rbrindley: branch rbrindley/astman_revamp r4588 - /team/rbrindley/astman_reva...
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Thu Mar 5 13:05:31 CST 2009
Author: rbrindley
Date: Thu Mar 5 13:05:28 2009
New Revision: 4588
URL: http://svn.digium.com/svn-view/asterisk-gui?view=rev&rev=4588
Log:
- implemented pbx.users.edit to replace astgui_manageusers.editUserProperty
- it now handles multiple properties instead of one at a time
Modified:
team/rbrindley/astman_revamp/config/js/pbx2.js
Modified: team/rbrindley/astman_revamp/config/js/pbx2.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/astman_revamp/config/js/pbx2.js?view=diff&rev=4588&r1=4587&r2=4588
==============================================================================
--- team/rbrindley/astman_revamp/config/js/pbx2.js (original)
+++ team/rbrindley/astman_revamp/config/js/pbx2.js Thu Mar 5 13:05:28 2009
@@ -146,6 +146,36 @@
x.callActions(callback);
};
+
+/**
+ * Edit User Properties.
+ * @param user The user.
+ * @param info An object holding the var and vals of properties to be edited.
+ */
+pbx.users.edit = function(user, info) {
+ if (!sessionData.pbxinfo['users'][p.user]) {
+ top.log.debug('pbx.users.edit: User not found, exiting.');
+ return false;
+ }
+
+ for (var prop in info) {
+ if (info.hasOwnProperty(prop)) {
+ var val = info[prop];
+ var u = ASTGUI.updateaValue({ file: 'users.conf', context: user, variable: prop, value: val});
+
+ if (u) {
+ try {
+ sessionData.pbxinfo['users'][user][prop] = val;
+ } catch (err) {
+ top.log.error('pbx.users.edit: ' + err);
+ }
+ }
+ }
+ }
+
+ return true;
+};
+
/**
* Get User Details
* @param user The user to get.
More information about the asterisk-gui-commits
mailing list