Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Sobota, 24. október 2026

Rozdiely pre phpPlatonLib/Auth_AuthDB/AuthDB.php medzi verziami 1.6 a 1.7

verzia 1.6, 2002/05/29 15:08:32 verzia 1.7, 2002/07/31 15:34:14
Riadok 31 
Riadok 31 
   
 require_once 'DB.php';  require_once 'DB.php';
   
 define('AUTH_DB_COOKIE_NAME', 'AuthDB_session_id_cookie');  define('AUTH_DB_COOKIE_NAME',   'AuthDB_session_id_cookie');
 define('AUTH_DB_UNDEFINED',              0);  define('AUTH_DB_UNDEFINED',              0);
 define('AUTH_DB_NOT_LOGGED',    -1);  define('AUTH_DB_NOT_LOGGED',    -1);
 define('AUTH_DB_LOGGED_IN',              1);  define('AUTH_DB_LOGGED_IN',              1);
Riadok 96  class AuthDB
Riadok 96  class AuthDB
         function _processStatus()          function _processStatus()
         {          {
                 $this->_checkDB();                  $this->_checkDB();
                 $this->_dbUpdateTimeout();                  $this->_DBupdateTimeout();
   
                 if ($this->_dbCheckLogin())                  if ($this->_DBcheckLogin())
                         return AUTH_DB_LOGGED_IN;                          return AUTH_DB_LOGGED_IN;
   
   
Riadok 106  class AuthDB
Riadok 106  class AuthDB
                 $status = $this->login();                  $status = $this->login();
   
                 if ($status == AUTH_DB_LOGGED_IN) {                  if ($status == AUTH_DB_LOGGED_IN) {
                         $this->_dbInsert();                          $this->_DBinsert();
                 }                  } elseif ($status == AUTH_DB_FAILED) {
                 elseif ($status == AUTH_DB_FAILED) {                          $this->_DBlog();
                         $this->_dbLog();  
                 }                  }
   
                 return $status;                  return $status;
Riadok 121  class AuthDB
Riadok 120  class AuthDB
   
                 if (! empty($this->_props['username'])) {                  if (! empty($this->_props['username'])) {
   
                         $password = $this->_dbGetPassword();                          $password = $this->_DBgetPassword();
                         if (isset($password)                          if (isset($password)
                                 && ! strcmp($password, md5($this->_props['password']))) {                                  && ! strcmp($password, md5($this->_props['password']))) {
                                 $status = AUTH_DB_LOGGED_IN;                                  $status = AUTH_DB_LOGGED_IN;
                         }                          } else {
                         else {  
                                 $status = AUTH_DB_FAILED;                                  $status = AUTH_DB_FAILED;
                         }                          }
                 }                  } else {
                 else {  
                         $status = AUTH_DB_NOT_LOGGED;                          $status = AUTH_DB_NOT_LOGGED;
                 }                  }
   
Riadok 140  class AuthDB
Riadok 137  class AuthDB
         function logout()          function logout()
         {          {
                 if ($this->getAuth()) {                  if ($this->getAuth()) {
                         $this->_dbLogout();                          $this->_DBlogout();
                         $this->_status = AUTH_DB_LOGGED_OUT;                          $this->_status = AUTH_DB_LOGGED_OUT;
                 }                  }
         }          }
   
         function getUsername()          function getUsername()
         {          {
                 return $this->_dbGetUsername();                  return $this->_DBgetUsername();
         }          }
   
         function getUserInfo()          function getUserInfo()
         {          {
                 if ($this->getAuth()) {                  if ($this->getAuth()) {
                         $this->_props['username'] = $this->getUsername();                          $this->_props['username'] = $this->getUsername();
                         return $this->_dbGetUserInfo();                          return $this->_DBgetUserInfo();
                 }                  }
   
                 return false;                  return false;
Riadok 178  class AuthDB
Riadok 175  class AuthDB
   
         function _error($error)          function _error($error)
         {          {
                 echo "AuthDB error: "                  echo 'AuthDB error: '
                         . $error->getMessage() . "<br>"                          . $error->getMessage() . '<br>'
                         . $error->getDebugInfo() . "<br>";                          . $error->getDebugInfo() . '<br>';
                 die();                  die();
         }          }
   
Riadok 210  class AuthDB
Riadok 207  class AuthDB
                                 if (isset($HTTP_COOKIE_VARS[AUTH_DB_COOKIE_NAME])) {                                  if (isset($HTTP_COOKIE_VARS[AUTH_DB_COOKIE_NAME])) {
                                         $ret = $HTTP_COOKIE_VARS[AUTH_DB_COOKIE_NAME];                                          $ret = $HTTP_COOKIE_VARS[AUTH_DB_COOKIE_NAME];
                                         $ret = intval(stripslashes($ret));                                          $ret = intval(stripslashes($ret));
                                 }                                  } else {
                                 else {  
                                         $ret = '';                                          $ret = '';
                                 }                                  }
                                 break;                                  break;
Riadok 221  class AuthDB
Riadok 217  class AuthDB
                 return $ret;                  return $ret;
         }          }
   
         function _dbGetPassword()          function _DBgetPassword()
         {          {
                 $query = sprintf('SELECT %s FROM %s WHERE %s = %s',                  $query = sprintf('SELECT %s FROM %s WHERE %s = %s',
                                 $this->_options['users']['cols']['password'],                                  $this->_options['users']['cols']['password'],
Riadok 235  class AuthDB
Riadok 231  class AuthDB
                 return $password;                  return $password;
         }          }
   
         function _dbInsert()          function _DBinsert()
         {          {
                 mt_srand((double) microtime() * 1000000);                  mt_srand((double) microtime() * 1000000);
   
Riadok 274  class AuthDB
Riadok 270  class AuthDB
                 return true;                  return true;
         }          }
   
         function _dbLog()          function _DBlog()
         {          {
                 $query = sprintf('INSERT INTO %s'                  $query = sprintf('INSERT INTO %s'
                                 .' (status, login, logout,'                                  .' (status, login, logout,'
Riadok 294  class AuthDB
Riadok 290  class AuthDB
                 return true;                  return true;
         }          }
   
         function _dbUpdateTimeout()          function _DBupdateTimeout()
         {          {
                 if (intval($this->_options['timeout']) <= 0) {                  if (intval($this->_options['timeout']) <= 0) {
                         return true;                          return true;
Riadok 314  class AuthDB
Riadok 310  class AuthDB
         }          }
   
         // This method needs ISDN fastfix          // This method needs ISDN fastfix
         function _dbLogout()          function _DBlogout()
         {          {
                 $query = sprintf('UPDATE %s'                  $query = sprintf('UPDATE %s'
                                 .' SET status = "logout", logout = sysdate() '                                  .' SET status = "logout", logout = sysdate() '
Riadok 336  class AuthDB
Riadok 332  class AuthDB
         }          }
   
         // This method needs ISDN fastfix          // This method needs ISDN fastfix
         function _dbUpdateLogin()          function _DBupdateLogin()
         {          {
                 $query = sprintf('UPDATE %s'                  $query = sprintf('UPDATE %s'
                                 .' SET logout = sysdate()'                                  .' SET logout = sysdate()'
Riadok 356  class AuthDB
Riadok 352  class AuthDB
         }          }
   
         // This method needs ISDN fastfix          // This method needs ISDN fastfix
         function _dbCheckLogin()          function _DBcheckLogin()
         {          {
                 if ($this->_dbUpdateLogin() == true)                  if ($this->_DBupdateLogin() == true)
                         return true;                          return true;
   
                 $query = sprintf('SELECT id FROM %s'                  $query = sprintf('SELECT id FROM %s'
Riadok 378  class AuthDB
Riadok 374  class AuthDB
         }          }
   
         // This method needs ISDN fastfix          // This method needs ISDN fastfix
         function _dbGetUsername()          function _DBgetUsername()
         {          {
                 $query = sprintf('SELECT username FROM %s'                  $query = sprintf('SELECT username FROM %s'
                                 .' WHERE status = "online"'                                  .' WHERE status = "online"'
Riadok 396  class AuthDB
Riadok 392  class AuthDB
                 return $res[0];                  return $res[0];
         }          }
   
         function _dbGetUserInfo()          function _DBgetUserInfo()
         {          {
                 $select_cols = array();                  $select_cols = array();
                 $select_tables = array();                  $select_tables = array();
Riadok 422  class AuthDB
Riadok 418  class AuthDB
                         $select_tables[] = $table;                          $select_tables[] = $table;
   
                         foreach ($cols as $col_val)                          foreach ($cols as $col_val)
                                 $select_cols[] = "$table.$col_val AS $prefix"."$col_val";                                  $select_cols[] = "$table.$col_val AS ".$prefix.$col_val;
                 }                  }
   
                 if (count($select_tables) == 0 || count($select_cols) == 0)                  if (count($select_tables) == 0 || count($select_cols) == 0)

Legend:
Odstranené z verzie1.6  
zmenené riadky
  Pridané vo verzii1.7

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok