Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

user/passwordchange.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: passwordchange.php 6484 2001-08-17 13:36:01Z jhe $
5 //
6 // Created on: <20-Sep-2000 13:32:11 ce>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezhttptool.php" );
30
31 $ini =& eZINI::instance( 'site.ini' );
32 $Language = $ini->variable( "eZUserMain", "Language" );
33 $DOC_ROOT = $ini->variable( "eZUserMain", "DocumentRoot" );
34 $errorIni = new eZINI( "kernel/ezuser/admin/intl/" . $Language . "/passwordchange.php.ini", false );
35
36 // include_once( "ezuser/classes/ezuser.php" );
37 // include_once( "ezuser/classes/ezusergroup.php" );
38 // include_once( "ezuser/classes/ezmodule.php" );
39 // include_once( "ezuser/classes/ezpermission.php" );
40 // include_once( "ezsession/classes/ezsession.php" );
41
42 require( "kernel/ezuser/admin/admincheck.php" );
43
44 if ( isset( $Cancel ) )
45 {
46 eZHTTPTool::header( "Location: /" );
47 }
48
49 // Template
50 $t = new eZTemplate( $DOC_ROOT . "/admin/" . $ini->variable( "eZUserMain", "AdminTemplateDir" ),
51 $DOC_ROOT . "/admin/" . "/intl", $Language, "passwordchange.php" );
52 $t->setAllStrings();
53
54 $t->set_file( array(
55 "change" => "passwordchange.tpl"
56 ) );
57
58 $user =& eZUser::currentUser();
59 if ( !$user )
60 {
61 eZHTTPTool::header( "Location: /user/login/" );
62 exit();
63 }
64
65 if ( isset( $Action ) && $Action == "update" )
66 {
67 $checkuser = $user->validateUser( $user->login(), $OldPassword );
68
69 if ( !$checkuser )
70 {
71 $error_msg = $errorIni->variable( "strings", "error_wrong" );
72 }
73 else if ( $NewPassword != $VerifyPassword )
74 {
75 $error_msg = $errorIni->variable( "strings", "error_nomach" );
76 }
77 else if ( isset( $OldPassword ) && isset( $NewPassword ) && $OldPassword != $NewPassword )
78 {
79 $user->setPassword( $NewPassword );
80 $user->store();
81 $error_msg = $errorIni->variable( "strings", "password_update" );
82
83 }
84 }
85
86 $t->set_var( "error_msg", isset( $error_msg ) ? $error_msg : false );
87
88 $t->set_var( "first_name", $user->firstName() );
89 $t->set_var( "last_name", $user->lastName() );
90
91 $t->set_var( "action_value", "update" );
92 $t->pparse( "output", "change" );
93
94 ?>
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZINI
Reads and writes .ini style configuration files.
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$Action
$Action
Definition: companysearch.php:80
$error_msg
$error_msg
Definition: ezlink/admin/categoryedit.php:33
exit
exit
Definition: folder.php:81
$DOC_ROOT
$DOC_ROOT
Definition: user/passwordchange.php:33
$errorIni
$errorIni
Definition: user/passwordchange.php:34
$user
$user
Definition: user/passwordchange.php:58
$Language
$Language
Definition: user/passwordchange.php:32
$ini
$ini
Definition: user/passwordchange.php:31
$t
if(isset( $Cancel)) $t
Definition: user/passwordchange.php:50
$VerifyPassword
if(( $ForceSSL=="enabled")) elseif( $ForceSSL=="disabled") $VerifyPassword
Definition: userwithaddress.php:76
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.