2 ################################################################################
4 # File: $RCSfile: updateprofile.cgi,v $
5 # Revision: $Revision: 1.1 $
6 # Description: Update the users profile
7 # Author: Andrew@DeFaria.com
8 # Created: Mon Jan 16 20:25:32 PST 2006
9 # Modified: $Date: 2013/06/12 14:05:47 $
12 # (c) Copyright 2000-2006, Andrew@DeFaria.com, all rights reserved.
14 ################################################################################
19 $0 = $FindBin::Script;
21 use lib "$FindBin::Bin/../lib";
26 use CGI qw (:standard);
30 my $fullname = param('fullname');
31 my $email = param('email');
32 my $old_password = param('old_password');
33 my $new_password = param('new_password');
34 my $repeated_password = param('repeated_password');
35 my $mapspop = param('MAPSPOP');
36 my $history = param('history');
37 my $days = param('days');
38 my $dates = param('dates');
39 my $tag_and_forward = param('tag_and_forward');
47 'Tag&Forward' => $tag_and_forward,
50 if ($old_password && $old_password ne '') {
51 my $dbpassword = UserExists($userid);
52 my $encrypted_old_password = Encrypt($old_password, $userid);
54 if ($dbpassword ne $encrypted_old_password) {
55 DisplayError 'Your old password was not correct!';
59 if (UpdateUser($userid, $fullname, $email, $new_password) != 0) {
60 DisplayError "Unable to update user record for user $userid";
63 if (UpdateUserOptions($userid, %options) != 0) {
64 DisplayError "Unable to update user options for user $userid";
67 print h2 {-class => 'header',
69 "${Userid}'s profile has been updated";
76 "Update user's profile",
78 $Userid = ucfirst $userid;
81 NavigationBar($userid);