Example #1
0
/**
 * if user agrees to send system information and the last sent info is outdated outputs a bunch of stuff that sends sysinfo without interrupting
 */
function fs_output_send_info_form()
{
    if (fs_is_admin() && fs_get_system_option("user_agreed_to_send_system_information") && fs_last_sent_info_outdated()) {
        ?>
        <iframe id="hidden_frame" name="hidden_frame" style="width:0px; height:0px; border: 0px" src="about:blank"></iframe>
        <form name="send_info_form" target="hidden_frame" method="post" action="<?echo FS_SYSINFO_URL?>">
            <?php 
        $sysinfo = fs_get_sysinfo();
        foreach ($sysinfo as $k => $v) {
            ?>
                        <input type="hidden" name="<?php 
            echo $k;
            ?>
" value="<?php 
            echo $v;
            ?>
"></input>
                    <?php 
        }
        ?>
        </form>
        <script type='text/javascript'>
        sendSilentRequest('action=saveSentSysInfo');
        document.forms['send_info_form'].submit();
        </script>
    <?php 
    }
}
Example #2
0
/**
 * store some usage FireStats usage information
 */
function fs_maintain_usage_stats()
{
    if (fs_is_admin()) {
        $first_run_time = fs_get_system_option('first_run_time');
        if (!$first_run_time) {
            fs_update_system_option('first_run_time', time());
        }
        $firestats_id = fs_get_system_option('firestats_id');
        if (!$firestats_id) {
            fs_update_system_option('firestats_id', mt_rand());
        }
    }
    $first_login = fs_get_option('first_login');
    if (!$first_login) {
        fs_update_option('first_login', time());
    }
}
Example #3
0
    ?>

<script type='text/javascript'>
//<![CDATA[
	// this is done here instead of sending an updated page in the first place
	// to improve startup time.
	updateAllStats();
	toggleAutoRefresh();
	sendSilentRequest('action=getNextUserMessage');

	<?php 
    if (fs_is_admin()) {
        if (fs_get_auto_bots_list_update() == 'true') {
            ?>
			sendSilentRequest('action=updateBotsList&update=botlist_placeholder,num_excluded&user_initiated=false');
			<?php 
        }
        if (fs_get_system_option('archive_method') == 'auto') {
            ?>
			FS.archiveOldData();
			<?php 
        }
        ?>
		sendSilentRequest('action=handle_pending_maintanence');
		<?php 
    }
    ?>
//]]>
</script>
<?php 
}
Example #4
0
function fs_add_pending_maintanence_job($id)
{
    $jobs = fs_get_system_option('pending_maintanence', '');
    if ($jobs == '') {
        $jobs = $id;
    } else {
        $jobs .= ",{$id}";
    }
    // remove duplicate jobs
    $jobs = implode(',', array_unique(explode(',', $jobs)));
    fs_update_system_option('pending_maintanence', $jobs);
}
Example #5
0
function fs_get_archive_method_dropbox()
{
    $automatically = fs_r('Automatically');
    $manually = fs_r('Manually');
    $select = fs_r('Please select');
    $n = fs_get_system_option('archive_method');
    $res = "<select id='archive_method' onchange=\"saveSystemOption('archive_method','archive_method','string')\">";
    if ($n == null) {
        $res .= "<option value='ask' selected='selected'>{$select}</option>";
    }
    $res .= "<option value='auto'" . ('auto' == $n ? " selected='selected'" : "") . ">{$automatically}</option>";
    $res .= "<option value='manual'" . ('manual' == $n ? " selected='selected'" : "") . ">{$manually}</option>";
    $res .= "</select>";
    return $res;
}
Example #6
0
function fs_ajax_handle_pending_maintanence(&$response)
{
    $str = fs_get_system_option('pending_maintanence', '');
    if ($str != '') {
        $jobs = explode(',', $str);
        if (count($jobs) > 0) {
            $job = array_pop($jobs);
            $response['execute'] = "FS.executeProcess('{$job}')";
            fs_update_system_option('pending_maintanence', implode(',', $jobs));
        }
    }
}
Example #7
0
function fs_get_archive_older_than()
{
    return fs_get_system_option('archive_older_than', 90);
}
Example #8
0
function fs_get_botlist_version_hash()
{
    return fs_get_system_option('botlist_version_hash', '');
}