Beispiel #1
0
 public function executeDisplayLinks()
 {
     $this->linksList = W3sPagePeer::getPagesOrderedByName();
     $oLanguage = W3sLanguagePeer::retrieveByPk($this->getRequestParameter('lang'));
     $this->language = $oLanguage->getLanguage();
     // 'italian';    . $idLanguage
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
  <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 {
    echo link_to_function('Login', sprintf('doLogin(\'%s\', \'/W3studioCMS/%s/%s.html\')', url_for('@sf_guard_signin'), strtolower($languageName), strtolower($pageName)), 'class="link_button"');
}
?>