count(); $oldData = C::t('common_cron')->range(0, $count); foreach ($oldData as $value) { if ($value['filename'] == 'cron_security_daily.php') { $cronId_security_daily = $value['cronid']; }elseif ($value['filename'] == 'cron_security_cleanup_lastpost.php') { $cronId_security_lastpost = $value['cronid']; } } } include DISCUZ_ROOT . 'source/language/lang_admincp_cloud.php'; if(file_exists(DISCUZ_ROOT . './source/include/cron/cron_security_cleanup_lastpost.php') && empty($cronId_security_lastpost)) { $data = array( 'available' => 1, 'type' => 'system', 'name' => $extend_lang['security_cron_lastpost'], 'filename' => 'cron_security_cleanup_lastpost.php', 'weekday' => -1, 'day' => -1, 'hour' => 7, 'minute' => 0, ); C::t('common_cron')->insert($data, true, false, false); } if (file_exists(DISCUZ_ROOT . './source/include/cron/cron_security_daily.php')) { if (empty($cronId_security_daily)) { $data = array( 'available' => 1, 'type' => 'system', 'name' => $extend_lang['security_cron_daily'], 'filename' => 'cron_security_daily.php', 'weekday' => -1, 'day' => -1, 'hour' => 2, 'minute' => 0, ); $cronId_security_daily = C::t('common_cron')->insert($data, true, false, false); } else { C::t('common_cron')->update($cronId_security_daily, array( 'available' => 1, 'weekday' => -1, 'day' => -1, 'hour' => 2, 'minute' => 0, )); } updatecache('setting'); discuz_cron::run($cronId_security_daily); } $updateData = array( 'security_usergroups_white_list' => serialize(array(1, 2, 3)), 'security_safelogin' => 1, ); C::t('common_setting')->update_batch($updateData); updatecache('setting'); $finish = true;