PageRenderTime 119ms CodeModel.GetById 33ms RepoModel.GetById 1ms app.codeStats 0ms

/website/community/account/us_register.php

https://gitlab.com/Drakons/Illarion-Website
PHP | 129 lines | 115 code | 14 blank | 0 comment | 7 complexity | 254b1ee962b22195f2eb6949cf5f4d48 MD5 | raw file
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/shared/shared.php';
  3. includeWrapper::includeOnce(Page::getRootPath().'/community/account/inc_register.php');
  4. if (isset($_GET['activate']))
  5. {
  6. if (IllaUser::activate( $_GET['activate'] ))
  7. {
  8. Messages::add('Account got activated', 'info');
  9. Page::addPiwikGoal(2);
  10. includeWrapper::includeOnce( Page::getRootPath().'/community/account/us_newchar.php' );
  11. exit();
  12. }
  13. else
  14. {
  15. Messages::add('Activation key is invalid.', 'error');
  16. Messages::add('Sometimes, the browser sends the activation request twice because the website did not respond fast enough. In this case the account is activated and the error message appears. Please just try to login into your account.', 'note');
  17. }
  18. }
  19. if (isset($_POST['submit']))
  20. {
  21. if (isTorRequest())
  22. {
  23. Messages::add('TOR proxy network detected! Registration rejected.', 'error');
  24. }
  25. else
  26. {
  27. applyUserData();
  28. if ( IllaUser::register() )
  29. {
  30. Messages::add('Registration was successful. You will now receive an email to activate your account.', 'info');
  31. Page::addPiwikGoal(1);
  32. includeWrapper::includeOnce( Page::getRootPath().'/general/us_startpage.php' );
  33. exit();
  34. }
  35. else
  36. {
  37. Messages::add('Registration failed. Check your used login name. Special characters are not allowed.', 'error');
  38. }
  39. }
  40. }
  41. Page::setTitle( array( 'Account', 'Create a new Account' ) );
  42. Page::setDescription( 'On this page you can register at Illarion' );
  43. Page::setKeywords( array( 'account', 'register', 'playing', 'join' ) );
  44. Page::addJavaScript( array( 'jquery', 'wz_tooltip', 'register' ) );
  45. Page::setXHTML();
  46. Page::Init();
  47. ?>
  48. <h1>Create a new account</h1>
  49. <h2>Important information</h2>
  50. <p>On this page you can create an account for Illarion.
  51. In addition it's needed to create a character you
  52. can play after you created this account.</p>
  53. <p>Players who already have an account should know that it's forbidden to create another
  54. one.</p>
  55. <p>Details with a * behind are required. All others are optional. The email address
  56. needs to be valid, because an email is send to this address with a link in it to activate the
  57. account.</p>
  58. <p>To use that page it is needed that the used browser supports JavaScript.</p>
  59. <?php if (isTorRequest()): ?>
  60. <p style="font-weight:bold;">The homepage detected that you are using a proxy
  61. server of the TOR network. You have to disable this proxy to be allowed to
  62. register at Illarion.</p>
  63. <?php endif; ?>
  64. <h2>Account details</h2>
  65. <form action="<?php echo Page::getURL(); ?>/community/account/us_register.php" method="post">
  66. <table style="width:100%;">
  67. <tr>
  68. <td style="width:130px;"><a title="" class="tooltip" onmouseover="Tip('This name needs to be unique on the server and it\'s used to login to your account. The name contains at least 5 and maximal 32 characters. Capital and non-capital letters, as well as digits, underlines and hyphens are possible. Other special characters such as spaces are not allowed.',TITLE,'Login name',WIDTH,-300);" onmouseout="UnTip();">Login name:</a></td>
  69. <td style="width:10px;"></td>
  70. <td style="width:162px;"><input type="text" name="username" id="username" value="" /> *</td>
  71. <td style="text-indent:15px;" id="check_username"></td>
  72. </tr>
  73. <tr>
  74. <td><a title="" class="tooltip" onmouseover="Tip('Only this name would be displayed for all other players. Furthermore this name is taken for your first board account. If you don\'t enter a name then your login name will be taken. As soon as you state a name it\'s not changeable anymore.',TITLE,'Displayed Name',WIDTH,-300);" onmouseout="UnTip();">Displayed Name:</a></td>
  75. <td></td>
  76. <td><input type="text" name="name" value="" /></td>
  77. </tr>
  78. <tr><td>&nbsp;</td></tr>
  79. <tr>
  80. <td><a title="" class="tooltip" onmouseover="Tip('This email address will be used in case the Illarion staff needs to contact you. The address will be stored hidden for everyone except the staff.',TITLE,'Email address',WIDTH,-300);" onmouseout="UnTip();">Email address:</a></td>
  81. <td></td>
  82. <td><input type="text" name="email" id="email" value="" /> *</td>
  83. <td id="check_email" style="text-indent:15px;"></td>
  84. </tr>
  85. <tr><td>&nbsp;</td></tr>
  86. <tr>
  87. <td><a title="" class="tooltip" onmouseover="Tip('With this password you will be able to login at the homepage and into the game. The password contains at least 5 and at maximum 15 characters. There are no limits for the characters you can use. But its recommended to use capital and non-capital letters, as well as digits and special characters to make your password safe.',TITLE,'Password',WIDTH,-300);" onmouseout="UnTip();">Password:</a></td>
  88. <td></td>
  89. <td><input type="password" name="passwd" id="passwd" value="" /> *</td>
  90. </tr>
  91. <tr>
  92. <td><a title="" class="tooltip" onmouseover="Tip('Here you have to type in your password again, just to take care that you made no typing mistake.',TITLE,'Repeat password',WIDTH,-300);" onmouseout="UnTip();">Repeat password:</a></td>
  93. <td></td>
  94. <td><input type="password" name="passwd2" id="passwd2" value="" /> *</td>
  95. <td id="check_passwd" style="text-indent:15px;"></td>
  96. </tr>
  97. <tr><td>&nbsp;</td></tr>
  98. <tr>
  99. <td><a title="" class="tooltip" onmouseover="Tip('Here you can choose the language your account shall work with.',TITLE,'Language',WIDTH,-300);" onmouseout="UnTip();">Language:</a></td>
  100. <td></td>
  101. <td>
  102. <select name="language">
  103. <option value="0">german</option>
  104. <option value="1" selected="selected">english</option>
  105. </select>
  106. </td>
  107. <td></td>
  108. </tr>
  109. <tr><td>&nbsp;</td></tr>
  110. <tr>
  111. <td colspan="3" class="center"><input type="submit" value="Send registration" name="submit" id="submit" disabled="disabled" class="disabled" /></td>
  112. </tr>
  113. </table>
  114. </form>