summaryrefslogtreecommitdiff
path: root/drupal_auth/backends.py
diff options
context:
space:
mode:
authorJayaram Pai2013-12-05 21:25:35 +0530
committerJayaram Pai2013-12-05 21:25:35 +0530
commit41e5496301cd02bff34dad877d20b2dd30349866 (patch)
tree587de041ff2c6820c7b2a9fc0c4ab87a6c2eb63a /drupal_auth/backends.py
parente0bbd9f308e03d1d4e5b2f1e668b8958c81c039e (diff)
downloadspoken-tutorial-forums-41e5496301cd02bff34dad877d20b2dd30349866.tar.gz
spoken-tutorial-forums-41e5496301cd02bff34dad877d20b2dd30349866.tar.bz2
spoken-tutorial-forums-41e5496301cd02bff34dad877d20b2dd30349866.zip
something works :)
Diffstat (limited to 'drupal_auth/backends.py')
-rw-r--r--drupal_auth/backends.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/drupal_auth/backends.py b/drupal_auth/backends.py
new file mode 100644
index 0000000..1caa1f0
--- /dev/null
+++ b/drupal_auth/backends.py
@@ -0,0 +1,23 @@
+from django.contrib.auth.models import User
+from django.contrib.auth import get_user_model
+from django.shortcuts import render_to_response, get_object_or_404
+
+User = get_user_model()
+
+class DrupalAuthBackend(object):
+ def authenticate(self, username=None, password=None):
+ try:
+ user = User(name='cheese')
+ user.is_active = True
+ user.is_authenticated = True
+ return user
+ except Exception, e:
+ print e.message
+ print "blaj"*1000
+
+ def get_user(self, user_id):
+ try:
+ print "Hello"*1000
+ return User.objects.get(pk=user_id)
+ except User.DoesNotExist:
+ return None