public function executeSignout($request) { /* We need to be sure that user is authenticated because it can have more * sessions opened in several browsers ot browsers tabs */ if ($this->getUser()->isAuthenticated()) { $idUser = $this->getUser()->getGuardUser()->getId(); $this->getUser()->signOut(); $operation = $request->getParameter('lang') . $request->getParameter('page'); semaphore::deleteOperation($idUser, $operation); } $oPage = W3sPagePeer::retrieveByPk($this->getRequestParameter('page')); $oLanguage = W3sLanguagePeer::retrieveByPk($this->getRequestParameter('lang')); $this->getResponse()->setHttpHeader('X-JSON', '([["sPageUrl", "/' . strtolower($oLanguage->getLanguage()) . '/' . strtolower($oPage->getPageName()) . '.html"]])'); return sfView::HEADER_ONLY; }
/** * Renames the page */ public function executeRename($request) { if ($request->hasParameter('idPage') && $request->hasParameter('newName')) { $page = W3sPagePeer::retrieveByPk($this->getRequestParameter('idPage')); if ($page != null) { $page->setPageName($this->getRequestParameter('newName')); $page->save(); $fileManager = new w3sFileManager($this->getRequestParameter('curLang'), $this->getRequestParameter('curPage')); return $this->renderPartial('listPages', array('fileManager' => $fileManager)); } else { $this->getResponse()->setStatusCode(404); return $this->renderText(w3sCommonFunctions::toI18n('The requested page does not exists anymore.')); } } else { $this->getResponse()->setStatusCode(404); return $this->renderText(w3sCommonFunctions::toI18n('One or more required parameter are missing.')); } }
?> <div id="w3s_signin"> <form action="<?php echo url_for('@sf_guard_signin'); ?> " method="post"> <table style="padding: 4px"> <?php echo $form; ?> <tr> <td></td> <td> <?php $oPage = W3sPagePeer::retrieveByPk($sf_request->getParameter('page')); if ($oPage != null) { $pageName = $oPage->getPageName(); $oLanguage = W3sLanguagePeer::retrieveByPk($sf_request->getParameter('lang')); $languageName = $oLanguage != null ? $oLanguage->getLanguage() : ''; } else { $pageName = ''; $languageName = ''; } /* In the test enviroment we need a real submit button. In others * enviroments the button to perform the login is a link to a * javascript function. */ if (sfConfig::get('sf_environment') == 'test' || !$isAjax) { echo submit_tag(__('signin')); } else {