diff --git a/maloja/__pkginfo__.py b/maloja/__pkginfo__.py index e56f2f1..982dceb 100644 --- a/maloja/__pkginfo__.py +++ b/maloja/__pkginfo__.py @@ -5,7 +5,7 @@ author = { "email":"maloja@krateng.dev", "github": "krateng" } -version = 2,7,7 +version = 2,7,8 versionstr = ".".join(str(n) for n in version) links = { "pypi":"malojaserver", diff --git a/maloja/database.py b/maloja/database.py index f2e9985..04fcb63 100644 --- a/maloja/database.py +++ b/maloja/database.py @@ -246,7 +246,7 @@ def normalize_name(name): # skip regular authentication if api key is present in request # an api key now ONLY permits scrobbling tracks, no other admin tasks def api_key_correct(request): - args = request.query + args = request.params if "key" in args: apikey = args["key"] del args["key"] diff --git a/maloja/web/jinja/admin_overview.jinja b/maloja/web/jinja/admin_overview.jinja index 5c0d285..bcef3f5 100644 --- a/maloja/web/jinja/admin_overview.jinja +++ b/maloja/web/jinja/admin_overview.jinja @@ -74,4 +74,11 @@ Report Issue
Readme
PyPi
+ {% if false %} +

Change Password

+ +
+

+ Change + {% endif %} {% endblock %} diff --git a/maloja/web/jinja/error.jinja b/maloja/web/jinja/error.jinja index 3fe843b..215408a 100644 --- a/maloja/web/jinja/error.jinja +++ b/maloja/web/jinja/error.jinja @@ -1,4 +1,5 @@ {% extends "abstracts/base.jinja" %} +{% block title %}Maloja - Error{% endblock %} {% block content %} diff --git a/maloja/web/proxy.html b/maloja/web/proxy.html deleted file mode 100644 index e91f7a2..0000000 --- a/maloja/web/proxy.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - Maloja - Proxyscrobble - - - - - - -
- - - - -
-
-
-

Proxyscrobble

- -

Duplicate your scrobbles to another service. - Your API key is required to make any changes to the server:

-
- - - - - KEY_STATUS_LASTFM - -
Last.fm
- - - - diff --git a/maloja/web/proxy.py b/maloja/web/proxy.py deleted file mode 100644 index 0973aa0..0000000 --- a/maloja/web/proxy.py +++ /dev/null @@ -1,53 +0,0 @@ -from doreah.settings import get_settings, update_settings -import urllib.request -import hashlib -import xml.etree.ElementTree as ET -from bottle import redirect, request -from ..database import checkAPIkey -from ..external import lfmbuild - -def instructions(keys): - authenticated = False - if "Cookie" in request.headers: - cookies = request.headers["Cookie"].split(";") - for c in cookies: - if c.strip().startswith("apikey="): - authenticated = checkAPIkey(c.strip()[7:]) - - if "token" in keys and authenticated: - token = keys.get("token") - parameters = { - "method":"auth.getSession", - "token":token, - "api_key":get_settings("LASTFM_API_KEY") - } - response = urllib.request.urlopen("http://ws.audioscrobbler.com/2.0/?" + lfmbuild(parameters)) - xml = response.read() - data = ET.fromstring(xml) - if data.attrib.get("status") == "ok": - username = data.find("session").find("name").text - sessionkey = data.find("session").find("key").text - - update_settings("settings/settings.ini",{"LASTFM_API_SK":sessionkey,"LASTFM_USERNAME":username},create_new=True) - - return "/proxy" - - else: - key,secret,sessionkey,name = get_settings("LASTFM_API_KEY","LASTFM_API_SECRET","LASTFM_API_SK","LASTFM_USERNAME") - - if key is None: - lastfm = "No Last.fm key provided" - elif secret is None: - lastfm = "No Last.fm secret provided" - elif sessionkey is None and authenticated: - url = "http://www.last.fm/api/auth/?api_key=" + key + "&cb=" - lastfm = "
Connect
" - elif sessionkey is None: - lastfm = "Not active" - else: - - lastfm = "Account: " + name + "" - - - - return {"KEY_STATUS_LASTFM":lastfm},[]