mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-25 10:10:19 -06:00
Fix email validation and mouse pointer over the Users option.
This commit is contained in:
parent
e4f21568ad
commit
f3fae9d238
@ -69,7 +69,7 @@ try {
|
||||
<li><a href="{{ url_for('security.change_password') }}">{{ _('Change Password') }}</a></li>
|
||||
<li class="divider"></li>
|
||||
{% if is_admin %}
|
||||
<li><a onclick="pgAdmin.Browser.UserManagement.show_users()">{{ _('Users') }}</a></li>
|
||||
<li><a href="#" onclick="pgAdmin.Browser.UserManagement.show_users()">{{ _('Users') }}</a></li>
|
||||
<li class="divider"></li>
|
||||
{% endif %}
|
||||
<li><a href="{{ url_for('security.logout') }}">{{ _('Logout') }}</a></li>
|
||||
|
@ -66,7 +66,10 @@ blueprint = UserManagementModule(
|
||||
|
||||
def validate_user(data):
|
||||
new_data = dict()
|
||||
email_filter = '^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$'
|
||||
email_filter = re.compile("^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9]"
|
||||
"(?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9]"
|
||||
"(?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
|
||||
|
||||
if ('newPassword' in data and data['newPassword'] != "" and
|
||||
'confirmPassword' in data and data['confirmPassword'] != ""):
|
||||
|
||||
@ -76,7 +79,7 @@ def validate_user(data):
|
||||
raise Exception(_("Passwords do not match."))
|
||||
|
||||
if 'email' in data and data['email'] != "":
|
||||
if re.match(email_filter, data['email']):
|
||||
if email_filter.match(data['email']):
|
||||
new_data['email'] = data['email']
|
||||
else:
|
||||
raise Exception(_("Invalid email address."))
|
||||
|
@ -157,7 +157,7 @@ define([
|
||||
var err = {},
|
||||
errmsg = null,
|
||||
changedAttrs = this.changed || {},
|
||||
email_filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
||||
email_filter = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
||||
|
||||
if (('email' in changedAttrs || !this.isNew()) && (_.isUndefined(this.get('email')) ||
|
||||
_.isNull(this.get('email')) ||
|
||||
@ -377,8 +377,8 @@ define([
|
||||
setup:function() {
|
||||
return {
|
||||
buttons: [{
|
||||
text: '{{ _('Close') }}', key: 27, className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button',
|
||||
attrs:{name:'close'}
|
||||
text: '{{ _('Close') }}', key: 27, className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button user_management_pg-alertify-button',
|
||||
attrs:{name:'close', type:'button'}
|
||||
}],
|
||||
// Set options for dialog
|
||||
options: {
|
||||
|
Loading…
Reference in New Issue
Block a user