From 849ebd28a2388e3257cb360a4609d3e9dfc77dc0 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 6 Aug 2015 14:06:07 -0400 Subject: ok --- backend/views.py | 11 ++++++++--- frontend/static/js/src/auth.js | 2 +- frontend/templates/base.html | 3 +-- frontend/templates/faq.html | 26 ++++++++++++++++---------- frontend/templates/pas | 14 ++++++++++++++ frontend/templates/password_reset/reset.html | 23 +++++++++++++++++++++++ scannerjammer/urls.py | 2 +- 7 files changed, 64 insertions(+), 17 deletions(-) create mode 100644 frontend/templates/pas create mode 100644 frontend/templates/password_reset/reset.html diff --git a/backend/views.py b/backend/views.py index 5e24078..1d7d431 100755 --- a/backend/views.py +++ b/backend/views.py @@ -384,8 +384,8 @@ def api_auth_login(request): user = auth.authenticate(username=request.POST['username'], password=request.POST['password']) #any idea? well for login to work i think ajax should send cookies, but i don't see any django cookies there - if not user: - return response_error('NO USER') +# if not user: +# return response_error('NO USER') if user: if user.is_active: auth.login(request, user) @@ -399,7 +399,10 @@ def api_auth_login(request): return response_error('WRONG PASSWORD') else: return response_error('NO SUCH USER') - +# ok just wrong password +# other weird thing is that when I enter it, the form submission goes nuts and keeps submitting, do you have that issue? yep +#what could that be, js thing? looks so it's as though it's not doing the right password formula, like when I reset the password with +# the reset link, it's doing a different type of hashing or something? could be, let's check database again @require_POST def api_auth_logout(request): """ Log out user. Public API @@ -438,6 +441,7 @@ def api_auth_register(request): """ Register new user. Public API """ form_fields = ['username', 'password'] +#was there any preprocessing for password on js side? maybe so do you see any here? response = check_form_fields(request, form_fields) if response: return response @@ -1071,6 +1075,7 @@ def api_video_search(request): if response: return response + response = response_success() #like this? hope so videos = SearchQuerySet().filter(content=request.POST['q']).load_all() for searchresult in videos.all(): v = searchresult.object diff --git a/frontend/static/js/src/auth.js b/frontend/static/js/src/auth.js index 42a92c5..b1df019 100644 --- a/frontend/static/js/src/auth.js +++ b/frontend/static/js/src/auth.js @@ -10,7 +10,7 @@ var Auth = d.warn("LOG IN") var username = d.trim( $("#login-username").val() ) var password = d.trim( $("#login-password").val() ) - var pwhash = $.md5("scanjam"+password) + var pwhash = $.md5("scanjam"+password) if (! username || ! password) return Main.enter = false d.warn("LOGGING IN") diff --git a/frontend/templates/base.html b/frontend/templates/base.html index 7591cfd..1f35b37 100644 --- a/frontend/templates/base.html +++ b/frontend/templates/base.html @@ -1,4 +1,3 @@ -helloh -{% block title %}{% endblock %}t +{% block title %}{% endblock %} {% block content %}{% endblock %} diff --git a/frontend/templates/faq.html b/frontend/templates/faq.html index 40b5b0b..e74f211 100755 --- a/frontend/templates/faq.html +++ b/frontend/templates/faq.html @@ -71,11 +71,16 @@ body, html } #likebutton { + display:none; float: right; - display: inline-block; - width: 90px; - height: 21px; +// display: inline-block; +// width: 90px; +// height: 21px; } +#u_0_0{ + display:none; + pointer-events: none; +} h3 { @@ -255,13 +260,14 @@ post a youtube url into the chat and begin. also, you should say hello to whomev yes. we can play any Vimeo or Soundcloud url.

-

how can I help scannerjammer, I like this site!

-
- -
-

- click the like button. it's crucial ------------------> -

+ + + + + + + +

how do I improve my fav score?

diff --git a/frontend/templates/pas b/frontend/templates/pas new file mode 100644 index 0000000..0fb5d5c --- /dev/null +++ b/frontend/templates/pas @@ -0,0 +1,14 @@ +{% extends "password_reset/base.html" %}{% load i18n %}{% load url from future %} + +{% block content %} + {% if invalid %}{% url "password_reset_recover" as recovery_url %} +

{% blocktrans %}Sorry, this password reset link is invalid. You can still request a new one.{% endblocktrans %}

+ {% else %} +

{% blocktrans %}Hi, {{ username }}. Please choose your new password.{% endblocktrans %}

+
+ {% csrf_token %} + {{ form.as_p }} +

+
+ {% endif %} +{% endblock %} diff --git a/frontend/templates/password_reset/reset.html b/frontend/templates/password_reset/reset.html new file mode 100644 index 0000000..df5bd5e --- /dev/null +++ b/frontend/templates/password_reset/reset.html @@ -0,0 +1,23 @@ +{% extends "password_reset/base.html" %}{% load i18n %}{% load url from future %} + +{% block content %} + {% if invalid %}{% url "password_reset_recover" as recovery_url %} +

{% blocktrans %}Sorry, this password reset link is invalid. You can still request a new one.{% endblocktrans %}

+ {% else %} +

{% blocktrans %}Hi, {{ username }}. Please choose your new password.{% endblocktrans %}

+
+ {% csrf_token %} + {{ form.as_p }} +

+
+ + + + {% endif %} +{% endblock %} diff --git a/scannerjammer/urls.py b/scannerjammer/urls.py index de316f7..382e1a3 100755 --- a/scannerjammer/urls.py +++ b/scannerjammer/urls.py @@ -11,7 +11,7 @@ admin.autodiscover() urlpatterns = patterns('', url(r'^recover/(?P.+)/$', views.recover_done, name='password_reset_sent'), - url(r'^recover/$', views.recover, name='password_reset_recover'), + url(r'^recover/?$', views.recover, name='password_reset_recover'), url(r'^reset/done/$', views.reset_done, name='password_reset_done'), url(r'^reset/(?P[\w:-]+)/$', views.reset, name='password_reset_reset'), -- cgit v1.2.3-70-g09d2