Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
better_formats
Commits
a7bb8b98
Commit
a7bb8b98
authored
Dec 11, 2008
by
dragonwize
Browse files
Only set default perms on core roles
parent
2835d06a
Changes
1
Hide whitespace changes
Inline
Side-by-side
better_formats.install
View file @
a7bb8b98
...
...
@@ -62,14 +62,14 @@ function better_formats_install() {
// default perms to be like core defaults
$default_perms
=
',show format selection,show format tips,collapsible format selection,collapse format fieldset by default'
;
// get current perms
$sql
=
"SELECT * FROM
{
permission
}
"
;
// get current
core
perms
$sql
=
"SELECT * FROM
{
permission
}
WHERE rid IN (1,2)
"
;
$result
=
db_query
(
$sql
);
$row_perms
=
array
();
while
(
$row
=
db_fetch_object
(
$result
))
{
$role_perms
[]
=
$row
;
}
// add perms to
all
roles
// add perms to
core
roles
(anonymous user, authenticated user)
foreach
(
$role_perms
as
$perms
)
{
$sql
=
"UPDATE
{
permission
}
SET perm = '%s' WHERE pid = %d"
;
db_query
(
$sql
,
$perms
->
perm
.
$default_perms
,
$perms
->
pid
);
...
...
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