Просмотр файла magboard/reg.php

Размер файла: 2.77Kb
<?  
require("functionChat.ssp");

function ValidNN($s) 
{
  return !eregi("[^a-z0-9_]",$s);
}


$r = GetRandom();
$nn=ReplaceChar($nn);

if (empty($nn)) 
{
  LogResult(utf(4),utf(26),"index.php?p=$r");
}

if (!ValidNN($nn))
{
  LogResult(utf(4),utf(35),"index.php?p=$r");
}

openDB(); 
if ($log=="old") // зарегистрированный пользователь
{
  $result = checkpass($nn,$pass,"email,subjectlen");
  $email = mysql_result($result,0, "email");
  $subjectlen = mysql_result($result,0, "subjectlen");
  if (!($subjectlen >= 0 and $subjectlen <= 255)) { $subjectlen = $DefSubjectLen;}
}  
else 
{
  if ($log=="new")
  {
    $sqlSel="select * from users where nick = '$nn'";
    $result=mysql_query($sqlSel) or die(mysql_error()); 
    $Count=mysql_num_rows($result);
    if ($Count != 0)
    {
      LogResult(utf(4),utf(27),"index.php?p=$r&amp;login=$nn&amp;pass=$pass");
    }
    include("antimat.ssp");
    $BadWord = GetBadWord($nn);
    if ($BadWord != "") LogResult(utf(4),utf(25)."<br/>$BadWord", "index.php?p=$r");
    $email = "";
    $messlim = $DefMessLim;
    $subjectlen = $DefSubjectLen;
  }
  else
  {
    LogResult(utf(4),utf(28),"index.php?p=$r");
  }  
}    
mysql_close();

require("headerwml.ssp");

echo "<card id=\"ComputerMag\" title=\"ComputerMag\">"; 

echo "<onevent type=\"onenterforward\">\n";
echo "<refresh>\n";
echo "<setvar name=\"password\" value=\"\"/>\n";
echo "<setvar name=\"email\" value=\"\"/>\n";
echo "<setvar name=\"subjectlen\" value=\"\"/>\n";
echo "</refresh>\n";
echo "</onevent>\n";
 
echo "<p align=\"center\">";            
// Правильный синтаксис ников
echo utf(0).":<b>$nn</b><br/>\n";
echo utf(1).":(a-Z,0-9)<br/>";
echo "<input name=\"password\" title=\"=\" type=\"text\" value=\"$pass\" maxlength=\"10\"/>";

echo utf(29)."<br/>";
echo "<input name=\"email\" title=\"=\" emptyok=\"true\" type=\"text\" value=\"$email\" maxlength=\"50\"/>";

echo utf(30)."<br/>".utf(31)."<br/>(1-255):<br/>";
echo "<input name=\"subjectlen\" format=\"*N\" title=\"=\" type=\"text\" value=\"$subjectlen\" maxlength=\"3\"/>";

echo "</p>";
echo "<p>";
echo "<a href=\"index.php?p=$r&amp;login=$nn&amp;pass=$pass\">- ".utf(9)."</a><br/>\n";
echo "<anchor>- ".utf(32);
echo "<go method=\"post\" href=\"savereg.php?log=$log\">\n";
echo "<postfield name=\"email\" value=\"$(email)\"/>\n";
echo "<postfield name=\"subjectlen\" value=\"$(subjectlen)\"/>\n";
echo "<postfield name=\"refrint\" value=\"$DefRefrInt\"/>\n";
echo "<postfield name=\"pass\" value=\"$pass\"/>\n"; 
echo "<postfield name=\"nn\" value=\"$nn\"/>\n";
echo "<postfield name=\"newpass\" value=\"$(password)\"/>\n"; 
echo "<postfield name=\"newnn\" value=\"$nn\"/>\n";

echo "</go>\n";
echo "</anchor>\n";   
echo "</p>";
include ("bottom.inc");
?>