public function action_plugin_activation($file) { if (realpath($file) == __FILE__) { CronTab::add_cron(array('name' => 'pbem_check_accounts', 'callback' => array(__CLASS__, 'check_accounts'), 'increment' => 600, 'description' => 'Check for new PBEM mail every 600 seconds.')); ACL::create_token('PBEM', 'Directly administer posts from the PBEM plugin', 'pbem'); $dir = Site::get_dir('user') . '/files/PBEM'; if (!is_dir($dir)) { if (!mkdir($dir, 0755)) { EventLog::log('PBEM temporary storage directory ' . $dir . ' could not be created. Attachment processing will not work.', 'info', 'plugin', 'pbem'); Session::error('PBEM temporary storage directory ' . $dir . ' could not be created. Attachment processing will not work.'); } else { EventLog::log('PBEM temporary storage directory ' . $dir . ' created.', 'info', 'plugin', 'pbem'); } } } }
public function on_success($form) { $form->save(); $params = array('name' => 'fireeagle:refresh', 'callback' => 'fireeagle_refresh', 'increment' => Options::get('fireeagle__refresh_interval'), 'description' => 'Refreshing Fire Eagle Location'); CronTab::delete_cronjob($params['name']); CronTab::add_cron($params); return false; }