This commit is contained in:
genuineparts 2025-06-03 23:02:49 +02:00
parent 85994871a0
commit 26732d5cd8
7 changed files with 180 additions and 85 deletions

View file

@ -16,14 +16,14 @@ if (isset($_COOKIE[$config["cookiename"] . "_rid"])){
if ($db->num_rows ($result) <= 0){
$db->query("INSERT INTO `" . $config['prefix'] . "banned_ips` (`ip`,`date`,`reason`) VALUES ('".$session->ip."','".time()."','Autoban - Matched Cookie')");
}
$core->message('Gebannt','Es scheint als wäre deine IP aktulle von der Accounterstellung ausgeschlossen.<br /> Wenn du denkst dies sei ein Fehler bitte sende uns eine <a href="mailto:'.$config['siteemail'].'">E-Mail</a>.',TRUE,$config['path'].'/index.php',5);
$core->message('Gebannt','Es scheint als wäre deine IP aktulle von der Accounterstellung ausgeschlossen.<br> Wenn du denkst dies sei ein Fehler bitte sende uns eine <a href="mailto:'.$config['siteemail'].'">E-Mail</a>.',TRUE,$config['path'].'/index.php',5);
}
$result = $db->query("SELECT `id` FROM `" . $config['prefix'] . "banned_ips` WHERE `ip` = '".$db->escape($session->ip)."'");
if ($db->num_rows ($result) > 0){
$row=$db->fetch_object($result);
$id=$row->id;
$session->setcookie($config['cookiename'] . '_rid', $id , time() + 60 * 60 * 24 * 365, $config['path'],$config['domain']);
$core->message('Gebannt','Es scheint als wäre deine IP aktulle von der Accounterstellung ausgeschlossen.<br /> Wenn du denkst dies sei ein Fehler bitte sende uns eine <a href="mailto:'.$config['siteemail'].'">E-Mail</a>.',TRUE,$config['path'].'/index.php',5);
$core->message('Gebannt','Es scheint als wäre deine IP aktulle von der Accounterstellung ausgeschlossen.<br> Wenn du denkst dies sei ein Fehler bitte sende uns eine <a href="mailto:'.$config['siteemail'].'">E-Mail</a>.',TRUE,$config['path'].'/index.php',5);
}
/*if($_GET['activate']!=""){
if($_GET['regstring']!=""){
@ -41,13 +41,11 @@ if(isset($_POST['submit']) && $_POST['openid']!='' && isset($_POST['openid'])){
$username=$session->sanitize_username($_POST['username']);
$vusername=$session->verify_username($username);
if($vusername!==TRUE){
$emsg.='<span style="color:red; font-weight:bold">'.$vusername.'</span><br />';
$emsg.='<span style="color:red; font-weight:bold">'.$vusername.'</span><br>';
}
if($config['captcha']==1){
include ('thirdparty/securimage/securimage.php');
$img = new Securimage();
if(!$img->check($_POST['captcha'])){
$emsg.='<span style="color:red; font-weight:bold">Das Captcha is ung&uuml;ltig!</span><br />';
if($config['captcha']!=0){
if(!$captcha->validate($_POST)){
$emsg.='<span style="color:red; font-weight:bold">Das Captcha is ung&uuml;ltig!</span><br>';
}
}
if(!preg_match('/^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/iD',$_POST['email'])){
@ -55,11 +53,11 @@ if(isset($_POST['submit']) && $_POST['openid']!='' && isset($_POST['openid'])){
}
$result = $db->query("SELECT `uid` FROM `" . $config['prefix'] . "users` WHERE `username` LIKE '".$db->escape($username)."' LIMIT 1");
if ($db->num_rows ($result) > 0){
$emsg.='<span style="color:red; font-weight:bold">Dieser Nickname ist bereits vergeben!</span><br />';
$emsg.='<span style="color:red; font-weight:bold">Dieser Nickname ist bereits vergeben!</span><br>';
}
$result = $db->query("SELECT `uid` FROM `" . $config['prefix'] . "users` WHERE `email` LIKE '".$db->escape($_POST['email'])."' LIMIT 1");
if ($db->num_rows ($result) > 0){
$emsg.='<span style="color:red; font-weight:bold">Diese E-Mail ist bereits registriert!</span><br />';
$emsg.='<span style="color:red; font-weight:bold">Diese E-Mail ist bereits registriert!</span><br>';
}
if(!$emsg){
// Secure Posted Data
@ -84,7 +82,7 @@ if(isset($_POST['submit']) && $_POST['openid']!='' && isset($_POST['openid'])){
$core->redirect_message('Logged in','You have been successfully logged-in and will be redirected shortly.',TRUE,$config['path'].'/index.php',3);
}else{
$tpl->assign('emsg',$emsg);
$tpl->assign('captcha',$config['captcha']);
$tpl->assign('captcha',$captcha->getCaptcha());
$tpl->assign('openid',$config['use_openid']);
$tpl->assign('identity',$_POST['openid']);
$tpl->assign('data',$_POST);
@ -107,52 +105,32 @@ If(isset($_POST['submit'])){
$username=$session->sanitize_username($_POST['username']);
$vusername=$session->verify_username($username);
if($vusername!==TRUE){
$emsg.='<span style="color:red; font-weight:bold">'.$vusername.'</span><br />';
$emsg.='<span style="color:red; font-weight:bold">'.$vusername.'</span><br>';
}
if(!isset($_POST['agreed']) || $_POST['agreed']==''){
$emsg.='<span style="color:red; font-weight:bold">Du musst den Nutzungsbedingungen zustimmen!</span><br />';
$emsg.='<span style="color:red; font-weight:bold">Du musst den Nutzungsbedingungen zustimmen!</span><br>';
}
if(!isset($_POST['birthday']) || $_POST['birthday']==''){
$emsg.='<span style="color:red; font-weight:bold">Du musst dein Geburtsdatum angeben!</span><br />';
$emsg.='<span style="color:red; font-weight:bold">Du musst dein Geburtsdatum angeben!</span><br>';
}else{
$birthday = strtotime($_POST['birthday']);
// check
// 31536000 is the number of seconds in a 365 days year.
if(time() - $birthday < 16 * 31536000) {
$emsg.='<span style="color:red; font-weight:bold">Du musst leider midnestens 16 Jahre alt sein.</span><br />';
$emsg.='<span style="color:red; font-weight:bold">Du musst leider mindestens 16 Jahre alt sein.</span><br>';
}
}
if(!isset($_POST['password']) || $_POST['password']==''){
$emsg.='<span style="color:red; font-weight:bold">Du musst ein Passwort vergeben!</span><br />';
$emsg.='<span style="color:red; font-weight:bold">Du musst ein Passwort vergeben!</span><br>';
}elseif($_POST['password']!=$_POST['cpassword']){
$emsg.='<span style="color:red; font-weight:bold">Deine Passw&ouml;rter stimmen nicht &uuml;berein!</span><br />';
$emsg.='<span style="color:red; font-weight:bold">Deine Passw&ouml;rter stimmen nicht &uuml;berein!</span><br>';
}elseif(strlen($_POST['password'])<6){
$emsg.='<span style="color:red; font-weight:bold">Dein Passwort ist zu kurz, es muss mindestens 6 Zeichen lang sein.</span><br />';
$emsg.='<span style="color:red; font-weight:bold">Dein Passwort ist zu kurz, es muss mindestens 6 Zeichen lang sein.</span><br>';
}
if($config['captcha']==1){
if(isset($_POST['g-recaptcha-response']) && $_POST['g-recaptcha-response']!=''){
$ch = curl_init();
// setze die URL und andere Optionen
curl_setopt($ch, CURLOPT_URL, "https://www.google.com/recaptcha/api/siteverify?secret=".$config['recaptcha_secret']."&response=".$_POST['g-recaptcha-response']."&remoteip=".$functions->get_ip());
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
// führe die Aktion aus und gebe die Daten an den Browser weiter
$fh=curl_exec($ch);
// schließe den cURL-Handle und gebe die Systemresourcen frei
curl_close($ch);
if(!$fh){
$emsg.='<span style="color:red; font-weight:bold">Das Captcha is ung&uuml;ltig!</span><br />';
}else{
$response = json_decode($fh, true);
if($response["success"] !== true){
$emsg.='<span style="color:red; font-weight:bold">Das Captcha is ung&uuml;ltig!</span><br />';
}
}
if($config['captcha']!=0){
if(!$captcha->validate($_POST)){
$emsg.='<span style="color:red; font-weight:bold">Das Captcha is ung&uuml;ltig!</span><br>';
}
}
if(!preg_match('/^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/iD',$_POST['email'])){
@ -209,11 +187,12 @@ If(isset($_POST['submit'])){
}
$meta='<link type="text/css" rel="stylesheet" href="'.$config['path'].'js/calendar/dhtmlgoodies_calendar.css?random=20060118" media="screen"></link>
<script src="'.$config['path'].'js/calendar/dhtmlgoodies_calendar.js?random=20060118" type="text/javascript">
</script><script src=\'https://www.google.com/recaptcha/api.js\'></script>';
</script>';
$dcap = $captcha->getCaptcha();
$tpl->assign('path','//'.$config['domain'].'/'.$config['path']);
$tpl->assign('emsg',$emsg);
$tpl->assign('regstring',$_GET['regstring']);
$tpl->assign('captcha',$config['captcha']);
$tpl->assign('captcha',$dcap);
$tpl->assign('sid',md5(uniqid(time())));
$tpl->assign('data',$_POST);
$content=$tpl->fetch('register.tpl');