Elxis CMS Forum
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: IOS Reservations online hotel booking system for Elxis CMS.
 
Pages: [1]
  Print  
Author Topic: How to define that this kind of user can see this link  (Read 1908 times)
Davide
Full Member
***
Offline Offline

Posts: 116


Do yuo know that everything come from Source?


WWW
« on: July 23, 2011, 14:20:55 »

How is possible in php to define that only administrator has the enough power to see a specific link that i had manually insert in the source code?
Logged

webgift
Elxis Team
Hero Member
*****
Offline Offline

Posts: 3262



WWW
« Reply #1 on: July 23, 2011, 14:36:08 »

Administrator belongs at group's id = 25. So you can do that like :

Code: (php)
global $my;
if ($my->gid == 25) {
echo '<a href="http://www.example.com" title="title of example website" target="_blank">Link's text here</a>';
}
Logged

Davide
Full Member
***
Offline Offline

Posts: 116


Do yuo know that everything come from Source?


WWW
« Reply #2 on: July 24, 2011, 00:33:48 »

i can't check if is really working but i appreciate your help, where you are seeing the number of the id of the group of administrator or superadministrator? i'm checking the database but there's no more than 3 or 6 id in order not 25... also in elxis on user's group there's no this high number
Logged

Davide
Full Member
***
Offline Offline

Posts: 116


Do yuo know that everything come from Source?


WWW
« Reply #3 on: July 24, 2011, 00:35:59 »

table name elx_core_acl_aro_groups right? is not better to use group_id instead of gid?
Logged

webgift
Elxis Team
Hero Member
*****
Offline Offline

Posts: 3262



WWW
« Reply #4 on: July 24, 2011, 10:51:19 »

You asked me Davide :
How is possible in php to define that only administrator...
And i answered you :
Code: (php)
global $my;
if ($my->gid == 25) {
echo '<a href="http://www.example.com" title="title of example website" target="_blank">Link's text here</a>';
}
Now what are you looking for exactly?
Logged

Davide
Full Member
***
Offline Offline

Posts: 116


Do yuo know that everything come from Source?


WWW
« Reply #5 on: July 24, 2011, 17:09:59 »

uò nothing just understanding if you take this number "25" from the table of the database that i've previous posted. thank you for your help.
Logged

CREATIVE Options
Authorized Elxis Professional
Elxis Community
Hero Member
*****
Offline Offline

Posts: 2323


Professional services for Elxis CMS


WWW
« Reply #6 on: July 24, 2011, 17:20:14 »

1. The unique id of each group is stored in DB.
2. The basic groups with different security access it is also in the core code of Elxis.

Yes, the elx_core_acl_aro_groups is the table where is stored all the "gid" all the unique numbers.

The proper solution of permitting something only for those who has the id is to use the gid, as webgift told you.
Logged

Online Booking Pro Template with split menu (Elxis 2009.3) | We introduce the service of transferring all the content from Elxis 2006.x / 2008.x / 2009.x to Elxis 4 !
Pages: [1]
  Print  
 
Jump to: