Syncing /usr/share/ahenk to src and recreating ahenk.install

This commit is contained in:
Tuncay ÇOLAK 2020-10-08 12:09:57 +03:00
parent d7c59b10e6
commit 618ff56896
3 changed files with 22 additions and 14 deletions

View file

@ -104,47 +104,55 @@ class AnonymousMessenger(ClientXMPP):
self.logger.debug('Registration status: ' + str(status)) self.logger.debug('Registration status: ' + str(status))
if 'not_authorized' == str(status): if 'not_authorized' == str(status):
self.logger.info('Registration is failed. User not authorized') self.logger.debug('[REGISTRATION IS FAILED]. User not authorized')
if self.registration.showUserNotify == True: if self.registration.showUserNotify == True:
Util.show_message(os.getlogin(), ':0','Ahenk Lider MYS sistemine alınamadı !! Sadece yetkili kullanıcılar kayıt yapabilir.', 'Kullanıcı Yetkilendirme Hatası') Util.show_message(os.getlogin(), ':0','Ahenk Lider MYS\`ye alınamadı !! Sadece yetkili kullanıcılar kayıt yapabilir.', 'Kullanıcı Yetkilendirme Hatası')
self.logger.debug('Disconnecting...') self.logger.debug('Disconnecting...')
self.disconnect() self.disconnect()
elif 'already_exists' == str(status) or 'registered' == str(status) or 'registered_without_ldap' == str(status): elif 'registered' == str(status) or 'registered_without_ldap' == str(status):
try: try:
self.logger.info('Registred from server. Registration process starting.') self.logger.info('Registred from server. Registration process starting.')
self.event_manager.fireEvent('REGISTRATION_SUCCESS', j) self.event_manager.fireEvent('REGISTRATION_SUCCESS', j)
if self.registration.showUserNotify == True: if self.registration.showUserNotify == True:
msg = str(self.host) + " Etki Alanına hoş geldiniz." msg = str(self.host) + " Etki Alanına hoş geldiniz."
Util.show_message(os.getlogin(), ':0' ,msg, "UYARI") Util.show_message(os.getlogin(), ':0', msg, "UYARI")
msg = "Değişikliklerin etkili olması için sistem yeniden başlayacaktır. Sistem yeniden başlatılıyor...." msg = "Değişikliklerin etkili olması için sistem yeniden başlayacaktır. Sistem yeniden başlatılıyor...."
Util.show_message(os.getlogin(), ':0',msg, "UYARI") Util.show_message(os.getlogin(), ':0', msg, "UYARI")
time.sleep(3) time.sleep(3)
self.logger.info('Disconnecting...') self.logger.info('Disconnecting...')
self.disconnect() self.disconnect()
self.logger.info('Rebooting...') self.logger.info('Rebooting...')
#System.Process.kill_by_pid(int(System.Ahenk.get_pid_number())) #System.Process.kill_by_pid(int(System.Ahenk.get_pid_number()))
#sys.exit(2) #sys.exit(2)
Util.shutdown(); Util.shutdown()
except Exception as e: except Exception as e:
self.logger.error('Error Message: {0}.'.format(str(e))) self.logger.error('Error Message: {0}.'.format(str(e)))
if self.registration.showUserNotify == True: if self.registration.showUserNotify == True:
Util.show_message(os.getlogin(), ':0',str(e)) Util.show_message(os.getlogin(), ':0',str(e))
self.logger.debug('Disconnecting...') self.logger.debug('Disconnecting...')
self.disconnect() self.disconnect()
elif 'already_exists' == str(status):
self.logger.debug('[REGISTRATION IS FAILED] - Hostname already in use!')
if self.registration.showUserNotify == True:
Util.show_message(os.getlogin(), ':0',
'{0} bilgisayar adı zaten kullanılmaktadır. Lütfen bilgisayar adını değiştirerek tekrar deneyiniz'.format(System.Os.hostname()),
'Bilgisayar İsimlendirme Hatası')
self.logger.debug('Disconnecting...')
self.disconnect()
elif 'registration_error' == str(status): elif 'registration_error' == str(status):
self.logger.info('Registration is failed. New registration request will send') self.logger.info('[REGISTRATION IS FAILED] - New registration request will send')
#self.event_manager.fireEvent('REGISTRATION_ERROR', str(j)) #self.event_manager.fireEvent('REGISTRATION_ERROR', str(j))
if self.registration.showUserNotify == True: if self.registration.showUserNotify == True:
Util.show_message(os.getlogin(), ':0','Ahenk Lider MYS sistemine alınamadı !! Kayıt esnasında hata oluştu. Lütfen sistem yöneticinize başvurunuz.', Util.show_message(os.getlogin(), ':0', 'Ahenk Lider MYS\`ye alınamadı !! Kayıt esnasında hata oluştu. Lütfen sistem yöneticinize başvurunuz.',
'Sistem Hatası') 'Sistem Hatası')
self.logger.debug('Disconnecting...') self.logger.debug('Disconnecting...')
self.disconnect() self.disconnect()
else: else:
self.event_manger.fireEvent(message_type, str(msg['body'])) self.event_manager.fireEvent(message_type, str(msg['body']))
self.logger.debug('Fired event is: {0}'.format(message_type)) self.logger.debug('Fired event is: {0}'.format(message_type))
def send_direct_message(self, msg): def send_direct_message(self, msg):
self.logger.debug('<<--------Sending message: {0}'.format(msg)) self.logger.debug('<<--------Sending message: {0}'.format(msg))
self.send_message(mto=self.receiver, mbody=msg, mtype='normal') self.send_message(mto=self.receiver, mbody=msg, mtype='normal')

View file

@ -46,6 +46,7 @@ class Messenger(ClientXMPP):
if self.receiver_resource: if self.receiver_resource:
self.receiver += '/' + self.receiver_resource self.receiver += '/' + self.receiver_resource
self.port = self.configuration_manager.get('CONNECTION', 'port')
self.logger.debug('XMPP Messager parameters were set') self.logger.debug('XMPP Messager parameters were set')
self.register_extensions() self.register_extensions()
@ -73,8 +74,7 @@ class Messenger(ClientXMPP):
def connect_to_server(self): # Connect to the XMPP server and start processing XMPP stanzas. def connect_to_server(self): # Connect to the XMPP server and start processing XMPP stanzas.
try: try:
self['feature_mechanisms'].unencrypted_plain = True self['feature_mechanisms'].unencrypted_plain = True
self.connect((self.hostname, self.port), use_tls=self.use_tls)
self.connect((self.hostname, 5222), use_tls=self.use_tls)
self.process(block=False) self.process(block=False)
self.logger.debug('Connection were established successfully') self.logger.debug('Connection were established successfully')
return True return True

View file

@ -66,7 +66,7 @@ class SetupVnc(AbstractPlugin):
display_number = self.Sessions.display(user_name) display_number = self.Sessions.display(user_name)
desktop_env = self.get_desktop_env() desktop_env = self.get_desktop_env()
if desktop_env == "gnome": if desktop_env == "gnome":
self.get_username_display_gnome(user_name) display_number = self.get_username_display_gnome(user_name)
self.logger.info("Get display of {0} is {1}".format(user_name, display_number)) self.logger.info("Get display of {0} is {1}".format(user_name, display_number))
homedir = self.get_homedir(user_name) homedir = self.get_homedir(user_name)
self.logger.info("Get home directory of {0} is {1}".format(user_name, homedir)) self.logger.info("Get home directory of {0} is {1}".format(user_name, homedir))