Default browser..

Started on the old forum in October 2009 · view the original in the archive · old links redirect here

9 replies · 661 views · started 17 years ago · 3 min read

2 participants
srecnica Developer · 174 posts #1

How to make the user may enter only with a browser .. If you try to get another browser to escape his notice that his nik protected and may enter default browser that is marked as the default..... I tried to do this .. but not work 🙁 the SQL users I have added zastita CHAR 1.. to index.php

else if($action=="zastita"){
addonline(getuid_sid($sid),"HAPPY","index.php?action=$action");

$pstyle = gettheme($sid);
    echo xhtmlhead("HAPPY",$pstyle);
echo "<p align=\"center\">";

$userwa = $uid;
$zastita = mysql_fetch_array(mysql_query("SELECT zastita FROM ibwf_users WHERE id = '".$userwa."'"));
if($zastita[0]==0){
        mysql_query("UPDATE ibwf_users SET zastita=1 WHERE id=$userwa");
        echo "Protection of your browser is activated.<br/>";
}
else if($zastita[0]==1){
        mysql_query("UPDATE ibwf_users SET zastita=0 WHERE id=$userwa");
        echo "Protection of yout browser is inactive.<br/>";

}
$thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));
    $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'"));  
    echo "<img src=\"http://coding-talk.com/images/themes/$themeimageset[0]/home.gif\" alt=\"*\"/> <a href=\"index.php?action=main&sid=$sid\">";
echo "HAPPY</a>";
  echo "</p>";
  echo xhtmlfoot();
}

to login.php

$zastita = mysql_fetch_array(mysql_query("SELECT zastita FROM ibwf_users WHERE name='".$uid."' AND browserm='".$brws."'"));
if($zastita[0]==1){

return true;

}else{

  $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=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>Nik ne postoji<br/><br/>";
  }else{
    //check for pwd
    $epwd = ($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=\"http://coding-talk.com/images/notok.gif\" alt=\"X\"/>pogresna lozinka<br/><br/>";
    }else{
      
      $tm = (time() - $timeadjust) ;
      $xtm = $tm + (getsxtm()*60);
      $did = $uid.$tm;
      $res = mysql_query("INSERT INTO ibwf_ses SET id='".($did)."', uid='".getuid_nick($uid)."', expiretm='".$xtm."'");
      
      if($res)
      {
        $tolog=true;
        
$sesx = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online"));
echo "Na online je: <a href=\"index.php?action=online2\">$sesx[0]</a>  Forumasa<br/>";

        echo "<b>Uspesan login</b>!<br/>Pozdrav <b>$uid</b><br/>";

echo "<img src=\"http://coding-talk.com/images/see_down.gif\" alt=\"*\"/><br/>";
include "clock/include.php";
echo "<br/>";
        $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."'");
             mysql_query("UPDATE ibwf_users SET lastact='".(time() - $timeadjust)."' 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() - $timeadjust) + (getsxtm()*60);
          $res = mysql_query("UPDATE ibwf_ses SET expiretm='".$xtm."' WHERE uid='".getuid_nick($uid)."'");
          
          if($res)
          {
            $tolog=true;
            //echo "Bookmark THIS page to avoid repeating the login proccess in the future<br/><br/>";
            echo "<b>Uspesan login!<br/>Pozdrav <b>$uid</b><br/>";

           
            
          }else{
            echo "<img src=\"http://coding-talk.com/images/point.gif\" alt=\"!\"/>Nemoguce logovanje, pokusaj kasnije<br/>"; //no chance this could happen unless there's error in mysql connection
            
          }
          
        }
        
      }
    }
  }
  
  if($tolog)

{

  $sid = ($did);
    echo "<br/><a href=\"index.php?action=main&sid=$sid\">";

echo "<b>Udji i budi HAPPY</b></a><br/><br/>";
echo "<img src=\"http://coding-talk.com/images/str1.gif\" alt=\"!\"/>  <a href=\"index.php?action=sexclub&sid=$sid\">18+ Club</a>  <img src=\"http://coding-talk.com/images/str2.gif\" alt=\"!\"/><br/><br/>";

echo "<b>Za laksi ulaz na forum skini</b><br/>";
echo "<a href=\"http://www.opera.com/mini/download/generic/generic_advanced_midp_2/\">OPERU MINI</a><br/>";
echo "Sacuvaj ovu stranicu kako bi izbegao/la stalno logovanje.<br/>";
        
}else{
echo "<br/><a href=\"index.php\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "HAPPY</a><br/><br/>";
}
return false;

}

So if I protect my nick with the browser and if someone try a different browser to enter my nick, he can not allow input...

