diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bf60e189b5d8e6e014e262805ba431ac734d8b2e..a29b6313332ad39922515b40f46ae4e85f2c64af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - TO_PACKAGE: 'appinfo l10n img lib templates js' + TO_PACKAGE: 'appinfo css l10n lib templates js img' include: - project: "e/infra/ecloud/nextcloud-apps/ci-templates" ref: main diff --git a/README.md b/README.md index ed839c855e2b3d83c407dee0b649aff20abcebb1..1c3a89f90dd533ff61c9ac7cd428c1faa2d1b8ad 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,16 @@ Please open issues here : https://gitlab.e.foundation/e/backlog/issues This plugin works in cunjunction with the drop_account plugin : https://apps.nextcloud.com/apps/drop_account This plugin uses SRDI's [Simple and lightweight curl class](https://github.com/srdi/php-curl-class), under the The Unlicense license : https://github.com/srdi/php-curl-class/blob/master/LICENSE + +## Beta User + +- The app is using system values which are configured in `/config/config.php`. +- Below keys to add: +1. beta_group_name +2. beta_gitlab_email_id + +The values are: +``` +'beta_group_name' => 'beta', +'beta_gitlab_email_id' => 'xyz@e.email', +``` diff --git a/appinfo/info.xml b/appinfo/info.xml index 20104380954ea153ba5f75aa52b98b5d9b237d08..9727eca6d10dd67e0b599cedbe3f09f73da94293 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -21,6 +21,7 @@ OCA\EcloudAccounts\Settings\Personal - - + OCA\EcloudAccounts\Settings\BetaUserSetting + OCA\EcloudAccounts\Settings\BetaSection + diff --git a/appinfo/routes.php b/appinfo/routes.php index 2daf9af7d6af8eab7fe3e7f0c8d4ae4d07f152f3..db6f2a5a33a19e2a4f771d7b14cb93621fc4aee9 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -13,4 +13,16 @@ return ['routes' => [ 'name' => 'user#preflighted_cors', 'url' => '/api/{path}', 'verb' => 'OPTIONS', 'requirements' => array('path' => '.+') ], + [ + 'name' => 'beta_user#remove_user_in_group', + 'url' => '/beta/update', 'verb' => 'DELETE' + ], + [ + 'name' => 'beta_user#add_user_in_group', + 'url' => '/beta/update', 'verb' => 'POST' + ], + [ + 'name' => 'beta_user#submit_issue', + 'url' => '/issue/submit', 'verb' => 'POST' + ] ]]; diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000000000000000000000000000000000000..81c482639af760516455914969cde8b5de3d5fb0 --- /dev/null +++ b/css/style.css @@ -0,0 +1,52 @@ +.alert { + position: relative; + padding: 0.75rem 1.25rem; + margin-top: 1rem; + border: 1px solid transparent; + border-radius: 0.25rem; + width: fit-content; +} + +.alert-success { + color: #155724; + background-color: #d4edda; + border-color: #c3e6cb; +} + +.alert-fail { + color: #721c24; + background-color: #f8d7da; + border-color: #f5c6cb; +} + +#issue-submit-form #title, +#issue-submit-form textarea { + width: 450px; +} + +#issue-submit-form textarea { + height: 100px; +} + +#issue-submit-form textarea:hover { + border-color: var(--color-primary-element) !important; +} + +.mt-20 { + margin-top: 20px !important; +} + +#beta-form .btn-optout { + background-color: white; + color: var(--color-delete); + border-color: var(--color-delete); +} + +#beta-form .width300, +#issue-submit-form .width300 { + width: 300px; +} + +.color-red { + color: red; +} \ No newline at end of file diff --git a/img/beta.svg b/img/beta.svg new file mode 100644 index 0000000000000000000000000000000000000000..f1d4611df0b3bc9de469a8fdea9e1ef3b8d17e80 --- /dev/null +++ b/img/beta.svg @@ -0,0 +1,3 @@ + + + diff --git a/l10n/de.js b/l10n/de.js index ee9f82930baf89636e00302d926be7c7314456e1..42edda79a3920e1e11b3bcc6010ae8331f151832 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -1,15 +1,37 @@ OC.L10N.register( "ecloud-accounts", { - "Email Address": "Email Address", - "Options": "Options", - "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.", - "For your information you have %d order(s) in your account.": "For your information you have %d order(s) in your account.", - "I also want to delete my shop account": "I also want to delete my shop account", - "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ", - "Error while setting shop delete preference": "Error while setting shop delete preference", - "Shop email cannot be same as this account's email.": "Murena.com email cannot be same as this account's email.", - "Invalid Email Format.": "Invalid Email Format.", - "A Murena.com account already uses this e-mail address.": "A Murena.com account already uses this e-mail address." + "Email Address": "E-Mail Adresse", + "Options": "Optionen", + "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "Wir werden mit der Löschung Ihres Cloud-Kontos fortfahren. Markieren Sie das Kästchen unten, wenn Sie auch das zugehörige Shop-Konto löschen möchten.", + "For your information you have %d order(s) in your account.": "Zu Ihrer Information: Sie haben %d Auftrag(e) in Ihrem Konto.", + "I also want to delete my shop account": "Ich möchte auch mein Shop-Konto löschen", + "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "Wenn Sie Ihr Shop-Konto behalten möchten, bestätigen oder ändern Sie bitte die E-Mail-Adresse unten. Diese E-Mail-Adresse wird Ihr neues Login für den Shop sein. ", + "Error while setting shop delete preference": "Fehler beim Einstellen der Shop-Löschpräferenz", + "Shop email cannot be same as this account's email.": "Die E-Mail von Murena.com kann nicht mit der E-Mail dieses Kontos übereinstimmen.", + "Invalid Email Format.": "Ungültiges E-Mail-Format.", + "A Murena.com account already uses this e-mail address.": "Ein Murena.com-Konto verwendet bereits diese E-Mail-Adresse.", + "You are part of the beta users.": "Sie sind Teil der Beta-Nutzer.", + "Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.": "Hinweis: Da die Funktionen noch nicht freigegeben sind, können Sie auf einige Fehler stoßen. Bitte melden Sie diese und Ihr Feedback über das unten stehende Formular.", + "Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!": "Möchten Sie eine Pause von den Beta-Funktionen einlegen? Klicken Sie einfach auf die Schaltfläche unten. Sie können jederzeit wieder ein Beta-Benutzer werden!", + "Do you want to become a beta user?": "Möchten Sie Beta-Nutzer werden?", + "You want to experiment new features ahead of the others and provide feedback on them before and if they're released? This section is made for you!": "Sie möchten neue Funktionen vor allen anderen ausprobieren und Feedback dazu geben, bevor oder falls sie veröffentlicht werden? Dann ist dieser Bereich wie geschaffen für Sie!", + "To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.": "Um eine Vorschau auf unsere neuen Funktionen zu erhalten, müssen Sie Teil unserer Beta-Benutzer werden. Klicken Sie dazu einfach auf die Schaltfläche unten. Sie können sich jederzeit von den Beta-Funktionen abmelden.", + "Opt out of beta features": "Abmeldung von Beta-Funktionen", + "Become a beta user": "Beta-Benutzer werden", + "Are you sure you want to opt out of beta features?": "Sind Sie sicher, dass Sie die Beta-Funktionen nicht nutzen möchten?", + "You've successfully been removed from the beta users.": "Sie haben sich erfolgreich von den Beta-Benutzern abgemeldet.", + "Congratulations! You've successfully been added to the beta users.": "Herzlichen Glückwunsch! Du wurdest erfolgreich zu den Beta-Benutzern hinzugefügt.", + "Beta program is not available at the moment.": "Beta programma is momenteel niet beschikbaar.", + "Something went wrong.": "Etwas ist schief gelaufen.", + "Title": "Titel", + "required": "benötigt", + "Description": "Beschreibung", + "Summary of your feedback": "Zusammenfassung Ihres Feedbacks", + "Please give us as many details as possible": "Bitte geben Sie uns so viele Details wie möglich", + "Submit": "Einreichen", + "Experimental": "Experimentelle", + "Title is mandatory.": "Der Titel ist obligatorisch.", + "Description is mandatory.": "Die Beschreibung ist obligatorisch." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de.json b/l10n/de.json index 58c6862a09d142507233960159834fdc945830c5..dc4ae4126ec6a0ab13c0788ce64faa34d14e1153 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -1,15 +1,37 @@ { "translations": { - "Email Address": "Email Address", - "Options": "Options", - "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.", - "For your information you have %d order(s) in your account.": "For your information you have %d order(s) in your account.", - "I also want to delete my shop account": "I also want to delete my shop account", - "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ", - "Error while setting shop delete preference": "Error while setting shop delete preference", - "Shop email cannot be same as this account's email.": "Murena.com email cannot be same as this account's email.", - "Invalid Email Format.": "Invalid Email Format.", - "A Murena.com account already uses this e-mail address.": "A Murena.com account already uses this e-mail address." + "Email Address": "E-Mail Adresse", + "Options": "Optionen", + "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "Wir werden mit der Löschung Ihres Cloud-Kontos fortfahren. Markieren Sie das Kästchen unten, wenn Sie auch das zugehörige Shop-Konto löschen möchten.", + "For your information you have %d order(s) in your account.": "Zu Ihrer Information: Sie haben %d Auftrag(e) in Ihrem Konto.", + "I also want to delete my shop account": "Ich möchte auch mein Shop-Konto löschen", + "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "Wenn Sie Ihr Shop-Konto behalten möchten, bestätigen oder ändern Sie bitte die E-Mail-Adresse unten. Diese E-Mail-Adresse wird Ihr neues Login für den Shop sein. ", + "Error while setting shop delete preference": "Fehler beim Einstellen der Shop-Löschpräferenz", + "Shop email cannot be same as this account's email.": "Die E-Mail von Murena.com kann nicht mit der E-Mail dieses Kontos übereinstimmen.", + "Invalid Email Format.": "Ungültiges E-Mail-Format.", + "A Murena.com account already uses this e-mail address.": "Ein Murena.com-Konto verwendet bereits diese E-Mail-Adresse.", + "You are part of the beta users.": "Sie sind Teil der Beta-Nutzer.", + "Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.": "Hinweis: Da die Funktionen noch nicht freigegeben sind, können Sie auf einige Fehler stoßen. Bitte melden Sie diese und Ihr Feedback über das unten stehende Formular.", + "Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!": "Möchten Sie eine Pause von den Beta-Funktionen einlegen? Klicken Sie einfach auf die Schaltfläche unten. Sie können jederzeit wieder ein Beta-Benutzer werden!", + "Do you want to become a beta user?": "Möchten Sie Beta-Nutzer werden?", + "You want to experiment new features ahead of the others and provide feedback on them before and if they're released? This section is made for you!": "Sie möchten neue Funktionen vor allen anderen ausprobieren und Feedback dazu geben, bevor oder falls sie veröffentlicht werden? Dann ist dieser Bereich wie geschaffen für Sie!", + "To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.": "Um eine Vorschau auf unsere neuen Funktionen zu erhalten, müssen Sie Teil unserer Beta-Benutzer werden. Klicken Sie dazu einfach auf die Schaltfläche unten. Sie können sich jederzeit von den Beta-Funktionen abmelden.", + "Opt out of beta features": "Abmeldung von Beta-Funktionen", + "Become a beta user": "Beta-Benutzer werden", + "Are you sure you want to opt out of beta features?": "Sind Sie sicher, dass Sie die Beta-Funktionen nicht nutzen möchten?", + "You've successfully been removed from the beta users.": "Sie haben sich erfolgreich von den Beta-Benutzern abgemeldet.", + "Congratulations! You've successfully been added to the beta users.": "Herzlichen Glückwunsch! Du wurdest erfolgreich zu den Beta-Benutzern hinzugefügt.", + "Beta program is not available at the moment.": "Beta programma is momenteel niet beschikbaar.", + "Something went wrong.": "Etwas ist schief gelaufen.", + "Title": "Titel", + "required": "benötigt", + "Description": "Beschreibung", + "Summary of your feedback": "Zusammenfassung Ihres Feedbacks", + "Please give us as many details as possible": "Bitte geben Sie uns so viele Details wie möglich", + "Submit": "Einreichen", + "Experimental": "Experimentelle", + "Title is mandatory.": "Der Titel ist obligatorisch.", + "Description is mandatory.": "Die Beschreibung ist obligatorisch." }, "pluralForm": "nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/en.js b/l10n/en.js index ee9f82930baf89636e00302d926be7c7314456e1..ec95023b4d248829ef4d009ff61cca788c4dfb06 100644 --- a/l10n/en.js +++ b/l10n/en.js @@ -10,6 +10,28 @@ OC.L10N.register( "Error while setting shop delete preference": "Error while setting shop delete preference", "Shop email cannot be same as this account's email.": "Murena.com email cannot be same as this account's email.", "Invalid Email Format.": "Invalid Email Format.", - "A Murena.com account already uses this e-mail address.": "A Murena.com account already uses this e-mail address." + "A Murena.com account already uses this e-mail address.": "A Murena.com account already uses this e-mail address.", + "You are part of the beta users.": "You are part of the beta users.", + "Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.": "Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.", + "Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!": "Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!", + "Do you want to become a beta user?": "Do you want to become a beta user?", + "You want to experiment new features ahead of the others and provide feedback on them before and if they're released? This section is made for you!": "You want to experiment new features ahead of the others and provide feedback on them before and if they're released? This section is made for you!", + "To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.": "To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.", + "Opt out of beta features": "Opt out of beta features", + "Become a beta user": "Become a beta user", + "Are you sure you want to opt out of beta features?": "Are you sure you want to opt out of beta features?", + "You've successfully been removed from the beta users.": "You've successfully been removed from the beta users.", + "Congratulations! You've successfully been added to the beta users.": "Congratulations! You've successfully been added to the beta users.", + "Beta program is not available at the moment.": "Beta program is not available at the moment. ", + "Something went wrong.": "Something went wrong.", + "Title": "Title", + "required": "required", + "Description": "Description", + "Summary of your feedback": "Summary of your feedback", + "Please give us as many details as possible": "Please give us as many details as possible", + "Submit": "Submit", + "Experimental": "Experimental", + "Title is mandatory.": "Title is mandatory.", + "Description is mandatory.": "Description is mandatory." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/en.json b/l10n/en.json index 58c6862a09d142507233960159834fdc945830c5..9622806142a8567200ef60aed693b73dfd5475a6 100644 --- a/l10n/en.json +++ b/l10n/en.json @@ -9,7 +9,29 @@ "Error while setting shop delete preference": "Error while setting shop delete preference", "Shop email cannot be same as this account's email.": "Murena.com email cannot be same as this account's email.", "Invalid Email Format.": "Invalid Email Format.", - "A Murena.com account already uses this e-mail address.": "A Murena.com account already uses this e-mail address." + "A Murena.com account already uses this e-mail address.": "A Murena.com account already uses this e-mail address.", + "You are part of the beta users.": "You are part of the beta users.", + "Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.": "Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.", + "Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!": "Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!", + "Do you want to become a beta user?": "Do you want to become a beta user?", + "You want to experiment new features ahead of the others and provide feedback on them before and if they're released? This section is made for you!": "You want to experiment new features ahead of the others and provide feedback on them before and if they're released? This section is made for you!", + "To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.": "To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.", + "Opt out of beta features": "Opt out of beta features", + "Become a beta user": "Become a beta user", + "Are you sure you want to opt out of beta features?": "Are you sure you want to opt out of beta features?", + "You've successfully been removed from the beta users.": "You've successfully been removed from the beta users.", + "Congratulations! You've successfully been added to the beta users.": "Congratulations! You've successfully been added to the beta users.", + "Beta program is not available at the moment.": "Beta program is not available at the moment. ", + "Something went wrong.": "Something went wrong.", + "Title": "Title", + "required": "required", + "Description": "Description", + "Summary of your feedback": "Summary of your feedback", + "Please give us as many details as possible": "Please give us as many details as possible", + "Submit": "Submit", + "Experimental": "Experimental", + "Title is mandatory.": "Title is mandatory.", + "Description is mandatory.": "Description is mandatory." }, "pluralForm": "nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/es.js b/l10n/es.js index ee9f82930baf89636e00302d926be7c7314456e1..cb1da34451e47601da9ce4be60bcb98c56207d52 100644 --- a/l10n/es.js +++ b/l10n/es.js @@ -1,15 +1,38 @@ OC.L10N.register( "ecloud-accounts", { - "Email Address": "Email Address", - "Options": "Options", - "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.", - "For your information you have %d order(s) in your account.": "For your information you have %d order(s) in your account.", - "I also want to delete my shop account": "I also want to delete my shop account", - "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ", - "Error while setting shop delete preference": "Error while setting shop delete preference", - "Shop email cannot be same as this account's email.": "Murena.com email cannot be same as this account's email.", - "Invalid Email Format.": "Invalid Email Format.", - "A Murena.com account already uses this e-mail address.": "A Murena.com account already uses this e-mail address." + "Email Address": "Correo electrónico", + "Options": "Opciones", + "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "Vamos a proceder a la supresión de su cuenta en la nube. Marca la casilla de abajo si también quieres eliminar la cuenta de la tienda asociada.", + "For your information you have %d order(s) in your account.": "Para su información tiene %d orden(es) en su cuenta.", + "I also want to delete my shop account": "También quiero borrar mi cuenta de la tienda", + "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "Si quieres mantener tu cuenta de la tienda, valida o modifica la dirección de correo electrónico que aparece a continuación. Esta dirección de correo electrónico se convertirá en su nuevo acceso a la tienda. ", + "Error while setting shop delete preference": "Error al configurar la preferencia de eliminación de la tienda", + "Shop email cannot be same as this account's email.": "El correo electrónico de Murena.com no puede ser el mismo que el de esta cuenta.", + "Invalid Email Format.": "Formato de correo electrónico no válido.", + "A Murena.com account already uses this e-mail address.": "Una cuenta de Murena.com ya utiliza esta dirección de correo electrónico.", + "You are part of the beta users.": "Usted forma parte de los usuarios beta.", + "Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.": "Nota: como las funciones aún no se han liberado, es posible que encuentres algunos errores. Por favor, informe de ellos y de sus comentarios utilizando el siguiente formulario.", + "Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!": "Quieres descansar de las funciones beta? Sólo tienes que hacer clic en el botón de abajo. Puedes volver a ser un usuario beta en cualquier momento.", + "Do you want to become a beta user?": "Desea convertirse en usuario beta?", + "You want to experiment new features ahead of the others and provide feedback on them before and if they're released? This section is made for you!": "Quieres experimentar las nuevas funciones antes que los demás y dar tu opinión sobre ellas antes y si se publican? Esta sección está hecha para ti.", + "To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.": "Para obtener una vista previa que muestre nuestras nuevas funciones, debe formar parte de nuestros usuarios beta. Para ello, simplemente haga clic en el botón de abajo. Puedes excluirte de las funciones beta en cualquier momento.", + "I agree with terms & conditions.": "Estoy de acuerdo con los términos y condiciones.", + "Opt out of beta features": "No participar en las funciones beta", + "Become a beta user": "Convertirse en usuario beta", + "Are you sure you want to opt out of beta features?": "Estás seguro de que quieres excluir las funciones beta?", + "You've successfully been removed from the beta users.": "Has conseguido excluir a los usuarios de la beta.", + "Congratulations! You've successfully been added to the beta users.": "Enhorabuena! Has sido añadido con éxito a los usuarios beta.", + "Beta program is not available at the moment.": "El programa beta no está disponible por el momento.", + "Something went wrong.": "Algo salió mal.", + "Title": "Título", + "required": "requerido", + "Description": "Descripción", + "Summary of your feedback": "Resumen de sus comentarios", + "Please give us as many details as possible": "Por favor, danos tantos detalles como sea posible", + "Submit": "Envíe", + "Experimental": "Experimento", + "Title is mandatory.": "El título es obligatorio.", + "Description is mandatory.": "La descripción es obligatoria." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/es.json b/l10n/es.json index 58c6862a09d142507233960159834fdc945830c5..1cc4ba0f9196b7bcf3c2337b2a43a0c752eac6b7 100644 --- a/l10n/es.json +++ b/l10n/es.json @@ -1,15 +1,37 @@ { "translations": { - "Email Address": "Email Address", - "Options": "Options", - "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.", - "For your information you have %d order(s) in your account.": "For your information you have %d order(s) in your account.", - "I also want to delete my shop account": "I also want to delete my shop account", - "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ", - "Error while setting shop delete preference": "Error while setting shop delete preference", - "Shop email cannot be same as this account's email.": "Murena.com email cannot be same as this account's email.", - "Invalid Email Format.": "Invalid Email Format.", - "A Murena.com account already uses this e-mail address.": "A Murena.com account already uses this e-mail address." + "Email Address": "Correo electrónico", + "Options": "Opciones", + "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "Vamos a proceder a la supresión de su cuenta en la nube. Marca la casilla de abajo si también quieres eliminar la cuenta de la tienda asociada.", + "For your information you have %d order(s) in your account.": "Para su información tiene %d orden(es) en su cuenta.", + "I also want to delete my shop account": "También quiero borrar mi cuenta de la tienda", + "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "Si quieres mantener tu cuenta de la tienda, valida o modifica la dirección de correo electrónico que aparece a continuación. Esta dirección de correo electrónico se convertirá en su nuevo acceso a la tienda. ", + "Error while setting shop delete preference": "Error al configurar la preferencia de eliminación de la tienda", + "Shop email cannot be same as this account's email.": "El correo electrónico de Murena.com no puede ser el mismo que el de esta cuenta.", + "Invalid Email Format.": "Formato de correo electrónico no válido.", + "A Murena.com account already uses this e-mail address.": "Una cuenta de Murena.com ya utiliza esta dirección de correo electrónico.", + "You are part of the beta users.": "Usted forma parte de los usuarios beta.", + "Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.": "Nota: como las funciones aún no se han liberado, es posible que encuentres algunos errores. Por favor, informe de ellos y de sus comentarios utilizando el siguiente formulario.", + "Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!": "Quieres descansar de las funciones beta? Sólo tienes que hacer clic en el botón de abajo. Puedes volver a ser un usuario beta en cualquier momento.", + "Do you want to become a beta user?": "Desea convertirse en usuario beta?", + "You want to experiment new features ahead of the others and provide feedback on them before and if they're released? This section is made for you!": "Quieres experimentar las nuevas funciones antes que los demás y dar tu opinión sobre ellas antes y si se publican? Esta sección está hecha para ti.", + "To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.": "Para obtener una vista previa que muestre nuestras nuevas funciones, debe formar parte de nuestros usuarios beta. Para ello, simplemente haga clic en el botón de abajo. Puedes excluirte de las funciones beta en cualquier momento.", + "Opt out of beta features": "No participar en las funciones beta", + "Become a beta user": "Convertirse en usuario beta", + "Are you sure you want to opt out of beta features?": "Estás seguro de que quieres excluir las funciones beta?", + "You've successfully been removed from the beta users.": "Has conseguido excluir a los usuarios de la beta.", + "Congratulations! You've successfully been added to the beta users.": "Enhorabuena! Has sido añadido con éxito a los usuarios beta.", + "Beta program is not available at the moment.": "El programa beta no está disponible por el momento.", + "Something went wrong.": "Algo salió mal.", + "Title": "Título", + "required": "requerido", + "Description": "Descripción", + "Summary of your feedback": "Resumen de sus comentarios", + "Please give us as many details as possible": "Por favor, danos tantos detalles como sea posible", + "Submit": "Envíe", + "Experimental": "Experimento", + "Title is mandatory.": "El título es obligatorio.", + "Description is mandatory.": "La descripción es obligatoria." }, "pluralForm": "nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/fr.js b/l10n/fr.js index ee9f82930baf89636e00302d926be7c7314456e1..33f867495185a810950944eb0ca209f45fed926d 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -1,15 +1,37 @@ OC.L10N.register( "ecloud-accounts", { - "Email Address": "Email Address", + "Email Address": "Adresse e-mail", "Options": "Options", - "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.", - "For your information you have %d order(s) in your account.": "For your information you have %d order(s) in your account.", + "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "Nous allons procéder à la suppression de votre compte cloud. Cochez la case ci-dessous si vous souhaitez également supprimer le compte boutique associé.", + "For your information you have %d order(s) in your account.": "Pour votre information, vous avez %d ordre(s) en votre compte.", "I also want to delete my shop account": "I also want to delete my shop account", - "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ", - "Error while setting shop delete preference": "Error while setting shop delete preference", - "Shop email cannot be same as this account's email.": "Murena.com email cannot be same as this account's email.", - "Invalid Email Format.": "Invalid Email Format.", - "A Murena.com account already uses this e-mail address.": "A Murena.com account already uses this e-mail address." + "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "Si vous souhaitez conserver votre compte boutique, veuillez valider ou modifier l'adresse e-mail ci-dessous. Cette adresse email deviendra votre nouveau login pour la boutique. ", + "Error while setting shop delete preference": "Erreur lors de la configuration de la préférence de suppression de boutique", + "Shop email cannot be same as this account's email.": "L'adresse électronique de Murena.com ne peut pas être la même que celle de ce compte.", + "Invalid Email Format.": "Format d'email invalide.", + "A Murena.com account already uses this e-mail address.": "Un compte Murena.com utilise déjà cette adresse électronique.", + "You are part of the beta users.": "Vous faites partie des utilisateurs bêta.", + "Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.": "Note : les fonctionnalités n'étant pas encore disponibles, il est possible que vous rencontriez quelques bugs. Veuillez les signaler et faire part de vos commentaires en utilisant le formulaire ci-dessous.", + "Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!": "Vous voulez faire une pause dans les fonctionnalités de la version bêta ? Cliquez simplement sur le bouton ci-dessous. Vous pouvez redevenir un utilisateur bêta à tout moment !", + "Do you want to become a beta user?": "Voulez-vous devenir un utilisateur bêta ?", + "You want to experiment new features ahead of the others and provide feedback on them before and if they're released? This section is made for you!": "Vous voulez expérimenter les nouvelles fonctionnalités avant les autres et donner votre avis sur celles-ci avant et si elles sont publiées ? Cette section est faite pour vous !", + "To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.": "Pour avoir un aperçu de nos nouvelles fonctionnalités, vous devez faire partie de nos utilisateurs bêta. Pour ce faire, il vous suffit de cliquer sur le bouton ci-dessous. Vous pouvez vous retirer des fonctionnalités bêta à tout moment.", + "Opt out of beta features": "Désactiver les fonctions bêta", + "Become a beta user": "Devenir utilisateur bêta", + "Are you sure you want to opt out of beta features?": "Êtes-vous sûr de vouloir refuser les fonctionnalités de la version bêta ?", + "You've successfully been removed from the beta users.": "Vous avez réussi à vous retirer des utilisateurs de la version bêta..", + "Congratulations! You've successfully been added to the beta users.": "Félicitations! Vous avez été ajouté avec succès aux utilisateurs de la version bêta.", + "Beta program is not available at the moment.": "Le programme bêta n'est pas disponible pour le moment.", + "Something went wrong.": "Quelque chose a mal tourné.", + "Title": "Titre", + "required": "requis", + "Description": "Description", + "Summary of your feedback": "Résumé de vos commentaires", + "Please give us as many details as possible": "Veuillez nous donner le plus de détails possible", + "Submit": "Soumettre", + "Experimental": "Expérimental", + "Title is mandatory.": "Le titre est obligatoire.", + "Description is mandatory.": "La description est obligatoire." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/fr.json b/l10n/fr.json index 58c6862a09d142507233960159834fdc945830c5..c9262bb06bcc1c506efa9b6626219da38ae0ac3e 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -1,15 +1,37 @@ { "translations": { - "Email Address": "Email Address", + "Email Address": "Adresse e-mail", "Options": "Options", - "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.", - "For your information you have %d order(s) in your account.": "For your information you have %d order(s) in your account.", + "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "Nous allons procéder à la suppression de votre compte cloud. Cochez la case ci-dessous si vous souhaitez également supprimer le compte boutique associé.", + "For your information you have %d order(s) in your account.": "Pour votre information, vous avez %d ordre(s) en votre compte.", "I also want to delete my shop account": "I also want to delete my shop account", - "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ", - "Error while setting shop delete preference": "Error while setting shop delete preference", - "Shop email cannot be same as this account's email.": "Murena.com email cannot be same as this account's email.", - "Invalid Email Format.": "Invalid Email Format.", - "A Murena.com account already uses this e-mail address.": "A Murena.com account already uses this e-mail address." + "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "Si vous souhaitez conserver votre compte boutique, veuillez valider ou modifier l'adresse e-mail ci-dessous. Cette adresse email deviendra votre nouveau login pour la boutique. ", + "Error while setting shop delete preference": "Erreur lors de la configuration de la préférence de suppression de boutique", + "Shop email cannot be same as this account's email.": "L'adresse électronique de Murena.com ne peut pas être la même que celle de ce compte.", + "Invalid Email Format.": "Format d'email invalide.", + "A Murena.com account already uses this e-mail address.": "Un compte Murena.com utilise déjà cette adresse électronique.", + "You are part of the beta users.": "Vous faites partie des utilisateurs bêta.", + "Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.": "Note : les fonctionnalités n'étant pas encore disponibles, il est possible que vous rencontriez quelques bugs. Veuillez les signaler et faire part de vos commentaires en utilisant le formulaire ci-dessous.", + "Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!": "Vous voulez faire une pause dans les fonctionnalités de la version bêta ? Cliquez simplement sur le bouton ci-dessous. Vous pouvez redevenir un utilisateur bêta à tout moment !", + "Do you want to become a beta user?": "Voulez-vous devenir un utilisateur bêta ?", + "You want to experiment new features ahead of the others and provide feedback on them before and if they're released? This section is made for you!": "Vous voulez expérimenter les nouvelles fonctionnalités avant les autres et donner votre avis sur celles-ci avant et si elles sont publiées ? Cette section est faite pour vous !", + "To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.": "Pour avoir un aperçu de nos nouvelles fonctionnalités, vous devez faire partie de nos utilisateurs bêta. Pour ce faire, il vous suffit de cliquer sur le bouton ci-dessous. Vous pouvez vous retirer des fonctionnalités bêta à tout moment.", + "Opt out of beta features": "Désactiver les fonctions bêta", + "Become a beta user": "Devenir utilisateur bêta", + "Are you sure you want to opt out of beta features?": "Êtes-vous sûr de vouloir refuser les fonctionnalités de la version bêta ?", + "You've successfully been removed from the beta users.": "Vous avez réussi à vous retirer des utilisateurs de la version bêta..", + "Congratulations! You've successfully been added to the beta users.": "Félicitations! Vous avez été ajouté avec succès aux utilisateurs de la version bêta.", + "Beta program is not available at the moment.": "Le programme bêta n'est pas disponible pour le moment.", + "Something went wrong.": "Quelque chose a mal tourné.", + "Title": "Titre", + "required": "requis", + "Description": "Description", + "Summary of your feedback": "Résumé de vos commentaires", + "Please give us as many details as possible": "Veuillez nous donner le plus de détails possible", + "Submit": "Soumettre", + "Experimental": "Expérimental", + "Title is mandatory.": "Le titre est obligatoire.", + "Description is mandatory.": "La description est obligatoire." }, "pluralForm": "nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/it.js b/l10n/it.js index ee9f82930baf89636e00302d926be7c7314456e1..946c5acbb64ac5692312e26fe7553ffcd9b15ca1 100644 --- a/l10n/it.js +++ b/l10n/it.js @@ -1,15 +1,37 @@ OC.L10N.register( "ecloud-accounts", { - "Email Address": "Email Address", - "Options": "Options", - "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.", - "For your information you have %d order(s) in your account.": "For your information you have %d order(s) in your account.", - "I also want to delete my shop account": "I also want to delete my shop account", - "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ", - "Error while setting shop delete preference": "Error while setting shop delete preference", - "Shop email cannot be same as this account's email.": "Murena.com email cannot be same as this account's email.", - "Invalid Email Format.": "Invalid Email Format.", - "A Murena.com account already uses this e-mail address.": "A Murena.com account already uses this e-mail address." + "Email Address": "Indirizzo e-mail", + "Options": "Opzioni", + "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "Procederemo con la soppressione dell'account cloud. Selezionare la casella sottostante se si desidera eliminare anche l'account del negozio associato.", + "For your information you have %d order(s) in your account.": "Per vostra informazione, avete %d ordini in il tuo account.", + "I also want to delete my shop account": "Voglio anche cancellare il mio account del negozio", + "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "Se volete mantenere il vostro account del negozio, convalidate o modificate l'indirizzo e-mail qui sotto. Questo indirizzo e-mail diventerà il vostro nuovo login al negozio. ", + "Error while setting shop delete preference": "Errore durante l'impostazione della preferenza di cancellazione del negozio", + "Shop email cannot be same as this account's email.": "L'e-mail di Murena.com non può essere uguale a quella di questo account.", + "Invalid Email Format.": "Formato email non valido.", + "A Murena.com account already uses this e-mail address.": "Un account Murena.com utilizza già questo indirizzo e-mail.", + "You are part of the beta users.": "Fate parte degli utenti beta.", + "Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.": "Nota: poiché le funzioni non sono ancora state rilasciate, è possibile che si verifichino alcuni bug. Si prega di segnalarli e di fornire il proprio feedback utilizzando il modulo sottostante.", + "Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!": "Volete fare una pausa dalle funzioni beta? Basta fare clic sul pulsante qui sotto. Potrete tornare a essere un utente beta in qualsiasi momento!", + "Do you want to become a beta user?": "Volete diventare utenti beta?", + "You want to experiment new features ahead of the others and provide feedback on them before and if they're released? This section is made for you!": "Volete sperimentare le nuove funzionalità prima degli altri e fornire un feedback su di esse prima e se vengono rilasciate? Questa sezione è fatta per voi!", + "To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.": "Per ottenere un'anteprima delle nostre nuove funzionalità è necessario entrare a far parte dei nostri utenti beta. Per farlo, è sufficiente cliccare sul pulsante sottostante. È possibile rinunciare alle funzioni beta in qualsiasi momento.", + "Opt out of beta features": "Esclusione delle funzioni beta", + "Become a beta user": "Diventare utente beta", + "Are you sure you want to opt out of beta features?": "Siete sicuri di voler rinunciare alle funzionalità della versione beta?", + "You've successfully been removed from the beta users.": "Siete usciti con successo dagli utenti della beta.", + "Congratulations! You've successfully been added to the beta users.": "Congratulazioni! Siete stati aggiunti con successo agli utenti beta.", + "Beta program is not available at the moment.": "Il programma beta non è al momento disponibile.", + "Something went wrong.": "Qualcosa è andato storto.", + "Title": "Titolo", + "required": "richiesto", + "Description": "Descrizione", + "Summary of your feedback": "Sintesi del vostro feedback", + "Please give us as many details as possible": "Vi preghiamo di fornirci il maggior numero di dettagli possibile", + "Submit": "Invia", + "Experimental": "Sperimentale", + "Title is mandatory.": "Il titolo è obbligatorio.", + "Description is mandatory.": "La descrizione è obbligatoria." }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/it.json b/l10n/it.json index 58c6862a09d142507233960159834fdc945830c5..359fcadbfcef0999567210e9c284e4496ab84883 100644 --- a/l10n/it.json +++ b/l10n/it.json @@ -1,15 +1,37 @@ { "translations": { - "Email Address": "Email Address", - "Options": "Options", - "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.", - "For your information you have %d order(s) in your account.": "For your information you have %d order(s) in your account.", - "I also want to delete my shop account": "I also want to delete my shop account", - "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ", - "Error while setting shop delete preference": "Error while setting shop delete preference", - "Shop email cannot be same as this account's email.": "Murena.com email cannot be same as this account's email.", - "Invalid Email Format.": "Invalid Email Format.", - "A Murena.com account already uses this e-mail address.": "A Murena.com account already uses this e-mail address." + "Email Address": "Indirizzo e-mail", + "Options": "Opzioni", + "We are going to proceed with your cloud account suppression. Check the box below if you also want to delete the associated shop account.": "Procederemo con la soppressione dell'account cloud. Selezionare la casella sottostante se si desidera eliminare anche l'account del negozio associato.", + "For your information you have %d order(s) in your account.": "Per vostra informazione, avete %d ordini in il tuo account.", + "I also want to delete my shop account": "Voglio anche cancellare il mio account del negozio", + "If you want to keep your shop account please validate or modify the email address below. This email address will become your new login to the shop. ": "Se volete mantenere il vostro account del negozio, convalidate o modificate l'indirizzo e-mail qui sotto. Questo indirizzo e-mail diventerà il vostro nuovo login al negozio. ", + "Error while setting shop delete preference": "Errore durante l'impostazione della preferenza di cancellazione del negozio", + "Shop email cannot be same as this account's email.": "L'e-mail di Murena.com non può essere uguale a quella di questo account.", + "Invalid Email Format.": "Formato email non valido.", + "A Murena.com account already uses this e-mail address.": "Un account Murena.com utilizza già questo indirizzo e-mail.", + "You are part of the beta users.": "Fate parte degli utenti beta.", + "Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.": "Nota: poiché le funzioni non sono ancora state rilasciate, è possibile che si verifichino alcuni bug. Si prega di segnalarli e di fornire il proprio feedback utilizzando il modulo sottostante.", + "Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!": "Volete fare una pausa dalle funzioni beta? Basta fare clic sul pulsante qui sotto. Potrete tornare a essere un utente beta in qualsiasi momento!", + "Do you want to become a beta user?": "Volete diventare utenti beta?", + "You want to experiment new features ahead of the others and provide feedback on them before and if they're released? This section is made for you!": "Volete sperimentare le nuove funzionalità prima degli altri e fornire un feedback su di esse prima e se vengono rilasciate? Questa sezione è fatta per voi!", + "To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.": "Per ottenere un'anteprima delle nostre nuove funzionalità è necessario entrare a far parte dei nostri utenti beta. Per farlo, è sufficiente cliccare sul pulsante sottostante. È possibile rinunciare alle funzioni beta in qualsiasi momento.", + "Opt out of beta features": "Esclusione delle funzioni beta", + "Become a beta user": "Diventare utente beta", + "Are you sure you want to opt out of beta features?": "Siete sicuri di voler rinunciare alle funzionalità della versione beta?", + "You've successfully been removed from the beta users.": "Siete usciti con successo dagli utenti della beta.", + "Congratulations! You've successfully been added to the beta users.": "Congratulazioni! Siete stati aggiunti con successo agli utenti beta.", + "Beta program is not available at the moment.": "Il programma beta non è al momento disponibile.", + "Something went wrong.": "Qualcosa è andato storto.", + "Title": "Titolo", + "required": "richiesto", + "Description": "Descrizione", + "Summary of your feedback": "Sintesi del vostro feedback", + "Please give us as many details as possible": "Vi preghiamo di fornirci il maggior numero di dettagli possibile", + "Submit": "Invia", + "Experimental": "Sperimentale", + "Title is mandatory.": "Il titolo è obbligatorio.", + "Description is mandatory.": "La descrizione è obbligatoria." }, "pluralForm": "nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/lib/Controller/BetaUserController.php b/lib/Controller/BetaUserController.php new file mode 100644 index 0000000000000000000000000000000000000000..ac6b06c60a999a7d5d93b7429dc3683d542be2b3 --- /dev/null +++ b/lib/Controller/BetaUserController.php @@ -0,0 +1,104 @@ +appName = $AppName; + $this->request = $request; + $this->config = $config; + $this->logger = $logger; + $this->userManager = $userManager; + $this->userSession = $userSession; + $this->groupManager = $groupManager; + $this->mailer = $mailer; + } + + /** + * @NoAdminRequired + * @NoCSRFRequired + */ + public function addUserInGroup() { + $user = $this->userSession->getUser(); + $groupName = $this->config->getSystemValue("beta_group_name"); + if (!$this->groupManager->groupExists($groupName)) { + return false; + } + $group = $this->groupManager->get($groupName); + $group->addUser($user); + return true; + } + + /** + * @NoAdminRequired + * @NoCSRFRequired + */ + public function removeUserInGroup() { + $user = $this->userSession->getUser(); + $groupName = $this->config->getSystemValue("beta_group_name"); + if (!$this->groupManager->groupExists($groupName)) { + return false; + } + $group = $this->groupManager->get($groupName); + $group->removeUser($user); + return true; + } + + /** + * @NoAdminRequired + * @NoCSRFRequired + */ + public function submitIssue(string $title, string $description) { + $user = $this->userSession->getUser(); + $fromEmail = $user->getEMailAddress(); + $fromName = $user->getDisplayName(); + + + $template = $this->mailer->createEMailTemplate('betauser.SubmitGitIssue', []); + $template->addHeader(); + $template->setSubject($title); + $template->addBodyText(htmlspecialchars($description), $description); + + $message = $this->mailer->createMessage(); + $message->setFrom([Util::getDefaultEmailAddress('noreply')]); + $message->setReplyTo([$fromEmail => $fromName]); + $message->setTo([$this->config->getSystemValue("beta_gitlab_email_id")]); + $message->useTemplate($template); + + $this->mailer->send($message); + + return true; + } +} diff --git a/lib/Settings/BetaSection.php b/lib/Settings/BetaSection.php new file mode 100644 index 0000000000000000000000000000000000000000..f1557497a9955ad94698eb879f4e4937abefbec1 --- /dev/null +++ b/lib/Settings/BetaSection.php @@ -0,0 +1,71 @@ +url = $url; + $this->l = $l; + } + + /** + * returns the ID of the section. It is supposed to be a lower case string, + * e.g. 'ldap' + * + * @returns string + */ + public function getID() { + return 'beta-user'; + } + + /** + * returns the translated name as it should be displayed, e.g. 'LDAP / AD + * integration'. Use the L10N service to translate it. + * + * @return string + */ + public function getName() { + return $this->l->t('Experimental'); + } + + /** + * @return int whether the form should be rather on the top or bottom of + * the settings navigation. The sections are arranged in ascending order of + * the priority values. It is required to return a value between 0 and 99. + * + * E.g.: 70 + */ + public function getPriority() { + return 70; + } + + /** + * {@inheritdoc} + */ + public function getIcon() { + return $this->url->imagePath('ecloud-accounts', 'beta.svg'); + } +} diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php new file mode 100644 index 0000000000000000000000000000000000000000..cbb37c6508888dbc104682eec8fd0182fea8fffa --- /dev/null +++ b/lib/Settings/BetaUserSetting.php @@ -0,0 +1,60 @@ +userSession = $userSession; + $this->groupManager = $groupManager; + $this->appName = $appName; + $this->config = $config; + $this->util = $util; + } + + public function getForm(): TemplateResponse { + $uid = $this->userSession->getUser()->getUID(); + $isBeta = 0; + $betaGroupName = $this->config->getSystemValue("beta_group_name"); + $groupExists = $this->groupManager->groupExists($betaGroupName); + if ($groupExists) { + $isBeta = $this->groupManager->isInGroup($uid, $betaGroupName); + } + $this->util->addScript($this->appName, $this->appName . '-beta-user-setting'); + $parameters = ['isBeta' => $isBeta, 'groupExists' => $groupExists]; + return new TemplateResponse($this->appName, 'beta_user_setting', $parameters, ''); + } + + public function getSection(): ?string { + return 'beta-user'; + } + + public function getPriority(): int { + return 0; + } +} diff --git a/lib/Settings/Personal.php b/lib/Settings/Personal.php index 96e764c29a68b8903c93d938bdacd30503a2f951..2e694e98fbf20e89421ec8748922bd024e8848db 100644 --- a/lib/Settings/Personal.php +++ b/lib/Settings/Personal.php @@ -31,7 +31,10 @@ class Personal implements ISettings { private IUserManager $userManager; - public function __construct($appName, IUserSession $userSession, IInitialState $initialState, ShopAccountService $shopAccountService, IAppManager $appManager, IGroupManager $groupManager, IUserManager $userManager) { + /** @var Util */ + protected $util; + + public function __construct($appName, IUserSession $userSession, IInitialState $initialState, ShopAccountService $shopAccountService, IAppManager $appManager, IGroupManager $groupManager, IUserManager $userManager, Util $util) { $this->userSession = $userSession; $this->initialState = $initialState; $this->appName = $appName; @@ -39,6 +42,7 @@ class Personal implements ISettings { $this->appManager = $appManager; $this->userManager = $userManager; $this->groupManager = $groupManager; + $this->util = $util; } /** @@ -51,8 +55,8 @@ class Personal implements ISettings { $onlyUser = $this->userManager->countUsers() < 2; $adminGroup = $this->groupManager->get('admin'); $onlyAdmin = $adminGroup && $adminGroup->count() < 2 && $this->groupManager->isAdmin($user->getUID()); - Util::addScript($this->appName, 'ecloud-accounts-personal-settings'); - Util::addScript($this->appName, 'ecloud-accounts-delete-account-listeners'); + $this->util->addScript($this->appName, $this->appName.'-personal-settings'); + $this->util->addScript($this->appName, $this->appName.'-delete-account-listeners'); $deleteShopAccount = $this->shopAccountService->getShopDeletePreference($user->getUID()); $shopEmailPostDelete = $this->shopAccountService->getShopEmailPostDeletePreference($user->getUID()); diff --git a/src/beta-user-setting.js b/src/beta-user-setting.js new file mode 100644 index 0000000000000000000000000000000000000000..fb43238b618bf8f164478e48623870ff4f4be1c5 --- /dev/null +++ b/src/beta-user-setting.js @@ -0,0 +1,86 @@ +/* + * Copyright 2022 - Murena SAS - tous droits réservés + */ +/* global $ */ +$(function() { + $('#beta-form').submit(function(event) { + event.preventDefault() + + $('#beta-form [type="submit"]').attr('disabled', true) + const registerType = $('#beta').val() + const url_ = OC.generateUrl('/apps/ecloud-accounts/beta/update') + + $.ajax({ + url: url_, + method: (registerType === 'deregister') ? 'DELETE' : 'POST', + success(result) { + let message_ = '' + if (result) { + if (registerType === 'deregister') { + message_ = t('ecloud-accounts', 'You\'ve successfully been removed from the beta users.') + } else { + message_ = t('ecloud-accounts', 'Congratulations! You\'ve successfully been added to the beta users.') + } + $('#message').addClass('alert-success') + } else { + message_ = t('ecloud-accounts', 'Something went wrong.') + $('#message').addClass('alert-fail') + } + $('#message').html(message_) + setTimeout(function() { + window.location.reload() + }, 2000) + }, + error(request, msg, error) { + $('#message').addClass('alert-fail') + $('#message').html(t('ecloud-accounts', 'Something went wrong here.')) + }, + }) + }) + + $('#title, #description').on('input', function() { + $(this).parent().find('.error-msg').remove() + }) + + $('#issue-submit-form').submit(function(event) { + event.preventDefault() + + const url_ = OC.generateUrl('/apps/ecloud-accounts/issue/submit') + $('.error-msg').remove() + if ($('#title').val() === '' || $('#description').val() === '') { + if ($('#title').val() === '') { + $('#title').parent().append('
' + t('ecloud-accounts', 'Title is mandatory.') + '
') + } + if ($('#description').val() === '') { + $('#description').parent().append('
' + t('ecloud-accounts', 'Description is mandatory.') + '
') + } + return + } + $('#issue-submit-form [type="submit"]').attr('disabled', true) + + $.ajax({ + url: url_, + method: 'POST', + data: $(this).serializeArray(), + success(result) { + let message_ = '' + if (result) { + message_ = t('ecloud-accounts', 'Issue submitted successfully.') + $('#issue_message').addClass('alert-success') + } else { + message_ = t('ecloud-accounts', 'Something went wrong.') + $('#issue_message').addClass('alert-fail') + } + $('#issue_message').html(message_) + setTimeout(function() { + window.location.reload() + }, 2000) + + }, + error(request, msg, error) { + $('#issue_message').addClass('alert-fail') + $('#issue_message').html(t('ecloud-accounts', 'Something went wrong.')) + }, + }) + }) +}) diff --git a/templates/beta_user_setting.php b/templates/beta_user_setting.php new file mode 100644 index 0000000000000000000000000000000000000000..6fdb6b78dc410212dcbd10072bc2c31de1e629e1 --- /dev/null +++ b/templates/beta_user_setting.php @@ -0,0 +1,50 @@ + + +
+
+
+ + +

