You are here

function _hosting_group_requirements in Hosting 5

File

./hosting_help.inc, line 395
Hosting help subsystem

Code

function _hosting_group_requirements() {
  $username = HOSTING_DEFAULT_SCRIPT_USER;
  $group = HOSTING_DEFAULT_WEB_GROUP;
  $vigr_cmd = <<<EOF
    sudo adduser {<span class="php-variable">$username</span>} {<span class="php-variable">$group</span>}
EOF;
  $vigr1 = <<<EOF
    {<span class="php-variable">$group</span>}::99:
EOF;
  $vigr2 = <<<EOF
    {<span class="php-variable">$group</span>}::99:{<span class="php-variable">$username</span>}
EOF;
  $vigr3 = <<<EOF
    {<span class="php-variable">$group</span>}::99:anotheruser,{<span class="php-variable">$username</span>}
EOF;
  $su = <<<EOF
    su -
EOF;
  $help['title'] = t('The system group of the web server');
  $help['summary'] = t('For the provision framework to be able to ensure that the file permissions of the
                          hosted sites are always as safe as can be, and especially to make sure that the web server does
                          not have the ability to modify the code of the site, the configured system account needs to be a member
                          of the web server group, in order to be able to correctly set the file permissions.');
  $help['suggestion'] = t('Based on your server configuration we have determined that you should add the
                        system account "<code>@username</code>" to the "<code>@group</code>" system group.', array(
    "@username" => $username,
    "@group" => $group,
  ));
  $help['configuration'] = t('If your system account is not a member of the web group, you can add them by using the
                          <code>adduser</code> command:
                          <pre>@vigr_cmd</pre>
                          If that command is not available, you will need to edit the /etc/group file directly with
                          your vigr or your favorite editor.
                          Find the line that says : <pre>@vigr1</pre>
                          Then add the username to the end of the line, so that it looks like : <pre>@vigr2</pre>
                          If there were already users in the group, add your user to the group using a comma as separator :
                          <pre>@vigr3</pre>
                          Once you have changed this, you will need to log out and log bag into your terminal session for this
                          setting to take effect. Alternatively you
                          can get a new login shell by typing :<pre>@su</pre>', array(
    '@vigr_cmd' => $vigr_cmd,
    '@vigr1' => $vigr1,
    '@vigr2' => $vigr2,
    '@vigr3' => $vigr3,
    '@su' => $su,
  ));
  return $help;
}