1
0
Fork 0

Fix include/template paths

master
Anonymous Contributor 2023-08-23 18:16:35 +02:00
parent 17fe6651c8
commit d3f3ca5779
21 changed files with 43 additions and 37 deletions

View File

@ -15,7 +15,7 @@
echo '<table style="width:350px;margin-left:auto;margin-right:auto;margin-top:25px"><tr><th align="left" style="background-color: #FF8000;">Name</th><th align="left" style="background-color: #FF8000;">Region</th></tr>'; echo '<table style="width:350px;margin-left:auto;margin-right:auto;margin-top:25px"><tr><th align="left" style="background-color: #FF8000;">Name</th><th align="left" style="background-color: #FF8000;">Region</th></tr>';
$entryColor = TRUE; $entryColor = TRUE;
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
while($row = $statement->fetch()) while($row = $statement->fetch())
{ {

View File

@ -1,5 +1,5 @@
<?php <?php
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
$HTML = new HTML(); $HTML = new HTML();

View File

@ -1,7 +1,6 @@
<?php <?php
class HTML class HTML
{ {
//Hier wird der HTML Code zum Ausgeben vorbereitet. //Hier wird der HTML Code zum Ausgeben vorbereitet.
//Dieser kann aus einer fertigen HTML Seite ausgelesen werden, oder aber auch st<73>ck f<>r St<53>ck //Dieser kann aus einer fertigen HTML Seite ausgelesen werden, oder aber auch st<73>ck f<>r St<53>ck
//Zusammen gebaut werden. //Zusammen gebaut werden.
@ -61,8 +60,9 @@
} }
public function importHTMLHeader($file){ public function importHTMLHeader($file){
global $RUNTIME;
//Der HTML Header wird aus einer Datei eingelesen und der bisherige gel<65>scht. //Der HTML Header wird aus einer Datei eingelesen und der bisherige gel<65>scht.
$this->HTMLHeader = file_get_contents($file); $this->HTMLHeader = file_get_contents($RUNTIME['BASEDIR'].'/templates/'.$file);
$this->isBuild = false; $this->isBuild = false;
} }
@ -90,8 +90,9 @@
} }
public function importHTMLMenu($file){ public function importHTMLMenu($file){
global $RUNTIME;
//Das Komplette Men<65> wird aus einer Datei ausgelesen und das alte <20>berschrieben. //Das Komplette Men<65> wird aus einer Datei ausgelesen und das alte <20>berschrieben.
$this->DasMenu = file_get_contents($file); $this->DasMenu = file_get_contents($RUNTIME['BASEDIR'].'/templates/'.$file);
$this->isBuild = false; $this->isBuild = false;
} }
@ -106,8 +107,9 @@
//Der Seiten HTML Quelcode wird eingelesen. //Der Seiten HTML Quelcode wird eingelesen.
public function importHTML($file){ public function importHTML($file){
global $RUNTIME;
//Der HTML Quelltext wird aus einer Datei eingelesen. //Der HTML Quelltext wird aus einer Datei eingelesen.
$this->HTMLDatei = file_get_contents($file); $this->HTMLDatei = file_get_contents($RUNTIME['BASEDIR'].'/templates/'.$file);
$this->isBuild = false; $this->isBuild = false;
} }
@ -138,8 +140,9 @@
//Der inhalt der Seite wird zusammen gesetzt (nicht der quelltext) (%%EchoInhalt%%) //Der inhalt der Seite wird zusammen gesetzt (nicht der quelltext) (%%EchoInhalt%%)
public function importSeitenInhalt($file){ public function importSeitenInhalt($file){
global $RUNTIME;
//L<>d einen fertigen Text aus einer datei. //L<>d einen fertigen Text aus einer datei.
$this->DerInhalt = file_get_contents($file); $this->DerInhalt = file_get_contents($RUNTIME['BASEDIR'].'/templates/'.$file);
$this->isBuild = false; $this->isBuild = false;
} }
@ -150,8 +153,9 @@
} }
public function importAndAddSeitenInhalt($file){ public function importAndAddSeitenInhalt($file){
global $RUNTIME;
//L<>d einen fertigen Text aus einer datei. //L<>d einen fertigen Text aus einer datei.
$this->DerInhalt = $this->DerInhalt.file_get_contents($file); $this->DerInhalt = $this->DerInhalt.file_get_contents($RUNTIME['BASEDIR'].'/templates/'.$file);
$this->isBuild = false; $this->isBuild = false;
} }

View File

