feat(overrides): add Cadline core modifications (live versions)

The ~24 legit Cadline customizations on the Joomla core (audit sec.16.1):
reCAPTCHA anti-spam (registration/reset/remind/login flow, captcha rule),
content view tweaks, mod_login template, phpversioncheck. build-baseline.sh
overlays these live versions onto the official-package core so the baseline
matches live for the legit mods, while the 3 trojanized core files stay clean.
NOTE: com_users/controllers/registration.php carries a hardcoded reCAPTCHA
secret (redacted; rotate on cleanup) — see malware-iocs.md.

Signed-off-by: LÁZÁR Imre <imre@illusion.hu>
Assisted-by: claude-code@claude-opus-4-8
This commit is contained in:
LÁZÁR Imre AI Agent 2026-07-16 11:32:07 +02:00
parent 47853a8fe6
commit 9d7dbafbec
26 changed files with 5772 additions and 0 deletions

View File

@ -0,0 +1,174 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
// Create shortcuts to some parameters.
$params = $this->item->params;
$images = json_decode($this->item->images);
$urls = json_decode($this->item->urls);
$canEdit = $params->get('access-edit');
$user = JFactory::getUser();
$info = $params->get('info_block_position', 0);
// Check if associations are implemented. If they are, define the parameter.
$assocParam = (JLanguageAssociations::isEnabled() && $params->get('show_associations'));
JHtml::_('behavior.caption');
?>
<div class="item-page<?php echo $this->pageclass_sfx; ?>" itemscope itemtype="https://schema.org/Article">
<meta itemprop="inLanguage" content="<?php echo ($this->item->language === '*') ? JFactory::getConfig()->get('language') : $this->item->language; ?>" />
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
</div>
<?php endif;
if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && $this->item->paginationrelative)
{
echo $this->item->pagination;
}
?>
<?php // Todo Not that elegant would be nice to group the params ?>
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author') || $assocParam); ?>
<?php if (!$useDefList && $this->print) : ?>
<div id="pop-print" class="btn hidden-print">
<?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
</div>
<div class="clearfix"> </div>
<?php endif; ?>
<?php if ($params->get('show_title') || $params->get('show_author')) : ?>
<div class="page-header">
<?php if ($params->get('show_title')) : ?>
<h2 itemprop="headline">
<?php echo $this->escape($this->item->title); ?>
</h2>
<?php endif; ?>
<?php if ($this->item->state == 0) : ?>
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<?php if (strtotime($this->item->publish_up) > strtotime(JFactory::getDate())) : ?>
<span class="label label-warning"><?php echo JText::_('JNOTPUBLISHEDYET'); ?></span>
<?php endif; ?>
<?php if ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate()) : ?>
<span class="label label-warning"><?php echo JText::_('JEXPIRED'); ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if (!$this->print) : ?>
<?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
<?php echo JLayoutHelper::render('joomla.content.icons', array('params' => $params, 'item' => $this->item, 'print' => false)); ?>
<?php endif; ?>
<?php else : ?>
<?php if ($useDefList) : ?>
<div id="pop-print" class="btn hidden-print">
<?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentAfterTitle" ?>
<?php echo $this->item->event->afterDisplayTitle; ?>
<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
<?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above')); ?>
<?php endif; ?>
<?php if ($info == 0 && $params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentBeforeDisplay" ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '0')) || ($params->get('urls_position') == '0' && empty($urls->urls_position)))
|| (empty($urls->urls_position) && (!$params->get('urls_position')))) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php if ($params->get('access-view')) : ?>
<?php echo JLayoutHelper::render('joomla.content.full_image', $this->item); ?>
<?php
if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && !$this->item->paginationrelative) :
echo $this->item->pagination;
endif;
?>
<?php if (isset ($this->item->toc)) :
echo $this->item->toc;
endif; ?>
<div itemprop="articleBody">
<?php echo $this->item->text; ?>
</div>
<?php if ($info == 1 || $info == 2) : ?>
<?php if ($useDefList) : ?>
<?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'below')); ?>
<?php endif; ?>
<?php if ($params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
<?php endif; ?>
<?php
if (!empty($this->item->pagination) && $this->item->pagination && $this->item->paginationposition && !$this->item->paginationrelative) :
echo $this->item->pagination;
?>
<?php endif; ?>
<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '1')) || ($params->get('urls_position') == '1'))) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php // Optional teaser intro text for guests ?>
<?php elseif ($params->get('show_noauth') == true && $user->get('guest')) : ?>
<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
<?php echo JHtml::_('content.prepare', $this->item->introtext); ?>
<?php // Optional link to let them register to see the whole article. ?>
<?php if ($params->get('show_readmore') && $this->item->fulltext != null) : ?>
<?php $menu = JFactory::getApplication()->getMenu(); ?>
<?php $active = $menu->getActive(); ?>
<?php $itemId = $active->id; ?>
<?php $link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false)); ?>
<?php $link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language))); ?>
<p class="readmore">
<a href="<?php echo $link; ?>" class="register">
<?php $attribs = json_decode($this->item->attribs); ?>
<?php
if ($attribs->alternative_readmore == null) :
echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
elseif ($readmore = $attribs->alternative_readmore) :
echo $readmore;
if ($params->get('show_readmore_title', 0) != 0) :
echo JHtml::_('string.truncate', $this->item->title, $params->get('readmore_limit'));
endif;
elseif ($params->get('show_readmore_title', 0) == 0) :
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
else :
echo JText::_('COM_CONTENT_READ_MORE');
echo JHtml::_('string.truncate', $this->item->title, $params->get('readmore_limit'));
endif; ?>
</a>
</p>
<?php endif; ?>
<?php endif; ?>
<?php
if (!empty($this->item->pagination) && $this->item->pagination && $this->item->paginationposition && $this->item->paginationrelative) :
echo $this->item->pagination;
?>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
<?php echo $this->item->event->afterDisplayContent; ?>
</div>

View File

@ -0,0 +1,80 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Create shortcut
$urls = json_decode($this->item->urls);
// Create shortcuts to some parameters.
$params = $this->item->params;
if ($urls && (!empty($urls->urla) || !empty($urls->urlb) || !empty($urls->urlc))) :
?>
<div class="content-links">
<ul class="nav nav-tabs nav-stacked">
<?php
$urlarray = array(
array($urls->urla, $urls->urlatext, $urls->targeta, 'a'),
array($urls->urlb, $urls->urlbtext, $urls->targetb, 'b'),
array($urls->urlc, $urls->urlctext, $urls->targetc, 'c')
);
foreach ($urlarray as $url) :
$link = $url[0];
$label = $url[1];
$target = $url[2];
$id = $url[3];
if ( ! $link) :
continue;
endif;
// If no label is present, take the link
$label = $label ?: $link;
// If no target is present, use the default
$target = $target ?: $params->get('target' . $id);
?>
<li class="content-links-<?php echo $id; ?>">
<?php
// Compute the correct link
switch ($target)
{
case 1:
// Open in a new window
echo '<a href="' . htmlspecialchars($link, ENT_COMPAT, 'UTF-8') . '" target="_blank" rel="nofollow noopener noreferrer">' .
htmlspecialchars($label, ENT_COMPAT, 'UTF-8') . '</a>';
break;
case 2:
// Open in a popup window
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600';
echo "<a href=\"" . htmlspecialchars($link, ENT_COMPAT, 'UTF-8') . "\" onclick=\"window.open(this.href, 'targetWindow', '" . $attribs . "'); return false;\" rel=\"noopener noreferrer\">" .
htmlspecialchars($label, ENT_COMPAT, 'UTF-8') . '</a>';
break;
case 3:
// Open in a modal window
JHtml::_('behavior.modal', 'a.modal');
echo '<a class="modal" href="' . htmlspecialchars($link, ENT_COMPAT, 'UTF-8') . '" rel="{handler: \'iframe\', size: {x:600, y:600}} noopener noreferrer">' .
htmlspecialchars($label, ENT_COMPAT, 'UTF-8') . ' </a>';
break;
default:
// Open in parent window
echo '<a href="' . htmlspecialchars($link, ENT_COMPAT, 'UTF-8') . '" rel="nofollow">' .
htmlspecialchars($label, ENT_COMPAT, 'UTF-8') . ' </a>';
break;
}
?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

View File

