[254427] Externalize genie id
diff --git a/html/global.php b/html/global.php
index dbe23a0..fcb49a3 100644
--- a/html/global.php
+++ b/html/global.php
@@ -207,4 +207,18 @@
return implode("",$unicode);
}
}
+
+/**
+* Returns the genie user to be used for headless applications.
+* The user is found by looking for its id in the base.conf file.
+*/
+function getGenieUser() {
+ if (!($ini = @parse_ini_file(BABEL_BASE_DIR . 'classes/base.conf'))) {
+ errorLog("Failed to find/read conf file - aborting.");
+ exitTo("error.php?errNo=101300","error: 101300 - conf file can not be found");
+ }
+ $User = new User();
+ $User->loadFromID($ini['genie_id']); // genie
+ return $User;
+}
?>
\ No newline at end of file