Code

Applied patch to allow selecting the primary Group when copying users
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 May 2009 11:47:45 +0000 (11:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 May 2009 11:47:45 +0000 (11:47 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@13600 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/posix/class_posixAccount.inc
plugins/personal/posix/paste_generic.tpl

index 085146744c53d9c8f21e0f8634b47766de4550f6..7ac1e1a2670fe9baacf37b8c264e3a8936a0aeb8 100644 (file)
@@ -1201,6 +1201,10 @@ class posixAccount extends plugin
         $this->is_modified= TRUE;
       }
       $this->force_ids= $data;
+      $this->primaryGroup= $_POST['primaryGroup'];
+      if ($this->primaryGroup != 0){
+        $this->gidNumber= $this->primaryGroup;
+      }
     }
   }
 
@@ -1253,7 +1257,9 @@ class posixAccount extends plugin
 
     /* Assigned informations to smarty */
     $smarty = get_smarty();
+    $smarty->assign("secondaryGroups",$this->secondaryGroups);
     $smarty->assign("homeDirectory",$this->homeDirectory);
+    $smarty->assign("primaryGroup",$this->primaryGroup);
     $smarty->assign("uidNumber",$this->uidNumber);
     $smarty->assign("gidNumber",$this->gidNumber);
     $smarty->assign("forceMode",$forceMode);
@@ -1285,6 +1291,9 @@ class posixAccount extends plugin
     /* Avoid using the same gid/uid number as source user */
     $this->savedUidNumber = $this->get_next_id("uidNumber", $this->dn);
     $this->savedGidNumber = $this->get_next_id("gidNumber", $this->dn);
+
+    /* Fill group */
+    $this->primaryGroup= $source->gidNumber;
   }
 
   function convertToSeconds($val)
index 5f07cb7b38811df6221aa6b5757d1a886fa3b86a..a7f8ad12da9bb721a0396ffc3cb99302d757c3a6 100644 (file)
                                                <input id="homeDirectory" name="homeDirectory" size=40 maxlength=120 value="{$homeDirectory}">
                                        </td>
                                </tr>
+        <tr>
+         <td><label for="">{t}Primary group{/t}</label></td>
+         <td>
+          <select id="primaryGroup" size="1" name="primaryGroup">
+           {html_options options=$secondaryGroups selected=$primaryGroup}
+          </select> 
+         </td>
+        </tr>
                        </table>
                        <table style='width:100%;'>
                                <tr>