[icinga-checkins] icinga.org: icinga-web/master: * Admin ui fixes, fixed principal-> principals renaming issues

git at icinga.org git at icinga.org
Wed Nov 23 13:04:15 CET 2011


Module: icinga-web
Branch: master
Commit: d0e78544ab70f52443aa7a9f0c2826b9f26a1ab7
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=d0e78544ab70f52443aa7a9f0c2826b9f26a1ab7

Author: Jannis Mosshammer <jannis.mosshammer at netways.de>
Date:   Wed Nov 23 13:03:37 2011 +0100

* Admin ui fixes, fixed principal->principals renaming issues

---

 .../DataProvider/UserProviderAction.class.php      |    4 ++--
 app/modules/AppKit/lib/js/admin/RoleManager.js     |    6 ++++--
 app/modules/AppKit/lib/js/admin/UserManager.js     |    3 ++-
 app/modules/AppKit/models/UserAdminModel.class.php |    4 ++--
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/app/modules/AppKit/actions/DataProvider/UserProviderAction.class.php b/app/modules/AppKit/actions/DataProvider/UserProviderAction.class.php
index ff70398..8312b7c 100644
--- a/app/modules/AppKit/actions/DataProvider/UserProviderAction.class.php
+++ b/app/modules/AppKit/actions/DataProvider/UserProviderAction.class.php
@@ -148,7 +148,7 @@ class AppKit_DataProvider_UserProviderAction extends AppKitBaseAction {
             $useradmin->updateUserroles($user, $rd->getParameter('userroles', array()));
 
             $padmin->updatePrincipalValueData(
-                $user->principals,
+                $user->principal,
                 $rd->getParameter('principal_target', array()),
                 $rd->getParameter('principal_value', array())
             );
@@ -158,7 +158,7 @@ class AppKit_DataProvider_UserProviderAction extends AppKitBaseAction {
             try {
                 Doctrine_Manager::connection()->rollback();
             } catch (Doctrine_Transaction_Exception $e) {}
-
+            print_r($e->getTraceAsString());
             $this->setAttribute("error",$e->getMessage());
 
         }
diff --git a/app/modules/AppKit/lib/js/admin/RoleManager.js b/app/modules/AppKit/lib/js/admin/RoleManager.js
index 99e982e..e3a11a7 100644
--- a/app/modules/AppKit/lib/js/admin/RoleManager.js
+++ b/app/modules/AppKit/lib/js/admin/RoleManager.js
@@ -96,7 +96,8 @@ AppKit.Admin.RoleManager = Ext.extend(Ext.Container, {
                     handler:  function(b) {
                         b.setIconClass('icinga-icon-throbber');
                         b.setText(_("Saving role"));
-                        b.setDisabled(true);
+                        b.setDisabled(false);
+                        var _this = this;
                         AppKit.Admin.RoleEditForm.saveRole(
                             cfg.roleProviderURI,
                             function() {
@@ -106,7 +107,8 @@ AppKit.Admin.RoleManager = Ext.extend(Ext.Container, {
                                 b.setIconClass('icinga-icon-disk');
                                 b.setText(_("Save"));
                                 b.setDisabled(false);
-                                this.roleList.load({params: {start:0,limit:25}})
+                                _this.roleList.load({params: {start:0,limit:25}});
+                                Ext.getCmp('roleEditor').setDisabled(true);
                             },
                             function() {
                                 Ext.getCmp('progressbar-field').setValue(
diff --git a/app/modules/AppKit/lib/js/admin/UserManager.js b/app/modules/AppKit/lib/js/admin/UserManager.js
index d46520f..ffe13fd 100644
--- a/app/modules/AppKit/lib/js/admin/UserManager.js
+++ b/app/modules/AppKit/lib/js/admin/UserManager.js
@@ -220,7 +220,8 @@ Ext.ns("AppKit.Admin");
                                     b.setIconClass('icinga-icon-disk');
                                     b.setText(_("Save"));
                                     b.setDisabled(false);
-                                    userList.load({params: {start:0,limit:25}})
+                                    userList.load({params: {start:0,limit:25}});
+                                    
                                 },
                                 function() {
                                     Ext.getCmp('progressbar-field').setValue(
diff --git a/app/modules/AppKit/models/UserAdminModel.class.php b/app/modules/AppKit/models/UserAdminModel.class.php
index 7394ebd..b3d4c86 100644
--- a/app/modules/AppKit/models/UserAdminModel.class.php
+++ b/app/modules/AppKit/models/UserAdminModel.class.php
@@ -159,8 +159,8 @@ class AppKit_UserAdminModel extends AppKitBaseModel {
         }
 
         // Checking the principal
-        if (!$user ->principals->principal_id) {
-            $user ->principals->principal_type = NsmPrincipal::TYPE_ROLE;
+        if (!$user ->principal->principal_id) {
+            $user ->principal->principal_type = NsmPrincipal::TYPE_ROLE;
         }
 
         // Save the record





More information about the icinga-checkins mailing list