Example #1
0
 /**
  * Configures one setting
  * 
  * @access protected
  * @param string $path
  * @param string $value
  */
 protected function configureSetting($path, $value)
 {
     $newValue = $this->cliHelper->inputText('Please enter the value for "' . $path . '":', $value);
     if ($newValue === $value) {
         return;
     }
     $this->configurationManager->setSetting($path, $newValue);
 }
Example #2
0
 /**
  * Starts the work of the fork
  * 
  * @param integer $pid
  * @param callable $callback
  * @param \Zepi\Core\Utils\Entity\Task $task
  * @param \Zepi\Core\Utils\Entity\Process $oldProcess
  */
 protected function startFork($pid, $callback, Task $task, Process $oldProcess = null)
 {
     if ($pid === -1) {
         $this->cliHelper->writeTimeLine('Could not fork!');
         exit;
     } elseif ($pid) {
         $newProcess = new Process($task, $pid);
         $this->processes[$pid] = $newProcess;
         if ($callback !== null) {
             if ($oldProcess !== null) {
                 call_user_func($callback, $oldProcess, $newProcess);
             } else {
                 call_user_func($callback, $newProcess);
             }
         }
     } else {
         $this->executeTask($task);
     }
 }
Example #3
0
 /**
  * Execute the installation the access control module
  * 
  * @access public
  * @param \Zepi\Turbo\Framework $framework
  * @param \Zepi\Turbo\Request\CliRequest $request
  * @param \Zepi\Turbo\Response\Response $response
  */
 public function execute(Framework $framework, CliRequest $request, Response $response)
 {
     // Execute the installer only if there are no users
     $dataRequest = new \Zepi\DataSource\Core\Entity\DataRequest(1, 0, 'name', 'ASC');
     if ($this->userManager->count($dataRequest) > 0) {
         return;
     }
     $username = '';
     while ($username === '') {
         $username = trim($this->cliHelper->inputText('Please enter the username for the super-admin user:'******'';
     while ($password === '') {
         $password = trim($this->cliHelper->inputText('Please enter the password for the super-admin user:'******'', '', $username, '', array());
     $user->setNewPassword($password);
     // Save the super-admin user
     $user = $this->userManager->addUser($user);
     // Add the super-admin access level
     $this->accessControlManager->grantPermission($user->getUuid(), '\\Zepi\\Web\\AccessControl\\Entity\\User', '\\Global\\*', 'CLI');
 }