Skip to content

Commit d836123

Browse files
committed
v1.8 release
1 parent 5a1216d commit d836123

8 files changed

Lines changed: 555 additions & 337 deletions

File tree

helper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ public static function getUserRegister($params = array()){
443443
}
444444
}
445445
}
446+
$_SESSION['jd_user_registered'] = 1;
446447
}
447448
}
448449
public static function getReturnUrl($params, $type)

mod_registerlogin.php

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,65 +7,65 @@
77
* @copyright Copyright (C) 2009 - 2016 www.joomdev.com. All rights reserved.
88
* @license GNU GPL2 or later; see LICENSE.txt
99
*/
10-
defined('_JEXEC') or die;
1110

11+
defined('_JEXEC') or die;
1212
// Include the login functions only once
1313
$language = JFactory::getLanguage();
14-
$language->load('com_users');
14+
$language->load('com_users');
1515
require_once __DIR__ . '/helper.php';
1616
$params->def('greeting', 1);
1717
$user = JFactory::getUser();
1818
$layout = $params->get('layout', 'default');
1919
$app = JFactory::getApplication();
2020
$type = modRegisterLoginHelper::getType();
2121
$return = modRegisterLoginHelper::getReturnURL($params, $type);
22-
$jinput = $app->input->get;
22+
$jinput = JFactory::getApplication()->input;
2323
// user register
24-
$mName = 'module'.$module->id;
24+
$mName = 'module'.$module->id;
2525
$errorMessage = '';
2626
if($jinput->get($mName) == 'register'){
2727
$registerResponse = modRegisterLoginHelper::getUserRegister($params);
2828
if($registerResponse['error']){
29-
$errorMessage = $registerResponse['error_message'];
30-
if($errorMessage == 'Username in use.'){
31-
$errorMessage = JText::_('COM_USERS_REGISTER_USERNAME_MESSAGE');
32-
}
33-
if($errorMessage == 'captcha incorrect'){
34-
$errorMessage = "Captcha code is incorrect , enter a valid captcha code.";
35-
}
36-
}
37-
else{
38-
$useractivation = $params->def('useractivation');
39-
if ($useractivation == 0){
40-
$messge = JText::_('COM_USERS_REGISTRATION_SAVE_SUCCESS');
41-
}
42-
elseif ($useractivation == 1){
43-
$messge = JText::_('COM_USERS_REGISTRATION_COMPLETE_ACTIVATE');
29+
$errorMessage = $registerResponse['error_message'];
30+
if($errorMessage == 'Username in use.'){
31+
$errorMessage = JText::_('COM_USERS_REGISTER_USERNAME_MESSAGE');
32+
}
4433
}else{
45-
$messge = JText::_('COM_USERS_REGISTRATION_COMPLETE_VERIFY');
46-
}
47-
$app->enqueueMessage($messge, 'Success');
48-
if($params->get('login')){
49-
$app->redirect($return);
50-
}else{
51-
$app->redirect(JURI::current());
52-
}
34+
$useractivation = $params->def('useractivation');
35+
if ($useractivation == 0)
36+
{
37+
$messge = JText::_('COM_USERS_REGISTRATION_SAVE_SUCCESS');
38+
}
39+
elseif ($useractivation == 1)
40+
{
41+
$messge = JText::_('COM_USERS_REGISTRATION_COMPLETE_ACTIVATE');
42+
}else{
43+
$messge = JText::_('COM_USERS_REGISTRATION_COMPLETE_VERIFY');
44+
}
45+
46+
$app->enqueueMessage($messge, 'Success');
47+
if($params->get('login')){
48+
$app->redirect($return);
49+
}else{
50+
$app->redirect(JURI::current());
51+
}
5352
}
5453
}
5554
//user login
5655
$loginResponse = '';
5756
$mName = 'module'.$module->id;
5857
if($jinput->get($mName) == 'login'){
5958
$loginResponse = modRegisterLoginHelper::getUserlogin($params);
60-
if(!$loginResponse['error']){
61-
if($params->get('login')){
62-
$app->redirect($return); }
63-
else{
64-
$app->redirect(JURI::current()); }
59+
if(!$loginResponse['error']){
60+
if($params->get('login')){
61+
$app->redirect($return);
62+
}else{
63+
$app->redirect(JURI::current());
64+
}
6565
}
6666
}
6767
if (!$user->guest)
6868
{
6969
$layout .= '_logout';
7070
}
71-
require JModuleHelper::getLayoutPath('mod_registerlogin', $layout);
71+
require JModuleHelper::getLayoutPath('mod_registerlogin', $layout);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
(function($){
2+
$.fn.jdRegisterLogin = function(){
3+
return this.each(function(){
4+
let _this = $(this);
5+
_this.find('[data-tab]').hide();
6+
let _targetActive = _this.find('.active[data-tab-target]').data('tab-target');
7+
$(_targetActive).show();
8+
9+
_this.find('[data-tab-target]').click(function(){
10+
$(this).parent().siblings().children('[data-tab-target]').removeClass('active');
11+
$(this).addClass('active');
12+
let _targetNext = $(this).parent().siblings().children().data('tab-target');
13+
let _target = $(this).data('tab-target');
14+
$(_targetNext).hide();
15+
$(_target).show();
16+
});
17+
});
18+
};
19+
}(jQuery));

tmpl/assets/loader.gif

83.4 KB
Loading

0 commit comments

Comments
 (0)