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