Advertisement
Guest User

Untitled

a guest
Nov 8th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.44 KB | None | 0 0
  1. <!-- BEGIN AUTH LOGIN-->
  2. <h5 class="auth__title">Login Membro</h5>
  3. <form action="" id="loginform" class="auth__form js-login-form js-parsley">
  4. <div class="auth__row form-group">
  5. <label for="login-username-inline" class="auth__label control-label">Usuário</label>
  6. <input type="text" name="accountUser" id="login-username-inline" required data-parsley-trigger="keyup" data-parsley-minlength="6" data-parsley-validation-threshold="5" data-parsley-minlength-message="Login should be at least 6 chars" class="auth__in auth__in--text form-control">
  7. </div>
  8. <div class="auth__row auth__row--password form-group">
  9. <label for="login-password-inline" class="auth__label control-label">Senha</label>
  10. <input type="password" name="accountType" value="member" id="login-password-inline" required class="auth__in auth__in--text form-control">
  11. <input type="radio" name="member" class="userTab">Sou Usuário</a>
  12. <input type="radio" name="model" class="performerTab">Sou Modelo</a>
  13. </div>
  14. <div class="auth__row"><a href="user_restore_pass.html" class="auth__forgot">Perdi minha senha!</a>
  15. <button type="submit" id="btn" class="auth__in auth__in--submit">Entrar</button><span class="auth__remember">
  16. <input type="checkbox" id="remember-in-inline" class="in-checkbox">
  17. <label for="remember-in-inline" class="in-label">Lembrar-me</label></span>
  18. </div>
  19. <div class="auth__row"><span class="auth__links">Não tem usuário?<a href="registration/user.php">Crie uma conta</a></span></div>
  20. </form>
  21. <!-- end of block .auth__form-->
  22. <!-- END AUTH LOGIN-->
  23.  
  24.  
  25. <script>
  26. $( document ).ready(function() {
  27. $( "#btn" ).click(function() {
  28. $( "#loginform" ).submit();
  29. });
  30. $(document).keypress(function(e) {
  31. if(e.which == 13) {
  32. $( "#loginform" ).submit();
  33. }
  34. });
  35. });
  36.  
  37. </script>
  38.  
  39. <?php
  40. if ($model == '2' || $username=='1'){
  41. $TMenu .= '<li><a href="cp/chatusers/index.php">Minha Conta</a></li>
  42.  
  43. <li><a href="cp/chatusers/favorites.php">Favoritos</a></li>
  44.  
  45. <li><a href="cp/chatusers/updateprofile.php">Meu Perfil</a></li>
  46.  
  47. <li><a href="cp/chatusers/viewsessions.php">Hist&oacute;rico</a></li>
  48.  
  49. <li><a href="cp/chatusers/buyminutes.php">Dinheiro</a></li>
  50.  
  51. <li><a href="logout.php">Logout</a></li>';
  52. $TMenu .= '
  53. <li><a href="index.php">Minha Conta</a></li>
  54.  
  55. <li><a href="cp/chatmodels/broadcast.php">Transmiss&aatilde;o</a></li>
  56.  
  57. <li><a href="cp/chatmodels/updateprofile.php">Meu Perfil</a></li>
  58.  
  59. <li><a href="cp/chatmodels/showslist.php">Hist&oacute;rico</a></li>
  60.  
  61. <li><a href="cp/chatmodels/uploadpicture.php">Minhas Fotos</a></li>
  62.  
  63. <li><a href="cp/chatmodels/paymentop.php">Dinheiro</a></li>
  64.  
  65. <li><a href="logout.php">Logout</a></li> ';
  66. $TMenu .= 'Logue';
  67. }else{$TMenu = 'Logue';}
  68.  
  69. ?>
  70.  
  71. <?php
  72.  
  73. if(isset($_POST['accountUser']) && isset($_POST['accountPassword']))
  74.  
  75. {
  76. include("dbase.php");
  77. include("settings.php");
  78. if ($_POST['accountType']=="member")
  79. {
  80. $database="chatusers";
  81. } else if ($_POST['accountType']=="model")
  82. {
  83. $database="chatmodels";
  84. } else if ($_POST['accountType']=="studioop")
  85. {
  86. $database="chatoperators";
  87. }
  88. $userExists=false;
  89. $result = mysql_query("SELECT id,user,password,status,admin FROM $database WHERE status!='pending' AND status!='' ");
  90. while($row = mysql_fetch_array($result))
  91. {
  92. $tempUser=$row["user"];
  93. $tempPass=$row["password"];
  94. $tempId=$row["id"];
  95.  
  96. $isAdmin = $row["admin"];
  97. if ($_POST['accountUser']==$tempUser && md5($_POST['accountPassword'])==$tempPass)
  98. {
  99. if ($row["status"]=="blocked")
  100. {
  101. $userExists=true;
  102. $errorMsg="Conta bloqueada, entre em contato com o administrador para obter mais detalhes";
  103. } else {
  104. $userExists=true;
  105. $currentTime=time();
  106. mysql_query("UPDATE $database SET lastLogIn='$currentTime' WHERE id = '$tempId' LIMIT 1");
  107. setcookie("usertype", $database, time()+360000);
  108. setcookie("id", $tempId, time()+360000);
  109. if($isAdmin == 1){
  110. header("Location: index.php");
  111. }else{
  112. header("Location: cp/$database/");
  113. }
  114.  
  115. }
  116.  
  117. }
  118. }
  119. if (!$userExists){
  120. $errorMsg="Nome de usu&aacute;rio ou senha incorretos.";
  121. }
  122. } else if (isset($_GET['from']) && $_GET['from']=="recoverpass"){
  123. $errorMsg="Sua nova senha foi enviada para o seu endere&ccedil;o de e-mail";
  124. } else {
  125. $errorMsg="";
  126. }
  127. ?>
  128. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
  129. <script>
  130. $( document ).ready(function() {
  131. $( "#btn" ).click(function() {
  132. $( "#loginform" ).submit();
  133. });
  134. $(document).keypress(function(e) {
  135. if(e.which == 13) {
  136. $( "#loginform" ).submit();
  137. }
  138. });
  139. });
  140.  
  141. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement