IsSMTP(); // send using SMTP $phpmailerU->Host = "$phpmailerHost"; // SMTP server to use $phpmailerU->SMTPAuth = true; // use SMTP Auth $phpmailerU->Username = "$phpmailerUser"; // SMTP username $phpmailerU->Password = "$phpmailerPass"; // SMTP password $phpmailerU->From = "$email_from"; // sender EMail $phpmailerU->FromName = "Galatool $owner Uni $global_universe"; // sender name $phpmailerU->WordWrap = 80; // set word wrap $phpmailerU->IsHTML(false); // send as HTML $phpmailerA = new PHPMailer() ; // phpmailer itself for user $phpmailerA->IsSMTP(); // send using SMTP $phpmailerA->Host = "$phpmailerHost"; // SMTP server to use $phpmailerA->SMTPAuth = true; // use SMTP Auth $phpmailerA->Username = "$phpmailerUser"; // SMTP username $phpmailerA->Password = "$phpmailerPass"; // SMTP password $phpmailerA->From = "$email_from"; // sender EMail $phpmailerA->FromName = "Galatool $owner Uni $global_universe"; // sender name $phpmailerA->WordWrap = 80; // set word wrap $phpmailerA->IsHTML(false); // send as HTML } if (!isset($_SESSION['lang'])) { $_SESSION['lang'] = $default_language; } switch ($_SESSION['lang']) { case "german" : include "languages/german.inc.php"; break; case "english" : include "languages/english.inc.php"; break; case "spanish" : include "languages/spanish.inc.php"; break; case "dutch" : include "languages/dutch.inc.php"; break; case "balkan" : include "languages/balkan.inc.php"; break; case "french" : include "languages/french.inc.php"; break; case "portugues" : include "languages/portugues.inc.php"; break; case "polish" : include "languages/polish.inc.php"; break; case "italian" : include "languages/italian.inc.php"; break; case "turkish" : include "languages/turkish.inc.php"; break; case "danish" : include "languages/danish.inc.php"; break; case "brazilian" : include "languages/brazilian.inc.php"; break; case "russian" : include "languages/russian.inc.php"; break; case "swedish" : include "languages/swedish.inc.php"; break; case "greek" : include "languages/greek.inc.php"; break; case "romanian" : include "languages/romanian.inc.php"; break; case "hungarian" : include "languages/hungarian.inc.php"; break; case "czech" : include "languages/czech.inc.php"; break; case "korean" : include "languages/korean.inc.php"; break; case "norwegian" : include "languages/norwegian.inc.php"; break; case "taiwan" : include "languages/taiwan.inc.php"; break; case "japan" : include "languages/japan.inc.php"; break; case "chinese" : include "languages/chinese.inc.php"; break; case "bulgarian" : include "languages/bulgarian.inc.php"; break; case "lithuanian" : include "languages/lithuanian.inc.php"; break; case "latvian" : include "languages/latvian.inc.php"; break; case "finnish" : include "languages/finnish.inc.php"; break; default : include "languages/german.inc.php"; break; } ?> <?php echo PROGRAM_NAME; ?>
 
".REGISTER_ERROR3."
".mysql_error().""; } else { echo "
".REGISTER_INFO3."
"; } } else { if (isset($_POST['loginusername'])) { // get all reg. information $loginusername = preg_replace("/[^a-zA-Z0-9äöüÄÖÜß_\s\-\.]/","",$_POST['loginusername']); $password1 = preg_replace("/[^a-zA-Z0-9äöüÄÖÜß_\s\-\.]/","",$_POST['password1']); $password2 = preg_replace("/[^a-zA-Z0-9äöüÄÖÜß_\s\-\.]/","",$_POST['password2']); $ingameusername = mysql_real_escape_string(trim(stripslashes($_POST['ingameusername']))); $email = trim(stripslashes($_POST['email'])); $allytag = mysql_real_escape_string(trim(stripslashes($_POST['allytag']))); if (empty($loginusername) || empty($password1) || empty($password2) || empty($ingameusername) || empty($email) || ($password1 != $password2) || preg_replace("/([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})/","",$email) != "" ) { $error_occured = true; if ($password1 != $password2 || empty($password1)) $error['pass'] = "class=\"failure\""; } else { // save data $query = "INSERT INTO $utablename (username,userpass,stylepath,email,ingame,allytag,links) VALUES ('$loginusername','".md5($password1)."','styles.css','".mysql_real_escape_string($email)."','$ingameusername','$allytag','Galaxytool;http://www.galaxytool.eu')"; $res = mysql_query($query); if (!$res) { echo "
".REGISTER_ERROR1."
"; $error_occured = true; } else { echo "
".REGISTER_INFO1."
"; // send email for veryfication $link = strtolower(strtok($_SERVER['SERVER_PROTOCOL'], '/')).'://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?action=verify&id=".md5($password1)."&email=".$email; $link .= "\n\n"; if ($usePHPMailer) { $phpmailerU->AddAddress($email); // set receiving email $phpmailerU->Subject = REGISTER_EMAILVERIFICATION; // set topic of mail $phpmailerU->Body = REGISTER_EMAILTEXT."\n".$link; // set content of mail $result = ($phpmailerU->Send()); // send and see what happens } else { // send email for veryfication via local mail server $headers = "From: ".$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/plain; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n"; // Send $result = mail($email, REGISTER_EMAILVERIFICATION, REGISTER_EMAILTEXT."\n".$link, $headers); } // send email to tool admin if ($email_to != 'none@none.com' && !empty($email_to)) { $link = strtolower(strtok($_SERVER['SERVER_PROTOCOL'], '/')).'://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; $link = str_replace("register.php","",$link); if ($usePHPMailer) { $phpmailerA->AddAddress($email_to); // set receiving email $phpmailerA->Subject = REGISTER_NEW_SUBJECT; // set topic of mail // set content of mail $phpmailerA->Body = REGISTER_NEW_MAILTEXT."\nloginusername: $loginusername\ningame:$ingameusername\n\nlink: $link"; $result = ($phpmailerA->Send()); // send and see what happens } else { // send using local mail server $headers = "From: ".$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/plain; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n"; // Send $result = mail($email_to, REGISTER_NEW_SUBJECT , REGISTER_NEW_MAILTEXT."\nloginusername: $loginusername\ningame:$ingameusername\n\nlink: $link", $headers); } } if ($result) { echo "
".REGISTER_INFO2."
"; } else { echo "
".REGISTER_ERROR2."
\n"; } echo '
'; } } } if ((isset($error_occured) && $error_occured) || !isset($_POST['loginusername'])) { if (!isset($error_occured)) $error_occured = false; // show registration Screen if (!isset($error['pass'])) $error['pass'] = ""; if ($error_occured && empty($loginusername)) { $error['loginname'] = "class=\"failure\""; } else $error['loginname'] = ""; if ($error_occured && empty($ingameusername)) { $error['ingamename'] = "class=\"failure\""; } else $error['ingamename'] = ""; if ($error_occured && (empty($email) || preg_replace("/([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})/","",$email) != "")) { $error['email'] = "class=\"failure\""; } else $error['email'] = ""; if ($error_occured && empty($allytag)) { $error['ally'] = "class=\"failure\""; } else $error['ally'] = ""; $text_to_show = REGISTER_MISSING_FIELDS; echo '
'.$text_to_show.'
'.REGISTER_LOGINNAME.':
'.REGISTER_PASSWORD.':
'.REGISTER_PASSWORD_CONFIRM.':
'.REGISTER_EMAIL.':
'.REGISTER_INGAME.':
'.REGISTER_ALLYTAG.':[]
 
'; } } ?>