From fada483d554498acce2d7a0b79d1757a8ff0ba1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Mon, 11 May 2020 20:37:25 +0200 Subject: [PATCH] [Login] Add missing e-registers. --- .../edziennik/data/api/LoginMethods.kt | 1 + .../vulcan/data/web/VulcanWebLuckyNumber.kt | 3 +- .../edziennik/ui/modules/login/LoginInfo.kt | 83 ++++++++++++++---- .../drawable/login_mode_edudziennik_web.png | Bin 0 -> 1530 bytes .../res/drawable/login_mode_idziennik_web.png | Bin 0 -> 3319 bytes app/src/main/res/values/strings.xml | 10 ++- 6 files changed, 78 insertions(+), 19 deletions(-) create mode 100644 app/src/main/res/drawable/login_mode_edudziennik_web.png create mode 100644 app/src/main/res/drawable/login_mode_idziennik_web.png diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/LoginMethods.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/LoginMethods.kt index 527c86b1..8ac92274 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/LoginMethods.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/LoginMethods.kt @@ -134,6 +134,7 @@ val idziennikLoginMethods = listOf( ) const val LOGIN_TYPE_EDUDZIENNIK = 5 +const val LOGIN_MODE_EDUDZIENNIK_WEB = 0 const val LOGIN_METHOD_EDUDZIENNIK_WEB = 100 val edudziennikLoginMethods = listOf( LoginMethod(LOGIN_TYPE_EDUDZIENNIK, LOGIN_METHOD_EDUDZIENNIK_WEB, EdudziennikLoginWeb::class.java) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/web/VulcanWebLuckyNumber.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/web/VulcanWebLuckyNumber.kt index dbdbc599..cbf24c2a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/web/VulcanWebLuckyNumber.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/web/VulcanWebLuckyNumber.kt @@ -59,8 +59,7 @@ class VulcanWebLuckyNumber(override val data: DataVulcan, Metadata.TYPE_LUCKY_NUMBER, luckyNumberObject.date.value.toLong(), true, - profile?.empty ?: false, - System.currentTimeMillis() + profile?.empty ?: false )) } } ?: { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginInfo.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginInfo.kt index 04e9bf16..679bcb68 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginInfo.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginInfo.kt @@ -203,17 +203,7 @@ object LoginInfo { validationRegex = "[A-Z]{7}[0-9]+", caseMode = Credential.CaseMode.UPPER_CASE ), - Credential( - keyName = "webPassword", - name = R.string.login_hint_password, - icon = CommunityMaterial.Icon2.cmd_lock_outline, - emptyText = R.string.login_error_no_password, - invalidText = R.string.login_error_incorrect_login_or_password, - errorCodes = mapOf(), - isRequired = true, - validationRegex = ".*", - hideText = true - ) + getPasswordCredential("webPassword") ), errorCodes = mapOf() ) @@ -276,11 +266,74 @@ object LoginInfo { ) ) ) - ) - /*Register( + ), + Register( loginType = LOGIN_TYPE_IDZIENNIK, - - )*/ + internalName = "idziennik", + registerName = R.string.login_type_idziennik, + registerLogo = R.drawable.login_logo_iuczniowie, + loginModes = listOf( + Mode( + loginMode = LOGIN_MODE_IDZIENNIK_WEB, + name = R.string.login_mode_idziennik_web, + icon = R.drawable.login_mode_idziennik_web, + hintText = R.string.login_mode_idziennik_web_hint, + guideText = R.string.login_mode_idziennik_web_guide, + credentials = listOf( + Credential( + keyName = "schoolName", + name = R.string.login_hint_school_name, + icon = CommunityMaterial.Icon2.cmd_school, + emptyText = R.string.login_error_no_school_name, + invalidText = R.string.login_error_incorrect_school_name, + errorCodes = mapOf( + ERROR_LOGIN_IDZIENNIK_WEB_INVALID_SCHOOL_NAME to R.string.login_error_incorrect_school_name + ), + isRequired = true, + validationRegex = "^[a-z0-9_\\-.]+$", + caseMode = Credential.CaseMode.LOWER_CASE + ), + Credential( + keyName = "username", + name = R.string.login_hint_username, + icon = CommunityMaterial.Icon.cmd_account_outline, + emptyText = R.string.login_error_no_username, + invalidText = R.string.login_error_incorrect_username, + errorCodes = mapOf(), + isRequired = true, + validationRegex = "^[a-z0-9_\\-.]+$", + caseMode = Credential.CaseMode.LOWER_CASE + ), + getPasswordCredential("password") + ), + errorCodes = mapOf( + ERROR_LOGIN_IDZIENNIK_WEB_INVALID_LOGIN to R.string.login_error_incorrect_login_or_password + ) + ) + ) + ), + Register( + loginType = LOGIN_TYPE_EDUDZIENNIK, + internalName = "edudziennik", + registerName = R.string.login_type_edudziennik, + registerLogo = R.drawable.login_logo_edudziennik, + loginModes = listOf( + Mode( + loginMode = LOGIN_MODE_EDUDZIENNIK_WEB, + name = R.string.login_mode_edudziennik_web, + icon = R.drawable.login_mode_edudziennik_web, + hintText = R.string.login_mode_edudziennik_web_hint, + guideText = R.string.login_mode_edudziennik_web_guide, + credentials = listOf( + getEmailCredential("email"), + getPasswordCredential("password") + ), + errorCodes = mapOf( + ERROR_LOGIN_EDUDZIENNIK_WEB_INVALID_LOGIN to R.string.login_error_incorrect_login_or_password + ) + ) + ) + ) ) } data class Register( diff --git a/app/src/main/res/drawable/login_mode_edudziennik_web.png b/app/src/main/res/drawable/login_mode_edudziennik_web.png new file mode 100644 index 0000000000000000000000000000000000000000..76fc52615d3cbe15f9018ceecf3919e87733b54b GIT binary patch literal 1530 zcmVPTad zfem6pB2lz~6&PVkFq$loOoVcKTY`=bn1RuDz+lkQ_Vb*JC4pw4y}d0L_Wj70H0`~& z=YGF)&ONuBdk8@g1VIo4K@bE%5ClOG1VIo4K@bGlK>$={qIuauxNj^(^Ct}}eJw;U z)Vx46BlLTIr|}bg?-EZmMHZrcGSngu>U8^scF-!$#x2^2^Cxl^{TKdlv}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.png b/app/src/main/res/drawable/login_mode_idziennik_web.png new file mode 100644 index 0000000000000000000000000000000000000000..0db940b71f7a3135b39aa3c35b410d3e4dc2e2b8 GIT binary patch literal 3319 zcmVT(|XaoozkPdV*3CkcOi3JyvSdkC9e^ls zDi+T<_q*SBZ`~@eV8Ma~3l=O`uwcQ01q*K#(i?ua{Bar~%C@5H`QZt6`}S>DE|>e2 zVHkIX5D9V0VHie2*Y&&UbowuD-@ffSOf$;U)6)ZnVLTERs)_MLqREShVhSS(I`{`uz}fP9bwDA8#2uPl1aAsh~W3OLM!BQq+=fZ}$$|HR5!%)#sR z{&7hF*-R!=4|c$77)DrF48hIeARi9;IoImMp`0vFnMp4lKu8Gj>ZlGfUoewU8#7 z(#t-ulliL}oDK1(n*m*V@G6nV|q&GjAuDm#CZ zby4MuTQ8}0nJaxBF86u)XedC)r<^_kUPbdfnN9O(I?3aiWJR_`b&hMa0Ji&vY69%u z@o1lyYXd$;`@D3wIFJq~P8}-&iiThzl4D{%!`<;Xvn$z}q||c1%?7=#E=GDiT)*gN zY9Y;&*%Z$fGh{WRA@X=lj_dUp|Sm8rKj) z>^8C~=c|guxmG9do%eBTG)Ty&AeT8+2!UP{d^r~9{^SM|^J(;=sNRxlFd_uV60`&q zete~g_s(yMq1fd^5#T`U08KYoUe9xHJi#|F5=1sM3`3Z9uhhW-MIKb6@ABtUi`yog#3LZ>t@ZHNKQ;Qj5$$}YU)pX*S zfWn{MYU9RG09mf?^x4%6UyW@rK9^=LoZBRFYHL_E2dkNth$QhV#qO>*Z>{m+OOmY_i1I4=El#PcrsHidWJ6 z-n_qo->nttzE2zFRsGb%SPYaT4 ztM5P)XHG^_I$w>&`D!eVLzQtV67h7gO2sSo-Qp^f&n}l#CttBiTxeGq?s4(^S6k?8 zaqlaI-A5<9c{ByRKq0nFI=X};%eVsVsNPmocMwTd5mN0xFX}WIQL2n{+HPlJ&iPgP zph|B@HDZ7HQ&whK5{_bWRs{QB+FCHd3Qw{8@ z8;9=JH%ybYOG% z5ql1${wU|0W<6~I8>77{eXS}TAscJ4G%ITf);BUt&#z%fbBvDOLs1h1JpKIQ#;=hj zb4A#(84FrmiSh0DJP*E~;lbnC*CC|rkn9c*s;3!epbfh#RCZXk2iW%G{GJv&LtQEt z+7(*-HeN*%ti{u;t|ytEUt>L<;X+Rf9}J)6gORf=#s7ilOaDgDdyYT+@Nbb0Sb#&H zlI(5|(cK>67eBc|DwF50e|?9i&zHz&lG`K|@@WeBH0kI(it54Utf3p1YkQ0k#M?wINd%B!$8+^WYY=q*)&E` z-~MnWzCtFxf-K88+lZqewOtqnJ9L+hhfPkT0CiKv zk`;y6V@$j1z^*!Q`$81799lNZY|M$`>B8yvvg5pyt=&|qD=LlkG<4waLLX3d`b3Dj z##B@%isD4LyFgYdwzPWA7nmjAY{}F(-A!p;%x2OdoL|&KIYz1vEgu zs9j16Oyv2;nEay=z;qT<$NAMNXp?!qI3{Wwk2PYZ$S*tpzbeb(M3H~Ab%1Cj)>k+~ zO;jEx*cbWI(PI73L&~C##_b`M>lgi8>Gv|)=dJiF0ry#C>2MbI9qA%H zAp|o^8~oqo3Qwokcs?JaSel%#H%`C(va1_xO4S**-Cvg_xX|flq}Rib1_KOqxvDPw z0C+n08_sw9oU9fl5RMW>)G&F3o+PJe%_CjqzDqG;2i52dTE%Ra_Mk1|M4k@ng9TPHJ@B3Uf z20Go`_$@y-h5~q9wwg{q@X&IS1=uY{Ca3dqF~+?o%RHQ1VI!5_Tn8pfEkIU~B=EcK zynn&R&EX(}U2Z&1+gn{7|4s_98~H+!A6{+n=vkQmdboh$Z0FY1GrWJ^M_;?^NUslZ zDg-FU)(T8nK7N<9J2vNr9%>OIpZseHT35`n1h53KU$H z5WIBh((v5e+_ZI%q}rIBot^IP?j8kNfVvY2X6M$uB?oHhf`xYj{}1*k2akoq62t%i002ovPDHLkV1mNt BPe}j( literal 0 HcmV?d00001 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 33c96675..1ee557ac 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1343,7 +1343,13 @@ Zaloguj się do dziennika Vulcan na komputerze, wybierz zakładkę Dostęp Mobilny, kliknij przycisk Zarejestruj urządzenie mobilne. Podaj otrzymany Token, Symbol i PIN w polach poniżej. Podaj dane, którymi logujesz się na stronie internetowej dziennika VULCAN lub na miejskiej platformie. Podaj dane, których używasz do logowania na stronie MobiDziennika. Jako adres serwera możesz wpisać adres strony internetowej, na której masz MobiDziennik. - Dodaj nowego ucznia - Zaloguj konto ucznia/rodzica w aplikacji Logowanie do dziennika Vulcan... + iDziennik Progman / iUczniowie + Zaloguj używając nazwy użytkownika i hasła + Podaj dane, których używasz na stronie internetowej e-dziennika + Użyj danych, które wpisujesz w formularz na stronie iDziennika. Jeśli nie pamiętasz hasła, wejdź na http://iuczniowie.progman.pl/ i kliknij przycisk \"Zapomniałem hasła\". + EduDziennik + Zaloguj używając e-maila i hasła + Użyj danych, które podajesz na stronie internetowej e-dziennika + Podaj adres e-mail i hasło, których używasz do logowania w przeglądarce na stronie EduDziennika.