fix login and redirect links for forms without anonymous answers
This commit is contained in:
parent
d35a499fc7
commit
62761c903c
1 changed files with 11 additions and 1 deletions
|
@ -2512,6 +2512,16 @@ define([
|
|||
}
|
||||
};
|
||||
|
||||
var showAnonBlockedAlert = function () {
|
||||
var content = UI.setHTML(h('span.cp-anon-blocked-msg'), Messages.form_anonymous_blocked);
|
||||
$(content).find('a').click(function (ev) {
|
||||
ev.preventDefault();
|
||||
var href = ($(this).attr('href') || '').replace(/\//g, '');
|
||||
APP.common.setLoginRedirect(href || 'login');
|
||||
});
|
||||
UI.alert(content);
|
||||
};
|
||||
|
||||
framework.onReady(function () {
|
||||
var priv = metadataMgr.getPrivateData();
|
||||
|
||||
|
@ -2581,7 +2591,7 @@ define([
|
|||
|
||||
var loggedIn = framework._.sfCommon.isLoggedIn();
|
||||
if (!loggedIn && !content.answers.anonymous) {
|
||||
UI.alert(Messages.form_anonymous_blocked);
|
||||
showAnonBlockedAlert();
|
||||
}
|
||||
|
||||
// If the results are public and there is at least one doodle, fetch the results now
|
||||
|
|
Loading…
Reference in a new issue