/[informatika.old]/html/ko_lozinka.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

Contents of /html/ko_lozinka.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Thu Oct 26 14:31:45 2000 UTC (22 years, 3 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +16 -2 lines
prvi korisnik je fake

1 <?
2
3 session_unregister($kontakt_osoba_id);
4 include("inc/head.inc");
5
6 echo '<h1>Rad sa lozinkama za pristup kontakt osoba</h1>';
7
8 if ($what=="send" || $what=="change") {
9
10 echo '<table border=0><form method="post" action="'.$PHP_SELF.'" name="forma">';
11
12 if (! isset($kontakt_osoba_id) || $kontakt_osoba_id==0) {
13 echo '<tr><td>Odaberite Va¹e ime i prezime:</td><td><select name="kontakt_osoba_id">';
14 echo '<option value=0>-</option>';
15 $result = pg_Exec ($conn, "select id,ime,prezime from kontakt_osobe where aktivna=true order by ime");
16 for ($k = 0; $k < pg_numrows($result); $k++) {
17 $row=pg_fetch_array($result,$k);
18 echo "<option value=\"$row[id]\"";
19 if ($row[id]==$kontakt_osoba_id) { echo " selected"; }
20 echo ">$row[ime] $row[prezime]</option>\n";
21 }
22 echo "</select></td></tr>";
23 }
24
25 if ($what=="send" || !isset($what)) {
26 echo '<tr><td></td><td><input type="submit" name="Submit" value="Po¹alji mi lozinku e-mail-om"></td></tr>';
27 $what="send";
28 } elseif ($what=="change") {
29 echo '<tr><td>Trenutna lozinka:</td><td><input type="password" name="curr_passwd" size=8></td></tr>';
30 echo '<tr><td>Nova lozinka:</td><td><input type="password" name="new_passwd" size=8></td></tr>';
31 echo '<tr><td>Nova lozinka:</td><td><input type="password" name="new_passwd2" size=8><small>Ponovo za provjeru</small></td></tr>';
32 echo '<tr><td></td><td><input type="submit" name="Submit" value="Promjeni lozinku"></td></tr>';
33 }
34
35 } elseif (isset($kontakt_osoba_id) && $what=="send-now") {
36
37 $result = pg_Exec ($conn, "select ime,prezime,e_mail,passwd from kontakt_osobe
38 where aktivna=true and id=$kontakt_osoba_id");
39 if (pg_numrows($result) > 0) {
40
41 $row=pg_fetch_array($result,0);
42
43 mail($row[e_mail],"Loznika za pristup support.pliva.hr","
44 Va¹a lozinka za pristup stranicama
45
46 http://support.pliva.hr/
47
48 je trenutno
49
50 $row[passwd]
51
52 Morate odabrati svoje ime i prezime iz padajuæeg izbornika
53 ($row[ime] $row[prezime])
54 i upisati gornji password.
55
56 PlivaNet Core Support Team
57 ","From: PlivaNet Core Support Team <pcst@pliva.hr>");
58
59 echo 'Va¹a loznika je poslana na Va¹u e-mail adresu '.$row[e_mail].'
60 <p>Mo¾ete zatvoriti ovaj prozor i provjeriti va¹ e-mail u kojem
61 se nalazi loznika za pristup.';
62
63 } else {
64
65 session_unregister($kontakt_osoba_id);
66 echo "Morate odabrati svoje ime iz popisa osoba!
67 <a href=\"$PHP_SELF?what=$oldwhat&kontakt_osoba_id=0\">Dalje...</a>";
68
69 }
70
71 } elseif (isset($kontakt_osoba_id) && $what=="change-now") {
72
73 $result = pg_Exec ($conn, "select ime,prezime,e_mail,passwd from kontakt_osobe
74 where aktivna=true and id=$kontakt_osoba_id");
75 $row=pg_fetch_array($result,0);
76
77 if ($curr_passwd != $row[passwd]) {
78 echo "<b>Neispravna trenutna lozinka!</b>";
79 } else {
80 if ($new_passwd != $new_passwd2) {
81 echo "<b>Nova lozinka nije ista dva puta!</b>";
82 } else {
83 $result = pg_Exec ($conn, "update kontakt_osobe set passwd='$new_passwd' where aktivna=true and id=$kontakt_osoba_id");
84 echo 'Va¹a loznika je promjenjena.
85 <p>Mo¾ete zatvoriti ovaj prozor i nastaviti
86 raditi sa novom lozinkom.';
87 }
88 }
89
90 }
91
92 if ($what=="send" || $what=="change") {
93 echo '</table>
94 <input type="hidden" name="oldwhat" value="'.$what.'">
95 <input type="hidden" name="what" value="'.$what.'-now">
96 </form>';
97 }
98
99 include("inc/footer.inc");
100
101 ?>

  ViewVC Help
Powered by ViewVC 1.1.26