@ -0,0 +1,43 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');
JHtml::_('behavior.core');
// Add strings for translations in Javascript.
JText::script('JGLOBAL_EXPAND_CATEGORIES');
JText::script('JGLOBAL_COLLAPSE_CATEGORIES');
JFactory::getDocument()->addScriptDeclaration("
jQuery(function($) {
$('.categories-list').find('[id^=category-btn-]').each(function(index, btn) {
var btn = $(btn);
btn.on('click', function() {
btn.find('span').toggleClass('icon-plus');
btn.find('span').toggleClass('icon-minus');
if (btn.attr('aria-label') === Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES'))
{
btn.attr('aria-label', Joomla.JText._('JGLOBAL_COLLAPSE_CATEGORIES'));
} else {
btn.attr('aria-label', Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES'));
}
});
});
});");
?>
<div class="categories-list<?php echo $this->pageclass_sfx; ?>">
<?php
echo JLayoutHelper::render('joomla.content.categories_default', $this);
echo $this->loadTemplate('items');
?>
</div>

View File

@ -0,0 +1,138 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');
$dispatcher = JEventDispatcher::getInstance();
$this->category->text = $this->category->description;
$dispatcher->trigger('onContentPrepare', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
$this->category->description = $this->category->text;
$results = $dispatcher->trigger('onContentAfterTitle', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
$afterDisplayTitle = trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentBeforeDisplay', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
$beforeDisplayContent = trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentAfterDisplay', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
$afterDisplayContent = trim(implode("\n", $results));
?>
<div class="blog<?php echo $this->pageclass_sfx; ?>" itemscope itemtype="https://schema.org/Blog">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_category_title', 1) or $this->params->get('page_subheading')) : ?>
<h2> <?php echo $this->escape($this->params->get('page_subheading')); ?>
<?php if ($this->params->get('show_category_title')) : ?>
<span class="subheading-category"><?php echo $this->category->title; ?></span>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php echo $afterDisplayTitle; ?>
<?php if ($this->params->get('show_cat_tags', 1) && !empty($this->category->tags->itemTags)) : ?>
<?php $this->category->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->category->tagLayout->render($this->category->tags->itemTags); ?>
<?php endif; ?>
<?php if ($beforeDisplayContent || $afterDisplayContent || $this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
<div class="category-desc clearfix">
<?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
<img src="<?php echo $this->category->getParams()->get('image'); ?>" alt="<?php echo htmlspecialchars($this->category->getParams()->get('image_alt'), ENT_COMPAT, 'UTF-8'); ?>"/>
<?php endif; ?>
<?php echo $beforeDisplayContent; ?>
<?php if ($this->params->get('show_description') && $this->category->description) : ?>
<?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_content.category'); ?>
<?php endif; ?>
<?php echo $afterDisplayContent; ?>
</div>
<?php endif; ?>
<?php if (empty($this->lead_items) && empty($this->link_items) && empty($this->intro_items)) : ?>
<?php if ($this->params->get('show_no_articles', 1)) : ?>
<p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p>
<?php endif; ?>
<?php endif; ?>
<?php $leadingcount = 0; ?>
<?php if (!empty($this->lead_items)) : ?>
<div class="items-leading clearfix">
<?php foreach ($this->lead_items as &$item) : ?>
<div class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"
itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</div>
<?php $leadingcount++; ?>
<?php endforeach; ?>
</div><!-- end items-leading -->
<?php endif; ?>
<?php
$introcount = count($this->intro_items);
$counter = 0;
?>
<?php if (!empty($this->intro_items)) : ?>
<?php foreach ($this->intro_items as $key => &$item) : ?>
<?php $rowcount = ((int) $key % (int) $this->columns) + 1; ?>
<?php if ($rowcount === 1) : ?>
<?php $row = $counter / $this->columns; ?>
<div class="items-row cols-<?php echo (int) $this->columns; ?> <?php echo 'row-' . $row; ?> row-fluid clearfix">
<?php endif; ?>
<div class="span<?php echo round(12 / $this->columns); ?>">
<div class="item column-<?php echo $rowcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"
itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</div>
<!-- end item -->
<?php $counter++; ?>
</div><!-- end span -->
<?php if (($rowcount == $this->columns) or ($counter == $introcount)) : ?>
</div><!-- end row -->
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if (!empty($this->link_items)) : ?>
<div class="items-more">
<?php echo $this->loadTemplate('links'); ?>
</div>
<?php endif; ?>
<?php if ($this->maxLevel != 0 && !empty($this->children[$this->category->id])) : ?>
<div class="cat-children">
<?php if ($this->params->get('show_category_heading_title_text', 1) == 1) : ?>
<h3> <?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?> </h3>
<?php endif; ?>
<?php echo $this->loadTemplate('children'); ?> </div>
<?php endif; ?>
<?php if (($this->params->def('show_pagination', 1) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?>
<div class="pagination">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter pull-right"> <?php echo $this->pagination->getPagesCounter(); ?> </p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?> </div>
<?php endif; ?>
</div>

View File

@ -0,0 +1,237 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php');
/**
* Profile controller class for Users.
*
* @since 1.6
*/
class UsersControllerProfile extends UsersController
{
/**
* Method to check out a user for editing and redirect to the edit form.
*
* @return boolean
*
* @since 1.6
*/
public function edit()
{
$app = JFactory::getApplication();
$user = JFactory::getUser();
$loginUserId = (int) $user->get('id');
// Get the previous user id (if any) and the current user id.
$previousId = (int) $app->getUserState('com_users.edit.profile.id');
$userId = $this->input->getInt('user_id');
// Check if the user is trying to edit another users profile.
if ($userId != $loginUserId)
{
$app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
$app->setHeader('status', 403, true);
return false;
}
$cookieLogin = $user->get('cookieLogin');
// Check if the user logged in with a cookie
if (!empty($cookieLogin))
{
// If so, the user must login to edit the password and other data.
$app->enqueueMessage(JText::_('JGLOBAL_REMEMBER_MUST_LOGIN'), 'message');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false));
return false;
}
// Set the user id for the user to edit in the session.
$app->setUserState('com_users.edit.profile.id', $userId);
// Get the model.
$model = $this->getModel('Profile', 'UsersModel');
// Check out the user.
if ($userId)
{
$model->checkout($userId);
}
// Check in the previous user.
if ($previousId)
{
$model->checkin($previousId);
}
// Redirect to the edit screen.
$this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&layout=edit', false));
return true;
}
/**
* Method to save a user's profile data.
*
* @return void
*
* @since 1.6
*/
public function save()
{
// Check for request forgeries.
$this->checkToken();
$app = JFactory::getApplication();
$model = $this->getModel('Profile', 'UsersModel');
$user = JFactory::getUser();
$userId = (int) $user->get('id');
// Get the user data.
$requestData = $app->input->post->get('jform', array(), 'array');
// Force the ID to this user.
$requestData['id'] = $userId;
// Validate the posted data.
$form = $model->getForm();
if (!$form)
{
JError::raiseError(500, $model->getError());
return false;
}
// Send an object which can be modified through the plugin event
$objData = (object) $requestData;
$app->triggerEvent(
'onContentNormaliseRequestData',
array('com_users.user', $objData, $form)
);
$requestData = (array) $objData;
// Validate the posted data.
$data = $model->validate($form, $requestData);
// Check for errors.
if ($data === false)
{
// Get the validation messages.
$errors = $model->getErrors();
// Push up to three validation messages out to the user.
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)
{
if ($errors[$i] instanceof Exception)
{
$app->enqueueMessage($errors[$i]->getMessage(), 'warning');
}
else
{
$app->enqueueMessage($errors[$i], 'warning');
}
}
// Unset the passwords.
unset($requestData['password1'], $requestData['password2']);
// Save the data in the session.
$app->setUserState('com_users.edit.profile.data', $requestData);
// Redirect back to the edit screen.
$userId = (int) $app->getUserState('com_users.edit.profile.id');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&layout=edit&user_id=' . $userId, false));
return false;
}
// Attempt to save the data.
$return = $model->save($data);
// Check for errors.
if ($return === false)
{
// Save the data in the session.
$app->setUserState('com_users.edit.profile.data', $data);
// Redirect back to the edit screen.
$userId = (int) $app->getUserState('com_users.edit.profile.id');
$this->setMessage(JText::sprintf('COM_USERS_PROFILE_SAVE_FAILED', $model->getError()), 'warning');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&layout=edit&user_id=' . $userId, false));
return false;
}
// Redirect the user and adjust session state based on the chosen task.
switch ($this->getTask())
{
case 'apply':
// Check out the profile.
$app->setUserState('com_users.edit.profile.id', $return);
$model->checkout($return);
// Redirect back to the edit screen.
$this->setMessage(JText::_('COM_USERS_PROFILE_SAVE_SUCCESS'));
$redirect = $app->getUserState('com_users.edit.profile.redirect');
// Don't redirect to an external URL.
if (!JUri::isInternal($redirect))
{
$redirect = null;
}
if (!$redirect)
{
$redirect = 'index.php?option=com_users&view=profile&layout=edit&hidemainmenu=1';
}
$this->setRedirect(JRoute::_($redirect, false));
break;
default:
// Check in the profile.
$userId = (int) $app->getUserState('com_users.edit.profile.id');
if ($userId)
{
$model->checkin($userId);
}
// Clear the profile id from the session.
$app->setUserState('com_users.edit.profile.id', null);
$redirect = $app->getUserState('com_users.edit.profile.redirect');
// Don't redirect to an external URL.
if (!JUri::isInternal($redirect))
{
$redirect = null;
}
if (!$redirect)
{
$redirect = 'index.php?option=com_users&view=profile&user_id=' . $return;
}
// Redirect to the list screen.
$this->setMessage(JText::_('COM_USERS_PROFILE_SAVE_SUCCESS'));
$this->setRedirect(JRoute::_($redirect, false));
break;
}
// Flush the data from the session.
$app->setUserState('com_users.edit.profile.data', null);
}
}

View File

@ -0,0 +1,384 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php');
/**
* Registration controller class for Users.
*
* @since 1.6
*/
class UsersControllerRegistration extends UsersController
{
/**
* Method to activate a user.
*
* @return boolean True on success, false on failure.
*
* @since 1.6
*/
public function activate()
{
$user = JFactory::getUser();
$input = JFactory::getApplication()->input;
$uParams = JComponentHelper::getParams('com_users');
// Check for admin activation. Don't allow non-super-admin to delete a super admin
if ($uParams->get('useractivation') != 2 && $user->get('id')) {
$this->setRedirect('index.php');
return true;
}
// If user registration or account activation is disabled, throw a 403.
if ($uParams->get('useractivation') == 0 || $uParams->get('allowUserRegistration') == 0) {
JError::raiseError(403, JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'));
return false;
}
$model = $this->getModel('Registration', 'UsersModel');
$token = $input->getAlnum('token');
// Check that the token is in a valid format.
if ($token === null || strlen($token) !== 32) {
JError::raiseError(403, JText::_('JINVALID_TOKEN'));
return false;
}
// Attempt to activate the user.
$return = $model->activate($token);
// Check for errors.
if ($return === false) {
// Redirect back to the home page.
$this->setMessage(JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $model->getError()), 'error');
$this->setRedirect('index.php');
return false;
}
$useractivation = $uParams->get('useractivation');
// Redirect to the login screen.
if ($useractivation == 0) {
$this->setMessage(JText::_('COM_USERS_REGISTRATION_SAVE_SUCCESS'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false));
} elseif ($useractivation == 1) {
$this->setMessage(JText::_('COM_USERS_REGISTRATION_ACTIVATE_SUCCESS'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false));
} elseif ($return->getParam('activate')) {
$this->setMessage(JText::_('COM_USERS_REGISTRATION_VERIFY_SUCCESS'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false));
} else {
$this->setMessage(JText::_('COM_USERS_REGISTRATION_ADMINACTIVATE_SUCCESS'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false));
}
return true;
}
public function testReg()
{
// Check for request forgeries.
$this->checkToken();
// If registration is disabled - Redirect to login page.
if (JComponentHelper::getParams('com_users')->get('allowUserRegistration') == 0) {
$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false));
return false;
}
$app = JFactory::getApplication();
$model = $this->getModel('Registration', 'UsersModel');
// Get the user data.
$requestData = $this->input->post->get('jform', array(), 'array');
// Validate the posted data.
$form = $model->getForm();
if (!$form) {
JError::raiseError(500, $model->getError());
return false;
}
$datetime = new \DateTime('');
$date = $datetime->format('c');
$ip = $_SERVER['REMOTE_ADDR'];
$browser = $_SERVER['HTTP_USER_AGENT'];
if (isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) {
$api_url = 'https://www.google.com/recaptcha/api/siteverify';
$resq_data = array(
'secret' => '6Le1o70lAAAAAE125nVz9KQYBX1h2-o5kmlx4tJw',
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
);
$curlConfig = array(
CURLOPT_URL => $api_url,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $resq_data
);
$ch = curl_init();
curl_setopt_array($ch, $curlConfig);
$response = curl_exec($ch);
curl_close($ch);
$responseData = json_decode($response);
if (!$responseData->success) {
$log = "{$date} capchaID: 'web-registration-v3' verdict: 'FAILURE' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
$app->enqueueMessage('Captcha failed', 'error');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration', false));
return false;
}
$log = "{$date} capchaID: 'web-registration-v3' verdict: 'SUCCESS' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
} else {
$log = "{$date} capchaID: 'web-registration-v3' verdict: 'FAILURE' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
$error = $_SERVER['HTTP_HOST'] == 'www.archlinexp.com' ? 'Please complete the CAPTCHA.' : 'Kérjük, töltse ki a CAPTCHA-t.';
$app->enqueueMessage($error, 'error');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration', false));
return false;
}
$data = $model->validate($form, $requestData);
// Check for validation errors.
if ($data === false) {
// Get the validation messages.
$errors = $model->getErrors();
// Push up to three validation messages out to the user.
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {
if ($errors[$i] instanceof Exception) {
$app->enqueueMessage($errors[$i]->getMessage(), 'error');
} else {
$app->enqueueMessage($errors[$i], 'error');
}
}
// Save the data in the session.
$app->setUserState('com_users.registration.data', $requestData);
// Redirect back to the registration screen.
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration', false));
return false;
}
// Attempt to save the data.
$return = $model->register($data);
// Check for errors.
if ($return === false) {
// Save the data in the session.
$app->setUserState('com_users.registration.data', $data);
// Redirect back to the edit screen.
$this->setMessage($model->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration', false));
return false;
}
// Flush the data from the session.
$app->setUserState('com_users.registration.data', null);
// Redirect to the profile screen.
if ($return === 'adminactivate') {
$this->setMessage(JText::_('COM_USERS_REGISTRATION_COMPLETE_VERIFY'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false));
} elseif ($return === 'useractivate') {
$this->setMessage(JText::_('COM_USERS_REGISTRATION_COMPLETE_ACTIVATE'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false));
} else {
$this->setMessage(JText::_('COM_USERS_REGISTRATION_SAVE_SUCCESS'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false));
}
return true;
}
/**
* Method to register a user.
*
* @return boolean True on success, false on failure.
*
* @since 1.6
*/
public function register()
{
// Check for request forgeries.
$this->checkToken();
// If registration is disabled - Redirect to login page.
if (JComponentHelper::getParams('com_users')->get('allowUserRegistration') == 0) {
$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false));
return false;
}
$app = JFactory::getApplication();
$model = $this->getModel('Registration', 'UsersModel');
// Get the user data.
$requestData = $this->input->post->get('jform', array(), 'array');
// Validate the posted data.
$form = $model->getForm();
if (!$form) {
JError::raiseError(500, $model->getError());
return false;
}
$datetime = new \DateTime('');
$date = $datetime->format('c');
$ip = $_SERVER['REMOTE_ADDR'];
$browser = $_SERVER['HTTP_USER_AGENT'];
if (isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) {
$api_url = 'https://www.google.com/recaptcha/api/siteverify';
$resq_data = array(
'secret' => '6Le1o70lAAAAAE125nVz9KQYBX1h2-o5kmlx4tJw',
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
);
$curlConfig = array(
CURLOPT_URL => $api_url,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $resq_data
);
$ch = curl_init();
curl_setopt_array($ch, $curlConfig);
$response = curl_exec($ch);
curl_close($ch);
$responseData = json_decode($response);
if (!$responseData->success) {
$log = "{$date} capchaID: 'web-registration-v3' verdict: 'FAILURE' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
$app->enqueueMessage('Captcha failed', 'error');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration', false));
return false;
}
$log = "{$date} capchaID: 'web-registration-v3' verdict: 'SUCCESS' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
} else {
$log = "{$date} capchaID: 'web-registration-v3' verdict: 'FAILURE' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
$error = $_SERVER['HTTP_HOST'] == 'www.archlinexp.com' ? 'Please complete the CAPTCHA.' : 'Kérjük, töltse ki a CAPTCHA-t.';
$app->enqueueMessage($error, 'error');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration', false));
return false;
}
$data = $model->validate($form, $requestData);
// Check for validation errors.
if ($data === false) {
// Get the validation messages.
$errors = $model->getErrors();
// Push up to three validation messages out to the user.
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {
if ($errors[$i] instanceof Exception) {
$app->enqueueMessage($errors[$i]->getMessage(), 'error');
} else {
$app->enqueueMessage($errors[$i], 'error');
}
}
// Save the data in the session.
$app->setUserState('com_users.registration.data', $requestData);
// Redirect back to the registration screen.
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration', false));
return false;
}
// Attempt to save the data.
$return = $model->register($data);
// Check for errors.
if ($return === false) {
// Save the data in the session.
$app->setUserState('com_users.registration.data', $data);
// Redirect back to the edit screen.
$this->setMessage($model->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration', false));
return false;
}
// Flush the data from the session.
$app->setUserState('com_users.registration.data', null);
// Redirect to the profile screen.
if ($return === 'adminactivate') {
$this->setMessage(JText::_('COM_USERS_REGISTRATION_COMPLETE_VERIFY'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false));
} elseif ($return === 'useractivate') {
$this->setMessage(JText::_('COM_USERS_REGISTRATION_COMPLETE_ACTIVATE'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false));
} else {
$this->setMessage(JText::_('COM_USERS_REGISTRATION_SAVE_SUCCESS'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false));
}
return true;
}
public function registerWithARCHLine()
{
$response = array();
$model = $this->getModel('Registration', 'UsersModel');
$message = '';
$return = $model->registerWithARCHLine($_POST, $message);
if ($return === false) $response['error'] = true;
$response['msg'] = $message;
echo json_encode($response);
die();
}
}

View File

@ -0,0 +1,90 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php');
/**
* Reset controller class for Users.
*
* @since 1.6
*/
class UsersControllerRemind extends UsersController
{
/**
* Method to request a username reminder.
*
* @return boolean
*
* @since 1.6
*/
public function remind()
{
// Check the request token.
$this->checkToken('post');
$model = $this->getModel('Remind', 'UsersModel');
$data = $this->input->post->get('jform', array(), 'array');
$captchaError = 'Captcha failed';
if (isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) {
$api_url = 'https://www.google.com/recaptcha/api/siteverify';
$resq_data = array(
'secret' => '6Le1o70lAAAAAE125nVz9KQYBX1h2-o5kmlx4tJw',
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
);
$curlConfig = array(
CURLOPT_URL => $api_url,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $resq_data
);
$ch = curl_init();
curl_setopt_array($ch, $curlConfig);
$response = curl_exec($ch);
curl_close($ch);
$responseData = json_decode($response);
if (!$responseData->success) {
$this->setRedirect(JRoute::_('index.php?option=com_users&view=remind', false), $captchaError, 'error');
return false;
}
} else {
$this->setRedirect(JRoute::_('index.php?option=com_users&view=remind', false), $captchaError, 'error');
return false;
}
// Submit the password reset request.
$return = $model->processRemindRequest($data);
// Check for a hard error.
if ($return == false) {
// The request failed.
// Go back to the request form.
$message = JText::sprintf('COM_USERS_REMIND_REQUEST_FAILED', $model->getError());
$this->setRedirect(JRoute::_('index.php?option=com_users&view=remind', false), $message, 'notice');
return false;
} else {
// The request succeeded.
// Proceed to step two.
$message = JText::_('COM_USERS_REMIND_REQUEST_SUCCESS');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false), $message);
return true;
}
}
}

View File

@ -0,0 +1,200 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php');
/**
* Reset controller class for Users.
*
* @since 1.6
*/
class UsersControllerReset extends UsersController
{
/**
* Method to request a password reset.
*
* @return boolean
*
* @since 1.6
*/
public function request()
{
// Check the request token.
$this->checkToken('post');
$app = JFactory::getApplication();
$model = $this->getModel('Reset', 'UsersModel');
$data = $this->input->post->get('jform', array(), 'array');
$captchaError = 'Captcha failed';
if (isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) {
$api_url = 'https://www.google.com/recaptcha/api/siteverify';
$resq_data = array(
'secret' => '6Le1o70lAAAAAE125nVz9KQYBX1h2-o5kmlx4tJw',
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
);
$curlConfig = array(
CURLOPT_URL => $api_url,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $resq_data
);
$ch = curl_init();
curl_setopt_array($ch, $curlConfig);
$response = curl_exec($ch);
curl_close($ch);
$responseData = json_decode($response);
if (!$responseData->success) {
$this->setRedirect(JRoute::_('index.php?option=com_users&view=reset', false), $captchaError, 'error');
return false;
}
} else {
$this->setRedirect(JRoute::_('index.php?option=com_users&view=reset', false), $captchaError, 'error');
return false;
}
// Submit the password reset request.
$return = $model->processResetRequest($data);
// Check for a hard error.
if ($return instanceof Exception) {
// Get the error message to display.
if ($app->get('error_reporting')) {
$message = $return->getMessage();
} else {
$message = JText::_('COM_USERS_RESET_REQUEST_ERROR');
}
// Go back to the request form.
$this->setRedirect(JRoute::_('index.php?option=com_users&view=reset', false), $message, 'error');
return false;
} elseif ($return === false) {
// The request failed.
// Go back to the request form.
$message = JText::sprintf('COM_USERS_RESET_REQUEST_FAILED', $model->getError());
$this->setRedirect(JRoute::_('index.php?option=com_users&view=reset', false), $message, 'notice');
return false;
} else {
// The request succeeded.
// Proceed to step two.
$this->setRedirect(JRoute::_('index.php?option=com_users&view=reset&layout=confirm', false));
return true;
}
}
/**
* Method to confirm the password request.
*
* @return boolean
*
* @access public
* @since 1.6
*/
public function confirm()
{
// Check the request token.
$this->checkToken('request');
$app = JFactory::getApplication();
$model = $this->getModel('Reset', 'UsersModel');
$data = $this->input->get('jform', array(), 'array');
// Confirm the password reset request.
$return = $model->processResetConfirm($data);
// Check for a hard error.
if ($return instanceof Exception) {
// Get the error message to display.
if ($app->get('error_reporting')) {
$message = $return->getMessage();
} else {
$message = JText::_('COM_USERS_RESET_CONFIRM_ERROR');
}
// Go back to the confirm form.
$this->setRedirect(JRoute::_('index.php?option=com_users&view=reset&layout=confirm', false), $message, 'error');
return false;
} elseif ($return === false) {
// Confirm failed.
// Go back to the confirm form.
$message = JText::sprintf('COM_USERS_RESET_CONFIRM_FAILED', $model->getError());
$this->setRedirect(JRoute::_('index.php?option=com_users&view=reset&layout=confirm', false), $message, 'notice');
return false;
} else {
// Confirm succeeded.
// Proceed to step three.
$this->setRedirect(JRoute::_('index.php?option=com_users&view=reset&layout=complete', false));
return true;
}
}
/**
* Method to complete the password reset process.
*
* @return boolean
*
* @since 1.6
*/
public function complete()
{
// Check for request forgeries
$this->checkToken('post');
$app = JFactory::getApplication();
$model = $this->getModel('Reset', 'UsersModel');
$data = $this->input->post->get('jform', array(), 'array');
// Complete the password reset request.
$return = $model->processResetComplete($data);
// Check for a hard error.
if ($return instanceof Exception) {
// Get the error message to display.
if ($app->get('error_reporting')) {
$message = $return->getMessage();
} else {
$message = JText::_('COM_USERS_RESET_COMPLETE_ERROR');
}
// Go back to the complete form.
$this->setRedirect(JRoute::_('index.php?option=com_users&view=reset&layout=complete', false), $message, 'error');
return false;
} elseif ($return === false) {
// Complete failed.
// Go back to the complete form.
$message = JText::sprintf('COM_USERS_RESET_COMPLETE_FAILED', $model->getError());
$this->setRedirect(JRoute::_('index.php?option=com_users&view=reset&layout=complete', false), $message, 'notice');
return false;
} else {
// Complete succeeded.
// Proceed to the login form.
$message = JText::_('COM_USERS_RESET_COMPLETE_SUCCESS');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false), $message);
return true;
}
}
}

View File

@ -0,0 +1,374 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php');
/**
* Registration controller class for Users.
*
* @since 1.6
*/
class UsersControllerUser extends UsersController
{
/**
* Method to log in a user.
*
* @return void
*
* @since 1.6
*/
public function login()
{
$this->checkToken('post');
$app = JFactory::getApplication();
$input = $app->input->getInputForRequestMethod();
// Populate the data array:
$data = array();
$data['return'] = base64_decode($input->get('return', '', 'BASE64'));
$data['username'] = $input->get('username', '', 'USERNAME');
$data['password'] = $input->get('password', '', 'RAW');
$data['secretkey'] = $input->get('secretkey', '', 'RAW');
// Check for a simple menu item id
if (is_numeric($data['return']))
{
if (JLanguageMultilang::isEnabled())
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('language')
->from($db->quoteName('#__menu'))
->where('client_id = 0')
->where('id =' . $data['return']);
$db->setQuery($query);
try
{
$language = $db->loadResult();
}
catch (RuntimeException $e)
{
return;
}
if ($language !== '*')
{
$lang = '&lang=' . $language;
}
else
{
$lang = '';
}
}
else
{
$lang = '';
}
$data['return'] = 'index.php?Itemid=' . $data['return'] . $lang;
}
else
{
// Don't redirect to an external URL.
if (!JUri::isInternal($data['return']))
{
$data['return'] = '';
}
}
// Set the return URL if empty.
if (empty($data['return']))
{
$data['return'] = 'index.php?option=com_users&view=profile';
}
// Set the return URL in the user state to allow modification by plugins
$app->setUserState('users.login.form.return', $data['return']);
// Get the log in options.
$options = array();
$options['remember'] = $this->input->getBool('remember', false);
$options['return'] = $data['return'];
// Get the log in credentials.
$credentials = array();
$credentials['username'] = $data['username'];
$credentials['password'] = $data['password'];
$credentials['secretkey'] = $data['secretkey'];
// Perform the log in.
if (true !== $app->login($credentials, $options))
{
// Login failed !
// Clear user name, password and secret key before sending the login form back to the user.
$data['remember'] = (int) $options['remember'];
$data['username'] = '';
$data['password'] = '';
$data['secretkey'] = '';
$app->setUserState('users.login.form.data', $data);
$uri = JFactory::getURI();
$url = $uri->toString();
$app->redirect(JRoute::_($url, false));
//$app->redirect(JRoute::_('index.php?option=com_users&view=login', false)); //Eredeti
}
// Success
if ($options['remember'] == true)
{
$app->setUserState('rememberLogin', true);
}
$app->setUserState('users.login.form.data', array());
$app->redirect(JRoute::_($app->getUserState('users.login.form.return'), false));
}
/**
* Method to log out a user.
*
* @return void
*
* @since 1.6
*/
public function logout()
{
$this->checkToken('request');
$app = JFactory::getApplication();
// Prepare the logout options.
$options = array(
'clientid' => $app->get('shared_session', '0') ? null : 0,
);
// Perform the log out.
$error = $app->logout(null, $options);
$input = $app->input->getInputForRequestMethod();
// Check if the log out succeeded.
if ($error instanceof Exception)
{
$app->redirect(JRoute::_('index.php?option=com_users&view=login', false));
}
// Get the return URL from the request and validate that it is internal.
$return = $input->get('return', '', 'BASE64');
$return = base64_decode($return);
// Check for a simple menu item id
if (is_numeric($return))
{
if (JLanguageMultilang::isEnabled())
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('language')
->from($db->quoteName('#__menu'))
->where('client_id = 0')
->where('id =' . $return);
$db->setQuery($query);
try
{
$language = $db->loadResult();
}
catch (RuntimeException $e)
{
return;
}
if ($language !== '*')
{
$lang = '&lang=' . $language;
}
else
{
$lang = '';
}
}
else
{
$lang = '';
}
$return = 'index.php?Itemid=' . $return . $lang;
}
else
{
// Don't redirect to an external URL.
if (!JUri::isInternal($return))
{
$return = '';
}
}
// In case redirect url is not set, redirect user to homepage
if (empty($return))
{
$return = JUri::root();
}
// Redirect the user.
$app->redirect(JRoute::_($return, false));
}
/**
* Method to logout directly and redirect to page.
*
* @return void
*
* @since 3.5
*/
public function menulogout()
{
// Get the ItemID of the page to redirect after logout
$app = JFactory::getApplication();
$itemid = $app->getMenu()->getActive()->params->get('logout');
// Get the language of the page when multilang is on
if (JLanguageMultilang::isEnabled())
{
if ($itemid)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('language')
->from($db->quoteName('#__menu'))
->where('client_id = 0')
->where('id =' . $itemid);
$db->setQuery($query);
try
{
$language = $db->loadResult();
}
catch (RuntimeException $e)
{
return;
}
if ($language !== '*')
{
$lang = '&lang=' . $language;
}
else
{
$lang = '';
}
// URL to redirect after logout
$url = 'index.php?Itemid=' . $itemid . $lang;
}
else
{
// Logout is set to default. Get the home page ItemID
$lang_code = $app->input->cookie->getString(JApplicationHelper::getHash('language'));
$item = $app->getMenu()->getDefault($lang_code);
$itemid = $item->id;
// Redirect to Home page after logout
$url = 'index.php?Itemid=' . $itemid;
}
}
else
{
// URL to redirect after logout, default page if no ItemID is set
$url = $itemid ? 'index.php?Itemid=' . $itemid : JUri::root();
}
// Logout and redirect
$this->setRedirect('index.php?option=com_users&task=user.logout&' . JSession::getFormToken() . '=1&return=' . base64_encode($url));
}
/**
* Method to request a username reminder.
*
* @return boolean
*
* @since 1.6
*/
public function remind()
{
// Check the request token.
$this->checkToken('post');
$app = JFactory::getApplication();
$model = $this->getModel('User', 'UsersModel');
$data = $this->input->post->get('jform', array(), 'array');
// Submit the username remind request.
$return = $model->processRemindRequest($data);
// Check for a hard error.
if ($return instanceof Exception)
{
// Get the error message to display.
$message = $app->get('error_reporting')
? $return->getMessage()
: JText::_('COM_USERS_REMIND_REQUEST_ERROR');
// Get the route to the next page.
$itemid = UsersHelperRoute::getRemindRoute();
$itemid = $itemid !== null ? '&Itemid=' . $itemid : '';
$route = 'index.php?option=com_users&view=remind' . $itemid;
// Go back to the complete form.
$this->setRedirect(JRoute::_($route, false), $message, 'error');
return false;
}
if ($return === false)
{
// Complete failed.
// Get the route to the next page.
$itemid = UsersHelperRoute::getRemindRoute();
$itemid = $itemid !== null ? '&Itemid=' . $itemid : '';
$route = 'index.php?option=com_users&view=remind' . $itemid;
// Go back to the complete form.
$message = JText::sprintf('COM_USERS_REMIND_REQUEST_FAILED', $model->getError());
$this->setRedirect(JRoute::_($route, false), $message, 'notice');
return false;
}
// Complete succeeded.
// Get the route to the next page.
$itemid = UsersHelperRoute::getLoginRoute();
$itemid = $itemid !== null ? '&Itemid=' . $itemid : '';
$route = 'index.php?option=com_users&view=login' . $itemid;
// Proceed to the login form.
$message = JText::_('COM_USERS_REMIND_REQUEST_SUCCESS');
$this->setRedirect(JRoute::_($route, false), $message);
return true;
}
/**
* Method to resend a user.
*
* @return void
*
* @since 1.6
*/
public function resend()
{
// Check for request forgeries
// $this->checkToken('post');
}
}

View File

