Core  3.2
PHP API documentation
 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 = "";
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");
62 ?>
global $_POST
Definition: chgpasswd.php:17
$action
Definition: chgpasswd.php:35
print
Definition: checklist.php:49
exit
Definition: chgpasswd.php:61
global $_SERVER
Definition: chgpasswd.php:58
$CoreNull
Definition: chgpasswd.php:32
$core
Definition: chgpasswd.php:33
← centre documentaire © anakeen