Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.0.9.0
  8. * @ Author : DeZender
  9. * @ Release on : 08.08.2019
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace Plugins\MassVoting;
  15.  
  16. require_once PLUGINS_PATH . '/' . IDNAME . '/vendor/autoload.php';
  17.  
  18. if (!defined('APP_VERSION')) {
  19. exit('Yo, what\'s up?');
  20. }
  21.  
  22. class SettingsController extends \Controller
  23. {
  24. const IDNAME = 'massvoting';
  25.  
  26. /**
  27. * Process
  28. * @return null
  29. */
  30. public function process()
  31. {
  32. $AuthUser = $this->getVariable('AuthUser');
  33. $this->setVariable('idname', self::IDNAME);
  34. if (!$AuthUser || !$AuthUser->isAdmin()) {
  35. header('Location: ' . APPURL . '/login');
  36. exit();
  37. }
  38. else if ($AuthUser->isExpired()) {
  39. header('Location: ' . APPURL . '/expired');
  40. exit();
  41. }
  42.  
  43. require_once PLUGINS_PATH . '/' . $this->getVariable('idname') . '/models/SchedulesModel.php';
  44. $Schedules = new SchedulesModel();
  45. $Schedules->setPageSize(20)->setPage(\Input::get('page'))->orderBy('process_id', 'ASC')->fetchData();
  46. $Schedule = [PLUGINS_PATH . '/' . $this->getVariable('idname') . '/models/ScheduleModel.php', 'Plugins\\MassVoting\\ScheduleModel'];
  47. require_once PLUGINS_PATH . '/' . $this->getVariable('idname') . '/models/LogsModel.php';
  48. $L = [PLUGINS_PATH . '/' . $this->getVariable('idname') . '/models/LogModel.php', 'Plugins\\MassVoting\\LogModel'];
  49. $LL_Ds = [];
  50.  
  51. foreach ($Schedules->getDataAs($Schedule) as $sc) {
  52. $LL = new LogsModel();
  53. $LL->setPageSize(1)->setPage(1)->where('user_id', '=', $sc->get('user_id'))->where('account_id', '=', $sc->get('account_id'))->orderBy('id', 'DESC')->fetchData();
  54.  
  55. foreach ($LL->getDataAs($L) as $l) {
  56. $LL_Ds[$sc->get('account_id')] = $l->get('date');
  57. }
  58. }
  59.  
  60. $server_info = NULL;
  61. exec('/usr/bin/top -b -n 1', $server_info);
  62. $this->setVariable('Schedules', $Schedules)->setVariable('Schedule', $Schedule)->setVariable('server_info', $server_info)->setVariable('LL_Ds', $LL_Ds);
  63. $this->setVariable('Settings', settings());
  64.  
  65. if (\Input::post('action') == 'save') {
  66. $this->save();
  67. }
  68. else if (\Input::post('action') == 'restart') {
  69. $this->restart();
  70. }
  71. else if (\Input::post('action') == 'bulk-restart') {
  72. $this->bulk_restart();
  73. }
  74.  
  75. $this->view(PLUGINS_PATH . '/' . self::IDNAME . '/views/settings.php', NULL);
  76. }
  77.  
  78. /**
  79. * Save plugin settings
  80. * @return boolean
  81. */
  82. private function save()
  83. {
  84. $Settings = $this->getVariable('Settings');
  85.  
  86. if (!$Settings->isAvailable()) {
  87. $Settings->set('name', 'plugin-' . self::IDNAME . '-settings');
  88. }
  89.  
  90. $maximum_speed = (int) \Input::post('maximum-speed');
  91.  
  92. if ($maximum_speed == 'maximum') {
  93. $maximum_speed = 'maximum';
  94. }
  95. else if ($maximum_speed < 10000) {
  96. $maximum_speed = 10000;
  97. }
  98. else if (800000 < $maximum_speed) {
  99. $maximum_speed = 800000;
  100. .....................................................................................
  101. ..............................................
  102. ...............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement