]> git.openstreetmap.org Git - osqa.git/blob - forum_modules/openidauth/authentication.py
Fixes for http://jira.osqa.net/browse/OSQA-187
[osqa.git] / forum_modules / openidauth / authentication.py
1 from consumer import OpenIdAbstractAuthConsumer
2 from forum.authentication.base import ConsumerTemplateContext
3
4 class GoogleAuthConsumer(OpenIdAbstractAuthConsumer):
5     def get_user_url(self, request):
6         return 'https://www.google.com/accounts/o8/id'
7
8 class GoogleAuthContext(ConsumerTemplateContext):
9     mode = 'BIGICON'
10     type = 'DIRECT'
11     weight = 200
12     human_name = 'Google'
13     icon = '/media/images/openid/google.gif'
14
15
16
17 class YahooAuthConsumer(OpenIdAbstractAuthConsumer):
18     def get_user_url(self, request):
19         return 'http://yahoo.com/'
20
21 class YahooAuthContext(ConsumerTemplateContext):
22     mode = 'BIGICON'
23     type = 'DIRECT'
24     weight = 300
25     human_name = 'Yahoo'
26     icon = '/media/images/openid/yahoo.gif'
27
28
29
30 class AolAuthConsumer(OpenIdAbstractAuthConsumer):
31     def get_user_url(self, request):
32         uname = request.POST['input_field']
33         return 'http://openid.aol.com/' + uname
34
35 class AolAuthContext(ConsumerTemplateContext):
36     mode = 'BIGICON'
37     type = 'SIMPLE_FORM'
38     simple_form_context = {
39         'your_what': 'AOL screen name'
40     }
41     weight = 400
42     human_name = 'AOL'
43     icon = '/media/images/openid/aol.gif'
44
45
46 class MyOpenIdAuthConsumer(OpenIdAbstractAuthConsumer):
47     def get_user_url(self, request):
48         blog_name = request.POST['input_field']
49         return "http://%s.myopenid.com/" % blog_name
50
51 class MyOpenIdAuthContext(ConsumerTemplateContext):
52     mode = 'SMALLICON'
53     type = 'SIMPLE_FORM'
54     simple_form_context = {
55         'your_what': 'MyOpenID user name'
56     }
57     weight = 200
58     human_name = 'MyOpenID'
59     icon = '/media/images/openid/myopenid.png'
60
61
62 class FlickrAuthConsumer(OpenIdAbstractAuthConsumer):
63     def get_user_url(self, request):
64         blog_name = request.POST['input_field']
65         return "http://flickr.com/%s/" % blog_name
66
67 class FlickrAuthContext(ConsumerTemplateContext):
68     mode = 'SMALLICON'
69     type = 'SIMPLE_FORM'
70     simple_form_context = {
71         'your_what': 'Flickr user name'
72     }
73     weight = 250
74     human_name = 'Flickr'
75     icon = '/media/images/openid/flickr.png'
76
77
78 class TechnoratiAuthConsumer(OpenIdAbstractAuthConsumer):
79     def get_user_url(self, request):
80         blog_name = request.POST['input_field']
81         return "http://technorati.com/people/technorati/%s/" % blog_name
82
83 class TechnoratiAuthContext(ConsumerTemplateContext):
84     mode = 'SMALLICON'
85     type = 'SIMPLE_FORM'
86     simple_form_context = {
87         'your_what': 'Technorati user name'
88     }
89     weight = 260
90     human_name = 'Technorati'
91     icon = '/media/images/openid/technorati.png'
92
93
94 class WordpressAuthConsumer(OpenIdAbstractAuthConsumer):
95     def get_user_url(self, request):
96         blog_name = request.POST['input_field']
97         return "http://%s.wordpress.com/" % blog_name
98
99 class WordpressAuthContext(ConsumerTemplateContext):
100     mode = 'SMALLICON'
101     type = 'SIMPLE_FORM'
102     simple_form_context = {
103         'your_what': 'Wordpress blog name'
104     }
105     weight = 270
106     human_name = 'Wordpress'
107     icon = '/media/images/openid/wordpress.png'
108
109
110 class BloggerAuthConsumer(OpenIdAbstractAuthConsumer):
111     def get_user_url(self, request):
112         blog_name = request.POST['input_field']
113         return "http://%s.blogspot.com/" % blog_name
114
115 class BloggerAuthContext(ConsumerTemplateContext):
116     mode = 'SMALLICON'
117     type = 'SIMPLE_FORM'
118     simple_form_context = {
119         'your_what': 'Blogger blog name'
120     }
121     weight = 300
122     human_name = 'Blogger'
123     icon = '/media/images/openid/blogger.png'
124
125
126 class LiveJournalAuthConsumer(OpenIdAbstractAuthConsumer):
127     def get_user_url(self, request):
128         blog_name = request.POST['input_field']
129         return "http://%s.livejournal.com/" % blog_name
130
131 class LiveJournalAuthContext(ConsumerTemplateContext):
132     mode = 'SMALLICON'
133     type = 'SIMPLE_FORM'
134     simple_form_context = {
135         'your_what': 'LiveJournal blog name'
136     }
137     weight = 310
138     human_name = 'LiveJournal'
139     icon = '/media/images/openid/livejournal.png'
140
141
142 class ClaimIdAuthConsumer(OpenIdAbstractAuthConsumer):
143     def get_user_url(self, request):
144         blog_name = request.POST['input_field']
145         return "http://claimid.com/%s" % blog_name
146
147 class ClaimIdAuthContext(ConsumerTemplateContext):
148     mode = 'SMALLICON'
149     type = 'SIMPLE_FORM'
150     simple_form_context = {
151         'your_what': 'ClaimID user name'
152     }
153     weight = 320
154     human_name = 'ClaimID'
155     icon = '/media/images/openid/claimid.png'
156
157 class VerisignAuthConsumer(OpenIdAbstractAuthConsumer):
158     def get_user_url(self, request):
159         blog_name = request.POST['input_field']
160         return "http://%s.pip.verisignlabs.com/" % blog_name
161
162 class VerisignAuthContext(ConsumerTemplateContext):
163     mode = 'SMALLICON'
164     type = 'SIMPLE_FORM'
165     simple_form_context = {
166         'your_what': 'Verisign user name'
167     }
168     weight = 340
169     human_name = 'Verisign'
170     icon = '/media/images/openid/verisign.png'
171
172     
173 class OpenIdUrlAuthConsumer(OpenIdAbstractAuthConsumer):
174     pass
175
176 class OpenIdUrlAuthContext(ConsumerTemplateContext):
177     mode = 'STACK_ITEM'
178     weight = 300
179     human_name = 'OpenId url'
180     stack_item_template = 'modules/openidauth/openidurl.html'
181     icon = '/media/images/openid/openid-inputicon.gif'