/**
 * Check if an update is available for PHP Server Monitor
 *
 * @global object $db
 * @return boolean
 */
function sm_check_updates()
{
    global $db;
    $last_update = sm_get_conf('last_update_check');
    if (time() - 7 * 24 * 60 * 60 > $last_update) {
        // been more than a week since update, lets go
        // update "update-date"
        $db->save(SM_DB_PREFIX . 'config', array('value' => time()), array('key' => 'last_update_check'));
        $latest = sm_curl_get('http://phpservermon.neanderthal-technology.com/version');
        $current = sm_get_conf('version');
        if ((int) $current < (int) $latest) {
            // new update available
            return true;
        }
    }
    return false;
}
 protected function _auth_https_post($host, $path, $data)
 {
     $url = $host . $path . $data;
     return sm_curl_get($url);
 }