Permalink
Browse files

Fixed a bug with permissions

-By default, every user can post new status and comments on their own wall.
Fixed a bug with fetching the comments
Fixed an undefined index "enable_wall"
  • Loading branch information...
1 parent 98d0488 commit cf659a78a21844cb713ed057320d0c0ad21e86b5 @MissAllSunday committed Mar 17, 2012
Showing with 10 additions and 10 deletions.
  1. +4 −4 Breeze/Breeze_Query.php
  2. +4 −4 Breeze/Breeze_User.php
  3. +1 −1 hooks.php
  4. +1 −1 remove.php
View
@@ -357,7 +357,7 @@ protected function Status()
public function GetStatus()
{
- return $this->Status;
+ return $this->Status ? $this->Status : $this->Status();
}
/*
@@ -466,7 +466,7 @@ protected function Comments()
*/
public function GetComments()
{
- return $this->Comments;
+ return $this->Comments ? $this->Comments : $this->Comments();
}
/*
@@ -488,7 +488,7 @@ public function GetCommentsByStatus($id)
$this->ResetTemp();
$temp2 = array();
- $this->temp = $this->GetComments();
+ $this->temp = $this->Comments ? $this->Comments : $this->Comments();
foreach($this->temp as $c)
if ($c['status_id'] == $id)
@@ -945,7 +945,7 @@ protected function Notifications()
public function GetNotifications()
{
- return $this->Notifications();
+ return $this->Notifications ? $this->Notifications : $this->Notifications();
}
public function InsertNotification($array)
View
@@ -79,7 +79,7 @@ public static function Wall()
$user_settings = $query->GetUserSettings($context['member']['id']);
/* Does the user even enable this? */
- if ($user_settings['enable_wall'] == 0)
+ if (empty($user_settings['enable_wall']))
redirectexit('action=profile;area=static;u='.$context['member']['id']);
/* This user cannot see his/her own profile and cannot see any profile either */
@@ -180,9 +180,9 @@ public static function Wall()
$context['Breeze']['Modules'] = $modules->GetAllModules();
/* The visitor's permissions */
- $context['Breeze']['visitor']['post_status'] = allowedTo('breeze_postStatus');
- $context['Breeze']['visitor']['post_comment'] = allowedTo('breeze_postComments');
- $context['Breeze']['visitor']['delete_status_comments'] = allowedTo('breeze_deleteStatus');
+ $context['Breeze']['visitor']['post_status'] = allowedTo('breeze_postStatus') || $context['user']['is_owner'];
+ $context['Breeze']['visitor']['post_comment'] = allowedTo('breeze_postComments') || $context['user']['is_owner'];
+ $context['Breeze']['visitor']['delete_status_comments'] = allowedTo('breeze_deleteStatus') || $context['user']['is_owner'];
/* Write to the log */
$query->WriteProfileVisit($context['member']['id'], $user_info['id']);
View
@@ -5,7 +5,7 @@
*
* The purpose of this file is
* @package Breeze mod
- * @version 1.0 Beta 1
+ * @version 1.0 Beta 2
* @author Jessica González <missallsunday@simplemachines.org>
* @copyright Copyright (c) 2012, Jessica González
* @license http://www.mozilla.org/MPL/MPL-1.1.html
View
@@ -5,7 +5,7 @@
*
* The purpose of this file is to remove the hooks when uninstall
* @package Breeze mod
- * @version 1.0 Beta 1
+ * @version 1.0 Beta 2
* @author Jessica González <missallsunday@simplemachines.org>
* @copyright Copyright (c) 2012, Jessica González
* @license http://www.mozilla.org/MPL/MPL-1.1.html

0 comments on commit cf659a7

Please sign in to comment.