add iar save
parent
0429f2db6a
commit
e6a326b8fc
|
@ -82,19 +82,30 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="row" style="margin-top: 15px;">
|
<div class="row" style="margin-top: 15px;">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<hr>
|
<center><button type="submit" name="savePassword" class="btn btn-primary btn-lg">Speichern</button></center>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="row" style="margin-top: 15px;">
|
||||||
|
<div class="col">
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="lead"><b>IAR Sicherung</b></p>
|
||||||
|
<center>%%IARINFOMESSAGE%%</center>
|
||||||
|
Hier kannst du eine IAR deines Inventars erstellen.<br>
|
||||||
|
Dies wird einige Zeit dauern. Deswegen bekommst du einen Downloadlink per E-Mail zugeschickt, sobald die IAR fertig gestellt wurde. Stelle also sicher das du links eine gültige E-Mail Adresse eingetragen hast.
|
||||||
|
|
||||||
|
<form action="index.php?page=profile" method="post">
|
||||||
<div class="row" style="margin-top: 15px;">
|
<div class="row" style="margin-top: 15px;">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<button type="submit" name="savePassword" class="btn btn-primary btn-lg">Speichern</button>
|
<center><button type="submit" name="createIAR" class="btn btn-primary btn-lg" %%IARBUTTONSTATE%%>IAR erstellen</button></center>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,7 +1,42 @@
|
||||||
<?php
|
<?php
|
||||||
|
$statement = $RUNTIME['PDO']->prepare("CREATE TABLE IF NOT EXISTS `iarstates` (`userID` VARCHAR(36) NOT NULL COLLATE 'utf8_unicode_ci', `filesize` INT(11) NOT NULL, `iarfilename` VARCHAR(64) NOT NULL COLLATE 'utf8_unicode_ci', PRIMARY KEY (`userID`) USING BTREE) COLLATE='utf8_unicode_ci' ENGINE=InnoDB;");
|
||||||
|
$statement->execute();
|
||||||
|
|
||||||
$HTML->setHTMLTitle("Dein Profile");
|
$HTML->setHTMLTitle("Dein Profile");
|
||||||
$HTML->importSeitenInhalt("pages/HTML/profile.html");
|
$HTML->importSeitenInhalt("pages/HTML/profile.html");
|
||||||
|
|
||||||
|
//Prüfe ob IAR grade erstellt wird.
|
||||||
|
$IARRUNNING = FALSE;
|
||||||
|
|
||||||
|
$statementIARCheck = $RUNTIME['PDO']->prepare('SELECT * FROM iarstates WHERE userID =:userID');
|
||||||
|
$statementIARCheck->execute(['userID' => $_SESSION['UUID']]);
|
||||||
|
if($statementIARCheck->rowCount() != 0)
|
||||||
|
{
|
||||||
|
$HTML->ReplaceSeitenInhalt("%%IARINFOMESSAGE%%", '<div class="alert alert-danger" role="alert">Aktuell wird eine IAR erstellt.<br>Warte bitte bis du eine E-Mail bekommst.</div>');
|
||||||
|
$HTML->ReplaceSeitenInhalt("%%IARBUTTONSTATE%%", 'disabled');
|
||||||
|
$IARRUNNING = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($_REQUEST['createIAR']))
|
||||||
|
{
|
||||||
|
|
||||||
|
$iarname = md5(time().$_SESSION['UUID'] . rand()).".iar";
|
||||||
|
|
||||||
|
$APIURL = $RUNTIME['SIDOMAN']['URL']."api.php?CONTAINER=".$RUNTIME['SIDOMAN']['CONTAINER']."&KEY=".$RUNTIME['SIDOMAN']['PASSWORD']."&METODE=COMMAND&COMMAND=".urlencode("save iar ".$_SESSION['FIRSTNAME']." ".$_SESSION['LASTNAME']." /* PASSWORD /downloads/".$iarname);
|
||||||
|
$APIResult = file_get_contents($APIURL);
|
||||||
|
|
||||||
|
if(trim($APIResult) == "DONE")
|
||||||
|
{
|
||||||
|
$HTML->ReplaceSeitenInhalt("%%IARINFOMESSAGE%%", '<div class="alert alert-danger" role="alert">Deine IAR wird jetzt erstellt und der Download Link wird dir per E-Mail zugesendet. '.$APIResult.'</div>');
|
||||||
|
|
||||||
|
$statementIARSTART = $RUNTIME['PDO']->prepare('INSERT INTO iarstates (userID, filesize, iarfilename) VALUES (:userID, :filesize, :iarfilename)');
|
||||||
|
$statementIARSTART->execute(['userID' => $_SESSION['UUID'], 'filesize' => 0, 'iarfilename' => $iarname]);
|
||||||
|
}else{
|
||||||
|
$HTML->ReplaceSeitenInhalt("%%IARINFOMESSAGE%%", '<div class="alert alert-danger" role="alert">Es ist etwas schiefgelaufen, bitte warte etwas und versuche es erneut. '.$APIURL.'</div>');
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($_REQUEST['formInputFeldVorname']) || @$_REQUEST['formInputFeldVorname'] != "")
|
if(isset($_REQUEST['formInputFeldVorname']) || @$_REQUEST['formInputFeldVorname'] != "")
|
||||||
{
|
{
|
||||||
$NewFirstName = trim($_REQUEST['formInputFeldVorname']);
|
$NewFirstName = trim($_REQUEST['formInputFeldVorname']);
|
||||||
|
@ -97,7 +132,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$statementLocalUsers = $RUNTIME['PDO']->prepare("SELECT * FROM UserAccounts ORDER BY PrincipalID ASC");
|
$statementLocalUsers = $RUNTIME['PDO']->prepare("SELECT * FROM UserAccounts ORDER BY PrincipalID ASC");
|
||||||
$statementLocalUsers->execute();
|
$statementLocalUsers->execute();
|
||||||
|
|
||||||
|
@ -130,7 +164,8 @@
|
||||||
$HTML->ReplaceSeitenInhalt("%%email%%", $RUNTIME['OPENSIM']->getUserMail($_SESSION['UUID']));
|
$HTML->ReplaceSeitenInhalt("%%email%%", $RUNTIME['OPENSIM']->getUserMail($_SESSION['UUID']));
|
||||||
$HTML->ReplaceSeitenInhalt("%%listAllResidentsAsJSArray%%", "");
|
$HTML->ReplaceSeitenInhalt("%%listAllResidentsAsJSArray%%", "");
|
||||||
$HTML->ReplaceSeitenInhalt("%%INFOMESSAGE%%", ' ');
|
$HTML->ReplaceSeitenInhalt("%%INFOMESSAGE%%", ' ');
|
||||||
$HTML->ReplaceSeitenInhalt("%%INFOMESSAGE%%", ' ');
|
$HTML->ReplaceSeitenInhalt("%%IARINFOMESSAGE%%", ' ');
|
||||||
|
$HTML->ReplaceSeitenInhalt("%%IARBUTTONSTATE%%", '');
|
||||||
|
|
||||||
$HTML->build();
|
$HTML->build();
|
||||||
echo $HTML->ausgabe();
|
echo $HTML->ausgabe();
|
||||||
|
|
|
@ -53,6 +53,12 @@
|
||||||
<span>Profil</span></a>
|
<span>Profil</span></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="index.php?page=inventar">
|
||||||
|
<i class="fas fa-archive"></i>
|
||||||
|
<span>Inventar</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="index.php?page=identities">
|
<a class="nav-link" href="index.php?page=identities">
|
||||||
<i class="fas fa-fingerprint"></i>
|
<i class="fas fa-fingerprint"></i>
|
||||||
|
|
|
@ -53,6 +53,12 @@
|
||||||
<span>Profil</span></a>
|
<span>Profil</span></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="index.php?page=inventar">
|
||||||
|
<i class="fas fa-archive"></i>
|
||||||
|
<span>Inventar</span></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="index.php?page=identities">
|
<a class="nav-link" href="index.php?page=identities">
|
||||||
<i class="fas fa-fingerprint"></i>
|
<i class="fas fa-fingerprint"></i>
|
||||||
|
|
Loading…
Reference in New Issue