Solved

Joomla 2.5 logged in user question

Posted on 2012-12-28
3
366 Views
Last Modified: 2013-01-06
I want to display a link only for users logged in and part of the administrator group.  The administrator group seems to be group id 7 in J2.5

kind of like this

if ($userGroup = 'admin') {
 
show link

}

Anyone know the syntax would look for Joomla 2.5?
0
Comment
Question by:tf2012
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 13

Accepted Solution

by:
Abhijeet Rananaware earned 250 total points
ID: 38735918
You need to access joomla user object.

To access user object use following code.After loading userobject in user variable you can acess usertype and add conditions according to user type as you need.
$user =& JFactory::getUser();
if($user->usertype =="Super Administrator")
{
  //code for admin
}

Open in new window

0
 
LVL 25

Assisted Solution

by:lenamtl
lenamtl earned 250 total points
ID: 38747692
If the link is a menu item just select the appropriate group access.

For content you can use:
http://ninjaforge.com/extensions/ninja-access-plugin
Ninja Access - Plugin allows you to hide or show portions of content depending on the access level of the viewer.
0
 
LVL 1

Author Closing Comment

by:tf2012
ID: 38748347
thank you!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome Friends, This is the tutorial for how to create new simple module in joomla 1.5. In the module has two important files. One is XML file and another file is PHP controller file. First you need to create the XML file. (CODE) …
This is our step by step to setting up and configuring a Joomla Install on a Windows 2003 Server. This is the perfect solution for an Intranet Website using Joomla. What you need (only use the following versions) : A fresh copy of Joomla http…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question