diff options
| author | root <root@dino.fm> | 2015-08-06 14:06:07 -0400 |
|---|---|---|
| committer | root <root@dino.fm> | 2015-08-06 14:06:07 -0400 |
| commit | 849ebd28a2388e3257cb360a4609d3e9dfc77dc0 (patch) | |
| tree | 3bbf18032f25e25d371ac1c96e79b1f8f4a9b5c0 | |
| parent | eb77110c49b06606533add8a4a16e04565926fab (diff) | |
ok
| -rwxr-xr-x | backend/views.py | 11 | ||||
| -rw-r--r-- | frontend/static/js/src/auth.js | 2 | ||||
| -rw-r--r-- | frontend/templates/base.html | 3 | ||||
| -rwxr-xr-x | frontend/templates/faq.html | 26 | ||||
| -rw-r--r-- | frontend/templates/pas | 14 | ||||
| -rw-r--r-- | frontend/templates/password_reset/reset.html | 23 | ||||
| -rwxr-xr-x | scannerjammer/urls.py | 2 |
7 files changed, 64 insertions, 17 deletions
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. </p> -<h3>how can I help scannerjammer, I like this site!</h3> - <div id="likebutton"> - <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://scannerjammer.com:17769/" layout="button_count" show_faces="false" width="90" font=""></fb:like> - </div> -<p> - click the like button. it's crucial ------------------> -</p> +<!--<h3>how can I help scannerjammer, I like this site!</h3>--> +<!-- <div id="likebutton">--> +<!-- <style type="text/css">#fake-like-rapper{display: inline-block;margin:0;padding:0;}#fake-like-rapper div{float:left;margin:0;padding:0;}#like-fake div.connect_widget_button_count_including, td.connect_widget_simple_including{margin:0;padding:0;}#like-fake td, td.label{font-size: 11px;text-align: left;margin:0;padding:0;}#like-fake{font-size: 11px;font-family:"lucida grande",tahoma,verdana,arial,sans-serif;color:#333;line-height:1.28;text-align: left;direction: ltr;margin-top: 1px !important; margin-left: -2px!important;position: relative;float:left;}#like-fake .uiGrid{border: 0;border-collapse: collapse;border-spacing: 0;}#like-fake .connect_widget_button_count_count{background: white;border: 1px solid #D1D1D1;float: left;font-weight: normal;height: 14px;margin-left: 1px;min-width: 17px;padding: 1px 2px 1px 2px;text-align: center;line-height: 14px;white-space: nowrap;}#like-fake .connect_widget_button_count_nub s, #like-fake .connect_widget_button_count_nub i{border: solid transparent;border-right-color: #D7D7D7;top: 1px;display: block;position: relative;border-width: 4px 5px 4px 0;}#like-fake .connect_widget_button_count_nub i{left: 2px;top: -7px;border-right-color: white;}#like-fake .connect_widget_button_count_nub {float: left; position: relative; height: 0; width: 5px; top: -5px; left: 2px; }</style><div id="fake-like-rapper"><div class="fb-like" data-href="http://scannerjammer.com" data-send="false" data-layout="button_count" data-width="48" data-show-faces="false" data-font="arial" style="width: 48px; height: 20px; overflow: hidden;"></div><div id="like-fake"><div class="connect_widget_button_count_including"><table class="uiGrid" cellspacing="0" cellpadding="0"><tbody><tr><td><div class="thumbs_up hidden_elem"></div></td><td><div class="undo hidden_elem"></div></td></tr><tr><td><div class="connect_widget_button_count_nub"><s></s><i></i></div></td><td><div class="connect_widget_button_count_count">8k</div></td></tr></tbody></table></div></div></div>--> +<!-- <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://scannerjammer.com:17769/" layout="button_count" show_faces="false" width="90" font=""></fb:like>--> +<!-- </div>--> +<!--<p>--> +<!-- click the like button. it's crucial ------------------>--> +<!--</p>--> <h3>how do I improve my fav score?</h3> <p> 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 %} + <p>{% blocktrans %}Sorry, this password reset link is invalid. You can still <a href="{{ recovery_url }}">request a new one</a>.{% endblocktrans %}</p> + {% else %} + <p>{% blocktrans %}Hi, <strong>{{ username }}</strong>. Please choose your new password.{% endblocktrans %}</p> + <form method="post" action="{% url "password_reset_reset" token %}"> + {% csrf_token %} + {{ form.as_p }} + <p><input type="submit" value="{% trans "Set new password" %}"></p> + </form> + {% 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 %} + <p>{% blocktrans %}Sorry, this password reset link is invalid. You can still <a href="{{ recovery_url }}">request a new one</a>.{% endblocktrans %}</p> + {% else %} + <p>{% blocktrans %}Hi, <strong>{{ username }}</strong>. Please choose your new password.{% endblocktrans %}</p> + <form method="post" action="{% url "password_reset_reset" token %}"> + {% csrf_token %} + {{ form.as_p }} + <p><input type="submit" onclick="changepwd()" value="{% trans "Set new password" %}"></p> + </form> + <script src="/static/js/src/jquery-1.5.2.min.js"></script> + <script src="/static/js/src/jquery.md5.js"></script> + <script> + function changepwd(){ + $('#id_password1').val( $.md5("scanjam" + $("#id_password1").val() ) ); + $('#id_password2').val( $.md5("scanjam" + $("#id_password2").val() ) ); + return true; + } + </script> + {% 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<signature>.+)/$', 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<token>[\w:-]+)/$', views.reset, name='password_reset_reset'), |
