X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FUFMatch.php;h=0e8d7ed47c9d98083fd19dd62cde40b06867695d;hb=a13f3d8c01e114b11c381b6ac3e64becae9380b1;hp=36a0dcdb938c6f4e3933cf3968175c9bdade809f;hpb=87d422669cee2e65706fe72821613ad846cd0adb;p=civicrm-core.git diff --git a/CRM/Core/BAO/UFMatch.php b/CRM/Core/BAO/UFMatch.php index 36a0dcdb93..0e8d7ed47c 100644 --- a/CRM/Core/BAO/UFMatch.php +++ b/CRM/Core/BAO/UFMatch.php @@ -1,7 +1,7 @@ userSystem; $session = CRM_Core_Session::singleton(); if (!is_object($session)) { @@ -172,20 +174,24 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch { * Synchronize the object with the UF Match entry. Can be called stand-alone from * the drupalUsers script * - * @param Object $user the drupal user object - * @param string $userKey the id of the user from the uf object - * @param string $uniqId the OpenID of the user - * @param string $uf the name of the user framework - * @param integer $status returns the status if user created or already exits (used for CMS sync) + * @param Object $user + * The drupal user object. + * @param string $userKey + * The id of the user from the uf object. + * @param string $uniqId + * The OpenID of the user. + * @param string $uf + * The name of the user framework. + * @param int $status + * Returns the status if user created or already exits (used for CMS sync). * * @param null $ctype * @param bool $isLogin * * @return the ufmatch object that was found or created - * @access public * @static */ - static function &synchronizeUFMatch(&$user, $userKey, $uniqId, $uf, $status = NULL, $ctype = NULL, $isLogin = FALSE) { + public static function &synchronizeUFMatch(&$user, $userKey, $uniqId, $uf, $status = NULL, $ctype = NULL, $isLogin = FALSE) { $config = CRM_Core_Config::singleton(); if (!CRM_Utils_Rule::email($uniqId)) { @@ -359,13 +365,13 @@ AND domain_id = %4 /** * Update the uf_name in the user object * - * @param int $contactId id of the contact to update + * @param int $contactId + * Id of the contact to update. * * @return void - * @access public * @static */ - static function updateUFName($contactId) { + public static function updateUFName($contactId) { if (!$contactId) { return; } @@ -413,14 +419,15 @@ AND domain_id = %4 /** * Update the email value for the contact and user profile * - * @param $contactId Int Contact ID of the user - * @param $emailAddress email to be modified for the user + * @param $contactId + * Int Contact ID of the user. + * @param $emailAddress + * Email to be modified for the user. * * @return void - * @access public * @static */ - static function updateContactEmail($contactId, $emailAddress) { + public static function updateContactEmail($contactId, $emailAddress) { $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower'; $emailAddress = $strtolower($emailAddress); @@ -469,13 +476,13 @@ AND domain_id = %4 /** * Delete the object records that are associated with this cms user * - * @param int $ufID id of the user to delete + * @param int $ufID + * Id of the user to delete. * * @return void - * @access public * @static */ - static function deleteUser($ufID) { + public static function deleteUser($ufID) { $ufmatch = new CRM_Core_DAO_UFMatch(); $ufmatch->uf_id = $ufID; @@ -486,13 +493,13 @@ AND domain_id = %4 /** * Get the contact_id given a uf_id * - * @param int $ufID Id of UF for which related contact_id is required + * @param int $ufID + * Id of UF for which related contact_id is required. * * @return int contact_id on success, null otherwise - * @access public * @static */ - static function getContactId($ufID) { + public static function getContactId($ufID) { if (!isset($ufID)) { return NULL; } @@ -510,13 +517,13 @@ AND domain_id = %4 /** * Get the uf_id given a contact_id * - * @param int $contactID ID of the contact for which related uf_id is required + * @param int $contactID + * ID of the contact for which related uf_id is required. * * @return int uf_id of the given contact_id on success, null otherwise - * @access public * @static */ - static function getUFId($contactID) { + public static function getUFId($contactID) { if (!isset($contactID)) { return NULL; } @@ -534,7 +541,7 @@ AND domain_id = %4 /** * @return bool */ - static function isEmptyTable() { + public static function isEmptyTable() { $sql = "SELECT count(id) FROM civicrm_uf_match"; return CRM_Core_DAO::singleValueQuery($sql) > 0 ? FALSE : TRUE; } @@ -544,10 +551,9 @@ AND domain_id = %4 * * * @return int contact_id on success, null otherwise - * @access public * @static */ - static function getContactIDs() { + public static function getContactIDs() { $id = array(); $dao = new CRM_Core_DAO_UFMatch(); $dao->find(); @@ -564,10 +570,9 @@ AND domain_id = %4 * @param int $openId * * @return bool true if allowed to login, false otherwise - * @access public * @static */ - static function getAllowedToLogin($openId) { + public static function getAllowedToLogin($openId) { $ufmatch = new CRM_Core_DAO_UFMatch(); $ufmatch->uf_name = $openId; $ufmatch->allowed_to_login = 1; @@ -583,10 +588,9 @@ AND domain_id = %4 * * * @return int next highest unused value for uf_id - * @access public * @static */ - static function getNextUfIdValue() { + public static function getNextUfIdValue() { $query = "SELECT MAX(uf_id)+1 AS next_uf_id FROM civicrm_uf_match"; $dao = CRM_Core_DAO::executeQuery($query); if ($dao->fetch()) { @@ -604,7 +608,7 @@ AND domain_id = %4 * * @return bool */ - static function isDuplicateUser($email) { + public static function isDuplicateUser($email) { $session = CRM_Core_Session::singleton(); $contactID = $session->get('userID'); if (!empty($email) && isset($contactID)) { @@ -620,14 +624,15 @@ AND domain_id = %4 /** * Get uf match values for given uf id or logged in user. * - * @param int $ufID uf id. + * @param int $ufID + * Uf id. * * return array $ufValues uf values. - ** + * * * * @return array */ - static function getUFValues($ufID = NULL) { + public static function getUFValues($ufID = NULL) { if (!$ufID) { //get logged in user uf id. $ufID = CRM_Utils_System::getLoggedInUfID(); @@ -653,4 +658,3 @@ AND domain_id = %4 return $ufValues[$ufID]; } } -