diff -r -c -N eprints-3.0.2-beta-3/cgi/register eprints-3.0.2-patched/cgi/register
*** eprints-3.0.2-beta-3/cgi/register	Wed Jun 13 16:13:51 2007
--- eprints-3.0.2-patched/cgi/register	Fri Jun 29 10:44:34 2007
***************
*** 178,193 ****
  			username=>$session->make_text( $v->{username} ) ) );
  
  	my $maxdelta = EPrints::Time::human_delay(
  		$session->get_repository->get_conf( "pin_timeout" ) );
  
  	# If email fails then we should abort
  	my $rc = $user->mail( 
  		"cgi/register:account",
  		$session->html_phrase( 
  			"mail_password_pin", 
! 			confirmurl => $session->render_link( $session->get_repository->get_conf( "perl_url" )."/confirm?userid=".$user->get_value( "userid" )."&pin=".$pin ),
  			username => $user->render_value( "username" ),
! 			maxdelta => $session->make_text( $maxdelta ) ) );
  
  	if( !$rc )
  	{
--- 178,196 ----
  			username=>$session->make_text( $v->{username} ) ) );
  
  	my $maxdelta = EPrints::Time::human_delay(
+ 		$session,
  		$session->get_repository->get_conf( "pin_timeout" ) );
  
  	# If email fails then we should abort
+ 	my $link = $session->get_repository->get_conf( "perl_url" )."/confirm?userid=".$user->get_value( "userid" )."&pin=".$pin ;
  	my $rc = $user->mail( 
  		"cgi/register:account",
  		$session->html_phrase( 
  			"mail_password_pin", 
! 			confirmurl => $session->render_link( $link ),
! 			urltext => $session->make_text( $link ),
  			username => $user->render_value( "username" ),
! 			maxdelta => $maxdelta ) );
  
  	if( !$rc )
  	{
diff -r -c -N eprints-3.0.2-beta-3/cgi/reset_password eprints-3.0.2-patched/cgi/reset_password
*** eprints-3.0.2-beta-3/cgi/reset_password	Wed Jun 13 16:13:51 2007
--- eprints-3.0.2-patched/cgi/reset_password	Fri Jun 29 10:42:54 2007
***************
*** 147,161 ****
  	$user->commit();
  	
  	my $maxdelta = EPrints::Time::human_delay(
  		$session->get_repository->get_conf( "pin_timeout" ) );
  	
  	my $rc = $user->mail( 
  		"cgi/set_password:account",
  		$session->html_phrase( 
  			"mail_password_pin", 
! 			confirmurl => $session->render_link( $session->get_repository->get_conf( "perl_url" )."/confirm?userid=".$user->get_value( "userid" )."&pin=".$pin ),
  			username => $user->render_value( "username" ),
! 			maxdelta => $session->make_text( $maxdelta ) ) );
  
  	# did email send OK?
  	if( !$rc )
--- 147,164 ----
  	$user->commit();
  	
  	my $maxdelta = EPrints::Time::human_delay(
+ 		$session,
  		$session->get_repository->get_conf( "pin_timeout" ) );
  	
+ 	my $link = $session->get_repository->get_conf( "perl_url" )."/confirm?userid=".$user->get_value( "userid" )."&pin=".$pin ;
  	my $rc = $user->mail( 
  		"cgi/set_password:account",
  		$session->html_phrase( 
  			"mail_password_pin", 
! 			confirmurl => $session->render_link( $link ),
! 			urltext => $session->make_text( $link ),
  			username => $user->render_value( "username" ),
! 			maxdelta => EPrints::XML::clone_node( $maxdelta, 1 ) ) );
  
  	# did email send OK?
  	if( !$rc )
***************
*** 172,178 ****
  	$page->appendChild( $session->html_phrase( 
  		"cgi/set_password:mail_sent",
  		email=>$session->make_text( $email ),
! 		maxdelta => $session->make_text( $maxdelta ) ) );
  	return( $page, $title );
  }
  
--- 175,181 ----
  	$page->appendChild( $session->html_phrase( 
  		"cgi/set_password:mail_sent",
  		email=>$session->make_text( $email ),
! 		maxdelta => $maxdelta ) );
  	return( $page, $title );
  }
  
