Author: richter
Date: Thu Jan 30 08:25:32 2014
New Revision: 1562718

URL: http://svn.apache.org/r1562718
Log:
Do not write passwords in html text

Modified:
    perl/embperl/trunk/Embperl/Form/Control/password.pm
    perl/embperl/trunk/Embperl/Form/Control/passwordonce.pm

Modified: perl/embperl/trunk/Embperl/Form/Control/password.pm
URL: 
http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/password.pm?rev=1562718&r1=1562717&r2=1562718&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/password.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/password.pm Thu Jan 30 08:25:32 2014
@@ -20,8 +20,60 @@ package Embperl::Form::Control::password
 use strict ;
 use base 'Embperl::Form::Control' ;
 
+use vars qw{%fdat} ;
+
 use Embperl::Inline ;
 
+
+    
+# 
------------------------------------------------------------------------------------------
+#
+#   init_data - daten aufteilen
+#
+
+sub init_data
+    {
+    my ($self, $req, $parentctrl) = @_ ;
+
+    my $fdat  = $req -> {docdata} || \%fdat ;
+    my $name    = $self->{name} ;
+
+    $fdat->{$name} = $fdat->{$name}?'********':'' ;
+    
+    my $retype_name = $self->{retype_name} ;
+    $fdat->{$retype_name} = $fdat->{$name} if ($retype_name) ;
+    }
+
+# 
------------------------------------------------------------------------------------------
+#
+#   prepare_fdat - daten zusammenfuehren
+#
+
+sub prepare_fdat
+    {
+    my ($self, $req) = @_ ;
+
+    my $fdat  = $req -> {form} || \%fdat ;
+    my $name    = $self->{name} ;
+
+    delete $fdat -> {$name} if ($fdat -> {$name} eq '********') ;
+    }
+
+# ---------------------------------------------------------------------------
+#
+#   get_validate_auto_rules - get rules for validation, in case user did
+#                             not specify any
+#
+
+sub get_validate_auto_rules
+    {
+    my ($self, $req) = @_ ;
+    
+    return if (!$self->{retype_name}) ;
+    return [ "same", $self->{retype_name} ] ;
+    }
+
+
 1 ;
 
 __EMBPERL__
@@ -45,7 +97,7 @@ __EMBPERL__
 #   show_control_readonly - output the control as readonly
 #]
 
-[$ sub show_control_readonly ($self) $]*****[$endsub$]
+[$ sub show_control_readonly ($self) $][$ if ($fdat{$self->{name}}) 
$]********[$endif$][$endsub$]
 
 
 
@@ -90,6 +142,13 @@ Will be used as label for the text input
 
 Gives the size in characters
 
+=head3 retype_name
+
+Name of control that is used to repeat the password.
+An automatic validation rule will be generated, to make
+sure both inputs are equal.
+
+
 =head3 maxlength
 
 Gives the maximun length in characters

Modified: perl/embperl/trunk/Embperl/Form/Control/passwordonce.pm
URL: 
http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/passwordonce.pm?rev=1562718&r1=1562717&r2=1562718&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/passwordonce.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/passwordonce.pm Thu Jan 30 08:25:32 
2014
@@ -18,10 +18,14 @@
 package Embperl::Form::Control::passwordonce ;
 
 use strict ;
-use base 'Embperl::Form::Control' ;
+use base 'Embperl::Form::Control::password' ;
 
 use Embperl::Inline ;
 
+
+
+
+
 1 ;
 
 __EMBPERL__



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscr...@perl.apache.org
For additional commands, e-mail: embperl-cvs-h...@perl.apache.org

Reply via email to