Source for file AuthenticationManager.php

Documentation is available at AuthenticationManager.php

  1. <?php
  2. include_once(dirname(__FILE__)."/../OsidManager.php");
  3. /**
  4. * <p>
  5. * AuthenticationManager:
  6. *
  7. * <ul>
  8. * <li>
  9. * gets authentication Types supported by the implementation,
  10. * </li>
  11. * <li>
  12. * authenticates the user using a particular authentication Type,
  13. * </li>
  14. * <li>
  15. * determines if the user is authenticated for a particular authentication
  16. * Type,
  17. * </li>
  18. * <li>
  19. * destroys the user's authentication,
  20. * </li>
  21. * <li>
  22. * returns the Id of the Agent that represents the user.
  23. * </li>
  24. * </ul>
  25. * </p>
  26. *
  27. * <p>
  28. * All implementations of OsidManager (manager) provide methods for accessing
  29. * and manipulating the various objects defined in the OSID package. A manager
  30. * defines an implementation of an OSID. All other OSID objects come either
  31. * directly or indirectly from the manager. New instances of the OSID objects
  32. * are created either directly or indirectly by the manager. Because the OSID
  33. * objects are defined using interfaces, create methods must be used instead
  34. * of the new operator to create instances of the OSID objects. Create methods
  35. * are used both to instantiate and persist OSID objects. Using the
  36. * OsidManager class to define an OSID's implementation allows the application
  37. * to change OSID implementations by changing the OsidManager package name
  38. * used to load an implementation. Applications developed using managers
  39. * permit OSID implementation substitution without changing the application
  40. * source code. As with all managers, use the OsidLoader to load an
  41. * implementation of this interface.
  42. * </p>
  43. *
  44. * <p></p>
  45. *
  46. * <p>
  47. * OSID Version: 2.0
  48. * </p>
  49. *
  50. * <p>
  51. * Licensed under the {@link org.osid.SidImplementationLicenseMIT MIT}
  52. * O.K.I&#46; OSID Definition License}.
  53. * </p>
  54. *
  55. * @package org.osid.authentication
  56. */
  57. class AuthenticationManager
  58. extends OsidManager
  59. {
  60. /**
  61. * Get the authentication Types that are supported by the implementation.
  62. *
  63. * @return object TypeIterator
  64. *
  65. * @throws object AuthenticationException An exception
  66. * with one of the following messages defined in
  67. * org.osid.authentication.AuthenticationException may be thrown:
  68. * {@link }
  69. * org.osid.authentication.AuthenticationException#OPERATION_FAILED
  70. * OPERATION_FAILED}, {@link }
  71. * org.osid.authentication.AuthenticationException#PERMISSION_DENIED
  72. * PERMISSION_DENIED}, {@link }
  73. * org.osid.authentication.AuthenticationException#CONFIGURATION_ERROR
  74. * CONFIGURATION_ERROR}, {@link }
  75. * org.osid.authentication.AuthenticationException#UNIMPLEMENTED
  76. * UNIMPLEMENTED}
  77. *
  78. * @access public
  79. */
  80. function getAuthenticationTypes () {
  81. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  82. }
  83.  
  84. /**
  85. * Invoke the authentication process of the specified Type to identify the
  86. * user. It may be necessary to call isUserAuthenticated to check the
  87. * status of authentication. The standard authentication technique of
  88. * limiting the time an user's authentication is valid requires explicit
  89. * queries of the authentication status. It is likely that checking the
  90. * status of authentication will occur more frequently than invoking the
  91. * mechanism to authenticate the user. Separation of the authentication
  92. * process from checking the status of the authentication process is made
  93. * explicit by having the authenticateUser and isUserAuthenticated
  94. * methods.
  95. *
  96. * @param object Type $authenticationType
  97. *
  98. * @throws object AuthenticationException An exception
  99. * with one of the following messages defined in
  100. * org.osid.authentication.AuthenticationException may be thrown:
  101. * {@link }
  102. * org.osid.authentication.AuthenticationException#OPERATION_FAILED
  103. * OPERATION_FAILED}, {@link }
  104. * org.osid.authentication.AuthenticationException#PERMISSION_DENIED
  105. * PERMISSION_DENIED}, {@link }
  106. * org.osid.authentication.AuthenticationException#CONFIGURATION_ERROR
  107. * CONFIGURATION_ERROR}, {@link }
  108. * org.osid.authentication.AuthenticationException#UNIMPLEMENTED
  109. * UNIMPLEMENTED}, {@link }
  110. * org.osid.authentication.AuthenticationException#NULL_ARGUMENT
  111. * NULL_ARGUMENT}, {@link }
  112. * org.osid.authentication.AuthenticationException#UNKNOWN_TYPE
  113. * UNKNOWN_TYPE}
  114. *
  115. * @access public
  116. */
  117. function authenticateUser ( $authenticationType ) {
  118. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  119. }
  120.  
  121. /**
  122. * Check the current authentication status of the user. If the method
  123. * returns true, the user is authenticated. If the method returns false,
  124. * the user is not authenticated. This can indicate that the user could
  125. * not be authenticated or that the user's authentication has timed out.
  126. * The intent is to use the method authenticateUser to invoke the
  127. * authentication process. The standard authentication technique of
  128. * limiting the time an user's authentication is valid requires explicit
  129. * queries of the authentication status. It is likely that checking the
  130. * status of authentication will occur more frequently than invoking the
  131. * mechanism to authenticate the user. Separation of the authentication
  132. * process from checking the status of the authentication process is made
  133. * explicit by having the authenticateUser and isUserAuthenticated
  134. * methods.
  135. *
  136. * @param object Type $authenticationType
  137. *
  138. * @return boolean
  139. *
  140. * @throws object AuthenticationException An exception
  141. * with one of the following messages defined in
  142. * org.osid.authentication.AuthenticationException may be thrown:
  143. * {@link }
  144. * org.osid.authentication.AuthenticationException#OPERATION_FAILED
  145. * OPERATION_FAILED}, {@link }
  146. * org.osid.authentication.AuthenticationException#PERMISSION_DENIED
  147. * PERMISSION_DENIED}, {@link }
  148. * org.osid.authentication.AuthenticationException#CONFIGURATION_ERROR
  149. * CONFIGURATION_ERROR}, {@link }
  150. * org.osid.authentication.AuthenticationException#UNIMPLEMENTED
  151. * UNIMPLEMENTED}, {@link }
  152. * org.osid.authentication.AuthenticationException#NULL_ARGUMENT
  153. * NULL_ARGUMENT}, {@link }
  154. * org.osid.authentication.AuthenticationException#UNKNOWN_TYPE
  155. * UNKNOWN_TYPE}
  156. *
  157. * @access public
  158. */
  159. function isUserAuthenticated ( $authenticationType ) {
  160. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  161. }
  162.  
  163. /**
  164. * Get the unique Id of the Agent that represents the user for the
  165. * specified AuthenticationType. Agents are managed using the Agent OSID.
  166. *
  167. * @param object Type $authenticationType
  168. *
  169. * @return object Id
  170. *
  171. * @throws object AuthenticationException An exception
  172. * with one of the following messages defined in
  173. * org.osid.authentication.AuthenticationException may be thrown:
  174. * {@link }
  175. * org.osid.authentication.AuthenticationException#OPERATION_FAILED
  176. * OPERATION_FAILED}, {@link }
  177. * org.osid.authentication.AuthenticationException#PERMISSION_DENIED
  178. * PERMISSION_DENIED}, {@link }
  179. * org.osid.authentication.AuthenticationException#CONFIGURATION_ERROR
  180. * CONFIGURATION_ERROR}, {@link }
  181. * org.osid.authentication.AuthenticationException#UNIMPLEMENTED
  182. * UNIMPLEMENTED}, {@link }
  183. * org.osid.authentication.AuthenticationException#NULL_ARGUMENT
  184. * NULL_ARGUMENT}, {@link }
  185. * org.osid.authentication.AuthenticationException#UNKNOWN_TYPE
  186. * UNKNOWN_TYPE}
  187. *
  188. * @access public
  189. */
  190. function getUserId ( $authenticationType ) {
  191. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  192. }
  193.  
  194. /**
  195. * Destroy authentication for all authentication types.
  196. *
  197. * @throws object AuthenticationException An exception
  198. * with one of the following messages defined in
  199. * org.osid.authentication.AuthenticationException may be thrown:
  200. * {@link }
  201. * org.osid.authentication.AuthenticationException#OPERATION_FAILED
  202. * OPERATION_FAILED}, {@link }
  203. * org.osid.authentication.AuthenticationException#PERMISSION_DENIED
  204. * PERMISSION_DENIED}, {@link }
  205. * org.osid.authentication.AuthenticationException#CONFIGURATION_ERROR
  206. * CONFIGURATION_ERROR}, {@link }
  207. * org.osid.authentication.AuthenticationException#UNIMPLEMENTED
  208. * UNIMPLEMENTED}
  209. *
  210. * @access public
  211. */
  212. function destroyAuthentication () {
  213. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  214. }
  215.  
  216. /**
  217. * Destroy authentication for the specified authentication type.
  218. *
  219. * @param object Type $authenticationType
  220. *
  221. * @throws object AuthenticationException An exception
  222. * with one of the following messages defined in
  223. * org.osid.authentication.AuthenticationException may be thrown:
  224. * {@link }
  225. * org.osid.authentication.AuthenticationException#OPERATION_FAILED
  226. * OPERATION_FAILED}, {@link }
  227. * org.osid.authentication.AuthenticationException#PERMISSION_DENIED
  228. * PERMISSION_DENIED}, {@link }
  229. * org.osid.authentication.AuthenticationException#CONFIGURATION_ERROR
  230. * CONFIGURATION_ERROR}, {@link }
  231. * org.osid.authentication.AuthenticationException#UNIMPLEMENTED
  232. * UNIMPLEMENTED}, {@link }
  233. * org.osid.authentication.AuthenticationException#NULL_ARGUMENT
  234. * NULL_ARGUMENT}, {@link }
  235. * org.osid.authentication.AuthenticationException#UNKNOWN_TYPE
  236. * UNKNOWN_TYPE}
  237. *
  238. * @access public
  239. */
  240. function destroyAuthenticationForType ( $authenticationType ) {
  241. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  242. }
  243. }
  244.  
  245. ?>

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