Account::getCurrentUser PHP Method

getCurrentUser() private method

Called by the constructor and any time the user updates his/her user account.
private getCurrentUser ( $accountID )
    private function getCurrentUser($accountID)
    {
        if ($accountID == "anonymousAdmin") {
            $accountID = 1;
            $this->isAnonymousAdmin = true;
            $_SESSION["account_id"] = 1;
        } else {
            if ($accountID == "anonymousUser") {
                $this->isAnonymousUser = true;
                // anon users don't have an entry in the accounts table, so we populate the available plugins by pulling
                // the full list of available plugins right from Settings
                $this->selectedDataTypes = explode(",", Settings::getSetting("installedDataTypes"));
                $this->selectedExportTypes = explode(",", Settings::getSetting("installedExportTypes"));
                $this->selectedCountries = explode(",", Settings::getSetting("installedCountries"));
            }
        }
        if (is_numeric($accountID)) {
            $prefix = Core::getDbTablePrefix();
            $response = Core::$db->query("\n\t\t\t\tSELECT * \n\t\t\t\tFROM {$prefix}user_accounts\n\t\t\t\tWHERE account_id = {$accountID}\n\t\t\t");
            if ($response["success"]) {
                $accountInfo = mysqli_fetch_assoc($response["results"]);
                $this->accountID = $accountInfo["account_id"];
                $this->accountType = $accountInfo["account_type"];
                $this->dateCreated = date("U", strtotime($accountInfo["date_created"]));
                $this->lastUpdated = date("U", strtotime($accountInfo["last_updated"]));
                $this->dateExpires = date("U", strtotime($accountInfo["date_expires"]));
                $this->firstName = $accountInfo["first_name"];
                $this->lastName = $accountInfo["last_name"];
                $this->email = $accountInfo["email"];
                $this->selectedDataTypes = explode(",", $accountInfo["selected_data_types"]);
                $this->selectedExportTypes = explode(",", $accountInfo["selected_export_types"]);
                $this->selectedCountries = explode(",", $accountInfo["selected_countries"]);
                $this->getConfigurations();
                $this->numRowsGenerated = $accountInfo["num_rows_generated"];
            }
        }
    }