@ -1606,104 +1606,6 @@ function table_by_key ($table_key) {
/*
Called after a mailbox has been deleted in the DBMS.
Returns: boolean.
*/
function mailbox_postdeletion($username,$domain) {
$cmd = Config::read('mailbox_postdeletion_script');
if ( empty($cmd) ) {
return true;
}
if (empty($username) || empty($domain)) {
print '< p > Warning: empty username and/or domain parameter.< / p > ';
return false;
}
$cmdarg1=escapeshellarg($username);
$cmdarg2=escapeshellarg($domain);
$command = "$cmd $cmdarg1 $cmdarg2";
$retval=0;
$output=array();
$firstline='';
$firstline=exec($command,$output,$retval);
if (0!=$retval) {
error_log("Running $command yielded return value=$retval, first line of output=$firstline");
print '< p > WARNING: Problems running mailbox postdeletion script!< / p > ';
return FALSE;
}
return TRUE;
}
/*
Called after a domain has been added in the DBMS.
Returns: boolean.
*/
# TODO: move to DomainHandler
# TODO: replace "print" with $this->errormsg (or infomsg?)
function domain_postcreation($domain) {
$script=Config::read('domain_postcreation_script');
if (empty($script)) {
return true;
}
if (empty($domain)) {
print '< p > Warning: empty domain parameter.< / p > ';
return false;
}
$cmdarg1=escapeshellarg($domain);
$command= "$script $cmdarg1";
$retval=0;
$output=array();
$firstline='';
$firstline=exec($command,$output,$retval);
if (0!=$retval) {
error_log("Running $command yielded return value=$retval, first line of output=$firstline");
print '< p > WARNING: Problems running domain postcreation script!< / p > ';
return FALSE;
}
return TRUE;
}
/*
Called after a domain has been deleted in the DBMS.
Returns: boolean.
*/
# TODO: move to DomainHandler (after moving the delete code there)
# TODO: replace "print" with $this->errormsg (or infomsg?)
function domain_postdeletion($domain) {
$script=Config::read('domain_postdeletion_script');
if (empty($script)) {
return true;
}
if (empty($domain)) {
print '< p > Warning: empty domain parameter.< / p > ';
return false;
}
$cmdarg1=escapeshellarg($domain);
$command= "$script $cmdarg1";
$retval=0;
$output=array();
$firstline='';
$firstline=exec($command,$output,$retval);
if (0!=$retval) {
error_log("Running $command yielded return value=$retval, first line of output=$firstline");
print '< p > WARNING: Problems running domain postdeletion script!< / p > ';
return FALSE;
}
return TRUE;
}
/*
Called after an alias_domain has been deleted in the DBMS.
Returns: boolean.