Anshul Senior · 296 posts #2

add something like in ur login check function

$user_ip         = $user["user_ip"];
$user_browser = $user["user_soft"];
if(($user_browser!==$HTTP_USER_AGENT || $user_ip!==$ip)){
mysql_query ("Update users set user_soft='". $HTTP_USER_AGENT."', user_ip = '".$ip."' WHERE id = '".$id."';");

if ($user["ipbrosafety"]==1){
// here ipbrosafety if its on then user logout
}
}
srecnica Developer · 174 posts #3

Anshul wrote: add something like in ur login check function

$user_ip         = $user["user_ip"];
$user_browser = $user["user_soft"];
if(($user_browser!==$HTTP_USER_AGENT || $user_ip!==$ip)){
mysql_query ("Update users set user_soft='". $HTTP_USER_AGENT."', user_ip = '".$ip."' WHERE id = '".$id."';");

if ($user["ipbrosafety"]==1){
// here ipbrosafety if its on then user logout
}
}

no.. not work 🙁

Anshul Senior · 296 posts #4

post here ur ifunction that checks if user is logged or not 🙂

srecnica Developer · 174 posts #5

$user = mysql_fetch_array(mysql_query("SELECT zastita FROM ibwf_users WHERE id = '".$uid."'"));

$user_ip = $user["user_ip"]; $user_browser = $user["user_soft"]; if(($user_browser!==$HTTP_USER_AGENT || $user_ip!==$ip)){ mysql_query ("Update users set user_soft='". $HTTP_USER_AGENT."', user_ip = '".$ip."' WHERE id = '".$id."';");

if ($user["ipbrosafety"]==1){ echo "<a href="logovanje.php">Uloguj Se!</a>"; } } ...and as you said ...

srecnica Developer · 174 posts #6

Again I 🙂...Look, I've done this in login.php

$tolog = false; $brws = explode("/ ",$HTTP_USER_AGENT);
$ipscos = getip(); $uip =$ipscos ; $ubr = $brws [0]; $uinf = mysql_fetch_array(mysql_query("SELECT zastita FROM ibwf_users WHERE name='".$uid."'AND browserm='".$ubr."'")); if($uinf[0]==1) { $pstyle = gettheme($sid); echo xhtmlhead("$nazivsajta",$pstyle); echo " ";

mysql_query("DELETE FROM ibwf_ses WHERE uid='".getuid_sid($sid)."'"); echo " <img src="http://coding-talk.com/images/notok.gif" alt="x"/>This Nick is protected... "; echo "You do not have permission to login this browser "; echo "<a href="register.php">Register</a> ";

$nume = numebyip($ipscos); $text = "Ip-ul: $ipscos tried to get to Nik $nick![br/]Suspend of users: $nume / $ubr"; $sql = mysql_query("SELECT id, name FROM ibwf_users WHERE perm='4'"); while ($id = @mysql_fetch_array($sql)){ mysql_query("INSERT INTO ibwf_obavestenja SET text='Warning!!![br/]".$text."', byuid='4', touid = '".$uid[0]."', timesent='".time()."'"); } }else{

$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="http://coding-talk.com/images/notok.gif" alt="X"/>Nick does not exis

"; }else{ //check for pwd $epwd = ($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="http://coding-talk.com/images/notok.gif" alt="X"/>wrong password

"; }else{

  $tm = (time() - $timeadjust) ;
  $xtm = $tm + (getsxtm()*60);
  $did = $uid.$tm;
  $res = mysql_query("INSERT INTO ibwf_ses SET id='".($did)."', uid='".getuid_nick($uid)."', expiretm='".$xtm."'");
  
  if($res)
  {
    $tolog=true;

but when you protect your nick with option zastita = 1 (zastita=protected.. translate 😉 ), then we are not allowed to log on and protected browser .. Where did I go wrong?...how to call the last entry in the database browser and to protect it recognize? to let me log in with that browser?....External image (may be gone)External image (may be gone)External image (may be gone)

Anshul Senior · 296 posts #8

first

  1. you want to disallow any other browser to login into account only the browser that is saved at login time ??

or

you want to show some message to user if his last login ip and browser didnt match wid his/her current ip and browser

srecnica Developer · 174 posts #9
  1. you want to disallow any other browser to login into account only the browser that is saved at login time ?? ... yes, yes,yes, yes 😀 just want to ... they can log only protected browser...for example .. If you protect my Mozilla browser, they can log only with him ... and if you do not protect your browser to be able to log on with that browser ing... with the latest code that I made a wrong thing done to me .. ban me enter protected browser instead we allow input from himExternal image (may be gone)

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