Advertisement
Guest User

choose_name.php

a guest
Apr 15th, 2017
125
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. #|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
  3. #| #|
  4. #| Développement de RetroPHP par Tyler #|
  5. #| #|
  6. #|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
  7.  
  8. include '../init.php';
  9.  
  10. $pageid = "renamed";
  11. $Auth::Session_Disconnected($_SESSION);
  12.  
  13. $pagename = "Choisir un pseudo";
  14.  
  15. if($rtp_user['renamed'] == 1) {
  16. Redirect(URL."/client");
  17. }
  18.  
  19. if(isset($_POST['username']))
  20. {
  21. $username = safe($_POST['username'],'SQL');
  22. $filter = preg_replace("/[^a-z\d'\-=\?!@:\.]/i", "", $username);
  23. $tmp_sql = $bdd->query("SELECT id FROM users WHERE username = '".safe($username,'SQL')."' LIMIT 1");
  24. $tmp = $tmp_sql->rowCount();
  25. if(isset($username)) {
  26. $failure = false;
  27.  
  28. if(strlen($username) < 3){
  29. $message1['username'] = "Votre pseudo est trop court.";
  30. $failure = true;
  31. } elseif(strlen($username) > 15){
  32. $message1['username'] = "Votre pseudo est trop long.";
  33. $failure = true;
  34. } elseif($filter !== $username){
  35. $message1['username'] = "Votre Pseudo contient des carractères non-autorisé.";
  36. $failure = true;
  37. } elseif($tmp > 0){
  38. $message1['username'] = "Ce Pseudo existe déjà.";
  39. $failure = true;
  40. }
  41. if(str_contains($username, 'mod-') || str_contains($username, 'vip-') || str_contains($username, 'adm-') || str_contains($username, 'admin-') || str_contains($username, 'smod-') || str_contains($username, 'mod-') || str_contains($username, 'vip-') || str_contains($username, 'adm-') || str_contains($username, 'admin-') || str_contains($username, 'sadm-')){
  42. $message1['username'] = "Votre Pseudo contient des mots interdit.";
  43. $failure = true;
  44. }
  45. if($username == "mod" || $username == "admin" || $username == "founder" || $username == "smod" || $username == "sadmin" || $username == "Mod" || $username == "Admin" || $username == "Founder" || $username == "Smod" || $username == "Sadmin"){
  46. $message1['username'] = "Votre Pseudo contient des mots interdit.";
  47. $failure = true;
  48. }
  49. if($failure == false){
  50. $bdd->exec("UPDATE retrophp_users SET renamed = '1' WHERE uid = '".safe($User->id,'SQL')."'");
  51. $bdd->exec("UPDATE users SET username = '".safe($username,'SQL')."' WHERE id = '".safe($User->id,'SQL')."'");
  52. $_SESSION['username'] = $username;
  53. Redirect(URL."/client");
  54. }
  55. }
  56. }
  57.  
  58. preg_match('#^((.|\s)+)@#', $User->mail, $pseudo);
  59. ?>
  60. <html>
  61. <head>
  62. <meta charset="utf-8">
  63. <title><?php echo Settings('Name'); ?>: <?php echo $pagename; ?> </title>
  64. <link type="text/css" rel="stylesheet" href="<?php echo URL; ?>/web-gallery/v5/css/habbo.out.css?<?PHP echo UPDATE; ?>">
  65. <link rel="shortcut icon" href="<?php echo URL; ?>/web-gallery/v2/favicon.ico?<?PHP echo UPDATE; ?>" type="image/vnd.microsoft.icon" />
  66. <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  67.  
  68. </head>
  69. <body>
  70. <SCRIPT LANGUAGE="JavaScript">
  71. <!--
  72. var today=new Date();
  73. var heure="";
  74. function messagevariable() {
  75. var time=today.getHours();
  76. heure=""
  77. if(time>=6 && time<8)
  78. heure="<div id=\"habbo-hotel-image\">"
  79. if(time>=8 && time<18)
  80. heure="<div id=\"habbo-hotel-image\">"
  81. if(time>=18 || time<6)
  82. heure="<div id=\"habbo-hotel-night\">"
  83. }
  84. // --></SCRIPT>
  85. <SCRIPT LANGUAGE="JavaScript">
  86. <!--
  87. messagevariable();
  88. document.writeln(heure)
  89. // -->
  90. </SCRIPT>
  91. </div>
  92. <form id="login" method="post">
  93. <div class="logo">
  94. </div>
  95. <div class="section">
  96. <span class="title">Pseudo</span>
  97. <p>
  98. Tu peux utiliser des chiffres, des lettres, et les caract&egrave;res - _ .
  99. </p>
  100. <?PHP if(isset($message1)) { ?>
  101. <div class="message error">
  102. <?PHP if(isset($message1['username'])) { echo $message1['username']; } ?>
  103. </div>
  104. <?php } ?>
  105. <input type="text" name="username" id="username" placeholder="Pseudo" <?php if($rtp_user['facebook'] == 1) { ?>value="<?php echo $User->username; ?>"<?php } ?> <?php if($rtp_user['facebook'] == 0) { ?>value="<?php echo nl2br($pseudo[1]); ?>"<?php } ?>>
  106. </div>
  107. <a onclick="location.href='<?php echo URL; ?>/account/logout';" class="btn red">Annuler mon inscription</a>
  108. <button type="submit" class="btn green" style="outline: none;">Suivant</button>
  109. </form>
  110. </body>
  111. </html>
Advertisement
RAW Paste Data Copied
Advertisement