wenn man im Backend am pflegen ist und dann z.B. im Firefox ein weiteren Tab auf macht um sich die Sachen im Frontend anzuschauen bekommt man statt der Inhaltsseite die Contenido (Backend) Login Maske angezeigt. Hier kann man aber einen Backend User wie man will eintippen. Man kommt nicht weiter. Problemlösung ist es die Cookies zu löschen oder alle Browserfenster zu schliessen. Da dieses nicht praktikabel ist, habe ich einige Dateien von Contenido angepasst, so dass der Pfad des Cookies für das Backend auch nur für das Backend gesetzt wird.
Nachfolgend die Anpassungen:
Dies sind 3 Dateien. Alle im conlib Ordner.
local.php ab Zeile 114: Austausch / Anpassung der Klasse "Contenido_Session"
Code: Alles auswählen
class Contenido_Session extends Session
{
var $classname = 'Contenido_Session';
var $cookiename = 'contenido'; ## defaults to classname
var $magic = '123Hocuspocus'; ## ID seed
var $mode = 'get'; ## We propagate session IDs with cookies
var $fallback_mode = 'cookie';
var $lifetime = 0; ## 0 = do session cookies, else minutes
var $that_class = 'Contenido_CT_Sql'; ## name of data storage container
var $gc_probability = 5;
##################################################
# Korrektur des Cookiepfades fürs Backend
##################################################
var $cookie_path = null;
function init($cfg_path)
{
$this->cookie_path = '/';
if (preg_match("/^(http\:\/\/)?(www\.)?((([a-z0-9]([\-_\.\~]*[a-z0-9])*)\.)*(([a-z0-9]([\-_\.\~]*[a-z0-9])*)\.?([a-z0-9]{2,4})?))\/?/i", $cfg_path, $regMatch))
{
$this->cookie_path = '/'.str_replace($regMatch[0], '', $cfg_path);
}
}
function delete ()
{
cInclude('classes', 'class.inuse.php');
$col = new InUseCollection;
$col->removeSessionMarks($this->id);
parent::delete();
}
}
Code: Alles auswählen
function page_open($feature)
{
global $_PHPLIB;
global $cfg;
# enable sess and all dependent features.
if (isset($feature['sess']))
{
global $sess;
$sess = new $feature['sess'];
switch ($feature['sess'])
{
case 'Contenido_Session':
$sess->init($cfg['path']['contenido_fullhtml']);
break;
}
$sess->start();
# ab hier geht es normal mit
# if (isset($feature['auth']))
# weiter
nach
Code: Alles auswählen
var $cookie_domain = "";
Code: Alles auswählen
var $cookie_path = "/"; ## Der Pfad auf dem Server, für welchen
## das Cookie verfügbar sein wird.
Code: Alles auswählen
switch ($this->mode)
{
case 'cookie':
if ( $newid && ( 0 == $this->lifetime ) )
{
SetCookie($this->name, $id, 0, $this->cookie_path, $this->cookie_domain);
}
if ( 0 < $this->lifetime )
{
SetCookie($this->name, $id, time()+$this->lifetime*60, $this->cookie_path, $this->cookie_domain);
}
// Remove session ID info from QUERY String - it is in cookie
if ( isset($QUERY_STRING) && ("" != $QUERY_STRING) )
{
$QUERY_STRING = ereg_replace(
"(^|&)".quotemeta(urlencode($this->name))."=".$id."(&|$)",
"\\1", $QUERY_STRING);
}
break;
case 'get':
if (isset($QUERY_STRING) && ('' != $QUERY_STRING))
{
$QUERY_STRING = ereg_replace(
"(^|&)".quotemeta(urlencode($this->name))."=".$id."(&|$)",
"\\1", $QUERY_STRING);
}
break;
default:
;
break;
}
Code: Alles auswählen
function put_id()
{
global $_COOKIE;
switch ($this->mode)
{
case "cookie":
$this->name = $this->cookiename == "" ? $this->classname : $this->cookiename;
SetCookie($this->name, "", 0, $this->cookie_path, $this->cookie_domain);
$_COOKIE[$this->name] = "";
break;
default:
// do nothing. We don't need to die for modes other than cookie here.
break;
}
}