@ -0,0 +1,944 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Registration model class for Users.
*
* @since 1.6
*/
class UsersModelRegistration extends JModelForm
{
/**
* @var object The user registration data.
* @since 1.6
*/
protected $data;
/**
* Constructor
*
* @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request).
*
* @since 3.6
*
* @throws Exception
*/
public function __construct($config = array())
{
$config = array_merge(
array(
'events_map' => array('validate' => 'user')
),
$config
);
parent::__construct($config);
}
/**
* Method to activate a user account.
*
* @param string $token The activation token.
*
* @return mixed False on failure, user object on success.
*
* @since 1.6
*/
public function activate($token)
{
$config = JFactory::getConfig();
$userParams = JComponentHelper::getParams('com_users');
$db = $this->getDbo();
// Get the user id based on the token.
$query = $db->getQuery(true);
$query->select($db->quoteName('id'))
->from($db->quoteName('#__users'))
->where($db->quoteName('activation') . ' = ' . $db->quote($token))
->where($db->quoteName('block') . ' = ' . 1)
->where($db->quoteName('lastvisitDate') . ' = ' . $db->quote($db->getNullDate()));
$db->setQuery($query);
try {
$userId = (int) $db->loadResult();
} catch (RuntimeException $e) {
$this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500);
return false;
}
// Check for a valid user id.
if (!$userId) {
$this->setError(JText::_('COM_USERS_ACTIVATION_TOKEN_NOT_FOUND'));
return false;
}
// Load the users plugin group.
JPluginHelper::importPlugin('user');
// Activate the user.
$user = JFactory::getUser($userId);
// Admin activation is on and user is verifying their email
if (($userParams->get('useractivation') == 2) && !$user->getParam('activate', 0)) {
$uri = JUri::getInstance();
// Compile the admin notification mail values.
$data = $user->getProperties();
$data['activation'] = JApplicationHelper::getHash(JUserHelper::genRandomPassword());
$user->set('activation', $data['activation']);
$data['siteurl'] = JUri::base();
$base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
$data['activate'] = $base . JRoute::_('index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false);
// Remove administrator/ from activate URL in case this method is called from admin
if (JFactory::getApplication()->isClient('administrator')) {
$adminPos = strrpos($data['activate'], 'administrator/');
$data['activate'] = substr_replace($data['activate'], '', $adminPos, 14);
}
$data['fromname'] = $config->get('fromname');
$data['mailfrom'] = $config->get('mailfrom');
$data['sitename'] = $config->get('sitename');
$user->setParam('activate', 1);
$emailSubject = JText::sprintf(
'COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_SUBJECT',
$data['name'],
$data['sitename']
);
$emailBody = JText::sprintf(
'COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY',
$data['sitename'],
$data['name'],
$data['email'],
$data['username'],
$data['activate']
);
// Get all admin users
$query->clear()
->select($db->quoteName(array('name', 'email', 'sendEmail', 'id')))
->from($db->quoteName('#__users'))
->where($db->quoteName('sendEmail') . ' = 1')
->where($db->quoteName('block') . ' = 0');
$db->setQuery($query);
try {
$rows = $db->loadObjectList();
} catch (RuntimeException $e) {
$this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500);
return false;
}
// Send mail to all users with users creating permissions and receiving system emails
foreach ($rows as $row) {
$usercreator = JFactory::getUser($row->id);
if ($usercreator->authorise('core.create', 'com_users')) {
$return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $row->email, $emailSubject, $emailBody);
// Check for an error.
if ($return !== true) {
$this->setError(JText::_('COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED'));
return false;
}
}
}
}
// Admin activation is on and admin is activating the account
elseif (($userParams->get('useractivation') == 2) && $user->getParam('activate', 0)) {
$user->set('activation', '');
$user->set('block', '0');
// Compile the user activated notification mail values.
$data = $user->getProperties();
$user->setParam('activate', 0);
$data['fromname'] = $config->get('fromname');
$data['mailfrom'] = $config->get('mailfrom');
$data['sitename'] = $config->get('sitename');
$data['siteurl'] = JUri::base();
$emailSubject = JText::sprintf(
'COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT',
$data['name'],
$data['sitename']
);
$emailBody = JText::sprintf(
'COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY',
$data['name'],
$data['siteurl'],
$data['username']
);
$return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody);
// Check for an error.
if ($return !== true) {
$this->setError(JText::_('COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED'));
return false;
}
} else {
$user->set('activation', '');
$user->set('block', '0');
$query = $db->getQuery(true);
$query->select('a.nUserID')->from('cl_hlusers.u_emails AS a')->where('a.email = "' . $user->email . '"');
$db->setQuery($query);
$existingUser = $db->loadObjectList();
$query = $db->getQuery(true);
$query->select('j.phone, j.profession, j.old_db, j.country, j.zip, j.city, j.address')->from('jml_jsn_users AS j')->where('j.id = "' . $userId . '"');
$db->setQuery($query);
$storeData = $db->loadObject();
if (count($existingUser) > 0) {
foreach ($existingUser as $users) {
$nUserID = $users->nUserID;
}
$query = $db->getQuery(true);
$query->select('u.old_db')->from('cl_hlusers.users AS u')->where('u.nUserID = "' . $nUserID . '"');
$db->setQuery($query);
$userDb = $db->loadObject();
if ($userDb->old_db == 'clusers') {
$old_db = "clusers";
$info = "Weben regisztrált";
$topic = 362;
} else {
$old_db = "clusers_eng";
$info = "Web registration";
$topic = 219;
}
} else {
$query = $db->getQuery(false);
if ($storeData->old_db == 'hu') {
$old_db = "clusers";
$info = "Weben regisztrált";
$topic = 362;
} else {
$old_db = "clusers_eng";
$info = "Web registration";
$topic = 219;
}
$query = 'INSERT INTO cl_hlusers.users(strName, strTel, nUserProf, nManagerID, old_db, strEmail, dateInsert, nUserType, strStreet, strCity, strZip)
VALUES("' . $user->name . '", "' . $storeData->phone . '", "' . $storeData->profession . '", 36, "' . $old_db . '", "' . $user->email . '",
' . time() . ', 0, "' . $storeData->address . '", "' . $storeData->city . '", "' . $storeData->zip . '")';
$db->setQuery($query);
$db->execute();
$nUserID = $db->insertid();
if ($storeData->country == null)
$storeData->country = 0;
$query = $db->getQuery(true);
$query->update("cl_hlusers.users");
$query->set('users.nCtrID = ' . $storeData->country);
$query->where('users.nUserID = ' . $nUserID);
$db->setQuery($query);
$db->execute();
$query = "INSERT INTO cl_hlusers.u_emails(email, nUserID)
VALUES('" . $user->email . "', '" . $nUserID . "')";
$db->setQuery($query);
$db->execute();
$query = $db->getQuery(true);
$query->update("cl_hlusers.u_emails");
$query->set('u_emails.default = 1');
$query->set('u_emails.newsletter = 1');
$query->where('nUserID = ' . $nUserID);
$db->setQuery($query);
$db->execute();
}
$query = $db->getQuery(false);
$query = "INSERT INTO cl_hlusers.u_history(nUserID, nTopicID, dateEvent, strPlace, strInfo, nManagerID, insertDate)
VALUES(" . $nUserID . ", " . $topic . ", '" . date("Y-m-d", time()) . "', 'web', '" . $info . "', 36, '" . date("Y-m-d H:i:s", time()) . "')";
$db->setQuery($query);
$db->execute();
$user->set('username', $user->email);
$user->set('nUserID', $nUserID);
}
// Store the user object.
if (!$user->save()) {
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_ACTIVATION_SAVE_FAILED', $user->getError()));
return false;
}
return $user;
}
/**
* Method to get the registration form data.
*
* The base form data is loaded and then an event is fired
* for users plugins to extend the data.
*
* @return mixed Data object on success, false on failure.
*
* @since 1.6
*/
public function getData()
{
if ($this->data === null) {
$this->data = new stdClass;
$app = JFactory::getApplication();
$params = JComponentHelper::getParams('com_users');
// Override the base user data with any data in the session.
$temp = (array) $app->getUserState('com_users.registration.data', array());
// Don't load the data in this getForm call, or we'll call ourself
$form = $this->getForm(array(), false);
foreach ($temp as $k => $v) {
// Here we could have a grouped field, let's check it
if (is_array($v)) {
$this->data->$k = new stdClass;
foreach ($v as $key => $val) {
if ($form->getField($key, $k) !== false) {
$this->data->$k->$key = $val;
}
}
}
// Only merge the field if it exists in the form.
elseif ($form->getField($k) !== false) {
$this->data->$k = $v;
}
}
// Get the groups the user should be added to after registration.
$this->data->groups = array();
// Get the default new user group, Registered if not specified.
$system = $params->get('new_usertype', 2);
$this->data->groups[] = $system;
// Unset the passwords.
unset($this->data->password1, $this->data->password2);
// Get the dispatcher and load the users plugins.
$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('user');
// Trigger the data preparation event.
$results = $dispatcher->trigger('onContentPrepareData', array('com_users.registration', $this->data));
// Check for errors encountered while preparing the data.
if (count($results) && in_array(false, $results, true)) {
$this->setError($dispatcher->getError());
$this->data = false;
}
}
return $this->data;
}
/**
* Method to get the registration form.
*
* The base form is loaded from XML and then an event is fired
* for users plugins to extend the form with extra fields.
*
* @param array $data An optional array of data for the form to interogate.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return JForm A JForm object on success, false on failure
*
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_users.registration', 'registration', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form)) {
return false;
}
// When multilanguage is set, a user's default site language should also be a Content Language
if (JLanguageMultilang::isEnabled()) {
$form->setFieldAttribute('language', 'type', 'frontend_language', 'params');
}
return $form;
}
/**
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
*
* @since 1.6
*/
protected function loadFormData()
{
$data = $this->getData();
if (JLanguageMultilang::isEnabled() && empty($data->language)) {
$data->language = JFactory::getLanguage()->getTag();
}
$this->preprocessData('com_users.registration', $data);
return $data;
}
/**
* Override preprocessForm to load the user plugin group instead of content.
*
* @param JForm $form A JForm object.
* @param mixed $data The data expected for the form.
* @param string $group The name of the plugin group to import (defaults to "content").
*
* @return void
*
* @since 1.6
* @throws Exception if there is an error in the form event.
*/
protected function preprocessForm(JForm $form, $data, $group = 'user')
{
$userParams = JComponentHelper::getParams('com_users');
// Add the choice for site language at registration time
if ($userParams->get('site_language') == 1 && $userParams->get('frontend_userparams') == 1) {
$form->loadFile('sitelang', false);
}
parent::preprocessForm($form, $data, $group);
}
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
*
* @since 1.6
*/
protected function populateState()
{
// Get the application object.
$app = JFactory::getApplication();
$params = $app->getParams('com_users');
// Load the parameters.
$this->setState('params', $params);
}
/**
* Method to save the form data.
*
* @param array $temp The form data.
*
* @return mixed The user id on success, false on failure.
*
* @since 1.6
*/
public function register($temp)
{
$params = JComponentHelper::getParams('com_users');
// Initialise the table with JUser.
$user = new JUser;
$data = (array) $this->getData();
// Merge in the registration data.
foreach ($temp as $k => $v) {
$data[$k] = $v;
}
// Prepare the data for the user object.
$data['email'] = JStringPunycode::emailToPunycode($data['email1']);
$data['name'] = $data['firstname']; // N.M. Az új registration form miatt kellett. Az emailben kiküldött név nem úgy jelent meg, ahogy kéne
$data['name'] .= ' ';
$data['name'] .= $data['lastname'];
$data['password'] = $data['password1'];
$useractivation = $params->get('useractivation');
$sendpassword = $params->get('sendpassword', 1);
// Check if the user needs to activate their account.
if (($useractivation == 1) || ($useractivation == 2)) {
$data['activation'] = JApplicationHelper::getHash(JUserHelper::genRandomPassword());
$data['block'] = 1;
}
// Bind the data.
if (!$user->bind($data)) {
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_BIND_FAILED', $user->getError()));
return false;
}
// Load the users plugin group.
JPluginHelper::importPlugin('user');
// Store the data.
if (!$user->save()) {
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $user->getError()));
return false;
}
$config = JFactory::getConfig();
$db = $this->getDbo();
$query = $db->getQuery(true);
// Compile the notification mail values.
$data = $user->getProperties();
$data['fromname'] = $config->get('fromname');
$data['mailfrom'] = $config->get('mailfrom');
$data['sitename'] = $config->get('sitename');
$data['siteurl'] = JUri::root();
// Handle account activation/confirmation emails.
if ($useractivation == 2) {
// Set the link to confirm the user email.
$uri = JUri::getInstance();
$base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
$data['activate'] = $base . JRoute::_('index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false);
// Remove administrator/ from activate URL in case this method is called from admin
if (JFactory::getApplication()->isClient('administrator')) {
$adminPos = strrpos($data['activate'], 'administrator/');
$data['activate'] = substr_replace($data['activate'], '', $adminPos, 14);
}
$emailSubject = JText::sprintf(
'COM_USERS_EMAIL_ACCOUNT_DETAILS',
$data['name'],
$data['sitename']
);
if ($sendpassword) {
$emailBody = JText::sprintf(
'COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY',
$data['name'],
$data['sitename'],
$data['activate'],
$data['siteurl'],
$data['username'],
$data['password_clear']
);
} else {
$emailBody = JText::sprintf(
'COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY_NOPW',
$data['name'],
$data['sitename'],
$data['activate'],
$data['siteurl'],
$data['username']
);
}
} elseif ($useractivation == 1) {
// Set the link to activate the user account.
$uri = JUri::getInstance();
$base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
$data['activate'] = $base . JRoute::_('index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false);
// Remove administrator/ from activate URL in case this method is called from admin
if (JFactory::getApplication()->isClient('administrator')) {
$adminPos = strrpos($data['activate'], 'administrator/');
$data['activate'] = substr_replace($data['activate'], '', $adminPos, 14);
}
$emailSubject = JText::sprintf(
'COM_USERS_EMAIL_ACCOUNT_DETAILS',
$data['name'],
$data['sitename']
);
if ($sendpassword) {
$emailBody = JText::sprintf(
'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY',
$data['name'],
$data['sitename'],
$data['activate'],
$data['siteurl'],
$data['username'],
$data['password_clear']
);
} else {
// $data['username'] valtozot ki kell cserelni az emailre, mert false adatot kuldunk ki
$emailBody = JText::sprintf(
'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW',
$data['name'],
$data['sitename'],
$data['activate'],
$data['siteurl'],
$data['username']
);
}
} else {
$emailSubject = JText::sprintf(
'COM_USERS_EMAIL_ACCOUNT_DETAILS',
$data['name'],
$data['sitename']
);
if ($sendpassword) {
$emailBody = JText::sprintf(
'COM_USERS_EMAIL_REGISTERED_BODY',
$data['name'],
$data['sitename'],
$data['siteurl'],
$data['username'],
$data['password_clear']
);
} else {
$emailBody = JText::sprintf(
'COM_USERS_EMAIL_REGISTERED_BODY_NOPW',
$data['name'],
$data['sitename'],
$data['siteurl']
);
}
}
// Send the registration email.
$return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody);
// Send Notification mail to administrators
if (($params->get('useractivation') < 2) && ($params->get('mail_to_admin') == 1)) {
$emailSubject = JText::sprintf(
'COM_USERS_EMAIL_ACCOUNT_DETAILS',
$data['name'],
$data['sitename']
);
$emailBodyAdmin = JText::sprintf(
'COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY',
$data['name'],
$data['username'],
$data['siteurl']
);
// Get all admin users
$query->clear()
->select($db->quoteName(array('name', 'email', 'sendEmail')))
->from($db->quoteName('#__users'))
->where($db->quoteName('sendEmail') . ' = 1')
->where($db->quoteName('block') . ' = 0');
$db->setQuery($query);
try {
$rows = $db->loadObjectList();
} catch (RuntimeException $e) {
$this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500);
return false;
}
// Send mail to all superadministrators id
foreach ($rows as $row) {
$return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $row->email, $emailSubject, $emailBodyAdmin);
// Check for an error.
if ($return !== true) {
$this->setError(JText::_('COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED'));
return false;
}
}
}
// Check for an error.
if ($return !== true) {
$this->setError(JText::_('COM_USERS_REGISTRATION_SEND_MAIL_FAILED'));
// Send a system message to administrators receiving system mails
$db = $this->getDbo();
$query->clear()
->select($db->quoteName('id'))
->from($db->quoteName('#__users'))
->where($db->quoteName('block') . ' = ' . (int) 0)
->where($db->quoteName('sendEmail') . ' = ' . (int) 1);
$db->setQuery($query);
try {
$userids = $db->loadColumn();
} catch (RuntimeException $e) {
$this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500);
return false;
}
if (count($userids) > 0) {
$jdate = new JDate;
// Build the query to add the messages
foreach ($userids as $userid) {
$values = array(
$db->quote($userid),
$db->quote($userid),
$db->quote($jdate->toSql()),
$db->quote(JText::_('COM_USERS_MAIL_SEND_FAILURE_SUBJECT')),
$db->quote(JText::sprintf('COM_USERS_MAIL_SEND_FAILURE_BODY', $return, $data['username']))
);
$query->clear()
->insert($db->quoteName('#__messages'))
->columns($db->quoteName(array('user_id_from', 'user_id_to', 'date_time', 'subject', 'message')))
->values(implode(',', $values));
$db->setQuery($query);
try {
$db->execute();
} catch (RuntimeException $e) {
$this->setError(JText::sprintf('COM_USERS_DATABASE_ERROR', $e->getMessage()), 500);
return false;
}
}
}
return false;
}
if ($useractivation == 1) {
return 'useractivate';
} elseif ($useractivation == 2) {
return 'adminactivate';
} else {
return $user->id;
}
}
private function checkCaptcha($response)
{
$secret = '';
if ($_SERVER['SERVER_NAME'] == 'www.archline.hu')
$secret = '6Lc8nh8TAAAAALeRGLDbjsr7Rh1qpQJkYXYO-P50';
else
$secret = '6LeqnB8TAAAAAJTatP1dt8npqwDfJLz4_i9-rbNg';
$post_data = http_build_query(
array(
'secret' => $secret,
'response' => $response,
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array(
'http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $post_data
)
);
$context = stream_context_create($opts);
$response = file_get_contents('https://www.google.com/recaptcha/api/siteverify', false, $context);
$result = json_decode($response);
return $result->success;
}
private function phoneCorrect(&$phone)
{
$phone = str_replace('-', '', $phone);
$phone = str_replace(' ', '', $phone);
$phone = str_replace('+', '', $phone);
$phone = str_replace('/', '', $phone);
$phone = str_replace('.', '', $phone);
$phone = str_replace(' ', '', $phone);
return $phone;
}
public function registerWithARCHLine($temp, &$message)
{
if (!class_exists('crm_hardlock')) require_once(JPATH_BASE . "/common_cadline_libraries/crm_hardlock.class.php");
$resource = new Resource($temp['country']);
$captchaResult = $this->checkCaptcha($temp['captcha']);
$datetime = new \DateTime('');
$date = $datetime->format('c');
$ip = $_SERVER['REMOTE_ADDR'];
$browser = $_SERVER['HTTP_USER_AGENT'];
if (!$captchaResult) {
$message = $resource->getDlgString('10947');
$log = "{$date} capchaID: 'archline-registration-v2' verdict: 'FAILURE' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
return false;
}
$log = "{$date} capchaID: 'archline-registration-v2' verdict: 'SUCCESS' IP: '{$ip}' Browser: '{$browser}'" . PHP_EOL;
error_log($log, 3, $_SERVER['DOCUMENT_ROOT'] . '/logs/captchaErrorLog.log');
$query = "SELECT * FROM www_archline_hu.jml_users WHERE username = ? OR email = ?";
Database::getInstance()->query($query, array('ss', $temp['email'], $temp['email']));
$res = Database::getInstance()->fetchNext();
if (!empty($res)) {
$message = $resource->getDlgString('10789');
return false;
}
if ($temp['password'] != $temp['password2']) {
$message = $resource->getDlgString('10792');
return false;
}
// Initialise the table with JUser.
$user = new JUser;
$data = (array) $this->getData();
// Merge in the registration data.
foreach ($temp as $k => $v) {
$data[$k] = $v;
}
$user->bind($data);
if (!$user->save()) {
$message = JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $user->getError());
return false;
}
$profile_phone = array(
'user_id' => $user->id,
'profile_key' => 'profile.phone',
'profile_value' => $temp['phone'],
'ordering' => 7
);
$profile_country = array(
'user_id' => $user->id,
'profile_key' => 'profile.country',
'profile_value' => $temp['country'],
'ordering' => 5
);
Database::getInstance()->insert('www_archline_hu.jml_user_profiles', $profile_phone, 'issi');
Database::getInstance()->insert('www_archline_hu.jml_user_profiles', $profile_country, 'issi');
$query = "SELECT nUserID FROM cl_hlusers.u_emails WHERE email = ?";
Database::getInstance()->query($query, array('s', $user->email));
$existingUser = Database::getInstance()->fetchNext();
if (count($existingUser) > 0) {
$nUserID = $existingUser['nUserID'];
} else {
$query = "SELECT * FROM www_archline_hu.jml_jsn_users WHERE id = ?";
Database::getInstance()->query($query, array('i', $user->id));
$storeData = Database::getInstance()->fetchNext();
if ($storeData['old_db'] == 'hu') {
$old_db = "clusers";
$info = "Weben regisztrált";
$topic = 362;
} else {
$old_db = "clusers_eng";
$info = "Web registration";
$topic = 219;
}
$nUserID = Database::getInstance()->insert(
'cl_hlusers.users',
array(
"strName" => $user->name,
"strTel" => $storeData['phone'],
"nUserProf" => $storeData['profession'],
"nManagerID" => 36,
"strEmail" => $user->email,
"dateInsert" => time(),
"nUserType" => 0,
"strStreet" => $storeData['address'],
"strCity" => $storeData['city'],
"strZip" => $storeData['zip'],
"nCtrID" => $storeData['country'] == null ? 0 : $storeData['country'],
"old_db" => $old_db
),
'ssiisiisssis'
);
Database::getInstance()->insert(
'cl_hlusers.u_emails',
array(
"email" => $user->email,
"nUserID" => $nUserID,
"newsletter" => 1,
"default" => 1
),
'siii'
);
}
Database::getInstance()->update(
"www_archline_hu.jml_users",
array(
'nUserID' => $nUserID,
'username' => $user->email
),
array('id' => $user->id),
'isi'
);
Database::getInstance()->insert(
'cl_hlusers.u_history',
array(
"nUserID" => $nUserID,
"nTopicID" => $topic,
"dateEvent" => date("Y-m-d", time()),
"strPlace" => 'web',
"strInfo" => $info,
"nManagerID" => 36,
"insertDate" => date("Y-m-d H:i:s", time())
),
'iisssis'
);
$this->phoneCorrect($temp['phone']);
$query = "SELECT * FROM www_archline_hu.jml_users WHERE id = ?";
Database::getInstance()->query($query, array('i', $user->id));
$jmlUser = Database::getInstance()->fetchNext();
Database::getInstance()->update(
'cl_hlusers.users',
array(
'strTel' => $temp['phone'],
'nCtrID' => $temp['country']
),
array('nUserID' => $jmlUser['nUserID']),
'sii'
);
$message = $resource->getDlgString('10793');
return $user->id;
}
}

View File

@ -0,0 +1,106 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
?>
<div class="login<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
<div class="login-description">
<?php endif; ?>
<?php if ($this->params->get('logindescription_show') == 1) : ?>
<?php echo $this->params->get('login_description'); ?>
<?php endif; ?>
<?php if ($this->params->get('login_image') != '') : ?>
<img src="<?php echo $this->escape($this->params->get('login_image')); ?>" class="login-image" alt="<?php echo JText::_('COM_USERS_LOGIN_IMAGE_ALT'); ?>" />
<?php endif; ?>
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
</div>
<?php endif; ?>
<form action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post" class="form-validate form-horizontal well">
<fieldset>
<?php foreach ($this->form->getFieldset('credentials') as $field) : ?>
<?php if (!$field->hidden) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($this->tfa) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getField('secretkey')->label; ?>
</div>
<div class="controls">
<?php echo $this->form->getField('secretkey')->input; ?>
</div>
</div>
<?php endif; ?>
<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
<div class="control-group">
<div class="control-label">
<label for="remember">
<?php echo JText::_('COM_USERS_LOGIN_REMEMBER_ME'); ?>
</label>
</div>
<div class="controls">
<input id="remember" type="checkbox" name="remember" class="inputbox" value="yes" />
</div>
</div>
<?php endif; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary">
<?php echo JText::_('JLOGIN'); ?>
</button>
</div>
</div>
<?php $return = $this->form->getValue('return', '', $this->params->get('login_redirect_url', $this->params->get('login_redirect_menuitem'))); ?>
<input type="hidden" name="return" value="<?php echo base64_encode($return); ?>" />
<?php echo JHtml::_('form.token'); ?>
</fieldset>
</form>
</div>
<div>
<ul class="nav nav-tabs nav-stacked">
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_RESET'); ?>
</a>
</li>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=remind'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REMIND'); ?>
</a>
</li>
<?php $usersConfig = JComponentHelper::getParams('com_users'); ?>
<?php if ($usersConfig->get('allowUserRegistration')) : ?>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?>
</a>
</li>
<?php endif; ?>
</ul>
</div>

View File

@ -0,0 +1,93 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
?>
<script src="https://www.google.com/recaptcha/api.js"></script>
<style>
#main-text {
margin-left: 30%;
}
#reg-btn {
margin-left: 10%;
}
</style>
<div class="registration<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
</div>
<?php endif; ?>
<form id="member-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=registration.registernew'); ?>" method="post" class="form-validate form-horizontal well" enctype="multipart/form-data">
<?php // Iterate through the form fieldsets and display each one.
?>
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<?php $fields = $this->form->getFieldset($fieldset->name); ?>
<?php if (count($fields)) : ?>
<fieldset>
<?php // If the fieldset has a label set, display it as the legend.
?>
<?php if (isset($fieldset->label)) : ?>
<legend><?php echo JText::_($fieldset->label); ?></legend>
<?php endif; ?>
<?php // Iterate through the fields in the set and display them.
?>
<?php foreach ($fields as $field) : ?>
<?php // If the field is hidden, just display the input.
?>
<?php if ($field->hidden) : ?>
<?php echo $field->input; ?>
<?php else : ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
<?php if (!$field->required && $field->type !== 'Spacer') : ?>
<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL'); ?></span>
<?php endif; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</fieldset>
<?php endif; ?>
<?php endforeach; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary validate g-recaptcha" data-sitekey="6Le1o70lAAAAAAyKS0PSXpNnU8YfFzpKOUqxB6We" data-callback='onCatpchaSubmitRegistration' data-action='submit'>
<?php echo JText::_('JREGISTER'); ?>
</button>
<a class="btn" href="<?php echo JRoute::_(''); ?>" title="<?php echo JText::_('JCANCEL'); ?>">
<?php echo JText::_('JCANCEL'); ?>
</a>
<input type="hidden" name="option" value="com_users" />
<input type="hidden" name="task" value="registration.testReg" />
</div>
</div>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
<script>
function onCatpchaSubmitRegistration(token) {
document.getElementById("member-registration").submit();
}
</script>

View File

@ -0,0 +1,53 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
die();
?>
<div class="remind<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<form id="user-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=remind.remind'); ?>" method="post" class="form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<p><?php echo JText::_($fieldset->label); ?></p>
<?php foreach ($this->form->getFieldset($fieldset->name) as $name => $field) : ?>
<?php if ($field->hidden === false) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</fieldset>
<?php endforeach; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary validate">
<?php echo JText::_('JSUBMIT'); ?>
</button>
</div>
</div>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>

View File

@ -0,0 +1,49 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
?>
<div class="reset-complete<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<form action="<?php echo JRoute::_('index.php?option=com_users&task=reset.complete'); ?>" method="post" class="form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<p><?php echo JText::_($fieldset->label); ?></p>
<?php foreach ($this->form->getFieldset($fieldset->name) as $name => $field) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endforeach; ?>
</fieldset>
<?php endforeach; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary validate">
<?php echo JText::_('JSUBMIT'); ?>
</button>
</div>
</div>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>

View File

@ -0,0 +1,50 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
?>
<div class="reset-confirm<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<form action="<?php echo JRoute::_('index.php?option=com_users&task=reset.confirm'); ?>" method="post" class="form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<p><?php echo JText::_($fieldset->label); ?></p>
<?php foreach ($this->form->getFieldset($fieldset->name) as $name => $field) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endforeach; ?>
</fieldset>
<?php endforeach; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary validate">
<?php echo JText::_('JSUBMIT'); ?>
</button>
</div>
</div>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>

View File

@ -0,0 +1,52 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
?>
<div class="reset<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<form id="user-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=reset.request'); ?>" method="post" class="form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<p><?php echo JText::_($fieldset->label); ?></p>
<?php foreach ($this->form->getFieldset($fieldset->name) as $name => $field) : ?>
<?php if ($field->hidden === false) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</fieldset>
<?php endforeach; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary validate">
<?php echo JText::_('JSUBMIT'); ?>
</button>
</div>
</div>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>

View File

@ -0,0 +1,133 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Reset view class for Users.
*
* @since 1.5
*/
class UsersViewReset extends JViewLegacy
{
protected $form;
protected $params;
protected $state;
/**
* Method to display the view.
*
* @param string $tpl The template file to include
*
* @return mixed
*
* @since 1.5
*/
public function display($tpl = null)
{
// This name will be used to get the model
$name = $this->getLayout();
// Check that the name is valid - has an associated model.
if (!in_array($name, array('confirm', 'complete')))
{
$name = 'default';
}
if ('default' === $name)
{
$formname = 'Form';
}
else
{
$formname = ucfirst($this->_name) . ucfirst($name) . 'Form';
}
// Get the view data.
$this->form = $this->get($formname);
$this->state = $this->get('State');
$this->params = $this->state->params;
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// Escape strings for HTML output
$this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx'), ENT_COMPAT, 'UTF-8');
$this->prepareDocument();
parent::display($tpl);
}
/**
* Prepares the document.
*
* @return void
*
* @since 1.6
*/
protected function prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
}
else
{
$this->params->def('page_heading', JText::_('COM_USERS_RESET'));
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots', $this->params->get('robots'));
}
}
}

View File

@ -0,0 +1,99 @@
; Joomla! Project
; Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
COM_CONTENT_GO_THERE="Go there"
COM_CONTENT_MORE_CONTENT="Content"
COM_CONTENT_ACCESS_DELETE_DESC="Inherited state for <strong>delete actions</strong> on this article and the calculated state based on the menu selection."
COM_CONTENT_ACCESS_EDIT_DESC="Inherited state for <strong>edit actions</strong> on this article and the calculated state based on the menu selection."
COM_CONTENT_ACCESS_EDITSTATE_DESC="Inherited state for <strong>edit state actions</strong> on this article and the calculated state based on the menu selection."
COM_CONTENT_ARTICLE_CONTENT="Content"
COM_CONTENT_ARTICLE_HITS="Hits: %s"
COM_CONTENT_ARTICLE_INFO="Details"
COM_CONTENT_ARTICLE_VOTE_FAILURE="You already rated this Article today!"
COM_CONTENT_ARTICLE_VOTE_SUCCESS="Thank You for rating this Article."
COM_CONTENT_AUTHOR_FILTER_LABEL="Author Filter"
COM_CONTENT_CAPTCHA_DESC="Please complete the security check."
COM_CONTENT_CAPTCHA_LABEL="Captcha"
COM_CONTENT_CATEGORY="Category: %s"
COM_CONTENT_CATEGORY_LIST_TABLE_CAPTION="List of articles in category %s"
COM_CONTENT_CHECKED_OUT_BY="Checked out by %s"
COM_CONTENT_CONTENT_TYPE_ARTICLE="Article"
COM_CONTENT_CONTENT_TYPE_CATEGORY="Article Category"
COM_CONTENT_CREATE_ARTICLE="Submit new article"
COM_CONTENT_CREATED_DATE="Created Date"
COM_CONTENT_CREATED_DATE_ON="Created: %s"
COM_CONTENT_EDIT_ITEM="Edit Article"
COM_CONTENT_ERROR_ARTICLE_NOT_FOUND="Article not found"
COM_CONTENT_ERROR_LOGIN_TO_VIEW_ARTICLE="Please login to view the article"
COM_CONTENT_ERROR_PARENT_CATEGORY_NOT_FOUND="Parent category not found"
COM_CONTENT_FEED_READMORE="Read More ..."
COM_CONTENT_FIELD_FULL_DESC="Select or upload an image for the single article display."
COM_CONTENT_FIELD_FULL_LABEL="Full Article Image"
COM_CONTENT_FIELD_IMAGE_ALT_DESC="Alternative text used for visitors without access to images."
COM_CONTENT_FIELD_IMAGE_ALT_LABEL="Alt Text"
COM_CONTENT_FIELD_IMAGE_CAPTION_DESC="Caption attached to the image."
COM_CONTENT_FIELD_IMAGE_CAPTION_LABEL="Caption"
COM_CONTENT_FIELD_IMAGE_DESC="The image to be displayed."
COM_CONTENT_FIELD_INTRO_DESC="Select or upload an image for the intro text layouts such as blogs and featured."
COM_CONTENT_FIELD_INTRO_LABEL="Intro Image"
COM_CONTENT_FIELD_URL_DESC="Link for display."
COM_CONTENT_FIELD_URL_LINK_TEXT_DESC="Text to display for the link."
COM_CONTENT_FIELD_URL_LINK_TEXT_LABEL="Link Text"
COM_CONTENT_FIELD_URLA_LABEL="Link A"
COM_CONTENT_FIELD_URLA_LINK_TEXT_LABEL="Link A Text"
COM_CONTENT_FIELD_URLB_LABEL="Link B"
COM_CONTENT_FIELD_URLB_LINK_TEXT_LABEL="Link B Text"
COM_CONTENT_FIELD_URLC_LABEL="Link C"
COM_CONTENT_FIELD_URLC_LINK_TEXT_LABEL="Link C Text"
COM_CONTENT_FILTER_SEARCH_DESC="Content Filter Search"
COM_CONTENT_FLOAT_DESC="Controls placement of the image."
COM_CONTENT_FLOAT_FULLTEXT_LABEL="Full text image float."
COM_CONTENT_FLOAT_INTRO_LABEL="Intro Image float"
COM_CONTENT_FLOAT_LABEL="Image Float"
COM_CONTENT_FORM_EDIT_ARTICLE="Edit an article"
COM_CONTENT_FORM_FILTER_LEGEND="Filters"
COM_CONTENT_FORM_FILTER_SUBMIT="Filter"
COM_CONTENT_HEADING_TITLE="Title"
COM_CONTENT_HITS_FILTER_LABEL="Hits Filter"
COM_CONTENT_IMAGES_AND_URLS="Images and Links"
COM_CONTENT_INTROTEXT="Article must have some content."
COM_CONTENT_INVALID_RATING="Article Rating: Invalid Rating: %s"
COM_CONTENT_LAST_UPDATED="Last Updated: %s"
COM_CONTENT_LEFT="Left"
COM_CONTENT_METADATA="Metadata"
COM_CONTENT_MODAL_FILTER_SEARCH_DESC="Search in title and alias. Prefix with ID: or AUTHOR: to search for an article ID or article author."
COM_CONTENT_MODAL_FILTER_SEARCH_LABEL="Search Articles"
COM_CONTENT_MODIFIED_DATE="Modified Date"
COM_CONTENT_MONTH="Month"
COM_CONTENT_MORE_ARTICLES="More articles..."
COM_CONTENT_NEW_ARTICLE="New Article"
COM_CONTENT_NO_ARTICLES="There are no articles in this category. If subcategories display on this page, they may have articles."
COM_CONTENT_NONE="None"
COM_CONTENT_NUM_ITEMS="Article Count:"
COM_CONTENT_NUM_ITEMS_TIP="Article Count"
COM_CONTENT_ON_NEW_CONTENT="A new Article has been submitted by '%1$s' entitled '%2$s'."
COM_CONTENT_ORDERING="Ordering:<br />New articles default to the first position in the Category. The ordering can be changed in Backend."
COM_CONTENT_PAGEBREAK_DOC_TITLE="Page Break"
COM_CONTENT_PAGEBREAK_INSERT_BUTTON="Insert Page Break"
COM_CONTENT_PAGEBREAK_TITLE="Page Title:"
COM_CONTENT_PAGEBREAK_TOC="Table of Contents Alias:"
COM_CONTENT_PARENT="Parent Category: %s"
COM_CONTENT_PUBLISHED_DATE="Published Date"
COM_CONTENT_PUBLISHED_DATE_ON="Published: %s"
COM_CONTENT_PUBLISHING="Publishing"
COM_CONTENT_RATINGS="Rating"
COM_CONTENT_RATINGS_COUNT="Rating: %s"
COM_CONTENT_READ_MORE="Read more: "
COM_CONTENT_READ_MORE_TITLE="Read more ..."
COM_CONTENT_REGISTER_TO_READ_MORE="Register to read more ..."
COM_CONTENT_RIGHT="Right"
COM_CONTENT_SAVE_SUCCESS="Article saved."
COM_CONTENT_SAVE_WARNING="Alias already existed so a number was added at the end. If you want to change the alias, please contact a site administrator"
COM_CONTENT_SELECT_AN_ARTICLE="Select an Article"
COM_CONTENT_SUBMIT_SAVE_SUCCESS="Article submitted."
COM_CONTENT_TITLE_FILTER_LABEL="Title Filter"
COM_CONTENT_VOTES="Vote"
COM_CONTENT_VOTES_COUNT="Vote: %s"
COM_CONTENT_WRITTEN_BY="Written by %s"

View File

