fix typo giving fatal error on Univention Installation

This commit is contained in:
Ralf Becker 2015-07-29 16:07:36 +00:00
parent 1eda847c47
commit bc595da0a5
2 changed files with 5 additions and 4 deletions

View File

@ -1401,9 +1401,10 @@ class emailadmin_account implements ArrayAccess
* *
* @param boolean $smtp =false false: usable for IMAP, true: usable for SMTP * @param boolean $smtp =false false: usable for IMAP, true: usable for SMTP
* @param boolean $return_id =false true: return acc_id, false return account object * @param boolean $return_id =false true: return acc_id, false return account object
* @param boolean $log_no_default =true true: error_log if no default found, false be silent
* @return emailadmin_account|null * @return emailadmin_account|null
*/ */
static function get_default($smtp=false, $return_id=false) static function get_default($smtp=false, $return_id=false, $log_no_default=true)
{ {
try try
{ {
@ -1443,7 +1444,7 @@ class emailadmin_account implements ArrayAccess
} }
catch (Exception $e) catch (Exception $e)
{ {
error_log(__METHOD__.__LINE__.' Error no Default available.'.$e->getMessage()); if ($log_no_default) error_log(__METHOD__.__LINE__.' Error no Default available.'.$e->getMessage());
} }
return null; return null;
} }

View File

@ -67,7 +67,7 @@ class accounts_univention extends accounts_ldap
// get_default() does not work for Adminstrator, try acc_id=1 instead // get_default() does not work for Adminstrator, try acc_id=1 instead
// if everything fails try hostname ... // if everything fails try hostname ...
try { try {
if (!($account = emailadmin_account::get_default())) if (!($account = emailadmin_account::get_default(false, false, false)))
{ {
$account = emailadmin_account::read(1); $account = emailadmin_account::read(1);
} }
@ -76,7 +76,7 @@ class accounts_univention extends accounts_ldap
catch(Exception $e) { catch(Exception $e) {
unset($e); unset($e);
} }
if (empty($hostname)) $hostname = trunc(system('hostname -f')); if (empty($hostname)) $hostname = trim(system('hostname -f'));
$params[] = '--set'; $params[] = 'mailHomeServer='.$hostname; $params[] = '--set'; $params[] = 'mailHomeServer='.$hostname;
} }
$cmd = self::DIRECTORY_MANAGER_BIN.' '.implode(' ', array_map('escapeshellarg', $params)); $cmd = self::DIRECTORY_MANAGER_BIN.' '.implode(' ', array_map('escapeshellarg', $params));