From: hickert Date: Fri, 12 Aug 2005 10:10:03 +0000 (+0000) Subject: Create user from template fixed, some Session vars wasn't initialised X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=59e7fd75aa55753b49777e45986f5331351fad00;p=gosa.git Create user from template fixed, some Session vars wasn't initialised git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1121 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index 2987d9be1..3e1c08410 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -108,6 +108,7 @@ class userManagement extends plugin } $s_entry = preg_replace("/_.$/","",$s_entry); + if(preg_match("/.*-.*/",$s_entry)){ $s_tab = preg_replace("/^.*-/i","",$s_entry); $s_entry = preg_replace("/-.*$/i","",$s_entry); @@ -455,7 +456,7 @@ class userManagement extends plugin } /* Generate template list */ - if ($s_action=="new"){ + if (($s_action=="new")||($s_action=="create_user_from_tpl")){ $this->templates= array(); $ldap= $this->config->get_ldap_link(); foreach ($this->config->departments as $key => $value){ @@ -503,7 +504,7 @@ class userManagement extends plugin } /* Use template if there are any of them */ - if (count($this->templates) && !isset($_POST['new_template'])){ + if ((count($this->templates) && !isset($_POST['new_template']))||($s_action=="create_user_from_tpl")){ foreach(array("sn", "givenName", "uid", "got_uid", "templates") as $attr){ $smarty->assign("$attr", $this->$attr); }