/**
  * This where we check whether the user is logged in or not.
  */
 public function send_http_headers()
 {
     parent::send_http_headers();
     /*
      * Make sure that the user is logged in.
      */
     $alm = UserLogin_LoginManager::get_instance();
     if (!$alm->is_logged_in()) {
         $_SESSION['user-login-data']['desired-url'] = new HTMLTags_URL();
         $_SESSION['user-login-data']['desired-url']->set_file('/');
         $redirection_manager = new PublicHTML_RedirectionManager();
         $redirection_url = $redirection_manager->get_url();
         $redirection_url->set_file('/');
         $location_header_line = 'Location: ' . $redirection_url->get_as_string();
         header($location_header_line);
         exit;
     }
 }
示例#2
0
<?php

/**
 * Security restrictions for the admin-includer page.
 *
 * @copyright Clear Line Web Design, 2007-08-19
 */
$alm = Admin_LoginManager::get_instance();
if (!$alm->is_logged_in()) {
    $_SESSION['admin-login-data']['desired-url'] = new HTMLTags_URL();
    $_SESSION['admin-login-data']['desired-url']->set_file('/hc/admin/navigation.html');
    $redirection_manager = new PublicHTML_RedirectionManager();
    $redirection_url = $redirection_manager->get_url();
    $redirection_url->set_file('/hc/admin/login.html');
    $location_header_line = 'Location: ' . $redirection_url->get_as_string();
    header($location_header_line);
    exit;
}
示例#3
0
<?php

/**
 * The default pre-main section for redirect-scripts.
 *
 * @copyright Clear Line Web Design, 2007-07-17
 */
//echo '__FILE__: ' . __FILE__ . "\n";
//exit;
/*
 * Create the singleton objects.
 */
$gvm = Caching_GlobalVarManager::get_instance();
$page_manager = PublicHTML_PageManager::get_instance();
/*
 * This is the old fashioned way of doing this.
 */
if (isset($_GET['return_to'])) {
    $return_to = new HTMLTags_URL();
    $return_to->parse_url($_GET['return_to']);
    $page_manager->set_return_to_url($return_to);
} else {
    #$return_to_url = $page_manager->get_return_to_url();
    $rm = new PublicHTML_RedirectionManager();
    $return_to_url = $rm->get_current_url();
    $return_to_url->set_get_variable('type', 'html');
    $page_manager->set_return_to_url($return_to_url);
}
/*
 * See check-get-vars.inc.php for the newer way.
 */
// * Define which module is being asked for.
// */
//define('MODULE', isset($_GET['module']) ? $_GET['module'] : 'admin');
//
///*
// * Define which page we are on.
// */
//define('PAGE', isset($_GET['page']) ? $_GET['page'] : 'home');
$success_url = new HTMLTags_URL();
if (isset($_GET['success_url'])) {
    $success_url->parse_url($_GET['success_url']);
} else {
    if (isset($_GET['return_to'])) {
        $success_url->parse_url($_GET['return_to']);
    } else {
        $rm = new PublicHTML_RedirectionManager();
        $success_url = $rm->get_current_url();
        $success_url->set_get_variable('type', 'html');
    }
}
$gvm->set('success-url', $success_url);
$failure_url = new HTMLTags_URL();
if (isset($_GET['failure_url'])) {
    $failure_url->parse_url($_GET['failure_url']);
} else {
    if (isset($_GET['return_to'])) {
        $success_url->parse_url($_GET['return_to']);
    } else {
        $failure_url = clone $success_url;
    }
}