Panel bugfixes

This commit is contained in:
Kload 2013-10-23 11:01:14 +00:00
parent 418ae04571
commit f9547b6dc8
3 changed files with 36 additions and 53 deletions

View file

@ -130,7 +130,10 @@ end
function set_headers (user) function set_headers (user)
user = user or ngx.var.cookie_SSOwAuthUser user = user or ngx.var.cookie_SSOwAuthUser
if not cache[user] or not cache[user]["mail"] then if not cache[user] then
cache[user] = {}
end
if not cache[user]["mail"] then
ldap = lualdap.open_simple("localhost") ldap = lualdap.open_simple("localhost")
for dn, attribs in ldap:search { for dn, attribs in ldap:search {
base = "uid=".. user ..",ou=users,dc=yunohost,dc=org", base = "uid=".. user ..",ou=users,dc=yunohost,dc=org",

View file

@ -1,20 +1 @@
{ {}
"portal_scheme": "https",
"portal_domain": "mydomain.com",
"portal_path": "/ssowat/",
"domains": [
"mydomain.com",
"myotherdomain.com"
],
"skipped_urls": [
"mydomain.com/megusta",
"myotherdomain.com/somuchwin"
],
"unprotected_urls": ["mydomain.com/yunoprotect"],
"additional_headers": {
"Auth-User": "uid",
"Remote-User": "uid",
"Email": "mail",
"Name": "cn"
}
}

View file

@ -20,6 +20,8 @@ var ynh = {};
ynh.jquery = jQuery.noConflict(); ynh.jquery = jQuery.noConflict();
(function( $ ) { (function( $ ) {
preventFire = false;
preventRefire = false;
function datScroll(to) { function datScroll(to) {
preventRefire = true; preventRefire = true;
$("body,html").animate({scrollTop:to}, '100', 'swing', function() { $("body,html").animate({scrollTop:to}, '100', 'swing', function() {
@ -30,15 +32,15 @@ ynh.jquery = jQuery.noConflict();
$("#ynhtoggle").removeClass("ynhopen"); $("#ynhtoggle").removeClass("ynhopen");
} }
preventRefire = false; preventRefire = false;
}, 300); }, 200);
}); });
} }
preventRefire = false;
function checkScroll (direction) { function checkScroll (direction) {
if(preventRefire) return; if(preventRefire) return;
if((direction == "top") && ($("body").scrollTop() == 107 || $("html").scrollTop() == 107) && $("#ynhtoggle.ynhopen").length == 0) { if((direction == "top") && ($("body").scrollTop() == 107 || $("html").scrollTop() == 107) && $("#ynhtoggle.ynhopen").length == 0) {
if(preventFire) return;
datScroll(0); datScroll(0);
} else if((direction == "bottom") && $("#ynhtoggle.ynhopen").length > 0) { } else if((direction == "bottom") && $("#ynhtoggle.ynhopen").length > 0) {
datScroll(h); datScroll(h);
@ -46,42 +48,39 @@ ynh.jquery = jQuery.noConflict();
} }
$( document ).ready(function($) { $( document ).ready(function($) {
scroll = $("body").scrollTop();
h = 107; h = 107;
$("#glu").load(function() {
setTimeout(function() {
$('body').children().filter(function() { $('body').children().filter(function() {
return $(this).css("position") === 'absolute' || $(this).css("position") === 'fixed'; return $(this).css("position") === 'absolute' || $(this).css("position") === 'fixed';
}).css({top: function(index, value) { }).css({top: function(index, value) {
return parseFloat(value) + h + 3; return parseFloat(value) + h + 3;
}}); }});
if ($(window).height() > $("html").height()) {
alert('moualé');
$("html").css('min-height', $(window).height() + h );
}
$("body").append('<div id="ynhtopbar"><div id="ynhtoggle" class="ynhopen">YunoHost</div></div>'); $("body").append('<div id="ynhtopbar"><div id="ynhtoggle" class="ynhopen">YunoHost</div></div>');
$("body").css({marginTop: function(index, value) { $("body").css({marginTop: function(index, value) {
return parseFloat(value) + h + 3; return parseFloat(value) + h + 3;
}}); }});
if (scroll == 0) { if ($("body").scrollTop() == 0) {
$("body,html").animate({scrollTop:h}, '100', 'swing', function() { $("body,html").scrollTop(h);
setTimeout(function() {
$("#ynhtoggle").removeClass("ynhopen"); $("#ynhtoggle").removeClass("ynhopen");
}, 300);
//window.scrollTo(0, h);
});
} }
$("#ynhtoggle").on("click", function() { $("#ynhtoggle").on("click", function() {
if ($("body").scrollTop() == 0 && $("html").scrollTop() == 0) { preventFire = false;
datScroll(h);
} else {
datScroll(0);
}
});
$("#glu").load(function() {
$( $(this)[0].contentWindow ).bind("DOMMouseScroll mousewheel scroll", function(event) {
if (event.currentTarget.scrollY > 0) {
checkScroll("bottom"); checkScroll("bottom");
checkScroll("top");
});
}, 10);
$( $(this)[0].contentWindow ).bind("DOMMouseScroll mousewheel scroll", function(event) {
if ((event.type == "DOMMouseScroll" && event.originalEvent.detail > 0)
|| (event.type == "mousewheel" && event.originalEvent.wheelDeltaY < 0)
|| event.currentTarget.scrollY > 0 ) {
checkScroll("bottom");
preventFire = true;
} else { } else {
setTimeout(function() { preventFire = false; }, 200);
checkScroll("top"); checkScroll("top");
} }
}); });