From: hickert Date: Tue, 28 Jun 2011 08:10:02 +0000 (+0000) Subject: Fixed problem with user creation from template. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=841ec62329b867b0e9339e1680d96b653ea9ce65;p=gosa.git Fixed problem with user creation from template. -If no uid could be generated, then allow to assign it manually. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20920 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index d215c6096..f554cf372 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -592,16 +592,23 @@ class userManagement extends management if ($ldap->count () != 0){ msg_dialog::displayChecks(array(msgPool::duplicated(_("Name")))); + $smarty->assign("edit_uid", ""); }else{ // Preset uid field by using the idGenerator $attributes= array('sn' => $this->sn, 'givenName' => $this->givenName); if ($this->config->get_cfg_value("core","idGenerator") != ""){ - $uids= gen_uids ($this->config->get_cfg_value("core","idGenerator"), $attributes); - if (count($uids)){ - $smarty->assign("edit_uid", "false"); - $smarty->assign("uids", $uids); - $this->uid= current($uids); + $genStr = $this->config->get_cfg_value("core","idGenerator"); + $smarty->assign("edit_uid", ""); + if(!empty($genStr)){ + $uids= gen_uids($genStr, $attributes); + if (count($uids)){ + $smarty->assign("edit_uid", "false"); + $smarty->assign("uids", $uids); + $this->uid= current($uids); + }else{ + msg_dialog::displayChecks(array(_("Cannot generate a unique id, please specify it manually!"))); + } } } else { $smarty->assign("edit_uid", "");