How to do custom password restore in joomla? - joomla

I rewrote Joomla authorization using a plugin with onUserAuthenticate method to use custom service. Now i need to add custom password restore like question/answer (they already exists in db). Is there any event to fire on password reset or may be some other thing which could replace default password restore via email ?

You haven't specified a Joomla version so I'll base my answer on the current 3.x series.
Joomla's authentication works via the plug-in's as you already know, but the front-end login is handled through a combination of the component com_users and module mod_login.
On the back-end there is also com_login, all of which work with the JAuthentication.
To work in conjunction with your restore you will need to create a component (e.g. com_myauthenticator) to present the front-end views. You may be able to do it in a module but apart from space considerations a Joomla component allows you to do much more without jumping through hoops.
The starting point tutorial for Joomla 3 components is here and you can find more in the Developers Portal.

Related

Joomla User Registration Component

I am new to this forum and also new in using joomla. I have a joomla3.4 site where I would like add extra fields to user registration form. I have searched over this for entirely two days now and got few options like
1)Override registration component
2)modifyng and adding new fileds in root/libraries/joomla/user/user.php
3)using extensions
I am not a joomla expert, hence 1st and 2nd option is bit more complicated for me, since it also invloves core files getting rewritten during joomla upgrade.
I am left with the 3rd option, which makes use of other 3rd party extension. I am not sure how does this 3rd party plugins work. Do they automatically insert the extra fileds data into joomla user table or where it will be stored?
I would like to use captcha-recaptcha into the registration form.
Please guide me on some good extensions(freeor paid) that I can use for registration form.
Your help and support is appreciated.
Thanks,
mds2907
In theory you should be able to just enable the plugin "User - Profile" that you already have and select the fields you want added to the form. That's not actually working for me on Joomla 3.4 but that may be due to a different issue with some additional symptoms that I'm debugging (Joomla 3.x - Two factor authentication disabled but still working).

display both register and login pages custom component in joomla

I'm building up a custom component, which should only be accessible to logged in users. I'm thinking about checking JFactory::getUser()->guest and if is set, redirect them to a custom page.
Now i prefer this page to contain both register and login options, but joomla itself does not seem to have this feature. Do i have to make this functionality to my custom component, or there is an another solution?
You should really use the built in ACL to control user access instead of trying to code it in yourself. That's kind of the whole point of having the ACL to begin with. Here's the tutorial for how the ACL works in the admin and front end of a site -
http://docs.joomla.org/ACL_Tutorial_for_Joomla_1.6
Here is the tutorial for adding ACL to a component -
http://docs.joomla.org/Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.7_-_Part_14
I think you will be much better served using the ACL system as it allows you a lot more flexibility - like adding additional user groups and permissions later without having to touch the code.
Once you have this set up, making a custom register or login page is as easy as a template override of the default com_user login view. You would need to combine these files -
For the login part of the page:
JOOMLA/components/com_users/views/login/tmpl/default.php
For the registration part of the page:
JOOMLA/components/com_users/views/registration/tmpl.default.php
Then put the new and improved file here:
JOOMLA/templates/YOUR TEMPLATE/html/com_users/login/default.php
That would give you ACL controlled access to your component as well as a custom login/registration page without having to muck around with any unnecessary extensions.
Joomla!'s default login module/page only provide a link to a registration page.
A quick search of the JED shows about 200 login extensions, it's possible one of them does what you want.
However, if you want it integrated with the access to your component you will have to code it yourself. The normal process is that if a user tries to access an asset view the view.html.php (or similar) will check their permissions and depending on the component post an JError message and possibly redirect them to the system login.
eg. com_content
// Check the view access to the article (the model has already computed the values).
if ($item->params->get('access-view') != true && (($item->params->get('show_noauth') != true && $user->get('guest') ))) {
JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
return;
}

Is there a way in Joomla to have public user profiles?

I installed Joomla 1.7 and I noticed that you can have user profiles with the user profile plugin. However, is there a way to publicly access a user's profile (without loging in)?
For instance, I noticed that you can go to:
/index.php?option=com_users&view=profile
However, that seems to pull up my own profile, If I am logged out it always redirects you to the login form. I have tried adding additional variables like "id=1", "user_id=1", or "userId=1".
Is there a way to do this? Or will I have to develop a component to pull in this information publicly?
Even though it not possible with clean Joomla website a lot of useful code come with it, which you could include to your component if you prefer to create one.
But... there is a great extension Community Builder with a great team behind it. Having used it in the past, I would highly recommend it as a solution for community based sites.
It changes the login form to a much better & bug-free form, enables more fields to be created for registration, and allows special pages for individual users, plus, community builder has extension-specific plugins.
EDIT: This answer needs an update as since it was added more extensions have been introduced like JomSocial or EasySocial. I cannot recomment CommunityBuilder any more
This post is tagged with Joomla 1.7 however I wanted to mention that if using Joomla 3.7.4 you now have the ability to show the User Profile plugin data from the core Contacts component. You can also add more custom fields to the Users component and they will also show from the Contacts component. You can set the display of the Users Profile info by going to the Admin panel -> Contacts -> Options. Turn on the option under; Contact -> User Profile -> set to "Show".

Change Registration form in Joomla 1.5

I am developing a website where I need to create two user types. One is "member" and the other is "merchant". Both have different areas to be accessed. I am really confused on how can I achieve this.
Also I am trying to add my custom fields of First name and Password in the default Joomla registration form. As soon as I add a new TR with field first name the registration form stops working.
Can you guys help me in doing this?
If you have some troubles with default Joomla registrtion, you could use Community Builder. It is pretty easy to add fields to users profile and users registration. To separate members and merchants you could add field to the registration form called for example Account type. And then according to its value assign new user as registered(members) or author(merchant).
First, adding user types in 1.5 is not going to accomplish the access requirements you have described. You would need to install an access control component to control different user types accessing different content.
Next, Joomla 1.5 is nearing end of life, April 2012 to be exact. Version 1.7.x released last week so you should very seriously consider moving the site to the latest version. An added bonus is that Joomla 1.7.x has built in access control levels that would accomplish what you are trying to do.
Regarding different access levels best thing to do would be upgrade to Joomla 1.6/1.7 It has this functionality built in. It may be possible to achieve this in 1.5 with third party components, but I don't have any experience with this.
Regarding custom registration fields, again, if you upgrade to 1.6/1.7 it has User - Profile plugin which allows to add additional fields to your registration form.
In 1.5 you can use third party components such as ExtendedReg (commercial).
Or alternately edit core files: http://www.mysysadmintips.com/index.php/web/100

joomla integrating external php signup form

I have a joomla website.here is the link
link for siteI want to integrate a external php signup and login form.I create a php signup form.It works perfecly.
signup linkBut the problem is i dont know how to integrate that form to my joomla web pages...I want to secure my web pages..Only registered users can view my page....please help me..
Why have you create your own register form? Joomla already has the one. To see it follow the link index.php?option=com_user&task=register, Login for there index.php?option=com_user&task=login. If you need more fields to be filled out during registation you may you Community Builder. This extention allows to add to user profie as many fields as you want
It is also possible to use Chronoforms to allow for registration that brings in multiple fields as well without having to bring in an external file for registration/login.
Using the tools Joomla has to stay within Joomla is really the best way to go about it. It will allow you to keep your sanity and keep things as uniformed as possible.

Resources