Advertisement
Guest User

Untitled

a guest
Mar 24th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.63 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.3
  8. * @ Author : DeZender
  9. * @ Release on : 06.05.2013
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class GameCP {
  15.  
  16.  
  17. public $ranNavStats = null;
  18. public $ranUserList = null;
  19. public $tools = array();
  20. public $key = "gamecpuniquekey";
  21. public $sentKey = "i1gruasdfc3padsr5abeccdada2s8r9oe0k1e2y3s4e5pn6t7t8opm0e";
  22. public $a = array(0 => "YmlsbGluZy5nYW1lY3AuY29t", 1 => "YmlsbGluZzIuZ2FtZWNwLmNvbQ==");
  23. public function __construct() {
  24.  
  25. $this->UsersOnline();
  26. return;
  27. }
  28.  
  29. public function ClientPermissions() {
  30.  
  31. $mp = array();
  32. $mp["voice"] = array("removeban", "removeallbans", "addban", "teamspeak", "control", "managevent", "edit", "savevent");
  33. $mp["services"] = array("taskschedule", "timeschedule", "mass", "fastdl", "edit", "edit2", "backup", "saveSched", "deleteSched", "restoreconfigs", "editgame", "addaddon", "addaddon2");
  34. $mp["support"] = array("massupdate", "update", "add", "edit", "new", "view", "viewc", "viewreply", "viewactive", "all", "deletetmpfiles", "download", "uploadfile");
  35. $mp["maps"] = array("install", "uninstall");
  36. $mp["clients"] = array("changepw", "removesubuser", "update", "edit", "updatesub", "editsubaccount", "newsubaccount", "addsubacct", "edit2", "cancel", "update", "viewsubaccount");
  37. $mp["dashboard"] = array();
  38. $mp["files"] = array("download", "wget", "remove", "upload", "doextract", "quickmanage", "edit", "cd", "rename", "mkdir", "mkfile", "addshortcut", "removeshortcut", "Save Changes");
  39. $mp["donations"] = array();
  40. $mp["console"] = array();
  41. $mp["configs"] = array("add", "new", "edit", "execute", "update", "remove", "editconfigs", "builder", "builderedit", "builderrun");
  42. $mp["cmdbackend"] = array("mass", "submitscreen", "viewlog", "downloadlog");
  43. $mp["billing"] = array("print", "view");
  44. $mp["serverstatus"] = array();
  45. $mp["process"] = array();
  46. $mp["payment"] = array();
  47. $mp["profile"] = array();
  48. $mp["modules"] = array("edit", "edit2");
  49. $mp["subusers"] = array("removesubuser", "updatesub", "newsubaccount", "editsubaccount", "addsubacct", "viewsubaccount");
  50. return $mp;
  51. }
  52.  
  53. public function AdminPermissions() {
  54.  
  55. $mp = array();
  56. $mp["payment"] = array();
  57. $mp["donations"] = array("update", "edit", "add", "remove", "edit2", "new");
  58. $mp["taxes"] = array("update", "edit", "add", "remove", "edit2", "new");
  59. $mp["promotions"] = array("update", "edit", "add", "remove", "edit2", "new");
  60. $mp["products"] = array("view", "new", "newproduct", "addprice", "newprice", "reorder", "viewpackages");
  61. $mp["productaddons"] = array("remove", "removetype", "save", "edit");
  62. $mp["gateways"] = array("update", "edit", "add", "remove", "edit2", "new");
  63. $mp["currencies"] = array("updaterates", "update", "edit", "add", "remove", "edit2", "new");
  64. $mp["billingcategories"] = array("update", "edit", "add", "remove", "edit2", "new");
  65. $mp["update"] = array("run", "download");
  66. $mp["ttcategories"] = array("update", "edit", "add", "remove", "edit2", "new");
  67. $mp["tools"] = array("custom", "autoip", "submitautoip", "sql", "submitsql", "backup", "backupv2", "cron", "cleanup", "optimize", "run_optimize", "phpinfo", "phpinfo2", "portcheck", "checkport");
  68. $mp["terminal"] = array();
  69. $mp["settings"] = array("edit", "logs", "testmail", "disableMaintenance", "update");
  70. $mp["schedule"] = array("remove", "save");
  71. $mp["portal"] = array("update", "edit", "add", "remove", "edit2", "new");
  72. $mp["orders"] = array("edit", "run", "remove", "pending", "fraud", "paid", "saveq", "edit2");
  73. $mp["online"] = array();
  74. $mp["notify"] = array("edit", "sendmasspre", "sendmass", "send", "sendpre", "sendall");
  75. $mp["newservice"] = array("new", "add");
  76. $mp["news"] = array("update", "edit", "add", "remove", "edit2", "new");
  77. $mp["newmachine"] = array("add", "new");
  78. $mp["machines"] = array("edit", "syncvoice", "updateftpd", "installcron", "updatebackend", "massremip", "edit2", "remove", "removeip", "updateip", "update", "addrange", "addip", "editip", "graphs", "migrate", "migrate2", "migrate3", "migrate4", "directions", "viewdetail");
  79. $mp["installgames"] = array();
  80. $mp["gameupdates"] = array("remove", "manage", "run", "view", "addedit", "doupdate");
  81. $mp["games"] = array("export", "import", "clone", "removeGame", "edit", "edit2", "add", "update", "new");
  82. $mp["emails"] = array("update", "edit", "add", "add2", "edit3", "edit2", "remove", "edit2", "new", "sendtest");
  83. $mp["configbuilder"] = array("updateitems", "removeitem", "edit2", "edit");
  84. $mp["commands"] = array("pre", "save", "sendsave", "send", "remove");
  85. $mp["admins"] = array("update", "edit", "add", "remove", "edit2", "new");
  86. $mp["addons"] = array("update", "edit", "add", "remove", "clone", "new");
  87. $mp["addoncategories"] = array("update", "edit", "add", "remove", "edit2", "new");
  88. $mp["subusers"] = array("removesubuser", "updatesub", "newsubaccount", "editsubaccount", "addsubacct", "viewsubaccount");
  89. $mp["voice"] = array("removeban", "removeallbans", "addban", "unsuspend", "suspend", "teamspeak", "control", "managevent", "edit", "savevent", "remove");
  90. $mp["services"] = array("taskschedule", "timeschedule", "mass", "fastdl", "edit", "edit2", "backup", "saveSched", "deleteSched", "changeuser", "unsuspend", "suspend", "restoreconfigs", "editgame", "addaddon", "addaddon2", "newgame2");
  91. $mp["support"] = array("massupdate", "update", "add", "edit", "new", "view", "viewc", "viewreply", "viewactive", "all", "deletetmpfiles", "download", "uploadfile");
  92. $mp["maps"] = array("install", "uninstall");
  93. $mp["clients"] = array("changepw", "removesubuser", "update", "edit", "add", "remove", "clone", "new", "updatesub", "editsubaccount", "newsubaccount", "export", "import", "resetpassword", "addsubacct", "edit2", "cancel", "update", "moveuser", "move2", "move3", "swapshell", "viewsubaccount");
  94. $mp["dashboard"] = array();
  95. $mp["files"] = array("download", "wget", "remove", "upload", "doextract", "quickmanage", "edit", "cd", "rename", "mkdir", "mkfile", "addshortcut", "removeshortcut", "Save Changes");
  96. $mp["console"] = array();
  97. $mp["serverstatus"] = array();
  98. $mp["process"] = array();
  99. $mp["payment"] = array();
  100. $mp["configs"] = array("add", "new", "edit", "execute", "update", "remove", "editconfigs", "builder", "builderedit", "builderrun");
  101. $mp["cmdbackend"] = array("mass", "submitscreen", "viewlog", "downloadlog");
  102. $mp["billing"] = array("print", "view");
  103. $mp["modules"] = array("update", "edit", "action", "remove", "edit2", "new");
  104. return $mp;
  105. }
  106.  
  107. public function CheckPermissions($page) {
  108.  
  109. global $mode;
  110. global $opt;
  111. global $noheader;
  112. if (!isset($_REQUEST["mode"]))
  113. {
  114. $_REQUEST["mode"] = "";
  115. }
  116. if (!isset($_REQUEST["mode"]) && isset($mode))
  117. {
  118. $_REQUEST["mode"] = $mode;
  119. }
  120. $failed = false;
  121. $perms = $_SESSION["gamecp"]["userinfo"]["permissions"];
  122. if ($_SESSION["gamecp"]["userinfo"]["ulevel"] == "0")
  123. {
  124. $mainperms = $this->ClientPermissions();
  125. if (!isset($mainperms[$page]))
  126. {
  127. $failed = true;
  128. }
  129. }
  130. else
  131. {
  132. $mainperms = $this->AdminPermissions();
  133. if (!array_key_exists($page, $mainperms))
  134. {
  135. return true;
  136. }
  137. if (!empty($_REQUEST["mode"]) && !isset($mainperms[$page][$_REQUEST["mode"]]))
  138. {
  139. return true;
  140. }
  141. }
  142. if (!(!is_array($perms)) && !array_key_exists($page, $perms))
  143. {
  144. $failed = true;
  145. }
  146. if (!empty($_REQUEST["mode"]))
  147. {
  148. if (!in_array($_REQUEST["mode"], $mainperms[$page]))
  149. {
  150. return true;
  151. }
  152. if (!isset($perms[$page][$_REQUEST["mode"]]))
  153. {
  154. $failed = true;
  155. }
  156. }
  157. if ($failed)
  158. {
  159. if (!$noheader)
  160. {
  161. $this->loadIncludes("panel");
  162. $Panel = new Panel();
  163. $Panel->ErrorExit('' . "You do not have permission to view this page. (" . $page . ")");
  164. return null;
  165. }
  166. exit();
  167. }
  168. return;
  169. }
  170.  
  171. public function RegisterTool($title, $tool) {
  172.  
  173. $this->tools[$tool] = $title;
  174. return;
  175. }
  176.  
  177. public function GetTools() {
  178.  
  179. return $this->tools;
  180. }
  181.  
  182. public function SecureHome($fname, $afile) {
  183.  
  184. $ofile = str_replace("..", "", $afile);
  185. if (strpos($afile, '' . "/home/" . $fname) === false)
  186. {
  187. return FMError("You do not have permission to view this location, error: FILE3a.");
  188. }
  189. return;
  190. }
  191.  
  192. public function GetSessionKey() {
  193.  
  194. return md5(md5($_SESSION["gamecp"]["userinfo"]["id"]) . $_SESSION["gamecp"]["userinfo"]["name"] . md5("GCP" . $this->whitelist($_SERVER["REMOTE_ADDR"], "int")));
  195. }
  196.  
  197. public function ConvertBytes($size) {
  198.  
  199. $unit = array("bytes", "KB", "MB", "GB", "TB", "PB");
  200. return @round($size / pow(1024, $i = floor(log($size, 1024))), 2) . " " . $unit[$i];
  201. }
  202.  
  203. public function ConvertToBytes($size) {
  204.  
  205. $var = explode(" ", $size);
  206. if ($var[1] == "MB")
  207. {
  208. return $var[0] * 1024 * 1024;
  209. }
  210. if ($var[1] == "GB")
  211. {
  212. return round($var[0] * 1024 * 1024 * 1024);
  213. }
  214. return;
  215. }
  216.  
  217. public function LoginSession() {
  218.  
  219. if (isset($_SESSION["gamecp"]["lang"]))
  220. {
  221. $lang = $_SESSION["gamecp"]["lang"];
  222. }
  223. if (isset($_SESSION["gamecp"]["upgrades"]))
  224. {
  225. $upgrades = $_SESSION["gamecp"]["upgrades"];
  226. }
  227. if (isset($_SESSION["gamecp"]["copyright"]))
  228. {
  229. $copyright = $_SESSION["gamecp"]["copyright"];
  230. }
  231. if (isset($_SESSION["gamecp"]["basic"]))
  232. {
  233. $clanmode = $_SESSION["gamecp"]["basic"];
  234. }
  235. if (isset($lang))
  236. {
  237. $_SESSION["gamecp"]["lang"] = $lang;
  238. }
  239. if (isset($upgrades))
  240. {
  241. $_SESSION["gamecp"]["upgrades"] = $upgrades;
  242. unset($upgrades);
  243. ................................................................
  244. ...............................
  245. ...............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement