[geeklog-cvs] Geeklog-2/commands Geeklog_LoginCommand.php,NONE,1.1

tony at iowaoutdoors.org tony at iowaoutdoors.org
Mon Dec 20 17:15:48 EST 2004


Update of /var/cvs/Geeklog-2/commands
In directory www:/tmp/cvs-serv28513

Added Files:
	Geeklog_LoginCommand.php 
Log Message:
Initial release.  Note the magic of logging in actually happens in the appropriate Account Manager.  
This is just a proxy to the right Account Manager.


--- NEW FILE: Geeklog_LoginCommand.php ---
<?php

/* Reminder: always indent with 4 spaces (no tabs). */
/**
 * Geeklog 2
 *
 * License Details To Be Determined
 *
 */
  
/**
 * Base Command
 */
require_once 'BaseCommand.php';

/**
 * Account Manager
 */
require_once 'AccountManager.php';

/**
 * User domain object
 */
require_once 'Geeklog-2/Gl2User.php';

/**
 * Login command
 *
 * Account Managers will allow Geeklog to better meet the more complex needs of an enterprise.  
 * This class most likely need not be extended as all the magic happens at the underlying account
 * manager level.
 *
 * @copyright 2004 Tony Bibbs
 * @author Tony Bibbs <tony at geeklog.net>
 *
 */
class Geeklog_LoginCommand extends Geeklog_BaseCommand {
	public function execute()
	{
		global $glConf;

		// Get the appropriate account Manager
		$actManager = &Geeklog_AccountManager::singleton($glConf['account_manager']
			, $glConf['account_manager_options']);
			
		try {
			// Let the account manager do the magic, note this only returns a MVCnPHP forward, not
			// a user object.  The account manager will put the user object in session if the 
			// authenticate call works.
			return $actManager->authenticate();
		} catch (Exception $e) {
			// Should do something here.
			throw $e;
		}					
	}
}

?>



More information about the geeklog-cvs mailing list