Class WFAuthorizationDelegate


Informal delegate protocol for your web application to handle authentication.

The WFAuthorizationManager will call your delegate methods to attempt logins.

Located in /framework/WFAuthorization.php (line 18)

Method Summary
object WFAuthorizationInfo login (string $username, string $password, boolean $passIsToken)
mixed loginFailedMessage (string $username)
string loginMessage ()
string resetPassword (string $username)
string usernameLabel ()
defaultLoginContinueURL (line 48)

The URL to continue to if the user logs in but there is no "continue to url" set.

If NULL, no redirect will be performed, and just a message saying "Login successful" will be seen.

string defaultLoginContinueURL ()
defaultLogoutContinueURL (line 57)

The URL to continue to if the user logs out.

If NULL, no redirect will be performed, and just a message saying "Logout successful" will be seen.

string defaultLogoutContinueURL ()
login (line 30)

Provide the login authentication.

Your WFAuthorizationDelegate can provide its own login capability. Maybe your app will authenticate against LDAP, a Database, etc.

  • return: Return an WFAuthorizationInfo with any additional security profile. This of course can be a subclass. Return NULL if login failed.
object WFAuthorizationInfo login (string $username, string $password, boolean $passIsToken)
  • string $username: The username to use for the authentication.
  • string $password: The password to use for the authentication.
  • boolean $passIsToken: TRUE if the password is in "token" form; ie, not the clear-text password. Useful for remember-me logins or single-sign-on (SSO) setups.
loginFailedMessage (line 102)

The message to display to a use on unsuccessful login.

  • return: string: The message to display on failed login. array of strings; Multiple messages to display (as list items). DEFAULT: string:"Login username or password is not valid."
mixed loginFailedMessage (string $username)
  • string $username: The username that the attempted login was for.
loginInvocationPath (line 39)

Provide the invocationPath for handling login.

By default, this will be "login/promptLogin". Applications can override this behavior by writing their own login modules, or even simply "wrapping" the built-in one.

  • return: The invocationPath to the login. Remember the page handling login *should* accept a first parameter of "continueURL" (the url will be encoded with WFWebApplication::serializeURL())
string loginInvocationPath ()
loginMessage (line 87)

The login help message that should be displayed above the login box.

  • return: The login message to display above the login box. DEFAULT: "You must log in to access the requested page."
string loginMessage ()
resetPassword (line 119)

Reset the password for the given user.

  • return: The message to show the user on successful password reset. DEFAULT: "The password for <usernameLabel> <username> been reset. Your new password information has been emailed to the email address on file for your account."
  • throws: object WFException If the password cannot be reset, throw an error with the message to be displayed as the string.
    object WFRedirectRequestException If your reset password system is more complicated than can be handled by PHOCOA, feel free to redirect to another page to handle this.
string resetPassword (string $username)
  • string $username: The username that the attempted login was for.
shouldEnableForgottenPasswordReset (line 109)

Should a "forgot your password" link be shown?

  • return: TRUE to enable forgotten password reset feature.
boolean shouldEnableForgottenPasswordReset ()
shouldEnableRememberMe (line 72)

Should the login interface have a "remember me" checkbox?

  • return: TRUE to enable "remember me" functionality. DEFAULT: false.
  • todo: REMEMBER ME code to actually set up / read remember me cookies it NOT implemented.
boolean shouldEnableRememberMe ()
shouldRememberMeByDefault (line 80)

If "remember me" is enabled with shouldEnableRememberMe, should "remember me" be checked by default?

  • return: TRUE if the "remember me" checkbox should be checked by default. DEFAULT: false.
boolean shouldRememberMeByDefault ()
shouldShowLogoutConfirmation (line 64)

Should there be an interstitial "You have logged out successfully, click here to continue", or should logout immediately redirect to defaultLogoutContinueURL()?

  • return: TRUE to show a logout interstitial. DEFAULT: true.
boolean shouldShowLogoutConfirmation ()
usernameLabel (line 94)

The label to use for the "username" field.

  • return: The label for the username field. DEFAULT: "Username".
string usernameLabel ()

Inherited Methods

Inherited From WFObject


Documentation generated on Thu, 14 May 2009 16:19:46 -0400 by phpDocumentor 1.4.2