Source for file username_password_form.act.php

Documentation is available at username_password_form.act.php

  1. <?php
  2. /**
  3. * @package polyphony.authentication
  4. *
  5. * @copyright Copyright &copy; 2005, Middlebury College
  6. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  7. *
  8. * @version $Id: username_password_form.act.php,v 1.12 2007/09/19 14:04:53 adamfranco Exp $
  9. */
  10.  
  11. require_once(HARMONI."GUIManager/Components/Block.class.php");
  12. require_once(POLYPHONY."/main/library/AbstractActions/MainWindowAction.class.php");
  13.  
  14. /**
  15. *
  16. * @package polyphony.authentication
  17. *
  18. * @copyright Copyright &copy; 2005, Middlebury College
  19. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  20. *
  21. * @version $Id: username_password_form.act.php,v 1.12 2007/09/19 14:04:53 adamfranco Exp $
  22. */
  23. class username_password_formAction
  24. extends MainWindowAction
  25. {
  26. /**
  27. * Check Authorizations
  28. *
  29. * @return boolean
  30. * @access public
  31. * @since 4/26/05
  32. */
  33. function isAuthorizedToExecute () {
  34. return TRUE;
  35. }
  36. /**
  37. * Return the heading text for this action, or an empty string.
  38. *
  39. * @return string
  40. * @access public
  41. * @since 4/26/05
  42. */
  43. function getHeadingText () {
  44. return dgettext("polyphony", "Login");
  45. }
  46. /**
  47. * Build the content for this action
  48. *
  49. * @return void
  50. * @access public
  51. * @since 4/26/05
  52. */
  53. function buildContent () {
  54. $actionRows =$this->getActionRows();
  55. $harmoni = Harmoni::instance();
  56.  
  57. // Set our textdomain
  58. $defaultTextDomain = textdomain("polyphony");
  59. ob_start();
  60. $harmoni->request->startNamespace("harmoni-authentication");
  61. $action = $harmoni->history->getReturnURL("polyphony/authentication");
  62. $usernameField = $harmoni->request->getName("username");
  63. $passwordField = $harmoni->request->getName("password");
  64. $usernameText = _("Username");
  65. $passwordText = _("Password");
  66. print<<<END
  67. <center><form name='login' action='$action' method='post'>
  68. $usernameText: <input type='text' name='$usernameField' />
  69. <br />$passwordText: <input type='password' name='$passwordField' />
  70. <br /><input type='submit' />
  71. </form></center>
  72. END;
  73. $actionRows->add(new Block(ob_get_contents(), 2), "100%", null, CENTER, CENTER);
  74. ob_end_clean();
  75. $harmoni->request->endNamespace();
  76. // go back to the default text domain
  77. textdomain($defaultTextDomain);
  78. }
  79. }

Documentation generated on Wed, 19 Sep 2007 10:27:40 -0400 by phpDocumentor 1.3.0RC3