rbrindley: branch rbrindley/astman_revamp r4584 - /team/rbrindley/astman_reva...
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Thu Mar 5 11:50:16 CST 2009
Author: rbrindley
Date: Thu Mar 5 11:50:13 2009
New Revision: 4584
URL: http://svn.digium.com/svn-view/asterisk-gui?view=rev&rev=4584
Log:
- implemented pbx.users.remove, to replace astgui_manageusers.deleteuser
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=4584&r1=4583&r2=4584
==============================================================================
--- team/rbrindley/astman_revamp/config/js/pbx2.js (original)
+++ team/rbrindley/astman_revamp/config/js/pbx2.js Thu Mar 5 11:50:13 2009
@@ -90,10 +90,46 @@
*/
pbx.trunks = {};
+/*---------------------------------------------------------------------------*/
/**
* Users object.
*/
pbx.users = {};
+
+/**
+ * Remove user.
+ * @param user The user.
+ * @param vmdel Optional, default = false. Boolean to delete vms or not.
+ * @param callback Optional, default = null. The callback function after deleting a user.
+ */
+pbx.users.remove = function(params) {
+ var u = new listOfSynActions('users.conf');
+ u.new_action('delcat', params.user, '', '');
+ u.callActions();
+
+ u.clearActions('extensions.conf');
+ u.new_action('delete', 'globals', ASTGUI.globals.odcidUsrPrefix + user, '');
+ u.callActions();
+
+ delete sessionData.pbxinfo['users'][user];
+
+ var qs_x = new listOfActions('queues.conf');
+ var qs = config2json({filename: 'queues.conf', usf:0});
+ for (var i in qs) {
+ if (qs[q].contains('member=Agent/' + user) ) {
+ qs_x.new_action('delete', i, 'member', '', 'Agent/' + user);
+ }
+ }
+
+ qs_x.callActions(function() {
+ if (params.vmdel) {
+ ASTGUI.systemCmd('rm ' + top.sessionData.directories.voicemails_dir + user + ' -rf', params.callback);
+ } else {
+ params.callback();
+ }
+ }):
+};
+/*---------------------------------------------------------------------------*/
/**
* VoiceMail Groups object.
More information about the asterisk-gui-commits
mailing list