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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
7f83d274
Commit
7f83d274
authored
17 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#146937
by merlinofchaos: restore maintenance mode.
parent
1f864214
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
includes/common.inc
+1
-0
1 addition, 0 deletions
includes/common.inc
includes/menu.inc
+29
-0
29 additions, 0 deletions
includes/menu.inc
with
30 additions
and
0 deletions
includes/common.inc
+
1
−
0
View file @
7f83d274
...
...
@@ -320,6 +320,7 @@ function drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response
* Generates a site off-line message
*/
function
drupal_site_offline
()
{
drupal_maintenance_theme
();
drupal_set_header
(
'HTTP/1.1 503 Service unavailable'
);
drupal_set_title
(
t
(
'Site off-line'
));
print
theme
(
'maintenance_page'
,
filter_xss_admin
(
variable_get
(
'site_offline_message'
,
...
...
This diff is collapsed.
Click to expand it.
includes/menu.inc
+
29
−
0
View file @
7f83d274
...
...
@@ -305,6 +305,10 @@ function menu_get_item($path = NULL) {
* Execute the page callback associated with the current path
*/
function
menu_execute_active_handler
()
{
if
(
_menu_site_is_offline
())
{
return
MENU_SITE_OFFLINE
;
}
if
(
$item
=
menu_get_item
())
{
if
(
$item
->
access
)
{
if
(
$item
->
file
)
{
...
...
@@ -1462,3 +1466,28 @@ function menu_path_is_external($path) {
$colonpos
=
strpos
(
$path
,
':'
);
return
$colonpos
!==
FALSE
&&
!
preg_match
(
'![/?#]!'
,
substr
(
$path
,
0
,
$colonpos
))
&&
filter_xss_bad_protocol
(
$path
,
FALSE
)
==
check_plain
(
$path
);
}
/**
* Returns TRUE if the site is off-line for maintenance.
*/
function
_menu_site_is_offline
()
{
// Check if site is set to off-line mode
if
(
variable_get
(
'site_offline'
,
0
))
{
// Check if the user has administration privileges
if
(
!
user_access
(
'administer site configuration'
))
{
// Check if this is an attempt to login
if
(
drupal_get_normal_path
(
$_GET
[
'q'
])
!=
'user'
)
{
return
TRUE
;
}
}
else
{
$offline_message
=
t
(
'Operating in off-line mode.'
);
$messages
=
drupal_set_message
();
// Ensure that the off-line message is displayed only once [allowing for page redirects].
if
(
!
isset
(
$messages
)
||
!
isset
(
$messages
[
'status'
])
||
!
in_array
(
$offline_message
,
$messages
[
'status'
]))
{
drupal_set_message
(
$offline_message
);
}
}
}
return
FALSE
;
}
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