Skip to content

Commit

Permalink
Do not check whether we are a super user
Browse files Browse the repository at this point in the history
refs #7163
  • Loading branch information
Johannes Meyer committed Nov 7, 2014
1 parent f1b6a82 commit 004ac04
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions application/clicommands/SetupCommand.php
Expand Up @@ -47,11 +47,6 @@ public function showTokenAction()
*/
public function generateTokenAction()
{
if (false === $this->isSuperUser()) {
$this->fail($this->translate('This action needs to be run as super user in order to work properly!'));
return false;
}

$token = bin2hex(openssl_random_pseudo_bytes(8));
$filepath = $this->app->getConfigDir() . '/setup.token';

Expand Down Expand Up @@ -89,11 +84,6 @@ public function generateTokenAction()
*/
public function createConfigDirectoryAction()
{
if (false === $this->isSuperUser()) {
$this->fail($this->translate('This action needs to be run as super user in order to work properly!'));
return false;
}

$group = $this->params->getStandalone();
if ($group === null) {
$this->fail($this->translate('The `group\' argument is mandatory.'));
Expand All @@ -119,14 +109,4 @@ public function createConfigDirectoryAction()

printf($this->translate("Successfully created configuration directory at: %s\n"), $path);
}

/**
* Return whether the current user is a super user
*
* @return bool
*/
protected function isSuperUser()
{
return intval(shell_exec('echo $EUID')) === 0;
}
}

0 comments on commit 004ac04

Please sign in to comment.