├── l10n ├── .gitkeep ├── uz.json ├── eo.json ├── kab.json ├── uz.js ├── eo.js ├── ia.json ├── nn_NO.json ├── kab.js ├── af.json ├── mn.json ├── ia.js ├── ka.json ├── nn_NO.js ├── sq.json ├── ka_GE.json ├── ko.json ├── oc.json ├── sc.json ├── af.js ├── is.json ├── mn.js ├── ka.js ├── sq.js ├── ka_GE.js ├── ko.js ├── oc.js ├── sc.js ├── zh_CN.json ├── mk.json ├── sv.json ├── he.json ├── lv.json ├── es_419.json ├── es_AR.json ├── es_CL.json ├── es_CO.json ├── es_CR.json ├── es_DO.json ├── es_GT.json ├── es_HN.json ├── es_NI.json ├── es_PA.json ├── es_PE.json ├── es_PR.json ├── es_PY.json ├── es_SV.json ├── es_UY.json ├── is.js ├── mk.js ├── sv.js ├── fa.json ├── he.js ├── lv.js ├── zh_CN.js ├── es_419.js ├── es_AR.js ├── es_CL.js ├── es_CO.js ├── es_CR.js ├── es_DO.js ├── es_GT.js ├── es_HN.js ├── es_NI.js ├── es_PA.js ├── es_PE.js ├── es_PR.js ├── es_PY.js ├── es_SV.js ├── es_UY.js ├── hr.json ├── be.json ├── ca.json ├── es_MX.json ├── ro.json ├── fa.js ├── hr.js ├── bg.json ├── lo.json ├── pt_PT.json ├── be.js ├── es_MX.js ├── ro.js ├── th.json ├── ca.js ├── es_EC.json ├── pt_PT.js ├── bg.js ├── lo.js ├── th.js ├── es_EC.js ├── lt_LT.json ├── br.json ├── br.js ├── lt_LT.js ├── da.json ├── da.js ├── sl.json ├── sl.js ├── vi.json ├── vi.js ├── ast.json ├── ast.js ├── it.json ├── fi.json ├── it.js ├── fi.js ├── hu.json ├── hu.js ├── zh_TW.json ├── zh_HK.json ├── zh_TW.js ├── zh_HK.js ├── cs.json ├── ja.json ├── cs.js ├── ja.js ├── en_GB.json ├── en_GB.js ├── nb.json ├── nb.js ├── ug.json ├── nl.json ├── ug.js ├── nl.js ├── eu.json ├── eu.js ├── sw.json ├── ar.json ├── ga.json ├── sw.js ├── ar.js ├── tr.json ├── ga.js ├── gl.json ├── sk.json ├── el.json ├── et_EE.json ├── tr.js ├── sr.json ├── gl.js ├── sk.js ├── el.js ├── et_EE.js ├── pt_BR.json ├── sr.js ├── pl.json ├── pt_BR.js ├── pl.js ├── es.json └── de.json ├── .l10nignore ├── .github ├── CODEOWNERS ├── autoapproval.yml ├── workflows │ ├── conventional_commits.yml │ ├── reuse.yml │ ├── lint-info-xml.yml │ ├── lint-stylelint.yml │ ├── lint-php-cs.yml │ └── lint-php.yml ├── dependabot.yml └── renovate.json ├── vendor-bin ├── phpunit │ └── composer.json ├── rector │ └── composer.json └── csfixer │ └── composer.json ├── .eslintrc.js ├── krankerl.toml ├── babel.config.js ├── css └── challenge.css ├── stylelint.config.js ├── src ├── mixins │ └── Nextcloud.js ├── settings.js ├── service │ └── AdminCodeService.js └── components │ ├── AdminSettings.vue │ └── CodeGenerator.vue ├── .gitignore ├── .tx └── config ├── appinfo ├── routes.php └── info.xml ├── templates ├── settings-admin.php └── challenge.php ├── webpack.js ├── tests ├── bootstrap.php ├── Unit │ ├── Template │ │ └── ChallengeTemplateTest.php │ ├── Event │ │ └── StateChangedTest.php │ └── Listener │ │ └── StateChangeRegistryUpdaterTest.php ├── phpunit.xml └── Integration │ └── Service │ └── CodeStorageTest.php ├── .php-cs-fixer.dist.php ├── doc ├── index.md ├── Admin Documentation.md └── User Documentation.md ├── .scrutinizer.yml ├── .nextcloudignore ├── AUTHORS.md ├── lib ├── Db │ ├── Code.php │ └── CodeMapper.php ├── Settings │ └── AdminSettings.php ├── Event │ └── StateChanged.php ├── Migration │ ├── Version3Date20200821134738.php │ ├── Version1Date20180907092152.php │ ├── Version0Date20180907071626.php │ ├── Version2Date20180926055748.php │ └── Version2Date20180926053333.php ├── AppInfo │ └── Application.php ├── Listener │ └── StateChangeRegistryUpdater.php ├── Command │ └── Generate.php ├── Controller │ └── AdminCodeController.php ├── Provider │ └── AdminProvider.php └── Service │ └── CodeStorage.php ├── rector.php ├── LICENSES └── MIT.txt ├── composer.json ├── REUSE.toml ├── package.json └── README.md /l10n/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /l10n/uz.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Submit" : "Submit" 3 | },"pluralForm" :"nplurals=1; plural=0;" 4 | } -------------------------------------------------------------------------------- /l10n/eo.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Submit" : "Sendi" 3 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 4 | } -------------------------------------------------------------------------------- /l10n/kab.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "unknown error" : "Agul mačči d aḍahri" 3 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 4 | } -------------------------------------------------------------------------------- /l10n/uz.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Submit" : "Submit" 5 | }, 6 | "nplurals=1; plural=0;"); 7 | -------------------------------------------------------------------------------- /l10n/eo.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Submit" : "Sendi" 5 | }, 6 | "nplurals=2; plural=(n != 1);"); 7 | -------------------------------------------------------------------------------- /l10n/ia.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Codice de authentication" 3 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 4 | } -------------------------------------------------------------------------------- /l10n/nn_NO.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Autentifikasjons kode" 3 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 4 | } -------------------------------------------------------------------------------- /.l10nignore: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | js/ 4 | vendor/ 5 | -------------------------------------------------------------------------------- /l10n/kab.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "unknown error" : "Agul mačči d aḍahri" 5 | }, 6 | "nplurals=2; plural=(n != 1);"); 7 | -------------------------------------------------------------------------------- /l10n/af.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Verifikasiekode", 3 | "Submit" : "Dien in" 4 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 5 | } -------------------------------------------------------------------------------- /l10n/mn.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "танилтын код", 3 | "Submit" : "мэдэгдэх" 4 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 5 | } -------------------------------------------------------------------------------- /l10n/ia.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Codice de authentication" 5 | }, 6 | "nplurals=2; plural=(n != 1);"); 7 | -------------------------------------------------------------------------------- /l10n/ka.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Authentication code", 3 | "Submit" : "Submit" 4 | },"pluralForm" :"nplurals=2; plural=(n!=1);" 5 | } -------------------------------------------------------------------------------- /l10n/nn_NO.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Autentifikasjons kode" 5 | }, 6 | "nplurals=2; plural=(n != 1);"); 7 | -------------------------------------------------------------------------------- /l10n/sq.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Kodi i verifikimit", 3 | "Submit" : "Dërgo" 4 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 5 | } -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | * @Altahrim @ChristophWurst 4 | -------------------------------------------------------------------------------- /l10n/ka_GE.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "აუტენტიფიკაციის კოდი", 3 | "Submit" : "გაგზავნა" 4 | },"pluralForm" :"nplurals=2; plural=(n!=1);" 5 | } -------------------------------------------------------------------------------- /l10n/ko.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "User ID" : "유저 ID", 3 | "Authentication code" : "인증 코드", 4 | "Submit" : "제출" 5 | },"pluralForm" :"nplurals=1; plural=0;" 6 | } -------------------------------------------------------------------------------- /l10n/oc.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Còdi d’autentificacion", 3 | "Submit" : "Transmetre" 4 | },"pluralForm" :"nplurals=2; plural=(n > 1);" 5 | } -------------------------------------------------------------------------------- /l10n/sc.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Còdighe de autenticatzione", 3 | "Submit" : "Imbia" 4 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 5 | } -------------------------------------------------------------------------------- /l10n/af.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Verifikasiekode", 5 | "Submit" : "Dien in" 6 | }, 7 | "nplurals=2; plural=(n != 1);"); 8 | -------------------------------------------------------------------------------- /l10n/is.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Auðkenningarkóði", 3 | "Submit" : "Senda inn" 4 | },"pluralForm" :"nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);" 5 | } -------------------------------------------------------------------------------- /l10n/mn.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "танилтын код", 5 | "Submit" : "мэдэгдэх" 6 | }, 7 | "nplurals=2; plural=(n != 1);"); 8 | -------------------------------------------------------------------------------- /l10n/ka.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Authentication code", 5 | "Submit" : "Submit" 6 | }, 7 | "nplurals=2; plural=(n!=1);"); 8 | -------------------------------------------------------------------------------- /l10n/sq.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Kodi i verifikimit", 5 | "Submit" : "Dërgo" 6 | }, 7 | "nplurals=2; plural=(n != 1);"); 8 | -------------------------------------------------------------------------------- /l10n/ka_GE.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "აუტენტიფიკაციის კოდი", 5 | "Submit" : "გაგზავნა" 6 | }, 7 | "nplurals=2; plural=(n!=1);"); 8 | -------------------------------------------------------------------------------- /l10n/ko.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "User ID" : "유저 ID", 5 | "Authentication code" : "인증 코드", 6 | "Submit" : "제출" 7 | }, 8 | "nplurals=1; plural=0;"); 9 | -------------------------------------------------------------------------------- /l10n/oc.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Còdi d’autentificacion", 5 | "Submit" : "Transmetre" 6 | }, 7 | "nplurals=2; plural=(n > 1);"); 8 | -------------------------------------------------------------------------------- /l10n/sc.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Còdighe de autenticatzione", 5 | "Submit" : "Imbia" 6 | }, 7 | "nplurals=2; plural=(n != 1);"); 8 | -------------------------------------------------------------------------------- /l10n/zh_CN.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "User ID" : "用户ID", 3 | "Generate" : "生成", 4 | "Authentication code" : "授权代码", 5 | "Submit" : "提交" 6 | },"pluralForm" :"nplurals=1; plural=0;" 7 | } -------------------------------------------------------------------------------- /l10n/mk.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Код за автентификација", 3 | "Submit" : "Испрати" 4 | },"pluralForm" :"nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;" 5 | } -------------------------------------------------------------------------------- /l10n/sv.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "User ID" : "Användar-ID", 3 | "Authentication code" : "Autentiseringskod", 4 | "Submit" : "Skicka" 5 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 6 | } -------------------------------------------------------------------------------- /l10n/he.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "קוד אימות", 3 | "Submit" : "שליחה" 4 | },"pluralForm" :"nplurals=3; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: 2;" 5 | } -------------------------------------------------------------------------------- /l10n/lv.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Autentificēšanās kods", 3 | "Submit" : "Iesniegt" 4 | },"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);" 5 | } -------------------------------------------------------------------------------- /l10n/es_419.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_AR.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_CL.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_CO.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_CR.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_DO.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_GT.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_HN.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_NI.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_PA.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_PE.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_PR.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_PY.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_SV.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/es_UY.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Código de autenticación", 3 | "Submit" : "Enviar" 4 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /l10n/is.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Auðkenningarkóði", 5 | "Submit" : "Senda inn" 6 | }, 7 | "nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);"); 8 | -------------------------------------------------------------------------------- /vendor-bin/phpunit/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "platform": { 4 | "php": "7.4" 5 | } 6 | }, 7 | "require": { 8 | "christophwurst/nextcloud_testing": "^0.12.4" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vendor-bin/rector/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "platform": { 4 | "php": "8.1" 5 | }, 6 | "sort-packages": true 7 | }, 8 | "require-dev": { 9 | "nextcloud/rector": "^0.4.1" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /l10n/mk.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Код за автентификација", 5 | "Submit" : "Испрати" 6 | }, 7 | "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"); 8 | -------------------------------------------------------------------------------- /l10n/sv.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "User ID" : "Användar-ID", 5 | "Authentication code" : "Autentiseringskod", 6 | "Submit" : "Skicka" 7 | }, 8 | "nplurals=2; plural=(n != 1);"); 9 | -------------------------------------------------------------------------------- /vendor-bin/csfixer/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "platform": { 4 | "php": "8.0" 5 | }, 6 | "sort-packages": true 7 | }, 8 | "require-dev": { 9 | "nextcloud/coding-standard": "^1.4" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /l10n/fa.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "unknown error" : "unknown error", 3 | "User ID" : "شناسه کاربر", 4 | "Authentication code" : "کد هویت", 5 | "Submit" : "ارسال" 6 | },"pluralForm" :"nplurals=2; plural=(n > 1);" 7 | } -------------------------------------------------------------------------------- /l10n/he.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "קוד אימות", 5 | "Submit" : "שליחה" 6 | }, 7 | "nplurals=3; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: 2;"); 8 | -------------------------------------------------------------------------------- /l10n/lv.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Autentificēšanās kods", 5 | "Submit" : "Iesniegt" 6 | }, 7 | "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);"); 8 | -------------------------------------------------------------------------------- /l10n/zh_CN.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "User ID" : "用户ID", 5 | "Generate" : "生成", 6 | "Authentication code" : "授权代码", 7 | "Submit" : "提交" 8 | }, 9 | "nplurals=1; plural=0;"); 10 | -------------------------------------------------------------------------------- /l10n/es_419.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_AR.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_CL.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_CO.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_CR.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_DO.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_GT.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_HN.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_NI.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_PA.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_PE.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_PR.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_PY.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_SV.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/es_UY.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | }, 7 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors 3 | * SPDX-License-Identifier: AGPL-3.0-or-later 4 | */ 5 | 6 | module.exports = { 7 | extends: [ 8 | '@nextcloud', 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /l10n/hr.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Authentication code" : "Šifra za autentifikaciju", 3 | "Submit" : "Šalji" 4 | },"pluralForm" :"nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;" 5 | } -------------------------------------------------------------------------------- /krankerl.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | [package] 4 | before_cmds = [ 5 | "composer install --no-dev -o", 6 | "npm i", 7 | "npm run build", 8 | ] 9 | -------------------------------------------------------------------------------- /l10n/be.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Submit" : "Адправіць" 3 | },"pluralForm" :"nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);" 4 | } -------------------------------------------------------------------------------- /l10n/ca.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "unknown error" : "error desconegut", 3 | "User ID" : "ID de l'usuari", 4 | "Authentication code" : "Codi d'autenticació", 5 | "Submit" : "Envia" 6 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 7 | } -------------------------------------------------------------------------------- /l10n/es_MX.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "User ID" : "ID de usuario", 3 | "Authentication code" : "Código de autenticación", 4 | "Submit" : "Enviar" 5 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 6 | } -------------------------------------------------------------------------------- /l10n/ro.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "User ID" : "ID-ul utilizatorului", 3 | "Authentication code" : "Cod autentificare", 4 | "Submit" : "Trimite" 5 | },"pluralForm" :"nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));" 6 | } -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors 3 | * SPDX-License-Identifier: AGPL-3.0-or-later 4 | */ 5 | 6 | const babelConfig = require('@nextcloud/babel-config') 7 | 8 | module.exports = babelConfig 9 | -------------------------------------------------------------------------------- /css/challenge.css: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors 3 | * SPDX-License-Identifier: AGPL-3.0-or-later 4 | */ 5 | #admin-2fa-form > input, #admin-2fa-form > button { 6 | padding: 10px; 7 | margin: 0px 0px 5px 0px; 8 | } 9 | -------------------------------------------------------------------------------- /l10n/fa.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "unknown error" : "unknown error", 5 | "User ID" : "شناسه کاربر", 6 | "Authentication code" : "کد هویت", 7 | "Submit" : "ارسال" 8 | }, 9 | "nplurals=2; plural=(n > 1);"); 10 | -------------------------------------------------------------------------------- /l10n/hr.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Authentication code" : "Šifra za autentifikaciju", 5 | "Submit" : "Šalji" 6 | }, 7 | "nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;"); 8 | -------------------------------------------------------------------------------- /l10n/bg.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "unknown error" : "неизвестна грешка", 3 | "User ID" : "Потребителски Идентификатор /Име/", 4 | "Authentication code" : "Удостоверителен код", 5 | "Submit" : "Изпращане" 6 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 7 | } -------------------------------------------------------------------------------- /l10n/lo.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "unknown error" : "ຂໍ້ຜິດພາດທີ່ບໍ່ຮູ້ຈັກ", 3 | "User ID" : "ໄອດີຜູ້ໃຊ້", 4 | "Generate" : "ສ້າງ", 5 | "Authentication code" : "Authentication code", 6 | "Submit" : "ສົ່ງ" 7 | },"pluralForm" :"nplurals=1; plural=0;" 8 | } -------------------------------------------------------------------------------- /l10n/pt_PT.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "unknown error" : "erro desconhecido", 3 | "Authentication code" : "Código de autenticação", 4 | "Submit" : "Submeter" 5 | },"pluralForm" :"nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 6 | } -------------------------------------------------------------------------------- /stylelint.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors 3 | * SPDX-License-Identifier: AGPL-3.0-or-later 4 | */ 5 | 6 | const stylelintConfig = require('@nextcloud/stylelint-config') 7 | 8 | module.exports = stylelintConfig 9 | -------------------------------------------------------------------------------- /.github/autoapproval.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | from_owner: 4 | - dependabot-preview[bot] 5 | required_labels: 6 | - dependencies 7 | apply_labels: 8 | - autoapproved 9 | -------------------------------------------------------------------------------- /l10n/be.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Submit" : "Адправіць" 5 | }, 6 | "nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);"); 7 | -------------------------------------------------------------------------------- /l10n/es_MX.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "User ID" : "ID de usuario", 5 | "Authentication code" : "Código de autenticación", 6 | "Submit" : "Enviar" 7 | }, 8 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 9 | -------------------------------------------------------------------------------- /l10n/ro.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "User ID" : "ID-ul utilizatorului", 5 | "Authentication code" : "Cod autentificare", 6 | "Submit" : "Trimite" 7 | }, 8 | "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));"); 9 | -------------------------------------------------------------------------------- /l10n/th.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "user {uid} does not exist" : "ไม่มีผู้ใช้ {uid}", 3 | "unknown error" : "ข้อผิดพลาดไม่ทราบสาเหตุ", 4 | "User ID" : "ไอดีผู้ใช้งาน", 5 | "Generate" : "สร้าง", 6 | "Submit" : "ส่ง" 7 | },"pluralForm" :"nplurals=1; plural=0;" 8 | } -------------------------------------------------------------------------------- /l10n/ca.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "unknown error" : "error desconegut", 5 | "User ID" : "ID de l'usuari", 6 | "Authentication code" : "Codi d'autenticació", 7 | "Submit" : "Envia" 8 | }, 9 | "nplurals=2; plural=(n != 1);"); 10 | -------------------------------------------------------------------------------- /l10n/es_EC.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "unknown error" : "error desconocido", 3 | "User ID" : "ID de usuario", 4 | "Authentication code" : "Código de autenticación", 5 | "Submit" : "Enviar" 6 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 7 | } -------------------------------------------------------------------------------- /l10n/pt_PT.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "unknown error" : "erro desconhecido", 5 | "Authentication code" : "Código de autenticação", 6 | "Submit" : "Submeter" 7 | }, 8 | "nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 9 | -------------------------------------------------------------------------------- /l10n/bg.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "unknown error" : "неизвестна грешка", 5 | "User ID" : "Потребителски Идентификатор /Име/", 6 | "Authentication code" : "Удостоверителен код", 7 | "Submit" : "Изпращане" 8 | }, 9 | "nplurals=2; plural=(n != 1);"); 10 | -------------------------------------------------------------------------------- /l10n/lo.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "unknown error" : "ຂໍ້ຜິດພາດທີ່ບໍ່ຮູ້ຈັກ", 5 | "User ID" : "ໄອດີຜູ້ໃຊ້", 6 | "Generate" : "ສ້າງ", 7 | "Authentication code" : "Authentication code", 8 | "Submit" : "ສົ່ງ" 9 | }, 10 | "nplurals=1; plural=0;"); 11 | -------------------------------------------------------------------------------- /src/mixins/Nextcloud.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors 3 | * SPDX-License-Identifier: AGPL-3.0-or-later 4 | */ 5 | 6 | import { translate } from '@nextcloud/l10n' 7 | 8 | export default { 9 | methods: { 10 | t: translate, 11 | }, 12 | } 13 | -------------------------------------------------------------------------------- /l10n/th.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "user {uid} does not exist" : "ไม่มีผู้ใช้ {uid}", 5 | "unknown error" : "ข้อผิดพลาดไม่ทราบสาเหตุ", 6 | "User ID" : "ไอดีผู้ใช้งาน", 7 | "Generate" : "สร้าง", 8 | "Submit" : "ส่ง" 9 | }, 10 | "nplurals=1; plural=0;"); 11 | -------------------------------------------------------------------------------- /l10n/es_EC.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "unknown error" : "error desconocido", 5 | "User ID" : "ID de usuario", 6 | "Authentication code" : "Código de autenticación", 7 | "Submit" : "Enviar" 8 | }, 9 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | /build/artifacts 4 | 5 | composer.phar 6 | .php-cs-fixer.cache 7 | /vendor/ 8 | /vendor-bin/*/vendor 9 | /node_modules 10 | 11 | /js 12 | 13 | /tests/clover.xml 14 | /tests/.phpunit.result.cache 15 | 16 | -------------------------------------------------------------------------------- /.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | lang_map = hu_HU: hu, nb_NO: nb, sk_SK: sk, th_TH: th, ja_JP: ja, bg_BG: bg, cs_CZ: cs, fi_FI: fi 4 | 5 | [o:nextcloud:p:nextcloud:r:twofactor_admin] 6 | file_filter = translationfiles//twofactor_admin.po 7 | source_file = translationfiles/templates/twofactor_admin.pot 8 | source_lang = en 9 | type = PO 10 | -------------------------------------------------------------------------------- /appinfo/routes.php: -------------------------------------------------------------------------------- 1 | [ 12 | [ 13 | 'name' => 'adminCode#create', 14 | 'url' => '/api/admin/code', 15 | 'verb' => 'POST' 16 | ], 17 | ] 18 | ]; 19 | -------------------------------------------------------------------------------- /l10n/lt_LT.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "unknown error" : "nežinoma klaida", 3 | "User ID" : "Naudotojo ID", 4 | "Authentication code" : "Tapatybės nustatymo kodas", 5 | "Submit" : "Pateikti" 6 | },"pluralForm" :"nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);" 7 | } -------------------------------------------------------------------------------- /templates/settings-admin.php: -------------------------------------------------------------------------------- 1 | 14 | 15 |
16 | -------------------------------------------------------------------------------- /l10n/br.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Submit" : "Kinnig" 3 | },"pluralForm" :"nplurals=5; plural=((n%10 == 1) && (n%100 != 11) && (n%100 !=71) && (n%100 !=91) ? 0 :(n%10 == 2) && (n%100 != 12) && (n%100 !=72) && (n%100 !=92) ? 1 :(n%10 ==3 || n%10==4 || n%10==9) && (n%100 < 10 || n% 100 > 19) && (n%100 < 70 || n%100 > 79) && (n%100 < 90 || n%100 > 99) ? 2 :(n != 0 && n % 1000000 == 0) ? 3 : 4);" 4 | } -------------------------------------------------------------------------------- /webpack.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors 3 | * SPDX-License-Identifier: AGPL-3.0-or-later 4 | */ 5 | 6 | const path = require('path'); 7 | const webpackConfig = require('@nextcloud/webpack-vue-config') 8 | 9 | webpackConfig.entry = { 10 | settings: path.join(__dirname, 'src', 'settings.js') 11 | } 12 | 13 | module.exports = webpackConfig 14 | -------------------------------------------------------------------------------- /l10n/br.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Submit" : "Kinnig" 5 | }, 6 | "nplurals=5; plural=((n%10 == 1) && (n%100 != 11) && (n%100 !=71) && (n%100 !=91) ? 0 :(n%10 == 2) && (n%100 != 12) && (n%100 !=72) && (n%100 !=92) ? 1 :(n%10 ==3 || n%10==4 || n%10==9) && (n%100 < 10 || n% 100 > 19) && (n%100 < 70 || n%100 > 79) && (n%100 < 90 || n%100 > 99) ? 2 :(n != 0 && n % 1000000 == 0) ? 3 : 4);"); 7 | -------------------------------------------------------------------------------- /l10n/lt_LT.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "unknown error" : "nežinoma klaida", 5 | "User ID" : "Naudotojo ID", 6 | "Authentication code" : "Tapatybės nustatymo kodas", 7 | "Submit" : "Pateikti" 8 | }, 9 | "nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);"); 10 | -------------------------------------------------------------------------------- /l10n/da.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Admin kode", 3 | "Use a one-time code provided by your admin" : "Brug en engangskode leveret af din admin", 4 | "Two-Factor Admin Support" : "To-faktor admin support", 5 | "unknown error" : "ukendt fejl", 6 | "User ID" : "Bruger ID", 7 | "Authentication code" : "Godkendelses kode", 8 | "Submit" : "Tilføj" 9 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 10 | } -------------------------------------------------------------------------------- /src/settings.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors 3 | * SPDX-License-Identifier: AGPL-3.0-or-later 4 | */ 5 | 6 | import Vue from 'vue' 7 | 8 | import AdminSettings from './components/AdminSettings.vue' 9 | import Nextcloud from './mixins/Nextcloud.js' 10 | 11 | Vue.mixin(Nextcloud) 12 | 13 | const View = Vue.extend(AdminSettings) 14 | new View().$mount('#two-factor-admin-admin-settings') 15 | -------------------------------------------------------------------------------- /l10n/da.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Admin kode", 5 | "Use a one-time code provided by your admin" : "Brug en engangskode leveret af din admin", 6 | "Two-Factor Admin Support" : "To-faktor admin support", 7 | "unknown error" : "ukendt fejl", 8 | "User ID" : "Bruger ID", 9 | "Authentication code" : "Godkendelses kode", 10 | "Submit" : "Tilføj" 11 | }, 12 | "nplurals=2; plural=(n != 1);"); 13 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | loadApp('twofactor_admin'); 18 | -------------------------------------------------------------------------------- /.php-cs-fixer.dist.php: -------------------------------------------------------------------------------- 1 | getFinder() 17 | ->ignoreVCSIgnored(true) 18 | ->notPath('vendor') 19 | ->notPath('vendor-bin') 20 | ->in(__DIR__); 21 | return $config; 22 | -------------------------------------------------------------------------------- /.github/workflows/conventional_commits.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: MIT 3 | name: Conventional Commits 4 | 5 | on: 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | build: 11 | name: Conventional Commits 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 15 | - uses: webiny/action-conventional-commits@8bc41ff4e7d423d56fa4905f6ff79209a78776c7 #v1.3.0 16 | -------------------------------------------------------------------------------- /src/service/AdminCodeService.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors 3 | * SPDX-License-Identifier: AGPL-3.0-or-later 4 | */ 5 | 6 | import axios from '@nextcloud/axios' 7 | import { generateUrl } from '@nextcloud/router' 8 | 9 | /** 10 | * @param {string} uid UserID 11 | * @return {Promise} 12 | */ 13 | export const generateCode = uid => { 14 | const url = generateUrl('/apps/twofactor_admin/api/admin/code') 15 | 16 | return axios.post(url, { uid }) 17 | .then(resp => resp.data) 18 | } 19 | -------------------------------------------------------------------------------- /doc/index.md: -------------------------------------------------------------------------------- 1 | 5 | # Home 6 | 7 | This is the official documentation of the `twofactor_admin` Nextcloud app. This app 8 | allows admins to generate a one-time login code for users which they can use to 9 | unlock their otherwise locked account. This is useful for situations where users lost 10 | access to all of their factory or if two-factor authentication is enforced and there 11 | is no other two-factor provider configured for the user. 12 | -------------------------------------------------------------------------------- /.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | build: 4 | nodes: 5 | analysis: 6 | tests: 7 | override: 8 | - php-scrutinizer-run --enable-security-analysis 9 | 10 | filter: 11 | excluded_paths: 12 | - 'l10n/*' 13 | - 'tests/' 14 | - 'vendor/*' 15 | 16 | checks: 17 | php: true 18 | 19 | tools: 20 | external_code_coverage: 21 | runs: 6 22 | timeout: 1200 # Timeout in seconds. 20 minutes 23 | -------------------------------------------------------------------------------- /l10n/sl.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "user {uid} does not exist" : "uporabnik {uid} ne obstaja", 3 | "you are not allowed to generate codes for this user" : "nimate dovoljenja za ustvarnjanje kod za tega uporabnika", 4 | "unknown error" : "neznana napaka", 5 | "User ID" : "ID Uporabnika", 6 | "Enter the one-time code provided by your admin." : "Vstavi enkratno kodo prejetko od administratorja", 7 | "Authentication code" : "Overitvena koda", 8 | "Submit" : "Pošlji" 9 | },"pluralForm" :"nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);" 10 | } -------------------------------------------------------------------------------- /.nextcloudignore: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | /.babelrc.js 4 | /.eslintrc.js 5 | /.git 6 | /.github 7 | /.gitignore 8 | /.nextcloudignore 9 | /.travis.yml 10 | /.tx 11 | /.scrutinizer.yml 12 | /build 13 | /ci 14 | /CONTRIBUTING.md 15 | /composer.* 16 | /coverage 17 | /krankerl.toml 18 | /l10n/no-php 19 | /Makefile 20 | /nbproject 21 | /node_modules 22 | /package* 23 | /screenshots 24 | /src 25 | /tests 26 | /vendor/bin 27 | /vendor/christophwurst/nextcloud/.git 28 | /vendor/endroid/qr-code/assets 29 | /vendor-bin 30 | -------------------------------------------------------------------------------- /l10n/sl.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "user {uid} does not exist" : "uporabnik {uid} ne obstaja", 5 | "you are not allowed to generate codes for this user" : "nimate dovoljenja za ustvarnjanje kod za tega uporabnika", 6 | "unknown error" : "neznana napaka", 7 | "User ID" : "ID Uporabnika", 8 | "Enter the one-time code provided by your admin." : "Vstavi enkratno kodo prejetko od administratorja", 9 | "Authentication code" : "Overitvena koda", 10 | "Submit" : "Pošlji" 11 | }, 12 | "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);"); 13 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | 5 | # Authors 6 | 7 | - Andrea Xheli 8 | - Andy Scherzinger 9 | - Benjamin Gaussorgues 10 | - Christian Wolf 11 | - Christoph Wurst 12 | - John Molakvoæ 13 | - Jonas Meurer 14 | - Richard Steinmetz 15 | - Roeland Jago Douma 16 | - Thomas Citharel 17 | -------------------------------------------------------------------------------- /lib/Db/Code.php: -------------------------------------------------------------------------------- 1 | user = $user; 27 | } 28 | 29 | public function getUser(): IUser { 30 | return $this->user; 31 | } 32 | 33 | public function isEnabled(): bool { 34 | return $this->enabled; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /tests/Unit/Template/ChallengeTemplateTest.php: -------------------------------------------------------------------------------- 1 | template = new Template('twofactor_admin', 'challenge'); 24 | } 25 | 26 | public function testRender() { 27 | $html = $this->template->fetchPage(); 28 | 29 | $this->assertStringStartsWith('withPaths([ 15 | __DIR__ . '/appinfo', 16 | __DIR__ . '/lib', 17 | __DIR__ . '/templates', 18 | __DIR__ . '/tests', 19 | ]) 20 | ->withPhpSets(php80: true) 21 | ->withTypeCoverageLevel(0) 22 | ->withImportNames(importShortClasses:false) 23 | ->withPreparedSets( 24 | codeQuality: true, 25 | codingStyle: true, 26 | deadCode: true, 27 | earlyReturn: true, 28 | instanceOf: true, 29 | privatization: true, 30 | strictBooleans: true, 31 | ) 32 | ->withSets([ 33 | NextcloudSets::NEXTCLOUD_27, 34 | ]); 35 | -------------------------------------------------------------------------------- /l10n/ast.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Códigu de l'alministración", 3 | "Use a one-time code provided by your admin" : "Usa un códigu d'un usu forníu pola alministración", 4 | "you are not allowed to generate codes for this user" : "nun tienes permisu pa xenerar códigos pa esti usuariu", 5 | "unknown error" : "error desconocíu", 6 | "Generate" : "Xenerar", 7 | "Could not generate a code: {error}" : "Nun se pudo xenerar un códigu: {error}", 8 | "The generated code is {code}. It is valid for {hours} hours" : "El códigu xeneráu ye {code}. Ye válidu demientres {hours} hores", 9 | "Enter the one-time code provided by your admin." : "Introduz el códigu d'un usu que te fornió l'alministración.", 10 | "Authentication code" : "Códigu d'autenticación", 11 | "Submit" : "Unviar" 12 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 13 | } -------------------------------------------------------------------------------- /.github/workflows/reuse.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | 6 | # SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. 7 | # 8 | # SPDX-License-Identifier: CC0-1.0 9 | 10 | name: REUSE Compliance Check 11 | 12 | on: [pull_request] 13 | 14 | permissions: 15 | contents: read 16 | 17 | jobs: 18 | reuse-compliance-check: 19 | runs-on: ubuntu-latest-low 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 23 | with: 24 | persist-credentials: false 25 | 26 | - name: REUSE Compliance Check 27 | uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5.0.0 28 | -------------------------------------------------------------------------------- /l10n/ast.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Códigu de l'alministración", 5 | "Use a one-time code provided by your admin" : "Usa un códigu d'un usu forníu pola alministración", 6 | "you are not allowed to generate codes for this user" : "nun tienes permisu pa xenerar códigos pa esti usuariu", 7 | "unknown error" : "error desconocíu", 8 | "Generate" : "Xenerar", 9 | "Could not generate a code: {error}" : "Nun se pudo xenerar un códigu: {error}", 10 | "The generated code is {code}. It is valid for {hours} hours" : "El códigu xeneráu ye {code}. Ye válidu demientres {hours} hores", 11 | "Enter the one-time code provided by your admin." : "Introduz el códigu d'un usu que te fornió l'alministración.", 12 | "Authentication code" : "Códigu d'autenticación", 13 | "Submit" : "Unviar" 14 | }, 15 | "nplurals=2; plural=(n != 1);"); 16 | -------------------------------------------------------------------------------- /tests/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | 12 | . 13 | 14 | 15 | 16 | ../ 17 | 18 | ../l10n 19 | ../tests 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /doc/Admin Documentation.md: -------------------------------------------------------------------------------- 1 | 5 | # Admin Documentation 6 | 7 | ## The occ Interface 8 | 9 | The Nextcloud [`occ` interface](https://docs.nextcloud.com/server/14/admin_manual/configuration_server/occ_command.html) allows admins to execute various tasks 10 | from the command line. 11 | 12 | ### Generate a one-time code 13 | 14 | Once this app is enabled, it provides a `twofactorauth:admin:generate-code` command you can execute with 15 | 16 | ```bash 17 | ./occ twofactorauth:admin:generate-code leonida 18 | ``` 19 | 20 | where "leonida" is the user ID for which a one-time login could shall be generated. 21 | 22 | The command will tell you the newly generated code as well as its expiry date. You may 23 | now transfer this code to the user via a trusted and secure channel. 24 | -------------------------------------------------------------------------------- /doc/User Documentation.md: -------------------------------------------------------------------------------- 1 | 5 | # User Documentation 6 | 7 | Once an admin has generated a code for you, you can log into the Nextcloud 8 | web interface with your usual login name and password. If you are prompted with 9 | a selection of two-factor auth providers, choose the *Admin code* provider. 10 | 11 | 12 | You should have been redirected to a page asking for your admin code. Now it's time 13 | to enter or paste the code in the input and submit it. If the code is valid and 14 | has not expired yet, you'll be logged in after this step. In any other case, 15 | please contact your admin again for assistance. 16 | 17 | 18 | **Note: since the code can only be used once, you'll have to make sure that your 19 | two-factor setup is up to date. Otherwise you'll be unable to log in again.** 20 | -------------------------------------------------------------------------------- /src/components/AdminSettings.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 19 | 20 | 30 | -------------------------------------------------------------------------------- /l10n/it.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Use a one-time code provided by your admin" : "Utilizza un codice monouso fornito dal tuo amministratore", 3 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Il provider di amministrazione a due fattori ti consente di generare codici monouso per i tuoi utenti. Ciò è utile per il primo accesso dopo che è stata abilitata l'autenticazione a due fattori o quando gli utenti perdono l'accesso agli altri fattori.", 4 | "Generate a code" : "Genera un codice", 5 | "unknown error" : "errore sconosciuto", 6 | "User ID" : "ID utente", 7 | "Generate" : "Genera", 8 | "Authentication code" : "Codice di autenticazione", 9 | "Submit" : "Invia" 10 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 11 | } -------------------------------------------------------------------------------- /lib/Migration/Version3Date20200821134738.php: -------------------------------------------------------------------------------- 1 | hasTable('twofactor_admin_codes')) { 28 | $schema->dropTable('twofactor_admin_codes'); 29 | } 30 | 31 | return $schema; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /tests/Unit/Event/StateChangedTest.php: -------------------------------------------------------------------------------- 1 | createMock(IUser::class); 20 | $event = new StateChanged($user, true); 21 | 22 | $this->assertSame($user, $event->getUser()); 23 | $this->assertTrue($event->isEnabled()); 24 | } 25 | 26 | public function testIsDisabled() { 27 | $user = $this->createMock(IUser::class); 28 | $event = new StateChanged($user, false); 29 | 30 | $this->assertSame($user, $event->getUser()); 31 | $this->assertFalse($event->isEnabled()); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /l10n/fi.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Ylläpitäjän koodi", 3 | "Use a one-time code provided by your admin" : "Käytä ylläpitäjän antamaa kertakäyttökoodia", 4 | "Generate a code" : "Luo koodi", 5 | "user {uid} does not exist" : "käyttäjää {uid} ei ole olemassa", 6 | "you are not allowed to generate codes for this user" : "sinulla ei ole oikeutta luoda koodeja tälle käyttäjälle", 7 | "unknown error" : "tuntematon virhe", 8 | "User ID" : "Käyttäjätunniste", 9 | "Generate" : "Luo", 10 | "Could not generate a code: {error}" : "Koodia ei voitu luoda: {error}", 11 | "The generated code is {code}. It is valid for {hours} hours" : "Luotiin koodi {code}. Se on kelvollinen {hours} tunnin ajan", 12 | "Enter the one-time code provided by your admin." : "Kirjoita ylläpitäjän antama kertakäyttökoodi.", 13 | "Authentication code" : "Tunnistautumiskoodi", 14 | "Submit" : "Lähetä" 15 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 16 | } -------------------------------------------------------------------------------- /lib/Migration/Version1Date20180907092152.php: -------------------------------------------------------------------------------- 1 | getTable('twofactor_admin_codes'); 28 | $table->dropPrimaryKey(); 29 | $table->setPrimaryKey(['id', 'user_id']); 30 | 31 | return $schema; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | version: 2 4 | updates: 5 | - package-ecosystem: composer 6 | directory: "/" 7 | schedule: 8 | interval: daily 9 | time: "02:00" 10 | open-pull-requests-limit: 10 11 | ignore: 12 | - dependency-name: christophwurst/nextcloud 13 | versions: 14 | - "> 18.0.0, < 19" 15 | - package-ecosystem: npm 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | time: "02:00" 20 | open-pull-requests-limit: 10 21 | ignore: 22 | - dependency-name: webpack-cli 23 | versions: 24 | - 4.3.1 25 | - 4.4.0 26 | - dependency-name: "@babel/preset-env" 27 | versions: 28 | - 7.12.11 29 | - dependency-name: "@babel/core" 30 | versions: 31 | - 7.12.10 32 | - dependency-name: webpack 33 | versions: 34 | - 4.44.2 35 | - dependency-name: css-loader 36 | versions: 37 | - 5.0.1 38 | -------------------------------------------------------------------------------- /l10n/it.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Use a one-time code provided by your admin" : "Utilizza un codice monouso fornito dal tuo amministratore", 5 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Il provider di amministrazione a due fattori ti consente di generare codici monouso per i tuoi utenti. Ciò è utile per il primo accesso dopo che è stata abilitata l'autenticazione a due fattori o quando gli utenti perdono l'accesso agli altri fattori.", 6 | "Generate a code" : "Genera un codice", 7 | "unknown error" : "errore sconosciuto", 8 | "User ID" : "ID utente", 9 | "Generate" : "Genera", 10 | "Authentication code" : "Codice di autenticazione", 11 | "Submit" : "Invia" 12 | }, 13 | "nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 14 | -------------------------------------------------------------------------------- /l10n/fi.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Ylläpitäjän koodi", 5 | "Use a one-time code provided by your admin" : "Käytä ylläpitäjän antamaa kertakäyttökoodia", 6 | "Generate a code" : "Luo koodi", 7 | "user {uid} does not exist" : "käyttäjää {uid} ei ole olemassa", 8 | "you are not allowed to generate codes for this user" : "sinulla ei ole oikeutta luoda koodeja tälle käyttäjälle", 9 | "unknown error" : "tuntematon virhe", 10 | "User ID" : "Käyttäjätunniste", 11 | "Generate" : "Luo", 12 | "Could not generate a code: {error}" : "Koodia ei voitu luoda: {error}", 13 | "The generated code is {code}. It is valid for {hours} hours" : "Luotiin koodi {code}. Se on kelvollinen {hours} tunnin ajan", 14 | "Enter the one-time code provided by your admin." : "Kirjoita ylläpitäjän antama kertakäyttökoodi.", 15 | "Authentication code" : "Tunnistautumiskoodi", 16 | "Submit" : "Lähetä" 17 | }, 18 | "nplurals=2; plural=(n != 1);"); 19 | -------------------------------------------------------------------------------- /templates/challenge.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 |
15 |

