mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Address PR comments
This commit is contained in:
@@ -574,11 +574,21 @@ class Application extends SilexApplication
|
||||
return $this['session']->getFlashBag()->get($type, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a temporary unlock data for a account-locked user
|
||||
*
|
||||
* @param integer $usr_id
|
||||
*/
|
||||
public function addUnlockLink($usr_id)
|
||||
{
|
||||
$this['session']->set('unlock_user_id', $usr_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the temporary unlock data
|
||||
*
|
||||
* @return null|integer
|
||||
*/
|
||||
public function getUnlockLink()
|
||||
{
|
||||
if ($this['session']->has('unlock_user_id')) {
|
||||
|
@@ -34,7 +34,9 @@ class Lightbox implements ControllerProviderInterface
|
||||
}
|
||||
|
||||
if (false === $usr_id = $app['authentication.token-validator']->isValid($request->query->get('LOG'))) {
|
||||
return $app->redirect("/login/?error=" . urlencode($e->getMessage()));
|
||||
$app->addFlash('error', _('The URL you used is out of date, please login'));
|
||||
|
||||
return $app->redirect($app->path('homepage'));
|
||||
}
|
||||
|
||||
$app['authentication']->openAccount(\User_Adapter::getInstance($usr_id, $app));
|
||||
|
@@ -46,7 +46,6 @@ interface ProviderInterface
|
||||
*/
|
||||
public function authenticate();
|
||||
|
||||
|
||||
/**
|
||||
* This method is called on provider callback, whenever the auth was
|
||||
* successful or failure.
|
||||
|
@@ -22,6 +22,12 @@ class TokenValidator
|
||||
$this->app = $app;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the token is valid
|
||||
*
|
||||
* @param type $token
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValid($token)
|
||||
{
|
||||
try {
|
||||
|
@@ -27,7 +27,6 @@ class Root implements ControllerProviderInterface
|
||||
->get('/language/{locale}/', $this->call('setLocale'))
|
||||
->bind('set_locale');
|
||||
|
||||
|
||||
$controllers
|
||||
->get('/', $this->call('getRoot'))
|
||||
->bind('root');
|
||||
|
@@ -41,7 +41,6 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface
|
||||
return new CookieManager($app['auth.password-encoder'], $app['EM'], $app['browser']);
|
||||
});
|
||||
|
||||
|
||||
$app['authentication.suggestion-finder'] = $app->share(function (Application $app) {
|
||||
return new SuggestionFinder($app);
|
||||
});
|
||||
|
Reference in New Issue
Block a user