2

Background

I have a joomla based application. My customers sign up and they register as a user on the site. My customers (primary customers) then have their own space on the site that they can then setup their own customers (secondary customer).

Question/Problem

The problem I am having is that I need to tag each secondary customer to a primary customer. I thought about just creating a new component and having a separate table that includes all the secondary customers. The problem is that I then lose out on all the authentication, session handling and login/logout that the core joomla _users component offers. I then thought about just having all the users in the core _users table and add the primary customer associated with each secondary customer to a field in a profile plugin. This would work for the most part, but this means that primary customers cannot create a secondary customer with a user name that already exists in the _users table. I didn't think this would be an issue, but several of my primary customers (currently only test users) have been confused by the site telling them a username is not available, since they can only see the names of their own secondary customers.

Any ideas on some architectural changes I could make to solve this?

2
  • I don't understand if you've already created an application, 1. why would creating and extra table to track relationships require a new component? 2. Why would either of these actions (a new table or new component) mean you "lose out on all the authentication, session handling and login/logout that the core joomla _users component offers"?
    – Craig
    Commented Dec 16, 2012 at 23:55
  • The secondary users will NOT be in the _users table referenced in the _users component. That will surely mean that the normal way to login and manage sessions etc will not work for the secondary users. If my understanding is wrong would be great if you could provide some detail in an answer to help me with this problem / my misunderstanding.
    – GWed
    Commented Dec 17, 2012 at 9:50

1 Answer 1

2

The login views and modules are really com_user (and mod_login via com_user) which just calls user.login (in com_user) which then calls the $app instance ('site' or 'admin') and asks it to do the login $app->login(). This in turn creates a JAuthentication object passing it the user credentials.

The JAuthentication class actually loads any active authentication plugins to perform the actual validation of the users credentials.

If the response from that authentication step is successful, then all your session data and user state gets established.

So, as you can have as many active authentication plugins as you want you could create your own version of the plugins/authentication/joomla plugin and point it at your version of the user table.

1
  • Ah I see! So all i do is create my own 'users' and use the authentication class to tell the application to load all the session data? That sounds just what I need. I was worried that there was too much important functionality wrapped in com_user which i would then have to recreate to get all the session/authentication functionality. I'll give that a go and let you know.
    – GWed
    Commented Dec 17, 2012 at 11:38

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.