Fix #48 : Display warning before installing an app on domain root (/)

This commit is contained in:
opi 2014-09-04 14:54:43 +02:00
parent 92b6cd0c0f
commit 17bbb55545

View file

@ -872,6 +872,8 @@ app = Sammy('#main', function (sam) {
});
sam.post('#/apps', function(c) {
// Warn admin if app is going to be installed on domain root.
if (c.params['path'] !== '/' || confirm(y18n.t('confirm_install_domain_root', [c.params['domain']]))) {
params = { 'label': c.params['label'], 'app': c.params['app'] }
delete c.params['label'];
delete c.params['app'];
@ -884,6 +886,12 @@ app = Sammy('#main', function (sam) {
c.api('/apps', function() { // http://api.yunohost.org/#!/app/app_install_post_2
c.redirect('#/apps');
}, 'POST', params);
}
else {
c.flash('warning', y18n.t('app_install_cancel'));
store.clear('slide');
c.redirect('#/apps/install');
}
});
// Install custom app from github