It happened, that I had to rename my admin.cgi, because somebody tried to hack it. My rule is: it is better to avoid the possibility that hacker can find the admin script and he can try to hack it.
So if I rename admin.cgi, I will have to change all references to "admin.cgi".
In my old modified Links 2.0, I solved it by setting an $admin global at the beginning of admin.cgi, so I was later able to check, if I'm in admin process or not. If we are in admin, display additional info, if not do not display anything, just log into error file if error occured.
That was the logic I used in Links 2.0.
Same should work in Links SQL, too.
1) Solution of Paul works, but anytime later I may run in the problem I described
2) Wrapper function is good idea, but we still need to find out if we are in admin or not.
I do not want to create 2 functions of everything I do (1 for admin, 1 for site), since it would offend against the reusable codes rules.
The truth is, the solution what Andy and Paul suggested is not bad, but I wanted to look for an internal solution if there exists such.
I was also lazy a bit to look for internal solutions in the core code.
But I may have to check it.
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...