public function loginAction() { $analytics = new SxCms_Analytics(); if ($this->getRequest()->isPost()) { $email = $this->_getParam('email', ''); $password = $this->_getParam('password', ''); //echo "email $email password $password"; if ($email == '' or $password == '') { $this->view->error = $this->admin_tmx->_('emailpasswordempty'); } else { require_once APPLICATION_ROOT . '/library/Gapi/gapi.php'; require_once APPLICATION_ROOT . '/library/Gapi/gManagementApi.php'; try { $ga = new gManagementApi($email, $password); } catch (exception $e) { $this->view->error = $this->admin_tmx->_('logindoesntmatch'); } if (!isset($e)) { $analytics->setLogin($email)->setPass($password)->setStep('2')->save(); header('Location: /admin/analytics/profile'); exit; } } } }