screwup in my fix for new user

"Seth Cribby" <[email protected]> Sun, 15 Sep 2002 22:18:08 -0700
Newsgroups gmane.comp.web.envolution.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.

------=_NextPart_000_0008_01C25D05.C4FE1240
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

I noticed in RC 10 that I screwed up the last fix I sent.

the line (221 in modules\NS-NewUser\user.php):

echo "<tr><td><font class=\"pn-normal\">"._FEMAIL.": </font></td><td><input
type=\"text\" name=\"email\" size=\"26\" maxlength=\"60\"></td></tr>\n";

should be:

echo "<tr><td><font class=\"pn-normal\">"._FEMAIL." </font></td><td><input
type=\"text\" name=\"femail\" size=\"26\" maxlength=\"60\"></td></tr>\n";

Both Email and fake email were given name=\"email\".  Thats what I get for
copying and pasting.  Also took out the extra colon since there is one in
the language.  Sorry.

Seth

------=_NextPart_000_0008_01C25D05.C4FE1240
Content-Type: application/octet-stream;
	name="user.php"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="user.php"

<?php /* $Id: user.php,v 1.57.2.3 2002/05/15 14:24:52 byronmhome Exp $ =
*/

// =
----------------------------------------------------------------------

// POST-NUKE Content Management System

// Copyright (C) 2001 by the Post-Nuke Development Team.

// http://www.postnuke.com/

// =
----------------------------------------------------------------------

// Based on:

// PHP-NUKE Web Portal System - http://phpnuke.org/

// Thatware - http://thatware.org/

// =
----------------------------------------------------------------------

// LICENSE

//

// This program is free software; you can redistribute it and/or

// modify it under the terms of the GNU General Public License (GPL)

// as published by the Free Software Foundation; either version 2

// of the License, or (at your option) any later version.

//

// This program 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.

//

// To read the license please visit http://www.gnu.org/copyleft/gpl.html

// =
----------------------------------------------------------------------

// Original Author of this file:

// Purpose of this file:  new user routines

// =
----------------------------------------------------------------------



$ModName =3D 'NS-NewUser';

modules_get_language();

global $prefix;



function newuser_user_underage()

{

include 'header.php';



    OpenTable();

        echo "<font class=3D\"pn-title\">"._SORRY."</font>";

        echo "<br><br>\n"

            ."<font class=3D\"pn-normal\">"._MUSTBE."<br>"

            ."<br>"._CLICK."<a href=3D\"index.php\">"._HERE."</a> =
"._RETURN."</font><br>\n";

   CloseTable();

   include 'footer.php';

}



function newuser_user_check_age($var)

{

    $sitename =3D pnConfigGetVar('sitename');



    include 'header.php';

        /*Added by Chestnut !*/

        if (pnConfigGetVar('blkusrreg')=3D=3D"1") {

                echo "<center><font =
class=3D\"pn-title\">"._UAREGNOACTIVE."<br>";                /*Valeur =
langue =E0 d=E9terminer*/

                echo ""._UAREGBEBACK."</font></center>";                 =
                                                                         =
      /*Valeur langue =E0 d=E9terminer*/

                include 'footer.php';

                Exit();

        }

        /*End*/

    OpenTable();

    echo "<center>"

        ."<font class=3D\"pn-title\">"._WELCOMETO." =
".pnVarPrepForDisplay($sitename)." "._REGISTRATION."</font>"

        ."<br><br>\n"

        ."<font class=3D\"pn-normal\">"._MUSTBE."</font><br>\n"



        ."<a href=3D\"user.php?op=3Dregister&amp;module=3DNS-NewUser\">"

        .""._OVER13.""

        ."</a><br><br>"



        ."<font class=3D\"pn-normal\">"._CONSENT."</font><br><br>\n"



        ."<a href=3D\"user.php?op=3Dunderage&amp;module=3DNS-NewUser\">"

        .""._UNDER13.""

        ."</a><br>\n"



        ."</font></center>\n";



    CloseTable();

    include 'footer.php';

}



function newuser_user_register()

