diff --git a/client/hosting_client.install b/client/hosting_client.install
index 882370d..81a2a20 100644
--- a/client/hosting_client.install
+++ b/client/hosting_client.install
@@ -35,6 +35,12 @@ function hosting_client_schema() {
         'not null' => TRUE,
         'default' => '',
       ),
+      'platforms' => array(
+        'type' => 'text',
+        'size' => big,
+        'not null' => FALSE,
+        'default' => '',
+      ),
     ),
     'primary key' => array('vid'),
   );
@@ -169,3 +175,12 @@ function hosting_client_update_7() {
   return array();
 }
 
+/**
+ * Add platforms column for restricted platforms per clients
+ */
+function hosting_client_update_6() {
+  $ret = array();
+  $ret[] = update_sql("ALTER TABLE {hosting_client} ADD platforms LONGTEXT");
+  return $ret;
+}
+
diff --git a/client/hosting_client.module b/client/hosting_client.module
index 4cb26ae..6e6c6ac 100644
--- a/client/hosting_client.module
+++ b/client/hosting_client.module
@@ -109,6 +109,7 @@ function hosting_get_client_by_email($email) {
  */
 function hosting_client_form(&$node) {
   $type = node_get_types('type', $node);
+  $platforms = _hosting_get_platforms();
 
   $form['title'] = array('#type' => 'hidden', '#value' => $node->title);
 
@@ -147,6 +148,18 @@ function hosting_client_form(&$node) {
     '#maxlength' => 100,
   );
 
+  $q = db_query("SELECT platforms FROM {hosting_client} WHERE nid = %d", $node->nid);
+  while ($result = db_fetch_array($q)) {
+    $allowed_platforms = $result['platforms'];
+  }
+  $allowed_platforms = explode(',', $allowed_platforms);
+  $form['platforms'] = array(
+    '#type' => 'checkboxes',
+    '#title' => 'Allowed platforms',
+    '#options' => $platforms,
+    '#default_value' => $allowed_platforms,
+  );
+
   if ($node->nid) {
     // this should probably be factored out in a common function
     $q = db_query("SELECT u.uid, u.name FROM {hosting_client_user} h INNER JOIN {users} u ON u.uid = h.user WHERE h.client = %d", $node->nid);
@@ -235,8 +248,15 @@ function hosting_client_set_title(&$node) {
  * Implementation of hook_insert().
  */
 function hosting_client_insert($node) {
-  db_query("INSERT INTO {hosting_client} (vid, nid, name, organization, email) VALUES (%d, %d, '%s', '%s', '%s' )",
-    $node->vid, $node->nid, $node->client_name, $node->organization, $node->email);
+  $element = $node->platforms;
+  foreach ($element as $key => $choice) {
+    if (isset($element[$key]) && $element[$key] != 0) {
+      $platform[] = $element[$key];
+    }
+  }
+  $allowed_platforms = @implode(',', $platform);
+  db_query("INSERT INTO {hosting_client} (vid, nid, name, organization, email) VALUES (%d, %d, '%s', '%s', '%s', '%s' )",
+    $node->vid, $node->nid, $node->client_name, $node->organization, $node->email, $allowed_platforms);
   hosting_client_set_title($node);
   if (variable_get('hosting_client_register_user', FALSE) 
     && !user_load(array('mail' => $node->email))) {
@@ -310,8 +330,15 @@ function hosting_client_update($node) {
     hosting_client_insert($node);
   }
   else {
-    db_query("UPDATE {hosting_client} SET nid=%d, name = '%s', organization = '%s', email='%s' WHERE vid=%d",
-              $node->nid, $node->client_name, $node->organization, $node->email, $node->vid);
+    $element = $node->platforms;
+    foreach ($element as $key => $choice) {
+      if (isset($element[$key]) && $element[$key] != 0) {
+        $platform[] = $element[$key];
+      }
+    }
+    $allowed_platforms = @implode(',', $platform);
+    db_query("UPDATE {hosting_client} SET nid=%d, name = '%s', organization = '%s', email='%s', platforms='%s' WHERE vid=%d",
+              $node->nid, $node->client_name, $node->organization, $node->email, $allowed_platforms, $node->vid);
   }
   hosting_client_set_title($node);  
   if ($node->users) {
diff --git a/site/hosting_site.module b/site/hosting_site.module
index e580937..7adc63a 100644
--- a/site/hosting_site.module
+++ b/site/hosting_site.module
@@ -373,6 +373,11 @@ function hosting_site_validate($node, &$form) {
     if (!user_access('administer clients') && !array_key_exists($client->nid, hosting_get_client_from_user($user->uid))) {
       form_set_error('client', t('Access denied to client @client', array('@client' => $client->title)));
     }
+    $platforms = db_result(db_query("SELECT platforms FROM {hosting_client} WHERE nid = %d", $client->nid));
+    $platforms = explode(",", $platforms);
+    if (!in_array($node->platform, $platforms)) {
+      form_set_error('client', t('This client cannot create a site on this platform'));
+    }
   }
   if (!array_key_exists($node->profile, hosting_get_profiles($node->platform))) {
     form_set_error('profile', t('Please fill in a valid profile'));
