Thread: [Codestriker-commits] CVS update: codestriker/bin install.pl
                
                Brought to you by:
                
                    sits
                    
                
            
            
        
        
        
    | 
      
      
      From: <si...@us...> - 2006-06-10 07:51:38
       | 
|   User: sits    
  Date: 06/06/10 00:48:35
  Modified:    bin      install.pl
  Log:
  Use current perl path when generating codestriker.pl file
  
  
  
  Index: install.pl
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- install.pl	10 Jun 2006 07:45:30 -0000	1.8
  +++ install.pl	10 Jun 2006 07:48:35 -0000	1.9
  @@ -1030,12 +1030,12 @@
   # For Win32, don't enable tainting mode.  There are weird issues with
   # ActivePerl, and sometimes with IIS as well.  Make sure the Windows Perl
   # path is set correctly, as its location could be anywhere.
  +my $perl = $^X;
   if ($windows) {
  -    my $perl = $^X;
       $perl =~ s/\\/\//g;
       $template_vars->{hash_ex_line} = '#!' . $perl . ' -w';
   } else {
  -    $template_vars->{hash_ex_line} = '#!/usr/bin/perl -wT';
  +    $template_vars->{hash_ex_line} = '#!' . $perl . ' -wT';
   }
   
   $template_vars->{codestriker_lib} = 'use lib \'' . cwd() . '/../lib\';';
  
  
  
 | 
| 
      
      
      From: <si...@us...> - 2006-08-10 23:57:00
       | 
|   User: sits    
  Date: 06/08/10 16:56:56
  Modified:    bin      install.pl
  Log:
  Added the right dependency value for MIME::QuotedPrint
  
  
  
  Index: install.pl
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- install.pl	21 Jul 2006 06:25:27 -0000	1.11
  +++ install.pl	10 Aug 2006 23:56:56 -0000	1.12
  @@ -77,7 +77,7 @@
       }, 
       {
   	name => 'MIME::QuotedPrint',
  -	version => '0'
  +	version => '2.14'
       },
       { 
           name => 'DBI', 
  
  
  
 | 
| 
      
      
      From: <si...@us...> - 2008-06-17 12:00:55
       | 
|   User: sits    
  Date: 08/06/17 05:00:54
  Modified:    bin      install.pl
  Log:
  Include warning if highlighter is not configured in the codestriker.conf file with an appropriate message.
  
  
  
  Index: install.pl
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- install.pl	22 Feb 2008 00:32:05 -0000	1.17
  +++ install.pl	17 Jun 2008 12:00:54 -0000	1.18
  @@ -341,6 +341,13 @@
       }
   }
   
  +# Issue a warning to the user if the highlight binary is not available.
  +if (! (defined $Codestriker::highlighter) || $Codestriker::highlighter eq '') {
  +	print STDERR "\nWARNING: \$highlighter variable is not set in codestriker.conf.\n";
  +	print STDERR "No syntax highlighting will be performed.\n";
  +	print STDERR "Download from http://www.andre-simon.de/ and\n";
  +	print STDERR " set \$highlighter to location of executable.\n\n";
  +}
   
   # Obtain a database connection.
   my $dbh = $database->get_connection();
  
  
  
 | 
| 
      
      
      From: <si...@us...> - 2008-08-13 10:16:24
       | 
| User: sits Date: 08/08/13 03:16:23 Modified: bin install.pl Log: Make install.pl run from the base directory rather than bin to support multi-host setups as described in: https://sourceforge.net/tracker/?func=detail&atid=429863&aid=1537058&group_id=41136 Index: install.pl =================================================================== RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- install.pl 12 Aug 2008 09:20:22 -0000 1.20 +++ install.pl 13 Aug 2008 10:16:22 -0000 1.21 @@ -23,18 +23,18 @@ use strict; use Config; -# Determine the location of the Codestriker bin directory. This will +# Determine the location of the Codestriker base directory. This will # work even if the script was not executed in the bin directory. -my $bin_directory; +my $base_directory; BEGIN { use File::Spec::Functions qw(rel2abs); use File::Basename qw(dirname); my $path = rel2abs($0); - $bin_directory = dirname($path); + $base_directory = dirname(dirname($path)); } -use lib $bin_directory . "/../lib"; +use lib $base_directory . "/lib"; -chdir $bin_directory; +chdir $base_directory; require 5.008_0; @@ -60,7 +60,7 @@ @Codestriker::valid_repositories = (); # Initialise Codestriker, load up the configuration file. -Codestriker->initialise(cwd() . '/..'); +Codestriker->initialise(cwd()); # Make sure the $db configuration variable has been set, and if not # complain and exit. @@ -1064,7 +1064,7 @@ # Now generate the contents of the codestriker.pl file, with the appropriate # configuration details set (basically, the location of the lib dir). print "Generating cgi-bin/codestriker.pl file...\n"; -mkdir '../cgi-bin', 0755; +mkdir 'cgi-bin', 0755; my $template = Template->new(); @@ -1090,9 +1090,9 @@ $template_vars->{scmbug_lib} = 'use lib \'' . $Codestriker::scmbug_lib_dir . '\';'; } -$template_vars->{codestriker_lib} = 'use lib \'' . cwd() . '/../lib\';'; +$template_vars->{codestriker_lib} = 'use lib \'' . cwd() . '/lib\';'; -$template_vars->{codestriker_conf} = '\'' . cwd() . '/..\''; +$template_vars->{codestriker_conf} = '\'' . cwd() . '\''; $template_vars->{has_rss} = !exists($missing_optional{'XML::RSS'}); @@ -1101,20 +1101,20 @@ "# !!!! DO NOT EDIT !!!\n". "# The base source is bin/codestriker.pl.base.\n"; -open(CODESTRIKER_PL, ">../cgi-bin/codestriker.pl") - || die "Unable to create ../cgi-bin/codestriker.pl file: $!"; +open(CODESTRIKER_PL, ">cgi-bin/codestriker.pl") + || die "Unable to create cgi-bin/codestriker.pl file: $!"; -$template->process("codestriker.pl.base", $template_vars,\*CODESTRIKER_PL); +$template->process("bin/codestriker.pl.base", $template_vars, \*CODESTRIKER_PL); close CODESTRIKER_PL; # Make sure the generated file is executable. -chmod 0755, '../cgi-bin/codestriker.pl'; +chmod 0755, 'cgi-bin/codestriker.pl'; # Clean out the contents of the data and template directory, but don't # remove them. print "Removing old generated templates...\n"; -chdir('../cgi-bin') || +chdir('cgi-bin') || die "Couldn't change to cgi-dir directory: $!"; if (-d 'template/en') { print "Cleaning old template directory...\n"; | 
| 
      
      
      From: <si...@us...> - 2008-09-07 04:49:28
       | 
|   User: sits    
  Date: 08/09/06 21:49:27
  Modified:    lib/Codestriker/Model User.pm
               lib/Codestriker/Http/Method LoginMethod.pm
                        AuthenticateMethod.pm
               lib/Codestriker/Http UrlBuilder.pm Dispatcher.pm
               bin      install.pl
  Added:       template/en/default login.html.tmpl
               lib/Codestriker/Action Login.pm
  Log:
  Now have the example login page in the system.
  
  
  
  Index: login.html.tmpl
  ===================================================================
  RCS file: login.html.tmpl
  diff -N login.html.tmpl
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ login.html.tmpl	7 Sep 2008 04:49:26 -0000	1.1
  @@ -0,0 +1,57 @@
  +[%# Screen for login form. #%]
  +
  +[% PROCESS header.html.tmpl version = version displaymenu = 1 
  +                            closehead = 1 subtitle = "Login" %]
  +<p>
  +Please enter your email address and password to continue. 
  +</p>
  +
  +<form method="post" enctype="application/x-www-form-urlencoded" action="[% action_url %]">
  +
  +<input type="hidden" name="action" value="authenticate" />
  +  <table>
  +    <tr>
  +      <th align="right">E-mail address:</th>
  +      <td>
  +        <input size="40" maxlength="80" name="email">
  +      </td>
  +    </tr>
  +    <tr>
  +      <th align="right">Password:</th>
  +      <td>
  +        <input type="password" size="40" name="password">
  +      </td>
  +    </tr>
  +    <tr>
  +      <th> </th><td> </td>
  +    </tr>
  +  </table>
  +
  +  <input type="submit" name=".submit" value="Log in" />
  +
  +</form>
  +
  +<!--
  +<hr>
  +
  +<p>
  +If you don't have a Codestriker account, you can create a new account.
  +</p>
  +
  +<hr>
  +
  +<form method="post" enctype="application/x-www-form-urlencoded" action="[% action_url %]">
  +  <input type="hidden" name="action" value="reset_password">
  +  <p>
  +    If you have an account, but have forgotten your password,
  +    enter your e-mail address below to generate a new password.
  +  </p>
  +  <input size="40" maxlength="80" name="email">
  +  <input type="submit" name=".submit2" value="Regenerate Password">
  +</form>
  +-->
  +
  +[% PROCESS trailer.html.tmpl %]
  +
  +</body>
  +</html>
  
  
  
  
  
  Index: User.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Model/User.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- User.pm	6 Sep 2008 11:33:06 -0000	1.2
  +++ User.pm	7 Sep 2008 04:49:26 -0000	1.3
  @@ -24,15 +24,16 @@
       my $dbh = Codestriker::DB::DBI->get_connection();
       eval {
           my $select_user =
  -          $dbh->prepare_cached('SELECT password_hash, admin ' .
  +          $dbh->prepare_cached('SELECT password_hash, challenge, admin ' .
                                  'FROM usertable ' .
                                  'WHERE email = ?');
           $select_user->execute($email);
   
  -        my ($password_hash, $admin) = $select_user->fetchrow_array();
  +        my ($password_hash, $challenge, $admin) = $select_user->fetchrow_array();
           $select_user->finish();
   
           $self->{password_hash} = $password_hash;
  +        $self->{challenge} = $challenge;
           $self->{admin} = $admin;
       };
       my $success = $@ ? 0 : 1;
  @@ -45,11 +46,41 @@
       return $self;
   }
   
  +# Determine if the specific user already exists.
  +sub exists {
  +    my ($type, $email) = @_;
  +
  +    # Obtain a database connection.
  +    my $dbh = Codestriker::DB::DBI->get_connection();
  +
  +    my $count = 0;
  +    eval {
  +        my $select_email =
  +          $dbh->prepare_cached('SELECT COUNT(*) FROM usertable ' .
  +                               'WHERE email = ?');
  +        $select_email->execute($email);
  +        ($count) = $select_email->fetchrow_array();
  +        $select_email->finish();
  +    };
  +    my $success = $@ ? 0 : 1;
  +
  +    Codestriker::DB::DBI->release_connection($dbh, $success);
  +    die $dbh->errstr unless $success;
  +
  +    return $count;
  +}
  +
   # Update an existing user record with a new password.
   sub update_password {
       my ($self, $new_password) = @_;
   
  -    my $password_hash = _hash_password($new_password);
  +    $self->update_password_hash(_hash_password($new_password));
  +}
  +
  +# Update an existing user record with a new password_hash.
  +sub update_password_hash {
  +    my ($self, $password_hash) = @_;
  +
       my $dbh = Codestriker::DB::DBI->get_connection();
       eval {
           my $update_user =
  @@ -113,28 +144,33 @@
       return $new_password;
   }
   
  -# Determine if the specific user already exists.
  -sub exists {
  -    my ($type, $email) = @_;
  +# Create a challenge key into the user table for supporting the
  +# case where a user can update their password via a
  +# challenge/response protocol.
  +sub create_challenge {
  +    my ($self, $email) = @_;
   
       # Obtain a database connection.
       my $dbh = Codestriker::DB::DBI->get_connection();
   
  -    my $count = 0;
  +    # Create a random challenge for the user.
  +    my $new_password = _create_random_password();
  +    my $challenge = _hash_password($new_password);
  +
  +    # Set this challenge into the user record.
       eval {
  -        my $select_email =
  -          $dbh->prepare_cached('SELECT COUNT(*) FROM usertable ' .
  -                               'WHERE email = ?');
  -        $select_email->execute($email);
  -        ($count) = $select_email->fetchrow_array();
  -        $select_email->finish();
  +        my $challenge_update =
  +          $dbh->prepare_cached('UPDATE usertable ' .
  +                               'SET challenge = ? ' .
  +                               'WHERE email = ? ');
  +        $challenge_update->execute($self->{email}, $challenge);
       };
       my $success = $@ ? 0 : 1;
   
       Codestriker::DB::DBI->release_connection($dbh, $success);
       die $dbh->errstr unless $success;
   
  -    return $count;
  +    return $challenge;
   }
   
   # Method for producing a hash from a password.
  
  
  
  
  
  Index: LoginMethod.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/LoginMethod.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LoginMethod.pm	7 Sep 2008 03:44:15 -0000	1.1
  +++ LoginMethod.pm	7 Sep 2008 04:49:26 -0000	1.2
  @@ -11,6 +11,7 @@
   
   use strict;
   use Codestriker::Http::Method;
  +use Codestriker::Action::Login;
   
   @Codestriker::Http::Method::LoginMethod::ISA = ("Codestriker::Http::Method");
   
  @@ -50,7 +51,7 @@
   sub execute {
       my ($self, $http_input, $http_output) = @_;
   
  -    Codestriker::Action::LoginAction->process($http_input, $http_output);
  +    Codestriker::Action::Login->process($http_input, $http_output);
   }
   
   1;
  
  
  
  
  
  Index: AuthenticateMethod.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Method/AuthenticateMethod.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AuthenticateMethod.pm	7 Sep 2008 03:44:15 -0000	1.1
  +++ AuthenticateMethod.pm	7 Sep 2008 04:49:26 -0000	1.2
  @@ -44,7 +44,7 @@
   sub execute {
       my ($self, $http_input, $http_output) = @_;
   
  -    Codestriker::Action::AuthenticateAction->process($http_input, $http_output);
  +    Codestriker::Action::Authenticate->process($http_input, $http_output);
   }
   
   1;
  
  
  
  
  
  Index: UrlBuilder.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- UrlBuilder.pm	6 Sep 2008 06:03:56 -0000	1.49
  +++ UrlBuilder.pm	7 Sep 2008 04:49:26 -0000	1.50
  @@ -35,6 +35,8 @@
   use Codestriker::Http::Method::UpdateTopicMetricsMethod;
   use Codestriker::Http::Method::UpdateCommentMetricsMethod;
   use Codestriker::Http::Method::UpdateTopicStateMethod;
  +use Codestriker::Http::Method::LoginMethod;
  +use Codestriker::Http::Method::AuthenticateMethod;
   
   # Constructor for this class.
   sub new {
  @@ -225,4 +227,17 @@
       return Codestriker::Http::Method::DownloadMetricsMethod->new($self->{query})->url();
   }
   
  +# Create the URL for going to the login page.
  +sub login_url {
  +    my ($self, %args) = @_;
  +    return Codestriker::Http::Method::LoginMethod->new($self->{query})->url(%args);
  +}
  +
  +# Create the URL for authenticating.
  +sub authenticate_url {
  +    my ($self, %args) = @_;
  +    return Codestriker::Http::Method::AuthenticateMethod->new($self->{query})->url(%args);
  +}
  +
  +
   1;
  
  
  
  
  
  Index: Dispatcher.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Dispatcher.pm,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Dispatcher.pm	6 Sep 2008 00:31:47 -0000	1.10
  +++ Dispatcher.pm	7 Sep 2008 04:49:26 -0000	1.11
  @@ -38,6 +38,8 @@
   use Codestriker::Http::Method::ViewMetricsMethod;
   use Codestriker::Http::Method::UpdateTopicStateMethod;
   use Codestriker::Http::Method::AddProjectMethod;
  +use Codestriker::Http::Method::LoginMethod;
  +use Codestriker::Http::Method::AuthenticateMethod;
   
   # Initialise all of the methods that are known to the system.
   # TODO: add configuration to the parameter.
  @@ -77,6 +79,8 @@
       push @methods, Codestriker::Http::Method::ViewMetricsMethod->new($query);
       push @methods, Codestriker::Http::Method::UpdateTopicStateMethod->new($query);
       push @methods, Codestriker::Http::Method::AddProjectMethod->new($query);
  +    push @methods, Codestriker::Http::Method::LoginMethod->new($query);
  +    push @methods, Codestriker::Http::Method::AuthenticateMethod->new($query);
   
       $self->{methods} = \@methods;
       return bless $self, $type;
  @@ -87,6 +91,9 @@
   sub dispatch {
       my ($self, $http_input, $http_output) = @_;
   
  +    # TODO: put login in here which redirects to the login form
  +    # if appropriate with the full URL in the redirect parameter.
  +
       foreach my $method ( @{$self->{methods}} ) {
           if ($method->extract_parameters($http_input)) {
               $method->execute($http_input, $http_output);
  
  
  
  
  
  Index: Login.pm
  ===================================================================
  RCS file: Login.pm
  diff -N Login.pm
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ Login.pm	7 Sep 2008 04:49:27 -0000	1.1
  @@ -0,0 +1,35 @@
  +###############################################################################
  +# Codestriker: Copyright (c) 2001, 2002 David Sitsky.  All rights reserved.
  +# si...@us...
  +#
  +# This program is free software; you can redistribute it and modify it under
  +# the terms of the GPL.
  +
  +# Action object for displaying the login page.
  +
  +package Codestriker::Action::Login;
  +
  +use strict;
  +use Codestriker::Http::UrlBuilder;
  +
  +# Create an appropriate form for logging in.
  +sub process {
  +    my ($type, $http_input, $http_response) = @_;
  +
  +    my $query = $http_response->get_query();
  +
  +    $http_response->generate_header(topic_title=>"Login",
  +                                    reload=>0, cache=>1);
  +
  +    # Target URL to divert the post to.
  +    my $vars = {};
  +    my $url_builder = Codestriker::Http::UrlBuilder->new($query);
  +    $vars->{'action_url'} = $url_builder->authenticate_url();
  +
  +    my $template = Codestriker::Http::Template->new("login");
  +    $template->process($vars);
  +
  +    $http_response->generate_footer();
  +}
  +
  +1;
  
  
  
  
  
  Index: install.pl
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- install.pl	6 Sep 2008 11:33:06 -0000	1.24
  +++ install.pl	7 Sep 2008 04:49:27 -0000	1.25
  @@ -579,6 +579,7 @@
     table(name => "usertable",
           columns => [col(name=>"email", type=>$VARCHAR, length=>200, pk=>1),
                       col(name=>"password_hash", type=>$VARCHAR, length=>128),
  +                    col(name=>"challenge", type=>$VARCHAR, length=>128, mandatory=>0),
                       col(name=>"admin", type=>$INT16)
                      ],
           indexes => []);
  @@ -1071,12 +1072,14 @@
   
   # Now create any admin users, if necessary.
   $dbh->{PrintError} = 1;
  +my $user_added = 0;
   if (defined $Codestriker::admin_users) {
       foreach my $admin_user (@{ $Codestriker::admin_users }) {
           if (!Codestriker::Model::User->exists($admin_user)) {
               print "Creating admin user $admin_user...\n";
               Codestriker::Model::User->create($admin_user, 1);
               # TODO: consider sending email with password details.
  +            $user_added = 1;
               print "Done\n";
           } else {
               # Existing user, check if they are an admin already.
  @@ -1084,11 +1087,13 @@
               if (! $user->{admin}) {
                   print "Upgrading non-admin user $admin_user to admin...\n";
                   $user->update_admin(1);
  +                $user_added = 1;
                   print "Done\n";
               }
           }
       }
   }
  +$database->commit() if $user_added;
   
   # Now generate the contents of the codestriker.pl file, with the appropriate
   # configuration details set (basically, the location of the lib dir).
  
  
  
 | 
| 
      
      
      From: <si...@us...> - 2008-09-08 07:20:16
       | 
|   User: sits    
  Date: 08/09/08 00:20:15
  Modified:    lib/Codestriker/Http Response.pm
               lib/Codestriker/Action Authenticate.pm
               bin      install.pl
  Log:
  Set the password hash into the cookie.  Next step will be to enforce
  login for certain methods.
  
  
  
  Index: Response.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Response.pm,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- Response.pm	6 Sep 2008 06:03:56 -0000	1.53
  +++ Response.pm	8 Sep 2008 07:20:14 -0000	1.54
  @@ -52,6 +52,7 @@
       my $projectid = "";
       my $load_anchor = "";
       my $topicsort = "";
  +    my $password_hash = "";
       my $fview = -1;
   
       my $reload = $params{reload};
  @@ -129,6 +130,13 @@
           $topicsort = $params{topicsort};
       }
   
  +    if (! defined $params{password_hash} || $params{password_hash} eq "") {
  +        $password_hash = Codestriker::Http::Cookie->get_property($query,
  +                                                                 'password_hash');
  +    } else {
  +        $password_hash = $params{password_hash};
  +    }
  +
       $cookie{'email'} = $email if $email ne "";
       $cookie{'reviewers'} = $reviewers if $reviewers ne "";
       $cookie{'cc'} = $cc if $cc ne "";
  @@ -137,6 +145,7 @@
       $cookie{'repository'} = $repository if $repository ne "";
       $cookie{'projectid'} = $projectid if $projectid ne "";
       $cookie{'topicsort'} = $topicsort if $topicsort ne "";
  +    $cookie{'password_hash'} = $password_hash if $password_hash ne "";
   
       my $cookie_obj = Codestriker::Http::Cookie->make($query, \%cookie);
   
  
  
  
  
  
  Index: Authenticate.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/Authenticate.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Authenticate.pm	8 Sep 2008 06:49:38 -0000	1.1
  +++ Authenticate.pm	8 Sep 2008 07:20:14 -0000	1.2
  @@ -24,10 +24,11 @@
       my $feedback = "";
   
       # Check if the account for this email address is valid.
  +    my $user;
       if (!Codestriker::Model::User->exists($email)) {
           $feedback = "The username or password you entered is not valid.";
       } else {
  -        my $user = Codestriker::Model::User->new($email);
  +        $user = Codestriker::Model::User->new($email);
   
           # Check that the password entered is correct.
           if (! $user->check_password($password)) {
  @@ -42,11 +43,17 @@
           print $query->redirect(-URI => $url);
       } else {
           # Redirect to the specified URL, if present, otherwise go to the default
  -        # URL.
  +        # URL.  Get the current cookie, and set the password hash into it.
  +        my %cookie_hash = Codestriker::Http::Cookie->get($query);
  +        $cookie_hash{password_hash} = $user->{password_hash};
  +        my $cookie = Codestriker::Http::Cookie->make($query, \%cookie_hash);
  +
           if (defined $redirect && $redirect ne "") {
  -            print $query->redirect(-URI => $redirect);
  +            print $query->redirect(-cookie => $cookie,
  +                                   -URI => $redirect);
           } else {
  -            print $query->redirect(-URI => $query->url());
  +            print $query->redirect(-cookie => $cookie,
  +                                   -URI => $query->url());
           }
       }
   }
  
  
  
  
  
  Index: install.pl
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- install.pl	7 Sep 2008 04:49:27 -0000	1.25
  +++ install.pl	8 Sep 2008 07:20:15 -0000	1.26
  @@ -1080,7 +1080,7 @@
               Codestriker::Model::User->create($admin_user, 1);
               # TODO: consider sending email with password details.
               $user_added = 1;
  -            print "Done\n";
  +            print "Done.  You will need to use \"Reset Password\" on the login page.\n";
           } else {
               # Existing user, check if they are an admin already.
               my $user = Codestriker::Model::User->new($admin_user);
  
  
  
 |