1
0
Fork 0

fix pw page

master
Christopher 2020-08-04 12:08:41 +02:00
parent 0e0ec17630
commit 79f020b9c2
9 changed files with 42 additions and 85 deletions

View File

@ -1,23 +0,0 @@
<div style="width: 400px; margin: auto; left: 50%;">
Hier kannst du einen Invite Link erstellen.<br>
Jeder der solch einen Link bekommt, kann sich im Grid Regestrieren.
Der Link ist einzigartig und funktioniert nur einmalig.<br>
Nach dem aufrufen des Links muss ein Name, Passwort und Standart Avatar ausgewählt werden.
</div>
<div style="width: 400px; margin: auto; left: 50%;">
<form action="index.php?page=invite" method="post">
<div class="row" style="margin-top: 15px;">
<div class="col">
<label for="linkOutput">InviteLink:</label>
<input type="text" class="form-control" id="linkOutput" name="formLink" value="%%link%%">
</div>
</div>
<div class="row" style="margin-top: 15px;">
<div class="col">
<button type="submit" name="generateLink" class="btn btn-primary btn-lg">Link Generieren</button>
</div>
</div>
</form>
</div>

View File

@ -1,43 +0,0 @@
<center>%%INFOMESSAGE%%</center>
<div style="width: 400px; margin: auto; left: 50%;">
<form action="index.php?page=password" method="post">
<div class="row" style="margin-top: 15px;">
<div class="col">
<label for="oldPassword">Altes Passwort</label>
<input type="text" class="form-control" id="oldPassword" name="oldPassword"">
</div>
</div>
<div class="row" style="margin-top: 15px;">
<div class="col">
<label for="newPassword">Neues Passwort</label>
<input type="text" class="form-control" id="PasswordNew" name="newPassword"">
</div>
</div>
<div class="row" style="margin-top: 15px;">
<div class="col">
<label for="newPasswordRepeate">Neues Passwort wiederholen</label>
<input type="text" class="form-control" id="PasswordNewRepeate" name="newPasswordRepeate"">
</div>
</div>
<div class="row" style="margin-top: 15px;">
<div class="col">
<hr>
</div>
</div>
<div class="row" style="margin-top: 15px;">
<div class="col">
<button type="submit" name="savePassword" class="btn btn-primary btn-lg">Speichern</button>
</div>
</div>
</form>
</div>

View File

@ -12,7 +12,7 @@
</div> </div>
<div style="width: 400px; margin: auto; left: 50%;"> <div style="width: 400px; margin: auto; left: 50%;">
<form action="index.php?page=invite" method="post"> <form action="index.php?page=users" method="post">
<div class="row" style="margin-top: 15px;"> <div class="row" style="margin-top: 15px;">
<div class="col"> <div class="col">
<label for="linkOutput">InviteLink:</label> <label for="linkOutput">InviteLink:</label>

View File

@ -1,21 +1,17 @@
<?php <?php
$HTML->setHTMLTitle("Invite erstellen"); if(@$_SESSION['LEVEL'] < 100)
$HTML->importSeitenInhalt("pages/HTML/invite.html");
$statement = $RUNTIME['PDO']->prepare("CREATE TABLE IF NOT EXISTS `InviteCodes` (`InviteCode` VARCHAR(64) NOT NULL, PRIMARY KEY (`InviteCode`))");
$statement->execute();
if(isset($_REQUEST['generateLink']) || @$_REQUEST['generateLink'] != "")
{ {
$inviteID = md5(time().$_SESSION['UUID'].rand(11111, 9999999)); $HTML->setHTMLTitle("Kein Zugriff");
$link = "https://".$_SERVER['SERVER_NAME']."/index.php?page=register&code=".$inviteID; $HTML->SetSeitenInhalt("Dazu hast du keine Rechte!");
$HTML->build();
$statement = $RUNTIME['PDO']->prepare('INSERT INTO `InviteCodes` (`InviteCode`) VALUES (:InviteCode)'); echo $HTML->ausgabe();
$statement->execute(['InviteCode' => $inviteID]); die();
$HTML->ReplaceSeitenInhalt("%%link%%", $link);
} }
$HTML->setHTMLTitle("Benutzer");
$HTML->importSeitenInhalt("pages/HTML/users.html");
$HTML->ReplaceSeitenInhalt("%%link%%", ' '); $HTML->ReplaceSeitenInhalt("%%link%%", ' ');
$HTML->build(); $HTML->build();

View File

@ -52,6 +52,18 @@
} }
} }
$PartnerName = "";
$PartnerUUID = $RUNTIME['OPENSIM']->getPartner($_SESSION['UUID']);
if($PartnerUUID != null)$PartnerName = $RUNTIME['OPENSIM']->getUserName($PartnerUUID);
$HTML->ReplaceSeitenInhalt("%%offlineIMSTATE%%", ' ');
$HTML->ReplaceSeitenInhalt("%%firstname%%", $_SESSION['FIRSTNAME']);
$HTML->ReplaceSeitenInhalt("%%lastname%%", $_SESSION['LASTNAME']);
$HTML->ReplaceSeitenInhalt("%%partner%%", $PartnerName);
$HTML->ReplaceSeitenInhalt("%%email%%", $RUNTIME['OPENSIM']->getUserMail($_SESSION['UUID']));
$HTML->ReplaceSeitenInhalt("%%listAllResidentsAsJSArray%%", "");
$HTML->ReplaceSeitenInhalt("%%INFOMESSAGE%%", ' ');
$HTML->ReplaceSeitenInhalt("%%INFOMESSAGE%%", ' ');
$HTML->ReplaceSeitenInhalt("%%INFOMESSAGE%%", ' '); $HTML->ReplaceSeitenInhalt("%%INFOMESSAGE%%", ' ');
$HTML->build(); $HTML->build();

