Пример #1
0
function fs_last_sent_info_outdated()
{
    $last_sysinfo_ser = fs_get_option('last_sent_sysinfo');
    if ($last_sysinfo_ser) {
        $current_sysinfo = fs_get_sysinfo();
        $last_sysinfo = unserialize($last_sysinfo_ser);
        foreach ($last_sysinfo as $k => $v) {
            if (isset($current_sysinfo[$k]) && $current_sysinfo[$k] != $last_sysinfo[$k]) {
                return true;
            }
        }
        return false;
    }
    return true;
}
Пример #2
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 
    }
}
Пример #3
0
function fs_ajax_saveSentSysInfo(&$response)
{
    if (!fs_ajax_assert_admin($response)) {
        return;
    }
    $si = fs_get_sysinfo();
    fs_update_system_option('last_sent_sysinfo', serialize($si));
}