@ -1,5 +1,5 @@
<?php <?php
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
$statement = $RUNTIME['PDO']->prepare("CREATE TABLE IF NOT EXISTS `iarstates` (`userID` VARCHAR(36) NOT NULL COLLATE 'utf8_unicode_ci', `filesize` BIGINT(20) NOT NULL DEFAULT '0', `iarfilename` VARCHAR(64) NOT NULL COLLATE 'utf8_unicode_ci', `running` INT(1) NOT NULL DEFAULT '0', PRIMARY KEY (`userID`) USING BTREE) COLLATE='utf8_unicode_ci' ENGINE=InnoDB;"); $statement = $RUNTIME['PDO']->prepare("CREATE TABLE IF NOT EXISTS `iarstates` (`userID` VARCHAR(36) NOT NULL COLLATE 'utf8_unicode_ci', `filesize` BIGINT(20) NOT NULL DEFAULT '0', `iarfilename` VARCHAR(64) NOT NULL COLLATE 'utf8_unicode_ci', `running` INT(1) NOT NULL DEFAULT '0', PRIMARY KEY (`userID`) USING BTREE) COLLATE='utf8_unicode_ci' ENGINE=InnoDB;");

View File

@ -39,7 +39,7 @@
while($row = $statement->fetch()) while($row = $statement->fetch())
{ {
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
$email = $opensim->getUserMail($row['PrincipalID']); $email = $opensim->getUserMail($row['PrincipalID']);

View File

@ -19,7 +19,7 @@
if($result == FALSE || $result == "") if($result == FALSE || $result == "")
{ {
include '../app/OpenSim.php'; include 'app/OpenSim.php';
echo "Die Region ".$row['regionName']." von ".$opensim->getUserName($row['owner_uuid'])." ist nicht erreichbar.\n"; echo "Die Region ".$row['regionName']." von ".$opensim->getUserName($row['owner_uuid'])." ist nicht erreichbar.\n";

View File

@ -7,9 +7,9 @@ include_once("app/utils.php");
include_once("app/HTML.php"); include_once("app/HTML.php");
$RUNTIME = array(); $RUNTIME = array();
$RUNTIME['BASEDIR'] = __DIR__;
include_once("config.php"); include_once("config.php");
if ($handle = opendir('./cron/')) if ($handle = opendir('./cron/'))
{ {
while (false !== ($entry = readdir($handle))) while (false !== ($entry = readdir($handle)))

View File

@ -2,6 +2,8 @@
date_default_timezone_set("Europe/Berlin"); date_default_timezone_set("Europe/Berlin");
error_reporting(E_ALL); error_reporting(E_ALL);
include_once("config.php"); include_once("config.php");
$RUNTIME['BASEDIR'] = __DIR__;
set_include_path('.:'.$RUNTIME['BASEDIR']);
session_set_cookie_params([ session_set_cookie_params([
'lifetime' => 86400, 'lifetime' => 86400,

View File

@ -1,9 +1,9 @@
<?php <?php
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
$HTML->setHTMLTitle("Dashboard"); $HTML->setHTMLTitle("Dashboard");
$HTML->importSeitenInhalt("../templates/dashboard-home.html"); $HTML->importSeitenInhalt("dashboard-home.html");
$HTML->ReplaceSeitenInhalt("%%GLOBAL-USER-COUNT%%", $opensim->getUserCount()); $HTML->ReplaceSeitenInhalt("%%GLOBAL-USER-COUNT%%", $opensim->getUserCount());
$HTML->ReplaceSeitenInhalt("%%GLOBAL-REGION-COUNT%%", $opensim->getRegionCount()); $HTML->ReplaceSeitenInhalt("%%GLOBAL-REGION-COUNT%%", $opensim->getRegionCount());

View File

@ -12,7 +12,7 @@
} }
$HTML->setHTMLTitle("Online Anzeige"); $HTML->setHTMLTitle("Online Anzeige");
$HTML->importSeitenInhalt("../templates/online-anzeige.html"); $HTML->importSeitenInhalt("online-anzeige.html");
$table = '<table class="table"><thead><tr><th scope="col">Name</th><th scope="col">Optionen</th></thead><tbody>%%ENTRY%%</tbody></table>'; $table = '<table class="table"><thead><tr><th scope="col">Name</th><th scope="col">Optionen</th></thead><tbody>%%ENTRY%%</tbody></table>';
@ -25,7 +25,7 @@
$FriendData = explode(";", $row['Friend']); $FriendData = explode(";", $row['Friend']);
$Friend = $FriendData[0]; $Friend = $FriendData[0];
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
$entry = '<tr><td>'.trim($opensim->getUserName($Friend)).'</td><td><a href="index.php?page=friends&action=remove&uuid='.$row['Friend'].'">LÖSCHEN</a></td></tr>'; $entry = '<tr><td>'.trim($opensim->getUserName($Friend)).'</td><td><a href="index.php?page=friends&action=remove&uuid='.$row['Friend'].'">LÖSCHEN</a></td></tr>';

View File

@ -8,11 +8,11 @@
die(); die();
} }
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
$HTML->setHTMLTitle("Gruppen"); $HTML->setHTMLTitle("Gruppen");
$HTML->importSeitenInhalt("../templates/deine-regionen.html"); $HTML->importSeitenInhalt("deine-regionen.html");
$table = '<table class="table"><thead><tr><th scope="col">Name</th><th scope="col">Gründer</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>'; $table = '<table class="table"><thead><tr><th scope="col">Name</th><th scope="col">Gründer</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>';

View File

@ -1,6 +1,6 @@
<?php <?php
$HTML->setHTMLTitle("Identitäten"); $HTML->setHTMLTitle("Identitäten");
$HTML->importSeitenInhalt("../templates/identities.html"); $HTML->importSeitenInhalt("identities.html");
$statementCreateTable = $RUNTIME['PDO']->prepare("CREATE TABLE IF NOT EXISTS `UserIdentitys` (`PrincipalID` VARCHAR(38) NOT NULL, `IdentityID` VARCHAR(38) NOT NULL, PRIMARY KEY (`IdentityID`))"); $statementCreateTable = $RUNTIME['PDO']->prepare("CREATE TABLE IF NOT EXISTS `UserIdentitys` (`PrincipalID` VARCHAR(38) NOT NULL, `IdentityID` VARCHAR(38) NOT NULL, PRIMARY KEY (`IdentityID`))");
$statementCreateTable->execute(); $statementCreateTable->execute();
@ -64,7 +64,7 @@
} }
} }
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
if(isset($_REQUEST['createIdent']) && isset($_REQUEST['newName']) && $_REQUEST['createIdent'] == "" && $_REQUEST['newName'] != "") if(isset($_REQUEST['createIdent']) && isset($_REQUEST['newName']) && $_REQUEST['createIdent'] == "" && $_REQUEST['newName'] != "")

View File

@ -9,7 +9,7 @@
} }
$HTML->setHTMLTitle("Benutzer"); $HTML->setHTMLTitle("Benutzer");
$HTML->importSeitenInhalt("../templates/users.html"); $HTML->importSeitenInhalt("users.html");
$HTML->ReplaceSeitenInhalt("%%link%%", ' '); $HTML->ReplaceSeitenInhalt("%%link%%", ' ');

