From b7919e2a036f2ae8daac2d97a170a28e5b09c25f Mon Sep 17 00:00:00 2001
From: hahn <axel.hahn@iml.unibe.ch>
Date: Fri, 22 Jul 2022 19:34:57 +0200
Subject: [PATCH] for dev-env: force a user without login

---
 public_html/deployment/index.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/public_html/deployment/index.php b/public_html/deployment/index.php
index 8dc4e613..b57dfd06 100644
--- a/public_html/deployment/index.php
+++ b/public_html/deployment/index.php
@@ -66,6 +66,11 @@ $sTopAction=getAction();
 
 // ------ action 
 $oUser=new user();
+if (isset($aConfig["auth"]['forceuser']) && $aConfig["auth"]['forceuser']){
+    $oCLog->add("Found config -> auth -> forceuser: using fake identity [".$aConfig["auth"]['forceuser'].']', "warning");
+    $oUser->setUser($aConfig["auth"]['forceuser']);
+}
+
 if ($oUser->hasPermission('page_'.$sAction)){
 
     $sActionFile = __DIR__ . '/pages/act_' . $sAction . ".php";
-- 
GitLab