'app_name': APP_SHORT_NAME,
}
+class UserLoginAction(ActionProxy):
+ verb = _("logged in")
+
+ def describe(self, viewer=None):
+ return _("%(user)s %(have_has)s logged in") % {
+ 'user' : self.hyperlink(self.user.get_profile_url(), self.friendly_username(viewer, self.user)),
+ 'have_has': self.viewer_or_user_verb(viewer, self.user, _('have'), _('has')),
+ }
+
class EmailValidationAction(ActionProxy):
verb = _("validated e-mail")
from forum.authentication.base import InvalidAuthentication
from forum.authentication import AUTH_PROVIDERS
from forum.models import User, AuthKeyUserAssociation, ValidationHash
-from forum.actions import UserJoinsAction
+from forum.actions import UserJoinsAction, UserLoginAction
from forum import settings
from vars import ON_SIGNIN_SESSION_ATTR, PENDING_SUBMISSION_SESSION_ATTR
user.backend = "django.contrib.auth.backends.ModelBackend"
login(request, user)
+ # Store the login action
+ UserLoginAction(user=user, ip=request.META['REMOTE_ADDR']).save()
+
if message is None:
message = _("Welcome back %s, you are now logged in") % smart_unicode(user.username)
weight = 100
human_name = 'Facebook'
code_template = 'modules/facebookauth/button.html'
- extra_css = ["http://www.facebook.com/css/connect/connect_button.css"]
+ extra_css = []
API_KEY = settings.FB_API_KEY
\ No newline at end of file