summaryrefslogtreecommitdiffstats
path: root/examples/class/object.class.php
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-02-16 03:07:26 -0500
committerMalf Furious <m@lfurio.us>2017-02-16 03:07:26 -0500
commitea46bd0a4a040040c9cadd45441089bce9769bea (patch)
treecba2d9a7ac97cc5eb9a086c953a30c660e92e1fd /examples/class/object.class.php
parent127a6bba72f699816f227164661e7b451a4e7e76 (diff)
downloadscrott-ea46bd0a4a040040c9cadd45441089bce9769bea.tar.gz
scrott-ea46bd0a4a040040c9cadd45441089bce9769bea.zip
Rm old content
Diffstat (limited to 'examples/class/object.class.php')
-rw-r--r--examples/class/object.class.php291
1 files changed, 0 insertions, 291 deletions
diff --git a/examples/class/object.class.php b/examples/class/object.class.php
index 4bafc5c..6c036ed 100644
--- a/examples/class/object.class.php
+++ b/examples/class/object.class.php
@@ -3,297 +3,6 @@
abstract class Object extends Framework
{
/*
- * Check if given user has permissions for this object
- */
- function canAccess($user)
- {
- if ($user->admin)
- return true;
-
- if ($this->isOwner($user))
- return true;
-
- if ($this->isMember($user))
- return true;
-
- if ($this->perms & 0x004) // accessible by public
- return true;
-
- if ($this->parent != "")
- {
- $parent = new DBObject($this->parent);
-
- if ($parent->canAccessSub($user))
- return true;
- }
- else if ($this->owner != $this->guid)
- {
- $owner = new DBObject($this->owner);
-
- if ($owner->canAccessSub($user))
- return true;
- }
-
- return false;
- }
-
- /*
- * Check if given user has permissions for this object
- */
- function canModify($user)
- {
- if ($user->admin)
- return true;
-
- if ($this->isOwner($user))
- return true;
-
- if ($this->isMember($user) && $this->perms & 0x100)
- return true;
-
- if ($this->parent != "")
- {
- $parent = new DBObject($this->parent);
-
- if ($parent->canModifySub($user))
- return true;
- }
- else if ($this->owner != $this->guid)
- {
- $owner = new DBObject($this->owner);
-
- if ($owner->canModifySub($user))
- return true;
- }
-
- return false;
- }
-
- /*
- * Check if given user has permissions for this object
- */
- function canModifyMembers($user)
- {
- if ($user->admin)
- return true;
-
- if ($this->isOwner($user))
- return true;
-
- if ($this->isMember($user) && $this->perms & 0x080)
- return true;
-
- if ($this->parent != "")
- {
- $parent = new DBObject($this->parent);
-
- if ($parent->canModifySubMembers($user))
- return true;
- }
- else if ($this->owner != $this->guid)
- {
- $owner = new DBObject($this->owner);
-
- if ($owner->canModifySubMembers($user))
- return true;
- }
-
- return false;
- }
-
- /*
- * Check if given user has permissions for this object
- */
- function canModifyPermissions($user)
- {
- if ($user->admin)
- return true;
-
- if ($this->isOwner($user))
- return true;
-
- if ($this->parent != "")
- {
- $parent = new DBObject($this->parent);
-
- if ($parent->canModifySubPermissions($user))
- return true;
- }
- else if ($this->owner != $this->guid)
- {
- $owner = new DBObject($this->owner);
-
- if ($owner->canModifySubPermissions($user))
- return true;
- }
-
- return false;
- }
-
- /*
- * Check if given user has permissions for this object
- */
- function canAccessSub($user)
- {
- if ($user->admin)
- return true;
-
- if ($this->isOwner($user))
- return true;
-
- if ($this->isMember($user) && $this->perms & 0x040)
- return true;
-
- if ($this->perms & 0x002) // accessible by public
- return true;
-
- if ($this->parent != "")
- {
- $parent = new DBObject($this->parent);
-
- if ($parent->canAccessSub($user))
- return true;
- }
- else if ($this->owner != $this->guid)
- {
- $owner = new DBObject($this->owner);
-
- if ($owner->canAccessSub($user))
- return true;
- }
-
- return false;
- }
-
- /*
- * Check if given user has permissions for this object
- */
- function canCreateSub($user)
- {
- if ($user->admin)
- return true;
-
- if ($this->isOwner($user))
- return true;
-
- if ($this->isMember($user) && $this->perms & 0x020)
- return true;
-
- if ($this->perms & 0x001) // accessible by public
- return true;
-
- if ($this->parent != "")
- {
- $parent = new DBObject($this->parent);
-
- if ($parent->canCreateSub($user))
- return true;
- }
- else if ($this->owner != $this->guid)
- {
- $owner = new DBObject($this->owner);
-
- if ($owner->canCreateSub($user))
- return true;
- }
-
- return false;
- }
-
- /*
- * Check if given user has permissions for this object
- */
- function canModifySub($user)
- {
- if ($user->admin)
- return true;
-
- if ($this->isOwner($user))
- return true;
-
- if ($this->isMember($user) && $this->perms & 0x010)
- return true;
-
- if ($this->parent != "")
- {
- $parent = new DBObject($this->parent);
-
- if ($parent->canModifySub($user))
- return true;
- }
- else if ($this->owner != $this->guid)
- {
- $owner = new DBObject($this->owner);
-
- if ($owner->canModifySub($user))
- return true;
- }
-
- return false;
- }
-
- /*
- * Check if given user has permissions for this object
- */
- function canModifySubMembers($user)
- {
- if ($user->admin)
- return true;
-
- if ($this->isOwner($user))
- return true;
-
- if ($this->isMember($user) && $this->perms & 0x008)
- return true;
-
- if ($this->parent != "")
- {
- $parent = new DBObject($this->parent);
-
- if ($parent->canModifySubMembers($user))
- return true;
- }
- else if ($this->owner != $this->guid)
- {
- $owner = new DBObject($this->owner);
-
- if ($owner->canModifySubMembers($user))
- return true;
- }
-
- return false;
- }
-
- /*
- * Check if given user has permissions for this object
- */
- function canModifySubPermissions($user)
- {
- if ($user->admin)
- return true;
-
- if ($this->isOwner($user))
- return true;
-
- if ($this->parent != "")
- {
- $parent = new DBObject($this->parent);
-
- if ($parent->canModifySubPermissions($user))
- return true;
- }
- else if ($this->owner != $this->guid)
- {
- $owner = new DBObject($this->owner);
-
- if ($owner->canModifySubPermissions($user))
- return true;
- }
-
- return false;
- }
-
- /*
* Get URL to this object
*/
function getURL()