[WTF CVS] wtf/lib/WTF/Apache Authen.pm, 1.2, 1.3 Authz.pm, 1.4, 1.5 Response.pm, 1.1.1.1, 1.2
Brought to you by:
gryphonshafer
|
From: Gryphon S. <gry...@us...> - 2006-12-02 00:09:13
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Apache In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6361/lib/WTF/Apache Modified Files: Authen.pm Authz.pm Response.pm Log Message: Random bits of changes here and there, mostly code clean-up but a few bits of refactoring (globally) based on a code review in prep for v1.02 build and release Index: Authz.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Apache/Authz.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Authz.pm 20 Nov 2006 02:53:07 -0000 1.4 --- Authz.pm 2 Dec 2006 00:09:09 -0000 1.5 *************** *** 1,4 **** package WTF::Apache::Authz; ! our $VERSION = 1.01; use strict; use warnings; --- 1,4 ---- package WTF::Apache::Authz; ! our $VERSION = 1.02; use strict; use warnings; *************** *** 61,65 **** =head1 VERSION ! This document describes WTF::Apache::Authz version 1.01 =head1 DESCRIPTION --- 61,65 ---- =head1 VERSION ! This document describes WTF::Apache::Authz version 1.02 =head1 DESCRIPTION Index: Authen.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Apache/Authen.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Authen.pm 27 Oct 2006 22:34:51 -0000 1.2 --- Authen.pm 2 Dec 2006 00:09:09 -0000 1.3 *************** *** 1,4 **** package WTF::Apache::Authen; ! our $VERSION = 1.01; use strict; use warnings; --- 1,4 ---- package WTF::Apache::Authen; ! our $VERSION = 1.02; use strict; use warnings; *************** *** 68,72 **** $sth->{'authz'}->execute($id) or die $dbh->errstr(); if ( grep { $_->[0] eq 'login_as' } @{ $sth->{'authz'}->fetchall_arrayref() } ) { - $r->pnotes( 'real_user_id' => $id ); --- 68,71 ---- *************** *** 82,88 **** } ! $r->pnotes( 'user_id' => $id ); ! $r->pnotes( 'user_name' => $user_name ); ! $r->pnotes( 'is_admin' => $is_admin ); return Apache2::Const::OK; --- 81,89 ---- } ! $r->pnotes( $_->[0] => $_->[1] ) for ( ! [ 'user_id', $id ], ! [ 'user_name', $user_name ], ! [ 'is_admin', $is_admin ], ! ); return Apache2::Const::OK; *************** *** 105,109 **** =head1 VERSION ! This document describes WTF::Apache::Authen version 1.01 =head1 DESCRIPTION --- 106,110 ---- =head1 VERSION ! This document describes WTF::Apache::Authen version 1.02 =head1 DESCRIPTION *************** *** 114,118 **** On successful login, the function will update the user's last login date/time ! in the database and will set "$r->pnotes" with: =over --- 115,121 ---- On successful login, the function will update the user's last login date/time ! in the database, set a simple boolean session cookie ("authen") so that on ! subsequent requests the application won't update the user's last login in the ! database, and will set "$r->pnotes" with: =over *************** *** 122,125 **** --- 125,133 ---- The database row ID for the user. + =item * username + + The user account name of the current user, typically (and assumed to be for + the purposes of this application) an email address. + =item * user_name *************** *** 134,137 **** --- 142,169 ---- =back + In addition, and to support the "Login As..." functionality, the handler + will check the "login_as" cookie for a value. If there's a value, that + value is a valid user ID number of a person who reports up to the current + user, and the current user has the "login_as" authorization, the handler + will make changes to "$r->pnotes" as follows: + + =over + + =item * real_user_id + + This value will be added, and it will contain the real user ID number + for the current user. When the user desires to revert to his own + account, this data will be used to allow the revertion. + + =item * username + + This value will change to the username (email address) of the user the + current user wishes to become. + + =back + + Additionally, the "user_id", "user_name", and "is_admin" records in pnotes + will be set to the desired "login_as" user rather than the current user. + =head1 CONFIGURATION AND ENVIRONMENT Index: Response.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Apache/Response.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Response.pm 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- Response.pm 2 Dec 2006 00:09:09 -0000 1.2 *************** *** 1,4 **** package WTF::Apache::Response; ! our $VERSION = 1.01; use strict; use warnings; --- 1,4 ---- package WTF::Apache::Response; ! our $VERSION = 1.02; use strict; use warnings; *************** *** 23,27 **** =head1 VERSION ! This document describes WTF::Apache::Response version 1.01 =head1 DESCRIPTION --- 23,27 ---- =head1 VERSION ! This document describes WTF::Apache::Response version 1.02 =head1 DESCRIPTION |