Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
d7f2da4f
Commit
d7f2da4f
authored
Nov 17, 2006
by
Richard Mansfield
Browse files
Use db prefix in admin users, staff users
parent
c5863f89
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/usermanagement/adminusers.php
View file @
d7f2da4f
...
...
@@ -58,14 +58,11 @@ $form = array(
function
adminusers_submit
(
$values
)
{
global
$SESSION
;
$table
=
get_config
(
'dbprefix'
)
.
'usr'
;
db_begin
();
execute_sql
(
'UPDATE usr
SET admin = 0
WHERE admin = 1'
);
execute_sql
(
'UPDATE usr
SET admin = 1
WHERE id IN ('
.
join
(
','
,
$values
[
'users'
])
.
')'
);
execute_sql
(
'UPDATE '
.
$table
.
' SET admin = 0 WHERE admin = 1'
);
execute_sql
(
'UPDATE '
.
$table
.
' SET admin = 1 WHERE id IN ('
.
join
(
','
,
$values
[
'users'
])
.
')'
);
db_commit
();
$SESSION
->
add_ok_msg
(
get_string
(
'adminusersupdated'
,
'admin'
));
redirect
(
get_config
(
'wwwroot'
)
.
'admin/usermanagement/adminusers.php'
);
...
...
htdocs/admin/usermanagement/staffusers.php
View file @
d7f2da4f
...
...
@@ -57,14 +57,11 @@ $form = array(
function
staffusers_submit
(
$values
)
{
global
$SESSION
;
$table
=
get_config
(
'dbprefix'
)
.
'usr'
;
db_begin
();
execute_sql
(
'UPDATE usr
SET staff = 0
WHERE staff = 1'
);
execute_sql
(
'UPDATE usr
SET staff = 1
WHERE id IN ('
.
join
(
','
,
$values
[
'users'
])
.
')'
);
execute_sql
(
'UPDATE '
.
$table
.
' SET staff = 0 WHERE staff = 1'
);
execute_sql
(
'UPDATE '
.
$table
.
' SET staff = 1 WHERE id IN ('
.
join
(
','
,
$values
[
'users'
])
.
')'
);
db_commit
();
$SESSION
->
add_ok_msg
(
get_string
(
'staffusersupdated'
,
'admin'
));
redirect
(
get_config
(
'wwwroot'
)
.
'admin/usermanagement/staffusers.php'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment