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

Class: Zenphoto_Authority

Source Location: /lib-auth.php

Class Zenphoto_Authority

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

[ Top ]
Method Summary
static Zenphoto_Administrator   getAnAdmin()   Returns an admin object from the $pat:$criteria
static void   getAuthCookies()   returns an array of the active "password" cookies
static void   getResetTicket()  
static void   getRights()   Returns an array of the rights definitions for $version (default returns current version rights)
static void   getVersion()  
static void   handleLogout()   Cleans up on logout
static void   logUser()   Set log-in cookie for a user
static object   newAdministrator()   Instantiates and returns administrator object
static string   passwordHash()   Returns the hash of the zenphoto password
static string   pbkdf2()   PBKDF2 Implementation (described in RFC 2898)
static void   printPasswordForm()  
static void   printPasswordFormJS()   Javascript for password change input handling
static mixed   updateAdminField()   Updates a field in admin record(s)
lib_auth_options   __construct()   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
object   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"
void   getMasterUser()  
array   getOptionsSupported()   Declares options used by lib-auth
void   handleLogon()   User authentication support
void   handleOption()   Dummy for object inheritance purposes
void   isMasterUser()  
void   migrateAuth()   Migrates credentials
void   printLoginForm()   Print the login form for ZP. This will take into account whether mod_rewrite is enabled or not.
void   validateTicket()  

[ Top ]
Properties
static mixed   $hashList = array('pbkdf2' => 3, 'pbkdf2*' => 2, 'sha1' => 1, 'md5' => 0) [line 56]

[ Top ]
static mixed   $preferred_version = 4 [line 54]

[ Top ]
static mixed   $supports_version = 4 [line 55]

[ Top ]
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]
API Tags:
Access:  protected


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

[ Top ]
Methods
static method getAnAdmin  [line 225]

  static Zenphoto_Administrator getAnAdmin( array $criteria  )

Returns an admin object from the $pat:$criteria

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


[ Top ]
static method getAuthCookies  [line 762]

  static 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 ]
static method getResetTicket  [line 607]

  static void getResetTicket( $user, $pass  )

Parameters:
   $user: 
   $pass: 


[ Top ]
static method getRights  [line 496]

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

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

Parameters:
$version   $version: 


[ Top ]
static method getVersion  [line 158]

  static void getVersion( )



[ Top ]
static method handleLogout  [line 782]

  static void handleLogout( )

Cleans up on logout



[ Top ]
static method logUser  [line 640]

  static void logUser( object $user  )

Set log-in cookie for a user

Parameters:
object   $user: 


[ Top ]
static method newAdministrator  [line 486]

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

Instantiates and returns administrator object

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


[ Top ]
static method passwordHash  [line 174]

  static string passwordHash( string $user, string $pass, [ $hash_type = NULL]  )

Returns the hash of the zenphoto password

Parameters:
string   $user: 
string   $pass: 
   $hash_type: 


[ Top ]
static method pbkdf2  [line 1250]

  static string pbkdf2( string $p, string $s, [int $c = 1000], [int $kl = 32], [string $a = 'sha256']  )

PBKDF2 Implementation (described in RFC 2898)

Parameters:
string   $p:  p password
string   $s:  s salt
int   $c:  c iteration count (use 1000 or higher)
int   $kl:  kl derived key length
string   $a:  a hash algorithm

API Tags:
Return:  derived key


[ Top ]
static method printPasswordForm  [line 1205]

  static void printPasswordForm( [ $id = ''], [ $pad = false], [ $disable = NULL], [ $required = false], [ $flag = '']  )

Parameters:
   $id: 
   $pad: 
   $disable: 
   $required: 
   $flag: 


[ Top ]
static method printPasswordFormJS  [line 1086]

  static void printPasswordFormJS( )

Javascript for password change input handling



[ Top ]
static method updateAdminField  [line 459]

  static 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 ]
Constructor __construct  [line 63]

  lib_auth_options __construct( )

class instantiation function



[ Top ]
checkAuthorization  [line 252]

  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 795]

  void checkCookieCredentials( )

Checks saved cookies to see if a user is logged in



[ Top ]
checkLogon  [line 313]

  object checkLogon( string $user, string $pass  )

Checks a logon user/password against admins

Returns the user object if there is a match

Parameters:
string   $user: 
string   $pass: 


[ Top ]
getAdminEmail  [line 352]

  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 207]

  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 ]
getMasterUser  [line 88]

  void getMasterUser( )



[ Top ]
getOptionsSupported  [line 101]

  array getOptionsSupported( )

Declares options used by lib-auth



[ Top ]
handleLogon  [line 650]

  void handleLogon( )

User authentication support



[ Top ]
handleOption  [line 120]

  void handleOption( $option, $currentValue  )

Dummy for object inheritance purposes

Parameters:
   $option: 
   $currentValue: 


[ Top ]
isMasterUser  [line 92]

  void isMasterUser( $user  )

Parameters:
   $user: 


[ Top ]
migrateAuth  [line 375]

  void migrateAuth( $to, int $oldversion  )

Migrates credentials

Parameters:
int   $oldversion: 
   $to: 


[ Top ]
printLoginForm  [line 817]

  void printLoginForm( [string $redirect = null], [bool $logo = true], [bool $showUserField = 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   $showUserField:  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 ]
validateTicket  [line 614]

  void validateTicket( $ticket, $user  )

Parameters:
   $ticket: 
   $user: 


[ Top ]

Documentation generated on Sat, 07 Jun 2014 18:03:36 +0200 by phpDocumentor 1.4.3