some spacing between files
[phorkie.git] / www / www-header.php
index 5381eed67a4f01e89b528ad7a47a8630d6031d9d..833fb8a56479a461382dba5983cfe6cfc9495551 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 namespace phorkie;
-error_reporting(error_reporting() & ~E_STRICT);
+error_reporting(error_reporting() & ~E_STRICT & ~E_DEPRECATED);
 session_set_cookie_params(14 * 86400);//2 weeks session expiry time
 session_start();
 
@@ -50,6 +50,12 @@ if (file_exists($cfgFilePath)) {
 
 if ($GLOBALS['phorkie']['cfg']['baseurl'] === null) {
     $GLOBALS['phorkie']['cfg']['baseurl'] = Tools::detectBaseUrl();
+    if (substr($GLOBALS['phorkie']['cfg']['git']['public'], 0, 9) == '%BASEURL%') {
+        //make autoconfig work
+        $GLOBALS['phorkie']['cfg']['git']['public'] = Tools::fullUrlNoPhar(
+            substr($GLOBALS['phorkie']['cfg']['git']['public'], 9)
+        );
+    }
 }
 
 // Set/Get git commit session variables
@@ -99,6 +105,10 @@ function render($tplname, $vars = array())
         $vars['identity'] = $_SESSION['identity'];
         $vars['name'] = $_SESSION['name'];
         $vars['email'] = $_SESSION['email'];
+    } else if (isset($_COOKIE['lastopenid'])
+        && !isset($_COOKIE['tried-autologin'])
+    ) {
+        $vars['autologin'] = true;
     }
     $vars['db'] = new Database();
     if (!isset($vars['htmlhelper'])) {