You are here

function hosting_site_quota_exceeded in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 site/hosting_site.quota.inc \hosting_site_quota_exceeded()
  2. 7.3 site/hosting_site.quota.inc \hosting_site_quota_exceeded()

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 site/hosting_site.form.inc
Implements hook_validate().
1 string reference to 'hosting_site_quota_exceeded'
hosting_site_validate in site/hosting_site.form.inc
Implements hook_validate().

File

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;
}