Merge branch '3.6-rc'
[friendica-addons.git] / remote_permissions / remote_permissions.php
index 94bdf5c11ea0d89a8a7320cf9882287e015759c9..b1651517408060f029fe3061a15248c7a5beddd3 100644 (file)
@@ -4,7 +4,7 @@
  * Description: Allow the recipients of private posts to see who else can see the post by clicking the lock icon
  * Version: 1.0
  * Author: Zach <https://f.shmuz.in/profile/techcity>
- *
+ * 
  */
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
@@ -28,7 +28,7 @@ function remote_permissions_settings(&$a,&$o) {
        if(! local_user())
                return;
 
-       $global = Config::get("remote_perms", "global");
+       $global = get_config("remote_perms", "global");
        if($global == 1)
                return;
 
@@ -38,8 +38,8 @@ function remote_permissions_settings(&$a,&$o) {
 
        /* Get the current state of our config variable */
 
-       $remote_perms = PConfig::get(local_user(),'remote_perms','show');
-
+       $remote_perms = get_pconfig(local_user(),'remote_perms','show');
+       
        /* Add some HTML to the existing form */
 
 //     $t = file_get_contents("addon/remote_permissions/settings.tpl" );
@@ -66,13 +66,13 @@ function remote_permissions_content($a, $item_copy) {
        if($item_copy['uid'] != local_user())
                return;
 
-       if(Config::get('remote_perms','global') == 0) {
+       if(get_config('remote_perms','global') == 0) {
                // Admin has set Individual choice. We need to find
                // the original poster. First, get the contact's info
                $r = q("SELECT nick, url FROM contact WHERE id = %d LIMIT 1",
                       intval($item_copy['contact-id'])
                );
-               if(! $r)
+               if(! $r) 
                        return;
 
                // Find out if the contact lives here
@@ -89,14 +89,14 @@ function remote_permissions_content($a, $item_copy) {
                if(! $r)
                        return;
 
-               if(PConfig::get($r[0]['uid'],'remote_perms','show') == 0)
+               if(get_pconfig($r[0]['uid'],'remote_perms','show') == 0)
                        return;
        }
 
        if(($item_copy['private'] == 1) && (! strlen($item_copy['allow_cid'])) && (! strlen($item_copy['allow_gid']))
                && (! strlen($item_copy['deny_cid'])) && (! strlen($item_copy['deny_gid']))) {
 
-               $allow_names = [];
+               $allow_names = array();
 
                // Check for the original post here -- that's the only way
                // to definitely get all of the recipients
@@ -132,7 +132,7 @@ function remote_permissions_content($a, $item_copy) {
                                $r = q("SELECT DISTINCT `contact-id` FROM group_member WHERE gid IN ( %s )",
                                        dbesc(implode(', ', $allowed_groups))
                                );
-                               foreach($r as $rr)
+                               foreach($r as $rr) 
                                        $allow[] = $rr['contact-id'];
                        }
                        $allow = array_unique($allow + $allowed_users);
@@ -141,7 +141,7 @@ function remote_permissions_content($a, $item_copy) {
                                $r = q("SELECT DISTINCT `contact-id` FROM group_member WHERE gid IN ( %s )",
                                        dbesc(implode(', ', $deny_groups))
                                );
-                               foreach($r as $rr)
+                               foreach($r as $rr) 
                                        $deny[] = $rr['contact-id'];
                        }
                        $deny = $deny + $deny_users;
@@ -168,7 +168,7 @@ function remote_permissions_content($a, $item_copy) {
                        if(! $r)
                                return;
 
-                       $allow = [];
+                       $allow = array();
                        foreach($r as $rr)
                                $allow[] = $rr['uid'];