summaryrefslogtreecommitdiff
path: root/change_password.php
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2005-06-28 07:46:24 +0000
committerChristian Fowler <spider@viovio.com>2005-06-28 07:46:24 +0000
commit656623ad5f8315a1994232734e5e309661f7a7c5 (patch)
treea34d5e9ce39406d597f8631f20afbcb26bfd6fbf /change_password.php
parent75f4060746db5b6c35e400a0b6c5c02450629106 (diff)
downloadusers-656623ad5f8315a1994232734e5e309661f7a7c5.tar.gz
users-656623ad5f8315a1994232734e5e309661f7a7c5.tar.bz2
users-656623ad5f8315a1994232734e5e309661f7a7c5.zip
Merge recent changes from R1 into HEAD
Diffstat (limited to 'change_password.php')
-rw-r--r--change_password.php44
1 files changed, 23 insertions, 21 deletions
diff --git a/change_password.php b/change_password.php
index 0108560..9e9179c 100644
--- a/change_password.php
+++ b/change_password.php
@@ -1,9 +1,21 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_users/change_password.php,v 1.1 2005/06/19 05:12:22 bitweaver Exp $
-// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
-// All Rights Reserved. See copyright.txt for details and a complete list of authors.
-// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
-// Initialization
+/**
+ * $Header: /cvsroot/bitweaver/_bit_users/change_password.php,v 1.2 2005/06/28 07:46:22 spiderr Exp $
+ *
+ * Copyright (c) 2004 bitweaver.org
+ * Copyright (c) 2003 tikwiki.org
+ * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
+ * All Rights Reserved. See copyright.txt for details and a complete list of authors.
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
+ *
+ * $Id: change_password.php,v 1.2 2005/06/28 07:46:22 spiderr Exp $
+ * @package users
+ * @subpackage functions
+ */
+
+/**
+ * required setup
+ */
require_once( '../bit_setup_inc.php' );
if (!isset($_REQUEST['login']))
$_REQUEST['login'] = '';
@@ -12,29 +24,19 @@ if (!isset($_REQUEST["oldpass"]))
$smarty->assign('login', $_REQUEST['login']);
$smarty->assign('oldpass', $_REQUEST["oldpass"]);
if (isset($_REQUEST["change"])) {
-
+
if ($_REQUEST["pass"] != $_REQUEST["pass2"]) {
- $smarty->assign('msg', tra("The passwords didn't match"));
- $gBitSystem->display( 'error.tpl' );
- die;
+ $gBitSystem->fatalError( tra("The passwords didn't match") );
}
if ($_REQUEST["pass"] == $_REQUEST["oldpass"]) {
- $smarty->assign('msg', tra("You can not use the same password again"));
- $gBitSystem->display( 'error.tpl' );
- die;
+ $gBitSystem->fatalError( tra("You can not use the same password again") );
}
- if (!$gBitUser->validate_user($_REQUEST['login'], $_REQUEST["oldpass"], '', '')) {
- if(!$gBitUser->validate_user("admin",substr($_REQUEST["oldpass"],6,200),'','') or (!$gBitUser->isAdmin())) {
- $smarty->assign('msg', tra("Invalid old password"));
- $gBitSystem->display( 'error.tpl' );
- die;
- }
+ if( !$gBitUser->isAdmin() && !$gBitUser->validate($_REQUEST['login'], $_REQUEST["oldpass"], '', '') ) {
+ $gBitSystem->fatalError( tra("Invalid old password") );
}
//Validate password here
if (strlen($_REQUEST["pass"]) < $min_pass_length) {
- $smarty->assign('msg', tra("Password should be at least"). ' ' . $min_pass_length . ' ' . tra("characters long"));
- $gBitSystem->display( 'error.tpl' );
- die;
+ $gBitSystem->fatalError( tra("Password should be at least"). ' ' . $min_pass_length . ' ' . tra("characters long") );
}
// Check this code
if ($pass_chr_num == 'y') {