You are here

function _hosting_user_requirements in Hosting 5

File

./hosting_help.inc, line 376
Hosting help subsystem

Code

function _hosting_user_requirements() {
  $username = HOSTING_DEFAULT_SCRIPT_USER;
  $path = HOSTING_DEFAULT_DOCROOT_PATH;
  $add_cmd = <<<EOF
    sudo adduser {<span class="php-variable">$username</span>}
EOF;
  $chmod_cmd = <<<EOF
    sudo chown -R {<span class="php-variable">$username</span>} {<span class="php-variable">$path</span>}
EOF;
  $help['title'] = t('A separate system account for the scripts');
  $help['summary'] = t('The provision framework requires that the scripts run as a non-root system account, to ensure that
    it can correctly set the file permissions on the hosted files. All existing files need to be changed to belong to this
    new system account.');
  $help['suggestion'] = t('Based on your server configuration, we have determined that your user account should be <code>@script_user</code>', array(
    '@script_user' => HOSTING_DEFAULT_SCRIPT_USER,
  ));
  $help['configuration'][] = t('If your system supports it, run the adduser command (if this command is unavailable, please consult your operating system documentation on how to add new system accounts) : <pre>@cmd</pre>', array(
    '@cmd' => $add_cmd,
  ));
  $help['configuration'][] = t('Once you have created the user account, you need to modify the ownership of the files. Use the following command : <pre>@cmd</pre>', array(
    '@cmd' => $chmod_cmd,
  ));
  return $help;
}