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 ...
Lodder's user avatar
  • 26.9k
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 ...
FFrewin's user avatar
  • 19.7k
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 ...
BodgeIT's user avatar
  • 677
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 ...
Lodder's user avatar
  • 26.9k
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 ...
Lanah's user avatar
  • 522
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/...
webchun's user avatar
  • 2,418
5 votes

User Enabled but not Activated

Enabled allows a user to login at will. If you switch Enabled for a user to 'off' they won't be able to get into their account. Activated however only happens one time usually by the administrator, or ...
Rafe's user avatar
  • 247
4 votes

Profile Pictures for Joomla Users?

This can be achieved using custom fields now-a-days. My previous answer in case anyone finds that useful. The above is probably more relevant this is just here for reference. Custom Fields (above ...
Eoin's user avatar
  • 1,909
4 votes

Migrate users account from Joomla 3 to another Joomla 3 manually

Rather than migrating the users manually you could try some of the extensions available at Joomla Extensions Directory. This page contains several extensions, both free and commercial, you'd have to ...
johanpw's user avatar
  • 13.3k
4 votes
Accepted

Check if a user account was activated by administrator

I have been able to resolve this question by writing my own plugin, as recommended by Lodder in the comments. My plugin is very simple; it merely creates a user note against the user when the user's ...
Simba's user avatar
  • 610
4 votes

Assign template to user

I believe you'd need to write/find a plug-in to fully achieve that. The following question gives a basic framework for such a plugin: https://stackoverflow.com/questions/20049266/how-to-set-a-...
RichardB's user avatar
  • 3,082
4 votes
Accepted

Find user by email

Joomla\CMS\Table\User::load() can only load rows by user ID. Use database query to get user ID by email and pass it to table's load() method: $db = JFactory::getDbo(); $query = $db->getQuery(true) ...
Sharky's user avatar
  • 11.2k
4 votes
Accepted

Redirect if userid is not found in a database table

The first problem is that you're using joomlausers->id which doesn't look correct. It should be $joomlausers->id (with a $ at the beginning). Secondly, loadObjectList() returns an indexed array ...
Lodder's user avatar
  • 26.9k
4 votes
Accepted

What is the correct way to programmatically delete a joomla user and their data?

The documentations has this : https://api.joomla.org/cms-3/classes/Joomla.CMS.User.User.html but it seems that no parameters are passed to user->delete? That's correct. This method works on the user ...
Sharky's user avatar
  • 11.2k
4 votes
Accepted

How to get user object in Ajax call

When importing classes using use statement, it has to be outside of your class. When put inside a class, it's interpreted as a use of trait. And when used inside a method it will cause a syntax error. ...
Sharky's user avatar
  • 11.2k
4 votes
Accepted

Non deprecated method in Joomla! 4 to load user by userid

Use Joomla\CMS\User\UserFactory. You can get it from the service container: use Joomla\CMS\User\UserFactoryInterface; $userFactory = $container->get(UserFactoryInterface::class); Or using alias: $...
Sharky's user avatar
  • 11.2k
3 votes
Accepted

Searching for users and tagging their name in a post

2) for sure. An Ajax query is a small load. It does not block and return the whole users table. You can have better control. For example, returning only 3 attempts. On the other hand 3) is a method ...
Anibal's user avatar
  • 7,435
3 votes

How to let users delete their account from the frontend?

Community Builder Profile Privacy plugin also does this, if you use Community Builder for your membership management. Besides deleting an account, it also allows user to temporarily disable their ...
Margaret's user avatar
3 votes
Accepted

Using Joomla! user account for authenticating to a Laravel application

as Valentin Despa say "I can imagine it could be quite easy to draft a solution where you expose an RESTful API via a component which allows you to authenticate the users." A non REST solution is to ...
Pierre-André Vullioud's user avatar
3 votes
Accepted

Get user info and send email from button

Download Flexi Custom Code Module from the JED. Install the module and publish it to the position of your choice. Below the custom code box leave the option to use PHP on and disable the cleanup of ...
Terry Carter's user avatar
  • 1,812
3 votes
Accepted

Modify mail on user-creation

Registration message comes from Language Variable defined in com_users language file: \language\en-GB\en-GB.com_users.ini Replace en-GB with your desired language code of course. You should ...
Mikan's user avatar
  • 3,007
3 votes

Direct logout link

I found that on Joomla 3.9.22, a link to /component/users/?task=user.logout worked as a logout link that did not require a userToken. When I used index.php?option=com_users&view=login&layout=...
ApolloLV's user avatar
  • 141
3 votes
Accepted

Redirect users after they reset their password

The onUserAfterSave hook allows you to access this data at the appropriate time via a plugin.
RichardB's user avatar
  • 3,082
3 votes
Accepted

When a content is trying to display to super user in Joomla 3.6.2, its not working with parse syntax error

you have some error in your code. Please try this : <?php //i want this to display only to super users $user = JFactory::getUser(); if($user->authorise('core.admin')) { ?><li><a ...
Joomler's user avatar
  • 1,811
3 votes

Is it possible to know the time spent by a student on a particular topic?

You can use the unload window event. Will be need make a plugin that send userId, pageId and time information to a controller that store this on database and provide statistics about it. <script ...
Guilherme's user avatar
  • 347
3 votes

Logout within plugin interfering with other plugins

The Joomla plugins run as they are ordered in the Joomla backend. Change the ordering - and ensure that the ordering of your plugin is last. This will ensure that all other plugins will run before ...
itoctopus's user avatar
  • 3,226
3 votes
Accepted

creating users programmatically causing conflict with logged in username display

I finally resolved the issue. All I had to do was make sure that once the new user was created I set the $user variable back to the active user data by using JFactory::getUser(). I was really over ...
user11029's user avatar
3 votes

Assign user to a specific group based on custom field selected

Write user plugin which will have the below file structure plugins/user/plugins_name/ plg_add_group.php plg_add_group.xml plg_add_group.xml - Write plugin manifest code here you can ...
Sudhir Sapkal's user avatar
3 votes

Get contact details from article override

You will firstly need to retrieve the user ID like so: $id = JFactory::getUser()->id; Then get the array of profile data, like so: $profile = JUserHelper::getProfile($id)->profile; You can ...
Lodder's user avatar
  • 26.9k
3 votes
Accepted

How to write the logged in user id in Plotalot queries?

Plotalot includes various variables that can be used in sql queries, eg. %%J_USER_ID%% is the currently logged in user_id. The Plotalot User Documentation Available as PDF here
jamesgarrett's user avatar
  • 3,299

Only top scored, non community-wiki answers of a minimum length are eligible