From f809e76743a6ccab2badf69633bb6132c1358f2e Mon Sep 17 00:00:00 2001 From: ewinslow Date: Wed, 15 Sep 2010 19:31:39 +0000 Subject: Refs #2220: Pulled remaining classes out of lib files. Core classes now autoloaded via __autoload(). git-svn-id: http://code.elgg.org/elgg/trunk@6941 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/AccessControlQueryComponent.php | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 engine/classes/AccessControlQueryComponent.php (limited to 'engine/classes/AccessControlQueryComponent.php') diff --git a/engine/classes/AccessControlQueryComponent.php b/engine/classes/AccessControlQueryComponent.php new file mode 100644 index 000000000..ad5410ddc --- /dev/null +++ b/engine/classes/AccessControlQueryComponent.php @@ -0,0 +1,40 @@ +acl_table = $CONFIG->dbprefix . sanitise_string($acl_table); + $this->acl_field = sanitise_string($acl_field); + $this->object_owner_table = $CONFIG->dbprefix . sanitise_string($object_owner_table); + $this->object_owner_id_field = sanitise_string($object_owner_id_field); + } + + function __toString() + { + //$access = get_access_list(); + // KJ - changed to use get_access_sql_suffix + // Note: currently get_access_sql_suffix is hardwired to use + // $acl_field = "access_id", $object_owner_table = $acl_table, and + // $object_owner_id_field = "owner_guid" + // @todo recode get_access_sql_suffix to make it possible to specify alternate field names + return "and ".get_access_sql_suffix($this->acl_table); // Add access controls + + //return "and ({$this->acl_table}.{$this->acl_field} in {$access} or ({$this->acl_table}.{$this->acl_field} = 0 and {$this->object_owner_table}.{$this->object_owner_id_field} = {$_SESSION['id']}))"; + } +} -- cgit v1.2.3