1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
<?php
/******************
x0Konzept : Dev'One
******************/
if (!defined('IN'))
{
exit;
}
class mysql_db
{
private $tab_pr = array();
// oo_add
private function oo_add($nom, $valeur)
{
$this->tab_pr[$nom] = $valeur;
}
// oo_sort
function oo_sort($nom)
{
return $this->tab_pr[$nom];
}
// connect
function connect($host, $user, $password, $db)
{
$this->dbserver = $host;
$this->dbuser = $user;
$this->dbpassword = $password;
$this->dbbase = $db;
$this->connexion = @mysql_connect($this->dbserver, $this->dbuser, $this->dbpassword);
if($this->connexion && $this->dbbase != '')
{
$dbselect = @mysql_select_db("xkonzept", $this->connexion);
if($dbselect)
{
return $this->connexion;
}
}
}
// query_login
function sql_query_login($query)
{
$this->do_query = @mysql_query($query, $this->connexion);
$result = mysql_num_rows($this->do_query);
if($result == 1)
{
$this->al = TRUE;
return $this->do_query;
}
else
{
return FALSE;
}
}
// query
function sql_query($query)
{
$this->do_query = @mysql_query($query, $this->connexion);
if($this->do_query)
{
return $this->do_query;
}
}
// login_check
function login_check($l_username, $l_password)
{
if(isset($l_username) && isset($l_password))
{
if(!empty($l_username) && !empty($l_password))
{
$this->oo_add('username', $l_username);
$query = "SELECT ID, username, password FROM devone_users WHERE username='".$l_username."' AND password=md5('".$l_password."')";
if($this->sql_query_login($query) == TRUE)
{
return TRUE;
}
if( $this->sql_query_login($query) == FALSE)
{
return FALSE;
}
}
}
}
// _sort
function _sort($nom)
{
if(!empty($nom))
{
if($_SESSION['AUTHX'] == TRUE)
{
$_return = $this->oo_sort('username');
return $_return;
}
else
{
return 'Erreur, @1';
}
}
else
{
return 'Erreur, @2';
}
}
// fetchrow
function sql_fetchrow($query_id = 0)
{
if(!$query_id)
{
$query_id = $this->query_result;
}
if($query_id)
{
$this->row[$query_id] = @mysql_fetch_array($query_id);
return $this->row[$query_id];
}
else
{
return false;
}
}
}
?> |
Partager