rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: mynameiskeeet on September 12, 2012, 08:37:47 AM

Title: How to hide this button if %user% is not "admin".
Post by: mynameiskeeet on September 12, 2012, 08:37:47 AM
hi. i just want to ask if you guys know a code on how to hide the "Admin Panel" when the account logged in is just a user. i need the whole code. new here :D thanks guys  ;D i will wait for ur replies


heres a screenshot of what i want to hide.

(http://i724.photobucket.com/albums/ww243/keithjohn/Dwm-2012-09-12-16-31-02-64.gif)
Title: Re: How to hide this button if %user% is not "admin".
Post by: mynameiskeeet on September 12, 2012, 10:37:58 AM
found out the answer by searching. thanks :D

{.if|{.=|%user%|user1.}{.=|%user%|user2.}{.=|%user%|user3.}|
<a href="/page/">mylink</a>
.}
Title: Re: How to hide this button if %user% is not "admin".
Post by: Mars on September 12, 2012, 03:17:59 PM
another coding can

{.if|{.count substring|;%user%;|;user1;user2;user3;user4;user5;........userN;.}|
<a href="/page/">mylink</a>
.}

if you have a long list, it is best to use a group Admin

member of | A
    true if the current user is member of group A (specify more than one group separating by semicolons ";").
    Optional parameter user to check a different user.
    Example member of|administrators|user=rejetto

{.if|{.member of |Admin.}|
<a href="/page/">mylink</a>
.}

Title: Re: How to hide this button if %user% is not "admin".
Post by: mynameiskeeet on September 21, 2012, 10:36:26 AM
another coding can

{.if|{.count substring|;%user%;|;user1;user2;user3;user4;user5;........userN;.}|
<a href="/page/">mylink</a>
.}

if you have a long list, it is best to use a group Admin

member of | A
    true if the current user is member of group A (specify more than one group separating by semicolons ";").
    Optional parameter user to check a different user.
    Example member of|administrators|user=rejetto

{.if|{.member of |Admin.}|
<a href="/page/">mylink</a>
.}

just saw this now. thanks mars :)