Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

24

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 PHP magic is required in order to get the token. The following code will display a Login link to guests, and a direct Logout Username link to logged in users: $...


23

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 Properties: id ($user->id) name ($user->name) username ($user->username) groups ($user->groups) email ($user->email). You can check if the ...


14

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, where the location of the user registration form is well known and by default public accessible, it's easy to start filling up and submitting the forms. ...


12

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 frontend. There is also a feature where it notifies all admins if a user has deleted their account. Looks like a promising extension and exactly what you need. ...


11

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 disabled by setting Users -> Manage -> Options -> Allow User Registration to "No". You can then delete all users except the Super Administrator account....


10

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 flexibility to add more fields and override the output. I haven't really played with it much but I have heard good things about it. Joom Profile


10

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 problem. This could be termed as somewhat of a problem in Joomla as knowing your way around you can still register/login if you know the url structure. There are ...


10

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: public static function getUserId($username) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ...


9

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 ); define( 'JPATH_BASE', realpath(dirname(__FILE__).'/' )); require_once ( JPATH_BASE .'/includes/defines.php' ); require_once ( JPATH_BASE .'/includes/framework....


9

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 newly created usergroup.


8

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 go area so I won't even start on that. I would strongly suggest you use a small and simple 3rd party plugin. Here's a plugin that does just that for Joomla 3.4, ...


8

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 manager options, you should be good. Then just give your client the url. So the steps are: Create a new menu, name it Hidden Don't publish a module of the new menu ...


8

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 exact approach should depend on from where you want to import these users and the actual user-data you already have and want to import. Also, if these users ...


8

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 get the names of these groups, you can run a database query (add after the code above) $user = JFactory::getUser(); $groups = JAccess::getGroupsByUser($user-&...


7

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 limited, but as far as I remember it still supports avatars. One of the functions I found usefull was the option to set a custom redirect for the first login after ...


7

@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 various options available like, Community Builder, JomSocial, EasySocial and other socila networking solution. But if don't want the full community solution then you ...


7

There is already a plugin which works great for logout button. You should check this extension logout button


7

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 override): templates/MY_TEMPLATE/html/com_users/login/default_login.php and go to line 81, where you will see the following code: <input type="hidden" ...


6

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 good results using CloudFlare to buffer traffic to our sites. It keeps most of the bad traffic from ever even hitting the server. But installing Akeeba Admin ...


6

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: /components/com_users/views/login/tmpl/default.php and change if ($this->user->get('guest')): echo $this->loadTemplate('login'); to if ($this->user->...


6

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 from the plugin name and type, and the file/folder naming conventions & structure for the plugin help Joomla find and load the right php files. If your ...


6

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” user group. Then you change the permission of each category to deny the access for this user group. Here is a Step by Step tutorial (Joomla 2.5 because ...


6

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” user group. Add the group to the “special” access level and allow the group to access the backend and the com_content. Then you change the permission of each ...


6

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 profile. Return must me an internal. Don't redirect to an external URL or it will be overwritten by default, profile redirect. In view part, joomla check if you ...


6

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/views/registration/tmpl/default.php to /templates/your_template_name/html/com_users/registration/default.php then open it with your favorite php editor. ...


5

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>'; echo '<p>Country: ' . $profile->profile['country'] . '</p>'; echo '<p>Website: ' . $profile->profile['website'] . '</p>'; echo '<p&...


5

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.xyz/administrator/index.php?option=com_plugins and activate the recaptcha Plugin and put your private and public keys in the plugin settings Then go to http://...


5

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. In the Joomla backend, go to Extensions (top menu) >> Plugin Manager >> User Profile. You will see the following custom fields: Address 1 Address 2 ...


5

Finally found out what the issue was. It turned out that upon migrating Joomla 2.5 to 3.3, a lot of the most recent registrants has not been assigned to the "Registered" user group, therefore they had no permissions at all. I ended up running the following MySQL query in PhpMyAdmin: SELECT `id` FROM `jos_users` WHERE `id` NOT IN (SELECT `user_id` FROM `...


5

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 code would go into are onUserAfterSave and onUserAfterDelete and are documented at Plugin/Events/User. These events will fire when a user is saved or deleted ...


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