diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/pageowner.php | 26 |
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 |