Esempio n. 1
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");
     }
 }