Skip to content
Extraits de code Groupes Projets
Valider c79bec81 rédigé par Stefan Giehl's avatar Stefan Giehl Validation de GitHub
Parcourir les fichiers

Show confirmation before giving view access to anonymous user (#11744)

* Show confirmation before giving view access to anonymous user

* Remove unneeded usage of raw template filter
parent 33a1a566
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -133,7 +133,15 @@ ...@@ -133,7 +133,15 @@
if (idSites === 'all') { if (idSites === 'all') {
setViewAccessForUserToAllWebsitesIfUserConfirms(userLogin); setViewAccessForUserToAllWebsitesIfUserConfirms(userLogin);
} else { } else {
setViewAccessForUserIfNotAlreadyHasAccess(userLogin, idSites); function onValidate() {
setViewAccessForUserIfNotAlreadyHasAccess(userLogin, idSites);
}
if (userLogin == 'anonymous') {
piwikHelper.modalConfirm('#confirmAnonymousAccess', {yes: onValidate, no: hideLoading})
} else {
onValidate();
}
} }
} }
......
...@@ -104,19 +104,22 @@ ...@@ -104,19 +104,22 @@
} }
} }
if (this.site.id == 'all') { function onValidate() {
launchAjaxRequest(login, access).then(successCallback);
}
if (login == 'anonymous' && access == 'view') {
piwikHelper.modalConfirm('#confirmAnonymousAccess', {yes: onValidate})
}
else if (this.site.id == 'all') {
//ask confirmation //ask confirmation
$('#confirm').find('.login').text(login); $('#confirm').find('.login').text(login);
function onValidate() {
launchAjaxRequest(login, access).then(successCallback);
}
piwikHelper.modalConfirm('#confirm', {yes: onValidate}) piwikHelper.modalConfirm('#confirm', {yes: onValidate})
} }
else { else {
launchAjaxRequest(login, access).then(successCallback); onValidate();
} }
} }
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"AddUser": "Add a new user", "AddUser": "Add a new user",
"Alias": "Alias", "Alias": "Alias",
"AllWebsites": "All websites", "AllWebsites": "All websites",
"AnonymousAccessConfirmation": "You are about to grant the anonymous user the 'view' access to this website. This means your analytics reports and your visitors information will be publicly viewable by anyone even without a login. Are you sure you want to proceed?",
"AnonymousUser": "Anonymous user", "AnonymousUser": "Anonymous user",
"AnonymousUserHasViewAccess": "Note: the %1$s user has %2$s access to this website.", "AnonymousUserHasViewAccess": "Note: the %1$s user has %2$s access to this website.",
"AnonymousUserHasViewAccess2": "Your analytics reports and your visitors information are publicly viewable.", "AnonymousUserHasViewAccess2": "Your analytics reports and your visitors information are publicly viewable.",
......
...@@ -162,6 +162,12 @@ ...@@ -162,6 +162,12 @@
<input role="no" type="button" value="{{ 'General_No'|translate }}"/> <input role="no" type="button" value="{{ 'General_No'|translate }}"/>
</div> </div>
<div class="ui-confirm" id="confirmAnonymousAccess">
<h2>{{ 'UsersManager_AnonymousAccessConfirmation'|translate }}</h2>
<input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
<input role="no" type="button" value="{{ 'General_No'|translate }}"/>
</div>
{% if userIsSuperUser %} {% if userIsSuperUser %}
<div piwik-content-block content-title="{{ 'UsersManager_UsersManagement'|translate|e('html_attr') }}"> <div piwik-content-block content-title="{{ 'UsersManager_UsersManagement'|translate|e('html_attr') }}">
<div class="ui-confirm" id="confirmUserRemove"> <div class="ui-confirm" id="confirmUserRemove">
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter