Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
fda977b1
Commit
fda977b1
authored
Mar 03, 2019
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for users with umlauts
parent
68a36597
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
opds.py
cps/opds.py
+5
-1
osd.xml
cps/templates/osd.xml
+1
-1
web.py
cps/web.py
+2
-1
No files found.
cps/opds.py
View file @
fda977b1
...
...
@@ -36,6 +36,7 @@ import helper
from
werkzeug.security
import
check_password_hash
from
werkzeug.datastructures
import
Headers
from
web
import
download_required
import
sys
try
:
from
urllib.parse
import
quote
except
ImportError
:
...
...
@@ -300,7 +301,10 @@ def feed_search(term):
return
render_xml_template
(
'feed.xml'
,
searchterm
=
""
)
def
check_auth
(
username
,
password
):
user
=
ub
.
session
.
query
(
ub
.
User
)
.
filter
(
func
.
lower
(
ub
.
User
.
nickname
)
==
username
.
lower
())
.
first
()
if
sys
.
version_info
.
major
==
3
:
username
=
username
.
encode
(
'windows-1252'
)
user
=
ub
.
session
.
query
(
ub
.
User
)
.
filter
(
func
.
lower
(
ub
.
User
.
nickname
)
==
username
.
decode
(
'utf-8'
)
.
lower
())
.
first
()
return
bool
(
user
and
check_password_hash
(
user
.
password
,
password
))
...
...
cps/templates/osd.xml
View file @
fda977b1
...
...
@@ -6,7 +6,7 @@
<Developer>
Janeczku
</Developer>
<Contact>
https://github.com/janeczku/calibre-web
</Contact>
<Url
type=
"text/html"
template=
"{{url_for('opds.feed_cc_search')}}
?query=
{searchTerms}"
/>
template=
"{{url_for('opds.feed_cc_search')}}{searchTerms}"
/>
<Url
type=
"application/atom+xml"
template=
"{{url_for('opds.feed_normal_search')}}?query={searchTerms}"
/>
<SyndicationRight>
open
</SyndicationRight>
...
...
cps/web.py
View file @
fda977b1
...
...
@@ -46,6 +46,7 @@ from cps import lm, babel, ub, config, get_locale, language_table, app, db
from
pagination
import
Pagination
from
sqlalchemy.sql.expression
import
text
feature_support
=
dict
()
try
:
from
oauth_bb
import
oauth_check
,
register_user_with_oauth
,
logout_oauth_user
,
get_oauth_status
...
...
@@ -1349,7 +1350,7 @@ def login():
def
logout
():
if
current_user
is
not
None
and
current_user
.
is_authenticated
:
logout_user
()
if
feature_support
[
'oauth'
]:
if
feature_support
[
'oauth'
]
and
(
config
.
config_login_type
==
2
or
config
.
config_login_type
==
3
)
:
logout_oauth_user
()
return
redirect
(
url_for
(
'web.login'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment