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
c84c9e18
Commit
c84c9e18
authored
15 years ago
by
Robert Anderson
Browse files
Options
Downloads
Patches
Plain Diff
Fixed update queries
Added calling-station-id query
parent
e93583dd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webui/wisp-user-edit.php
+84
-43
84 additions, 43 deletions
webui/wisp-user-edit.php
with
84 additions
and
43 deletions
webui/wisp-user-edit.php
+
84
−
43
View file @
c84c9e18
...
@@ -38,13 +38,11 @@ if ($_POST['frmaction'] == "edit") {
...
@@ -38,13 +38,11 @@ if ($_POST['frmaction'] == "edit") {
# Prepare statements
# Prepare statements
$userID
=
$_POST
[
'user_id'
];
$userID
=
$_POST
[
'user_id'
];
$sql
=
"SELECT
$sql
=
"SELECT
Password,
FirstName,
FirstName,
LastName,
LastName,
Location,
Location,
Email,
Email,
Phone,
Phone
AddressList
FROM
FROM
userdata
userdata
WHERE
WHERE
...
@@ -55,11 +53,7 @@ if ($_POST['frmaction'] == "edit") {
...
@@ -55,11 +53,7 @@ if ($_POST['frmaction'] == "edit") {
$userDataRow
=
$userDataResult
->
fetchObject
();
$userDataRow
=
$userDataResult
->
fetchObject
();
$sql
=
"SELECT
$sql
=
"SELECT
UserID,
Value
Name,
Operator,
Value,
Disabled
FROM
FROM
user_attributes
user_attributes
WHERE
WHERE
...
@@ -72,11 +66,35 @@ if ($_POST['frmaction'] == "edit") {
...
@@ -72,11 +66,35 @@ if ($_POST['frmaction'] == "edit") {
$framedIPRow
=
$framedIPResult
->
fetchObject
();
$framedIPRow
=
$framedIPResult
->
fetchObject
();
$sql
=
"SELECT
$sql
=
"SELECT
UserID,
Value
Name,
FROM
Operator,
user_attributes
Value,
WHERE
Disabled
UserID =
$userID
AND
Name = 'Calling-Station-Id'
"
;
$callingStationResult
=
$db
->
query
(
$sql
);
$callingStationRow
=
$callingStationResult
->
fetchObject
();
$sql
=
"SELECT
Value
FROM
user_attributes
WHERE
UserID =
$userID
AND
Name = 'User-Password'
"
;
$userPasswordResult
=
$db
->
query
(
$sql
);
$userPasswordRow
=
$userPasswordResult
->
fetchObject
();
$sql
=
"SELECT
Value
FROM
FROM
user_attributes
user_attributes
WHERE
WHERE
...
@@ -87,13 +105,10 @@ if ($_POST['frmaction'] == "edit") {
...
@@ -87,13 +105,10 @@ if ($_POST['frmaction'] == "edit") {
$dataLimitResult
=
$db
->
query
(
$sql
);
$dataLimitResult
=
$db
->
query
(
$sql
);
$dataLimitRow
=
$dataLimitResult
->
fetchObject
();
$dataLimitRow
=
$dataLimitResult
->
fetchObject
();
$dataLimit
=
$dataLimitRow
->
value
;
$sql
=
"SELECT
$sql
=
"SELECT
UserID,
Value
Name,
Operator,
Value,
Disabled
FROM
FROM
user_attributes
user_attributes
WHERE
WHERE
...
@@ -104,6 +119,7 @@ if ($_POST['frmaction'] == "edit") {
...
@@ -104,6 +119,7 @@ if ($_POST['frmaction'] == "edit") {
$timeLimitResult
=
$db
->
query
(
$sql
);
$timeLimitResult
=
$db
->
query
(
$sql
);
$timeLimitRow
=
$timeLimitResult
->
fetchObject
();
$timeLimitRow
=
$timeLimitResult
->
fetchObject
();
$timeLimit
=
$timeLimitRow
->
value
;
?>
?>
...
@@ -114,7 +130,7 @@ if ($_POST['frmaction'] == "edit") {
...
@@ -114,7 +130,7 @@ if ($_POST['frmaction'] == "edit") {
<input
type=
"hidden"
name=
"user_id"
value=
"
<?php
echo
$_POST
[
'user_id'
];
?>
"
/>
<input
type=
"hidden"
name=
"user_id"
value=
"
<?php
echo
$_POST
[
'user_id'
];
?>
"
/>
<table
class=
"entry"
>
<table
class=
"entry"
>
<tr>
<tr>
<td
class=
"entrytitle"
colspan=
"3"
>
Account Information
</td>
<td
class=
"entrytitle
textcenter
"
colspan=
"3"
>
Account Information
</td>
</tr>
</tr>
<tr>
<tr>
<td><div></div></td>
<td><div></div></td>
...
@@ -123,26 +139,31 @@ if ($_POST['frmaction'] == "edit") {
...
@@ -123,26 +139,31 @@ if ($_POST['frmaction'] == "edit") {
</tr>
</tr>
<tr>
<tr>
<td
class=
"entrytitle texttop"
>
Password
</td>
<td
class=
"entrytitle texttop"
>
Password
</td>
<td
class=
"oldval texttop"
>
<?php
echo
$user
DataRow
->
password
?>
</td>
<td
class=
"oldval texttop"
>
<?php
echo
$user
PasswordRow
->
value
?>
</td>
<td><input
type=
"password"
name=
"new_password"
/></td>
<td><input
type=
"password"
name=
"new_password"
/></td>
</tr>
</tr>
<tr>
<tr>
<td
class=
"entrytitle texttop"
>
Data Limit
</td>
<td
class=
"entrytitle texttop"
>
Data Limit
</td>
<td
class=
"oldval texttop"
>
<?php
echo
$dataLimit
Row
->
value
?>
</td>
<td
class=
"oldval texttop"
>
<?php
echo
$dataLimit
?>
MB
</td>
<td><input
type=
"text"
name=
"new_data_limit"
/></td>
<td><input
type=
"text"
name=
"new_data_limit"
/></td>
</tr>
</tr>
<tr>
<tr>
<td
class=
"entrytitle texttop"
>
Time Limit
</td>
<td
class=
"entrytitle texttop"
>
Time Limit
</td>
<td
class=
"oldval texttop"
>
<?php
echo
$timeLimit
Row
->
value
?>
</td>
<td
class=
"oldval texttop"
>
<?php
echo
$timeLimit
?>
Min
</td>
<td><input
type=
"text"
name=
"new_time_limit"
/></td>
<td><input
type=
"text"
name=
"new_time_limit"
/></td>
</tr>
</tr>
<tr>
<td
class=
"entrytitle texttop"
>
MAC Address
</td>
<td
class=
"oldval texttop"
>
<?php
echo
$callingStationRow
->
value
?>
</td>
<td><input
type=
"text"
name=
"new_mac_address"
/></td>
</tr>
<tr>
<tr>
<td
class=
"entrytitle texttop"
>
IP Address
</td>
<td
class=
"entrytitle texttop"
>
IP Address
</td>
<td
class=
"oldval texttop"
>
<?php
echo
$framedIPRow
->
value
?>
</td>
<td
class=
"oldval texttop"
>
<?php
echo
$framedIPRow
->
value
?>
</td>
<td><input
type=
"text"
name=
"new_ip_address"
/></td>
<td><input
type=
"text"
name=
"new_ip_address"
/></td>
</tr>
</tr>
<tr>
<tr>
<td
class=
"entrytitle"
colspan=
"3"
>
Private Information
</td>
<td
class=
"entrytitle
textcenter
"
colspan=
"3"
>
Private Information
</td>
</tr>
</tr>
<tr>
<tr>
<td><div></div></td>
<td><div></div></td>
...
@@ -174,11 +195,6 @@ if ($_POST['frmaction'] == "edit") {
...
@@ -174,11 +195,6 @@ if ($_POST['frmaction'] == "edit") {
<td
class=
"oldval texttop"
>
<?php
echo
$userDataRow
->
phone
?>
</td>
<td
class=
"oldval texttop"
>
<?php
echo
$userDataRow
->
phone
?>
</td>
<td><input
type=
"text"
name=
"new_phone"
/></td>
<td><input
type=
"text"
name=
"new_phone"
/></td>
</tr>
</tr>
<tr>
<td
class=
"entrytitle texttop"
>
Address List
</td>
<td
class=
"oldval texttop"
>
<?php
echo
$userDataRow
->
addresslist
?>
</td>
<td><input
type=
"text"
name=
"new_addresslist"
/></td>
</tr>
</table>
</table>
<p
/>
<p
/>
...
@@ -204,6 +220,7 @@ if ($_POST['frmaction'] == "edit") {
...
@@ -204,6 +220,7 @@ if ($_POST['frmaction'] == "edit") {
$framedIPResult
->
closeCursor
();
$framedIPResult
->
closeCursor
();
$dataLimitResult
->
closeCursor
();
$dataLimitResult
->
closeCursor
();
$timeLimitResult
->
closeCursor
();
$timeLimitResult
->
closeCursor
();
$callingStationResult
->
closeCursor
();
# SQL Updates
# SQL Updates
}
elseif
(
$_POST
[
'frmaction'
]
==
"edit2"
)
{
}
elseif
(
$_POST
[
'frmaction'
]
==
"edit2"
)
{
...
@@ -219,9 +236,6 @@ if ($_POST['frmaction'] == "edit") {
...
@@ -219,9 +236,6 @@ if ($_POST['frmaction'] == "edit") {
$userDataUpdates
=
array
();
$userDataUpdates
=
array
();
if
(
!
empty
(
$_POST
[
'new_password'
]))
{
array_push
(
$userDataUpdates
,
"Password = "
.
$db
->
quote
(
$_POST
[
'new_password'
]));
}
if
(
!
empty
(
$_POST
[
'new_firstname'
]))
{
if
(
!
empty
(
$_POST
[
'new_firstname'
]))
{
array_push
(
$userDataUpdates
,
"FirstName = "
.
$db
->
quote
(
$_POST
[
'new_firstname'
]));
array_push
(
$userDataUpdates
,
"FirstName = "
.
$db
->
quote
(
$_POST
[
'new_firstname'
]));
}
}
...
@@ -237,39 +251,66 @@ if ($_POST['frmaction'] == "edit") {
...
@@ -237,39 +251,66 @@ if ($_POST['frmaction'] == "edit") {
if
(
!
empty
(
$_POST
[
'new_phone'
]))
{
if
(
!
empty
(
$_POST
[
'new_phone'
]))
{
array_push
(
$userDataUpdates
,
"Phone = "
.
$db
->
quote
(
$_POST
[
'new_phone'
]));
array_push
(
$userDataUpdates
,
"Phone = "
.
$db
->
quote
(
$_POST
[
'new_phone'
]));
}
}
if
(
!
empty
(
$_POST
[
'new_addresslist'
]))
{
array_push
(
$userDataUpdates
,
"AddressList = "
.
$db
->
quote
(
$_POST
[
'new_addresslist'
]));
}
$numUserAttributesUpdates
=
0
;
$numUserAttributesUpdates
=
0
;
if
(
!
empty
(
$_POST
[
'new_data_limit'
]))
{
if
(
!
empty
(
$_POST
[
'new_data_limit'
]))
{
$dataLimitResult
=
$db
->
exec
(
" UPDATE
$dataLimitResult
=
$db
->
exec
(
" UPDATE
user_attributes
user_attributes
SET
SET
SMRadius-Capping-Traffic-Limit
= "
.
$db
->
quote
(
$_POST
[
'new_data_limit'
])
.
"
Value
= "
.
$db
->
quote
(
$_POST
[
'new_data_limit'
])
.
"
WHERE
WHERE
UserID = "
.
$db
->
quote
(
$_POST
[
'user_id'
])
UserID = "
.
$db
->
quote
(
$_POST
[
'user_id'
])
.
"
);
AND
Name = 'SMRadius-Capping-Traffic-Limit'
"
);
$numUserAttributesUpdates
++
;
$numUserAttributesUpdates
++
;
}
}
if
(
!
empty
(
$_POST
[
'new_time_limit'
]))
{
if
(
!
empty
(
$_POST
[
'new_time_limit'
]))
{
$timeLimitResult
=
$db
->
exec
(
" UPDATE
$timeLimitResult
=
$db
->
exec
(
" UPDATE
user_attributes
user_attributes
SET
SET
SMRadius-Capping-Traffic-Limit
= "
.
$db
->
quote
(
$_POST
[
'new_time_limit'
])
.
"
Value
= "
.
$db
->
quote
(
$_POST
[
'new_time_limit'
])
.
"
WHERE
WHERE
UserID = "
.
$db
->
quote
(
$_POST
[
'user_id'
])
UserID = "
.
$db
->
quote
(
$_POST
[
'user_id'
])
.
"
);
AND
Name = 'SMRadius-Capping-Traffic-Limit'
"
);
$numUserAttributesUpdates
++
;
}
if
(
!
empty
(
$_POST
[
'new_password'
]))
{
$setUserPasswordResult
=
$db
->
exec
(
" UPDATE
user_attributes
SET
Value = "
.
$db
->
quote
(
$_POST
[
'new_password'
])
.
"
WHERE
UserID = "
.
$db
->
quote
(
$_POST
[
'user_id'
])
.
"
AND
Name = 'User-Password'
"
);
$numUserAttributesUpdates
++
;
$numUserAttributesUpdates
++
;
}
}
if
(
!
empty
(
$_POST
[
'new_ip_address'
]))
{
if
(
!
empty
(
$_POST
[
'new_ip_address'
]))
{
$ipAddressResult
=
$db
->
exec
(
" UPDATE
$ipAddressResult
=
$db
->
exec
(
" UPDATE
user_attributes
user_attributes
SET
SET
Framed-IP-Address = "
.
$db
->
quote
(
$_POST
[
'new_ip_address'
])
.
"
Value = "
.
$db
->
quote
(
$_POST
[
'new_ip_address'
])
.
"
WHERE
UserID = "
.
$db
->
quote
(
$_POST
[
'user_id'
])
.
"
AND
Name = 'Framed-IP-Address'
"
);
$numUserAttributesUpdates
++
;
}
if
(
!
empty
(
$_POST
[
'new_mac_address'
]))
{
$macAddressResult
=
$db
->
exec
(
" UPDATE
user_attributes
SET
Value = "
.
$db
->
quote
(
$_POST
[
'new_mac_address'
])
.
"
WHERE
WHERE
UserID = "
.
$db
->
quote
(
$_POST
[
'user_id'
])
UserID = "
.
$db
->
quote
(
$_POST
[
'user_id'
])
.
"
);
AND
Name = 'Calling-Station-Id'
"
);
$numUserAttributesUpdates
++
;
$numUserAttributesUpdates
++
;
}
}
...
...
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