Esempio n. 1
0
//Get path info
$pathinfo = getPathInfo();

$url_parser = new UrlParser($pathinfo);
$path_array =  $url_parser->getPathArray();
$_pretty_url_course_id = $path_array[0];
$obj = $path_array[1];

if (!$obj->isEmpty()){
	/* 
	 * Addresses the issue for relative uri 
	 * @refer to constants.inc.php $_rel_link
	 */
	$_rel_url = $obj->redirect();
	$var_query = $obj->parsePrettyQuery();
	save2Get($var_query);	//remake all the _GET and _REQUEST variables so that the vitals can use it

	$_user_location	= '';	//reset user_location so that the vital file in each page would validate
	$pretty_current_page = $obj->getPage();
	//If page not found, forward back to index.php
	//ignore error, cause it will give a warning: No such file error, and can't send header.
	if (!@include($pretty_current_page)){
		header('Location: '.AT_BASE_HREF.'index.php');
		exit;
	} 
} elseif ($_pretty_url_course_id==0) {
	//TODO: $_SESSION[course_id] seems to be resetted to 0, causing vitals.inc.php line 273 to redirect incorrectly.
	//		Need to find out where exactly the course_id is being resetted. 
	return;
//	header('location: '.AT_BASE_HREF.'bounce.php?course=0');
//	exit;
Esempio n. 2
0
    $_config[$row['name']] = $row['value'];
}
//Get path info
$pathinfo = getPathInfo();
$url_parser = new UrlParser($pathinfo);
$path_array = $url_parser->getPathArray();
$_pretty_url_course_id = $path_array[0];
$obj = $path_array[1];
if (!$obj->isEmpty()) {
    /* 
     * Addresses the issue for relative uri 
     * @refer to constants.inc.php $_rel_link
     */
    $_rel_url = $obj->redirect();
    $var_query = $obj->parsePrettyQuery();
    save2Get($var_query);
    //remake all the _GET and _REQUEST variables so that the vitals can use it
    $_user_location = '';
    //reset user_location so that the vital file in each page would validate
    $pretty_current_page = $obj->getPage();
    //If page not found, forward back to index.php
    //ignore error, cause it will give a warning: No such file error, and can't send header.
    if (!@(include $pretty_current_page)) {
        header('Location: ' . AT_BASE_HREF . 'index.php');
        exit;
    }
} elseif ($_pretty_url_course_id == 0) {
    //TODO: $_SESSION[course_id] seems to be resetted to 0, causing vitals.inc.php line 273 to redirect incorrectly.
    //		Need to find out where exactly the course_id is being resetted.
    return;
    //	header('location: '.AT_BASE_HREF.'bounce.php?course=0');