-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed backend options, moved js to a seperate file, added session tokens
- Loading branch information
mxkmp29
authored and
mxkmp29
committed
Aug 10, 2016
1 parent
cc283cd
commit 3461949
Showing
9 changed files
with
80 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,6 +257,7 @@ | |
rows="4" | ||
cols="50" | ||
filter="string" | ||
showon="allowed_chars_username_preset:1,2,3" | ||
> | ||
</field> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
window.onload = function() { | ||
var ajaxUrl = document.getElementById('ajax-validation').getAttribute('data-url'); | ||
|
||
// check if username is already in database | ||
jQuery('#jform_username').change(function(){ | ||
var name = jQuery(this).val(); | ||
if(name.length){ | ||
jQuery.ajax({ | ||
type: 'POST', | ||
url: ajaxUrl + '&username=' + name | ||
}).done(function(data){ | ||
if(data.success){ | ||
var message = { | ||
'error' : [data.message] | ||
}; | ||
Joomla.renderMessages(message); | ||
} | ||
}); | ||
} | ||
}); | ||
// check if email is already in database | ||
jQuery('#jform_email1').change(function(){ | ||
var mail = jQuery(this).val(); | ||
if(mail.length) { | ||
jQuery.ajax({ | ||
type: 'POST', | ||
url: ajaxUrl + '&email=' + mail | ||
}).done(function (data) { | ||
if (data.success) { | ||
var message = { | ||
'error': [data.message] | ||
}; | ||
Joomla.renderMessages(message); | ||
} | ||
}); | ||
} | ||
}); | ||
//check if emails are equal | ||
jQuery('#jform_email2').change(function(){ | ||
var mail1 = jQuery('#jform_email1').val(); | ||
var mail2 = jQuery('#jform_email2').val(); | ||
if(mail1.length && mail2.length){ | ||
if(mail1 != mail2){ | ||
var message = { | ||
'error' : [ Joomla.JText._('COM_USERS_PROFILE_EMAIL2_MESSAGE') ] | ||
}; | ||
Joomla.renderMessages(message); | ||
} | ||
} | ||
}); | ||
//check if password are equal | ||
jQuery('#jform_password2').change(function(){ | ||
var pass1 = jQuery('#jform_password1').val(); | ||
var pass2 = jQuery('#jform_password2').val(); | ||
if(pass1.length && pass2.length){ | ||
if(pass1 != pass2){ | ||
var message = { | ||
'error' : [ Joomla.JText._('COM_USERS_FIELD_RESET_PASSWORD1_MESSAGE')] | ||
}; | ||
Joomla.renderMessages(message); | ||
} | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.