after installation cmsimple 4.0.3

Questions about how to install and problems installing - please read the documentation first!
roze
Posts: 230
Joined: Tue Jun 03, 2008 7:13 am
Location: NL
Contact:

Re: after installation cmsimple 4.0.3

Post by roze » Thu Dec 13, 2012 10:06 pm

Gert, Christoph,

I put the original CMS.php back.


I replaced all 9 occurences of "CMSIMPLE_ROOT" with "/" in cmsimple/login.php.


www.haptonomiedommelen.nl : the page is blanc
Rob Zeijen,

Valkenswaard (NL)

Gert
Posts: 3075
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: after installation cmsimple 4.0.3

Post by Gert » Thu Dec 13, 2012 10:09 pm

Hi Rob,

now the only way is to give me ftp access (PM or mail), so I could make some tests tomorrow,

Gert
Gert Ebersbach | CMSimple | Templates - Plugins - Services

roze
Posts: 230
Joined: Tue Jun 03, 2008 7:13 am
Location: NL
Contact:

Re: after installation cmsimple 4.0.3

Post by roze » Thu Dec 13, 2012 11:00 pm

Gert wrote:Hi Rob,

now the only way is to give me ftp access (PM or mail), so I could make some tests tomorrow,

Gert
PM send
Rob Zeijen,

Valkenswaard (NL)

cmb
Posts: 13342
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: after installation cmsimple 4.0.3

Post by cmb » Thu Dec 13, 2012 11:08 pm

Hi Rob, hi Gert,
roze wrote:the page is blanc
Sorry! My explanation was more than ambigious as I see now. What I meant was, that you should replace "CMSIMPLE_ROOT" with "'/'". For example:

Code: Select all

        setcookie('status', 'adm', 0, CMSIMPLE_ROOT); 
should be replaced with

Code: Select all

        setcookie('status', 'adm', 0, '/'); 
But even if this allows the login, I'm quite sure that at least some things will not work (perhaps none of the features or plugins you need, though).

@Gert: IMO the problem is, that in Rob's environment CMSIMPLE_ROOT should sometimes be '/haptonomiedommelen/' and sometimes '/'. For absolute file paths probably the former, for construction of absolute URLs in combination with SERVER_NAME the latter, but for construction of absolute URLs in combination with HTTP_HOST the former.

:idea: Perhaps a solution is to change SERVER_NAME and SCRIPT_NAME early in cms.php to what they're supposed to be (I'm not sure, if that has to be considered a dirty hack or a viable solution), and leaving the rest as it is in the original distribution. A simple attempt:

Code: Select all

$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
$_SERVER['SCRIPT_NAME'] = preg_replace('~^/[^/]*~', '', $_SERVER['SCRIPT_NAME']); 
(perhaps also using the same preg_replace() for REQUEST_URI and PHP_SELF, in case these are used by plugins)

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Gert
Posts: 3075
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: after installation cmsimple 4.0.3

Post by Gert » Fri Dec 14, 2012 3:43 pm

cmb wrote: :idea: Perhaps a solution is to change SERVER_NAME and SCRIPT_NAME early in cms.php to what they're supposed to be (I'm not sure, if that has to be considered a dirty hack or a viable solution), and leaving the rest as it is in the original distribution. A simple attempt:

Code: Select all

    $_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
    $_SERVER['SCRIPT_NAME'] = preg_replace('~^/[^/]*~', '', $_SERVER['SCRIPT_NAME']);  
Doesn't work in subsites and second languages, or if you call the site with "domain.tld/subfolder/".

For such servers only an individually solution is possible:

Code: Select all

$_SERVER['SCRIPT_NAME'] = str_replace('/haptonomiedommelen', '', $_SERVER['SCRIPT_NAME']);
$_SERVER['PHP_SELF'] = str_replace('/haptonomiedommelen', '', $_SERVER['PHP_SELF']); 
... at first in cms.php,

Gert
Gert Ebersbach | CMSimple | Templates - Plugins - Services

roze
Posts: 230
Joined: Tue Jun 03, 2008 7:13 am
Location: NL
Contact:

Re: after installation cmsimple 4.0.3

Post by roze » Fri Dec 14, 2012 7:16 pm

Gert wrote:
cmb wrote:
For such servers only an individually solution is possible:

Code: Select all

$_SERVER['SCRIPT_NAME'] = str_replace('/haptonomiedommelen', '', $_SERVER['SCRIPT_NAME']);
$_SERVER['PHP_SELF'] = str_replace('/haptonomiedommelen', '', $_SERVER['PHP_SELF']); 
... at first in cms.php,

Gert
Thank you Gert.

This works for my situation.

Grtz. Rob
Rob Zeijen,

Valkenswaard (NL)

Post Reply