Exemple #1
0
    $GLOBALS["RESTART"] = true;
}
if ($argv[1] == "--kinit") {
    kinit_config();
    exit;
}
if ($argv[1] == "--DirectorySize") {
    DirectorySize();
    exit;
}
if ($argv[1] == "--cyrusadm-ad") {
    ExtractCyrusAdmAD();
    exit;
}
if ($argv[1] == "--imaps-failed") {
    cyrus_ssl_error();
    exit;
}
if ($argv[1] == "--DB_CONFIG") {
    DB_CONFIG();
    exit;
}
function ExtractCyrusAdmAD()
{
    $sock = new sockets();
    $CyrusToAD = $sock->GET_INFO("CyrusToAD");
    $EnableSambaActiveDirectory = $sock->GET_INFO("EnableSambaActiveDirectory");
    if (!is_numeric($EnableSambaActiveDirectory)) {
        $EnableSambaActiveDirectory = 0;
    }
    if ($CyrusToAD == null) {
Exemple #2
0
<?php
include_once(dirname(__FILE__).'/ressources/class.templates.inc');
include_once(dirname(__FILE__).'/ressources/class.ini.inc');
if(posix_getuid()<>0){die("Cannot be used in web server mode\n\n");}
include_once(dirname(__FILE__).'/framework/class.unix.inc');
include_once(dirname(__FILE__)."/framework/frame.class.inc");

if(preg_match("#--verbose#",implode(" ",$argv))){$GLOBALS["debug"]=true;$GLOBALS["VERBOSE"]=true;}
if(preg_match("#--reload#",implode(" ",$argv))){$GLOBALS["RELOAD"]=true;$GLOBALS["RESTART"]=true;}
if($argv[1]=="--kinit"){kinit_config();exit;}
if($argv[1]=="--DirectorySize"){DirectorySize();exit;}
if($argv[1]=="--cyrusadm-ad"){ExtractCyrusAdmAD();exit;}
if($argv[1]=="--imaps-failed"){cyrus_ssl_error();exit;}
if($argv[1]=="--DB_CONFIG"){DB_CONFIG();exit;}




function ExtractCyrusAdmAD(){
	$sock=new sockets();
	$CyrusToAD=$sock->GET_INFO("CyrusToAD");
	$EnableSambaActiveDirectory=$sock->GET_INFO("EnableSambaActiveDirectory");
	if(!is_numeric($EnableSambaActiveDirectory)){$EnableSambaActiveDirectory=0;}
	if($CyrusToAD==null){$CyrusToAD=0;}
	@unlink("/etc/artica-postfix/CyrusAdmPlus");
	if($CyrusToAD==0){return;}
	$array=unserialize(base64_decode($sock->GET_INFO("CyrusToADConfig")));
	if($EnableSambaActiveDirectory==1){
		$newconf=unserialize(base64_decode($sock->GET_INFO("SambaAdInfos")));
		$array["domain"]=$newconf["ADDOMAIN"];
		$array["servername"]=$newconf["ADSERVER"];