CGI-Builder-Auth

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for CGI-Builder-Auth.

0.05 -- 12 July 2004
	* User and Group factories now operate as objects (they are designed to be
	  instantiated). Database files are closed and unlocked after each request.
	  (Bug 987411)

0.04 -- 5 July 2004
	* Made Context call Group membership methods as instance methods, not 
		class methods (Bug 984963)
	* Added example of custom User/Group factories derived from Class::DBI.
	
0.03 -- 2 July 2004
	* Fixed several warnings from 0.02
	* Corrected POD in Group.pm (Bug 983388)

lib/CGI/Builder/Auth/GroupAdmin.pm  view on Meta::CPAN


Turn debugging on or off

=item lock([$timeout])
=item unlock()

These methods give you control of the locking mechanism.

    $group = new CGI::Builder::Auth::GroupAdmin (Locking => 0); #turn off auto-locking
    $group->lock; #lock the object's database
    $group->add($username,$passwd); #write while database is locked
    $group->unlock; release the lock

=item db($dbname);

Select a different database.

    $olddb = $group->db($newdb);
    print "Now we're reading and writing '$newdb', done with '$olddb'n\";

=item flags([$flags])

lib/CGI/Builder/Auth/UserAdmin.pm  view on Meta::CPAN

    $dbmuser = $user->convert(@Apache);

=item lock([$timeout])

=item unlock()

These methods give you control of the locking mechanism.

    $user = new CGI::Builder::Auth::UserAdmin (Locking => 0); #turn off auto-locking
    $user->lock; #lock the object's database
    $user->add($username,$passwd); #write while file is locked
    $user->unlock; release the lock


=item db($dbname);

Select a different database.

    $olddb = $user->db($newdb);
    print "Now we're reading and writing '$newdb', done with '$olddb'n\";

t/05user.t  view on Meta::CPAN

#-------------------------------------------------------------------- 
# Delete
#-------------------------------------------------------------------- 
$user = $user_factory->load(id => 'bob');
ok($user->delete,	"delete as object method");
ok($user_factory->load(id => 'carol')->delete, 	"delete 'in place'");
ok(!$user_factory->list,	"users deleted successfully");

$user = undef;
$user_factory = undef;
ok(!-f '.htpasswd.lock',	"Database unlocked when unused");

# vim:ft=perl:tw=80:

t/06group.t  view on Meta::CPAN

#-------------------------------------------------------------------- 
# Delete
#-------------------------------------------------------------------- 
$group = $group_factory->load(id => 'testgroup');
ok($group->delete,	"delete as object method");
ok($group_factory->load(id => 'mygroup')->delete, 	"delete 'in place'");
ok(!$group_factory->list,	"groups deleted successfully");

$group = undef;
$group_factory = undef;
ok(!-f '.htgroup.lock', 	"Database unlocked when unused");

# vim:ft=perl:tw=80:



( run in 1.622 second using v1.01-cache-2.11-cpan-49f99fa48dc )