@ -0,0 +1,194 @@
; Joomla! Project
; Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8
COM_USERS_LINK_LABEL="<b>Existing customer? Download your software using your user account to login <a class="link" data-toggle="modal" data-target="#myModal">here.</a></b>"
COM_USERS_LINK_LABEL_NEW="Already have an account? <a class="link" data-toggle="modal" data-target="#myModal">Sign in.</a>"
COM_USERS_LOGIN_HEADER="Login"
COM_USERS_LOGIN_LABEL="After signing in you can download and install the 30-day free trial of ARCHLine.XP design software."
COM_USERS_PROFILE_BASIC_LABEL="CREATE ACCOUNT"
COM_USERS_PROFILE_DETAILS_LABEL="Details"
COM_USERS_PROFILE_REQUIRED_LABEL="Required field"
COM_USERS_PROFILE_YES_DESC="Yes"
COM_USERS_PROFILE_NO_DESC="No"
COM_USERS_PROFILE_SPECIALIST_DESC="I would like a product specialist to walk me through the product(s) and its features"
COM_USERS_PROFILE_TRIAL_LABEL="GET YOUR FREE TRIAL"
COM_USERS_PROFILE_PRIVACYPOLICY_LABEL="I have read and agree to the ARCHLine.XP <a href="/legal/privacy-policy" target="_blank">Privacy Policy</a>"
COM_USERS_PROFILE_FIRSTNAME_LABEL="First Name"
COM_USERS_PROFILE_FIRSTNAME_DESC="First Name"
COM_USERS_PROFILE_LASTNAME_LABEL="Last Name"
COM_USERS_PROFILE_LASTNAME_DESC="Last Name"
COM_USERS_PROFILE_EMAIL_DESC="Email address"
COM_USERS_PROFILE_CONFIRMEMAIL_LABEL="Confirm email"
COM_USERS_PROFILE_CONFIRMEMAIL_DESC="Confirm email"
COM_USERS_PROFILE_PASSWORD_LABEL="Password"
COM_USERS_PROFILE_PASSWORD_DESC="Password"
COM_USERS_PROFILE_CONFIRMPASSWORD_LABEL="Confirm password"
COM_USERS_PROFILE_CONFIRMPASSWORD_DESC="Confirm password"
COM_USERS_PROFILE_PHONE_LABEL="Phone number"
COM_USERS_PROFILE_PHONE_DESC="Phone number"
COM_USERS_PROFILE_COUNTRY_LABEL="Country"
COM_USERS_PROFILE_COUNTRY_DESC="--- Please select an option ---"
COM_USERS_PROFILE_PROFESSION_LABEL="Profession"
COM_USERS_PROFILE_PROFESSION_DESC="Select"
COM_USERS_ACTIVATION_TOKEN_NOT_FOUND="Verification code not found."
COM_USERS_CAPTCHA_LABEL="Captcha"
COM_USERS_CAPTCHA_DESC="Please complete the security check."
COM_USERS_DATABASE_ERROR="Error getting the user from the database: %s"
COM_USERS_DESIRED_PASSWORD="Enter your desired password."
COM_USERS_DESIRED_USERNAME="Enter your desired username."
COM_USERS_EDIT_PROFILE="Edit Profile"
COM_USERS_EMAIL_ACCOUNT_DETAILS="Account Details for %s at %s"
COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY="Hello administrator,\n\nA new user has registered at %s.\nThe user has verified their email address and requests that you approve their account.\nThis email has their details:\n\n Name : %s \n email: %s \n Username: %s \n\nYou can activate the user by selecting on the link below:\n %s \n"
COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_SUBJECT="Registration approval required for account of %s at %s"
COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY="Hello %s,\n\nYour account has been activated by an administrator. You can now login at %s using the username %s and the password you chose while registering."
COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT="Account activated for %s at %s"
COM_USERS_EMAIL_PASSWORD_RESET_BODY="Hello,\n\nA request has been made to reset your %s account password. To reset your password, you will need to submit this verification code to verify that the request was legitimate.\n\nThe verification code is %s\n\nSelect the URL below and proceed with resetting your password.\n\n %s \n\nThank you."
COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT="Your %s password reset request"
COM_USERS_EMAIL_REGISTERED_BODY="Hello %s,\n\nThank you for registering at %s.\n\nYou may now log in to %s using the following username and password:\n\nUsername: %s\nPassword: %s"
COM_USERS_EMAIL_REGISTERED_BODY_NOPW="Hello %s,\n\nThank you for registering at %s.\n\nYou may now log in to %s using the username and password you registered with."
COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY="Hello administrator, \n\nA new user '%s', username '%s', has registered at %s."
COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY="Hello %s,\n\nThank you for registering at %s. Your account is created and must be activated before you can use it.\nTo activate the account select the following link or copy-paste it in your browser:\n%s \n\nAfter activation you may login to %s using the following username and password:\n\nUsername: %s\nPassword: %s"
COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW="Hello %s,\n\nThank you for registering at %s. Your account is created and must be activated before you can use it.\nTo activate the account select the following link or copy-paste it in your browser:\n%s \n\nAfter activation you may login to %s using the email address and the password you entered during registration."
COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY="Hello %s,\n\nThank you for registering at %s. Your account is created and must be verified before you can use it.\nTo verify the account select the following link or copy-paste it in your browser:\n %s \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\nOnce that account has been activated you may login to %s using the following username and password:\n\nUsername: %s\nPassword: %s"
COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY_NOPW="Hello %s,\n\nThank you for registering at %s. Your account is created and must be verified before you can use it.\nTo verify the account select the following link or copy-paste it in your browser:\n %s \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\nOnce that account has been activated you may login to %s using the following username and the password you entered during registration:\n\nUsername: %s"
COM_USERS_EMAIL_USERNAME_REMINDER_BODY="Hello,\n\nA username reminder has been requested for your %s account.\n\nYour username is %s.\n\nTo login to your account, select the link below.\n\n%s \n\nThank you."
COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT="Your %s username"
COM_USERS_ERROR_SECRET_CODE_WITHOUT_TFA="You have entered a Secret Code but two factor authentication is not enabled in your user account. If you want to use a secret code to secure your login please edit your user profile and enable two factor authentication."
COM_USERS_FIELD_PASSWORD_RESET_DESC="Please enter the email address associated with your User account.<br />A verification code will be sent to you. Once you have received the verification code, you will be able to choose a new password for your account."
COM_USERS_FIELD_PASSWORD_RESET_LABEL="Email Address"
COM_USERS_FIELD_REMIND_EMAIL_DESC="Please enter the email address associated with your User account.<br />Your username will be emailed to the email address on file."
COM_USERS_FIELD_REMIND_EMAIL_LABEL="Email Address"
COM_USERS_FIELD_RESET_CONFIRM_TOKEN_DESC="Enter the password reset verification code you received by email."
COM_USERS_FIELD_RESET_CONFIRM_TOKEN_LABEL="Verification Code"
COM_USERS_FIELD_RESET_CONFIRM_USERNAME_DESC="Enter your username."
COM_USERS_FIELD_RESET_CONFIRM_USERNAME_LABEL="Username"
COM_USERS_FIELD_RESET_PASSWORD1_DESC="Enter your new password."
COM_USERS_FIELD_RESET_PASSWORD1_LABEL="Password"
COM_USERS_FIELD_RESET_PASSWORD1_MESSAGE="The passwords you entered do not match. Please enter your desired password in the password field and confirm your entry by entering it in the confirm password field."
COM_USERS_FIELD_RESET_PASSWORD2_DESC="Confirm your new password."
COM_USERS_FIELD_RESET_PASSWORD2_LABEL="Confirm Password"
COM_USERS_INVALID_EMAIL="Invalid email address"
COM_USERS_LOGIN_IMAGE_ALT="Login image"
COM_USERS_LOGIN_REGISTER="Don't have an account?"
COM_USERS_LOGIN_REMEMBER_ME="Remember me"
COM_USERS_LOGIN_REMIND="Forgot your username?"
COM_USERS_LOGIN_RESET="Forgot your password?"
COM_USERS_LOGIN_USERNAME_LABEL="Username"
COM_USERS_MAIL_FAILED="Failed sending email."
COM_USERS_MAIL_SEND_FAILURE_BODY="An error was encountered when sending the user registration email. The error is: %s The user who tried to register is: %s"
COM_USERS_MAIL_SEND_FAILURE_SUBJECT="Error sending email"
COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N="Password does not have enough digits. At least %s digits are required."
COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N_1="Password does not have enough digits. At least 1 digit is required."
COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N="Password does not have enough symbols. At least %s symbols are required."
COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N_1="Password does not have enough symbols. At least 1 symbol is required."
COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N="Password does not have enough uppercase characters. At least %s upper case characters are required."
COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N_1="Password does not have enough uppercase characters. At least 1 upper case character is required."
COM_USERS_MSG_PASSWORD_TOO_LONG="Password is too long. Passwords must be less than 100 characters."
COM_USERS_MSG_PASSWORD_TOO_SHORT_N="Password is too short. Passwords must have at least %s characters."
COM_USERS_MSG_SPACES_IN_PASSWORD="Password must not have spaces."
COM_USERS_OPTIONAL="(optional)"
COM_USERS_OR="or"
COM_USERS_PROFILE="User Profile"
COM_USERS_PROFILE_BIND_FAILED="Could not bind profile data: %s"
COM_USERS_PROFILE_CORE_LEGEND="Profile"
COM_USERS_PROFILE_CUSTOM_LEGEND="Custom Profile"
COM_USERS_PROFILE_DEFAULT_LABEL="Edit Your Profile"
COM_USERS_PROFILE_EMAIL1_DESC="Enter your email address."
COM_USERS_PROFILE_EMAIL1_LABEL="Email Address"
COM_USERS_PROFILE_EMAIL1_MESSAGE="The email address you entered is already in use or invalid. Please enter another email address."
COM_USERS_PROFILE_EMAIL2_DESC="Confirm your email address."
COM_USERS_PROFILE_EMAIL2_LABEL="Confirm Email Address"
COM_USERS_PROFILE_EMAIL2_MESSAGE="The email addresses you entered do not match. Please enter your email address in the email address field and confirm your entry by entering it in the confirm email address field."
COM_USERS_PROFILE_LAST_VISITED_DATE_LABEL="Last Visited Date"
COM_USERS_PROFILE_MY_PROFILE="My Profile"
COM_USERS_PROFILE_NAME_DESC="Enter your full name."
COM_USERS_PROFILE_NAME_LABEL="Name"
COM_USERS_PROFILE_NEVER_VISITED="This is the first time you visit this site"
COM_USERS_PROFILE_NOCHANGE_USERNAME_DESC="If you want to change your username, please contact a site administrator."
COM_USERS_PROFILE_OTEPS="One time emergency passwords"
COM_USERS_PROFILE_OTEPS_DESC="If you do not have access to your two factor authentication device you can use any of the following passwords instead of a regular security code. Each one of these emergency passwords is immediately destroyed upon use. We recommend printing these passwords out and keeping the printout in a safe and accessible location, eg your wallet or a safety deposit box."
COM_USERS_PROFILE_OTEPS_WAIT_DESC="There are no emergency one time passwords generated in your account. The passwords will be generated automatically and displayed here as soon as you activate two factor authentication."
COM_USERS_PROFILE_PASSWORD1_LABEL="Password"
COM_USERS_PROFILE_PASSWORD1_MESSAGE="The passwords you entered do not match. Please enter your desired password in the password field and confirm your entry by entering it in the confirm password field."
COM_USERS_PROFILE_PASSWORD2_DESC="Confirm your password."
COM_USERS_PROFILE_PASSWORD2_LABEL="Confirm Password"
COM_USERS_PROFILE_REGISTERED_DATE_LABEL="Registered Date"
COM_USERS_PROFILE_SAVE_FAILED="Profile could not be saved: %s"
COM_USERS_PROFILE_SAVE_SUCCESS="Profile saved."
COM_USERS_PROFILE_TWO_FACTOR_AUTH="Two Factor Authentication"
COM_USERS_PROFILE_TWOFACTOR_LABEL="Authentication Method"
COM_USERS_PROFILE_TWOFACTOR_DESC="Which two factor authentication method you want to activate on the user account."
COM_USERS_PROFILE_USERNAME_DESC="Enter your desired username."
COM_USERS_PROFILE_USERNAME_LABEL="Username"
COM_USERS_PROFILE_USERNAME_MESSAGE="The username you entered is not available. Please pick another username."
COM_USERS_PROFILE_VALUE_NOT_FOUND="No Information Entered"
COM_USERS_PROFILE_WELCOME="Welcome, %s"
COM_USERS_REGISTER_DEFAULT_LABEL="Create An Account"
COM_USERS_REGISTER_EMAIL1_DESC="Enter your email address."
COM_USERS_REGISTER_EMAIL1_LABEL="Email Address"
COM_USERS_REGISTER_EMAIL1_MESSAGE="The email address you entered is already in use or invalid. Please enter another email address."
COM_USERS_REGISTER_EMAIL2_DESC="Confirm your email address."
COM_USERS_REGISTER_EMAIL2_LABEL="Confirm Email Address"
COM_USERS_REGISTER_EMAIL2_MESSAGE="The email addresses you entered do not match. Please enter your email address in the email address field and confirm your entry by entering it in the confirm email address field."
COM_USERS_REGISTER_NAME_DESC="Enter your full name."
COM_USERS_REGISTER_NAME_LABEL="Name"
COM_USERS_REGISTER_PASSWORD1_LABEL="Password"
COM_USERS_REGISTER_PASSWORD1_MESSAGE="The passwords you entered do not match. Please enter your desired password in the password field and confirm your entry by entering it in the confirm password field."
COM_USERS_REGISTER_PASSWORD2_DESC="Confirm your password."
COM_USERS_REGISTER_PASSWORD2_LABEL="Confirm Password"
COM_USERS_REGISTER_REQUIRED="<strong class="_QQ_"red"_QQ_">*</strong> Required field"
COM_USERS_REGISTER_USERNAME_DESC="Enter your desired username."
COM_USERS_REGISTER_USERNAME_LABEL="Username"
COM_USERS_REGISTER_USERNAME_MESSAGE="The username you entered is not available. Please pick another username."
COM_USERS_REGISTRATION="User Registration"
COM_USERS_REGISTRATION_ACTIVATE_SUCCESS="Your Account has been activated. You can now log in using the username and password you chose during the registration."
COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED="An error was encountered while sending activation notification email"
COM_USERS_REGISTRATION_ACTIVATION_SAVE_FAILED="Failed to save activation data: %s"
COM_USERS_REGISTRATION_ADMINACTIVATE_SUCCESS="The user's account has been activated and the user has been notified about it."
COM_USERS_REGISTRATION_BIND_FAILED="Failed to bind registration data: %s"
COM_USERS_REGISTRATION_COMPLETE_ACTIVATE="Your account has been created and an activation link has been sent to the email address you entered. Note that you must activate the account by selecting the activation link when you get the email before you can login."
COM_USERS_REGISTRATION_COMPLETE_VERIFY="Your account has been created and a verification link has been sent to the email address you entered. Note that you must verify the account by selecting the verification link when you get the email and then an administrator will activate your account before you can login."
COM_USERS_REGISTRATION_DEFAULT_LABEL="User Registration"
COM_USERS_REGISTRATION_SAVE_FAILED="Registration failed: %s"
COM_USERS_REGISTRATION_SAVE_SUCCESS="Thank you for registering. You may now log in using the username and password you registered with."
COM_USERS_REGISTRATION_SEND_MAIL_FAILED="An error was encountered while sending the registration email. A message has been sent to the administrator of this site."
COM_USERS_REGISTRATION_VERIFY_SUCCESS="Your email address has been verified. Once an administrator approves your account you will be notified by email and you can login to the site."
COM_USERS_REMIND="Reminder"
COM_USERS_REMIND_DEFAULT_LABEL="Please enter the email address associated with your User account. Your username will be emailed to the email address on file."
COM_USERS_REMIND_EMAIL_LABEL="Your Email"
COM_USERS_REMIND_LIMIT_ERROR_N_HOURS="You have exceeded the maximum number of password resets allowed. Please try again in %s hours."
COM_USERS_REMIND_LIMIT_ERROR_N_HOURS_1="You have exceeded the maximum number of password resets allowed. Please try again in one hour."
COM_USERS_REMIND_REQUEST_ERROR="Error requesting password reminder."
COM_USERS_REMIND_REQUEST_FAILED="Reminder failed: %s"
COM_USERS_REMIND_REQUEST_SUCCESS="Reminder sent. Please check your mail."
COM_USERS_REMIND_SUPERADMIN_ERROR="A Super User can't request a password reminder. Please contact another Super User or use an alternative method."
COM_USERS_RESET="Password Reset"
COM_USERS_RESET_COMPLETE_ERROR="Error completing password reset."
COM_USERS_RESET_COMPLETE_FAILED="Completing reset password failed: %s"
COM_USERS_RESET_COMPLETE_LABEL="To complete the password reset process, please enter a new password."
COM_USERS_RESET_COMPLETE_SUCCESS="Reset password successful. You may now login to the site."
COM_USERS_RESET_CONFIRM_ERROR="Error while confirming the password."
COM_USERS_RESET_CONFIRM_FAILED="Your password reset confirmation failed because the verification code was invalid. %s"
COM_USERS_RESET_CONFIRM_LABEL="An email has been sent to your email address. The email has a verification code, please paste the verification code in the field below to prove that you are the owner of this account."
COM_USERS_RESET_COMPLETE_TOKENS_MISSING="Your password reset confirmation failed because the verification code was missing."
COM_USERS_RESET_REQUEST_ERROR="Error requesting password reset."
COM_USERS_RESET_REQUEST_FAILED="Reset password failed: %s"
COM_USERS_RESET_REQUEST_LABEL="Please enter the email address for your account. A verification code will be sent to you. Once you have received the verification code, you will be able to choose a new password for your account."
COM_USERS_SETTINGS_FIELDSET_LABEL="Basic Settings"
COM_USERS_USER_BLOCKED="This user is blocked. If this is an error, please contact an administrator."
COM_USERS_USER_FIELD_BACKEND_LANGUAGE_DESC="Choose your default language for the Backend."
COM_USERS_USER_FIELD_BACKEND_LANGUAGE_LABEL="Backend Language"
COM_USERS_USER_FIELD_BACKEND_TEMPLATE_DESC="Select the template style for the Administrator Backend interface. This will only affect this User."
COM_USERS_USER_FIELD_BACKEND_TEMPLATE_LABEL="Backend Template Style"
COM_USERS_USER_FIELD_EDITOR_DESC="Choose your text editor."
COM_USERS_USER_FIELD_EDITOR_LABEL="Editor"
COM_USERS_USER_FIELD_FRONTEND_LANGUAGE_DESC="Choose your default language for the Frontend."
COM_USERS_USER_FIELD_FRONTEND_LANGUAGE_LABEL="Frontend Language"
COM_USERS_USER_FIELD_HELPSITE_DESC="Help site for the Backend."
COM_USERS_USER_FIELD_HELPSITE_LABEL="Help Site"
COM_USERS_USER_FIELD_TIMEZONE_DESC="Choose your time zone."
COM_USERS_USER_FIELD_TIMEZONE_LABEL="Time Zone"
COM_USERS_USER_NOT_FOUND="User not found."
COM_USERS_USER_SAVE_FAILED="Failed to save user: %s"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,339 @@
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Captcha;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Editor\Editor;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Registry\Registry;
/**
* Joomla! Captcha base object
*
* @abstract
* @package Joomla.Libraries
* @subpackage Captcha
* @since 2.5
*/
class Captcha extends \JObject
{
/**
* An array of Observer objects to notify
*
* @var array
* @since 2.5
*/
protected $_observers = array();
/**
* The state of the observable object
*
* @var mixed
* @since 2.5
*/
protected $_state = null;
/**
* A multi dimensional array of [function][] = key for observers
*
* @var array
* @since 2.5
*/
protected $_methods = array();
/**
* Captcha Plugin object
*
* @var CMSPlugin
* @since 2.5
*/
private $_captcha;
/**
* Editor Plugin name
*
* @var string
* @since 2.5
*/
private $_name;
/**
* Array of instances of this class.
*
* @var Captcha[]
* @since 2.5
*/
private static $_instances = array();
/**
* Class constructor.
*
* @param string $captcha The editor to use.
* @param array $options Associative array of options.
*
* @since 2.5
*/
public function __construct($captcha, $options)
{
$this->_name = $captcha;
$this->_load($options);
}
/**
* Returns the global Captcha object, only creating it
* if it doesn't already exist.
*
* @param string $captcha The plugin to use.
* @param array $options Associative array of options.
*
* @return Captcha|null Instance of this class.
*
* @since 2.5
*/
public static function getInstance($captcha, array $options = array())
{
$signature = md5(serialize(array($captcha, $options)));
if (empty(self::$_instances[$signature])) {
try {
self::$_instances[$signature] = new Captcha($captcha, $options);
} catch (\RuntimeException $e) {
\JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
return;
}
}
return self::$_instances[$signature];
}
/**
* Fire the onInit event to initialise the captcha plugin.
*
* @param string $id The id of the field.
*
* @return boolean True on success
*
* @since 2.5
*/
public function initialise($id)
{
$args['id'] = $id;
$args['event'] = 'onInit';
try {
$this->_captcha->update($args);
} catch (\Exception $e) {
\JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
return false;
}
return true;
}
/**
* Get the HTML for the captcha.
*
* @param string $name The control name.
* @param string $id The id for the control.
* @param string $class Value for the HTML class attribute
*
* @return mixed The return value of the function "onDisplay" of the selected Plugin.
*
* @since 2.5
*/
public function display($name, $id, $class = '')
{
// Check if captcha is already loaded.
if ($this->_captcha === null) {
return;
}
// Initialise the Captcha.
if (!$this->initialise($id)) {
return;
}
$args['name'] = $name;
$args['id'] = $id ?: $name;
$args['class'] = $class ? 'class="' . $class . '"' : '';
$args['event'] = 'onDisplay';
return $this->_captcha->update($args);
}
/**
* Checks if the answer is correct.
*
* @param string $code The answer.
*
* @return mixed The return value of the function "onCheckAnswer" of the selected Plugin.
*
* @since 2.5
*/
public function checkAnswer($code)
{
// Check if captcha is already loaded
if ($this->_captcha === null) {
return;
}
$args['code'] = $code;
$args['event'] = 'onCheckAnswer';
return $this->_captcha->update($args);
}
/**
* Load the Captcha plugin.
*
* @param array $options Associative array of options.
*
* @return void
*
* @since 2.5
* @throws \RuntimeException
*/
private function _load(array $options = array())
{
// Build the path to the needed captcha plugin
$name = \JFilterInput::getInstance()->clean($this->_name, 'cmd');
$path = JPATH_PLUGINS . '/captcha/' . $name . '/' . $name . '.php';
if (!is_file($path)) {
return; // TODO: Mindig kiirja a hibat, ha ki van kapcsolva a Captcha, v3 miatt lett kiszedve
throw new \RuntimeException(\JText::sprintf('JLIB_CAPTCHA_ERROR_PLUGIN_NOT_FOUND', $name));
}
// Require plugin file
require_once $path;
// Get the plugin
$plugin = PluginHelper::getPlugin('captcha', $this->_name);
if (!$plugin) {
return; // TODO: Mindig kiirja a hibat, ha ki van kapcsolva a Captcha, v3 miatt lett kiszedve
throw new \RuntimeException(\JText::sprintf('JLIB_CAPTCHA_ERROR_PLUGIN_NOT_FOUND', $name));
}
// Check for already loaded params
if (!($plugin->params instanceof Registry)) {
$params = new Registry($plugin->params);
$plugin->params = $params;
}
// Build captcha plugin classname
$name = 'PlgCaptcha' . $this->_name;
$this->_captcha = new $name($this, (array) $plugin, $options);
}
/**
* Get the state of the Captcha object
*
* @return mixed The state of the object.
*
* @since 2.5
*/
public function getState()
{
return $this->_state;
}
/**
* Attach an observer object
*
* @param object $observer An observer object to attach
*
* @return void
*
* @since 2.5
*/
public function attach($observer)
{
if (is_array($observer)) {
if (!isset($observer['handler']) || !isset($observer['event']) || !is_callable($observer['handler'])) {
return;
}
// Make sure we haven't already attached this array as an observer
foreach ($this->_observers as $check) {
if (is_array($check) && $check['event'] == $observer['event'] && $check['handler'] == $observer['handler']) {
return;
}
}
$this->_observers[] = $observer;
end($this->_observers);
$methods = array($observer['event']);
} else {
if (!($observer instanceof Editor)) {
return;
}
// Make sure we haven't already attached this object as an observer
$class = get_class($observer);
foreach ($this->_observers as $check) {
if ($check instanceof $class) {
return;
}
}
$this->_observers[] = $observer;
$methods = array_diff(get_class_methods($observer), get_class_methods('\JPlugin'));
}
$key = key($this->_observers);
foreach ($methods as $method) {
$method = strtolower($method);
if (!isset($this->_methods[$method])) {
$this->_methods[$method] = array();
}
$this->_methods[$method][] = $key;
}
}
/**
* Detach an observer object
*
* @param object $observer An observer object to detach.
*
* @return boolean True if the observer object was detached.
*
* @since 2.5
*/
public function detach($observer)
{
$retval = false;
$key = array_search($observer, $this->_observers);
if ($key !== false) {
unset($this->_observers[$key]);
$retval = true;
foreach ($this->_methods as &$method) {
$k = array_search($key, $method);
if ($k !== false) {
unset($method[$k]);
}
}
}
return $retval;
}
}

