1

Merge pull request #5 from Atterratio/master

add: enable logins and logouts logging config
This commit is contained in:
diSabler
2015-12-30 15:43:36 +03:00
3 changed files with 32 additions and 28 deletions

View File

@@ -1744,6 +1744,7 @@ Troll. Delay between messages for troll command Troll. Задержка отпр
Karma. Minimal karma for allow krama change for participants Karma. Минимальная карма при которой изменение кармы доступно не постоянным участникам Karma. Minimal karma for allow krama change for participants Karma. Минимальная карма при которой изменение кармы доступно не постоянным участникам
Iq. Allow answer to service discovery Iq. Разрешение отвечать на запрос обзора сервисов Iq. Allow answer to service discovery Iq. Разрешение отвечать на запрос обзора сервисов
Msgtoadmin. Time limit for next message for msgtoadmin Msgtoadmin. Лимит времени следующей посылки сообщения для команды msgtoadmin Msgtoadmin. Time limit for next message for msgtoadmin Msgtoadmin. Лимит времени следующей посылки сообщения для команды msgtoadmin
Logger. Enable logins and logouts logging Logger. Запись в логи входов и выходов
Muc-filter. A kind words count Muc-filter. Счётчик одинаковых слов Muc-filter. A kind words count Muc-filter. Счётчик одинаковых слов
Whereis. Frequency for answer check for whereis command Whereis. Частота проверки ответа для команды whereis Whereis. Frequency for answer check for whereis command Whereis. Частота проверки ответа для команды whereis
Kernel. Bot status. Show different status for bot loading Kernel. Bot status. Особый статус при загрузке Kernel. Bot status. Show different status for bot loading Kernel. Bot status. Особый статус при загрузке
@@ -1858,5 +1859,6 @@ API settings Настройки API
World of Tanks settings Настройки плагина World of Tanks World of Tanks settings Настройки плагина World of Tanks
# write locale file: ru.txt # write locale file: ru.txt
# total: 1435 # total: 1436
# regenarated without mistakes! # regenarated without mistakes!

View File

