Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('config.php');
- require_once('recaptchalib.php'); //REQUIRED IMPORT FOR RECAPTCHA ENGINE
- //Recaptcha public key that is needed to request recaptcha input dialog, change as needed, depending on site.
- $publickey = "6LfVTgwAAAAAAAXOeGyaKxCO0OGUn_Kwml30Qpy7";
- if (!defined('AXE'))
- exit;
- if (!$a_user['is_guest'])
- {
- box ('Hmm','You are already logged in, why do you wan\'t new account? <br>I should ban u at the spot... But ill leave u be...');
- $tpl_footer = new Template("styles/".$style."/footer.php");
- $tpl_footer->setVar("imagepath", 'styles/'.$style.'/images/');
- print $tpl_footer->toString();
- exit;
- }
- //common include
- $box_simple_wide = new Template("styles/".$style."/box_simple_wide.php");
- $box_wide = new Template("styles/".$style."/box_wide.php");
- $box_wide->setVar("imagepath", 'styles/'.$style.'/images/');
- $box_simple_wide->setVar("imagepath", 'styles/'.$style.'/images/');
- //end common include
- if (isset($_POST['action']))
- {
- //RECAPTCHA KEY FOR RETRIEVING RESPONSE
- $privatekey = "6LfVTgwAAAAAADdX1g-uUHZzJ8CFTKc9i4t2zts9";
- //boolean Response declaration from reCaptcha site to verify if user input is correct.
- $resp = recaptcha_check_answer ($privatekey,
- $_SERVER["REMOTE_ADDR"],
- $_POST["recaptcha_challenge_field"],
- $_POST["recaptcha_response_field"]);
- //do login stuff:
- $login = preg_replace( "/[^A-Za-z0-9]/", "", $_POST['username'] ); //only letters and numbers
- if (!$resp->is_valid) { //Error Catching for Captcha
- $war5="<br><center><font color='red' size=5>Wrong Recaptcha</font></center>";
- }
- else {
- if ($login=='')
- {
- $war1="<font color='red'>Type in username/login</font>";
- }
- else //pass empty
- {
- $db->select_db($acc_db);
- $result = $db->query("SELECT ".$db_translation['login']." FROM ".$db_translation['accounts']." WHERE ".$db_translation['login']." = '".$db->escape($login)."' LIMIT 1") or die(mysql_error());
- $rows = $db->num_rows($result);
- if ($rows>=1)
- {
- $war1="<font color='red'>Username '".$login."' already exist!</font>";
- $db->select_db($db_name);
- }
- else //pass username
- {
- if ($smtp_h=='')
- {
- $pass1 = preg_replace( "/[^A-Za-z0-9]/", "", $_POST['password'] ); //only letters and numbers
- $pass2 = preg_replace( "/[^A-Za-z0-9]/", "", $_POST['password2'] ); //only letters and numbers
- if ($pass1=='')
- {
- box ('Fail',"Type in password.");
- $tpl_footer = new Template("styles/".$style."/footer.php");
- $tpl_footer->setVar("imagepath", 'styles/'.$style.'/images/');
- print $tpl_footer->toString();
- exit;
- }
- else //pass empty
- {
- if ($pass1<>$pass2)
- {
- box ('Fail',"Passwords does not match.");
- $tpl_footer = new Template("styles/".$style."/footer.php");
- $tpl_footer->setVar("imagepath", 'styles/'.$style.'/images/');
- print $tpl_footer->toString();
- exit;
- }
- }
- }
- $email = pun_htmlspecialchars($_POST['email']);
- if ($email=='')
- {
- $war3="<font color='red'>Type in email</font>";
- }
- else //pass empty
- {
- $db->select_db($acc_db);
- $result = $db->query("SELECT ".$db_translation['login']." FROM ".$db_translation['accounts']." WHERE ".$db_translation['email']." = '".$db->escape($email)."' LIMIT 1") or die(mysql_error());
- $rows = $db->num_rows($result);
- if ($rows>=1)
- {
- $war3="<font color='red'>Email '".$email."' is already in use!</font>";
- $db->select_db($db_name);
- }
- else //pass
- {
- $question = $_POST['question'];
- $answer = preg_replace( "/[^A-Za-z0-9]/", "", $_POST['answer'] );
- if ($answer=='')
- {
- $war4="<font color='red'>Make sure you type in answer</font>";
- }
- else //pass final
- {
- //random pass
- if ($smtp_h<>'' && $smtp_u<>'') //check if there is smtp info
- {
- $pass1=random_pass('6');
- }
- $db->select_db($acc_db);
- //create_account($user,$pass,$email,$securityq,$securitya)
- $createacc=create_account($login,$pass1,$db->escape($email));
- if ($createacc)
- {
- box ('Fail',$createacc);
- $tpl_footer = new Template("styles/".$style."/footer.php");
- $tpl_footer->setVar("imagepath", 'styles/'.$style.'/images/');
- print $tpl_footer->toString();
- exit;
- }
- $db->select_db($db_name);
- //add additional data
- $result2 = $db->query("INSERT INTO accounts_more (acc_login, vp, question_id, answer, dp) VALUES ('".strtoupper($login)."','0','".$question."','".$db->escape($answer)."','0')") or die(mysql_error());
- if ($question=='1')
- {
- $questi="Your middle name?";
- }
- elseif ($question=='2')
- {
- $questi="Your birth town?";
- }
- elseif ($question=='3')
- {
- $questi="Your pet's name?";
- }
- elseif ($question=='4')
- {
- $questi="Your mother maiden name?";
- }
- else
- {
- print "Something went wrong with with your security question...";
- }
- //SMTP START
- if ($smtp_h<>'' && $smtp_u<>'') //check if there is smtp info
- {
- $from =trim($email);
- $to = trim($email);
- $subject = $title." - Your Account Info";
- $body = "Hi, thank you for creating account, ".$login."!\n\nYour password: ".$pass1."\n\nEnjoy your stay!\n\n".$domain_url;
- require_once "smtp.php";
- }
- //SMTP END
- $thisboxstring.='<span class="colorgood">Account Create Success. You are Logged in, your account will be active ingame after 3 minutes.<br><b><strong> set realmlist logon.zhyperwow.com</strong></b></span><br><br>'.$smtpme;
- if ($smtp_h=='' && $smtp_u<>'') //check if there is smtp info
- {
- $thisboxstring.=' Your password is <strong>'.$pass1.'</strong>. You can change it from Account Panel.';
- }
- $thisboxstring.='<a href="./quest.php?name=account">Go to Account Panel</a>';
- box ('Success',$thisboxstring);
- //login
- $_SESSION['user']=pun_htmlspecialchars($login);
- $tpl_footer = new Template("styles/".$style."/footer.php");
- $tpl_footer->setVar("imagepath", 'styles/'.$style.'/images/');
- print $tpl_footer->toString();
- exit;
- }
- }
- }
- }
- }
- }
- }
- $cont2='
- <form action="" method="post">
- <style>input#recaptcha_response_field { background-color: white; }</style>
- <table align="center" border="0">
- <tr>
- <td class="td">
- <label for="username" onMouseOver="$WowheadPower.showTooltip(event, \'Type in your username/login, this is your server login.\')" onMouseMove="$WowheadPower.moveTooltip(event)" onMouseOut="$WowheadPower.hideTooltip();">
- Username:
- </label>
- </td>
- <td>
- <input type="text" id="username" maxlength="20" name="username" /> '. $war1.'
- </td>
- </tr>';
- if ($smtp_h=='') //check if there is smtp info
- {
- $cont2.='
- <tr>
- <td class="td">
- <label for="password" onMouseOver="$WowheadPower.showTooltip(event, \'Make sure it is secure, you can always change trough Account Panel later.\')" onMouseMove="$WowheadPower.moveTooltip(event)" onMouseOut="$WowheadPower.hideTooltip();">
- Password:
- </label>
- </td>
- <td>
- <input type="password" id="password" maxlength="20" name="password" />
- </td>
- </tr>
- <tr>
- <td class="td">
- <label for="password2">
- Confirm Password:
- </label>
- </td>
- <td>
- <input type="password" id="password2" maxlength="20" name="password2" /> '. $war2.'
- </td>
- </tr>';
- }
- $cont2.='
- <tr>
- <td class="td">
- <label for="email" onmouseover="$WowheadPower.showTooltip(event, \'Enter your e-mail address.';
- if ($smtp_h<>'') $cont2.= " Mail with your password will be sent to your e-mail."; $cont2.='\')" onmousemove="$WowheadPower.moveTooltip(event)" onmouseout="$WowheadPower.hideTooltip();">
- Email Address:
- </label>
- </td>
- <td>
- <input type="text" id="email" maxlength="40" name="email" /> '. $war3.'
- </td>
- </tr>
- <tr>
- <td>
- <label for="question">
- Security Question:
- </label>
- </td>
- <td>
- <label><input name="question" type="radio" value="1" /> Your middle name?</label><br />
- <label><input name="question" type="radio" value="2" checked="checked" /> Your birth town?</label><br />
- <label><input name="question" type="radio" value="3" /> Your pet\'s name?</label><br />
- <label><input name="question" type="radio" value="4" /> Your mother maiden name?</label><br />
- </td>
- </tr>
- <tr>
- <td class="td">
- <label for="answer">
- Security Answer:
- </label>
- </td>
- <td>
- <input type="text" id="answer" maxlength="100" name="answer" /> '.$war4.'
- </td>
- </tr>
- <tr>
- <th align="center" colspan=2><br/><br/>'.recaptcha_get_html($publickey).$war5.'</th>
- </tr>
- </table><br />
- <center>
- <p>*Only alphabetic letters A-Z, a-z and numbers 0-9 are allowed*</p>
- <p>*Make sure you put valid informations such as emails and security questions as they will be used to recover your account.*</p>
- <p><strong><font color="#006600" size="5">Realmlist: logon.zhyperwow.com </font></strong><br />
- <br />
- <input type="submit" name="action" value="Create Account" class="button doit" />
- </p>
- </center>
- </form>
- <!--<div class="post2" align="center">
- <div class="post_header2">
- Server Information
- </div>
- <div class="post_body2">
- set realmlist connect.zhyperwow.com
- </div>
- <img src="res/post_bottom2.png" alt="" align="top" />
- </div>-->';
- $box_wide->setVar("content_title", "Account registration");
- $box_wide->setVar("content", $cont2);
- print $box_wide->toString();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement