Fixes #3508 - new _plugin dir introduces auth:login events which will never get triggered.

This commit is contained in:
Rolf Schmidt 2021-05-07 11:52:45 +00:00 committed by Martin Edenhofer
parent 236420da75
commit 1c4524de81
18 changed files with 33 additions and 30 deletions

View file

@ -5,6 +5,4 @@ class App.ControllerWizardFullScreen extends App.ControllerWizardModal
# login check / get session user
redirectToLogin: =>
App.Auth.loginCheck()
@el.remove()
App.Plugin.init()
@navigate '#', { removeEl: true }
@navigate('#', { removeEl: true })

View file

@ -59,6 +59,8 @@ class App.DashboardActivityStream extends App.CollectionController
@el.closest('.sidebar').find('.activity-description').addClass('hidden')
onRenderItemEnd: (item, el) ->
return if App.Session.get() is undefined
new App.WidgetAvatar(
el: el.find('.js-avatar')
object_id: item.created_by_id

View file

@ -16,8 +16,7 @@ class DefaultLocale extends App.Controller
processData: true
)
@controllerBind('auth:login', (session) =>
if App.Session.get() isnt undefined
@delay(check, 3500, 'default_locale')
)
App.Config.set('default_locale', DefaultLocale, 'Plugins')

View file

@ -26,9 +26,8 @@ class DefaultTimezone extends App.Controller
# processData: true
#)
@controllerBind('auth:login', (session) =>
if App.Session.get() isnt undefined
@delay(check, 8500, 'default_timezone')
)
updateSetting: (timezone) ->
App.Setting.set('timezone_default', timezone)

View file

@ -51,11 +51,9 @@ class App.Notify extends App.Controller
)
# request desktop notification after login
@controllerBind('auth', (data) ->
if !_.isEmpty(data)
return if !window.Notification
window.Notification.requestPermission()
)
if App.Session.get() isnt undefined && window.Notification
window.Notification.requestPermission()
$(window).focus(
=>
for counter, notification of @desktopNotify

View file

@ -5,14 +5,16 @@ class SessionTimeout extends App.Controller
super
lastEvent = new Date().getTime()
check_timeout = =>
checkTimeout = =>
return if new Date().getTime() - 1000 < lastEvent
lastEvent = new Date().getTime()
@checkLogout()
$(document).off('keyup.session_timeout').on('keyup.session_timeout', check_timeout)
$(document).off('mousemove.session_timeout').on('mousemove.session_timeout', check_timeout)
@controllerBind('config_update', check_timeout)
# reset timeout on mouse move
$(document).off('keyup.session_timeout').on('keyup.session_timeout', checkTimeout)
$(document).off('mousemove.session_timeout').on('mousemove.session_timeout', checkTimeout)
@controllerBind('config_update', checkTimeout)
@controllerBind('session_timeout', @quitApp)
@interval(@checkLogout, 5000, 'session_timeout')

View file

@ -14,12 +14,6 @@ class SwitchBackToUser extends App.Controller
@render()
)
# remove widget
@controllerBind('auth:logout', =>
App.Config.set('switch_back_to_possible', false)
@render()
)
render: (user) ->
# if no switch to user is active

View file

@ -27,9 +27,8 @@ class TranslationSupport extends App.Controller
@controllerBind('i18n:language:change', =>
@delay(check, 2500, 'translation_support')
)
@controllerBind('auth:login', =>
if App.Session.get() isnt undefined
@delay(check, 2500, 'translation_support')
)
App.Config.set( 'translaton_support', TranslationSupport, 'Plugins' )

View file

@ -7,10 +7,6 @@ class UserSignupCheck extends App.Controller
new Modal(user: user)
)
@controllerBind('auth:login', (user) =>
return if !user
@verifyLater(user.id)
)
user = App.User.current()
@verifyLater(user.id) if user?

View file

@ -76,7 +76,6 @@ class Login extends App.ControllerFullPage
)
success: (data, status, xhr) =>
App.Plugin.init()
# redirect to #
@log 'notice', 'REDIRECT to -#/-'

View file

@ -159,7 +159,6 @@ class App.Auth
if _.isFunction(model_object.clearInMemory)
model_object.clearInMemory()
App.Plugin.init()
App.Event.trigger('auth')
App.Event.trigger('auth:logout')

View file

@ -850,6 +850,8 @@ set new attributes of model (remove already available attributes)
collection
activityMessage: (item) ->
return if !item
return "Need own activityMessage() in model to generate text (#{@objectDisplayName()}/#{item.type})."
@lastUpdatedAt: ->

View file

@ -21,6 +21,9 @@ Data Privacy tasks will be executed every 10 minutes. The execution might take s
'''
activityMessage: (item) ->
return if !item
return if !item.created_by
if item.type is 'create'
return App.i18n.translateContent('%s created data privacy task to delete user id |%s|', item.created_by.displayName(), item.objectNative.deletable_id)
else if item.type is 'update'

View file

@ -48,6 +48,9 @@ Using **Organisations** you can **group** customers. This has among others two i
icon: 'organization'
activityMessage: (item) ->
return if !item
return if !item.created_by
if item.type is 'create'
return App.i18n.translateContent('%s created Organization |%s|', item.created_by.displayName(), item.title)
else if item.type is 'update'

View file

@ -19,6 +19,9 @@ class App.Role extends App.Model
]
activityMessage: (item) ->
return if !item
return if !item.created_by
if item.type is 'create'
return App.i18n.translateContent('%s created Role |%s|', item.created_by.displayName(), item.title)
else if item.type is 'update'

View file

@ -98,6 +98,8 @@ class App.Ticket extends App.Model
activityMessage: (item) ->
return if !item
return if !item.created_by
if item.type is 'create'
return App.i18n.translateContent('%s created Ticket |%s|', item.created_by.displayName(), item.title)
else if item.type is 'update'

View file

@ -43,6 +43,8 @@ class App.TicketArticle extends App.Model
activityMessage: (item) ->
return if !item
return if !item.created_by
if item.type is 'create'
return App.i18n.translateContent('%s created Article for |%s|', item.created_by.displayName(), item.title)
else if item.type is 'update'

View file

@ -163,6 +163,9 @@ class App.User extends App.Model
icon: 'user'
activityMessage: (item) ->
return if !item
return if !item.created_by
if item.type is 'create'
return App.i18n.translateContent('%s created User |%s|', item.created_by.displayName(), item.title)
else if item.type is 'update'