Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

site_close issue #1070

Closed
Marc-pi opened this issue Apr 20, 2014 · 5 comments
Closed

site_close issue #1070

Marc-pi opened this issue Apr 20, 2014 · 5 comments

Comments

@Marc-pi
Copy link
Member

Marc-pi commented Apr 20, 2014

in var/config/engine.php
setting to 1 the site_close value closes completely the access the site, even the admin site

in lib/Pi/Application/Boostrap/Resource/Permission.php line 58
the Permission class has in the checkAction method with this test

// Deny all access to front for close/maintenance
if (Pi::config('site_close')) {
$this->denyAccess($e);
return;
}

that makes use of the denyAccess method
protected function denyAccess(MvcEvent $e)
{
$statusCode = Pi::service('user')->getUser()->isGuest()
? 401 : 403;
$e->getResponse()->setStatusCode($statusCode);
$e->setError(true);
}

=> should not block the access to admin.
=> would be nice to implement a dedicated template also

taiwen added a commit that referenced this issue Apr 21, 2014
@Marc-pi
Copy link
Member Author

Marc-pi commented Apr 21, 2014

thanks for the changes, there is a little typo still

in var/config/application.admin.php
please uncomment line 29
'check_close' => false,

and change comment
// Whether to check site_close for maintenance, default as true
to
// Whether to check site_close for maintenance, default as false

to make it work properly by default (only admin access when site is closed)

@Marc-pi
Copy link
Member Author

Marc-pi commented Apr 25, 2014

thanks for the uncomment, don't forget to change the comment, so i can close this issue

@Marc-pi
Copy link
Member Author

Marc-pi commented May 28, 2014

@taiwen can you change the comment line

// Whether to check site_close for maintenance, default as true
to
// Whether to check site_close for maintenance, default as false

to have the proper default value indication (only admin access when site is closed)
so i can close afterwards this ticket
thanks

@taiwen
Copy link
Member

taiwen commented May 31, 2014

What default as true means is that if check_close is not specified, it will be treated as true.
So, the existent comment is not wrong.

@Marc-pi
Copy link
Member Author

Marc-pi commented May 31, 2014

ok, i learned something new again today about Pi ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants