本文整理汇总了PHP中clladp::AddDomainEntity方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::AddDomainEntity方法的具体用法?PHP clladp::AddDomainEntity怎么用?PHP clladp::AddDomainEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clladp
的用法示例。
在下文中一共展示了clladp::AddDomainEntity方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform
function perform()
{
$domain = $_POST["domain"];
$ou = $_POST["ou"];
$tpl = new templates();
$ldap = new clladp();
$hashdoms = $ldap->hash_get_all_domains();
writelogs("hashdoms[{$domain}]={$hashdoms[$domain]}", __FUNCTION__, __FILE__);
if ($hashdoms[$domain] != null) {
echo $tpl->_ENGINE_parse_body('{error_domain_exists} ->`' . $domain . "`");
return;
}
if (!$ldap->AddDomainEntity($ou, $domain)) {
echo $ldap->ldap_last_error;
return;
}
}
示例2: create_domain
function create_domain()
{
$ldap = new clladp();
$tpl = new templates();
$page = CurrentPageName();
$q = new mysql();
$sql = "SELECT * FROM register_orgs WHERE `zmd5`='{$_GET["key"]}'";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
$ou = $ligne["ou"];
if ($ligne["ou"] == null) {
echo $tpl->_ENGINE_parse_body("{please_register_first}");
return;
}
$domain = $ligne["domain"];
if (!$ldap->AddDomainEntity($ou, $domain)) {
$html = "\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td width=1%><img src='img/42-red.png'></td>\n\t\t\t<td valign='top' style='font-size:16px'>{domain}: {$domain} {failed} {$ldap->ldap_last_error}</td>\n\t\t</tr>\n\t\t</table>\n\t\t<div id='step-3'></div>\n\t\t<script>\n\t\t\tLoadAjax('step-3','{$page}?create-user=yes&key={$_GET["key"]}');\n\t\t</script>";
echo $tpl->_ENGINE_parse_body($html);
return;
}
$html = "\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td width=1%><img src='img/42-green.png'></td>\n\t\t\t<td valign='top' style='font-size:16px'>{domain}: {$domain} {success}</td>\n\t\t</tr>\n\t\t</table>\n\t\t<div id='step-3'></div>\n\t\t<script>\n\t\t\tLoadAjax('step-3','{$page}?create-user=yes&key={$_GET["key"]}');\n\t\t</script>\t\t\n\t\t\n\t\t\n\t\t";
echo $tpl->_ENGINE_parse_body($html);
return;
}
示例3: SaveSettings
function SaveSettings()
{
echo "<div><code>";
$ldap = new clladp();
$usersMenus = new usersMenus();
$ldap->AddOrganization($_COOKIE["company"]);
echo "</div></code>";
echo "<div><code>";
if (!$usersMenus->cyrus_imapd_installed) {
$ldap->AddRelayDomain($_COOKIE["company"], $_COOKIE["smtp_domain"], $_COOKIE["smtp_relay"], 25);
} else {
$ldap->AddDomainEntity($_COOKIE["company"], $_COOKIE["smtp_domain"]);
}
echo "</div></code>";
echo "<div><code>";
$users = new user($_COOKIE["username"]);
$users->mail = "{$_COOKIE["username"]}@{$_COOKIE["smtp_domain"]}";
$users->password = $_COOKIE["password"];
$users->ou = $_COOKIE["company"];
$users->add_user();
$users->add_alias("root");
$users->add_alias("mailflt3");
$users->add_alias("root@localhost.localdomain");
$users->add_alias("root@{$usersMenus->fqdn}");
$users->add_alias("postmaster@{$usersMenus->fqdn}");
$users->add_alias("postmaster@localhost.localdomain");
$users->add_alias("postmaster");
echo "</div></code>";
$sock = new sockets();
$sock->SET_INFO("PostmasterAdress", $users->mail);
$sock->SET_INFO("MasterSMTPDomainName", $_COOKIE["smtp_domain"]);
$sock->SET_INFO("SmtpWizardFinish", 1);
if ($usersMenus->AMAVIS_INSTALLED) {
echo "<div><code>";
include_once "ressources/class.amavis.inc";
$amavis = new amavis();
$amavis->Save();
$sock->SET_INFO("EnableAmavisDaemon", "1");
$sock->getFrameWork("cmd.php?artica-filter-reload=yes");
$amavis->SaveToServer();
echo "</div></code>";
}
if ($usersMenus->BIND9_INSTALLED) {
include_once "ressources/class.bind9.inc";
include_once "ressources/class.system.network.inc";
$net = new networking();
if (is_array($net->arrayNameServers)) {
$dns = implode("\n", $net->arrayNameServers);
$sock->SaveConfigFile($dns, "PostfixBind9DNSList");
$sock->SET_INFO('PostfixEnabledInBind9', 1);
}
}
echo "<div><code>";
$main = new main_cf();
$main->save_conf();
$main->save_conf_to_server();
echo "</div></code>";
}
示例4: USER_ADD
function USER_ADD()
{
$userid = $_REQUEST["new_userid"];
$password = $_REQUEST["password"];
$group_id = $_REQUEST["group_id"];
if (isset($_GET["encpass"])) {
$password = url_decode_special_tool($password);
}
$ou = $_REQUEST["ou"];
$tpl = new templates();
if (preg_match("#(.+?)@(.+)#", $_REQUEST["email"], $re)) {
$_REQUEST["user_domain"] = $re[2];
$_REQUEST["email"] = $re[1];
}
$email = $_REQUEST["email"] . "@" . $_REQUEST["user_domain"];
$email = strtolower($email);
$user = new usersMenus();
if ($user->EnableVirtualDomainsInMailBoxes == 1) {
writelogs("Adding change {$userid} to \"{$email}\" in group {$group_id}", __FUNCTION__, __FILE__, __LINE__);
$userid = $email;
}
if (is_numeric($group_id)) {
$gp = new groups($group_id);
writelogs("privileges: {$group_id} -> AsComplexPassword = \"{$gp->Privileges_array["AsComplexPassword"]}\"", __FUNCTION__, __FILE__, __LINE__);
if ($gp->Privileges_array["AsComplexPassword"] == "yes") {
$ldap = new clladp();
$hash = $ldap->OUDatas($ou);
$privs = $ldap->_ParsePrivieleges($hash["ArticaGroupPrivileges"], array(), true);
$policiespwd = unserialize(base64_decode($privs["PasswdPolicy"]));
if (is_array($policiespwd)) {
$priv = new privileges();
if (!$priv->PolicyPassword($password, $policiespwd)) {
return false;
}
}
} else {
writelogs("privileges: {$group_id} -> AsComplexPassword = \"No\" -> continue", __FUNCTION__, __FILE__, __LINE__);
}
}
$users = new user($userid);
if ($users->UserExists) {
echo $tpl->javascript_parse_text('ERROR: {account_already_exists}');
return false;
}
writelogs("Adding {$userid} in group {$group_id}", __FUNCTION__, __FILE__, __LINE__);
$email = $_REQUEST["email"] . "@" . $_REQUEST["user_domain"];
if ($ou == null) {
echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_ou}'));
exit;
}
if ($userid == null) {
echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_userid}'));
exit;
}
if ($password == null) {
echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_password}'));
exit;
}
if ($email == null) {
echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_email}'));
exit;
}
$ldap = new clladp();
if (!is_numeric($group_id)) {
writelogs("Groupid is not numeric", __FUNCTION__, __FILE__, __LINE__);
$default_dn_group = "cn=nogroup,ou={$ou},dc=organizations,{$ldap->suffix}";
if (!$ldap->ExistsDN($default_dn_group)) {
$ldap->AddGroup("nogroup", $ou);
}
$group_id = $ldap->GroupIDFromName($ou, "nogroup");
if (!is_numeric($group_id)) {
$group_id = 0;
}
}
$emT = explode('@', $email);
//Verify domains --------------------------------------------------------------- 2008 10 05,P3
$hash_domains_table = $ldap->hash_get_domains_ou($ou);
if (!isset($hash_domains_table[$_REQUEST["user_domain"]])) {
writelogs("{$userid} have no domains", __FUNCTION__, __FILE__, __LINE__);
writelogs("Create a new local domain by default", __FUNCTION__, __FILE__, __LINE__);
$ldap->AddDomainEntity($ou, $_REQUEST["user_domain"]);
}
//------------------------------------------------------------------------------
$domains = $ldap->domains_get_locals_domains($ou);
$dn = "cn={$userid},ou={$ou},dc=organizations,{$ldap->suffix}";
if ($ldap->ExistsDN($dn)) {
writelogs("{$userid} ({$dn}) already exists", __FUNCTION__, __FILE__, __LINE__);
echo $userid;
exit;
}
$users = new user($userid);
$users->mail = $email;
$users->accountGroup = $group_id;
$users->domainname = $_REQUEST["user_domain"];
if ($password != null) {
$users->password = $password;
}
$users->ou = $ou;
if ($domains[$_REQUEST["user_domain"]] == true) {
$upd = array();
//.........这里部分代码省略.........
示例5: add_domain_entity
function add_domain_entity()
{
$domain = $_GET["add_domain_entity"];
$ou = $_GET["entity_name"];
$ldap = new clladp();
$ldap->AddDomainEntity($ou, $domain);
echo List_entities(1);
}
示例6: TASK_ADD_DOMAIN
function TASK_ADD_DOMAIN($value)
{
$meta = new artica_meta(true);
events("{$value}:: get domain parameters from {$value}", __FUNCTION__, __FILE__, __LINE__);
$http = new httpget();
$datasToSend = base64_encode(serialize($meta->GLOBAL_ARRAY));
$body = $http->send("{$meta->ArticaMetaHostname}/lic.query.server.php", "post", array("DATAS" => $datasToSend, "GET_SMTP_DOM_PARAMS" => $value));
if (preg_match("#<RESULTS>(.+?)</RESULTS>#", $body, $re)) {
$array = unserialize(base64_decode($re[1]));
}
if (!is_array($array)) {
events("VALUE is not an array", __FUNCTION__, __FILE__, __LINE__);
return false;
}
$domain = $array["domain"];
$ou = $array["ou"];
$transport = $array["transport"];
events("{$value}:: Adding/editing domain {$domain} for {$ou} ({$transport})", __FUNCTION__, __FILE__, __LINE__);
$ldap = new clladp();
if ($transport == "LOCAL") {
if ($ldap->AddDomainEntity($ou, $domain)) {
$http = new httpget();
$body = $http->send("{$meta->ArticaMetaHostname}/lic.query.server.php", "post", array("DATAS" => $datasToSend, "UNLOCK_DOMAIN" => $value));
send_email_events("Domain [{$domain}] was successfully added", null, "CLOUD");
return true;
}
}
if ($transport == null) {
send_email_events("Domain [{$domain}] was failed to be added, transport type is null", null, "CLOUD");
events("{$value}:: Adding/editing domain {$domain} failed, no such transport", __FUNCTION__, __FILE__, __LINE__);
return true;
}
if (!preg_match("#\\[(.+?)\\]:([0-9]+)#", $transport, $re)) {
send_email_events("Domain [{$domain}] was failed to be added, \"{$transport}\" pattern is corrupted", null, "CLOUD");
return true;
}
if ($ldap->AddDomainTransport($ou, $domain, $re[1], $re[2])) {
$http = new httpget();
$body = $http->send("{$meta->ArticaMetaHostname}/lic.query.server.php", "post", array("DATAS" => $datasToSend, "UNLOCK_DOMAIN" => $value));
events("{$value}:: Adding/editing domain {$domain} ({$transport}) success", __FUNCTION__, __FILE__, __LINE__);
send_email_events("Domain [{$domain}] -> {$transport} was successfully added", null, "CLOUD");
return true;
} else {
events("{$value}:: Adding/editing domain {$domain} failed", __FUNCTION__, __FILE__, __LINE__);
return false;
}
}
示例7: AddNewInternetDomain
function AddNewInternetDomain()
{
$usr = new usersMenus();
$tpl = new templates();
if ($usr->AllowChangeDomains == false) {
echo $tpl->_ENGINE_parse_body('{no_privileges}');
exit;
}
$tpl = new templates();
$ou = $_GET["AddNewInternetDomain"];
$domain = trim(strtolower($_GET["AddNewInternetDomainDomainName"]));
$ldap = new clladp();
$sock = new sockets();
$InternetDomainsAsOnlySubdomains = $sock->GET_INFO("InternetDomainsAsOnlySubdomains");
if ($InternetDomainsAsOnlySubdomains == 1) {
if (!$usr->OverWriteRestrictedDomains) {
$domaintbl = explode(".", $domain);
$subdomain = $domaintbl[0];
unset($domaintbl[0]);
$domainsuffix = @implode(".", $domaintbl);
$sql = "SELECT domain FROM officials_domains WHERE domain='{$domainsuffix}'";
$q = new mysql();
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
if (!$q->ok) {
echo $q->mysql_error;
return;
}
if ($ligne["domain"] == null) {
echo $tpl->_ENGINE_parse_body("{please_choose_an_official_domain}");
return;
}
}
}
$hashdoms = $ldap->hash_get_all_domains();
writelogs("hashdoms[{$domain}]={$hashdoms[$domain]}", __FUNCTION__, __FILE__);
if ($hashdoms[$domain] != null) {
echo $tpl->_ENGINE_parse_body('{error_domain_exists}');
exit;
}
if (!$ldap->AddDomainEntity($ou, $domain)) {
echo $ldap->ldap_last_error;
return;
}
}
示例8: USER_ADD
function USER_ADD()
{
$userid = $_GET["new_userid"];
$password = $_GET["password"];
$group_id = $_GET["group_id"];
$tpl = new templates();
$email = $_GET["email"] . "@" . $_GET["user_domain"];
$user = new usersMenus();
if ($user->EnableVirtualDomainsInMailBoxes == 1) {
writelogs("Adding change {$userid} to \"{$email}\" in group {$group_id}", __FUNCTION__, __FILE__, __LINE__);
$userid = $email;
}
$users = new user($userid);
if ($users->UserExists) {
echo $tpl->javascript_parse_text('ERROR: {account_already_exists}');
return false;
}
writelogs("Adding {$userid} in group {$group_id}", __FUNCTION__, __FILE__, __LINE__);
$email = $_GET["email"] . "@" . $_GET["user_domain"];
$ou = $_GET["ou"];
if ($ou == null) {
echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_ou}'));
exit;
}
if ($userid == null) {
echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_userid}'));
exit;
}
if ($password == null) {
echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_password}'));
exit;
}
if ($email == null) {
echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_email}'));
exit;
}
$ldap = new clladp();
if ($group_id == null) {
$default_dn_group = "cn=nogroup,ou={$ou},dc=organizations,{$ldap->suffix}";
if (!$ldap->ExistsDN($default_dn_group)) {
$ldap->AddGroup("nogroup", $ou);
}
$group_id = $ldap->GroupIDFromName($ou, "nogroup");
if ($group_id == null) {
$group_id = 0;
}
}
$emT = explode('@', $email);
//Verify domains --------------------------------------------------------------- 2008 10 05,P3
$hash_domains_table = $ldap->hash_get_domains_ou($ou);
if ($hash_domains_table[$_GET["user_domain"]] == null) {
writelogs("{$userid} have no domains", __FUNCTION__, __FILE__, __LINE__);
writelogs("Create a new local domain by default", __FUNCTION__, __FILE__, __LINE__);
$ldap->AddDomainEntity($ou, $_GET["user_domain"]);
}
//------------------------------------------------------------------------------
$domains = $ldap->domains_get_locals_domains($ou);
$dn = "cn={$userid},ou={$ou},dc=organizations,{$ldap->suffix}";
if ($ldap->ExistsDN($dn)) {
writelogs("{$userid} ({$dn}) already exists", __FUNCTION__, __FILE__, __LINE__);
echo $userid;
exit;
}
$users = new user($userid);
$users->mail = $email;
$users->accountGroup = $group_id;
$users->domainname = $_GET["user_domain"];
if ($password != null) {
$users->password = $password;
}
$users->ou = $ou;
if ($domains[$_GET["user_domain"]] == true) {
writelogs("is a local domain {$_GET["user_domain"]}={$domains[$_GET["user_domain"]]}", __FUNCTION__, __FILE__, __LINE__);
$upd["ObjectClass"][] = 'ArticaSettings';
$users->MailboxActive = "TRUE";
}
if (!$users->add_user()) {
echo "ERROR:" . $users->ldap_error;
exit;
}
if ($group_id > 0) {
$ldap->AddUserToGroup($group_id, $users->uid);
}
echo $users->uid;
}
示例9: WizardExecute
//.........这里部分代码省略.........
}
if (isset($savedsettings["GoldKey"])) {
if (!$sock->IsGoldKey($savedsettings["GoldKey"])) {
unset($savedsettings["GoldKey"]);
}
}
if (isset($savedsettings["GoldKey"])) {
if ($sock->IsGoldKey($savedsettings["GoldKey"])) {
$WORKDIR = base64_decode("L3Vzci9sb2NhbC9zaGFyZS9hcnRpY2E=");
$WORKFILE = base64_decode('LmxpYw==');
$WORKPATH = "{$WORKDIR}/{$WORKFILE}";
@file_put_contents($WORKPATH, "TRUE");
$LicenseInfos = unserialize(base64_decode($sock->GET_INFO("LicenseInfos")));
$LicenseInfos["UUID"] = $savedsettings["UUID_FIRST"];
$LicenseInfos["TIME"] = time();
$sock->SaveConfigFile(base64_encode(serialize($LicenseInfos)), "LicenseInfos");
writeprogress(31, "{register_license}");
shell_exec("{$php5} /usr/share/artica-postfix/exec.web-community-filter.php --register >/dev/null 2>&1");
writeprogress(32, "{saving_license}");
shell_exec("{$php5} /usr/share/artica-postfix/exec.web-community-filter.php --register-lic >/dev/null 2>&1");
}
}
$ldap = new clladp();
writeprogress(40, "{building_organization} {$savedsettings["organization"]}");
if (!$ldap->AddOrganization($savedsettings["organization"])) {
debug_logs("Building organization failed {$ldap->ldap_last_error}");
sleep(2);
if (!$ldap->AddOrganization($savedsettings["organization"])) {
debug_logs("Building organization failed 2/2 {$ldap->ldap_last_error}");
}
}
sleep(2);
writeprogress(40, "{creating_domain} {$savedsettings["smtp_domainname"]}");
if (!$ldap->AddDomainEntity($savedsettings["organization"], $savedsettings["smtp_domainname"])) {
debug_logs("AddDomainEntity failed {$ldap->ldap_last_error}");
}
sleep(2);
$timezone = $savedsettings["timezones"];
$sourcefile = "/usr/share/zoneinfo/{$timezone}";
if (is_file($sourcefile)) {
writeprogress(60, "{timezone} {$timezone}");
@unlink("/etc/localtime");
@copy($sourcefile, "/etc/localtime");
@file_put_contents("/etc/timezone", $timezone);
} else {
writeprogress(60, "{$sourcefile} no such file");
}
sleep(2);
BUILD_NETWORK();
shell_exec("{$nohup} /etc/init.d/artica-status restart >/dev/null 2>&1 &");
shell_exec("{$nohup} /etc/init.d/monit restart >/dev/null 2>&1 &");
$unix->THREAD_COMMAND_SET("{$php5} /usr/share/artica-postfix/exec.postfix.maincf.php --reconfigure");
$unix->THREAD_COMMAND_SET("/usr/share/artica-postfix/bin/artica-install --reconfigure-cyrus");
$FreeWebAdded = false;
sleep(3);
if (!is_file("/etc/artica-postfix/WIZARD_INSTALL_EXECUTED")) {
if (!$GLOBALS["NOREBOOT"]) {
$reboot = true;
}
$rebootWarn = null;
}
if (is_file($squidbin)) {
include_once dirname(__FILE__) . "/ressources/class.squid.inc";
if ($SQUIDEnable == 1) {
$squid = new squidbee();
if ($AsTransparentProxy == 1) {
示例10: AddNewInternetDomain
function AddNewInternetDomain()
{
$usr = new usersMenus();
$tpl = new templates();
if ($usr->AllowChangeDomains == false) {
echo $tpl->_ENGINE_parse_body('{no_privileges}');
exit;
}
$tpl = new templates();
$ou = $_GET["AddNewInternetDomain"];
$domain = trim($_GET["AddNewInternetDomainDomainName"]);
$ldap = new clladp();
$hashdoms = $ldap->hash_get_all_domains();
writelogs("hashdoms[{$domain}]={$hashdoms[$domain]}", __FUNCTION__, __FILE__);
if ($hashdoms[$domain] != null) {
echo $tpl->_ENGINE_parse_body('{error_domain_exists}');
exit;
}
$ldap->AddDomainEntity($ou, $domain);
if ($ldap->ldap_last_error != null) {
echo $ldap->ldap_last_error;
} else {
$sock = new sockets();
if ($usr->cyrus_imapd_installed) {
$sock->getFrameWork("cmd.php?cyrus-check-cyr-accounts=yes");
}
$sock->getFrameWork("cmd.php?postfix-transport-maps=yes");
}
}
示例11: CreateDomain
function CreateDomain()
{
$tpl = new templates();
$ldap = new clladp();
$ou = $_GET["ou"];
$domain = $_GET["domain"];
if ($_GET["domain_ip"] != null) {
CreateDomainIP();
return null;
}
$ldap->AddDomainEntity($ou, $domain);
if ($ldap->ldap_last_error != null) {
echo $ldap->ldap_last_error;
} else {
echo $tpl->_ENGINE_parse_body($domain . ' {added}');
}
$main = new main_cf();
$main->main_array["myorigin"] = $domain;
$main->save_conf();
}
示例12: finish
function finish()
{
include_once 'ressources/class.artica.inc';
$company_name = $_GET["company_name"];
$domain_name = $_GET["domain_name"];
$relay_behavior = $_GET["relay"];
$relay_infos = $_GET["relay_infos"];
$artica = new artica_general();
$artica->RelayType = $relay_behavior;
$artica->Save();
$ldap = new clladp();
$ldap->AddOrganization($company_name);
if ($relay_behavior == "single") {
if ($relay_infos == null) {
$relay_infos = "127.0.0.1";
}
$ldap->AddDomainTransport($company_name, $domain_name, $relay_infos, '25', 'smtp');
} else {
$ldap->AddDomainEntity($company_name, $domain_name);
}
$html = "<div style='padding:5px;margin:5px'>\n\t\t<H2>{finish}</H2>\n\t<table>\n\t<tr>\n\t<td><img src='img/150-org.jpg'></td>\n\t<td valign='top'>\t\n\t<table>\n\t<tr>\n\t\t<td width=60% class='caption' nowrap align='right'><strong>{all_settings_saved}:</strong></td >\n\t\t\n\t</tr>\t\n\t</table>\n\t</div>";
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($html);
}