diff --git a/overrides/components/com_content/views/article/tmpl/default.php b/overrides/components/com_content/views/article/tmpl/default.php
new file mode 100644
index 00000000..04c32af4
--- /dev/null
+++ b/overrides/components/com_content/views/article/tmpl/default.php
@@ -0,0 +1,174 @@
+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');
+
+?>
+
+
+
+ params->get('show_page_heading')) : ?>
+
+ item->pagination) && $this->item->pagination && !$this->item->paginationposition && $this->item->paginationrelative)
+ {
+ echo $this->item->pagination;
+ }
+ ?>
+
+
+ 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); ?>
+
+ print) : ?>
+
+ item, $params); ?>
+
+
+
+ get('show_title') || $params->get('show_author')) : ?>
+
+
+ print) : ?>
+ get('show_print_icon') || $params->get('show_email_icon')) : ?>
+ $params, 'item' => $this->item, 'print' => false)); ?>
+
+
+
+
+ item, $params); ?>
+
+
+
+
+
+ item->event->afterDisplayTitle; ?>
+
+
+
+ $this->item, 'params' => $params, 'position' => 'above')); ?>
+
+
+ get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
+ item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
+
+ item->tagLayout->render($this->item->tags->itemTags); ?>
+
+
+
+ item->event->beforeDisplayContent; ?>
+
+ urls_position) && ($urls->urls_position == '0')) || ($params->get('urls_position') == '0' && empty($urls->urls_position)))
+ || (empty($urls->urls_position) && (!$params->get('urls_position')))) : ?>
+ loadTemplate('links'); ?>
+
+ get('access-view')) : ?>
+ item); ?>
+ item->pagination) && $this->item->pagination && !$this->item->paginationposition && !$this->item->paginationrelative) :
+ echo $this->item->pagination;
+ endif;
+ ?>
+ item->toc)) :
+ echo $this->item->toc;
+ endif; ?>
+
+ item->text; ?>
+
+
+
+
+
+ $this->item, 'params' => $params, 'position' => 'below')); ?>
+
+ get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
+ item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
+ item->tagLayout->render($this->item->tags->itemTags); ?>
+
+
+
+ item->pagination) && $this->item->pagination && $this->item->paginationposition && !$this->item->paginationrelative) :
+ echo $this->item->pagination;
+ ?>
+
+ urls_position) && ($urls->urls_position == '1')) || ($params->get('urls_position') == '1'))) : ?>
+ loadTemplate('links'); ?>
+
+
+ get('show_noauth') == true && $user->get('guest')) : ?>
+ item); ?>
+ item->introtext); ?>
+
+ get('show_readmore') && $this->item->fulltext != null) : ?>
+ getMenu(); ?>
+ getActive(); ?>
+ id; ?>
+
+ setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language))); ?>
+
+
+ item->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; ?>
+
+
+
+
+ item->pagination) && $this->item->pagination && $this->item->paginationposition && $this->item->paginationrelative) :
+ echo $this->item->pagination;
+ ?>
+
+
+ item->event->afterDisplayContent; ?>
+
diff --git a/overrides/components/com_content/views/article/tmpl/default_links.php b/overrides/components/com_content/views/article/tmpl/default_links.php
new file mode 100644
index 00000000..78db3377
--- /dev/null
+++ b/overrides/components/com_content/views/article/tmpl/default_links.php
@@ -0,0 +1,80 @@
+item->urls);
+
+// Create shortcuts to some parameters.
+$params = $this->item->params;
+if ($urls && (!empty($urls->urla) || !empty($urls->urlb) || !empty($urls->urlc))) :
+?>
+
+
+ params->get('show_page_heading')) : ?>
+
+
+
+ params->get('show_category_title', 1) or $this->params->get('page_subheading')) : ?>
+
escape($this->params->get('page_subheading')); ?>
+ params->get('show_category_title')) : ?>
+ category->title; ?>
+
+
+
+
+
+ params->get('show_cat_tags', 1) && !empty($this->category->tags->itemTags)) : ?>
+ category->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
+ category->tagLayout->render($this->category->tags->itemTags); ?>
+
+
+ params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
+
+ params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
+
->get('image'); ?>)
+
+
+ params->get('show_description') && $this->category->description) : ?>
+ category->description, '', 'com_content.category'); ?>
+
+
+
+
+
+ lead_items) && empty($this->link_items) && empty($this->intro_items)) : ?>
+ params->get('show_no_articles', 1)) : ?>
+
+
+
+
+
+ lead_items)) : ?>
+
+ lead_items as &$item) : ?>
+
+ item = &$item;
+ echo $this->loadTemplate('item');
+ ?>
+
+
+
+
+
+
+ intro_items);
+ $counter = 0;
+ ?>
+
+ intro_items)) : ?>
+ intro_items as $key => &$item) : ?>
+ columns) + 1; ?>
+
+ columns; ?>
+
+
+
+
+ item = &$item;
+ echo $this->loadTemplate('item');
+ ?>
+
+
+
+
+ columns) or ($counter == $introcount)) : ?>
+
+
+
+
+
+ link_items)) : ?>
+
+ loadTemplate('links'); ?>
+
+
+
+ maxLevel != 0 && !empty($this->children[$this->category->id])) : ?>
+
+ params->get('show_category_heading_title_text', 1) == 1) : ?>
+
+
+ loadTemplate('children'); ?>
+
+ params->def('show_pagination', 1) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?>
+
+
+
diff --git a/overrides/components/com_users/controllers/profile.php b/overrides/components/com_users/controllers/profile.php
new file mode 100644
index 00000000..05317f70
--- /dev/null
+++ b/overrides/components/com_users/controllers/profile.php
@@ -0,0 +1,237 @@
+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);
+ }
+}
diff --git a/overrides/components/com_users/controllers/registration.php b/overrides/components/com_users/controllers/registration.php
new file mode 100644
index 00000000..25e18e76
--- /dev/null
+++ b/overrides/components/com_users/controllers/registration.php
@@ -0,0 +1,384 @@
+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();
+ }
+}
diff --git a/overrides/components/com_users/controllers/remind.php b/overrides/components/com_users/controllers/remind.php
new file mode 100644
index 00000000..b824ebf3
--- /dev/null
+++ b/overrides/components/com_users/controllers/remind.php
@@ -0,0 +1,90 @@
+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;
+ }
+ }
+}
diff --git a/overrides/components/com_users/controllers/reset.php b/overrides/components/com_users/controllers/reset.php
new file mode 100644
index 00000000..b4ea3e8f
--- /dev/null
+++ b/overrides/components/com_users/controllers/reset.php
@@ -0,0 +1,200 @@
+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;
+ }
+ }
+}
diff --git a/overrides/components/com_users/controllers/user.php b/overrides/components/com_users/controllers/user.php
new file mode 100644
index 00000000..2efa8bdc
--- /dev/null
+++ b/overrides/components/com_users/controllers/user.php
@@ -0,0 +1,374 @@
+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');
+ }
+}
diff --git a/overrides/components/com_users/models/registration.php b/overrides/components/com_users/models/registration.php
new file mode 100644
index 00000000..9ceb9dbc
--- /dev/null
+++ b/overrides/components/com_users/models/registration.php
@@ -0,0 +1,944 @@
+ 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;
+ }
+}
diff --git a/overrides/components/com_users/views/login/tmpl/default_login.php b/overrides/components/com_users/views/login/tmpl/default_login.php
new file mode 100644
index 00000000..cd774aaf
--- /dev/null
+++ b/overrides/components/com_users/views/login/tmpl/default_login.php
@@ -0,0 +1,106 @@
+
+
+ params->get('show_page_heading')) : ?>
+
+
+ params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
+
+
+ params->get('logindescription_show') == 1) : ?>
+ params->get('login_description'); ?>
+
+ params->get('login_image') != '') : ?>
+
); ?>)
+
+ params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
+
+
+
+
+
+ params->get('show_page_heading')) : ?>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/overrides/components/com_users/views/remind/tmpl/default.php b/overrides/components/com_users/views/remind/tmpl/default.php
new file mode 100644
index 00000000..b69557ef
--- /dev/null
+++ b/overrides/components/com_users/views/remind/tmpl/default.php
@@ -0,0 +1,53 @@
+
+
+ params->get('show_page_heading')) : ?>
+
+
+
+
\ No newline at end of file
diff --git a/overrides/components/com_users/views/reset/tmpl/complete.php b/overrides/components/com_users/views/reset/tmpl/complete.php
new file mode 100644
index 00000000..71204a14
--- /dev/null
+++ b/overrides/components/com_users/views/reset/tmpl/complete.php
@@ -0,0 +1,49 @@
+
+
+ params->get('show_page_heading')) : ?>
+
+
+
+
diff --git a/overrides/components/com_users/views/reset/tmpl/confirm.php b/overrides/components/com_users/views/reset/tmpl/confirm.php
new file mode 100644
index 00000000..73a6191c
--- /dev/null
+++ b/overrides/components/com_users/views/reset/tmpl/confirm.php
@@ -0,0 +1,50 @@
+
+
+ params->get('show_page_heading')) : ?>
+
+
+
+
\ No newline at end of file
diff --git a/overrides/components/com_users/views/reset/tmpl/default.php b/overrides/components/com_users/views/reset/tmpl/default.php
new file mode 100644
index 00000000..7bdc93e1
--- /dev/null
+++ b/overrides/components/com_users/views/reset/tmpl/default.php
@@ -0,0 +1,52 @@
+
+
+ params->get('show_page_heading')) : ?>
+
+
+
+
\ No newline at end of file
diff --git a/overrides/components/com_users/views/reset/view.html.php b/overrides/components/com_users/views/reset/view.html.php
new file mode 100644
index 00000000..a65f3916
--- /dev/null
+++ b/overrides/components/com_users/views/reset/view.html.php
@@ -0,0 +1,133 @@
+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('