@visman

thank you very much for all your assistance! once again you folks have come through for me!!
everything seems to be working perfectly!

i recall being well taken care of back in 2007:
http://punbb.informer.com/forums/post/96393/#p96393

and even back to the days when anderson(punbb's original creator, i think) was running the show.

i will mark the thread solved!

@visman

thx!

i added the intval as indicated in the three places.
i greped to make sure those were the only three.

the posts still do not show up.

however, the lines in the error log are reduced - only 3 this time:

====
[Sun Oct 02 22:24:27.449578 2016] [:error] [pid 6493] [client 192.168.0.18:35680] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /srv/websites/towardsfreedom.com/ber/tfbb/include/parser.php on line 776, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 22:24:27.450212 2016] [:error] [pid 6493] [client 192.168.0.18:35680] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /srv/websites/towardsfreedom.com/ber/tfbb/include/parser.php on line 722, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 22:24:27.450308 2016] [:error] [pid 6493] [client 192.168.0.18:35680] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /srv/websites/towardsfreedom.com/ber/tfbb/include/parser.php on line 776, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
====

and they all relate to the parser.php file whereas before there was only one such line in the errorlog before.
no problems showing up for pgsql.php though!

PanBB.Ru wrote:

You can throw me a file of your forum and database.? I'll see what I can do.

thx! i appreciate the offer!

however, i don't quite understand what you mean by "a file of your forum and database".

do you want me to make a tar of the entire forum and a dump of the tfbb database???!

Visman wrote:

What is written in the error.log file?

