What I want to do, is every user has special rights.
If a user has the rights set to "1", then he must be able to see all links. (1 + 2 + 3)
If a user has the rights set to "2", then he must be able to see all links. (2 + 3)
If a user has the rights set to "3", then he must be able to see all links. (3 only)
My idear was it by doing a if as in the example, but it doesn't work!
Who could do it?
$userrights = "1";
if($userrights=="1")
{
$user_rights = "and rights='1' and rights='2' and rights='3'";
}
elseif($userrights=="2")
{
$user_rights = "and rights='2' and rights='3'";
}
elseif($userrights=="3")
{
$user_rights = "and rights='3'";
}
else
{
$user_rights = "and rights='3'";
}
$content_menu=mysql_query("select id,content,link,rights from $db_menu where language='$language' and title='$row[title]' $user_rights order by 'content'");
// Menu Table
// $db_menu -> "menu links"
id orderby language title content link rights
1 1 eng General Language /adm_language.mrm 3
2 1 eng General Version /adm_version.mrm 3
3 2 eng Settings Create User /adm_user_create.mrm 1
4 2 eng Settings Edit User /adm_user_change.mrm 1
5 3 eng Content Management /adm_management.mrm 2
6 1 eng General System Information /adm_sysinfo.mrm 3
7 2 eng Settings Change Password /adm_password.mrm 3