Apache-DBI

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	  option to true, will use placeholders for the given userid 
	  in the SELECT statements. This will speedup database access. 

	- proposal from "Jordi 'Matematic' Salvat" <jordi@webarna.com>:
	  replace AuthName with a summary of all attributes relevant
	  for the select statements. This still keeps the userid entries
	  in the cache unique, but solves the problem with different 
	  AuthNames which eventually forces the user to authenticate 
	  several times. 

	- new configuration option Auth_DBI_expeditive from
	  "Jordi 'Matematic' Salvat" <jordi@webarna.com>. 
	  When authorization fails, AuthzDBI returns AUTH_REQUIRED
	  as default. With Auth_DBI_expeditive set to "on" it returns
	  FORBIDDEN if access is denied. Hence this can be distinguished 
	  from the case, where the user just mistyped the password.

	- applied patch from Ask Bjoern Hansen <ask@valueclick.com>:
	  get rid of some annoying "Use of uninitialized value ..."

	- applied patch from Joshua Chamas <joshua@chamas.com>:
	  use eval{ping} to prevent using an invalid database handle.

	- added 'use Apache;' to Apache::DBI.pm as proposed by

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

              'Auth_DBI_log_string'       => '',
              'Auth_DBI_authoritative'    => 'on',
              'Auth_DBI_nopasswd'         => 'off',
              'Auth_DBI_encrypted'        => 'on',
              'Auth_DBI_encryption_salt'  => 'password',
              #Using Two (or more) Methods Will Allow for Fallback to older Methods
              'Auth_DBI_encryption_method'=> 'sha1hex/md5/crypt',
              'Auth_DBI_uidcasesensitive' => 'on',
              'Auth_DBI_pwdcasesensitive' => 'on',
              'Auth_DBI_placeholder'      => 'off',
              'Auth_DBI_expeditive'       => 'on',
             );

# stores the configuration of current URL.
# initialized  during authentication, eventually re-used for authorization.
my $Attr = {};

# global cache: all records are put into one string.
# record separator is a newline. Field separator is $;.
# every record is a list of id, time of last access, password, groups
#(authorization only).

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

        return MP2 ? Apache2::Const::DECLINED() :
            Apache::Constants::DECLINED();
    }

    # do we want Windows-like case-insensitivity?
    $user_sent = lc $user_sent if $Attr->{uidcasesensitive} eq "off";

    # select code to return if authorization is denied:
    my $authz_denied;
    if (MP2) {
      $authz_denied = $Attr->{expeditive} eq 'on' ?
          Apache2::Const::FORBIDDEN() : Apache2::Const::AUTH_REQUIRED();
    }
    else {
      $authz_denied = $Attr->{expeditive} eq 'on' ?
          Apache::Constants::FORBIDDEN() : Apache::Constants::AUTH_REQUIRED();
    }

    # check if requirements exists
    my $ary_ref = $r->requires;
    unless ($ary_ref) {
        if ($Attr->{authoritative} eq 'on') {
            $r->log_reason("user $user_sent denied, no access rules specified (DBI-Authoritative)", $r->uri);
            if ($authz_denied == (MP2 ? Apache2::Const::AUTH_REQUIRED() :
                Apache::Constants::AUTH_REQUIRED())) {



( run in 1.226 second using v1.01-cache-2.11-cpan-de7293f3b23 )