[ class tree: plugins ] [ index: plugins ] [ all elements ]

Procedural File: federated_logon.php

Source Location: /zp-extensions/federated_logon.php

Page Details

Interface to federated login handlers

The plugin will use a federated login such as Google Accounts as a logon server. If the logon succeeds it will log that user onto Zenphoto. An attempt will be made to match the user to an existing Zenphoto user. If such is found, then the user is logged in as that Zenphoto user. If not, a Zenphoto user will be created and the user logged in as him.

The default priviledges for a created user are obtained from the "viewers" group. (The user will belong to that group.) This will be the case whether or not the user_groups plugin is enabled. If you want to be able to specify unique default priviledges you will have to use the user_groups plugin at least until you have defined your default group.

You may also find the user_expiry plugin useful in conjunction with this plugin. Since users may arbitrarily be created from those visitors who login with their federated credentials you may want to "age" these users and remove them after some period of time. That is done by the user_expiry plugin.

Currently there is only one handle available. It is an OpenID handler based on the Janrain OpenID Enabled library (http://www.janrain.com/openid-enabled). There are some server requirements for this library. To see if you server meets them run the script zp-core/zp-extensions/federated_logon/OpenID_detect.php. It will give you a report on what might need be done. You can ignore items about data stores as they are not used in this implementation.

See also the Janrain Readme.txt file.

Other handlers can be created and placed in the plugins/federated_logon folder. Integration with Zenphoto is fairly simple. The logon handler script should be named ending in "_logon.php". The plugin will use the name up to that point as the selector on the logon form.

You need to preserve the $_GET['redirect'] parameter for use after the authentication is successful at which time you call the logonFederatedCredentials() function passing a user ID, e-mail and name (if you have them) and the redirection link you saved above. For an example, the former is done at the beginning of the OpenID_logon.php script. The latter is done in the "run()" function of OpenID_finish_auth.php

There are a couple of examples of handlers here: http://www.zenphoto.org/trac/wiki/ZenphotoPlugins/federated_logon.zip These would be placed in the "plugins" folder (not the zp-extensions folder.)

Author:  Stephen Billard (sbillard)
Classes
Class Description
federated_login_options Option class
Functions
federated_login_alt_login_handler  [line 175]

Provides a list of alternate handlers for logon

Parameters:
$handler_list   $handler_list: 


void federated_login_alt_login_handler( $handler_list $handler_list  )

[ Top ]
federated_login_buttons  [line 381]

Creates a list of logon buttons for federated logon handlers.

Note that it will use an image if one exists. The name of the image should be cononical to the name of the logon handler, but without the "_logon'. The image must be a PNG file.

The styling of the buttons is done by the "federated_logon_buttons.css". If you do not like the one provided place an alternate version in your theme folder or the plugins/federated_logon folder.

Parameters:
   $redirect: 


void federated_login_buttons( [ $redirect = NULL]  )

[ Top ]
federated_login_edit_admin  [line 300]

Enter Admin user tab handler

Parameters:
$html   $html: 
$userobj   $userobj: 
$i   $i: 
$background   $background: 
$current   $current: 
$local_alterrights   $local_alterrights: 


void federated_login_edit_admin( $html $html, $userobj $userobj, $i $i, $background $background, $current $current, $local_alterrights $local_alterrights  )

[ Top ]
federated_login_save_custom  [line 277]

Check if an e-mail address has been provided

Parameters:
$updated   $updated: 
$userobj   $userobj: 
$i   $i: 
$alter   $alter: 


void federated_login_save_custom( $updated $updated, $userobj $userobj, $i $i, $alter $alter  )

[ Top ]
federated_login_verify  [line 338]

Processes the verification POST tickets

Parameters:
   $obj: 


void federated_login_verify( $obj  )

[ Top ]
federated_logon_css  [line 72]

Load the CSS for the logon buttons


void federated_logon_css( )

[ Top ]
logonFederatedCredentials  [line 200]

Common logon handler.

Will log the user on if he exists. Otherwise it will create a user accoung and log on that account.

Redirects into Zenphoto on success presuming there is a redirect link.

Parameters:
$user   $user: 
$email   $email: 
$name   $name: 
$redirect   $redirect: 


void logonFederatedCredentials( $user $user, $email $email, $name $name, $redirect $redirect  )

[ Top ]


Documentation generated on Tue, 20 Dec 2011 16:07:11 +0100 by phpDocumentor 1.4.3