Removed /usr/local from CDPATH
[clearscm.git] / maps / bin / editprofile.cgi
index 092e35c..652154b 100755 (executable)
@@ -16,9 +16,10 @@ use strict;
 use warnings;
 
 use FindBin;
-$0 = $FindBin::Script;
+local $0 = $FindBin::Script;
 
 use lib "$FindBin::Bin/../lib";
+use lib "$FindBin::Bin/../../lib";
 
 use MAPS;
 use MAPSWeb;
@@ -29,12 +30,9 @@ my $userid;
 my $table_name = 'profile';
 
 sub Body() {
-  my $handle = FindUser($userid);
+  FindUser(userid => $userid);
 
-  my ($fullname, $email, $password);
-  ($_, $fullname, $email, $password) = GetUser($handle);
-
-  $handle->finish;
+  my $rec = GetUser;
 
   my %options = GetUserOptions($userid);
 
@@ -45,6 +43,7 @@ sub Body() {
   };
   print start_table {
     -align       => 'center',
+    -bgcolor     => 'white',
     -id          => $table_name,
     -border      => 1,
     -cellspacing => 0,
@@ -62,7 +61,7 @@ sub Body() {
       textfield {-class => 'inputfield',
                  -size  => 50,
                  -name  => 'fullname',
-                 -value => $fullname}),
+                 -value => $rec->{name}}),
     td {-class  => 'notetext'},'Specify your full name'
   ]) . "\n";
   print Tr [
@@ -71,7 +70,7 @@ sub Body() {
       textfield {-class => 'inputfield',
                  -size  => 50,
                  -name  => 'email',
-                 -value => $email}),
+                 -value => $rec->{email}}),
     td {-class  => 'notetext'},'Your email address is used if you are a ' .
     i ("Tag & Forward") .
       ' user. This is the email address that MAPS will forward your email to after it tags it. This email address is also used in case you forget your password so that we can email you your password.'
@@ -165,6 +164,8 @@ sub Body() {
     submit (-name       => 'submit',
             -value      => 'Update Profile'));
   print end_form;
+
+  return;
 } # Body
 
 # Main
@@ -180,6 +181,8 @@ $userid = Heading(
   @scripts
 );
 
+$userid //= $ENV{USER};
+
 SetContext $userid;
 NavigationBar $userid;