mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 00:38:45 -03:30
Fixed issue benno discovered where non-privileged user could not change password.
This commit is contained in:
@@ -236,7 +236,7 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam
|
|||||||
scope.scmChange = function() {
|
scope.scmChange = function() {
|
||||||
// When an scm_type is set, path is not required
|
// When an scm_type is set, path is not required
|
||||||
scope.pathRequired = (scope.scm_type) ? false : true;
|
scope.pathRequired = (scope.scm_type) ? false : true;
|
||||||
scope.scmBranchLabel = (scope.scm_type.value == 'svn') ? 'Revision #' : 'SCM Branch';
|
scope.scmBranchLabel = (scope.scm_type && scope.scm_type.value && scope.scm_type.value == 'svn') ? 'Revision #' : 'SCM Branch';
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.authChange = function() {
|
scope.authChange = function() {
|
||||||
@@ -504,7 +504,7 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara
|
|||||||
scope.scmChange = function() {
|
scope.scmChange = function() {
|
||||||
// When an scm_type is set, path is not required
|
// When an scm_type is set, path is not required
|
||||||
scope.pathRequired = (scope.scm_type) ? false : true;
|
scope.pathRequired = (scope.scm_type) ? false : true;
|
||||||
scope.scmBranchLabel = (scope.scm_type.value == 'svn') ? 'Revision #' : 'SCM Branch';
|
scope.scmBranchLabel = (scope.scm_type && scope.scm_type.value && scope.scm_type.value == 'svn') ? 'Revision #' : 'SCM Branch';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,11 @@ function UsersAdd ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
else {
|
else {
|
||||||
data[fld] = scope[fld];
|
data[fld] = scope[fld];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data.is_superuser = (data.is_superuser == null || data.is_superuser == undefined || data.is_superuser == '') ? false :
|
||||||
|
data.is_superuser;
|
||||||
|
|
||||||
Rest.post(data)
|
Rest.post(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||||
@@ -247,8 +251,17 @@ function UsersEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
|||||||
Rest.setUrl(defaultUrl + id + '/');
|
Rest.setUrl(defaultUrl + id + '/');
|
||||||
var data = {}
|
var data = {}
|
||||||
for (var fld in form.fields) {
|
for (var fld in form.fields) {
|
||||||
data[fld] = scope[fld];
|
if (form.fields[fld].realName) {
|
||||||
}
|
data[form.fields[fld].realName] = scope[fld];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
data[fld] = scope[fld];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data.is_superuser = (data.is_superuser == null || data.is_superuser == undefined || data.is_superuser == '') ? false :
|
||||||
|
data.is_superuser;
|
||||||
|
|
||||||
Rest.put(data)
|
Rest.put(data)
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ angular.module('UserFormDefinition', [])
|
|||||||
sourceField: 'name',
|
sourceField: 'name',
|
||||||
ngClick: 'lookUpOrganization()',
|
ngClick: 'lookUpOrganization()',
|
||||||
excludeMode: 'edit',
|
excludeMode: 'edit',
|
||||||
awRequiredWhen: { variable: "orgrequired", init: true}
|
awRequiredWhen: { variable: "orgrequired", init: true }
|
||||||
},
|
},
|
||||||
username: {
|
username: {
|
||||||
label: 'Username',
|
label: 'Username',
|
||||||
@@ -65,7 +65,7 @@ angular.module('UserFormDefinition', [])
|
|||||||
label: 'Password',
|
label: 'Password',
|
||||||
type: 'password',
|
type: 'password',
|
||||||
ngShow: 'ldap_user == false',
|
ngShow: 'ldap_user == false',
|
||||||
awRequiredWhen: { variable: "not_ldap_user", init: true},
|
awRequiredWhen: { variable: "not_ldap_user", init: true },
|
||||||
ngChange: "clearPWConfirm('password_confirm')",
|
ngChange: "clearPWConfirm('password_confirm')",
|
||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
chkPass: true
|
chkPass: true
|
||||||
|
|||||||
Reference in New Issue
Block a user