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

Class: Zenphoto_Authority

Source Location: /lib-auth.php

Class Zenphoto_Authority

Property Summary
mixed   $admin_all  
mixed   $admin_groups  
mixed   $admin_other  
mixed   $admin_users  
mixed   $master_user  
mixed   $preferred_version  
mixed   $rightsset  
mixed   $supports_version  

[ Top ]
Method Summary
lib_auth_options   Zenphoto_Authority()   class instantiation function
bit   checkAuthorization()   Retuns the administration rights of a saved authorization code Will promote an admin to ADMIN_RIGHTS if he is the most privileged admin
void   checkCookieCredentials()   Checks saved cookies to see if a user is logged in
bool   checkLogon()   Checks a logon user/password against admins
array   getAdminEmail()   Returns the email addresses of the Admin with ADMIN_USERS rights
array   getAdministrators()   Returns an array of admin users, indexed by the userid and ordered by "privileges"
Zenphoto_Administrator   getAnAdmin()   Returns an admin object from the $pat:$criteria
void   getAuthCookies()   returns an array of the active "password" cookies
array   getOptionsSupported()   Declares options used by lib-auth
void   getResetTicket()  
void   getRights()   Returns an array of the rights definitions for $version (default returns current version rights)
void   getVersion()  
void   handleLogon()   User authentication support
void   handleLogout()   Cleans up on logout
void   handleOption()   Dummy for object inheritance purposes
void   logUser()   Set log-in cookie for a user
void   migrateAuth()   Migrates credentials
object   newAdministrator()   Instantiates and returns administrator object
string   passwordHash()   Returns the hash of the zenphoto password
string   passwordNote()   Returns text describing password constraints
void   printLoginForm()   Print the login form for ZP. This will take into account whether mod_rewrite is enabled or not.
mixed   updateAdminField()   Updates a field in admin record(s)
string   validatePassword()   Checks to see if password follows rules Returns error message if not.
void   validateTicket()  

[ Top ]
Properties
mixed   $admin_all = NULL [line 51]

[ Top ]
mixed   $admin_groups = NULL [line 49]

[ Top ]
mixed   $admin_other = NULL [line 50]

[ Top ]
mixed   $admin_users = NULL [line 48]

[ Top ]
mixed   $master_user = NULL [line 53]

[ Top ]
mixed   $preferred_version = 3 [line 54]

[ Top ]
mixed   $rightsset = NULL [line 52]

[ Top ]
mixed   $supports_version = 3 [line 55]

[ Top ]
Methods
Constructor Zenphoto_Authority  [line 62]

  lib_auth_options Zenphoto_Authority( )

class instantiation function



[ Top ]
checkAuthorization  [line 305]

  bit checkAuthorization( string $authCode, int $id  )

Retuns the administration rights of a saved authorization code Will promote an admin to ADMIN_RIGHTS if he is the most privileged admin

Parameters:
string   $authCode:  the hash code to check
int   $id:  whom we think this is


[ Top ]
checkCookieCredentials  [line 759]

  void checkCookieCredentials( )

Checks saved cookies to see if a user is logged in



[ Top ]
checkLogon  [line 351]

  bool checkLogon( string $user, string $pass  )

Checks a logon user/password against admins

Returns true if there is a match

Parameters:
string   $user: 
string   $pass: 

API Tags:
Access:  protected


[ Top ]
getAdminEmail  [line 364]

  array getAdminEmail( [bit $rights = NULL]  )

Returns the email addresses of the Admin with ADMIN_USERS rights

Parameters:
bit   $rights:  what kind of admins to retrieve


[ Top ]
getAdministrators  [line 239]

  array getAdministrators( [ $what = 'users'], string $what:  )

Returns an array of admin users, indexed by the userid and ordered by "privileges"

The array contains the id, hashed password, user's name, email, and admin privileges

Parameters:
string   $what::  'all' for everything, 'users' for just users 'groups' for groups and templates
   $what: 


[ Top ]
getAnAdmin  [line 278]

  Zenphoto_Administrator getAnAdmin( array $criteria  )

Returns an admin object from the $pat:$criteria

Parameters:
array   $criteria:  [ match => criteria ]


[ Top ]
getAuthCookies  [line 731]

  void getAuthCookies( )

returns an array of the active "password" cookies

NOTE: this presumes the general form of an authrization cookie is: zp_xxxxx_auth{_dddd) where xxxxx is the authority (e.g. gallery, image, search, ...) and dddd if present is the object id.



[ Top ]
getOptionsSupported  [line 87]

  array getOptionsSupported( )

Declares options used by lib-auth



[ Top ]
getResetTicket  [line 580]

  void getResetTicket( $user, $pass  )

Parameters:
   $user: 
   $pass: 


[ Top ]
getRights  [line 490]

  void getRights( [$version $version = NULL]  )

Returns an array of the rights definitions for $version (default returns current version rights)

Parameters:
$version   $version: 


[ Top ]
getVersion  [line 124]

  void getVersion( )



[ Top ]
handleLogon  [line 620]

  void handleLogon( )

User authentication support



[ Top ]
handleLogout  [line 747]

  void handleLogout( )

Cleans up on logout



[ Top ]
handleOption  [line 103]

  void handleOption( $option, $currentValue  )

Dummy for object inheritance purposes

Parameters:
   $option: 
   $currentValue: 


[ Top ]
logUser  [line 610]

  void logUser( string $user  )

Set log-in cookie for a user

Parameters:
string   $user: 


[ Top ]
migrateAuth  [line 387]

  void migrateAuth( $to, int $oldversion  )

Migrates credentials

Parameters:
int   $oldversion: 
   $to: 


[ Top ]
newAdministrator  [line 480]

  object newAdministrator( $name $name, [$valid $valid = 1]  )

Instantiates and returns administrator object

Parameters:
$name   $name: 
$valid   $valid: 


[ Top ]
passwordHash  [line 140]

  string passwordHash( string $user, string $pass  )

Returns the hash of the zenphoto password

Parameters:
string   $user: 
string   $pass: 


[ Top ]
passwordNote  [line 196]

  string passwordNote( )

Returns text describing password constraints



[ Top ]
printLoginForm  [line 791]

  void printLoginForm( [string $redirect = null], [bool $logo = true], [bool $showUser = true], [bool $showCaptcha = true], [string $hint = '']  )

Print the login form for ZP. This will take into account whether mod_rewrite is enabled or not.

Parameters:
string   $redirect:  URL to return to after login
bool   $logo:  set to true to display the ADMIN zenphoto logo.
bool   $showUser:  set to true to display the user input
bool   $showCaptcha:  set to false to not display the forgot password captcha.
string   $hint:  optional hint for the password


[ Top ]
updateAdminField  [line 454]

  mixed updateAdminField( string $update, mixed $value, array $constraints  )

Updates a field in admin record(s)

Parameters:
string   $update:  name of the field
mixed   $value:  what to store
array   $constraints:  on the update [ field<op>,value ]

API Tags:
Return:  Query result


[ Top ]
validatePassword  [line 157]

  string validatePassword( string $pass  )

Checks to see if password follows rules Returns error message if not.

Parameters:
string   $pass: 


[ Top ]
validateTicket  [line 587]

  void validateTicket( $ticket, $user  )

Parameters:
   $ticket: 
   $user: 


[ Top ]

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