Quote
Ankur wrote:
Or you can Simply try this condition :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]if (!iUSER_GROUPS || iUSER_GROUPS =='Group A') {
echo "Allow him to see Forum A";
}
else {
redirect(FORUM."index.php");
}[/syntaxhighlighter]
thanks for the advise...
i added this in viewforum.php
if (!iUSER_GROUPS || iUSER_GROUPS =='2' {
echo "Allow him to see Forum A";
}
else {
redirect(FORUM."index.php");
}
and it works as what i am expecting.. but something strikes in my mind.... means whenever user clicks on any link.. it will be sort of "fixed" type ?
or where should i put this code on ? do i need additional code further ?
example :
General
- school A (/viewforum.php?forum_id=1)
- school B (/viewforum.php?forum_id=2)
- school C (/viewforum.php?forum_id=3)
should i hardcode it somwhere else... so that i can define myself.. when viewforum.php?forum_id=1 is clicked... i can control who will be able to access that page ?
- school A (/viewforum.php?forum_id=1)
if (!iUSER_GROUPS || iUSER_GROUPS =='1' {
echo "Allow him to see school A";
}
else {
redirect(FORUM."index.php");
}
- school B (/viewforum.php?forum_id=2)
if (!iUSER_GROUPS || iUSER_GROUPS =='2' {
echo "Allow him to see school B";
}
else {
redirect(FORUM."index.php");
}
- school C (/viewforum.php?forum_id=3)
if (!iUSER_GROUPS || iUSER_GROUPS =='2' {
echo "Allow him to see school C";
}
else {
redirect(FORUM."index.php");
}
thank you