From 6dee99ea12bb3b536b320f57be5991c321f3665c Mon Sep 17 00:00:00 2001 From: Potsky Date: Tue, 23 Dec 2014 13:50:22 +0100 Subject: [PATCH] grunt install from branch dev commit 82a1a75 --- cfg/apache.config.php | 2 +- cfg/apache.paths.php | 2 +- cfg/config.example.php | 2 +- cfg/iis.config.php | 2 +- cfg/iis.paths.php | 2 +- cfg/nginx.config.php | 2 +- cfg/nginx.paths.php | 2 +- cfg/php.config.php | 2 +- cfg/php.paths.php | 2 +- cfg/pimpmylog.config.php | 2 +- cfg/softwares.inc.php | 2 +- composer.json | 2 +- css/config.inc.css | 2 +- inc/configure.php | 2 +- inc/error.inc.php | 2 +- inc/favicon.inc.php | 2 +- inc/getlog.pml.php | 2 +- inc/global.inc.php | 2 +- inc/login.inc.php | 2 +- inc/rss.php | 2 +- inc/rss.pml.php | 2 +- inc/test.php | 2 +- inc/upgrade.pml.php | 2 +- inc/users.pml.php | 2 +- index.php | 2 +- js/configure.min.js | 2 +- js/login.min.js | 2 +- js/main.min.js | 4 ++-- js/pml.min.js | 2 +- js/test.min.js | 2 +- version.js | 12 +++++++++--- 31 files changed, 40 insertions(+), 34 deletions(-) diff --git a/cfg/apache.config.php b/cfg/apache.config.php index 1e187642..16e919ed 100644 --- a/cfg/apache.config.php +++ b/cfg/apache.config.php @@ -1,5 +1,5 @@ ';return c===!0&&(d+=''),d+=b,d+=""}$(function(){"use strict";$("#changeLogModal").on("show.bs.modal",function(){$.ajax({url:"version.js?local=true&callback=?",type:"GET",dataType:"jsonp",jsonp:"pml_version_cb"}).done(function(){}).fail(function(){}).always(function(){})})});var pml_version_cb=function(a){"use strict";var b={fixed:{name:"Fixed","class":"success"},"new":{name:"New","class":"warning"},changed:{name:"Changed","class":"info"}},c='
Star me on Github if you me!
';for(var d in a.changelog){c+='
',c+='
',c+='

',c+=" Version "+d+"",c+=void 0!==a.changelog[d].released?" - released on "+a.changelog[d].released:"",c+="

",c+="
",c+='
',void 0!==a.changelog[d].notice&&(c+='
'+a.changelog[d].notice+"

