English 中文(简体)
Custom Joomla component integration with Joomla com_user
原标题:

I am creating a component where registered users will be able to use the features of my component.

My component has a some forms and views. I want to allow only logged in users to access links to my component.

How can i add extra custom fields to the User Registration form of Joomla? I have some extra fields to capture like address and company name.

How can i integrate the authentication with my component?

How can i accomplish my component without creating again the functionality of User registration and authentication. As i know that i can use joomla user registration and integrate it with my component. But i Dont know how to do it.

Kindly Help Thanks

最佳回答

There are lots of ways you can accomplish that. OFC best methods are always integrating without doing core hacks. That said i would suggest two ways.

There are lots of plugins or components which extend the user registration fields. But these are solutions on themselves, so it will be of no use for your component which holds own data (adress, company, etc.).

  1. You simply create a registration frontend view for your component using the joomla users model. That way users can register thru your component and add all extra fields you like. You just have to take care to add the non standard fields to your db tables in the model.

  2. If you realy dont want to create a registration form on your own, you can create an User Plugin in combination of an content override for the registration form. The plugin would than take care of adding the extra fields to your db tables. The correct User Event would be:


function onAfterStoreUser($user, $isnew, $success, $msg) {
   ...
   if ($isnew)
   {
      myComponent::createExtraFields($user[ id ], $args);    }
   else
   {
      myComponent::updateExtraFields($user[ id ], $args); 
   }
   ...
}
问题回答

暂无回答




相关问题
CHATGPT Integration [closed]

Can anyone please let me know the steps to integrate ChatGPT in to a website using Api with python I am expecting Chat GPT integration process in to a website for my process. So please let me know the ...

using perforce with team foundation server

Does Team Foundation Server 2008 or upcoming 2010 work with perforce as the SCM tool? I haven t been able to find any documentation on the web indicating whether or not this configuration is supported?...

Adding Crystal Reports support into LAMP product

We have a newly documented feature request, from sales and support, to integrate Crystal Reports into our LAMP product. (It s more like LAPP, really, with Postgres and PHP.) I have to admit, ...

how to connect to hotmail server?

i am developing a website in wich i want to connect to hotmail server to read and send emails through my website but i am not able to connect to server..i am using pop3 and smtp i am getting error as ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

热门标签