From 7772ff89374f220f92ce59fa560dac392ede5442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edip=20Y=C4=B1ld=C4=B1z?= Date: Thu, 25 Jun 2020 10:37:36 +0300 Subject: [PATCH] display error fix --- src/ahenkd.py | 1 + src/base/execution/execution_manager.py | 12 ++++++++---- src/base/messaging/messaging.py | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/ahenkd.py b/src/ahenkd.py index 85fdb33..8f6d8cd 100644 --- a/src/ahenkd.py +++ b/src/ahenkd.py @@ -174,6 +174,7 @@ class AhenkDaemon(BaseDaemon): except Exception as e: self.registration_failed() self.logger.error('Registration failed. Error message: {0}'.format(str(e))) + #Util.execute("/etc/init.d/ahenk stop") def is_registered(self): diff --git a/src/base/execution/execution_manager.py b/src/base/execution/execution_manager.py index a52040f..d4a52f1 100644 --- a/src/base/execution/execution_manager.py +++ b/src/base/execution/execution_manager.py @@ -410,15 +410,19 @@ class ExecutionManager(object): if 'not_authorized' == str(status): self.logger.info('UnRegistration is failed. User not authorized') if self.unregister_user_name is None: - user_name = os.getlogin() - display = Util.get_username_display() + #user_name = os.getlogin() + #display = Util.get_username_display() + user_name = self.db_service.select_one_result('session', 'username', " 1=1 order by id desc ") + display = self.db_service.select_one_result('session', 'display', " 1=1 order by id desc ") Util.show_message(user_name, display, 'Ahenk Lider MYS sisteminden çıkarmak için yetkili kullanıcı haklarına sahip olmanız gerekmektedir.', 'Kullanıcı Yetkilendirme Hatası') else: if self.unregister_user_name is None: - user_name = os.getlogin() - display = Util.get_username_display() + #user_name = os.getlogin() + #display = Util.get_username_display() + user_name = self.db_service.select_one_result('session', 'username', " 1=1 order by id desc ") + display = self.db_service.select_one_result('session', 'display', " 1=1 order by id desc ") Util.show_message(user_name, display, "Ahenk Lider MYS sisteminden çıkarılmıştır.", "") if Util.show_message(user_name, display, "Değişikliklerin etkili olması için sistem yeniden başlatılacaktır. Lütfen bekleyiniz...", diff --git a/src/base/messaging/messaging.py b/src/base/messaging/messaging.py index 425314c..d9b7b41 100644 --- a/src/base/messaging/messaging.py +++ b/src/base/messaging/messaging.py @@ -171,10 +171,10 @@ class Messaging(object): data['password'] = str(self.conf_manager.get('CONNECTION', 'password')) # unregistration from commandline.. if(usernameForCheck==None and passwordForCheck==None): - #user_name = self.db_service.select_one_result('session', 'username') - #display = self.db_service.select_one_result('session', 'display') - user_name = os.getlogin() - display = Util.get_username_display() + user_name = self.db_service.select_one_result('session', 'username') + display = self.db_service.select_one_result('session', 'display') + #user_name = os.getlogin() + #display = Util.get_username_display() self.logger.debug('User : ' + str(user_name)) pout = Util.show_unregistration_message(user_name,display, 'Makineyi etki alanından çıkarmak için zorunlu alanları giriniz. Lütfen DEVAM EDEN İŞLEMLERİNİZİ sonlandırdığınıza emin olunuz !',