Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($requests->post_data['submit']) AND $_SERVER['REQUEST_METHOD'] == 'POST')
- {
- $login = $requests->post_data['Username'];
- $email = $requests->post_data['Email'];
- $secret_code = $requests->post_data['secret_code'];
- $rules = $requests->post_data['rules'];
- $captcha = substr($requests->post_data['captcha'], 0, 4);
- $raspuns1 = $requests->post_data['Raspuns1'];
- $raspuns2 = $requests->post_data['Raspuns2'];
- $raspuns3 = $requests->post_data['Raspuns3'];
- $raspuns4 = $requests->post_data['Raspuns4'];
- if(empty($login) OR empty($email) OR empty($secret_code) OR empty($captcha) OR empty($raspuns1) OR empty($raspuns2) OR empty($raspuns3))
- {
- $pages->SetBodyContent($pages->GetMsgError('Fill all the fields!
- <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
- }
- else if(empty($login) OR empty($rules))
- {
- $pages->SetBodyContent($pages->GetMsgError('To register, please accept the terms!
- <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
- }
- else if(strlen($login) < 5 OR strlen($login) > 24)
- {
- $pages->SetBodyContent($pages->GetMsgError('Username must not be longer than 24 and not shorter than 5.
- <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
- }
- else if(strlen($email) < 10 OR strlen($email) > 128)
- {
- $pages->SetBodyContent($pages->GetMsgError('Email must not be longer than 128 and not shorter than 10.
- <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
- }
- else if(strlen($secret_code) < 5 OR strlen($secret_code) > 16)
- {
- $pages->SetBodyContent($pages->GetMsgError('Secret word must not be longer than 16 and not shorter than 5.
- <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
- }
- else if(preg_match( "/[\||\'|\<|\>|\[|\]|\"|\!|\?|\$|\@|\/|\\\|\&\~\*\{\+]/", $login))
- {
- $pages->SetBodyContent($pages->GetMsgError('Invalid name (no signs)!
- <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
- }
- else if(!preg_match("/^[a-zA-Z_]+$/", $login))
- {
- $pages->SetBodyContent($pages->GetMsgError('Invalid name (only latin letters)!
- <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
- }
- else if(preg_match('/[^(\w)|(\@)|(\.)|(\-)]/', $email))
- {
- $pages->SetBodyContent($pages->GetMsgError('Invalid email!
- <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
- }
- else if($user_class->IsUserRegistered($login))
- {
- $pages->SetBodyContent($pages->GetMsgError('This name is already registered!
- <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
- }
- else if($user_class->IsEmailRegistered($email))
- {
- $pages->SetBodyContent($pages->GetMsgError('This email is already used!
- <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
- }
- else if($user_class->Register($login, $email, $secret_code, $raspuns1, $raspuns2, $raspuns3, $raspuns4))
- {
- $_SESSION['test_good'] = 0;
- $pages->SetBodyContent($pages->GetMsgSuccess('You have been registered. The password has been sent to your email.
- <META HTTP-EQUIV="REFRESH" CONTENT="5; URL=../../">'));
- }
- else
- {
- $pages->SetBodyContent($pages->GetMsgError('There is an error!
- <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../?page=register">'));
- }
- }
- if(!$get_register)
- {
- $pages->SetBodyContent($pages->GetMsgNotice('Registrarile sunt inchise, reveniti mai tarziu.'));
- }
- else
- {
- $pages->SetBodyContent('<form class="contact-form" method="post">
- <div id="_info" class="ui-state-focus ui-corner-all" style="padding: 0 .7em;"> <p align="center"><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>Please make sure you use a rememberable secret word<br>
- This secret word will help you if you lose your account.</p></div><br>
- <table width=70%>
- <tr>
- <td><b>Username:</b></td>
- <td><input type="text" name="Username" maxlength="24" size="36"></td>
- </tr>
- <tr>
- <td><b>Email:</b></td>
- <td><input type="text" name="Email" maxlength="128" size="36"></td>
- </tr>
- <tr>
- <td><b>Secret word</b></td>
- <td><input type="text" name="secret_code" maxlength="16" size="36"></td>
- </tr>
- <tr>
- <td><b>Captcha:</b></td>
- <td><input type="text" name="captcha" maxlength="4"> <img id="captcha_img" src="/other/captcha/captcha.php" alt="Captcha" align="bottom" /></td>
- </tr>
- </table>
- <br>
- <b><p>Write a short background story about your character (must be at least 2 paragraphs).<p></b>
- <center><textarea type="text" name="Raspuns1" cols="75" rows="5" maxlength="2000" oncontextmenu="return false;" onKeyDown="return nocopypaste(event)">'.$raspuns1.'</textarea>
- <br></center>
- <b><p>Tell us about your past experiences with SA-MP (fell free to provide your in-game names and server names).</p></b>
- <center><textarea type="text" name="Raspuns2" cols="75" rows="5" maxlength="2000" oncontextmenu="return false;" onKeyDown="return nocopypaste(event)">'.$raspuns2.'</textarea>
- <br></center>
- <b><p>What is our policy regarding rape, robbing and scamming?</p></b>
- <center><textarea type="text" name="Raspuns3" cols="75" rows="5" maxlength="2000" oncontextmenu="return false;" onKeyDown="return nocopypaste(event)">'.$raspuns3.'</textarea>
- <br></center>
- <b><p>What is our policy regarding rape, robbing and scamming?</p></b>
- <center><textarea type="text" name="Raspuns4" cols="75" rows="5" maxlength="2000" oncontextmenu="return false;" onKeyDown="return nocopypaste(event)">'.$raspuns4.'</textarea>
- <br></center>
- <br>
- <center><br><div class="notice"> Odata ce cererea este depusa trebuie sa va conectati in joc pentru ca cererea sa fie revizuita. Imposibilitatea de a face acest lucru va avea ca rezultat neverificarea aplicatiei sau eventual respingerea acesteia.</div>
- <input type="checkbox" name="rules" /> Sunt de acord cu <a href="http://na-rp.ro/forum" target="_blank">regulamentul serverului</a>.<br>
- <br><br>
- <center><input type="submit" name="submit" value="Send" /><br><br></center>
- <br><br></form>');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement