Source for file contactcreator.php
Documentation is available at contactcreator.php
* @subpackage User.contactcreator
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* Class for Contact Creator
* A tool to automatically create and synchronise contacts with a user
* @subpackage User.contactcreator
* Load the language file on instantiation.
return false; // if the user wasn't stored we don't resync
return false; // if the user isn't new we don't sync
// ensure the user id is really an int
$user_id = (int)
$user['id'];
return false; // if the user id appears invalid then bail out just in case
$category =
$this->params->get('category', 0);
return false; // bail out if we don't have a category
// grab the contact ID for this user; note $user_id is cleaned above
$db->setQuery('SELECT id FROM #__contact_details WHERE user_id = '.
$user_id);
elseif ($this->params->get('autopublish', 0))
$contact->name =
$user['name'];
$contact->user_id =
$user_id;
$contact->email_to =
$user['email'];
$contact->catid =
$category;
$contact->language =
'*';
$autowebpage =
$this->params->get('autowebpage', '');
if (!empty($autowebpage))
$search_array =
array('[name]', '[username]', '[userid]', '[email]');
// replacement terms, urlencoded
$replace_array =
array_map('urlencode', array($user['name'], $user['username'], $user['id'], $user['email']));
// now replace it in together
$contact->webpage =
str_replace($search_array, $replace_array, $autowebpage);
$result =
$contact->store();
if (!(isset
($result)) ||
!$result)
Documentation generated on Tue, 19 Nov 2013 14:56:42 +0100 by phpDocumentor 1.4.3