t('You are part of the beta users.')); ?>

+

+ t('Note : as the features are not released yet, you may encounter some bugs. Please report them or give your feedback using the form below.')); ?> +

+
+

+ +

+

+ +

+

+ +

+

+ +

+

+ +

+
+
+

t('Want to take a break from beta features? Just click on the button below. You can become a beta user again anytime!')) ?>

+ +

t('Do you want to become a beta user?')); ?>

+

t('You want to experiment new features ahead of the others and provide feedback on them before and if they\'re released? This section is made for you!')) ?>

+

t('To get a preview of our new features you need to become part of our beta users. To do so, simply click on the button below. You can opt out of beta features at anytime.')) ?>

+ +
+
+ + +
+
+
+ +

t('Beta program is not available at the moment.')); ?>

+ +
+
+
diff --git a/webpack.config.js b/webpack.config.js index eb7e4bfd4e123207fc04a751ca617a3820a48943..ea2fb2f24f4bfa34237c2e5730ccd414046f241a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,5 +8,6 @@ module.exports = { entry: { 'personal-settings': path.join(__dirname, 'src/personal.js'), 'delete-account-listeners': path.join(__dirname, 'src/delete-account-listeners.js'), + 'beta-user-setting': path.join(__dirname, 'src/beta-user-setting.js'), }, }