diff --git a/addressbook/inc/class.addressbook_univention.inc.php b/addressbook/inc/class.addressbook_univention.inc.php new file mode 100644 index 0000000000..7698163e70 --- /dev/null +++ b/addressbook/inc/class.addressbook_univention.inc.php @@ -0,0 +1,20 @@ + + * @package addressbook + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @version $Id$ + */ + +/** + * Univention backend for accounts + * + * There's currently no difference to LDAP backend + */ +class addressbook_univention extends addressbook_ldap +{ + +} diff --git a/doc/rpm-build/post_install.php b/doc/rpm-build/post_install.php index 739e52083b..5491824b76 100755 --- a/doc/rpm-build/post_install.php +++ b/doc/rpm-build/post_install.php @@ -778,7 +778,7 @@ function set_univention_defaults() if (!is_array($domains)) $domains = explode("\n", $domains); $domain = array_shift($domains); $config['smtpserver'] = "$mailserver,465,,,yes,tls"; - $config['smtp'] = 'no,emailadmin_smtp_ldap_univention'; + $config['smtp'] = ',emailadmin_smtp_ldap_univention'; $config['mailserver'] = "$mailserver,993,$domain,email,tls"; $config['imap'] = /*'cyrus,'._ucr_secret('cyrus')*/','.',emailadmin_imap_cyrus'; $config['folder'] = 'INBOX/Sent,INBOX/Trash,INBOX/Drafts,INBOX/Templates,INBOX/Spam'; diff --git a/phpgwapi/inc/class.accounts_univention.inc.php b/phpgwapi/inc/class.accounts_univention.inc.php index bfafc8a426..9283d57c38 100644 --- a/phpgwapi/inc/class.accounts_univention.inc.php +++ b/phpgwapi/inc/class.accounts_univention.inc.php @@ -37,11 +37,13 @@ class accounts_univention extends accounts_ldap { if (!$data['account_id'] && $data['account_type'] !== 'g' && self::available()) { + $config = $this->frontend->config && $this->frontend->config['ldap_context'] ? + $this->frontend->config : $GLOBALS['egw_info']['server']; $params = array( 'users/user','create', - '--binddn', $this->frontend->config['ldap_root_dn'], - '--bindpwd', 5=>$this->frontend->config['ldap_root_pw'], - '--position', $this->frontend->config['ldap_context'], + '--binddn', $config['ldap_root_dn'], + '--bindpwd', 5=>$config['ldap_root_pw'], + '--position', $config['ldap_context'], '--set', 'username='.$data['account_lid'], '--set', 'firstname='.$data['account_firstname'], '--set', 'lastname='.$data['account_lastname'], @@ -57,7 +59,7 @@ class accounts_univention extends accounts_ldap $cmd = self::DIRECTORY_MANAGER_BIN.' '.implode(' ', array_map('escapeshellarg', $params)); $output_arr = $ret = $matches = null; exec($cmd, $output_arr, $ret); - $output = explode("\n", $output_arr); + $output = implode("\n", $output_arr); if ($ret || !preg_match('/^Object created: (uid=.*)$/mui', $output, $matches)) { $params[5] = '********'; // mask out password! @@ -65,7 +67,7 @@ class accounts_univention extends accounts_ldap throw new egw_exception_wrong_userinput($cmd."\nreturned\n".$output); } $data['account_dn'] = $matches[1]; - $data['account_id'] = $this->name2id($matches[1], 'account_dn', 'u'); + $data['account_id'] = $this->name2id($data['account_lid'], 'account_lid', 'u'); } return parent::save($data); } diff --git a/setup/inc/class.setup.inc.php b/setup/inc/class.setup.inc.php index bd77b8528a..516c2ff5fd 100644 --- a/setup/inc/class.setup.inc.php +++ b/setup/inc/class.setup.inc.php @@ -969,7 +969,7 @@ class setup function setup_account_object(array $config=array()) { - if (!isset($this->accounts) || $config) + if (!isset($this->accounts) || $this->accounts->config || $config) { if (!is_object($this->db)) {