Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Loader)
- *
- * @ Version : 2.0.0.3
- * @ Author : DeZender
- * @ Release on : 06.05.2013
- * @ Official site : http://DeZender.Net
- *
- */
- if (!defined("GSP_CALLED"))
- {
- exit("This file cannot be called directly, please include gsp-panel.php");
- }
- class GSP {
- private static $_instance = null;
- private $version = "1.0.84-stable";
- private $releasetype = null;
- private $allowedservers = null;
- private $allowedgameservers = null;
- public $licinfo = null;
- public $updates = null;
- public $settings = null;
- public $lang = null;
- public $api = false;
- public $db = null;
- public static function getInstance() {
- if (null === self::$_instance)
- {
- self::$_instance = new self();
- }
- return self::$_instance;
- }
- public function __construct() {
- require_once DOC_ROOT . "/includes/mysql.conf.php";
- if (!($this->db = new mysqli($config["mysql_host"], $config["mysql_user"], $config["mysql_pass"], $config["mysql_database"])))
- {
- exit("There was a problem connecting to the database");
- }
- $this->db->set_charset("utf8");
- return;
- }
- public function GetAllowedGameServers() {
- return $this->allowedgameservers;
- }
- public function GetAllowedServers() {
- return $this->allowedservers;
- }
- public function CheckVersion() {
- return $this->version;
- }
- public function GetReleaseType() {
- return $this->releasetype;
- }
- public function Update() {
- if (!extension_loaded("zip"))
- {
- return array("error" => -1);
- }
- if (!is_writeable(DOC_ROOT))
- {
- return array("error" => -2);
- }
- $updateurl = $this->updates["url"];
- $localzip = DOC_ROOT . "/update.zip";
- $dir = DOC_ROOT;
- $ch = curl_init($updateurl);
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
- $rawdata = curl_exec($ch);
- curl_close($ch);
- if (file_exists($localzip))
- {
- @unlink($localzip);
- }
- if (strlen($rawdata) < 200)
- {
- return array("error" => -5, "message" => $rawdata);
- }
- $fp = fopen($localzip, "x");
- fwrite($fp, $rawdata);
- fclose($fp);
- if (!(!is_file($localzip)) && !is_dir($dir))
- {
- return array("error" => -3);
- }
- $zip = new ZipArchive();
- $res = $zip->open($localzip, ZIPARCHIVE::CHECKCONS);
- if ($res === true)
- {
- $erroredfiles = array();
- $i = 0;
- while ($i <= $zip->numFiles)
- {
- if (file_exists($dir . "/" . $zip->getNameIndex($i)) && !is_writable($dir . "/" . $zip->getNameIndex($i)))
- {
- $erroredfiles[] = $zip->getNameIndex($i);
- }
- ++$i;
- continue;
- }
- if (0 < count($erroredfiles))
- {
- $filestring = "";
- ...........................................................................
- .............................
- ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement