-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclientchangepasspublic.php
More file actions
179 lines (151 loc) · 5.49 KB
/
clientchangepasspublic.php
File metadata and controls
179 lines (151 loc) · 5.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
require_once("./stpiadmin/includes/includes.php");
require_once("./stpiadmin/includes/classes/content/clshead.php");
require_once("./stpiadmin/includes/classes/content/clsbody.php");
require_once("./stpiadmin/includes/classes/content/clsmenu.php");
require_once("./stpiadmin/includes/classes/javascript/clsjavascript.php");
require_once("./stpiadmin/includes/classes/content/clsfooter.php");
require_once("./stpiadmin/includes/classes/motd/clsmotd.php");
require_once("./stpiadmin/includes/classes/security/clslock.php");
require_once("./stpiadmin/includes/classes/client/clsclient.php");
require_once("./stpiadmin/includes/classes/security/clscryption.php");
require_once("./stpiadmin/includes/classes/user/clsuser.php");
require_once("./stpiadmin/includes/classes/email/clsemail.php");
$strPage = basename($_SERVER["SCRIPT_NAME"]);
$objMotd = new clsmotd();
$objTexte = new clstexte("./texte/client");
$objBody = new clsbody();
$objHead = new clshead($objTexte->stpi_getArrTxt("headtitre"), $objTexte->stpi_getArrTxt("keywords"), $objTexte->stpi_getArrTxt("description"));
$objJavaScript = new clsjavascript();
$objMenu = new clsmenu($strPage);
$objFooter = new clsfooter();
$objBdd = clsBdd::singleton();
$objLock = new clslock($strPage, "login.php");
$objLock->stpi_run();
$objClient = new clsclient();
$objCryption = new clscryption();
$objUser = new clsuser();
$objEmail = new clsemail();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
$objHead->stpi_affPublicHead();
?>
</head>
<body>
<div id="header">
<div id="menulang">
<?php
$objMenu->stpi_affPublicMenuLang();
?>
</div>
<div id="loginurl">
<?php
$objLock->stpi_affUrl();
?>
</div>
<div id="cart"><?php $objBody->stpi_affCartUrl(); ?></div>
<div id="welcomemsg">
<?php
print($objTexte->stpi_getArrTxt("welcome"));
?>
</div>
</div>
<div id="topmenu">
<?php
$objMenu->stpi_affPublicMenu();
?>
</div>
<div id="container">
<div id="fullcontent">
<?php
$objJavaScript->stpi_affArrLang();
$objJavaScript->stpi_affCreateXmlHttp();
$objJavaScript->stpi_affNoAjax();
$objJavaScript->stpi_affNoJavaScript();
$objClient->stpi_affJsPassChange();
$objClient->stpi_affJsChkPasswordStrengthPublic();
$objMotd->stpi_affPublic();
$objUser = $objUser->stpi_getObjUserFromSession();
if ($objUser->stpi_getNbTypeUserID() == 2)
{
if ($objClient->stpi_setNbID($objUser->stpi_getNbID()))
{
$gonogo = true;
print("<h2>" . $objTexte->stpi_getArrTxt("changepass") . "</h2>\n");
print("<form action=\"./" . $strPage . "?l=" . LG . "&op=save\" method=\"post\">\n");
print("<p>\n");
print($objTexte->stpi_getArrTxt("oldpassword") . "<br/>\n");
print("<input type=\"password\" maxlength=\"50\" size=\"20\" id=\"strOldPassword\" name=\"strOldPassword\" value=\"\" /><br/>\n");
if ($_GET["op"] == "save")
{
if (!$objClient->stpi_chkStrOldPassword($_POST["strOldPassword"]))
{
$gonogo = false;
}
}
print("</p>\n");
print("<p>\n");
print($objTexte->stpi_getArrTxt("newpassword") . "<br/>\n");
print("<input type=\"password\" onkeyup=\"stpi_chkPasswordStrength(this.value)\" maxlength=\"50\" size=\"20\" id=\"strPassword\" name=\"strPassword\" value=\"\" />\n");
print("<span id=\"stpi_chkPasswordStrength\"></span><br/>\n");
if ($_GET["op"] == "save")
{
if (!$objClient->stpi_chkStrPassword($_POST["strPassword"]))
{
$gonogo = false;
}
}
print($objTexte->stpi_getArrTxt("newpassword2") . "<br/>\n");
print("<input type=\"password\" maxlength=\"50\" size=\"20\" id=\"strPasswordConfirm\" name=\"strPasswordConfirm\" value=\"\" /><br/>\n");
if ($_GET["op"] == "save")
{
if ($_POST["strPassword"] != $_POST["strPasswordConfirm"])
{
$gonogo = false;
print("<span style=\"color:#FF0000;\">" . $objTexte->stpi_getArrErrTxt("passworddifferent") . "</span><br/>\n");
}
}
print("</p>\n");
print("<p>\n");
if ($gonogo && $_GET["op"] == "save")
{
$objClient->stpi_setStrPassword($_POST["strPassword"]);
if ($objClient->stpi_update())
{
print("<script type=\"text/javascript\">\n");
print("stpi_ClearPasswordChangeForm();\n");
print("</script>\n");
$objEmail->stpi_setStrEmail($objBdd->stpi_trsBddToHTML($objClient->stpi_getStrCourriel()));
$objEmail->stpi_setStrFromEmail(STR_EMAIL_FROM);
$objEmail->stpi_setStrSubject($objTexte->stpi_getArrTxt("changepass"));
$objEmail->stpi_setStrMessage("<p>" . $objTexte->stpi_getArrTxt("emailmessage") . "<br/>" . $objTexte->stpi_getArrTxt("emailwarning") . "<br/> IP: " . $_SERVER["REMOTE_ADDR"] . "</p>\n");
if ($objEmail->stpi_Send())
{
print("<span style=\"color:#008000;\">" . $objTexte->stpi_getArrTxt("changed") . "</span><br/>\n");
}
}
}
print("<input type=\"submit\" value=\"" . $objTexte->stpi_getArrTxt("change") . "\"/><br/>\n");
print("</p>\n");
print("</form>\n");
}
}
?>
</div>
<div class="doubleclear"></div>
</div>
<div id="bottommenu">
<?php
$objMenu->stpi_affPublicMenu();
?>
</div>
<div id="footer">
<?php
$objFooter->stpi_affPublicFooter();
?>
</div>
</body>
</html>