[ PHPXref.com ] [ Generated: Sun Jul 20 18:58:10 2008 ] [ Netious 0.4 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> verifymail.php (source)

   1  <?
   2  
   3  /* **************************************************************

   4  Inclusion of the 'include' file containing the functions' definitions

   5  and the db file which stores the DB parameters. Afterwards: 

   6  Call of the DBInfo function which makes the DB pars accessible

   7  for the script and connection to the DB.

   8  ************************************************************** */
   9  
  10  require ("include.php");
  11  
  12  if (!file_exists("db.php")) {echo "The basic service configuration has not been finished yet. <br /> If all files/directories have been copied to the server  <a href=\"./config/\">click here to start the configuration script.</a>";}
  13  else {
  14  
  15  require("db.php");
  16  
  17  
  18  DBInfo();
  19  mysql_connect("$DBHost","$DBUser","$DBPass");
  20  mysql_select_db("$DBName");
  21  
  22  if (!isset($action)) $action="0";
  23  
  24  
  25  
  26  
  27  
  28  if (isset($uemail) && isset($upass) && isset($uwaitkey) && $action=="0")
  29  {    
  30  $result=mysql_query("SELECT UserId, Prior FROM user WHERE (Nick='$uemail' OR Email='$uemail') AND WaitKey='".sha1($uwaitkey)."' AND pwd='".sha1($upass)."'");
  31  $row=mysql_fetch_row($result);
  32  $num_rows0=mysql_num_rows($result);
  33  $uid=$row[0];
  34  $uprior=$row[1];
  35  
  36  
  37  $pagetype=0;
  38  if ($num_rows0==1)
  39      {if ($uprior=="1") 
  40          {mysql_query("UPDATE user SET WaitKey='Wait' WHERE UserId='$uid'");
  41          } else {mysql_query("UPDATE user SET WaitKey='Go' WHERE UserId='$uid'");}
  42      } else 
  43      {$result=mysql_query("SELECT UserId, Prior FROM user WHERE (Nick='$uemail' OR Email='$uemail') AND (WaitKey='".sha1($uwaitkey)."' OR WaitKey='Go' OR WaitKey='Wait') AND pwd='".sha1($upass)."'");
  44  $row=mysql_fetch_row($result);
  45  $num_rows=mysql_num_rows($result);
  46      if ($num_rows==1) {$pagetype=1;} else {$pagetype=2;}
  47      }
  48      
  49  if ($pagetype==0) 
  50  {
  51  /* Create the page */

  52  
  53  commonheader($pageid,$title,$keywords,$description,$forcedid);
  54  bodybegin($width, $bodyposition);
  55  logobar($logoname,$textlogo);
  56  
  57  
  58  echo " <center><table width=\"60%\"><tr><td height=\"300px\"><br /><br />E-mail successfully verified. You can <a href=\"signin.php?takeupass=$upass&takeunick=$uemail\" title=\"Sign in\">sign in </a>now. Remember to change the temporary password! <br /><br /><br /><br /></td></tr></table></center>";
  59  } elseif ($pagetype==1) 
  60  {
  61  /* Create the page */

  62  
  63  commonheader($pageid,$title,$keywords,$description,$forcedid);
  64  bodybegin($width, $bodyposition);
  65  logobar($logoname,$textlogo);
  66  
  67  
  68  echo " <center><table width=\"60%\"><tr><td height=\"300px\"><br /><br />E-mail already verified. There was no need to verify it again. You can <a href=\"signin.php?takeupass=$upass&takeunick=$uemail\" title=\"Sign in\">sign in </a> <br /><br /><br /><br /><br /></td></tr></table></center>";
  69  } else 
  70  {Header("Location: verifymail.php?uemail=$uemail&upass=$upass&uwaitkey=$uwaitkey&action=1");
  71  }
  72  }
  73  else 
  74  {
  75  
  76  /* Create the page */

  77  
  78  commonheader($pageid,$title,$keywords,$description,$forcedid);
  79  bodybegin($width, $bodyposition);
  80  logobar($logoname,$textlogo);
  81  
  82  
  83  
  84  
  85  
  86  if (!isset($uemail)) $uemail="";
  87  if (!isset($upass)) $upass="";
  88  if (!isset($uwaitkey)) $uwaitkey="";
  89  
  90      echo "
  91      <br />
  92      <center>
  93      <form action=\"verifymail.php\" method=\"post\">
  94      <table width=\"70%\" cellspacing=\"5\" cellpadding=\"5\">
  95      <tr>
  96      <td align=\"left\" style=\"border:solid 1px #cccccc\" width=\"100px\">
  97      User ID (or e-mail):
  98      </td>
  99      <td align=\"left\" style=\"border:solid 1px #cccccc\">
 100      <input type=\"text\" name=\"uemail\" value=\"$uemail\" size=\"40\" />
 101      </td>
 102      </tr>
 103      <tr>
 104      <td align=\"left\" style=\"border:solid 1px #cccccc\">
 105      Temporary password:
 106      </td>
 107      <td align=\"left\" style=\"border:solid 1px #cccccc\">
 108      <input type=\"password\" name=\"upass\" value=\"$upass\" size=\"40\" />
 109      </td>
 110      </tr>
 111      <tr>
 112      <td align=\"left\" style=\"border:solid 1px #cccccc\">
 113      Verification key:
 114      </td>
 115      <td align=\"left\" style=\"border:solid 1px #cccccc\">
 116      <input type=\"text\" name=\"uwaitkey\" value=\"$uwaitkey\" size=\"40\" />
 117      </td>
 118      </tr>
 119      <tr>
 120      <td colspan=\"2\" align=\"center\">
 121      <input type=\"submit\" value=\"Continue\" />
 122      </td>
 123      </tr>
 124      </table>
 125      </form>
 126      </center>
 127  ";
 128  
 129  
 130  
 131  }
 132  
 133  
 134  
 135  
 136  bodyend($thisurl);
 137  commonfooter();
 138  
 139  }
 140  
 141  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]