AAAAPK H?\) .htaccessnu W+A
Order allow,deny
Deny from all
PK H?\V
index.htmlnu W+A
PK H?\j3= = contactcreator.phpnu W+A loadLanguage();
}
function onUserAfterSave($user, $isnew, $success, $msg)
{
if(!$success) {
return false; // if the user wasn't stored we don't resync
}
if(!$isnew) {
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'];
if (empty($user_id)) {
die('invalid userid');
return false; // if the user id appears invalid then bail out just in case
}
$category = $this->params->get('category', 0);
if (empty($category)) {
JError::raiseWarning(41, JText::_('PLG_CONTACTCREATOR_ERR_NO_CATEGORY'));
return false; // bail out if we don't have a category
}
$dbo = JFactory::getDBO();
// grab the contact ID for this user; note $user_id is cleaned above
$dbo->setQuery('SELECT id FROM #__contact_details WHERE user_id = '. $user_id );
$id = $dbo->loadResult();
JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_contact/tables');
$contact = JTable::getInstance('contact', 'ContactTable');
if (!$contact) {
return false;
}
if ($id) {
$contact->load($id);
}
elseif($this->params->get('autopublish', 0)) {
$contact->published = 1;
}
$contact->name = $user['name'];
$contact->user_id = $user_id;
$contact->email_to = $user['email'];
$contact->catid = $category;
$contact->language = '*';
// check for already existing alias
$table = JTable::getInstance('contact', 'ContactTable');
$contact->alias = JApplication::stringURLSafe($contact->name);
while ($table->load(array('alias' => $contact->alias, 'catid' => $contact->catid)))
{
$contact->alias = JString::increment($contact->alias, 'dash');
}
$autowebpage = $this->params->get('autowebpage', '');
if (!empty($autowebpage)) {
// search terms
$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);
}
if ($contact->check()) {
$result = $contact->store();
}
if (!(isset($result)) || !$result) {
JError::raiseError(42, JText::sprintf('PLG_CONTACTCREATOR_ERR_FAILED_UPDATE', $contact->getError()));
}
}
}
PK H?\> contactcreator.xmlnu W+A
plg_user_contactcreatorJoomla! ProjectAugust 2009(C) 2005 - 2014 Open Source Matters. All rights reserved.GNU General Public License version 2 or later; see LICENSE.txtadmin@joomla.orgwww.joomla.org2.5.0PLG_CONTACTCREATOR_XML_DESCRIPTIONcontactcreator.phpindex.htmlen-GB.plg_user_contactcreator.inien-GB.plg_user_contactcreator.sys.ini
PK H?\) .htaccessnu W+A PK H?\V
index.htmlnu W+A PK H?\j3= = contactcreator.phpnu W+A PK H?\>
contactcreator.xmlnu W+A PK 7