$mainUfId = CRM_Core_BAO_UFMatch::getUFId($this->_cid);
$mainUser = NULL;
if ($mainUfId) {
- // d6 compatible
- if ($config->userSystem->is_drupal == '1') {
- $mainUser = user_load($mainUfId);
- }
- elseif ($config->userFramework == 'Joomla') {
- $mainUser = JFactory::getUser($mainUfId);
- }
-
+ $mainUser = $config->userSystem->getUser($this->_cid);
$this->assign('mainUfId', $mainUfId);
- $this->assign('mainUfName', $mainUser ? $mainUser->name : NULL);
+ $this->assign('mainUfName', $mainUser ? $mainUser['name'] : NULL);
}
$flipParams = array_merge($urlParams, ['action' => 'update', 'cid' => $this->_oid, 'oid' => $this->_cid]);
if (!$flip) {
$otherUser = NULL;
if ($otherUfId) {
- // d6 compatible
- if ($config->userSystem->is_drupal == '1') {
- $otherUser = user_load($otherUfId);
- }
- elseif ($config->userFramework == 'Joomla') {
- $otherUser = JFactory::getUser($otherUfId);
- }
-
+ $otherUser = $config->userSystem->getUser($this->_oid);
$this->assign('otherUfId', $otherUfId);
- $this->assign('otherUfName', $otherUser ? $otherUser->name : NULL);
+ $this->assign('otherUfName', $otherUser ? $otherUser['name'] : NULL);
}
$cmsUser = ($mainUfId && $otherUfId) ? TRUE : FALSE;
return $modules;
}
+ /**
+ * @inheritDoc
+ */
+ public function getUser($contactID) {
+ $user_details = parent::getUser($contactID);
+ $user_details['name'] = $user_details['name']->value;
+ $user_details['email'] = $user_details['email']->value;
+ return $user_details;
+ }
+
/**
* @inheritDoc
*/
return $this->getUniqueIdentifierFromUserObject($user);
}
+ /**
+ * @inheritDoc
+ */
+ public function getUser($contactID) {
+ $user_details = parent::getUser($contactID);
+ $user = JFactory::getUser($user_details['id']);
+ $user_details['name'] = $user->name;
+ return $user_details;
+ }
+
/**
* @inheritDoc
*/