コード例 #1
0
function SavePools()
{
    $user = $_GET["is"];
    writelogs("local user is :\"{$_GET["is"]}\"", __FUNCTION__, __FILE__);
    $tpl = new templates();
    $ldap = new clladp();
    $dn = $ldap->dn_from_email($user);
    if ($dn == null) {
        echo $tpl->_ENGINE_parse_body("\"{$user}\"\n{doesntexists}");
        exit;
    }
    $fr = new Fetchmail_settings();
    if ($fr->EditRule($_GET, $_GET["rule_number"])) {
        $fetchmail = new fetchmail();
        $fetchmail->Save();
        echo $tpl->javascript_parse_text('{success}');
    } else {
        echo $tpl->javascript_parse_text('{failed}');
    }
}
コード例 #2
0
function FETCHMAIL_EDIT($value)
{
    $array = unserialize(base64_decode($value));
    $tasksynchro = shell_exec(LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-fetchmail-rules");
    foreach ($array as $key => $value) {
        $FINAL[$key] = $value;
    }
    include_once dirname(__FILE__) . "/ressources/class.fetchmail.inc";
    $fetch = new Fetchmail_settings();
    if ($FINAL["ID"] > 0) {
        if ($fetch->EditRule($FINAL, $FINAL["ID"])) {
            send_email_events("Success Editing rule ID {$FINAL["ID"]} for {$FINAL["uid"]}", null, "CLOUD");
            return true;
        } else {
            send_email_events("Failed Editing rule ID {$FINAL["ID"]} for {$FINAL["uid"]}", null, "CLOUD");
            return true;
        }
    }
    if ($fetch->AddRule($FINAL)) {
        send_email_events("Success Adding new rule for {$FINAL["uid"]}", null, "CLOUD");
        shell_exec($tasksynchro);
    } else {
        send_email_events("Failed Adding new rule for {$FINAL["uid"]}", null, "CLOUD");
        shell_exec($tasksynchro);
    }
    return true;
}
コード例 #3
0
ファイル: exec.fetchmail.php プロジェクト: BillTheBest/1.6.x
function import_filename($filename)
{
    if (!is_file($filename)) {
        echo "{$filename} (no such file)\n";
    }
    $f = new Fetchmail_settings();
    $array = $f->parse_config(@file_get_contents($filename));
    echo "Importing " . count($array) . " lines/rules form \"{$path}\"\n";
    $fetch = new Fetchmail_settings();
    while (list($num, $ligne) = each($array)) {
        if ($fetch->EditRule($ligne, 0, true)) {
        }
    }
}
コード例 #4
0
function saverule()
{
    $uid = $_SESSION["uid"];
    $_GET["uid"] = $_SESSION["uid"];
    writelogs("local user is :\"{$_GET["is"]}\"", __FUNCTION__, __FILE__);
    $tpl = new templates();
    $ldap = new clladp();
    $user = new user($uid);
    if ($user->dn == null) {
        echo $tpl->_ENGINE_parse_body("\"{$uid}\"\n{doesntexists}");
        exit;
    }
    $fr = new Fetchmail_settings();
    $_GET["is"] = $user->mail;
    $fr->EditRule($_GET, $_GET["rule_number"]);
}
コード例 #5
0
function page_save(){
	
	$ldap=new clladp();
	$user=new user($_GET["uid"]);
	$fetchmail=new Fetchmail_settings();
	if($_GET["fetchmail_rule_id"]>-1){
		$fetchmail->EditRule($_GET,$_GET["fetchmail_rule_id"]);
		
	}else{
		
		if(!$fetchmail->AddRule($_GET)){
			echo "->AddRule Class, Mysql error !\n";
			return;
			
		}
	}
	
	$fetchmail=new fetchmail();
	$fetchmail->Save();
	
}
コード例 #6
0
function page_save(){
	$_POST["pass"]=url_decode_special_tool($_POST["pass"]);
	$ldap=new clladp();
	$user=new user($_POST["uid"]);
	$fetchmail=new Fetchmail_settings();
	if($_POST["fetchmail_rule_id"]>-1){
		$fetchmail->EditRule($_POST,$_POST["fetchmail_rule_id"]);
		
	}else{
		
		if(!$fetchmail->AddRule($_POST)){
			echo "->AddRule Class, Mysql error !\n";
			return;
			
		}
	}
	
	$fetchmail=new fetchmail();
	$fetchmail->Save();
	
}