Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
smradius
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shail
smradius
Commits
817b0e87
Commit
817b0e87
authored
15 years ago
by
Robert Anderson
Browse files
Options
Downloads
Patches
Plain Diff
Initial fixes for WiSPUser add
parent
422ae13f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
webgui/ajax.php
+9
-0
9 additions, 0 deletions
webgui/ajax.php
webgui/include/ajax/functions/WiSPUsers.php
+62
-2
62 additions, 2 deletions
webgui/include/ajax/functions/WiSPUsers.php
webgui/js/app/windows/WiSPUsers.js
+206
-4
206 additions, 4 deletions
webgui/js/app/windows/WiSPUsers.js
with
277 additions
and
6 deletions
webgui/ajax.php
+
9
−
0
View file @
817b0e87
...
...
@@ -491,6 +491,15 @@
$res
->
setID
(
'ID'
);
$res
->
addField
(
'ID'
,
'int'
);
$res
->
addField
(
'Username'
,
'string'
);
$res
->
addField
(
'Password'
,
'string'
);
$res
->
addField
(
'Firstname'
,
'string'
);
$res
->
addField
(
'Lastname'
,
'string'
);
$res
->
addField
(
'Phone'
,
'string'
);
$res
->
addField
(
'Email'
,
'string'
);
$res
->
addField
(
'MACAddress'
,
'string'
);
$res
->
addField
(
'IPAddress'
,
'string'
);
$res
->
addField
(
'Datalimit'
,
'int'
);
$res
->
addField
(
'Uptimelimit'
,
'int'
);
$res
->
parseHash
(
$rawData
);
echo
json_encode
(
$res
->
export
());
...
...
This diff is collapsed.
Click to expand it.
webgui/include/ajax/functions/WiSPUsers.php
+
62
−
2
View file @
817b0e87
...
...
@@ -65,8 +65,23 @@ function getWiSPUsers($params) {
function
getWiSPUser
(
$params
)
{
global
$db
;
$res
=
DBSelect
(
"
SELECT
wisp_userdata.UserID,
wisp_userdata.FirstName,
wisp_userdata.LastName,
wisp_userdata.Phone,
wisp_userdata.Email,
users.Username
FROM
wisp_userdata, users
WHERE
wisp_userdata.UserID = ?
AND
users.ID = wisp_userdata.UserID
"
,
array
(
$params
[
0
])
);
$res
=
DBSelect
(
"SELECT ID, Username FROM users WHERE ID = ?"
,
array
(
$params
[
0
]));
if
(
!
is_object
(
$res
))
{
return
$res
;
}
...
...
@@ -75,9 +90,54 @@ function getWiSPUser($params) {
$row
=
$res
->
fetchObject
();
$resultArray
[
'ID'
]
=
$row
->
id
;
$resultArray
[
'ID'
]
=
$row
->
user
id
;
$resultArray
[
'Username'
]
=
$row
->
username
;
$resultArray
[
'Firstname'
]
=
$row
->
firstname
;
$resultArray
[
'Lastname'
]
=
$row
->
lastname
;
$resultArray
[
'Phone'
]
=
$row
->
phone
;
$resultArray
[
'Email'
]
=
$row
->
email
;
$res
=
DBSelect
(
"
SELECT
user_attributes.Name,
user_attributes.Value
FROM
user_attributes
WHERE
user_attributes.UserID = ?
"
,
array
(
$params
[
0
])
);
if
(
!
is_object
(
$res
))
{
return
$res
;
}
while
(
$row
=
$res
->
fetchObject
())
{
switch
(
$row
->
name
)
{
case
"User-Password"
:
$resultArray
[
'Password'
]
=
$row
->
value
;
break
;
case
"MACAddress"
:
$resultArray
[
'MACAddress'
]
=
$row
->
value
;
break
;
case
"SMRadius-Capping-Traffic-Limit"
:
$resultArray
[
'Datalimit'
]
=
$row
->
value
;
break
;
case
"SMRadius-Capping-Uptime-Limit"
:
$resultArray
[
'Uptimelimit'
]
=
$row
->
value
;
break
;
case
"Framed-IP-Address"
:
$resultArray
[
'IPAddress'
]
=
$row
->
value
;
break
;
}
}
foreach
(
array
(
'Password'
,
'MACAddress'
,
'Datalimit'
,
'Uptimelimit'
,
'IPAddress'
)
as
$key
)
{
if
(
!
isset
(
$resultArray
[
$key
]))
{
$resultArray
[
$key
]
=
''
;
}
}
return
$resultArray
;
}
...
...
This diff is collapsed.
Click to expand it.
webgui/js/app/windows/WiSPUsers.js
+
206
−
4
View file @
817b0e87
...
...
@@ -222,7 +222,16 @@ function showWiSPUserEditWindow(id) {
SOAPFunction
:
'
updateWiSPUser
'
,
SOAPParams
:
'
0:ID,
'
+
'
0:Username
'
'
0:Username,
'
+
'
0:Password,
'
+
'
0:Firstname,
'
+
'
0:Lastname,
'
+
'
0:Phone,
'
+
'
0:Email,
'
+
'
0:MACAddress,
'
+
'
0:IPAddress,
'
+
'
0:Datalimit,
'
+
'
0:Uptimelimit
'
};
// We doing an Add
...
...
@@ -230,7 +239,16 @@ function showWiSPUserEditWindow(id) {
submitAjaxConfig
=
{
SOAPFunction
:
'
createWiSPUser
'
,
SOAPParams
:
'
0:Username
'
'
0:Username,
'
+
'
0:Password,
'
+
'
0:Firstname,
'
+
'
0:Lastname,
'
+
'
0:Phone,
'
+
'
0:Email,
'
+
'
0:MACAddress,
'
+
'
0:IPAddress,
'
+
'
0:Datalimit,
'
+
'
0:Uptimelimit
'
};
}
...
...
@@ -241,10 +259,10 @@ function showWiSPUserEditWindow(id) {
title
:
"
User Information
"
,
width
:
475
,
height
:
26
0
,
height
:
34
0
,
minWidth
:
475
,
minHeight
:
26
0
minHeight
:
34
0
},
// Form panel config
{
...
...
@@ -263,6 +281,190 @@ function showWiSPUserEditWindow(id) {
maskRe
:
usernamePartRe
,
allowBlank
:
false
,
},
{
fieldLabel
:
'
Password
'
,
name
:
'
Password
'
,
vtype
:
'
usernamePart
'
,
maskRe
:
usernamePartRe
,
allowBlank
:
false
,
},
{
xtype
:
'
tabpanel
'
,
plain
:
'
true
'
,
deferredRender
:
false
,
// Load all panels!
activeTab
:
0
,
height
:
200
,
defaults
:
{
layout
:
'
form
'
,
bodyStyle
:
'
padding: 10px;
'
},
items
:
[
{
title
:
'
Personal
'
,
layout
:
'
form
'
,
defaultType
:
'
textfield
'
,
items
:
[
{
fieldLabel
:
'
First Name
'
,
name
:
'
Firstname
'
,
vtype
:
'
usernamePart
'
,
allowBlank
:
true
},
{
fieldLabel
:
'
Last Name
'
,
name
:
'
Lastname
'
,
vtype
:
'
usernamePart
'
,
allowBlank
:
true
},
{
fieldLabel
:
'
Phone
'
,
name
:
'
Phone
'
,
vtype
:
'
number
'
,
allowBlank
:
true
},
{
fieldLabel
:
'
Email
'
,
name
:
'
Email
'
,
allowBlank
:
true
}
]
},
{
title
:
'
Attributes
'
,
layout
:
'
form
'
,
defaultType
:
'
textfield
'
,
items
:
[
{
xtype
:
'
combo
'
,
//id: 'combo',
fieldLabel
:
'
Name
'
,
name
:
'
Name
'
,
allowBlank
:
false
,
width
:
160
,
store
:
new
Ext
.
ux
.
JsonStore
({
sortInfo
:
{
field
:
"
Name
"
,
direction
:
"
ASC
"
},
baseParams
:
{
SOAPUsername
:
globalConfig
.
soap
.
username
,
SOAPPassword
:
globalConfig
.
soap
.
password
,
SOAPAuthType
:
globalConfig
.
soap
.
authtype
,
SOAPModule
:
'
WiSPUsers
'
,
SOAPFunction
:
'
getWiSPUserAttributeNames
'
,
SOAPParams
:
'
__null,__search
'
}
}),
displayField
:
'
Name
'
,
valueField
:
'
Name
'
,
hiddenName
:
'
Name
'
,
forceSelection
:
true
,
triggerAction
:
'
all
'
,
editable
:
false
},
{
xtype
:
'
combo
'
,
//id: 'combo',
fieldLabel
:
'
Value
'
,
name
:
'
Value
'
,
allowBlank
:
false
,
width
:
160
,
store
:
new
Ext
.
ux
.
JsonStore
({
sortInfo
:
{
field
:
"
Value
"
,
direction
:
"
ASC
"
},
baseParams
:
{
SOAPUsername
:
globalConfig
.
soap
.
username
,
SOAPPassword
:
globalConfig
.
soap
.
password
,
SOAPAuthType
:
globalConfig
.
soap
.
authtype
,
SOAPModule
:
'
WiSPUsers
'
,
SOAPFunction
:
'
getWiSPUserAttributeValues
'
,
SOAPParams
:
'
__null,__search
'
}
}),
displayField
:
'
Value
'
,
valueField
:
'
Value
'
,
hiddenName
:
'
Value
'
,
forceSelection
:
true
,
triggerAction
:
'
all
'
,
editable
:
false
},
/*{
xtype: 'combo',
//id: 'combo',
fieldLabel: 'Group',
name: 'Group',
allowBlank: true,
width: 140,
store: new Ext.ux.JsonStore({
sortInfo: { field: "Name", direction: "ASC" },
baseParams: {
SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'AdminUserGroups',
SOAPFunction: 'getAdminGroups',
SOAPParams: '__null,__search'
}
}),
displayField: 'Name',
valueField: 'ID',
hiddenName: 'GroupID',
forceSelection: false,
triggerAction: 'all',
editable: false
},*/
/*{
xtype: 'combo',
//id: 'combo',
fieldLabel: 'Location',
name: 'Location',
allowBlank: true,
width: 160,
store: new Ext.ux.JsonStore({
sortInfo: { field: "Name", direction: "ASC" },
baseParams: {
SOAPUsername: globalConfig.soap.username,
SOAPPassword: globalConfig.soap.password,
SOAPAuthType: globalConfig.soap.authtype,
SOAPModule: 'AdminUserGroups',
SOAPFunction: 'getWiSPLocations',
SOAPParams: '__null,__search'
}
}),
displayField: 'Name',
valueField: 'ID',
hiddenName: 'LocationID',
forceSelection: false,
triggerAction: 'all',
editable: false
},*/
/*{
fieldLabel: 'MAC Address',
name: 'MACAddress',
allowBlank: true
},
{
fieldLabel: 'IP Address',
name: 'IPAddress',
allowBlank: true
},
{
fieldLabel: 'Data Limit',
name: 'Datalimit',
vtype: 'number',
allowBlank: true
},
{
fieldLabel: 'Uptime Limit',
name: 'Uptimelimit',
vtype: 'number',
allowBlank: true
}*/
]
},
]
},
],
},
// Submit button config
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment