<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
* Create UF Match, Note that thsi function is here in it's simplest form @ the moment
*
*
- * @param array $params input parameters
+ * @param array $params
+ * Input parameters.
*/
/**
* @param array $params
*
* @return CRM_Core_DAO_UFMatch
*/
- static function create($params) {
+ public static function create($params) {
$hook = empty($params['id']) ? 'create' : 'edit';
CRM_Utils_Hook::pre($hook, 'UFMatch', CRM_Utils_Array::value('id', $params), $params);
if(empty($params['domain_id'])) {
* object for this user. If the user has new values, we need
* to update the CRM DB with the new values
*
- * @param Object $user the drupal user object
- * @param boolean $update has the user object been edited
+ * @param Object $user
+ * The drupal user object.
+ * @param bool $update
+ * Has the user object been edited.
* @param $uf
*
* @param $ctype
* @param bool $isLogin
*
* @return void
- * @access public
* @static
*/
- static function synchronize(&$user, $update, $uf, $ctype, $isLogin = FALSE) {
+ public static function synchronize(&$user, $update, $uf, $ctype, $isLogin = FALSE) {
$userSystem = CRM_Core_Config::singleton()->userSystem;
$session = CRM_Core_Session::singleton();
if (!is_object($session)) {
* 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)) {
}
/**
- * update the uf_name in the user object
+ * 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;
}
/**
* 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);
/**
* 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;
}
/**
- * get the contact_id given a uf_id
+ * 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;
}
}
/**
- * get the uf_id given a contact_id
+ * 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;
}
/**
* @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;
}
/**
- * get the list of contact_id
+ * Get the list of contact_id
*
*
* @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();
}
/**
- * see if this user exists, and if so, if they're allowed to login
+ * See if this user exists, and if so, if they're allowed to login
*
*
- * @param $openId
+ * @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;
}
/**
- * get the next unused uf_id value, since the standalone UF doesn't
+ * Get the next unused uf_id value, since the standalone UF doesn't
* have id's (it uses OpenIDs, which go in a different field)
*
*
* @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()) {
*
* @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)) {
/**
* 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();
return $ufValues[$ufID];
}
}
-