1
TBrillon
Removing authentication from register.php
  • 2005/2/10 19:00

  • TBrillon

  • Just popping in

  • Posts: 9

  • Since: 2002/9/1 7


Anyone know what code elements I would need to remove from register.php so that I can display this page to new users when I have the site in Closed Status?


I want to close the site indefinitely and give access to people that are already members but in the same sense I want to have register.php available for new people to sign up.

As it is right now, new users cannot access register.php unless they authenticate first.

I just want to remove the authenication piece within register.php so new users can sign up.

Any ideas on how to remove the code?

Since I start the sites main page in a sensitive module I cant just remove it from anonymous view without it redirecting to a profile page.

Thanks for your help

2
TBrillon
Re: Removing authentication from register.php
  • 2005/2/14 15:49

  • TBrillon

  • Just popping in

  • Posts: 9

  • Since: 2002/9/1 7


Zzzzzzzzzz.... *falls asleep while waiting for some sign of life*

3
Mithrandir
Re: Removing authentication from register.php

The code is not in register.php, but in include/common.php from line 233:
if ($xoopsConfig['closesite'] == 1) {
        
$allowed = false;
        if (
is_object($xoopsUser)) {
            foreach (
$xoopsUser->getGroups() as $group) {
                if (
in_array($group, $xoopsConfig['closesite_okgrp']) || XOOPS_GROUP_ADMIN == $group) {
                    
$allowed = true;
                    break;
                }
            }
        } elseif (!empty(
$_POST['xoops_login'])) {
            include_once 
XOOPS_ROOT_PATH.'/include/checklogin.php';
            exit();
        }
        if (!
$allowed) {
            include_once 
XOOPS_ROOT_PATH.'/class/template.php';
            
$xoopsTpl = new XoopsTpl();
            
$xoopsTpl->assign(array('sitename' => $xoopsConfig['sitename'], 'xoops_themecss' => xoops_getcss(), 'xoops_imageurl' => XOOPS_THEME_URL.'/'.$xoopsConfig['theme_set'].'/', 'lang_login' => _LOGIN, 'lang_username' => _USERNAME, 'lang_password' => _PASSWORD, 'lang_siteclosemsg' => $xoopsConfig['closesite_text']));
            
$xoopsTpl->xoops_setCaching(1);
            
$xoopsTpl->display('db:system_siteclosed.html');
            exit();
        }
        unset(
$allowed, $group);
    }
}
You'll have to change that to check if the requested page is register.php (and the user is not logged in, perhaps) and if so, allow the page to be served.