Solved

Joomla 2.5 logged in user question

Posted on 2012-12-28
3
359 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
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 24

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
First of all, we will need Jumi component or Sourcerer plugin for this to work. We need either of these because the main focus here is custom development outside of the standard modules or articles within Joomla. You can find Jumi here...it's my …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now