16 | t('Enter the one-time code provided by your admin.')) ?> 17 | t('Once logged in, please check your two-factor settings in order to be able to log in again.')) ?> 18 |

19 | 28 | 32 |
33 | -------------------------------------------------------------------------------- /LICENSES/MIT.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /lib/AppInfo/Application.php: -------------------------------------------------------------------------------- 1 | getContainer(); 26 | $this->registerListeners($container); 27 | } 28 | 29 | private function registerListeners(IAppContainer $container): void { 30 | /** @var IEventDispatcher $dispatcher */ 31 | $dispatcher = $container->query(IEventDispatcher::class); 32 | 33 | $dispatcher->addServiceListener(StateChanged::class, StateChangeRegistryUpdater::class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /lib/Listener/StateChangeRegistryUpdater.php: -------------------------------------------------------------------------------- 1 | registry = $registry; 28 | } 29 | 30 | public function handle(Event $event): void { 31 | if ($event instanceof StateChanged) { 32 | if ($event->isEnabled()) { 33 | $this->registry->enableProviderFor($this->provider, $event->getUser()); 34 | } else { 35 | $this->registry->disableProviderFor($this->provider, $event->getUser()); 36 | } 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /.github/workflows/lint-info-xml.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: Lint info.xml 10 | 11 | on: pull_request 12 | 13 | permissions: 14 | contents: read 15 | 16 | concurrency: 17 | group: lint-info-xml-${{ github.head_ref || github.run_id }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | xml-linters: 22 | runs-on: ubuntu-latest-low 23 | 24 | name: info.xml lint 25 | steps: 26 | - name: Checkout 27 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 28 | with: 29 | persist-credentials: false 30 | 31 | - name: Download schema 32 | run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd 33 | 34 | - name: Lint info.xml 35 | uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2 36 | with: 37 | xml-file: ./appinfo/info.xml 38 | xml-schema-file: ./info.xsd 39 | -------------------------------------------------------------------------------- /lib/Migration/Version0Date20180907071626.php: -------------------------------------------------------------------------------- 1 | createTable('twofactor_admin_codes'); 28 | $table->addColumn('id', 'bigint', [ 29 | 'autoincrement' => true, 30 | 'notnull' => true, 31 | 'unsigned' => true, 32 | ]); 33 | $table->addColumn('user_id', 'string', [ 34 | 'notnull' => true, 35 | 'length' => 64, 36 | ]); 37 | $table->addColumn('code', 'string', [ 38 | 'notnull' => true, 39 | 'length' => 6, 40 | ]); 41 | $table->setPrimaryKey(['id']); 42 | 43 | return $schema; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nextcloud/twofactor_admin", 3 | "description": "Nextcloud Two-Factor Authentication Admin Provider", 4 | "type": "library", 5 | "license": "AGPL-v3", 6 | "authors": [ 7 | { 8 | "name": "Christoph Wurst", 9 | "email": "christoph@winzerhof-wurst.at" 10 | } 11 | ], 12 | "config": { 13 | "platform": { 14 | "php": "8.1" 15 | }, 16 | "allow-plugins": { 17 | "bamarni/composer-bin-plugin": true 18 | } 19 | }, 20 | "scripts": { 21 | "cs:check": "php-cs-fixer fix --dry-run --diff", 22 | "cs:fix": "php-cs-fixer fix", 23 | "lint": "find . -name \\*.php -not -path './vendor*/*' -print0 | xargs -0 -n1 -P $(nproc) php -l", 24 | "test": "phpunit -c tests/phpunit.xml", 25 | "test:integration": "phpunit -c tests/phpunit.xml tests/Integration", 26 | "test:unit": "phpunit -c tests/phpunit.xml tests/Unit", 27 | "test:integration:dev": "phpunit -c tests/phpunit.xml tests/Integration --no-coverage", 28 | "test:unit:dev": "phpunit -c tests/phpunit.xml tests/Unit --no-coverage", 29 | "post-install-cmd": [ 30 | "@composer bin all install --ansi" 31 | ], 32 | "post-update-cmd": [ 33 | "@composer bin all update --ansi" 34 | ], 35 | "rector": "rector && composer run cs:fix" 36 | }, 37 | "require": { 38 | "bamarni/composer-bin-plugin": "^1.8.2" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/Migration/Version2Date20180926055748.php: -------------------------------------------------------------------------------- 1 | makeExpiresNotNull($schema); 28 | 29 | return $schema; 30 | } 31 | 32 | /** 33 | * @param Closure $schemaClosure 34 | * 35 | * @throws SchemaException 36 | */ 37 | private function makeExpiresNotNull(ISchemaWrapper $schema) { 38 | $codesTable = $schema->getTable('twofactor_admin_codes'); 39 | $expiresCol = $codesTable->getColumn('expires'); 40 | $expiresCol->setNotnull(true); 41 | $expiresCol->setDefault(0); 42 | 43 | $idCol = $codesTable->getColumn('id'); 44 | $idCol->setAutoincrement(true); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /l10n/hu.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Rendszergazda kód", 3 | "Use a one-time code provided by your admin" : "Hasznája a rendszergada által biztosított egyszer használatos kódot", 4 | "Two-Factor Admin Support" : "Két-faktor rendszergazdai támogatás", 5 | "Two-Factor Admin" : "Kétfaktoros Adminisztáció", 6 | "Generate a code" : "Kód generálása", 7 | "user {uid} does not exist" : "{uid} felhasználó nem létezik", 8 | "you are not allowed to generate codes for this user" : "nincs jogosultsága kódok létrehozásához ehhez a felhasználóhoz", 9 | "unknown error" : "ismeretlen hiba", 10 | "User ID" : "Felhasználóazonosító", 11 | "Generate" : "Generálás", 12 | "Could not generate a code: {error}" : "Kód generálása sikertelen: {error}", 13 | "The generated code is {code}. It is valid for {hours} hours" : "A generált kód: {code}. {hours} óráig érvényes", 14 | "Enter the one-time code provided by your admin." : "Adja meg a rendszergada által biztosított egyszer használatos kódot", 15 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Amint bejelentkezett, ellenőrizze a kétfaktoros hitelesítési beállításait, hogy újra be tudjon jelentkezni.", 16 | "Authentication code" : "Hitelesítőkód", 17 | "Submit" : "Beküldés" 18 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 19 | } -------------------------------------------------------------------------------- /l10n/hu.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Rendszergazda kód", 5 | "Use a one-time code provided by your admin" : "Hasznája a rendszergada által biztosított egyszer használatos kódot", 6 | "Two-Factor Admin Support" : "Két-faktor rendszergazdai támogatás", 7 | "Two-Factor Admin" : "Kétfaktoros Adminisztáció", 8 | "Generate a code" : "Kód generálása", 9 | "user {uid} does not exist" : "{uid} felhasználó nem létezik", 10 | "you are not allowed to generate codes for this user" : "nincs jogosultsága kódok létrehozásához ehhez a felhasználóhoz", 11 | "unknown error" : "ismeretlen hiba", 12 | "User ID" : "Felhasználóazonosító", 13 | "Generate" : "Generálás", 14 | "Could not generate a code: {error}" : "Kód generálása sikertelen: {error}", 15 | "The generated code is {code}. It is valid for {hours} hours" : "A generált kód: {code}. {hours} óráig érvényes", 16 | "Enter the one-time code provided by your admin." : "Adja meg a rendszergada által biztosított egyszer használatos kódot", 17 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Amint bejelentkezett, ellenőrizze a kétfaktoros hitelesítési beállításait, hogy újra be tudjon jelentkezni.", 18 | "Authentication code" : "Hitelesítőkód", 19 | "Submit" : "Beküldés" 20 | }, 21 | "nplurals=2; plural=(n != 1);"); 22 | -------------------------------------------------------------------------------- /REUSE.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 202$ Nextcloud GmbH and Nextcloud contributors 2 | # SPDX-License-Identifier: AGPL-3.0-or-later 3 | version = 1 4 | SPDX-PackageName = "twofactor_admin" 5 | SPDX-PackageSupplier = "Nextcloud " 6 | SPDX-PackageDownloadLocation = "https://github.com/nextcloud/twofactor_admin" 7 | 8 | [[annotations]] 9 | path = ["composer.json", "composer.lock", "CHANGELOG.md"] 10 | precedence = "aggregate" 11 | SPDX-FileCopyrightText = "2018 Nextcloud GmbH and Nextcloud contributors" 12 | SPDX-License-Identifier = "AGPL-3.0-or-later" 13 | 14 | [[annotations]] 15 | path = ["package.json", "package-lock.json", ".github/renovate.json"] 16 | precedence = "aggregate" 17 | SPDX-FileCopyrightText = "2019-2025 Nextcloud GmbH and Nextcloud contributors" 18 | SPDX-License-Identifier = "AGPL-3.0-or-later" 19 | 20 | [[annotations]] 21 | path = ["l10n/**.js", "l10n/**.json"] 22 | precedence = "aggregate" 23 | SPDX-FileCopyrightText = "2023 Nextcloud translators" 24 | SPDX-License-Identifier = "AGPL-3.0-or-later" 25 | 26 | [[annotations]] 27 | path = [".tx/config", "vendor-bin/csfixer/composer.json", "vendor-bin/csfixer/composer.lock", "vendor-bin/phpunit/composer.json", "vendor-bin/phpunit/composer.lock", "vendor-bin/rector/composer.json", "vendor-bin/rector/composer.lock"] 28 | precedence = "aggregate" 29 | SPDX-FileCopyrightText = "2023 Nextcloud GmbH and Nextcloud contributors" 30 | SPDX-License-Identifier = "AGPL-3.0-or-later" 31 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended", 5 | "helpers:pinGitHubActionDigests", 6 | ":dependencyDashboard", 7 | ":semanticCommits", 8 | ":gitSignOff" 9 | ], 10 | "timezone": "Europe/Vienna", 11 | "schedule": [ 12 | "before 5am on wednesday" 13 | ], 14 | "labels": [ 15 | "dependencies", 16 | "3. to review" 17 | ], 18 | "commitMessageAction": "Bump", 19 | "commitMessageTopic": "{{depName}}", 20 | "commitMessageExtra": "from {{currentVersion}} to {{#if isPinDigest}}{{{newDigestShort}}}{{else}}{{#if isMajor}}{{prettyNewMajor}}{{else}}{{#if isSingleVersion}}{{prettyNewVersion}}{{else}}{{#if newValue}}{{{newValue}}}{{else}}{{{newDigestShort}}}{{/if}}{{/if}}{{/if}}{{/if}}", 21 | "rangeStrategy": "bump", 22 | "rebaseWhen": "conflicted", 23 | "ignoreUnstable": false, 24 | "baseBranches": [ 25 | "main", 26 | "stable31", 27 | "stable30", 28 | "stable29" 29 | ], 30 | "enabledManagers": [ 31 | "github-actions" 32 | ], 33 | "packageRules": [ 34 | { 35 | "description": "Bump Github actions monthly and request reviews", 36 | "matchManagers": [ 37 | "github-actions" 38 | ], 39 | "extends": [ 40 | "schedule:monthly" 41 | ] 42 | }, 43 | { 44 | "description": "Auto-merge minor and patch bumps", 45 | "matchUpdateTypes": [ 46 | "minor", 47 | "patch" 48 | ], 49 | "matchCurrentVersion": "!/^0/", 50 | "automerge": true, 51 | "automergeType": "pr", 52 | "platformAutomerge": true, 53 | "labels": [ 54 | "dependencies", 55 | "4. to release" 56 | ], 57 | "reviewers": [] 58 | } 59 | ] 60 | } 61 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "twofactor-admin", 3 | "description": "Nextcloud Admin Two-Factor Authentication Support Provider", 4 | "author": "Christoph Wurst", 5 | "license": "AGPL-3.0-or-later", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/nextcloud/twofactor_admin.git" 9 | }, 10 | "scripts": { 11 | "build": "NODE_ENV=production webpack --progress --config webpack.js", 12 | "dev": "NODE_ENV=development webpack --progress --config webpack.js", 13 | "watch": "NODE_ENV=development webpack --progress --watch --config webpack.js", 14 | "lint": "eslint --ext .js,.vue src", 15 | "stylelint": "stylelint css/*.css css/*.scss src/**/*.scss src/**/*.vue", 16 | "stylelint:fix": "stylelint css/*.css css/*.scss src/**/*.scss src/**/*.vue --fix" 17 | }, 18 | "keywords": [ 19 | "nextcloud" 20 | ], 21 | "bugs": { 22 | "url": "https://github.com/nextcloud/twofactor_admin/issues" 23 | }, 24 | "homepage": "https://github.com/nextcloud/twofactor_admin#readme", 25 | "dependencies": { 26 | "@nextcloud/axios": "^2.5.2", 27 | "@nextcloud/l10n": "^3.4.0", 28 | "@nextcloud/router": "^3.0.1", 29 | "vue": "^2.7.15" 30 | }, 31 | "browserslist": [ 32 | "extends @nextcloud/browserslist-config" 33 | ], 34 | "engines": { 35 | "node": "^24.0.0", 36 | "npm": "^11.3.0" 37 | }, 38 | "devDependencies": { 39 | "@nextcloud/babel-config": "^1.2.0", 40 | "@nextcloud/browserslist-config": "^3.0.1", 41 | "@nextcloud/eslint-config": "^8.4.1", 42 | "@nextcloud/stylelint-config": "^2.4.0", 43 | "@nextcloud/webpack-vue-config": "^6.3.0" 44 | }, 45 | "version": "4.9.0" 46 | } 47 | -------------------------------------------------------------------------------- /lib/Db/CodeMapper.php: -------------------------------------------------------------------------------- 1 | db->getQueryBuilder(); 24 | 25 | $select = $qb->select($qb->func()->count('*')) 26 | ->from($this->getTableName()) 27 | ->where($qb->expr()->eq( 28 | 'user_id', 29 | $qb->createNamedParameter($user->getUID()) 30 | )); 31 | $res = $select->executeQuery(); 32 | $data = $res->fetchColumn(0); 33 | $res->closeCursor(); 34 | 35 | if ($data === false) { 36 | // No data returned 37 | return false; 38 | } 39 | 40 | $cnt = (int)$data; 41 | 42 | return $cnt > 0; 43 | } 44 | 45 | public function find(IUser $user): Code { 46 | $qb = $this->db->getQueryBuilder(); 47 | 48 | $select = $qb->select('*') 49 | ->from($this->getTableName()) 50 | ->where($qb->expr()->eq( 51 | 'user_id', 52 | $qb->createNamedParameter($user->getUID()) 53 | )); 54 | 55 | return $this->findEntity($select); 56 | } 57 | 58 | public function deleteAll(IUser $user) { 59 | $qb = $this->db->getQueryBuilder(); 60 | 61 | $delete = $qb->delete($this->getTableName()) 62 | ->where($qb->expr()->eq( 63 | 'user_id', 64 | $qb->createNamedParameter($user->getUID()) 65 | )); 66 | $delete->executeStatement(); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /.github/workflows/lint-stylelint.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: Lint stylelint 10 | 11 | on: pull_request 12 | 13 | permissions: 14 | contents: read 15 | 16 | concurrency: 17 | group: lint-stylelint-${{ github.head_ref || github.run_id }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | lint: 22 | runs-on: ubuntu-latest 23 | 24 | name: stylelint 25 | 26 | steps: 27 | - name: Checkout 28 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 29 | with: 30 | persist-credentials: false 31 | 32 | - name: Read package.json node and npm engines version 33 | uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 34 | id: versions 35 | with: 36 | fallbackNode: '^20' 37 | fallbackNpm: '^10' 38 | 39 | - name: Set up node ${{ steps.versions.outputs.nodeVersion }} 40 | uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 41 | with: 42 | node-version: ${{ steps.versions.outputs.nodeVersion }} 43 | 44 | - name: Set up npm ${{ steps.versions.outputs.npmVersion }} 45 | run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' 46 | 47 | - name: Install dependencies 48 | env: 49 | CYPRESS_INSTALL_BINARY: 0 50 | run: npm ci 51 | 52 | - name: Lint 53 | run: npm run stylelint 54 | -------------------------------------------------------------------------------- /l10n/zh_TW.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "管理員驗證碼", 3 | "Use a one-time code provided by your admin" : "使用您管理員提供的拋棄式驗證碼", 4 | "Two-Factor Admin Support" : "兩階段管理員支援", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud 兩階段驗證管理員支援提供程式", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "這個 Nextcloud 的兩階段驗證 (2FA) 提供程式讓管理員可以產生一個拋棄式\n\t\t驗證碼,用來讓使用者登入受 2FA 保護的帳號。這對使用者失去\n\t\t對他們的其他 2FA 方法的存取權,或是強制 2FA 但並未啟用任何\n\t\t2FA 提供程式時很有用。", 7 | "Two-Factor Admin" : "兩階段管理員", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "兩階段管理員提供程式讓您可以為您的使用者產生拋棄式驗證碼。這對啟用兩階段驗證後,或是無法存取其他驗證方式的使用者的第一次登入很有用。", 9 | "Generate a code" : "產生驗證碼", 10 | "user {uid} does not exist" : "使用者 {uid} 不存在", 11 | "you are not allowed to generate codes for this user" : "您不被允許為此使用者產生驗證碼", 12 | "unknown error" : "未知錯誤", 13 | "User ID" : "使用者 ID", 14 | "Generate" : "產生", 15 | "Could not generate a code: {error}" : "無法產生驗證碼:{error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "產生的驗證碼是 {code}。有效時間為{hours}小時", 17 | "Enter the one-time code provided by your admin." : "輸入您管理員提供的拋棄式驗證碼", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "一旦登入,請檢查您的兩階段設定,如此才能再次登入。", 19 | "Authentication code" : "驗證碼", 20 | "Submit" : "遞交" 21 | },"pluralForm" :"nplurals=1; plural=0;" 22 | } -------------------------------------------------------------------------------- /l10n/zh_HK.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "管理員驗證碼", 3 | "Use a one-time code provided by your admin" : "使用管理員提供的一次性驗證碼", 4 | "Two-Factor Admin Support" : "雙重認證(Two-Factor Authentication)管理支援", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud 雙重認證證管理支援提供者", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "這個 Nextcloud 的雙重認證 (2FA) 提供程式讓管理員可以產生一個一次性\n\t\t驗證碼,用來讓使用者登入受 2FA 保護的帳號。這對使用者失去\n\t\t對他們的其他 2FA 方法的存取權,或是強制 2FA 但並未啟用任何\n\t\t2FA 提供程式時很有用。", 7 | "Two-Factor Admin" : "雙重認證管理", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "雙重認證管理提供者允許您為用戶生成一次性代碼。這在啟用雙重認證後的首次登錄或用戶無法訪問其他驗證因素時非常有用。", 9 | "Generate a code" : "產生驗證碼", 10 | "user {uid} does not exist" : "用戶 {uid} 不存在", 11 | "you are not allowed to generate codes for this user" : "您不能為此用戶產生驗證碼", 12 | "unknown error" : "錯誤不詳", 13 | "User ID" : "用戶 ID", 14 | "Generate" : "產生", 15 | "Could not generate a code: {error}" : "無法產生驗證碼:{error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "產生的驗證碼是 {code}。有效時間為{hours}小時", 17 | "Enter the one-time code provided by your admin." : "輸入您管理員提供的一次性驗證碼", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "一旦登入,請檢查您的雙重認證設定,以便能夠再次登入。", 19 | "Authentication code" : "驗證碼", 20 | "Submit" : "遞交" 21 | },"pluralForm" :"nplurals=1; plural=0;" 22 | } -------------------------------------------------------------------------------- /l10n/zh_TW.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "管理員驗證碼", 5 | "Use a one-time code provided by your admin" : "使用您管理員提供的拋棄式驗證碼", 6 | "Two-Factor Admin Support" : "兩階段管理員支援", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud 兩階段驗證管理員支援提供程式", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "這個 Nextcloud 的兩階段驗證 (2FA) 提供程式讓管理員可以產生一個拋棄式\n\t\t驗證碼,用來讓使用者登入受 2FA 保護的帳號。這對使用者失去\n\t\t對他們的其他 2FA 方法的存取權,或是強制 2FA 但並未啟用任何\n\t\t2FA 提供程式時很有用。", 9 | "Two-Factor Admin" : "兩階段管理員", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "兩階段管理員提供程式讓您可以為您的使用者產生拋棄式驗證碼。這對啟用兩階段驗證後,或是無法存取其他驗證方式的使用者的第一次登入很有用。", 11 | "Generate a code" : "產生驗證碼", 12 | "user {uid} does not exist" : "使用者 {uid} 不存在", 13 | "you are not allowed to generate codes for this user" : "您不被允許為此使用者產生驗證碼", 14 | "unknown error" : "未知錯誤", 15 | "User ID" : "使用者 ID", 16 | "Generate" : "產生", 17 | "Could not generate a code: {error}" : "無法產生驗證碼:{error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "產生的驗證碼是 {code}。有效時間為{hours}小時", 19 | "Enter the one-time code provided by your admin." : "輸入您管理員提供的拋棄式驗證碼", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "一旦登入,請檢查您的兩階段設定,如此才能再次登入。", 21 | "Authentication code" : "驗證碼", 22 | "Submit" : "遞交" 23 | }, 24 | "nplurals=1; plural=0;"); 25 | -------------------------------------------------------------------------------- /l10n/zh_HK.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "管理員驗證碼", 5 | "Use a one-time code provided by your admin" : "使用管理員提供的一次性驗證碼", 6 | "Two-Factor Admin Support" : "雙重認證(Two-Factor Authentication)管理支援", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud 雙重認證證管理支援提供者", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "這個 Nextcloud 的雙重認證 (2FA) 提供程式讓管理員可以產生一個一次性\n\t\t驗證碼,用來讓使用者登入受 2FA 保護的帳號。這對使用者失去\n\t\t對他們的其他 2FA 方法的存取權,或是強制 2FA 但並未啟用任何\n\t\t2FA 提供程式時很有用。", 9 | "Two-Factor Admin" : "雙重認證管理", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "雙重認證管理提供者允許您為用戶生成一次性代碼。這在啟用雙重認證後的首次登錄或用戶無法訪問其他驗證因素時非常有用。", 11 | "Generate a code" : "產生驗證碼", 12 | "user {uid} does not exist" : "用戶 {uid} 不存在", 13 | "you are not allowed to generate codes for this user" : "您不能為此用戶產生驗證碼", 14 | "unknown error" : "錯誤不詳", 15 | "User ID" : "用戶 ID", 16 | "Generate" : "產生", 17 | "Could not generate a code: {error}" : "無法產生驗證碼:{error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "產生的驗證碼是 {code}。有效時間為{hours}小時", 19 | "Enter the one-time code provided by your admin." : "輸入您管理員提供的一次性驗證碼", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "一旦登入,請檢查您的雙重認證設定,以便能夠再次登入。", 21 | "Authentication code" : "驗證碼", 22 | "Submit" : "遞交" 23 | }, 24 | "nplurals=1; plural=0;"); 25 | -------------------------------------------------------------------------------- /lib/Migration/Version2Date20180926053333.php: -------------------------------------------------------------------------------- 1 | timeFactory = $timeFactory; 30 | $this->db = $db; 31 | } 32 | 33 | public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { 34 | /** @var ISchemaWrapper $schema */ 35 | $schema = $schemaClosure(); 36 | 37 | $codesTable = $schema->getTable('twofactor_admin_codes'); 38 | $codesTable->addColumn('expires', 'bigint', [ 39 | 'notnull' => false, 40 | 'unsigned' => true, 41 | ]); 42 | 43 | return $schema; 44 | } 45 | 46 | public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { 47 | $qb = $this->db->getQueryBuilder(); 48 | $now = $this->timeFactory->getTime(); 49 | // Sensible default 50 | $twoDaysAgo = $now - 3600 * 48; 51 | 52 | $this->fillExpireDates($qb, $twoDaysAgo); 53 | } 54 | 55 | private function fillExpireDates(IQueryBuilder $qb, int $expires) { 56 | $updateQuery = $qb->update('twofactor_admin_codes') 57 | ->set('expires', $qb->createNamedParameter($expires)) 58 | ->where($qb->expr()->isNull('expires')); 59 | $updateQuery->executeStatement(); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /.github/workflows/lint-php-cs.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: Lint php-cs 10 | 11 | on: pull_request 12 | 13 | permissions: 14 | contents: read 15 | 16 | concurrency: 17 | group: lint-php-cs-${{ github.head_ref || github.run_id }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | lint: 22 | runs-on: ubuntu-latest 23 | 24 | name: php-cs 25 | 26 | steps: 27 | - name: Checkout 28 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 29 | with: 30 | persist-credentials: false 31 | 32 | - name: Get php version 33 | id: versions 34 | uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 35 | 36 | - name: Set up php${{ steps.versions.outputs.php-min }} 37 | uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5 38 | with: 39 | php-version: ${{ steps.versions.outputs.php-min }} 40 | extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite 41 | coverage: none 42 | ini-file: development 43 | env: 44 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 45 | 46 | - name: Install dependencies 47 | run: | 48 | composer remove nextcloud/ocp --dev 49 | composer i 50 | 51 | - name: Lint 52 | run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 5 | # Nextcloud Two-Factor Authentication Admin Support Provider 6 | 7 | [![REUSE status](https://api.reuse.software/badge/github.com/nextcloud/twofactor_admin)](https://api.reuse.software/info/github.com/nextcloud/twofactor_admin) 8 | [![Build status](https://github.com/ChristophWurst/twofactor_admin/actions/workflows/test.yml/badge.svg)](https://github.com/ChristophWurst/twofactor_admin/actions/workflows/test.yml) 9 | [![Read the Docs](https://img.shields.io/readthedocs/nextcloud-twofactor-admin.svg)](https://nextcloud-twofactor-admin.readthedocs.io/en/latest/) 10 | 11 | This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time 12 | code for users to log into a 2FA protected account. This is helpful in situations where 13 | users have lost access to their other 2FA methods or mandatory 2FA without any previously 14 | enabled 2FA provider. 15 | 16 | For more details, see the [admin documentation] and [user documentation]. 17 | 18 | ## Maintainers 19 | 20 | * [Altahrim](https://github.com/Altahrim) 21 | * [ChristophWurst](https://github.com/ChristophWurst) 22 | * [Nextcloud Two-Factor Authentication Working Group](https://github.com/nextcloud/wg-two-factor-authentication#members) 23 | 24 | [admin documentation]: https://nextcloud-twofactor-admin.readthedocs.io/en/latest/Admin%20Documentation/ 25 | [user documentation]: https://nextcloud-twofactor-admin.readthedocs.io/en/latest/User%20Documentation/ 26 | 27 | ## How to release 28 | 29 | 1) Go to https://github.com/nextcloud/twofactor_admin/actions/workflows/release.yml 30 | 2) Click *Run workflow* 31 | 1) Leave *Branch: main* 32 | 2) Click *Run workflow* 33 | 3) Go to https://github.com/nextcloud/twofactor_admin/actions 34 | 4) Click on the pending *Release* workflow and approve it (only maintainers can do this) 35 | -------------------------------------------------------------------------------- /l10n/cs.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Kód od správce", 3 | "Use a one-time code provided by your admin" : "Použít jednorázový kód poskytnutý správcem", 4 | "Two-Factor Admin Support" : "Podpora správce pro dvoufázové ověřování", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Poskytovatel podpory správce pro dvoufázové ověřování v Nextcloud", 6 | "Two-Factor Admin" : "Správa druhého faktoru", 7 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Správa druhého faktoru umožňuje vytváření jednorázových kódů pro vaše uživatele. Toto se hodí pro první přihlášení po zapnutí dvoufázového ověřování nebo když uživatelé ztratí přístup ke svým druhým faktorům.", 8 | "Generate a code" : "Vytvořit kód", 9 | "user {uid} does not exist" : "uživatel {uid} neexistuje", 10 | "you are not allowed to generate codes for this user" : "nemáte oprávnění vytvářet kódy pro tohoto uživatele", 11 | "unknown error" : "neznámá chyba", 12 | "User ID" : "Identif. uživatele", 13 | "Generate" : "Vytvořit", 14 | "Could not generate a code: {error}" : "Kód se nepodařilo vytvořit: {error}", 15 | "The generated code is {code}. It is valid for {hours} hours" : "Vytvořený kód je {code}. Je platný po dobu {hours} hodin", 16 | "Enter the one-time code provided by your admin." : "Zadejte jednorázový kód poskytnutý správcem.", 17 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Poté co se přihlásíte, zkontrolujte svá nastavení pro druhý faktor – abyste byli schopní se přihlásit znovu.", 18 | "Authentication code" : "Ověřovací kód", 19 | "Submit" : "Odeslat" 20 | },"pluralForm" :"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;" 21 | } -------------------------------------------------------------------------------- /l10n/ja.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "管理者コード", 3 | "Use a one-time code provided by your admin" : "管理者が提供するワンタイムコードを使用する", 4 | "Two-Factor Admin Support" : "Two-Factor Admin Support", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud Two-Factor Authentication管理者サポートプロバイダー", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Nextcloud向けのこの2要素認証 (2FA) プロバイダーにより、管理者はユーザーが2FAで\n\t\t保護されたアカウントにログインするためのワンタイムコードを生成できます。\n\t\tこれは、以前に有効になっていた2FAプロバイダーがなく、ユーザが他の2FA方式または\n\t\t必須の2FAにアクセスできなくなった場合に役立ちます。", 7 | "Two-Factor Admin" : "Two-Factor Admin", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "2要素管理プロバイダーを使用すると、ユーザーのワンタイムコードを生成できます。これは、2要素認証を有効にした後の最初のログイン、またはユーザが他の要素にアクセスできなくなった場合に役立ちます。", 9 | "Generate a code" : "コードを生成", 10 | "user {uid} does not exist" : "ユーザ{uid}は存在しません", 11 | "you are not allowed to generate codes for this user" : "このユーザーのコードを生成することは許可されていません", 12 | "unknown error" : "不明なエラー", 13 | "User ID" : "ユーザーID", 14 | "Generate" : "生成", 15 | "Could not generate a code: {error}" : "コードを生成できませんでした: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "生成されたコードは{code}です。{hours}時間有効です", 17 | "Enter the one-time code provided by your admin." : "管理者から提供されたワンタイムコードを入力してください。", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "ログインしたら、再度ログインできるように2要素認証設定を確認してください。", 19 | "Authentication code" : "認証コード", 20 | "Submit" : "送信" 21 | },"pluralForm" :"nplurals=1; plural=0;" 22 | } -------------------------------------------------------------------------------- /tests/Integration/Service/CodeStorageTest.php: -------------------------------------------------------------------------------- 1 | codeStorage = Server::get(CodeStorage::class); 30 | } 31 | 32 | public function testValidateInexistentCode() { 33 | $user = $this->createTestUser(); 34 | $code = '123456'; 35 | 36 | $valid = $this->codeStorage->validateCode($user, $code); 37 | 38 | $this->assertFalse($valid); 39 | } 40 | 41 | public function testValidateWrongCode() { 42 | $user = $this->createTestUser(); 43 | $this->codeStorage->generateCode($user); 44 | 45 | $valid = $this->codeStorage->validateCode($user, '123456'); 46 | 47 | $this->assertFalse($valid); 48 | } 49 | 50 | public function testValidateCorrectCode() { 51 | $user = $this->createTestUser(); 52 | $code = $this->codeStorage->generateCode($user); 53 | 54 | $valid = $this->codeStorage->validateCode($user, $code); 55 | 56 | $this->assertTrue($valid); 57 | } 58 | 59 | public function testValidateCorrectCodeTwice() { 60 | $user = $this->createTestUser(); 61 | $code = $this->codeStorage->generateCode($user); 62 | 63 | $valid = $this->codeStorage->validateCode($user, $code); 64 | $validAgain = $this->codeStorage->validateCode($user, $code); 65 | 66 | $this->assertTrue($valid); 67 | $this->assertFalse($validAgain); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /l10n/cs.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Kód od správce", 5 | "Use a one-time code provided by your admin" : "Použít jednorázový kód poskytnutý správcem", 6 | "Two-Factor Admin Support" : "Podpora správce pro dvoufázové ověřování", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Poskytovatel podpory správce pro dvoufázové ověřování v Nextcloud", 8 | "Two-Factor Admin" : "Správa druhého faktoru", 9 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Správa druhého faktoru umožňuje vytváření jednorázových kódů pro vaše uživatele. Toto se hodí pro první přihlášení po zapnutí dvoufázového ověřování nebo když uživatelé ztratí přístup ke svým druhým faktorům.", 10 | "Generate a code" : "Vytvořit kód", 11 | "user {uid} does not exist" : "uživatel {uid} neexistuje", 12 | "you are not allowed to generate codes for this user" : "nemáte oprávnění vytvářet kódy pro tohoto uživatele", 13 | "unknown error" : "neznámá chyba", 14 | "User ID" : "Identif. uživatele", 15 | "Generate" : "Vytvořit", 16 | "Could not generate a code: {error}" : "Kód se nepodařilo vytvořit: {error}", 17 | "The generated code is {code}. It is valid for {hours} hours" : "Vytvořený kód je {code}. Je platný po dobu {hours} hodin", 18 | "Enter the one-time code provided by your admin." : "Zadejte jednorázový kód poskytnutý správcem.", 19 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Poté co se přihlásíte, zkontrolujte svá nastavení pro druhý faktor – abyste byli schopní se přihlásit znovu.", 20 | "Authentication code" : "Ověřovací kód", 21 | "Submit" : "Odeslat" 22 | }, 23 | "nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;"); 24 | -------------------------------------------------------------------------------- /l10n/ja.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "管理者コード", 5 | "Use a one-time code provided by your admin" : "管理者が提供するワンタイムコードを使用する", 6 | "Two-Factor Admin Support" : "Two-Factor Admin Support", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud Two-Factor Authentication管理者サポートプロバイダー", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Nextcloud向けのこの2要素認証 (2FA) プロバイダーにより、管理者はユーザーが2FAで\n\t\t保護されたアカウントにログインするためのワンタイムコードを生成できます。\n\t\tこれは、以前に有効になっていた2FAプロバイダーがなく、ユーザが他の2FA方式または\n\t\t必須の2FAにアクセスできなくなった場合に役立ちます。", 9 | "Two-Factor Admin" : "Two-Factor Admin", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "2要素管理プロバイダーを使用すると、ユーザーのワンタイムコードを生成できます。これは、2要素認証を有効にした後の最初のログイン、またはユーザが他の要素にアクセスできなくなった場合に役立ちます。", 11 | "Generate a code" : "コードを生成", 12 | "user {uid} does not exist" : "ユーザ{uid}は存在しません", 13 | "you are not allowed to generate codes for this user" : "このユーザーのコードを生成することは許可されていません", 14 | "unknown error" : "不明なエラー", 15 | "User ID" : "ユーザーID", 16 | "Generate" : "生成", 17 | "Could not generate a code: {error}" : "コードを生成できませんでした: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "生成されたコードは{code}です。{hours}時間有効です", 19 | "Enter the one-time code provided by your admin." : "管理者から提供されたワンタイムコードを入力してください。", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "ログインしたら、再度ログインできるように2要素認証設定を確認してください。", 21 | "Authentication code" : "認証コード", 22 | "Submit" : "送信" 23 | }, 24 | "nplurals=1; plural=0;"); 25 | -------------------------------------------------------------------------------- /lib/Command/Generate.php: -------------------------------------------------------------------------------- 1 | userManager = $userManager; 30 | } 31 | 32 | protected function configure() { 33 | $this->setName('twofactorauth:admin:generate-code'); 34 | $this->setDescription('Generate a one-time 2FA code for users to log into their account'); 35 | $this->addArgument('uid', InputArgument::REQUIRED); 36 | } 37 | 38 | protected function execute(InputInterface $input, OutputInterface $output) { 39 | $userId = $input->getArgument('uid'); 40 | 41 | $user = $this->userManager->get($userId); 42 | 43 | if (is_null($user)) { 44 | $output->writeln('Invalid UID'); 45 | return 1; 46 | } 47 | 48 | if ($this->codeStorage->hasCode($user)) { 49 | // TODO: abort? Ask for confirmattion? Add `-f|--force` flag? 50 | $output->writeln('There is an existing code that will be overwritten.'); 51 | $output->writeln(''); 52 | } 53 | 54 | $code = $this->codeStorage->generateCode($user); 55 | $output->writeln(sprintf('Generated new one-time code for %s: %s', $userId, $code)); 56 | $ttlInHours = CodeStorage::CODE_TTL / 3600; 57 | $output->writeln(sprintf('This code is valid for %d hours.', $ttlInHours)); 58 | 59 | return 0; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /appinfo/info.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | twofactor_admin 8 | Two-Factor Admin Support 9 | Nextcloud Two-Factor Authentication Admin Support Provider 10 | This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time 11 | code for users to log into a 2FA protected account. This is helpful in situations where 12 | users have lost access to their other 2FA methods or mandatory 2FA without any previously 13 | enabled 2FA provider. 14 | 15 | 4.9.0 16 | agpl 17 | Benjamin Gaussorgues 18 | Christoph Wurst 19 | Nextcloud Two-Factor Authentication Working Group 20 | TwoFactorAdmin 21 | 22 | https://nextcloud-twofactor-admin.readthedocs.io/en/latest/User%20Documentation/ 23 | https://nextcloud-twofactor-admin.readthedocs.io/en/latest/Admin%20Documentation/ 24 | 25 | security 26 | https://github.com/ChristophWurst/twofactor_admin/issues 27 | 28 | 29 | sqlite 30 | mysql 31 | pgsql 32 | 33 | 34 | 35 | 36 | OCA\TwoFactorAdmin\Provider\AdminProvider 37 | 38 | 39 | 40 | OCA\TwoFactorAdmin\Command\Generate 41 | 42 | 43 | 44 | OCA\TwoFactorAdmin\Settings\AdminSettings 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/components/CodeGenerator.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 30 | 31 | 73 | -------------------------------------------------------------------------------- /tests/Unit/Listener/StateChangeRegistryUpdaterTest.php: -------------------------------------------------------------------------------- 1 | registry = $this->createMock(IRegistry::class); 34 | $this->provider = $this->createMock(AdminProvider::class); 35 | 36 | $this->listener = new StateChangeRegistryUpdater($this->registry, $this->provider); 37 | } 38 | 39 | public function testHandleUnrelatedEvent() { 40 | $event = new Event(); 41 | $this->registry->expects($this->never()) 42 | ->method('enableProviderFor'); 43 | $this->registry->expects($this->never()) 44 | ->method('disableProviderFor'); 45 | 46 | $this->listener->handle($event); 47 | } 48 | 49 | public function testEnableEvent() { 50 | $user = $this->createMock(IUser::class); 51 | $event = new StateChanged($user, true); 52 | $this->registry->expects($this->once()) 53 | ->method('enableProviderFor') 54 | ->with($this->provider, $user); 55 | 56 | $this->listener->handle($event); 57 | } 58 | 59 | public function testDisableEvent() { 60 | $user = $this->createMock(IUser::class); 61 | $event = new StateChanged($user, false); 62 | $this->registry->expects($this->once()) 63 | ->method('disableProviderFor') 64 | ->with($this->provider, $user); 65 | 66 | $this->listener->handle($event); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /lib/Controller/AdminCodeController.php: -------------------------------------------------------------------------------- 1 | userManager = $userManager; 47 | $this->groupManager = $groupManager; 48 | $this->subAdmin = $subAdmin; 49 | $this->userSession = $userSession; 50 | } 51 | 52 | /** 53 | * 54 | * @SubAdminRequired 55 | */ 56 | public function create(string $uid): JSONResponse { 57 | $currentUser = $this->userSession->getUser(); 58 | $user = $this->userManager->get($uid); 59 | 60 | if ($currentUser === null) { 61 | // This is pretty much impossible 62 | return new JSONResponse(null, Http::STATUS_BAD_REQUEST); 63 | } 64 | 65 | if ($user === null) { 66 | return new JSONResponse(null, Http::STATUS_NOT_FOUND); 67 | } 68 | 69 | if (!$this->groupManager->isAdmin($currentUser->getUID()) 70 | && !$this->subAdmin->isUserAccessible($currentUser, $user)) { 71 | // Nope 72 | return new JSONResponse(null, Http::STATUS_FORBIDDEN); 73 | } 74 | 75 | return new JSONResponse([ 76 | 'code' => $this->codeStorage->generateCode($user), 77 | 'validFor' => CodeStorage::CODE_TTL, 78 | ]); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /l10n/en_GB.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Admin code", 3 | "Use a one-time code provided by your admin" : "Use a one-time code provided by your admin", 4 | "Two-Factor Admin Support" : "Two-Factor Admin Support", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud Two-Factor Authentication Admin Support Provider", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider.", 7 | "Two-Factor Admin" : "Two-Factor Admin", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors.", 9 | "Generate a code" : "Generate a code", 10 | "user {uid} does not exist" : "user {uid} does not exist", 11 | "you are not allowed to generate codes for this user" : "you are not allowed to generate codes for this user", 12 | "unknown error" : "unknown error", 13 | "User ID" : "User ID", 14 | "Generate" : "Generate", 15 | "Could not generate a code: {error}" : "Could not generate a code: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "The generated code is {code}. It is valid for {hours} hours", 17 | "Enter the one-time code provided by your admin." : "Enter the one-time code provided by your admin.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Once logged in, please check your two-factor settings in order to be able to log in again.", 19 | "Authentication code" : "Authentication code", 20 | "Submit" : "Submit" 21 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 22 | } -------------------------------------------------------------------------------- /.github/workflows/lint-php.yml: -------------------------------------------------------------------------------- 1 | # This workflow is provided via the organization template repository 2 | # 3 | # https://github.com/nextcloud/.github 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization 5 | # 6 | # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors 7 | # SPDX-License-Identifier: MIT 8 | 9 | name: Lint php 10 | 11 | on: pull_request 12 | 13 | permissions: 14 | contents: read 15 | 16 | concurrency: 17 | group: lint-php-${{ github.head_ref || github.run_id }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | matrix: 22 | runs-on: ubuntu-latest-low 23 | outputs: 24 | php-versions: ${{ steps.versions.outputs.php-versions }} 25 | steps: 26 | - name: Checkout app 27 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 28 | with: 29 | persist-credentials: false 30 | 31 | - name: Get version matrix 32 | id: versions 33 | uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 34 | 35 | php-lint: 36 | runs-on: ubuntu-latest 37 | needs: matrix 38 | strategy: 39 | matrix: 40 | php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}} 41 | 42 | name: php-lint 43 | 44 | steps: 45 | - name: Checkout 46 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 47 | with: 48 | persist-credentials: false 49 | 50 | - name: Set up php ${{ matrix.php-versions }} 51 | uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5 52 | with: 53 | php-version: ${{ matrix.php-versions }} 54 | extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite 55 | coverage: none 56 | ini-file: development 57 | env: 58 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 59 | 60 | - name: Lint 61 | run: composer run lint 62 | 63 | summary: 64 | permissions: 65 | contents: none 66 | runs-on: ubuntu-latest-low 67 | needs: php-lint 68 | 69 | if: always() 70 | 71 | name: php-lint-summary 72 | 73 | steps: 74 | - name: Summary status 75 | run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi 76 | -------------------------------------------------------------------------------- /l10n/en_GB.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Admin code", 5 | "Use a one-time code provided by your admin" : "Use a one-time code provided by your admin", 6 | "Two-Factor Admin Support" : "Two-Factor Admin Support", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud Two-Factor Authentication Admin Support Provider", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider.", 9 | "Two-Factor Admin" : "Two-Factor Admin", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors.", 11 | "Generate a code" : "Generate a code", 12 | "user {uid} does not exist" : "user {uid} does not exist", 13 | "you are not allowed to generate codes for this user" : "you are not allowed to generate codes for this user", 14 | "unknown error" : "unknown error", 15 | "User ID" : "User ID", 16 | "Generate" : "Generate", 17 | "Could not generate a code: {error}" : "Could not generate a code: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "The generated code is {code}. It is valid for {hours} hours", 19 | "Enter the one-time code provided by your admin." : "Enter the one-time code provided by your admin.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Once logged in, please check your two-factor settings in order to be able to log in again.", 21 | "Authentication code" : "Authentication code", 22 | "Submit" : "Submit" 23 | }, 24 | "nplurals=2; plural=(n != 1);"); 25 | -------------------------------------------------------------------------------- /l10n/nb.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Admin-kode", 3 | "Use a one-time code provided by your admin" : "Bruk en engangskode levert av administratoren din", 4 | "Two-Factor Admin Support" : "To-faktor admin-støtte", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Leverandør av admin-støtte for Nextcloud To-faktor autentisering.", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Denne tofaktors autentiseringsleverandøren (2FA) for Nextcloud lar administratorer generere en engangs\n\t\t-kode for brukere å logge på en 2FA-beskyttet konto. Dette er nyttig i situasjoner der\n\t\tbrukere har mistet tilgangen til sine andre 2FA-metoder eller obligatorisk 2FA uten noen tidligere\n\t\taktivert 2FA-leverandør.", 7 | "Two-Factor Admin" : "To-faktor Admin", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Tofaktoradministratorleverandøren lar deg generere engangskoder for brukerne dine. Dette er nyttig for første pålogging etter at tofaktorautentisering er aktivert, eller når brukerne mister tilgangen til de andre faktorene.", 9 | "Generate a code" : "Generer en kode", 10 | "user {uid} does not exist" : "bruker {uid} finnes ikke", 11 | "you are not allowed to generate codes for this user" : "du har ikke lov til å generere koder for denne brukeren", 12 | "unknown error" : "Ukjent feil", 13 | "User ID" : "Bruker-ID", 14 | "Generate" : "Generer", 15 | "Could not generate a code: {error}" : "Kunne ikke generere en kode: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "Den genererte koden er {code}. Den er gyldig for {hours} timer", 17 | "Enter the one-time code provided by your admin." : "Skriv inn engangskoden fra administratoren din.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Når du er logget på, vennligst sjekk tofaktorinnstillingene dine for å kunne logge på igjen.", 19 | "Authentication code" : "Autentiseringskode", 20 | "Submit" : "Send inn" 21 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 22 | } -------------------------------------------------------------------------------- /l10n/nb.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Admin-kode", 5 | "Use a one-time code provided by your admin" : "Bruk en engangskode levert av administratoren din", 6 | "Two-Factor Admin Support" : "To-faktor admin-støtte", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Leverandør av admin-støtte for Nextcloud To-faktor autentisering.", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Denne tofaktors autentiseringsleverandøren (2FA) for Nextcloud lar administratorer generere en engangs\n\t\t-kode for brukere å logge på en 2FA-beskyttet konto. Dette er nyttig i situasjoner der\n\t\tbrukere har mistet tilgangen til sine andre 2FA-metoder eller obligatorisk 2FA uten noen tidligere\n\t\taktivert 2FA-leverandør.", 9 | "Two-Factor Admin" : "To-faktor Admin", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Tofaktoradministratorleverandøren lar deg generere engangskoder for brukerne dine. Dette er nyttig for første pålogging etter at tofaktorautentisering er aktivert, eller når brukerne mister tilgangen til de andre faktorene.", 11 | "Generate a code" : "Generer en kode", 12 | "user {uid} does not exist" : "bruker {uid} finnes ikke", 13 | "you are not allowed to generate codes for this user" : "du har ikke lov til å generere koder for denne brukeren", 14 | "unknown error" : "Ukjent feil", 15 | "User ID" : "Bruker-ID", 16 | "Generate" : "Generer", 17 | "Could not generate a code: {error}" : "Kunne ikke generere en kode: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "Den genererte koden er {code}. Den er gyldig for {hours} timer", 19 | "Enter the one-time code provided by your admin." : "Skriv inn engangskoden fra administratoren din.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Når du er logget på, vennligst sjekk tofaktorinnstillingene dine for å kunne logge på igjen.", 21 | "Authentication code" : "Autentiseringskode", 22 | "Submit" : "Send inn" 23 | }, 24 | "nplurals=2; plural=(n != 1);"); 25 | -------------------------------------------------------------------------------- /l10n/ug.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "باشقۇرۇش كودى", 3 | "Use a one-time code provided by your admin" : "باشقۇرغۇچىڭىز تەمىنلىگەن بىر قېتىملىق كودنى ئىشلىتىڭ", 4 | "Two-Factor Admin Support" : "ئىككى ئامىل باشقۇرغۇچىنى قوللاش", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud ئىككى ئامىللىق دەلىللەش باشقۇرغۇچى ياردەمچىسى", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Nextcloud ئۈچۈن بۇ ئىككى ئامىللىق auth (2FA) تەمىنلىگۈچى باشقۇرغۇچىنىڭ بىر قېتىم ھاسىل قىلىشىغا يول قويىدۇ\n\t\tئىشلەتكۈچىلەرنىڭ 2FA قوغدىلىدىغان ھېساباتقا كىرىشى ئۈچۈن كود. بۇ ئەھۋاللار پايدىلىق\n\t\tئىشلەتكۈچىلەر ئىلگىرى باشقا 2FA ئۇسۇلى ياكى مەجبۇرىي 2FA گە ئېرىشىش پۇرسىتىدىن مەھرۇم قالدى\n\t\tقوزغىتىلغان 2FA تەمىنلىگۈچى.", 7 | "Two-Factor Admin" : "ئىككى فاكتور باشقۇرغۇچى", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "ئىككى ئامىللىق باشقۇرغۇچى تەمىنلىگۈچى ئابونتلىرىڭىز ئۈچۈن بىر قېتىم كود ھاسىل قىلالايدۇ. بۇ ئىككى ئامىللىق دەلىللەش قوزغىتىلغاندىن كېيىن ياكى ئابونتلار باشقا ئامىللارغا ئېرىشىش پۇرسىتىدىن ئايرىلغاندىن كېيىن تۇنجى كىرىشكە پايدىلىق.", 9 | "Generate a code" : "كود ھاسىل قىلىڭ", 10 | "user {uid} does not exist" : "ئىشلەتكۈچى {uid} مەۋجۇت ئەمەس", 11 | "you are not allowed to generate codes for this user" : "بۇ ئىشلەتكۈچى ئۈچۈن كود ھاسىل قىلىشىڭىزغا رۇخسەت قىلىنمايدۇ", 12 | "unknown error" : "نامەلۇم خاتالىق", 13 | "User ID" : "ئىشلەتكۈچى كىملىكى", 14 | "Generate" : "Generate", 15 | "Could not generate a code: {error}" : "كود ھاسىل قىلالمىدى: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "ھاسىل قىلىنغان كود {code}. ئۇ {hours} سائەت كۈچكە ئىگە", 17 | "Enter the one-time code provided by your admin." : "باشقۇرغۇچىڭىز تەمىنلىگەن بىر قېتىملىق كودنى كىرگۈزۈڭ.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "كىرگەندىن كېيىن ، قايتا كىرەلەيدىغان بولۇش ئۈچۈن ئىككى ئامىللىق تەڭشەكلىرىڭىزنى تەكشۈرۈپ بېقىڭ.", 19 | "Authentication code" : "دەلىللەش كودى", 20 | "Submit" : "يوللاڭ" 21 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 22 | } -------------------------------------------------------------------------------- /l10n/nl.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Admin code", 3 | "Use a one-time code provided by your admin" : "Gebruik een eenmalige code door je beheerder verstrekt", 4 | "Two-Factor Admin Support" : "Tweefactor Admin Ondersteuning", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud Two-Factor Authentication Admin Support Provider", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Met deze tweefactorauthentic (2FA) provider voor Nextcloud kunnen beheerders een eenmalige genereren\n\t\tcode waarmee gebruikers kunnen inloggen op een 2FA-beveiligd account. Dit is nuttig in situaties waarin\n\t\tgebruikers hebben de toegang tot hun andere 2FA-methoden of verplichte 2FA verloren zonder enige voorafgaande\n\t\tingeschakelde 2FA-provider.", 7 | "Two-Factor Admin" : "Tweefactorbeheer", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Met tweefactoradmin kunt u eenmalige codes voor uw gebruikers genereren. Dit is handig voor de eerste login nadat tweefactorauthenticatie is ingeschakeld of wanneer de gebruikers de toegang tot hun andere factoren verliezen.", 9 | "Generate a code" : "Genereer een code", 10 | "user {uid} does not exist" : "gebruiker {uid} bestaat niet", 11 | "you are not allowed to generate codes for this user" : "je mag geen codes genereren voor deze gebruiker", 12 | "unknown error" : "onbekende fout", 13 | "User ID" : "Gebruiker-ID", 14 | "Generate" : "Genereer", 15 | "Could not generate a code: {error}" : "Kon geen code genereren: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "De gegenereerde code is {code}. Het is {hours} uur geldig.", 17 | "Enter the one-time code provided by your admin." : "Voer de eenmalige code in die je beheerder heeft gegeven.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Wanneer je ingelogd bent, controleer dan je tweefactorinstellingen om opnieuw te kunnen inloggen.", 19 | "Authentication code" : "Authenticatiecode", 20 | "Submit" : "Indienen" 21 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 22 | } -------------------------------------------------------------------------------- /l10n/ug.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "باشقۇرۇش كودى", 5 | "Use a one-time code provided by your admin" : "باشقۇرغۇچىڭىز تەمىنلىگەن بىر قېتىملىق كودنى ئىشلىتىڭ", 6 | "Two-Factor Admin Support" : "ئىككى ئامىل باشقۇرغۇچىنى قوللاش", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud ئىككى ئامىللىق دەلىللەش باشقۇرغۇچى ياردەمچىسى", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Nextcloud ئۈچۈن بۇ ئىككى ئامىللىق auth (2FA) تەمىنلىگۈچى باشقۇرغۇچىنىڭ بىر قېتىم ھاسىل قىلىشىغا يول قويىدۇ\n\t\tئىشلەتكۈچىلەرنىڭ 2FA قوغدىلىدىغان ھېساباتقا كىرىشى ئۈچۈن كود. بۇ ئەھۋاللار پايدىلىق\n\t\tئىشلەتكۈچىلەر ئىلگىرى باشقا 2FA ئۇسۇلى ياكى مەجبۇرىي 2FA گە ئېرىشىش پۇرسىتىدىن مەھرۇم قالدى\n\t\tقوزغىتىلغان 2FA تەمىنلىگۈچى.", 9 | "Two-Factor Admin" : "ئىككى فاكتور باشقۇرغۇچى", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "ئىككى ئامىللىق باشقۇرغۇچى تەمىنلىگۈچى ئابونتلىرىڭىز ئۈچۈن بىر قېتىم كود ھاسىل قىلالايدۇ. بۇ ئىككى ئامىللىق دەلىللەش قوزغىتىلغاندىن كېيىن ياكى ئابونتلار باشقا ئامىللارغا ئېرىشىش پۇرسىتىدىن ئايرىلغاندىن كېيىن تۇنجى كىرىشكە پايدىلىق.", 11 | "Generate a code" : "كود ھاسىل قىلىڭ", 12 | "user {uid} does not exist" : "ئىشلەتكۈچى {uid} مەۋجۇت ئەمەس", 13 | "you are not allowed to generate codes for this user" : "بۇ ئىشلەتكۈچى ئۈچۈن كود ھاسىل قىلىشىڭىزغا رۇخسەت قىلىنمايدۇ", 14 | "unknown error" : "نامەلۇم خاتالىق", 15 | "User ID" : "ئىشلەتكۈچى كىملىكى", 16 | "Generate" : "Generate", 17 | "Could not generate a code: {error}" : "كود ھاسىل قىلالمىدى: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "ھاسىل قىلىنغان كود {code}. ئۇ {hours} سائەت كۈچكە ئىگە", 19 | "Enter the one-time code provided by your admin." : "باشقۇرغۇچىڭىز تەمىنلىگەن بىر قېتىملىق كودنى كىرگۈزۈڭ.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "كىرگەندىن كېيىن ، قايتا كىرەلەيدىغان بولۇش ئۈچۈن ئىككى ئامىللىق تەڭشەكلىرىڭىزنى تەكشۈرۈپ بېقىڭ.", 21 | "Authentication code" : "دەلىللەش كودى", 22 | "Submit" : "يوللاڭ" 23 | }, 24 | "nplurals=2; plural=(n != 1);"); 25 | -------------------------------------------------------------------------------- /l10n/nl.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Admin code", 5 | "Use a one-time code provided by your admin" : "Gebruik een eenmalige code door je beheerder verstrekt", 6 | "Two-Factor Admin Support" : "Tweefactor Admin Ondersteuning", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud Two-Factor Authentication Admin Support Provider", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Met deze tweefactorauthentic (2FA) provider voor Nextcloud kunnen beheerders een eenmalige genereren\n\t\tcode waarmee gebruikers kunnen inloggen op een 2FA-beveiligd account. Dit is nuttig in situaties waarin\n\t\tgebruikers hebben de toegang tot hun andere 2FA-methoden of verplichte 2FA verloren zonder enige voorafgaande\n\t\tingeschakelde 2FA-provider.", 9 | "Two-Factor Admin" : "Tweefactorbeheer", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Met tweefactoradmin kunt u eenmalige codes voor uw gebruikers genereren. Dit is handig voor de eerste login nadat tweefactorauthenticatie is ingeschakeld of wanneer de gebruikers de toegang tot hun andere factoren verliezen.", 11 | "Generate a code" : "Genereer een code", 12 | "user {uid} does not exist" : "gebruiker {uid} bestaat niet", 13 | "you are not allowed to generate codes for this user" : "je mag geen codes genereren voor deze gebruiker", 14 | "unknown error" : "onbekende fout", 15 | "User ID" : "Gebruiker-ID", 16 | "Generate" : "Genereer", 17 | "Could not generate a code: {error}" : "Kon geen code genereren: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "De gegenereerde code is {code}. Het is {hours} uur geldig.", 19 | "Enter the one-time code provided by your admin." : "Voer de eenmalige code in die je beheerder heeft gegeven.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Wanneer je ingelogd bent, controleer dan je tweefactorinstellingen om opnieuw te kunnen inloggen.", 21 | "Authentication code" : "Authenticatiecode", 22 | "Submit" : "Indienen" 23 | }, 24 | "nplurals=2; plural=(n != 1);"); 25 | -------------------------------------------------------------------------------- /l10n/eu.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Administrazio kodea", 3 | "Use a one-time code provided by your admin" : "Erabili administratzaileak emandako behin-behineko kodea", 4 | "Two-Factor Admin Support" : "Bi faktoreko administrazio-laguntza", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud Bi faktoreko autentifikazioko administrazioaren laguntza-hornitzailea", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Nextcloud-erako bi faktoreko autentifikazio (2FA) hornitzaile honek administratzaileei behin-behineko kode bat sortzeko aukera ematen die\nerabiltzaileek 2FA babestutako kontu batean saioa hasteko. Hau lagungarria da\nerabiltzaileek beren beste 2FA metodoetarako edo derrigorrezko 2FArako sarbidea galdu duten egoeretan.", 7 | "Two-Factor Admin" : "Bi Faktoreko administrazioa", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Bi faktoreko administrazioaren hornitzaileak zure erabiltzaileentzako behin-behineko kodeak sortzeko aukera ematen dizu. Hau lagungarria da bi faktoreko autentifikazioa gaitu ondoren edo erabiltzaileek beste faktoreetarako sarbidea galtzen dutenean lehen saioa hasteko.", 9 | "Generate a code" : "Sortu kode bat", 10 | "user {uid} does not exist" : "{uid} erabiltzailea ez da existitzen", 11 | "you are not allowed to generate codes for this user" : "ez duzu baimenik erabiltzaile honentzako kodeak sortzeko", 12 | "unknown error" : "errore ezezaguna", 13 | "User ID" : "Erabiltzailearen ID", 14 | "Generate" : "Sortu", 15 | "Could not generate a code: {error}" : "Ezin izan da koderik sortu: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "Sortutako kodea {code} da. {ordu} ordurako balio du", 17 | "Enter the one-time code provided by your admin." : "Sartu administratzaileak emandako behin-behineko kodea.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Saioa hasi ondoren, egiaztatu zure bi faktoreen ezarpenak berriro saioa hasi ahal izateko.", 19 | "Authentication code" : "Autentifikazio kodea", 20 | "Submit" : "Bidali" 21 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 22 | } -------------------------------------------------------------------------------- /lib/Provider/AdminProvider.php: -------------------------------------------------------------------------------- 1 | l10n->t('Admin code'); 43 | } 44 | 45 | /** 46 | * Get the description for selecting the 2FA provider 47 | */ 48 | public function getDescription(): string { 49 | return $this->l10n->t('Use a one-time code provided by your admin'); 50 | } 51 | 52 | /** 53 | * Get the template for rending the 2FA provider view 54 | * 55 | * 56 | */ 57 | public function getTemplate(IUser $user): Template { 58 | return new Template($this->appName, 'challenge'); 59 | } 60 | 61 | /** 62 | * Verify the given challenge 63 | * 64 | * 65 | */ 66 | public function verifyChallenge(IUser $user, string $challenge): bool { 67 | return $this->codeStorage->validateCode($user, $challenge); 68 | } 69 | 70 | /** 71 | * Decides whether 2FA is enabled for the given user 72 | */ 73 | public function isTwoFactorAuthEnabledForUser(IUser $user): bool { 74 | return $this->codeStorage->hasCode($user); 75 | } 76 | 77 | /** 78 | * Disable this provider for the given user. 79 | * 80 | * @param IUser $user the user to deactivate this provider for 81 | */ 82 | public function disableFor(IUser $user): void { 83 | $this->codeStorage->removeCodesForUser($user); 84 | } 85 | 86 | public function getLightIcon(): String { 87 | return $this->urlGenerator->imagePath('core', 'actions/more-white.svg'); 88 | } 89 | 90 | public function getDarkIcon(): String { 91 | return $this->urlGenerator->imagePath('core', 'actions/more.svg'); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /l10n/eu.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Administrazio kodea", 5 | "Use a one-time code provided by your admin" : "Erabili administratzaileak emandako behin-behineko kodea", 6 | "Two-Factor Admin Support" : "Bi faktoreko administrazio-laguntza", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud Bi faktoreko autentifikazioko administrazioaren laguntza-hornitzailea", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Nextcloud-erako bi faktoreko autentifikazio (2FA) hornitzaile honek administratzaileei behin-behineko kode bat sortzeko aukera ematen die\nerabiltzaileek 2FA babestutako kontu batean saioa hasteko. Hau lagungarria da\nerabiltzaileek beren beste 2FA metodoetarako edo derrigorrezko 2FArako sarbidea galdu duten egoeretan.", 9 | "Two-Factor Admin" : "Bi Faktoreko administrazioa", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Bi faktoreko administrazioaren hornitzaileak zure erabiltzaileentzako behin-behineko kodeak sortzeko aukera ematen dizu. Hau lagungarria da bi faktoreko autentifikazioa gaitu ondoren edo erabiltzaileek beste faktoreetarako sarbidea galtzen dutenean lehen saioa hasteko.", 11 | "Generate a code" : "Sortu kode bat", 12 | "user {uid} does not exist" : "{uid} erabiltzailea ez da existitzen", 13 | "you are not allowed to generate codes for this user" : "ez duzu baimenik erabiltzaile honentzako kodeak sortzeko", 14 | "unknown error" : "errore ezezaguna", 15 | "User ID" : "Erabiltzailearen ID", 16 | "Generate" : "Sortu", 17 | "Could not generate a code: {error}" : "Ezin izan da koderik sortu: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "Sortutako kodea {code} da. {ordu} ordurako balio du", 19 | "Enter the one-time code provided by your admin." : "Sartu administratzaileak emandako behin-behineko kodea.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Saioa hasi ondoren, egiaztatu zure bi faktoreen ezarpenak berriro saioa hasi ahal izateko.", 21 | "Authentication code" : "Autentifikazio kodea", 22 | "Submit" : "Bidali" 23 | }, 24 | "nplurals=2; plural=(n != 1);"); 25 | -------------------------------------------------------------------------------- /l10n/sw.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Msimbo wa msimamizi", 3 | "Use a one-time code provided by your admin" : "Tumia msimbo wa mara moja uliotolewa na msimamizi wako", 4 | "Two-Factor Admin Support" : "Usaidizi wa msimamizi wa Mambo mawili", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Mtoa Huduma wa Usaidizi wa Msimamizi wa Uthibitishaji wa Mambo mawili ya Nextcloud", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Mtoa huduma huyu wa vipengele viwili (2FA) kwa Nextcloud huruhusu wasimamizi kuzalisha mara moja\n\t\t msimbo wa watumiaji kuingia katika akaunti iliyolindwa ya 2FA. Hii inasaidia katika hali ambapo\n\t\twatumiaji wamepoteza ufikiaji wa njia zao zingine za 2FA au 2FA ya lazima bila yoyote hapo awali\n\t\tkuwasha mtoa huduma wa 2FA.", 7 | "Two-Factor Admin" : "Msimamizi wa Mambo mawili", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Mtoa huduma wa msimamizi wa vipengele viwili hukuruhusu kutengeneza misimbo ya mara moja kwa watumiaji wako. Hii ni muhimu kwa kuingia kwa mara ya kwanza baada ya uthibitishaji wa vipengele viwili kuwezeshwa au wakati watumiaji wanapoteza uwezo wa kufikia vipengele vyao vingine.", 9 | "Generate a code" : "Tengeneza msimbo", 10 | "user {uid} does not exist" : "mtumiaji {uid} hayupo", 11 | "you are not allowed to generate codes for this user" : "huruhusiwi kutoa misimbo ya mtumiaji huyu", 12 | "unknown error" : "hitilafu isiyojulikana", 13 | "User ID" : "Kitambulisho cha mtumiaji", 14 | "Generate" : "Tengeneza/zalisha", 15 | "Could not generate a code: {error}" : "Haikuweza kuzalisha msimbo: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "Msimbo uliotengenezwa ni {code}. Ni halali kwa saa{hours}", 17 | "Enter the one-time code provided by your admin." : "Weka msimbo wa mara moja uliotolewa na msimamizi wako.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Ukishaingia, tafadhali angalia mipangilio yako ya vipengele viwili ili uweze kuingia tena.", 19 | "Authentication code" : "Msimbo wa uthibitishaji", 20 | "Submit" : "Wasilisha" 21 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 22 | } -------------------------------------------------------------------------------- /l10n/ar.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "رمز المدير", 3 | "Use a one-time code provided by your admin" : "إستعِمل رمز المرة الواحدة الممنوح لك من المدير", 4 | "Two-Factor Admin Support" : "دعم المدير للتحقق ثنائي العوامل من الهوِيّة", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "مزوّد دعم المدير للتحقق ثنائي العوامل من الهوِيّة في نكست كلاود", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "يسمح مُزوّد التحقق ثنائي العوامل من الهويّة في نكست كلاود (2FA) لـ Nextcloud للمديرين بإنشاء رموز تستعمل لمرة واحدة \t\t لتسجيل دخول المستخدم إلى حسابه المحمي مع التحقُّق المثنى من هُويَّتِه 2FA. و هذا مفيد في المواقف التي \t\tيكون المستخدم قد فقد فيها إمكانية الوصول إلى طرق التحقُّق الأخرى أو في حالة فرض التحقق المثنى الإلزامي بدون \t\tتمكين مزود للتحقق المثنى 2FA.", 7 | "Two-Factor Admin" : "مدير التحقق ثنائي العوامل من الهويّة", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "يسمح مُزوّد التحقق ثنائي العوامل من الهويّة في نكست كلاود لك بإنشاء رموز لمرة واحدة لمستخدميك. و هذا مفيد في المواقف التي يكون المستخدم قد فقد فيها إمكانية الوصول إلى طرق التحقُّق الأخرى أو في حالة فرض التحقق المثنى الإلزامي بدون تمكين مزود للتحقق المثنى.", 9 | "Generate a code" : "قم بتوليد كود", 10 | "user {uid} does not exist" : "المستخدِم {uid} غير موجود", 11 | "you are not allowed to generate codes for this user" : "غير مسموح لك بتوليد كود لهذا المستخدِم", 12 | "unknown error" : "خطأٌ غير محدّدٍ", 13 | "User ID" : "رمز المستخدم", 14 | "Generate" : "توليد", 15 | "Could not generate a code: {error}" : "تعذّر توليد كود: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "الكود المٌولَّد هو {code}. وهو صالح لـ {hours} ساعات", 17 | "Enter the one-time code provided by your admin." : "أدخِل كود المرة الواحدة الممنوح لك من المدير.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "بمجرد دخولك، يُرجى التحقق من إعدادات التحقق ثنائي العوامل لديك حتى يمكنك الدخول في المرة القادمة.", 19 | "Authentication code" : "رمز المصادقة", 20 | "Submit" : "إرسال " 21 | },"pluralForm" :"nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;" 22 | } -------------------------------------------------------------------------------- /l10n/ga.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Cóid admin", 3 | "Use a one-time code provided by your admin" : "Úsáid cód aonuaire a sholáthraíonn do riarthóir", 4 | "Two-Factor Admin Support" : "Tacaíocht Riaracháin Dhá-Fhachtóir", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Soláthraí Tacaíochta Riaracháin Fíordheimhnithe Dhá-Fhachtóir Nextcloud", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Ligeann an soláthraí údair dhá-fhachtóir seo (2FA) do Nextcloud do riarthóirí aon-uaire a ghiniúint\n\t\t cód le go bhféadfaidh úsáideoirí logáil isteach i gcuntas faoi chosaint 2FA. Tá sé seo cabhrach i gcásanna ina\n\t\t tá rochtain caillte ag úsáideoirí ar a modhanna 2FA eile nó ar 2FA éigeantach gan aon cheann roimhe seo\n\t\t soláthraí 2FA cumasaithe.", 7 | "Two-Factor Admin" : "Riarachán Dhá-Fhachtóir", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Ligeann an soláthraí riaracháin dhá-fhachtóir duit cóid aonuaire a ghiniúint do d’úsáideoirí. Tá sé seo cabhrach don chéad logáil isteach tar éis fíordheimhniú dhá-fhachtóir a chumasú nó nuair a chailleann na húsáideoirí rochtain ar a gcuid fachtóirí eile.", 9 | "Generate a code" : "Gin cód", 10 | "user {uid} does not exist" : "níl úsáideoir {uid} ann", 11 | "you are not allowed to generate codes for this user" : "níl cead agat cóid a ghiniúint don úsáideoir seo", 12 | "unknown error" : "earráid anaithnid", 13 | "User ID" : "ID Úsáideoir", 14 | "Generate" : "Gin", 15 | "Could not generate a code: {error}" : "Níorbh fhéidir cód a ghiniúint: {earráid}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "Is é {code} an cód ginte. Tá sé bailí ar feadh {uair} uair an chloig", 17 | "Enter the one-time code provided by your admin." : "Cuir isteach an cód aonuaire a sholáthraíonn do riarthóir.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Nuair a bheidh tú logáilte isteach, seiceáil do shocruithe dhá-fhachtóir le gur féidir leat logáil isteach arís.", 19 | "Authentication code" : "Cód fíordheimhnithe", 20 | "Submit" : "Cuir isteach" 21 | },"pluralForm" :"nplurals=5; plural=(n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4);" 22 | } -------------------------------------------------------------------------------- /l10n/sw.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Msimbo wa msimamizi", 5 | "Use a one-time code provided by your admin" : "Tumia msimbo wa mara moja uliotolewa na msimamizi wako", 6 | "Two-Factor Admin Support" : "Usaidizi wa msimamizi wa Mambo mawili", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Mtoa Huduma wa Usaidizi wa Msimamizi wa Uthibitishaji wa Mambo mawili ya Nextcloud", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Mtoa huduma huyu wa vipengele viwili (2FA) kwa Nextcloud huruhusu wasimamizi kuzalisha mara moja\n\t\t msimbo wa watumiaji kuingia katika akaunti iliyolindwa ya 2FA. Hii inasaidia katika hali ambapo\n\t\twatumiaji wamepoteza ufikiaji wa njia zao zingine za 2FA au 2FA ya lazima bila yoyote hapo awali\n\t\tkuwasha mtoa huduma wa 2FA.", 9 | "Two-Factor Admin" : "Msimamizi wa Mambo mawili", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Mtoa huduma wa msimamizi wa vipengele viwili hukuruhusu kutengeneza misimbo ya mara moja kwa watumiaji wako. Hii ni muhimu kwa kuingia kwa mara ya kwanza baada ya uthibitishaji wa vipengele viwili kuwezeshwa au wakati watumiaji wanapoteza uwezo wa kufikia vipengele vyao vingine.", 11 | "Generate a code" : "Tengeneza msimbo", 12 | "user {uid} does not exist" : "mtumiaji {uid} hayupo", 13 | "you are not allowed to generate codes for this user" : "huruhusiwi kutoa misimbo ya mtumiaji huyu", 14 | "unknown error" : "hitilafu isiyojulikana", 15 | "User ID" : "Kitambulisho cha mtumiaji", 16 | "Generate" : "Tengeneza/zalisha", 17 | "Could not generate a code: {error}" : "Haikuweza kuzalisha msimbo: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "Msimbo uliotengenezwa ni {code}. Ni halali kwa saa{hours}", 19 | "Enter the one-time code provided by your admin." : "Weka msimbo wa mara moja uliotolewa na msimamizi wako.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Ukishaingia, tafadhali angalia mipangilio yako ya vipengele viwili ili uweze kuingia tena.", 21 | "Authentication code" : "Msimbo wa uthibitishaji", 22 | "Submit" : "Wasilisha" 23 | }, 24 | "nplurals=2; plural=(n != 1);"); 25 | -------------------------------------------------------------------------------- /l10n/ar.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "رمز المدير", 5 | "Use a one-time code provided by your admin" : "إستعِمل رمز المرة الواحدة الممنوح لك من المدير", 6 | "Two-Factor Admin Support" : "دعم المدير للتحقق ثنائي العوامل من الهوِيّة", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "مزوّد دعم المدير للتحقق ثنائي العوامل من الهوِيّة في نكست كلاود", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "يسمح مُزوّد التحقق ثنائي العوامل من الهويّة في نكست كلاود (2FA) لـ Nextcloud للمديرين بإنشاء رموز تستعمل لمرة واحدة \t\t لتسجيل دخول المستخدم إلى حسابه المحمي مع التحقُّق المثنى من هُويَّتِه 2FA. و هذا مفيد في المواقف التي \t\tيكون المستخدم قد فقد فيها إمكانية الوصول إلى طرق التحقُّق الأخرى أو في حالة فرض التحقق المثنى الإلزامي بدون \t\tتمكين مزود للتحقق المثنى 2FA.", 9 | "Two-Factor Admin" : "مدير التحقق ثنائي العوامل من الهويّة", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "يسمح مُزوّد التحقق ثنائي العوامل من الهويّة في نكست كلاود لك بإنشاء رموز لمرة واحدة لمستخدميك. و هذا مفيد في المواقف التي يكون المستخدم قد فقد فيها إمكانية الوصول إلى طرق التحقُّق الأخرى أو في حالة فرض التحقق المثنى الإلزامي بدون تمكين مزود للتحقق المثنى.", 11 | "Generate a code" : "قم بتوليد كود", 12 | "user {uid} does not exist" : "المستخدِم {uid} غير موجود", 13 | "you are not allowed to generate codes for this user" : "غير مسموح لك بتوليد كود لهذا المستخدِم", 14 | "unknown error" : "خطأٌ غير محدّدٍ", 15 | "User ID" : "رمز المستخدم", 16 | "Generate" : "توليد", 17 | "Could not generate a code: {error}" : "تعذّر توليد كود: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "الكود المٌولَّد هو {code}. وهو صالح لـ {hours} ساعات", 19 | "Enter the one-time code provided by your admin." : "أدخِل كود المرة الواحدة الممنوح لك من المدير.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "بمجرد دخولك، يُرجى التحقق من إعدادات التحقق ثنائي العوامل لديك حتى يمكنك الدخول في المرة القادمة.", 21 | "Authentication code" : "رمز المصادقة", 22 | "Submit" : "إرسال " 23 | }, 24 | "nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;"); 25 | -------------------------------------------------------------------------------- /l10n/tr.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Yönetici kodu", 3 | "Use a one-time code provided by your admin" : "Yöneticiniz tarafından verilen tek kullanımlık kodu kullanın", 4 | "Two-Factor Admin Support" : "İki adımlı doğrulama yönetici desteği", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud iki adımlı doğrulama yönetici desteği hizmeti sağlayıcısı", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Nextcloud için iki adımlı doğrulama (2FA) hizmeti sağlayıcısı. Yöneticilerin, kullanıcıların iki adımlı\n\t\tdoğrulama ile korunan bir hesapta oturum açması için tek kullanımlık bir kod üretilmesini sağlar.\n\t\tBu kod, kullanıcının iki adımlı doğrulama yöntemine erişimi olmadığında ya da önceden\n\t\tkullanıma alınmış bir hizmet sağlayıcısı yokken iki adımlı doğrulamanın dayatıldığı durumlarda yararlıdır.", 7 | "Two-Factor Admin" : "İki adımlı doğrulama yöneticisi", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "İki adımlı doğrulama yönetici hizmeti sağlayıcı, kullanıcılarınız için tek kullanımlık kodlar üretmenizi sağlar. Bu kodlar, iki adımlı doğrulama açıldıktan sonraki ilk oturum açma işleminde veya kullanıcılar diğer doğrulama adımlarına erişimi kaybettiğinde işe yarar.", 9 | "Generate a code" : "Bir kod oluşturun", 10 | "user {uid} does not exist" : "{uid} kullanıcısı bulunamadı", 11 | "you are not allowed to generate codes for this user" : "bu kullanıcı için kod üretme izniniz yok", 12 | "unknown error" : "hata bilinmiyor", 13 | "User ID" : "Kullanıcı kimliği", 14 | "Generate" : "Oluştur", 15 | "Could not generate a code: {error}" : "Kod oluşturulamadı: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "{code} kodu oluşturuldu ve {hours} saat süreyle geçerli olacak", 17 | "Enter the one-time code provided by your admin." : "Yöneticiniz tarafından verilen tek kullanımlık kodu yazın.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Oturum açtıktan sonra, daha sonra yeniden oturum açabilmek için iki adımlı doğrulama ayarlarınızı denetleyin.", 19 | "Authentication code" : "Doğrulama kodu", 20 | "Submit" : "Gönder" 21 | },"pluralForm" :"nplurals=2; plural=(n > 1);" 22 | } -------------------------------------------------------------------------------- /l10n/ga.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Cóid admin", 5 | "Use a one-time code provided by your admin" : "Úsáid cód aonuaire a sholáthraíonn do riarthóir", 6 | "Two-Factor Admin Support" : "Tacaíocht Riaracháin Dhá-Fhachtóir", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Soláthraí Tacaíochta Riaracháin Fíordheimhnithe Dhá-Fhachtóir Nextcloud", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Ligeann an soláthraí údair dhá-fhachtóir seo (2FA) do Nextcloud do riarthóirí aon-uaire a ghiniúint\n\t\t cód le go bhféadfaidh úsáideoirí logáil isteach i gcuntas faoi chosaint 2FA. Tá sé seo cabhrach i gcásanna ina\n\t\t tá rochtain caillte ag úsáideoirí ar a modhanna 2FA eile nó ar 2FA éigeantach gan aon cheann roimhe seo\n\t\t soláthraí 2FA cumasaithe.", 9 | "Two-Factor Admin" : "Riarachán Dhá-Fhachtóir", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Ligeann an soláthraí riaracháin dhá-fhachtóir duit cóid aonuaire a ghiniúint do d’úsáideoirí. Tá sé seo cabhrach don chéad logáil isteach tar éis fíordheimhniú dhá-fhachtóir a chumasú nó nuair a chailleann na húsáideoirí rochtain ar a gcuid fachtóirí eile.", 11 | "Generate a code" : "Gin cód", 12 | "user {uid} does not exist" : "níl úsáideoir {uid} ann", 13 | "you are not allowed to generate codes for this user" : "níl cead agat cóid a ghiniúint don úsáideoir seo", 14 | "unknown error" : "earráid anaithnid", 15 | "User ID" : "ID Úsáideoir", 16 | "Generate" : "Gin", 17 | "Could not generate a code: {error}" : "Níorbh fhéidir cód a ghiniúint: {earráid}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "Is é {code} an cód ginte. Tá sé bailí ar feadh {uair} uair an chloig", 19 | "Enter the one-time code provided by your admin." : "Cuir isteach an cód aonuaire a sholáthraíonn do riarthóir.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Nuair a bheidh tú logáilte isteach, seiceáil do shocruithe dhá-fhachtóir le gur féidir leat logáil isteach arís.", 21 | "Authentication code" : "Cód fíordheimhnithe", 22 | "Submit" : "Cuir isteach" 23 | }, 24 | "nplurals=5; plural=(n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4);"); 25 | -------------------------------------------------------------------------------- /l10n/gl.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Código de administración", 3 | "Use a one-time code provided by your admin" : "Utilice un código dun só uso fornecido pola administración do sitio ", 4 | "Two-Factor Admin Support" : "Compatibilidade administrativa de dous factores", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Proveedor de compatibilidade administrativa da autenticación de dous factores de Nextcloud", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Este provedor de segundo factor de autenticación (2FA) para Nextcloud permite á administración do\n\t\tsitio xerar un código dun só uso para que os usuarios accedan a unha conta protexida por 2FA.\n\t\tIsto é útil en situacións nas que os usuarios perderon o acceso aos seus outros métodos 2FA ou\n\t\t2FA obrigatorio sen ningún provedor 2FA activado previamente.", 7 | "Two-Factor Admin" : "Administración de dous factores", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "O provedor de administración de dous factores permítelle xerar códigos únicos para os seus usuarios. Isto é útil para o primeiro acceso após activar a autenticación de dous factores ou cando os usuarios perden o acceso aos seus outros factores.", 9 | "Generate a code" : "Xerar un código", 10 | "user {uid} does not exist" : "o usuario {uid} non existe", 11 | "you are not allowed to generate codes for this user" : "Vde. non ten permiso para xerar códigos para este usuario", 12 | "unknown error" : "produciuse un erro descoñecido", 13 | "User ID" : "ID do usuario", 14 | "Generate" : "Xerar", 15 | "Could not generate a code: {error}" : "Non foi posíbel xerar un código: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "O código xerado é {code}. É válido durante {hours} horas", 17 | "Enter the one-time code provided by your admin." : "Introduza o código dun só uso fornecido pata administración do sitio.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Unha vez que acceda, comprobe a súa configuración de dous factores para poder acceder de novo.", 19 | "Authentication code" : "Código de autenticación", 20 | "Submit" : "Enviar" 21 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 22 | } -------------------------------------------------------------------------------- /l10n/sk.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Kód administrácie", 3 | "Use a one-time code provided by your admin" : "Použite jednorazový kód, ktorý vám poskytne váš administrátor", 4 | "Two-Factor Admin Support" : " Podpora Administrácia 2-faktorového overenia", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Poskytovateľ administračnej podpory dvojfaktorovej autentizácie Nextcloud", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Tento poskytovateľ dvojfaktorového overenia (2FA) pre Nextcloud umožňuje administrátorom vygenerovať jednorazový\nkód pre užívateľov pre prihlásenie do účtu chráneného 2FA. To je užitočné v situáciách, kedy\nužívatelia stratili prístup k svojim ďalším metódam 2FA alebo povinným 2FA bez toho, aby predtým\npovolený poskytovateľ 2FA.", 7 | "Two-Factor Admin" : " Administrácia 2-faktorového overenia", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Poskytovateľ administrácie dvojfaktorového prihlasovania vám umožňuje generovať jednorazové kódy pre vašich užívateľov. Je to užitočné pri prvom prihlásení a po aktivácii dvojfaktorovej autentifikácie alebo keď užívatelia stratia prístup k svojim ďalším faktorom.", 9 | "Generate a code" : "Vygenerovať kód", 10 | "user {uid} does not exist" : "užívateľ {uid} neexistuje", 11 | "you are not allowed to generate codes for this user" : "nemáte povolené generovať kódy pre tohto používateľa", 12 | "unknown error" : "neznáma chyba", 13 | "User ID" : "ID užívateľa", 14 | "Generate" : "Vygenerovať", 15 | "Could not generate a code: {error}" : "Nepodarilo sa vygenerovať kód: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "Vygenerovaný kód je {code}. Je platný po dobu {hours} hodín ", 17 | "Enter the one-time code provided by your admin." : "Vložte jednorazový kód, ktorý vám poskytol váš administrátor", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Po prihlásení skontrolujte svoje dvojfaktorové nastavenia, aby ste sa mohli znova prihlásiť.", 19 | "Authentication code" : "Overovací kód", 20 | "Submit" : "Odoslať" 21 | },"pluralForm" :"nplurals=4; plural=(n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3);" 22 | } -------------------------------------------------------------------------------- /l10n/el.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Κωδικός διαχειριστή", 3 | "Use a one-time code provided by your admin" : "Χρησιμοποιήστε έναν μοναδικό κωδικό που παρέχεται από τον διαχειριστή σας", 4 | "Two-Factor Admin Support" : "Υποστήριξη Διπλής Πιστοποίησης για Διαχειριστές", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Πάροχος Υποστήριξης Διπλής Πιστοποίησης για Διαχειριστές του Nextcloud", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Αυτός ο πάροχος διπλής πιστοποίησης (2FA) για το Nextcloud επιτρέπει στους διαχειριστές να δημιουργούν έναν μοναδικό κωδικό για να συνδεθούν οι χρήστες σε έναν λογαριασμό προστατευμένο με 2FA. Αυτό είναι χρήσιμο σε περιπτώσεις όπου οι χρήστες έχουν χάσει την πρόσβασή τους σε άλλες μεθόδους 2FA ή όταν απαιτείται 2FA χωρίς να υπάρχει ενεργοποιημένος πάροχος 2FA.", 7 | "Two-Factor Admin" : "Διαχειριστής Διπλής Πιστοποίησης", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Ο πάροχος διαχειριστή διπλής πιστοποίησης σας επιτρέπει να δημιουργείτε μοναδικούς κωδικούς για τους χρήστες σας. Αυτό είναι χρήσιμο για την πρώτη σύνδεση μετά την ενεργοποίηση της διπλής πιστοποίησης ή όταν οι χρήστες χάσουν την πρόσβασή τους σε άλλες μεθόδους.", 9 | "Generate a code" : "Δημιουργία κωδικού", 10 | "user {uid} does not exist" : "ο χρήστης {uid} δεν υπάρχει", 11 | "you are not allowed to generate codes for this user" : "δεν επιτρέπεται η δημιουργία κωδικών για αυτόν τον χρήστη", 12 | "unknown error" : "άγνωστο σφάλμα", 13 | "User ID" : "Ταυτότητα Χρήστη", 14 | "Generate" : "Δημιουργία", 15 | "Could not generate a code: {error}" : "Δεν ήταν δυνατή η δημιουργία κωδικού: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "Ο δημιουργημένος κωδικός είναι {code}. Είναι έγκυρος για {hours} ώρες", 17 | "Enter the one-time code provided by your admin." : "Εισάγετε τον μοναδικό κωδικό που παρέχεται από τον διαχειριστή σας.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Αφού συνδεθείτε, ελέγξτε τις ρυθμίσεις διπλής πιστοποίησης για να μπορείτε να συνδεθείτε ξανά.", 19 | "Authentication code" : "Κωδικός πιστοποίησης", 20 | "Submit" : "Υποβολή" 21 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 22 | } -------------------------------------------------------------------------------- /l10n/et_EE.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Peakasutaja antud kood", 3 | "Use a one-time code provided by your admin" : "Kasuta peakasutaja või haldaja poolt antud koodi", 4 | "Two-Factor Admin Support" : "Tugiteenus kaheastmelise autentimise korraldamisel", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Tugiteenus kaheastmelise autentimise korraldamisel Nextcloudis", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "See kaheastmelise autentimise (2FA) teenusepakkuja Nextcloudi jaoks võimaldab peakasutajatel luua kasutajatele üks kord kasutatavaid\n\t\tkoode sisselogimiseks 2FA poolt kaitstud kasutajakontoga. See on abiks olukorras,\n\t\tkus kasutajad ei saa pruukida muid 2FA meetodeid või 2FA kohustuslikkuse\n\t\tkorral pole 2FA teenusepakkujat eelnevalt kasutusele võtnud.", 7 | "Two-Factor Admin" : "Kaheastmelise autentimise haldus", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "See tugiteenus kaheastmelise autentimise korraldamisel aitab sul luua oma kasutajatele ühekordselt pruugitavaid koode. See on abiks olukorras, kus kasutajad ei saa pruukida muid 2FA meetodeid või 2FA kohustuslikkuse korral pole kasutaja 2FA teenusepakkujat eelnevalt kasutusele võtnud.", 9 | "Generate a code" : "Loo kood", 10 | "user {uid} does not exist" : "kasutajat „{uid}“ pole olemas", 11 | "you are not allowed to generate codes for this user" : "sul pole õigust luua sellele kasutajale koode", 12 | "unknown error" : "tundmatu viga", 13 | "User ID" : "Kasutajatunnus", 14 | "Generate" : "Loo", 15 | "Could not generate a code: {error}" : "Koodi loomine ei õnnestunud: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "Loodud koos on {code} ja ta kehtib {hours} tundi", 17 | "Enter the one-time code provided by your admin." : "Sisesta ühekordseks kasutuseks mõeldud kood, mille sulle andis süsteemi haldaja või peakasutaja.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Kui oled sisse loginud, siis järgmiste sisselogimiste toimimise tagamiseks palun kontrolli oma kaheastmelise autentimise seadistusi.", 19 | "Authentication code" : "Autentimiskood", 20 | "Submit" : "Saada" 21 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 22 | } -------------------------------------------------------------------------------- /l10n/tr.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Yönetici kodu", 5 | "Use a one-time code provided by your admin" : "Yöneticiniz tarafından verilen tek kullanımlık kodu kullanın", 6 | "Two-Factor Admin Support" : "İki adımlı doğrulama yönetici desteği", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud iki adımlı doğrulama yönetici desteği hizmeti sağlayıcısı", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Nextcloud için iki adımlı doğrulama (2FA) hizmeti sağlayıcısı. Yöneticilerin, kullanıcıların iki adımlı\n\t\tdoğrulama ile korunan bir hesapta oturum açması için tek kullanımlık bir kod üretilmesini sağlar.\n\t\tBu kod, kullanıcının iki adımlı doğrulama yöntemine erişimi olmadığında ya da önceden\n\t\tkullanıma alınmış bir hizmet sağlayıcısı yokken iki adımlı doğrulamanın dayatıldığı durumlarda yararlıdır.", 9 | "Two-Factor Admin" : "İki adımlı doğrulama yöneticisi", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "İki adımlı doğrulama yönetici hizmeti sağlayıcı, kullanıcılarınız için tek kullanımlık kodlar üretmenizi sağlar. Bu kodlar, iki adımlı doğrulama açıldıktan sonraki ilk oturum açma işleminde veya kullanıcılar diğer doğrulama adımlarına erişimi kaybettiğinde işe yarar.", 11 | "Generate a code" : "Bir kod oluşturun", 12 | "user {uid} does not exist" : "{uid} kullanıcısı bulunamadı", 13 | "you are not allowed to generate codes for this user" : "bu kullanıcı için kod üretme izniniz yok", 14 | "unknown error" : "hata bilinmiyor", 15 | "User ID" : "Kullanıcı kimliği", 16 | "Generate" : "Oluştur", 17 | "Could not generate a code: {error}" : "Kod oluşturulamadı: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "{code} kodu oluşturuldu ve {hours} saat süreyle geçerli olacak", 19 | "Enter the one-time code provided by your admin." : "Yöneticiniz tarafından verilen tek kullanımlık kodu yazın.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Oturum açtıktan sonra, daha sonra yeniden oturum açabilmek için iki adımlı doğrulama ayarlarınızı denetleyin.", 21 | "Authentication code" : "Doğrulama kodu", 22 | "Submit" : "Gönder" 23 | }, 24 | "nplurals=2; plural=(n > 1);"); 25 | -------------------------------------------------------------------------------- /l10n/sr.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Администраторски кôд", 3 | "Use a one-time code provided by your admin" : "Користите једнократни кôд који је генерисао ваш администратор.", 4 | "Two-Factor Admin Support" : "Двофакторска админ подршка", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud пружалац услуге двофакторске аутентификације са админ подршком", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Овај пружалац услуге двофакторске аутентификације (2FA) за Nextcloud омогућава\n\t\tда админи корисницима генеришу једнократне кодове за кориснике којима се\n\t\tпријављују на налог заштићен са 2FA. Ово је кориснио у ситуацијама у којима су\n\t\tкорисници изгубили приступ осталим 2FA методама или је 2FA обавезна, али претходно\n\t\tније укључен пружалац услуге за 2FA.", 7 | "Two-Factor Admin" : "Двофакторски админ", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Пружалац услуге двофакторског админа вам омогућава да својим корисницима генеришете једнократне кодове. Ово је корисно за прво пријављивање након укључивања двофакторске аутентификације или када корисник изгуби приступ својим осталим факторима.", 9 | "Generate a code" : "Генериши кôд", 10 | "user {uid} does not exist" : "корисник {uid} не постоји", 11 | "you are not allowed to generate codes for this user" : "није вам дозвољено да генеришете кодове за овог корисника", 12 | "unknown error" : "непозната грешка", 13 | "User ID" : "Кориснички ID", 14 | "Generate" : "Генериши", 15 | "Could not generate a code: {error}" : "Није могао да се генерише кôд: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "Генерисани кôд је {code}. Рок важења је {hours} сати", 17 | "Enter the one-time code provided by your admin." : "Унесите једнократни кôд који је генерисао ваш администратор.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Када се пријавите, молимо вас да проверите своја двофакторска подешавања и обезбедите могућност да се поново пријавите.", 19 | "Authentication code" : "Код за проверу идентитета", 20 | "Submit" : "Пошаљи" 21 | },"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" 22 | } -------------------------------------------------------------------------------- /l10n/gl.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Código de administración", 5 | "Use a one-time code provided by your admin" : "Utilice un código dun só uso fornecido pola administración do sitio ", 6 | "Two-Factor Admin Support" : "Compatibilidade administrativa de dous factores", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Proveedor de compatibilidade administrativa da autenticación de dous factores de Nextcloud", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Este provedor de segundo factor de autenticación (2FA) para Nextcloud permite á administración do\n\t\tsitio xerar un código dun só uso para que os usuarios accedan a unha conta protexida por 2FA.\n\t\tIsto é útil en situacións nas que os usuarios perderon o acceso aos seus outros métodos 2FA ou\n\t\t2FA obrigatorio sen ningún provedor 2FA activado previamente.", 9 | "Two-Factor Admin" : "Administración de dous factores", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "O provedor de administración de dous factores permítelle xerar códigos únicos para os seus usuarios. Isto é útil para o primeiro acceso após activar a autenticación de dous factores ou cando os usuarios perden o acceso aos seus outros factores.", 11 | "Generate a code" : "Xerar un código", 12 | "user {uid} does not exist" : "o usuario {uid} non existe", 13 | "you are not allowed to generate codes for this user" : "Vde. non ten permiso para xerar códigos para este usuario", 14 | "unknown error" : "produciuse un erro descoñecido", 15 | "User ID" : "ID do usuario", 16 | "Generate" : "Xerar", 17 | "Could not generate a code: {error}" : "Non foi posíbel xerar un código: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "O código xerado é {code}. É válido durante {hours} horas", 19 | "Enter the one-time code provided by your admin." : "Introduza o código dun só uso fornecido pata administración do sitio.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Unha vez que acceda, comprobe a súa configuración de dous factores para poder acceder de novo.", 21 | "Authentication code" : "Código de autenticación", 22 | "Submit" : "Enviar" 23 | }, 24 | "nplurals=2; plural=(n != 1);"); 25 | -------------------------------------------------------------------------------- /l10n/sk.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Kód administrácie", 5 | "Use a one-time code provided by your admin" : "Použite jednorazový kód, ktorý vám poskytne váš administrátor", 6 | "Two-Factor Admin Support" : " Podpora Administrácia 2-faktorového overenia", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Poskytovateľ administračnej podpory dvojfaktorovej autentizácie Nextcloud", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Tento poskytovateľ dvojfaktorového overenia (2FA) pre Nextcloud umožňuje administrátorom vygenerovať jednorazový\nkód pre užívateľov pre prihlásenie do účtu chráneného 2FA. To je užitočné v situáciách, kedy\nužívatelia stratili prístup k svojim ďalším metódam 2FA alebo povinným 2FA bez toho, aby predtým\npovolený poskytovateľ 2FA.", 9 | "Two-Factor Admin" : " Administrácia 2-faktorového overenia", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Poskytovateľ administrácie dvojfaktorového prihlasovania vám umožňuje generovať jednorazové kódy pre vašich užívateľov. Je to užitočné pri prvom prihlásení a po aktivácii dvojfaktorovej autentifikácie alebo keď užívatelia stratia prístup k svojim ďalším faktorom.", 11 | "Generate a code" : "Vygenerovať kód", 12 | "user {uid} does not exist" : "užívateľ {uid} neexistuje", 13 | "you are not allowed to generate codes for this user" : "nemáte povolené generovať kódy pre tohto používateľa", 14 | "unknown error" : "neznáma chyba", 15 | "User ID" : "ID užívateľa", 16 | "Generate" : "Vygenerovať", 17 | "Could not generate a code: {error}" : "Nepodarilo sa vygenerovať kód: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "Vygenerovaný kód je {code}. Je platný po dobu {hours} hodín ", 19 | "Enter the one-time code provided by your admin." : "Vložte jednorazový kód, ktorý vám poskytol váš administrátor", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Po prihlásení skontrolujte svoje dvojfaktorové nastavenia, aby ste sa mohli znova prihlásiť.", 21 | "Authentication code" : "Overovací kód", 22 | "Submit" : "Odoslať" 23 | }, 24 | "nplurals=4; plural=(n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3);"); 25 | -------------------------------------------------------------------------------- /l10n/el.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Κωδικός διαχειριστή", 5 | "Use a one-time code provided by your admin" : "Χρησιμοποιήστε έναν μοναδικό κωδικό που παρέχεται από τον διαχειριστή σας", 6 | "Two-Factor Admin Support" : "Υποστήριξη Διπλής Πιστοποίησης για Διαχειριστές", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Πάροχος Υποστήριξης Διπλής Πιστοποίησης για Διαχειριστές του Nextcloud", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Αυτός ο πάροχος διπλής πιστοποίησης (2FA) για το Nextcloud επιτρέπει στους διαχειριστές να δημιουργούν έναν μοναδικό κωδικό για να συνδεθούν οι χρήστες σε έναν λογαριασμό προστατευμένο με 2FA. Αυτό είναι χρήσιμο σε περιπτώσεις όπου οι χρήστες έχουν χάσει την πρόσβασή τους σε άλλες μεθόδους 2FA ή όταν απαιτείται 2FA χωρίς να υπάρχει ενεργοποιημένος πάροχος 2FA.", 9 | "Two-Factor Admin" : "Διαχειριστής Διπλής Πιστοποίησης", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Ο πάροχος διαχειριστή διπλής πιστοποίησης σας επιτρέπει να δημιουργείτε μοναδικούς κωδικούς για τους χρήστες σας. Αυτό είναι χρήσιμο για την πρώτη σύνδεση μετά την ενεργοποίηση της διπλής πιστοποίησης ή όταν οι χρήστες χάσουν την πρόσβασή τους σε άλλες μεθόδους.", 11 | "Generate a code" : "Δημιουργία κωδικού", 12 | "user {uid} does not exist" : "ο χρήστης {uid} δεν υπάρχει", 13 | "you are not allowed to generate codes for this user" : "δεν επιτρέπεται η δημιουργία κωδικών για αυτόν τον χρήστη", 14 | "unknown error" : "άγνωστο σφάλμα", 15 | "User ID" : "Ταυτότητα Χρήστη", 16 | "Generate" : "Δημιουργία", 17 | "Could not generate a code: {error}" : "Δεν ήταν δυνατή η δημιουργία κωδικού: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "Ο δημιουργημένος κωδικός είναι {code}. Είναι έγκυρος για {hours} ώρες", 19 | "Enter the one-time code provided by your admin." : "Εισάγετε τον μοναδικό κωδικό που παρέχεται από τον διαχειριστή σας.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Αφού συνδεθείτε, ελέγξτε τις ρυθμίσεις διπλής πιστοποίησης για να μπορείτε να συνδεθείτε ξανά.", 21 | "Authentication code" : "Κωδικός πιστοποίησης", 22 | "Submit" : "Υποβολή" 23 | }, 24 | "nplurals=2; plural=(n != 1);"); 25 | -------------------------------------------------------------------------------- /l10n/et_EE.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Peakasutaja antud kood", 5 | "Use a one-time code provided by your admin" : "Kasuta peakasutaja või haldaja poolt antud koodi", 6 | "Two-Factor Admin Support" : "Tugiteenus kaheastmelise autentimise korraldamisel", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Tugiteenus kaheastmelise autentimise korraldamisel Nextcloudis", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "See kaheastmelise autentimise (2FA) teenusepakkuja Nextcloudi jaoks võimaldab peakasutajatel luua kasutajatele üks kord kasutatavaid\n\t\tkoode sisselogimiseks 2FA poolt kaitstud kasutajakontoga. See on abiks olukorras,\n\t\tkus kasutajad ei saa pruukida muid 2FA meetodeid või 2FA kohustuslikkuse\n\t\tkorral pole 2FA teenusepakkujat eelnevalt kasutusele võtnud.", 9 | "Two-Factor Admin" : "Kaheastmelise autentimise haldus", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "See tugiteenus kaheastmelise autentimise korraldamisel aitab sul luua oma kasutajatele ühekordselt pruugitavaid koode. See on abiks olukorras, kus kasutajad ei saa pruukida muid 2FA meetodeid või 2FA kohustuslikkuse korral pole kasutaja 2FA teenusepakkujat eelnevalt kasutusele võtnud.", 11 | "Generate a code" : "Loo kood", 12 | "user {uid} does not exist" : "kasutajat „{uid}“ pole olemas", 13 | "you are not allowed to generate codes for this user" : "sul pole õigust luua sellele kasutajale koode", 14 | "unknown error" : "tundmatu viga", 15 | "User ID" : "Kasutajatunnus", 16 | "Generate" : "Loo", 17 | "Could not generate a code: {error}" : "Koodi loomine ei õnnestunud: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "Loodud koos on {code} ja ta kehtib {hours} tundi", 19 | "Enter the one-time code provided by your admin." : "Sisesta ühekordseks kasutuseks mõeldud kood, mille sulle andis süsteemi haldaja või peakasutaja.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Kui oled sisse loginud, siis järgmiste sisselogimiste toimimise tagamiseks palun kontrolli oma kaheastmelise autentimise seadistusi.", 21 | "Authentication code" : "Autentimiskood", 22 | "Submit" : "Saada" 23 | }, 24 | "nplurals=2; plural=(n != 1);"); 25 | -------------------------------------------------------------------------------- /l10n/pt_BR.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Código do administrador", 3 | "Use a one-time code provided by your admin" : "Use uma senha única gerada por seu administrador", 4 | "Two-Factor Admin Support" : "Suporte Administrativo para Autenticação de Dois Fatores", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Provedor para Suporte Administrativo para a Autenticação de Dois Fatores do Nextcloud", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Este provedor de autenticação de dois fatores (2FA) para o Nextcloud permite que os administradores gerem um código único\n\t\tpara que os usuários façam login em uma conta protegida por 2FA. Isso é útil em situações em que\n\t\tos usuários perderam o acesso a seus outros métodos de 2FA ou à 2FA obrigatória sem nenhum\n\t\tprovedor de 2FA previamente habilitado.", 7 | "Two-Factor Admin" : "Administrador de Dois Fatores", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "O provedor de administrador de dois fatores permite que você gere códigos de uso único para seus usuários. Isso ajudar para o primeiro login após a autenticação de dois fatores ser habilitada ou quando o usuário perder acesso aos seus outros fatores.", 9 | "Generate a code" : "Gerar um código", 10 | "user {uid} does not exist" : "o usuário {uid} não existe", 11 | "you are not allowed to generate codes for this user" : "você não tem permissão para gerar códigos para este usuário", 12 | "unknown error" : "erro desconhecido", 13 | "User ID" : "ID do usuário", 14 | "Generate" : "Gerar", 15 | "Could not generate a code: {error}" : "Não foi possível gerar um código: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "O código gerado é {code}. Ele tem validade de {hours} horas", 17 | "Enter the one-time code provided by your admin." : "Insira o código de uso único gerado pelo seu administrador.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Após logado, verifique sua configuração de autenticação de dois fatores para poder fazer login novamente no futuro.", 19 | "Authentication code" : "Código de autenticação", 20 | "Submit" : "Enviar" 21 | },"pluralForm" :"nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 22 | } -------------------------------------------------------------------------------- /l10n/sr.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Администраторски кôд", 5 | "Use a one-time code provided by your admin" : "Користите једнократни кôд који је генерисао ваш администратор.", 6 | "Two-Factor Admin Support" : "Двофакторска админ подршка", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Nextcloud пружалац услуге двофакторске аутентификације са админ подршком", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Овај пружалац услуге двофакторске аутентификације (2FA) за Nextcloud омогућава\n\t\tда админи корисницима генеришу једнократне кодове за кориснике којима се\n\t\tпријављују на налог заштићен са 2FA. Ово је кориснио у ситуацијама у којима су\n\t\tкорисници изгубили приступ осталим 2FA методама или је 2FA обавезна, али претходно\n\t\tније укључен пружалац услуге за 2FA.", 9 | "Two-Factor Admin" : "Двофакторски админ", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Пружалац услуге двофакторског админа вам омогућава да својим корисницима генеришете једнократне кодове. Ово је корисно за прво пријављивање након укључивања двофакторске аутентификације или када корисник изгуби приступ својим осталим факторима.", 11 | "Generate a code" : "Генериши кôд", 12 | "user {uid} does not exist" : "корисник {uid} не постоји", 13 | "you are not allowed to generate codes for this user" : "није вам дозвољено да генеришете кодове за овог корисника", 14 | "unknown error" : "непозната грешка", 15 | "User ID" : "Кориснички ID", 16 | "Generate" : "Генериши", 17 | "Could not generate a code: {error}" : "Није могао да се генерише кôд: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "Генерисани кôд је {code}. Рок важења је {hours} сати", 19 | "Enter the one-time code provided by your admin." : "Унесите једнократни кôд који је генерисао ваш администратор.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Када се пријавите, молимо вас да проверите своја двофакторска подешавања и обезбедите могућност да се поново пријавите.", 21 | "Authentication code" : "Код за проверу идентитета", 22 | "Submit" : "Пошаљи" 23 | }, 24 | "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"); 25 | -------------------------------------------------------------------------------- /l10n/pl.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Kod Administratora", 3 | "Use a one-time code provided by your admin" : "Użyj jednorazowego kodu dostarczonego przez administratora", 4 | "Two-Factor Admin Support" : "Pomoc Administratora przy weryfikacji dwuskładnikowej", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Dostawca pomocy administracyjnej dla uwierzytelniania dwuskładnikowego Nextcloud", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Ten dostawca uwierzytelniania dwuskładnikowego (2FA) dla Nextcloud pozwala administratorom generować jednorazowe kody dla użytkowników, aby mogli zalogować się do kont chronionych 2FA. Jest to przydatne w sytuacjach, gdy użytkownicy utracili dostęp do innych metod 2FA lub gdy wymagane jest obowiązkowe 2FA bez uprzednio włączonego dostawcy 2FA.", 7 | "Two-Factor Admin" : "Two-Factor Admin", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Pomoc administratora przy weryfikacji dwuskładnikowej umożliwia generowanie jednorazowych kodów dla użytkowników. Jest to przydatne przy pierwszym logowaniu po włączeniu uwierzytelniania dwuskładnikowego lub gdy użytkownicy stracą dostęp do innych swoich metod.", 9 | "Generate a code" : "Wygeneruj kod", 10 | "user {uid} does not exist" : "Użytkownik {uid} nie istnieje", 11 | "you are not allowed to generate codes for this user" : "nie masz uprawnień do generowania kodów dla tego użytkownika", 12 | "unknown error" : "nieznany błąd", 13 | "User ID" : "ID użytkownika", 14 | "Generate" : "Wygeneruj", 15 | "Could not generate a code: {error}" : "Nie można wygenerować kodu: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "Wygenerowany kod to {code}. Jest ważny przez {hours} godzin", 17 | "Enter the one-time code provided by your admin." : "Wpisz jednorazowy kod dostarczony przez administratora.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Po zalogowaniu sprawdź ustawienia dwuskładnikowe, aby móc zalogować się ponownie.", 19 | "Authentication code" : "Kod uwierzytelnienia", 20 | "Submit" : "Wyślij" 21 | },"pluralForm" :"nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);" 22 | } -------------------------------------------------------------------------------- /l10n/pt_BR.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Código do administrador", 5 | "Use a one-time code provided by your admin" : "Use uma senha única gerada por seu administrador", 6 | "Two-Factor Admin Support" : "Suporte Administrativo para Autenticação de Dois Fatores", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Provedor para Suporte Administrativo para a Autenticação de Dois Fatores do Nextcloud", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Este provedor de autenticação de dois fatores (2FA) para o Nextcloud permite que os administradores gerem um código único\n\t\tpara que os usuários façam login em uma conta protegida por 2FA. Isso é útil em situações em que\n\t\tos usuários perderam o acesso a seus outros métodos de 2FA ou à 2FA obrigatória sem nenhum\n\t\tprovedor de 2FA previamente habilitado.", 9 | "Two-Factor Admin" : "Administrador de Dois Fatores", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "O provedor de administrador de dois fatores permite que você gere códigos de uso único para seus usuários. Isso ajudar para o primeiro login após a autenticação de dois fatores ser habilitada ou quando o usuário perder acesso aos seus outros fatores.", 11 | "Generate a code" : "Gerar um código", 12 | "user {uid} does not exist" : "o usuário {uid} não existe", 13 | "you are not allowed to generate codes for this user" : "você não tem permissão para gerar códigos para este usuário", 14 | "unknown error" : "erro desconhecido", 15 | "User ID" : "ID do usuário", 16 | "Generate" : "Gerar", 17 | "Could not generate a code: {error}" : "Não foi possível gerar um código: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "O código gerado é {code}. Ele tem validade de {hours} horas", 19 | "Enter the one-time code provided by your admin." : "Insira o código de uso único gerado pelo seu administrador.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Após logado, verifique sua configuração de autenticação de dois fatores para poder fazer login novamente no futuro.", 21 | "Authentication code" : "Código de autenticação", 22 | "Submit" : "Enviar" 23 | }, 24 | "nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); 25 | -------------------------------------------------------------------------------- /l10n/pl.js: -------------------------------------------------------------------------------- 1 | OC.L10N.register( 2 | "twofactor_admin", 3 | { 4 | "Admin code" : "Kod Administratora", 5 | "Use a one-time code provided by your admin" : "Użyj jednorazowego kodu dostarczonego przez administratora", 6 | "Two-Factor Admin Support" : "Pomoc Administratora przy weryfikacji dwuskładnikowej", 7 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Dostawca pomocy administracyjnej dla uwierzytelniania dwuskładnikowego Nextcloud", 8 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Ten dostawca uwierzytelniania dwuskładnikowego (2FA) dla Nextcloud pozwala administratorom generować jednorazowe kody dla użytkowników, aby mogli zalogować się do kont chronionych 2FA. Jest to przydatne w sytuacjach, gdy użytkownicy utracili dostęp do innych metod 2FA lub gdy wymagane jest obowiązkowe 2FA bez uprzednio włączonego dostawcy 2FA.", 9 | "Two-Factor Admin" : "Two-Factor Admin", 10 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Pomoc administratora przy weryfikacji dwuskładnikowej umożliwia generowanie jednorazowych kodów dla użytkowników. Jest to przydatne przy pierwszym logowaniu po włączeniu uwierzytelniania dwuskładnikowego lub gdy użytkownicy stracą dostęp do innych swoich metod.", 11 | "Generate a code" : "Wygeneruj kod", 12 | "user {uid} does not exist" : "Użytkownik {uid} nie istnieje", 13 | "you are not allowed to generate codes for this user" : "nie masz uprawnień do generowania kodów dla tego użytkownika", 14 | "unknown error" : "nieznany błąd", 15 | "User ID" : "ID użytkownika", 16 | "Generate" : "Wygeneruj", 17 | "Could not generate a code: {error}" : "Nie można wygenerować kodu: {error}", 18 | "The generated code is {code}. It is valid for {hours} hours" : "Wygenerowany kod to {code}. Jest ważny przez {hours} godzin", 19 | "Enter the one-time code provided by your admin." : "Wpisz jednorazowy kod dostarczony przez administratora.", 20 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Po zalogowaniu sprawdź ustawienia dwuskładnikowe, aby móc zalogować się ponownie.", 21 | "Authentication code" : "Kod uwierzytelnienia", 22 | "Submit" : "Wyślij" 23 | }, 24 | "nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);"); 25 | -------------------------------------------------------------------------------- /l10n/es.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Código de Administrador", 3 | "Use a one-time code provided by your admin" : "Utilice un código de uso único provisto por su administrador", 4 | "Two-Factor Admin Support" : "Soporte de Administrador para autenticación de dos factores", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Proveedor de soporte para autenticación de dos factores de administrador de Nextcloud", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Este proveedor para autenticación de dos factores (2FA) permite a los administradores generar un código de uso único\npara que los usuarios puedan ingresar en una cuenta protegida por 2FA. Esto es útil en aquellas situaciones en las que\nlos usuarios han perdido acceso a sus otros métodos de autenticación 2FA o a su 2FA obligatorio sin haber activado previamente\nsu proveedor 2FA.", 7 | "Two-Factor Admin" : "Administrador de autenticación de dos factores", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "El administrador de autenticación de dos factores le permite generar un código de uso único para sus usuarios. Esto es útil para el primer ingreso luego de que la autenticación de dos factores ha sido habilitada o cuando los usuarios pierden acceso a sus otros factores.", 9 | "Generate a code" : "Generar un código", 10 | "user {uid} does not exist" : "usuario {uid} no existe", 11 | "you are not allowed to generate codes for this user" : "no le está permitido generar códigos para este usuario", 12 | "unknown error" : "error desconocido", 13 | "User ID" : "ID de usuario", 14 | "Generate" : "Generar", 15 | "Could not generate a code: {error}" : "No se pudo generar un código: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "El código generado es {code}. Es válido por {hours} horas", 17 | "Enter the one-time code provided by your admin." : "Ingrese el código de uso único provisto por su administrador.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Una vez que ingrese, por favor chequee sus ajustes de autenticación de dos factores de manera que pueda ingresar nuevamente.", 19 | "Authentication code" : "Código de autentificación", 20 | "Submit" : "Enviar" 21 | },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" 22 | } -------------------------------------------------------------------------------- /lib/Service/CodeStorage.php: -------------------------------------------------------------------------------- 1 | random = $random; 42 | $this->eventDispatcher = $eventDispatcher; 43 | $this->timeFactory = $timeFactory; 44 | } 45 | 46 | public function generateCode(IUser $user): string { 47 | $code = $this->random->generate(6, ISecureRandom::CHAR_DIGITS); 48 | 49 | $dbCode = new Code(); 50 | $dbCode->setUserId($user->getUID()); 51 | $dbCode->setCode($code); 52 | $dbCode->setExpires($this->timeFactory->getTime() + self::CODE_TTL); 53 | 54 | $this->codeMapper->deleteAll($user); 55 | $this->codeMapper->insert($dbCode); 56 | 57 | $this->eventDispatcher->dispatch(StateChanged::class, new StateChanged($user, true)); 58 | 59 | return $code; 60 | } 61 | 62 | public function hasCode(IUser $user): bool { 63 | return $this->codeMapper->entryExists($user); 64 | } 65 | 66 | public function validateCode(IUser $user, string $code): bool { 67 | try { 68 | $dbCode = $this->codeMapper->find($user); 69 | } catch (DoesNotExistException) { 70 | // TODO: log? 71 | return false; 72 | } catch (MultipleObjectsReturnedException) { 73 | // Actually impossible with the primary key constraints, but still 74 | return false; 75 | } 76 | 77 | if ($dbCode->getCode() === $code) { 78 | // TODO: log? 79 | $this->codeMapper->delete($dbCode); 80 | 81 | $this->eventDispatcher->dispatch(StateChanged::class, new StateChanged($user, false)); 82 | 83 | return $dbCode->getExpires() >= $this->timeFactory->getTime(); 84 | } 85 | 86 | return false; 87 | } 88 | 89 | public function removeCodesForUser(IUser $user): void { 90 | $this->codeMapper->deleteAll($user); 91 | $this->eventDispatcher->dispatch(StateChanged::class, new StateChanged($user, false)); 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /l10n/de.json: -------------------------------------------------------------------------------- 1 | { "translations": { 2 | "Admin code" : "Administrationscode", 3 | "Use a one-time code provided by your admin" : "Einen einmaligen Code verwenden, der von deiner Administration bereitgestellt wird", 4 | "Two-Factor Admin Support" : "Zwei-Faktor-Administrationsunterstützung", 5 | "Nextcloud Two-Factor Authentication Admin Support Provider" : "Anbieter der Administrationsunterstützung für Nextcloud Zwei-Faktor-Authentifizierung", 6 | "This two-factor auth (2FA) provider for Nextcloud allows admins to generate a one-time\n\t\tcode for users to log into a 2FA protected account. This is helpful in situations where\n\t\tusers have lost access to their other 2FA methods or mandatory 2FA without any previously\n\t\tenabled 2FA provider." : "Dieser Zwei-Faktor-Authentifizierungsanbieter (2FA) für Nextcloud ermöglicht es der Administration, einen einmaligen\n\t\tCode zu generieren, mit dem sich Benutzer bei einem 2FA-geschützten Konto anmelden können. Dies ist hilfreich in Situationen, in denen\n\t\tBenutzer den Zugang zu ihren bisherigen 2FA-Methoden verloren haben oder eine 2FA ohne einen zuvor\n\t\taktivierten 2FA-Anbieter erforderlich ist.", 7 | "Two-Factor Admin" : "Zwei-Faktor-Administration", 8 | "The two-factor admin provider allows you to generate one-time codes for your users. This is helpful for the first login after two-factor authentication has been enabled or when the users lose access to their other factors." : "Mit dem Zwei-Faktor-Administrationsanbieter kannst du Einmalcodes für deine Benutzer generieren. Dies ist hilfreich für die erste Anmeldung, nachdem die Zwei-Faktor-Authentifizierung aktiviert wurde, oder wenn die Benutzer den Zugriff auf ihre bisherigen Faktoren verloren haben.", 9 | "Generate a code" : "Einen Code erzeugen", 10 | "user {uid} does not exist" : "Benutzer {uid} existiert nicht", 11 | "you are not allowed to generate codes for this user" : "Du bist nicht berechtigt, Codes für diesen Benutzer zu erstellen.", 12 | "unknown error" : "unbekannter Fehler", 13 | "User ID" : "Benutzer-ID", 14 | "Generate" : "Erzeugen", 15 | "Could not generate a code: {error}" : "Es konnte kein Code erzeugt werden: {error}", 16 | "The generated code is {code}. It is valid for {hours} hours" : "Der erzeugte Code lautet {code}. Er ist gültig für {hours} Stunden.", 17 | "Enter the one-time code provided by your admin." : "Geben Sie den Einmal-Code ein, den du von deiner Administration erhalten hast.", 18 | "Once logged in, please check your two-factor settings in order to be able to log in again." : "Wenn du angemeldet bist, überprüfe bitte deine Zwei-Faktor-Einstellungen, damit du dich erneut anmelden kannst.", 19 | "Authentication code" : "Authentifizierungscode", 20 | "Submit" : "Übermitteln" 21 | },"pluralForm" :"nplurals=2; plural=(n != 1);" 22 | } --------------------------------------------------------------------------------