ILIAS
Release_4_4_x_branch Revision 61816
|
Class ilDiskQuotaChecker. More...
Public Member Functions | |
ilDiskQuotaChecker () |
Static Public Member Functions | |
static | _lookupDiskQuota ($a_user_id) |
Gets the disk quota info for the specified user account. | |
static | _lookupDiskUsage ($a_user_id) |
Gets the disk usage info for the specified user account. | |
static | _fetchDiskQuotaReport ($a_usage_filter=3, $a_access_filter=1, $a_order_column='disk_usage', $a_order_by='desc') |
Reads disk quota/disk usage report of the user accounts. | |
static | _updateDiskUsageReport () |
Updates the disk usage info of all user accounts. | |
static | _sendSummaryMails () |
static | _sendReminderMails () |
Sends reminder e-mails to all users who have access and who have exceeded their disk quota and who haven't received a reminder mail in the past 7 days. | |
static | _lookupDiskUsageReportLastUpdate () |
Returns the SQL datetime of the last update of the disk usage report. | |
static | _lookupPersonalWorkspaceDiskQuota ($a_user_id) |
Static Private Member Functions | |
static | __updateDiskUsageReportOfType ($a_access_obj, $a_type) |
Updates the disk usage report of the specified object type for all user accounts. | |
static | __saveUserData ($a_user_id, $a_type, $a_size, $a_count) |
Save disk quota for user. | |
static | __updateDiskUsageReportOfTypeHelper ($a_access_obj, $a_objects, &$a_result) |
for each objects of an owner, count the number of objects and sum up the size | |
static | __getRepositoryObjectsByType ($a_type) |
get all objects of the desired type which are in the repository | |
static | __getWorkspaceObjectsByType ($a_type) |
get all objects of the desired type which are in the personal workspace ordered by owner | |
static | __updateDiskUsageReportOfUsers ($a_access_obj, $a_type) |
Updates the disk usage report of the specified object type for all user accounts. |
Class ilDiskQuotaChecker.
Definition at line 33 of file class.ilDiskQuotaChecker.php.
|
staticprivate |
get all objects of the desired type which are in the repository
ordered by owner
type | $a_type |
Definition at line 483 of file class.ilDiskQuotaChecker.php.
Referenced by __updateDiskUsageReportOfType().
|
staticprivate |
get all objects of the desired type which are in the personal workspace ordered by owner
type | $a_type |
Definition at line 504 of file class.ilDiskQuotaChecker.php.
Referenced by __updateDiskUsageReportOfType().
|
staticprivate |
Save disk quota for user.
int | $a_user_id | |
string | $a_type | |
int | $a_size | |
int | $a_count |
Definition at line 419 of file class.ilDiskQuotaChecker.php.
Referenced by __updateDiskUsageReportOfType(), and __updateDiskUsageReportOfUsers().
|
staticprivate |
Updates the disk usage report of the specified object type for all user accounts.
The results are stored in table usr_pref. For each user which owns files the following rows are inserted:
$a_access_obj | Object A access object, such as ilObjFileAccess. |
$a_type | string The type of the access object, such as 'file'. |
Keyword Value Description 'disk_usage.file.count' integer The number of files owned by the user 'disk_usage.file.usage' integer The disk usage of the files
Definition at line 389 of file class.ilDiskQuotaChecker.php.
References $res, __getRepositoryObjectsByType(), __getWorkspaceObjectsByType(), __saveUserData(), and __updateDiskUsageReportOfTypeHelper().
Referenced by _updateDiskUsageReport().
|
staticprivate |
for each objects of an owner, count the number of objects and sum up the size
object | $a_access_obj | |
object | $a_objects | |
array | $a_result |
Definition at line 450 of file class.ilDiskQuotaChecker.php.
References $row, $size, and DB_FETCHMODE_OBJECT.
Referenced by __updateDiskUsageReportOfType().
|
staticprivate |
Updates the disk usage report of the specified object type for all user accounts.
The results are stored in table usr_pref. For each user which owns files the following rows are inserted:
$a_access_obj | Object A access object, such as ilObjFileAccess. |
$a_type | string The type of the access object, such as 'file'. |
Keyword Value Description 'disk_usage.file.count' integer The number of files owned by the user 'disk_usage.file.usage' integer The disk usage of the files
Definition at line 531 of file class.ilDiskQuotaChecker.php.
References $res, $row, __saveUserData(), and DB_FETCHMODE_OBJECT.
Referenced by _updateDiskUsageReport().
|
static |
Reads disk quota/disk usage report of the user accounts.
Returns an array or associative arrays with information about the disk usage of each user account.
string | usage filter values: 1 = all users 2 = only users who don't use disk space 3 = only users who use disk space 4 = only users who have exceeded their quota |
string | access filter values: 1 = all users 2 = only users who have access 4 = only users who have no access |
'disk_usage'=>integer, // the disk usage in bytes 'disk_quota'=>integer, // the disk quota in bytes } }
Definition at line 219 of file class.ilDiskQuotaChecker.php.
References $res, $row, and DB_FETCHMODE_ASSOC.
Referenced by ilObjFileAccessSettingsGUI\viewDiskQuotaReport().
|
static |
Gets the disk quota info for the specified user account.
Returns an associative array with information about the disk quota of this user account.
integer | user id |
"role_disk_quota"=>integer or positive infinity, // the disk quota specified by the role in bytes. // the disk quota is positive infinity if // the user has the system administrator role
"user_disk_quota"=>integer // the disk quota specified on the user account // form.
"disk_quota"=>integer or positive infinity // the disk quota which is in effect. This is // either role_quota or user_quota whichever // is higher.
"last_reminder"=>string or null // the SQL datetime the last time a disk quota // reminder was sent to the user }
Definition at line 70 of file class.ilDiskQuotaChecker.php.
References $res, $row, and DB_FETCHMODE_OBJECT.
Referenced by ilObjUserGUI\initForm().
|
static |
Gets the disk usage info for the specified user account.
Returns an associative array with information about the disk usage of this user account.
integer | user id |
'disk_usage'=>integer, // the disk usage in bytes
'details' array(array('type'=>string,'count'=>integer,'size'=>integer),...) // an associative array with the disk // usage in bytes for each object type
Definition at line 140 of file class.ilDiskQuotaChecker.php.
References $res, $row, and DB_FETCHMODE_OBJECT.
Referenced by _sendReminderMails(), ilObjUserGUI\initForm(), and ilDiskQuotaSummaryNotification\send().
|
static |
Returns the SQL datetime of the last update of the disk usage report.
Returns null, if the disk usage report has never been made.
Definition at line 667 of file class.ilDiskQuotaChecker.php.
References $res, $row, and DB_FETCHMODE_ASSOC.
Referenced by ilObjFileAccessSettingsGUI\viewDiskQuotaReport().
|
static |
Definition at line 680 of file class.ilDiskQuotaChecker.php.
References $res, $row, and DB_FETCHMODE_OBJECT.
Referenced by ilDiskQuotaHandler\getStatusLegend(), ilObjUserGUI\initForm(), and ilDiskQuotaHandler\isUploadPossible().
|
static |
Sends reminder e-mails to all users who have access and who have exceeded their disk quota and who haven't received a reminder mail in the past 7 days.
Definition at line 565 of file class.ilDiskQuotaChecker.php.
References $res, $row, _lookupDiskUsage(), and DB_FETCHMODE_ASSOC.
Referenced by ilDAVCronDiskQuota\run().
|
static |
Definition at line 545 of file class.ilDiskQuotaChecker.php.
References $ilSetting.
Referenced by ilDAVCronDiskQuota\run().
|
static |
Updates the disk usage info of all user accounts.
The result is stored in usr_pref of each user. The following keywords are used:
'disk_usage_last_update' - the unix timestamp of the last update. 'disk_usage.file' - the disk usage of file objects owned by the user.
Definition at line 332 of file class.ilDiskQuotaChecker.php.
References __updateDiskUsageReportOfType(), and __updateDiskUsageReportOfUsers().
Referenced by ilDAVCronDiskQuota\run().
ilDiskQuotaChecker::ilDiskQuotaChecker | ( | ) |
Definition at line 35 of file class.ilDiskQuotaChecker.php.