Joomla! Discussion Forums



It is currently Thu Nov 26, 2009 3:01 pm (All times are UTC )

 


Forum rules

Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Security Checklist
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
Posted: Wed Nov 04, 2009 2:29 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Jul 10, 2008 10:36 am
Posts: 9
Hi to all,

i have to ask to you a stupid question i think :) .. but i can't resolve it!
I'd like to create a page to login my joomla site... Really is for a intranet so i nedd a page wit a login form and when the users are authenticated can surf the site.

How can i do?

thanks
gab


Top
  E-mail  
 
Posted: Wed Nov 04, 2009 2:51 pm 
User avatar
Joomla! Hero
Joomla! Hero
Online

Joined: Fri Dec 21, 2007 9:36 pm
Posts: 2224
Location: Yorkshire, UK
If you are using SEO (all 3 options enabled) the link to the login page will be something such as:
yoursite.com/component/user/login.html

If not it will be something like:

yoursite.com/index.php?option=com_user&view=login

Create a menu item pointing to one of these links and set it as "Default" in the Menu Manager. Joomla! will automatically use this as the home page. Then have a look at the following thread: viewtopic.php?f=431&t=372673

_________________
Freedom of expression ... some may try to suppress it but they can never take it away ...
There is no problem a good miracle can't fix.


Top
  E-mail  
 
Posted: Thu Nov 05, 2009 12:51 am 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Tue Jun 09, 2009 2:21 am
Posts: 1263
Location: WV
@dizzi - and what if the user KNOWS the address to the resource they want?

Open up your template's index.php & add this after the JEXEC check (UNTESTED):
Code:
global $mainframe;
$user =& JFactory::getUser();
$isLogin = JRequest::getCmd('option') == 'com_user';
if( $user->guest && !$isLogin )
  $mainframe->redirect( 'index.php?option=com_user&view=login' );


Alternatively, you might be able to set all your menu items to "registered" but you may end up having issues re: 403 errors. Anyone want to correct me?

_________________
http://jeffchannell.com - Joomla Extensions & Web Development
Unsolicited private messages/emails asking for help = you wish to hire me to fix your problem.
καλλιστι


Top
   
 
Posted: Thu Nov 05, 2009 10:04 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Jul 10, 2008 10:36 am
Posts: 9
It's ok tha'ts what i need!!!

But anyway i have to set all menu items to registered.. Now i can yet see the contents...

Second i'd like to adjust the graphic appeal of the module... Really i'd like to have the same login page of the off-line site. Is it impossibile?

Thanks
gab


Top
  E-mail  
 
Posted: Thu Nov 05, 2009 11:28 am 
User avatar
Joomla! Hero
Joomla! Hero
Online

Joined: Fri Dec 21, 2007 9:36 pm
Posts: 2224
Location: Yorkshire, UK
jeffchannell wrote:
@dizzi - and what if the user KNOWS the address to the resource they want?
The link I posted, suggests setting the access level of articles as 'Registered'. Menu items can be made public but if items they point to are set to "Registered" than non-logged in users still won't have access.

Regarding the 403 errors, a custom error page (containing a login link) can be provided.

P.S. The solution you provided looks quite elegant and represents much less work. If I ever have to create a private site, I will definitely try it. Thanks for posting :).

_________________
Freedom of expression ... some may try to suppress it but they can never take it away ...
There is no problem a good miracle can't fix.


Top
  E-mail  
 
Posted: Thu Nov 05, 2009 1:24 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Jul 10, 2008 10:36 am
Posts: 9
It's true... also item in menu are locked!!!

I have to take a look at the joomla off-line source page... I think if i rescue to reproduce the code on the index there are good possibilities to do it.

i don't care by the error 403!

When the developer enable the seo settings on joomla confgiration the developer will change this line

Code:
$mainframe->redirect( 'index.php?option=com_user&view=login' );


with this
Code:
yoursite.com/component/user/login.html


Am i making some mistakes?

Thanks
gab


Top
  E-mail  
 
Posted: Thu Nov 05, 2009 2:57 pm 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Tue Jun 09, 2009 2:21 am
Posts: 1263
Location: WV
No, don't change the URL! You can account for this like so:
Code:
$mainframe->redirect( JRoute::_('index.php?option=com_user&view=login') );

Though since this is a redirect and not a link, .htaccess should redirect the non-SEF to the SEF pretty transparently...

_________________
http://jeffchannell.com - Joomla Extensions & Web Development
Unsolicited private messages/emails asking for help = you wish to hire me to fix your problem.
καλλιστι


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

Quick reply

 



Who is online

Users browsing this forum: Makis77 and 31 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group