Advertisement
Guest User

Untitled

a guest
Sep 1st, 2017
339
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. if( isset($_GET["noscript"]) )
  3. {
  4.     $_SESSION["lk"] = "";
  5.     showmessage("<div style=\"border: 3px solid red; text-align: center; font-size: 18px; font-weight: bold; padding: 10px; width: 600px; height: 65px; margin: 100px auto; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; line-height: 1.7;\">Your Browser does not support JavaScript, or it is disabled.<br/>To run this application, you must enable JavaScript!!</div>");
  6. }
  7.  
  8. aaaaov();
  9. $viaPost = (strtoupper($_SERVER["REQUEST_METHOD"]) == "POST" ? 1 : 0);
  10. $isAjax = (isset($_POST["isAjax"]) ? 1 : 0);
  11. $stepCount = (isset($_POST["stepCount"]) ? intval($_POST["stepCount"]) : 1);
  12. $submitForm = (isset($_POST["submitForm"]) && $_POST["submitForm"] == "yes" ? 1 : 0);
  13. $doAction = (isset($_POST["doAction"]) ? trim($_POST["doAction"]) : "");
  14. $ERROR = "";
  15. $TSUE = array(  );
  16. aaaaow();
  17. if( $isAjax && $viaPost )
  18. {
  19.     if( $doAction == "requirementsCheck" )
  20.     {
  21.         clearstatcache();
  22.         if( file_exists(DATAPATH . "cache/install.lock") )
  23.         {
  24.             aaaaox("This installation has been locked. Please read <a href=\"http://templateshares-ue.net/customers/faq/\" target=\"_blank\">this</a>.");
  25.         }
  26.  
  27.         if( !file_exists(LIBRARYPATH . "config/database_config.php") )
  28.         {
  29.             aaaaox("Database configuration file does not exists. Please follow <a href=\"http://templateshares-ue.net/customers/manual/installation/\" target=\"_blank\">this</a> steps.");
  30.         }
  31.  
  32.         $errors = array(  );
  33.         if( !session_id() )
  34.         {
  35.             $errors["session"] = "PHP Session support does not exists. Please ask your host to enable this feature.";
  36.         }
  37.  
  38.         $phpVersion = phpversion();
  39.         if( version_compare($phpVersion, "5.2.0", "<") )
  40.         {
  41.             $errors["phpVersion"] = "PHP 5.2.0 or newer is required. " . $phpVersion . " does not meet this requirement. Please ask your host to upgrade PHP.";
  42.         }
  43.  
  44.         if( @ini_get("safe_mode") == 1 || strtolower(@ini_get("safe_mode")) == "on" )
  45.         {
  46.             $errors["safe_mode"] = "PHP must not be running in safe_mode. Please ask your host to disable the PHP safe_mode setting.";
  47.         }
  48.  
  49.         if( !ini_get("allow_url_fopen") || strtolower(ini_get("allow_url_fopen")) == "off" )
  50.         {
  51.             $errors["allow_url_fopen"] = "The PHP allow_url_fopen setting is disabled. Please ask your host to enable the PHP allow_url_fopen setting.";
  52.         }
  53.  
  54.         if( !function_exists("curl_init") || function_exists("curl_init") && !($ch = curl_init()) )
  55.         {
  56.             $errors["curl"] = "The required PHP library CURL could not be found. Please ask your host to install this library.";
  57.         }
  58.  
  59.         if( !function_exists("mysqli_connect") )
  60.         {
  61.             $errors["mysqlPhp"] = "The required PHP extension MySQLi could not be found. Please ask your host to install this extension.";
  62.         }
  63.         else
  64.         {
  65.             $TSUE["TSUE_Database"] = new TSUE_Database(false);
  66.             if( $TSUE["TSUE_Database"]->error )
  67.             {
  68.                 $errors["mysqlPhp"] = "Database Connection Failed! Please follow <a href=\"http://templateshares-ue.net/customers/manual/installation/\" target=\"_blank\">this</a> steps.";
  69.             }
  70.  
  71.         }
  72.  
  73.         if( !function_exists("preg_replace") )
  74.         {
  75.             $errors["pcre"] = "The required PHP extension PCRE could not be found. Please ask your host to install this extension.";
  76.         }
  77.  
  78.         if( function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc() )
  79.         {
  80.             $errors["get_magic_quotes_gpc"] = "Warning: Magic Quotes GPC is enabled.";
  81.         }
  82.  
  83.         if( function_exists("get_magic_quotes_runtime") && get_magic_quotes_runtime() )
  84.         {
  85.             $errors["get_magic_quotes_runtime"] = "Warning: Magic Quotes Runtime is enabled.";
  86.         }
  87.  
  88.         if( !function_exists("gd_info") )
  89.         {
  90.             $errors["gd"] = "The required PHP extension GD could not be found. Please ask your host to install this extension.";
  91.         }
  92.         else
  93.         {
  94.             if( !function_exists("imagecreatefromjpeg") )
  95.             {
  96.                 $errors["gdJpeg"] = "The required PHP extension GD was found, but JPEG support is missing. Please ask your host to add support for JPEG images.";
  97.             }
  98.             else
  99.             {
  100.                 if( !function_exists("imagecreatefromgif") )
  101.                 {
  102.                     $errors["gdJpeg"] = "The required PHP extension GD was found, but GIF support is missing. Please ask your host to add support for GIF images.";
  103.                 }
  104.                 else
  105.                 {
  106.                     if( !function_exists("imagecreatefrompng") )
  107.                     {
  108.                         $errors["gdJpeg"] = "The required PHP extension GD was found, but PNG support is missing. Please ask your host to add support for PNG images.";
  109.                     }
  110.  
  111.                 }
  112.  
  113.             }
  114.  
  115.         }
  116.  
  117.         if( !function_exists("json_encode") )
  118.         {
  119.             $errors["json"] = "The required PHP extension JSON could not be found. Please ask your host to install this extension.";
  120.         }
  121.  
  122.         if( !function_exists("mb_check_encoding") )
  123.         {
  124.             $errors["mb_check_encoding"] = "The required PHP extension mb_check_encoding could not be found. Please ask your host to install this extension.";
  125.         }
  126.  
  127.         if( !class_exists("DOMDocument") || !class_exists("SimpleXMLElement") )
  128.         {
  129.             $errors["xml"] = "The required PHP extensions for XML handling (DOM and SimpleXML) could not be found. Please ask your host to install this extension.";
  130.         }
  131.  
  132.         if( $errors )
  133.         {
  134.             $errorList = "";
  135.             foreach( $errors as $error )
  136.             {
  137.                 $errorList .= "<li>" . $error . "</li>";
  138.             }
  139.             $Result = "\r\n\t\t\t<div class=\"failure\">\r\n\t\t\t\t<h2>\r\n\t\t\t\t\t<span style=\"float: right; font-weight: normal; font-size: 11px; color: #999; margin-top: -30px; margin-right: -5px;\">DB: " . MYSQL_DB . "</span>\r\n\t\t\t\t\tRequirements Not Met\r\n\t\t\t\t</h2>\r\n\t\t\t\t<p>The following TSUE requirements were not met. Please contact your host for help.</p>\r\n\t\t\t\t<ol>\r\n\t\t\t\t\t" . $errorList . "\r\n\t\t\t\t</ol>\r\n\t\t\t\t<p class=\"mysql\">\r\n\t\t\t\t\tCan't install yourself? Please purchase a professional installation at: <a href=\"http://templateshares-ue.net/customers/services/\">http://templateshares-ue.net/customers/services/</a>\r\n\t\t\t\t</p>\r\n\t\t\t</div>";
  140.         }
  141.         else
  142.         {
  143.             $LADivHeight = 250;
  144.             $licenseAgreement = @file_get_contents("http://templateshares-ue.net/licenseAgreement.html");
  145.             if( !$licenseAgreement )
  146.             {
  147.                 $LADivHeight = 50;
  148.                 $licenseAgreement = "Unable to fetch TSUE License Agreement. Please click <a href=\"http://templateshares-ue.net/licenseAgreement.html\" target=\"_blank\">here</a> to view HTML version.";
  149.             }
  150.  
  151.             $Result = "\r\n\t\t\t<div class=\"success\" id=\"requirementsMet\">\r\n\t\t\t\t<h2>\r\n\t\t\t\t\t<span style=\"float: right; font-weight: normal; font-size: 11px; color: #999; margin-top: -30px; margin-right: -5px;\">DB: " . MYSQL_DB . "</span>\r\n\t\t\t\t\tRequirements Met\r\n\t\t\t\t</h2>\r\n\t\t\t\t<p>Your server meets all of TSUE requirements and you are now ready to begin installation.</p>\r\n\t\t\t\t<p class=\"mysql\">TSUE also requires MySQL 5.0 or newer. Please manually check that you meet this requirement.</p>\r\n\t\t\t</div>\r\n\t\t\t\r\n\t\t\t<div class=\"success\" id=\"licenseAgreement\">\r\n\t\t\t\t<div style=\"padding: 5px; margin: 5px; border: 1px solid #ccc; height: " . $LADivHeight . "px; overflow: auto; font-size: 11px;\">\r\n\t\t\t\t\t<h1>License Agreement</h1>\r\n\t\t\t\t\t" . $licenseAgreement . "\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
  152.         }
  153.  
  154.         showmessage($Result);
  155.     }
  156.  
  157.     if( $stepCount )
  158.     {
  159.         switch( $stepCount )
  160.         {
  161.             case 1:
  162.                 $TSUESystemDirectories = aaaaoy();
  163.                 $searchDirectories = aaaaoz(DATAPATH);
  164.                 if( count($searchDirectories) < 7 )
  165.                 {
  166.                     showerror("Required TSUE system directory does not exists in " . DATAPATH);
  167.                 }
  168.  
  169.                 foreach( $TSUESystemDirectories as $TSUESystemDirectory )
  170.                 {
  171.                     if( !checkdirectorypermissions(DATAPATH . $TSUESystemDirectory) )
  172.                     {
  173.                         showerror("The following TSUE System directory is not writable: " . DATAPATH . $TSUESystemDirectory);
  174.                     }
  175.  
  176.                 }
  177.                 showmessage("Directory Permissions has been checked & confirmed. Database connection is being checked...");
  178.                 break;
  179.             case 2:
  180.                 $TSUE["TSUE_Database"] = new TSUE_Database();
  181.                 showmessage("Database Connection has been confirmed. MySQL Tables are being created, please be patient during this procedure...");
  182.                 break;
  183.             case 3:
  184.                 $TSUE["TSUE_Database"] = new TSUE_Database();
  185.                 $sqlContents = aaaapa(2);
  186.                 if( !$sqlContents )
  187.                 {
  188.                     showerror("Could not get SQL commands.");
  189.                 }
  190.  
  191.                 $sqlCommands = explode("[TSUE_INSTALL_QUERY]", $sqlContents);
  192.                 foreach( $sqlCommands as $sqlCommand )
  193.                 {
  194.                     $sqlCommand = trim($sqlCommand);
  195.                     if( $sqlCommand )
  196.                     {
  197.                         $TSUE["TSUE_Database"]->query($sqlCommand);
  198.                     }
  199.  
  200.                 }
  201.                 showmessage("MySQL Tables has been created & confirmed. Basic settings are being configured...");
  202.                 break;
  203.             case 4:
  204.                 if( $viaPost && $submitForm )
  205.                 {
  206.                     $TSUE["TSUE_Database"] = new TSUE_Database();
  207.                     $TSUE["TSUE_Settings"] = new TSUE_Settings();
  208.                     if( !$TSUE["TSUE_Settings"]->settings["global_settings"] )
  209.                     {
  210.                         aaaaox("Unable to read Global Settings.");
  211.                     }
  212.  
  213.                     $Settings = array(  );
  214.                     $Settings["website_url"] = getpostvar("website_url");
  215.                     $Settings["website_title"] = getpostvar("website_title");
  216.                     $Settings["website_description"] = getpostvar("website_description");
  217.                     $Settings["website_email"] = getpostvar("website_email");
  218.                     $Settings["website_sendmail_from"] = getpostvar("website_sendmail_from");
  219.                     foreach( $Settings as $settingName => $settingValue )
  220.                     {
  221.                         $settingValue = trim($settingValue);
  222.                         if( !$settingValue )
  223.                         {
  224.                             aaaaox("Required fields can not be empty!");
  225.                         }
  226.  
  227.                         if( !isset($TSUE["TSUE_Settings"]->settings["global_settings"][$settingName]) )
  228.                         {
  229.                             aaaaox("Invalid Setting: " . $settingName);
  230.                         }
  231.  
  232.                         $TSUE["TSUE_Settings"]->settings["global_settings"][$settingName] = trim($settingValue);
  233.                     }
  234.                     $TSUE["TSUE_Settings"]->settings["global_settings"]["announce_url"] = $Settings["website_url"] . "/announce.php";
  235.                     updatesettings("global_settings", $TSUE["TSUE_Settings"]->settings["global_settings"]);
  236.                     showmessage("Basic settings has been configured. Administrator account is being created...");
  237.                 }
  238.  
  239.                 showdialog($ERROR . "\r\n\t\t\t\t<form method=\"post\" id=\"dialogForm\" action=\"\">\r\n\t\t\t\t<input type=\"hidden\" name=\"isAjax\" value=\"1\" />\r\n\t\t\t\t<input type=\"hidden\" name=\"stepCount\" value=\"" . $stepCount . "\" />\r\n\t\t\t\t<input type=\"hidden\" name=\"submitForm\" value=\"yes\" />\r\n\t\t\t\t<div id=\"formDIV\">\r\n\t\t\t\t\t<h1>Setup Basic Settings</h1>\r\n\t\t\t\t\t<div class=\"text\">Website URL: " . showhint("The primary URL to your website. Do not include a trailing '/' or 'index.php'. The URL should look similar to this: " . TSUE_FRONT_URL) . "</div>\r\n\t\t\t\t\t<div class=\"input\"><input type=\"text\" name=\"website_url\" class=\"inputbox\" value=\"" . TSUE_FRONT_URL . "\" /></div>\r\n\r\n\t\t\t\t\t<div class=\"text\">Website Title: " . showhint("The title of your website. This will be displayed at the top of pages and used in emails.") . "</div>\r\n\t\t\t\t\t<div class=\"input\"><input type=\"text\" name=\"website_title\" class=\"inputbox\" value=\"\" /></div>\r\n\r\n\t\t\t\t\t<div class=\"text\">Website Meta Description: " . showhint("Enter a description for your website. This will be placed inside the meta description tag for the website home page, so avoid using HTML.") . "</div>\r\n\t\t\t\t\t<div class=\"input\"><input type=\"text\" name=\"website_description\" class=\"inputbox\" value=\"\" /></div>\r\n\r\n\t\t\t\t\t<div class=\"text\">Contact Email Address: " . showhint("Email address where website-related messages will be sent.") . "</div>\r\n\t\t\t\t\t<div class=\"input\"><input type=\"text\" name=\"website_email\" class=\"inputbox\" value=\"contact@" . _HTTP_HOST . "\" /></div>\r\n\r\n\t\t\t\t\t<div class=\"text\">Default Email Address: " . showhint("This is the default email address that emails will be sent from.") . "</div>\r\n\t\t\t\t\t<div class=\"input\"><input type=\"text\" name=\"website_sendmail_from\" class=\"inputbox\" value=\"noreply@" . _HTTP_HOST . "\" /></div>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<div class=\"buttons\">\r\n\t\t\t\t\t\t<input type=\"submit\" value=\"save settings\" class=\"submit\" /> \r\n\t\t\t\t\t\t<input type=\"reset\" value=\"reset\" class=\"submit\" />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t</form>");
  240.                 break;
  241.             case 5:
  242.                 if( $viaPost && $submitForm )
  243.                 {
  244.                     $Account = array(  );
  245.                     $Account["membername"] = getpostvar("membername");
  246.                     $Account["password"] = getpostvar("password");
  247.                     $Account["email"] = getpostvar("email");
  248.                     $BuildQuery = array(  );
  249.                     foreach( $Account as $Name => $Value )
  250.                     {
  251.                         $Value = trim($Value);
  252.                         if( !$Value )
  253.                         {
  254.                             aaaaox("Required fields can not be empty!");
  255.                         }
  256.  
  257.                         $BuildQuery[$Name] = ($Name == "password" ? md5($Value) : $Value);
  258.                     }
  259.                     $passkey = generatepasskey();
  260.                     $BuildQuery["password_date"] = TIMENOW;
  261.                     $BuildQuery["memberid"] = 1;
  262.                     $BuildQuery["membergroupid"] = 7;
  263.                     $BuildQuery["passkey"] = $passkey;
  264.                     $BuildQuery["themeid"] = 1;
  265.                     $BuildQuery["languageid"] = 1;
  266.                     $BuildQuery["joindate"] = TIMENOW;
  267.                     $BuildQuery["lastactivity"] = TIMENOW;
  268.                     $BuildQuery["timezone"] = "1";
  269.                     $TSUE["TSUE_Database"] = new TSUE_Database();
  270.                     $TSUE["TSUE_Database"]->insert("tsue_members", $BuildQuery);
  271.                     $memberid = $TSUE["TSUE_Database"]->insert_id();
  272.                     if( !$memberid )
  273.                     {
  274.                         aaaaox("Database Error.");
  275.                     }
  276.  
  277.                     $staffCPAvailableActions = aaaapb();
  278.                     $TSUE["TSUE_Database"]->replace("tsue_staffcp_permissions", array( "memberid" => $memberid, "permissions" => serialize($staffCPAvailableActions) ));
  279.                     $BuildQuery = array( "memberid" => $memberid );
  280.                     $TSUE["TSUE_Database"]->replace("tsue_member_privacy", $BuildQuery);
  281.                     $BuildQuery = array( "memberid" => $memberid, "signature" => "", "custom_title" => "", "uploaded" => 0, "downloaded" => 0, "total_posts" => 1, "invites_left" => 10, "points" => 1000, "torrent_pass" => substr($passkey, 0, 32) );
  282.                     $TSUE["TSUE_Database"]->replace("tsue_member_profile", $BuildQuery);
  283.                     $TSUE["TSUE_Database"]->update("tsue_cron", array( "nextrun" => TIMENOW ));
  284.                     showmessage("Administrator account has been created. Setting up TSUE for first use...");
  285.                 }
  286.  
  287.                 showdialog($ERROR . "\r\n\t\t\t\t<form method=\"post\" id=\"dialogForm\" action=\"\">\r\n\t\t\t\t<input type=\"hidden\" name=\"isAjax\" value=\"1\" />\r\n\t\t\t\t<input type=\"hidden\" name=\"stepCount\" value=\"" . $stepCount . "\" />\r\n\t\t\t\t<input type=\"hidden\" name=\"submitForm\" value=\"yes\" />\r\n\t\t\t\t<div id=\"formDIV\">\r\n\t\t\t\t\t<h1>Create Administrator Account</h1>\r\n\t\t\t\t\t<div class=\"text\">Membername:</div>\r\n\t\t\t\t\t<div class=\"input\"><input type=\"text\" name=\"membername\" class=\"inputbox\" value=\"\" /></div>\r\n\r\n\t\t\t\t\t<div class=\"text\">Password:</div>\r\n\t\t\t\t\t<div class=\"input\"><input type=\"password\" name=\"password\" class=\"inputbox\" value=\"\" /></div>\r\n\r\n\t\t\t\t\t<div class=\"text\">Email:</div>\r\n\t\t\t\t\t<div class=\"input\"><input type=\"text\" name=\"email\" class=\"inputbox\" value=\"\" /></div>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<div class=\"buttons\">\r\n\t\t\t\t\t\t<input type=\"submit\" value=\"save settings\" class=\"submit\" /> \r\n\t\t\t\t\t\t<input type=\"reset\" value=\"reset\" class=\"submit\" />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t</form>");
  288.                 break;
  289.             case 6:
  290.                 $TSUE["TSUE_Database"] = new TSUE_Database();
  291.                 $TSUE["TSUE_Settings"] = new TSUE_Settings();
  292.                 handleprune();
  293.                 handlerebuildcaches();
  294.                 showmessage("Finishing Installation...");
  295.                 break;
  296.             case 7:
  297.                 file_put_contents(DATAPATH . "cache/install.lock", TIMENOW);
  298.                 showmessage("\r\n\t\t\t\t<div id=\"installationComplete\">\r\n\t\t\t\t\t<div class=\"success\"><h2>Installation Complete</h2></div>\r\n\t\t\t\t\t<b>Here's what you should do next:</b>\r\n\t\t\t\t\t<br />\r\n\t\t\t\t\t<ol>\r\n\t\t\t\t\t\t<li>\r\n\t\t\t\t\t\t\tDelete the Install Folder<br />\r\n\t\t\t\t\t\t\tYou should now delete the install directory from your web server.<br />\r\n\t\t\t\t\t\t\t<span class=\"mysql\">For security reasons, this script has been locked.</span>\r\n\t\t\t\t\t\t</li>\r\n\r\n\t\t\t\t\t\t<li>\r\n\t\t\t\t\t\t\tConfigure TSUE<br />\r\n\t\t\t\t\t\t\tNow it's time to configure your TSUE installation.<br />\r\n\t\t\t\t\t\t\tClick <a href=\"" . TSUE_FRONT_URL . "/admincp/\">here</a> to go to the admin area now.\r\n\t\t\t\t\t\t</li>\r\n\t\t\t\t\t</ol>\r\n\r\n\t\t\t\t\t<div class=\"thankYou\">\r\n\t\t\t\t\t\tThank you for choosing TSUE!<br />\r\n\t\t\t\t\t\twww.templateshares-ue.net\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t");
  299.                 break;
  300.             default:
  301.                 exit();
  302.         }
  303.     }
  304.  
  305. }
  306.  
  307. printoutput("\r\n\t<div id=\"welcomeScreen\">\r\n\t\t<img src=\"./images/ajax-loader.gif\" id=\"loader\" alt=\"\" title=\"\" border=\"0\" /> Please wait... Checking TSUE System Requirements...\r\n\t</div>\r\n\t<div id=\"beginInstall\">\r\n\t\t<div id=\"progressbar\"><div id=\"progress\"></div></div>\r\n\t\t<div id=\"buttons\">\r\n\t\t\t<input type=\"button\" name=\"start\" id=\"start\" class=\"submit\" value=\"If you Read & Agree TSUE License Agreement above, please click here to Begin Installation.\" />\r\n\t\t\t<input type=\"button\" name=\"reload\" id=\"reload\" class=\"submit\" value=\"Reload!\" />\r\n\t\t</div>\r\n\t\t<div id=\"result\"></div>\r\n\t</div>\r\n", true);
  308.  
  309. class TSUE_Settings
  310. {
  311.     public $settings = array(  );
  312.  
  313.     public function TSUE_Settings()
  314.     {
  315.         global $TSUE;
  316.         $fetchSettings = $TSUE["TSUE_Database"]->query("SELECT settingname, settingvalues FROM tsue_settings ORDER BY settingname");
  317.         if( $TSUE["TSUE_Database"]->num_rows($fetchSettings) )
  318.         {
  319.             while( $Setting = $TSUE["TSUE_Database"]->fetch_assoc($fetchSettings) )
  320.             {
  321.                 $this->settings[$Setting["settingname"]] = unserialize($Setting["settingvalues"]);
  322.             }
  323.         }
  324.  
  325.     }
  326.  
  327. }
  328.  
  329.  
  330. class TSUE_Database
  331. {
  332.     public $querycount = 0;
  333.     public $query = NULL;
  334.     public $query_cache = array(  );
  335.     public $shutdown_queries = array(  );
  336.     public $error = NULL;
  337.     public $connection = NULL;
  338.     public $locked = false;
  339.  
  340.     public function TSUE_Database($halt = true)
  341.     {
  342.         if( !is_file(LIBRARYPATH . "config/database_config.php") )
  343.         {
  344.             exit( "<h1>Fatal Error: The database configuration file does not exists.</h1>" );
  345.         }
  346.  
  347.         require(LIBRARYPATH . "config/database_config.php");
  348.         if( !($this->connection = @mysqli_init()) )
  349.         {
  350.             $this->error = "mysqli_init failed!";
  351.             if( $halt )
  352.             {
  353.                 $this->halt();
  354.             }
  355.  
  356.         }
  357.  
  358.         if( !defined("MYSQL_HOST") || !defined("MYSQL_USER") || !defined("MYSQL_PASS") || !defined("MYSQL_DB") || !defined("MYSQL_PORT") || !defined("MYSQL_SOCKET") )
  359.         {
  360.             exit( "<h1>Fatal Error: Invalid variables in the database configuration file.</h1>" );
  361.         }
  362.  
  363.         if( !mysqli_real_connect($this->connection, MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB, MYSQL_PORT, MYSQL_SOCKET) )
  364.         {
  365.             $this->error = "MySQLi connection error!";
  366.             $this->halt();
  367.         }
  368.  
  369.         if( !@mysqli_real_connect($this->connection, MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB, MYSQL_PORT, MYSQL_SOCKET) )
  370.         {
  371.             $this->error = "MySQLi connection error!";
  372.             if( $halt )
  373.             {
  374.                 $this->halt();
  375.             }
  376.  
  377.         }
  378.  
  379.         if( MYSQL_CHARSET != "" )
  380.         {
  381.             if( function_exists("mysqli_set_charset") )
  382.             {
  383.                 mysqli_set_charset($this->connection, MYSQL_CHARSET);
  384.                 return NULL;
  385.             }
  386.  
  387.             $this->execute_query("SET NAMES " . MYSQL_CHARSET);
  388.         }
  389.  
  390.     }
  391.  
  392.     public function execute_query($query, $buffered = true)
  393.     {
  394.         $this->querycount++;
  395.         $this->query = $query;
  396.         $this->query_cache[] = $query;
  397.         if( $queryresult = mysqli_query($this->connection, $this->query, ($buffered ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT)) )
  398.         {
  399.             return $queryresult;
  400.         }
  401.  
  402.         $this->error = mysqli_error($this->connection);
  403.         $this->halt();
  404.     }
  405.  
  406.     public function query($query, $buffered = true)
  407.     {
  408.         return $this->execute_query($query, $buffered);
  409.     }
  410.  
  411.     public function replace($table, $buildQuery, $isShutDownQuery = false)
  412.     {
  413.         $Query = array(  );
  414.         foreach( $buildQuery as $field => $value )
  415.         {
  416.             $Query[] = "`" . $field . "` = " . $this->escape($value);
  417.         }
  418.         $SET = implode(",", $Query);
  419.         if( $isShutDownQuery )
  420.         {
  421.             return $this->shutdown_query("REPLACE INTO `" . $table . "` SET " . $SET);
  422.         }
  423.  
  424.         return $this->query("REPLACE INTO `" . $table . "` SET " . $SET);
  425.     }
  426.  
  427.     public function insert($table, $buildQuery, $isShutDownQuery = false, $EXTRA = "", $IGNORE = "")
  428.     {
  429.         $Query = array(  );
  430.         foreach( $buildQuery as $field => $value )
  431.         {
  432.             $Query[] = "`" . $field . "` = " . $this->escape($value);
  433.         }
  434.         $SET = implode(",", $Query);
  435.         if( $isShutDownQuery )
  436.         {
  437.             return $this->shutdown_query("INSERT" . (($IGNORE ? " IGNORE" : "")) . " INTO `" . $table . "` SET " . $SET . $EXTRA);
  438.         }
  439.  
  440.         return $this->query("INSERT" . (($IGNORE ? " IGNORE" : "")) . " INTO `" . $table . "` SET " . $SET . $EXTRA);
  441.     }
  442.  
  443.     public function update($table, $buildQuery, $where = "", $isShutDownQuery = false)
  444.     {
  445.         $Query = array(  );
  446.         foreach( $buildQuery as $field => $value )
  447.         {
  448.             if( is_array($value) )
  449.             {
  450.                 if( $value["escape"] == 0 )
  451.                 {
  452.                     $Query[] = "`" . $field . "` = " . $value["value"];
  453.                 }
  454.                 else
  455.                 {
  456.                     $Query[] = "`" . $field . "` = " . $this->escape($value["value"]);
  457.                 }
  458.  
  459.             }
  460.             else
  461.             {
  462.                 $Query[] = "`" . $field . "` = " . $this->escape($value);
  463.             }
  464.  
  465.         }
  466.         $SET = implode(",", $Query);
  467.         if( $isShutDownQuery )
  468.         {
  469.             return $this->shutdown_query("UPDATE `" . $table . "` SET " . $SET . (($where ? " WHERE " . $where : "")));
  470.         }
  471.  
  472.         return $this->query("UPDATE `" . $table . "` SET " . $SET . (($where ? " WHERE " . $where : "")));
  473.     }
  474.  
  475.     public function delete($table, $WHERE)
  476.     {
  477.         $this->execute_query("DELETE FROM " . $table . (($WHERE ? " WHERE " . $WHERE : "")));
  478.         return $this->affected_rows();
  479.     }
  480.  
  481.     public function truncate($table)
  482.     {
  483.         return $this->execute_query("TRUNCATE TABLE `" . $table . "`");
  484.     }
  485.  
  486.     public function query_result($query, $buffered = true)
  487.     {
  488.         $returnarray = false;
  489.         $queryresult = $this->execute_query($query, $buffered);
  490.         if( $this->num_rows($queryresult) )
  491.         {
  492.             $returnarray = $this->fetch_assoc($queryresult);
  493.             $this->free($queryresult);
  494.         }
  495.  
  496.         return $returnarray;
  497.     }
  498.  
  499.     public function exec_shutdown_queries()
  500.     {
  501.         if( $this->shutdown_queries && count($this->shutdown_queries) )
  502.         {
  503.             foreach( $this->shutdown_queries as $query )
  504.             {
  505.                 $this->execute_query($query);
  506.             }
  507.         }
  508.  
  509.     }
  510.  
  511.     public function row_count($query, $buffered = true)
  512.     {
  513.         return $this->num_rows($this->execute_query($query, $buffered));
  514.     }
  515.  
  516.     public function shutdown_query($query)
  517.     {
  518.         $this->shutdown_queries[] = $query;
  519.     }
  520.  
  521.     public function lock_tables($tablelist = "")
  522.     {
  523.         if( !empty($tablelist) && is_array($tablelist) )
  524.         {
  525.             $sql = "";
  526.             foreach( $tablelist as $name => $type )
  527.             {
  528.                 $sql .= ((!empty($sql) ? ", " : "")) . $name . " " . $type;
  529.             }
  530.             $this->query("LOCK TABLES " . $sql);
  531.             $this->locked = true;
  532.         }
  533.  
  534.     }
  535.  
  536.     public function unlock_tables()
  537.     {
  538.         if( $this->locked )
  539.         {
  540.             $this->query("UNLOCK TABLES");
  541.             $this->locked = false;
  542.         }
  543.  
  544.     }
  545.  
  546.     public function affected_rows()
  547.     {
  548.         return mysqli_affected_rows($this->connection);
  549.     }
  550.  
  551.     public function insert_id()
  552.     {
  553.         return mysqli_insert_id($this->connection);
  554.     }
  555.  
  556.     public function fetch_assoc($query)
  557.     {
  558.         return mysqli_fetch_array($query, MYSQLI_ASSOC);
  559.     }
  560.  
  561.     public function fetch_row($query)
  562.     {
  563.         return mysqli_fetch_row($query);
  564.     }
  565.  
  566.     public function num_rows($query)
  567.     {
  568.         return mysqli_num_rows($query);
  569.     }
  570.  
  571.     public function free($query)
  572.     {
  573.         mysqli_free_result($query);
  574.     }
  575.  
  576.     public function escape($string)
  577.     {
  578.         return "'" . mysqli_real_escape_string($this->connection, $string) . "'";
  579.     }
  580.  
  581.     public function escape_no_quotes($string)
  582.     {
  583.         return mysqli_real_escape_string($this->connection, $string);
  584.     }
  585.  
  586.     public function halt()
  587.     {
  588.         showerror($this->error);
  589.     }
  590.  
  591.     public function close()
  592.     {
  593.         mysqli_close($this->connection);
  594.     }
  595.  
  596. }
  597.  
  598. function aaaaov()
  599. {
  600.     @date_default_timezone_set("GMT");
  601.     define("TIMENOW", time());
  602.     if( function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc() )
  603.     {
  604.         require("./../library/functions/functions_undoMagicQuotes.php");
  605.     }
  606.  
  607.     if( function_exists("get_magic_quotes_runtime") && get_magic_quotes_runtime() )
  608.     {
  609.         @set_magic_quotes_runtime(false);
  610.     }
  611.  
  612.     @ini_set("memory_limit", "256M");
  613.     @set_time_limit(0);
  614.     @ignore_user_abort(true);
  615.     @ini_set("pcre.backtrack_limit", -1);
  616.     @ini_set("output_buffering", false);
  617.     while( ob_get_level() )
  618.     {
  619.         @ob_end_clean();
  620.     }
  621.     define("SCRIPT_NAME", "install.php");
  622.     define("REALPATH", str_replace("\\", "/", realpath(".")) . "/");
  623.     define("ROOTPATH", str_replace("\\", "/", realpath("./../")) . "/");
  624.     define("DATAPATH", ROOTPATH . "data/");
  625.     define("JSPATH", ROOTPATH . "js/");
  626.     define("LIBRARYPATH", ROOTPATH . "library/");
  627.     define("STYLEPATH", ROOTPATH . "styles/");
  628.     @error_reporting(30719);
  629.     @ini_set("display_errors", "Off");
  630.     @set_error_handler("InstallErrorHandler");
  631.     define("IN_INSTALL", true);
  632.     define("TSUE_ADMINCP_URL", aaaapc());
  633.     define("TSUE_FRONT_URL", str_replace("/tsue_install/", "", TSUE_ADMINCP_URL));
  634.     define("TSUE_URL", "i5fow4%2BUe93I0t7fxrfN2MvMpJWkX4WM7oLJ2MHOktGc482z");
  635.     define("TSUE_URL3", "aHR0cDovL3RlbXBsYXRlc2hhcmVzLmJpei9pcC5waHA=");
  636.     define("U", (!empty($_SERVER["SERVER_NAME"]) ? fixurl($_SERVER["SERVER_NAME"]) : (!empty($_SERVER["HTTP_HOST"]) ? fixurl($_SERVER["HTTP_HOST"]) : "")));
  637.     define("I", getserverip());
  638.     define("V", "2.2");
  639. }
  640.  
  641. function installerrorhandler($errno, $errstr, $errfile, $errline)
  642. {
  643.     $Message = "\r\n------------------------------------------\r\n" . date("d-m-Y H:i:s") . "\r\n[" . $errno . "] " . $errstr . "\r\nPHP Error on line " . number_format($errline) . " in file " . $errfile . "\r\n" . PHP_VERSION . " " . PHP_OS . "\r\n------------------------------------------";
  644.     @file_put_contents(DATAPATH . "errors/" . SCRIPT_NAME . ".log", $Message, FILE_APPEND);
  645. }
  646.  
  647. function getserverip()
  648. {
  649.     $ipFile = DATAPATH . "cache/ip.srv";
  650.     if( isset($_SERVER["SERVER_ADDR"]) && !empty($_SERVER["SERVER_ADDR"]) && is_valid_ip($_SERVER["SERVER_ADDR"]) )
  651.     {
  652.         $ip = $_SERVER["SERVER_ADDR"];
  653.     }
  654.     else
  655.     {
  656.         if( isset($_SERVER["LOCAL_ADDR"]) && !empty($_SERVER["LOCAL_ADDR"]) && is_valid_ip($_SERVER["LOCAL_ADDR"]) )
  657.         {
  658.             $ip = $_SERVER["LOCAL_ADDR"];
  659.         }
  660.         else
  661.         {
  662.             if( file_exists($ipFile) && TIMENOW < filemtime($ipFile) + 1800 )
  663.             {
  664.                 $ip = file_get_contents($ipFile);
  665.             }
  666.             else
  667.             {
  668.                 if( function_exists("curl_init") && ($ch = curl_init()) )
  669.                 {
  670.                     curl_setopt($ch, CURLOPT_URL, base64_decode(TSUE_URL3));
  671.                     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  672.                     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
  673.                     curl_setopt($ch, CURLOPT_HEADER, 0);
  674.                     curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0");
  675.                     $ip = curl_exec($ch);
  676.                     curl_close($ch);
  677.                     if( is_writable(DATAPATH . "cache/") )
  678.                     {
  679.                         @file_put_contents($ipFile, $ip);
  680.                     }
  681.  
  682.                 }
  683.  
  684.             }
  685.  
  686.         }
  687.  
  688.     }
  689.  
  690.     if( is_valid_ip($ip) )
  691.     {
  692.         return $ip;
  693.     }
  694.  
  695.     if( file_exists($ipFile) )
  696.     {
  697.         @unlink($ipFile);
  698.     }
  699.  
  700. }
  701.  
  702. function is_valid_ip($ip)
  703. {
  704.     return $ip != "127.0.0.1" && $ip != "::1" && filter_var($ip, FILTER_VALIDATE_IP);
  705. }
  706.  
  707. function aaaaoy()
  708. {
  709.     return array( "announceLog/", "avatars/l/", "avatars/m/", "avatars/s/", "backups/", "cache/", "countryFlags/", "downloads/files/", "downloads/previews/", "errors/", "gallery/l/", "gallery/s/", "languageFlags/", "posts/", "smilies/", "subTitles/", "torrents/auto_uploader/", "torrents/category_images/", "torrents/imdb/", "torrents/nfo/", "torrents/torrent_files/", "torrents/torrent_genres/", "torrents/torrent_images/l/", "torrents/torrent_images/m/", "torrents/torrent_images/s/" );
  710. }
  711.  
  712. function aaaaoz($path = "")
  713. {
  714.     if( !$path || !is_dir($path) )
  715.     {
  716.         return false;
  717.     }
  718.  
  719.     clearstatcache();
  720.     $Directories = scandir($path);
  721.     if( !$Directories )
  722.     {
  723.         return false;
  724.     }
  725.  
  726.     $aaaapd = array(  );
  727.     foreach( $Directories as $directory )
  728.     {
  729.         if( is_dir($path . $directory) && $directory != "." && $directory != ".." )
  730.         {
  731.             $aaaapd[] = $path . $directory . "/";
  732.         }
  733.  
  734.     }
  735.     return $aaaapd;
  736. }
  737.  
  738. function aaaapc()
  739. {
  740.     $port = (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] ? intval($_SERVER["SERVER_PORT"]) : 0);
  741.     $port = (in_array($port, array( 80, 443 )) ? "" : ":" . $port);
  742.     $scheme = (":443" == $port || isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] && $_SERVER["HTTPS"] != "off" ? "https://" : "http://");
  743.     $host = fetch_server_value("HTTP_HOST");
  744.     $name = fetch_server_value("SERVER_NAME");
  745.     $host = (substr_count($name, ".") < substr_count($host, ".") ? $host : $name);
  746.     define("_HTTP_HOST", $host);
  747.     if( !($scriptpath = fetch_server_value("PATH_INFO")) && !($scriptpath = fetch_server_value("REDIRECT_URL")) && !($scriptpath = fetch_server_value("URL")) && !($scriptpath = fetch_server_value("PHP_SELF")) )
  748.     {
  749.         $scriptpath = fetch_server_value("SCRIPT_NAME");
  750.     }
  751.  
  752.     $url = $scheme . $host . "/" . str_replace(SCRIPT_NAME, "", ltrim($scriptpath, "/\\"));
  753.     return $url;
  754. }
  755.  
  756. function fetch_server_value($name)
  757. {
  758.     if( isset($_SERVER[$name]) && $_SERVER[$name] )
  759.     {
  760.         return $_SERVER[$name];
  761.     }
  762.  
  763.     if( isset($_ENV[$name]) && $_ENV[$name] )
  764.     {
  765.         return $_ENV[$name];
  766.     }
  767.  
  768.     return false;
  769. }
  770.  
  771. function showmessage($message = "")
  772. {
  773.     sleep(2);
  774.     exit( $message );
  775. }
  776.  
  777. function checkdirectorypermissions($Directory = "")
  778. {
  779.     clearstatcache();
  780.     return !empty($Directory) && is_dir($Directory) && is_writable($Directory);
  781. }
  782.  
  783. function showerror($error)
  784. {
  785.     showmessage("-ERROR-Fatal Error: " . $error);
  786. }
  787.  
  788. function aaaaox($error)
  789. {
  790.     showmessage("<div id=\"error\">" . $error . "</div>");
  791. }
  792.  
  793. function showdialog($dialog)
  794. {
  795.     showmessage("-DIALOG-" . $dialog);
  796. }
  797.  
  798. function aaaape($error = "", $useDIV = true)
  799. {
  800.     global $isAjax;
  801.     $_SESSION["lk"] = "";
  802.     if( $isAjax )
  803.     {
  804.         showmessage("-ERROR-" . $error);
  805.     }
  806.     else
  807.     {
  808.         printoutput(($useDIV ? "<div id=\"error\">" . $error . "</div>" : $error));
  809.     }
  810.  
  811. }
  812.  
  813. function printoutput($HTML, $useInstallJS = false)
  814. {
  815.     $Output = "\r\n\t<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n\t<html>\r\n\t\t<head>\r\n\t\t\t<noscript><meta http-equiv=refresh content=\"0; URL=" . TSUE_ADMINCP_URL . SCRIPT_NAME . "?noscript=1\" /></noscript>\r\n\t\t\t<meta charset=\"utf-8\" />\r\n\t\t\t<title>TSUE Install System</title>\r\n\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/install.css\" />\r\n\t\t\t<script type=\"text/javascript\">var TSUEPhrases = {}</script>\r\n\t\t\t<script type=\"text/javascript\" src=\"" . TSUE_FRONT_URL . "/js/tsue/jquery.js\"></script>\r\n\t\t</head>\r\n\t\t\r\n\t\t<body>\r\n\r\n\t\t\t<div id=\"dialog\"></div>\r\n\t\t\t<div id=\"header\"></div>\r\n\t\t\t<div id=\"wrapper\">\t\t\t\r\n\t\t\t\t<div id=\"container\">" . $HTML . "</div>\t\t\t\r\n\t\t\t</div>\r\n\r\n\t\t\t<div id=\"footer\"></div>\r\n\t\t\t\r\n\t\t\t<div id=\"copyright\">\r\n                <div class=\"tsue dotted-bottom-gray\">Software by TSUE&trade; &copy;2014 <a href=\"http://www.templateshares-ue.net\" target=\"_blank\">www.templateshares-ue.net</a></div>\r\n            </div>\r\n\r\n\t\t\t" . (($useInstallJS ? "\r\n\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\tvar stepCount = 0,\r\n\t\t\t\t\$totalSteps = 7,\r\n\t\t\t\t\$progressbar = \$(\"#progressbar\"),\r\n\t\t\t\t\$progress = \$(\"#progress\"),\r\n\t\t\t\t\$result = \$(\"#welcomeScreen\"),\r\n\t\t\t\t\$dialog = \$(\"#dialog\"),\r\n\t\t\t\t\$loader = \$('<img src=\"images/ajax-loader.gif\" alt=\"loading..\" title=\"loading..\" border=\"0\" id=\"loader\" />'),\r\n\t\t\t\t\$bigLoader = \$('<img src=\"images/ajax-loader-big.gif\" alt=\"loading..\" title=\"loading..\" border=\"0\" id=\"bigLoader\" />'),\r\n\t\t\t\t\$adminAccount = null;\r\n\r\n\t\t\t\tvar openDialog = function(text, onFinish)\r\n\t\t\t\t{\r\n\t\t\t\t\t\$dialog.html(text);\r\n\t\t\t\t\t\$dialog.overlay\r\n\t\t\t\t\t({\r\n\t\t\t\t\t\tmask: {color: \"#ccc\",loadSpeed:200,opacity:0.7},\r\n\t\t\t\t\t\tcloseOnClick: false,\r\n\t\t\t\t\t\tcloseOnEsc: false,\r\n\t\t\t\t\t\tload: true,\r\n\t\t\t\t\t\tonClose: onFinish,\r\n\t\t\t\t\t\tonBeforeLoad: function(){},\r\n\t\t\t\t\t\tonBeforeClose: function(){}\r\n\t\t\t\t\t}).load();\r\n\t\t\t\t};\r\n\r\n\t\t\t\t\$(document).on(\"submit\", \"#dialogForm\", function(e)\r\n\t\t\t\t{\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\tvar \$thisForm = \$(this),  \$serialize = \$thisForm.serialize();\r\n\r\n\t\t\t\t\t\$(\"#error\").remove();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\$bigLoader.appendTo(\"#formDIV\");\r\n\r\n\t\t\t\t\t\$.ajax\r\n\t\t\t\t\t({\r\n\t\t\t\t\t\ttype: \"POST\",\r\n\t\t\t\t\t\tdata: \$serialize,\r\n\t\t\t\t\t\turl: \"" . SCRIPT_NAME . "\",\r\n\t\t\t\t\t\tsuccess: function(formResults)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\$bigLoader.remove();\r\n\t\t\t\t\t\t\tif(formResults && formResults.match(/\"error\"/))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\$thisForm.find(\"#formResults\").remove();\r\n\t\t\t\t\t\t\t\t\$('<div id=\"formResults\">'+formResults+'</div>').prependTo(\$thisForm);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if(formResults)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\$dialog.empty().overlay().close();\r\n\t\t\t\t\t\t\t\t\$result.html(formResults);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tvar ajaxProgress = function()\r\n\t\t\t\t{\r\n\t\t\t\t\tstepCount++;\r\n\r\n\t\t\t\t\tvar pWidth = Math.round((stepCount/\$totalSteps*100));\r\n\t\t\t\t\tif(pWidth > 100 || stepCount >= \$totalSteps)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tpWidth = 100;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(\$progress.width() < 100)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\$progress.animate({width: pWidth+\"%\"}, 3000);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\$.ajax\r\n\t\t\t\t\t({\r\n\t\t\t\t\t\ttype: \"POST\",\r\n\t\t\t\t\t\tdata: \"isAjax=1&stepCount=\"+stepCount,\r\n\t\t\t\t\t\turl: \"" . SCRIPT_NAME . "\",\r\n\t\t\t\t\t\tsuccess: function(serverResult)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(serverResult.match(/-ERROR-/))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tserverResult = '<div id=\"error\">'+serverResult.replace(/-ERROR-/, '')+'</div>';\r\n\t\t\t\t\t\t\t\t\$result.html(serverResult);\r\n\t\t\t\t\t\t\t\t\$progressbar.hide();\r\n\t\t\t\t\t\t\t\t\$loader.hide();\r\n\t\t\t\t\t\t\t\tstepCount = 0;\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if(serverResult.match(/-DIALOG-/))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tserverResult = serverResult.replace(/-DIALOG-/, \"\");\r\n\r\n\t\t\t\t\t\t\t\tvar onFinish = function()\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tajaxProgress();\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\topenDialog(serverResult, onFinish);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if(serverResult)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\$result.html(serverResult);\r\n\t\t\t\t\t\t\t\tajaxProgress();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse//finished?\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tstepCount=0;\r\n\t\t\t\t\t\t\t\t\$progress.animate({width: \"100%\"}, 100, function(){\$loader.remove()});\r\n\t\t\t\t\t\t\t\t\$progressbar.hide();\r\n\t\t\t\t\t\t\t\t\$loader.hide();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar welcomeScreen = function()\r\n\t\t\t\t{\r\n\t\t\t\t\t\$.ajax\r\n\t\t\t\t\t({\r\n\t\t\t\t\t\ttype: \"POST\",\r\n\t\t\t\t\t\tdata: \"isAjax=1&doAction=requirementsCheck\",\r\n\t\t\t\t\t\turl: \"" . SCRIPT_NAME . "\",\r\n\t\t\t\t\t\tsuccess: function(serverResult)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\$(\"#welcomeScreen\").html(serverResult);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(serverResult.match(/Requirements Met/))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\$(\"#beginInstall\").show();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar enableButtons = function()\r\n\t\t\t\t{\r\n\t\t\t\t\t\$(\"body :input\").attr(\"disabled\", false);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar disableButtons = function()\r\n\t\t\t\t{\r\n\t\t\t\t\t\$(\"body :input\").attr(\"disabled\", true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar initTipsy = function()\r\n\t\t\t\t{\r\n\t\t\t\t\t\$(\".hint\").tipsy({title: \"id\", gravity: \"sw\", html: true});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\$(document).ready(function()\r\n\t\t\t\t{\r\n\t\t\t\t\t\$.ajaxSetup({timeout: 600000});\r\n\t\t\t\t\t\$(document).ajaxStart(function(){disableButtons()}).ajaxComplete(function(){enableButtons(); initTipsy();});\r\n\r\n\t\t\t\t\twelcomeScreen();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\$(document).on(\"click\", \"#start\", function(e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\$(\"#start,#reload\").remove();\r\n\t\t\t\t\t\t\$(\"#requirementsMet,#licenseAgreement\").remove();\r\n\t\t\t\t\t\t\$progressbar.show();\r\n\t\t\t\t\t\t\$loader.appendTo(\"#buttons\");\r\n\t\t\t\t\t\t\$result.html(\"Initializing...\");\r\n\t\t\t\t\t\tajaxProgress();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\$(document).on(\"click\", \"#reload\", function(e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\twindow.location.reload();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t</script>" : "")) . "\r\n\r\n\t\t</body>\r\n\t</html>";
  816.     exit( $Output );
  817. }
  818.  
  819. function getpostvar($name = "")
  820. {
  821.     return ($name && isset($_POST[$name]) ? $_POST[$name] : "");
  822. }
  823.  
  824. function showhint($hint = "", $link = "help")
  825. {
  826.     return "<span class=\"hint\" id=\"" . $hint . "\">" . $link . "</span>";
  827. }
  828.  
  829. function aaaapf($hint = "")
  830. {
  831.     return "<span class=\"inputHint\">" . $hint . "</span>";
  832. }
  833.  
  834. function aaaapg()
  835. {
  836.     return "<span class=\"okMessage\">CONFIRMED!</span>";
  837. }
  838.  
  839. function showtitle($title = "")
  840. {
  841.     return "<span class='title'>" . $title . "</span>";
  842. }
  843.  
  844. function generatepasskey($length = 30)
  845. {
  846.     $passkey = "";
  847.     for( $i = 0; $i < $length; $i++ )
  848.     {
  849.         $passkey .= chr(rand(33, 126));
  850.     }
  851.     return sha1($passkey);
  852. }
  853.  
  854. function file_extension($filename)
  855. {
  856.     return substr(strrchr($filename, "."), 1);
  857. }
  858.  
  859. function updatesettings($settingname, $settingvalues)
  860. {
  861.     global $TSUE;
  862.     $BuildQuery = array( "settingname" => $settingname, "settingvalues" => serialize($settingvalues) );
  863.     $TSUE["TSUE_Database"]->delete("tsue_settings", "settingname = " . $TSUE["TSUE_Database"]->escape($settingname));
  864.     return $TSUE["TSUE_Database"]->insert("tsue_settings", $BuildQuery);
  865. }
  866.  
  867. function handleprune()
  868. {
  869.     global $TSUE;
  870.     $TSUE["TSUE_Database"]->truncate("tsue_file_caches");
  871.     $cacheFolder = DATAPATH . "cache/";
  872.     if( !is_dir($cacheFolder) || !is_writable($cacheFolder) )
  873.     {
  874.         showerror("Cache folder is not writable: " . $cacheFolder);
  875.     }
  876.  
  877.     $cacheFiles = scandir($cacheFolder);
  878.     if( count($cacheFiles) <= 2 )
  879.     {
  880.         showerror("Cache files does not exists in: " . $cacheFolder);
  881.     }
  882.  
  883.     foreach( $cacheFiles as $cacheFile )
  884.     {
  885.         $_ext = file_extension($cacheFile);
  886.         if( in_array($_ext, array( "tsue", "gz", "js", "gif", "jpg", "png", "jpeg", "zip", "srv" )) )
  887.         {
  888.             @unlink($cacheFolder . $cacheFile);
  889.         }
  890.  
  891.     }
  892. }
  893.  
  894. function handlerebuildcaches($logANDreturn = true)
  895. {
  896.     global $TSUE;
  897.     $content = "";
  898.     $cacheContents = array(  );
  899.     $Announcement = $TSUE["TSUE_Database"]->query_result("SELECT a.*, m.membername FROM tsue_announcements a LEFT JOIN tsue_members m USING(memberid) WHERE a.active = 1 ORDER BY a.date DESC LIMIT 1");
  900.     if( $Announcement )
  901.     {
  902.         $cacheContents["active_announcements_cache"] = array( "aid" => $Announcement["aid"], "memberid" => $Announcement["memberid"], "date" => $Announcement["date"], "title" => $Announcement["title"], "content" => $Announcement["content"] );
  903.     }
  904.     else
  905.     {
  906.         $cacheContents["active_announcements_cache"] = array(  );
  907.     }
  908.  
  909.     $News = $TSUE["TSUE_Database"]->query("SELECT n.*, m.membername FROM tsue_news n LEFT JOIN tsue_members m USING(memberid) WHERE n.active = 1 ORDER BY n.date DESC");
  910.     if( $TSUE["TSUE_Database"]->num_rows($News) )
  911.     {
  912.         while( $nItem = $TSUE["TSUE_Database"]->fetch_assoc($News) )
  913.         {
  914.             $cacheContents["active_news_cache"][] = array( "nid" => $nItem["nid"], "memberid" => $nItem["memberid"], "date" => $nItem["date"], "title" => $nItem["title"], "content" => $nItem["content"] );
  915.         }
  916.     }
  917.     else
  918.     {
  919.         $cacheContents["active_news_cache"] = array(  );
  920.     }
  921.  
  922.     $aaaaph = $TSUE["TSUE_Database"]->query("SELECT * FROM tsue_ban_country ORDER BY 'country'");
  923.     if( $TSUE["TSUE_Database"]->num_rows($aaaaph) )
  924.     {
  925.         while( $nItem = $TSUE["TSUE_Database"]->fetch_assoc($aaaaph) )
  926.         {
  927.             $cacheContents["banned_countries_cache"][] = $nItem["country"];
  928.         }
  929.     }
  930.     else
  931.     {
  932.         $cacheContents["banned_countries_cache"] = array(  );
  933.     }
  934.  
  935.     $aaaapi = $TSUE["TSUE_Database"]->query("SELECT * FROM tsue_ban_email ORDER BY 'banned_email'");
  936.     if( $TSUE["TSUE_Database"]->num_rows($aaaapi) )
  937.     {
  938.         while( $nItem = $TSUE["TSUE_Database"]->fetch_assoc($aaaapi) )
  939.         {
  940.             $cacheContents["banned_emails_cache"][] = $nItem["banned_email"];
  941.         }
  942.     }
  943.     else
  944.     {
  945.         $cacheContents["banned_emails_cache"] = array(  );
  946.     }
  947.  
  948.     $bannedIPs = $TSUE["TSUE_Database"]->query("SELECT * FROM tsue_ip_match WHERE match_type = 'banned'");
  949.     if( $TSUE["TSUE_Database"]->num_rows($bannedIPs) )
  950.     {
  951.         while( $nItem = $TSUE["TSUE_Database"]->fetch_assoc($bannedIPs) )
  952.         {
  953.             $cacheContents["banned_ips_cache"][$nItem["first_octet"]][] = array( $nItem["start_range"], $nItem["end_range"] );
  954.         }
  955.     }
  956.     else
  957.     {
  958.         $cacheContents["banned_ips_cache"] = array(  );
  959.     }
  960.  
  961.     $Smilies = $TSUE["TSUE_Database"]->query("SELECT smilie_text, smilie_title, smilie_file FROM tsue_smilies");
  962.     if( $TSUE["TSUE_Database"]->num_rows($Smilies) )
  963.     {
  964.         while( $Smilie = $TSUE["TSUE_Database"]->fetch_assoc($Smilies) )
  965.         {
  966.             $cacheContents["dialog_smilies_cache"][] = $Smilie;
  967.         }
  968.     }
  969.     else
  970.     {
  971.         $cacheContents["dialog_smilies_cache"] = array(  );
  972.     }
  973.  
  974.     $permissions = $TSUE["TSUE_Database"]->query("SELECT * FROM tsue_forums_permissions ORDER BY forumid ASC");
  975.     if( $TSUE["TSUE_Database"]->num_rows($permissions) )
  976.     {
  977.         while( $nItem = $TSUE["TSUE_Database"]->fetch_assoc($permissions) )
  978.         {
  979.             $cacheContents["forums_permissions_cache"][] = array( "forumid" => $nItem["forumid"], "membergroupid" => $nItem["membergroupid"], "permissions" => $nItem["permissions"] );
  980.         }
  981.     }
  982.     else
  983.     {
  984.         $cacheContents["forums_permissions_cache"] = array(  );
  985.     }
  986.  
  987.     $prefixes = $TSUE["TSUE_Database"]->query("SELECT * FROM tsue_forums_thread_prefixes ORDER BY pname ASC");
  988.     if( $TSUE["TSUE_Database"]->num_rows($prefixes) )
  989.     {
  990.         while( $nItem = $TSUE["TSUE_Database"]->fetch_assoc($prefixes) )
  991.         {
  992.             $cacheContents["forums_thread_prefixes"][] = array( "pid" => $nItem["pid"], "pname" => $nItem["pname"], "cssname" => $nItem["cssname"], "viewpermissions" => $nItem["viewpermissions"] );
  993.         }
  994.     }
  995.     else
  996.     {
  997.         $cacheContents["forums_thread_prefixes"] = array(  );
  998.     }
  999.  
  1000.     $Plugins = $TSUE["TSUE_Database"]->query("SELECT pluginid, name, filename, contents, viewpermissions, pluginOptions FROM tsue_plugins WHERE `active` = 1");
  1001.     if( $TSUE["TSUE_Database"]->num_rows($Plugins) )
  1002.     {
  1003.         while( $nItem = $TSUE["TSUE_Database"]->fetch_assoc($Plugins) )
  1004.         {
  1005.             $cacheContents["tsue_plugins_cache"][] = $nItem;
  1006.         }
  1007.     }
  1008.     else
  1009.     {
  1010.         $cacheContents["tsue_plugins_cache"] = array(  );
  1011.     }
  1012.  
  1013.     $Genres = $TSUE["TSUE_Database"]->query("SELECT gid, gname, gicon, categories FROM tsue_torrents_genres WHERE active = 1 ORDER BY gname ASC");
  1014.     if( $TSUE["TSUE_Database"]->num_rows($Genres) )
  1015.     {
  1016.         while( $Genre = $TSUE["TSUE_Database"]->fetch_assoc($Genres) )
  1017.         {
  1018.             $cacheContents["tsue_torrents_genres_cache"][] = $Genre;
  1019.         }
  1020.     }
  1021.     else
  1022.     {
  1023.         $cacheContents["tsue_torrents_genres_cache"] = array(  );
  1024.     }
  1025.  
  1026.     $Themes = $TSUE["TSUE_Database"]->query("SELECT themeid FROM tsue_themes WHERE active = 1");
  1027.     if( $TSUE["TSUE_Database"]->num_rows($Themes) )
  1028.     {
  1029.         while( $Theme = $TSUE["TSUE_Database"]->fetch_assoc($Themes) )
  1030.         {
  1031.             $aaaapj[] = $Theme["themeid"];
  1032.         }
  1033.         $TSUE["TSUE_Settings"]->settings["global_settings"]["available_themes"] = implode(",", $aaaapj);
  1034.     }
  1035.  
  1036.     $Languages = $TSUE["TSUE_Database"]->query("SELECT languageid FROM tsue_languages WHERE active = 1");
  1037.     if( $TSUE["TSUE_Database"]->num_rows($Languages) )
  1038.     {
  1039.         while( $Language = $TSUE["TSUE_Database"]->fetch_assoc($Languages) )
  1040.         {
  1041.             $languageCache[] = $Language["languageid"];
  1042.         }
  1043.         $TSUE["TSUE_Settings"]->settings["global_settings"]["available_languages"] = implode(",", $languageCache);
  1044.     }
  1045.  
  1046.     updatesettings("global_settings", $TSUE["TSUE_Settings"]->settings["global_settings"]);
  1047.     if( !empty($cacheContents) )
  1048.     {
  1049.         foreach( $cacheContents as $settingname => $settingvalues )
  1050.         {
  1051.             updatesettings($settingname, $settingvalues);
  1052.         }
  1053.     }
  1054.  
  1055. }
  1056.  
  1057. function fixurl($url = "")
  1058. {
  1059.     return strtolower(str_replace(array( "http://", "https://", "www.", "http://www.", "https://www." ), "", $url));
  1060. }
  1061.  
  1062. function encodestring($String = "", $AnahtarKelime = "I3RTVWVMaWNlbnNlQ2hlY2syMDExIw==")
  1063. {
  1064.     $AnahtarKelime = base64_decode($AnahtarKelime);
  1065.     $result = "";
  1066.     for( $i = 0; $i < strlen($String); $i++ )
  1067.     {
  1068.         $char = substr($String, $i, 1);
  1069.         $keychar = substr($AnahtarKelime, $i % strlen($AnahtarKelime) - 1, 1);
  1070.         $char = chr(ord($char) + ord($keychar));
  1071.         $result .= $char;
  1072.     }
  1073.     return urlencode(base64_encode($result));
  1074. }
  1075.  
  1076. function decodestring($String = "", $AnahtarKelime = "I3RTVWVMaWNlbnNlQ2hlY2syMDExIw==")
  1077. {
  1078.     $AnahtarKelime = base64_decode($AnahtarKelime);
  1079.     $String = urldecode($String);
  1080.     $result = "";
  1081.     $String = urldecode(base64_decode($String));
  1082.     for( $i = 0; $i < strlen($String); $i++ )
  1083.     {
  1084.         $char = substr($String, $i, 1);
  1085.         $keychar = substr($AnahtarKelime, $i % strlen($AnahtarKelime) - 1, 1);
  1086.         $char = chr(ord($char) - ord($keychar));
  1087.         $result .= $char;
  1088.     }
  1089.     return $result;
  1090. }
  1091.  
  1092. function compare_key($installkey = "")
  1093. {
  1094.     return strlen($installkey) === 36 && preg_match(str_replace("#", "[0-9,A-F]", "{########-####-####-####-############}"), $installkey);
  1095. }
  1096.  
  1097. function is_valid_url($url = "")
  1098. {
  1099.     return (!empty($url) && !preg_match("#^[a-z0-9-\\.]+\$#", $url) ? false : true);
  1100. }
  1101.  
  1102. function aaaapa($type = 0)
  1103. {
  1104.     $serverResponse = "";
  1105.     if( function_exists("curl_init") && ($ch = curl_init()) )
  1106.     {
  1107.         curl_setopt($ch, CURLOPT_URL, decodestring(TSUE_URL));
  1108.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  1109.         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
  1110.         curl_setopt($ch, CURLOPT_HEADER, 0);
  1111.         curl_setopt($ch, CURLOPT_USERAGENT, "d3bJmHWuutzXxtrfxrfR1NE%3D");
  1112.         curl_setopt($ch, CURLOPT_REFERER, U);
  1113.         curl_setopt($ch, CURLOPT_POST, 1);
  1114.         curl_setopt($ch, CURLOPT_POSTFIELDS, "t=" . $type . "&u=" . encodestring(U) . "&i=" . encodestring(I) . "&v=" . V);
  1115.         $serverResponse = curl_exec($ch);
  1116.         curl_close($ch);
  1117.         if( $serverResponse )
  1118.         {
  1119.             $serverResponse = decodestring($serverResponse);
  1120.         }
  1121.  
  1122.     }
  1123.  
  1124.     return $serverResponse;
  1125. }
  1126.  
  1127. function aaaaow()
  1128. {
  1129.     global $isAjax;
  1130.     $ERROR = "";
  1131.     session_name("tsueinstallation");
  1132.     session_start();
  1133.     return true;
  1134.     if( file_exists($_SERVER["DOCUMENT_ROOT"] . "/tsue/l.php") )
  1135.     {
  1136.         aaaape("Critical Security Error.");
  1137.     }
  1138.  
  1139.     $serverResponse = aaaapa(1);
  1140.     if( !$serverResponse )
  1141.     {
  1142.         aaaape("Could not connect to TSUE license server.");
  1143.     }
  1144.  
  1145.     if( !preg_match("#\\[lk\\](.*)\\[\\/lk\\]#", $serverResponse, $licenseKey) )
  1146.     {
  1147.         $serverResponse = str_replace(array( "margin: 50px auto 0 auto;", "width: 600px;" ), array( "margin: 0 auto;", "width: 100%;" ), $serverResponse);
  1148.         aaaape($serverResponse, false);
  1149.     }
  1150.  
  1151.     $licenseKey = (isset($licenseKey["1"]) ? $licenseKey["1"] : "");
  1152.     if( !compare_key($licenseKey) )
  1153.     {
  1154.         aaaape("Could not fetch the correct license key.");
  1155.     }
  1156.  
  1157.     if( strtoupper($_SERVER["REQUEST_METHOD"]) === "POST" && isset($_POST["licenseKey"]) && !empty($_POST["licenseKey"]) )
  1158.     {
  1159.         if( isset($_POST["CSRFKey"]) && $_POST["CSRFKey"] && isset($_SESSION["CSRFKey"]) && $_SESSION["CSRFKey"] && $_POST["CSRFKey"] === $_SESSION["CSRFKey"] )
  1160.         {
  1161.             if( compare_key($_POST["licenseKey"]) && $_POST["licenseKey"] === $licenseKey )
  1162.             {
  1163.                 $_SESSION["lk"] = $_POST["licenseKey"];
  1164.             }
  1165.             else
  1166.             {
  1167.                 $_SESSION["lk"] = "";
  1168.                 $ERROR = "<div id=\"error\">The entered License Key could not be verified.</div>";
  1169.             }
  1170.  
  1171.         }
  1172.         else
  1173.         {
  1174.             $_SESSION["lk"] = "";
  1175.             $_SESSION["CSRFKey"] = "";
  1176.             $ERROR = "<div id=\"error\">Invalid Security Token.</div>";
  1177.         }
  1178.  
  1179.     }
  1180.  
  1181.     if( !isset($_SESSION["lk"]) || !compare_key($_SESSION["lk"]) || $_SESSION["lk"] != $licenseKey )
  1182.     {
  1183.         $_SESSION["lk"] = "";
  1184.         $CSRFKey = sha1(microtime());
  1185.         $_SESSION["CSRFKey"] = $CSRFKey;
  1186.         if( $isAjax )
  1187.         {
  1188.             showmessage("-ERROR-Please refresh page and re-enter your License Key.");
  1189.         }
  1190.  
  1191.         printoutput("\r\n\t\t\t" . $ERROR . "\r\n\t\t\t<form method=\"post\" id=\"checkLicense\">\r\n\t\t\t<input type=\"hidden\" name=\"CSRFKey\" value=\"" . $CSRFKey . "\" />\r\n\t\t\t\t<div id=\"licenseKey\">\r\n\t\t\t\t\t" . showhint("For security reasons, you must verify your license key.<br />You can find your license key in our Client Area.") . "\r\n\t\t\t\t\tEnter License Key Here: <input type=\"text\" name=\"licenseKey\" class=\"key\" value=\"\" /> <input type=\"submit\" value=\"verifiy\" class=\"submit\" />\r\n\t\t\t\t</div>\r\n\t\t\t</form>\r\n\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\t\$(document).ready(function()\r\n\t\t\t\t{\r\n\t\t\t\t\t\$(\".hint\").tipsy({title: \"id\", gravity: \"sw\", html: true});\r\n\t\t\t\t\t\$(\"#checkLicense\").submit(function(e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\$(\"input[type='submit']\").val(\"checking...\");\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t</script>\r\n\t\t");
  1192.     }
  1193.  
  1194. }
  1195.  
  1196. function aaaapb()
  1197. {
  1198.     return array( "Options" => 1, "Pages" => 1, "Polls" => 1, "News" => 1, "FAQ" => 1, "Torrent Categories" => 1, "Market" => 1, "API Manager" => 1, "Cron Entries" => 1, "Rebuild Caches" => 1, "Logs" => 1, "Server" => 1, "Notes" => 1, "Statistics" => 1, "Read PM" => 1, "Database" => 1, "Announcements" => 1, "Torrents" => 1, "Add-ons" => 1, "TSUE Store" => 1, "Recent Comments" => 1, "Torrent Genres" => 1, "Advertisements" => 1, "Shoutbox Channels" => 1, "Plugin Manager" => 1, "Forum Manager" => 1, "Appearance" => 1, "All Members" => 1, "Awaiting Approval" => 1, "Banned Members" => 1, "Warned Members" => 1, "Membergroups" => 1, "Email Members" => 1, "Search Members" => 1, "Peers" => 1, "Account Upgrades" => 1, "Muted Members" => 1, "PM Members" => 1, "Promotions" => 1, "Duplicate Ips" => 1, "Hit and Runners" => 1, "Test Permissions" => 1, "Administrators" => 1, "Gift" => 1, "Mass Invite" => 1, "Awards" => 1, "Auto Warned Members" => 1, "Uploader Activity" => 1, "First Line Support" => 1, "Spam Cleaner" => 1, "Prune" => 1, "Smilies" => 1, "Country Flags" => 1, "Attachment Browser" => 1, "Downloads" => 1, "Permissions" => 1, "Cleanup" => 1 );
  1199. }
Advertisement
RAW Paste Data Copied
Advertisement