-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevudo_hosting.module
More file actions
42 lines (33 loc) · 1.28 KB
/
devudo_hosting.module
File metadata and controls
42 lines (33 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
include('devudo_hosting.forms.inc');
function devudo_hosting_nodeapi(&$node, $op){
if ($op == 'load' && $node->type == 'task') {
}
}
/**
* Implements hook_hosting_site_context_options()
*
* This passes info about the client to the $task object,
* so that hook_post_hosting_install_task() gets it.
*/
function devudo_hosting_hosting_site_context_options(&$task) {
drush_log('[DEVUDO] devudo_hosting_hosting_site_context_options() invoked.');
// From hosting_hosting_platform_context_options().
$client = node_load($task->ref->client);
$task->context_options['client'] = $client;
drush_log('[DEVUDO] Client: ' .$client->title);
}
/**
* Implements hook_post_hosting_install_task()
*/
function devudo_hosting_post_hosting_install_task($task, $data){
// @TODO: Verify installation of devmaster profile
drush_log('[DEVUDO] devudo_hosting_post_hosting_install_task() invoked.');
// Create the server user!
$client_name = $task->context_options['client_name'];
drush_log("[DEVUDO] Running 'sudo devudo-create-user $client_name'");
// Execute our "Create User" script.
drush_shell_exec("sudo devudo-create-user $client_name");
drush_log('[DEVUDO] Output: ' . implode("\n", drush_shell_exec_output()));
drush_log("[DEVUDO] Client user account created: $client_name");
}