· 6 years ago · Apr 30, 2019, 09:10 AM
1<?php
2$navigateur = $_SERVER["HTTP_USER_AGENT"];
3$bannav = Array('HTTrack','httrack','WebCopier','HTTPClient','websitecopier','webcopier');
4foreach ($bannav as $banni)
5{ $comparaison = strstr($navigateur, $banni);
6if($comparaison!==false)
7 {
8 echo '<center>This tentative by using HTTrack was registered with successful!<br><br>Your IP adress was sended via email to angelzone.ro: ';
9 $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
10 echo '<br>';
11 echo $hostname;
12 echo '</center>';
13 exit;
14 }
15}
16if(!defined('rpg'))
17 die('Nope.');
18class Config {
19 private static $instance;
20 public static $g_con;
21 public static $_url = array();
22 public static $_pages = array(
23 'staff','online','search','banlist','members','top','vehicles','houses','businesses','login','logs','profile','logout',
24 'leader','admin','premium','forum','ticket','replyticket','seeticket','ban','unban','invite','leaderp','uninvite',
25 'fup','fdown','rup','rdown','adminp','lock','unlock','unbans','facapp','helperapp','leaderapp','adminapp','complaints','recover','verify'
26 );
27 public static $_PAGE_URL = 'http://hostumeu.eu/panel/'; // am bagat
28 public static $_IP = 'ip-ul:7777'; // am bagat
29 public static $factions = array();
30 public static $logs = array();
31 public static $invalid_url = array();
32 public static $vehColors = array();
33 public static $facColors = array();
34
35 private function __construct() {
36 $db['mysql'] = array(
37 'host' => '', // aici am conectat tot bine
38 'username' => 'samp',
39 'password' => 'ghena',
40 'dbname' => 'samp',
41 );
42
43 try {
44 self::$g_con = new PDO('mysql:host='.$db['mysql']['host'].';dbname='.$db['mysql']['dbname'].';charset=utf8',$db['mysql']['username'],$db['mysql']['password']);
45 self::$g_con->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
46 self::$g_con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
47 self::$_pages[] = $db;
48 } catch (PDOException $e) {
49 @file_put_contents('error_log',@file_get_contents('error_log') . $e->getMessage() . "\n");
50 die('Something went wrong.If you are the administrator,check error_log.');
51 }
52 self::_getUrl();
53 self::arrays();
54 }
55
56 public static function formatName($id,$name = null,$faction = null) {
57 if($name == null) {
58 $data = User::getData($id,array('Member','Name'));
59 $name = $data['Name'];
60 $faction = $data['Member'];
61 }
62 $color = Arrays::$_factions[$faction]['color'];
63 $name = '<a
64 href="'.Config::$_PAGE_URL.'profile/'.$id.'"
65 style="color:' . (!$faction ? '#919191' : $color ) . ';"
66 onmouseover="this.style.textDecoration = \'none\'; "
67 class="profile"
68 id="'.$id.'">' . $name .
69 '</a>';
70 return $name;
71 }
72
73 public static function init()
74 {
75 if (is_null(self::$instance))
76 {
77 self::$instance = new self();
78 }
79 return self::$instance;
80 }
81
82 private static function _getUrl() {
83 $url = isset($_GET['page']) ? $_GET['page'] : null;
84 $url = rtrim($url, '/');
85 $url = filter_var($url, FILTER_SANITIZE_URL);
86 self::$_url = explode('/', $url);
87 }
88
89 public static function getContent() {
90 if(isset(self::$_url[0]) && self::$_url[0] === 'signature') include_once 'inc/pages/signature.p.php'; ;
91 include_once 'inc/header.inc.php';
92
93 if(self::$_url[0] === 'admin' && isset(self::$_url[1]) && file_exists('inc/pages/admin/' . self::$_url[1] . '.a.php'))
94 include 'inc/pages/admin/' . self::$_url[1] . '.a.php';
95 else if(self::$_url[0] === 'admin')
96 include 'inc/pages/admin/index.a.php';
97
98 if(in_array(self::$_url[0],self::$_pages))
99 include 'inc/pages/' . self::$_url[0] . '.p.php';
100 else
101 include_once 'inc/pages/index.p.php';
102
103 include_once 'inc/footer.inc.php';
104 }
105
106 public static function rows($table) {
107 if(is_array($table)) {
108 $rows = 0;
109 foreach($table as $val) {
110 $q = self::$g_con->prepare("SELECT * FROM `".$val."`");
111 $q->execute();
112 $rows += $q->rowCount();
113 }
114 return $rows;
115 }
116 $q = self::$g_con->prepare("SELECT * FROM `".$table."`");
117 $q->execute();
118 return $q->rowCount();
119 }
120
121 public static function encrypt_decrypt($action, $string) {
122 $output = false;
123
124 $encrypt_method = "AES-256-CBC";
125 $secret_key = 'This is my secret key';
126 $secret_iv = 'This is my secret iv';
127
128 // hash
129 $key = hash('sha256', $secret_key);
130
131 // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning
132 $iv = substr(hash('sha256', $secret_iv), 0, 16);
133
134 if( $action == 'encrypt' ) {
135 $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);
136 $output = base64_encode($output);
137 }
138 else if( $action == 'decrypt' ){
139 $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);
140 }
141
142 return $output;
143 }
144
145 public static function generateRandomString($length = 10) {
146 $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
147 $charactersLength = strlen($characters);
148 $randomString = '';
149 for ($i = 0; $i < $length; $i++) {
150 $randomString .= $characters[rand(0, $charactersLength - 1)];
151 }
152 return $randomString;
153 }
154
155 public static function _getPage() {
156 return self::$_url[0];
157 }
158
159 public static function _invalid_webpage() {
160 return "asd";
161 }
162
163 public static function getPage() {
164 return isset(self::$_url[2]) ? self::$_url[2] : 1;
165 }
166
167 public static function isActive($active) {
168 if(is_array($active)) {
169 foreach($active as $ac) {
170 if($ac === self::$_url[0]) return ' class="active"';
171 }
172 return;
173 } else return self::$_url[0] === $active ? ' class="active"' : false;
174 }
175
176 public static function message($label,$text,$custom = null) {
177 if(isset($custom))
178 return '<' . $custom . '><span class="label label-'.$label.'">'.$text.'</span></' . $custom . '>';
179 else
180 return '<span class="label label-'.$label.'">'.$text.'</span>';
181 }
182
183 public static function button($label,$text,$custom = null) {
184 if(isset($custom))
185 return '<' . $custom . '><button class="btn btn-xs btn-'.$label.'">'.$text.'</button></' . $custom . '>';
186 else
187 return '<button class="btn btn-xs btn-'.$label.'">'.$text.'</button>';
188 }
189
190 public static function getDate($timestamp,$time = false){
191 if(!$timestamp) return 1;
192 $difference = time() - $timestamp;
193 if($difference < 0)
194 return 'just now';
195 $periods = array("second", "minute", "hour", "day", "week",
196 "month", "year", "decade");
197 $lengths = array("60","60","24","7","4.35","12","10");
198 if ($difference > 0) {
199 $ending = "ago";
200 } else {
201 $difference = -$difference;
202 $ending = "to go";
203 }
204 if(!$difference) return 'just now';
205 for($j = 0; $difference >= $lengths[$j]; $j++)
206 $difference /= $lengths[$j];
207 $difference = round($difference);
208 if($difference != 1) $periods[$j].= "s";
209 if($time) $text = "$difference $periods[$j]";
210 else $text = "$difference $periods[$j] $ending";
211 return $text;
212 }
213
214 private static function arrays() {
215 self::$factions = array(
216 0 => 'Civil',
217 1 => 'Los Santos PD',
218 2 => 'FBI',
219 3 => 'National Guard',
220 4 => 'Los Aztecas',
221 5 => 'Grove Street',
222 6 => 'Los Vagos',
223 7 => 'None',
224 8 => 'Las Venturas PD',
225 9 => 'News Reporter',
226 10 => 'Ballas',
227 11 => 'Hitman',
228 12 => 'School-Instructors LV',
229 13 => 'Taxi LS',
230 14 => 'Paramedic',
231 15 => 'Taxi Lv',
232 16=> 'School-Instructors LS',
233 17=> 'School-Instructors SF',
234 18=> 'Taxi SF',
235 19=> 'Paramedic SF',
236 20=> 'San Fierro PD',
237 21=> 'The Rifa',
238 22=> 'The Russian Mafia',
239 23=> 'Red Dragon Triads',
240 24=> 'The Italian Mafia',
241 25=> 'SF Bikers',
242 );
243 self::$invalid_url = array(
244 0 => 'default',
245 1 => 'invalid_urll'
246 );
247 self::$logs = array(
248 'logpolitiaromana' => 'Politia Romana',
249 'logserviciulroman' => 'S.R.I',
250 'logarmataromana' => 'Armata Romana',
251 'logsmurd' => 'S.M.U.R.D',
252 'logprimar' => 'Guvern',
253 'logtaxi' => 'Taxi',
254 'loginstructor' => 'School Instructor',
255 'loghitman' => 'Hitman Agency',
256 'logremorcari' => 'T.C.C',
257 'logsadoveanu' => 'Grove Street',
258 'logcorsicanu' => 'Stracci',
259 'logtobosaru' => 'Ballas',
260 'logcamataru' => 'Corleone',
261 );
262
263 self::$vehColors = array(
264 '#000000', '#F5F5F5', '#2A77A1', '#840410', '#263739', '#86446E', '#D78E10', '#4C75B7', '#BDBEC6', '#5E7072',
265 '#46597A', '#656A79', '#5D7E8D', '#58595A', '#D6DAD6', '#9CA1A3', '#335F3F', '#730E1A', '#7B0A2A', '#9F9D94',
266 '#3B4E78', '#732E3E', '#691E3B', '#96918C', '#515459', '#3F3E45', '#A5A9A7', '#635C5A', '#3D4A68', '#979592',
267 '#421F21', '#5F272B', '#8494AB', '#767B7C', '#646464', '#5A5752', '#252527', '#2D3A35', '#93A396', '#6D7A88',
268 '#221918', '#6F675F', '#7C1C2A', '#5F0A15', '#193826', '#5D1B20', '#9D9872', '#7A7560', '#989586', '#ADB0B0',
269 '#848988', '#304F45', '#4D6268', '#162248', '#272F4B', '#7D6256', '#9EA4AB', '#9C8D71', '#6D1822', '#4E6881',
270 '#9C9C98', '#917347', '#661C26', '#949D9F', '#A4A7A5', '#8E8C46', '#341A1E', '#6A7A8C', '#AAAD8E', '#AB988F',
271 '#851F2E', '#6F8297', '#585853', '#9AA790', '#601A23', '#20202C', '#A4A096', '#AA9D84', '#78222B', '#0E316D',
272 '#722A3F', '#7B715E', '#741D28', '#1E2E32', '#4D322F', '#7C1B44', '#2E5B20', '#395A83', '#6D2837', '#A7A28F',
273 '#AFB1B1', '#364155', '#6D6C6E', '#0F6A89', '#204B6B', '#2B3E57', '#9B9F9D', '#6C8495', '#4D8495', '#AE9B7F',
274 '#406C8F', '#1F253B', '#AB9276', '#134573', '#96816C', '#64686A', '#105082', '#A19983', '#385694', '#525661',
275 '#7F6956', '#8C929A', '#596E87', '#473532', '#44624F', '#730A27', '#223457', '#640D1B', '#A3ADC6', '#695853',
276 '#9B8B80', '#620B1C', '#5B5D5E', '#624428', '#731827', '#1B376D', '#EC6AAE', '#000000',
277 '#177517', '#210606', '#125478', '#452A0D', '#571E1E', '#010701', '#25225A', '#2C89AA', '#8A4DBD', '#35963A',
278 '#B7B7B7', '#464C8D', '#84888C', '#817867', '#817A26', '#6A506F', '#583E6F', '#8CB972', '#824F78', '#6D276A',
279 '#1E1D13', '#1E1306', '#1F2518', '#2C4531', '#1E4C99', '#2E5F43', '#1E9948', '#1E9999', '#999976', '#7C8499',
280 '#992E1E', '#2C1E08', '#142407', '#993E4D', '#1E4C99', '#198181', '#1A292A', '#16616F', '#1B6687', '#6C3F99',
281 '#481A0E', '#7A7399', '#746D99', '#53387E', '#222407', '#3E190C', '#46210E', '#991E1E', '#8D4C8D', '#805B80',
282 '#7B3E7E', '#3C1737', '#733517', '#781818', '#83341A', '#8E2F1C', '#7E3E53', '#7C6D7C', '#020C02', '#072407',
283 '#163012', '#16301B', '#642B4F', '#368452', '#999590', '#818D96', '#99991E', '#7F994C', '#839292', '#788222',
284 '#2B3C99', '#3A3A0B', '#8A794E', '#0E1F49', '#15371C', '#15273A', '#375775', '#060820', '#071326', '#20394B',
285 '#2C5089', '#15426C', '#103250', '#241663', '#692015', '#8C8D94', '#516013', '#090F02', '#8C573A', '#52888E',
286 '#995C52', '#99581E', '#993A63', '#998F4E', '#99311E', '#0D1842', '#521E1E', '#42420D', '#4C991E', '#082A1D',
287 '#96821D', '#197F19', '#3B141F', '#745217', '#893F8D', '#7E1A6C', '#0B370B', '#27450D', '#071F24', '#784573',
288 '#8A653A', '#732617', '#319490', '#56941D', '#59163D', '#1B8A2F', '#38160B', '#041804', '#355D8E', '#2E3F5B',
289 '#561A28', '#4E0E27', '#706C67', '#3B3E42', '#2E2D33', '#7B7E7D', '#4A4442', '#28344E'
290 );
291
292 self::$facColors = array(
293 0 => '#E8E8E8',
294 1 => '#2641FE',
295 2 => '#2641FE',
296 3 => '#1E519D',
297 4 => '#FF4800',
298 5 => '#8F8C47',
299 6 => '#FFFF00',
300 7 => '#33CCFF',
301 8 => '#AA3333',
302 9 => '#C2A2DA',
303 10 => '#F5DEB3',
304 11 => '#40863C',
305 12 => '#D900D9',
306 13 => '#FD7E00',
307 14 => '#B4BBCF',
308 15 => '#6A4444',
309 16 => '#45382A',
310 17 => '#E1F0E6',
311 18 => '#81A383'
312 );
313
314 }
315 public static function getData_s($id,$data) {
316 if(!is_array($data)) {
317 $q = Config::$g_con->prepare('SELECT `'.$data.'` FROM `users` WHERE `id` = ?');
318 $q->execute(array($id));
319 $fdata = $q->fetch();
320 return $fdata[$data];
321 } else {
322 $q = '';
323 foreach($data as $d) {
324 if(end($data) !== $d) $q .= '`'.$d.'`,';
325 else $q .= '`'.$d.'`';
326 }
327 $q = Config::$g_con->prepare('SELECT '.$q.' FROM `users` WHERE `id` = ?');
328 $q->execute(array($id));
329 return $q->fetch(PDO::FETCH_ASSOC);
330 }
331 }
332 public static function get() {
333 return (isset($_SESSION['user']) ? $_SESSION['user'] : false);
334 }
335 public static function getData($table,$data,$id) {
336 $q = Config::$g_con->prepare('SELECT `'.$data.'` FROM `'.$table.'` WHERE `id` = ?');
337 $q->execute(array($id));
338 $r_data = $q->fetch();
339 return $r_data[$data];
340 }
341 public static function getSpecificData($data,$data2,$id1,$id) {
342 if(!is_array($data)) {
343 $q = Config::$g_con->prepare('SELECT `'.$data.'` FROM `'.$data2.'` WHERE `'.$id1.'` = ?');
344 $q->execute(array($id));
345 $fdata = $q->fetch();
346 return $fdata[$data];
347 } else {
348 $q = '';
349 foreach($data as $d) {
350 if(end($data) !== $d) $q .= '`'.$d.'`,';
351 else $q .= '`'.$d.'`';
352 }
353 $q = Config::$g_con->prepare('SELECT '.$q.' FROM `'.$data2.'` WHERE `'.$id1.'` = ?');
354 $q->execute(array($id));
355 return $q->fetch(PDO::FETCH_ASSOC);
356 }