Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.5.0.0
- * @ Author : DeZender
- * @ Release on : 22.06.2018
- * @ Official site : http://DeZender.Net
- *
- */
- define('CRONS_PAGE', true);
- require_once 'load.php';
- if (PHP_SAPI !== 'cli' && (empty($_REQUEST['key']) || $_REQUEST['key'] !== $_OPTIONS['system']['cron_tasks_key'])) {
- do_deny_access();
- }
- $_OPTIONS['inline']['base_url'] = $_OPTIONS['system']['website_url'];
- $_OPTIONS['crontasks'] = $db->where('option_name', 'crontasks')->getValue('options', 'option_value');
- $_OPTIONS['crontasks'] = (empty($_OPTIONS['crontasks']) ? array() : json_decode($_OPTIONS['crontasks'], true));
- foreach ($_OPTIONS['crontasks'] as $key => $value) {
- if (substr($key, strlen($key) - 7, strlen($key)) !== '_period') {
- continue;
- }
- $cronP = array('val' => 1, 'unit' => 'minutes');
- $_process = do_fetch_period($value);
- if ($_process) {
- $cronP = array('val' => $_process['RV'], 'unit' => $_process['RU']);
- }
- $cronP['gm_value'] = (string) $cronP['val'] . ' ' . $cronP['unit'];
- $cronP['date_next'] = do_gmdate_format($cronP['gm_value']);
- $cronP['seconds'] = do_convert_period($cronP['val'], $cronP['unit']);
- $_OPTIONS['crontasks'][$key] = $cronP;
- }
- $helpDate = $_OPTIONS['inline']['date_now'];
- $taskList = $db->where('is_run', 0)->where("(`date_next` IS NULL OR `date_next` <= '" . $helpDate . "')")->get('tasks', null, array('task_id', 'system_slug', 'is_system', 'date_run', 'date_next', 'date_update'));
- if (!empty($taskList)) {
- foreach ($taskList as $key => $value) {
- $upData = array('is_run' => 1, 'date_run' => $_OPTIONS['inline']['date_now'], 'date_update' => $_OPTIONS['inline']['date_now']);
- if (!empty($value['is_system']) && isset($_OPTIONS['crontasks'][$value['system_slug'] . '_period'])) {
- $upData['date_next'] = $_OPTIONS['crontasks'][(string) $value['system_slug'] . '_period']['date_next'];
- } else {
- $upData['date_next'] = null;
- }
- $db->where('task_id', $value['task_id'])->update('tasks', $upData, 1);
- }
- }
- $systemTasks = $db->where('is_system', 1)->where('is_run', 1)->get('tasks');
- if (!empty($systemTasks)) {
- foreach ($systemTasks as $key => $taskData) {
- $_process = false;
- switch ($taskData['system_slug']) {
- case 'new_badge_reset':
- if (!isset($_OPTIONS['crontasks']['new_badge_reset_period'])) {
- break;
- }
- $helpDate = do_gmdate_format('- ' . $_OPTIONS['crontasks']['new_badge_reset_period']['gm_value']);
- foreach (array('articles', 'folders', 'files', 'products') as $tableName) {
- $_process = $db->where('is_new', 1)->where("(`date_new` IS NULL OR `date_new` <= '" . $helpDate . "')")->update($tableName, array('is_new' => 0, 'date_new' => null));
- if (!$_process) {
- break 2;
- }
- }
- break;
- case 'download_link_expire':
- $helpDate = $_OPTIONS['inline']['date_now'];
- $_process = $db->where('is_active', 1)->where("(`date_expire` IS NULL OR `date_expire` <= '" . $helpDate . "')")->update('udownloads', array('is_active' => 0));
- break;
- case 'users_temporary':
- if (!isset($_OPTIONS['crontasks']['users_temporary_period'])) {
- break;
- }
- $helpDate = do_gmdate_format('- ' . $_OPTIONS['crontasks']['users_temporary_period']['gm_value']);
- $_process = $db->where('is_verified', 0)->where('date_create', $helpDate, '<=')->delete('users');
- break;
- case 'package_expire_check':
- $helpDate = $_OPTIONS['inline']['date_now'];
- $_process = $db->where('is_active', 1)->where('`date_expire` IS NOT NULL')->where("`date_expire` <= '" . $helpDate . "'")->update('upackages', array('is_active' => 0));
- break;
- case 'package_extra_reset':
- $_process = $db->update('upackages', array('extra' => 0, 'extra_files' => 0));
- break;
- case 'package_fair_reset':
- $_process = $db->update('upackages', array('fair' => 0, 'fair_files' => 0));
- ...........................................................................
- .............................................
- ...................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement