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
e9a9d4d2
Commit
e9a9d4d2
authored
15 years ago
by
Robert Anderson
Browse files
Options
Downloads
Patches
Plain Diff
Fixed queries for changed table name
parent
2b96ef9e
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
+52
-11
52 additions, 11 deletions
webui/wisp-user-edit.php
with
52 additions
and
11 deletions
webui/wisp-user-edit.php
+
52
−
11
View file @
e9a9d4d2
...
...
@@ -37,18 +37,23 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "edit") {
$userID
=
$_POST
[
'user_id'
];
$sql
=
"SELECT
FirstName,
LastName,
Location,
Email,
Phone
wisp_userdata.FirstName,
wisp_userdata.LastName,
wisp_userdata.Email,
wisp_userdata.Phone,
wisp_userdata.LocationID,
wisp_locations.ID,
wisp_locations.Name
FROM
userdata
wisp_
userdata
, wisp_locations
WHERE
UserID = "
.
$db
->
quote
(
$userID
)
.
"
wisp_userdata.UserID = "
.
$db
->
quote
(
$userID
)
.
"
AND
wisp_userdata.LocationID = 'wisp_locations.ID'
"
;
$userDataResult
=
$db
->
query
(
$sql
);
print_r
(
"NUMBER OF ROWS: "
.
$userDataResult
->
rowCount
());
$userDataRow
=
$userDataResult
->
fetchObject
();
$sql
=
"SELECT
...
...
@@ -181,8 +186,34 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "edit") {
</tr>
<tr>
<td
class=
"entrytitle texttop"
>
Location
</td>
<td
class=
"oldval texttop"
>
<?php
echo
$userDataRow
->
location
;
?>
</td>
<td><input
type=
"text"
name=
"new_location"
/></td>
<td
class=
"oldval texttop"
>
<?php
echo
$userDataRow
->
name
;
?>
</td>
<td>
<select
name=
"new_location"
>
<option
selected=
"selected"
value=
"
<?php
echo
$userDataRow
->
id
;
?>
"
>
Unchanged
</option>
<?php
$sql
=
"SELECT
ID, Name
FROM
${DB_TABLE_PREFIX}wisp_locations
ORDER BY
Name
DESC
"
;
$res
=
$db
->
query
(
$sql
);
# If there are any result rows, list items
if
(
$res
->
rowCount
()
>
0
)
{
while
(
$row
=
$res
->
fetchObject
())
{
?>
<option
value=
"
<?php
echo
$row
->
id
;
?>
"
>
<?php
echo
$row
->
name
;
?>
</option>
<?php
}
}
?>
</select>
</td>
</tr>
<tr>
<td
class=
"entrytitle texttop"
>
Email
</td>
...
...
@@ -313,12 +344,22 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "edit") {
"
);
$numUserAttributesUpdates
++
;
}
if
(
!
empty
(
$_POST
[
'new_location'
]))
{
$locationResult
=
$db
->
exec
(
" UPDATE
wisp_userdata
SET
LocationID = "
.
$db
->
quote
(
$_POST
[
'new_location'
])
.
"
WHERE
UserID = "
.
$db
->
quote
(
$_POST
[
'user_id'
])
.
"
"
);
}
# Check if we have userdata table updates
# Check if we have
wisp_
userdata table updates
if
(
sizeof
(
$userDataUpdates
)
>
0
)
{
$userDataUpdateString
=
implode
(
', '
,
$userDataUpdates
);
$res
=
$db
->
exec
(
"UPDATE userdata SET
$userDataUpdateString
WHERE UserID = "
.
$db
->
quote
(
$_POST
[
'user_id'
]));
$res
=
$db
->
exec
(
"UPDATE
wisp_
userdata SET
$userDataUpdateString
WHERE UserID = "
.
$db
->
quote
(
$_POST
[
'user_id'
]));
if
(
$res
)
{
?>
...
...
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