Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function authorise($itemid)
- {
- $menus = $this->getMenu();
- $user = JFactory::getUser();
- /* quick fix :) */
- // Joomla base code seems to work but is overridden somewhere -
- // let's reset username
- $table = $user->getTable();
- if($table->load($user->id))
- {
- $original_properties = $table->getProperties();
- if(isset($original_properties['username']))
- {
- $user->set('username', $original_properties['username']);
- }
- }
- /* End quick fix */
- if (!$menus->authorise($itemid))
- {
- if ($user->get('id') == 0)
- {
- // Redirect to login
- $uri = JFactory::getURI();
- $return = (string)$uri;
- $this->setUserState('users.login.form.data', array( 'return' => $return ) );
- $url = 'index.php?option=com_users&view=login';
- $url = JRoute::_($url, false);
- $this->redirect($url, JText::_('JGLOBAL_YOU_MUST_LOGIN_FIRST'));
- }
- else {
- JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement