How to dynamically change ACL of a logged in user? - Joomla! Forum - community, help and support
we've written plugin adds registered users new group called "customers" using below code. problem have log out , in again see menu items, etc. associated customers. i've tried number of variations of these functions (not in order shown) make joomla recognize them new acl, no luck.
there way accomplish this? between iterations , protected objects, can't seem find way it.
in case it's not clear, want "registered" user become "customer" (this part works), , immediately have acl needed see menu items visible "customers" without having log out, , in again.
code: select all
$user = jfactory::getuser();
juserhelper::addusertogroup($user->id, 9); //make user customer
$user_new = new juser($user->id);
$user_new->getauthorisedgroups();
$user_new->getauthorisedviewlevels();
$session = jfactory::getsession();
$session->set('user', $user_new);
in case it's not clear, want "registered" user become "customer" (this part works), , immediately have acl needed see menu items visible "customers" without having log out, , in again.
i'm pretty new php , joomla! , know if there way make joomla! 2.5 recognize change in acl without user logging out , logging in.
the changes in acl @ site have don't take affect until logout/login complete, though there code included regarding refreshing sessions , updating database.
any appreciated!
the changes in acl @ site have don't take affect until logout/login complete, though there code included regarding refreshing sessions , updating database.
any appreciated!
Comments
Post a Comment