Skip to content

Commit

Permalink
Merge pull request #517 from zelgerj/master
Browse files Browse the repository at this point in the history
fixed setup script for sudo user
  • Loading branch information
zelgerj committed Feb 12, 2015
2 parents 8100a4c + 9a53da4 commit b3718e9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
// check if server.php -s is called for doing setup process
if (array_key_exists($setup, $arguments)) {
try {

// get setup mode from arguments
$setupMode = $arguments[$setup];
// init user and group vars
Expand All @@ -147,8 +146,13 @@

// prepares everything for developer mode
case 'dev':
// get current user to set permissions for
// set current user
$user = get_current_user();
// check if script is called via sudo
if (array_key_exists('SUDO_USER', $_SERVER)) {
// set current sudo user
$user = $_SERVER['SUDO_USER'];
}
// get defined group from configuration
$group = $server->getSystemConfiguration()->getParam('group');
// replace user in configuration file
Expand Down

0 comments on commit b3718e9

Please sign in to comment.