Created
December 15, 2012 20:47
-
-
Save idea34/4299047 to your computer and use it in GitHub Desktop.
Useful Joomla snips
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Change Joomla user groups programatically | |
jimport('joomla.user.helper'); | |
JUserHelper::removeUserFromGroup($user_id, $group_id); | |
JUserHelper::addUserToGroup($user_id, $group_id); | |
// Get a user's view levels | |
$user =& JFactory::getUser(); | |
$aid = max ($user->getAuthorisedViewLevels()); | |
// Programatically login a Joomla user | |
$mainframe->login(array('username'=>$_POST['username'], 'password'=>$_POST['password']), array('silent'=>true)) | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment