Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Joomla 2.5 logged in user question

Posted on 2012-12-28
3
Medium Priority
?
369 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 1000 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 26

Assisted Solution

by:lenamtl
lenamtl earned 1000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In the following article I will try to explain some of the issues I had learning Joomla and I hope this helps all of you beginners out there that love the concept but find it confusing and difficult to manage and configure a Joomla website. Like …
Here is a tutorial for making your own Joomla templates. Note before reading, you should have some existing knowledge of web development using HTML and CSS. Design Layout: Design your template in a graphics program like Adobe PhotoShop or Corel…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

721 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