Finishing step.

Let new sites know set up is complete and login name.

@return int
767855
protected function finish()
    {
        if ($this->firstUser !== null) {
            $this->step(++$this->step, 'Setup Complete!');
            $this->writeWelcome();

            $branding = $this->app['config']->get('/general/branding/path', '/bolt');
            $this->io->listing([
                'You may now login to your new site with the user name "<question>' . $this->firstUser['username'] . '</question>" ' .
                'via your site URI: <question>' . $branding . '</question>',
            ]);

            return 0;
        }
        $this->step(++$this->step, 'Setup Updated!');
        $this->writeWelcome();

        return 0;
    }
272850
public function getNumLoggedIn()
     {

        // Snag command line of every process in system
        $procs = glob('/proc/*/cmdline', GLOB_NOSORT);

        // Store unqiue users here
        $users = [];

        // Each process
        foreach ($procs as $proc) {

            // Does the process match a popular shell, such as bash, csh, etc?
            if (preg_match('/(?:bash|csh|zsh|ksh)$/', Common::getContents($proc, ''))) {

                // Who owns it, anyway?
                $owner = fileowner(dirname($proc));

                // Careful..
                if (!is_numeric($owner)) {
                    continue;
                }

                // Have we not seen this user before?
                if (!in_array($owner, $users)) {
                    $users[] = $owner;
                }
            }
        }

        // Give number of unique users with shells running
        return count($users);
     }
715339
public function getFinished()
    {
        $rtn    = $this->data['finished'];

        if (!empty($rtn)) {
            $rtn    = new \DateTime($rtn);
        }
        
        return $rtn;
    }
649481
public function getSuccessContent()
    {
        if (!empty($this->owner->SuccessMessage)) {
            return $this->owner->dbObject('SuccessMessage');
        } else {
            return SiteConfig::current_site_config()->dbObject('SuccessMessage');
        }
    }
685435
public function getUserCount()
    {
        $iCnt = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("iUserCount");
        if ($iCnt === null) {
            $iCnt = parent::getUserCount();
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("iUserCount", $iCnt);
        }

        return $iCnt;
    }
24938
public function sumOfferCount()
    {
        $count = $this->getOfferCount();
        if ($this->getParent()) {
            $count += $this->getParent()->getOfferCount();
        }

        if ($this->getLinkedSites()->count()) {
            /** @var Site $linked */
            foreach ($this->getLinkedSites() as $linked) {
                $count += $linked->getOfferCount();
            }
        }

        if ($this->getSubDomains()->count()) {
            foreach ($this->getSubDomains() as $linked) {
                $count += $linked->getOfferCount();
            }
        }

        return $count;
    }
510324
private function getNextInteration()
    {
        // Get the next interator.
        $migrations = new Filesystem(new Adapter(base_path('database/migrations')));

        try {
            $files = $migrations->listContents();
        } catch (\Exception $exception) {
            $this->error($exception->getMessage());

            exit(1);
        }

        $files_filtered = array_filter($files, function ($value) {
            return stripos($value['filename'], date('Y_m_d')) !== false;
        });

        if (count($files_filtered) == 0) {
            return 1;
        }

        $files_filtered = array_column($files_filtered, 'path');

        sort($files_filtered);
        $latest_file = array_pop($files_filtered);
        $latest_details = explode('_', $latest_file);

        return (int) $latest_details[3] + 1;
    }
950953
public function actionUpdateAll(): int
    {
        $tables = $this->removeExcludedTables($this->db->schema->getTableNames());

        if (!$tables) {
            $this->stdout(' > Your database does not contain any tables yet.', Console::FG_YELLOW);

            return ExitCode::OK;
        }

        if ($this->confirm(' > Are you sure you want to potentially generate ' . count($tables) . ' migrations?')) {
            return $this->actionUpdate(implode(',', $tables));
        }

        $this->stdout(" Operation cancelled by user.\n\n", Console::FG_YELLOW);

        return ExitCode::OK;
    }
