diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-06-23 13:02:16 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-06-23 13:02:16 +0300 |
commit | fba961d11a55c8f934817e1c891b9360c77872cb (patch) | |
tree | b2f106c0160d704aca9c8495b419c00cb01a96a7 /plugins/Login/Controller.php | |
parent | a32f537a8a2fb39cd84bdb00103566ebc455b7f2 (diff) |
#8087 handle also the cases where a user has no access (redirect to the login form)
Diffstat (limited to 'plugins/Login/Controller.php')
-rw-r--r-- | plugins/Login/Controller.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/plugins/Login/Controller.php b/plugins/Login/Controller.php index b9660a221d..1f3f05ddbd 100644 --- a/plugins/Login/Controller.php +++ b/plugins/Login/Controller.php @@ -9,7 +9,6 @@ namespace Piwik\Plugins\Login; use Exception; -use Piwik\Access; use Piwik\Auth as AuthInterface; use Piwik\Common; use Piwik\Config; @@ -163,6 +162,26 @@ class Controller extends \Piwik\Plugin\Controller } /** + * Error message shown when an AJAX request has no access + * + * @param string $errorMessage + * @return string + */ + public function ajaxNoAccess($errorMessage) + { + return sprintf( + '<div class="alert alert-danger"> + <p><strong>%s:</strong> %s</p> + <p><a href="%s">%s</a></p> + </div>', + Piwik::translate('General_Error'), + $errorMessage, + 'index.php?module=Login&idSite=7&period=day&date=yesterday', + Piwik::translate('Login_LogIn') + ); + } + + /** * Authenticate user and password. Redirect if successful. * * @param string $login user name |