"
+msgid "Activate renew options."
+msgstr "Wiederherstellungsoptionen aktivieren."
+
msgid "Cancel"
msgstr "Abbrechen"
-msgid "Change Password"
-msgstr "Passwort ändern"
-
msgid "Change password"
msgstr "Passwort ändern"
-msgid "Contact information for Password reset"
-msgstr "Kontaktinformationen zum Zurücksetzen des Passworts"
+msgid "Change your (expired) password."
+msgstr "Ändern Sie Ihr (abgelaufenes) Passwort."
-msgid "EMail"
-msgstr "E-Mail"
+msgid "Everyone forgets their password now and then. Protect yourself and activate the opportunity to set a new password."
+msgstr "Jeder vergißt mal das Passwort. Schützen Sie sich und aktivieren Sie die Möglichkeit ihr Passwort erneuern zu können."
-msgid "Feel free to change your contact information. Press \"Save\" to confirm your changes."
-msgstr "Bitte tragen Sie Ihre Kontaktinformationen ein und drücken Sie anschließend \"Speichern\", um Ihre Änderungen zu bestätigen."
+msgid "Forbidden chars:"
+msgstr "Vorbotene Zeichen:"
msgid ""
"Forbidden redirect to: {0}\n"
@@ -49,6 +46,9 @@ msgstr ""
"Verbotene Weiterleitung nach: {0}\n"
" Die URL muss mit (nur) einem \"/\" beginnen."
+msgid "Forgot your password? Set a new one: "
+msgstr "Haben Sie ihr Passwort vergessen? Setzen Sie ein Neues:"
+
#, python-format
msgid "Hello %(last)s, %(first)s!"
msgstr "Hallo %(last)s, %(first)s!"
@@ -57,69 +57,69 @@ msgstr "Hallo %(last)s, %(first)s!"
msgid "Hello %s %s!"
msgstr "Hallo %s %s!"
+msgid "If you did not received an e-mail please check your spam directory or use this link to go back to step 2."
+msgstr "Sollten Sie keine E-Mail erhalten haben, dann prüfen Sie bitte Ihr SPAM-Verzeichnis oder nutzen Sie diesen Link und kehren zu Schritt 2 zurück."
+
msgid "Language"
msgstr "Sprache"
-msgid "Mobile"
-msgstr "Mobilfunknummer"
-
-msgid "New password"
+msgid "New Password"
msgstr "Neues Passwort"
-msgid "New password (retype)"
+msgid "New Password (retype)"
msgstr "Neues Passwort (Wiederholung)"
msgid "Next"
msgstr "Weiter"
-msgid "Old password"
+msgid "Old Password"
msgstr "Altes Passwort"
-msgid "On this page you can change your password. If you have lost your password, use this link to the password reset page."
-msgstr "Auf dieser Seite können Sie Ihr Passwort ändern. Wenn Sie Ihr Passwort vergessen haben, nutzen Sie bitte den folgenden Link: Passwort zurücksetzen."
-
-msgid "On this page you can reset your lost password or provide contact information for setting a new password in the future."
-msgstr "Auf dieser Seite können Sie Ihr Passwort zurücksetzen oder Ihre Kontaktinformationen angeben, um zukünftig Ihr Passwort zurücksetzen zu können."
-
-msgid "On this page you can set your contact information to reset your password in the future. During the reset process a token is sent to you. Without contact information it is not possible to reset your password."
-msgstr "Auf dieser Seite können Sie Ihre Kontaktinformationen angeben. Diese Informationen werden benötigt, um Ihnen einen Token (Sicherheitsschlüssel) zuzusenden. Nur mit Hilfe eines Tokens ist es möglich das Passwort zurückzusetzen."
-
msgid "Password"
msgstr "Passwort"
-msgid "Password Reset"
-msgstr "Passwort zurücksetzen"
+msgid "Password change"
+msgstr "Passwort ändern"
-msgid "Please choose a method to receive the token."
-msgstr "Bitte wählen Sie eine Benachrichtigungsart über die Sie einen Token (Sicherheitsschlüssel) erhalten möchten."
+msgid "Password forgotten"
+msgstr "Passwort vergessen"
-msgid "Please click the following link to change your contact information for resetting your password in the future."
-msgstr "Bitte nutzen Sie den folgenden Link, um Ihre Kontaktinformationen zu ändern damit Sie zukünftig Ihr Passwort zurücksetzen können."
+msgid "Please choose an option to renew your password."
+msgstr "Bitte wählen Sie eine Wiederherstellungsoption aus."
msgid "Please enter a valid email address."
msgstr "Keine gültige E-Mail-Adresse."
-msgid "Please enter the token and your new password."
-msgstr "Bitte geben Sie den Token (Sicherheitsschlüssel) und ein neues Passwort ein."
+msgid "Protect Account Access"
+msgstr "Kontozugang schützen"
-msgid "Please enter your username and password to display your contact information."
-msgstr "Bitte geben Sie Ihren Benutzernamen und Ihr Passwort ein, um Ihre Kontaktinformationen einsehen und ändern zu können."
+msgid "Required chars:"
+msgstr "Erforderliche Zeichen:"
-msgid "Please provide the required data to change your password."
-msgstr "Bitte geben Sie die notwendigen Daten ein, um Ihr Passwort zu ändern."
+msgid "Required length:"
+msgstr "Erforderliche Passwortlänge:"
-msgid "Please provide your username to receive a token that is required to reset your password."
-msgstr "Bitte geben Sie Ihren Benutzernamen ein. Sie erhalten anschließend einen Token (Sicherheitsschlüssel) mit dem Sie Ihr Passwort zurücksetzen können."
+msgid "Required number of lower case letters:"
+msgstr "Erforderliche Anzahl von Kleinbuchstaben:"
-msgid "Provide your contact information."
-msgstr "Geben Sie Ihre Kontaktinformationen an."
+msgid "Required number of special characters (nor digit or letters):"
+msgstr "Erforderliche Anzahl von Sonderzeichen:"
-msgid "Reset your password."
-msgstr "Passwort zurücksetzen."
+msgid "Required number of upper case letters:"
+msgstr "Erforderliche Anzahl von Großbuchstaben:"
msgid "Save"
msgstr "Speichern"
+msgid "Set a new password!"
+msgstr "Setzen Sie ein neues Passwort!"
+
+msgid "The entries do not match, please retype again."
+msgstr "Die Eingaben stimmen nicht überein. Bitte versuchen Sie es erneut."
+
+msgid "The password must fullfill following conditions:"
+msgstr "Das Passwort muss folgende Bedingungen erfüllen:"
+
msgid "The passwords do not match, please retype again."
msgstr "Die Passwörter stimmen nicht überein. Bitte versuchen Sie es erneut."
@@ -127,8 +127,8 @@ msgstr "Die Passwörter stimmen nicht überein. Bitte versuchen Sie es erneut."
msgid "The total cost was %.2f EUR!"
msgstr "Die Gesamtkosten waren %.2f EUR!"
-msgid "Token"
-msgstr "Token (Sicherheitsschlüssel)"
+msgid "This value is required."
+msgstr "Pflichtfeld."
msgid "Translate me!"
msgstr "Übersetz mich!"
@@ -136,95 +136,11 @@ msgstr "Übersetz mich!"
msgid "Username"
msgstr "Benutzername"
-msgid "to '{0}'"
-msgstr "zu '{0}'"
-
-#~ msgid "A license file has been sent to {0}. This file is necessary to activate the system. For this, please carry out the following steps:
Open the email.
Save the attachement (ucs.license) on your computer.
Click the button 'Upload license file'.
Select the file (ucs.license) you just saved.
Confirm the selection.
Once the activation has been finished your email address will be sent to the app provider. The app provider may contact you."
-#~ msgstr "Eine Lizenzdatei wurde an {0} gesendet. Sie wird benötigt um das System zu aktivieren. Bitte führen Sie dazu folgende Schritte aus:
Öffnen Sie die E-Mail.
Speichern Sie den Anhang (ucs.license) auf Ihren Computer.
Klicken Sie auf die Schaltfläche 'Lizenzdatei hochladen'.
Wählen Sie die soeben gespeicherte Datei (ucs.license) aus.
Bestätigen Sie die Auswahl.
Sobald die Aktivierung durchgeführt ist, wird Ihre E-Mail-Adresse an den App-Anbieter weitergeleitet. Der App-Anbieter wird Sie ggf. kontaktieren."
-
-#~ msgid "Activation of {appliance_name} Univention App"
-#~ msgstr "Aktivierung von {appliance_name} Univention App"
-
-#~ msgid "Activation successful!"
-#~ msgstr "Aktivierung erfolgreich!"
-
-#~ msgid "An unknown error has occurred."
-#~ msgstr "Ein unbekannter Fehler trat auf."
-
-#~ msgid "An unknown error occured. Please try it again later!"
-#~ msgstr "Ein unbekannter Fehler trat auf. Bitte versuchen sie es später noch einmal!"
-
-#~ msgid "Confirm username"
-#~ msgstr "Benutzername bestätigen"
-
-#~ msgid "Continue"
-#~ msgstr "Weiter"
+msgid "We have send you an e-mail to your alternative e-mail address, that you have provided on the page \"Protect Account Access\". Please check your mails and follow the link to renew your password."
+msgstr "Wir haben Ihnen eine E-Mail an Ihre alternative E-Mailadresse geschickt. Diese haben Sie auf der Seite \"Kontugang schützen\" hinterlegt. Bitte prüfen Sie Ihre E-Mails und folgen Sie den Link, um Ihr Passwort zu erneuern."
-#~ msgid "E-mail address"
-#~ msgstr "E-Mail-Adresse"
+msgid "You have mail!"
+msgstr "Sie haben eine neue E-Mail!"
-#~ msgid "Error "
-#~ msgstr "Fehler "
-
-#~ msgid "I have forgotten my password."
-#~ msgstr "Ich habe mein Passwort vergessen."
-
-#~ msgid "I want to change my (expired) password."
-#~ msgstr "Ich will mein (abgelaufenes) Passwort ändern."
-
-#~ msgid "I would like to set my contact information for resetting my password."
-#~ msgstr "Ich möchte meine Kontaktinformationen ändern, um zukünftig mein Password zurücksetzen zu können."
-
-#~ msgid "If you did not receive an email, please check your SPAM directory or request the email again."
-#~ msgstr "Sollten Sie keine E-Mail erhalten haben, prüfen Sie Ihr SPAM-Verzeichnis oder fordern Sie die Lizenzdatei noch einmal an."
-
-#~ msgid "If you encounter problems during the activation, please send an email to: feedback@univention.de"
-#~ msgstr "Sollten Probleme bei der Aktivierung auftreten, senden Sie bitte eine E-Mail an: feedback@univention.de"
-
-#~ msgid "In order to reset your password please carry out the following steps: "
-#~ msgstr "Um Ihr Passwort zurückzusetzen führen Sie bitte die folgenden Schritte aus: "
-
-#~ msgid "License request."
-#~ msgstr "Anforderung einer Lizenz."
-
-#~ msgid "More details about the activation can be found in the UCS manual."
-#~ msgstr "Weitere Informationen zu der Aktivierung können im UCS-Handbuch gefunden werden."
-
-#~ msgid "Password self-service"
-#~ msgstr "Passwort verwalten"
-
-#~ msgid "Please enter a valid email address in order to activate {appliance_name} Univention App. The activation is mandatory to deploy the system. In the next step you can upload the license file that has been sent to your email address."
-#~ msgstr "Bitte geben Sie eine gültige E-Mail-Adresse ein, um {appliance_name} Univention App zu aktivieren. Die Aktivierung ist Voraussetzung, um das System in Gebrauch zu nehmen. Im nächsten Schritt können sie die Lizenzdatei hochladen, die an Ihre E-Mail-Adresse gesendet wurde."
-
-#~ msgid "Please enter your username."
-#~ msgstr "Bitte geben Sie Ihren Benutzernamen ein."
-
-#~ msgid "Request token"
-#~ msgstr "Token anfordern"
-
-#~ msgid "Show contact information"
-#~ msgstr "Kontaktinformationen anzeigen"
-
-#~ msgid "The following error occurred:"
-#~ msgstr "Der folgende Fehler trat auf:"
-
-#~ msgid "The server is not responding. Please restart the system."
-#~ msgstr "Der Webserver antwortet nicht. Bitte starten Sie das System neu."
-
-#~ msgid "Upload license file"
-#~ msgstr "Lizenzdatei hochladen"
-
-#~ msgid "Welcome to the Password self-service. On this site you can reset and change your password. Please select an option to get more information."
-#~ msgstr "Willkommen zur Passwortverwaltung. Auf dieser Seite können Sie Ihr Passwort zurücksetzen oder ändern. Bitte wählen Sie eine Option, um mehr Informationen zu erhalten."
-
-#~ msgid "You have got mail!"
-#~ msgstr "Sie haben eine neue E-Mail!"
-
-#~ msgid "You have received a license file by email!"
-#~ msgstr "Sie haben eine Lizendatei per E-Mail erhalten!"
-
-#~ msgid "your email address"
-#~ msgstr "Ihre E-Mail-Adresse"
-
-#~ msgid "{appliance_name} Univention App is now activated. Click \"Continue\" to access the management interface (which may take a while)."
-#~ msgstr "{appliance_name} Univention App ist nun aktiviert. Klicken sie auf \"Weiter\", um auf die Verwaltungsoberfläche zuzugreifen. (Das kann einige Zeit benötigen.)"
+msgid "to '{0}'"
+msgstr "zu '{0}'"
--- a/management/univention-self-service/js/ucs/lib.js
+++ a/management/univention-self-service/js/ucs/lib.js
@@ -36,16 +36,22 @@ define([
"dojo/io-query",
"dojox/html/entities",
"put-selector/put",
+ "dojo/request",
"./i18n!."
-], function(lang, fx, dom, domGeom, ioQuery, htmlEntities, put, _) {
+], function(lang, fx, dom, domGeom, ioQuery, htmlEntities, put, request, _) {
return {
getCurrentLanguageQuery: function() {
return '?lang=' + (this.getQuery('lang') || 'en-US');
},
+ /**
+ * Displays given message.
+ * @param {object} msg - Provides targetNode, class and content
+ * for the message.
+ */
showMessage: function(msg) {
- var targetNode = msg.targetNode || dom.byId("content");
+ var targetNode = msg.targetNode || dom.byId("server_msg");
var msgNode = dom.byId('msg');
if (msgNode) {
@@ -64,7 +70,7 @@ define([
},
showLastMessage: function(msg) {
- var targetNode = msg.targetNode || dom.byId("title");
+ var targetNode = msg.targetNode || dom.byId("server_msg");
var msgNode = dom.byId('msg');
if (msgNode) {
@@ -107,22 +113,34 @@ define([
return message;
},
+ /**
+ * Returns relative url from query string.
+ */
_getUrlForRedirect: function() {
var queryUrl = this.getQuery('url');
if (queryUrl) {
- // checking if queryUrl is relative = has to start wit only one '/'
- var reg = /^\/([^\/]|$)/;
- var isUrlRelative = reg.test(queryUrl);
- if (isUrlRelative) {
+ if (this._isUrlRelative(queryUrl)) {
return queryUrl;
} else {
- // forbidden to provide absolute urls
- console.error(lang.replace(_('Forbidden redirect to: {0}\n The url has to start with (only) one "/".', [queryUrl])));
+ var msg = {
+ content: lang.replace(_('Forbidden redirect to: {0}\n The url has to start with (only) one "/".', [queryUrl])),
+ 'class': 'error'
+ };
+ this.showMessage(msg);
}
}
return;
},
+ /** Returns boolean if given url is relative.
+ * @param {string} url - url to test
+ * */
+ _isUrlRelative: function(url) {
+ var reg = /^\/([^\/]|$)/;
+ var isUrlRelative = reg.test(url);
+ return isUrlRelative;
+ },
+
_getUrlLabelForRedirect: function() {
var label = this.getQuery('urlLabel');
if (label) {
@@ -133,6 +151,9 @@ define([
}
},
+ /**
+ * Returns the value of the query string for a given key.
+ * */
getQuery: function(key) {
var queryString = window.location.search.substring(1);
var queryObject = ioQuery.queryToObject(queryString);
@@ -146,6 +167,24 @@ define([
}
},
+ /**
+ * Returns the needed backend information for the Password Service
+ * as a promise or as an object.
+ * The information is requested once and will be cached in
+ * this._backend_info.
+ * */
+ getBackendInformation: function() {
+ if (!this._backend_info) {
+ var promise = request.get("/univention-self-service/entries.json");
+ promise.then(lang.hitch(this, function(data){
+ this._backend_info = data;
+ }));
+ return promise;
+ } else {
+ return this._backend_info;
+ }
+ },
+
wipeInNode: function(conf) {
var endHeight = domGeom.getMarginBox(conf.node).h;
fx.animateProperty({
--- a/management/univention-self-service/js/ucs/passwordchange.js
+++ a/management/univention-self-service/js/ucs/passwordchange.js
@@ -1,209 +0,0 @@
-/*
- * Copyright 2015-2016 Univention GmbH
- *
- * http://www.univention.de/
- *
- * All rights reserved.
- *
- * The source code of this program is made available
- * under the terms of the GNU Affero General Public License version 3
- * (GNU AGPL V3) as published by the Free Software Foundation.
- *
- * Binary versions of this program provided by Univention to you as
- * well as other copyrighted, protected or trademarked materials like
- * Logos, graphics, fonts, specific documentations and configurations,
- * cryptographic keys etc. are subject to a license agreement between
- * you and Univention and not subject to the GNU AGPL V3.
- *
- * In the case you use this program under the terms of the GNU AGPL V3,
- * the program is provided in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License with the Debian GNU/Linux or Univention distribution in file
- * /usr/share/common-licenses/AGPL-3; if not, see
- * .
- */
-/*global define require console window */
-
-define([
- "dojo/_base/lang",
- "dojo/on",
- "dojo/keys",
- "dojo/dom",
- "dojo/json",
- "dojo/request/xhr",
- "dijit/form/Button",
- "put-selector/put",
- "./TextBox",
- "./LabelPane",
- "./lib",
- "./i18n!."
-], function(lang, on, keys, dom, json, xhr, Button, put, TextBox, LabelPane, lib, _) {
-
- return {
- _createTitle: function() {
- var title = _('Change Password');
- var siteDescription = lang.replace(_('On this page you can change your password. If you have lost your password, use this link to the password reset page.', [lib.getCurrentLanguageQuery()]));
- document.title = title;
- var titleNode = dom.byId('title');
- put(titleNode, 'h1', title);
- put(titleNode, 'p', { innerHTML : siteDescription });
- put(titleNode, '!.dijitHidden');
- },
-
- _createContent: function() {
- var contentNode = dom.byId('content');
- var formNode = this._getFormNode();
- put(formNode, '[id=form]!dijitHidden');
- put(contentNode, formNode);
- },
-
- _getFormNode: function() {
- var formNode = put('div.step');
- put(formNode, 'p > b', _('Please provide the required data to change your password.'));
- var stepContent = put(formNode, 'div.stepContent');
-
- // create input field for username
- this._username = new TextBox({
- label: _('Username'),
- 'class': 'doubleLabelPane block',
- isValid: function() {
- return !!this.get('value');
- },
- required: true
- });
- put(stepContent, '>', this._username.label.domNode);
- this._username.startup();
-
- // create input field for old password
- this._oldPassword = new TextBox({
- label: _('Old password'),
- type: 'password',
- 'class': 'doubleLabelPane block',
- isValid: function() {
- return !!this.get('value');
- },
- required: true
- });
- put(stepContent, '>', this._oldPassword.label.domNode);
- this._oldPassword.startup();
-
- // create input fields for new password
- this._newPassword = new TextBox({
- label: _('New password'),
- type: 'password',
- 'class': 'doubleLabelPane left',
- isValid: function() {
- return !!this.get('value');
- },
- required: true
- });
- put(stepContent, '>', this._newPassword.label.domNode);
- this._newPassword.startup();
-
- // create input fields for new password
- this._verifyPassword = new TextBox({
- label: _('New password (retype)'),
- type: 'password',
- 'class': 'doubleLabelPane',
- isValid: lang.hitch(this, function() {
- return this._newPassword.get('value') ===
- this._verifyPassword.get('value');
- }),
- invalidMessage: _('The passwords do not match, please retype again.'),
- required: true
- });
- put(stepContent, '>', this._verifyPassword.label.domNode);
- this._verifyPassword.startup();
-
- // create submit button
- this._submitButton = new Button({
- label: _('Change password'),
- onClick: lang.hitch(this, '_submit')
- });
- put(stepContent, '>', this._submitButton.domNode);
-
- // let the user submit form by pressing ENTER
- on(document, "keyup", lang.hitch(this, function(evt) {
- if (evt.keyCode === keys.ENTER && !this._submitButton.get('disabled')) {
- this._submit();
- }
- }));
-
- return formNode;
- },
-
- _submit: function() {
- this._showValidStatusOfInputFields();
- this._submitButton.set('disabled', true);
- var allInputFieldsAreValid = this._username.isValid() &&
- this._oldPassword.isValid() &&
- this._newPassword.isValid() &&
- this._verifyPassword.isValid();
-
- if (allInputFieldsAreValid) {
- data = json.stringify({
- password: {
- 'username': this._username.get('value'),
- 'password': this._oldPassword.get('value'),
- 'new_password': this._newPassword.get('value')
- }
- });
-
- xhr.post('/univention-management-console/set', {
- handleAs: 'json',
- headers: {
- 'Content-Type': 'application/json',
- 'Accept-Language': lib.getQuery('lang') || 'en-US'
- },
- data: data
- }).then(lang.hitch(this, function(data) {
- lib._removeMessage();
- var callback = function() {
- lib.showLastMessage({
- content: data.message,
- 'class': '.success'
- });
- };
- lib.wipeOutNode({
- node: dom.byId('form'),
- callback: callback
- });
- this._clearAllInputFields();
- }), lang.hitch(this, function(err) {
- var message = err.name + ": " + err.message;
- if (err.response && err.response.data && err.response.data.message) {
- message = err.response.data.message;
- }
- lib.showMessage({content: message, 'class': '.error'});
- })).always(lang.hitch(this, function(){
- this._submitButton.set('disabled', false);
- }));
- } else {
- this._submitButton.set('disabled', false);
- }
- },
-
- _showValidStatusOfInputFields: function() {
- this._username.setValid(this._username.isValid());
- this._oldPassword.setValid(this._oldPassword.isValid());
- this._newPassword.setValid(this._newPassword.isValid());
- //this._verifyPassword.setValid(this._verifyPassword.isValid());
- },
-
- _clearAllInputFields: function() {
- this._username.reset();
- this._oldPassword.reset();
- this._newPassword.reset();
- this._verifyPassword.reset();
- },
-
- start: function() {
- this._createTitle();
- this._createContent();
- }
- };
-});
--- a/management/univention-self-service/js/ucs/passwordreset.js
+++ a/management/univention-self-service/js/ucs/passwordreset.js
@@ -1,386 +0,0 @@
-/*
- * Copyright 2015-2016 Univention GmbH
- *
- * http://www.univention.de/
- *
- * All rights reserved.
- *
- * The source code of this program is made available
- * under the terms of the GNU Affero General Public License version 3
- * (GNU AGPL V3) as published by the Free Software Foundation.
- *
- * Binary versions of this program provided by Univention to you as
- * well as other copyrighted, protected or trademarked materials like
- * Logos, graphics, fonts, specific documentations and configurations,
- * cryptographic keys etc. are subject to a license agreement between
- * you and Univention and not subject to the GNU AGPL V3.
- *
- * In the case you use this program under the terms of the GNU AGPL V3,
- * the program is provided in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License with the Debian GNU/Linux or Univention distribution in file
- * /usr/share/common-licenses/AGPL-3; if not, see
- * .
- */
-/*global define require console window */
-
-define([
- "dojo/_base/lang",
- "dojo/_base/array",
- "dojo/on",
- "dojo/keys",
- "dojo/dom",
- "dojo/json",
- "dojo/request/xhr",
- "dijit/form/Button",
- "put-selector/put",
- "./ContainerWidget",
- "./LabelPane",
- "./TextBox",
- "./RadioButton",
- "./lib",
- "./i18n!."
-], function(lang, array, on, keys, dom, json, xhr, Button, put, ContainerWidget, LabelPane, TextBox, RadioButton, lib, _) {
-
- return {
- selectedTokenMethod: null,
-
- _createTitle: function() {
- var title = _('Password Reset');
- var siteDescription = _('On this page you can reset your lost password or provide contact information for setting a new password in the future.');
- document.title = title;
- var titleNode = dom.byId('title');
- put(titleNode, 'h1', title);
- put(titleNode, 'p', siteDescription);
- put(titleNode, '!.dijitHidden');
- },
-
- _createContent: function() {
- var contentNode = dom.byId('content');
- var formNode = this._getFormNode();
- put(formNode, '[id=form].step!dijitHidden');
- put(contentNode, formNode);
- this._fillContentByUrl();
- },
-
- _getFormNode: function() {
- var formNode = put('div[style="overflow: hidden;"]');
-
- // step 1 username and link to contact information
- this.usernameNode = put(formNode, 'div.step');
- put(this.usernameNode, 'p > b', _('Reset your password.'));
- put(this.usernameNode, 'p', _('Please provide your username to receive a token that is required to reset your password.'));
- var stepContent = put(this.usernameNode, 'div.stepContent');
- this._username = new TextBox({
- label: _('Username'),
- 'class': 'soloLabelPane',
- isValid: function() {
- return !!this.get('value');
- },
- required: true
- });
- this._username.on('keyup', lang.hitch(this, function(evt) {
- if (evt.keyCode === keys.ENTER) {
- this._getResetMethods();
- }
- }));
- put(stepContent, this._username.label.domNode);
- this._username.startup();
- this._usernameButton = new Button({
- label: _('Next'),
- onClick: lang.hitch(this, '_getResetMethods')
- });
- put(stepContent, this._usernameButton.domNode);
-
- // contact information
- this.contactNode = put(formNode, 'div.step');
- put(this.contactNode, 'p > b', _('Provide your contact information.'));
- put(this.contactNode, 'p', {
- innerHTML: lang.replace(_('Please click the following link to change your contact information for resetting your password in the future.', [lib.getCurrentLanguageQuery()]))
- });
-
- // step 2 token
- this.tokenNode = put(formNode, 'div.step.hide-step');
- var skipStep = function() {
- put(this.newPasswordNode, '!hide-step');
- put(this._requestTokenButton.domNode, '.dijitHidden');
- this._requestTokenButton.set('disabled', true);
- };
- var descRequestToken = put(this.tokenNode, 'p', _('Please choose a method to receive the token.'));
- put(descRequestToken, 'span', {
- innerHTML: _(' If you already have a token you can skip this step.'),
- onclick: lang.hitch(this, skipStep)
- });
- stepContent = put(this.tokenNode, 'div.stepContent');
- this._tokenOptions = new ContainerWidget({});
- put(stepContent, this._tokenOptions.domNode);
- this._requestTokenButton = new Button({
- label: _('Next'),
- onClick: lang.hitch(this, '_requestToken')
- });
- put(stepContent, this._requestTokenButton.domNode);
-
- // step 3 use the token to set a new password
- this.newPasswordNode = put(formNode, 'div.step.hide-step');
- var prevStep = function() {
- put(this.newPasswordNode, '.hide-step');
- put(this.tokenNode, '!dijitHidden');
- put(this.tokenNode, '!hide-step');
- put(this._requestTokenButton.domNode, '!dijitHidden');
- this._requestTokenButton.set('disabled', false);
- };
- var descNewPassword = put(this.newPasswordNode, 'p', _('Please enter the token and your new password.'));
- put(descNewPassword, 'span', {
- innerHTML: _(' If your token has expired you can request a new token.'),
- onclick: lang.hitch(this, prevStep)
- });
- stepContent = put(this.newPasswordNode, 'div.stepContent');
- this._token = new TextBox({
- label: _('Token'),
- 'class': 'soloLabelPane',
- isValid: function() {
- return !!this.get('value');
- },
- required: true
- });
- this._token.on('keyup', lang.hitch(this, function(evt) {
- if (evt.keyCode === keys.ENTER) {
- this._setPassword();
- }
- }));
- put(stepContent, this._token.label.domNode);
- this._token.startup();
-
- this._newPassword = new TextBox({
- label: _('New password'),
- type: 'password',
- 'class': 'doubleLabelPane left',
- isValid: function() {
- return !!this.get('value');
- },
- required: true
- });
- this._newPassword.on('keyup', lang.hitch(this, function(evt) {
- if (evt.keyCode === keys.ENTER) {
- this._setPassword();
- }
- }));
- put(stepContent, this._newPassword.label.domNode);
- this._newPassword.startup();
-
- this._verifyPassword = new TextBox({
- label: _('New password (retype)'),
- type: 'password',
- 'class': 'doubleLabelPane',
- isValid: lang.hitch(this, function() {
- return this._newPassword.get('value') ===
- this._verifyPassword.get('value');
- }),
- invalidMessage: _('The passwords do not match, please retype again.'),
- required: true
- });
- this._verifyPassword.on('keyup', lang.hitch(this, function(evt) {
- if (evt.keyCode === keys.ENTER) {
- this._setPassword();
- }
- }));
- put(stepContent, this._verifyPassword.label.domNode);
- this._verifyPassword.startup();
- this._setPasswordButton = new Button({
- label: _('Change password'),
- onClick: lang.hitch(this, '_setPassword')
- });
- put(stepContent, this._setPasswordButton.domNode);
- return formNode;
- },
-
- _getResetMethods: function() {
- this._username.set('disabled', true);
- this._usernameButton.set('disabled', true);
-
- if (this._username.isValid()) {
- data = json.stringify({
- 'username': this._username.get('value')
- });
- xhr.post('passwordreset/get_reset_methods', {
- handleAs: 'json',
- headers: {
- 'Content-Type': 'application/json',
- 'Accept-Language': lib.getQuery('lang') || 'en-US'
- },
- data: data
- }).then(lang.hitch(this, function(data) {
- lib._removeMessage();
- put(this._usernameButton.domNode, '.dijitHidden');
- put(this.contactNode, '!');
- this._buildTokenOptions(data.result);
- }), lang.hitch(this, function(err){
- var message = err.name + ": " + err.message;
- if (err.response && err.response.data && err.response.data.message) {
- message = err.response.data.message;
- }
- lib.showMessage({
- content: message,
- targetNode: this.usernameNode,
- 'class': '.error'
- });
- this._usernameButton.set('disabled', false);
- this._username.set('disabled', false);
- }));
- } else {
- this._usernameButton.set('disabled', false);
- this._username.set('disabled', false);
- }
- },
-
- _buildTokenOptions: function(options) {
- array.forEach(options, lang.hitch(this, function(obj, idx){
- var radioButton = new RadioButton({
- name: 'button' + idx,
- label: obj.label,
- method: obj.id,
- checked: idx === 0,
- radioButtonGroup: 'token',
- _categoryID: 'token'
- });
- var label = new LabelPane({
- 'class': 'ucsRadioButtonLabel',
- content: radioButton
- });
- this._tokenOptions.addChild(label);
- }));
- put(this.tokenNode, '!hide-step');
- },
-
- _requestToken: function() {
- // get selected method for requesting a token
- array.some(this._tokenOptions.getChildren(), lang.hitch(this, function(tokenLabel) {
- var radioButton = tokenLabel.getChildren()[0];
- if (radioButton.checked) {
- this.selectedTokenMethod = {
- label: radioButton.get('label'),
- method: radioButton.get('method')
- };
- }
- }));
-
- if (this.selectedTokenMethod) {
- this._requestTokenButton.set('disabled', true);
- data = json.stringify({
- 'username': this._username.get('value'),
- 'method': this.selectedTokenMethod.method
- });
- xhr.post('passwordreset/send_token', {
- handleAs: 'json',
- headers: {
- 'Content-Type': 'application/json',
- 'Accept-Language': lib.getQuery('lang') || 'en-US'
- },
- data: data
- }).then(lang.hitch(this, function(data) {
- lib.showMessage({
- content: data.message,
- targetNode: this.tokenNode,
- 'class': '.success'
- });
- put(this._requestTokenButton.domNode, '.dijitHidden');
- put(this.newPasswordNode, '!hide-step');
- }), lang.hitch(this, function(err){
- var message = err.name + ": " + err.message;
- if (err.response && err.response.data && err.response.data.message) {
- message = err.response.data.message;
- }
- lib.showMessage({
- content: message,
- targetNode: this.tokenNode,
- 'class': '.error'
- });
- this._requestTokenButton.set('disabled', false);
- }));
- }
- },
-
- _setPassword: function() {
- this._setPasswordButton.set('disabled', true);
- this._token.set('disabled', true);
- this._newPassword.set('disabled', true);
- this._verifyPassword.set('disabled', true);
-
- var isTokenAndNewPassValid = this._token.isValid() &&
- this._newPassword.isValid() &&
- this._verifyPassword.isValid();
-
- if (isTokenAndNewPassValid) {
- data = json.stringify({
- 'username': this._username.get('value'),
- 'password': this._verifyPassword.get('value'),
- 'token' : this._token.get('value')
- });
- xhr.post('passwordreset/set_password', {
- handleAs: 'json',
- headers: {
- 'Content-Type': 'application/json',
- 'Accept-Language': lib.getQuery('lang') || 'en-US'
- },
- data: data
- }).then(lang.hitch(this, function(data) {
- lib._removeMessage();
- var callback = function() {
- lib.showLastMessage({
- content: data.message,
- 'class': '.success'
- });
- };
- lib.wipeOutNode({
- node: dom.byId('form'),
- callback: callback
- });
- }), lang.hitch(this, function(err){
- var message = err.name + ": " + err.message;
- if (err.response && err.response.data && err.response.data.message) {
- message = err.response.data.message;
- }
- lib.showMessage({
- content: message,
- targetNode: this.newPasswordNode,
- 'class': '.error'
- });
- this._setPasswordButton.set('disabled', false);
- this._token.set('disabled', false);
- this._newPassword.set('disabled', false);
- this._verifyPassword.set('disabled', false);
- }));
- } else {
- this._setPasswordButton.set('disabled', false);
- this._token.set('disabled', false);
- this._newPassword.set('disabled', false);
- this._verifyPassword.set('disabled', false);
- }
- },
-
- _fillContentByUrl: function() {
- // checks if the url contains a username and a token
- // show and fill the corresponding input fields if true
- var token = lib.getQuery('token');
- var username = lib.getQuery('username');
- if (token && username) {
- this._username.set('value', username);
- this._token.set('value', token);
- put(this.contactNode, '!');
- this._getResetMethods();
- this._requestTokenButton.set('disabled', true);
- put(this.tokenNode, '.dijitHidden');
- put(this.newPasswordNode, '!hide-step');
- }
- },
-
- start: function() {
- this._createTitle();
- this._createContent();
- }
- };
-});
--- a/management/univention-self-service/js/ucs/setcontactinformation.js
+++ a/management/univention-self-service/js/ucs/setcontactinformation.js
@@ -1,300 +0,0 @@
-/*
- * Copyright 2015-2016 Univention GmbH
- *
- * http://www.univention.de/
- *
- * All rights reserved.
- *
- * The source code of this program is made available
- * under the terms of the GNU Affero General Public License version 3
- * (GNU AGPL V3) as published by the Free Software Foundation.
- *
- * Binary versions of this program provided by Univention to you as
- * well as other copyrighted, protected or trademarked materials like
- * Logos, graphics, fonts, specific documentations and configurations,
- * cryptographic keys etc. are subject to a license agreement between
- * you and Univention and not subject to the GNU AGPL V3.
- *
- * In the case you use this program under the terms of the GNU AGPL V3,
- * the program is provided in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License with the Debian GNU/Linux or Univention distribution in file
- * /usr/share/common-licenses/AGPL-3; if not, see
- * .
- */
-/*global define require console window */
-
-define([
- "dojo/_base/lang",
- "dojo/_base/array",
- "dojo/on",
- "dojo/keys",
- "dojo/dom",
- "dojo/json",
- "dojo/request/xhr",
- "dijit/form/Button",
- "put-selector/put",
- "./ContainerWidget",
- "./LabelPane",
- "./TextBox",
- "./RadioButton",
- "./lib",
- "./i18n!."
-], function(lang, array, on, keys, dom, json, xhr, Button, put, ContainerWidget, LabelPane, TextBox, RadioButton, lib, _) {
-
- return {
- selectedTokenMethod: null,
-
- _createTitle: function() {
- var title = _('Contact information for Password reset');
- var siteDescription = _('On this page you can set your contact information to reset your password in the future. During the reset process a token is sent to you. Without contact information it is not possible to reset your password.');
- document.title = title;
- var titleNode = dom.byId('title');
- put(titleNode, 'h1', title);
- put(titleNode, 'p', siteDescription);
- put(titleNode, '!.dijitHidden');
- },
-
- _createContent: function() {
- var contentNode = dom.byId('content');
- var formNode = this._getFormNode();
- put(formNode, '[id=form].step!dijitHidden');
- put(contentNode, formNode);
- },
-
- _getFormNode: function() {
- var formNode = put('div[style="overflow: hidden;"]');
-
- // step 1 username and password
- this.usernameNode = put(formNode, 'div.step');
- put(this.usernameNode, 'p > b', _('Please enter your username and password to display your contact information.'));
- var stepContent = put(this.usernameNode, 'div.stepContent');
-
- this._username = new TextBox({
- label: _('Username'),
- 'class': 'doubleLabelPane left',
- isValid: function() {
- return !!this.get('value');
- },
- required: true
- });
- this._username.on('keyup', lang.hitch(this, function(evt) {
- if (evt.keyCode === keys.ENTER) {
- this._getContactInformation();
- }
- }));
- put(stepContent, this._username.label.domNode);
- this._username.startup();
-
- this._password = new TextBox({
- label: _('Password'),
- 'class': 'doubleLabelPane',
- isValid: function() {
- return !!this.get('value');
- },
- required: true,
- type: 'password'
- });
- this._password.on('keyup', lang.hitch(this, function(evt) {
- if (evt.keyCode === keys.ENTER) {
- this._getContactInformation();
- }
- }));
- put(stepContent, this._password.label.domNode);
- this._password.startup();
-
- this._showContactInformationButton = new Button({
- label: _('Next'),
- onClick: lang.hitch(this, '_getContactInformation')
- });
- put(stepContent, this._showContactInformationButton.domNode);
-
- // step 2 show and set contact information
- this.contactInformationNode = put(formNode, 'div.step.hide-step');
- put(this.contactInformationNode, 'p', _('Feel free to change your contact information. Press "Save" to confirm your changes.'));
- stepContent = put(this.contactInformationNode, 'div.stepContent');
-
- this._email = new TextBox({
- label: _('EMail'),
- 'class': 'doubleLabelPane left',
- id: 'email'
- });
- this._email.on('keyup', lang.hitch(this, function(evt) {
- if (evt.keyCode === keys.ENTER) {
- this._setContactInformation();
- }
- }));
- put(stepContent, this._email.label.domNode);
-
- this._mobile = new TextBox({
- label: _('Mobile'),
- 'class': 'doubleLabelPane',
- id: 'mobile'
- });
- this._mobile.on('keyup', lang.hitch(this, function(evt) {
- if (evt.keyCode === keys.ENTER) {
- this._setContactInformation();
- }
- }));
- put(stepContent, this._mobile.label.domNode);
-
- this._saveButton = new Button({
- label: _('Save'),
- onClick: lang.hitch(this, '_setContactInformation')
- });
- put(stepContent, this._saveButton.domNode);
-
- this._cancelButton = new Button({
- label: _('Cancel'),
- onClick: lang.hitch(this, '_deleteContactInformationNode')
- });
- put(stepContent, this._cancelButton.domNode);
-
- return formNode;
- },
-
- _getContactInformation: function() {
- this._username.set('disabled', true);
- this._password.set('disabled', true);
- this._showContactInformationButton.set('disabled', true);
-
- var validCredentials = this._username.isValid() && this._password.isValid();
- if (validCredentials) {
- data = json.stringify({
- 'username': this._username.get('value'),
- 'password': this._password.get('value')
- });
- xhr.post('passwordreset/get_contact', {
- handleAs: 'json',
- headers: {
- 'Content-Type': 'application/json',
- 'Accept-Language': lib.getQuery('lang') || 'en-US'
- },
- data: data
- }).then(lang.hitch(this, function(data) {
- lib._removeMessage();
- put(this._showContactInformationButton.domNode, '.dijitHidden');
- this._displayContactInformation(data.result);
- }), lang.hitch(this, function(err){
- var message = err.name + ": " + err.message;
- if (err.response && err.response.data && err.response.data.message) {
- message = err.response.data.message;
- }
- lib.showMessage({
- content: message,
- targetNode: this.usernameNode,
- 'class': '.error'
- });
- this._showContactInformationButton.set('disabled', false);
- this._username.set('disabled', false);
- this._password.set('disabled', false);
- }));
- } else {
- this._showContactInformationButton.set('disabled', false);
- this._username.set('disabled', false);
- this._password.set('disabled', false);
- }
- },
-
- _displayContactInformation: function(contactInformation) {
- var mappingIdAndInput = {
- 'email': this._email,
- 'mobile': this._mobile
- };
-
- array.forEach(contactInformation, lang.hitch(this, function(contact){
- var currentInput = mappingIdAndInput[contact.id];
- if (currentInput) {
- currentInput.set('value', contact.value);
- //currentInput._updateInlineLabelVisibility();
- }
- }));
- put(this.contactInformationNode, '!hide-step');
- },
-
- _setContactInformation: function() {
- this._cancelButton.set('disabled', true);
- this._saveButton.set('disabled', true);
-
- data = this._getNewContactInformation();
- var isValidMail = this._validateMail(data.email);
- if (isValidMail) {
- xhr.post('passwordreset/set_contact', {
- handleAs: 'json',
- headers: {
- 'Content-Type': 'application/json',
- 'Accept-Language': lib.getQuery('lang') || 'en-US'
- },
- data: json.stringify(data)
- }).then(lang.hitch(this, function(data) {
- lib._removeMessage();
- var callback = function() {
- lib.showLastMessage({
- content: data.message,
- 'class': '.success'
- });
- };
- lib.wipeOutNode({
- node: dom.byId('form'),
- callback: callback
- });
- }), lang.hitch(this, function(err){
- var message = err.name + ": " + err.message;
- if (err.response && err.response.data && err.response.data.message) {
- message = err.response.data.message;
- }
- lib.showMessage({
- content: message,
- targetNode: this.contactInformationNode,
- 'class': '.error'
- });
- this._cancelButton.set('disabled', false);
- this._saveButton.set('disabled', false);
- }));
- } else {
- this._cancelButton.set('disabled', false);
- this._saveButton.set('disabled', false);
- }
- },
-
- _getNewContactInformation: function() {
- var contactInformation = {
- 'username': this._username.get('value'),
- 'password': this._password.get('value'),
- 'email': this._email.get('value'),
- 'mobile': this._mobile.get('value')
- };
- return contactInformation;
- },
-
- _validateMail: function(email) {
- var reg = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
- var isValid = !email.length || reg.test(email);
- if(!isValid) {
- lib.showMessage({
- content: _('Please enter a valid email address.'),
- 'class': '.error',
- targetNode: this.contactInformationNode
- });
- }
- return isValid;
- },
-
- _deleteContactInformationNode: function() {
- put(this.contactInformationNode, '.hide-step');
- put(this._showContactInformationButton.domNode, '!dijitHidden');
- this._showContactInformationButton.set('disabled', false);
- this._username.reset();
- this._password.reset();
- },
-
- start: function() {
- this._createTitle();
- this._createContent();
- }
- };
-});
--- a/management/univention-self-service/www/index.html
+++ a/management/univention-self-service/www/index.html
@@ -4,7 +4,7 @@
-
+ Password Settings
@@ -16,17 +16,20 @@