[jasmine-commit] SF.net SVN: newsphp: [128] trunk/jasmine/classes/User.class.php
Brought to you by:
christoph_berg,
red-
|
From: <Re...@us...> - 2007-08-13 02:39:21
|
Revision: 128
http://newsphp.svn.sourceforge.net/newsphp/?rev=128&view=rev
Author: Red-
Date: 2007-08-12 19:39:23 -0700 (Sun, 12 Aug 2007)
Log Message:
-----------
Fixed a quick bug in the User Class dealing with the permissions.
Modified Paths:
--------------
trunk/jasmine/classes/User.class.php
Modified: trunk/jasmine/classes/User.class.php
===================================================================
--- trunk/jasmine/classes/User.class.php 2007-08-13 02:31:22 UTC (rev 127)
+++ trunk/jasmine/classes/User.class.php 2007-08-13 02:39:23 UTC (rev 128)
@@ -10,6 +10,7 @@
private $Logout = false;
public $Auth = false;
private $Session_ID;
+ private $Type;
static private $instance;
private $db;
@@ -131,18 +132,17 @@
* param $Type is the type of permission
* to get. Ie, Group or User. If it's not
* set, User is the permissions assigned.
+ * If it is set with anything, use Group
*
+ * @todo organize the method
+ *
* return true or false
*/
public function isAllowed($Type = NULL)
- {
- self::loadPermissions();
-
- if($Type == NULL)
- {
- $Type = 'User';
- }
-
+ {
+ $this->Type = ($Type == NULL ? 'User' : 'Group');
+ $this->loadPermissions();
+
return $this->permissions[$Type]['Allowed'];
}
@@ -150,6 +150,10 @@
* The actual loader for permissions
* from the db. Relays to isAllowed.
*
+ * It loads both permissions for added
+ * permission security. Ie: If a user
+ * is allowed, but a group is not and
+ * the other way around.
*/
private function loadPermissions()
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|