Possible to make login restrictions?

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
tatterdemalion
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Fri Dec 12, 2008 2:26 am

Possible to make login restrictions?

Post by tatterdemalion » Sat Dec 20, 2008 7:53 am

Hi. I have 5 different sections and a login form for each section. When I login to one section, I can access the information from the other sections and I shouldn't be able to. How can I restrict access to those other sections? Each login is for its specific section.

Thanks in advance.

 
prateekshaweb
Joomla! Explorer
Joomla! Explorer
Posts: 331
Joined: Mon Aug 04, 2008 8:00 am
Location: India
Contact:

Re: Possible to make login restrictions?

Post by prateekshaweb » Sat Dec 20, 2008 11:32 am

i do not think there is any easy solution to this...

u can create a plugin and check if the user of a certain type and then allow access to content.

to create different type of users ...u can create new groups in the table jos_core_acl_aro_groups

i have NOT tried it... but i think it may solve the problem.
Sumeet Shroff
PSD to Joomla, Joomla Custom Template Design and Virtuemart Shopping Cart
http://www.prateeksha.com http://www.joomlawebsitedesigners.com

tatterdemalion
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Fri Dec 12, 2008 2:26 am

Re: Possible to make login restrictions?

Post by tatterdemalion » Sat Dec 20, 2008 10:22 pm

Do you know if there is a link to a tutorial on this subject?

prateekshaweb
Joomla! Explorer
Joomla! Explorer
Posts: 331
Joined: Mon Aug 04, 2008 8:00 am
Location: India
Contact:

Re: Possible to make login restrictions?

Post by prateekshaweb » Sun Dec 21, 2008 4:47 am

>> u can create a plugin and check if the user of a certain type and then allow access to content.

http://docs.joomla.org/How_to_create_a_content_plugin

>> to create different type of users ...u can create new groups in the table jos_core_acl_aro_groups

http://docs.joomla.org/Custom_user_groups
Sumeet Shroff
PSD to Joomla, Joomla Custom Template Design and Virtuemart Shopping Cart
http://www.prateeksha.com http://www.joomlawebsitedesigners.com

tatterdemalion
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Fri Dec 12, 2008 2:26 am

Re: Possible to make login restrictions?

Post by tatterdemalion » Mon Dec 22, 2008 12:05 am

Hi. Thank you for the info. I'm going to try to conduct a step-by-step tutorial for myself, however I'll need some assistance from you to verify if I'm going in the right direction, if you don't mind.

Step 1: Create the 5 different types of user groups using the tutorial at this address: http://docs.joomla.org/Custom_user_groups.

Step 2: Create a plugin for each different user group using the tutorial at this address:
http://docs.joomla.org/How_to_create_a_content_plugin. Which example on this page will create a plugin to restrict access?

Question: How will the default login form recognize which user group to log into? For example, I will link the Distributors link to the user default login form in Joomla. How can I assign a certain user group to that form to prevent other users from logging into any login form?

Cheers!

prateekshaweb
Joomla! Explorer
Joomla! Explorer
Posts: 331
Joined: Mon Aug 04, 2008 8:00 am
Location: India
Contact:

Re: Possible to make login restrictions?

Post by prateekshaweb » Mon Dec 22, 2008 5:06 am

hi...

as mentioned i have not tried it before ........so i may not be correct ... but i help u...to create new ideas to solve the thing...

login will login the person normally... that is prefectly ok.. let the person login

after login, u need to check the "type"... or any other attribute that will give u the gid. (group id)

$user =& JFactory::getUser();

var_dump($user);

using the gid then u can set if the menu or content is shown...

so if the new user has gid 31 ..then

if ( $gid == 31 ) {
// show menu item
}
else {
// hide menu item
}

for that u may need to rewrite the mod_mainmenu

sumeet
Sumeet Shroff
PSD to Joomla, Joomla Custom Template Design and Virtuemart Shopping Cart
http://www.prateeksha.com http://www.joomlawebsitedesigners.com

tatterdemalion
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Fri Dec 12, 2008 2:26 am

Re: Possible to make login restrictions?

Post by tatterdemalion » Tue Dec 23, 2008 12:05 am

Ok. I'm going to try adding another group in the database table. I'll let you know how it goes.

tatterdemalion
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Fri Dec 12, 2008 2:26 am

Re: Possible to make login restrictions?

Post by tatterdemalion » Tue Dec 23, 2008 12:53 am

I'm confused about adding new groups in the jos_core_acl_aro_groups table.

Here is the table info for the registered user group:

Code: Select all

id = 18
parent_id = 29
name = Registered
lft = 4
rgt = 11
value = Registered
If I duplicate the registered user group and rename it to distributors, do I keep the same id? Will this make the user group unique and restrict access to the registered group?

tatterdemalion
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Fri Dec 12, 2008 2:26 am

Re: Possible to make login restrictions?

Post by tatterdemalion » Tue Dec 23, 2008 1:13 am

prateekshaweb wrote:hi...

as mentioned i have not tried it before ........so i may not be correct ... but i help u...to create new ideas to solve the thing...

login will login the person normally... that is prefectly ok.. let the person login

after login, u need to check the "type"... or any other attribute that will give u the gid. (group id)

$user =& JFactory::getUser();

var_dump($user);

using the gid then u can set if the menu or content is shown...

so if the new user has gid 31 ..then

if ( $gid == 31 ) {
// show menu item
}
else {
// hide menu item
}

for that u may need to rewrite the mod_mainmenu

sumeet
I successfully created a new group in the database table. I had to give it a unique id, so I used 40 since that hadn't been taken yet.

But where do I edit the code that you mentioned above?

 

Locked

Return to “Joomla! 1.5 Coding”