コード例 #1
0
ファイル: SmartySSL.php プロジェクト: mikejw/empathy
 public function display($template, $internal = false)
 {
     if ($internal) {
         $this->switchInternal();
     }
     if (\Empathy\MVC\Util\Misc::isSecure()) {
         echo str_replace('http://' . WEB_ROOT, 'https://' . WEB_ROOT, $this->smarty->fetch($template));
     } else {
         $this->smarty->display($template);
     }
 }
コード例 #2
0
ファイル: MdModule.php プロジェクト: mikejw/elib-mdmodule
 private static function doRedirect()
 {
     $proto = \Empathy\MVC\Util\Misc::isSecure() ? 'https' : 'http';
     if (isset(self::$config['redirect'])) {
         $loc = $proto . '://' . WEB_ROOT . PUBLIC_DIR . '/' . self::$class . '/' . self::$config['redirect'];
         header('Location: ' . $loc);
         exit;
     }
 }
コード例 #3
0
ファイル: Controller.php プロジェクト: mikejw/empathy
 /**
  * Redirect the user to another location within the application
  * Redirection is disabled if the MVC_TEST_MODE global flag is detected to prevent tests breaking
  * but execution always begins to end here
  *
  * @param string $endString the new URI to redirect to.
  *
  * @return void
  */
 public function redirect($endString)
 {
     $proto = \Empathy\MVC\Util\Misc::isSecure() ? 'https' : 'http';
     if (!defined('MVC_TEST_MODE')) {
         session_write_close();
         $location = 'Location: ';
         $location .= $proto . '://' . WEB_ROOT . PUBLIC_DIR . '/';
         if ($endString != '') {
             $location .= $endString;
         }
         header($location);
     } else {
         throw new TestModeException('Cannot redirect due to test mode.');
     }
 }