Skip to content
Snippets Groups Projects
Commit 5f12340d authored by xamgore's avatar xamgore
Browse files

Code format

parent b1b3a6c2
No related branches found
No related tags found
No related merge requests found
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Authentication extends Controller {
class Controller_Authentication extends Controller
{
public function before() {
parent::before();
if (UTF8::strcasecmp($this->request->action(), 'logout')) {
......@@ -14,10 +14,8 @@ class Controller_Authentication extends Controller {
}
}
private function sign()
{
if(!User::instance()->isSignedIn())
{
private function sign() {
if (!User::instance()->isSignedIn()) {
$type = $this->request->param('type');
$type = empty($type) ? 'in' : $type;
$twig = Twig::factory('sign/' . $type);
......@@ -28,13 +26,11 @@ class Controller_Authentication extends Controller {
}
}
public function action_enter_backdoor()
{
public function action_enter_backdoor() {
$this->sign();
}
public function action_enter_frontdoor()
{
public function action_enter_frontdoor() {
$admission = true;
$user = User::instance();
$role = $user->RoleMark;
......@@ -51,10 +47,8 @@ class Controller_Authentication extends Controller {
$user->signOut();
}
public function action_remind()
{
if(!User::instance()->isSignedIn())
{
public function action_remind() {
if (!User::instance()->isSignedIn()) {
$twig = Twig::factory('sign/remindpass');
$twig->Markdown = new Parsedown();
......@@ -63,9 +57,9 @@ class Controller_Authentication extends Controller {
}
}
public function action_endremind()
{
public function action_endremind() {
$token = $this->request->param('token');
if (!Account::instance()->checkToken($token)) {
$message = "Данная ссылка для восстановления пароля более не действительна!\n" .
"Либо истекло время действия ссылки, либо она уже была использована.";
......@@ -83,14 +77,12 @@ class Controller_Authentication extends Controller {
}
}
public function action_logout()
{
public function action_logout() {
User::instance()->signOut();
$this->redirect('sign', 302);
}
private function check_maintenance()
{
private function check_maintenance() {
$maintenance_info = Model_Account::getMaintenanceInfo();
if ($maintenance_info['active']) {
$this->response->status(503);
......@@ -100,14 +92,11 @@ class Controller_Authentication extends Controller {
$twig->message = "Восстановление работы сервиса: " . $maintenance_info['return'];
$this->response->body($twig);
return true;
}
else
} else
return false;
}
public function action_check_maintenance()
{
public function action_check_maintenance() {
$this->check_maintenance();
}
} // End Welcome
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment