forked from papullo/progetto_PW
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclassi.php~
More file actions
38 lines (37 loc) · 924 Bytes
/
classi.php~
File metadata and controls
38 lines (37 loc) · 924 Bytes
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
<?
class Utente
{
var $ok=false;
var $tipo='';
var $permessi='';
function __construct($_utente='', $_password='')
{
if ($_utente == 'root' && $_password == 'root')
{
$this->tipo = 'Amministratore';
$this->permessi = '11111111111111111111';
$this->ok = true;
}
else
{
if ($_utente != '')
$this->Init($_utente, $_password);
}
return $this->ok;
}
function Init($_utente, $_password)
{
//global $Connessione;
print("<script language='javascript'>alert(".str_quoted($_utente).");</script>");
$this->ok = false;
$rs = mysql_query("SELECT * FROM utenti WHERE nickname=".str_quoted($_utente)." AND password=".str_quoted($_password)) or die ("Errore : ".mysql_error());
if ($row = mysql_fetch_assoc($rs))
{
$this->nome = $row['nickname'];
$this->permessi = $row['permessi'];
$this->ok = true;
}
return $this->ok;
}
}
?>