This gets it working so you can use the link to the page in the back end to view the page in the front end when logged in.
In gsconfig.php turn on site wide cookies:
Then make the change suggested here http://get-simple.info/forum/post/11533/#p11533 in login_functions.php:
Change:
to
Then modify admin/inc/common.php changing:
to not check for $base:
and lastly edit index.php to change:
to be:
This works in my environment, YMMV.
-Rob A>
In gsconfig.php turn on site wide cookies:
Code:
# Make login cookie available sitewide.
define('GSCOOKIEISSITEWIDE', TRUE);
Then make the change suggested here http://get-simple.info/forum/post/11533/#p11533 in login_functions.php:
Change:
Code:
setcookie('GS_ADMIN_USERNAME', $USR);
Code:
if (defined('GSCOOKIEISSITEWIDE') && (GSCOOKIEISSITEWIDE == TRUE)) {
setcookie('GS_ADMIN_USERNAME', $USR, 0, '/');
} else {
setcookie('GS_ADMIN_USERNAME', $USR);
}
Then modify admin/inc/common.php changing:
Code:
/** grab user data */
if(!isset($base)) {
if (isset($_COOKIE['GS_ADMIN_USERNAME'])) {
$cookie_user_id = _id($_COOKIE['GS_ADMIN_USERNAME']);
if (file_exists(GSUSERSPATH . $cookie_user_id.'.xml')) {
$datau = getXML(GSUSERSPATH . $cookie_user_id.'.xml');
$USR = stripslashes($datau->USR);
$HTMLEDITOR = $datau->HTMLEDITOR;
$TIMEZONE = $datau->TIMEZONE;
$LANG = $datau->LANG;
} else {
$USR = null;
$TIMEZONE = 'America/New_York';
}
} else {
$USR = null;
$TIMEZONE = 'America/New_York';
}
} else {
$USR = null;
$TIMEZONE = 'America/New_York';
}
Code:
/** grab user data */
if (isset($_COOKIE['GS_ADMIN_USERNAME'])) {
$cookie_user_id = _id($_COOKIE['GS_ADMIN_USERNAME']);
if (file_exists(GSUSERSPATH . $cookie_user_id.'.xml')) {
$datau = getXML(GSUSERSPATH . $cookie_user_id.'.xml');
$USR = stripslashes($datau->USR);
$HTMLEDITOR = $datau->HTMLEDITOR;
$TIMEZONE = $datau->TIMEZONE;
$LANG = $datau->LANG;
} else {
$USR = null;
$TIMEZONE = 'America/New_York';
}
} else {
$USR = null;
$TIMEZONE = 'America/New_York';
}
and lastly edit index.php to change:
Code:
# if page is private, check user
if ($private == 'Y') {
redirect('404');
}
Code:
# if page is private, check user
if ($private == 'Y') {
include($admin_relative.'cookie_functions.php');
if (!cookie_check()) {
redirect('404');
}
}
This works in my environment, YMMV.
-Rob A>