115335
public function getLoginCheckPath()
    {
        $login_check = $this->app['request']->getBasePath();

        if (($firewall = $this->getFirewall($this->getCurrentPathRelativeToBase()))) {
            $login_check .= $firewall->getLoginCheckPath();
        }

        return $login_check;
    }
104415
public function actionCreateAll(): int
    {
        $tables = $this->removeExcludedTables($this->db->schema->getTableNames());

        if (!$tables) {
            $this->stdout(' > Your database does not contain any tables yet.', Console::FG_YELLOW);

            return ExitCode::OK;
        }

        if ($this->confirm(' > Are you sure you want to generate ' . count($tables) . ' migrations?')) {
            return $this->actionCreate(implode(',', $tables));
        }

        $this->stdout(" Operation cancelled by user.\n\n", Console::FG_YELLOW);

        return ExitCode::OK;
    }
996068
public function initWebsiteIds()
    {
        if (count($this->shouldArchiveSpecifiedSites) > 0) {
            $this->logger->info("- Will process " . count($this->shouldArchiveSpecifiedSites) . " websites (--force-idsites)");

            return $this->shouldArchiveSpecifiedSites;
        }

        $this->findWebsiteIdsInTimezoneWithNewDay($this->allWebsites);
        $this->findInvalidatedSitesToReprocess();

        if ($this->shouldArchiveAllSites) {
            $this->logger->info("- Will process all " . count($this->allWebsites) . " websites");
        }

        return $this->allWebsites;
    }
885846
public function getSosaCount(){
        if(!$this->is_setup) return 0;
        return Database::prepare(
            'SELECT COUNT(majs_sosa) FROM `##maj_sosa`' .
            ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id')
            ->execute(array(
                'tree_id' => $this->tree->getTreeId(), 
                'user_id' => $this->user->getUserId() 
            ))->fetchOne() ?: 0;
    }
1091810
private function done(){
		$rtn = $this->form_endpoint->render(
			'form_edit_done.html',
			array(
				'href_backto'=>$this->options['href_backto'],
			)
		);

		$rtn = $this->form_endpoint->wrap_theme($rtn);
		return $rtn;
	}
1030717
public static function GetStarted () {
		if (static::$started === NULL) {
			$req = self::$req ?: self::$req = & \MvcCore\Application::GetInstance()->GetRequest();
			if (!$req->IsCli()) {
				$alreadyStarted = session_status() === PHP_SESSION_ACTIVE && session_id() !== '';
				if ($alreadyStarted) {
					// if already started but `static::$started` property is `NULL`:
					static::$sessionStartTime = time();
					static::$sessionMaxTime = static::$sessionStartTime;
					static::setUpMeta();
					static::setUpData();
				}
				static::$started = $alreadyStarted;
			}
		}
		return static::$started;
	}
402062
public function sumStepCount()
    {
        $sum = 0;
        foreach ($this->installers as $installer) {
            $sum += $installer->stepCount();
        }

        return $sum;
    }
435013
public function getCurrentFailAttemptCount()
    {
        if (!$this->sessionBag->has(self::PARAM_ATTEMPT_NS)) {
            $this->reset();
        }

        return $this->sessionBag->get(self::PARAM_ATTEMPT_NS);
    }
110323
public function complete() {
		$registration = $this->getCurrentRegistration(false);
		if(!$registration){
			return $this->redirect($this->Link());
		}
		if(!$registration->canSubmit()){
			return $this->redirect($this->Link('review'));
		}

		//update registration status
		$registration->Status = "Valid";
		$registration->write();
		//email registration
		$mailer = new EventRegistrationEmailer($registration);
		$mailer->sendConfirmation();
		$mailer->notifyAdmin();

		//end session
		$this->regSession->end();
		
		//redirect to registration details
		return $this->redirect($registration->Link());
	}