get_count("SELECT * FROM `{$mod}_external` WHERE `email`='{$_REQUEST['email']}'") != 0) header("Location: ".$_SERVER['PHP_SELF']."?module=$mod&action=error&errno=60001"); else { $new['email'] = "'".$db->escape_string(trim($_REQUEST['email']))."'"; $new['password'] = "'".$db->escape_string(trim($_REQUEST['password']))."'"; if (!is_valid_email(trim($_REQUEST['email']))) header("Location: ".$_SERVER['PHP_SELF']."?module=$mod&action=error&errno=60011"); elseif ($new['password'] == "''") header("Location: ".$_SERVER['PHP_SELF']."?module=$mod&action=error&errno=60012"); else { $db->insert("{$mod}_external",$new); if ($db->lasterror()) echo $db->lasterror(); else header("Location: ".$_SERVER['PHP_SELF']."?module=$mod&action=addok"); } } $system['dorender'] = false; break; case 'signoff': $_REQUEST['email'] = $db->escape_string($_REQUEST['email']); if ($row = $db->get_array("SELECT * FROM `{$mod}_external` WHERE `email`='{$_REQUEST['email']}'")) { if ($row['password'] == $_REQUEST['password']) { $db->delete("{$mod}_external",array("`email`='{$_REQUEST['email']}'")); if ($db->lasterror()) echo $db->lasterror(); else header("Location: ".$_SERVER['PHP_SELF']."?module=$mod&action=removeok"); } else header("Location: ".$_SERVER['PHP_SELF']."?module=$mod&action=error&errno=60003"); } else header("Location: ".$_SERVER['PHP_SELF']."?module=$mod&action=error&errno=60002"); if ($db->lasterror()) echo $db->lasterror(); $system['dorender'] = false; break; case 'password': $_REQUEST['email'] = $db->escape_string($_REQUEST['email']); if ($row = $db->get_array("SELECT * FROM `{$mod}_external` WHERE `email`='{$_REQUEST['email']}'")) { $mail = "Hallo,\n"; $mail .= "Für deinen E-Mail-Adresse wurde das Newsletter-Passwort angefordert. Diese lautet :\n"; $mail .= "Passwort: {$row['password']}\n\n"; $mail .= "Abmelden kannst du dich unter http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}?module=$mod&action=index\n\n"; $mail .= "Das Technikteam\n\n---\nAutomatic generated message, do not reply"; if (mail($row['email'],'Newsletter-Kennwort',$mail,"From: mailerdemon@StuTa.de\nReply-To:technik@StuTa.de")) header("Location: ".$_SERVER['PHP_SELF']."?module=$mod&action=pwsend"); else header("Location: ".$_SERVER['PHP_SELF']."?module=$mod&action=error&errno=60010"); } else header("Location: ".$_SERVER['PHP_SELF']."?module=$mod&action=error&errno=60002"); $system['dorender'] = false; break; } ?>