View File

@ -0,0 +1,75 @@
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Form\Rule;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Captcha\Captcha;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Form\FormRule;
use Joomla\Registry\Registry;
/**
* Form Rule class for the Joomla Framework.
*
* @since 2.5
*/
class CaptchaRule extends FormRule
{
/**
* Method to test if the Captcha is correct.
*
* @param \SimpleXMLElement $element The SimpleXMLElement object representing the `<field>` tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control value. This acts as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
* @param Registry $input An optional Registry object with the entire data set to validate against the entire form.
* @param Form $form The form object for which the field is being tested.
*
* @return boolean True if the value is valid, false otherwise.
*
* @since 2.5
*/
public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null)
{
$app = \JFactory::getApplication();
$plugin = $app->get('captcha');
if ($app->isClient('site')) {
$plugin = $app->getParams()->get('captcha', $plugin);
}
$namespace = $element['namespace'] ?: $form->getName();
// Use 0 for none
if ($plugin === 0 || $plugin === '0') {
return true;
} else {
$captcha = Captcha::getInstance((string) $plugin, array('namespace' => (string) $namespace));
}
if ($value == null)
return true;
// Test the value.
if (!$captcha->checkAnswer($value)) {
$error = $captcha->getError();
if ($error instanceof \Exception) {
return $error;
} else {
return new \JException($error);
}
}
return true;
}
}

View File

