Platform
3.1
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
chgpasswd.php
Go to the documentation of this file.
1
<?php
2
/*
3
* @author Anakeen
4
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5
* @package FDL
6
*/
7
/**
8
* Display interface to change password in case of expiration
9
*
10
* @author Anakeen 2003
11
* @version $Id: chgpasswd.php,v 1.9 2005/11/14 17:13:10 eric Exp $
12
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13
* @package FDL
14
* @subpackage
15
*/
16
/**
17
*/
18
19
global
$_POST
;
20
21
if
(
$_POST
[
"login"
] ==
""
) {
22
print _(
"no login : passwd unchanged"
);
23
exit
;
24
}
25
include_once (
"Class.Application.php"
);
26
include_once (
"Class.User.php"
);
27
include_once (
'Class.SessionCache.php'
);
28
include_once (
'Lib.Prefix.php'
);
29
30
bindtextdomain(
"what"
,
"$pubdir/locale"
);
31
textdomain(
"what"
);
32
setlocale(LC_MESSAGES, getenv(
"LANG"
));
33
34
$CoreNull
=
""
;
35
$core
=
new
Application
();
36
$core
->Set(
"CORE"
,
$CoreNull
);
37
$action
=
new
Action
();
38
$action
->Set(
""
,
$core
);
39
40
$core
->user =
new
User
();
41
$core
->user->setLoginName(
$_POST
[
"login"
]);
42
43
if
(!
$core
->user->isAffected()) {
44
print _(
"unknown login : passwd unchanged"
);
45
exit
;
46
}
47
48
if
(
$_POST
[
"passwd1"
] !=
$_POST
[
"passwd2"
]) {
49
print _(
"password are not identicals : not changed"
);
50
exit
;
51
}
52
if
(
$_POST
[
"passwd1"
] ==
""
) {
53
print _(
"empty password : not changed"
);
54
exit
;
55
}
56
$core
->user->password_new = stripslashes(
$_POST
[
"passwd1"
]);
57
$core
->user->expires = 0;
58
$core
->user->modify();
59
60
global
$_SERVER
;
61
62
Header(
"Location: http://"
. $_SERVER[
'SERVER_NAME'
] .
":"
. $_SERVER[
'SERVER_PORT'
] .
"/what/index.php?sole=R"
);
63
exit
;
64
?>
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase