Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
M
maintenanceMode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SondagesPro
coreAndTools
maintenanceMode
Commits
d1f8bb17
Commit
d1f8bb17
authored
Jan 25, 2017
by
Chenu Denis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] Re-allow super admin
parent
6d84c8af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
maintenanceMode.php
maintenanceMode.php
+13
-5
No files found.
maintenanceMode.php
View file @
d1f8bb17
...
...
@@ -108,7 +108,11 @@ class maintenanceMode extends \ls\pluginmanager\PluginBase {
return
;
}
/* Get actual time */
if
(
$this
->
_inMaintenance
()
&&
!
$this
->
_accessAllowed
()){
if
(
$this
->
_inMaintenance
()){
if
(
$this
->
_accessAllowed
()){
// @todo add a flashMessage
return
;
}
$url
=
$this
->
get
(
'urlRedirect'
);
if
(
$url
){
$lang
=
Yii
::
app
()
->
request
->
getParam
(
'lang'
,
Yii
::
app
()
->
request
->
getParam
(
'language'
));
...
...
@@ -158,7 +162,8 @@ class maintenanceMode extends \ls\pluginmanager\PluginBase {
parent
::
saveSettings
(
$settings
);
}
/**
* @see ls\pluginmanager\PluginBase
* fix some settings
* @see ls\pluginmanager\PluginBase
*/
public
function
getPluginSettings
(
$getValues
=
true
)
{
...
...
@@ -191,12 +196,14 @@ class maintenanceMode extends \ls\pluginmanager\PluginBase {
/**
* Allow access
* @return boolean
*/
private
function
_accessAllowed
(){
/* don't used : Yii::app()->user->isGuest : reset the App()->language */
/* A1llow admin in condition */
//~
if(Yii::app()->session['loginID'] && !$this->get('superAdminOnly')){
//~
return true;
//~
}
if
(
Yii
::
app
()
->
session
[
'loginID'
]
&&
!
$this
->
get
(
'superAdminOnly'
)){
return
true
;
}
/* Always allow admin login */
if
(
!
Yii
::
app
()
->
session
[
'loginID'
]
&&
$this
->
event
->
get
(
'controller'
)
==
'admin'
){
return
true
;
...
...
@@ -216,6 +223,7 @@ class maintenanceMode extends \ls\pluginmanager\PluginBase {
}
/**
* Add this translation just after loaded all plugins
* @see event afterPluginLoad
*/
public
function
afterPluginLoad
(){
// messageSource for this plugin:
...
...
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