Code

Create user from template fixed, some Session vars wasn't initialised
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Aug 2005 10:10:03 +0000 (10:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Aug 2005 10:10:03 +0000 (10:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1121 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/users/class_userManagement.inc

index 2987d9be1459fa9efbbbf6497764a9ef8ffa3612..3e1c08410d35f16ad287dd4d0b763bff53ca335d 100644 (file)
@@ -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);
         }