Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
7fb6b1ac
Commit
7fb6b1ac
authored
Nov 16, 2006
by
drumm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#97686
by chx. Replace a loop with a standard PHP function.
parent
5278747d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
5 deletions
+1
-5
modules/user/user.module
modules/user/user.module
+1
-5
No files found.
modules/user/user.module
View file @
7fb6b1ac
...
...
@@ -1851,11 +1851,7 @@ function user_admin_perm_submit($form_id, $form_values) {
// Delete, so if we clear every checkbox we reset that role;
// otherwise permissions are active and denied everywhere.
db_query
(
'DELETE FROM {permission} WHERE rid = %d'
,
$role
->
rid
);
foreach
(
$form_values
[
$role
->
rid
]
as
$key
=>
$value
)
{
if
(
!
$value
)
{
unset
(
$form_values
[
$role
->
rid
][
$key
]);
}
}
$form_values
[
$role
->
rid
]
=
array_filter
(
$form_values
[
$role
->
rid
]);
if
(
count
(
$form_values
[
$role
->
rid
]))
{
db_query
(
"INSERT INTO
{
permission
}
(rid, perm) VALUES (%d, '%s')"
,
$role
->
rid
,
implode
(
', '
,
array_keys
(
$form_values
[
$role
->
rid
])));
}
...
...
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