function planned_delete($db_array, $path)
{
    # used to cleanup outdated mailboxes
    $dbhandler = "";
    open_db($dbhandler, $db_array);
    $request = $dbhandler->query("SELECT * FROM `mailboxlist`");
    while ($row = mysqli_fetch_array($request)) {
        $current = time();
        $current_readable = date('Y-m-d H:i:s', time());
        $creation = strtotime($row["creationdate"]);
        $creation_readable = $row["creationdate"];
        $ttl = $row["duration"] * 60 * 60;
        $removing = $creation + $ttl;
        $removing_readable = date('Y-m-d H:i:s', $removing);
        # converts
        if ($current >= $removing) {
            # Action for expired mailboxes
            $boxname = $row["boxname"];
            delete_mailbox($db_array, $boxname, $path);
            $to = $row["destination"];
            sent_status_mail($to);
            #echo "Die Mailbox ".$row["boxname"]." wurde gelöscht!<br \>";
        } else {
            #echo "for debug purposes<br \>";
        }
    }
    mysqli_close($dbhandler);
}
예제 #2
0
파일: cmd.php 프로젝트: brucewu16899/artica
}
//cyrus
if (isset($_GET["mailboxlist-domain"])) {
    cyrus_mailboxlist_domain();
    exit;
}
if (isset($_GET["mailboxlist"])) {
    cyrus_mailboxlist();
    exit;
}
if (isset($_GET["mailbox-delete"])) {
    cyrus_mailboxdelete();
    exit;
}
if (isset($_GET["DelMbx"])) {
    delete_mailbox();
    exit;
}
if (isset($_GET["cyrus-check-cyr-accounts"])) {
    cyrus_check_cyraccounts();
    exit;
}
if (isset($_GET["cyrus-reconfigure"])) {
    cyrus_reconfigure();
    exit;
}
if (isset($_GET["cyrus-get-partition-default"])) {
    cyrus_paritition_default_path();
    exit;
}
if (isset($_GET["cyrus-MoveDefaultToCurrentDir"])) {
예제 #3
0
    exit;
}
if ($argv[1] == "--DB_CONFIG") {
    DB_CONFIG();
    exit;
}
if ($argv[1] == "--listmailboxes") {
    listmailboxes();
    exit;
}
if ($argv[1] == "--listmailboxes-domains") {
    listmailboxes($argv[2]);
    exit;
}
if ($argv[1] == "--delete-mailbox") {
    delete_mailbox($argv[2]);
    exit;
}
function listmailboxes()
{
    $unix = new unix();
    $cachefile = "∕etc/artica-postfix/listmailboxes.db";
    $ldap = new clladp();
    $cyruspass = $ldap->CyrusPassword();
    if ($cyruspass == null) {
        echo "Warning cyrus password is not set!!!\n";
    }
    $cmd = "/usr/share/artica-postfix/bin/cyrus-admin.pl -u cyrus -p \"{$cyruspass}\" --list 2>&1";
    if ($GLOBALS["VERBOSE"]) {
        echo $cmd . "\n";
    }
예제 #4
0
                    $form_array = array("Boxname" => $boxname, "Destination" => $destination, "ttl" => $duration, "Comment" => $comment);
                    create_mailbox($db_array, $form_array, $path);
                }
            }
        } else {
            echo "Fehler in POST";
            echo "<pre>";
            print_r($_POST);
            echo "</pre>";
        }
    }
}
if (isset($_POST["delete"])) {
    # check for delete mark
    $boxname = $_POST["deleteboxname"];
    delete_mailbox($db_array, $boxname, $path);
} else {
    # show form to create mailbox
    $form_array_specific = "";
    $form_array_random = "";
    ?>
	
	<div>
		<form action="<?php 
    htmlentities($_SERVER['PHP_SELF']);
    ?>
" method="POST">
			<table>
				<tr>
					<th colspan="2"><?php 
    echo $text_set_name;
예제 #5
0
파일: cmd.php 프로젝트: rsd/artica-1.5
if(isset($_GET["safebox-logs"])){safebox_logs();exit;}
if(isset($_GET["check-safebox"])){safebox_check();exit;}

//ntpd
if(isset($_GET["ntpd-restart"])){ntpd_restart();exit;}
if(isset($_GET["ntpd-events"])){ntpd_events();exit;}

//zabix
if(isset($_GET["zabbix-restart"])){zabbix_restart();exit;}


//cyrus
if(isset($_GET["mailboxlist-domain"])){cyrus_mailboxlist_domain();exit;}
if(isset($_GET["mailboxlist"])){cyrus_mailboxlist();exit;}
if(isset($_GET["mailbox-delete"])){cyrus_mailboxdelete();exit;}
if(isset($_GET["DelMbx"])){delete_mailbox();exit;}
if(isset($_GET["cyrus-check-cyr-accounts"])){cyrus_check_cyraccounts();exit;}
if(isset($_GET["cyrus-reconfigure"])){cyrus_reconfigure();exit;}
if(isset($_GET["cyrus-get-partition-default"])){cyrus_paritition_default_path();exit;}
if(isset($_GET["cyrus-MoveDefaultToCurrentDir"])){cyrus_move_default_dir_to_currentdir();exit;}
if(isset($_GET["cyrus-SaveNewDir"])){cyrus_move_newdir();exit;}
if(isset($_GET["cyrus-rebuild-all-mailboxes"])){cyrus_rebuild_all_mailboxes();exit;}
if(isset($_GET["cyrus-imap-status"])){cyrus_imap_status();exit;}
if(isset($_GET["cyrus-change-password"])){cyrus_imap_change_password();}
if(isset($_GET["cyrus-empty-mailbox"])){cyrus_empty_mailbox();exit;}
if(isset($_GET["cyrus-to-ad"])){cyrus_activedirectory();exit;}
if(isset($_GET["cyrus-to-ad-events"])){cyrus_activedirectory_events();exit;}
if(isset($_GET["cyrus-sync-to-ad"])){cyrus_sync_to_ad();exit;}

if(isset($_GET["cyrus-mailbox-exists"])){cyrus_mailbox_exists();exit;}
if(isset($_GET["cyrus-db-config"])){cyrus_db_config();exit;}