1
ajaxbr
Access control for pages that aren't part of modules
  • 2005/1/20 0:59

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


This is a first attempt at a hack that lets XOOPS admins control whether legacy "bare pages" (e.g. backend.php, userinfo.php) should be accessible or not. Since I'm not a programmer, it could be made useful if a real one steps in and reviews/corrects it.

If you have a test server ready and can do a clean install, download and test this hack from http://www.zoologia.bio.br/barepages.zip

It will not work on an existing XOOPS site because I don't know how to add records to the (prefix)_config table .

It works like
le="color: #000000"><?php $config_handler =& xoops_gethandler('config'); $xoopsConfigBare =& $config_handler->getConfigsByCat(XOOPS_CONF_BARE); if ($xoopsConfigBare['bare_on'] != 1) { redirect_header('index.php',3,_NOPERM); exit(); }


And for userinfo.php, the "block anonymous access to userinfo.php" hack is in:
le="color: #000000"><?php $config_handler =& xoops_gethandler('config'); $xoopsConfigBare =& $config_handler->getConfigsByCat(XOOPS_CONF_BARE); if ($xoopsConfigBare['bare_userinfo'] != 1) { redirect_header('index.php',3,_NOPERM); exit(); } if ($xoopsConfigBare['bare_userinfo_all'] != 1) { if ( !$xoopsUser ) { redirect_header('index.php',3,_NOPERM); exit();} }


Feel free to re-write, improve, ignore, laugh at, mock, correct, whatever