phpDocumentor Password
Classes
[ class tree: Password ] [ index: Password ] [ all elements ]

Class: PasswordHelper

Source Location: /modules/password/classes/PasswordHelper.class

Class PasswordHelper

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From PasswordInterface_1_0

PasswordInterface_1_0::hasPassword()
Is item password protected?
PasswordInterface_1_0::removePassword()
Remove password protection for an item
PasswordInterface_1_0::setPassword()
Password protect an item

[ Top ]
Method Summary
static GalleryStatus   removePassword()   Remove password protection.
static GalleryStatus   setPassword()   Password protect an item.
PasswordHelper   PasswordHelper()  
GalleryStatus   handleMoveItem()   Update permissions as needed for appropriate password status when moving an item.
GalleryStatus   handleNewItem()   Update permissions as needed for appropriate password status when adding an item.
void   hasPassword()  
GalleryStatus   _adjustPermissionsForRemove()   Adjust permissions of item and subitems when removing a password
GalleryStatus   _adjustPermissionsForSet()   Adjust permissions of item and subitems when setting a password
array   _checkAncestors()   Check for nearest password/hidden ancestors of given item

[ Top ]
Methods
static method removePassword  [line 336]

  static GalleryStatus removePassword( &$item, [boolean $useProgressBar = false], GalleryItem $item  )

Remove password protection.

For an album, add back view permissions on all subitems to everybody group.

Parameters:
GalleryItem   $item:  the item to unprotect
boolean   $useProgressBar:  (default is false)
   &$item: 

API Tags:
Return:  a status code


Redefinition of:
PasswordInterface_1_0::removePassword()
Remove password protection for an item

[ Top ]
static method setPassword  [line 52]

  static GalleryStatus setPassword( &$item, string $password, [boolean $useProgressBar = false], GalleryItem $item  )

Password protect an item.

Remove public view permissions from all subitems (if $item is an album) and add session based permissions; leave public core.view on $item itself so users can browse to it. Add an onLoadHandler that will redirect to get-password view when core.ShowItem is accessed but the user doesn't have resize/source permission. This view will grant permissions to the session when the correct password is given.

Parameters:
GalleryItem   $item:  the item to be protected
string   $password:  password
boolean   $useProgressBar:  (default is false)
   &$item: 

API Tags:
Return:  a status code


Redefinition of:
PasswordInterface_1_0::setPassword()
Password protect an item

[ Top ]
Constructor PasswordHelper  [line 725]

  PasswordHelper PasswordHelper( )



[ Top ]
handleMoveItem  [line 588]

  GalleryStatus handleMoveItem( GalleryItem $item  )

Update permissions as needed for appropriate password status when moving an item.

Parameters:
GalleryItem   $item:  item that has moved

API Tags:
Return:  a status code


[ Top ]
handleNewItem  [line 676]

  GalleryStatus handleNewItem( GalleryItem $item  )

Update permissions as needed for appropriate password status when adding an item.

Parameters:
GalleryItem   $item:  new item

API Tags:
Return:  a status code


[ Top ]
hasPassword  [line 721]

  void hasPassword( $item  )

Parameters:
   $item: 

API Tags:
See:  PasswordInterface_1_0::hasPassword


Redefinition of:
PasswordInterface_1_0::hasPassword()
Is item password protected?

[ Top ]
_adjustPermissionsForRemove  [line 426]

  GalleryStatus _adjustPermissionsForRemove( &$item, int $protectedBy, mixed $protectedAncestor, mixed $hiddenAncestor, &$progressBar, GalleryItem $item, array $progressBar  )

Adjust permissions of item and subitems when removing a password

Parameters:
GalleryItem   $item: 
int   $protectedBy:  id of formerly password protected item
mixed   $protectedAncestor:  id of nearest password protected ancestor or false
mixed   $hiddenAncestor:  id of nearest hidden ancestor or false
array   $progressBar:  progress bar data or null
   &$item: 
   &$progressBar: 

API Tags:
Return:  a status code
Access:  private


[ Top ]
_adjustPermissionsForSet  [line 180]

  GalleryStatus _adjustPermissionsForSet( &$item, int $protectedBy, mixed $protectedAncestor, mixed $hiddenAncestor, &$progressBar, [boolean $inHidden = false], GalleryItem $item, array $progressBar  )

Adjust permissions of item and subitems when setting a password

Parameters:
GalleryItem   $item: 
int   $protectedBy:  id of password protected item
mixed   $protectedAncestor:  id of nearest password protected ancestor or false
mixed   $hiddenAncestor:  id of nearest hidden ancestor or false
array   $progressBar:  progress bar data or null
boolean   $inHidden:  (optional) true when recursing into a hidden album
   &$item: 
   &$progressBar: 

API Tags:
Return:  a status code
Access:  private


[ Top ]
_checkAncestors  [line 141]

  array _checkAncestors( GalleryItem $item  )

Check for nearest password/hidden ancestors of given item

Parameters:
GalleryItem   $item:  item

API Tags:
Return:  GalleryStatus a status code mixed id of nearest password protected ancestor or false mixed id of nearest hidden ancestor or false
Access:  private


[ Top ]

Documentation generated on Sat, 21 Nov 2009 05:17:19 -0800 by phpDocumentor 1.3.0RC6