24
votes
Accepted
How to display user profile information?
Joomla: Accessing User Info - The User Object
To get user information for the current user:
$user = JFactory::getUser();
It will return the User Object.
Here, some of the most common User Object's ...
24
votes
Accepted
Direct logout link
The following link is for direct logout:
http://example.com/index.php?option=com_users&task=user.logout
But a user token is required in order to avoid an error message Invalid Token, and some ...
15
votes
How to stop (fake) users from registering on my website?
Why I find fake/spam registered users in my site…?
The majority of such registrations are coming from botnets, infected machines, script kiddys and generally all kind of bots.
In systems like Joomla, ...
14
votes
Accepted
How to let users delete their account from the frontend?
Take a look at this extension called Delete My Account:
http://extensions.joomla.org/extensions/clients-a-communities/user-management/26011
It allows users to delete their own account via the ...
11
votes
Accepted
How to stop (fake) users from registering on my website?
Newer versions of Joomla 3.x disable User Registration by default.
If your version of Joomla was installed before this change, you probably have User Registration enabled.
User Registration can be ...
10
votes
Profile Pictures for Joomla Users?
THere's actually a fairly new plugin that you might want to look at called Joom Profile. Instead of a full community component, it's just made for expanding user profiles. It also gives you the ...
10
votes
What is the URL for user login (aka How to hide the login form?)
As an extension to Brian Peat's answer:
If you go to the url
domain.com/index.php?option=com_users&view=login
you can login without having a menu item set or any kind of publish/unpublish ...
10
votes
Accepted
Get user ID from username
Simple, you can use JUserHelper to achieve this:
$username = 'jophanpw';
$userId = JUserHelper::getUserId($username);
echo $userId;
All the code above does is run the following database query:
...
10
votes
Accepted
How to know which usergroup/specific access level user belongs to
To get an array of groups the currently logged in user belong to, you can use the following:
$user = JFactory::getUser();
$groups = JAccess::getGroupsByUser($user->id);
var_dump($groups);
To ...
9
votes
Accepted
Making Custom HTML User Profile Page by using Joomla Variables
Ok for starters, you can't use a .html site to display user information, instead you will require a .php file.
Once created, you will need to import the Joomla CMS like so:
define( '_JEXEC', 1 );
...
9
votes
Accepted
User group in joomla 3.2.1
You need to change the Group parent to registered (or any other than Public, Guest). As users from Public usergroup are not allowed to login at website.
Or you need to change the permissions of your ...
8
votes
Profile Pictures for Joomla Users?
The only way to achieve this without using a 3rd party extension would be to either write your own plugin or start editing the profile plugin that comes with Joomla. Editing core file is simply a no ...
8
votes
Accepted
What is the URL for user login (aka How to hide the login form?)
You can make a menu that isn't published, and put a link to the user login page there, and name the alias whatever you want. As long as you turn off the allow registrations function in the user ...
8
votes
Adding Multiple Users in Joomla
I see in the tags of your question you are using mysql and phpmyadmin, so I assume you are after a a way to INSERT records of users directly into the Joomla database.
However please note that, the ...
7
votes
Profile Pictures for Joomla Users?
I've previously used a plugin called Easy Profile. In addition to supporting Avatars, it has several other improvements over the built-in Joomla user profile system. The free version is somewhat ...
7
votes
How to display user profile information?
@Lodder is correct. If you want just some basic fields, then you can use Joomla User Profile plugin, which comes with Joomla itself.
If you want to create some customized fields, then there are ...
7
votes
Direct logout link
There is already a plugin which works great for logout button.
You should check this extension logout button
7
votes
Direct logout link
As a final answer, Joomla has a builtin "Logout" menu item, added to core I think around 3.4* maybe 3.5. So now you don't need any additional plugins.
The logout menu item also allows for a redirect ...
7
votes
Accepted
Redirect users to the last page visited, after login from component
Quite simple to do this.
You will firstly need to create a Template Override for the following file:
components/com_users/views/login/tmpl/default_login.php
Once done, open the following file (your ...
6
votes
How to avoid getting bulk registrations?
Besides setting Global config to not allow registration, I highly recommend using something like Akeeba Admin Tools. These tools provide high levels of protection for Joomla sites.
I also have had ...
6
votes
Accepted
onUserLogin and onUserAfterLogin events don't seem to fire
You don't mention a Joomla version so I'm assuming 3.x, although this should be pretty much the same for 2.5.x.
As mentioned your plugin's class name is incorrect, the name of the class is derived ...
6
votes
Accepted
What is best approach to update the user info in custom component user-info table?
You should save your data using a User Plugin - they're very easy to write. An example can be found at Creating a profile plugin, though the example might have more than you need.
The events your ...
6
votes
Accepted
Restrict user access to specific com_content category
There are 2 possible ways, I answer both ways each in separated answer.
This answer uses the exclude category variant. You have to create a new user group, set this user group as child of the “Manager”...
6
votes
Restrict user access to specific com_content category
There are 2 possible ways, I answer both ways each in separated answer.
This answer creates a complete new user group. You have to create a new user group, set this user group as child of the “Public” ...
6
votes
Accepted
Redirect users to the page pointed in the URL after login
First of all, com_users login is written to use POST method, so adding ?return= don't give you anything, it won't work.
If we don't specify return in post data, model will use default pointing into ...
6
votes
Accepted
Adding text to registration form
There are two ways you can do for that (both are safe from Joomla update / you won't loose the changes when updating your Joomla)
1. By using template override
Copy the file /components/com_users/...
5
votes
How to avoid getting bulk registrations?
Try it whit recaptcha to protect your site against spam registrants:
Go to this Link and follow and create your recaptcha keys
https://www.google.com/recaptcha/intro/index.html
Go to http://youdomain....
5
votes
How to display user profile information?
You should really do some research before asking a question like this. 2 seconds on Google and you would have all the information you needed.
There is a in User Profile plugin that comes with Joomla. ...
5
votes
Accepted
Joomla Variables for optional Profile Fields?
Very simple bit of code to use as shown below
$user = JFactory::getUser();
$profile = JUserHelper::getProfile($user->id);
echo '<p>City: ' . $profile->profile['city'] . '</p>';
...
5
votes
Accepted
Changing redirect login path for guests?
I figured it out myself! :)
You need to edit this file : /templates/your_template/html/com_users/login/default.php
or if your template folder doesn't consist of html folder, edit this one:
/...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
user × 203joomla-3.x × 84
registration × 27
login × 22
plugin × 18
user-groups × 16
php × 14
joomla-2.5 × 11
administrator × 11
articles × 10
access × 9
profile × 9
joomla-api × 8
joomla-3.4 × 7
database × 7
emails × 7
development × 6
extensions × 6
mysql × 6
custom-field × 6
security × 6
acl × 6
session × 6
sql × 5
authentication × 5