Jump to content

Viewing Store Offline Fix


Al Brookbanks
 Share

Recommended Posts

It is broken in 3.0.8 because the session name in the front end doesn't match that of the backend.

So open /admin/login.php, admin/logout.php and admin/includes/auth.inc.php

Find:

session_start();



Above this add:
if($glob['rootRel']=="/"){

	$sessionName = "ccSID";

} else {

	$sessionName = "ccSID-".md5($glob['rootRel']);

}



session_name($sessionName);

Link to comment
Share on other sites

Guest walmarc

It is broken in 3.0.8 because the session name in the front end doesn't match that of the backend.

So open /admin/login.php, admin/logout.php and admin/includes/auth.inc.php

Find:

session_start();



Above this add:
if($glob['rootRel']=="/"){

	$sessionName = "ccSID";

} else {

	$sessionName = "ccSID-".md5($glob['rootRel']);

}

OK done that - here is what that section of auth.inc.php looks like:

$sessionDomain = substr($GLOBALS['rootRel'],0, strlen($GLOBALS['rootRel'])-1);

@ini_set("session.cookie_path",$sessionDomain);

if($glob['rootRel']=="/"){

$sessionName = "ccSID";

} else {

$sessionName = "ccSID-".md5($glob['rootRel']);

}

session_start();

Still get the offline store message when I access the site from the admin panel? :angry:

Link to comment
Share on other sites

Guest walmarc

Looks great! Worked for me!

Thanks,

JAB*

If I add: session_name($sessionName);

I get a mostly greyed out left controlpanel + a Login screen. Up the top it says Logged in as: [Logout | Change Password]

One of the few options is Admin sessions which doesn't work. I copied and pasted the total code three times to the same effect. As soon as I remove the line session_name($sessionName); - I can log in normally again (although the offline store option won't work). I'm using CC 3.0.8 in Firefox 1.5.0.1

Any ideas? :blink:

Link to comment
Share on other sites

Guest reeko357

Just curious as to what 'Viewing Store Offline' is?

Haven't noticed that anything is broken so maybe its something I've never tried yet?

Pa

Viewing the store offline allows you to, turn your store off to the public

while allowing you or administrators, that are logged in, to continue to view the store.

It's a handy option to have if your working on your store and you don't want the public using your

store while you're in the process of modifying or upgrading.

Link to comment
Share on other sites

I couldn't view store as admin, so i tried this, but now i get an error that says...

Parse error: parse error, unexpected $ in /home/kylemc/public_html/shop/admin/includes/auth.inc.php on line 9

any help? thanks in advance!

Link to comment
Share on other sites

Guest cpbooks2

I still cant get it to work, cant view store when store is offline. Ive tried all the codes maybe Im doing something wrong, any suggestions?

Thanks!

Link to comment
Share on other sites

Guest reeko357

i doubt it has anything to do with that, cuz i don't have any SSL cert and i get the same problem :/

I had that problem in 3.0.8 but it seems to be fixed in 3.0.9

Link to comment
Share on other sites

  • 4 weeks later...
Guest chapter_two

I had this problem in version 3.0.6. Upgraded to version 3.0.10 yesterday in the hope it would fix it .... but it hasn't.

3.0.10 files already have the code entered as the fix. Admin sessions is being populated when I login so I know that is working.

Any ideas? I can't develop my store because I don't want it to be online whilst I do it.

Link to comment
Share on other sites

Guest EverythingWeb

Why not just put an index.html page with an 'Offline Message' and then in a .htaccess file put:

DirectoryIndex index.html index.php

??

Link to comment
Share on other sites

Guest chapter_two

Thanks for the suggestion. No need for the .htaccess file though as index.html always overrides index.php on my web server so I created a dummy index.html page as you suggested.

Thanks again :o

Link to comment
Share on other sites

  • 4 months later...
Guest janpugs

I put the codes in all 3 places , login.php, logout.php, and includes/auth.inc.php but I still can not veiw my store. I still get the "off line .php"

Am I reading the instructions correctly? it says to copy and paste the codes "above" session_start () ;

Is that right?

Link to comment
Share on other sites

Guest airjer

I see this above fix is edited into my files.... yet I can't view the store when it's offline. I'm using the latest Cube Cart version 3.0.12.

Maybe it's the SSL as mentioned?

Guess I'll just do the general index.html override.... ;)

Link to comment
Share on other sites

I see this above fix is edited into my files.... yet I can't view the store when it's offline. I'm using the latest Cube Cart version 3.0.12.

Maybe it's the SSL as mentioned?

Guess I'll just do the general index.html override.... ;)

I have noticed the same thing in 3.0.12

Burgensteen

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...