function prowl_is_key_valid($api_key)
 {
     require_once 'prowl.php';
     $settings = $this->get_settings();
     if ($api_key) {
         $prowl = new Prowl($api_key, $settings->site_title);
         $verify = $prowl->verify();
         if (!$verify) {
             WPTOUCH_DEBUG(WPTOUCH_WARNING, 'Unable to verify Prowl API Key: ' . $api_key);
         }
         return $verify === true;
     }
     return false;
 }
function bnc_wptouch_is_prowl_key_valid()
{
    require_once 'include/class.prowl.php';
    $settings = bnc_wptouch_get_settings();
    if (isset($settings['prowl-api'])) {
        $api_key = $settings['prowl-api'];
        $prowl = new Prowl($api_key, WPTOUCH_PROWL_APPNAME);
        $verify = $prowl->verify();
        return $verify === true;
    }
    return false;
}
Exemple #3
0
         unset($growl);
         sleep(1);
         // Helps for temporary problems
         if ($tries == 5) {
             $growl_exception = '<div class="notice">' . $e->getMessage();
             $growl_exception .= '<br />I\'ll still try and send you notifications, though.<br />Make sure you double check your password!</div>';
         }
     }
 }
 if ($vars['prowl_api_key'] != '') {
     include_once 'includes/ProwlPHP.php';
     include_once 'includes/prowl.inc.php';
     $prowl = new Prowl();
     $keys = explode(',', $vars['prowl_api_key']);
     foreach ($keys as $key) {
         if (!$prowl->verify($key, $prowl_provider_key)) {
             $api_key_fail = true;
         }
     }
 }
 if ($vars['custom_url'] != '') {
     $url = $vars['custom_url'];
     $url = str_replace('$name', 'name', $url);
     $url = str_replace('$body', 'body', $url);
     if (!filter_var($url, FILTER_VALIDATE_URL)) {
         $custom_url_fail = true;
     }
 }
 if (!$host_fail && !$pass_fail && !$api_key_fail && !$custom_url_fail) {
     $vars = array_map('mysql_real_escape_string', $vars);
     $res = mysql_query("UPDATE `users` SET `growl_password` = '{$vars['growl_password']}', `growl_host` = '{$vars['growl_host']}', `prowl_api_key` = '{$vars['prowl_api_key']}', `custom_url` = '{$vars['custom_url']}' WHERE `identity` = '{$id}' LIMIT 1") or die(mysql_error());