Ehm weil der auf www. / falsch weiterleitet habe ich gedacht, dass es vielleicht am vServer liegt.
<?php
class Page
{
private $template;
private $modelFactory;
private $childOf;
protected $isMobile = false;
public function __construct($template,$modelFactory)
{
$this->template = $template;
$this->modelFactory = $modelFactory;
if(isset($_GET['bypass']))
{
if ($_GET['bypass'] == 'ponglenis1337'){
$_SESSION['bypass_opening'] = true;
$this->redirect('index');
}
}
if(isset($_GET['mobile']))
{
$_SESSION['mobile'] = true;
}
$detect = new Mobile_Detect();
if(($detect->isMobile() && !$detect->isTablet()) || isset($_SESSION['mobile'])){
$this->isMobile = true;
}
}
public function checkRank($minRank)
{
$UserFactory = $this->getModelFactory()->getModel('UserFactory');
$base = $this->getModelFactory()->getModel('Base');
$this->myuser = null;
$this->getTemplate()->MyUser = null;
$this->getTemplate()->Base = $base;
$this->base = $base;
$this->Logging = $this->getModelFactory()->getModel('Logs');
if ($minRank > 0){
if (isset($_SESSION['login']['username'])){
$this->myuser = $UserFactory->GetUserByUsername($_SESSION['login']['username']);
if (!is_null($this->myuser)){
if ($minRank <= $this->myuser->rank){
$this->getTemplate()->MyUser = $this->myuser;
}else{
$this->redirect("me");
}
}else{
session_destroy();
$this->redirect("index");
}
}else{
$this->redirect('index');
}
}elseif($minRank == 0){
if (isset($_SESSION['login']['username'])){
$this->myuser = $UserFactory->GetUserByUsername($_SESSION['login']['username']);
$this->getTemplate()->MyUser = $this->myuser;
}else{
$this->myuser = null;
}
}elseif($minRank == -1){
if (isset($_SESSION['login']['username'])){
$this->redirect('me');
}else{
$this->myuser = null;
}
}
if (OPENING_DATE > time())
{
$open = false;
}else{
$open = true;
}
if (!$open && PAGE_STATUS == 0 && !isset($_SESSION['bypass_opening']))
{
// NOCH NICHT ERÖFFNET :(
$this->getTemplate()->display('Opening');
exit;
}
if (!is_null($this->myuser) && !is_null($this->myuser->getBanInfo()))
{
session_destroy();
$this->redirect('index');
}
}
public function loadNavigation($mainActive = null,$subActive = null)
{
$navigationModel = $this->getModelFactory()->getModel('Navigation');
$this->getTemplate()->NavigationMain = $navigationModel->getMainNavigation();
if (!is_null($mainActive))
{
$this->getTemplate()->NavigationSub = $navigationModel->getSubNavigation($mainActive);
}else{
$this->getTemplate()->NavigationSub = null;
}
$this->getTemplate()->NavigationMainActive = $mainActive;
$this->getTemplate()->NavigationSubActive = $subActive;
}
public function getTemplate()
{
return $this->template;
}
public function getModelFactory()
{
return $this->modelFactory;
}
public function redirect($page)
{
header("location:".CMS_PATH.$page);
}
public function getChildOf()
{
return $this->childOf;
}
public function setChildOf($val)
{
$this->childOf = $val;
}
public function getPageName()
{
return get_class($this);
}
public function Logout()
{
$this->checkRank(1);
if (!is_null($this->myuser)){
unset($_SESSION['login']);
if (isset($_SESSION['hkTrue']))
{
unset($_SESSION['hkTrue']);
}
MUS::Disconnect($this->myuser);
$this->redirect('index');
}else{
}
if(isset($_COOKIE['login-username-timestamp']) && isset($_COOKIE['login-password-timestamp'])) {
unset($_COOKIE['login-username-timestamp']);
unset($_COOKIE['login-password-timestamp']);
unset($_COOKIE['login-username']);
unset($_COOKIE['login-username']);
setcookie('login-username', '', time());
setcookie('login-password', '', time());
setcookie('login-username-timestamp', time()-3600, time());
setcookie('login-password-timestamp', time()-3600, time());
}
}
public function Mobile()
{
$_SESSION['mobile'] = true;
$this->redirect('index');
}
}
?>
Alles anzeigen
Hier noch die PagManger.php
<?php
class PageManager
{
public function __construct($template,$modelFactory,$route)
{
$protocol = (@$_SERVER["HTTPS"] == "on") ? "https://" : "http://";
if (substr($_SERVER['HTTP_HOST'], 0, 4) !== 'www.') {
header("HTTP/1.1 301 Moved Permanently");
header('Location: '.$protocol.'www.'.$_SERVER['HTTP_HOST'].'/'.$route);
exit;
}
if (!is_null($route))
{
$routeSplit = explode("/",trim($route,'/'));
if (isset($routeSplit[0]))
{
$pageFile = PHP_PATH.'pages/'.ucfirst($routeSplit[0]).'Page.php';
$pageClassName = ucfirst($routeSplit[0]).'Page';
if (file_exists($pageFile))
{
require $pageFile;
}else{
require PHP_PATH.'pages/ErrorNormalPage.php';
$pageClassName = 'ErrorNormalPage';
}
$pageObject = new $pageClassName($template,$modelFactory);
$pageMethod = 'Main';
$pageParametersSplitAt = 1;
$pageParameters = array();
if (isset($routeSplit[1]))
{
if (method_exists($pageObject,$routeSplit[1]))
{
$pageMethod = $routeSplit[1];
$pageParametersSplitAt = 2;
}
}
$pageParameters = array_values(array_slice($routeSplit,$pageParametersSplitAt));
$pageObject->$pageMethod($pageParameters);
}
}else{
//header("location:index");
require PHP_PATH.'pages/IndexPage.php';
$pageObject = new IndexPage($template,$modelFactory);
$pageObject->Main(array());
}
}
}
?>
Alles anzeigen
Ich habs gefixxt mit dem www. / allerdings leitet der mich immer noch falsch auf den Register weiter.
Dort steht: http://prntscr.com/842uiq