function tripal_get_user_quota
3.x tripal.quotas.api.inc | tripal_get_user_quota($uid) |
Retrieves the user's quote and default days to expire.
Parameters
$uid: The User ID.
Return value
An associative array containing the quota and default days to expire.
4 calls to tripal_get_user_quota()
- tripal_admin_edit_quota_form in tripal/
includes/ tripal.admin_files.inc - Edit an existing users' quota and/or expiration date
- tripal_file_upload in tripal/
includes/ tripal.upload.inc - tripal_reset_file_expiration in tripal/
api/ tripal.quotas.api.inc - Resets the expiration data of a file managed by Tripal.
- tripal_user_files_page in tripal/
includes/ tripal.user.inc - Provides the page with a list of files uploaded by the user.
File
- tripal/
api/ tripal.quotas.api.inc, line 13
Code
function tripal_get_user_quota($uid) {
$quota = db_select('tripal_custom_quota', 'tgcq')->fields('tgcq', [
'custom_quota'
'custom_expiration'
])
->condition('uid', $uid)
->execute()
->fetchObject();
if (! $quota) {
$quota = new stdClass();
$quota->custom_quota = variable_get('tripal_default_file_quota', pow(20, 6));
$quota->custom_expiration = variable_get('tripal_default_file_expiration', '60');
}
return $quota;
}