Apache-iNcom

 view release on metacpan or  search on metacpan

lib/Apache/iNcom.pm  view on Meta::CPAN


To turn off the use of the search profiles set this directive to
C<NONE>.

=back

=head2 PROFILES DIRECTIVES

=over

=item INCOM_INPUT_PROFILE

Sets the input profile that will be used to initialize the $Validator
object. Defaults to F<conf/input_profiles.pl> relative to server's
root.

See HTML::FormValidator(3) for details on the format of this file.

To turn off the creation of an input profile set this directive to
C<NONE>.

lib/Apache/iNcom/Request.pm  view on Meta::CPAN


	    # Load it if the user has logged into this session
	    if ( exists $self->{session}{_incom_logged_in} ) {
		$self->{user} =
		  $self->{userdb}->user_get( $self->{session}{_incom_logged_in} );
	    }
	}
    }

    # Setup validator object
    my $input_profile = $req_rec->dir_config( "INCOM_INPUT_PROFILE" )
      || "conf/input_profiles.pl";
    unless ( $input_profile eq "NONE" ) {
	$input_profile = $req_rec->server_root_relative( $input_profile );

	$self->{validator} = new HTML::FormValidator( $input_profile );
    }

    # Setup the cart object
    my $price_profile = $req_rec->dir_config( "INCOM_PRICING_PROFILE" )
      ||  "conf/pricing_profile.pl";

lib/HTML/FormValidator.pm  view on Meta::CPAN

    }


    bless { profile_file => $profile_file,
	    profiles	 => $profiles,
	  }, $class;
}

=pod

=head1 INPUT PROFILE SPECIFICATION

To create a HTML::FormValidator, use the following :

    my $validator = new HTML::FormValidator( $input_profile );

Where $input_profile may either be an hash reference to an input
profiles specification or a file that will be evaluated at runtime to
get a hash reference to an input profiles specification.

The input profiles specification is an hash reference where each key

lib/HTML/FormValidator.pm  view on Meta::CPAN

    $self->{profiles} = do $file;
    die "Error in input profiles: $@\n" if $@;
    die "Input profiles didn't return an hash ref\n"
      unless ref $self->{profiles} eq "HASH";

    $self->{profiles_mtime} = $mtime;
}

=pod

=head1 VALIDATING INPUT

    my( $valids, $missings, $invalids, $unknowns ) =
	$validator->validate( \%fdat, "customer_infos" );

To validate input you use the validate() method. This method takes two
parameters :

=over

=item data

lib/HTML/FormValidator.pm  view on Meta::CPAN

	    delete $valid{$field};
	    push @invalid, $field;
	}
    }

    return ( \%valid, \@missings, \@invalid, \@unknown );
}

=pod

=head1 INPUT FILTERS

These are the builtin filters which may be specified as name in the
I<filters> and I<field_filters> parameters of the input profile.

=over

=item trim

Remove white space at the front and end of the fields.



( run in 0.369 second using v1.01-cache-2.11-cpan-64827b87656 )