示例#1
0
 /**
  * @covers \Cx\Core\Json\Adapter\Block\JsonBlock::saveBlockContent
  */
 public function testSaveBlockContent()
 {
     global $sessionObj;
     $sessionObj = !$sessionObj ? \cmsSession::getInstance() : $sessionObj;
     $user = \FWUser::getFWUserObject()->objUser->getUser(1);
     \FWUser::loginUser($user);
     $jsonBlock = new JsonBlock();
     $jsonBlock->saveBlockContent(array('get' => array('block' => 32, 'lang' => 'de'), 'post' => array('content' => 'bla')));
     $result = $jsonBlock->getBlockContent(array('get' => array('block' => 32, 'lang' => 'de')));
     $this->assertEquals('bla', $result['content']);
 }
示例#2
0
 /**
  * @covers \Cx\Modules\Block\Controller\JsonBlockController::saveBlockContent
  */
 public function testSaveBlockContent()
 {
     $sessionObj = self::$cx->getComponent('Session')->getSession();
     $user = \FWUser::getFWUserObject()->objUser->getUser(1);
     \FWUser::loginUser($user);
     $jsonBlock = $this->getJsonBlockController();
     $jsonBlock->saveBlockContent(array('get' => array('block' => 32, 'lang' => 'de'), 'post' => array('content' => 'bla')));
     $result = $jsonBlock->getBlockContent(array('get' => array('block' => 32, 'lang' => 'de')));
     $this->assertEquals('bla', $result['content']);
 }
示例#3
0
 public function verifyUserAccount($email, $key)
 {
     global $_CORELANG;
     // TODO: add verificationTimeout as configuration option
     $verificationExpired = time() - 30 * 86400;
     $userFilter = array('restore_key' => $key, 'regdate' => array(array('>' => $verificationExpired), '=' => $verificationExpired), 'active' => 1, 'email' => $email);
     $objUser = $this->objUser->getUsers($userFilter, null, null, null, 1);
     if ($objUser) {
         if ($objUser->setVerification(true) && $objUser->releaseRestoreKey() && $objUser->store()) {
             // TODO: destroy session and create new one
             \FWUser::loginUser($objUser);
             // TODO: add language variable
             \Message::add('Sie haben Ihr Konto erfolgreich bestätigt.', \Message::CLASS_OK);
             return true;
         }
         $this->arrStatusMsg['error'] = array_merge($this->arrStatusMsg['error'], $objUser->getErrorMsg());
     } else {
         $this->arrStatusMsg['error'][] = $_CORELANG['TXT_INVALID_USER_ACCOUNT'];
     }
     return false;
 }