Hi Dongsheng,
just saw you latest gradual changes about this issue and have found that here:
http://cvs.moodle.org/moodle/backup/backup.php?r1=1.48&r2=1.49
You've used the same error string "cannotusepage" in THREE places. If you look at this carefully you'll see that the second replacement is incorrect, only admins can use that page (whereas the rest are admins and teachers).
I'd suggesto you to fix this by:
1) Adding some different lang strings like:
cannotuseadmin
cannotuseadminadminorteacher
...
(i.e. all them will start by "cannotuse" followed by the list of roles allowed to use the page). Just a example proposal, feel free to improve it.
2) Apply then where necessary.
That way, always you find one error message, you can resuse those langs strings safely in future changes of this gradual task.
Ciao
All the error() calls are changed to print_error() now, creating error strings may take a while, tooooo many strings need to be created.