Beispiel #1
0
function LoadUserRules()
{
    $ldap = new clladp();
    $hash = $ldap->find_users_by_mail($_GET["UserRules"]);
    $tpl = new templates();
    if (!is_array($hash)) {
        echo $tpl->_ENGINE_parse_body("Pattern: {$_GET["UserRules"]} : {no_users_in_database");
        exit;
    }
    $html = "<br><table style='width:100%'>";
    while (list($num, $ligne) = each($hash)) {
        $u = $ldap->UserDatas($num);
        $count = count($u["FetchMailsRulesSources"]);
        if ($count > 0) {
            $uri = texttooltip($num, '{edit_rules}', "LoadFetchMailRuleFromUser('{$num}')");
        } else {
            $uri = $num;
        }
        $html = $html . "<tr>\n\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t<td>{$uri}</td>\n\t\t<td>{$ligne}</td>\n\t\t<td>{$count} {rules}</td>\n\t\t</tr>";
    }
    $html = $html . "</table>";
    echo RoundedLightGreen($tpl->_ENGINE_parse_body($html));
}
function page_fetchmail_aliases_add(){
	$email=trim($_GET["FetchmailAddAliase"]);
	
	$ldap=new clladp();
	$hash=$ldap->find_users_by_mail($email);
	if($hash>0){
		$tpl=new templates();
		echo $tpl->_ENGINE_parse_body('{error_alias_exists}');
		exit;
	}
	
	$uid=$_GET["uid"];
	$users=new user($uid);
	$users->add_alias_fetchmail($email);
	
}