self opening modals, loginredirects keep fragment data

This commit is contained in:
marko
2022-06-12 19:54:29 +02:00
parent 56fe127c81
commit 8329a6b2df
8 changed files with 72 additions and 57 deletions

View File

@@ -1,7 +1,8 @@
<?php
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
set_include_path(get_include_path() . PATH_SEPARATOR . "./lib/");
require_once("lib/participoLib/participo.php");
require_once("participoLib/participo.php");
require_once("config/participo.php");
require_once("./local/dbConf.php");
@@ -28,10 +29,10 @@ else{
$message = ['error' => "Es wurden nicht alle Felder ausgefüllt."];
} else {
if( participo::checkCredentials( $_POST['f']['username'], $_POST['f']['password']) ){
$returnToUrl = $_POST['returnToUrl'] ?? ".";
$returnToUrl = ($_POST['returnToUrl'] ?? ".").($_POST['fragment'] ?? "");
participo::addMessage('success', "<div><a href=\"".$returnToUrl."\">weiter zum Inhalt</a>.</div>");
participo::addMessage('notice', "OnlineApps - cwsvJudo");
header("Location: " . $returnToUrl );
header("Location: " . $returnToUrl, TRUE, 301 );
}
}
}
@@ -66,6 +67,14 @@ else{
</div>
<?php if( isset( $_GET['returnToUrl']) ) echo("<input type=\"hidden\" name=\"returnToUrl\" value=\"".htmlspecialchars( $_GET['returnToUrl'])."\" />"); ?>
<?php if( isset($_POST['returnToUrl']) ) echo("<input type=\"hidden\" name=\"returnToUrl\" value=\"".htmlspecialchars($_POST['returnToUrl'])."\" />"); ?>
<input id="fragment" type="hidden" name="fragment" />
<!-- add the fragment to the post data-->
<script>
if(window.location.hash){
document.getElementById("fragment").value=window.location.hash;
}
</script>
</fieldset>
<fieldset>
<div>