Advertisement
Guest User

part.php

a guest
Dec 10th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.81 KB | None | 0 0
  1. <?php
  2.  
  3. function getsettings()
  4. {
  5.     $db = new DBDS(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
  6.     $query = $db->query("SELECT t1.value\n\t\t\t\t\t\tFROM `" . DB_PREFIX . "setting` t1\n\t\t\t\t\t\tWHERE t1.group = 'dsfirewall'\n\t\t\t\t\t\tAND t1.key = 'dsfirewall_module'\n\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t");
  7.  
  8.     if (isset($query->rows[0])) {
  9.         $setting_ = unserialize($query->row["value"]);
  10.     }
  11.  
  12.     if (isset($setting_[1])) {
  13.         $setting = $setting_[1];
  14.     }
  15.     else {
  16.         echo "</br></br><center><p>Module <b>DS firewall </b> - not installed  but still connected!</p>";
  17.         echo "</br></br><center><p>Module <b>DS firewall </b> - not installed  but still connected!</p><p>Please comment out or remove the line in <b>.htaccess</b> or in <b>PHP.INI</b>  code:</p><p>Модуль<b>DS firewall</b> - не установлен но подключен!</p><p>Пожалуйста закомментируйте или удалите строки в файле <b>.htaccess</b> или в <b>PHP.INI</b> код:</p> </br>
  18.                    
  19.                     <p>##DS Firewall##</p>
  20.                     <p>php_value auto_prepend_file .....</p>
  21.                     <p>##DS Firewall##</p></center>
  22.                     ";
  23.         return "exit";
  24.     }
  25.  
  26.     return $setting;
  27. }
  28.  
  29. function setlog($type, $ip, $log)
  30. {
  31.     $db = new DBDS(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
  32.     $query = $db->query("INSERT IGNORE INTO `" . DB_PREFIX . "ds_firewire_incidents_log` (`idsecurity`,`ip`,`security_info`)\n\t\t\t\t\t\t\t\t\t\t VALUES (" . $type . ",'$ip','$log')");
  33. }
  34.  
  35. function firewall_unset_globals()
  36. {
  37.     if (ini_get("register_globals")) {
  38.         $allow = array("_ENV" => 1, "_GET" => 1, "_POST" => 1, "_COOKIE" => 1, "_FILES" => 1, "_SERVER" => 1, "_REQUEST" => 1, "GLOBALS" => 1);
  39.  
  40.         foreach ($GLOBALS as $key => $value ) {
  41.             if (!isset($allow[$key])) {
  42.                 unset($GLOBALS[$key]);
  43.             }
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement