Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
grade
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton Yushko
grade
Commits
5f12340d
Commit
5f12340d
authored
10 years ago
by
xamgore
Browse files
Options
Downloads
Patches
Plain Diff
Code format
parent
b1b3a6c2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
~dev_rating/application/classes/Controller/Authentication.php
+79
-90
79 additions, 90 deletions
..._rating/application/classes/Controller/Authentication.php
with
79 additions
and
90 deletions
~dev_rating/application/classes/Controller/Authentication.php
+
79
−
90
View file @
5f12340d
<?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
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