Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
92de1f90
Commit
92de1f90
authored
Oct 3, 2006
by
Steven Wittens
Browse files
Options
Downloads
Patches
Plain Diff
#75289
: Don't allow user 1 to be blocked or deleted
parent
aae945c3
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/user/user.module
+8
-2
8 additions, 2 deletions
modules/user/user.module
with
8 additions
and
2 deletions
modules/user/user.module
+
8
−
2
View file @
92de1f90
...
@@ -1301,7 +1301,7 @@ function user_edit_form($uid, $edit, $register = FALSE) {
...
@@ -1301,7 +1301,7 @@ function user_edit_form($uid, $edit, $register = FALSE) {
'#required'
=>
TRUE
,
'#required'
=>
TRUE
,
);
);
}
}
if
(
$admin
)
{
if
(
$admin
&&
$uid
!=
1
)
{
$form
[
'account'
][
'status'
]
=
array
(
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Status'
),
'#default_value'
=>
isset
(
$edit
[
'status'
])
?
$edit
[
'status'
]
:
1
,
'#options'
=>
array
(
t
(
'Blocked'
),
t
(
'Active'
)));
$form
[
'account'
][
'status'
]
=
array
(
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Status'
),
'#default_value'
=>
isset
(
$edit
[
'status'
])
?
$edit
[
'status'
]
:
1
,
'#options'
=>
array
(
t
(
'Blocked'
),
t
(
'Active'
)));
}
}
if
(
user_access
(
'administer access control'
))
{
if
(
user_access
(
'administer access control'
))
{
...
@@ -1385,6 +1385,9 @@ function user_edit($category = 'account') {
...
@@ -1385,6 +1385,9 @@ function user_edit($category = 'account') {
$edit
=
$_POST
[
'op'
]
?
$_POST
:
(
array
)
$account
;
$edit
=
$_POST
[
'op'
]
?
$_POST
:
(
array
)
$account
;
if
(
arg
(
2
)
==
'delete'
)
{
if
(
arg
(
2
)
==
'delete'
)
{
if
(
$account
->
uid
==
1
)
{
return
drupal_not_found
();
}
if
(
$edit
[
'confirm'
])
{
if
(
$edit
[
'confirm'
])
{
user_delete
(
$edit
,
$account
->
uid
);
user_delete
(
$edit
,
$account
->
uid
);
drupal_goto
(
'admin/user/user'
);
drupal_goto
(
'admin/user/user'
);
...
@@ -1394,6 +1397,9 @@ function user_edit($category = 'account') {
...
@@ -1394,6 +1397,9 @@ function user_edit($category = 'account') {
}
}
}
}
else
if
(
$_POST
[
'op'
]
==
t
(
'Delete'
))
{
else
if
(
$_POST
[
'op'
]
==
t
(
'Delete'
))
{
if
(
$account
->
uid
==
1
)
{
return
drupal_not_found
();
}
if
(
$_REQUEST
[
'destination'
])
{
if
(
$_REQUEST
[
'destination'
])
{
$destination
=
drupal_get_destination
();
$destination
=
drupal_get_destination
();
unset
(
$_REQUEST
[
'destination'
]);
unset
(
$_REQUEST
[
'destination'
]);
...
@@ -1406,7 +1412,7 @@ function user_edit($category = 'account') {
...
@@ -1406,7 +1412,7 @@ function user_edit($category = 'account') {
$form
[
'_category'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$category
);
$form
[
'_category'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$category
);
$form
[
'_account'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$account
);
$form
[
'_account'
]
=
array
(
'#type'
=>
'value'
,
'#value'
=>
$account
);
$form
[
'submit'
]
=
array
(
'#type'
=>
'submit'
,
'#value'
=>
t
(
'Submit'
),
'#weight'
=>
30
);
$form
[
'submit'
]
=
array
(
'#type'
=>
'submit'
,
'#value'
=>
t
(
'Submit'
),
'#weight'
=>
30
);
if
(
user_access
(
'administer users'
))
{
if
(
user_access
(
'administer users'
)
&&
$account
->
uid
!=
1
)
{
$form
[
'delete'
]
=
array
(
'#type'
=>
'submit'
,
'#value'
=>
t
(
'Delete'
),
'#weight'
=>
31
);
$form
[
'delete'
]
=
array
(
'#type'
=>
'submit'
,
'#value'
=>
t
(
'Delete'
),
'#weight'
=>
31
);
}
}
$form
[
'#attributes'
][
'enctype'
]
=
'multipart/form-data'
;
$form
[
'#attributes'
][
'enctype'
]
=
'multipart/form-data'
;
...
...
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