View File

@ -1,7 +1,7 @@
<?php <?php
$HTML = new HTML(); $HTML = new HTML();
$HTML->setHTMLTitle("Login"); $HTML->setHTMLTitle("Login");
$HTML->importHTML("../templates/login.html"); $HTML->importHTML("login.html");
if(isset($_POST['login'])) if(isset($_POST['login']))
{ {

View File

@ -1,7 +1,7 @@
<?php <?php
$HTML->setHTMLTitle("Passwort ändern"); $HTML->setHTMLTitle("Passwort ändern");
$HTML->importSeitenInhalt("../templates/profile.html"); $HTML->importSeitenInhalt("profile.html");
if(isset($_REQUEST['oldPassword']) || @$_REQUEST['oldPassword'] != "") if(isset($_REQUEST['oldPassword']) || @$_REQUEST['oldPassword'] != "")
{ {
@ -56,7 +56,7 @@
} }
} }
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
$PartnerName = ""; $PartnerName = "";

View File

@ -3,7 +3,7 @@
$statement->execute(); $statement->execute();
$HTML->setHTMLTitle("Dein Profile"); $HTML->setHTMLTitle("Dein Profile");
$HTML->importSeitenInhalt("../templates/profile.html"); $HTML->importSeitenInhalt("profile.html");
//Prüfe ob IAR grade erstellt wird. //Prüfe ob IAR grade erstellt wird.
$IARRUNNING = FALSE; $IARRUNNING = FALSE;
@ -101,7 +101,7 @@
$statement->execute(['IMState' => 'false', 'PrincipalID' => $_SESSION['UUID']]); $statement->execute(['IMState' => 'false', 'PrincipalID' => $_SESSION['UUID']]);
} }
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
if(isset($_REQUEST['formInputFeldPartnerName']) && $_REQUEST['formInputFeldPartnerName'] != "") if(isset($_REQUEST['formInputFeldPartnerName']) && $_REQUEST['formInputFeldPartnerName'] != "")

