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


PHP clladp::hash_users_ou方法代码示例

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


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

示例1: sync

function sync($ou){
	
if(!Build_pid_func(__FILE__,__FUNCTION__)){
	writelogs(basename(__FILE__).":Already executed.. aborting the process",basename(__FILE__),__FILE__,__LINE__);
	return;
}
$unix=new unix();	
$imapsync=$unix->find_program("imapsync");


	if(!is_file($unix->find_program("imapsync"))){
		writelogs("Unable to stat imapsync",__FUNCTION__,__FILE__,__LINE__);
		send_email_events("Could not migrate from cyrus to zarafa","Unable to stat imapsync tool,aborting","mailbox");
		return;
	}
	
	$ou=base64_decode($ou);
	
	
	$ldap=new clladp();
	$members=$ldap->hash_users_ou($ou);
	writelogs("Loading $ou organization ".count($members)." members imapsync=$imapsync",__FUNCTION__,__FILE__,__LINE__);
	send_email_events("migration from cyrus to zarafa starting","Cyrus to zarafa starting (". count($members)." members)","mailbox");
	

	while (list ($uid, $name) = each ($members) ){
		if($uid==null){continue;}
		$user=new user($uid);
		send_email_events("migration from cyrus to zarafa starting","Cyrus to zarafa starting (". count($members)." members)","mailbox");
		$cmdline="$imapsync  --noauthmd5  --subscribe --host1 127.0.0.1 --port1 1143";
		$cmdline=$cmdline." --user1 $uid --password1 $user->password --delete --expunge1";
		$cmdline=$cmdline." --sep2 / --prefix2 \"\" --host2 127.0.0.1 --user2 $uid --password2 $user->password >/root/imapsync.$uid 2>&1";
		writelogs("$cmdline",__FUNCTION__,__FILE__,__LINE__);
		shell_exec($cmdline);
		$datas=@file_get_contents("/root/imapsync.$uid");
		if($GLOBALS["VERBOSE"]){
			echo "$datas";
		}
		if(strlen($datas)>0){
			send_email_events("$uid migration status",@file_get_contents("/root/imapsync.$uid"),"mailbox");
		}
		@unlink("/root/imapsync.$uid");
		
		
	}
	
	
	
	
	
	
}
开发者ID:rsd,项目名称:artica-1.5,代码行数:52,代码来源:exec.zarafa-migrate.php

示例2: DeleteMailboxesOU

function DeleteMailboxesOU($ou)
{
    $ldap = new clladp();
    $hash = $ldap->hash_users_ou($ou);
    if (!is_array($hash)) {
        return true;
    }
    while (list($num, $ligne) = each($hash)) {
        if (trim($num) == null) {
            continue;
        }
        error_log("PHP Infos: Delete {$num} mailbox", 0);
        system("/usr/share/artica-postfix/bin/artica-install --delete-mailbox \"{$num}\"");
    }
}
开发者ID:brucewu16899,项目名称:artica,代码行数:15,代码来源:exec.delete-ou.php

示例3: start

