本文整理汇总了PHP中clladp::hash_groups方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::hash_groups方法的具体用法?PHP clladp::hash_groups怎么用?PHP clladp::hash_groups使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clladp
的用法示例。
在下文中一共展示了clladp::hash_groups方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export
function export($ou, $path)
{
@file_put_contents($pidfile, getmypid());
//if(strlen($GLOBALS["USER_QUERY"])>0){$filter="(uid={$GLOBALS["USER_QUERY"]})";}
$ldap = new clladp();
$pattern = "(&(objectclass=userAccount){$filter})";
$attr = array();
$sr = @ldap_search($ldap->ldap_connection, "ou={$ou},dc=organizations,{$ldap->suffix}", $pattern, $attr);
$hash = ldap_get_entries($ldap->ldap_connection, $sr);
$unix = new unix();
$gzip = $unix->find_program("gzip");
$users_array = array();
if (is_array($hash)) {
for ($i = 0; $i < $hash["count"]; $i++) {
$usersArray[] = $hash[$i]["uid"][0];
}
}
if (is_array($usersArray)) {
while (list($index, $uid) = each($usersArray)) {
echo "Parsing {$uid}\n";
$u = new user($uid);
$array_user = array();
foreach ($u as $key => $value) {
$array_user[$key] = $value;
}
$array_users_final[] = $array_user;
unset($array_user);
}
}
$groups = $ldap->hash_groups($ou, 1);
while (list($num, $line) = each($groups)) {
echo "Parsing group {$num} {$line}\n";
$u = new groups($num);
$array_group = array();
foreach ($u as $key => $value) {
$array_group[$key] = $value;
}
$array_group_final[] = $array_group;
unset($array_group);
}
$array_final["USERS"] = $array_users_final;
$array_final["GROUPS"] = $array_group_final;
$tempfile = $unix->FILE_TEMP();
$datas = base64_encode(serialize($array_final));
@file_put_contents($tempfile, $datas);
if (is_dir($path)) {
compress($tempfile, $path . "/{$ou}.gz");
echo "Saved in " . $path . "/{$ou}.gz\n";
@chmod($path . "/{$ou}.gz", 0755);
} else {
echo $path . " no such directory...\n";
}
@unlink($tempfile);
}
示例2: INDEX_CREATE
function INDEX_CREATE()
{
$ldap = new clladp();
if ($_GET["ou"] == null) {
die;
}
$_GET["ou"] = base64_decode($_GET["ou"]);
$hash = $ldap->hash_groups($_GET["ou"], 1);
$domains = $ldap->hash_get_domains_ou($_GET["ou"]);
if (count($domains) == 0) {
$users = new usersMenus();
if ($users->POSTFIX_INSTALLED) {
$field_domains = Field_text('user_domain', "{$_GET["ou"]}.com", "width:85px");
} else {
if (!preg_match("#(.+?)\\.(.+)#", $_GET["ou"])) {
$dom = "{$_GET["ou"]}.com";
} else {
$dom = "{$_GET["ou"]}";
}
$field_domains = "<code><strong>{$dom}</strong></code>" . Field_hidden('user_domain', "{$dom}", "width:120px");
}
} else {
$field_domains = Field_array_Hash($domains, 'user_domain', "style:font-size:18px;padding:3px");
}
$tpl = new templates();
$hash[null] = "{select}";
$groups = Field_array_Hash($hash, 'group_id', $_GET["gpid"], "style:font-size:18px;padding:3px");
$error_no_password = $tpl->javascript_parse_text("{error_no_password}");
$error_no_userid = $tpl->javascript_parse_text("{error_no_userid}");
$t = time();
$title = "{$_GET["ou"]}:{create_user}";
$step1 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:99%' class='TableRemove' OnMouseOver=\"javascript:HideExplainAll(1)\">\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre1_32.png'></td>\n\t<td valign='top'>\n\t<div style='font-size:18px;font-weight:bold;margin-bottom:5px'>{name_the_new_account_title}:</div>\n\t" . Field_text('new_userid', null, "font-size:18px;padding:3px;font-weight:bold;color:#C80000", null, "UserAutoChange_eMail()", null, false, "UserADDCheck(event)") . "\n\n\t</td>\n\t</tr>\n\t</table></div>";
$step2 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:99%' class='TableRemove' OnMouseOver=\"javascript:HideExplainAll(2)\">\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre2_32.png'></td>\n\t<td valign='top'>\n\t<div style='font-size:18px;font-weight:bold;margin-bottom:5px'>{email}</div><br>\n\t<input type='hidden' name='email' value='' id='email'>\n\t<span id='prefix_email' style='width:90px;border:1px solid #CCCCCC;padding:2px;font-size:18px;font-weight:bold;margin:2px'>\n\t</span>@{$field_domains} \n\t<div style='text-align:right;font-size:14px;'><i><a href='javascript:ChangeAddUsereMail();'>{change}</a></i>\n\t\n\t</td>\n\t</tr>\n\t</table></div>";
$step3 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:99%' class='TableRemove' OnMouseOver=\"javascript:HideExplainAll(4)\">\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre3_32.png'></td>\n\t<td valign='top'>\n\t<div style='font-size:18px;font-weight:bold;margin-bottom:5px'>{password}</div>\n\t" . Field_password("password-{$t}", null, "font-size:18px;padding:3px;width:190px;letter-spacing:3px", null, null, null, false, "UserADDCheck(event)") . "\n\t</td>\n\t</tr>\n\t</table>\n\t</div>\n\t";
$step4 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:99%' class='TableRemove' OnMouseOver=\"javascript:HideExplainAll(3)\">\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre4_32.png'></td>\n\t<td valign='top'>\n\t<div style='font-size:18px;font-weight:bold;margin-bottom:5px'>{group}</div>\n\t<div style='font-size:18px;margin-bottom:5px'>{select_user_group_title}:</div><br>{$groups}\n\t</td>\n\t</tr>\n\t</table></div>\n\t";
if ($_GET["gpid"] > 0) {
$step4 = "<input type='hidden' id='group_id' value='{$_GET["gpid"]}'>";
}
$html = "\n\t<input type='hidden' id='ou-mem-add-form-user' value='{$_GET["ou"]}'>\n\t<input type='hidden' id='ou' value='{$_GET["ou"]}'>\n\t<div id='adduser_ajax_newfrm' style='margin-top:5px'>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%' class=TableRemove>\n\t<tr>\n\t<td valign='top' style='width:450px;vertical-align:top'>\n\t\t<table style='width:450px'>\n\t\t<tr>\n\t\t\t<td valign='top' width=290px>{$step1}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top'>{$step2}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top'><br>{$step3}</td>\n\t\t</tr>\n\t\t\t<td valign='top'><br>{$step4}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'>\n\t\t\t\t<hr>" . button("{add}", "UserADDSubmit()", 26) . "\n\t\t\t</td>\n\t\t</tr>\t\t\t\n\t\t</table>\n\t</td>\n\t<td valign='top' style='width:50%'>\n\t\t\t<center style='margin-bottom:8px'><img src='img/add-woman-256.png'></center>\n\t\t\t<div style='padding-left:10px'>\t\t\n\t\t\t\t<div class=text-info id='text-1' style='font-size:16px'>{name_the_new_account_explain}</div>\n\t\t\t\t<div class=text-info id='text-2' style='font-size:16px'>{user_email_text}</div>\n\t\t\t\t<div class=text-info id='text-3' style='font-size:16px'>{select_user_group_text}</div>\n\t\t\t\t<div class=text-info id='text-4' style='font-size:16px'>{give_password_text}</div>\n\t\t\t</div>\n\t\t\t\n\t</td>\n\t</tr>\t\n\t</table>\n\t</div>\n\t</div>\n\t<input type='hidden' id='flexRTMEM' value='{$_GET["flexRT"]}'>\n\t<script>\n\t\tfunction VerifyFormAddUserCheck(){\n\t\t\tvar pass;\n\t\t\tvar uid;\n\t\t\tpass=document.getElementById('password-{$t}').value;\n\t\t\tuid=document.getElementById('new_userid').value;\n\t\t\tif(uid.length<1){alert('{$error_no_userid}');return false;}\n\t\t\tif(pass.length<1){alert('{$error_no_password}');return false;}\n\t\t\treturn true;\n\t\t\t}\n\t\t\n\t\tfunction UserADDSubmit(){\n\t\t\tif(!VerifyFormAddUserCheck()){return;}\n\t\t\tUserADD{$t}();\n\t\t}\n\t\n\t\n\t\tfunction UserADDCheck(e){\n\t\t\tif(checkEnter(e)){UserADDSubmit();}\n\t\t}\n\t\t\n\t\tfunction HideExplainAll(id){\n\t\t\tdocument.getElementById('text-1').style.display='none';\n\t\t\tdocument.getElementById('text-2').style.display='none';\n\t\t\tdocument.getElementById('text-3').style.display='none';\n\t\t\tdocument.getElementById('text-4').style.display='none'; \n\t\t\tif(document.getElementById('text-'+id)){\n\t\t\t\tdocument.getElementById('text-'+id).style.display='block';\n\t\t\t\t} \n\t\t\t\n\t\t}\n\t\t\nfunction UserADD{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tvar ou=document.getElementById('ou').value;\n\t\tif(ou.length==0){if(document.getElementById('ou-mem-add-form-user')){ou=document.getElementById('ou-mem-add-form-user').value;}}\n\t\tif(ou.length==0){Alert('Unable to stat Organization name (ou field is empty)');return;}\n\t\t\n\t\tXHR.appendData('ou',ou);\n\t\tXHR.appendData('new_userid',document.getElementById('new_userid').value);\n\t\tXHR.appendData('password',document.getElementById('password-{$t}').value);\n\t\tXHR.appendData('group_id',document.getElementById('group_id').value);\n\t\tXHR.appendData('email',document.getElementById('email').value);\n\t\tXHR.appendData('user_domain',document.getElementById('user_domain').value);\n\t\t\n\t\tif(document.getElementById('adduser_ajax_newfrm')){AnimateDiv('adduser_ajax_newfrm');}\n\t\tif(document.getElementById('bglego')){document.getElementById('bglego').src='img/wait_verybig.gif';}\n\t\tif(document.getElementById('member_add_to_wait')){AnimateDiv('member_add_to_wait');}\n\t\tXHR.sendAndLoad('domains.edit.user.php', 'POST',X_UserADD);\t\n\t}\t\t\n\t\n\t\n\t\t\n\t\tHideExplainAll();\n</script>\t\n\t\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例3: INDEX_CREATE
function INDEX_CREATE()
{
$ldap = new clladp();
if ($_GET["ou"] == null) {
die;
}
$_GET["ou"] = base64_decode($_GET["ou"]);
$hash = $ldap->hash_groups($_GET["ou"], 1);
$domains = $ldap->hash_get_domains_ou($_GET["ou"]);
if (count($domains) == 0) {
$users = new usersMenus();
if ($users->POSTFIX_INSTALLED) {
$field_domains = Field_text('user_domain', "{$_GET["ou"]}.com", "width:85px");
} else {
if (!preg_match("#(.+?)\\.(.+)#", $_GET["ou"])) {
$dom = "{$_GET["ou"]}.com";
} else {
$dom = "{$_GET["ou"]}";
}
$field_domains = "<code><strong>{$dom}</strong></code>" . Field_hidden('user_domain', "{$dom}", "width:120px");
}
} else {
$field_domains = Field_array_Hash($domains, 'user_domain');
}
$hash[null] = "{select}";
$groups = Field_array_Hash($hash, 'group_id', $_GET["gpid"]);
$title = "{$_GET["ou"]}:{create_user}";
$step1 = "<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre1.png'></td>\n\t<td valign='top'>\n\t<H3>{name_the_new_account_title}</H3><br>\n\t<strong>{name_the_new_account_field}:</strong>\n\t<br>" . Field_text('new_userid', null, null, null, "UserAutoChange_eMail()") . "\n\t<div class=caption>{name_the_new_account_explain}</div>\n\t</td>\n\t</tr>\n\t</table>";
$step2 = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre2.png'></td>\n\t<td valign='top'>\n\t<H3>{email}</H3><br>\n\t<strong>{email}:</strong>\n\t<br><input type='hidden' name='email' value='' id='email'>\n\t<span id='prefix_email' style='width:90px;border:1px solid #CCCCCC;padding:2px;font-size:11px;font-weight:bold;margin:2px'></span>@{$field_domains} <a href='javascript:ChangeAddUsereMail();'>[{change}]</a>\n\t<div class=caption>{user_email_text}</div>\n\t</td>\n\t</tr>\n\t</table>";
$step3 = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre3.png'></td>\n\t<td valign='top'>\n\t<H3>{password}</H3><br>\n\t<strong>{give_password}:</strong>\n\t<br>" . Field_password('password') . "\n\t<div class=caption>{give_password_text}</div>\n\t</td>\n\t</tr>\n\t</table>\n\t";
$step4 = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre4.png'></td>\n\t<td valign='top'>\n\t<H3>{group}</H3><br>\n\t<strong>{select_user_group_title}:</strong>{$groups}\n\t<div class=caption>{select_user_group_text}</div>\n\t</td>\n\t</tr>\n\t</table>\n\t";
if ($_GET["gpid"] > 0) {
$step4 = "<input type='hidden' id='group_id' value='{$_GET["gpid"]}'>";
}
$html = "\n\t<input type='hidden' id='ou-mem-add-form-user' value='{$_GET["ou"]}'>\n\t<input type='hidden' id='ou' value='{$_GET["ou"]}'>\n\t<div style='float:right'><img src='img/64_bg_lego.png'></div><H1>{$title}</H1>\n\t<p class=caption>{create_user_text}</p>\n\t<div id='adduser_ajax_newfrm'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>{$step1}</td>\n\t<td valign='top'>{$step2}</td>\n\t</tr>\n\t<tr>\n\t<td valign='top'><br>{$step3}\n\t</td>\n\t<td valign='top'><br>{$step4}</td>\n\t</tr>\n\t<tr>\n\t<td colspan=2>\n\t<hr>\n\t<div style='padding:10px;text-align:right'>\n\t\t" . button("{add}", "UserADD()") . "\n\t\n\t</td>\n\t</tr>\t\t\n\t\n\t</table>\n\t</div>\n\t";
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($html);
}
示例4: time_groups
function time_groups(){
$ldap=new clladp();
$gprs=$ldap->hash_groups($_GET["connection-time-showgroup"],1);
$gprs[null]="{select}";
$tpl=new templates();
return $tpl->_ENGINE_parse_body(Field_array_Hash($gprs,'gpid',null,"ConnectionTimeSelectGroup()"));
}
示例5: LoadGroupsAjax
function LoadGroupsAjax($ou)
{
$ldap = new clladp();
echo $ldap->hash_groups($ou, 2);
}
示例6: move_user
function move_user($userid)
{
$ldap = new clladp();
$usersData = $ldap->UserDatas($userid);
$ou = $usersData["ou"];
if (is_array($usersData["groups"])) {
$gp = "<table style='width:100%'>";
while (list($num, $ligne) = each($usersData["groups"])) {
$gp = $gp . "\n\t\t\t<tr>\n\t\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t\t<td valign='top'>{$num}</td>\n\t\t\t<td valign='top'>" . imgtootltip('x.gif', '{delete} ' . $num, "DeleteUserGroup({$ligne},'{$userid}')") . "</td>\n\t\t\t</tr>";
}
$gp = $gp . "</table>";
}
$hash_group = $ldap->hash_groups($ou, 1);
$add = Field_array_Hash($hash_group, 'group_add', null, null, null, 0, 'width:150px');
$html = "<fieldset style='width:400px'>\n\t<legend>{move_member}</legend>\n\t<form name='ffm1'>\n\t<input type='hidden' name='userid' id='userid' value='{$userid}'>\n\t<strong>{add_member_to_group}: </strong>{$add} <input type='button' value='{add} »' OnClick=\"javascript:AddMemberGroup();\" style='margin-bottom:0px'><br>\n\t</form>\n\t<h4>{member_of_group}:</H4>\n\t{$gp}\n\t\n\t\n\t</fieldset>";
$tpl = new Templates();
return $tpl->_ENGINE_parse_body($html);
}
示例7: main_step2
function main_step2()
{
$ous = $ad->table_ou();
$ous[null] = "{select}";
$ous["Users"] = "Users";
$ldap = new clladp();
$hgp = $ldap->hash_groups($_POST["ou"], 1);
$html = "<table style='width:100%'>\n\t<tr><td colspan=3><hr></td></tr>\n\t<tr>\n\t\t<td width=1% valign='top'><img src='img/chiffre3.png'></td>\n\t\t<td valign='top'><H3>{remote_org}</H3>\n\t\t<p class=caption>{remote_org_text}</p>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td align='right' style='font-weight:bold;font-size:12px'>{remote_org}:</td>\n\t\t\t<td align='left'>" . Field_array_Hash($ous, 'dn_ou', $ad->dn_ou) . "</td>\n\t\t</tr>\n\t\t</table>\n\t\t</td>\n\t</tr>\n\t</table>\n<table style='width:100%'>\n\t<tr><td colspan=3><hr></td></tr>\n\t<tr>\n\t\t<td width=1% valign='top'><img src='img/chiffre4.png'></td>\n\t\t<td valign='top'><H3>{local_group}</H3>\n\t\t<p class=caption>{local_group_text}</p>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td align='right' style='font-weight:bold;font-size:12px'>{local_group}:</td>\n\t\t\t<td align='left'>" . Field_array_Hash($hgp, 'target_group', $ad->target_group) . "</td>\n\t\t</tr>\n\t\t</table>\n\t\t</td>\n\t</tr>\n\t</table>\n<table style='width:100%'>\n\t<tr><td><hr></td></tr>\n\t<tr><td align='right'><input type='button' value='{perform_importation} »' OnClick=\"javascript:AddStep2('{$_POST["ou"]}');\"></td>\n\t</tr>\n\t</table>\t\t\t";
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($html);
}
示例8: add_user_popup
function add_user_popup()
{
$ldap = new clladp();
if ($_GET["ou"] == null) {
senderror("{ERROR_NO_ORGANISATION_SELECTED}");
}
$hash = $ldap->hash_groups($_GET["ou"], 1);
$domains = $ldap->hash_get_domains_ou($_GET["ou"]);
$boot = new boostrap_form();
$boot->set_hidden("ou", $_GET["ou"]);
$boot->set_hidden("encpass", 1);
$boot->set_field("new_userid", "{name_the_new_account_title}", null, array("MANDATORY" => true));
$boot->set_field("password", "{password}", null, array("MANDATORY" => true));
$boot->set_field("email", "{email}", null, array("MANDATORY" => true));
$boot->set_field("password", "{password}", null, array("MANDATORY" => true, "ENCODE" => true));
$boot->set_list("group_id", "{group}", $hash);
$boot->set_button("{add}");
$boot->set_CloseYahoo("YahooWin2");
$boot->set_RefreshSearchs();
$boot->setAjaxPage("domains.edit.user.php");
$boot->set_formtitle("{$_GET["ou"]}:: {new_member}");
echo $boot->Compile();
}
示例9: find_member
function find_member()
{
$ldap = new clladp();
if ($ldap->IsKerbAuth()) {
find_member_active_directory();
return;
}
if ($_POST["qtype"] == "find-member") {
$tofind = $_POST["query"];
}
$t = $_GET["t"];
$tt = $_GET["tt"];
if ($_SESSION["uid"] == -100) {
$ou = $_GET["ou"];
} else {
$ou = $_SESSION["ou"];
}
$sock = new sockets();
if (is_base64_encoded($ou)) {
$ou = base64_decode($ou);
}
if ($tofind == null) {
$tofind = '*';
} else {
$tofind = "*{$tofind}*";
}
$tofind = str_replace('***', '*', $tofind);
$tofind = str_replace('**', '*', $tofind);
$tofind = str_replace('**', '*', $tofind);
$EnableManageUsersTroughActiveDirectory = $sock->GET_INFO("EnableManageUsersTroughActiveDirectory");
if (!is_numeric($EnableManageUsersTroughActiveDirectory)) {
$EnableManageUsersTroughActiveDirectory = 0;
}
$tofind = str_replace(".", '\\.', $tofind);
$tofind = str_replace("*", '.*?', $tofind);
$ldap = new clladp();
writelogs("FIND {$tofind} IN OU \"{$ou}\"", __FUNCTION__, __FILE__, __LINE__);
if (!$ldap->IsOUUnderActiveDirectory($ou)) {
if ($EnableManageUsersTroughActiveDirectory == 1) {
$GLOBALS["NOUSERSCOUNT"] = true;
$ldap = new ldapAD();
writelogs("[{$tofind}]: ->hash_get_groups_from_ou_mysql({$ou},{$tofind}) ", __FUNCTION__, __FILE__);
$hash = $ldap->hash_get_groups_from_ou_mysql($ou, $tofind, true);
} else {
$ldap = new clladp();
$hash = $ldap->hash_groups($ou, 1);
}
} else {
$hash = find_member_active_directory();
$ldap->EnableManageUsersTroughActiveDirectory = true;
$GLOBALS["NOUSERSCOUNT"] = true;
}
$number = count($hash);
$data = array();
$data['page'] = 0;
$data['total'] = $number;
$data['rows'] = array();
$styla = "style='font-size:14px;text-decoration:underline;font-weight:bold'";
$styleNum = "style='font-size:16px;font-weight:bold'";
$search = string_to_flexregex();
if (is_array($hash)) {
while (list($num, $line) = each($hash)) {
if (strtolower($line) == 'default_group') {
continue;
}
if (strlen($search) > 2) {
if (!preg_match("#{$search}#", $line)) {
continue;
}
}
$text = null;
$js = "javascript:Loadjs('domains.edit.group.php?js=yes&group-id={$num}&ou={$_GET["ou"]}&encoded=yes&tt={$t}&ttt={$tt}')";
$delete = imgsimple("delete-24.png", "{delete} {$num}", "Loadjs('domains.delete.group.php?gpid={$num}')");
if (!$GLOBALS["NOUSERSCOUNT"]) {
$delete = " ";
$gp = new groups($num);
$members = count($gp->members_array);
if ($gp->description != null) {
$text = $gp->description;
}
$data['rows'][] = array('id' => $line, 'cell' => array("<a href=\"javascript:blur();\" OnClick=\"{$js}\" {$styla}>{$line}</a>", "<span {$styleNum}>{$members}</span>", "<span style='font-size:14px'>{$text}</span>", $delete));
} else {
if (is_array($line)) {
if ($line["description"] != null) {
$text = $line["description"];
}
if (strlen($search) > 2) {
if (!preg_match("#{$search}#", $line["groupname"])) {
continue;
}
}
if (!is_numeric($line["gid"])) {
$delete = imgsimple("delete-24-grey.png");
}
$js = "javascript:Loadjs('domains.edit.group.php?js=yes&group-id={$line["gid"]}&ou={$_GET["ou"]}&encoded=yes&tt={$t}&ttt={$tt}')";
$data['rows'][] = array('id' => md5($line["groupname"]), 'cell' => array("<a href=\"javascript:blur();\" OnClick=\"{$js}\" {$styla}>{$line["groupname"]}</a>", "<span {$styleNum}>{$line["UsersCount"]}</span>", "<span style='font-size:14px'>{$text}</span>", $delete));
} else {
$data['rows'][] = array('id' => $line, 'cell' => array("<a href=\"javascript:blur();\" OnClick=\"{$js}\" {$styla}>{$line}</a>", "<span {$styleNum}>?</span>", "<span style='font-size:14px'></span>", $delete));
}
}
//.........这里部分代码省略.........
示例10: browse_groups_for_ou
function browse_groups_for_ou()
{
$ou = $_GET["browse-ou"];
$t = $_GET["t"];
$function = $_GET["function"];
$ldap = new clladp();
$tpl = new templates();
$groups = $ldap->hash_groups($ou, 1);
$id = md5($ou);
if ($GLOBALS["VERBOSE"]) {
print_r($groups);
}
if (!is_array($groups)) {
if ($GLOBALS["VERBOSE"]) {
echo "<H1>Not an array</H1>";
}
return null;
}
$style = " OnMouseOver=\";this.style.cursor='pointer';\" OnMouseOut=\";this.style.cursor='default';\"";
$f[] = "<ul id='{$id}' class='jqueryFileTree'>";
ksort($groups);
$group = $tpl->_ENGINE_parse_body("{group2}");
while (list($num, $groupname) = each($groups)) {
if ($GLOBALS["VERBOSE"]) {
echo "{$num} -> {$groupname}<br>\n";
}
$id = $num;
$CLASS = "group";
$f[] = "<li class={$CLASS} collapsed id='{$id}'>\n\t\t\t<a href=\"#\" OnClick=\"javascript:{$function}('{$num}','{$groupname}');YahooWinBrowseHide();\">{$groupname}</a></li>";
}
$f[] = "</ul>";
echo @implode("\n", $f);
}
示例11: groups_fields
function groups_fields()
{
$ou = $_GET["choose-group"];
if ($ou == null) {
return null;
}
$ldap = new clladp();
$tpl = new templates();
$hash = $ldap->hash_groups($ou, 1);
$hash[null] = $tpl->_ENGINE_parse_body("{select}");
$groups = Field_array_Hash($hash, 'gpid', null, null, null, 0, "font-size:15px;padding:4px");
echo $groups;
}
示例12: BuildLevel2
function BuildLevel2($ou)
{
$ldap = new clladp();
$privileges = new usersMenus($_GET["PRIVS"]);
$HashDomains = $ldap->hash_get_domains_ou($ou);
$hash_group = $ldap->hash_groups($ou);
$hash_transport = $ldap->hash_load_transport();
$hash_users = $ldap->hash_get_users_Only_ou($ou);
writelogs("BuildLevel2 ->{$ou} users number=" . count($hash_users), __FUNCTION__, basename(__FILE__));
if ($privileges->AllowChangeDomains == true) {
if (is_array($HashDomains)) {
while (list($num, $ligne) = each($HashDomains)) {
$items = $items . "{\n";
$items = $items . "\t\t\t'id' : 'domain:{$ou},{$num}',\n";
$items = $items . "\t\t\t'txt' : '{$ligne}',\n";
if (isset($hash_transport[$ligne])) {
$items = $items . "\t\t\t'img' : 'alias-18.gif',\n";
} else {
$items = $items . "\t\t\t'img' : 'globe.gif',\n";
}
$items = $items . "\t\t\t'editable' : false,\n";
$items = $items . "\t\t\t'draggable' : false\n";
$items = $items . "\t\t\t},";
}
}
}
if (is_array($hash_users)) {
if (count($hash_users) > 50) {
$count = count($hash_users);
$items = $items . "{\n";
$items = $items . "\t\t\t'id' : 'users:{$ou}',\n";
$items = $items . "\t\t\t'txt' : '{$count} users',\n";
$items = $items . "\t\t'openlink' : 'ldapTree.php',\n";
$items = $items . "\t\t'draggable' : true,\n";
$items = $items . "\t\t\t'img' : 'family-20.gif'\n";
$items = $items . "\t\t\t},";
}
}
if (is_array($hash_group)) {
while (list($num, $ligne) = each($hash_group)) {
$num = str_replace("'", "`", $num);
if (strlen($num) > 20) {
$num = substr($num, 0, 17) . "...";
}
$items = $items . "{\n";
$items = $items . "\t\t\t'id' : 'group:{$ligne["gid"]}',\n";
$items = $items . "\t\t\t'txt' : '{$num}',\n";
$items = $items . "\t\t\t'img' : 'tree-groups',\n";
$items = $items . "\t\t\t'editable' : true,\n";
$items = $items . "\t\t\t'draggable' : false,\n";
$items = $items . "\t\t'onopenpopulate' : myOpenPopulate,\n";
$items = $items . "\t\t'openlink' : 'ldapTree.php',\n";
$items = $items . "\t\t'canhavechildren' : true\n";
$items = $items . "\t\t\t},";
}
}
if (is_array($hash_users)) {
if (count($hash_users) < 50) {
while (list($num, $ligne) = each($hash_users)) {
$userdatas = $ldap->UserDatas($ligne);
$ligne = str_replace("'", "\\'", $ligne);
$name = $userdatas["displayName"];
$name = str_replace("'", "`", $name);
$items = $items . "{\n";
$items = $items . "\t\t\t'id' : 'user:{$ligne}',\n";
$items = $items . "\t\t\t'txt' : '{$name}',\n";
$items = $items . "\t\t'openlink' : 'ldapTree.php',\n";
$items = $items . "\t\t'draggable' : true,\n";
$items = $items . "\t\t\t'img' : 'outicon_1002.gif'\n";
$items = $items . "\t\t\t},";
}
}
}
if ($items[strlen($items) - 1] == ',') {
$items = substr($items, 0, strlen($items) - 1);
}
return $items;
}
示例13: add_group_list
function add_group_list()
{
$ldap = new clladp();
$groups = $ldap->hash_groups($_GET["ou-search"], 1);
$groups[null] = "{select}";
$ou_field = Field_array_Hash($groups, 'group-selected', null, null, null, 0, "font-size:14px");
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($ou_field);
}
示例14: database_migrate_popup
function database_migrate_popup(){
$tpl=new templates();
$users=new usersMenus();
if(!$users->AllowAddUsers){
echo "<H2>".$tpl->_ENGINE_parse_body("{ERROR_NO_PRIVS}")."</H2>";exit;
}
$ID=$_GET["database-migrate"];
$ou=$_GET["ou"];
$ou=base64_decode($ou);
$emailing=new emailings($ID);
$ldap=new clladp();
$group=$ldap->hash_groups($ou,1);
$group[null]="{select}";
$field=Field_array_Hash($group,'emailing_gpid_migr',trim($emailing->array_options["gpid"]),null,null,0,"font-size:14px;padding:4px");
$page=CurrentPageName();
$confirm=$tpl->javascript_parse_text('{confirm}?');
$ldap=new clladp();
$domains=$ldap->Hash_domains_table($ou);
while (list ($domain, $no) = each ($domains) ){
$DOMAINS_ARRAY[$domain]=$domain;
}
$DOMAINS_ARRAY[null]="{select}";
$domains_field=Field_array_Hash($DOMAINS_ARRAY,'export_domain',$emailing->array_options["export_domain"],null,null,0,"font-size:14px;padding:4px");
$html="
<div id='database_migrate_popup_id'>
<table style='width:100%'>
<tr>
<td valign='top' width=1%><img src='img/user-migrate-90.png'></td>
<td valign='top'>
<div style='font-size:13px'>{migrate_user_text}</div>
<table style='width:100%'>
<tr>
<td class=legend style='font-size:14px'>{group}:</td>
<td>$field</td>
</tr>
<tr>
<td class=legend style='font-size:14px'>{domain}:</td>
<td>$domains_field</td>
</tr>
<tr>
<td class=legend style='font-size:14px'>{default_password}:</td>
<td>". Field_password("export_default_password",$emailing->array_options["export_default_password"],"font-size:14px;padding:4px;width:120px")."</td>
</tr>
<tr>
<td colspan=2 align='right'><hr>". button("{import}","MigrateUsersToLdapPerform()")."</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<script>
var x_MigrateUsersToLdapPerform= function (obj) {
var tempvalue=obj.responseText;
if(tempvalue.length>0){alert(tempvalue);}
YahooWin5Hide();
RefreshTab('emailing_campaigns');
}
function MigrateUsersToLdapPerform(){
if(confirm('$confirm')){
var XHR = new XHRConnection();
XHR.appendData('database-migrate-perform','$ID');
XHR.appendData('ou','{$_GET["ou"]}');
XHR.appendData('gpid',document.getElementById('emailing_gpid_migr').value);
XHR.appendData('export_domain',document.getElementById('export_domain').value);
XHR.appendData('export_default_password',document.getElementById('export_default_password').value);
if(document.getElementById('database_migrate_popup_id')){document.getElementById('database_migrate_popup_id').innerHTML='<center style=\"margin:20px;padding:20px\"><img src=\"img/wait_verybig.gif\"></center>';}
XHR.sendAndLoad('$page', 'GET',x_MigrateUsersToLdapPerform);
}
}
</script>
";
echo $tpl->_ENGINE_parse_body("$html");
}
示例15: GROUPS_LIST
function GROUPS_LIST($OU)
{
writelogs("startup ou={$OU}", __FUNCTION__, __FILE__);
$page = CurrentPageName();
$ou = $OU;
if (is_base64_encoded($ou)) {
$ou = base64_decode($ou);
}
writelogs("Encoded ou ? =\"{$ou}\" {$_SESSION["uid"]}", __FUNCTION__, __FILE__);
$ldap = new clladp();
$users = new usersMenus();
if ($users->AsArticaAdministrator) {
writelogs("AsArticaAdministrator privileges", __FUNCTION__, __FILE__);
$org = $ldap->hash_get_ou(true);
while (list($ou1, $ou2) = each($org)) {
$orgs_encoded[base64_encode($ou1)] = $ou2;
}
//$orgs=Field_array_Hash($orgs_encoded,'SelectOuList',base64_encode($ou),"LoadGroupList()",null,0,'width:250px');
$hash = $ldap->hash_groups($ou, 1);
writelogs("AsArticaAdministrator:: Load " . count($hash) . " groups from ou {$ou}", __FUNCTION__, __FILE__);
} else {
$ou = ORGANISTATION_FROM_USER();
//$orgs="<strong>$ou</strong><input type='hidden' name=SelectOuList id='SelectOuList' value='$ou'>";
if (!$users->AsOrgAdmin) {
$hash = $ldap->UserGetGroups($_SESSION["uid"], 1);
}
if ($users->AsOrgAdmin) {
$hash = $ldap->hash_groups($ou, 1);
}
}
if (is_array($hash)) {
while (list($num, $line) = each($hash)) {
if (strtolower($line) == 'default_group') {
unset($hash["{$num}"]);
}
$tr[] = $num;
}
}
$orgs = Field_hidden("SelectOuList", base64_encode($ou));
writelogs("Load " . count($hash) . " groups from ou {$ou}", __FUNCTION__, __FILE__);
$hash[null] = "{select_group}";
reset($hash);
$field = Field_array_Hash($hash, 'SelectGroupList', null, "LoadGroupSettings()", null, 0, 'width:250px');
$html = "\n\t{$orgs}\n\t<table style='width:300px'>\n\t<td width=80%>{$field}</td>\n\t<td width=1%>" . imgtootltip('20-refresh.png', '{refresh}', "RefreshGroupList()") . "</td>\n\t<td width=1%>" . button("{add}", "Loadjs('{$page}?popup-add-group=yes&ou={$ou}')") . "</td>\n\t</tr>\n\t</table>\n\t\n\t<script>\n\tfunction RefreshGroupList(){\n\t\t\tLoadAjax('grouplist','{$page}?LoadGroupList={$ou}')\n\t\t\n\t\t}\n\t\n\tLoadGroupSettings('{$tr[0]}');\t\n\t</script>\n\t\n\t\n\t";
$tpl = new templates();
return $tpl->_ENGINE_parse_body($html);
}