doing a tail -f on error-towardsfreedom.com.log
anytime we go to a topic where we see actual posts
(eg http://towardsfreedom.com/tfbb/viewtopic.php?id=68)

the log fills up with errors:

====
[Sun Oct 02 09:42:00.945047 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#2 used as offset, casting to integer (2) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.948806 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#4 used as offset, casting to integer (4) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.949553 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#5 used as offset, casting to integer (5) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.950121 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#6 used as offset, casting to integer (6) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.950435 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#7 used as offset, casting to integer (7) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.953007 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#8 used as offset, casting to integer (8) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.955488 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#11 used as offset, casting to integer (11) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.958182 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#12 used as offset, casting to integer (12) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.958792 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /srv/websites/towardsfreedom.com/ber/tfbb/include/parser.php on line 776, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.959210 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /srv/websites/towardsfreedom.com/ber/tfbb/include/parser.php on line 776, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
[Sun Oct 02 09:42:00.960181 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Notice:  Resource ID#13 used as offset, casting to integer (13) in /srv/websites/towardsfreedom.com/ber/tfbb/include/dblayer/pgsql.php on line 123, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14
====

line 123 in pgsql.php is
                        $this->last_query_text[$this->query_result] = $sql;
i wonder what resource ids #2-12 are? these show up in the PHP Notices.

then there are the last two entries the latter being a notice with resource #13, but the former being a warning
[Sun Oct 02 09:42:00.959210 2016] [:error] [pid 25713] [client 192.168.0.18:59416] PHP Warning:  preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /srv/websites/towardsfreedom.com/ber/tfbb/include/parser.php on line 776, referer: http://towardsfreedom.com/tfbb/viewforum.php?id=14

complaining about some defunct code i think. line 776 is
       $text = preg_replace($pattern, $replace, $text);
this is php version 7.0.8 that we are using.


whenever i go to a topic page to see actual posts, a similar pattern shows up:
1. php notices involving ids from #2-x
2. the php warning on preg_replace
3. the php notice involving id one more than x

could the problem be that my punbb 1.4 is not compatible with the newer php 7.08?

running PunBB 1.4.1 with postgresql 9.5 and many posts seem to have disappeared.

everything was fine on the old setup with postgresql 9.1 and all posts were showing up perfectly (including the latex equations). this was on a debian system inside of a virtual machine using openvz. the webserver was lighttp.

we switch to a ubuntu server (and no virtual machine) with postgresql 9.5 and apache2 copying the punbb directory (with permissions intact) and doing a postgresql dumpall. when we restored the dump and tried to go to the forums all posts seem to be showing up just fine except mine! and i am the admin!

here is an example from http://towardsfreedom.com/tfbb/
http://towardsfreedom.com/tfbb/viewforum.php?id=14

you'll see that clicking on any topic say "steps":
http://towardsfreedom.com/tfbb/viewtopic.php?id=67

show my input contains only the signature. the complete post does exist on the postgresql database though.

also, some of my posts occasionally do appear, but i have not been able to figure out a pattern yet.

i've tried to rebuild the index, but doing so seems to accomplish nothing.

i would appreciate ideas which may lead to a solution. thx!

Smartys wrote:

No, since message is called before any processing is done in this case

And footer has an exit called at the very end wink

ok!!!
now i finally understand!

MattF wrote:

Logs are the easiest and most useful starting point every time. big_smile We've all had one, (or more), of those moments in the past of overlooking what seems obvious afterwards. big_smile

well i'm feeling better now that i've done some penance big_smile

MattF wrote:

With regards to the exit, it's more a bypass. If you look at that function, you'll notice that once the message function is called, it terminates itself directly. The calling script can't continue on.

Edit: Think of it as the page that calls the message function is actually calling a separate page, so therefore it no longer has anything to process itself.

ok but i thought after calling the function from the register.php:

if ($pun_config['o_regs_allow'] == '0')
    message($lang_register['No new regs']);

the program should continue from where it left off, shouldn't it unless it encounters an exit at the end of the function which it doesn't:

function message($message, $no_back_link = false)
{
    global $db, $lang_common, $pun_config, $pun_start, $tpl_main;

    if (!defined('PUN_HEADER'))
    {
        global $pun_user;

        $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Info'];
        require PUN_ROOT.'header.php';
    }
?>
<div id="msg" class="block">
    <h2><span><?php echo $lang_common['Info'] ?></span></h2>
    <div class="box">
        <div class="inbox">
        <p><?php echo $message ?></p>
<?php if (!$no_back_link): ?>        <p><a href="javascript: history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
<?php endif; ?>        </div>
    </div>
</div>
<?php

    require PUN_ROOT.'footer.php';
}

unless it's one of the exits that exist in the footer.php?

i can see that the exit would work going through the form regularly (as i wrote above), but is it possible to send the info through the uri directly and thereby bypass the message function?

MattF wrote:

Glad to hear you've found the cause of the problem. smile

ya it was me all the time big_smile big_smile big_smile
thanks mattf, for your inputs and the idea of looking at the log in the earlier post.
guess it's better to look at logs before looking at code big_smile

but now that i've done it, i think i'd still like to find out where that exit is implemented when o_new_reg=0.

Smartys wrote:

Don't worry about it pradtf, we're always happy to help smile

you are very kind.

i run 3 pun forums on our servers and always make donations to any free software that i intend to stick with.

i'm going to stick with pun because of its quality and the quality of people like you smartys as well as the others who tried to help out in this thread. may be one day after learning more, i'll be able to pass on the favor to someone else.

for now though, i'm on my way to the donation button ...

Smartys wrote:

I meant modifications to your PunBB forum. smile

i have not made any modifications.
i've done something much worse!! sad sad

Smartys wrote:

Could you check through your site's access log and see if you can find any entries for the IPs?

i just checked the log.
i found that there was another pun forum that had been setup in a different directory, but with access to the same database. this was an oversight when we changed our operating system from openbsd to debian.
they were getting in through that register.php and the cache_config.php had the o_allow_reg set to 1.

i learned a bit about how pun is coded and a lot about how helpful people on this forum really are.
unfortunately, i'm afraid i've wasted your time - a little more care on my part and earlier examination of the logs would have saved everyone this unnecessary trouble. for this i apologize.

thank you very much for trying to solve this problem of my own creation.

Smartys wrote:

What do you see when you visit the registration page directly?

the expected page with
=============
Info
This forum is not accepting new registrations.
Go back
=============

Smartys wrote:

Also, have you installed any mods (and if so, which)?

i don't think so - i don't know what mods are.
unless you mean mods as in the sense of apache mods like:
php5.conf php5.load perl.conf perl.load etc which are installed with apache when you want php or perl etc. is that what you mean or is it something else specifically related to punbb (i haven't explored much with pun because it did what i required perfectly).

Smartys wrote:

pradtf: Could you paste a copy of your register.php here?

certainly!
(i haven't changed anything since i really don't know enough php to feel confident in doing so.
this the same code as in 1.2.14 i think because i don't believe it got updated with 1.2.15 but i don't remember.)

<?php
/***********************************************************************

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  This file is part of PunBB.

  PunBB is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/


define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';


// If we are logged in, we shouldn't be here
if (!$pun_user['is_guest'])
{
    header('Location: index.php');
    exit;
}

// Load the register.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';

// Load the register.php/profile.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';

if ($pun_config['o_regs_allow'] == '0')
    message($lang_register['No new regs']);


// User pressed the cancel button
if (isset($_GET['cancel']))
    redirect('index.php', $lang_register['Reg cancel redirect']);


else if ($pun_config['o_rules'] == '1' && !isset($_GET['agree']) && !isset($_POST['form_sent']))
{
    $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register'];
    require PUN_ROOT.'header.php';

?>
<div class="blockform">
    <h2><span><?php echo $lang_register['Forum rules'] ?></span></h2>
    <div class="box">
        <form method="get" action="register.php">
            <div class="inform">
                <fieldset>
                    <legend><?php echo $lang_register['Rules legend'] ?></legend>
                    <div class="infldset">
                        <p><?php echo $pun_config['o_rules_message'] ?></p>
                    </div>
                </fieldset>
            </div>
            <p><input type="submit" name="agree" value="<?php echo $lang_register['Agree'] ?>" /><input type="submit" name="cancel" value="<?php echo $lang_register['Cancel'] ?>" /></p>
        </form>
    </div>
</div>
<?php

    require PUN_ROOT.'footer.php';
}


else if (isset($_POST['form_sent']))
{
    // Check that someone from this IP didn't register a user within the last hour (DoS prevention)
    $result = $db->query('SELECT 1 FROM '.$db->prefix.'users WHERE registration_ip=\''.get_remote_address().'\' AND registered>'.(time() - 3600)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());

    if ($db->num_rows($result))
        message('A new user was registered with the same IP address as you within the last hour. To prevent registration flooding, at least an hour has to pass between registrations from the same IP. Sorry for the inconvenience.');


    $username = pun_trim($_POST['req_username']);
    $email1 = strtolower(trim($_POST['req_email1']));

    if ($pun_config['o_regs_verify'] == '1')
    {
        $email2 = strtolower(trim($_POST['req_email2']));

        $password1 = random_pass(8);
        $password2 = $password1;
    }
    else
    {
        $password1 = trim($_POST['req_password1']);
        $password2 = trim($_POST['req_password2']);
    }

    // Convert multiple whitespace characters into one (to prevent people from registering with indistinguishable usernames)
    $username = preg_replace('#\s+#s', ' ', $username);

    // Validate username and passwords
    if (strlen($username) < 2)
        message($lang_prof_reg['Username too short']);
    else if (pun_strlen($username) > 25)    // This usually doesn't happen since the form element only accepts 25 characters
        message($lang_common['Bad request']);
    else if (strlen($password1) < 4)
        message($lang_prof_reg['Pass too short']);
    else if ($password1 != $password2)
        message($lang_prof_reg['Pass not match']);
    else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest']))
        message($lang_prof_reg['Username guest']);
    else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
        message($lang_prof_reg['Username IP']);
    else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
        message($lang_prof_reg['Username reserved chars']);
    else if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
        message($lang_prof_reg['Username BBCode']);

    // Check username for any censored words
    if ($pun_config['o_censoring'] == '1')
    {
        // If the censored username differs from the username
        if (censor_words($username) != $username)
            message($lang_register['Username censor']);
    }

    // Check that the username (or a too similar username) is not already registered
    $result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE UPPER(username)=UPPER(\''.$db->escape($username).'\') OR UPPER(username)=UPPER(\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\')') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());

    if ($db->num_rows($result))
    {
        $busy = $db->result($result);
        message($lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2']);
    }


    // Validate e-mail
    require PUN_ROOT.'include/email.php';

    if (!is_valid_email($email1))
        message($lang_common['Invalid e-mail']);
    else if ($pun_config['o_regs_verify'] == '1' && $email1 != $email2)
        message($lang_register['E-mail not match']);

    // Check it it's a banned e-mail address
    if (is_banned_email($email1))
    {
        if ($pun_config['p_allow_banned_email'] == '0')
            message($lang_prof_reg['Banned e-mail']);

        $banned_email = true;    // Used later when we send an alert e-mail
    }
    else
        $banned_email = false;

    // Check if someone else already has registered with that e-mail address
    $dupe_list = array();

    $result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE email=\''.$email1.'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
    if ($db->num_rows($result))
    {
        if ($pun_config['p_allow_dupe_email'] == '0')
            message($lang_prof_reg['Dupe e-mail']);

        while ($cur_dupe = $db->fetch_assoc($result))
            $dupe_list[] = $cur_dupe['username'];
    }

    // Make sure we got a valid language string
    if (isset($_POST['language']))
    {
        $language = preg_replace('#[\.\\\/]#', '', $_POST['language']);
        if (!file_exists(PUN_ROOT.'lang/'.$language.'/common.php'))
                message($lang_common['Bad request']);
    }
    else
        $language = $pun_config['o_default_lang'];

    $timezone = round($_POST['timezone'], 1);
    $save_pass = (!isset($_POST['save_pass']) || $_POST['save_pass'] != '1') ? '0' : '1';

    $email_setting = intval($_POST['email_setting']);
    if ($email_setting < 0 || $email_setting > 2) $email_setting = 1;

    // Insert the new user into the database. We do this now to get the last inserted id for later use.
    $now = time();

    $intial_group_id = ($pun_config['o_regs_verify'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED;
    $password_hash = pun_hash($password1);

    // Add the user
    $db->query('INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit) VALUES(\''.$db->escape($username).'\', '.$intial_group_id.', \''.$password_hash.'\', \''.$email1.'\', '.$email_setting.', '.$save_pass.', '.$timezone.' , \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$now.', \''.get_remote_address().'\', '.$now.')') or error('Unable to create user', __FILE__, __LINE__, $db->error());
    $new_uid = $db->insert_id();


    // If we previously found out that the e-mail was banned
    if ($banned_email && $pun_config['o_mailing_list'] != '')
    {
        $mail_subject = 'Alert - Banned e-mail detected';
        $mail_message = 'User \''.$username.'\' registered with banned e-mail address: '.$email1."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';

        pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
    }

    // If we previously found out that the e-mail was a dupe
    if (!empty($dupe_list) && $pun_config['o_mailing_list'] != '')
    {
        $mail_subject = 'Alert - Duplicate e-mail detected';
        $mail_message = 'User \''.$username.'\' registered with an e-mail address that also belongs to: '.implode(', ', $dupe_list)."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';

        pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
    }

    // Should we alert people on the admin mailing list that a new user has registered?
    if ($pun_config['o_regs_report'] == '1')
    {
        $mail_subject = 'Alert - New registration';
        $mail_message = 'User \''.$username.'\' registered in the forums at '.$pun_config['o_base_url']."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'Forum Mailer'."\n".'(Do not reply to this message)';

        pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
    }

    // Must the user verify the registration or do we log him/her in right now?
    if ($pun_config['o_regs_verify'] == '1')
    {
        // Load the "welcome" template
        $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/welcome.tpl'));

        // The first row contains the subject
        $first_crlf = strpos($mail_tpl, "\n");
        $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
        $mail_message = trim(substr($mail_tpl, $first_crlf));

        $mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
        $mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
        $mail_message = str_replace('<username>', $username, $mail_message);
        $mail_message = str_replace('<password>', $password1, $mail_message);
        $mail_message = str_replace('<login_url>', $pun_config['o_base_url'].'/login.php', $mail_message);
        $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);

        pun_mail($email1, $mail_subject, $mail_message);

        message($lang_register['Reg e-mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
    }

    pun_setcookie($new_uid, $password_hash, ($save_pass != '0') ? $now + 31536000 : 0);

    redirect('index.php', $lang_register['Reg complete']);
}


$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register'];
$required_fields = array('req_username' => $lang_common['Username'], 'req_password1' => $lang_common['Password'], 'req_password2' => $lang_prof_reg['Confirm pass'], 'req_email1' => $lang_common['E-mail'], 'req_email2' => $lang_common['E-mail'].' 2');
$focus_element = array('register', 'req_username');
require PUN_ROOT.'header.php';

?>
<div class="blockform">
    <h2><span><?php echo $lang_register['Register'] ?></span></h2>
    <div class="box">
        <form id="register" method="post" action="register.php?action=register" onsubmit="this.register.disabled=true;if(process_form(this)){return true;}else{this.register.disabled=false;return false;}">
            <div class="inform">
                <div class="forminfo">
                    <h3><?php echo $lang_common['Important information'] ?></h3>
                    <p><?php echo $lang_register['Desc 1'] ?></p>
                    <p><?php echo $lang_register['Desc 2'] ?></p>
                </div>
                <fieldset>
                    <legend><?php echo $lang_register['Username legend'] ?></legend>
                    <div class="infldset">
                        <input type="hidden" name="form_sent" value="1" />
                        <label><strong><?php echo $lang_common['Username'] ?></strong><br /><input type="text" name="req_username" size="25" maxlength="25" /><br /></label>
                    </div>
                </fieldset>
            </div>
<?php if ($pun_config['o_regs_verify'] == '0'): ?>            <div class="inform">
                <fieldset>
                    <legend><?php echo $lang_register['Pass legend 1'] ?></legend>
                    <div class="infldset">
                        <label class="conl"><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password1" size="16" maxlength="16" /><br /></label>
                        <label class="conl"><strong><?php echo $lang_prof_reg['Confirm pass'] ?></strong><br /><input type="password" name="req_password2" size="16" maxlength="16" /><br /></label>
                        <p class="clearb"><?php echo $lang_register['Pass info'] ?></p>
                    </div>
                </fieldset>
            </div>
<?php endif; ?>            <div class="inform">
                <fieldset>
                    <legend><?php echo ($pun_config['o_regs_verify'] == '1') ? $lang_prof_reg['E-mail legend 2'] : $lang_prof_reg['E-mail legend'] ?></legend>
                    <div class="infldset">
<?php if ($pun_config['o_regs_verify'] == '1'): ?>            <p><?php echo $lang_register['E-mail info'] ?></p>
<?php endif; ?>                    <label><strong><?php echo $lang_common['E-mail'] ?></strong><br />
                        <input type="text" name="req_email1" size="50" maxlength="50" /><br /></label>
<?php if ($pun_config['o_regs_verify'] == '1'): ?>                        <label><strong><?php echo $lang_register['Confirm e-mail'] ?></strong><br />
                        <input type="text" name="req_email2" size="50" maxlength="50" /><br /></label>
<?php endif; ?>                    </div>
                </fieldset>
            </div>
            <div class="inform">
                <fieldset>
                    <legend><?php echo $lang_prof_reg['Localisation legend'] ?></legend>
                    <div class="infldset">
                        <label><?php echo $lang_prof_reg['Timezone'] ?>: <?php echo $lang_prof_reg['Timezone info'] ?>
                        <br /><select id="time_zone" name="timezone">
                            <option value="-12"<?php if ($pun_config['o_server_timezone'] == -12 ) echo ' selected="selected"' ?>>-12</option>
                            <option value="-11"<?php if ($pun_config['o_server_timezone'] == -11) echo ' selected="selected"' ?>>-11</option>
                            <option value="-10"<?php if ($pun_config['o_server_timezone'] == -10) echo ' selected="selected"' ?>>-10</option>
                            <option value="-9.5"<?php if ($pun_config['o_server_timezone'] == -9.5) echo ' selected="selected"' ?>>-9.5</option>
                            <option value="-9"<?php if ($pun_config['o_server_timezone'] == -9 ) echo ' selected="selected"' ?>>-09</option>
                            <option value="-8.5"<?php if ($pun_config['o_server_timezone'] == -8.5) echo ' selected="selected"' ?>>-8.5</option>
                            <option value="-8"<?php if ($pun_config['o_server_timezone'] == -8 ) echo ' selected="selected"' ?>>-08 PST</option>
                            <option value="-7"<?php if ($pun_config['o_server_timezone'] == -7 ) echo ' selected="selected"' ?>>-07 MST</option>
                            <option value="-6"<?php if ($pun_config['o_server_timezone'] == -6 ) echo ' selected="selected"' ?>>-06 CST</option>
                            <option value="-5"<?php if ($pun_config['o_server_timezone'] == -5 ) echo ' selected="selected"' ?>>-05 EST</option>
                            <option value="-4"<?php if ($pun_config['o_server_timezone'] == -4 ) echo ' selected="selected"' ?>>-04 AST</option>
                            <option value="-3.5"<?php if ($pun_config['o_server_timezone'] == -3.5) echo ' selected="selected"' ?>>-3.5</option>
                            <option value="-3"<?php if ($pun_config['o_server_timezone'] == -3 ) echo ' selected="selected"' ?>>-03 ADT</option>
                            <option value="-2"<?php if ($pun_config['o_server_timezone'] == -2 ) echo ' selected="selected"' ?>>-02</option>
                            <option value="-1"<?php if ($pun_config['o_server_timezone'] == -1) echo ' selected="selected"' ?>>-01</option>
                            <option value="0"<?php if ($pun_config['o_server_timezone'] == 0) echo ' selected="selected"' ?>>00 GMT</option>
                            <option value="1"<?php if ($pun_config['o_server_timezone'] == 1) echo ' selected="selected"' ?>>+01 CET</option>
                            <option value="2"<?php if ($pun_config['o_server_timezone'] == 2 ) echo ' selected="selected"' ?>>+02</option>
                            <option value="3"<?php if ($pun_config['o_server_timezone'] == 3 ) echo ' selected="selected"' ?>>+03</option>
                            <option value="3.5"<?php if ($pun_config['o_server_timezone'] == 3.5 ) echo ' selected="selected"' ?>>+03.5</option>
                            <option value="4"<?php if ($pun_config['o_server_timezone'] == 4 ) echo ' selected="selected"' ?>>+04</option>
                            <option value="4.5"<?php if ($pun_config['o_server_timezone'] == 4.5 ) echo ' selected="selected"' ?>>+04.5</option>
                            <option value="5"<?php if ($pun_config['o_server_timezone'] == 5 ) echo ' selected="selected"' ?>>+05</option>
                            <option value="5.5"<?php if ($pun_config['o_server_timezone'] == 5.5 ) echo ' selected="selected"' ?>>+05.5</option>
                            <option value="6"<?php if ($pun_config['o_server_timezone'] == 6 ) echo ' selected="selected"' ?>>+06</option>
                            <option value="6.5"<?php if ($pun_config['o_server_timezone'] == 6.5 ) echo ' selected="selected"' ?>>+06.5</option>
                            <option value="7"<?php if ($pun_config['o_server_timezone'] == 7 ) echo ' selected="selected"' ?>>+07</option>
                            <option value="8"<?php if ($pun_config['o_server_timezone'] == 8 ) echo ' selected="selected"' ?>>+08</option>
                            <option value="9"<?php if ($pun_config['o_server_timezone'] == 9 ) echo ' selected="selected"' ?>>+09</option>
                            <option value="9.5"<?php if ($pun_config['o_server_timezone'] == 9.5 ) echo ' selected="selected"' ?>>+09.5</option>
                            <option value="10"<?php if ($pun_config['o_server_timezone'] == 10) echo ' selected="selected"' ?>>+10</option>
                            <option value="10.5"<?php if ($pun_config['o_server_timezone'] == 10.5 ) echo ' selected="selected"' ?>>+10.5</option>
                            <option value="11"<?php if ($pun_config['o_server_timezone'] == 11) echo ' selected="selected"' ?>>+11</option>
                            <option value="11.5"<?php if ($pun_config['o_server_timezone'] == 11.5 ) echo ' selected="selected"' ?>>+11.5</option>
                            <option value="12"<?php if ($pun_config['o_server_timezone'] == 12 ) echo ' selected="selected"' ?>>+12</option>
                            <option value="13"<?php if ($pun_config['o_server_timezone'] == 13 ) echo ' selected="selected"' ?>>+13</option>
                            <option value="14"<?php if ($pun_config['o_server_timezone'] == 14 ) echo ' selected="selected"' ?>>+14</option>
                        </select>
                        <br /></label>
<?php

        $languages = array();
        $d = dir(PUN_ROOT.'lang');
        while (($entry = $d->read()) !== false)
        {
            if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
                $languages[] = $entry;
        }
        $d->close();

        // Only display the language selection box if there's more than one language available
        if (count($languages) > 1)
        {

?>
                            <label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?>
                            <br /><select name="language">
<?php

            while (list(, $temp) = @each($languages))
            {
                if ($pun_config['o_default_lang'] == $temp)
                    echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
                else
                    echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
            }

?>
                            </select>
                            <br /></label>
<?php

        }
?>
                    </div>
                </fieldset>
            </div>
            <div class="inform">
                <fieldset>
                    <legend><?php echo $lang_prof_reg['Privacy options legend'] ?></legend>
                    <div class="infldset">
                        <p><?php echo $lang_prof_reg['E-mail setting info'] ?></p>
                        <div class="rbox">
                            <label><input type="radio" name="email_setting" value="0" /><?php echo $lang_prof_reg['E-mail setting 1'] ?><br /></label>
                            <label><input type="radio" name="email_setting" value="1" checked="checked" /><?php echo $lang_prof_reg['E-mail setting 2'] ?><br /></label>
                            <label><input type="radio" name="email_setting" value="2" /><?php echo $lang_prof_reg['E-mail setting 3'] ?><br /></label>
                        </div>
                        <p><?php echo $lang_prof_reg['Save user/pass info'] ?></p>
                        <div class="rbox">
                            <label><input type="checkbox" name="save_pass" value="1" checked="checked" /><?php echo $lang_prof_reg['Save user/pass'] ?><br /></label>
                        </div>
                    </div>
                </fieldset>
            </div>
            <p><input type="submit" name="register" value="<?php echo $lang_register['Register'] ?>" /></p>
        </form>
    </div>
</div>
<?php

require PUN_ROOT.'footer.php';
elbekko wrote:

No, the check is at the top of the page and should work just fine. Unless you've modified it, I believe the message function calls exit(); at the end.

register.php requires include/common.php which in turn requires include/functions.php

in the include/functions.php file there is the message function:

//
// Display a message
//
function message($message, $no_back_link = false)
{
    global $db, $lang_common, $pun_config, $pun_start, $tpl_main;

    if (!defined('PUN_HEADER'))
    {
        global $pun_user;

        $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Info'];
        require PUN_ROOT.'header.php';
    }
?>

<div id="msg" class="block">
    <h2><span><?php echo $lang_common['Info'] ?></span></h2>
    <div class="box">
        <div class="inbox">
        <p><?php echo $message ?></p>
<?php if (!$no_back_link): ?>        <p><a href="javascript: history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
<?php endif; ?>        </div>
    </div>
</div>
<?php

    require PUN_ROOT.'footer.php';
}

but this shouldn't call exit, should it?
because then it should do so for any message presumably?

now the require footer.php has

if (!defined('PUN'))
    exit;

which disallows running the script directly, but i don't think that has anything to do with exiting if message is run.

MattF wrote:

Btw, is there anything in the server logs regarding these registrations that are getting through?

didn't check, but they are showing up on the database.
i will check for it next time.
good idea!

MattF wrote:

Shouldn't be. Register.php is called to deal with whatever parameters are passed to it. Thereby, it will check the o_regs_allow setting before proceeding any further with it's processing on that demo above.

right! in fact, the action on the form is register.php (line 272):

<form id="register" method="post" action="register.php?action=register" onsubmit="this.register.disabled=true;if(process_form(this)){return true;}else{this.register.disabled=false;return false;}">

and if o_reg_allow is set to 0 you get message according to:

if ($pun_config['o_regs_allow'] == '0')
    message($lang_register['No new regs']);

end of story if you are using the normal form because you don't get to see the normal form.

however, the o_regs_allow appears only at the beginning of the file (line 43) and its purpose seems to be to print the message so people trying to register will go away. if you send info to register.php directly via the uri, won't the info go through regardless since you are actually sending information not requesting to input information because of

if (isset($_GET['cancel']))
    redirect('index.php', $lang_register['Reg cancel redirect']);
else if ($pun_config['o_rules'] == '1' && !isset($_GET['agree']) && !isset($_POST['form_sent']))
{ rest of file}

in other words, should the o_regs_allow be implemented this way perhaps:

if ($pun_config['o_regs_allow'] == '0') {
    message($lang_register['No new regs']);
        EXIT}
else {
        DO THE REST OF THE FORM
}

just a guess based on a quick look at the file and a limited understanding of php.

is it possible that

o_regs_allow = 0

in the config.php file only disables the registration form from showing up?

now if one were to parallel the registration uri directly, something like:
domain.com/register.php?name=me&email=me@whatever.com etc etc
thus simulating what would be sent by the registration form that the normal process would be circumvented?

i have set allow new registrations to NO.
i upgraded yesterday to 1.2.15.
but some how they are getting in anyway and i have to go and delete them manually.
they really aren't a problem  because they never post.

how can they register? i can't big_smile
they're showing up right in the postgresql database.

how can i stop these registrations?

i've read through several threads here regarding spambots - is that what i'm dealing with?
one of the ideas was to stop them via the time they are setting, but that seems like a temporary solution. captcha is a good idea if you want registrations, but i don't  so how do i stop it completely?

thanks in advance!

Smartys wrote:

PunBB can do md5 and sha1. If a user logs in and there is an md5 hash as their password when the server can do sha1, then the server logs them in and changes the password to sha1.

that is just fantastic to know!
i copied the md5 hash into the password field for a user and logged in under their name and just as you said, the password field was updated into sha1.
this is very nice because it means that i won't have to ask everyone to redo their passwords and the switchover will be quite seamless!
many thanks!!

hello prad!
i hope you don't mind if i post here big_smile

after looking at the table structures setup by punbb on postgre and those on mysql by phpbb, i think doing the thing manually might be best. they look very different and since there aren't too many things to transfer, it really isn't worth the trouble to do it otherwise.

so we'd set up users and login under their names and copy the posts - letting punbb take care of the linking between the users and their posts. seems safest to me with my minimal level of experience.

what i'm puzzled about is the conversion program that exists. does it handle the passwords?
phpBB uses md5 and punbb (at least on my postgre) does sha1.
since md5 can't be decrypted (from what i have read), how can the conversion program set the users up?
unless what is does is set them up with random passwords and let them change these later?

the discussions on this forum have convinced me to switch. besides, i like puns.

i need to go from phpBB-mysql to punBB-postgre.

i can think of several ways to do this, but am uncertain of the merits of each.

1. mysqldump the phpBB forum then convert it to postgre and hope that the result will work with punBB
2. do a backup through phpBB then convert it to postgre and hope that the result will work with punBB
3. use conversion tool to go from phpBB to punBB in mysql, then mysqldump, convert to postgre and hope ...

as one can see, there is a lot of hoping because the assumption is phpBB and punBB are sufficiently similar in structure so that the data is compatible.

if this is not the case, i see only 2 other possiblities:

1. understand the structures of phpBB in mysql and punBB in postgre and write a conversion program
2. manually transfer the information (doable because the forums aren't big yet)

insights or even incites would be appreciated.