Advertisement
AtlantoDM

PHP

Nov 5th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.26 KB | None | 0 0
  1. <?php
  2. require_once('./inc/hotel_core.php');
  3.  
  4.  
  5. session_start();
  6.  
  7. if(isset($_get['registercancel']) && filtertext($_get['registercancel'] == "true")){
  8. session_unset();
  9. }
  10.  
  11. if(!session_is_registered(username)){
  12.  
  13. if(isset($_post['username']) && isset($_post['password'])){
  14. $username = filtertext($_post['username']);
  15. $password = holohash($_post['password'], $username);
  16. $password2 = holohashmd5($_post['password'], $username);
  17.  
  18. if(empty($username) || empty($_post['password'])){
  19. $login_error = "<center>usuário/senha incorretos!</center>";
  20. } else {
  21. $sql = mysql_query("select id from users where username = '".$username."' and password = '".$password."' or username = '".$username."' and password = '".$password2."' limit 1") or die(mysql_error());
  22. if(mysql_num_rows($sql) < 1){
  23. $login_error = "usuário/senha incorretos!";
  24. } else {
  25. $userdata = mysql_fetch_assoc($sql);
  26. $userid = $userdata['id'];
  27. if(mysql_num_rows($ban) < 1){
  28.  
  29. mysql_query("update users set password = '".$password2."', ip_last = '".$remote_ip."' where username = '".$username."'");
  30.  
  31. $_session['username'] = $username;
  32. $_session['password'] = $password2;
  33. if ($_post['_login_remember_me'] == "true"){
  34. setcookie("remember", "remember", time()+60*60*24*100, "/");
  35. setcookie("rusername", $_session['username'], time()+60*60*24*100, "/");
  36. setcookie("rpassword", $_session['password'], time()+60*60*24*100, "/");
  37. }
  38. header("location: $path/me"); exit;
  39. } else {
  40. $bandata = mysql_fetch_assoc($ban);
  41. $timestamp = time();
  42. if($bandata['expire'] > $timestamp){
  43. $login_error = "você foi banido por: \"" . $bandata['reason'] . "\" e acaba em: " . date('d/m/y - h:i:s', $bandata['expire']) . ".";
  44. } else {
  45. mysql_query("delete from bans where value = '".$username."' and bantype = 'user' or value = '".$remote_ip."' and bantype = 'ip' limit 1") or die(mysql_error());
  46. mysql_query("update users set password = '".$password2."', ip_last = '".$remote_ip."' where username = '".$username."'");
  47.  
  48. $_session['username'] = $username;
  49. $_session['password'] = $password2;
  50. if ($_post['_login_remember_me'] == "true"){
  51. setcookie("remember", "remember", time()+60*60*24*100, "/");
  52. setcookie("rusername", $_session['username'], time()+60*60*24*100, "/");
  53. setcookie("rpassword", $_session['password'], time()+60*60*24*100, "/");
  54. }
  55. header("location: $path/me"); exit;
  56. }
  57. }
  58. }
  59. }
  60. }
  61.  
  62.  
  63.  
  64. $body_id = "index";
  65.  
  66.  
  67. ?>
  68. <!doctype html>
  69. <!--================================================================================
  70. fwk - content management system
  71. versão: 0.6.89a - versão privada
  72. autor: matheus silva
  73. web-site: www.wamper.top/fwk
  74. ================================================================================ -->
  75. <html lang="en">
  76. <head><meta http-equiv="content-type" content="text/html; charset=windows-1252">
  77. <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1">
  78. <title><?php echo $shortname; ?>: seu novo mundo de pixels!</title>
  79. <link href="http://bootswatch.com/lumen/bootstrap.min.css" rel="stylesheet" type="text/css" />
  80. <link href="http://bootswatch.com/lumen/bootstrap.css" rel="stylesheet" type="text/css" />
  81.  
  82. <link href="../css/_style.css?4" rel="stylesheet" type="text/css" />
  83. <body>
  84. <style>
  85. .putaria {
  86. color: #fff;
  87. font-family: segoe ui;
  88. font-weight: 300;
  89. margin-top: 200px;
  90. }
  91. body {
  92. background: url("../_images/bg-left.png") bottom left, url("../_images/bg-right.png") bottom right, -webkit-linear-gradient(#2b8ae8, #1831cf);
  93. background: url("../_images/bg-left.png") bottom left, url("../_images/bg-right.png") bottom right, -o-linear-gradient(#2b8ae8, #1831cf);
  94. background: url("../_images/bg-left.png") bottom left, url("../_images/bg-right.png") bottom right, -moz-linear-gradient(#2b8ae8, #1831cf);
  95. background: url("../_images/bg-left.png") bottom left, url("../_images/bg-right.png") bottom right, linear-gradient(#2b8ae8, #1831cf);
  96. background-repeat: no-repeat;
  97. background-attachment: fixed;
  98. color: #fff;
  99. }
  100. .text-shadow {
  101. text-shadow: 0 3px rgba(0, 0, 0, 0.1);
  102. }
  103. </style>
  104. <body>
  105. <div class="container" style="width: 1100px!important;margin-top:10px;">
  106. <div class="logo-texto" style=" margin-left: 0px;"><?php echo $shortname; ?></div>
  107. <div id="navbar" class="navbar-collapse collapse" style="margin-top:5px">
  108.  
  109. <form name="logindd" id="logindd" role="form" action="<?php echo $path; ?>" method="post" class="navbar-form navbar-right">
  110. <div class="form-group">
  111. <input type="text" placeholder="usuário" class="form-control" name="username" id="credentials-email" value="">
  112. </div>
  113. <div class="form-group">
  114. <input type="password" placeholder="senha" class="form-control" name="password" id="credentials-password">
  115. </div>
  116. <button type="submit" name="submit" class="btn btn-default" style="margin-left: 0px;">login</button>
  117. <a href="/registro" class="btn btn-warning">registro</a></form>
  118. <?php if(isset($login_error)){ ?>
  119. <div class="row">
  120.  
  121. <div class="col-md-7" style="float:right" >
  122. <div class="alert alert-dismissible alert-danger">
  123. <button type="button" class="close" data-dismiss="alert">&times;</button>
  124. usuário ou senha incorretos, tente novamente! =(
  125. </div></div></div>
  126. <?php } ?>
  127. </div>
  128. <div class="putaria"><div class="row">
  129. <div class="col-md-9">
  130. <h1 style="color:#fff; margin: 10px 0;" class="text-shadow">crie sua conta, jogue e divirta-se!</h1>
  131. <h2 style="color:#fff; margin: 10px 0;" class="text-shadow">bem-vind@s ao <?php echo $shortname; ?> </h2>
  132. <p class="lead text-shadow" style="color:#fff;">o <?php echo $shortname; ?> hotel é um mundo virtual para jogadores maiores de 8
  133. anos, onde você pode criar seu próprio personagem e projetar seu
  134. quarto do jeito que quiser. você poderá conhecer novos amigos, organizar
  135. festas, cuidar de mascotes virtuais, jogar e criar seus próprios
  136. jogos e completar tarefas.</p></div>
  137. <div class="col-md-3">
  138. <img src="../_images/creditsindex.gif" />
  139. </div>
  140.  
  141.  
  142.  
  143. <?php
  144.  
  145.  
  146. } else {
  147. header("location:me.php");
  148. }
  149.  
  150. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement