Documentation is available at BasicFormNamePassTokenCollector.class.php
- <?php
- /**
- * @package harmoni.osid_v2.authentication
- *
- * @copyright Copyright © 2005, Middlebury College
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
- *
- * @version $Id: BasicFormNamePassTokenCollector.class.php,v 1.4 2007/09/04 20:25:37 adamfranco Exp $
- */
- require_once(dirname(__FILE__)."/NamePassTokenCollector.abstract.php");
- /**
- * The HTTPAuthNamePassTokenCollector prompts a user for their name and password
- * by sending HTTP Authenticatio headers to the user.
- *
- * @package harmoni.osid_v2.authentication
- *
- * @copyright Copyright © 2005, Middlebury College
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
- *
- * @version $Id: BasicFormNamePassTokenCollector.class.php,v 1.4 2007/09/04 20:25:37 adamfranco Exp $
- */
- class BasicFormNamePassTokenCollector
- extends NamePassTokenCollector
- {
- /**
- * Prompt the user to supply their tokens
- *
- * @return void
- * @access public
- * @since 3/16/05
- */
- function prompt () {
- $harmoni = Harmoni::instance();
- $harmoni->request->startNamespace("harmoni-authentication");
- $action = $_SERVER['REQUEST_URI'];
- $usernameField = $harmoni->request->getName("username");
- $passwordField = $harmoni->request->getName("password");
- $usernameText = _("Username");
- $passwordText = _("Password");
- print<<<END
- <form name='login' action='$action' method='post'>
- $usernameText: <input type='text' name='$usernameField' />
- <br />$passwordText: <input type='password' name='$passwordField' />
- <br /><input type='submit' />
- </form>
- END;
- $harmoni->request->endNamespace();
- exit;
- }
- /**
- * Collect the name that the user may have supplied, Reply NULL if none
- * are found.
- *
- * @return mixed
- * @access public
- * @since 3/16/05
- */
- function collectName () {
- $harmoni = Harmoni::instance();
- $harmoni->request->startNamespace("harmoni-authentication");
- $username = $harmoni->request->get("username");
- $harmoni->request->endNamespace();
- return $username;
- }
- /**
- * Collect the password that the user may have supplied, Reply NULL if none
- * are found.
- *
- * @return mixed
- * @access public
- * @since 3/16/05
- */
- function collectPassword () {
- $harmoni = Harmoni::instance();
- $harmoni->request->startNamespace("harmoni-authentication");
- $password = $harmoni->request->get("password");
- $harmoni->request->endNamespace();
- return $password;
- }
- }
- ?>
Documentation generated on Wed, 19 Sep 2007 10:21:44 -0400 by phpDocumentor 1.3.0RC3