示例#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
 }
 /**
  * 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()
 {
     $ks = $this->_getParam('ks');
     $form = new Form_AdminLogin();
     $this->view->form = $form;
     $client = Infra_ClientHelper::getClient();
     $client->setKs($ks);
     $user = $client->user->get();
     /* @var $user Kaltura_Client_Type_User */
     $userLoginId = $user->email;
     $partnerId = $user->partnerId;
     KalturaLog::debug('creating auth adapter');
     $adapter = new Infra_AuthAdapter($userLoginId, null, $form->getValue('timezone_offset'), null, $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
 }