Changeset 1649
- Timestamp:
- Dec 11, 2006, 7:04:53 AM (17 years ago)
- Location:
- trunk/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/config_default.inc.php
r1642 r1649 241 241 $conf['rate_items'] = array(0,1,2,3,4,5); 242 242 243 // Define default method to use ('http' or 'html' in order to do redirect) 244 $conf['default_redirect_method'] = 'http'; 245 243 246 // +-----------------------------------------------------------------------+ 244 247 // | metadata | -
trunk/include/functions.inc.php
r1637 r1649 601 601 602 602 /** 603 * Redirects to the given URL 603 * Redirects to the given URL (HTTP method) 604 * 605 * Note : once this function called, the execution doesn't go further 606 * (presence of an exit() instruction. 607 * 608 * @param string $url 609 * @return void 610 */ 611 function redirect_http( $url ) 612 { 613 if (ob_get_length () !== FALSE) 614 { 615 ob_clean(); 616 } 617 header('Request-URI: '.$url); 618 header('Content-Location: '.$url); 619 header('Location: '.$url); 620 exit(); 621 } 622 623 /** 624 * Redirects to the given URL (HTML method) 604 625 * 605 626 * Note : once this function called, the execution doesn't go further … … 611 632 * @return void 612 633 */ 613 function redirect ( $url , $msg = '', $refresh_time = 0)634 function redirect_html( $url , $msg = '', $refresh_time = 0) 614 635 { 615 636 global $user, $template, $lang_info, $conf, $lang, $t2, $page, $debug; … … 651 672 652 673 exit(); 674 } 675 676 /** 677 * Redirects to the given URL (Switch to HTTP method or HTML method) 678 * 679 * Note : once this function called, the execution doesn't go further 680 * (presence of an exit() instruction. 681 * 682 * @param string $url 683 * @param string $title_msg 684 * @param integer $refreh_time 685 * @return void 686 */ 687 function redirect( $url , $msg = '', $refresh_time = 0) 688 { 689 global $conf; 690 691 // with RefeshTime <> 0, only html must be used 692 if (($conf['default_redirect_method'] == 'http') and ($refresh_time == 0)) 693 { 694 redirect_http($url); 695 } 696 else 697 { 698 redirect_html($url, $msg, $refresh_time); 699 } 653 700 } 654 701 -
trunk/include/functions_html.inc.php
r1643 r1649 610 610 { 611 611 set_status_header(401); 612 redirect ($login_url);612 redirect_html($login_url); 613 613 } 614 614 } … … 624 624 if ($alternate_url==null) 625 625 $alternate_url = make_index_url(); 626 redirect ( $alternate_url,626 redirect_html( $alternate_url, 627 627 '<div style="text-align:left; margin-left:5em;margin-bottom:5em;"> 628 628 <h1 style="text-align:left; font-size:36px;">Page not found</h1><br/>'
Note: See TracChangeset
for help on using the changeset viewer.