Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PigLatinTranslator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PeckaDesign
PigLatinTranslator
Commits
47065f37
Commit
47065f37
authored
Jun 25, 2014
by
Mpro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove sign presenter
parent
0078c5a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
70 deletions
+0
-70
SignPresenter.php
app/presenters/SignPresenter.php
+0
-64
in.latte
app/templates/Sign/in.latte
+0
-6
No files found.
app/presenters/SignPresenter.php
deleted
100644 → 0
View file @
0078c5a9
<?php
namespace
App\Presenters
;
use
Nette
,
App\Model
;
/**
* Sign in/out presenters.
*/
class
SignPresenter
extends
BasePresenter
{
/**
* Sign-in form factory.
* @return Nette\Application\UI\Form
*/
protected
function
createComponentSignInForm
()
{
$form
=
new
Nette\Application\UI\Form
;
$form
->
addText
(
'username'
,
'Username:'
)
->
setRequired
(
'Please enter your username.'
);
$form
->
addPassword
(
'password'
,
'Password:'
)
->
setRequired
(
'Please enter your password.'
);
$form
->
addCheckbox
(
'remember'
,
'Keep me signed in'
);
$form
->
addSubmit
(
'send'
,
'Sign in'
);
// call method signInFormSucceeded() on success
$form
->
onSuccess
[]
=
$this
->
signInFormSucceeded
;
return
$form
;
}
public
function
signInFormSucceeded
(
$form
,
$values
)
{
if
(
$values
->
remember
)
{
$this
->
getUser
()
->
setExpiration
(
'14 days'
,
FALSE
);
}
else
{
$this
->
getUser
()
->
setExpiration
(
'20 minutes'
,
TRUE
);
}
try
{
$this
->
getUser
()
->
login
(
$values
->
username
,
$values
->
password
);
$this
->
redirect
(
'Homepage:'
);
}
catch
(
Nette\Security\AuthenticationException
$e
)
{
$form
->
addError
(
$e
->
getMessage
());
}
}
public
function
actionOut
()
{
$this
->
getUser
()
->
logout
();
$this
->
flashMessage
(
'You have been signed out.'
);
$this
->
redirect
(
'in'
);
}
}
app/templates/Sign/in.latte
deleted
100644 → 0
View file @
0078c5a9
{block content}
<h1 n:block=title>Sign in</h1>
{control signInForm}
{* or use {include '../components/form.latte', form => signInForm} *}
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