diff --git a/homepage/participo/attendance.php b/homepage/participo/attendance.php
index fa7f477..55e7edb 100644
--- a/homepage/participo/attendance.php
+++ b/homepage/participo/attendance.php
@@ -15,15 +15,15 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
require_once($config['basePath']."/config/cwsvJudo.config.php");
require_once($config['basePath']."/config/phpcount.config.php");
- $dbConnection = getPdoDbConnection(
+ dbConnector::connect(
$cwsvJudoConfig["db"]["host"],
$cwsvJudoConfig["db"]["name"],
$cwsvJudoConfig["db"]["user"],
$cwsvJudoConfig["db"]["password"]
);
- $userData = getUserData($dbConnection, $_SESSION['user']['userId']);
- $usersKids = getUsersKids($dbConnection, $_SESSION['user']['userId']);
+ $userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
+ $usersKids = getUsersKids(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
abstract class AttendanceType {
const __default = null;
@@ -273,13 +273,13 @@ foreach($usersKids as $k){
if($_SESSION['login']){
?>
- UserAttribute::InTraining]));?>
+ UserAttribute::InTraining]));?>
Eigene Anwesenheiten".
- Attendance::userAttendanceHtmlTable($dbConnection, $userData['id'])
+ Attendance::userAttendanceHtmlTable(dbConnector::getDbConnection(), $userData['id'])
); require_once("./lib/participoLib/participo.php");
}
@@ -290,7 +290,7 @@ if($_SESSION['login']){
if($userData['id']==$k['kidId']) continue;
echo(
"".$k['vorname']." ".$k['name']." ".
- Attendance::userAttendanceHtmlTable($dbConnection, $k['kidId'])
+ Attendance::userAttendanceHtmlTable(dbConnector::getDbConnection(), $k['kidId'])
);
}
}
diff --git a/homepage/participo/auth.php b/homepage/participo/auth.php
index c25f3a6..4cdd5bf 100644
--- a/homepage/participo/auth.php
+++ b/homepage/participo/auth.php
@@ -1,9 +1,9 @@
"Event Planer",
+ 'description' => "Planung von (Nicht-)Teilnahmen an Wettkämpfen und anderen Veranstaltungen"
+ );
+?>
\ No newline at end of file
diff --git a/homepage/participo/events.php b/homepage/participo/events.php
new file mode 100644
index 0000000..39fcf27
--- /dev/null
+++ b/homepage/participo/events.php
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Übersicht anstehender Events
+
+
+
+ Detailansicht kommender Wettkämpfe
+ asHtmlCard());?>
+
+
+
+
diff --git a/homepage/participo/index.php b/homepage/participo/index.php
index f45462f..27490eb 100644
--- a/homepage/participo/index.php
+++ b/homepage/participo/index.php
@@ -1,110 +1,30 @@
= CURDATE() ".
- "ORDER BY wkParticipo_Events.date;";
- $ret = dbQuery($dbConn, $query);
- // $results = $anMysqlConn->query($query);
-
- // // Bei einem Fehler bei der Abfrage soll NULL zurückgeliefert werden
- // if( !$results ){
- // echo("No Results: ".$anMysqlConn->error);
- // return NULL;
- // }
- // // Bei einem leeren Ergebnis (NULL oder leeres Array) soll ein leeres Array zurückgeliefert werden
- // if( empty($results) ) return array();
-
- // while( $result = $results->fetch_assoc() ){
- // array_walk(
- // $result,
- // function (&$value, $key, $someOptions) {
- // $value = iconv($someOptions['dbCharset'], $someOptions['outCharset'], $value);
- // },
- // $someOptions
- // );
- // array_push( $ret, $result);
- // }
- return $ret;
-}
+ $userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
+ eventPlaner::setDbConnection( dbConnector::getDbConnection() );
-// array(12) {
-// ["id"]=> string(3) "139"
-// ["date"]=> string(10) "2021-12-29"
-// ["wkId"]=> string(0) ""
-// ["meldefrist"]=> string(10) "2021-12-28"
-// ["bemerkungen"]=> string(374) "{ "Datum": "2021-12-29", "Veranstaltung": "Jahresabschlusstraining", "Altersklassen": "alle", "bemerkungen": "
-
-// Zum Abschluss des Jahres noch einmal eine kleine Einheit hauptsächlich zum Spielen
-// Zeit: 16:00--19:00 Uhr
-
-// ", "Ort": "unser Dojo, Str. Usti nad Labem 42, 09120 Chemnitz", "Routenplaner": "https://osm.org/go/0MIYhLf3Q-" }"
-// ["kvOptions"]=> string(0) ""
-// ["Datum"]=> string(0) ""
-// ["Veranstaltung"]=> string(0) ""
-// ["Altersklassen"]=> string(0) ""
-// ["Ort"]=> string(0) ""
-// ["Ausschreibung"]=> string(0) ""
-// ["Routenplaner"]=> string(0) ""
-// }
-function getHtmlEventTable($eventList){
- $ret = "";
- foreach($eventList as $event){
- $e = json_decode($event['bemerkungen'], true);
- $e = (($e==null)?$event:$e);
- $e['id']=$event['id'];
- $ret .= "".$e['Datum']." ".$e['Veranstaltung']." ";
- }
- $ret .= "
";
- return $ret;
-}
?>
@@ -160,9 +80,9 @@ function getHtmlEventTable($eventList){
Einstellensettings
-
+
- adminStuff
+ adminStuff
@@ -189,7 +109,7 @@ echo(
AppCard::fromArray([
'link' => "/pages/desktop/wkParticipo",
'title' => "Event-Planer",
- 'description'=> "Organisieren der Teilnahmen (und nicht-Teilnahmen) an Wettkämpfen, Sondertrainingseinheiten, Feiern etc.
".getHtmlEventTable(getCommingWkEvents($dbConnection))."",
+ 'description'=> "Organisieren der Teilnahmen (und nicht-Teilnahmen) an Wettkämpfen, Sondertrainingseinheiten, Feiern etc.
".eventPlaner::getHtmlEventTable(eventPlaner::getCommingWkEvents())."",
'imgUrl' => "/ressourcen/graphiken/icons/terminKalender.svg",
'actions' => [
AppCardAction::fromArray(['caption'=>"Planer", 'link'=>"/pages/desktop/wkParticipo"]),
@@ -272,7 +192,7 @@ echo(
AdminStuff".
"
".
diff --git a/homepage/participo/infoZettel.php b/homepage/participo/infoZettel.php
index 538f7f5..b4e9bae 100644
--- a/homepage/participo/infoZettel.php
+++ b/homepage/participo/infoZettel.php
@@ -1,5 +1,8 @@
-
diff --git a/homepage/participo/lib/api.php b/homepage/participo/lib/api.php
index b455d83..b39ccb0 100644
--- a/homepage/participo/lib/api.php
+++ b/homepage/participo/lib/api.php
@@ -123,7 +123,7 @@ function updateUserPassword($db, $userId, $password){
':val' => array('value'=>$password, 'data_type'=>PDO::PARAM_STR),
':id' => array('value'=>$userId, 'data_type'=>PDO::PARAM_INT)
);
- dbQuery($db, $query, $params);
+ dbConnector::query($query, $params);
return;
}
diff --git a/homepage/participo/lib/db.php b/homepage/participo/lib/db.php
index d76a942..ae428cb 100644
--- a/homepage/participo/lib/db.php
+++ b/homepage/participo/lib/db.php
@@ -1,19 +1,4 @@
getMessage() );
- }
-return $dbConnection;
-}
-
function createDb($dbConnection){
<<
NULL, 'success' => NULL, 'notice' => NULL];
+
+ /**
+ * Returns the current login status
+ *
+ * The login status is stored in the session cookie. If it is not even set it means the login is invalid.
+ *
+ * @return The login status or false if none is set so far
+ */
+ static public function isLoginValid(){
+ return ($_SESSION['login'] ?? false);
+ }
+
+ /**
+ * A little Box with the login status as html entity
+ *
+ * @return string htmlEntity showing the login status
+ */
+ static public function htmlLoginStatus(){
+ return
+ "".
+ "Datum: ".date("Y-m-d")."
".
+ "Angemeldet als
".htmlspecialchars($_SESSION['user']['username'])." .
".
+ "
Sitzung beenden ".
+ "
";
+ }
+
+ /**
+ * Checks, if there already is a valid login, if not redirect to the login form
+ *
+ * @retval void
+ */
+ static public function authentificate(){
+ session_start();
+ if ( !self::isLoginValid() ) {
+ header("Location: login?returnToUrl=".urlencode($_SERVER['REQUEST_URI'].($_POST['fragment'] ?? "")), TRUE, 301);
+ exit(); // should'nt matter
+ }
+ }
+
+ static public function getMessages(){return self::$message;}
+ static public function addMessage($type, $message){self::$message[$type] = (self::$message[$type] ?? "").$message;}
+
+ /**
+ * check password for user
+ *
+ * @param string $loginName user who wants to get in
+ * @param string $password passwor for the user
+ *
+ * @retval true $password belongs to $loginName
+ * @retval false otherwise
+ */
+ static public function checkCredentials($loginName, $password){
+ sleep(1); // just to discurrage brute force attacks
+ // Check for dbConnection
+ if(!dbConnector::getDbConnection()){
+ self::addMessage('error', "No DbConnection available
");
+ return false;
+ }
+
+ // query all users with the entered name
+ $user = dbConnector::query(
+ "SELECT `id`, `loginName`, `pwHash`, `config` FROM `wkParticipo_Users` WHERE `loginName` = :loginName",
+ ['loginName' => ['value'=>$loginName, 'data_type'=>PDO::PARAM_STR]]
+ );
+
+ // If there is no such user OR the password isn't valid the login fails
+ if( empty($user || !password_verify( $password, $user['pwHash']) )){
+ sleep(5); // discourage brute force attacks
+ self::addMessage('error', "Falsches Passwort oder LoginName
");
+ return false;
+ }
+
+ session_start();
+ // case valid login: Set the session data
+ $_SESSION = array(
+ 'login' => true,
+ 'user' => array(
+ 'username' => $row['loginName'],
+ 'userId' => $row['id'],
+ 'userConfig' => json_decode($row['config'], true)
+ )
+ );
+
+ // Logging Logins
+ logLoginsToJsonFile($_SESSION['user']['username']);
+
+ self::addMessage('success', "Anmeldung erfolgreich
");
+ return true;
+ }
}
-
-
/**
* Action element of an MaterializeCss (App-)card
*/
@@ -213,44 +300,6 @@ function loadMarkdownFile($fileName){
);
}
-
-function checkCredentials($username, $password, $db_server, $db_user, $db_password, $db_name){
- sleep(1);
- $mysqli = @new mysqli($db_server, $db_user, $db_password, $db_name);
- if ($mysqli->connect_error) {
- $message['error'] = 'Datenbankverbindung fehlgeschlagen: ' . $mysqli->connect_error;
- } else {
- $query = sprintf(
- "SELECT id, loginName, pwHash, config FROM wkParticipo_Users WHERE loginName = '%s'",
- $mysqli->real_escape_string($_POST['f']['username'])
- );
- $result = $mysqli->query($query);
- if ($row = $result->fetch_array(MYSQLI_ASSOC)) {
- if( password_verify( $_POST['f']['password'], $row['pwHash']) ){
- session_start();
- $_SESSION = array(
- 'login' => true,
- 'user' => array(
- 'username' => $row['loginName'],
- 'userId' => $row['id'],
- 'userConfig' => json_decode($row['config'], true)
- ),
- );
- $message['success'] = 'Anmeldung erfolgreich, weiter zum Inhalt .';
-
- // Logging Logins
- logLoginsToJsonFile($_SESSION['user']['username']);
-
- header('Location: http://' . $_SERVER['HTTP_HOST'] . '/participo?user=' . $_POST['f']['username']);
- } else {
- sleep(5);
- $message['error'] = 'Das Kennwort ist nicht korrekt.';
- }
- }
- }
-return $message;
-}
-
/**
* Log the Login of an user into a logFile
*
@@ -273,4 +322,111 @@ function logLoginsToJsonFile($userName, $fileName="lastLogins.json"){
}
}
+
+class dbConnector{
+ static private $db = null;
+
+ // connect to the database
+ public static function connect($hostname, $dbName, $user, $password){
+ return self::setDbConnection( self::connectToPdo($hostname, $dbName, $user, $password) );
+ }
+
+ public static function getDbConnection(){return self::$db;}
+
+ /// perform a pdo-query
+ ///
+ /// @param $aQueryString
+ /// @param $aBindArray e.g. array(
+ /// ':userId' => array('value'=>$anUserId, 'data_type'=>PDO::PARAM_INT),
+ /// ':attributeId'=> array('value'=>$anAttributeId, 'data_type'=>PDO::PARAM_INT) )
+ /// @param $someOption
+ function query($aQueryString, $aBindArray = array(), $someOptions = array()){
+ // Standardbelegungen
+ if( empty($someOptions['dbCharset' ]) ) $someOptions['dbCharset' ] = "ISO-8859-1";
+ if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8";
+ if( empty($someOptions['dontFetch' ]) ) $someOptions['dontFetch' ] = false;
+
+ /// @toDo: Bisher wird nur die Rückgabe konvertiert. Eigentlich muss
+ /// doch auch die Eingabe konvertiert werden. Aber das jetzt
+ /// umzustellen wird schwer! Die User im Wettkampfplaner sind ja z.B.
+ /// als UTF8 in latin1(?) gespeichert.
+ /// @toDo: Die Standardwerte sollten vielleicht aus einer config
+ /// kommen, nicht hardcoded
+ try{
+ $pdoStatement = self::$db->prepare( $aQueryString );
+ foreach( $aBindArray as $bindName => $bind ){
+ if( $bind['data_type'] == PDO::PARAM_STR)
+ $bind['value'] = iconv(
+ $someOptions['outCharset'],
+ $someOptions['dbCharset'],
+ $bind['value']
+ );
+ $pdoStatement->bindValue(
+ $bindName,
+ $bind['value'],
+ (isset($bind['data_type'])?$bind['data_type']:PDO::PARAM_STR)
+ );
+ }
+ $pdoResult = $pdoStatement->execute();
+ if(!$pdoResult){
+ echo("Error during dbQuery!\n");
+ echo("DB-Error:\n"); var_dump(self::$db->errorInfo());
+ }
+ if($someOptions['dontFetch']){
+ $ret = NULL;
+ }
+ else{
+ $ret = $pdoStatement->fetchAll(PDO::FETCH_ASSOC);
+ }
+ }
+ catch(PDOException $db_error){
+ print "Error!: " . $db_error->getMessage() . " ";
+ return null;
+ }
+
+ // Zeichensatzkonvertierung
+ if( is_array($ret) ){
+ foreach($ret as &$entry){
+ array_walk(
+ $entry,
+ function (&$value, $key, $someOptions) {
+ $value = iconv($someOptions['dbCharset'], $someOptions['outCharset'], $value);
+ },
+ $someOptions
+ );
+ }
+ }
+ return $ret;
+ }
+
+ // get a Connection to the database
+ static private function connectToPdo($hostname, $dbName, $user, $password){
+ $dbConnection=null;
+ try{
+ $dbConnection = new PDO(
+ 'mysql:host='.$hostname.';dbname='.$dbName,
+ $user,
+ $password
+ );
+ }
+ catch(PDOException $dbError){
+ echo( "Error whilst getting a dbConnection!: " . $dbError->getMessage() );
+ }
+ return $dbConnection;
+ }
+
+ // set the dbConnection (just setting, no establishing)
+ private static function setDbConnection($dbConnection){
+ $success = false;
+ if($dbConnection instanceof PDO){
+ self::$db = $dbConnection;
+ $success = true;
+ }
+ else{
+ self::$db = null;
+ }
+ }
+
+
+}
?>
\ No newline at end of file
diff --git a/homepage/participo/lib/participoLib/planer.php b/homepage/participo/lib/participoLib/planer.php
new file mode 100644
index 0000000..a22f79a
--- /dev/null
+++ b/homepage/participo/lib/participoLib/planer.php
@@ -0,0 +1,186 @@
+id = (int) $id;
+ $this->date = DateTime::createFromFormat("Y-m-d", $date);
+ $this->name = $name;
+ $this->ageclasses = $ageclasses;
+ $this->place = $place;
+ $this->announcementUrl = $announcementUrl;
+ $this->routeUrl = $routeUrl;
+ $this->galleryUrl = $galleryUrl;
+ $this->promoImgUrl = $promoImgUrl;
+ }
+
+ public function getName(){
+ return $this->name;
+ }
+ public function getAgeClasses(){
+ return $this->ageclasses ? $this->ageclasses : "-";
+ }
+ public function getId(){
+ return $this->id;
+ }
+
+ static public function fromArray($member){
+ return new shiai(
+ $member['lfdeNr'] ?? null,
+ $member['Datum'] ?? null,
+ $member['Veranstaltung'] ?? "",
+ $member['Altersklassen'] ?? null,
+ $member['Ort'] ?? "",
+ $member['Ausschreibung'] ?? null,
+ $member['Routenplaner'] ?? null,
+ $member['galleryLink'] ?? null,
+ $member['promoPic'] ?? null
+ );
+ }
+} // end class shiai
+
+class event{
+ private $id = null; //< unique id of the event in the db
+ private $date = null; //< date for the event (@todo ranges?)
+ private $shiaiId = null; //< unique id of the shiai in the db (if appropriate)
+ private $deadline = null; //< until when one can register for the event
+ private $remarks = null; //< remarks to the event (special rules) or a json object for missing data (e.g. non-shiai events)
+
+ private $shiai = null;
+
+ function __construct($id, $date, $shiaiId, $deadline, $remarks, $shiai){
+ //! @todo InputValidation
+ $this->id = (int) $id;
+ $this->date = DateTime::createFromFormat("Y-m-d", $date);
+ $this->shiaiId = (($shiaiId!=null)?((int)$shiaiId):(null));
+ $this->deadline = DateTime::createFromFormat("Y-m-d", $deadline);
+ $this->remarks = $remarks;
+
+ $this->shiai = $shiai;
+ }
+
+ function asHtmlCard(){
+ return
+ "".
+ "
".
+ "
".$this->shiai->getName()." ".
+ "
".
+ "Datum ".
+ "".$this->date->format("Y-m-d")." ".
+ "Meldefrist ".
+ "".$this->deadline->format("Y-m-d")." ".
+ "Altersklassen ".
+ "".$this->shiai->getAgeClasses()." ".
+ " ".
+ "
";
+ }
+ public function htmlTableRow(){
+ return
+ "".
+ "Datum ".$this->date->format("Y-m-d")." ".
+ "id."\" >".$this->shiai->getName()." ".
+ "id."\">add ".
+ " ";
+ }
+ public function htmlModal(){
+ return
+ "id."\" class=\"modal\">".
+ "
".
+ "
".$this->shiai->getName()." ".
+ "
A bunch of text
".
+ "
". // end modal-content
+ "".
+ "
";
+ }
+
+ static public function fromArray($member){
+ $shiai = json_decode($member['bemerkungen'], true);
+
+ return new event(
+ $member['id'] ?? null,
+ $member['date'] ?? null,
+ $member['wkId'] ?? null,
+ $member['meldefrist'] ?? null,
+ $member['bemerkungen'] ?? null,
+ shiai::fromArray( ($shiai != null) ? $shiai : $member )
+ );
+ }
+} // end class event
+
+class eventPlaner{
+ static private $db = null;
+ // set the dbConnection (just setting, no establishing)
+ public static function setDbConnection($dbConnection){
+ if($dbConnection instanceof PDO)
+ self::$db = $dbConnection;
+ else
+ self::$db = null;
+ return;
+ }
+
+ static public function getCommingWkEvents($someOptions=array() ){
+ // wir befinden uns in der Übergangsphase:
+ // - als Standard wird das derzeitige Verhalten definiert (ISO-8859-1
+ // und die Konvertierung erfolgt ausserhalb)
+ // - wenn einmal alle mbConvertEncoding weg sind, kann der Standard auf
+ // das gewünschte Verhalten umgestellt werden
+ $dbCharset = $someOptions['dbCharset'] ?? "ISO-8859-1";
+ // dbCharset = $someOptions['outCharset'] ?? "UTF-8";// das spätere, gewünschte Verhalten
+ $outCharset = $someOptions['outCharset'] ?? "ISO-8859-1";
+
+ $query =
+ "SELECT ".
+ "wkParticipo_Events.id, ".
+ "wkParticipo_Events.date, ".
+ "wkParticipo_Events.wkId, ".
+ "wkParticipo_Events.meldefrist, ".
+ "wkParticipo_Events.bemerkungen, ".
+ "wkParticipo_Events.kvOptions, ".
+ "wettkampfkalender.Datum, ".
+ "wettkampfkalender.Veranstaltung, ".
+ "wettkampfkalender.Altersklassen, ".
+ "wettkampfkalender.Ort, ".
+ "wettkampfkalender.Ausschreibung, ".
+ "wettkampfkalender.Routenplaner ".
+ "FROM wkParticipo_Events ".
+ "LEFT JOIN wettkampfkalender ".
+ "ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
+ "WHERE wkParticipo_Events.date >= CURDATE() ".
+ "ORDER BY wkParticipo_Events.date;";
+ $ret = dbQuery(self::$db, $query);
+ $events = array();
+ foreach($ret as $event){
+ array_push( $events, event::fromArray( $event ) );
+ }
+ return $events;
+ }
+
+ static public function getHtmlEventTable($eventList){
+ $ret = "";
+ $ret .= "";
+ foreach($eventList as $event){
+ $ret .= $event->htmlTableRow();
+ }
+ $ret .= "
";
+ foreach($eventList as $event){
+ $ret .= $event->htmlModal();
+ }
+ return $ret;
+ }
+}
+
+
+?>
\ No newline at end of file
diff --git a/homepage/participo/lib/planerLib/planer.php b/homepage/participo/lib/planerLib/planer.php
deleted file mode 100644
index 2e5422f..0000000
--- a/homepage/participo/lib/planerLib/planer.php
+++ /dev/null
@@ -1,64 +0,0 @@
-$db = $db;
- }
-}
-
-class shiai{
- private $id = null; //< unique id
- private $date = null; //< date of the shiai
- private $name = null; //< name of the shiai as string
- private $ageclasses = null; //< age classes as space separated Uxy in a string
- private $place = null; //< place of the shiai as string
- private $announcementUrl = null; //< url to the announcement
- private $routeUrl = null; //< url to a routing planner
- private $galleryUrl = null; //< url of the gallery to a gallery of the shiai
- private $promoImgUrl = null; //< promotional image for the shiai (as url)
-
- function __construct($id, $date, $name, $ageclasses, $place, $announcementUrl, $routeUrl, $galleryUrl, $promoImgUrl){
- //! @todo input validation and sanitation
- $this->$id = (int) $id;
- $this->$date = DateTime::createFromFormat("Y-m-d", $date);
- $this->$name = $name;
- $this->ageclasses = $ageclasses;
- $this->place = $place;
- $this->announcementUrl = $announcementUrl;
- $this->routeUrl = $routeUrl;
- $this->galleryUrl = $galleryUrl;
- $this->promoImgUrl = $promoImgUrl;
- }
- static public function fromArray($member){
- $id = $member['lfdeNr'] ?? null;
- $date = $member['Datum'] ?? null;
- $name = $member['Veranstaltung'] ?? "";
- $ageclasses = $member['Altersklassen'] ?? null;
- $place = $member['Ort'] ?? "";
- $announcementUrl = $member['Ausschreibung'] ?? null;
- $routeUrl = $member['Routenplaner'] ?? null;
- $galleryUrl = $member['galleryLink'] ?? null;
- $promoImgUrl = $member['promoPic'] ?? null;
- }
-}
-class event{
- private $id = null; //< unique id of the event in the db
- private $date = null; //< date for the event (@todo ranges?)
- private $shiaiId = null; //< unique id of the shiai in the db (if appropriate)
- private $deadline = null; //< until when one can register for the event
- private $remarks = null; //< remarks to the event (special rules) or a json object for missing data (e.g. non-shiai events)
-
- private $shiai = null;
-
- function __construct($id, $date, $shiaiId, $deadline, $remarks){
- //! @todo InputValidation
- $this->$id = (int) $id;
- $this->$date = DateTime::createFromFormat("Y-m-d", $date);
- $this->shiaiId = (($shiaiId!=null)?((int)$shiaiId):(null));
- $this->deadline = DateTime::createFromFormat("Y-m-d");
- $this->remarks = $remarks;
- }
-}
-
-?>
\ No newline at end of file
diff --git a/homepage/participo/login.php b/homepage/participo/login.php
index fa9aadd..9d12351 100644
--- a/homepage/participo/login.php
+++ b/homepage/participo/login.php
@@ -1,14 +1,23 @@
"Es wurden nicht alle Felder ausgefüllt."];
} else {
-
- $message = checkCredentials($_POST['f']['username'], $_POST['f']['password'], $db_server, $db_user, $db_password, $db_name);
- if( !isset($message['error']) )
- $message['notice'] = "OnlineApps - cwsvJudo";
+ if( participo::checkCredentials( $_POST['f']['username'], $_POST['f']['password']) ){
+ $returnToUrl = ($_POST['returnToUrl'] ?? ".").($_POST['fragment'] ?? "");
+ participo::addMessage('success', "");
+ participo::addMessage('notice', "OnlineApps - cwsvJudo");
+ header("Location: " . $returnToUrl, TRUE, 301 );
+ }
}
}
}
@@ -42,18 +53,28 @@ else{
Loginseite der Online-Apps der Judoka des CWSV
-
+