1 |
<? |
<? |
2 |
|
|
3 |
|
set_magic_quotes_runtime(0); |
4 |
|
|
5 |
include("inc/class.FastTemplate.pinc"); |
include("inc/class.FastTemplate.pinc"); |
6 |
include("inc/conn.inc"); |
include("inc/conn.inc"); |
7 |
include("inc/fixsql.inc"); |
include("inc/fixsql.inc"); |
17 |
startnew => "startnew.html", |
startnew => "startnew.html", |
18 |
ttable => "topics-table.html", |
ttable => "topics-table.html", |
19 |
theader => "topics-header.html", |
theader => "topics-header.html", |
20 |
|
tlheader => "topics-list-header.html", |
21 |
trow => "topics-row.html", |
trow => "topics-row.html", |
22 |
|
tlrow => "topics-list-row.html", |
23 |
reply => "reply.html", |
reply => "reply.html", |
24 |
checkboxes => "checkboxes.html" |
checkboxes => "checkboxes.html" |
25 |
) |
) |
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" )); |
41 |
if ($row[solution] == "t") { |
if ($row[solution] == "t") { |
42 |
$solution_room=1; |
$solution_room=1; |
43 |
$sql_poruke_where.="and poruke.solution is true"; |
$sql_poruke_where.="and poruke.solution is true"; |
44 |
|
$tpl->assign(array( ROOM => "You are in solution room" )); |
45 |
} |
} |
46 |
$tpl->assign(array( |
$tpl->assign(array( |
47 |
FULL_NAME => $row[full_name], |
FULL_NAME => $row[full_name], |
54 |
|
|
55 |
if($pop3->connect("intranet.pliva.hr")) { |
if($pop3->connect("intranet.pliva.hr")) { |
56 |
$Count = $pop3->login($PHP_AUTH_USER,$PHP_AUTH_PW); |
$Count = $pop3->login($PHP_AUTH_USER,$PHP_AUTH_PW); |
57 |
if ( $Count != -1 ) { |
if ( $Count && $Count != -1 ) { |
58 |
$pop3->quit(); |
$pop3->quit(); |
59 |
// o.k., user exists now insert it in db! |
// o.k., user exists now insert it in db! |
60 |
include("finger.inc"); |
include("finger.inc"); |
66 |
$md5user=md5($PHP_AUTH_USER.$PHP_AUTH_PW); |
$md5user=md5($PHP_AUTH_USER.$PHP_AUTH_PW); |
67 |
$osoba_id=$row[id]; |
$osoba_id=$row[id]; |
68 |
$tpl->assign(array( |
$tpl->assign(array( |
69 |
FULL_NAME => $row[full_name], |
FULL_NAME => $full_name, |
70 |
RELOGIN => "$PHP_SELF?relogin=$md5user" |
RELOGIN => "$PHP_SELF?relogin=$md5user" |
71 |
)); |
)); |
72 |
} |
} |
80 |
$tpl->parse(MAIN, "main"); |
$tpl->parse(MAIN, "main"); |
81 |
$tpl->FastPrint(); |
$tpl->FastPrint(); |
82 |
exit ; |
exit ; |
83 |
|
} else { |
84 |
|
$dbh->dbh_do("update osobe set last_login=now() where login='$PHP_AUTH_USER'"); |
85 |
} |
} |
86 |
|
|
87 |
//---- insert reply into database |
//---- insert reply into database |
153 |
|
|
154 |
//----- end of inserts/updates... |
//----- end of inserts/updates... |
155 |
|
|
156 |
if (($what=="reply" || $what="show") && isset($t)) { |
if (($what=="reply" || $what=="show") && isset($t)) { |
157 |
$sql_where=" and topics.id=$t"; |
$sql_where=" and topics.id=$t"; |
158 |
} |
} |
159 |
|
|
182 |
COMMENTS => "<a href=\"$PHP_SELF?what=show&t=$row[topic_id]\">comments>></a>", |
COMMENTS => "<a href=\"$PHP_SELF?what=show&t=$row[topic_id]\">comments>></a>", |
183 |
PHP_SELF => $PHP_SELF |
PHP_SELF => $PHP_SELF |
184 |
)); |
)); |
|
$tpl->parse(ROWS,".theader"); |
|
185 |
|
|
186 |
if (isset($t) && $t==$row[topic_id]) { |
if (isset($t) && $t==$row[topic_id]) { |
187 |
|
$tpl->parse(ROWS,".theader"); |
188 |
$sth2 = $dbh->prepare(" |
$sth2 = $dbh->prepare(" |
189 |
select poruke.id as id,sadrzaj as topic,level,thread_id,reply_id,full_name,poruke.datum as datum,poruke.analitical as poruka_analitical |
select poruke.id as id,sadrzaj as topic,level,thread_id,reply_id,full_name,poruke.datum as datum,poruke.analitical as poruka_analitical |
190 |
from poruke,osobe |
from poruke,osobe |
235 |
DATE => $row2[datum], |
DATE => $row2[datum], |
236 |
SADRZAJ => $topic |
SADRZAJ => $topic |
237 |
)); |
)); |
|
# $tpl->parse(ROWS,".theader"); |
|
238 |
$tpl->parse(ROWS,".trow"); |
$tpl->parse(ROWS,".trow"); |
239 |
} |
} |
240 |
} else { |
} else { |
241 |
// non-unroll topics |
// non-unroll topics (list) |
242 |
$tpl->assign( array( |
$tpl->assign( array( |
243 |
SADRZAJ => $row[sadrzaj], |
SADRZAJ => $row[sadrzaj], |
244 |
COMMENTS => "<a href=\"$PHP_SELF?what=show&t=$row[topic_id]\">comments>></a>" |
COMMENTS => "<a href=\"$PHP_SELF?what=show&t=$row[topic_id]\">comments>></a>" |
245 |
)); |
)); |
246 |
# $tpl->parse(ROWS,".theader"); |
$tpl->parse(ROWS,".tlheader"); |
247 |
$tpl->parse(ROWS,".trow"); |
$tpl->parse(ROWS,".tlrow"); |
248 |
} |
} |
249 |
|
|
250 |
} |
} |