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
$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:
$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

Login

Who's Online

353 user(s) are online (255 user(s) are browsing Support Forums)


Members: 0


Guests: 353


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits