Code

Added release selector
[gosa.git] / gosa-core / plugins / admin / users / class_userManagement.inc
index 99fb427450adc6212f149b07148930e1db857540..c4ca4e77bf5001b6a47bf22452925c4d623f4b39 100644 (file)
@@ -42,6 +42,8 @@ class userManagement extends management
   protected $aclPlugin   = "user";
   protected $objectName   = "user";
 
+  protected $releaseSelector = NULL;
+
   function __construct($config,$ui)
   {
     $this->config = $config;
@@ -102,9 +104,25 @@ class userManagement extends management
     $this->registerAction("edit_environment","editEntry");
     $this->registerAction("edit_gofaxAccount","editEntry");
     $this->registerAction("edit_phoneAccount","editEntry");
+      
+    $rel = array("a" => "/");
+    $rel['b,a'] = "test";
+    $rel['c,a'] = "test/f";
+    $this->releaseSelector = new releaseSelector($rel, "a");
   }
 
 
+  function renderList()
+  {
+    $smarty = get_smarty();
+    $smarty->assign("RELEASE", $this->releaseSelector->render());
+    return(management::renderList());
+  }
+
+
+
   // Inject user actions 
   function detectPostActions()
   {
@@ -228,11 +246,12 @@ class userManagement extends management
 
   function handlePasswordQueue()
   {
+    $smarty = get_smarty();
+
     // Get next entry from queue.
     if(empty($this->dn) && count($this->pwd_change_queue)){
       $this->dn = array_pop($this->pwd_change_queue);
       set_object_info($this->dn);
-      $smarty = get_smarty();
       return ($smarty->fetch(get_template_path('password.tpl', TRUE)));
     }
 
@@ -253,7 +272,6 @@ class userManagement extends management
       // Display errors
       if (count($message) != 0){
         msg_dialog::displayChecks($message);
-        $smarty = get_smarty();
         return($smarty->fetch(get_template_path('password.tpl', TRUE)));
       }
 
@@ -295,8 +313,19 @@ class userManagement extends management
   function saveChanges()
   {
     $str = management::saveChanges();
+  
     if(!empty($str)) return($str);
 
+    if($this->last_tabObject instanceOf multi_plug){
+      foreach($this->last_tabObject->a_handles as $user){
+        if($user->password_change_needed()){
+          $this->force_hash_type[$user->dn] = $user->by_object['user']->pw_storage;
+          $this->pwd_change_queue[] = $user->dn;
+        }
+      }
+      return($this->handlePasswordQueue());
+    }
+
     if(isset($this->last_tabObject->by_object['user']) && $this->last_tabObject->by_object['user']->password_change_needed()){
       $this->force_hash_type[$this->last_tabObject->dn] = $this->last_tabObject->by_object['user']->pw_storage;
       $this->pwd_change_queue[] = $this->last_tabObject->dn;
@@ -541,6 +570,7 @@ class userManagement extends management
       // Check entry locking
       foreach($target as $dn){
         if (($user= get_lock($dn)) != ""){
+          $this->dn = $dn;
           return(gen_locked_message ($user, $dn));
         }
         $this->dns[] = $dn;
@@ -774,11 +804,9 @@ class userManagement extends management
     // Walk thru map
     foreach ($map as $oc => $properties) {
       if (in_array_ics($oc, $classes)) {
-        $result.="<input class='center' type='image' src='".$properties['image']."' ".
-                 "alt='".$properties['alt']."' title='".$properties['title'].
-                 "' name='listing_edit_".$properties['plugin']."_$row' style='padding:1px'>";
+        $result.= image($properties['image'], "listing_edit_".$properties['plugin']."_$row", $properties['title']);
       } else {
-        $result.="<img src='images/empty.png' alt=' ' class='center' style='padding:1px'>";
+        $result.= image('images/empty.png');
       }
     }
     return $result;