Exemplo n.º 1
0
 public function __construct()
 {
     parent::__construct(false);
     $this->sAction = 'login';
     if (Manager::isPost()) {
         ArrayUtil::trimStringsInArray($_POST);
     }
     //1st step: user clicked on the recovery link
     //	• Display email field
     if (isset($_REQUEST['password_forgotten'])) {
         $this->sAction = 'password_forgotten';
     }
     //2nd step: user has entered an email address
     //	• Send the email with the recovery link (and generate the hint)
     //	• Add confirmation message to flash
     if (isset($_POST['password_reset_user_name'])) {
         $this->sAction = self::processPasswordReset();
     }
     //3rd step: user has clicked on the reset link in the e-mail
     //	• Validate the hint
     //	• Display a form for entering a new password (form also contains hidden fields for email and hint)
     //	• Add the referrer to the session (again)
     if (isset($_REQUEST['recover_username'])) {
         $this->sAction = self::passwordReset();
     }
     //4th step: user has submitted the new password
     //	• Validate the hint (again)
     //	• Validate password constraints
     //	• Set the new password (if valid)
     //	• Log in (if valid)
     //	• Redirect to the referrer (if valid)
     if (isset($_POST['new_password'])) {
         $this->sAction = self::loginNewPassword();
     }
     if (isset($_POST[self::USER_NAME])) {
         self::login();
     }
     $oOutput = new XHTMLOutput('transitional');
     $oOutput->render();
     $this->oTemplate = new Template('login', array(DIRNAME_TEMPLATES, 'login'), false, true);
 }
 public function renderFile()
 {
     //Prerequisites
     Session::getSession()->setLanguage($this->sLanguageId);
     //Clear index
     SearchIndexQuery::create()->filterByLanguageId($this->sLanguageId)->delete();
     //Spider index
     $oRootPage = PagePeer::getRootPage();
     $this->oRootNavigationItem = PageNavigationItem::navigationItemForPage($oRootPage);
     $this->spider($this->oRootNavigationItem);
     //GC
     gc_enable();
     //Update index
     PreviewManager::setTemporaryManager('FrontendManager');
     foreach ($this->aIndexPaths as $aPath) {
         $bIsIndexed = $this->index($aPath);
         set_time_limit(30);
         $this->gc();
         $sMessage = $bIsIndexed ? 'Indexed' : 'Skipped';
         print "{$sMessage} <code>/" . htmlentities(implode('/', $aPath)) . "</code><br>\n";
     }
     PreviewManager::revertTemporaryManager();
 }
Exemplo n.º 3
0
 public function adminPreview($iObjectId)
 {
     if ($this->sLanguageId === null) {
         $this->sLanguageId = AdminManager::getContentLanguage();
     }
     $oCurrentContentObject = $this->contentObjectById($iObjectId);
     $oCurrentLanguageObject = $oCurrentContentObject->getLanguageObject($this->sLanguageId);
     //Some frontend modules use this
     FrontendManager::$CURRENT_PAGE = $oCurrentContentObject->getPage();
     //Some frontend modules generate links into the current manager – those need to be correct
     PreviewManager::setTemporaryManager();
     $oModuleInstance = $this->backendModuleInstanceByLanguageObject($oCurrentLanguageObject);
     $aResult = array('preview_contents' => $this->getModuleContents($oModuleInstance, false));
     PreviewManager::revertTemporaryManager();
     return $aResult;
 }
Exemplo n.º 4
0
 public static function revertTemporaryManager()
 {
     self::$CURRENT_MANAGER = self::$PREVIOUS_MANAGER;
 }