Site under a site

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Forum rules
Post Reply
wellman85
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Jan 08, 2007 1:30 pm

Site under a site

Post by wellman85 » Thu Feb 07, 2008 8:56 pm

Evening everyone,

I have a question,

I have a site that is not completely built yet.  It is not built in Joomla but will be in the future.  There is a folder on the server that contains a Joomla based site however.  What I want to happen is there is going to be a php login on the root directory that once you login you are redirected to for example: http://www.mysite.com/joomlasite/ .  My question is how can I do this so that if anyone goes to http://www.mysite.com/joomlasite/ they are prompt with you must be logged in and a link back to the login page in the root directory.

I am guessing a session variable to be pushed when redirected to the http://www.mysite.com/joomlasite/ and the template for the Joomla based directory to contain a way to look for this variable and if it exists show the site if not show you must be logged in to view this resource.

Any help would be great.

Thanks,

-Mike

User avatar
CirTap
Joomla! Intern
Joomla! Intern
Posts: 73
Joined: Mon Dec 12, 2005 5:34 pm
Contact:

Re: Site under a site

Post by CirTap » Fri Feb 08, 2008 10:30 am

Hi,

I presume that your "login script" somehow stores the status of a successful login, either in a cookie, the standard $_SESSION or a database.
You didn't mention what version you use.
The best way to implement this in Joomla! 1.5 would be a system plugin or an authentication plugin. They run first in chain and you could probably just copy the code that validates the login for the "root" into that very plugin. At this stage nothing big has happend yet inside Joomla! and you can happily redirect via PHP header() to that initial login page.
You can have programs written fast, well, and cheap, but you only get to pick 2 ...

"I love deadlines. I like the whooshing sound they make as they fly by." Douglas Adams

wellman85
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Jan 08, 2007 1:30 pm

Re: Site under a site

Post by wellman85 » Fri Feb 08, 2008 3:02 pm

Currently, the one that will sit under the http://www.mysite.com/joomlasite/ is setup as 1.0.13.  The one that will be in the root will most likely be 1.5.  For 1.5 what plugin would you suggest and for the time being with just a standard php database/session what login would you suggest.

Just an FYI,

Database Version:  4.1.22-standard 
PHP Version:  4.4.7

Session auto start:  OFF  (this is for the http://www.mysite.com/joomlasite/
Session save path:  /tmp  (this is for the http://www.mysite.com/joomlasite/)


Thanks for the input,

-Mike


Post Reply