Project

General

Profile

« Previous | Next » 

Revision 275

Added by stefan almost 19 years ago

Replace 'admin' by 'wb' in all account pages. Moved print_success and print_error code to class.wb.php. Added correct parameters to these functions in account pages.

View differences:

password.php
1 1
<?php
2 2

  
3
// $Id: password.php,v 1.2 2005/03/28 11:58:03 rdjurovich Exp $
3
// $Id$
4 4

  
5 5
/*
6 6

  
......
37 37

  
38 38
// Get existing password
39 39
$database = new database();
40
$query = "SELECT user_id FROM ".TABLE_PREFIX."users WHERE user_id = '".$admin->get_user_id()."' AND password = '".md5($current_password)."'";
40
$query = "SELECT user_id FROM ".TABLE_PREFIX."users WHERE user_id = '".$wb->get_user_id()."' AND password = '".md5($current_password)."'";
41 41
$results = $database->query($query);
42 42

  
43 43
// Validate values
44 44
if($results->numRows() == 0) {
45
	$admin->print_error($MESSAGE['PREFERENCES']['CURRENT_PASSWORD_INCORRECT'], $js_back);
45
	$wb->print_error($MESSAGE['PREFERENCES']['CURRENT_PASSWORD_INCORRECT'], $js_back, false);
46 46
}
47 47
if(strlen($new_password) < 3) {
48
	$admin->print_error($MESSAGE['USERS']['PASSWORD_TOO_SHORT'], $js_back);
48
	$wb->print_error($MESSAGE['USERS']['PASSWORD_TOO_SHORT'], $js_back, false);
49 49
}
50 50
if($new_password != $new_password2) {
51
	$admin->print_error($MESSAGE['USERS']['PASSWORD_MISMATCH'], $js_back);
51
	$wb->print_error($MESSAGE['USERS']['PASSWORD_MISMATCH'], $js_back, false);
52 52
}
53 53

  
54 54
// MD5 the password
......
56 56

  
57 57
// Update the database
58 58
$database = new database();
59
$query = "UPDATE ".TABLE_PREFIX."users SET password = '$md5_password' WHERE user_id = '".$admin->get_user_id()."'";
59
$query = "UPDATE ".TABLE_PREFIX."users SET password = '$md5_password' WHERE user_id = '".$wb->get_user_id()."'";
60 60
$database->query($query);
61 61
if($database->is_error()) {
62
	$admin->print_error($database->get_error);
62
	$wb->print_error($database->get_error, 'index.php', false);
63 63
} else {
64
	$admin->print_success($MESSAGE['PREFERENCES']['PASSWORD_CHANGED'], WB_URL.'/account/preferences'.PAGE_EXTENSION);
64
	$wb->print_success($MESSAGE['PREFERENCES']['PASSWORD_CHANGED'], WB_URL.'/account/preferences'.PAGE_EXTENSION);
65 65
}
66 66

  
67 67

  

Also available in: Unified diff