--- index.php 2000/12/21 14:41:23 1.4 +++ index.php 2001/02/12 07:13:26 1.8 @@ -17,7 +17,9 @@ startnew => "startnew.html", ttable => "topics-table.html", theader => "topics-header.html", + tlheader => "topics-list-header.html", trow => "topics-row.html", + tlrow => "topics-list-row.html", reply => "reply.html", checkboxes => "checkboxes.html" ) @@ -29,7 +31,7 @@ if ($row=$sth->fetchrow_hash()) { if ($row && $row[passwd] == $PHP_AUTH_PW) { $md5user=md5($PHP_AUTH_USER.$PHP_AUTH_PW); - $osoba_id=$row[id]; + $osoba_id=$row[id]; if ($row[analitical] == "t") { $analitical_room=1; $tpl->assign(array( ROOM => "You are member of analitical room" )); @@ -47,12 +49,11 @@ )); } } else { // try to verify user via pop3 - include("class.POP3.php3"); + include("auth_pop3.php"); $pop3 = new POP3(); if($pop3->connect("intranet.pliva.hr")) { - $Count = $pop3->login($PHP_AUTH_USER,$PHP_AUTH_PW); - if ( $Count != -1 ) { + if ($pop3->checklogin($PHP_AUTH_USER,$PHP_AUTH_PW)) { $pop3->quit(); // o.k., user exists now insert it in db! include("finger.inc"); @@ -64,7 +65,7 @@ $md5user=md5($PHP_AUTH_USER.$PHP_AUTH_PW); $osoba_id=$row[id]; $tpl->assign(array( - FULL_NAME => $row[full_name], + FULL_NAME => $full_name, RELOGIN => "$PHP_SELF?relogin=$md5user" )); } @@ -78,6 +79,8 @@ $tpl->parse(MAIN, "main"); $tpl->FastPrint(); exit ; +} else { + $dbh->dbh_do("update osobe set last_login=now() where login='$PHP_AUTH_USER'"); } //---- insert reply into database @@ -149,7 +152,7 @@ //----- end of inserts/updates... -if (($what=="reply" || $what="show") && isset($t)) { +if (($what=="reply" || $what=="show") && isset($t)) { $sql_where=" and topics.id=$t"; } @@ -178,9 +181,9 @@ COMMENTS => "comments>>", PHP_SELF => $PHP_SELF )); - $tpl->parse(ROWS,".theader"); if (isset($t) && $t==$row[topic_id]) { + $tpl->parse(ROWS,".theader"); $sth2 = $dbh->prepare(" select poruke.id as id,sadrzaj as topic,level,thread_id,reply_id,full_name,poruke.datum as datum,poruke.analitical as poruka_analitical from poruke,osobe @@ -231,17 +234,16 @@ DATE => $row2[datum], SADRZAJ => $topic )); -# $tpl->parse(ROWS,".theader"); $tpl->parse(ROWS,".trow"); } } else { - // non-unroll topics + // non-unroll topics (list) $tpl->assign( array( SADRZAJ => $row[sadrzaj], COMMENTS => "comments>>" )); -# $tpl->parse(ROWS,".theader"); - $tpl->parse(ROWS,".trow"); + $tpl->parse(ROWS,".tlheader"); + $tpl->parse(ROWS,".tlrow"); } }