2015-03-27 02:00:01 +01:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
2015-03-08 18:02:59 +01:00
|
|
|
|
|
|
|
class Redirect {
|
|
|
|
|
2018-08-27 22:19:42 +02:00
|
|
|
public static function url($url, $httpCode=301)
|
2015-03-08 18:02:59 +01:00
|
|
|
{
|
2018-08-27 22:19:42 +02:00
|
|
|
if (!headers_sent()) {
|
|
|
|
header("Location:".$url, TRUE, $httpCode);
|
2018-09-11 23:37:45 +02:00
|
|
|
exit(0);
|
2015-03-08 18:02:59 +01:00
|
|
|
}
|
|
|
|
|
2018-09-11 23:37:45 +02:00
|
|
|
exit('<meta http-equiv="refresh" content="0; url='.$url.'"/>');
|
2015-03-08 18:02:59 +01:00
|
|
|
}
|
|
|
|
|
2017-05-16 00:46:20 +02:00
|
|
|
public static function page($page)
|
2015-03-08 18:02:59 +01:00
|
|
|
{
|
2018-09-11 23:37:45 +02:00
|
|
|
self::url(HTML_PATH_ADMIN_ROOT.$page);
|
2015-03-08 18:02:59 +01:00
|
|
|
}
|
2015-05-15 00:07:45 +02:00
|
|
|
|
|
|
|
public static function home()
|
|
|
|
{
|
|
|
|
self::url(HTML_PATH_ROOT);
|
|
|
|
}
|
|
|
|
|
2018-10-23 20:25:06 +02:00
|
|
|
public static function admin()
|
|
|
|
{
|
|
|
|
self::url(HTML_PATH_ADMIN_ROOT);
|
|
|
|
}
|
2017-05-16 00:46:20 +02:00
|
|
|
}
|