You are here

function hosting_client_user in Hosting 6.2

Same name and namespace in other branches
  1. 5 client/hosting_client.access.inc \hosting_client_user()

Implements hook_user().

1 string reference to 'hosting_client_user'
hosting_client_update_6001 in client/hosting_client.install
Use VARCHAR on contact_type field so that we support MariaDB correctly.

File

client/hosting_client.access.inc, line 10
Control client node access.

Code

function hosting_client_user($op, &$edit, &$user, $category = NULL) {
  switch ($op) {
    case 'load':
      $user->client_id = hosting_get_client_from_user($user->uid);
      break;
    case 'view':
      if (hosting_feature('client')) {
        return hosting_client_user_view($user);
      }
      break;
    case 'form':
      if (hosting_feature('client')) {
        return hosting_client_user_form($edit, $user, $category);
      }
      break;
    case 'validate':
      return hosting_client_user_form_validate($edit);
    case 'insert':
    case 'update':
      hosting_client_user_form_submit($edit, $user);
      $edit['hosting_client'] = NULL;
      break;
    case 'submit':
      break;
    case 'delete':
      db_query('DELETE FROM {hosting_client_user} WHERE user = %d', $user->uid);
  }
}