Example #1
0
 /**
  * This action can only be accessed from the admin console, and passes a KS with which it is possible to access the VAR console
  */
 public function adminLoginAction()
 {
     $form = new Form_AdminLogin();
     $this->view->form = $form;
     KalturaLog::debug('creating auth adapter');
     $adapter = new Kaltura_VarAuthAdapter();
     $adapter->setTimezoneOffset($this->_getParam('timezone_offset'));
     $adapter->setKS($this->_getParam('ks'));
     //$adapter = new Zend_Auth_Adapter_DbTable($zendDb);
     $auth = Infra_AuthHelper::getAuthInstance();
     $result = $auth->authenticate($adapter);
     if ($result->isValid()) {
         $this->_helper->redirector('list-by-user', 'partner');
     } else {
         $form->setDescription('invalid login');
     }
     $form->setDefault('next_uri', $this->_getParam('next_uri'));
     // set in Infra_AuthPlugin
 }
Example #2
0
 public function varConsoleRedirectAction()
 {
     $request = $this->getRequest();
     $client = Infra_ClientHelper::getClient();
     $authorizedPartnerId = $this->_getParam('partner_id');
     $email = Infra_AuthHelper::getAuthInstance()->getIdentity()->getUser()->email;
     $password = Infra_AuthHelper::getAuthInstance()->getIdentity()->getPassword();
     $timezoneOffset = Infra_AuthHelper::getAuthInstance()->getIdentity()->getTimezoneOffset();
     $adapter = new Kaltura_VarAuthAdapter();
     $adapter->setCredentials($email, $password);
     $adapter->setPartnerId($authorizedPartnerId);
     $adapter->setTimezoneOffset($timezoneOffset);
     $auth = Infra_AuthHelper::getAuthInstance();
     $result = $auth->authenticate($adapter);
     if ($result->isValid()) {
         $this->_helper->redirector('list', 'partner');
     } else {
         throw new Exception("login failed");
     }
 }