Elxis CMS Forum

Support => Administration => Topic started by: Davide on July 23, 2011, 15:20:55

Title: How to define that this kind of user can see this link
Post by: Davide on July 23, 2011, 15: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?
Title: Re: How to define that this kind of user can see this link
Post by: webgift on July 23, 2011, 15:36:08
Administrator belongs at group's id = 25. So you can do that like :

Code: (php) [Select]
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>';
}
Title: Re: How to define that this kind of user can see this link
Post by: Davide on July 24, 2011, 01: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
Title: Re: How to define that this kind of user can see this link
Post by: Davide on July 24, 2011, 01:35:59
table name elx_core_acl_aro_groups right? is not better to use group_id instead of gid?
Title: Re: How to define that this kind of user can see this link
Post by: webgift on July 24, 2011, 11:51:19
You asked me Davide :
How is possible in php to define that only administrator...
And i answered you :
Code: (php) [Select]
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?
Title: Re: How to define that this kind of user can see this link
Post by: Davide on July 24, 2011, 18: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.
Title: Re: How to define that this kind of user can see this link
Post by: CREATIVE Options on July 24, 2011, 18: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.