当前位置: 首页>>代码示例>>PHP>>正文


PHP clladp::OUDatas方法代码示例

本文整理汇总了PHP中clladp::OUDatas方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::OUDatas方法的具体用法?PHP clladp::OUDatas怎么用?PHP clladp::OUDatas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在clladp的用法示例。


在下文中一共展示了clladp::OUDatas方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: INDEX

function INDEX()
{
    $ldap = new clladp();
    $ou = $_GET["ou"];
    $Hash_datas = $ldap->OUDatas($ou);
    $h_type = array("spam" => "spam", "ham" => "ham");
    $domains1 = $ldap->hash_get_domains_ou($ou);
    $domainsF1 = Field_array_Hash($domains1, 'bogo_spam_domain', null, null, null, 0, 'width:150px');
    $type = Field_array_Hash($h_type, 'bogo_type', null, null, null, 0, 'width:100px');
    $hash_action = array("delete" => "{bogo_delete}", "quarantine" => "{bogo_quarantine}", "prepend" => "{bogo_prepend}");
    $form_email = "\n\t<input type='hidden' id='ou' value='{$ou}'>\n\t<H5>{bogo_robots}</H5>\n\t<table style='width:100%'>\n\t<tr>\n\t<td align='right' nowrap><strong>{add_bogo_spam}:</strong></td>\n\t<td>" . Field_text('bogo_spam') . "</td>\n\t<td>{$domainsF1}</td>\n\t<td>{$type}</td>\n\t<td><input type='button' value='{add}&nbsp;&raquo;' OnClick=\"javascript:bogoAddSpamUser();\"></td>\n\t</tr>\n\t</table>\n\t\n\t";
    for ($i = 1; $i < 10; $i++) {
        $h_level[$i . '0'] = $i . '0 %';
    }
    $actions_datas = explode(';', $Hash_datas["BogoFilterAction"]);
    $action = "\n\t<H5>{spam_action}</H5>\n\t{spam_action_text} " . Field_array_Hash($h_level, 'exceed', $actions_datas[0], null, null, 0, 'width:60px') . " {then} " . Field_array_Hash($hash_action, 'action', $actions_datas[1], null, null, 0, 'width:160px') . "<br><br>\n\t{if_bogo_prepend} " . Field_text('bogo_prepend', $actions_datas[2], 'width:150px') . "\n\t<div style='width:100%;text-align:right'><input type='button' value='{edit}&nbsp;&raquo;&raquo;' OnClick=\"javascript:BogoFilterAction();\"></div>\n\t\n\t";
    $area_robots = "<div id='robots'></div><script>LoadAjax('robots','{$page}?GetRobots={$ou}')</script>";
    $area_robots = RoundedLightGrey($area_robots);
    $action = RoundedLightGrey($action);
    $form_email = RoundedLightGrey($form_email);
    $page = CurrentPageName();
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/bg_bogofilter.jpg'></td>\n\t<td valign='top' width=99%>" . RoundedLightGreen("{bogo_intro}") . "</td>\n\t</tr>\n\t</table>\n\t{$form_email}\n\t<br>\n\t{$action}\n\t<br>\n\t{$area_robots}\n\t";
    $cfg["JS"][] = "js/bogofilter.js";
    $tpl = new template_users('{APP_BOGOFILTER}', $html, 0, 0, 0, 0, $cfg);
    echo $tpl->web_page;
}
开发者ID:brucewu16899,项目名称:artica,代码行数:26,代码来源:bogofilter.ou.php

示例2: popup

function popup()
{
    $ldap = new clladp();
    $info = $ldap->OUDatas($_GET["ou"]);
    $zarafaEnabled = 1;
    if (!$info["objectClass"]["zarafa-company"]) {
        $zarafaEnabled = 0;
    }
    $enable = Paragraphe_switch_img("{ENABLE_ZARAFA_COMPANY}", "{ENABLE_ZARAFA_COMPANY_TEXT}", "zarafaEnabled", $zarafaEnabled);
    $html = "\n\t{$enable}\n\t<hr>\n\t\t<div style='text-align:right'>" . button("{apply}", "ENABLE_ZARAFA_COMPANY()") . "</div>\n\t\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:brucewu16899,项目名称:artica,代码行数:13,代码来源:domains.edit.zarafa.php

示例3: INDEX

function INDEX()
{
    $ldap = new clladp();
    $page = CurrentPageName();
    $hash = $ldap->OUDatas($_GET["ou"]);
    $hashD[1] = "1 {day}";
    for ($i = 2; $i < 91; $i++) {
        $hashD[$i] = "{$i} {days}";
    }
    $ArticaMaxDayQuarantine = Field_array_Hash($hashD, 'ArticaMaxDayQuarantine', $hash["ArticaMaxDayQuarantine"]);
    $html = "\n\t\t<input type='hidden' name='close_form' id='close_form' value='{close_form}'>\n\t<form name='FFMQ'>\n\n\t<input type='hidden' name='ou' id='ou' value='{$_GET["ou"]}'>\n\t" . RoundedLightGrey("<H5>{quarantine_max_day}</H5>\n\t<table style='width:100%'>\n\t<tr>\n\t<td align='left' class=caption>{quarantine_max_day_text}</td>\n\t<td>{$ArticaMaxDayQuarantine}</td>\n\t</tr>\n\t<tr>\n\t<td colspan=2 align='right'><input type='button' value='{edit}&nbsp;&raquo;' OnClick=\"javascript:ParseForm('FFMQ','{$page}',true);\"></td>\n\t</table>") . "\n\t</form><br>\n\t<div id=\"ButtonCloseIframe\" style='text-align:right'></div>\n\t<iframe id='template_forms' scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\" vspace=\"0\" hspace=\"0\" style=\"overflow:visible; width:100%; display:none\">\n\t</iframe>" . TemplatesForms();
    $cfg["JS"][] = "js/quarantine.ou.js";
    $tpl = new template_users('{global_quarantine_rules}', $html, 0, 0, 0, 0, $cfg);
    echo $tpl->web_page;
}
开发者ID:brucewu16899,项目名称:artica,代码行数:15,代码来源:quarantine.ou.php

示例4: popup

function popup()
{
    $page = CurrentPageName();
    $ldap = new clladp();
    $sock = new sockets();
    $info = $ldap->OUDatas($_GET["ou"]);
    $zarafaEnabled = 1;
    if (!$info["objectClass"]["zarafa-company"]) {
        $zarafaEnabled = 0;
    }
    $ZarafaUserSafeMode = $sock->GET_INFO("ZarafaUserSafeMode");
    $languages = unserialize(base64_decode($sock->getFrameWork("zarafa.php?locales=yes")));
    $langbox[null] = "{select}";
    while (list($index, $data) = each($languages)) {
        $langbox[$data] = $data;
    }
    $t = $_GET["t"];
    if (!is_numeric($t)) {
        $t = time();
    }
    $oumd5 = md5(strtolower(trim($_GET["ou"])));
    $OuDefaultLang = $sock->GET_INFO("zarafaMBXLang{$oumd5}");
    $OuZarafaDeleteADM = $sock->GET_INFO("OuZarafaDeleteADM{$oumd5}");
    $filter = "(&(objectClass=zarafa-user)(zarafaAdmin=1))";
    $attrs = array("displayName", "uid", "mail");
    $dn = "ou={$_GET["ou"]},dc=organizations,{$ldap->suffix}";
    $hash = $ldap->Ldap_search($dn, $filter, $attrs);
    $number = $hash["count"];
    $arruid[null] = "{select}";
    for ($i = 0; $i < $number; $i++) {
        $userZ = $hash[$i];
        $uid = $userZ["uid"][0];
        $arruid[$uid] = $uid;
    }
    $admin_delete = Field_array_Hash($arruid, "OuZarafaDeleteADM{$t}", $OuZarafaDeleteADM, "style:font-size:16px;padding:3px");
    $mailbox_language = Field_array_Hash($langbox, "zarafaMbxLang{$t}", $OuDefaultLang, "style:font-size:16px;padding:3px");
    if ($OuDefaultLang != null) {
        $rescan = "<div style='width:100%;margin:10px'><center>" . button("{scan_mailboxes_language}", "zarafaDScanMBXLang{$t}()", "16") . "</center></div>";
    }
    if ($ZarafaUserSafeMode == 1) {
        $warn = "\n\t\t\t<hr>\n\t\t\t<table style='width:99 %' class=form>\n\t\t\t<tr>\n\t\t\t<td valign='top'><img src='img/error-64.png'></td>\n\t\t\t<td valign='top'><strong style='font-size:14px'>{ZARAFA_SAFEMODE_EXPLAIN}</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t\n\t\t\t";
    }
    $enable = Paragraphe_switch_img("{ENABLE_ZARAFA_COMPANY}", "{ENABLE_ZARAFA_COMPANY_TEXT}", "zarafaEnabled", $zarafaEnabled, null, 400);
    $html = "\n\t<div id='{$t}-anim'></div>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td colspan=2>{$enable}</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{default_language}:</td>\n\t\t<td>{$mailbox_language}</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{delete_store_receiver}:</td>\n\t\t<td>{$admin_delete}</td>\n\t</tr>\t\n\t<tr>\n\t<td colspan=2 align='right'>\n\t<hr>" . button("{apply}", "ENABLE_ZARAFA_COMPANY()", 16) . "{$warn}</td>\n\t</tr>\n\t</table>\n\t{$rescan}\n\t</div>\n\t<script>\nvar X_ENABLE_ZARAFA_COMPANY= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\tdocument.getElementById('{$t}-anim').innerHTML='';\n\t\$('#table-{$t}').flexReload();\n\tif(document.getElementById('organization-find')){SearchOrgs();YahooWin3Hide();return;}\n\tZARAFA_OU_LOAD();\n\t\n\t}\t\n\t\nfunction ENABLE_ZARAFA_COMPANY(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('zarafaEnabled',document.getElementById('zarafaEnabled').value);\n\tXHR.appendData('zarafaMbxLang',document.getElementById('zarafaMbxLang{$t}').value);\n\tXHR.appendData('OuZarafaDeleteADM',document.getElementById('OuZarafaDeleteADM{$t}').value);\n\tXHR.appendData('ou','{$_GET["ou"]}');\n\tAnimateDiv('{$t}-anim');\n\tXHR.sendAndLoad('{$page}', 'GET',X_ENABLE_ZARAFA_COMPANY);\t\n}\n\n\nfunction zarafaDScanMBXLang{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('zarafaScanMbxLang','yes');\n\tXHR.appendData('ou','{$_GET["ou"]}');\n\tAnimateDiv('{$t}-anim');\n\tXHR.sendAndLoad('{$page}', 'POST',X_ENABLE_ZARAFA_COMPANY);\t\n}\n\n</script>\t\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:47,代码来源:domains.edit.zarafa.php

示例5: INDEX

function INDEX()
{
    if (!isset($_GET["ou"])) {
        header('location:domains.index.php');
        exit;
    }
    $page = CurrentPageName();
    $ou = $_GET["ou"];
    $ldap = new clladp();
    $hash = $ldap->OUDatas($ou);
    $ArticaFakedMailFrom_table = array("pass" => '{pass}', "quarantine" => "{quarantine}", "delete" => "{delete}");
    $ArticaFakedMailFrom_field = Field_array_Hash($ArticaFakedMailFrom_table, "ArticaFakedMailFrom", $hash["ArticaFakedMailFrom"], null, null, null, 'width:100px');
    $ArticaDenyNoMXRecords_table = array('pass' => '{pass}', "reject" => "{reject}");
    $ArticaDenyNoMXRecords_field = Field_array_Hash($ArticaDenyNoMXRecords_table, "ArticaDenyNoMXRecords", $hash["ArticaDenyNoMXRecords"], null, null, null, 'width:100px');
    $ArticaOuTrustMyUSers_field = Field_yesno_checkbox_img('OuTrustMyUSers', $hash["OuTrustMyUSers"], '{enable_disable}');
    $ArticaOuTrustMyUSers = "<H5>{trust_users}</H5>\n\t<div class=caption>{trust_users_text}</div>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td align='right' valign='top' nowrap><strong>{trust_users}</strong></td>\n\t\t<td align='left' valign='top'>{$ArticaOuTrustMyUSers_field}</td>\n\t\t\n\t</tr>\t\n\t</table>\n\t\n\t";
    $ArticaOuTrustMyUSers = RoundedLightGreen($ArticaOuTrustMyUSers);
    $html = "\n\t<form name='FFMQ'>\n\t<table style='width:100%;'>\n\t<tr>\n\t\t<td width=50% valign='top' style='margin:4px;padding:4px'>\n\t<input type='hidden' name='ou' value='{$ou}'>\n\t" . RoundedLightGrey("<H5>{ArticaFakedMailFrom}</H5>\n\t<div class=caption>{ArticaFakedMailFrom_text}</div>\n\t<table style='width:90%;border:1px solid #CCCCCC;padding:5px;margin:5px'>\n\t<tr>\n\t\t<td align='right' valign='top' nowrap><strong>{ArticaFakedMailFrom}</strong></td>\n\t\t<td align='left' valign='top'>{$ArticaFakedMailFrom_field}</td>\n\t\t\n\t</tr>\n\t</table>") . "</td>\n\t\n\t\n\t<td width=50% valign='top' style='margin:4px;padding:4px'>" . RoundedLightGrey("\n\t<H5>{ArticaDenyNoMXRecords}</H5>\n\t<div class=caption>{ArticaDenyNoMXRecords_text}</div>\n\t<table style='width:90%;border:1px solid #CCCCCC;padding:5px;margin:5px'>\n\t<tr>\n\t\t<td align='right' valign='top' nowrap><strong>{ArticaDenyNoMXRecords}</strong></td>\n\t\t<td align='left' valign='top'>{$ArticaDenyNoMXRecords_field}</td>\n\t\t\n\t</tr>\t\n\t</table>\n\t") . "\n\t<br>\n\t{$ArticaOuTrustMyUSers}\n\t</td>\n\t</tr>\n\t<tr>\n\t<td colspan=2 align='right' style='border-top:1px solid #CCCCCC'><input type='submit' value='{apply}&nbsp;&raquo;' style='width:150px'></td>\n\t</tr>\n\t</table>\n\t</form>";
    $cfg["JS"][] = "js/quarantine.ou.js";
    $tpl = new template_users('{artica_filters_rules}', $html, 0, 0, 0, 0, $cfg);
    echo $tpl->web_page;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:22,代码来源:global-filters.ou.php

示例6: OUSettings

function OUSettings()
{
    $ldap = new clladp();
    $ou = $_GET["ou"];
    $hash = $ldap->OUDatas($ou);
    $users = new usersMenus();
    $privs = $users->_ParsePrivieleges($hash["ArticaGroupPrivileges"]);
    $privs["ForceLanguageUsers"] = $_GET["OUlanguage"];
    $conf = $users->_BuildPrivileges($privs);
    $dn = "ou={$ou},dc=organizations,{$ldap->suffix}";
    $upd["ArticaGroupPrivileges"][0] = $conf;
    if (!$ldap->Ldap_modify($dn, $upd)) {
        echo $ldap->ldap_last_error;
    }
}
开发者ID:brucewu16899,项目名称:artica,代码行数:15,代码来源:domains.organization-settings.php

示例7: quarantine_ou_settings

function quarantine_ou_settings()
{
    $ou = $_GET["ou"];
    $ouU = strtoupper($ou);
    $ldap = new clladp();
    $hash = $ldap->OUDatas($ou);
    $sock = new sockets();
    $users = new usersMenus();
    $ini = new Bs_IniHandler();
    $ini->loadString($sock->GET_INFO("OuSendQuarantineReports{$ouU}"));
    if ($ini->_params["NEXT"]["hour"] == null) {
        $ini->_params["NEXT"]["hour"] = "23";
    }
    if ($ini->_params["NEXT"]["Min"] == null) {
        $ini->_params["NEXT"]["Min"] = "59";
    }
    if ($ini->_params["NEXT"]["Enabled"] == null) {
        $ini->_params["NEXT"]["Enabled"] = "0";
    }
    if ($ini->_params["NEXT"]["days"] == null) {
        $ini->_params["NEXT"]["days"] = "2";
    }
    if ($ini->_params["NEXT"]["mailfrom"] == null) {
        $ini->_params["NEXT"]["mailfrom"] = "reports@{$users->hostname}";
    }
    if ($ini->_params["NEXT"]["subject"] == null) {
        $ini->_params["NEXT"]["subject"] = "Daily Quarantine report";
    }
    if ($ini->_params["NEXT"]["title1"] == null) {
        $ini->_params["NEXT"]["title1"] = "Quarantine domain senders";
    }
    if ($ini->_params["NEXT"]["title2"] == null) {
        $ini->_params["NEXT"]["title2"] = "Quarantine list";
    }
    if ($ini->_params["NEXT"]["explain"] == null) {
        $ini->_params["NEXT"]["explain"] = "You will find here all mails stored in your quarantine area";
    }
    if ($ini->_params["NEXT"]["externalLink"] == null) {
        $ini->_params["NEXT"]["externalLink"] = "https://{$_SERVER["SERVER_NAME"]}/user.quarantine.query.php";
    }
    $OuSendQuarantineReports = $ini->_params["NEXT"]["Enabled"];
    for ($i = 0; $i < 60; $i++) {
        $text = $i;
        if ($i < 10) {
            $text = "0{$i}";
        }
        $M[$i] = $text;
    }
    for ($i = 0; $i < 24; $i++) {
        $text = $i;
        if ($i < 10) {
            $text = "0{$i}";
        }
        $H[$i] = $text;
    }
    for ($i = 0; $i < 30; $i++) {
        $text = $i;
        if ($i < 10) {
            $text = "{$i}";
        }
        $D[$i] = $text;
    }
    $minutes = Field_array_Hash($M, "Min", $ini->_params["NEXT"]["Min"]);
    $hours = Field_array_Hash($H, "hour", $ini->_params["NEXT"]["hour"]);
    $report = Field_array_Hash($D, "days", $ini->_params["NEXT"]["days"]);
    $time = "\n\t\n\t<table style='width:9%;margin-top:0px;' class=form>\n\t<tr>\n\t<td class=caption nowrap>{timetosendreport}:</td>\n\t<td>{$hours}</td>\n\t<td><strong>:</strong>\n\t<td>{$minutes}</td>\n\t</tr>\n\t</table>\n\t<br>\n\t<table style='width:99%;margin-top:0px;' class=form>\n\t<tr>\n\t\t<td class=legend nowrap>{build_report_for}:</td>\n\t\t<td>{$report}&nbsp;{days}</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{externalLink}:</td>\n\t\t<td>" . Field_text('externalLink', $ini->_params["NEXT"]["externalLink"], "width:250px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{sender}:</td>\n\t\t<td>" . Field_text('mailfrom', $ini->_params["NEXT"]["mailfrom"], "width:200px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{subject}:</td>\n\t\t<td>" . Field_text('subject', $ini->_params["NEXT"]["subject"], "width:250px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{explain}:</td>\n\t\t<td>" . Field_text('explain', $ini->_params["NEXT"]["explain"], "width:250px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>title 1:</td>\n\t\t<td>" . Field_text('title1', $ini->_params["NEXT"]["title1"], "width:250px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>title 2:</td>\n\t\t<td>" . Field_text('title2', $ini->_params["NEXT"]["title2"], "width:250px") . "</td>\n\t</tr>\t\t\t\t\t\t\t\n\t</table>\n\t<div style='margin:0px;width:100%;text-align:right;border-top:1px solid #CCCCCC'><input type='button' OnClick=\"javascript:QuarantineMailSettingsSave();\" value='{apply}&nbsp;&raquo;'></div>\n\t";
    $field = Paragraphe_switch_img('{enable_html_reports}', '{ou_quarantine_reports_explain}', "OuSendQuarantineReports", $OuSendQuarantineReports);
    $tpl = new templates();
    $html = "\n\t<H1>{quarantine_reports}</H1>\n\t<div id='quarantine_ou_settings'>\n\t<p class=caption>{quarantine_reports_text}</p>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' align='center'>\n\t\t{$field}\n\t\t<br>{$quarantine_robot}\n\t</td>\n\t<td valign='top'>\n\t{$time}\n\t\n\t</td>\n\t</tr>\n\t</table>\n\t</div>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:71,代码来源:domains.backup.php

示例8: EditGroup

function EditGroup()
{
    $gid = $_GET["PrivilegesGroup"];
    $ldap = new clladp();
    $update_array = array();
    writelogs("Save privileges for {$gid}", __CLASS__, __FUNCTION__, __FILE__, __LINE__);
    $loadGPID = true;
    if ($gid == -1) {
        $loadGPID = false;
        $Hash = $ldap->OUDatas($_GET["ou"]);
        writelogs("Loading ou datas of \"{$_GET["ou"]}\" ArticaGroupPrivileges=" . strlen($Hash["ArticaGroupPrivileges"]) . " bytes", __FUNCTION__, __FILE__, __LINE__);
        $dn = $Hash["dn"];
    }
    if ($gid == -2) {
        $loadGPID = false;
        $user = new user($_GET["userid"]);
        $Hash["ArticaGroupPrivileges"] = $user->ArticaGroupPrivileges;
        writelogs("Loading datas of \"{$_GET["userid"]}\" ArticaGroupPrivileges={$user->ArticaGroupPrivileges} bytes", __FUNCTION__, __FILE__, __LINE__);
    }
    if ($gid > 0) {
        writelogs("Loading datas of ldap->GroupDatas(\"{$_GET["{$gid}"]}\") ", __FUNCTION__, __FILE__, __LINE__);
        $Hash = $ldap->GroupDatas($gid);
    }
    if (!is_array($Hash["ArticaGroupPrivileges"])) {
        writelogs("ldap->_ParsePrivieleges(...)", __FUNCTION__, __FILE__, __LINE__);
        $ArticaGroupPrivileges = $ldap->_ParsePrivieleges($Hash["ArticaGroupPrivileges"]);
    } else {
        $ArticaGroupPrivileges = $Hash["ArticaGroupPrivileges"];
    }
    if (!is_array($ArticaGroupPrivileges)) {
        writelogs("ArticaGroupPrivileges[] is not an array !", __FUNCTION__, __FILE__, __LINE__);
    }
    if (is_array($ArticaGroupPrivileges)) {
        while (list($num, $val) = each($ArticaGroupPrivileges)) {
            $GroupPrivilege[$num] = $val;
        }
    }
    while (list($num, $val) = each($_GET)) {
        writelogs("ADD GroupPrivilege[{$num}]={$val}", __FUNCTION__, __FILE__, __LINE__);
        $GroupPrivilege[$num] = $val;
    }
    while (list($num, $val) = each($GroupPrivilege)) {
        if ($val == "no") {
            writelogs("[{$num}]=SKIP", __FUNCTION__, __FILE__, __LINE__);
            continue;
        }
        writelogs("[{$num}]=\"{$val}\"", __FUNCTION__, __FILE__, __LINE__);
        $GroupPrivilegeNew[] = "[{$num}]=\"{$val}\"";
    }
    $values = @implode($GroupPrivilegeNew, "\n");
    if ($gid == -2) {
        writelogs("ArticaGroupPrivileges -> {$gid} -> user->SavePrivileges() values={$values}", __FUNCTION__, __FILE__, __LINE__);
        $user->SavePrivileges($values);
        return;
    }
    if (strpos($gid, ",") > 0) {
        $gp = new external_ad_search();
        $gp->SaveGroupPrivileges($values, $gid);
        return;
    }
    $update_array["ArticaGroupPrivileges"][0] = $values;
    writelogs("ArticaGroupPrivileges ->  {$Hash["dn"]} -> group->SavePrivileges() values={$values}", __FUNCTION__, __FILE__, __LINE__);
    if (!$ldap->Ldap_modify($Hash["dn"], $update_array)) {
        echo basename(__FILE__) . "\nline: " . __LINE__ . "\n" . $ldap->ldap_last_error;
    }
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:66,代码来源:domains.edit.group.php

示例9: create_user

function create_user($filename)
{
    $tpl = new templates();
    $unix = new unix();
    $nohup = null;
    $path = "/usr/share/artica-postfix/ressources/logs/web/create-users/{$filename}";
    echo "Path:{$path}\n";
    build_progress("Open {$filename}", 10);
    if (!is_file($path)) {
        echo "{$path} no such file...\n";
        return false;
    }
    $MAIN = unserialize(base64_decode(@file_get_contents($path)));
    build_progress("Create new member {$MAIN["login"]}", 15);
    $users = new user($MAIN["login"]);
    if ($users->password != null) {
        echo "User already exists {$MAIN["login"]}\n";
        build_progress("{account_already_exists}", 110);
        @unlink($path);
        return;
    }
    $ou = $MAIN["ou"];
    $password = url_decode_special_tool($MAIN["password"]);
    $MAIN["firstname"] = url_decode_special_tool($MAIN["firstname"]);
    $MAIN["lastname"] = url_decode_special_tool($MAIN["lastname"]);
    build_progress("{$MAIN["firstname"]} {$MAIN["lastname"]}", 20);
    if (trim($MAIN["internet_domain"]) == null) {
        $MAIN["internet_domain"] = "localhost.localdomain";
    }
    echo "Add new user {$MAIN["login"]} {$MAIN["ou"]} {$MAIN["gpid"]}\n";
    $users->ou = $MAIN["ou"];
    $users->password = url_decode_special_tool($MAIN["password"]);
    $users->mail = "{$MAIN["email"]}@{$MAIN["internet_domain"]}";
    $users->DisplayName = "{$MAIN["firstname"]} {$MAIN["lastname"]}";
    $users->givenName = $MAIN["firstname"];
    $users->sn = $MAIN["lastname"];
    $users->group_id = $MAIN["gpid"];
    $users->homeDirectory = "/home/{$MAIN["login"]}";
    if (is_numeric($MAIN["gpid"])) {
        $gp = new groups($MAIN["gpid"]);
        echo "privileges: {$MAIN["gpid"]} -> AsComplexPassword = \"{$gp->Privileges_array["AsComplexPassword"]}\"\n";
        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)) {
                    build_progress("Need complex password", 110);
                    echo "Need complex password";
                    @unlink($path);
                    return;
                }
            }
        }
    }
    build_progress("{$MAIN["firstname"]} {$MAIN["lastname"]} {save}", 25);
    if (!$users->add_user()) {
        echo $users->error . "\n" . $users->ldap_error;
        build_progress("{failed}", 110);
        @unlink($path);
        return;
    }
    @mkdir("{$users->homeDirectory}");
    @chown("{$users->homeDirectory}", $users->uid);
    if ($MAIN["ByZarafa"] == "yes") {
        $terminated = " >/dev/null";
        $zarafa_admin = $unix->find_program("zarafa-admin");
        if (!$GLOBALS["WAIT"]) {
            $nohup = $unix->find_program("nohup");
            $terminated = null;
        }
        if (isset($MAIN["ZARAFA_LANG"])) {
            $users->SaveZarafaMbxLang($MAIN["ZARAFA_LANG"]);
            $langcmd = " --lang {$MAIN["ZARAFA_LANG"]} ";
        }
        $ldap = new clladp();
        $dn = "ou={$MAIN["ou"]},dc=organizations,{$ldap->suffix}";
        $upd["objectClass"] = "zarafa-company";
        $upd["cn"] = $MAIN["ou"];
        if (!$ldap->Ldap_add_mod("{$dn}", $upd)) {
            echo $ldap->ldap_last_error;
            build_progress("{failed} OpenLDAP Error", 110);
            @unlink($path);
            return;
        }
        build_progress("{create_store} {language}: {$MAIN["ZARAFA_LANG"]}", 30);
        $cmd = "{$nohup} {$zarafa_admin} {$langcmd}--create-store {$MAIN["login"]} >/dev/null 2>&1 &";
        system(trim($cmd));
        if (!$GLOBALS["WAIT"]) {
            $sock = new sockets();
            $sock->getFrameWork("cmd.php?zarafa-hash=yes&rebuild=yes");
            return;
        }
        @unlink("/usr/share/artica-postfix/ressources/databases/ZARAFA_DB_STATUS.db");
        @unlink("/etc/artica-postfix/zarafa-export.db");
        $cmd = LOCATE_PHP5_BIN2() . " /usr/share/artica-postfix/exec.zarafa.build.stores.php --export-hash";
        build_progress("{export_stores_data}", 35);
        echo "{$cmd}\n";
//.........这里部分代码省略.........
开发者ID:articatech,项目名称:artica,代码行数:101,代码来源:exec.create-user.php

示例10: 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();
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:domains.edit.user.php

示例11: RblDelete

function RblDelete()
{
    $ldap = new clladp();
    $ou = $_GET["ou"];
    $hash = $ldap->OUDatas($ou);
    $upd["SURBLServers"] = $hash["SURBLServers"][$_GET["SURBLServers"]];
    $dn = "ou={$ou},dc=organizations,{$ldap->suffix}";
    if (!$ldap->Ldap_del_mod($dn, $upd)) {
        echo $ldap->ldap_last_error;
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:11,代码来源:global-countries-surbl.ou.php

示例12: ORGANISATIONS_LIST


//.........这里部分代码省略.........
    }
    while (list($num, $ligne) = each($hash)) {
        $ou = $ligne;
        $ou_encoded = base64_encode($ou);
        if (!preg_match("#{$search}#i", $ligne)) {
            writelogs("'{$ligne}' NO MATCH {$search}", __FUNCTION__, __FILE__, __LINE__);
            continue;
        }
        $md = md5(serialize($hash) . time());
        $md5S = $md;
        $uri = "javascript:Loadjs('domains.manage.org.index.php?js=yes&ou={$ligne}');";
        if ($ajax) {
            $uri = "javascript:Loadjs('{$Mypage}?LoadOrgPopup={$ligne}');";
        }
        $IsOUUnderActiveDirectory = $ldap2->IsOUUnderActiveDirectory($ou);
        $GroupsNB = 0;
        if ($EnableManageUsersTroughActiveDirectory == 0) {
            $img = $ldap->get_organization_picture($ligne, 32);
            writelogs("ldap->CountDeUSerOu({$ligne})", __FUNCTION__, __FILE__, __LINE__);
            $usersNB = $ldap->CountDeUSerOu($ligne);
            $usersNB = "{$usersNB}";
        } else {
            $img = $pic;
            if ($IsOUUnderActiveDirectory) {
                $ad = new external_ad_search();
                writelogs("ldap->CountDeUSerOu({$ligne})", __FUNCTION__, __FILE__, __LINE__);
                $usersNB = $ad->CountDeUSerOu($ligne);
            } else {
                writelogs("ldap->CountDeUSerOu({$ligne})", __FUNCTION__, __FILE__, __LINE__);
                $usersNB = $ldap->CountDeUSerOu($ligne);
                $usersNB = "{$usersNB}";
            }
        }
        $delete = imgtootltip("delete-32-grey.png", "<b>{delete_ou} {$ligne}</b><br><i>{delete_ou_text}</i>");
        if ($users->AsArticaAdministrator) {
            $delete = Paragraphe('64-cancel.png', "{delete_ou} {$ligne}", '{delete_ou_text}', "javascript:Loadjs('domains.delete.org.php?ou={$ligne}');", null, 210, 100, 0, true);
            $delete = imgsimple("delete-32.png", "<b>{delete_ou} {$ligne}</b><br><i>{delete_ou_text}</i>", "javascript:Loadjs('domains.delete.org.php?ou={$ligne}&t={$t}&id-table={$md5S}');");
        }
        $DomainsNB = $ldap->CountDeDomainsOU($ligne);
        if ($GroupsNB == 0) {
            if ($IsOUUnderActiveDirectory) {
                $ad = new external_ad_search();
                writelogs("->CountDeGroups({$ou})", __FUNCTION__, __FILE__, __LINE__);
                $GroupsNB = $ad->CountDeGroups($ou);
            } else {
                writelogs("->CountDeGroups({$ou})", __FUNCTION__, __FILE__, __LINE__);
                $GroupsNB = $ldap->CountDeGroups($ou);
            }
        }
        Paragraphe('folder-useradd-64.png', '{create_user}', '{create_user_text}', "javascript:Loadjs('domains.add.user.php?ou={$ou}')", null, 210, null, 0, true);
        Paragraphe('64-folder-group-add.png', '{create_user}', '{create_user_text}', "javascript:Loadjs('domains.add.user.php?ou={$ou}')", null, 210, null, 0, true);
        Paragraphe("64-folder-group-add.png", "{$ou}:{add_group}", "{add_a_new_group_in_this_org}:<b>{$ou}</b>", "javascript:Loadjs('domains.edit.group.php?popup-add-group=yes&ou={$ou}&t={$t}')");
        $select = imgsimple("domain-32.png", "{manage_organisations_text}", $uri);
        $adduser = imgsimple("folder-useradd-32.png", "{$ou}<hr><b>{create_user}</b><br><i>{create_user_text}</i>", "Loadjs('domains.add.user.php?ou={$ou_encoded}&encoded=yes');");
        $addgroup = imgsimple("32-folder-group-add.png", "{$ou}<hr><b>{add_group}</b><br><i>{add_a_new_group_in_this_org}</i>", "Loadjs('domains.edit.group.php?popup-add-group=yes&ou={$ou}&t={$t}');");
        $SearchUser = imgsimple("loupe-32.png", "{$ou}<hr><b>{search}</b>:<i>{members}</i>", "Loadjs('domains.find.user.php?ou={$ou_encoded}&encoded=yes');");
        $SearchGroup = imgsimple("loupe-32.png", "{$ou}<hr><b>{search}</b>:<i>{groups}</i>", "Loadjs('domains.find.groups.php?ou={$ou_encoded}&encoded=yes&t={$t}');");
        $searchDomain = imgsimple("loupe-32.png", "{$ou}<hr><b>{localdomains}</b>:<i>{localdomains_text}</i>", "Loadjs('domains.edit.domains.php?js=yes&ou={$ou}&master-t={$t}');");
        $NOZARAFA = 0;
        $OuZarafaText = null;
        if ($IsOUUnderActiveDirectory) {
            $delete = imgtootltip("delete-24-grey.png", "", "");
            $adduser = imgsimple("folder-useradd-32-grey.png");
            $addgroup = imgsimple("32-folder-group-add-grey.png");
        }
        if ($_GET["zarafaF"] == 1) {
            $info = $ldap->OUDatas($ou);
            if (!$info["objectClass"]["zarafa-company"]) {
                $NOZARAFA = 1;
                $OuZarafaText = "<br><a href=\"javascript:blur()\" style='color:#B20808;text-decoration:underline;font-style:italic' \n\t\t\t\tOnClick=\"javascript:Loadjs('domains.edit.zarafa.php?ou={$ou_encoded}&t={$t}')\">{$ou_nozarafa_explain}</a>";
            }
        }
        $array = array();
        $array[] = "<a href=\"javascript:blur();\" \n\t\tOnClick=\"{$uri}\" style='font-size:26px;font-weight:bolder;text-transform:capitalize;\n\t\ttext-decoration:underline'>{$ligne}</strong></a>{$OuZarafaText}";
        if ($_GET["zarafaF"] == 1) {
            $zarafaEnabled = "zarafa-logo-32.png";
            if ($NOZARAFA == 1) {
                $zarafaEnabled = "zarafa-logo-32-grey.png";
            }
            $array[] = "<center>" . imgsimple($zarafaEnabled, "<strong style=font-size:26px>{$ou}:{APP_ZARAFA}</strong>\n\t\t\t\t\t<br>{ZARAFA_OU_ICON_TEXT}", "Loadjs('domains.edit.zarafa.php?ou={$ou_encoded}&t={$t}')") . "</center>";
        } else {
            $array[] = "&nbsp;";
        }
        $array[] = "<strong style='font-size:26px'>{$usersNB}</strong>";
        $array[] = "<center style='font-size:16px'>{$SearchUser}</center>";
        $array[] = "<strong style='font-size:26px'>{$GroupsNB}</strong>";
        $array[] = "<center style='font-size:16px'>{$SearchGroup}</center>";
        $array[] = "<strong style='font-size:26px'>{$DomainsNB}</strong>";
        $array[] = "<center style='font-size:16px'>{$searchDomain}</center>";
        $array[] = "<center style='font-size:16px'>{$adduser}</center>";
        $array[] = "<center style='font-size:16px'>{$addgroup}</center>";
        $array[] = "<center style='font-size:16px'>{$delete}</center>";
        $c++;
        $data['rows'][] = array('id' => $md5S, 'cell' => $array);
    }
    $total = $c;
    $data['page'] = 1;
    $data['total'] = $total;
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:domains.index.php

示例13: EditGroup

function EditGroup(){
	$gid=$_GET["PrivilegesGroup"];
	$ldap=new clladp();
	$update_array=array();
	writelogs("Save privileges for $gid",__CLASS__,__FUNCTION__,__FILE__,__LINE__);
	switch ($gid) {
		case -1:
			$Hash=$ldap->OUDatas($_GET["ou"]);
			writelogs("Loading ou datas of \"{$_GET["ou"]}\" ArticaGroupPrivileges=". strlen($Hash["ArticaGroupPrivileges"]) ." bytes",__FUNCTION__,__FILE__,__LINE__);
			
			break;
		case -2:
			$user=new user($_GET["userid"]);
			$Hash=$user->ArticaGroupPrivileges;
			break;
		default:$Hash=$ldap->GroupDatas($gid);break;
	}
	
		
	if(!is_array($Hash["ArticaGroupPrivileges"])){
		$ArticaGroupPrivileges=$ldap->_ParsePrivieleges($Hash["ArticaGroupPrivileges"]);
	}else{
		$ArticaGroupPrivileges=$Hash["ArticaGroupPrivileges"];
	}
	
	
	if(is_array($ArticaGroupPrivileges)){while (list ($num, $val) = each ($ArticaGroupPrivileges) ){$GroupPrivilege[$num]=$val;}}
	while (list ($num, $val) = each ($_GET) ){$GroupPrivilege[$num]=$val;}		
	while (list ($num, $val) = each ($GroupPrivilege) ){if($val=="no"){continue;} $values=$values . "[$num]=\"$val\"\n";}

	
	if($gid==-2){
		$user->SavePrivileges($values);
		return;
	}

	$update_array["ArticaGroupPrivileges"][0]=$values;
	writelogs("Modify: {$Hash["dn"]}",__FUNCTION__,__FILE__,__LINE__);
	if(!$ldap->Ldap_modify($Hash["dn"],$update_array)){
		echo basename(__FILE__)."\nline: ".__LINE__."\n".$ldap->ldap_last_error;
	}
		
	
	
}
开发者ID:rsd,项目名称:artica-1.5,代码行数:45,代码来源:domains.edit.group.php


注:本文中的clladp::OUDatas方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。