diff -r -c -N eprints-3.0.2-beta-3/lib/lang/en/phrases/time.xml eprints-3.0.2-patched/lib/lang/en/phrases/time.xml
*** eprints-3.0.2-beta-3/lib/lang/en/phrases/time.xml	Thu Jan  1 01:00:00 1970
--- eprints-3.0.2-patched/lib/lang/en/phrases/time.xml	Thu Jun 28 16:13:43 2007
***************
*** 0 ****
--- 1,14 ----
+ <?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
+ <!DOCTYPE phrases SYSTEM "entities.dtd">
+ 
+ <epp:phrases xmlns="http://www.w3.org/1999/xhtml" xmlns:epp="http://eprints.org/ep3/phrase" xmlns:epc="http://eprints.org/ep3/control">
+ 
+ <!-- phrases for the plural/singular delay -->
+ <epp:phrase id="humantime:hour"><epc:pin name="val" /> hour</epp:phrase>
+ <epp:phrase id="humantime:hours"><epc:pin name="val" /> hours</epp:phrase>
+ <epp:phrase id="humantime:day"><epc:pin name="val" /> day</epp:phrase>
+ <epp:phrase id="humantime:days"><epc:pin name="val" /> days</epp:phrase>
+ <epp:phrase id="humantime:week"><epc:pin name="val" /> week</epp:phrase>
+ <epp:phrase id="humantime:weeks"><epc:pin name="val" /> weeks</epp:phrase>
+ 
+ </epp:phrases>
diff -r -c -N eprints-3.0.2-beta-3/perl_lib/EPrints/Time.pm eprints-3.0.2-patched/perl_lib/EPrints/Time.pm
*** eprints-3.0.2-beta-3/perl_lib/EPrints/Time.pm	Wed Jun 13 16:13:51 2007
--- eprints-3.0.2-patched/perl_lib/EPrints/Time.pm	Thu Jun 28 16:03:36 2007
***************
*** 338,360 ****
  
  sub human_delay
  {
! 	my( $hours ) = @_;
  	
  	if( $hours < 24 )
  	{
! 		return $hours." hour".($hours>1?"s":"");
  	}
  
  	my $days = int( $hours / 24 );
  
  	if( $days < 7 )
  	{
! 		return $days." day".($days>1?"s":"");
  	}
  
  	my $weeks = int( $days / 7 );
  
! 	return $weeks." week".($weeks>1?"s":"");
  }
  
  1;
--- 338,372 ----
  
  sub human_delay
  {
! 	my($session, $hours ) = @_;
  	
+         if($hours < 2 )
+ 	{
+ 		return $session->html_phrase( "humantime:hour", val=>$session->make_text( $hours ) );
+ 	}
  	if( $hours < 24 )
  	{
! 		return $session->html_phrase( "humantime:hours", val=>$session->make_text( $hours ) );
  	}
  
  	my $days = int( $hours / 24 );
  
+         if( $days < 2 )
+ 	{
+ 		return $session->html_phrase( "humantime:day", val=>$session->make_text( $days ) );
+ 	}
  	if( $days < 7 )
  	{
! 		return $session->html_phrase( "humantime:days", val=>$session->make_text( $days ) );
  	}
  
  	my $weeks = int( $days / 7 );
  
!         if($weeks < 2 )
! 	{
! 		return $session->html_phrase( "humantime:week", val=>$session->make_text( $weeks ) );
! 	}
! 	return $session->html_phrase( "humantime:weeks", val=>$session->make_text( $weeks ) );
  }
  
  1;
diff -b -B -c -r -N eprints-3.0.2-beta-3/lib/lang/en/phrases/time.xml eprints-3.0.2-patched/lib/lang/en/phrases/time.xml
*** eprints-3.0.2-beta-3/lib/lang/en/phrases/time.xml	Thu Jan  1 01:00:00 1970
--- eprints-3.0.2-patched/lib/lang/en/phrases/time.xml	Thu Jun 28 16:13:43 2007
***************
*** 0 ****
--- 1,14 ----
+ <?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
+ <!DOCTYPE phrases SYSTEM "entities.dtd">
+ 
+ <epp:phrases xmlns="http://www.w3.org/1999/xhtml" xmlns:epp="http://eprints.org/ep3/phrase" xmlns:epc="http://eprints.org/ep3/control">
+ 
+ <!-- phrases for the plural/singular delay -->
+ <epp:phrase id="humantime:hour"><epc:pin name="val" /> hour</epp:phrase>
+ <epp:phrase id="humantime:hours"><epc:pin name="val" /> hours</epp:phrase>
+ <epp:phrase id="humantime:day"><epc:pin name="val" /> day</epp:phrase>
+ <epp:phrase id="humantime:days"><epc:pin name="val" /> days</epp:phrase>
+ <epp:phrase id="humantime:week"><epc:pin name="val" /> week</epp:phrase>
+ <epp:phrase id="humantime:weeks"><epc:pin name="val" /> weeks</epp:phrase>
+ 
+ </epp:phrases>