function start()
{
    $sock = new sockets();
    $ZarafaAdbksWhiteTask = $sock->GET_INFO("ZarafaAdbksWhiteTask");
    $ZarafaWhiteSentItems = $sock->GET_INFO("ZarafaWhiteSentItems");
    $ZarafaJunkItems = $sock->GET_INFO("ZarafaJunkItems");
    if (!is_numeric($ZarafaAdbksWhiteTask)) {
        $ZarafaAdbksWhiteTask = 0;
    }
    if (!is_numeric($ZarafaWhiteSentItems)) {
        $ZarafaWhiteSentItems = 1;
    }
    if (!is_numeric($ZarafaJunkItems)) {
        $ZarafaJunkItems = 0;
    }
    if ($ZarafaAdbksWhiteTask == 0) {
        return;
    }
    $q = new mysql();
    $q->BuildTables();
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $pidtime = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    if ($unix->process_exists($unix->get_pid_from_file($pidfile))) {
        system_admin_events("Already exists in memory, aborting task", __FUNCTION__, __FILE__, __LINE__, "zarafa");
        return;
    }
    @file_put_contents($pidfile, getmypid());
    $ZarafaServerListenIP = $sock->GET_INFO("ZarafaServerListenIP");
    if ($ZarafaServerListenIP == null) {
        $ZarafaServerListenIP = "127.0.0.1";
    }
    if ($ZarafaServerListenIP == "0.0.0.0") {
        $ZarafaServerListenIP = "127.0.0.1";
    }
    $TimeFile = $unix->file_time_min($pidtime);
    if ($TimeFile < 240) {
        return;
    }
    @unlink($pidtime);
    @file_put_contents($pidtime, time());
    $ldap = new clladp();
    $ous = $ldap->hash_get_ou(true);
    $countDeOu = count($ous);
    system_admin_events("Parsing {$countDeOu} organization(s)", __FUNCTION__, __FILE__, __LINE__, "zarafa");
    $GLOBALS["ITEMSC"] = 0;
    while (list($ou, $none) = each($ous)) {
        $users = $ldap->hash_users_ou($ou);
        $CountDeUsers = count($users);
        system_admin_events("{$ou} {$CountDeUsers} users", __FUNCTION__, __FILE__, __LINE__, "zarafa");
        if (!is_array($users)) {
            continue;
        }
        if (count($users) == 0) {
            continue;
        }
        while (list($uid, $none2) = each($users)) {
            if (trim($uid) == null) {
                continue;
            }
            import_contacts($uid, $ZarafaServerListenIP);
            if ($ZarafaWhiteSentItems == 1) {
                import_sentitems($uid);
            }
            if ($ZarafaJunkItems == 1) {
                inject_blacklists($uid);
            }
        }
    }
    system_admin_events("Adding {$GLOBALS["ITEMSC"]} contacts in white list", __FUNCTION__, __FILE__, __LINE__, "zarafa");
    $EnableAmavisDaemon = $sock->GET_INFO("EnableAmavisDaemon");
    if (!is_numeric($EnableAmavisDaemon)) {
        $EnableAmavisDaemon = 0;
    }
    $php5 = $unix->LOCATE_PHP5_BIN();
    $users = new usersMenus();
    if ($users->AMAVIS_INSTALLED) {
        if ($EnableAmavisDaemon == 1) {
            shell_exec("{$php5} " . dirname(__FILE__) . "/exec.amavis.php >/dev/null 2>&1");
            shell_exec("/etc/init.d/amavis reload");
        }
    }
    if ($users->MILTERGREYLIST_INSTALLED) {
        shell_exec("{$php5} " . dirname(__FILE__) . "/exec.milter-greylist.php >/dev/null 2>&1");
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:86,代码来源:exec.mapiContacts.php

示例4: CountDeUsers

function CountDeUsers(){
	$ldap=new clladp();
	$arr=$ldap->hash_users_ou(null);
	@file_put_contents("/etc/artica-postfix/UsersNumber",count($arr));
}
开发者ID:rsd,项目名称:artica-1.5,代码行数:5,代码来源:exec.samba.php

示例5: GroupUsers

function GroupUsers($gid)
{
    $tabs = GroupTabs($gid);
    $gid = $_GET["GroupEdit"];
    $ldap = new clladp();
    $hash = $ldap->GroupDatas($gid);
    $ou = $hash["ou"];
    $users = $ldap->hash_users_ou($ou);
    if (is_array($users)) {
        $USER_LIST = "<table>\n\t\t<tr class=rowT>\n\t\t\t<td>{domain} {users}</TD>\n\t\t</tr>\n\t\t<tr class='rowH'>\n\t\t<td colspan=2>{group how to add user}</td>\n\t\t</tr>\n\t\t";
        while (list($num, $ligne) = each($users)) {
            if ($class = "rowA") {
                $class = "rowB";
            } else {
                $class = "rowA";
            }
            if ($hash["members"][$num] == null) {
                $USER_LIST = $USER_LIST . "<tr class={$class}>\n\t\t\t<td><a href='#' OnClick=\"javascript:GroupUserAdd({$gid},'{$num}');\">{$ligne}</td>\n\t\t\t<tr>";
            }
        }
        $USER_LIST = $USER_LIST . "</table>";
    }
    if (is_array($hash["members"])) {
        $USER_GLIST = "<table>\n\t\t<tr class=rowT>\n\t\t\t<td>{group} {users}</TD>\n\t\t</tr>\n\t\t<tr class='rowH'>\n\t\t<td colspan=2>{group how to del user}</td>\n\t\t</tr>\n\t\t";
        while (list($num, $ligne) = each($hash["members"])) {
            if ($class = "rowA") {
                $class = "rowB";
            } else {
                $class = "rowA";
            }
            $USER_GLIST = $USER_GLIST . "<tr class={$class}>\n\t\t\t<td><a href='#' OnClick=\"javascript:GroupUserDelete({$gid},'{$num}');\">{$ligne}</td>\n\t\t\t<tr>";
        }
        $USER_GLIST = $USER_GLIST . "</table>";
    }
    $html = "\n\n\t{$tabs}\n\t<table style='margin:0px;padding:0px;border:0px;margin-top:5px'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/user-group-90.gif'></td>\n\t<td width=50% valign='top'>{$USER_GLIST}</td>\n\t<td width=50% valign='top'>{$USER_LIST}</td>\n\t</tr>\n\t</table>\n\t";
    $tpl = new templates();
    echo DIV_SHADOW($tpl->_parse_body($html), 'windows');
}
开发者ID:brucewu16899,项目名称:artica,代码行数:38,代码来源:group.edit.php


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