@@ -174,33 +174,34 @@ def presence_logger(room,jid,nick,type,mass,mode,logfile):
if not os.path.exists(curr_path): os.mkdir(curr_path) if not os.path.exists(curr_path): os.mkdir(curr_path)
curr_file = ['%s/%02d.txt','%s/%02d.html'][GT('html_logs_enable')] % (curr_path,lt[2]) curr_file = ['%s/%02d.txt','%s/%02d.html'][GT('html_logs_enable')] % (curr_path,lt[2])
ott = onlytimeadd(lt) ott = onlytimeadd(lt)
log_body = ['[%s] ' % ott,'<p><a id="%s" name="%s" href="#%s" class="time">%s</a> ' % (ott,ott,ott,ott)][GT('html_logs_enable')] if GT('movement_logs_enable'):
if type == 'unavailable': log_body = ['[%s] ' % ott,'<p><a id="%s" name="%s" href="#%s" class="time">%s</a> ' % (ott,ott,ott,ott)][GT('html_logs_enable')]
log_body += ['*** %s','<span class="unavailable">%s'][GT('html_logs_enable')] % nick if type == 'unavailable':
if mode and jid != 'None': log_body += ' (%s)' % jid log_body += ['*** %s','<span class="unavailable">%s'][GT('html_logs_enable')] % nick
if len(exit_type): log_body += ' %s' % exit_type
else: log_body += ' %s' % L('leave')
if exit_message != '': log_body += ' (%s)' % exit_message
if mode and '\r' in mass[4]: log_body += ', %s %s' % (L('Client:'),mass[4].split('\r')[1])
log_body += '%s\n' % ['','</span></p>'][GT('html_logs_enable')]
else:
log_body += ['*** %s','<span class="status">%s'][GT('html_logs_enable')] % nick
if not_found == 0:
if mode and jid != 'None': log_body += ' (%s)' % jid if mode and jid != 'None': log_body += ' (%s)' % jid
log_body += ' %s %s' % (L('join as'),L("%s/%s" % (role,affiliation))) if len(exit_type): log_body += ' %s' % exit_type
status_type = '%s_log_join' else: log_body += ' %s' % L('leave')
elif not_found == 1: if exit_message != '': log_body += ' (%s)' % exit_message
log_body += ' %s %s' % (L('now is'),L("%s/%s" % (role,affiliation))) if mode and '\r' in mass[4]: log_body += ', %s %s' % (L('Client:'),mass[4].split('\r')[1])
if exit_message: log_body += ' (%s)' % exit_message log_body += '%s\n' % ['','</span></p>'][GT('html_logs_enable')]
elif not_found == 2: status_type = '%s_log_change' else:
if not_found == 0 or not_found == 2: log_body += ['*** %s','<span class="status">%s'][GT('html_logs_enable')] % nick
status_mask = ' %s' if not_found else ', %s' if not_found == 0:
if show != 'None': log_body += status_mask % L(status_type % show).replace(status_type % '','') if mode and jid != 'None': log_body += ' (%s)' % jid
else: log_body += status_mask % L(status_type % "online").replace(status_type % '','') log_body += ' %s %s' % (L('join as'),L("%s/%s" % (role,affiliation)))
if priority != 'None': log_body += ' [%s]' % priority status_type = '%s_log_join'
else: log_body += ' [0]' elif not_found == 1:
if text != 'None': log_body += ' (%s)' % text log_body += ' %s %s' % (L('now is'),L("%s/%s" % (role,affiliation)))
log_body += '%s\n' % ['','</span></p>'][GT('html_logs_enable')] if exit_message: log_body += ' (%s)' % exit_message
elif not_found == 2: status_type = '%s_log_change'
if not_found == 0 or not_found == 2:
status_mask = ' %s' if not_found else ', %s'
if show != 'None': log_body += status_mask % L(status_type % show).replace(status_type % '','')
else: log_body += status_mask % L(status_type % "online").replace(status_type % '','')
if priority != 'None': log_body += ' [%s]' % priority
else: log_body += ' [0]'
if text != 'None': log_body += ' (%s)' % text
log_body += '%s\n' % ['','</span></p>'][GT('html_logs_enable')]
lht = '%s - %02d/%02d/%02d' % (room,lt[0],lt[1],lt[2]) lht = '%s - %02d/%02d/%02d' % (room,lt[0],lt[1],lt[2])
log_he = ['%s\t\thttp://isida-bot.com\n\n' % lht,log_header+lht+'</title></head><body><div class="main"><div class="top"><div class="heart"><a href="http://isida-bot.com">http://isida-bot.com</a></div><div class="conference">'+lht+'</div></div><div class="container">\n'][GT('html_logs_enable')] log_he = ['%s\t\thttp://isida-bot.com\n\n' % lht,log_header+lht+'</title></head><body><div class="main"><div class="top"><div class="heart"><a href="http://isida-bot.com">http://isida-bot.com</a></div><div class="conference">'+lht+'</div></div><div class="container">\n'][GT('html_logs_enable')]
try: log_he += initial_log_users(room,ott) + ['[%s] ' % ott,'<p><a id="%s" name="%s" href="#%s" class="time">%s</a> ' % (ott,ott,ott,ott)][GT('html_logs_enable')] + ['*** %s\n','<span class="topic">%s</span></p>'][GT('html_logs_enable')] % [topics[room],html_escape(topics[room]).replace('\n','<br/>')][GT('html_logs_enable')] try: log_he += initial_log_users(room,ott) + ['[%s] ' % ott,'<p><a id="%s" name="%s" href="#%s" class="time">%s</a> ' % (ott,ott,ott,ott)][GT('html_logs_enable')] + ['*** %s\n','<span class="topic">%s</span></p>'][GT('html_logs_enable')] % [topics[room],html_escape(topics[room]).replace('\n','<br/>')][GT('html_logs_enable')]

View File

@@ -1754,6 +1754,7 @@ config_groups = [config_group_mucfilter,config_group_mucfilter_newbie,config_gro
# XXe - execute latest field by eval # XXe - execute latest field by eval
owner_prefs = {'syslogs_enable': ['Logger. Enable system logs','b',True], owner_prefs = {'syslogs_enable': ['Logger. Enable system logs','b',True],
'movement_logs_enable':['Logger. Enable logins and logouts logging','b',True],
'status_logs_enable':['Logger. Enable status change logging','b',True], 'status_logs_enable':['Logger. Enable status change logging','b',True],
'aff_role_logs_enable':['Logger. Enable role and affiliation logging','b',True], 'aff_role_logs_enable':['Logger. Enable role and affiliation logging','b',True],
'html_logs_enable':['Logger. Html logs. Otherwize in text','b',True], 'html_logs_enable':['Logger. Html logs. Otherwize in text','b',True],
@@ -1877,7 +1878,7 @@ owner_group_juick = ['Juick settings','#owner-juick',
['juick_user_post_limit','juick_user_post_size','juick_msg_answers_default','juick_user_tags_limit']] ['juick_user_post_limit','juick_user_post_size','juick_msg_answers_default','juick_user_tags_limit']]
owner_group_logs = ['Logs settings','#owner-logs', owner_group_logs = ['Logs settings','#owner-logs',
['syslogs_enable','status_logs_enable','aff_role_logs_enable','html_logs_enable','html_logs_end_text','chatlogs_logs_gmt']] ['syslogs_enable','status_logs_enable','aff_role_logs_enable','movement_logs_enable','html_logs_enable','html_logs_end_text','chatlogs_logs_gmt']]
owner_group_youtube = ['Youtube settings','#owner-youtube', owner_group_youtube = ['Youtube settings','#owner-youtube',
['youtube_max_videos','youtube_default_videos','youtube_max_page_size','youtube_default_lang']] ['youtube_max_videos','youtube_default_videos','youtube_max_page_size','youtube_default_lang']]