aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-03 09:51:18 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-03 09:51:18 +0000
commitf7ed47d81489cd0bfe1be6ee737a7dda772d779b (patch)
tree6169594ee3f4d04eb770fea643f0829b9f4580b8 /engine
parentcb321a0dad1f6ec1f3061c7882d5c244c702f0d5 (diff)
downloadelgg-f7ed47d81489cd0bfe1be6ee737a7dda772d779b.tar.gz
elgg-f7ed47d81489cd0bfe1be6ee737a7dda772d779b.tar.bz2
Pages can now manually override the page owner
git-svn-id: https://code.elgg.org/elgg/trunk@383 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/pageowner.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php
index 4ab3d2334..b1a3fe8ff 100644
--- a/engine/lib/pageowner.php
+++ b/engine/lib/pageowner.php
@@ -21,6 +21,12 @@
function page_owner() {
global $CONFIG;
+
+ $setpageowner = set_page_owner();
+ if ($setpageowner !== false) {
+ return $setpageowner;
+ }
+
if ($username = get_input("username")) {
if ($user = get_user_by_username($username)) {
return $user->getGUID();
@@ -82,4 +88,24 @@
}
+ /**
+ * Allows a page to manually set a page owner
+ *
+ * @param int $entitytoset The GUID of the page owner
+ * @return int|false Either the page owner we've just set, or false if unset
+ */
+ function set_page_owner($entitytoset = -1) {
+
+ static $entity;
+
+ if (!isset($entity)) $entity = false;
+
+ if ($entitytoset > -1) {
+ $entity = $entitytoset;
+ }
+
+ return $entity;
+
+ }
+
?> \ No newline at end of file