31 |
if ($row=$sth->fetchrow_hash()) { |
if ($row=$sth->fetchrow_hash()) { |
32 |
if ($row && $row[passwd] == $PHP_AUTH_PW) { |
if ($row && $row[passwd] == $PHP_AUTH_PW) { |
33 |
$md5user=md5($PHP_AUTH_USER.$PHP_AUTH_PW); |
$md5user=md5($PHP_AUTH_USER.$PHP_AUTH_PW); |
34 |
$osoba_id=$row[id]; |
$osoba_id=$row[id]; |
35 |
if ($row[analitical] == "t") { |
if ($row[analitical] == "t") { |
36 |
$analitical_room=1; |
$analitical_room=1; |
37 |
$tpl->assign(array( ROOM => "You are member of analitical room" )); |
$tpl->assign(array( ROOM => "You are member of analitical room" )); |
49 |
)); |
)); |
50 |
} |
} |
51 |
} else { // try to verify user via pop3 |
} else { // try to verify user via pop3 |
52 |
include("class.POP3.php3"); |
include("auth_pop3.php"); |
53 |
$pop3 = new POP3(); |
$pop3 = new POP3(); |
54 |
|
|
55 |
if($pop3->connect("intranet.pliva.hr")) { |
if($pop3->connect("intranet.pliva.hr")) { |
56 |
$Count = $pop3->login($PHP_AUTH_USER,$PHP_AUTH_PW); |
if ($pop3->checklogin($PHP_AUTH_USER,$PHP_AUTH_PW)) { |
|
if ( $Count != -1 ) { |
|
57 |
$pop3->quit(); |
$pop3->quit(); |
58 |
// o.k., user exists now insert it in db! |
// o.k., user exists now insert it in db! |
59 |
include("finger.inc"); |
include("finger.inc"); |
65 |
$md5user=md5($PHP_AUTH_USER.$PHP_AUTH_PW); |
$md5user=md5($PHP_AUTH_USER.$PHP_AUTH_PW); |
66 |
$osoba_id=$row[id]; |
$osoba_id=$row[id]; |
67 |
$tpl->assign(array( |
$tpl->assign(array( |
68 |
FULL_NAME => $row[full_name], |
FULL_NAME => $full_name, |
69 |
RELOGIN => "$PHP_SELF?relogin=$md5user" |
RELOGIN => "$PHP_SELF?relogin=$md5user" |
70 |
)); |
)); |
71 |
} |
} |
79 |
$tpl->parse(MAIN, "main"); |
$tpl->parse(MAIN, "main"); |
80 |
$tpl->FastPrint(); |
$tpl->FastPrint(); |
81 |
exit ; |
exit ; |
82 |
|
} else { |
83 |
|
$dbh->dbh_do("update osobe set last_login=now() where login='$PHP_AUTH_USER'"); |
84 |
} |
} |
85 |
|
|
86 |
//---- insert reply into database |
//---- insert reply into database |