{

    $system =3D pnConfigGetVar('system');



        include 'header.php';

                /*Added by Chestnut !*/

                if (pnConfigGetVar('blkusrreg')=3D=3D"1") {

                        echo "<center><font =
class=3D\"pn-title\">"._UAREGNOACTIVE."<br>";

                        echo ""._UAREGBEBACK."</font></center>";

                        include 'footer.php';

                        Exit();

                }

                /*End*/



        OpenTable();

        echo "<form name=3D\"Register\" action=3D\"user.php\" =
method=3D\"post\">\n"

            ."<font =
class=3D\"pn-title\">"._REGNEWUSER."</font><br><br>\n"

            ."<table cellpadding=3D\"0\" cellspacing=3D\"0\" =
border=3D\"0\">\n"

            ."<tr><td><font class=3D\"pn-normal\">"._NICKNAME.": * =
</font></td><td><input type=3D\"text\" name=3D\"uname\" size=3D\"26\" =
maxlength=3D\"25\"></td></tr>\n";

                        /*Added by Chestnut !*/

                        $allowuserpass =3D =
pnConfigGetVar('allowuserpass');

                        if ($allowuserpass=3D=3D"0") {

                                echo "<tr><td><font =
class=3D\"pn-normal\">"._UAUPASS.": *</font></td><td><input =
type=3D\"password\" name=3D\"upass\" size=3D\"26\" =
maxlength=3D\"25\"></td></tr>\n";                /*Valeur langue =E0 =
d=E9terminer*/

                                echo "<tr><td><font =
class=3D\"pn-normal\">"._UAUPASSCONFIRM.": *</font></td><td><input =
type=3D\"password\" name=3D\"upassverif\" size=3D\"26\" =
maxlength=3D\"25\"></td></tr>\n";        /*Valeur langue =E0 =
d=E9terminer*/

                        }

                        /*End*/

            echo "<tr><td><font class=3D\"pn-normal\">"._EMAIL.": =
*</font></td><td><input type=3D\"text\" name=3D\"email\" size=3D\"26\" =
maxlength=3D\"60\"></td></tr>\n";

                        //Check to see if full profile is enabled

                        if (pnConfigGetVar(pncuaadvreg)=3D=3D"0") {

                                //30.07.2002 modified by CyberOto - =
change of hardcoded RealName and remove valign=3Dtop and <BR>(Must start =
with http://). Added a value=3Dhttp:// parameter

                                echo "<tr><td><font =
class=3D\"pn-normal\">"._FEMAIL." </font></td><td><input type=3D\"text\" =
name=3D\"femail\" size=3D\"26\" maxlength=3D\"60\"></td></tr>\n";
									=20
					  echo "<tr><td width=3D80><font =
class=3D\"pn-normal\">"._UAREALNAME.": </font></td><td><input =
type=3D\"text\" name=3D\"name\" size=3D\"26\" maxlength=3D\"60\">"

                        ."&nbsp;</td></tr>"

                        ."<tr><td width=3D80><font =
class=3D\"pn-normal\">"._YOURHOMEPAGE.": </font></td><td><input =
type=3D\"text\" value=3D\"http://\"name=3D\"url\" size=3D\"26\" =
maxlength=3D\"100\">"

                        ."&nbsp;</td></tr>"

                                        ."<tr><td =
colspan=3D\"2\">&nbsp;</td></tr>"

                                    ."<tr><td width=3D80 =
valign=3Dtop><font class=3D\"pn-normal\">"._YOURAVATAR.": =
</font></td><td><select name=3D\"user_avatar\" =
onChange=3D\"showimage()\" class=3D\"pn-normal\">";

                    $handle =3D opendir('images/avatar');

                    while ($file =3D readdir($handle)) {

                            $filelist[] =3D $file;

                    }

                    asort($filelist);

                    while (list ($key, $file) =3D each ($filelist)) {

                            ereg(".gif|.jpg",$file);

                            if ($file !=3D "." && $file !=3D "..") {

                                echo "<option value=3D\"$file\"";

                            if ($file =3D=3D $user_avatar) {

                                    echo " selected";

                            }

                            echo ">$file</option>";

                        }

                    }

                    echo "</select>&nbsp;&nbsp;<img =
src=3D\"images/avatar/blank.gif\" name=3D\"avatar\" width=3D\"32\" =
height=3D\"32\" alt=3D\"\" align=3D\"top\">"

                            ."</td></tr>";

                                        //30.07.2002 CyberOto remove =
again the valign=3Dtop

                            echo "<tr><td width=3D80p><font =
class=3D\"pn-normal\">"._YICQ.": </font></td><td><input type=3D\"text\" =
name=3D\"user_icq\" size=3D\"26\" maxlength=3D\"100\">"

                        ."&nbsp;</td></tr>";

                                        //30.07.2002 CyberOto remove =
again the valign=3Dtop

                                echo "<tr><td width=3D80><font =
class=3D\"pn-normal\">"._YAIM.": </font></td><td><input type=3D\"text\" =
name=3D\"user_aim\" size=3D\"26\" maxlength=3D\"100\">"

                        ."&nbsp;</td></tr>";

                                echo "<tr><td width=3D80 =
valign=3Dtop><font class=3D\"pn-normal\">"._YLOCATION.": =
</font></td><td><input type=3D\"text\" name=3D\"user_from\" =
size=3D\"26\" maxlength=3D\"100\">"._UALOCATION.""

                        ."&nbsp;</td></tr>";

                                echo "<tr><td width=3D80 =
valign=3Dtop><font class=3D\"pn-normal\">"._YOCCUPATION.": =
</font></td><td><input type=3D\"text\" name=3D\"user_occ\" size=3D\"26\" =
maxlength=3D\"100\">"

                        ."&nbsp;</td></tr>";

                                echo "<tr><td width=3D80 =
valign=3Dtop><font class=3D\"pn-normal\">"._YINTERESTS.": =
</font></td><td><input type=3D\"text\" name=3D\"user_intrest\" =
size=3D\"26\" maxlength=3D\"100\">"

                        ."&nbsp;</td></tr>";

                                echo "<tr><td width=3D80 =
valign=3Dtop><font class=3D\"pn-normal\">"._SIGNATURE.": =
</font></td><td><textarea wrap=3D\"virtual\" cols=3D\"50\" rows=3D\"5\" =
name=3D\"user_sig\" class=3D\"pn-normal\"></textarea>"

                        ."<br />"

                        ."&nbsp;<font =
class=3D\"pn-normal\">"._255CHARMAX."</font></td></tr>";

                    echo "<tr><td width=3D80 valign=3Dtop><font =
class=3D\"pn-normal\">"._EXTRAINFO.": </font></td><td><textarea =
wrap=3D\"virtual\" cols=3D\"50\" rows=3D\"5\" name=3D\"bio\" =
class=3D\"pn-normal\"></textarea>"

                        ."<br /> <font =
class=3D\"pn-normal\">"._OPTIONAL."</font><br />"

                        ."&nbsp;<font =
class=3D\"pn-normal\">"._CANKNOWABOUT."</font></td></tr>"

                                        ."<tr><td =
colspan=3D\"2\">&nbsp;</td></tr>"

                                        ."<tr><td><font =
class=3D\"pn-normal\">"._OPTION.":</font> </td><td><INPUT =
TYPE=3D\"CHECKBOX\" NAME=3D\"user_viewemail\" VALUE=3D\"1\"><font =
class=3D\"pn-normal\"> "._ALLOWEMAILVIEW."</font></td></tr>\n";

                        }

                //Check for legal module

            if (pnModAvailable("legal")) {

                echo "<tr><td>&nbsp;</td><td><INPUT TYPE=3D\"CHECKBOX\" =
NAME=3D\"agreetoterms\" VALUE=3D\"1\"><font class=3D\"pn-normal\"> =
"._REGISTRATIONAGREEMENT." <a =
href=3D\"modules.php?op=3Dmodload&amp;name=3DLegal&amp;file=3Dindex\">"._=
TERMSOFUSE."</a> "._ANDCONNECTOR." <a =
href=3D\"modules.php?op=3Dmodload&amp;name=3DLegal&amp;file=3Dprivacy\">"=
._PRIVACYPOLICY."</a>.</td></tr>\n";

            }

                        //30.07.2002 CyberOto Added a Note field for =
requested fields

            echo "<tr><td width=3D80><font class=3D\"pn-normal\"><br =
/><b>"._UAREMARK."</b> </font></td><td><font class=3D\"pn-normal\"><br =
/>"._UAREMARKTEXT."</font></td></tr>\n";

                        //pncUserHack v1.2

                    if(pnModAvailable('ppnews')) {

                                echo '<tr><td>&nbsp;</td><td><INPUT =
TYPE=3D"CHECKBOX" NAME=3D"subppnews" VALUE=3D"1"><font =
class=3D"pn-normal"> '._UASUBPSNREG.'<br></td></tr>';

                        }

                        echo '<tr><td colspan=3D"2">&nbsp;</td></tr>';

                        echo "<tr><td>\n"

                    ."<input type=3D\"hidden\" name=3D\"module\" =
value=3D\"NS-NewUser\">\n"

                    ."<input type=3D\"hidden\" name=3D\"op\" =
value=3D\"confirmnewuser\">\n"

                    ."<input type=3D\"submit\" =
value=3D\""._NEWUSER."\">\n"

                    ."</td></tr></table>\n"

                    ."</form>\n"

                    ."<br>\n";

            if($system =3D=3D 0) {

                                echo "<font class=3D\"pn-normal\">" . =
_PASSWILLSEND . "</font><br><br>\n";

                    }

            echo "<font =
class=3D\"pn-normal\">"._COOKIEWARNING."</font><br>\n"

                    ."<font =
class=3D\"pn-normal\">"._ASREGUSER."</font><br>\n"

                    ."<font class=3D\"pn-normal\"><ul>\n"

                    ."<li>"._ASREG1."\n"

                    ."<li>"._ASREG2."\n"

                    ."<li>"._ASREG3."\n"

                    ."<li>"._ASREG4."\n"

                    ."<li>"._ASREG5."\n"

                    ."<li>"._ASREG6."\n"

                    ."<li>"._ASREG7."\n"

                    ."</ul></font>\n"

                    ."<font =
class=3D\"pn-title\">"._REGISTERNOW."</font><br>\n"

                    ."<font =
class=3D\"pn-normal\">"._WEDONTGIVE."</font>\n";

        CloseTable();



include 'footer.php';



}



function userCheck($var)

{

    global $stop;//, $allowuserpass;



    list($dbconn) =3D pnDBGetConn();

    $pntable =3D pnDBGetTables();



    $uname =3D $var['uname'];

    $email =3D $var['email'];



    $allowuserpass =3D pnConfigGetVar('allowuserpass');

    if ($allowuserpass=3D=3D"0") {

        $upass =3D $var['upass'];

            $upassverif =3D $var['upassverif'];

    }



    $res =3D pnVarValidate($email, 'email');

    if($res =3D=3D false) {

        $stop =3D "<center><font =
class=3D\"pn-title\">"._ERRORINVEMAIL."</center></font><br>";

    }



    //Check for legal module

    if (pnModAvailable("legal")) {

        // If legal var agreetoterms checkbox not checked, value is 0 =
and results in error

        if ($var['agreetoterms'] =3D=3D 0) {

           $stop =3D "<center><font =
class=3D\"pn-title\">"._ERRORMUSTAGREE."</center></font><br>";

        }

    }



    // Here we test the uname. Any value is possible but space.

    // On special character sets you might configure the server.

    // (was bug #455288)

    if ((!$uname) || !(ereg("^[[:print:]]+",$uname) && =
!ereg("[[:space:]]",$uname))) {

    /*if ((!$uname) || ($uname=3D=3D"") || =
(ereg("[^a-zA-Z0-9_-]",$uname))) {*/

        $stop =3D "<center><font =
class=3D\"pn-title\">"._ERRORINVNICK."</center></font><br>";

    }

    if (strlen($uname) > 25) {

        $stop =3D "<center><font =
class=3D\"pn-title\">"._NICK2LONG."</center></font>";

    }

    if =
(preg_match('/((root)|(adm)|(linux)|(webmaster)|(admin)|(god)|(administra=
tor)|(administrador)|(nobody)|(anonymous)|(anonimo)|(an=F3=EEimo)|(operat=
or))/iAD',$uname)) {

        $stop =3D "<center><font =
class=3D\"pn-title\">"._NAMERESERVED."</center></font>";

    }

    if (strrpos($uname,' ') > 0) {

        $stop =3D "<center><font =
class=3D\"pn-title\">"._NICKNOSPACES."</center></font>";

    }

    $column =3D &$pntable['users_column'];

    $existinguser =3D $dbconn->Execute("SELECT $column[uname] FROM =
$pntable[users] WHERE =
$column[uname]=3D'".pnVarPrepForStore($uname)."'");

    if (!$existinguser->EOF) {

        $stop =3D "<center><font =
class=3D\"pn-title\">"._NICKTAKEN."</center></font><br>";

    }

    $existinguser->Close();

       =20

        if ($allowuserpass=3D=3D"0") {

                if (strlen($upass) < 5) {

                        $stop =3D "<center><font =
class=3D\"pn-title\">"._UAPASSTOOSHORT." ".pnConfigGetVar('minpass')." =
"._UAPASSTOOSHORT2."</center></font>";

                }

                if ($upass!=3D$upassverif) {

                        $stop =3D "<center><font =
class=3D\"pn-title\">"._UAPASSDIFF."</center></font>";                =
/*Valeur langue =E0 d=E9terminer*/

                }

        }

        /*End*/

    $existinguser =3D $dbconn->Execute("SELECT $column[email] FROM =
$pntable[users] WHERE =
$column[email]=3D'".pnVarPrepForStore($email)."'");

    if (!$existinguser->EOF) {

        $stop =3D "<center><font =
class=3D\"pn-title\">"._EMAILREGISTERED."</center></font><br>";

    }

    $existinguser->Close();

    return($stop);

}



function newuser_user_confirmNewUser($var)

{

    global $stop, $EditedMessage; //, $allowuserpass;



    include 'header.php';



    $allowuserpass =3D pnConfigGetVar('allowuserpass');



    filter_text($var['uname']);

    $var['uname'] =3D $EditedMessage;

    if(isset($var['user_viewemail']) && $var['user_viewemail'] =3D=3D 1) =
{

        $var['user_viewemail'] =3D "1";

        $var['femail'] =3D $var['email'];

    } else {

        $var['user_viewemail'] =3D "0";

 //       $var['femail'] =3D "-";

    }

    if(empty($var['agreetoterms'])) {

        $var['agreetoterms'] =3D '0';

    }

    if (!$stop) {

        OpenTable();

        echo "<font class=3D\"pn-normal\">"._USERNAME.": =
".pnVarPrepForDisplay($var['uname'])."<br>"

            .""._EMAIL.": ".$var['email']."<br></font><br><br>\n";

        echo ""._GOBACK."";

        echo "<form action=3D\"user.php\" method=3D\"post\">"

            ."<input type=3D\"hidden\" name=3D\"uname\" =
value=3D\"$var[uname]\">"

            ."<input type=3D\"hidden\" name=3D\"email\" =
value=3D\"$var[email]\">"

                        ."<input type=3D\"hidden\" name=3D\"femail\" =
value=3D\"$var[femail]\">";

                /*Added by Chestnut ! 21/05/2002*/

                if ($allowuserpass=3D=3D"0") {

                        echo "<input type=3D\"hidden\" name=3D\"upass\" =
value=3D\"$var[upass]\">";

                        echo "<input type=3D\"hidden\" =
name=3D\"upassverif\" value=3D\"$var[upassverif]\">";

                }

                //pncUserHack v1.2

                if (isset($var[subppnews])) {

                        echo "<input type=3D\"hidden\" =
name=3D\"subppnews\" value=3D\"$var[subppnews]\">";

                }

                if (pnConfigGetVar(pncuaadvreg)=3D=3D"0") {

                        echo "<input type=3D\"hidden\" name=3D\"name\" =
value=3D\"$var[name]\">";

                        echo "<input type=3D\"hidden\" name=3D\"url\" =
value=3D\"$var[url]\">";

                        echo "<input type=3D\"hidden\" =
name=3D\"user_avatar\" value=3D\"$var[user_avatar]\">";

                        echo "<input type=3D\"hidden\" =
name=3D\"user_icq\" value=3D\"$var[user_icq]\">";

                        echo "<input type=3D\"hidden\" =
name=3D\"user_aim\" value=3D\"$var[user_aim]\">";

                        echo "<input type=3D\"hidden\" =
name=3D\"user_from\" value=3D\"$var[user_from]\">";

                        echo "<input type=3D\"hidden\" =
name=3D\"user_occ\" value=3D\"$var[user_occ]\">";

                        echo "<input type=3D\"hidden\" =
name=3D\"user_intrest\" value=3D\"$var[user_intrest]\">";

                        echo "<input type=3D\"hidden\" =
name=3D\"user_sig\" value=3D\"$var[user_sig]\">";

                        echo "<input type=3D\"hidden\" name=3D\"bio\" =
value=3D\"$var[bio]\">";

                }

                /*End*/

                echo "<input type=3D\"hidden\" name=3D\"agreetoterms\" =
value=3D\"$var[agreetoterms]\">"

            ."<input type=3D\"hidden\" name=3D\"user_viewemail\" =
value=3D\"$var[user_viewemail]\">"

            ."<input type=3D\"hidden\" name=3D\"op\" =
value=3D\"finishnewuser\">"

            ."<input type=3D\"hidden\" name=3D\"module\" =
value=3D\"NS-NewUser\">"

            ."<input type=3D\"submit\" value=3D\""._FINISH."\"></form>";

        CloseTable();

    } else {

        OpenTable();

        echo "<center><font class=3D\"pn-title\">Registration =
Error!</font><br><br>";

        echo "<font =
class=3D\"pn-normal\">$stop<br>"._GOBACK."</font></center>";

        CloseTable();

    }

    include 'footer.php';

}



function newuser_user_finishnewuser($var)

{

    global $stop, $makepass, $EditedMessage;//, $allowuserpass;



    list($dbconn) =3D pnDBGetConn();

    $pntable =3D pnDBGetTables();



    $system =3D pnConfigGetVar('system');

    $adminmail =3D pnConfigGetVar('adminmail');

    $sitename =3D pnConfigGetVar('sitename');

    $Default_Theme =3D pnConfigGetVar('Default_Theme');

    $commentlimit =3D pnConfigGetVar('commentlimit');

    $storynum =3D pnConfigGetVar('storyhome');

    $timezoneoffset =3D pnConfigGetVar('timezone_offset');

    $allowuserpass =3D pnConfigGetVar('allowuserpass');

        $senduserpass =3D pnConfigGetVar('senduserpass');



    include 'header.php';

    userCheck($var);

    $var['user_regdate'] =3D time();

    if (!isset($stop)) {

        /*Added by Chestnut ! 21/05/2002*/

                if ($allowuserpass=3D=3D"0") {

                        $makepass =3D $var['upass'];

                } else {

                        $makepass =3D makepass();

                }

                /*end*/

        $cryptpass =3D md5($makepass);

        $uid =3D $dbconn->GenId($pntable['users']);

        $column =3D &$pntable['users_column'];

        $result =3D $dbconn->Execute("INSERT INTO $pntable[users] (

                                                                         =
                               $column[name],                            =
    $column[uname],

                                                                         =
                               $column[email],                           =
     $column[femail],

                                                                         =
                               $column[url],                             =
   $column[user_avatar],

                                                                         =
                               $column[user_regdate],                =
$column[user_icq],

                                                                         =
                               $column[user_occ],                        =
$column[user_from],

                                                                         =
                               $column[user_intrest],                =
$column[user_sig],

                                                                         =
          $column[user_viewemail],        $column[user_theme],

                                                                         =
                               $column[user_aim],                        =
$column[user_yim],

                                                                         =
          $column[user_msnm],                        $column[pass],

                                                                         =
                               $column[storynum],                        =
$column[umode],

                                                                         =
                               $column[uorder],                        =
$column[thold],

                                                                         =
                               $column[noscore],                        =
$column[bio],

                                                                         =
                               $column[ublockon],                        =
$column[ublock],

                                                                         =
                               $column[theme],                           =
     $column[commentmax],

                                                                         =
                               $column[counter],                        =
$column[timezone_offset])

                                                   VALUES (              =
  '".pnVarPrepForStore($var['name'])."',

                                                                         =
                               '".pnVarPrepForStore($var['uname'])."',

                                                                         =
                               '".pnVarPrepForStore($var['email'])."',

                                                                         =
                               '".pnVarPrepForStore($var['femail'])."',

                                                                         =
                               '".pnVarPrepForStore($var['url'])."',

                                                                         =
                               =
'".pnVarPrepForStore($var['user_avatar'])."',

                                                                         =
                               =
'".pnVarPrepForStore($var['user_regdate'])."',

                                                                         =
                               =
'".pnVarPrepForStore($var['user_icq'])."',

                                                                         =
                               =
'".pnVarPrepForStore($var['user_occ'])."',

                                                                         =
                               =
'".pnVarPrepForStore($var['user_from'])."',

                                                                         =
          '".pnVarPrepForStore($var['user_intrest'])."',

                                                                         =
                               =
'".pnVarPrepForStore($var['user_sig'])."',

                                                                         =
                               =
'".pnVarPrepForStore($var['user_viewemail'])."',

                                                                         =
                               '',

                                                                         =
          '".pnVarPrepForStore($var['user_aim'])."',

                                                                         =
                               '',

                                                                         =
                               '',

                                                                         =
                               '".pnVarPrepForStore($cryptpass)."',

                                                                         =
                               '".pnVarPrepForStore($storynum)."',

                                                                         =
                               '',

                                                                         =
                               0,

                                                                         =
                               0,

                                                                         =
                               0,

                                                                         =
                               '".pnVarPrepForStore($var['bio'])."',

                                                                         =
                               0,

                                                                         =
                               '',

                                                                         =
                               '',

                                                                         =
          '".pnVarPrepForStore($commentlimit)."',

                                                                         =
                               '0',

                                                                         =
                               =
'".pnVarPrepForStore($timezoneoffset)."')");

        if($dbconn->ErrorNo()<>0) {

            echo $dbconn->ErrorNo(). ": ".$dbconn->ErrorMsg(). "<br>";

            error_log ($dbconn->ErrorNo(). ": ".$dbconn->ErrorMsg(). =
"<br>");

        } else {

            // get the generated id

            $uid =3D =
$dbconn->PO_Insert_ID($pntable['users'],$column['uid']);

            // Add user to group

            $column =3D &$pntable['groups_column'];

            $result =3D $dbconn->Execute("SELECT $column[gid]

                                      FROM $pntable[groups]

                                      WHERE $column[name]=3D'". =
pnConfigGetVar('defaultgroup') . "'");

            if($dbconn->ErrorNo()<>0) {

                echo $dbconn->ErrorNo(). "Get default group: =
".$dbconn->ErrorMsg(). "<br>";

                error_log ($dbconn->ErrorNo(). "Get default group: =
".$dbconn->ErrorMsg(). "<br>");

            } else {

                if (!$result->EOF) {

                    list($gid) =3D $result->fields;

                    $result->Close();

                    $column =3D &$pntable['group_membership_column'];

                    $result =3D $dbconn->Execute("INSERT INTO =
$pntable[group_membership] ($column[gid], $column[uid])

                                              VALUES =
(".pnVarPrepForStore($gid).", ".pnVarPrepForStore($uid).")");

                    if($dbconn->ErrorNo()<>0) {

                        echo $dbconn->ErrorNo(). "Create default group =
membership: ".$dbconn->ErrorMsg(). "<br>";

                        error_log ($dbconn->ErrorNo(). "Create default =
group membership: ".$dbconn->ErrorMsg(). "<br>");

                    }

                }

                                if (isset($var[subppnews])) {

                                        $psnsub =3D =
subscribeppnews($var['uname'], $var['email'], $makepass);

                                        if ($psnsub =3D=3D "OK") {

                                                $psnconfirm =3D =
_UASUBPSNOK;

                                        } else {

                                                $psnconfirm =3D =
_UASUBPSNNO;

                                        }

                                }

                $message =3D ""._WELCOMETO." =
$sitename!\n\n"._YOUUSEDEMAIL." ($var[email]) "._TOREGISTER." $sitename. =
"._FOLLOWINGMEM."\n\n"._UNICKNAME." $var[uname]\n"._UPASSWORD." =
$makepass";

                $subject=3D""._USERPASS4." $var[uname]";

                $from=3D"$adminmail";

                if ($system =3D=3D 1) {

                    echo "<table align=3D\"center\"><tr><td><font =
class=3D\"pn-normal\">"._YOURPASSIS." <b>$makepass</b></font><br>";

                    echo "<a class=3D\"pn-normal\" =
href=3D\"user.php?module=3DNS-User&op=3Dlogin&uname=3D$var[uname]&pass=3D=
$makepass&url=3Duser.php\">"._LOGIN."</a><font class=3D\"pn-normal\"> =
"._2CHANGEINFO."</font></td></tr>";

                                        echo '<tr><td =
align=3D"center">'.pnVarPrepForDisplay($psnconfirm).'</td></tr></table>';=


                                } else {

// 11-09-01 eugeniobaldi not compliant with PHP < 4.0.5

//                    pnMail($var['email'], $subject, $message, "From: =
$from\nX-Mailer: PHP/" . phpversion(), "-f$from");

                                        /*Added by Chestnut ! =
21/05/2002*/

                                        if ($allowuserpass =3D=3D "0") {

                                                echo "<table =
align=3D\"center\"><tr><td><font class=3D\"pn-normal\">"._YOURPASSIS." =
<b>$makepass</b></font><br>";

                            echo "<a class=3D\"pn-normal\" =
href=3D\"user.php?module=3DNS-User&op=3Dlogin&uname=3D$var[uname]&pass=3D=
$makepass&url=3Duser.php\">"._LOGIN."</a><font class=3D\"pn-normal\"> =
"._2CHANGEINFO."</font></td></tr>";

                                                echo '<tr><td =
align=3D"center">'.pnVarPrepForDisplay($psnconfirm).'</td></tr></table>';=


                            if ($senduserpass =3D=3D "0") {

                                                        =
pnMail($var['email'], $subject, $message, "From: $from\nX-Mailer: PHP/" =
. phpversion());

                                                }

                                        } else {

                                                pnMail($var['email'], =
$subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());

                                        }

                                        if =
(pnConfigGetVar('sendaddmail')=3D=3D"0") {

                                                $message =3D =
"$var[uname] "._UAADMMAILNEWOBJ." $sitename =
!\n\n$psnconfirm\n\n"._UACYA."";

                                                $subject =3D =
""._UAADMMAILNEWSBJ." $sitename !";

                                                $from =3D $adminmail;

                                                pnMail($adminmail, =
$subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());

                                        }

                                        /*End*/

                                        if ($senduserpass =3D=3D "0") {

                            OpenTable();

                            echo "<font =
class=3D\"pn-normal\">"._YOUAREREGISTERED."<br>";

                                                //echo =
pnVarPrepForDisplay($psnconfirm).'</font>';

                            CloseTable();

                                        }

                }

            }

        }

    } else {

        echo "$stop";

    }

    include 'footer.php';

}



function subscribeppnews($uname, $umail, $upass)

{

        $prefix =3D pnConfigGetVar(prefix);

        include('modules/ppnews/pn_conf_nl.php');

    list($dbconn) =3D pnDBGetConn();



        $upass =3D base64_encode(trim($upass));

        $d =3D Date(Ymd);



        $sql =3D "INSERT INTO ".$prefix."_psn_newsletter (nom_user, =
mail_user, passe_user, format_mail, nb_js, nb_php, nb_lien, nb_new, =
date_in)

                        VALUES ('$uname', '$umail', '$upass', =
'$defaut_mail', '$defaut_js', '$defaut_php', '$defaut_lien', =
'$defaut_new', '$d')";



        $psnexec =3D $dbconn->Execute($sql);

        if($dbconn->ErrorNo()<>0) {

                return "NO<br>".$dbconn->ErrorMsg();

        } else {

                return "OK";

        }

}



?>
------=_NextPart_000_0008_01C25D05.C4FE1240--