From d032d1e427317cf2ef9c14b77988555f55b6c91b Mon Sep 17 00:00:00 2001 From: genuineparts Date: Wed, 4 Jun 2025 10:21:08 +0200 Subject: [PATCH] Fixed captcha and various improvements --- inc/captcha.class.php | 17 +++------ inc/sessions.class.php | 15 ++++++-- modules/text/text.module.php | 6 +-- themes/austria/register.tpl | 72 ++++++++++++++++++------------------ 4 files changed, 56 insertions(+), 54 deletions(-) diff --git a/inc/captcha.class.php b/inc/captcha.class.php index 6ff5177..fe9bcd7 100644 --- a/inc/captcha.class.php +++ b/inc/captcha.class.php @@ -27,8 +27,7 @@ class captcha{ function getCaptcha(){ global $config; if($config['captcha']==1) { - //return '
'; - return '
'; + return '
'; } else if ($config['captcha']==2) { return '
'; } else { @@ -37,9 +36,8 @@ class captcha{ } function validate($response){ - global $config; + global $config,$functions; if($config['captcha']==1) { - var_dump($response); if(isset($response['mcaptcha__token']) && $response['mcaptcha__token']!=''){ $token = $response['mcaptcha__token']; } else { @@ -65,19 +63,17 @@ class captcha{ // schließe den cURL-Handle und gebe die Systemresourcen frei curl_close($ch); - var_dump($fh); if(!$fh){ return false; }else{ - $response = json_decode($fh, true); - if($response["valid"] !== true){ + $cresp = json_decode($fh, true); + if($cresp["valid"] === true){ return true; }else{ return false; } } }else if($config['captcha']==2) { - var_dump($response); if(isset($response['g-recaptcha-response']) && $response['g-recaptcha-response']!=''){ $data = $response['g-recaptcha-response']; } else { @@ -95,12 +91,11 @@ class captcha{ // schließe den cURL-Handle und gebe die Systemresourcen frei curl_close($ch); - if(!$fh){ return false; }else{ - $response = json_decode($fh, true); - if($response["success"] !== true){ + $cresp = json_decode($fh, true); + if($cresp["success"] === true){ return true; }else{ return false; diff --git a/inc/sessions.class.php b/inc/sessions.class.php index 6605926..1268517 100644 --- a/inc/sessions.class.php +++ b/inc/sessions.class.php @@ -1,9 +1,9 @@ $validto, + 'path' => $path, + 'domain' => $domain, // leading dot for compatibility or use subdomain + 'secure' => $https, // or false + 'httponly' => $httponly, // or false + 'samesite' => 'Strict' // None || Lax || Strict + ); + setcookie($name, $data, $arr_cookie_options); } function update_session($sid, $uid=''){ diff --git a/modules/text/text.module.php b/modules/text/text.module.php index 7c2b17b..e81392b 100644 --- a/modules/text/text.module.php +++ b/modules/text/text.module.php @@ -11,7 +11,7 @@ class module_text extends admin_module{ $info["name"]="Textverwaltung"; $info["file"]="text"; $info["author"]="astat"; - $info["version"]="1.0.0"; + $info["version"]="1.0.1"; $info["url"]="http://www.astat.org"; return $info; } @@ -23,8 +23,8 @@ class module_text extends admin_module{ `text` text NOT NULL, `date` int(11) NOT NULL default '0', `author` int(11) NOT NULL default '0', - `eid` int(11) NOT NULL, - `edittime` int(11) NOT NULL, + `eid` int(11) NULL default NULL, + `edittime` int(11) NULL default NULL, `menue` int(11) NOT NULL default '0', `title` varchar(80) NOT NULL default '', `url` varchar(120) NOT NULL, diff --git a/themes/austria/register.tpl b/themes/austria/register.tpl index 54ad9e5..c8831e8 100644 --- a/themes/austria/register.tpl +++ b/themes/austria/register.tpl @@ -7,47 +7,47 @@ {$emsg} - - -
-
-
-
- Nickname:
- - Passwort:
- - Geburtstag:
-
- Herkunft:
- -
-
- E-Mail:
- - Passwort wiederholen:
- - Realname:
- - / Geschlecht:
- -
-
-
-
+
+ +
+
+
+ Nickname:
+ + Passwort:
+ + Geburtstag:
+
+ Herkunft:
+ +
+
+ E-Mail:
+ + Passwort wiederholen:
+ + Realname:
+ + / Geschlecht:
+ +
+
+
+
Ich stimme den Nutzungsbedingungen zu und bestätige mindestens 16 Jahre alt zu sein. {if $captcha != ""} Captcha {$captcha} {/if} -
+ Pflichtfelder
+
+ - - - + +