function hosting_quota_set_limit in Hosting 6.2
Same name and namespace in other branches
- 7.4 quota/hosting_quota.module \hosting_quota_set_limit()
- 7.3 quota/hosting_quota.module \hosting_quota_set_limit()
Set the hosting quota for a given resource.
Parameters
$client: The nid of the client node.
$resource: The machine name of the resource.
$value: The new value for the resource.
2 calls to hosting_quota_set_limit()
- hosting_quota_admin_defaults_form_submit in quota/
hosting_quota.admin.inc - Submit function for hosting_quota_admin_defaults_form
- hosting_quota_nodeapi in quota/
hosting_quota.module - Implements hook_nodeapi().
File
- quota/
hosting_quota.module, line 151 - Implement quota's for the resource used by client.
Code
function hosting_quota_set_limit($client, $resource, $value) {
if (db_result(db_query("SELECT COUNT(*) FROM {hosting_client_quota} WHERE client = %d AND resource = '%s'", $client, $resource))) {
db_query("UPDATE {hosting_client_quota} SET value = '%s' WHERE client = %d AND resource = '%s'", $value, $client, $resource);
}
else {
db_query("INSERT INTO {hosting_client_quota} (client, resource, value) VALUES (%d, '%s', '%s')", $client, $resource, $value);
}
}