View File

@ -1,6 +1,6 @@
<?php <?php
$HTML->setHTMLTitle("Deine Regionen"); $HTML->setHTMLTitle("Deine Regionen");
$HTML->importSeitenInhalt("../templates/deine-regionen.html"); $HTML->importSeitenInhalt("deine-regionen.html");
function cleanSize($bytes) function cleanSize($bytes)
{ {
@ -61,7 +61,7 @@
$statement = $RUNTIME['PDO']->prepare("SELECT uuid,regionName,owner_uuid,locX,locY FROM regions ".($showAll ? "ORDER BY owner_uuid ASC" : "WHERE owner_uuid = ? ORDER BY uuid ASC")); $statement = $RUNTIME['PDO']->prepare("SELECT uuid,regionName,owner_uuid,locX,locY FROM regions ".($showAll ? "ORDER BY owner_uuid ASC" : "WHERE owner_uuid = ? ORDER BY uuid ASC"));
$statement->execute(array($_SESSION['UUID'])); $statement->execute(array($_SESSION['UUID']));
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
while($row = $statement->fetch()) while($row = $statement->fetch())

View File

@ -4,7 +4,7 @@
global $RUNTIME; global $RUNTIME;
$HTML = new HTML(); $HTML = new HTML();
$HTML->setHTMLTitle("Registrieren"); $HTML->setHTMLTitle("Registrieren");
$HTML->importHTML("../templates/register.html"); $HTML->importHTML("register.html");
$HTML->ReplaceLayoutInhalt("%%MESSAGE%%", $message); $HTML->ReplaceLayoutInhalt("%%MESSAGE%%", $message);
$HTML->ReplaceLayoutInhalt("%%tosURL%%", $RUNTIME['TOOLS']['TOS'] ); $HTML->ReplaceLayoutInhalt("%%tosURL%%", $RUNTIME['TOOLS']['TOS'] );
@ -92,7 +92,7 @@
displayPage("Der gewählte Standardavatar existiert nicht."); displayPage("Der gewählte Standardavatar existiert nicht.");
} }
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
$avatarUUID = $opensim->gen_uuid(); $avatarUUID = $opensim->gen_uuid();

View File

@ -1,9 +1,9 @@
<?php <?php
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
$HTML->setHTMLTitle("Online Anzeige"); $HTML->setHTMLTitle("Online Anzeige");
$HTML->importSeitenInhalt("../templates/online-anzeige.html"); $HTML->importSeitenInhalt("online-anzeige.html");
$table = '<table class="table"><thead><tr><th scope="col">Benutzername</th><th scope="col">Region</th></thead><tbody>%%ENTRY%%</tbody></table>'; $table = '<table class="table"><thead><tr><th scope="col">Benutzername</th><th scope="col">Region</th></thead><tbody>%%ENTRY%%</tbody></table>';

View File

@ -12,11 +12,11 @@
die(); die();
} }
include '../app/OpenSim.php'; include 'app/OpenSim.php';
$opensim = new OpenSim(); $opensim = new OpenSim();
$HTML->setHTMLTitle("Benutzer"); $HTML->setHTMLTitle("Benutzer");
$HTML->importSeitenInhalt("../templates/users.html"); $HTML->importSeitenInhalt("users.html");
if(@$_REQUEST['action'] == 'genpw' && @$_REQUEST['userid'] != '') if(@$_REQUEST['action'] == 'genpw' && @$_REQUEST['userid'] != '')
{ {

View File

@ -2,10 +2,10 @@
$HTML = new HTML(); $HTML = new HTML();
if(@$_SESSION['LOGIN'] == 'true') if(@$_SESSION['LOGIN'] == 'true')
{ {
$HTML->importHTML("../templates/dashboard.html"); $HTML->importHTML("dashboard.html");
if(@$_SESSION['LEVEL'] > 100) if(@$_SESSION['LEVEL'] > 100)
$HTML->importHTML("../templates/dashboard-admin.html"); $HTML->importHTML("dashboard-admin.html");
$HTML->ReplaceLayoutInhalt("%%USERNAME%%", htmlspecialchars(@$_SESSION['DISPLAYNAME'])); $HTML->ReplaceLayoutInhalt("%%USERNAME%%", htmlspecialchars(@$_SESSION['DISPLAYNAME']));
} }