From effa320e2f3e9de49da3bb17b0b6014f6ee6d166 Mon Sep 17 00:00:00 2001 From: Zaptyp Date: Mon, 7 Jun 2021 20:52:47 +0200 Subject: [PATCH 1/3] Fakelog URL fix --- app/API/dashboard.py | 4 ++-- app/API/messages.py | 22 +++++++++++----------- app/login.py | 8 ++++---- frontend/src/api/login.ts | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/API/dashboard.py b/app/API/dashboard.py index 83c848f..27f0995 100644 --- a/app/API/dashboard.py +++ b/app/API/dashboard.py @@ -5,10 +5,10 @@ from bs4 import BeautifulSoup from .generate_cookies import autogenerate_cookies def get_dashboard(register_id, students, s, diary_url, symbol): - if diary_url != 'http://cufs.fakelog.cf/': + if diary_url != 'http://cufs.fakelog.tk/': diary_url = 'http://uonetplus.vulcan.net.pl/' else: - diary_url = 'http://uonetplus.fakelog.cf/' + diary_url = 'http://uonetplus.fakelog.tk/' cookies = autogenerate_cookies(students, s) diff --git a/app/API/messages.py b/app/API/messages.py index beb140b..22419e6 100644 --- a/app/API/messages.py +++ b/app/API/messages.py @@ -11,8 +11,8 @@ def get_received_messages(register_id, students, oun, s, date, school_year, symb now = calendar.timegm(time.gmtime()) - if oun == 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458': - received_messages = requests.get(f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}/Wiadomosc.mvc/GetInboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s) + if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458': + received_messages = requests.get(f'http://uonetplus-uzytkownik.fakelog.tk/{symbol}/Wiadomosc.mvc/GetInboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s) else: received_messages = requests.get(f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}/Wiadomosc.mvc/GetInboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s) @@ -24,8 +24,8 @@ def get_sent_messages(register_id, students, oun, s, date, school_year, symbol): now = calendar.timegm(time.gmtime()) - if oun == 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458': - sent_messages = requests.get(f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}/Wiadomosc.mvc/GetInboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s) + if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458': + sent_messages = requests.get(f'http://uonetplus-uzytkownik.fakelog.tk/{symbol}/Wiadomosc.mvc/GetInboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s) else: sent_messages = requests.get(f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}/Wiadomosc.mvc/GetInboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s) @@ -37,8 +37,8 @@ def get_deleted_messages(register_id, students, oun, s, date, school_year, symbo now = calendar.timegm(time.gmtime()) - if oun == 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458': - deleted_messages = requests.get(f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}/Wiadomosc.mvc/GetOutboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s) + if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458': + deleted_messages = requests.get(f'http://uonetplus-uzytkownik.fakelog.tk/{symbol}/Wiadomosc.mvc/GetOutboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s) else: deleted_messages = requests.get(f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}/Wiadomosc.mvc/GetOutboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25', headers=headers, cookies=s) @@ -48,8 +48,8 @@ def get_recipients(register_id, students, oun, s, date, school_year, symbol): with open('app/API/headers.json') as f: headers = json.load(f) - if oun == 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458': - link = f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}' + if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458': + link = f'http://uonetplus-uzytkownik.fakelog.tk/{symbol}' else: link = f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}' @@ -66,8 +66,8 @@ def send_message(register_id, students, oun, s, date, school_year, symbol, send_ with open('app/API/headers.json') as f: headers = json.load(f) - if oun == 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458': - link = f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}' + if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458': + link = f'http://uonetplus-uzytkownik.fakelog.tk/{symbol}' else: link = f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}' @@ -142,7 +142,7 @@ def get_message_content(register_id, students, oun, s, date, school_year, symbol with open('app/API/headers.json') as f: headers = json.load(f) - if oun == 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458': + if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458': link = f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}' else: link = f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}' diff --git a/app/login.py b/app/login.py index d483e80..d2df732 100644 --- a/app/login.py +++ b/app/login.py @@ -27,8 +27,8 @@ def send(url, data, fail, diary_url, symbol, s): if fail in page.text: return {'success': False} else: - if diary_url == 'http://cufs.fakelog.cf/': - page = s.get('http://cufs.fakelog.cf/powiatwulkanowy/FS/LS?wa=wsignin1.0&wtrealm=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx&wctx=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx') + if diary_url == 'http://cufs.fakelog.tk/': + page = s.get('http://cufs.fakelog.tk/powiatwulkanowy/FS/LS?wa=wsignin1.0&wtrealm=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx&wctx=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx') bs = BeautifulSoup(page.text, 'html.parser') wa = bs.find('input', {'name': 'wa'})['value'] cert = bs.find('input', {'name': 'wresult'})['value'] @@ -44,8 +44,8 @@ def send(url, data, fail, diary_url, symbol, s): school_url = a['href'] break - if diary_url == 'http://cufs.fakelog.cf/': - school_url = 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458' + if diary_url == 'http://cufs.fakelog.tk/': + school_url = 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458' cookies = get_cookies(symbol, school_url, s, diary_url) diff --git a/frontend/src/api/login.ts b/frontend/src/api/login.ts index 2150002..db22654 100644 --- a/frontend/src/api/login.ts +++ b/frontend/src/api/login.ts @@ -15,7 +15,7 @@ export default { loginName: email, Password: password, Symbol: symbol, - diaryUrl: 'http://cufs.fakelog.cf/', + diaryUrl: 'http://cufs.fakelog.tk/', }, }); From 278abda9758035d03b8d51e98bc0548de0b53ba3 Mon Sep 17 00:00:00 2001 From: Zaptyp Date: Mon, 7 Jun 2021 21:00:47 +0200 Subject: [PATCH 2/3] Fakelog.cf fix mark 2 --- app/views.py | 4 ++-- tests/test_views.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views.py b/app/views.py index 5e2d39b..d8d2c4c 100644 --- a/app/views.py +++ b/app/views.py @@ -33,10 +33,10 @@ def login(request, *args, **kwargs): Password = data['Password'] symbol = data['Symbol'] diary_url = data['diaryUrl'] - if diary_url != 'http://cufs.fakelog.cf/': + if diary_url != 'http://cufs.fakelog.tk/': link = f'{diary_url}{symbol}/Account/LogOn?ReturnUrl=%2F{symbol}%2FFS%2FLS%3Fwa%3Dwsignin1.0%26wtrealm%3Dhttps%253a%252f%252fuonetplus.vulcan.net.pl%252f{symbol}%252fLoginEndpoint.aspx%26wctx%3Dhttps%253a%252f%252fuonetplus.vulcan.net.pl%252f{symbol}%252fLoginEndpoint.aspx' else: - link = 'http://cufs.fakelog.cf/powiatwulkanowy/FS/LS?wa=wsignin1.0&wtrealm=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx&wctx=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx' + link = 'http://cufs.fakelog.tk/powiatwulkanowy/FS/LS?wa=wsignin1.0&wtrealm=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx&wctx=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx' s = requests.Session() sender_return = sender(link, loginName, Password, ('loginName', 'Password'), 'Zła nazwa użytkownika lub hasło', symbol, diary_url, s) if sender_return == {'success': False}: diff --git a/tests/test_views.py b/tests/test_views.py index 51c742e..614dc91 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -46,7 +46,7 @@ class TestViews(TestCase): "loginName": "jan@fakelog.cf", "Password": "jan123", "Symbol": "powiatwulkanowy", - "diaryUrl": "http://cufs.fakelog.cf/" + "diaryUrl": "http://cufs.fakelog.tk/" } print("\033[94mTesting login...") From 03a21faa874ac00be86d474a316f980fda64a8c4 Mon Sep 17 00:00:00 2001 From: Zaptyp Date: Mon, 7 Jun 2021 21:23:01 +0200 Subject: [PATCH 3/3] Fakelog.cf FIX mark 3 --- app/API/messages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/API/messages.py b/app/API/messages.py index 22419e6..ee0e3a3 100644 --- a/app/API/messages.py +++ b/app/API/messages.py @@ -143,7 +143,7 @@ def get_message_content(register_id, students, oun, s, date, school_year, symbol headers = json.load(f) if oun == 'http://uonetplus-uczen.fakelog.tk/powiatwulkanowy/123458': - link = f'http://uonetplus-uzytkownik.fakelog.cf/{symbol}' + link = f'http://uonetplus-uzytkownik.fakelog.tk/{symbol}' else: link = f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}'