]> git.mxchange.org Git - friendica.git/commitdiff
Remove unused parameter in can_write_wall()
authorHypolite Petovan <mrpetovan@gmail.com>
Thu, 4 Jan 2018 02:05:55 +0000 (21:05 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Thu, 4 Jan 2018 17:21:13 +0000 (12:21 -0500)
include/like.php
include/security.php
mod/item.php
mod/photos.php
mod/profile.php
mod/subthread.php
src/Object/Thread.php

index 8b8759c2f6401b90061cb6c90092d306e3f50c0d..793ea04215e62b0be9607b667d70373c7f5ce7fd 100644 (file)
@@ -85,7 +85,7 @@ function do_like($item_id, $verb) {
                $uid = local_user();
        }
 
-       if (!can_write_wall($a, $uid)) {
+       if (!can_write_wall($uid)) {
                logger('like: unable to write on wall ' . $uid);
                return false;
        }
index c443586c252a48fa946a6623ee28b5a9f0daa730..3cdfb4f28d83ab6921d6f3f152def8b886cacbf3 100644 (file)
@@ -165,7 +165,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
        }
 }
 
-function can_write_wall(App $a, $owner)
+function can_write_wall($owner)
 {
        static $verified = 0;
 
@@ -174,8 +174,7 @@ function can_write_wall(App $a, $owner)
        }
 
        $uid = local_user();
-
-       if (($uid) && ($uid == $owner)) {
+       if ($uid == $owner) {
                return true;
        }
 
index 1faef960163c7845bad16b15a814d58a747dd667..feb0496a3600c1db6e152fda6f4cd86309ea44f9 100644 (file)
@@ -215,7 +215,7 @@ function item_post(App $a) {
         * Now check that it is a page_type of PAGE_BLOG, and that valid personal details
         * have been provided, and run any anti-spam plugins
         */
-       if (!(can_write_wall($a, $profile_uid) || $allow_comment) && !$allow_moderated) {
+       if (!(can_write_wall($profile_uid) || $allow_comment) && !$allow_moderated) {
                notice(t('Permission denied.') . EOL) ;
                if (x($_REQUEST, 'return')) {
                        goaway($return_path);
index 54cfd7d4f7fa19f430037e40e09b92d5d1ee5213..ab0ad75013c24f03678dc2e63730f2725b1cd48a 100644 (file)
@@ -1499,7 +1499,7 @@ function photos_content(App $a)
                        $tpl = get_markup_template('photo_item.tpl');
                        $return_url = $a->cmd;
 
-                       if ($can_post || can_write_wall($a, $owner_uid)) {
+                       if ($can_post || can_write_wall($owner_uid)) {
                                $like_tpl = get_markup_template('like_noshare.tpl');
                                $likebuttons = replace_macros($like_tpl, array(
                                        '$id' => $link_item['id'],
@@ -1511,7 +1511,7 @@ function photos_content(App $a)
                        }
 
                        if (!DBM::is_result($r)) {
-                               if (($can_post || can_write_wall($a, $owner_uid)) && $link_item['last-child']) {
+                               if (($can_post || can_write_wall($owner_uid)) && $link_item['last-child']) {
                                        $comments .= replace_macros($cmnt_tpl, array(
                                                '$return_path' => '',
                                                '$jsreload' => $return_url,
@@ -1550,7 +1550,7 @@ function photos_content(App $a)
                                        $dislike = format_like($conv_responses['dislike'][$link_item['uri']], $conv_responses['dislike'][$link_item['uri'] . '-l'], 'dislike', $link_item['id']);
                                }
 
-                               if (($can_post || can_write_wall($a, $owner_uid)) && $link_item['last-child']) {
+                               if (($can_post || can_write_wall($owner_uid)) && $link_item['last-child']) {
                                        $comments .= replace_macros($cmnt_tpl,array(
                                                '$return_path' => '',
                                                '$jsreload' => $return_url,
@@ -1623,7 +1623,7 @@ function photos_content(App $a)
                                                '$comment' => $comment
                                        ));
 
-                                       if (($can_post || can_write_wall($a, $owner_uid)) && $item['last-child']) {
+                                       if (($can_post || can_write_wall($owner_uid)) && $item['last-child']) {
                                                $comments .= replace_macros($cmnt_tpl, array(
                                                        '$return_path' => '',
                                                        '$jsreload' => $return_url,
index bebd28403007c6a58643ad4fa9813b8e64af5890..ce2c5348d92dfae3c88347619de246153a9cb336 100644 (file)
@@ -194,7 +194,7 @@ function profile_content(App $a, $update = 0)
                $a->page['aside'] .= categories_widget(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], (x($category) ? xmlify($category) : ''));
                $a->page['aside'] .= tagcloud_wall_widget();
 
-               if (can_write_wall($a, $a->profile['profile_uid'])) {
+               if (can_write_wall($a->profile['profile_uid'])) {
                        $x = array(
                                'is_owner' => $is_owner,
                                'allow_location' => ($is_owner || $commvisitor) && $a->profile['allow_location'],
index a597b169872feb63a144aa5def4ae12d333ad2ac..9200c335e1b7b457eefe2441629691fc617d15b8 100644 (file)
@@ -32,7 +32,7 @@ function subthread_content(App $a) {
 
        $owner_uid = $item['uid'];
 
-       if(! can_write_wall($a,$owner_uid)) {
+       if(! can_write_wall($owner_uid)) {
                return;
        }
 
index a03bae6e9d1da65f3b052293fb0d1090e86f8d72..534095efbb3a745cb9773bca013c7ee310016d6a 100644 (file)
@@ -60,11 +60,11 @@ class Thread extends BaseObject
                                break;
                        case 'profile':
                                $this->profile_owner = $a->profile['profile_uid'];
-                               $this->writable = can_write_wall($a, $this->profile_owner);
+                               $this->writable = can_write_wall($this->profile_owner);
                                break;
                        case 'display':
                                $this->profile_owner = $a->profile['uid'];
-                               $this->writable = can_write_wall($a, $this->profile_owner) || $writable;
+                               $this->writable = can_write_wall($this->profile_owner) || $writable;
                                break;
                        case 'community':
                                $this->profile_owner = local_user();