Skip to content

Commit

Permalink
Merge branch '2024.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlabci committed Oct 15, 2024
2 parents 8ea9071 + fb5e2d7 commit 798ae88
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions tine20/Admin/js/user/EditDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,34 @@ Tine.Admin.UserEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
this.getForm().findField('personalFSQuota').setValue(xprops.personalFSQuota);
}

this.mustChangePasswordCheck()

Tine.Admin.UserEditDialog.superclass.onRecordLoad.call(this);
},


/**
* @private
*/
mustChangePasswordCheck: function () {
const changeAfter = Tine.Tinebase.configManager.get('userPwPolicy.pwPolicyChangeAfter', 'Tinebase')
if (!changeAfter || changeAfter === 0) return

const lastChangeDate = this.record.get('accountLastPasswordChangeRaw')

const maxDate = new Date(lastChangeDate).add('d', changeAfter)
if (maxDate > new Date()) return

const lastChangeField = this.getForm().findField('accountLastPasswordChange')
const mustChangeField = this.getForm().findField('password_must_change')

lastChangeField.addClass('tinebase-warning')
mustChangeField.disable()

this.record.set('password_must_change_actual', this.record.get('password_must_change'))
this.record.set('password_must_change', 1)
this.mustChangeTriggerPlugin.setVisible(true)
},

/**
* @private
*/
Expand Down Expand Up @@ -1184,28 +1209,6 @@ Tine.Admin.UserEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
return config;
},

afterRender: function () {
Tine.Admin.UserEditDialog.superclass.afterRender.call(this);

let changeAfter = Tine.Tinebase.configManager.get('userPwPolicy.pwPolicyChangeAfter', 'Tinebase')
if (!changeAfter || changeAfter === 0) return

let lastChangeDate = this.record.get('accountLastPasswordChange')

let maxDate = new Date(lastChangeDate).add('d', changeAfter)
if (maxDate > new Date()) return

let lastChangeField = this.getForm().findField('accountLastPasswordChange'),
mustChangeField = this.getForm().findField('password_must_change')

lastChangeField.addClass('tinebase-warning')
mustChangeField.disable()

this.record.set('password_must_change_actual', this.record.get('password_must_change'))
this.record.set('password_must_change', 1)
this.mustChangeTriggerPlugin.visible = true
},

suggestNameBasedProps: function(field, e) {
// suggest for new users only!
if (!this.record.id) {
Expand Down

0 comments on commit 798ae88

Please sign in to comment.