From noreply at devlabs.linuxassist.net Wed Feb 1 13:24:44 2012 From: noreply at devlabs.linuxassist.net (noreply at devlabs.linuxassist.net) Date: Wed, 1 Feb 2012 13:24:44 +0000 (GMT) Subject: [smradius-devel] [COMMIT] smradius branch master updated. dc9c22a50f1e27b364a4f2eab3d346c4322db7c9 Message-ID: <20120201132445.599641F01FB@devlabs.linuxassist.net> This is an automated email from the devlabs.linuxassist.net git system. It was generated because a ref change was pushed to the repository containing the project "smradius". The branch, master has been updated via dc9c22a50f1e27b364a4f2eab3d346c4322db7c9 (commit) from a3b2b1d2284b7d69922304a6be60f9c7a6a6d8bb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: smadmin | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) -- smradius From noreply at devlabs.linuxassist.net Tue Feb 7 13:30:59 2012 From: noreply at devlabs.linuxassist.net (noreply at devlabs.linuxassist.net) Date: Tue, 7 Feb 2012 13:30:59 +0000 (GMT) Subject: [smradius-devel] [COMMIT] smradius branch master updated. 6cb8d736602915e55e8504c60d794e356f97aa17 Message-ID: <20120207133059.A27AA1F01B5@devlabs.linuxassist.net> This is an automated email from the devlabs.linuxassist.net git system. It was generated because a ref change was pushed to the repository containing the project "smradius". The branch, master has been updated via 6cb8d736602915e55e8504c60d794e356f97aa17 (commit) from dc9c22a50f1e27b364a4f2eab3d346c4322db7c9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://devlabs.linuxassist.net/projects/smradius/repository/revisions/6cb8d736602915e55e8504c60d794e356f97aa17 commit 6cb8d736602915e55e8504c60d794e356f97aa17 Author: Robert Anderson Date: Tue Feb 7 13:04:07 2012 +0000 Added a checkbox for enabling/disabling users in add/edit window diff --git a/webgui/ajax.php b/webgui/ajax.php index 1264347..c30bafd 100644 --- a/webgui/ajax.php +++ b/webgui/ajax.php @@ -931,6 +931,7 @@ $res->setID('ID'); $res->addField('ID','int'); $res->addField('Username','string'); + $res->addField('Disabled','boolean'); $res->addField('Password','string'); $res->addField('Firstname','string'); $res->addField('Lastname','string'); diff --git a/webgui/include/ajax/functions/AdminUsers.php b/webgui/include/ajax/functions/AdminUsers.php index acba22e..2a0b60a 100644 --- a/webgui/include/ajax/functions/AdminUsers.php +++ b/webgui/include/ajax/functions/AdminUsers.php @@ -162,7 +162,7 @@ function removeAdminUser($params) { function createAdminUser($params) { # Perform query - $res = DBDo("INSERT INTO @TP at users (Username) VALUES (?)",array($params[0]['Username'])); + $res = DBDo("INSERT INTO @TP at users (Username,Disabled) VALUES (?,?)",array($params[0]['Username'],$params[0]['Disabled'])); # Return result if ($res !== TRUE) { @@ -176,7 +176,7 @@ function createAdminUser($params) { function updateAdminUser($params) { # Perform query - $res = DBDo("UPDATE @TP at users SET Username = ? WHERE ID = ?",array($params[0]['Username'],$params[0]['ID'])); + $res = DBDo("UPDATE @TP at users SET Username = ?, Disabled = ? WHERE ID = ?",array($params[0]['Username'],$params[0]['Disabled'],$params[0]['ID'])); # Return result if ($res !== TRUE) { diff --git a/webgui/include/ajax/functions/WiSPUsers.php b/webgui/include/ajax/functions/WiSPUsers.php index 9fbbf0e..054b848 100644 --- a/webgui/include/ajax/functions/WiSPUsers.php +++ b/webgui/include/ajax/functions/WiSPUsers.php @@ -91,7 +91,8 @@ function getWiSPUser($params) { @TP at wisp_userdata.Phone, @TP at wisp_userdata.Email, @TP at wisp_userdata.LocationID, - @TP at users.Username + @TP at users.Username, + @TP at users.Disabled FROM @TP at wisp_userdata, @TP at users WHERE @@ -113,6 +114,7 @@ function getWiSPUser($params) { # Set userdata fields $resultArray['ID'] = $row->userid; $resultArray['Username'] = $row->username; + $resultArray['Disabled'] = $row->disabled; if (isset($row->firstname)) { $resultArray['Firstname'] = $row->firstname; } else { @@ -335,7 +337,7 @@ function createWiSPUser($params) { # If we adding single user if (empty($params[0]['Number']) && !empty($params[0]['Username'])) { # Insert username - $res = DBDo("INSERT INTO @TP at users (Username) VALUES (?)",array($params[0]['Username'])); + $res = DBDo("INSERT INTO @TP at users (Username,Disabled) VALUES (?,?)",array($params[0]['Username'],$params[0]['Disabled'])); # Continue with others if successful if ($res !== FALSE) { @@ -507,7 +509,7 @@ function createWiSPUser($params) { # Insert users from array into database foreach ($wispUser as $username => $password) { - $res = DBDo("INSERT INTO @TP at users (Username) VALUES (?)",array($username)); + $res = DBDo("INSERT INTO @TP at users (Username,Disabled) VALUES (?,?)",array($username,$params[0]['Disabled'])); if ($res !== FALSE) { $id = DBLastInsertID(); $res = DBDo("INSERT INTO @TP at user_attributes (UserID,Name,Operator,Value) VALUES (?,?,?,?)", @@ -667,9 +669,8 @@ function updateWiSPUser($params) { $res = TRUE; # Perform query - if (!empty($params[0]['Username'])) { - $res = DBDo("UPDATE @TP at users SET Username = ? WHERE ID = ?",array($params[0]['Username'],$params[0]['ID'])); - } + $res = DBDo("UPDATE @TP at users SET Username = ?, Disabled = ? WHERE ID = ?",array($params[0]['Username'],$params[0]['Disabled'],$params[0]['ID'])); + # Change password if ($res !== FALSE) { $res = DBDo("UPDATE @TP at user_attributes SET Value = ? WHERE UserID = ? AND Name = ?", diff --git a/webgui/js/app/windows/AdminUsers.js b/webgui/js/app/windows/AdminUsers.js index 18e77da..6e36cee 100644 --- a/webgui/js/app/windows/AdminUsers.js +++ b/webgui/js/app/windows/AdminUsers.js @@ -274,7 +274,8 @@ function showAdminUserAddEditWindow(AdminUserWindow,id) { SOAPFunction: 'updateAdminUser', SOAPParams: '0:ID,'+ - '0:Username' + '0:Username,'+ + '0:Disabled' }, onSuccess: function() { var store = Ext.getCmp(AdminUserWindow.gridPanelID).getStore(); @@ -293,7 +294,8 @@ function showAdminUserAddEditWindow(AdminUserWindow,id) { params: { SOAPFunction: 'createAdminUser', SOAPParams: - '0:Username' + '0:Username,'+ + '0:Disabled' }, onSuccess: function() { var store = Ext.getCmp(AdminUserWindow.gridPanelID).getStore(); @@ -314,10 +316,10 @@ function showAdminUserAddEditWindow(AdminUserWindow,id) { iconCls: icon, width: 310, - height: 113, + height: 133, minWidth: 310, - minHeight: 113 + minHeight: 133 }, // Form panel config { @@ -335,6 +337,12 @@ function showAdminUserAddEditWindow(AdminUserWindow,id) { vtype: 'usernameRadius', maskRe: usernameRadiusPartRe, allowBlank: false + }, + { + fieldLabel: 'Disabled', + name: 'Disabled', + xtype: 'checkbox', + inputValue: '1' } ] }, diff --git a/webgui/js/app/windows/WiSPUsers.js b/webgui/js/app/windows/WiSPUsers.js index 4a330cd..6799d9e 100644 --- a/webgui/js/app/windows/WiSPUsers.js +++ b/webgui/js/app/windows/WiSPUsers.js @@ -171,11 +171,6 @@ function showWiSPUserWindow() { dataIndex: 'Username' }, { - header: "Disabled", - sortable: true, - dataIndex: 'Disabled' - }, - { header: "First Name", sortable: true, dataIndex: 'Firstname' @@ -194,6 +189,11 @@ function showWiSPUserWindow() { header: "Phone", sortable: true, dataIndex: 'Phone' + }, + { + header: "Disabled", + sortable: true, + dataIndex: 'Disabled' } ]), autoExpandColumn: 'Username' @@ -315,6 +315,7 @@ function showWiSPUserAddEditWindow(WiSPUserWindow,id) { '0:ID,'+ '0:Username,'+ '0:Password,'+ + '0:Disabled,'+ '0:Firstname,'+ '0:Lastname,'+ '0:Phone,'+ @@ -397,6 +398,7 @@ function showWiSPUserAddEditWindow(WiSPUserWindow,id) { SOAPFunction: 'createWiSPUser', SOAPParams: '0:Username,'+ + '0:Disabled,'+ '0:Password,'+ '0:Firstname,'+ '0:Lastname,'+ @@ -548,9 +550,9 @@ function showWiSPUserAddEditWindow(WiSPUserWindow,id) { allowBlank: false, mode: 'local', store: [ - [ '=', 'Add as reply if unique' ], + [ '=', 'Add as reply if unique' ], [ ':=', 'Set configuration value' ], - [ '==', 'Match value in request' ], + [ '==', 'Match value in request' ], [ '+=', 'Add reply and set configuration' ], [ '!=', 'Inverse match value in request' ], [ '<', 'Match less-than value in request' ], @@ -584,7 +586,7 @@ function showWiSPUserAddEditWindow(WiSPUserWindow,id) { editor: new Ext.form.ComboBox({ allowBlank: false, mode: 'local', - store: [ + store: [ [ 'Seconds', 'Seconds' ], [ 'Minutes', 'Minutes' ], [ 'Hours', 'Hours' ], @@ -736,10 +738,10 @@ function showWiSPUserAddEditWindow(WiSPUserWindow,id) { iconCls: icon, width: 700, - height: 342, + height: 362, minWidth: 700, - minHeight: 342 + minHeight: 362 }, // Form panel config { @@ -764,6 +766,12 @@ function showWiSPUserAddEditWindow(WiSPUserWindow,id) { allowBlank: true }, { + fieldLabel: 'Disabled', + name: 'Disabled', + xtype: 'checkbox', + inputValue: '1' + }, + { xtype: 'tabpanel', plain: 'true', deferredRender: false, // Load all panels! ----------------------------------------------------------------------- Summary of changes: webgui/ajax.php | 1 + webgui/include/ajax/functions/AdminUsers.php | 4 +- webgui/include/ajax/functions/WiSPUsers.php | 13 ++++++----- webgui/js/app/windows/AdminUsers.js | 16 +++++++++++--- webgui/js/app/windows/WiSPUsers.js | 28 ++++++++++++++++--------- 5 files changed, 40 insertions(+), 22 deletions(-) -- smradius