Esempio n. 1
0
}
if ($GLOBALS["VERBOSE"]) {
    ini_set('display_errors', 1);
    ini_set('html_errors', 0);
    ini_set('display_errors', 1);
    ini_set('error_reporting', E_ALL);
}
include_once dirname(__FILE__) . '/ressources/class.templates.inc';
include_once dirname(__FILE__) . '/ressources/class.ldap.inc';
include_once dirname(__FILE__) . '/ressources/class.user.inc';
include_once dirname(__FILE__) . '/ressources/class.ini.inc';
include_once dirname(__FILE__) . '/ressources/class.mysql.inc';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . '/framework/frame.class.inc';
if ($argv[1] == "--upgrade-7") {
    upgradeTo7();
    exit;
}
if ($argv[1] == "--mailboxes-ou-lang") {
    mailboxes_ou_lang($argv[2]);
    exit;
}
sync($argv[1]);
die;
function mailboxes_ou_lang($ou)
{
    $unix = new unix();
    $sock = new sockets();
    $t = time();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $unix = new unix();
Esempio n. 2
0
<?php
if(posix_getuid()<>0){die("Cannot be used in web server mode\n\n");}
include_once(dirname(__FILE__).'/ressources/class.templates.inc');
include_once(dirname(__FILE__).'/ressources/class.ldap.inc');
include_once(dirname(__FILE__).'/ressources/class.user.inc');
include_once(dirname(__FILE__).'/ressources/class.ini.inc');
include_once(dirname(__FILE__).'/ressources/class.mysql.inc');
include_once(dirname(__FILE__).'/framework/class.unix.inc');
include_once(dirname(__FILE__).'/framework/frame.class.inc');
if(preg_match("#--verbose#",implode(" ",$argv))){$GLOBALS["VERBOSE"]=true;}


if($argv[1]=="--upgrade-7"){upgradeTo7();exit;}

sync($argv[1]);

die();

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");