function hosting_form_alter in Hostmaster (Aegir) 6
Implementation of hook_form_alter().
File
- modules/
hosting/ hosting.module, line 730 - Hosting module.
Code
function hosting_form_alter(&$form, &$form_state, $form_id) {
// Do not allow package or task nodes to be edited through the interface.
if ($form_id == 'package_node_form' || $form_id == 'task_node_form') {
drupal_access_denied();
exit;
}
// Alter the 'Add User' form to remind users that this is not the New Client form
if ($form_id == 'user_register') {
$form[user_registration_help] = array(
'#type' => 'item',
'#description' => t('<strong>Adding a system user account does not make the user a Client that can add sites.</strong><br />
To add a Client, enable the Client feature and then add a new Client node.<br />
If you wish, you may then assign this system user to the Client as an \'Allowed user\' to inherit the permissions to add sites.'),
'#weight' => '-10',
);
}
// Remove additional UI added by core modules, that conflict with the hosting UI.
$node_types = array(
'site',
'platform',
'server',
'client',
);
foreach ($node_types as $type) {
if ($form_id == $type . '_node_form') {
$form['options']['#access'] = FALSE;
$form['menu']['#access'] = FALSE;
$form['revision_information']['#access'] = FALSE;
$form['author']['#access'] = FALSE;
$form['comment_settings']['#access'] = FALSE;
// because these aren't really posts, 'preview' doesnt make sense in this context.
$form['buttons']['preview']['#access'] = FALSE;
}
}
}