From: Adam M. <ad...@tu...> - 2001-09-20 16:57:33
|
by: Anonymous on: Wednesday 19 September @ 06:09:36 Sorry about that, this problem came from incompleted upload file that I did this morning (GMT+7) and because of bad internet connection. Now it ready for you to test, have fun :) I have to reupload my scripts because I found small bug inside new module structure of phpwebsite in following section if($admintest == $security_hash) switch($op) { case this_admin_op: this_admin_op(); break; //DO NOT INCLUDE A DEFAULT CASE!! If you do //it will not continue on to the user switch. } switch($op) { case this_user_op: this_user_op(); break; case default: default_operation; break; } if user login as admin and do admin function after load admin function by '$op' in the admin switch block, this '$op' will go to 'default' section of the user switch. To avoid this we have to add one flag for check '$op' The new code will look like $adminflag = 0; if($admintest == $security_hash) switch($op) { case this_admin_op: $adminflag = 1; this_admin_op(); break; //DO NOT INCLUDE A DEFAULT CASE!! If you do //it will not continue on to the user switch. } switch($op) { case this_user_op: this_user_op(); break; case default: if (!$adminflag) { default_operation; } break; } Just for your information. badguy by: Adam on: Thursday 20 September @ 12:42:45 (User Info) http://tux.appstate.edu/~adam Thanks for the post, Anon. I have changed the core modules to accomodate for this bug. I've also changed the module documentation to reflect this. This is what I did: //USER SWITCH switch($op) { default: if(!$op) default_op(); break; } Thanks again Adam --------------------------------- Adam Morton Developer - Web Technology Group Appalachian State University ad...@tu... |