Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
494aa87e
Commit
494aa87e
authored
May 18, 2003
by
Dries Buytaert
Browse files
- Small change that reduces the number of SQL queries when a certain role has no permissions set.
parent
9c43f544
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/user.module
View file @
494aa87e
...
...
@@ -214,8 +214,8 @@ function user_access($string) {
** To reduce the number of SQL queries, we cache the user's permissions
** in a static variable.
*/
if
(
!
$perm
)
{
if
(
isset
(
$perm
)
)
{
if
(
$user
->
uid
)
{
$perm
=
db_result
(
db_query
(
"SELECT p.perm FROM role r, permission p WHERE r.rid = p.rid AND name = '%s'"
,
$user
->
role
),
0
);
}
...
...
modules/user/user.module
View file @
494aa87e
...
...
@@ -214,8 +214,8 @@ function user_access($string) {
** To reduce the number of SQL queries, we cache the user's permissions
** in a static variable.
*/
if
(
!
$perm
)
{
if
(
isset
(
$perm
)
)
{
if
(
$user
->
uid
)
{
$perm
=
db_result
(
db_query
(
"SELECT p.perm FROM role r, permission p WHERE r.rid = p.rid AND name = '%s'"
,
$user
->
role
),
0
);
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment