/[health_html]/inc/util.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 /inc/util.php

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

revision 1.4 by ravilov, Wed Sep 26 13:04:28 2001 UTC revision 1.5 by ravilov, Fri Sep 28 23:34:37 2001 UTC
# Line 13  Line 13 
13          }          }
14    
15          function MyDelete($src) {          function MyDelete($src) {
16                  # @unlink($src);                  #@unlink($src);
17          }          }
18    
19          function PicSize($pic, $dir = "") {          function PicSize($pic, $dir = "") {
# Line 40  Line 40 
40    
41          function GetLinks($read, $more, $more_title, $id, $cat, $name, $edit, $updown = false, $up = false, $down = false) {          function GetLinks($read, $more, $more_title, $id, $cat, $name, $edit, $updown = false, $up = false, $down = false) {
42                  $t = new Smarty();                  $t = new Smarty();
43                  global $section, $section_menu, $spec;                  global $section, $section_menu, $section_menu2, $spec, $isMed;
44                  $t->assign("section", $section);                  $t->assign("section", $section);
45                  $t->assign("section_menu", $section_menu);                  $t->assign("section_menu", $section_menu);
46                    $t->assign("section_menu2", $section_menu2);
47                  $t->assign("spec", $spec);                  $t->assign("spec", $spec);
48                  $t->assign("id", $id);                  $t->assign("id", $id);
49                  $t->assign("cat", $cat);                  $t->assign("cat", $cat);
50                    $t->assign("med", $isMed);
51                    $m = "more";
52                    if ($cat == "t") $m = "tmore";
53                    if ($cat == "w") $m = "wmore";
54                    if ($cat == "p") $m = "pmore";
55                    $t->assign("m", $m);
56                  $t->assign("name", $name);                  $t->assign("name", $name);
57                  $t->assign("read", $read && !strstr($more, "?"));                  $t->assign("read", $read || ($more && !strstr($more, "?")));
58                  $t->assign("more", /* $more */ strstr($more, "?") ? $more : "");                  $t->assign("more", /* $more */ strstr($more, "?") ? $more : "");
59                  $t->assign("more_new", strstr($more, "://") ? true : false);                  $t->assign("more_new", strstr($more, "://") ? true : false);
60                  $t->assign("more_title", $more_title);                  $t->assign("more_title", $more_title);
# Line 112  Line 119 
119          function Auth($user = "", $pwd = "") {          function Auth($user = "", $pwd = "") {
120                  global $ME,$HTTP_USER_AGENT,$REMOTE_ADDR;                  global $ME,$HTTP_USER_AGENT,$REMOTE_ADDR;
121                  // DEBUG:                  // DEBUG:
122                  if (stristr($ME, "test.plivamed.net")) return 0;                  #if (stristr($ME, "test.plivamed.net")) return 0;
123                  // User-Agent: should be mnoGoSearch, but in version 3.1.19                  // User-Agent: should be mnoGoSearch, but in version 3.1.19
124                  // it's UdmSearch so we match just search                  // it's UdmSearch so we match just search
125                  if (strstr($HTTP_USER_AGENT, "Search") && strstr($REMOTE_ADDR, "10.254.1.")) return 0;                  if (strstr($HTTP_USER_AGENT, "Search") && strstr($REMOTE_ADDR, "10.254.1.")) return 0;
# Line 140  Line 147 
147          $isEdit = stristr($ME, "/edit/") ? true : false;          $isEdit = stristr($ME, "/edit/") ? true : false;
148          $isMed = stristr($ME, "med") || stristr($ME, "pm") ? true : false;          $isMed = stristr($ME, "med") || stristr($ME, "pm") ? true : false;
149          if ($isEdit) {          if ($isEdit) {
150                  if ($PHP_AUTH_USER != "test" && $PHP_AUTH_PW != "test") {                  if ($PHP_AUTH_USER != "editor" && $PHP_AUTH_PW != "jokkvpr") {
151                          Header("WWW-Authenticate: Basic realm=\"PLIVA".($isMed?"med.net":"zdravlje.hr")."\"");                          Header("WWW-Authenticate: Basic realm=\"PLIVA".($isMed?"med.net":"zdravlje.hr")."\"");
152                          Header("HTTP/1.0 401 Unauthorized");                          Header("HTTP/1.0 401 Unauthorized");
153                          echo "Sorry, you are not allowed to edit the site.\n";                          echo "Sorry, you are not allowed to edit the site.\n";

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

  ViewVC Help
Powered by ViewVC 1.1.26