Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer-cloud-storage

This commit is contained in:
Albert Santoni 2014-07-16 15:03:39 -04:00
commit c09457ce7c
30 changed files with 11878 additions and 105 deletions

View file

@ -14,9 +14,10 @@ class LoginController extends Zend_Controller_Action
$request = $this->getRequest();
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', 'en_CA'));
if (Zend_Auth::getInstance()->hasIdentity())
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity())
{
$this->_redirect('Showbuilder');
}
@ -52,8 +53,7 @@ class LoginController extends Zend_Controller_Action
//pass to the adapter the submitted username and password
$authAdapter->setIdentity($username)
->setCredential($password);
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($authAdapter);
if ($result->isValid()) {
//all info about this user from the login table omit only the password
@ -65,15 +65,13 @@ class LoginController extends Zend_Controller_Action
Application_Model_LoginAttempts::resetAttempts($_SERVER['REMOTE_ADDR']);
Application_Model_Subjects::resetLoginAttempts($username);
$tempSess = new Zend_Session_Namespace("referrer");
$tempSess->referrer = 'login';
//set the user locale in case user changed it in when logging in
Application_Model_Preference::SetUserLocale($locale);
$this->_redirect('Showbuilder');
} else {
$message = _("Wrong username or password provided. Please try again.");
Application_Model_Subjects::increaseLoginAttempts($username);
Application_Model_LoginAttempts::increaseAttempts($_SERVER['REMOTE_ADDR']);
@ -96,7 +94,8 @@ class LoginController extends Zend_Controller_Action
public function logoutAction()
{
Zend_Auth::getInstance()->clearIdentity();
$auth = Zend_Auth::getInstance();
$auth->clearIdentity();
$this->_redirect('showbuilder/index');
}

View file

@ -109,6 +109,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$controller = strtolower($request->getControllerName());
Application_Model_Auth::pinSessionToClient(Zend_Auth::getInstance());
//Ignore authentication for all access to the rest API. We do auth via API keys for this
//and/or by OAuth.