]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Remove assigning to api host when user is deleted
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 6 Aug 2017 08:13:32 +0000 (10:13 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 6 Aug 2017 08:40:34 +0000 (10:40 +0200)
gui/baculum/protected/Web/Portlets/Users.php
gui/baculum/protected/Web/Portlets/Users.tpl

index 265ae880968a8dd87a47218bcedfc88f71d15d06..fca312f78b00afe9fb0b81daa525599e0cda86b4 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 
-Prado::using('System.Web.UI.WebControls.TConditional');
+Prado::using('System.Web.UI.ActiveControls.TActiveRepeater');
 Prado::using('Application.Web.Portlets.Portlets');
 
 class Users extends Portlets {
@@ -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;
index 393b08c2133c6675aef46fd4b434420417dbf238..07fed30b1ff5eaea253ead78d469f6537aaadaf9 100644 (file)
@@ -1,6 +1,6 @@
 <a class="big" href="javascript:void(0)" id="add_user_btn"><img src="/themes/Baculum-v1/add.png" alt="Add"><%[ Add new user ]%></a>
 <div id="add_user" style="display: none">
-       <p><%[ Username: ]%><input id="newuser" type="text" /><%[ Password: ]%><input id="newpwd" type="password" /><%[ API host: ]%><com:TDropDownList ID="HostsList" OnInit="SourceTemplateControl.initHosts" />
+       <p><%[ Username: ]%><input id="newuser" type="text" /><%[ Password: ]%><input id="newpwd" type="password" />
        <a href="javascript:void(0)" onclick="Users.addUser()">
                <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_ok.png" alt="<%[ Save ]%>" title="<%[ Save ]%>"/>
        </a>
@@ -8,7 +8,7 @@
                <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/icon_err.png" alt="<%[ Close ]%>" title="<%[ Close ]%>" />
        </a></p>
 </div>
-<com:TRepeater ID="UsersList">
+<com:TActiveRepeater ID="UsersList">
        <prop:HeaderTemplate>
        <table id="users_list" class="window-section-detail-smallrow">
                <tr>
@@ -61,7 +61,7 @@
        <prop:FooterTemplate>
                </table>
        </prop:FooterTemplate>
-</com:TRepeater>
+</com:TActiveRepeater>
 <p><em><%[ Please note that for each user (excluding administrator) there should exist separate Bconsole config file in form: ]%> <strong><com:TLabel ID="BconsoleCustomPath" /></strong></em></p>
 <com:TCallback ID="UserAction" OnCallback="TemplateControl.userAction" ClientSide.OnComplete="Users.hide_loader();" />
 <script type="text/javascript">