View File

@ -128,7 +128,7 @@
$HTML->ReplaceSeitenInhalt("%%lastname%%", $_SESSION['LASTNAME']); $HTML->ReplaceSeitenInhalt("%%lastname%%", $_SESSION['LASTNAME']);
$HTML->ReplaceSeitenInhalt("%%partner%%", $PartnerName); $HTML->ReplaceSeitenInhalt("%%partner%%", $PartnerName);
$HTML->ReplaceSeitenInhalt("%%email%%", $RUNTIME['OPENSIM']->getUserMail($_SESSION['UUID'])); $HTML->ReplaceSeitenInhalt("%%email%%", $RUNTIME['OPENSIM']->getUserMail($_SESSION['UUID']));
$HTML->ReplaceSeitenInhalt("%%listAllResidentsAsJSArray%%", $allUsers); $HTML->ReplaceSeitenInhalt("%%listAllResidentsAsJSArray%%", "");
$HTML->ReplaceSeitenInhalt("%%INFOMESSAGE%%", ' '); $HTML->ReplaceSeitenInhalt("%%INFOMESSAGE%%", ' ');
$HTML->ReplaceSeitenInhalt("%%INFOMESSAGE%%", ' '); $HTML->ReplaceSeitenInhalt("%%INFOMESSAGE%%", ' ');

View File

@ -11,6 +11,20 @@
$HTML->setHTMLTitle("Benutzer"); $HTML->setHTMLTitle("Benutzer");
$HTML->importSeitenInhalt("pages/HTML/users.html"); $HTML->importSeitenInhalt("pages/HTML/users.html");
$statement = $RUNTIME['PDO']->prepare("CREATE TABLE IF NOT EXISTS `InviteCodes` (`InviteCode` VARCHAR(64) NOT NULL, PRIMARY KEY (`InviteCode`))");
$statement->execute();
if(isset($_REQUEST['generateLink']) || @$_REQUEST['generateLink'] != "")
{
$inviteID = md5(time().$_SESSION['UUID'].rand(11111, 9999999));
$link = "https://".$_SERVER['SERVER_NAME']."/index.php?page=register&code=".$inviteID;
$statement = $RUNTIME['PDO']->prepare('INSERT INTO `InviteCodes` (`InviteCode`) VALUES (:InviteCode)');
$statement->execute(['InviteCode' => $inviteID]);
$HTML->ReplaceSeitenInhalt("%%link%%", $link);
}
$table = '<table class="table"><thead><tr><th scope="col">Vorname</th><th scope="col">Nachname</th><th scope="col">Status</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>'; $table = '<table class="table"><thead><tr><th scope="col">Vorname</th><th scope="col">Nachname</th><th scope="col">Status</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>';
$statement = $RUNTIME['PDO']->prepare("SELECT * FROM UserAccounts ORDER BY Created ASC"); $statement = $RUNTIME['PDO']->prepare("SELECT * FROM UserAccounts ORDER BY Created ASC");
@ -24,6 +38,7 @@
$table = str_replace("%%ENTRY%%", "", $table); $table = str_replace("%%ENTRY%%", "", $table);
$HTML->ReplaceSeitenInhalt("%%REGION-LIST%%", $table); $HTML->ReplaceSeitenInhalt("%%REGION-LIST%%", $table);
$HTML->ReplaceSeitenInhalt("%%link%%", ' ');
$HTML->build(); $HTML->build();
echo $HTML->ausgabe(); echo $HTML->ausgabe();

View File

@ -40,7 +40,7 @@
<div id="wrapper"> <div id="wrapper">
<ul class="sidebar navbar-nav"> <ul class="sidebar navbar-nav">
<li class="nav-item active"> <li class="nav-item">
<a class="nav-link" href="index.php"> <a class="nav-link" href="index.php">
<i class="fas fa-fw fa-tachometer-alt"></i> <i class="fas fa-fw fa-tachometer-alt"></i>
<span>Übrsicht</span> <span>Übrsicht</span>
@ -76,7 +76,7 @@
Administration Administration
</div> </div>
<li class="nav-item active"> <li class="nav-item">
<a class="nav-link" href="index.php?page=loginPage"> <a class="nav-link" href="index.php?page=loginPage">
<i class="fas fa-fw fa-key"></i> <i class="fas fa-fw fa-key"></i>
<span>Anmeldung</span> <span>Anmeldung</span>

View File

@ -40,7 +40,7 @@
<div id="wrapper"> <div id="wrapper">
<ul class="sidebar navbar-nav"> <ul class="sidebar navbar-nav">
<li class="nav-item active"> <li class="nav-item">
<a class="nav-link" href="index.php"> <a class="nav-link" href="index.php">
<i class="fas fa-fw fa-tachometer-alt"></i> <i class="fas fa-fw fa-tachometer-alt"></i>
<span>Dashboard</span> <span>Dashboard</span>