1 |
<? |
<? |
2 |
|
|
3 |
include("inc/head.inc"); |
include("inc/head.inc"); |
4 |
|
include("inc/prava.inc"); |
5 |
|
|
6 |
if (! isset($id)) { |
if (isset($kontakt_osoba_id) && $what!="relogin") { |
7 |
|
$result = pg_Exec ($conn, "select ime,prezime,passwd,prava from kontakt_osobe where aktivna=true and id=$kontakt_osoba_id"); |
8 |
|
$row=pg_fetch_array($result,0); |
9 |
|
# print "--$row[passwd] | $md5_passwd | $passwd "; |
10 |
|
$prava=$row[prava]; |
11 |
|
print "<small>Trenutno ste prijavljeni kao $row[ime] $row[prezime], ako je to krivo odaberite <a href=\"$PHP_SELF?what=relogin\">ovaj link</a>.</small>"; |
12 |
|
$curr_md5_passwd=base64_encode(mhash(MHASH_MD5,$row[passwd])); |
13 |
|
if ( (!isset($md5_passwd) && $row[passwd] != $passwd) || |
14 |
|
(isset($md5_passwd) && $curr_md5_passwd != $md5_passwd) ) { |
15 |
|
include("inc/auth.inc"); |
16 |
|
$what="auth"; |
17 |
|
echo "<big>Upisana je neispravna loznika!</big>"; |
18 |
|
session_destroy(); |
19 |
|
print '<p><a href="index.php">Povratak na početnu stranicu</a>'; |
20 |
|
} else { |
21 |
|
session_register("md5_passwd"); |
22 |
|
$md5_passwd=base64_encode(mhash(MHASH_MD5,$row[passwd])); |
23 |
|
} |
24 |
|
} |
25 |
|
|
26 |
|
print "--$pr_ko--"; |
27 |
|
|
28 |
|
if (! isset($kontakt_osoba_id)) { |
29 |
|
include("inc/auth.inc"); |
30 |
|
$what="auth"; |
31 |
|
|
32 |
|
} elseif (! isset($id)) { |
33 |
include("inc/obavjest-forma.inc"); |
include("inc/obavjest-forma.inc"); |
34 |
} else { |
} elseif (isset($id)) { |
35 |
|
|
36 |
|
|
37 |
$result = pg_Exec ($conn, " |
$result = pg_Exec ($conn, " |
73 |
print "<p><big>Nema podataka o osobi sa id-jem $id</big>"; |
print "<p><big>Nema podataka o osobi sa id-jem $id</big>"; |
74 |
} |
} |
75 |
|
|
76 |
|
// kreiraj statuse, zapamti da li je instaliran |
77 |
|
|
78 |
|
$instaliran=0; |
79 |
|
|
80 |
|
$result = pg_Exec ($conn, "select datum,opis,ime,prezime,status_tip_id as st |
81 |
|
from status,kontakt_osobe,status_tip |
82 |
|
where kontakt_osoba_id=kontakt_osobe.id and status_tip_id=status_tip.id |
83 |
|
and osoba_id=$id"); |
84 |
|
|
85 |
|
$statusi=""; |
86 |
|
|
87 |
|
$nr = pg_numrows($result); |
88 |
|
if ($nr > 0) { |
89 |
|
for ($i=0;$i<$nr; $i++) { |
90 |
|
$row=pg_fetch_array($result,$i); |
91 |
|
$statusi.="<tr><td><small>$row[datum]</small></td><td>$row[opis]</td><td>$row[ime] $row[prezime]</td></tr>"; |
92 |
|
if ($row[st] == 6) { $instaliran = 1; }; |
93 |
|
} |
94 |
|
} else { |
95 |
|
$statusi.="<p><big>Nema podataka o korisničkom računu</big>"; |
96 |
|
} |
97 |
|
|
98 |
|
|
99 |
$result = pg_Exec ($conn, "select racuni.login as login, |
$result = pg_Exec ($conn, "select racuni.login as login, |
100 |
racuni.passwd as passwd,e_mail.alias as email |
racuni.passwd as passwd,e_mail.alias as email |
101 |
where racuni.osoba_id=$id and e_mail.osoba_id=$id"); |
where racuni.osoba_id=$id and e_mail.osoba_id=$id"); |
108 |
|
|
109 |
<table> |
<table> |
110 |
<tr><td>Korisnička oznaka:</td><td><tt>$row[login]</tt></td></tr> |
<tr><td>Korisnička oznaka:</td><td><tt>$row[login]</tt></td></tr> |
111 |
<tr><td>Lozinka:</td><td><tt>$row[passwd]</tt></td></tr> |
"; |
112 |
|
if ($prava and $pr_instalacija) { |
113 |
|
print "<tr><td>Lozinka:</td><td><tt>$row[passwd]</tt></td></tr>"; |
114 |
|
} else { |
115 |
|
print "<tr><td colspan=2><i>Nemate ovlaštenja vidjeti lozinku ovog korisnika!</i></td></tr>"; |
116 |
|
} |
117 |
|
print " |
118 |
<tr><td>E-mail adresa:</td><td><tt>$row[email]@pliva.hr</tt></td></tr> |
<tr><td>E-mail adresa:</td><td><tt>$row[email]@pliva.hr</tt></td></tr> |
119 |
</table> |
</table> |
120 |
"; |
"; |
123 |
print "<p><big>Nema podataka o korisničkom računu</big>"; |
print "<p><big>Nema podataka o korisničkom računu</big>"; |
124 |
} |
} |
125 |
|
|
|
$result = pg_Exec ($conn, "select datum,opis,ime,prezime |
|
|
from status,kontakt_osobe,status_tip |
|
|
where kontakt_osoba_id=kontakt_osobe.id and status_tip_id=status_tip.id |
|
|
and osoba_id=$id"); |
|
126 |
|
|
127 |
print " |
print " |
128 |
<h1>Podaci o statusima koriničkog računa</h1> |
<h1>Podaci o statusima koriničkog računa</h1> |
129 |
|
|
130 |
<table> |
<table> |
131 |
<tr><th>datum</th><th>status</th><th>status postavio/la</th></tr>"; |
<tr><th>datum</th><th>status</th><th>status postavio/la</th></tr> |
132 |
|
$statusi |
133 |
$nr = pg_numrows($result); |
</table>"; |
|
if ($nr > 0) { |
|
|
for ($i=0;$i<$nr; $i++) { |
|
|
$row=pg_fetch_array($result,$i); |
|
|
print "<tr><td><small>$row[datum]</small></td><td>$row[opis]</td><td>$row[ime] $row[prezime]</td></tr>"; |
|
|
} |
|
|
} else { |
|
|
print "<p><big>Nema podataka o korisničkom računu</big>"; |
|
|
} |
|
|
|
|
|
print "</table>"; |
|
134 |
|
|
135 |
} // isset($id) |
} // isset($id) |
136 |
|
|