Jump to content

viewable by logged in user only!


Guest m0nty

Recommended Posts

Guest m0nty

Hi,

i'm trying to figure out how i can make cube cart viewable only to logged in users only.

if a user is not logged in, i would just like a simple login screen to be displayed.

i've modified the admin settings slightly and added a few options to enable/disable.. these work fine.

then i modified the session.inc.php file as below:

// ----- wholesale logon hack by m0nty -----

if(($config['wholelogin']==1 && isset($_SESSION['ccAdmin']) && $config['wholeloginAllowAdmin']==0) || ($config['wholelogin']==1 && (!isset($_SESSION['ccAdmin']) || !isset($_SESSION['ccUser'])))) {

	header("Location: whole_login.php");

	exit;

}

// ----- end of wholesale logon hack -----

i have whole_login.php in the correct folder, altho i haven't completely finished the script yet.. i took the idea from the offline.php method..

but i'm struggling to change this so that whole_login.php displays the login form. once logged in, the user can view index.php as normal.

i've tried including login.inc.php, but this gave errors, i know there's more to it than that..

i'm not a complete php newbie, but i'm certainly not proficient either or experienced.

i've searched briefly on cubecart.org for something but couldn't find anything.. and as at moment, i can't seem to login there.. (have emailed the admin there though to let him know)

sorry, can a mod move this topic to cube cart version 3 forum please..

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.

×
×
  • Create New...