/[inncomm]/index.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /index.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by dpavlin, Thu Dec 21 14:41:23 2000 UTC revision 1.8 by dpavlin, Mon Feb 12 07:13:26 2001 UTC
# Line 17  $tpl->define( Line 17  $tpl->define(
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          )          )
# Line 29  if (isset($PHP_AUTH_USER)) { Line 31  if (isset($PHP_AUTH_USER)) {
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" ));
# Line 47  if (isset($PHP_AUTH_USER)) { Line 49  if (isset($PHP_AUTH_USER)) {
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");
# Line 64  if (isset($PHP_AUTH_USER)) { Line 65  if (isset($PHP_AUTH_USER)) {
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                          }                          }
# Line 78  if (md5($PHP_AUTH_USER.$PHP_AUTH_PW) != Line 79  if (md5($PHP_AUTH_USER.$PHP_AUTH_PW) !=
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
# Line 149  if (md5($PHP_AUTH_USER.$PHP_AUTH_PW) != Line 152  if (md5($PHP_AUTH_USER.$PHP_AUTH_PW) !=
152    
153  //----- end of inserts/updates...  //----- end of inserts/updates...
154    
155  if (($what=="reply" || $what="show") && isset($t)) {  if (($what=="reply" || $what=="show") && isset($t)) {
156          $sql_where=" and topics.id=$t";          $sql_where=" and topics.id=$t";
157  }  }
158    
# Line 178  while ($row=$sth->fetchrow_hash()) { Line 181  while ($row=$sth->fetchrow_hash()) {
181                  COMMENTS => "<a href=\"$PHP_SELF?what=show&t=$row[topic_id]\">comments&gt;&gt;</a>",                  COMMENTS => "<a href=\"$PHP_SELF?what=show&t=$row[topic_id]\">comments&gt;&gt;</a>",
182                  PHP_SELF => $PHP_SELF                  PHP_SELF => $PHP_SELF
183          ));          ));
         $tpl->parse(ROWS,".theader");  
184    
185          if (isset($t) && $t==$row[topic_id]) {          if (isset($t) && $t==$row[topic_id]) {
186                    $tpl->parse(ROWS,".theader");
187                  $sth2 = $dbh->prepare("                  $sth2 = $dbh->prepare("
188                          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
189                          from poruke,osobe                          from poruke,osobe
# Line 231  while ($row=$sth->fetchrow_hash()) { Line 234  while ($row=$sth->fetchrow_hash()) {
234                                          DATE => $row2[datum],                                          DATE => $row2[datum],
235                                          SADRZAJ => $topic                                          SADRZAJ => $topic
236                                  ));                                  ));
 #                       $tpl->parse(ROWS,".theader");  
237                          $tpl->parse(ROWS,".trow");                          $tpl->parse(ROWS,".trow");
238                  }                  }
239          } else {          } else {
240                  // non-unroll topics                  // non-unroll topics (list)
241                  $tpl->assign( array(                  $tpl->assign( array(
242                                  SADRZAJ => $row[sadrzaj],                                  SADRZAJ => $row[sadrzaj],
243                                  COMMENTS => "<a href=\"$PHP_SELF?what=show&t=$row[topic_id]\">comments&gt;&gt;</a>"                                  COMMENTS => "<a href=\"$PHP_SELF?what=show&t=$row[topic_id]\">comments&gt;&gt;</a>"
244                          ));                          ));
245  #               $tpl->parse(ROWS,".theader");                  $tpl->parse(ROWS,".tlheader");
246                  $tpl->parse(ROWS,".trow");                  $tpl->parse(ROWS,".tlrow");
247          }          }
248    
249  }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.26