添加了登陆,修改密码,注册三个页面的csrf;

添加了usernameCheck的valuedation检测方法;
urls.py 添加了register,change_password页面。
This commit is contained in:
sxw committed 2015-08-04 16:05:40 +08:00
1 parent 68c5a580d7
commit 62a9e050f5
8 files changed
+75 -5

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
define("csrf",function(){
function get_cookie(cookie_name) {
var name = cookie_name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1);
if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
}
return "";
}
function csrfHeader(xhr){
xhr.setRequestHeader("X-CSRFToken", get_cookie("csrftoken"));
}
return csrfHeader;
});
+2 -1
View File
@@ -8,7 +8,8 @@ define("validation",
'validator/date',
'validator/integer',
'validator/between',
'validator/confirm'],
'validator/confirm',
'validator/usernameCheck'],
function () {
});