You are here

function hosting_site_quota_exceeded in Hostmaster (Aegir) 6

Check for quotas and return an appropriate error message to the site creation form

1 call to hosting_site_quota_exceeded()
hosting_site_validate in modules/hosting/site/hosting_site.form.inc
Implements hook_validate().
1 string reference to 'hosting_site_quota_exceeded'
hosting_site_validate in modules/hosting/site/hosting_site.form.inc
Implements hook_validate().

File

modules/hosting/site/hosting_site.quota.inc, line 37

Code

function hosting_site_quota_exceeded($node = array()) {
  $client = node_load($node['client']);
  $usage = hosting_site_hosting_quota_get_usage($node['client'], 'sites');
  $limit = $client->quota['sites']['limit'];
  if ($usage >= $limit && !empty($limit)) {
    return t('@client has reached their site quota of @sites. No new sites can be added unless an existing site is deleted or the site quota is increased.', array(
      '@client' => $client->title,
      '@sites' => $limit,
    ));
  }
  return FALSE;
}