");for(var e in b)if(void 0!==a.changelog[d][e])for(var f in a.changelog[d][e]){var g=a.changelog[d][e][f].replace(/#([0-9]+)/g,'#$1');c+='
'+b[e].name+'
'+g+"
"}c+="
",c+="
",c+="
"}c+='Congrats, you have read the full change log. Here is a for you!',$("#changeLogModal .modal-body").html(c)},type_parser=function(a){"use strict";var b="txt",c="",d=0;if(void 0!==a){var e=a.split("/");void 0!==e[1]?(d=parseInt(a.split("/").slice(-1),10),b=a.split("/").slice(0,-1).join("/")):b=a,e=b.split(":"),void 0!==e[1]&&(c=b.split(":").slice(1).join(":"),b=e[0])}return{parser:b,param:c,cut:d}},val_cut=function(a,b){"use strict";return void 0===b?a:0===b?a:a.length<=Math.abs(b)?a:b>0?a.substr(0,b)+"…":"…"+a.substr(b)},get_logs=function(load_default_values,load_full_file,load_from_get,load_more){"use strict";var wanted_lines;if($(".loadmore").button("loading"),null!==auto_refresh_timer&&(clearTimeout(auto_refresh_timer),auto_refresh_timer=null),load_default_values===!0){if(load_from_get===!0){var found;set_notification("true"===query_parameters.n?!0:"false"===query_parameters.n?!1:files[file].notify),found=files[file].max,void 0!==typeof query_parameters.m&&$("#max option").each(function(){this.value===query_parameters.m&&(found=query_parameters.m)}),set_max(found),found=files[file].refresh,void 0!==typeof query_parameters.r&&$("#autorefresh option").each(function(){this.value===query_parameters.r&&(found=query_parameters.r)}),set_auto_refresh(found),set_columns(void 0!==query_parameters.t?query_parameters.t.split(","):files[file].thinit),sort=void 0!==query_parameters.o?query_parameters.o:files[file].sort,sorto=void 0!==query_parameters.p?query_parameters.p:files[file].order}else set_max(files[file].max),set_auto_refresh(files[file].refresh),set_notification(files[file].notify),set_columns(files[file].thinit),sort=files[file].sort;files[file].export===!1?($("#export").hide(),$("#noexport").show()):export_default!==!1||files[file].export?($("#noexport").hide(),$("#export").show()):($("#export").hide(),$("#noexport").show()),load_full_file=!0}else load_default_values=!1;reload_page(!0),load_full_file===!0?(reset=1,file_size=0,load_more=!1,last_line="",has_loaded_more=!1):(reset=0,load_full_file=!1),$(".loader").toggle(),loading=!0,wanted_lines=$("#max").val();var post_values={ldv:load_default_values,file:file,filesize:file_size,max:wanted_lines,search:$("#search").val(),csrf_token:csrf_token,lastline:last_line,reset:reset};load_more===!0&&(post_values.sp=get_top_offset(),has_loaded_more=!0),$.ajax({url:"inc/getlog.pml.php?"+(new Date).getTime()+"&"+querystring,data:post_values,type:"POST",dataType:"json"}).fail(function(a){return $(".loader").toggle(),loading=!1,a.responseText.indexOf("Pimp My Log Login Match")>-1?(notify("Pimp my Logs ["+files[file].display+"]",lemma.youhavebeendisconnected),void document.location.reload()):a.error?($(".result").hide(),$("#error").show(),$("#errortxt").html(a.responseText),void notify("Pimp my Logs ["+files[file].display+"]",lemma.error)):void 0}).done(function(logs){if($(".loader").toggle(),loading=!1,logs.lastline&&(last_line=logs.lastline,file_size=logs.newfilesize),logs.error)return $(".result").hide(),$("#error").show(),$("#errortxt").html(logs.error),void notify(notification_title.replace("%i",file).replace("%f",files[file].display),lemma.error);if(logs.warning&&pml_alert(logs.warning,"warning"),logs.notice&&pml_alert(logs.notice,"info"),logs.singlewarning&&pml_singlealert(logs.singlewarning,"warning"),logs.singlenotice&&pml_singlealert(logs.singlenotice,"info"),$("#error").hide(),$(".result").show(),logs.full)if(logs.found===!1){var nolog=lemma.no_log;""!==logs.search&&(nolog=logs.regsearch?lemma.search_no_regex.replace("%s",""+logs.search+""):lemma.search_no_regular.replace("%s",""+logs.search+"")),$("#nolog").html(nolog).show(),$("#logshead").hide()}else $("#nolog").text("").hide(),$("#logshead").show();else logs.logs&&($("#nolog").text("").hide(),$("#logshead").show());if(logs.regsearch?($("#searchctn").addClass("has-success"),$("#searchctn").prop("title",lemma.regex_valid)):($("#searchctn").removeClass("has-success"),$("#searchctn").prop("title",lemma.regex_invalid)),logs.headers){$("#logshead").text(""),$(".thmenucol").remove();var thtr=$("").addClass(file);sorto=1===parseInt(sorto,10)?1:-1;var sortn=-1;for(var h in logs.headers){$(".thmenuicon").removeClass("text-danger");var ic="";if(sort===h){sortn=-1*sorto;var q=1===sorto?"up":"down";ic=' '}var a=$('"+logs.headers[h]+ic+"").addClass(h).appendTo(thtr),f;is_column_displayed(h)?f="on":($(a).hide(),f="off"),$('
  • '+logs.headers[h]+"
  • ").appendTo(".thmenu")}thtr.appendTo("#logshead"),set_column_icon(),$(".thmenuitem").click(function(a){a.stopPropagation(),$(this).hasClass("thmenuon")?remove_column($(this).attr("data-h")):add_column($(this).attr("data-h"))})}logs.full&&$("#logsbody").text(""),void 0!==logs.logs&&$("#logsbody tr").removeClass("newlog");var uaparser=new UAParser,rowidx=0,rows=[];for(var log in logs.logs){var tr=$("").addClass(file).data("log",logs.logs[log].pml).data("offset",logs.logs[log].pmlo);for(var c in logs.logs[log])if("pml"!==c&&"pmlo"!==c&&"pmld"!==c){var type=type_parser(files[file].format.types[c]),val=logs.logs[log][c],title=val,output_html=!0;if("-"===val&&(val=""),"uaw3c"===type.parser&&(type.parser="ua",val=val.replace(/\+/g," ")),"badge"===type.parser){var clas;"http"===type.param?clas=badges[type.param][logs.logs[log][c].substr(0,1)]:"severity"===type.param&&(clas=badges[type.param][logs.logs[log][c].toLowerCase()],void 0===clas&&(clas=badges[type.param][logs.logs[log][c]])),void 0===clas&&(clas="default"),val=''+val_cut(val,type.cut)+""}else if("date"===type.parser)title=logs.logs[log].pml,val=val_cut(val,type.cut);else if("numeral"===type.parser)""!==val&&""!==type.param&&(val=numeral(val).format(type.param));else if("ip"===type.parser)val="geo"===type.param?''+val_cut(val,type.cut)+"":''+val_cut(val,type.cut)+"";else if("link"===type.parser)val=''+val_cut(val,type.cut)+"";else if("ua"===type.parser){var ua=uaparser.setUA(val).getResult(),uas=type.param.match(/\{[a-zA-Z.]*\}/g),uaf=!1;for(var k in uas){var d;try{d=eval("ua."+uas[k].replace("{","").replace("}","")),void 0===d&&(d="")}catch(e){d=""}""!==d&&(uaf=!0,type.param=type.param.replace(uas[k],d))}uaf===!0&&(val=$.trim(type.param))}else"preformatted"===type.parser?(val=val_cut(val.replace(/(?:\\r\\n|\\r|\\n)/g,"\n").replace(/\\t/g," "),type.cut),output_html=!1):"prefake"===type.parser?val=val_cut(val.replace(/(?:\r\n|\r|\n)/g,"
    "),type.cut):(val=val_cut(val,type.cut),output_html=!1);var b=output_html===!0?$("").html(val):$("").text(val);b=b.prop("title",title).addClass("pml-"+c+" pml-"+type.parser).appendTo(tr),is_column_displayed(c)||$(b).hide()}logs.full||(tr.addClass("newlog"),rowidx++),rows.push(tr)}if(logs.full||load_more===!0)$("#logsbody").append(rows);else if($("#logsbody").prepend(rows),has_loaded_more!==!0){var rowd=$("#logsbody tr").length;rowd>wanted_lines&&(rowd-=wanted_lines,$("#logsbody").find("tr:nth-last-child(-n+"+rowd+")").remove())}var older_line_offset=get_top_offset();if(1>=older_line_offset||""!==logs.search&&parseInt(logs.lpo,10)<=1?$(".loadmore").text($(".loadmore").data("nomore-text")).addClass("disabled").prop("disabled","disabled").attr("title",""):$(".loadmore").button("reset").attr("title",sprintf(lemma.loadmore,numeral(older_line_offset).format("0 b"))),void 0!==sort){var i=0,col=-1;if($("#logshead tr th").each(function(){$(this).hasClass(sort)&&(col=i),i++}),col>=0){var tbody=document.getElementById("logsbody"),trs=Array.prototype.slice.call(tbody.rows,0);for(trs=trs.sort(function(a,b){return a=a.cells[col].getAttribute("title"),b=b.cells[col].getAttribute("title"),$.isNumeric(a)&&$.isNumeric(b)?sorto*(parseFloat(a)-parseFloat(b)):sorto*a.toLowerCase().localeCompare(b.toLowerCase())}),i=0;i1&&(rowct=lemma.display_nlogs.replace("%s",rowc)+" "),$("#footer").html(rowct+logs.footer),first_launch===!1&&(logs.full?logs.fingerprint!==fingerprint&&(notify(notification_title.replace("%i",file).replace("%f",files[file].display),lemma.new_logs),fingerprint=logs.fingerprint):1===rowidx?notify(notification_title.replace("%i",file).replace("%f",files[file].display),lemma.new_log):rowidx>1&¬ify(notification_title.replace("%i",file).replace("%f",files[file].display),lemma.new_nlogs.replace("%s",rowidx))),first_launch=!1;var p=Math.max(0,parseInt($("#autorefresh").val(),10));p>0&&(auto_refresh_timer=setTimeout(function(){get_logs()},1e3*p))}).always(function(){})},notification_class="warning",set_notification=function(a){"use strict";void 0===a&&(a=notification),a===!0?($("#notification").removeClass("btn-warning btn-success btn-danger btn-default").addClass("active btn-"+notification_class),notification=!0):($("#notification").removeClass("btn-warning btn-success btn-danger active").addClass("btn-default"),notification=!1)},is_notification=function(){"use strict";return $("#notification").hasClass("active")},notify=function(a,b){"use strict";if("webkitNotifications"in window){var c=window.webkitNotifications.checkPermission();if(0===c){if(notification_class="success",set_notification(),notification===!0&&void 0!==a&¬ification_displayed===!1){notification_displayed=!0;var d=window.webkitNotifications.createNotification("img/icon72.png",a,b);d.onclick=function(){window.focus(),d.close()},d.onclose=function(){notification_displayed=!1},d.show(),setTimeout(function(){try{d.close()}catch(a){}},5e3)}}else 2===c?(notification_class="danger",set_notification()):(notification_class="warning",set_notification(),window.webkitNotifications.requestPermission(function(){notify(a,b)}))}else if("Notification"in window)if("default"===window.Notification.permission)notification_class="warning",set_notification(),window.Notification.requestPermission(function(){notify(a,b)});else if("granted"===window.Notification.permission){if(notification_class="success",set_notification(),notification===!0&&void 0!==a&¬ification_displayed===!1){notification_displayed=!0;var e=new window.Notification(a,{body:b,tag:"Pimp My Log"});e.onclick=function(){this.close()},e.onclose=function(){notification_displayed=!1}}}else if("denied"===window.Notification.permission)return notification_class="danger",void set_notification()},refresh_rss=function(){$("#exModalRefresh").button("loading"),$.ajax({url:$("#exModalUrl").text(),dataType:"text",success:function(a){$("#exModalRefresh").button("reset"),$("#exModalCtn").text(a)}})},get_rss=function(a){return $("#exModalResultLoading").show(),$("#exModalResult").hide(),$("#exModalRefresh").button("loading"),$.ajax({url:"inc/rss.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"get_rss_link",file:file,search:$("#search").val(),format:a}}).always(function(){}).fail(function(a){$("#prBody").html(get_alert("danger",c.message+"
    "+a.responseText,!1))}).done(function(b){b.singlewarning?pml_singlealert(b.singlewarning,"warning"):b.singlenotice?pml_singlealert(b.singlenotice,"info"):b.error?pml_singlealert(b.error,"danger"):"if"===b.met?document.body.innerHTML+="":("nd"===b.met?($("#exModalResultLoading").hide(),$("#exModalResult").hide(),$("#exModalRefresh").button("reset")):$.ajax({url:b.url,dataType:"text",success:function(a){$("#exModalCtn").text(a),$("#exModalResultLoading").hide(),$("#exModalResult").show(),$("#exModalRefresh").button("reset")}}),$("#exModalFormat").text(a),$("#exModalUrl").text(b.url),b.war===!1?$("#exModalWar").hide():$("#exModalWar").show(),$("#exModalOpen").attr("href",b.url),$("#exModal").modal("show"))}),!1};$(function(){"use strict";$("#prModal").on("show.bs.modal",function(){a()});var a=function(a,b,c){return $("#prAlert").html(void 0!==a?get_alert(a,b,c):""),$("#prBody").html(''),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"profile_get"}}).always(function(){}).fail(function(a){$("#prBody").html(get_alert("danger",a.responseText,!1))}).done(function(a){$("#prBody").html(a.singlewarning?get_alert("warning",a.singlewarning,!1):a.singlenotice?get_alert("info",a.singlenotice,!1):a.error?get_alert("danger",a.error,!1):a.b)}),!1};$("#prForm").on("submit",function(a){return b(),a.preventDefault(),!1});var b=function(){$("#prSave").button("loading");var b={csrf_token:csrf_token,action:"profile_save"};return $.each($("#prForm").serializeArray(),function(a,c){b[c.name]=c.value}),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:b}).always(function(){$("#prSave").button("reset")}).fail(function(a){$("#prAlert").html(get_alert("danger",a.responseText,!1))}).done(function(b){return b.singlewarning?($("#prBody").html(get_alert("warning",b.singlewarning,!1)),!1):b.singlenotice?($("#prBody").html(get_alert("info",b.singlenotice,!1)),!1):b.error?($("#prBody").html(get_alert("danger",b.error,!1)),!1):(a("success",lemma.profile_ok,!0),!1)}),!1};$("#cpModal").on("show.bs.modal",function(){$("#cpErr").hide(),$("#password1group").removeClass("has-error"),$("#password2group").removeClass("has-error"),$("#password3group").removeClass("has-error"),$("#cpSave").button("reset"),$("#password1").val(""),$("#password2").val(""),$("#password3").val("")}),$("#changepassword").on("submit",function(a){return $("#password1group").removeClass("has-error"),$("#password2group").removeClass("has-error"),$("#password3group").removeClass("has-error"),$("#cpErr").hide(),$("#cpSave").button("loading"),$("#cpErr").hide(),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{password1:$("#password1").val(),password2:$("#password2").val(),password3:$("#password3").val(),csrf_token:csrf_token,action:"change_password"}}).always(function(){$("#cpSave").button("reset")}).fail(function(a){$("#cpErrM").html(a.responseText).show(),$("#cpErr").show()}).done(function(a){if(a.singlewarning)$("#cpErr").html(get_alert("warning",a.singlewarning,!1)).show();else if(a.singlenotice)$("#cpErr").html(get_alert("info",a.singlenotice,!1)).show();else if(a.error)$("#cpErr").html(get_alert("danger",a.error,!1)).show();else if(a.ok)$("#notice").html(get_alert("success",a.ok,!0)),$("#cpModal").modal("hide");else if(a.errors){$("#cpErrUl").html("");for(var b in a.errors)$("#cpErrUl").append("
  • "+a.errors[b]+"
  • ");for(var b in a.fields)$("#"+a.fields[b]+"group").addClass("has-error");$("#cpErr").show()}}),a.preventDefault(),!1}),$("#umModal").on("show.bs.modal",function(){users_load($("#usermanagement div.tab-pane.active").attr("id"))}),$('#usermanagement a[data-toggle="pill"]').on("shown.bs.tab",function(a){users_load($(a.target).attr("href"))}),$(".roles-user").click(function(){$(this).parent().find("label.roles-admin").removeClass("btn-danger").addClass("btn-default"),$(this).parent().find("label.roles-user").addClass("btn-primary"),$(this).parent().parent().parent().parent().find(".logs-selector").show()}),$(".roles-admin").click(function(){$(this).parent().find("label.roles-user").removeClass("btn-primary").addClass("btn-default"),$(this).parent().find("label.roles-admin").addClass("btn-danger"),$(this).parent().parent().parent().parent().find(".logs-selector").hide()}),$("#umUsersAddForm").on("submit",function(a){return a.preventDefault(),users_add_save(this)}),log_selector_init(),$("#umAnonymousForm").on("submit",function(a){return a.preventDefault(),anonymous_save(this)})});var users_load=function(a){switch(a.replace(/#/g,"")){case"umUsers":users_list();break;case"umAnonymous":anonymous_list();break;case"umAuthLog":users_authlog();break;default:console.log("Oups ! User action "+a+" is unknown !")}},users_list=function(a,b,c){return $("#umUsersListAlert").html(void 0!==a?get_alert(a,b,c):""),$("#umUsersListBody").html(''),$("#umUsersList").show(),$("#umUsersView").hide(),$("#umUsersEdit").hide(),$("#umUsersAdd").hide(),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"users_list"}}).always(function(){}).fail(function(a){$("#umUsersListBody").html(get_alert("danger",a.responseText,!1))}).done(function(a){if(a.singlewarning)$("#umUsersListBody").html(get_alert("warning",a.singlewarning,!1));else if(a.singlenotice)$("#umUsersListBody").html(get_alert("info",a.singlenotice,!1));else if(a.error)$("#umUsersListBody").html(get_alert("danger",a.error,!1));else{var b="",c=a.b.length;b+='
    ',b+='

    '+c+" ",b+=c>1?lemma.users:lemma.user,b+="

    ",b+='
    ',b+=''+lemma.adduser+"",b+="
    ",b+="
    ",b+='
    ',b+='',b+="",b+="",b+='",b+='",b+='",b+='",b+="",b+="",b+="";for(var d in a.b){var e=a.b[d],f=e.u,g=e.roles,h=e.cd,i=(e.logs,e.lastlogin),j="";for(var k in g)switch(g[k]){case"admin":j+=''+g[k]+"";break;case"user":j+=''+g[k]+"";break;default:j+=''+g[k]+""}i=void 0!==i?i.ts:"",b+="",b+='",b+="",b+="",b+="",b+=""}b+="",b+="
    '+lemma.username+"'+lemma.roles+"'+lemma.creationdate+"'+lemma.lastlogin+"
    '+f+""+j+""+h+""+i+"
    ",b+="
    ",$("#umUsersListBody").html(b),$("#userlisttable").bootstrapTable().bootstrapTable("hideLoading")}}),!1},users_view=function(a){$("#umUsersViewBody").html(''),$("#umUsersViewAlert").html(""),$("#umUsersList").hide(),$("#umUsersView").show(),$("#umUsersEdit").hide(),$("#umUsersAdd").hide();var b=$(a).data("user")?$(a).data("user"):$(a).text();return $("#umUserEditBtn").data("user",b).show(),currentuser===b?$("#umUserEditBtn").attr("disabled","disabled"):$("#umUserEditBtn").removeAttr("disabled"),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"users_view",u:b}}).always(function(){}).fail(function(a){$("#umUsersViewBody").html(get_alert("danger",a.responseText,!1))}).done(function(a){if(a.singlewarning)return $("#umUsersViewBody").html(get_alert("warning",a.singlewarning,!1)),!1;if(a.singlenotice)return $("#umUsersViewBody").html(get_alert("info",a.singlenotice,!1)),!1;if(a.error)return $("#umUsersViewBody").html(get_alert("danger",a.error,!1)),!1;if(a.e)return $("#umUsersViewBody").html(get_alert("danger",a.e,!1)),!1;var c="",d=new UAParser,e=$.inArray("admin",a.b.roles)>-1;c+='
    ',c+='

    '+a.b.u+"

    ",c+='
    ',currentuser!==b&&(c+='
    ',c+=' ",c+=' ",c+="
    ",c+=" ",c+='
    ',c+=' ",c+=' ",c+="
    "),c+="
    ",c+="
    ",c+='',c+="";for(var f in a.b){var g=a.b[f];if("api_lastlogin"===f){var h=d.setUA(g.ua).getResult();g='").text(g.ur).html()+'" target="_blank" class="hyphen">'+g.ur+"
    "+g.ts+"
    "+g.ip+"
    "+h.browser.name+" "+h.browser.version+" - "+h.os.name+" "+h.os.version}else if("lastlogin"===f){var h=d.setUA(g.ua).getResult();g=g.ts+"
    "+g.ip+"
    "+h.browser.name+" "+h.browser.version+" - "+h.os.name+" "+h.os.version}else if("cb"===f)g||(g=''+lemma.system+"");else{if("u"===f)continue;if("at"===f)continue;if("hp"===f)continue;if("logs"===f)if(e===!0)g=lemma.all_access;else{var i="";for(var j in g)files[j]&&(i+=g[j].r===!0?'").text(files[j].path).html()+'">'+files[j].display+" ":'").text(files[j].path).html()+'">'+files[j].display+" ");g=i}else if("roles"===f){var k="";for(var j in g)switch(g[j]){case"admin":k+=''+g[j]+"";break;case"user":k+=''+g[j]+"";break;default:k+=''+g[j]+""}g=k}}c+="",c+="",c+="",c+=""}c+="",c+="
    "+lemma["user_"+f]+""+g+"
    ",$("#umUsersViewBody").html(c),$(function(){$('[data-toggle="tooltip"]').tooltip()})}),!1},users_add=function(){return $("#umUsersList").hide(),$("#umUsersView").hide(),$("#umUsersEdit").hide(),$("#umUsersAdd").show(),$("#umUsersAddLoader").hide(),$("#umUsersAddBody").show(),$("#umUsersAddPwdHelp").hide(),$("#umUsersAdd").find("label.logs-selector-yes").click(),$("#add-roles-user").click(),$("#add-username").val("").removeAttr("readonly"),$("#add-password").val(""),$("#add-password2").val(""),$("#umUsersAddAlert").html(""),$.each($("#umUsersAddForm").serializeArray(),function(a,b){$("#add-"+b.name+"-group").removeClass("has-error")}),$("#add-type").val("add"),$("#umUsersAddBtn").show(),$("#umUsersViewBtn").hide(),!1},users_add_save=function(){$("#umUsersAddSave").button("loading");var a={csrf_token:csrf_token,action:"users_add"};return $.each($("#umUsersAddForm").serializeArray(),function(b,c){$("#add-"+c.name+"-group").removeClass("has-error"),a[c.name]=c.value}),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:a}).always(function(){$("#umUsersAddSave").button("reset")}).fail(function(a){$("#umUsersAddAlert").html(get_alert("danger",a.responseText,!1))}).done(function(a){if(a.singlewarning)return $("#umUsersAddAlert").html(get_alert("warning",a.singlewarning,!1)),!1;if(a.singlenotice)return $("#umUsersAddAlert").html(get_alert("info",a.singlenotice,!1)),!1;if(a.error)return $("#umUsersAddAlert").html(get_alert("danger",a.error,!1)),!1;if(a.c>0){var b=""+lemma.form_invalid+"",$("#umUsersAddAlert").html(get_alert("danger",b,!1)),!1}users_list("success",lemma.user_add_ok,!0)}),!1},users_edit=function(a){var b=$(a).data("user");return $("#umUsersList").hide(),$("#umUsersView").hide(),$("#umUsersEdit").hide(),$("#umUsersAdd").show(),$("#umUsersAddLoader").show(),$("#umUsersAddBody").hide(),$("#umUsersAddPwdHelp").show(),$("#umUsersAdd").find("label.logs-selector-no").click(),$("#add-roles-user").click(),$("#add-username").val(b).attr("readonly","readonly"),$("#add-password").val(""),$("#add-password2").val(""),$("#umUsersAddAlert").html(""),$.each($("#umUsersAddForm").serializeArray(),function(a,b){$("#add-"+b.name+"-group").removeClass("has-error")}),$("#add-type").val("edit"),$("#umUsersAddBtn").hide(),$("#umUsersViewBtn").show().data("user",b),$("#umUsersAddSave").button("loading"),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"users_edit",u:b}}).always(function(){$("#umUsersAddSave").button("reset"),$("#umUsersAddLoader").hide(),$("#umUsersAddBody").show()}).fail(function(a){$("#umUsersAddBody").html(get_alert("danger",a.responseText,!1))}).done(function(a){if(a.b.roles)for(var b in a.b.roles)$("#add-roles-"+a.b.roles[b]).click();if(a.b.logs)for(var b in a.b.logs)$("#add-logs-f-"+b+"-"+a.b.logs[b].r).click()}),!1},users_delete=function(a){var b=$(a).parents(".del_base").find("p.lead").text();return $.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"users_delete",u:b}}).always(function(){}).fail(function(a){$("#umUsersViewAlert").html(get_alert("danger",a.responseText,!1))}).done(function(a){return a.singlewarning?($("#umUsersViewAlert").html(get_alert("warning",a.singlewarning,!1)),!1):a.singlenotice?($("#umUsersViewAlert").html(get_alert("info",a.singlenotice,!1)),!1):a.error?($("#umUsersViewAlert").html(get_alert("danger",a.error,!1)),!1):(users_list("success",lemma.user_delete_ok,!0),!1)}),!1},users_signinas=function(a){var b=$(a).parents(".del_base").find("p.lead").text();return $.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"users_signinas",u:b}}).always(function(){}).fail(function(a){$("#umUsersViewAlert").html(get_alert("danger",a.responseText,!1))}).done(function(a){return a.singlewarning?($("#umUsersViewAlert").html(get_alert("warning",a.singlewarning,!1)),!1):a.singlenotice?($("#umUsersViewAlert").html(get_alert("info",a.singlenotice,!1)),!1):a.error?($("#umUsersViewAlert").html(get_alert("danger",a.error,!1)),!1):(document.location.reload(),!1)}),!1},users_logfiles=function(){},users_authlog=function(){return $("#umAuthLogBody").html(''),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"authlog"}}).always(function(){}).fail(function(a){$("#umAuthLogBody").html(get_alert("danger",a.responseText,!1))}).done(function(a){if(a.singlewarning)return $("#umAuthLogBody").html(get_alert("warning",a.singlewarning,!1)),!1;if(a.singlenotice)return $("#umAuthLogBody").html(get_alert("info",a.singlenotice,!1)),!1;if(a.error)return $("#umAuthLogBody").html(get_alert("danger",a.error,!1)),!1;var b=a.b.length,c="";if(b>0){var d=new UAParser;c+='
    ',c+='',c+="",c+="",c+='",c+='",c+='",c+='",c+='",c+="",c+="",c+="";for(var e=0;b>e;e++){var f=a.b[e][2],g=a.b[e][0],h=a.b[e][1],i=a.b[e][3],j=d.setUA(a.b[e][4]).getResult();switch(j=j.browser.name+" "+j.browser.version+" - "+j.os.name+" "+j.os.version,g){case"signin":g=''+lemma.signin+"";break;case"signinerr":g=''+lemma.signinerr+"";break;case"signout":g=''+lemma.signout+"";break;case"changepwd":g=''+lemma.changepwd+""}g=g.replace(/^addadmin/,''+lemma.addadmin+""),g=g.replace(/^adduser/,''+lemma.adduser+""),g=g.replace(/^signinas/,''+lemma.signinas+""),g=g.replace(/^deleteuser/,''+lemma.deleteuser+""),c+="",c+="",c+="",c+="",c+="",c+='",c+=""}c+="",c+="
    '+lemma.date+"'+lemma.username+"'+lemma.action+"'+lemma.ip+"'+lemma.useragent+"
    "+f+""+h+""+g+""+i+"").text(a.b[e][4]).html()+'">'+j+"
    ",c+="
    "}else c=get_alert("info",lemma.authlogerror,!1);$("#umAuthLogBody").html(c),$("#authlogtable").bootstrapTable().bootstrapTable("hideLoading")}),!1},anonymous_save=function(){$("#umAnonymousSave").button("loading");var a={csrf_token:csrf_token,action:"anonymous_save"};return $.each($("#umAnonymousForm").serializeArray(),function(b,c){a[c.name]=c.value}),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:a}).always(function(){$("#umAnonymousSave").button("reset") + */function s(a,b){"use strict";sort=a,sorto=b,reload_page(!0),get_logs(!1,!0)}function get_top_offset(){return parseInt($("#logsbody").find("tr:last-child").data("offset"),10)}function log_selector_init(){$(".logs-selector-yes").click(function(){$(this).parent().find("label.logs-selector-no").removeClass("btn-danger").addClass("btn-default"),$(this).parent().find("label.logs-selector-yes").addClass("btn-success")}),$(".logs-selector-no").click(function(){$(this).parent().find("label.logs-selector-yes").removeClass("btn-success").addClass("btn-default"),$(this).parent().find("label.logs-selector-no").addClass("btn-danger")}),$(".logs-selector-toggler").click(function(){var a=$(this).parents(".logs-selector").find("label.logs-selector-yes:first").hasClass("active");a===!0?$(this).parents(".logs-selector").find("label.logs-selector-no").click():$(this).parents(".logs-selector").find("label.logs-selector-yes").click()})}function get_alert(a,b,c){var d='"}$(function(){"use strict";$("#changeLogModal").on("show.bs.modal",function(){$.ajax({url:"version.js?local=true&callback=?",type:"GET",dataType:"jsonp",jsonp:"pml_version_cb"}).done(function(){}).fail(function(){}).always(function(){})})});var pml_version_cb=function(a){"use strict";var b={fixed:{name:"Fixed","class":"success"},"new":{name:"New","class":"warning"},changed:{name:"Changed","class":"info"}},c='
    Star me on Github if you me!
    ';for(var d in a.changelog){c+='
    ',c+='
    ',c+='

    ',c+=" Version "+d+"",c+=void 0!==a.changelog[d].released?" - released on "+a.changelog[d].released:"",c+="

    ",c+="
    ",c+='
    ',void 0!==a.changelog[d].notice&&(c+='
    '+a.changelog[d].notice+"

    ");for(var e in b)if(void 0!==a.changelog[d][e])for(var f in a.changelog[d][e]){var g=a.changelog[d][e][f].replace(/#([0-9]+)/g,'#$1');c+='
    '+b[e].name+'
    '+g+"
    "}c+="
    ",c+="
    ",c+="
    "}c+='Congrats, you have read the full change log. Here is a for you!',$("#changeLogModal .modal-body").html(c)},type_parser=function(a){"use strict";var b="txt",c="",d=0;if(void 0!==a){var e=a.split("/");void 0!==e[1]?(d=parseInt(a.split("/").slice(-1),10),b=a.split("/").slice(0,-1).join("/")):b=a,e=b.split(":"),void 0!==e[1]&&(c=b.split(":").slice(1).join(":"),b=e[0])}return{parser:b,param:c,cut:d}},val_cut=function(a,b){"use strict";return void 0===b?a:0===b?a:a.length<=Math.abs(b)?a:b>0?a.substr(0,b)+"…":"…"+a.substr(b)},get_logs=function(load_default_values,load_full_file,load_from_get,load_more){"use strict";var wanted_lines;if($(".loadmore").button("loading"),null!==auto_refresh_timer&&(clearTimeout(auto_refresh_timer),auto_refresh_timer=null),load_default_values===!0){if(load_from_get===!0){var found;set_notification("true"===query_parameters.n?!0:"false"===query_parameters.n?!1:files[file].notify),found=files[file].max,void 0!==typeof query_parameters.m&&$("#max option").each(function(){this.value===query_parameters.m&&(found=query_parameters.m)}),set_max(found),found=files[file].refresh,void 0!==typeof query_parameters.r&&$("#autorefresh option").each(function(){this.value===query_parameters.r&&(found=query_parameters.r)}),set_auto_refresh(found),set_columns(void 0!==query_parameters.t?query_parameters.t.split(","):files[file].thinit),sort=void 0!==query_parameters.o?query_parameters.o:files[file].sort,sorto=void 0!==query_parameters.p?query_parameters.p:files[file].order}else set_max(files[file].max),set_auto_refresh(files[file].refresh),set_notification(files[file].notify),set_columns(files[file].thinit),sort=files[file].sort;files[file].export===!1?($("#export").hide(),$("#noexport").show()):export_default!==!1||files[file].export?($("#noexport").hide(),$("#export").show()):($("#export").hide(),$("#noexport").show()),load_full_file=!0}else load_default_values=!1;reload_page(!0),load_full_file===!0?(reset=1,file_size=0,load_more=!1,last_line="",has_loaded_more=!1):(reset=0,load_full_file=!1),$(".loader").toggle(),loading=!0,wanted_lines=$("#max").val();var post_values={ldv:load_default_values,file:file,filesize:file_size,max:wanted_lines,search:$("#search").val(),csrf_token:csrf_token,lastline:last_line,reset:reset};load_more===!0&&(post_values.sp=get_top_offset(),has_loaded_more=!0),$.ajax({url:"inc/getlog.pml.php?"+(new Date).getTime()+"&"+querystring,data:post_values,type:"POST",dataType:"json"}).fail(function(a){return $(".loader").toggle(),loading=!1,a.responseText.indexOf("Pimp My Log Login Match")>-1?(notify("Pimp my Logs ["+files[file].display+"]",lemma.youhavebeendisconnected),void document.location.reload()):a.error?($(".result").hide(),$("#error").show(),$("#errortxt").html(a.responseText),void notify("Pimp my Logs ["+files[file].display+"]",lemma.error)):void 0}).done(function(logs){if($(".loader").toggle(),loading=!1,logs.lastline&&(last_line=logs.lastline,file_size=logs.newfilesize),logs.error)return $(".result").hide(),$("#error").show(),$("#errortxt").html(logs.error),void notify(notification_title.replace("%i",file).replace("%f",files[file].display),lemma.error);if(logs.warning&&pml_alert(logs.warning,"warning"),logs.notice&&pml_alert(logs.notice,"info"),logs.singlewarning&&pml_singlealert(logs.singlewarning,"warning"),logs.singlenotice&&pml_singlealert(logs.singlenotice,"info"),$("#error").hide(),$(".result").show(),logs.full)if(logs.found===!1){var nolog=lemma.no_log;""!==logs.search&&(nolog=logs.regsearch?lemma.search_no_regex.replace("%s",""+logs.search+""):lemma.search_no_regular.replace("%s",""+logs.search+"")),$("#nolog").html(nolog).show(),$("#logshead").hide()}else $("#nolog").text("").hide(),$("#logshead").show();else logs.logs&&($("#nolog").text("").hide(),$("#logshead").show());if(logs.regsearch?($("#searchctn").addClass("has-success"),$("#searchctn").prop("title",lemma.regex_valid)):($("#searchctn").removeClass("has-success"),$("#searchctn").prop("title",lemma.regex_invalid)),logs.headers){$("#logshead").text(""),$(".thmenucol").remove();var thtr=$("").addClass(file);sorto=1===parseInt(sorto,10)?1:-1;var sortn=-1;for(var h in logs.headers){$(".thmenuicon").removeClass("text-danger");var ic="";if(sort===h){sortn=-1*sorto;var q=1===sorto?"up":"down";ic=' '}var a=$('"+logs.headers[h]+ic+"").addClass(h).appendTo(thtr),f;is_column_displayed(h)?f="on":($(a).hide(),f="off"),$('
  • '+logs.headers[h]+"
  • ").appendTo(".thmenu")}thtr.appendTo("#logshead"),set_column_icon(),$(".thmenuitem").click(function(a){a.stopPropagation(),$(this).hasClass("thmenuon")?remove_column($(this).attr("data-h")):add_column($(this).attr("data-h"))})}logs.full&&$("#logsbody").text(""),void 0!==logs.logs&&$("#logsbody tr").removeClass("newlog");var uaparser=new UAParser,rowidx=0,rows=[];for(var log in logs.logs){var tr=$("").addClass(file).data("log",logs.logs[log].pml).data("offset",logs.logs[log].pmlo);for(var c in logs.logs[log])if("pml"!==c&&"pmlo"!==c&&"pmld"!==c){var type=type_parser(files[file].format.types[c]),val=logs.logs[log][c],title=val,output_html=!0;if("-"===val&&(val=""),"uaw3c"===type.parser&&(type.parser="ua",val=val.replace(/\+/g," ")),"badge"===type.parser){var clas;"http"===type.param?clas=badges[type.param][logs.logs[log][c].substr(0,1)]:"severity"===type.param&&(clas=badges[type.param][logs.logs[log][c].toLowerCase()],void 0===clas&&(clas=badges[type.param][logs.logs[log][c]])),void 0===clas&&(clas="default"),val=''+val_cut(val,type.cut)+""}else if("date"===type.parser)title=logs.logs[log].pml,val=val_cut(val,type.cut);else if("numeral"===type.parser)""!==val&&""!==type.param&&(val=numeral(val).format(type.param));else if("ip"===type.parser)val="geo"===type.param?''+val_cut(val,type.cut)+"":''+val_cut(val,type.cut)+"";else if("link"===type.parser)val=''+val_cut(val,type.cut)+"";else if("ua"===type.parser){var ua=uaparser.setUA(val).getResult(),uas=type.param.match(/\{[a-zA-Z.]*\}/g),uaf=!1;for(var k in uas){var d;try{d=eval("ua."+uas[k].replace("{","").replace("}","")),void 0===d&&(d="")}catch(e){d=""}""!==d&&(uaf=!0,type.param=type.param.replace(uas[k],d))}uaf===!0&&(val=$.trim(type.param))}else"preformatted"===type.parser?(val=val_cut(val.replace(/(?:\\r\\n|\\r|\\n)/g,"\n").replace(/\\t/g," "),type.cut),output_html=!1):"prefake"===type.parser?val=val_cut(val.replace(/(?:\r\n|\r|\n)/g,"
    "),type.cut):(val=val_cut(val,type.cut),output_html=!1);output_html===!1&&(val=val.replace(/…/g,"..."));var b=output_html===!0?$("").html(val):$("").text(val);b=b.prop("title",title).addClass("pml-"+c+" pml-"+type.parser).appendTo(tr),is_column_displayed(c)||$(b).hide()}logs.full||(tr.addClass("newlog"),rowidx++),rows.push(tr)}if(logs.full||load_more===!0)$("#logsbody").append(rows);else if($("#logsbody").prepend(rows),has_loaded_more!==!0){var rowd=$("#logsbody tr").length;rowd>wanted_lines&&(rowd-=wanted_lines,$("#logsbody").find("tr:nth-last-child(-n+"+rowd+")").remove())}var older_line_offset=get_top_offset();if(1>=older_line_offset||""!==logs.search&&parseInt(logs.lpo,10)<=1?$(".loadmore").text($(".loadmore").data("nomore-text")).addClass("disabled").prop("disabled","disabled").attr("title",""):$(".loadmore").button("reset").attr("title",sprintf(lemma.loadmore,numeral(older_line_offset).format("0 b"))),void 0!==sort){var i=0,col=-1;if($("#logshead tr th").each(function(){$(this).hasClass(sort)&&(col=i),i++}),col>=0){var tbody=document.getElementById("logsbody"),trs=Array.prototype.slice.call(tbody.rows,0);for(trs=trs.sort(function(a,b){return a=a.cells[col].getAttribute("title"),b=b.cells[col].getAttribute("title"),$.isNumeric(a)&&$.isNumeric(b)?sorto*(parseFloat(a)-parseFloat(b)):sorto*a.toLowerCase().localeCompare(b.toLowerCase())}),i=0;i1&&(rowct=lemma.display_nlogs.replace("%s",rowc)+" "),$("#footer").html(rowct+logs.footer),first_launch===!1&&(logs.full?logs.fingerprint!==fingerprint&&(notify(notification_title.replace("%i",file).replace("%f",files[file].display),lemma.new_logs),fingerprint=logs.fingerprint):1===rowidx?notify(notification_title.replace("%i",file).replace("%f",files[file].display),lemma.new_log):rowidx>1&¬ify(notification_title.replace("%i",file).replace("%f",files[file].display),lemma.new_nlogs.replace("%s",rowidx))),first_launch=!1;var p=Math.max(0,parseInt($("#autorefresh").val(),10));p>0&&(auto_refresh_timer=setTimeout(function(){get_logs()},1e3*p))}).always(function(){})},notification_class="warning",set_notification=function(a){"use strict";void 0===a&&(a=notification),a===!0?($("#notification").removeClass("btn-warning btn-success btn-danger btn-default").addClass("active btn-"+notification_class),notification=!0):($("#notification").removeClass("btn-warning btn-success btn-danger active").addClass("btn-default"),notification=!1)},is_notification=function(){"use strict";return $("#notification").hasClass("active")},notify=function(a,b){"use strict";if("webkitNotifications"in window){var c=window.webkitNotifications.checkPermission();if(0===c){if(notification_class="success",set_notification(),notification===!0&&void 0!==a&¬ification_displayed===!1){notification_displayed=!0;var d=window.webkitNotifications.createNotification("img/icon72.png",a,b);d.onclick=function(){window.focus(),d.close()},d.onclose=function(){notification_displayed=!1},d.show(),setTimeout(function(){try{d.close()}catch(a){}},5e3)}}else 2===c?(notification_class="danger",set_notification()):(notification_class="warning",set_notification(),window.webkitNotifications.requestPermission(function(){notify(a,b)}))}else if("Notification"in window)if("default"===window.Notification.permission)notification_class="warning",set_notification(),window.Notification.requestPermission(function(){notify(a,b)});else if("granted"===window.Notification.permission){if(notification_class="success",set_notification(),notification===!0&&void 0!==a&¬ification_displayed===!1){notification_displayed=!0;var e=new window.Notification(a,{body:b,tag:"Pimp My Log"});e.onclick=function(){this.close()},e.onclose=function(){notification_displayed=!1}}}else if("denied"===window.Notification.permission)return notification_class="danger",void set_notification()},refresh_rss=function(){$("#exModalRefresh").button("loading"),$.ajax({url:$("#exModalUrl").text(),dataType:"text",success:function(a){$("#exModalRefresh").button("reset"),$("#exModalCtn").text(a)}})},get_rss=function(a){return $("#exModalResultLoading").show(),$("#exModalResult").hide(),$("#exModalRefresh").button("loading"),$.ajax({url:"inc/rss.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"get_rss_link",file:file,search:$("#search").val(),format:a}}).always(function(){}).fail(function(a){$("#prBody").html(get_alert("danger",c.message+"
    "+a.responseText,!1))}).done(function(b){b.singlewarning?pml_singlealert(b.singlewarning,"warning"):b.singlenotice?pml_singlealert(b.singlenotice,"info"):b.error?pml_singlealert(b.error,"danger"):"if"===b.met?document.body.innerHTML+="":("nd"===b.met?($("#exModalResultLoading").hide(),$("#exModalResult").hide(),$("#exModalRefresh").button("reset")):$.ajax({url:b.url,dataType:"text",success:function(a){$("#exModalCtn").text(a),$("#exModalResultLoading").hide(),$("#exModalResult").show(),$("#exModalRefresh").button("reset")}}),$("#exModalFormat").text(a),$("#exModalUrl").text(b.url),b.war===!1?$("#exModalWar").hide():$("#exModalWar").show(),$("#exModalOpen").attr("href",b.url),$("#exModal").modal("show"))}),!1};$(function(){"use strict";$("#prModal").on("show.bs.modal",function(){a()});var a=function(a,b,c){return $("#prAlert").html(void 0!==a?get_alert(a,b,c):""),$("#prBody").html(''),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"profile_get"}}).always(function(){}).fail(function(a){$("#prBody").html(get_alert("danger",a.responseText,!1))}).done(function(a){$("#prBody").html(a.singlewarning?get_alert("warning",a.singlewarning,!1):a.singlenotice?get_alert("info",a.singlenotice,!1):a.error?get_alert("danger",a.error,!1):a.b)}),!1};$("#prForm").on("submit",function(a){return b(),a.preventDefault(),!1});var b=function(){$("#prSave").button("loading");var b={csrf_token:csrf_token,action:"profile_save"};return $.each($("#prForm").serializeArray(),function(a,c){b[c.name]=c.value}),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:b}).always(function(){$("#prSave").button("reset")}).fail(function(a){$("#prAlert").html(get_alert("danger",a.responseText,!1))}).done(function(b){return b.singlewarning?($("#prBody").html(get_alert("warning",b.singlewarning,!1)),!1):b.singlenotice?($("#prBody").html(get_alert("info",b.singlenotice,!1)),!1):b.error?($("#prBody").html(get_alert("danger",b.error,!1)),!1):(a("success",lemma.profile_ok,!0),!1)}),!1};$("#cpModal").on("show.bs.modal",function(){$("#cpErr").hide(),$("#password1group").removeClass("has-error"),$("#password2group").removeClass("has-error"),$("#password3group").removeClass("has-error"),$("#cpSave").button("reset"),$("#password1").val(""),$("#password2").val(""),$("#password3").val("")}),$("#changepassword").on("submit",function(a){return $("#password1group").removeClass("has-error"),$("#password2group").removeClass("has-error"),$("#password3group").removeClass("has-error"),$("#cpErr").hide(),$("#cpSave").button("loading"),$("#cpErr").hide(),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{password1:$("#password1").val(),password2:$("#password2").val(),password3:$("#password3").val(),csrf_token:csrf_token,action:"change_password"}}).always(function(){$("#cpSave").button("reset")}).fail(function(a){$("#cpErrM").html(a.responseText).show(),$("#cpErr").show()}).done(function(a){if(a.singlewarning)$("#cpErr").html(get_alert("warning",a.singlewarning,!1)).show();else if(a.singlenotice)$("#cpErr").html(get_alert("info",a.singlenotice,!1)).show();else if(a.error)$("#cpErr").html(get_alert("danger",a.error,!1)).show();else if(a.ok)$("#notice").html(get_alert("success",a.ok,!0)),$("#cpModal").modal("hide");else if(a.errors){$("#cpErrUl").html("");for(var b in a.errors)$("#cpErrUl").append("
  • "+a.errors[b]+"
  • ");for(var b in a.fields)$("#"+a.fields[b]+"group").addClass("has-error");$("#cpErr").show()}}),a.preventDefault(),!1}),$("#umModal").on("show.bs.modal",function(){users_load($("#usermanagement div.tab-pane.active").attr("id"))}),$('#usermanagement a[data-toggle="pill"]').on("shown.bs.tab",function(a){users_load($(a.target).attr("href"))}),$(".roles-user").click(function(){$(this).parent().find("label.roles-admin").removeClass("btn-danger").addClass("btn-default"),$(this).parent().find("label.roles-user").addClass("btn-primary"),$(this).parent().parent().parent().parent().find(".logs-selector").show()}),$(".roles-admin").click(function(){$(this).parent().find("label.roles-user").removeClass("btn-primary").addClass("btn-default"),$(this).parent().find("label.roles-admin").addClass("btn-danger"),$(this).parent().parent().parent().parent().find(".logs-selector").hide()}),$("#umUsersAddForm").on("submit",function(a){return a.preventDefault(),users_add_save(this)}),log_selector_init(),$("#umAnonymousForm").on("submit",function(a){return a.preventDefault(),anonymous_save(this)})});var users_load=function(a){switch(a.replace(/#/g,"")){case"umUsers":users_list();break;case"umAnonymous":anonymous_list();break;case"umAuthLog":users_authlog();break;default:console.log("Oups ! User action "+a+" is unknown !")}},users_list=function(a,b,c){return $("#umUsersListAlert").html(void 0!==a?get_alert(a,b,c):""),$("#umUsersListBody").html(''),$("#umUsersList").show(),$("#umUsersView").hide(),$("#umUsersEdit").hide(),$("#umUsersAdd").hide(),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"users_list"}}).always(function(){}).fail(function(a){$("#umUsersListBody").html(get_alert("danger",a.responseText,!1))}).done(function(a){if(a.singlewarning)$("#umUsersListBody").html(get_alert("warning",a.singlewarning,!1));else if(a.singlenotice)$("#umUsersListBody").html(get_alert("info",a.singlenotice,!1));else if(a.error)$("#umUsersListBody").html(get_alert("danger",a.error,!1));else{var b="",c=a.b.length;b+='
    ',b+='

    '+c+" ",b+=c>1?lemma.users:lemma.user,b+="

    ",b+='
    ',b+=''+lemma.adduser+"",b+="
    ",b+="
    ",b+='
    ',b+='',b+="",b+="",b+='",b+='",b+='",b+='",b+="",b+="",b+="";for(var d in a.b){var e=a.b[d],f=e.u,g=e.roles,h=e.cd,i=(e.logs,e.lastlogin),j="";for(var k in g)switch(g[k]){case"admin":j+=''+g[k]+"";break;case"user":j+=''+g[k]+"";break;default:j+=''+g[k]+""}i=void 0!==i?i.ts:"",b+="",b+='",b+="",b+="",b+="",b+=""}b+="",b+="
    '+lemma.username+"'+lemma.roles+"'+lemma.creationdate+"'+lemma.lastlogin+"
    '+f+""+j+""+h+""+i+"
    ",b+="
    ",$("#umUsersListBody").html(b),$("#userlisttable").bootstrapTable().bootstrapTable("hideLoading")}}),!1},users_view=function(a){$("#umUsersViewBody").html(''),$("#umUsersViewAlert").html(""),$("#umUsersList").hide(),$("#umUsersView").show(),$("#umUsersEdit").hide(),$("#umUsersAdd").hide();var b=$(a).data("user")?$(a).data("user"):$(a).text();return $("#umUserEditBtn").data("user",b).show(),currentuser===b?$("#umUserEditBtn").attr("disabled","disabled"):$("#umUserEditBtn").removeAttr("disabled"),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"users_view",u:b}}).always(function(){}).fail(function(a){$("#umUsersViewBody").html(get_alert("danger",a.responseText,!1))}).done(function(a){if(a.singlewarning)return $("#umUsersViewBody").html(get_alert("warning",a.singlewarning,!1)),!1;if(a.singlenotice)return $("#umUsersViewBody").html(get_alert("info",a.singlenotice,!1)),!1;if(a.error)return $("#umUsersViewBody").html(get_alert("danger",a.error,!1)),!1;if(a.e)return $("#umUsersViewBody").html(get_alert("danger",a.e,!1)),!1;var c="",d=new UAParser,e=$.inArray("admin",a.b.roles)>-1;c+='
    ',c+='

    '+a.b.u+"

    ",c+='
    ',currentuser!==b&&(c+='
    ',c+=' ",c+=' ",c+="
    ",c+=" ",c+='
    ',c+=' ",c+=' ",c+="
    "),c+="
    ",c+="
    ",c+='',c+="";for(var f in a.b){var g=a.b[f];if("api_lastlogin"===f){var h=d.setUA(g.ua).getResult();g='").text(g.ur).html()+'" target="_blank" class="hyphen">'+g.ur+"
    "+g.ts+"
    "+g.ip+"
    "+h.browser.name+" "+h.browser.version+" - "+h.os.name+" "+h.os.version}else if("lastlogin"===f){var h=d.setUA(g.ua).getResult();g=g.ts+"
    "+g.ip+"
    "+h.browser.name+" "+h.browser.version+" - "+h.os.name+" "+h.os.version}else if("cb"===f)g||(g=''+lemma.system+"");else{if("u"===f)continue;if("at"===f)continue;if("hp"===f)continue;if("logs"===f)if(e===!0)g=lemma.all_access;else{var i="";for(var j in g)files[j]&&(i+=g[j].r===!0?'").text(files[j].path).html()+'">'+files[j].display+" ":'").text(files[j].path).html()+'">'+files[j].display+" ");g=i}else if("roles"===f){var k="";for(var j in g)switch(g[j]){case"admin":k+=''+g[j]+"";break;case"user":k+=''+g[j]+"";break;default:k+=''+g[j]+""}g=k}}c+="",c+="",c+="",c+=""}c+="",c+="
    "+lemma["user_"+f]+""+g+"
    ",$("#umUsersViewBody").html(c),$(function(){$('[data-toggle="tooltip"]').tooltip()})}),!1},users_add=function(){return $("#umUsersList").hide(),$("#umUsersView").hide(),$("#umUsersEdit").hide(),$("#umUsersAdd").show(),$("#umUsersAddLoader").hide(),$("#umUsersAddBody").show(),$("#umUsersAddPwdHelp").hide(),$("#umUsersAdd").find("label.logs-selector-yes").click(),$("#add-roles-user").click(),$("#add-username").val("").removeAttr("readonly"),$("#add-password").val(""),$("#add-password2").val(""),$("#umUsersAddAlert").html(""),$.each($("#umUsersAddForm").serializeArray(),function(a,b){$("#add-"+b.name+"-group").removeClass("has-error")}),$("#add-type").val("add"),$("#umUsersAddBtn").show(),$("#umUsersViewBtn").hide(),!1},users_add_save=function(){$("#umUsersAddSave").button("loading");var a={csrf_token:csrf_token,action:"users_add"};return $.each($("#umUsersAddForm").serializeArray(),function(b,c){$("#add-"+c.name+"-group").removeClass("has-error"),a[c.name]=c.value}),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:a}).always(function(){$("#umUsersAddSave").button("reset")}).fail(function(a){$("#umUsersAddAlert").html(get_alert("danger",a.responseText,!1))}).done(function(a){if(a.singlewarning)return $("#umUsersAddAlert").html(get_alert("warning",a.singlewarning,!1)),!1;if(a.singlenotice)return $("#umUsersAddAlert").html(get_alert("info",a.singlenotice,!1)),!1;if(a.error)return $("#umUsersAddAlert").html(get_alert("danger",a.error,!1)),!1;if(a.c>0){var b=""+lemma.form_invalid+"
      ";for(var c in a.e)b+="
    • "+a.e[c]+"
    • ",$("#add-"+c+"-group").addClass("has-error");return b+="
    ",$("#umUsersAddAlert").html(get_alert("danger",b,!1)),!1}users_list("success",lemma.user_add_ok,!0)}),!1},users_edit=function(a){var b=$(a).data("user");return $("#umUsersList").hide(),$("#umUsersView").hide(),$("#umUsersEdit").hide(),$("#umUsersAdd").show(),$("#umUsersAddLoader").show(),$("#umUsersAddBody").hide(),$("#umUsersAddPwdHelp").show(),$("#umUsersAdd").find("label.logs-selector-no").click(),$("#add-roles-user").click(),$("#add-username").val(b).attr("readonly","readonly"),$("#add-password").val(""),$("#add-password2").val(""),$("#umUsersAddAlert").html(""),$.each($("#umUsersAddForm").serializeArray(),function(a,b){$("#add-"+b.name+"-group").removeClass("has-error")}),$("#add-type").val("edit"),$("#umUsersAddBtn").hide(),$("#umUsersViewBtn").show().data("user",b),$("#umUsersAddSave").button("loading"),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"users_edit",u:b}}).always(function(){$("#umUsersAddSave").button("reset"),$("#umUsersAddLoader").hide(),$("#umUsersAddBody").show()}).fail(function(a){$("#umUsersAddBody").html(get_alert("danger",a.responseText,!1))}).done(function(a){if(a.b.roles)for(var b in a.b.roles)$("#add-roles-"+a.b.roles[b]).click();if(a.b.logs)for(var b in a.b.logs)$("#add-logs-f-"+b+"-"+a.b.logs[b].r).click()}),!1},users_delete=function(a){var b=$(a).parents(".del_base").find("p.lead").text();return $.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"users_delete",u:b}}).always(function(){}).fail(function(a){$("#umUsersViewAlert").html(get_alert("danger",a.responseText,!1))}).done(function(a){return a.singlewarning?($("#umUsersViewAlert").html(get_alert("warning",a.singlewarning,!1)),!1):a.singlenotice?($("#umUsersViewAlert").html(get_alert("info",a.singlenotice,!1)),!1):a.error?($("#umUsersViewAlert").html(get_alert("danger",a.error,!1)),!1):(users_list("success",lemma.user_delete_ok,!0),!1)}),!1},users_signinas=function(a){var b=$(a).parents(".del_base").find("p.lead").text();return $.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"users_signinas",u:b}}).always(function(){}).fail(function(a){$("#umUsersViewAlert").html(get_alert("danger",a.responseText,!1))}).done(function(a){return a.singlewarning?($("#umUsersViewAlert").html(get_alert("warning",a.singlewarning,!1)),!1):a.singlenotice?($("#umUsersViewAlert").html(get_alert("info",a.singlenotice,!1)),!1):a.error?($("#umUsersViewAlert").html(get_alert("danger",a.error,!1)),!1):(document.location.reload(),!1)}),!1},users_logfiles=function(){},users_authlog=function(){return $("#umAuthLogBody").html(''),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"authlog"}}).always(function(){}).fail(function(a){$("#umAuthLogBody").html(get_alert("danger",a.responseText,!1))}).done(function(a){if(a.singlewarning)return $("#umAuthLogBody").html(get_alert("warning",a.singlewarning,!1)),!1;if(a.singlenotice)return $("#umAuthLogBody").html(get_alert("info",a.singlenotice,!1)),!1;if(a.error)return $("#umAuthLogBody").html(get_alert("danger",a.error,!1)),!1;var b=a.b.length,c="";if(b>0){var d=new UAParser;c+='
    ',c+='',c+="",c+="",c+='",c+='",c+='",c+='",c+='",c+="",c+="",c+="";for(var e=0;b>e;e++){var f=a.b[e][2],g=a.b[e][0],h=a.b[e][1],i=a.b[e][3],j=d.setUA(a.b[e][4]).getResult();switch(j=j.browser.name+" "+j.browser.version+" - "+j.os.name+" "+j.os.version,g){case"signin":g=''+lemma.signin+"";break;case"signinerr":g=''+lemma.signinerr+"";break;case"signout":g=''+lemma.signout+"";break;case"changepwd":g=''+lemma.changepwd+""}g=g.replace(/^addadmin/,''+lemma.addadmin+""),g=g.replace(/^adduser/,''+lemma.adduser+""),g=g.replace(/^signinas/,''+lemma.signinas+""),g=g.replace(/^deleteuser/,''+lemma.deleteuser+""),c+="",c+="",c+="",c+="",c+="",c+='",c+=""}c+="",c+="
    '+lemma.date+"'+lemma.username+"'+lemma.action+"'+lemma.ip+"'+lemma.useragent+"
    "+f+""+h+""+g+""+i+"").text(a.b[e][4]).html()+'">'+j+"
    ",c+="
    "}else c=get_alert("info",lemma.authlogerror,!1);$("#umAuthLogBody").html(c),$("#authlogtable").bootstrapTable().bootstrapTable("hideLoading")}),!1},anonymous_save=function(){$("#umAnonymousSave").button("loading");var a={csrf_token:csrf_token,action:"anonymous_save"};return $.each($("#umAnonymousForm").serializeArray(),function(b,c){a[c.name]=c.value}),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:a}).always(function(){$("#umAnonymousSave").button("reset") }).fail(function(a){$("#umAnonymousAlert").html(get_alert("danger",a.responseText,!1))}).done(function(a){return a.singlewarning?($("#umAnonymousBody").html(get_alert("warning",a.singlewarning,!1)),!1):a.singlenotice?($("#umAnonymousBody").html(get_alert("info",a.singlenotice,!1)),!1):a.error?($("#umAnonymousBody").html(get_alert("danger",a.error,!1)),!1):(anonymous_list("success",lemma.anonymous_ok,!0),!1)}),!1},anonymous_list=function(a,b,c){return $("#umAnonymousAlert").html(void 0!==a?get_alert(a,b,c):""),$("#umAnonymousBody").html(''),$.ajax({url:"inc/users.pml.php?"+(new Date).getTime()+"&"+querystring,type:"POST",dataType:"json",data:{csrf_token:csrf_token,action:"anonymous_list"}}).always(function(){}).fail(function(a){$("#umAnonymousBody").html(get_alert("danger",a.responseText,!1))}).done(function(a){a.singlewarning?$("#umAnonymousBody").html(get_alert("warning",a.singlewarning,!1)):a.singlenotice?$("#umAnonymousBody").html(get_alert("info",a.singlenotice,!1)):a.error?$("#umAnonymousBody").html(get_alert("danger",a.error,!1)):($("#umAnonymousBody").html(a.b),log_selector_init())}),!1},file,notification,displayed_th,auto_refresh_timer,fingerprint,first_launch,file_size,last_line,loading,reset,sort,sorto,has_loaded_more=!1,notification_displayed=!1,query_parameters=function(){for(var a,b=[],c=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),d=0;d0?$(".thmenuicon").addClass("text-danger"):$(".thmenuicon").removeClass("text-danger")},parse_columns=function(){var a=[];$(".thmenuon").each(function(){a.push($(this).data("h"))}),set_columns(a),set_column_icon(),reload_page(!0)},custom_columns=function(){"use strict";return $.isArray(displayed_th)},is_column_displayed=function(a){"use strict";return $.isArray(displayed_th)===!0?$.inArray(a,displayed_th)>-1:!0},remove_column=function(a){"use strict";$('.thmenuitem[data-h="'+a+'"]').removeClass("thmenuon"),$('.thmenuitem[data-h="'+a+'"]').addClass("thmenuoff"),$("."+a).hide(),$(".pml-"+a).hide(),parse_columns()},add_column=function(a){"use strict";$('.thmenuitem[data-h="'+a+'"]').removeClass("thmenuoff"),$('.thmenuitem[data-h="'+a+'"]').addClass("thmenuon"),$("."+a).show(),$(".pml-"+a).show(),parse_columns()},set_title=function(){"use strict";document.title=title_file.replace("%i",file).replace("%f",files[file].display)},pml_alert=function(a,b){"use strict";$('
    '+a+"
    ").appendTo("#notice")},pml_singlealert=function(a,b){"use strict";$("#singlenotice").html('
    '+a+"
    ")};$(function(){"use strict";function a(a){return a?"addClass":"removeClass"}$("#singlelog").length?(file=$("#singlelog").data("file"),set_title(),get_logs(!0)):"bs"===file_selector?($(".file_menup.active").length||$(".file_menup:first").addClass("active"),$("#file_selector").text($(".file_menup.active:first a").text()),file=$(".file_menup.active").data("file"),set_title(),$(".file_menu").click(function(){$("#file_selector").text($(this).text()),$(".file_menup").removeClass("active"),$(this).parent().addClass("active"),file=$(this).parent().data("file"),set_title(),get_logs(!0)})):(file=$("#file_selector_big").val(),set_title(),$("#file_selector_big").change(function(){file=$("#file_selector_big").val(),set_title(),get_logs(!0)})),$(".logo").click(function(){document.location.href="?"}),$("#refresh").click(function(){notify(),get_logs()}),$(".cog").click(function(){switch($(this).data("cog")){case"wideview":"on"===$(this).data("value")?($(this).data("value","off"),$(this).find(".cogon").hide(),$(this).find(".cogoff").show(),$(".tableresult").removeClass("containerwide").addClass("container")):($(this).data("value","on"),$(this).find(".cogoff").hide(),$(this).find(".cogon").show(),$(".tableresult").addClass("containerwide").removeClass("container"))}reload_page(!0)}),$(".cog").each(function(){"on"===$(this).data("value")?($(this).find(".cogon").show(),$(this).find(".cogoff").hide(),$(".tableresult").addClass("containerwide").removeClass("container")):($(this).find(".cogon").hide(),$(this).find(".cogoff").show(),$(".tableresult").addClass("container").removeClass("containerwide"))}),$("#cog-lang").change(function(){reload_page()}),$("#cog-tz").change(function(){reload_page()}),$(document).keypress(function(a){$(a.target).is("input, textarea")||(114===a.which?(notify(),get_logs()):(102===a.which||47===a.which)&&(a.preventDefault(),$("#search").focus()))}),$(document).on("input",".clearable",function(){$(this)[a(this.value)]("x")}).on("mousemove",".x",function(b){$(this)[a(this.offsetWidth-18Hi folks!

    This alert box has been added to send important messages to you about Pimp my Log. It is not intended to be a Spam Zone.

    I need to know if I should continue the development of Pimp My Log and how many people are interested in Pimp my Log. Would you just let me know by starring the project in GitHub please?

    And don’t worry, Pimp my Log will be in open-source forever.

    potsky

    ", "20141011" : "This message will never be shown. Never Gonna Give You Up !" }, "changelog" : { + "1.7.7" : { + "released" : "2014-12-23", + "fixed" : [ + "Cut text in modes txt, pre and preformatted displays hellip; instead of ..." + ] + }, "1.7.6" : { "released" : "2014-12-23", "new" : [ "New type 'preformatted': it is the same type as 'pre' but new lines and tabs strings are replaced by real new lines and real tabs. var_dump and other debug functions returns are now well displayed!" ], "changed" : [ - "Type output change: txt and fake types (not prefake) are now in full raw text format. HTML is no more parsed. Use 'prefake' to let HTML in your logs be parsed", + "Type output change: txt, pre and preformatted types (not prefake) are now in full raw text format. HTML is no more parsed. Use 'prefake' to let HTML in your logs be parsed", "Dev: javascript files are split now, Grunt will concat them before uglifying" ], "fixed" : [