Filter by CurrentUserLevel in Recordset Selecting event

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
hemin
User
Posts: 165

Filter by CurrentUserLevel in Recordset Selecting event

Post by hemin »

i am trying to Filter by CurrentUserLevel in Recordset Selecting event for some user levels.
i want to filter for all levels except two userlevel which in the below code i specified, the problem is it works for the administrator(-1) level but for others not working?!

if (CurrentUserLevel()!= "3" && CurrentUserLevel() != "-1") {
ew_AddFilter($filter, "RequestPer = ".CurrentUserID().""); }

}
above will bypass the filter for level -1 but not for level 3

if i do it alone
if (CurrentUserLevel()!= "3" ) {
ew_AddFilter($filter, "RequestPer = ".CurrentUserID().""); }

}

and userlevel is 3 still the filter is done.
can anyone help with this?


mobhar
User
Posts: 11745

Post by mobhar »

Try this:

if (CurrentUserLevel() <> 3 && CurrentUserLevel() <> -1) {


hemin
User
Posts: 165

Post by hemin »

mobhar wrote:
Try this:

if (CurrentUserLevel() <> 3 && CurrentUserLevel() <> -1) {

thanks alot man it worked. can you tell me where can i get a documentation for the syntax used in phpmaker or something similar?!


mobhar
User
Posts: 11745

Post by mobhar »

Please read "Server Events and Client Scripts" topic from PHPMaker Help menu.


Post Reply