Merge branch '2.5.x' into cc-5709-airtime-analyzer

Conflicts:
	airtime_mvc/application/Bootstrap.php
	airtime_mvc/application/controllers/LoginController.php
	airtime_mvc/application/controllers/plugins/Acl_plugin.php
This commit is contained in:
drigato 2014-08-28 11:59:41 -04:00
commit 9fe0830dfd
93 changed files with 36793 additions and 2254 deletions

View file

@ -16,9 +16,8 @@ class LocaleController extends Zend_Controller_Action
$locale = Application_Model_Preference::GetLocale();
echo "var datatables_dict =" .
file_get_contents(Application_Common_OsPath::join(
$_SERVER["DOCUMENT_ROOT"],
$baseUrl,
"js/datatables/i18n/",
dirname(__file__),
"../../public/js/datatables/i18n/",
$locale.".txt")
);
}

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,8 @@ 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.
@ -118,7 +120,6 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
}
if (in_array($controller, array("api", "auth", "locale", "upgrade"))) {
$this->setRoleName("G");
} elseif (!Zend_Auth::getInstance()->hasIdentity()) {