mikuli.cz

:)
git clone https://git.sr.ht/~ashymad/mikuli.cz
Log | Files | Refs

commit 724359ff542d3d9c6ea419f2bd5ab958fe31b516
parent 8b0028981910ccdd4ed50d889eb689b6873d5a35
Author: markseu <mark2011@mayberg.se>
Date:   Mon,  6 Jul 2015 16:07:10 +0200

Core update (localhost support)

Diffstat:
MREADME.md | 2+-
Msystem/core/core-webinterface.php | 14+++++++++-----
Msystem/core/core.php | 2+-
3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md @@ -1,4 +1,4 @@ -Yellow 0.5.22 +Yellow 0.5.23 ============= [![Yellow](https://raw.githubusercontent.com/wiki/datenstrom/yellow/images/yellow.jpg)](http://datenstrom.se/yellow) diff --git a/system/core/core-webinterface.php b/system/core/core-webinterface.php @@ -5,7 +5,7 @@ // Web interface core plugin class YellowWebinterface { - const Version = "0.5.17"; + const Version = "0.5.18"; var $yellow; //access to API var $active; //web interface is active? (boolean) var $userLoginFailed; //web interface login failed? (boolean) @@ -625,10 +625,12 @@ class YellowWebinterfaceUsers if($this->isExisting($email)) { $location = $this->yellow->config->get("serverBase").$this->yellow->config->get("webinterfaceLocation"); + $domain = $this->yellow->config->get("webinterfaceServerName"); + $expire = time()+60*60*24*30*365; $session = $this->yellow->toolbox->createHash($this->users[$email]["hash"], "sha256"); if(empty($session)) $session = "error-hash-algorithm-sha256"; - setcookie($cookieName, "$email,$session", time()+60*60*24*30*365, $location, - $this->yellow->config->get("webinterfaceServerName"), + if($domain == "localhost") $domain = $expire = false; + setcookie($cookieName, "$email,$session", $expire, $location, $domain, $this->yellow->config->get("webinterfaceServerScheme")=="https"); } } @@ -637,8 +639,10 @@ class YellowWebinterfaceUsers function destroyCookie($cookieName) { $location = $this->yellow->config->get("serverBase").$this->yellow->config->get("webinterfaceLocation"); - setcookie($cookieName, "", time()-3600, - $location, $this->yellow->config->get("webinterfaceServerName"), + $domain = $this->yellow->config->get("webinterfaceServerName"); + $expire = time()-3600; + if($domain == "localhost") $domain = $expire = false; + setcookie($cookieName, "", $expire, $location, $domain, $this->yellow->config->get("webinterfaceServerScheme")=="https"); } diff --git a/system/core/core.php b/system/core/core.php @@ -5,7 +5,7 @@ // Yellow main class class Yellow { - const Version = "0.5.22"; + const Version = "0.5.23"; var $page; //current page var $pages; //pages from file system var $files; //files from file system