TimeTrex/interface/html5/dist/my_account-password-ChangePasswordViewController.bundle.js

1 line
47 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["my_account-password-ChangePasswordViewController"],{1968:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ChangePasswordViewController\": () => (/* binding */ ChangePasswordViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass ChangePasswordViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tshowPassword: null,\n\n\t\t\tshowPhonePassword: null,\n\t\t\tmfa_type_array: null,\n\t\t\thas_authenticated: false,\n\t\t\tapi_authentication: null,\n\t\t\tapi_misc: null,\n\t\t\tapi_notification_device_token: null,\n\n\t\t\tresult_data: []\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\n\t\t//this._super('initialize', options );\n\n\t\tthis.permission_id = 'user';\n\t\tthis.viewId = 'ChangePassword';\n\t\tthis.script_name = 'ChangePasswordView';\n\t\tthis.context_menu_name = $.i18n._( 'Passwords / Security' );\n\t\tthis.api = TTAPI.APIUser;\n\t\tthis.api_authentication = TTAPI.APIAuthentication;\n\t\tthis.api_notification_device_token = TTAPI.APINotificationDeviceToken;\n\t\tthis.api_misc = TTAPI.APIMisc;\n\n\t\tthis.initPermission();\n\n\t\tthis.render();\n\n\t\tthis.initData();\n\t}\n\n\tinitOptions( callback ) {\n\t\tvar options = [{ option_name: 'mfa_type' },];\n\n\t\tthis.initDropDownOptions( options, callback );\n\t}\n\n\tinitPermission() {\n\t\tsuper.initPermission();\n\n\t\tif ( PermissionManager.validate( 'user', 'edit_own_password' ) ) {\n\t\t\tthis.showPassword = true;\n\t\t} else {\n\t\t\tthis.showPassword = false;\n\t\t}\n\n\t\tif ( PermissionManager.validate( 'user', 'edit_own_phone_password' ) ) {\n\t\t\tthis.showPhonePassword = true;\n\t\t} else {\n\t\t\tthis.showPhonePassword = false;\n\t\t}\n\t}\n\n\trender() {\n\t\tsuper.render();\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\tgroups: {\n\t\t\t\ttrusted: {\n\t\t\t\t\tlabel: $.i18n._( 'Trusted Device' ), id: this.viewId + 'trusted', sort_order: 8000\n\t\t\t\t}\n\t\t\t},\n\t\t\texclude: ['default'],\n\t\t\tinclude: [\n\t\t\t\t'save',\n\t\t\t\t'cancel',\n\t\t\t\t{\n\t\t\t\t\tlabel: '', //Empty label. vue_icon is displayed instead of text.\n\t\t\t\t\tid: 'other_header',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'other',\n\t\t\t\t\taction_group_header: true,\n\t\t\t\t\tvue_icon: 'tticon tticon-more_vert_black_24dp',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Reauthenticate' ),\n\t\t\t\t\tid: 'reauthenticate',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'other'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Register API Key' ),\n\t\t\t\t\tid: 'register_api_key',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'other'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Remove All Trusted Devices' ),\n\t\t\t\t\tid: 'remove_all_trusted_devices',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'other'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Logout All Sessions' ),\n\t\t\t\t\tid: 'logout_all_sessions',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'other'\n\t\t\t\t},\n\t\t\t]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'remove_all_trusted_devices':\n\t\t\t\tthis.removeAllTrustedDevices();\n\t\t\t\tbreak;\n\t\t\tcase 'reauthenticate':\n\t\t\t\tGlobal.showAuthenticationModal( this.viewId, 'user_name_multi_factor', {\n\t\t\t\t\tstep: 'password',\n\t\t\t\t\ttype_id: 10,\n\t\t\t\t\tuser_action_message: ''\n\t\t\t\t}, true, ( result ) => {\n\t\t\t\t\tGlobal.hideAuthenticationModal();\n\t\t\t\t\tif ( result.status === true ) {\n\t\t\t\t\t\tthis.has_authenticated = true;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'register_api_key':\n\t\t\t\tthis.registerAPIK