]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/baculum/protected/Web/Portlets/Users.php
baculum: Tweak enable updating repeater with user list
[bacula/bacula] / gui / baculum / protected / Web / Portlets / Users.php
index 265ae880968a8dd87a47218bcedfc88f71d15d06..74d86360797dfad5ad1ea1c3470ea33bf63d1f37 100644 (file)
  */
 
 
-Prado::using('System.Web.UI.WebControls.TConditional');
+Prado::using('System.Web.UI.ActiveControls.TActiveRepeater');
 Prado::using('Application.Web.Portlets.Portlets');
 
 class Users extends Portlets {
 
        public $web_config;
 
-       public function onInit($param) {
-               parent::onInit($param);
+       public function __construct() {
+               parent::__construct();
                $this->web_config = $this->getModule('web_config')->getConfig();
-               $this->setUsers();
        }
 
        public function setUsers() {
@@ -68,6 +67,7 @@ class Users extends Portlets {
                if(!$_SESSION['admin']) {
                        return;
                }
+               $this->UsersList->ActiveControl->EnableUpdate = true;
                list($action, $user, $value) = explode(';', $param->CallbackParameter, 3);
                switch($action) {
                        case 'newuser':
@@ -96,6 +96,10 @@ class Users extends Portlets {
                        case 'rmuser': {
                                        if ($user != $_SERVER['PHP_AUTH_USER']) {
                                                $this->getModule('basic_webuser')->removeUser($user);
+                                               if (array_key_exists('users', $this->web_config) && array_key_exists($user, $this->web_config['users'])) {
+                                                       unset($this->web_config['users'][$user]);
+                                               }
+                                               $this->getModule('web_config')->setConfig($this->web_config);
                                                $this->setUsers();
                                        }
                                break;