Fix broken template management permissions logic

Old logic effectively denied access if a user was not an admin *or* was
not a CheckUser

New logic is correct behavior, deny access if a user is not an admin *and*
is not a CheckUser
(cherry picked from commit abbcb048de90a5f8f727e72d4e297c56a74290eb)
Update main.tpl
(cherry picked from commit d2984afffbee2b148376f9b73d0aac1cecdce912)
Merge branch 'privpol-enforcement', fixes #165 (cherry picked from commit 4bd20a7cbfa6b2017d67dfd71ca17499dcd15f98)

I don't know if cherry-picking this is still necessary, but doing so anyway
to avoid tool breakage as much as possible.
Fix XSS vulnerability that's not really XSS. (cherry picked from commit c1fcecfbccfb9c21fa909b393e3e06dba63382bb)

Is it really a vulnerability if the only user someone can exploit is themselves?
Merge tag 'rel6.2.5.1'

ACC release version 6.2.5, bugfix 1