lib_auth_options Zenphoto_Authority(
)
|
|
class instantiation function
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 |
void checkCookieCredentials(
)
|
|
Checks saved cookies to see if a user is logged in
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:
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 |
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: |
|
Returns an admin object from the $pat:$criteria
Parameters:
|
array |
$criteria: |
[ match => criteria ] |
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.
array getOptionsSupported(
)
|
|
Declares options used by lib-auth
void getResetTicket(
$user,
$pass
)
|
|
Parameters:
void getRights(
[$version
$version = NULL]
)
|
|
Returns an array of the rights definitions for $version (default returns current version rights)
Parameters:
User authentication support
void handleOption(
$option,
$currentValue
)
|
|
Dummy for object inheritance purposes
Parameters:
void logUser(
string
$user
)
|
|
Set log-in cookie for a user
Parameters:
void migrateAuth(
$to, int
$oldversion
)
|
|
Migrates credentials
Parameters:
object newAdministrator(
$name
$name, [$valid
$valid = 1]
)
|
|
Instantiates and returns administrator object
Parameters:
|
$name |
$name: |
|
|
$valid |
$valid: |
|
string passwordHash(
string
$user, string
$pass
)
|
|
Returns the hash of the zenphoto password
Parameters:
|
string |
$user: |
|
|
string |
$pass: |
|
Returns text describing password constraints
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 |
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:
string validatePassword(
string
$pass
)
|
|
Checks to see if password follows rules Returns error message if not.
Parameters:
void validateTicket(
$ticket,
$user
)
|
|
Parameters: