]> git.mxchange.org Git - friendica-addons.git/blobdiff - ifttt/ifttt.php
GContact moved to src
[friendica-addons.git] / ifttt / ifttt.php
index e5428e82b45b08935cdb0571e86098e018fec26f..2828d5026562719a2ca69c2bef36e9361a8c1f91 100644 (file)
@@ -9,6 +9,8 @@
 require_once("mod/item.php");
 require_once("include/items.php");
 
+use Friendica\Core\PConfig;
+
 function ifttt_install() {
        register_hook('connector_settings',     'addon/ifttt/ifttt.php', 'ifttt_settings');
        register_hook('connector_settings_post','addon/ifttt/ifttt.php', 'ifttt_settings_post');
@@ -30,11 +32,11 @@ function ifttt_settings(&$a,&$s) {
         if(! local_user())
                 return;
 
-        $key = get_pconfig(local_user(),'ifttt','key');
+        $key = PConfig::get(local_user(),'ifttt','key');
 
        if (!$key) {
                $key = substr(random_string(),0,20);
-               set_pconfig(local_user(),'ifttt','key', $key);
+               PConfig::set(local_user(),'ifttt','key', $key);
        }
 
        $s .= '<span id="settings_ifttt_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_ifttt_expanded\'); openClose(\'settings_ifttt_inflated\');">';
@@ -75,7 +77,7 @@ function ifttt_settings_post(&$a,&$b) {
 
         if(x($_POST,'ifttt-submit'))
                 if (isset($_POST['ifttt-rekey']))
-                        del_pconfig(local_user(), 'ifttt', 'key');
+                        PConfig::delete(local_user(), 'ifttt', 'key');
 }
 
 function ifttt_post(&$a) {
@@ -102,7 +104,7 @@ function ifttt_post(&$a) {
        $key = $_REQUEST["key"];
 
        // Check the key
-        if ($key != get_pconfig($uid,'ifttt','key')) {
+        if ($key != PConfig::get($uid,'ifttt','key')) {
                logger("Invalid key for user ".$uid, LOGGER_DEBUG);
                return;
        }