/** * Retrieve the value of a specific configuration Key name * * @param string $key The name of the Key * * @return string */ public function getConfigValue($key) { if (!$this->config) { $this->getConfig(); } $config = $this->config->getTableKeyValuePair(0); return $config[$key]; }
/** * Authenticate a uniquely matched user. * * As long as there is exactly one match *and* that match * has a valid User Account, go ahead and process * authentication for them. * * @return MinistryPlatform\Blackpulp\User */ public function getUserAndAuthenticate() { if ($this->getNumberOfMatches() === 1) { $user_data = $this->matches->getTable(0); if (isset($user_data['User_GUID']) && $user_data['User_GUID'] > 0) { return $this->mp->authenticateGuid($user_data['User_GUID']); } else { throw new MinistryPlatformException("The matched contact has no User Account."); } } else { throw new MinistryPlatformException("A single user was not returned. " . "Review the getMatches() method to determine your next steps."); } }