this-> InsertDomain

(Caronte Pcode version 2.0)

Description

int this-> InsertDomain (string domain);

Insert a domain with the default variables loaded from the local_domain_add_config.cstemplate , that is in the db folder.

Example.

Source:

CS_ADMIN_SCRIPT this = new CS_ADMIN_SCRIPT($_this);

int Main(CAdminRequest pRequest, CAdminResponse pResponse)
{

if (this->InsertDomain(domain) == -1)
{
return 0;
}
CDomainConf pconfdomain = this->GetDomain(domain);
if (!(property & LD_ED_MAR_SUBJECT || property & LD_ED_MAR_HEADER || property & LD_ED_MAR_REJECT))
property += LD_ED_MAR_SUBJECT;

pconfdomain->WaitForSession();
pconfdomain->StartSession();
pconfdomain->SetVar("proprieta",this->Format("%d",property));
pconfdomain->SetVar("repwd",md5password);
pconfdomain->SetVar("perc_user_aggre",this->Format("%f",perc_user_aggre));
pconfdomain->Save();
pconfdomain->EndSession();

if (fields->GetI("c5") == 1)
this->SaveDomains();


}

return 0;

}