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

Procedural File: quota_manager.php

Source Location: /zp-extensions/quota_manager.php

Page Details

A quota management system to limit the sum of sizes of uploaded images.

Set the default quota on the plugin options page. You can change the quota for individual users on the Admin tab. Users with ADMIN_RIGHTS or MANAGE_ALL_ALBUM_RIGHTS are not subject to quotas and will not be assigned ownership of an image.

Images uploaded by a user will be marked as his and will count toward his quota. Images uploaded via FTP will not necessarily have an owner assigned. If there is one assiged, it is the logged on user when the image is discovered by Zenphoto.

You may also assign the complete set of images in an albums to a user. (Just the images in the album. If you want to assign images from subalbums, you need to do that for each subalbum.)

A user who exceeds his quota will not be allowed to upload files.

Because of the difficulty of policing quotas when ZIP files are uploaded this plugin has an option to diable ZIP file upload.

Author:  Stephen Billard (sbillard)
Classes
Class Description
Quota_management Option handler class
Functions
quota_checkQuota  [line 200]

Checks if upload should be allowed

Parameters:
int   $error: 
string   $image: 


int quota_checkQuota( int $error, string $image  )

[ Top ]
quota_edit_admin  [line 106]

Returns table row(s) for edit of an admin user's custom data

Parameters:
string   $html:  always empty
string   $i:  prefix for the admin
string   $background:  background color for the admin row
bool   $current:  true if this admin row is the logged in admin
$userobj   $userobj:  Admin user object
   $local_alterrights: 


string quota_edit_admin( string $html, $userobj $userobj, string $i, string $background, bool $current, $local_alterrights  )

[ Top ]
quota_getCurrentUse  [line 130]

Returns current image useage

Parameters:
$userobj   $userobj:  Admin user object


int quota_getCurrentUse( $userobj $userobj  )

[ Top ]
quota_getUploadLimit  [line 187]

Returns the upload limit

Parameters:
int   $uploadlimit: 


int quota_getUploadLimit( int $uploadlimit  )

[ Top ]
quota_getUploadQuota  [line 171]

Returns the user's quota

Parameters:
int   $quota: 


int quota_getUploadQuota( int $quota  )

[ Top ]
quota_get_header  [line 223]

Returns quota text for header, etc.

Parameters:
string   $default: 


string quota_get_header( string $default  )

[ Top ]
quota_image_refresh  [line 160]

checks to see if the filesize is set and sets it if not

Parameters:
unknown_type   $image: 


object quota_image_refresh( unknown_type $image  )

[ Top ]
quota_new_image  [line 145]

Assigns owner to new image

Parameters:
string   $image: 


object quota_new_image( string $image  )

[ Top ]
quota_save_admin  [line 87]

Saves admin custom data Called when an admin is saved

Parameters:
string   $updated:  true if data has changed
object   $userobj:  admin user object
string   $i:  prefix for the admin
bool   $alter:  will be true if critical admin data may be altered


bool quota_save_admin( string $updated, object $userobj, string $i, bool $alter  )

[ Top ]
quota_upload_filetypes  [line 262]

Removes ZIP from list of upload suffixes

Parameters:
array   $types: 


array quota_upload_filetypes( array $types  )

[ Top ]
quota_upload_helper_js  [line 243]

Returns Javascript needed to support quota system

Parameters:
string   $defaultJS: 


string quota_upload_helper_js( string $defaultJS  )

[ Top ]


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