예제 #1
0
 public function post(\Request $request)
 {
     $cmd = $request->shiftCommand();
     switch ($cmd) {
         case 'toggleAllow':
             \Settings::set('pulse', 'allow_web_access', (\Settings::get('pulse', 'allow_web_access') - 1) * -1);
             $response = new \Http\SeeOtherResponse(\Server::getSiteUrl() . 'pulse/admin/');
             break;
     }
     return $response;
     exit;
 }
예제 #2
0
파일: Form.php 프로젝트: HaldunA/phpwebsite
 /**
  * Sets the action url.
  * @param string $action
  */
 public function setAction($action)
 {
     if (!preg_match('/^http(s)?:/i', $action)) {
         $action = \Server::getSiteUrl() . $action;
     }
     $this->action = $action;
 }
예제 #3
0
 /**
  * Creates a src url path based on the current directory.
  */
 private function loadSrc()
 {
     $this->loadRelativePath();
     $this->setSrc(\Server::getSiteUrl() . $this->getRelativePath());
 }
예제 #4
0
 private function sendWinnerEmail($lottery, \tailgate\Resource\Game $game)
 {
     $variables = $game->getStringVars();
     $variables['confirmation_link'] = \Server::getSiteUrl() . 'tailgate/User/Lottery/?command=confirm&hash=' . $lottery['confirmation'];
     $tpl = new \Template();
     $tpl->setModuleTemplate('tailgate', 'Admin/Lottery/Winner.html');
     $tpl->addVariables($variables);
     $content = $tpl->get();
     $this->sendEmail('Tailgate successful', $lottery['student_id'], $content);
 }
예제 #5
0
 /**
  * Returns the installations url address
  */
 public static function getHomeHttp($with_http = true, $with_directory = true, $with_slash = true)
 {
     $url = Server::getSiteUrl($with_http, $with_directory);
     if ($with_slash && !preg_match('/\\/$/', $url)) {
         $url .= '/';
     }
     return $url;
 }
예제 #6
0
<?php

// Detect phpWebSite
if (file_exists('../config/core/config.php')) {
    define('PHPWEBSITE', true);
    require_once '../config/core/config.php';
    require_once PHPWS_SOURCE_DIR . 'inc/Bootstrap.php';
    if (isset($_SERVER['PHP_AUTH_USER'])) {
        require_once PHPWS_SOURCE_DIR . 'mod/users/class/Current_User.php';
        Current_User::loginUser(preg_replace(PHPWS_SHIBB_USER_AUTH, '', $_SERVER['PHP_AUTH_USER']));
    }
    PHPWS_unBootstrap();
}
// Build new URL
require_once PHPWS_SOURCE_DIR . 'Global/Server.php';
$redirect = preg_replace('/secure\\/?$/', '', \Server::getSiteUrl());
?>
<html>
    <head>
        <!-- THIS FILE SHOULD NEVER EVER BE CACHED.  MAKE SURE TO DISABLE CACHING AT THE APACHE LEVEL. -->
        <meta http-equiv="refresh" content="0;url=<?php 
echo $redirect;
?>
" />
    </head>
    <body>
        <p><a href="<?php 
echo $redirect;
?>
">If you are not redirected automatically, please click this link.</a></p>
    </body>
예제 #7
0
 private function confirmWinner()
 {
     $game = \tailgate\Factory\Game::getCurrent();
     $hash = filter_input(INPUT_GET, 'hash', FILTER_SANITIZE_STRING);
     $template = new \Template();
     $factory = new Factory();
     $template->setModuleTemplate('tailgate', 'User/confirmation.html');
     $template->add('button_color', 'primary');
     if ($game->getPickupDeadline() < time()) {
         $template->add('message_color', 'danger');
         $template->add('message', 'Sorry, the confirmation deadline for this lottery has passed.');
         $template->add('url', \Server::getSiteUrl());
         $template->add('label', 'Go back to home page');
         $content = $template->get();
         return $content;
     }
     $confirm = $factory->confirm($hash);
     if ($confirm) {
         $template->add('message_color', 'success');
         $template->add('message', 'Lottery win confirmed!');
         if (!\Current_User::isLogged()) {
             $template->add('url', \Server::getSiteUrl() . 'admin/');
             $template->add('label', 'Log in to pick your lot');
         } else {
             $template->add('url', \Server::getSiteUrl() . 'tailgate/');
             $template->add('label', 'Go to your status page and pick a spot');
         }
     } else {
         $template->add('message_color', 'danger');
         $template->add('message', 'Sorry, could not confirm your lottery win. Contact us if you are having trouble.');
         $template->add('url', \Server::getSiteUrl());
         $template->add('label', 'Go back to home page');
     }
     $content = $template->get();
     return $content;
 }