From f4efaadad19c63625c7555ca9b3def9c637a2049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Fri, 7 Nov 2014 20:53:50 -0500 Subject: [PATCH] Remove Google auth (openid is deprecated) and Persona auth (useless) --- README.markdown | 8 +-- assets/js/all.min.js | 21 +++---- assets/js/app.js | 19 ------- assets/js/event.js | 8 --- assets/js/persona.js | 8 --- assets/js/popup.js | 2 +- controllers/common.php | 7 +-- controllers/user.php | 100 --------------------------------- lib/AuthProvider.php | 94 ------------------------------- locales/cs_CZ/translations.php | 11 ---- locales/de_DE/translations.php | 11 ---- locales/es_ES/translations.php | 11 ---- locales/fr_FR/translations.php | 11 ---- locales/it_IT/translations.php | 11 ---- locales/pt_BR/translations.php | 11 ---- locales/zh_CN/translations.php | 11 ---- models/config.php | 2 - templates/config.php | 17 ------ templates/login.php | 22 ++------ 19 files changed, 19 insertions(+), 366 deletions(-) delete mode 100644 assets/js/persona.js delete mode 100644 lib/AuthProvider.php diff --git a/README.markdown b/README.markdown index 4bcfbd9..7f5479e 100644 --- a/README.markdown +++ b/README.markdown @@ -11,7 +11,6 @@ Features - Your Raspberry Pi, a shared web-hosting, a virtual machine or localhost - Easy setup => copy and paste the source code and you are done! - Use a lightweight Sqlite database instead of Mysql or Postgresql -- Auto-update from the user interface ### Readability @@ -30,11 +29,6 @@ Features - Translated in English, French, German, Italian, Czech, Spanish, Portuguese and Simplified Chinese - RTL languages support -### Users management - -- Alternate authentication with a Google Account or Mozilla Persona -- Multiple databases (each user has his own database) - ### Awesome features - Keyboard shortcuts @@ -48,6 +42,8 @@ Features - Basic bookmarks - Import/Export of OPML feeds - Themes +- Auto-update from the user interface +- Multiple databases (each user has his own database) Requirements ------------ diff --git a/assets/js/all.min.js b/assets/js/all.min.js index 7e55f98..069cbd3 100644 --- a/assets/js/all.min.js +++ b/assets/js/all.min.js @@ -1,24 +1,21 @@ -var Miniflux={}; -Miniflux.App=function(){return{BlinkIcon:function(){var d=document.querySelectorAll(".loading-icon");[].forEach.call(d,function(b){b.classList.toggle("loading-icon-blink")})},Run:function(){Miniflux.Event.ListenKeyboardEvents();Miniflux.Event.ListenMouseEvents()},MozillaAuth:function(d){navigator.id.watch({onlogin:function(b){var a=new XMLHttpRequest;a.open("POST","?action="+d+"&token="+b,!0);a.setRequestHeader("Connection","close");a.onload=function(){window.location.href=this.responseText};a.send("token="+ -b)},onlogout:function(){}});navigator.id.request()}}}(); +var Miniflux={};Miniflux.App=function(){return{BlinkIcon:function(){var d=document.querySelectorAll(".loading-icon");[].forEach.call(d,function(b){b.classList.toggle("loading-icon-blink")})},Run:function(){Miniflux.Event.ListenKeyboardEvents();Miniflux.Event.ListenMouseEvents()}}}(); Miniflux.Feed=function(){function d(a){if(a=document.getElementById("loading-feed-"+a))a.appendChild(document.createTextNode("\u2600")),a.classList.add("loading-icon-blink");f||(f=setInterval(Miniflux.App.BlinkIcon,500))}function b(){for(var b=document.getElementsByTagName("a"),c=0,d=b.length;cc.length;){var b=a.shift();c.push(b);Miniflux.Feed.Update(b, +a);e&&(e.innerHTML="");if(e=document.getElementById("last-checked-feed-"+a))e.innerHTML=e.getAttribute("data-after-update");try{var h=JSON.parse(this.responseText);if(h.result){var n=h.items_count,c=document.getElementById("items-count-"+a);c&&(c.innerHTML="("+n.items_unread+"/"+n.items_total+")")}b&&b(h)}catch(d){}};c.open("POST","?action=refresh-feed&feed_id="+a,!0);c.send()},UpdateAll:function(){b();var d=setInterval(function(){for(;0c.length;){var b=a.shift();c.push(b);Miniflux.Feed.Update(b, function(b){b=c.indexOf(b.feed_id);0<=b&&c.splice(b,1);0==a.length&&0==c.length&&(clearInterval(d),clearInterval(f),window.location.href="?action=unread")})}},100)}}}(); Miniflux.Item=function(){function d(e){var a=document.getElementById("item-"+e);a||(a=document.getElementById("current-item"),a.getAttribute("data-item-id")!=e&&(a=!1));return a}function b(e){if(e&&e.getAttribute("data-reverse-label")){var a=e.innerHTML;e.innerHTML=e.getAttribute("data-reverse-label");e.setAttribute("data-reverse-label",a)}}function a(e){e=document.getElementById("bookmark-"+e);b(e)}function c(e){e=document.getElementById("status-"+e);b(e)}function f(e){"mouse"!=Miniflux.Event.lastEventType&& Miniflux.Nav.SelectNextItem();e.parentNode.removeChild(e);var a=document.getElementById("page-counter");if(a){e=e.getAttribute("data-item-page");var b=parseInt(a.textContent,10)-1,c=document.getElementsByTagName("article");if(0===b||0===c.length)window.location=location.href;a.textContent=b;switch(e){case "unread":document.title="Miniflux ("+b+")";document.getElementById("nav-counter").textContent="("+b+")";break;case "feed-items":document.title="("+b+") "+a.parentNode.firstChild.nodeValue;break; default:document.title=a.parentNode.textContent}}}function g(e){var a=new XMLHttpRequest;a.onload=function(){if(Miniflux.Nav.IsListing()){var a=d(e);if(a)if(a.getAttribute("data-hide"))f(a);else{a.setAttribute("data-item-status","read");c(e);if(a=document.getElementById("show-"+e)){a.className="read";var b=document.createElement("span");b.id="read-icon-"+e;b.appendChild(document.createTextNode("\u2714 "));a.parentNode.insertBefore(b,a)}(a=document.getElementById("status-"+e))&&a.setAttribute("data-action", -"mark-unread")}}};a.open("POST","?action=mark-item-read&id="+e,!0);a.send()}function m(a){var b=new XMLHttpRequest;b.onload=function(){if(Miniflux.Nav.IsListing()){var b=d(a);if(b)if(b.getAttribute("data-hide"))f(b);else{b.setAttribute("data-item-status","unread");c(a);if(b=document.getElementById("show-"+a))b.className="";(b=document.getElementById("read-icon-"+a))&&b.parentNode.removeChild(b);(b=document.getElementById("status-"+a))&&b.setAttribute("data-action","mark-read")}}};b.open("POST","?action=mark-item-unread&id="+ -a,!0);b.send()}function n(b,c){var d=b.getAttribute("data-item-id"),h=new XMLHttpRequest;h.onload=function(){try{if(JSON.parse(this.responseText).result)if(b.setAttribute("data-item-bookmark",c),c)if(Miniflux.Nav.IsListing()){if(f=document.getElementById("show-"+d)){var h=document.createElement("span");h.id="bookmark-icon-"+d;h.appendChild(document.createTextNode("\u2605 "));f.parentNode.insertBefore(h,f)}a(d)}else{var f=document.getElementById("bookmark-"+d);f&&(f.innerHTML="\u2605")}else if(Miniflux.Nav.IsListing()){var l= -document.getElementById("bookmark-icon-"+d);l&&l.parentNode.removeChild(l);a(d)}else{var q=document.getElementById("bookmark-"+d);q&&(q.innerHTML="\u2606")}}catch(g){}};h.open("POST","?action=bookmark&id="+d+"&value="+c,!0);h.send()}return{Get:d,MarkAsRead:g,MarkAsUnread:m,MarkAsRemoved:function(a){var b=new XMLHttpRequest;b.onload=function(){Miniflux.Nav.IsListing()&&f(d(a))};b.open("POST","?action=mark-item-removed&id="+a,!0);b.send()},SwitchBookmark:function(a){"1"==a.getAttribute("data-item-bookmark")? -n(a,0):n(a,1)},SwitchStatus:function(a){var b=a.getAttribute("data-item-id");a=a.getAttribute("data-item-status");"read"==a?m(b):"unread"==a&&g(b)},Show:function(a){(a=document.getElementById("show-"+a))&&a.click()},OpenOriginal:function(a){var b=document.getElementById("original-"+a);b&&("unread"==d(a).getAttribute("data-item-status")&&g(a),b.removeAttribute("data-action"),b.click())},DownloadContent:function(){var a=document.getElementById("download-item");if(a){var b=a.getAttribute("data-item-id"), +"mark-unread")}}};a.open("POST","?action=mark-item-read&id="+e,!0);a.send()}function l(a){var b=new XMLHttpRequest;b.onload=function(){if(Miniflux.Nav.IsListing()){var b=d(a);if(b)if(b.getAttribute("data-hide"))f(b);else{b.setAttribute("data-item-status","unread");c(a);if(b=document.getElementById("show-"+a))b.className="";(b=document.getElementById("read-icon-"+a))&&b.parentNode.removeChild(b);(b=document.getElementById("status-"+a))&&b.setAttribute("data-action","mark-read")}}};b.open("POST","?action=mark-item-unread&id="+ +a,!0);b.send()}function m(e,b){var c=e.getAttribute("data-item-id"),d=new XMLHttpRequest;d.onload=function(){try{if(JSON.parse(this.responseText).result)if(e.setAttribute("data-item-bookmark",b),b)if(Miniflux.Nav.IsListing()){if(f=document.getElementById("show-"+c)){var d=document.createElement("span");d.id="bookmark-icon-"+c;d.appendChild(document.createTextNode("\u2605 "));f.parentNode.insertBefore(d,f)}a(c)}else{var f=document.getElementById("bookmark-"+c);f&&(f.innerHTML="\u2605")}else if(Miniflux.Nav.IsListing()){var k= +document.getElementById("bookmark-icon-"+c);k&&k.parentNode.removeChild(k);a(c)}else{var p=document.getElementById("bookmark-"+c);p&&(p.innerHTML="\u2606")}}catch(g){}};d.open("POST","?action=bookmark&id="+c+"&value="+b,!0);d.send()}return{Get:d,MarkAsRead:g,MarkAsUnread:l,MarkAsRemoved:function(a){var b=new XMLHttpRequest;b.onload=function(){Miniflux.Nav.IsListing()&&f(d(a))};b.open("POST","?action=mark-item-removed&id="+a,!0);b.send()},SwitchBookmark:function(a){"1"==a.getAttribute("data-item-bookmark")? +m(a,0):m(a,1)},SwitchStatus:function(a){var b=a.getAttribute("data-item-id");a=a.getAttribute("data-item-status");"read"==a?l(b):"unread"==a&&g(b)},Show:function(a){(a=document.getElementById("show-"+a))&&a.click()},OpenOriginal:function(a){var b=document.getElementById("original-"+a);b&&("unread"==d(a).getAttribute("data-item-status")&&g(a),b.removeAttribute("data-action"),b.click())},DownloadContent:function(){var a=document.getElementById("download-item");if(a){var b=a.getAttribute("data-item-id"), c=a.getAttribute("data-before-message"),d=document.createElement("span");d.appendChild(document.createTextNode("\u2600"));d.className="loading-icon";a.innerHTML="";a.className="downloading";a.appendChild(d);a.appendChild(document.createTextNode(" "+c));var f=setInterval(Miniflux.App.BlinkIcon,250),g=new XMLHttpRequest;g.onload=function(){var b=JSON.parse(g.responseText);clearInterval(f);if(b.result){var c=document.getElementById("item-content");c&&(c.innerHTML=b.content);a&&(b=a.getAttribute("data-after-message"), a.innerHTML="",a.appendChild(document.createTextNode(" "+b)))}else a&&(b=a.getAttribute("data-failure-message"),a.innerHTML="",a.appendChild(document.createTextNode(" "+b)))};g.open("POST","?action=download-item&id="+b,!0);g.send()}},MarkListingAsRead:function(a){for(var b=document.getElementsByTagName("article"),c=[],d=0,f=b.length;db-(a.offsetTop+a.offsetHeight)||b-a.offsetTop>document.documentElement.clientHeight)&&window.scrollTo(0,a.offsetTop-10)}function b(){return document.getElementById("listing")?!0:!1}return{GetCurrentItem:function(){return document.getElementById("current-item")},GetCurrentItemId:function(){var a=Miniflux.Nav.GetCurrentItem();return a?a.getAttribute("data-item-id"):null},OpenNextPage:function(){var a=document.getElementById("next-page"); a&&a.click()},OpenPreviousPage:function(){var a=document.getElementById("previous-page");a&&a.click()},SelectNextItem:function(){var a=document.getElementById("next-item");if(a)a.click();else if(b())if(a=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var c=0,f=a.length;c1)throw"scope may not contain double colons: '::'"}var k=function(){var a="",b="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var c=0;c<5;c++)a+=b.charAt(Math.floor(Math.random()*b.length));return a}(),l={},m={},n={},o=!1,p=[],q=function(a,b,c){var d=!1,e=!1;return{origin:b,invoke:function(b,d){if(!n[a])throw"attempting to invoke a callback of a nonexistent transaction: "+a;var e=!1;for(var f=0;f0)for(var k=0;k=0;e--)try{if(c[e].location.href.indexOf(d)===0&&c[e].name===b)return c[e]}catch(f){}return}function i(a){/^https?:\/\//.test(a)||(a=window.location.href);var b=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(a);return b?b[1]:a}function h(){return window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage}function g(){try{var a=navigator.userAgent;return a.indexOf("Fennec/")!=-1||a.indexOf("Firefox/")!=-1&&a.indexOf("Android")!=-1}catch(b){}return!1}function f(){var a=-1;if(navigator.appName==="Microsoft Internet Explorer"){var b=navigator.userAgent,c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");c.exec(b)!=null&&(a=parseFloat(RegExp.$1))}return a>=8}function e(a,b,c){a.detachEvent?a.detachEvent("on"+b,c):a.removeEventListener&&a.removeEventListener(b,c,!1)}function d(a,b,c){a.attachEvent?a.attachEvent("on"+b,c):a.addEventListener&&a.addEventListener(b,c,!1)}var b="__winchan_relay_frame",c="die",k=f();return h()?{open:function(f,h){function s(a){if(a.origin===m)try{var b=JSON.parse(a.data);b.a==="ready"?n.postMessage(q,m):b.a==="error"?(r(),h&&(h(b.d),h=null)):b.a==="response"&&(r(),h&&(h(null,b.d),h=null))}catch(c){}}function r(){l&&document.body.removeChild(l),l=a,p&&(p=clearInterval(p)),e(window,"message",s),e(window,"unload",r);if(o)try{o.close()}catch(b){n.postMessage(c,m)}o=n=a}if(!h)throw"missing required callback argument";var j;f.url||(j="missing required 'url' parameter"),f.relay_url||(j="missing required 'relay_url' parameter"),j&&setTimeout(function(){h(j)},0),f.window_name||(f.window_name=null);if(!f.window_features||g())f.window_features=a;var l,m=i(f.url);if(m!==i(f.relay_url))return setTimeout(function(){h("invalid arguments: origin of url and relay_url must match")},0);var n;k&&(l=document.createElement("iframe"),l.setAttribute("src",f.relay_url),l.style.display="none",l.setAttribute("name",b),document.body.appendChild(l),n=l.contentWindow);var o=window.open(f.url,f.window_name,f.window_features);n||(n=o);var p=setInterval(function(){o&&o.closed&&(r(),h&&(h("unknown closed window"),h=null))},500),q=JSON.stringify({a:"request",d:f.params});d(window,"unload",r),d(window,"message",s);return{close:r,focus:function(){if(o)try{o.focus()}catch(a){}}}},onOpen:function(b){function l(a){if(a.data===c)try{window.close()}catch(b){}}function i(c){var d;try{d=JSON.parse(c.data)}catch(g){}!!d&&d.a==="request"&&(e(window,"message",i),f=c.origin,b&&setTimeout(function(){b(f,d.d,function(c){b=a,h({a:"response",d:c})})},0))}function h(a){a=JSON.stringify(a),k?g.doPost(a,f):g.postMessage(a,f)}var f="*",g=k?j():window.opener;if(!g)throw"can't find relay frame";d(k?g:window,"message",i),d(k?g:window,"message",l);try{h({a:"ready"})}catch(m){d(g,"load",function(a){h({a:"ready"})})}var n=function(){try{e(k?g:window,"message",l)}catch(c){}b&&h({a:"error",d:"client closed window"}),b=a;try{window.close()}catch(d){}};d(window,"unload",n);return{detach:function(){e(window,"unload",n)}}}}:{open:function(a,b,c,d){setTimeout(function(){d("unsupported browser")},0)},onOpen:function(a){setTimeout(function(){a("unsupported browser")},0)}}}();var c=function(){function l(){return c}function k(){c=g()||h()||i()||j();return!c}function j(){if(!(window.JSON&&window.JSON.stringify&&window.JSON.parse))return"JSON_NOT_SUPPORTED"}function i(){if(!a.postMessage)return"POSTMESSAGE_NOT_SUPPORTED"}function h(){try{var b="localStorage"in a&&a.localStorage!==null;if(b)a.localStorage.setItem("test","true"),a.localStorage.removeItem("test");else return"LOCALSTORAGE_NOT_SUPPORTED"}catch(c){return"LOCALSTORAGE_DISABLED"}}function g(){return f()}function f(){var a=e(),b=a>-1&&a<8;if(b)return"BAD_IE_VERSION"}function e(){var a=-1;if(b.appName=="Microsoft Internet Explorer"){var c=b.userAgent,d=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");d.exec(c)!=null&&(a=parseFloat(RegExp.$1))}return a}function d(c,d){b=c,a=d}var a=window,b=navigator,c;return{setTestEnv:d,isSupported:k,getNoSupportReason:l}}();navigator.id||(navigator.id={},navigator.mozId?navigator.id=navigator.mozId:navigator.id={});if(!navigator.id.request||navigator.id._shimmed){var d="https://login.persona.org",e=navigator.userAgent,f=e.indexOf("Fennec/")!=-1||e.indexOf("Firefox/")!=-1&&e.indexOf("Android")!=-1,g=f?a:"menubar=0,location=1,resizable=1,scrollbars=1,status=0,width=700,height=375",h,i={login:null,logout:null,match:null,ready:null},j,k=a;function l(b){b!==!0;if(k===a)k=b;else if(k!=b)throw new Error("you cannot combine the navigator.id.watch() API with navigator.id.getVerifiedEmail() or navigator.id.get()this site should instead use navigator.id.request() and navigator.id.watch()")}var m,n=!1,o=c.isSupported();function p(a){document.addEventListener?document.addEventListener("DOMContentLoaded",function b(){document.removeEventListener("DOMContentLoaded",b),a()},!1):document.attachEvent&&document.readyState&&document.attachEvent("onreadystatechange",function c(){var b=document.readyState;if(b==="loaded"||b==="complete"||b==="interactive")document.detachEvent("onreadystatechange",c),a()})}function q(){if(!!o){var c=window.document;if(!c.body){n||(p(q),n=!0);return}try{if(!m){var e=c.createElement("iframe");e.style.display="none",c.body.appendChild(e),e.src=d+"/communication_iframe",m=b.build({window:e.contentWindow,origin:d,scope:"mozid_ni",onReady:function(){m.call({method:"loaded",success:function(){i.ready&&i.ready()},error:function(){}})}}),m.bind("logout",function(a,b){i.logout&&i.logout()}),m.bind("login",function(a,b){i.login&&i.login(b)}),m.bind("match",function(a,b){i.match&&i.match()}),r(j)&&m.notify({method:"loggedInUser",params:j})}}catch(f){m=a}}}function r(a){return typeof a!="undefined"}function s(a){try{console.warn(a)}catch(b){}}function t(a,b){if(r(a[b])){s(b+" has been deprecated");return!0}}function u(a,b,c){if(r(a[b])&&r(a[c]))throw new Error("you cannot supply *both* "+b+" and "+c);t(a,b)&&(a[c]=a[b],delete a[b])}function v(a){if(typeof a=="object"){if(a.onlogin&&typeof a.onlogin!="function"||a.onlogout&&typeof a.onlogout!="function"||a.onmatch&&typeof a.onmatch!="function"||a.onready&&typeof a.onready!="function")throw new Error("non-function where function expected in parameters to navigator.id.watch()");if(!a.onlogin)throw new Error("'onlogin' is a required argument to navigator.id.watch()");if(!a.onlogout)throw new Error("'onlogout' is a required argument to navigator.id.watch()");i.login=a.onlogin||null,i.logout=a.onlogout||null,i.match=a.onmatch||null,i.ready=a.onready||null,u(a,"loggedInEmail","loggedInUser"),j=a.loggedInUser,q()}}var w;function x(){var a=w;a==="request"&&(i.ready?a="watch_with_onready":a="watch_without_onready");return a}function y(b){t(b,"requiredEmail"),u(b,"tosURL","termsOfService"),u(b,"privacyURL","privacyPolicy"),b.termsOfService&&!b.privacyPolicy&&s("termsOfService ignored unless privacyPolicy also defined"),b.privacyPolicy&&!b.termsOfService&&s("privacyPolicy ignored unless termsOfService also defined"),b.rp_api=x(),w=null,b.start_time=(new Date).getTime();if(h)try{h.focus()}catch(e){}else{if(!c.isSupported()){var f=c.getNoSupportReason(),j="unsupported_dialog";f==="LOCALSTORAGE_DISABLED"&&(j="cookies_disabled"),h=window.open(d+"/"+j,null,g);return}m&&m.notify({method:"dialog_running"}),h=WinChan.open({url:d+"/sign_in",relay_url:d+"/relay",window_features:g,window_name:"__persona_dialog",params:{method:"get",params:b}},function(c,d){if(m){!c&&d&&d.email&&m.notify({method:"loggedInUser",params:d.email});var e=!(c||d&&d.assertion);m.notify({method:"dialog_complete",params:e})}h=a;if(!c&&d&&d.assertion)try{i.login&&i.login(d.assertion)}catch(f){console.log(f);throw f}if(c==="client closed window"||!d)b&&b.oncancel&&b.oncancel(),delete b.oncancel})}}navigator.id={request:function(a){if(this!=navigator.id)throw new Error("all navigator.id calls must be made on the navigator.id object");if(!i.login)throw new Error("navigator.id.watch must be called before navigator.id.request");a=a||{},l(!1),w="request",a.returnTo||(a.returnTo=document.location.pathname);return y(a)},watch:function(a){if(this!=navigator.id)throw new Error("all navigator.id calls must be made on the navigator.id object");l(!1),v(a)},logout:function(a){if(this!=navigator.id)throw new Error("all navigator.id calls must be made on the navigator.id object");q(),m&&m.notify({method:"logout"}),typeof a=="function"&&(s("navigator.id.logout callback argument has been deprecated."),setTimeout(a,0))},get:function(b,c){var d={};c=c||{},d.privacyPolicy=c.privacyPolicy||a,d.termsOfService=c.termsOfService||a,d.privacyURL=c.privacyURL||a,d.tosURL=c.tosURL||a,d.siteName=c.siteName||a,d.siteLogo=c.siteLogo||a,d.backgroundColor=c.backgroundColor||a,w=w||"get";t(c,"silent")?b&&setTimeout(function(){b(null)},0):(l(!0),v({onlogin:function(a){b&&(b(a),b=null)},onlogout:function(){}}),d.oncancel=function(){b&&(b(null),b=null),i.login=i.logout=i.match=i.ready=null},y(d))},getVerifiedEmail:function(a){s("navigator.id.getVerifiedEmail has been deprecated"),l(!0),w="getVerifiedEmail",navigator.id.get(a)},_shimmed:!0}}})() \ No newline at end of file diff --git a/assets/js/popup.js b/assets/js/popup.js index 426d1dd..2de7ed1 100644 --- a/assets/js/popup.js +++ b/assets/js/popup.js @@ -1,7 +1,7 @@ document.onkeypress = function(e) { switch (e.keyCode || e.which) { - case 81: // Q + case 81: // Q case 113: // q window.close(); break; diff --git a/controllers/common.php b/controllers/common.php index ef2adfc..a3ddc89 100644 --- a/controllers/common.php +++ b/controllers/common.php @@ -17,7 +17,7 @@ Router\before(function($action) { } // Redirect to the login form if the user is not authenticated - $ignore_actions = array('login', 'google-auth', 'google-redirect-auth', 'mozilla-auth', 'bookmark-feed', 'select-db'); + $ignore_actions = array('login', 'bookmark-feed', 'select-db'); if (! isset($_SESSION['user']) && ! in_array($action, $ignore_actions)) { @@ -37,13 +37,10 @@ Router\before(function($action) { date_default_timezone_set(Model\Config\get('timezone') ?: 'UTC'); // HTTP secure headers - $frame_src = Model\Config\get_iframe_whitelist();; - $frame_src[] = 'https://login.persona.org'; - Response\csp(array( 'media-src' => '*', 'img-src' => '*', - 'frame-src' => $frame_src + 'frame-src' => Model\Config\get_iframe_whitelist(), )); Response\xframe(); diff --git a/controllers/user.php b/controllers/user.php index 03eb646..ea9a686 100644 --- a/controllers/user.php +++ b/controllers/user.php @@ -1,7 +1,5 @@ Model\Config\get('auth_google_token') !== '', - 'mozilla_auth_enable' => Model\Config\get('auth_mozilla_token') !== '', 'errors' => array(), 'values' => array(), 'databases' => Model\Database\get_list(), @@ -44,105 +40,9 @@ Router\post_action('login', function() { } Response\html(Template\load('login', array( - 'google_auth_enable' => Model\Config\get('auth_google_token') !== '', - 'mozilla_auth_enable' => Model\Config\get('auth_mozilla_token') !== '', 'errors' => $errors, 'values' => $values, 'databases' => Model\Database\get_list(), 'current_database' => Model\Database\select() ))); }); - -// Link to a Google Account (redirect) -Router\get_action('google-redirect-link', function() { - - Response\Redirect(AuthProvider\google_get_url(Helper\get_current_base_url(), '?action=google-link')); -}); - -// Link to a Google Account (association) -Router\get_action('google-link', function() { - - list($valid, $token) = AuthProvider\google_validate(); - - if ($valid) { - Model\Config\save_auth_token('google', $token); - Session\flash(t('Your Google Account is linked to Miniflux.')); - } - else { - Session\flash_error(t('Unable to link Miniflux to your Google Account.')); - } - - Response\redirect('?action=config'); -}); - -// Authenticate with a Google Account (redirect) -Router\get_action('google-redirect-auth', function() { - - Response\Redirect(AuthProvider\google_get_url(Helper\get_current_base_url(), '?action=google-auth')); -}); - -// Authenticate with a Google Account (callback url) -Router\get_action('google-auth', function() { - - list($valid, $token) = AuthProvider\google_validate(); - - if ($valid && $token === Model\Config\get('auth_google_token')) { - - $_SESSION['user'] = array( - 'username' => Model\Config\get('username'), - 'language' => Model\Config\get('language'), - ); - - Response\redirect('?action=unread'); - } - else { - - Response\html(Template\load('login', array( - 'google_auth_enable' => Model\Config\get('auth_google_token') !== '', - 'mozilla_auth_enable' => Model\Config\get('auth_mozilla_token') !== '', - 'errors' => array('login' => t('Unable to authenticate with Google')), - 'values' => array() - ))); - } -}); - -// Authenticate with a Mozilla Persona (ajax check) -Router\post_action('mozilla-auth', function() { - - list($valid, $token) = AuthProvider\mozilla_validate(Request\param('token')); - - if ($valid && $token === Model\Config\get('auth_mozilla_token')) { - - $_SESSION['user'] = array( - 'username' => Model\Config\get('username'), - 'language' => Model\Config\get('language'), - ); - - Response\text('?action=unread'); - } - else { - Response\text("?action=login"); - } -}); - -// Link Miniflux to a Mozilla Account (ajax check) -Router\post_action('mozilla-link', function() { - - list($valid, $token) = AuthProvider\mozilla_validate(Request\param('token')); - - if ($valid) { - Model\Config\save_auth_token('mozilla', $token); - Session\flash(t('Your Mozilla Persona Account is linked to Miniflux.')); - } - else { - Session\flash_error(t('Unable to link Miniflux to your Mozilla Persona Account.')); - } - - Response\text("?action=config"); -}); - -// Remove account link -Router\get_action('unlink-account-provider', function() { - Model\Config\remove_auth_token(Request\param('type')); - Response\redirect('?action=config'); -}); diff --git a/lib/AuthProvider.php b/lib/AuthProvider.php deleted file mode 100644 index daca6c9..0000000 --- a/lib/AuthProvider.php +++ /dev/null @@ -1,94 +0,0 @@ -array( - 'method'=> 'POST', - 'header'=> implode("\r\n", array( - 'Content-type: application/x-www-form-urlencoded', - 'Accept: application/xrds+xml, */*' - )), - 'content' => http_build_query($params, '', '&') - ))); - - $response = file_get_contents('https://www.google.com/accounts/o8/ud', false, $context); - $identity = $_GET['openid_identity']; - - return array(strpos($response, 'is_valid:true') !== false, $identity); -} - - -function mozilla_validate($token) -{ - if (! ini_get('allow_url_fopen')) { - die('You must have "allow_url_fopen=On" to use this feature!'); - } - - $params = array( - 'assertion' => $token, - 'audience' => (isset($_SERVER['HTTPS']) ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'] - ); - - $context = stream_context_create(array( - 'http'=> array( - 'method'=> 'POST', - 'header'=> implode("\r\n", array( - 'Content-type: application/x-www-form-urlencoded', - )), - 'content' => http_build_query($params, '', '&') - ))); - - $body = @file_get_contents('https://verifier.login.persona.org/verify', false, $context); - $response = json_decode($body, true); - - if (! $response) { - return array( - false, - '' - ); - } - - return array( - $response['status'] === 'okay', - $response['email'] - ); -} diff --git a/locales/cs_CZ/translations.php b/locales/cs_CZ/translations.php index ecc32f3..daf957e 100644 --- a/locales/cs_CZ/translations.php +++ b/locales/cs_CZ/translations.php @@ -37,17 +37,6 @@ return array( // 'Go to history' => '', // 'Go to subscriptions' => '', // 'Go to preferences' => '', - // 'Your Google Account is linked to Miniflux' => '', - // 'Link Miniflux to my Google account' => '', - // 'Link Miniflux to my Mozilla Persona account' => '', - // 'Your Google Account is linked to Miniflux.' => '', - // 'Unable to link Miniflux to your Google Account.' => '', - // 'Unable to authenticate with Google' => '', - // 'Your Mozilla Persona Account is linked to Miniflux' => '', - // 'Your Mozilla Persona Account is linked to Miniflux.' => '', - // 'Unable to link Miniflux to your Mozilla Persona Account.' => '', - // 'Login with my Google Account' => '', - // 'Login with my Mozilla Persona Account' => '', // 'Bookmarklet:' => '', // 'Subscribe with Miniflux' => '', // 'Drag and drop this link to your bookmarks' => '', diff --git a/locales/de_DE/translations.php b/locales/de_DE/translations.php index 126c1b3..362b44f 100644 --- a/locales/de_DE/translations.php +++ b/locales/de_DE/translations.php @@ -37,17 +37,6 @@ return array( 'Go to history' => 'Zu dem Verlauf gehen', 'Go to subscriptions' => 'Zu den Abonnements gehen', 'Go to preferences' => 'Zu den Einstellungen gehen', - 'Your Google Account is linked to Miniflux' => 'Dein Google-Account ist mit Miniflux verbunden', - 'Link Miniflux to my Google account' => 'Miniflux mit Google-Account verbinden', - 'Link Miniflux to my Mozilla Persona account' => 'Miniflux mit Mozilla Persona verbinden', - 'Your Google Account is linked to Miniflux.' => 'Dein Google-Account ist mit Miniflux verbunden.', - 'Unable to link Miniflux to your Google Account.' => 'Verbindung von Miniflux mit dem Google-Account fehlgeschlagen.', - 'Unable to authenticate with Google' => 'Authentifizierung mit Google-Account fehlgeschlagen', - 'Your Mozilla Persona Account is linked to Miniflux' => 'Dein "Mozilla Persona"-Account ist mit Miniflux verbunden', - 'Your Mozilla Persona Account is linked to Miniflux.' => 'Dein "Mozilla Persona"-Account ist mit Miniflux verbunden.', - 'Unable to link Miniflux to your Mozilla Persona Account.' => 'Verbindung von Miniflux mit dem "Mozilla Persona"-Account fehlgeschlagen.', - 'Login with my Google Account' => 'Mit Google-Account anmelden', - 'Login with my Mozilla Persona Account' => 'Mit Mozilla Persona anmelden', 'Bookmarklet:' => 'Bookmarklet:', 'Subscribe with Miniflux' => 'Mit Miniflux abonnieren', 'Drag and drop this link to your bookmarks' => 'Ziehe diesen Link in deine Lesezeichen', diff --git a/locales/es_ES/translations.php b/locales/es_ES/translations.php index 0ba9b63..0ff0c25 100644 --- a/locales/es_ES/translations.php +++ b/locales/es_ES/translations.php @@ -37,17 +37,6 @@ return array( 'Go to history' => 'Ir al historial', 'Go to subscriptions' => 'Ir a suscripciones', 'Go to preferences' => 'Ir a preferencias', - 'Your Google Account is linked to Miniflux' => 'Su cuenta de Google está vinculada con Miniflux', - 'Link Miniflux to my Google account' => 'Vincular Miniflux con mi cuenta de Google', - 'Link Miniflux to my Mozilla Persona account' => 'Vincular Miniflux con mi cuenta de Mozilla Persona', - 'Your Google Account is linked to Miniflux.' => 'Su cuenta de Google está vinculada con Miniflux.', - 'Unable to link Miniflux to your Google Account.' => 'No se puede vincular Miniflux con su cuenta de Google.', - 'Unable to authenticate with Google' => 'No se puede autenticar con Google', - // 'Your Mozilla Persona Account is linked to Miniflux' => '', - 'Your Mozilla Persona Account is linked to Miniflux.' => 'Su cuenta de Mozilla Persona está vinculada con Miniflux.', - 'Unable to link Miniflux to your Mozilla Persona Account.' => 'No se puede vincular Miniflux con su cuenta de Mozilla Persona.', - 'Login with my Google Account' => 'Iniciar sesión con mi cuenta de Google', - 'Login with my Mozilla Persona Account' => 'Iniciar sesión con mi cuenta de Mozilla Persona', 'Bookmarklet:' => 'Bookmarklet:', 'Subscribe with Miniflux' => 'Suscribir con Miniflux', 'Drag and drop this link to your bookmarks' => 'Arrastrar y soltar el enlace en los marcadores', diff --git a/locales/fr_FR/translations.php b/locales/fr_FR/translations.php index 5e3df14..827ff8a 100644 --- a/locales/fr_FR/translations.php +++ b/locales/fr_FR/translations.php @@ -37,17 +37,6 @@ return array( 'Go to history' => 'Voir l\'historique', 'Go to subscriptions' => 'Voir les abonnements', 'Go to preferences' => 'Voir les préférences', - 'Your Google Account is linked to Miniflux' => 'Votre compte Google est relié à Miniflux', - 'Link Miniflux to my Google account' => 'Lier Miniflux à mon compte Google', - 'Link Miniflux to my Mozilla Persona account' => 'Lier Miniflux à mon compte Mozilla Persona', - 'Your Google Account is linked to Miniflux.' => 'Votre compte Google est relié à Miniflux.', - 'Unable to link Miniflux to your Google Account.' => 'Impossible de lier Miniflux à votre compte Google', - 'Unable to authenticate with Google' => 'Impossible de s\'authentifier avec Google', - 'Your Mozilla Persona Account is linked to Miniflux' => 'Votre compte Mozilla Persona est lié avec Miniflux', - 'Your Mozilla Persona Account is linked to Miniflux.' => 'Votre compte Mozilla Persona est lié avec Miniflux.', - 'Unable to link Miniflux to your Mozilla Persona Account.' => 'Impossible de lier Miniflux avec votre compte Mozilla Persona.', - 'Login with my Google Account' => 'Se connecter avec mon compte Google', - 'Login with my Mozilla Persona Account' => 'Se connecter avec mon compte Mozilla Persona', 'Bookmarklet:' => 'Bookmarklet :', 'Subscribe with Miniflux' => 'S\'abonner avec Miniflux', 'Drag and drop this link to your bookmarks' => 'Glisser-déposer ce lien dans vos favoris', diff --git a/locales/it_IT/translations.php b/locales/it_IT/translations.php index 7ddf02d..0b0d4f1 100644 --- a/locales/it_IT/translations.php +++ b/locales/it_IT/translations.php @@ -37,17 +37,6 @@ return array( // 'Go to history' => '', // 'Go to subscriptions' => '', // 'Go to preferences' => '', - // 'Your Google Account is linked to Miniflux' => '', - // 'Link Miniflux to my Google account' => '', - // 'Link Miniflux to my Mozilla Persona account' => '', - // 'Your Google Account is linked to Miniflux.' => '', - // 'Unable to link Miniflux to your Google Account.' => '', - // 'Unable to authenticate with Google' => '', - // 'Your Mozilla Persona Account is linked to Miniflux' => '', - // 'Your Mozilla Persona Account is linked to Miniflux.' => '', - // 'Unable to link Miniflux to your Mozilla Persona Account.' => '', - // 'Login with my Google Account' => '', - // 'Login with my Mozilla Persona Account' => '', // 'Bookmarklet:' => '', // 'Subscribe with Miniflux' => '', // 'Drag and drop this link to your bookmarks' => '', diff --git a/locales/pt_BR/translations.php b/locales/pt_BR/translations.php index 38c3f23..4e37869 100644 --- a/locales/pt_BR/translations.php +++ b/locales/pt_BR/translations.php @@ -37,17 +37,6 @@ return array( // 'Go to history' => '', // 'Go to subscriptions' => '', // 'Go to preferences' => '', - // 'Your Google Account is linked to Miniflux' => '', - // 'Link Miniflux to my Google account' => '', - // 'Link Miniflux to my Mozilla Persona account' => '', - // 'Your Google Account is linked to Miniflux.' => '', - // 'Unable to link Miniflux to your Google Account.' => '', - // 'Unable to authenticate with Google' => '', - // 'Your Mozilla Persona Account is linked to Miniflux' => '', - // 'Your Mozilla Persona Account is linked to Miniflux.' => '', - // 'Unable to link Miniflux to your Mozilla Persona Account.' => '', - // 'Login with my Google Account' => '', - // 'Login with my Mozilla Persona Account' => '', // 'Bookmarklet:' => '', // 'Subscribe with Miniflux' => '', // 'Drag and drop this link to your bookmarks' => '', diff --git a/locales/zh_CN/translations.php b/locales/zh_CN/translations.php index aae0213..15ad10e 100644 --- a/locales/zh_CN/translations.php +++ b/locales/zh_CN/translations.php @@ -37,17 +37,6 @@ return array( // 'Go to history' => '', // 'Go to subscriptions' => '', // 'Go to preferences' => '', - // 'Your Google Account is linked to Miniflux' => '', - // 'Link Miniflux to my Google account' => '', - // 'Link Miniflux to my Mozilla Persona account' => '', - // 'Your Google Account is linked to Miniflux.' => '', - // 'Unable to link Miniflux to your Google Account.' => '', - // 'Unable to authenticate with Google' => '', - // 'Your Mozilla Persona Account is linked to Miniflux' => '', - // 'Your Mozilla Persona Account is linked to Miniflux.' => '', - // 'Unable to link Miniflux to your Mozilla Persona Account.' => '', - // 'Login with my Google Account' => '', - // 'Login with my Mozilla Persona Account' => '', // 'Bookmarklet:' => '', // 'Subscribe with Miniflux' => '', // 'Drag and drop this link to your bookmarks' => '', diff --git a/models/config.php b/models/config.php index 00ecb19..225271d 100644 --- a/models/config.php +++ b/models/config.php @@ -241,8 +241,6 @@ function get_all() 'feed_token', 'fever_token', 'bookmarklet_token', - 'auth_google_token', - 'auth_mozilla_token', 'items_sorting_direction', 'items_display_mode', 'redirect_nothing_to_read', diff --git a/templates/config.php b/templates/config.php index ca39bdb..f3dfdc2 100644 --- a/templates/config.php +++ b/templates/config.php @@ -49,23 +49,6 @@
-
    -
  • - - , - - - -
  • -
  • - - , - - - -
  • -
-
diff --git a/templates/login.php b/templates/login.php index 869833b..f1a548b 100644 --- a/templates/login.php +++ b/templates/login.php @@ -4,18 +4,14 @@ - + - - - - + + + + Miniflux - - - -
@@ -38,14 +34,6 @@
- -


- - - -


- -