@ -0,0 +1,124 @@
<?php
/**
* @package Joomla.Site
* @subpackage mod_login
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
require_once JPATH_SITE . '/components/com_users/helpers/route.php';
JHtml::_('behavior.keepalive');
JHtml::_('bootstrap.tooltip');
?>
<form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure')); ?>" method="post" id="login-form" class="form-inline">
<?php if ($params->get('pretext')) : ?>
<div class="pretext">
<p><?php echo $params->get('pretext'); ?></p>
</div>
<?php endif; ?>
<div class="userdata">
<div id="form-login-username" class="control-group">
<div class="controls">
<?php if (!$params->get('usetext')) : ?>
<div class="input-prepend">
<span class="add-on">
<span class="icon-user hasTooltip" title="<?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?>"></span>
<label for="modlgn-username" class="element-invisible"><?php echo JText::_('MOD_LOGIN_VALUE_USERNAME'); ?></label>
</span>
<input id="modlgn-username" type="text" name="username" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?>" />
</div>
<?php else: ?>
<label for="modlgn-username"><?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?></label>
<input id="modlgn-username" type="text" name="username" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?>" />
<?php endif; ?>
</div>
</div>
<div id="form-login-password" class="control-group">
<div class="controls">
<?php if (!$params->get('usetext')) : ?>
<div class="input-prepend">
<span class="add-on">
<span class="icon-lock hasTooltip" title="<?php echo JText::_('JGLOBAL_PASSWORD') ?>">
</span>
<label for="modlgn-passwd" class="element-invisible"><?php echo JText::_('JGLOBAL_PASSWORD'); ?>
</label>
</span>
<input id="modlgn-passwd" type="password" name="password" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('JGLOBAL_PASSWORD') ?>" />
</div>
<?php else: ?>
<label for="modlgn-passwd"><?php echo JText::_('JGLOBAL_PASSWORD') ?></label>
<input id="modlgn-passwd" type="password" name="password" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('JGLOBAL_PASSWORD') ?>" />
<?php endif; ?>
</div>
</div>
<?php if (count($twofactormethods) > 1): ?>
<div id="form-login-secretkey" class="control-group">
<div class="controls">
<?php if (!$params->get('usetext')) : ?>
<div class="input-prepend input-append">
<span class="add-on">
<span class="icon-star hasTooltip" title="<?php echo JText::_('JGLOBAL_SECRETKEY'); ?>">
</span>
<label for="modlgn-secretkey" class="element-invisible"><?php echo JText::_('JGLOBAL_SECRETKEY'); ?>
</label>
</span>
<input id="modlgn-secretkey" autocomplete="off" type="text" name="secretkey" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('JGLOBAL_SECRETKEY') ?>" />
<span class="btn width-auto hasTooltip" title="<?php echo JText::_('JGLOBAL_SECRETKEY_HELP'); ?>">
<span class="icon-help"></span>
</span>
</div>
<?php else: ?>
<label for="modlgn-secretkey"><?php echo JText::_('JGLOBAL_SECRETKEY') ?></label>
<input id="modlgn-secretkey" autocomplete="off" type="text" name="secretkey" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('JGLOBAL_SECRETKEY') ?>" />
<span class="btn width-auto hasTooltip" title="<?php echo JText::_('JGLOBAL_SECRETKEY_HELP'); ?>">
<span class="icon-help"></span>
</span>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
<div id="form-login-remember" class="control-group checkbox">
<label for="modlgn-remember" class="control-label"><?php echo JText::_('MOD_LOGIN_REMEMBER_ME') ?></label> <input id="modlgn-remember" type="checkbox" name="remember" class="inputbox" value="yes"/>
</div>
<?php endif; ?>
<div id="form-login-submit" class="control-group">
<div class="controls">
<button type="submit" tabindex="0" name="Submit" class="btn btn-primary"><?php echo JText::_('JLOGIN') ?></button>
</div>
</div>
<?php
$usersConfig = JComponentHelper::getParams('com_users'); ?>
<ul class="unstyled">
<?php if ($usersConfig->get('allowUserRegistration')) : ?>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration&Itemid=' . UsersHelperRoute::getRegistrationRoute()); ?>">
<?php echo JText::_('MOD_LOGIN_REGISTER'); ?> <span class="icon-arrow-right"></span></a>
</li>
<?php endif; ?>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=remind&Itemid=' . UsersHelperRoute::getRemindRoute()); ?>">
<?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_USERNAME'); ?></a>
</li>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=reset&Itemid=' . UsersHelperRoute::getResetRoute()); ?>">
<?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD'); ?></a>
</li>
</ul>
<input type="hidden" name="option" value="com_users" />
<input type="hidden" name="task" value="user.login" />
<input type="hidden" name="return" value="<?php echo $return; ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
<?php if ($params->get('posttext')) : ?>
<div class="posttext">
<p><?php echo $params->get('posttext'); ?></p>
</div>
<?php endif; ?>
</form>

View File

@ -0,0 +1,332 @@
<?php
/**
* @package Joomla.Plugin
* @subpackage Captcha
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Recaptcha Plugin.
* Based on the official recaptcha library( https://developers.google.com/recaptcha/docs/php )
*
* @since 2.5
*/
class PlgCaptchaRecaptcha extends JPlugin
{
/**
* Load the language file on instantiation.
*
* @var boolean
* @since 3.1
*/
protected $autoloadLanguage = true;
/**
* Initialise the captcha
*
* @param string $id The id of the field.
*
* @return Boolean True on success, false otherwise
*
* @throws Exception
*
* @since 2.5
*/
public function onInit($id = 'dynamic_recaptcha_1')
{
$pubkey = $this->params->get('public_key', '');
if ($pubkey === '')
{
throw new Exception(JText::_('PLG_RECAPTCHA_ERROR_NO_PUBLIC_KEY'));
}
if ($this->params->get('version', '1.0') === '1.0')
{
JHtml::_('jquery.framework');
$theme = $this->params->get('theme', 'clean');
$file = 'https://www.google.com/recaptcha/api/js/recaptcha_ajax.js';
JHtml::_('script', $file);
JFactory::getDocument()->addScriptDeclaration('jQuery( document ).ready(function()
{Recaptcha.create("' . $pubkey . '", "' . $id . '", {theme: "' . $theme . '",' . $this->_getLanguage() . 'tabindex: 0});});');
}
else
{
// Load callback first for browser compatibility
JHtml::_('script', 'plg_captcha_recaptcha/recaptcha.min.js', array('version' => 'auto', 'relative' => true));
$file = 'https://www.google.com/recaptcha/api.js?onload=JoomlaInitReCaptcha2&render=explicit&hl=' . JFactory::getLanguage()->getTag();
JHtml::_('script', $file);
}
return true;
}
/**
* Gets the challenge HTML
*
* @param string $name The name of the field. Not Used.
* @param string $id The id of the field.
* @param string $class The class of the field. This should be passed as
* e.g. 'class="required"'.
*
* @return string The HTML to be embedded in the form.
*
* @since 2.5
*/
public function onDisplay($name = null, $id = 'dynamic_recaptcha_1', $class = '')
{
if ($this->params->get('version', '1.0') === '1.0')
{
return '<div id="' . $id . '" ' . $class . '></div>';
}
else
{
return '<div id="' . $id . '" ' . str_replace('class="', 'class="g-recaptcha ', $class)
. ' data-sitekey="' . $this->params->get('public_key', '')
. '" data-theme="' . $this->params->get('theme2', 'light')
. '" data-size="' . $this->params->get('size', 'normal')
. '"></div>';
}
}
/**
* Calls an HTTP POST function to verify if the user's guess was correct
*
* @param string $code Answer provided by user. Not needed for the Recaptcha implementation
*
* @return True if the answer is correct, false otherwise
*
* @since 2.5
*/
public function onCheckAnswer($code = null)
{
$input = JFactory::getApplication()->input;
$privatekey = $this->params->get('private_key');
$version = $this->params->get('version', '1.0');
$remoteip = $input->server->get('REMOTE_ADDR', '', 'string');
switch ($version)
{
case '1.0':
$challenge = $input->get('recaptcha_challenge_field', '', 'string');
$response = $input->get('recaptcha_response_field', '', 'string');
$spam = ($challenge === '' || $response === '');
break;
case '2.0':
// Challenge Not needed in 2.0 but needed for getResponse call
$challenge = null;
$response = $input->get('g-recaptcha-response', '', 'string');
$spam = ($response === '');
break;
}
// Check for Private Key
if (empty($privatekey))
{
$this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_NO_PRIVATE_KEY'));
return false;
}
// Check for IP
if (empty($remoteip))
{
$this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_NO_IP'));
return false;
}
// Discard spam submissions
if ($spam)
{
$this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_EMPTY_SOLUTION'));
return false;
}
return $this->getResponse($privatekey, $remoteip, $response, $challenge);
}
/**
* Get the reCaptcha response.
*
* @param string $privatekey The private key for authentication.
* @param string $remoteip The remote IP of the visitor.
* @param string $response The response received from Google.
* @param string $challenge The challenge field from the reCaptcha. Only for 1.0.
*
* @return bool True if response is good | False if response is bad.
*
* @since 3.4
*/
private function getResponse($privatekey, $remoteip, $response, $challenge = null)
{
$version = $this->params->get('version', '1.0');
switch ($version)
{
case '1.0':
$response = $this->_recaptcha_http_post(
'www.google.com', '/recaptcha/api/verify',
array(
'privatekey' => $privatekey,
'remoteip' => $remoteip,
'challenge' => $challenge,
'response' => $response
)
);
$answers = explode("\n", $response[1]);
if (trim($answers[0]) !== 'true')
{
// @todo use exceptions here
$this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_' . strtoupper(str_replace('-', '_', $answers[1]))));
return false;
}
break;
case '2.0':
require_once 'plugins/captcha/recaptcha/recaptchalib.php';
$reCaptcha = new JReCaptcha($privatekey);
$response = $reCaptcha->verifyResponse($remoteip, $response);
if (!isset($response->success) || !$response->success)
{
// @todo use exceptions here
if (is_array($response->errorCodes))
{
foreach ($response->errorCodes as $error)
{
$this->_subject->setError($error);
}
}
return false;
}
break;
}
return true;
}
/**
* Encodes the given data into a query string format.
*
* @param array $data Array of string elements to be encoded
*
* @return string Encoded request
*
* @since 2.5
*/
private function _recaptcha_qsencode($data)
{
$req = '';
foreach ($data as $key => $value)
{
$req .= $key . '=' . urlencode(stripslashes($value)) . '&';
}
// Cut the last '&'
$req = rtrim($req, '&');
return $req;
}
/**
* Submits an HTTP POST to a reCAPTCHA server.
*
* @param string $host Host name to POST to.
* @param string $path Path on host to POST to.
* @param array $data Data to be POSTed.
* @param int $port Optional port number on host.
*
* @return array Response
*
* @since 2.5
*/
private function _recaptcha_http_post($host, $path, $data, $port = 80)
{
$req = $this->_recaptcha_qsencode($data);
$http_request = "POST $path HTTP/1.0\r\n";
$http_request .= "Host: $host\r\n";
$http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
$http_request .= "Content-Length: " . strlen($req) . "\r\n";
$http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
$http_request .= "\r\n";
$http_request .= $req;
$response = '';
if (($fs = @fsockopen($host, $port, $errno, $errstr, 10)) === false)
{
die('Could not open socket');
}
fwrite($fs, $http_request);
while (!feof($fs))
{
// One TCP-IP packet
$response .= fgets($fs, 1160);
}
fclose($fs);
$response = explode("\r\n\r\n", $response, 2);
return $response;
}
/**
* Get the language tag or a custom translation
*
* @return string
*
* @since 2.5
*/
private function _getLanguage()
{
$language = JFactory::getLanguage();
$tag = explode('-', $language->getTag());
$tag = $tag[0];
$available = array('en', 'pt', 'fr', 'de', 'nl', 'ru', 'es', 'tr');
if (in_array($tag, $available))
{
return "lang : '" . $tag . "',";
}
// If the default language is not available, let's search for a custom translation
if ($language->hasKey('PLG_RECAPTCHA_CUSTOM_LANG'))
{
$custom[] = 'custom_translations : {';
$custom[] = "\t" . 'instructions_visual : "' . JText::_('PLG_RECAPTCHA_INSTRUCTIONS_VISUAL') . '",';
$custom[] = "\t" . 'instructions_audio : "' . JText::_('PLG_RECAPTCHA_INSTRUCTIONS_AUDIO') . '",';
$custom[] = "\t" . 'play_again : "' . JText::_('PLG_RECAPTCHA_PLAY_AGAIN') . '",';
$custom[] = "\t" . 'cant_hear_this : "' . JText::_('PLG_RECAPTCHA_CANT_HEAR_THIS') . '",';
$custom[] = "\t" . 'visual_challenge : "' . JText::_('PLG_RECAPTCHA_VISUAL_CHALLENGE') . '",';
$custom[] = "\t" . 'audio_challenge : "' . JText::_('PLG_RECAPTCHA_AUDIO_CHALLENGE') . '",';
$custom[] = "\t" . 'refresh_btn : "' . JText::_('PLG_RECAPTCHA_REFRESH_BTN') . '",';
$custom[] = "\t" . 'help_btn : "' . JText::_('PLG_RECAPTCHA_HELP_BTN') . '",';
$custom[] = "\t" . 'incorrect_try_again : "' . JText::_('PLG_RECAPTCHA_INCORRECT_TRY_AGAIN') . '",';
$custom[] = '},';
$custom[] = "lang : '" . $tag . "',";
return implode("\n", $custom);
}
// If nothing helps fall back to english
return '';
}
}

View File

@ -0,0 +1,153 @@
<?php
/**
* This is a PHP library that handles calling reCAPTCHA.
* - Documentation and latest version
* https://developers.google.com/recaptcha/docs/php
* - Get a reCAPTCHA API Key
* https://www.google.com/recaptcha/admin/create
* - Discussion group
* http://groups.google.com/group/recaptcha
*
* @copyright Copyright (c) 2014, Google Inc.
* @link http://www.google.com/recaptcha
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* A JReCaptchaResponse is returned from checkAnswer().
*/
class JReCaptchaResponse
{
public $success;
public $errorCodes;
}
class JReCaptcha
{
private static $_signupUrl = 'https://www.google.com/recaptcha/admin';
private static $_siteVerifyUrl = 'https://www.google.com/recaptcha/api/siteverify';
private $_secret;
private static $_version = 'php_1.0';
/**
* Constructor.
*
* @param string $secret shared secret between site and ReCAPTCHA server.
*/
public function __construct($secret)
{
if ($secret === null || $secret === '') {
die("To use reCAPTCHA you must get an API key from <a href='"
. self::$_signupUrl . "'>" . self::$_signupUrl . "</a>");
}
$this->_secret = $secret;
}
/**
* Encodes the given data into a query string format.
*
* @param array $data array of string elements to be encoded.
*
* @return string - encoded request.
*/
private function _encodeQS($data)
{
$req = '';
foreach ($data as $key => $value) {
$req .= $key . '=' . urlencode(stripslashes($value)) . '&';
}
// Cut the last '&'
return substr($req, 0, strlen($req) - 1);
}
/**
* Submits an HTTP GET to a reCAPTCHA server.
*
* @param string $path URL path to recaptcha server.
* @param array $data array of parameters to be sent.
*
* @return mixed JSON string or false on error
*/
private function _submitHTTPGet($path, $data)
{
$req = $this->_encodeQS($data);
try {
$http = JHttpFactory::getHttp();
$result = $http->get($path . '?' . $req)->body;
} catch (RuntimeException $e) {
return false;
}
return $result;
}
/**
* Calls the reCAPTCHA siteverify API to verify whether the user passes
* CAPTCHA test.
*
* @param string $remoteIp IP address of end user.
* @param string $response response string from recaptcha verification.
*
* @return JReCaptchaResponse
*/
public function verifyResponse($remoteIp, $response)
{
// Discard empty solution submissions
if ($response === null || $response === '') {
$recaptchaResponse = new JReCaptchaResponse();
$recaptchaResponse->success = false;
$recaptchaResponse->errorCodes = 'missing-input';
return $recaptchaResponse;
}
$getResponse = $this->_submitHttpGet(
self::$_siteVerifyUrl,
array(
'secret' => $this->_secret,
'remoteip' => $remoteIp,
'v' => self::$_version,
'response' => $response
)
);
// Something is broken in submiting the http get request
if ($getResponse === false) {
$recaptchaResponse->success = false;
}
$answers = json_decode($getResponse, true);
$recaptchaResponse = new JReCaptchaResponse();
if (trim($answers['success']) !== '') {
$recaptchaResponse->success = true;
} else {
$recaptchaResponse->success = false;
$recaptchaResponse->errorCodes = isset($answers['error-codes']) ? $answers['error-codes'] : '';
}
return $recaptchaResponse;
}
}

View File

@ -0,0 +1,239 @@
<?php
/**
* @package Joomla.Plugin
* @subpackage Quickicon.phpversioncheck
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Plugin to check the PHP version and display a warning about its support status
*
* @since 3.7.0
*/
class PlgQuickiconPhpVersionCheck extends JPlugin
{
/**
* Constant representing the active PHP version being fully supported
*
* @var integer
* @since 3.7.0
*/
const PHP_SUPPORTED = 0;
/**
* Constant representing the active PHP version receiving security support only
*
* @var integer
* @since 3.7.0
*/
const PHP_SECURITY_ONLY = 1;
/**
* Constant representing the active PHP version being unsupported
*
* @var integer
* @since 3.7.0
*/
const PHP_UNSUPPORTED = 2;
/**
* Application object.
*
* @var JApplicationCms
* @since 3.7.0
*/
protected $app;
/**
* Load plugin language files automatically
*
* @var boolean
* @since 3.7.0
*/
protected $autoloadLanguage = true;
/**
* Check the PHP version after the admin component has been dispatched.
*
* @param string $context The calling context
*
* @return void
*
* @since 3.7.0
*/
public function onGetIcons($context)
{
if (!$this->shouldDisplayMessage())
{
return;
}
$supportStatus = $this->getPhpSupport();
if ($supportStatus['status'] !== self::PHP_SUPPORTED)
{
// Enqueue the notification message; set a warning if receiving security support or "error" if unsupported
switch ($supportStatus['status'])
{
case self::PHP_SECURITY_ONLY:
$this->app->enqueueMessage($supportStatus['message'], 'warning');
break;
case self::PHP_UNSUPPORTED:
$this->app->enqueueMessage($supportStatus['message'], 'error');
break;
}
}
}
/**
* Gets PHP support status.
*
* @return array Array of PHP support data
*
* @since 3.7.0
* @note The dates used in this method should correspond to the dates given on PHP.net
* @link https://secure.php.net/supported-versions.php
* @link https://secure.php.net/eol.php
*/
private function getPhpSupport()
{
$phpSupportData = array(
'5.3' => array(
'security' => '2013-07-11',
'eos' => '2014-08-14',
),
'5.4' => array(
'security' => '2014-09-14',
'eos' => '2015-09-14',
),
'5.5' => array(
'security' => '2015-07-10',
'eos' => '2016-07-21'
),
'5.6' => array(
'security' => '2017-01-19',
'eos' => '2018-12-31'
),
'7.0' => array(
'security' => '2017-12-03',
'eos' => '2018-12-03'
),
'7.1' => array(
'security' => '2018-12-01',
'eos' => '2019-12-01'
),
'7.2' => array(
'security' => '2019-11-30',
'eos' => '2020-11-30'
),
);
// Fill our return array with default values
$supportStatus = array(
'status' => self::PHP_SUPPORTED,
'message' => null,
);
// Check the PHP version's support status using the minor version
$activePhpVersion = PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;
// Do we have the PHP version's data?
if (isset($phpSupportData[$activePhpVersion]))
{
// First check if the version has reached end of support
$today = new JDate;
$phpEndOfSupport = new JDate($phpSupportData[$activePhpVersion]['eos']);
if ($phpNotSupported = $today > $phpEndOfSupport)
{
/*
* Find the oldest PHP version still supported that is newer than the current version,
* this is our recommendation for users on unsupported platforms
*/
foreach ($phpSupportData as $version => $versionData)
{
$versionEndOfSupport = new JDate($versionData['eos']);
if (version_compare($version, $activePhpVersion, 'ge') && ($today < $versionEndOfSupport))
{
$recommendedVersion = $version;
$recommendedVersionEndOfSupport = $versionEndOfSupport;
break;
}
}
$supportStatus['status'] = self::PHP_UNSUPPORTED;
/*$supportStatus['message'] = JText::sprintf(
'PLG_QUICKICON_PHPVERSIONCHECK_UNSUPPORTED',
PHP_VERSION,
$recommendedVersion,
$recommendedVersionEndOfSupport->format(JText::_('DATE_FORMAT_LC4'))
);*/
}
// If the version is still supported, check if it has reached eol minus 3 month
$interval = new DateInterval('P3M');
$phpEndOfSupport->sub($interval);
if (!$phpNotSupported && $today > $phpEndOfSupport)
{
$supportStatus['status'] = self::PHP_SECURITY_ONLY;
$supportStatus['message'] = JText::sprintf(
'PLG_QUICKICON_PHPVERSIONCHECK_SECURITY_ONLY', PHP_VERSION, $phpEndOfSupport->format(JText::_('DATE_FORMAT_LC4'))
);
}
}
return $supportStatus;
}
/**
* Determines if the message should be displayed
*
* @return boolean
*
* @since 3.7.0
*/
private function shouldDisplayMessage()
{
// Only on admin app
if (!$this->app->isClient('administrator'))
{
return false;
}
// Only if authenticated
if (JFactory::getUser()->guest)
{
return false;
}
// Only on HTML documents
if ($this->app->getDocument()->getType() !== 'html')
{
return false;
}
// Only on full page requests
if ($this->app->input->getCmd('tmpl', 'index') === 'component')
{
return false;
}
// Only to com_cpanel
if ($this->app->input->get('option') !== 'com_cpanel')
{
return false;
}
return true;
}
}