summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdolfo Fitoria <adolfo.fitoria@gmail.com>2011-08-18 21:45:39 -0400
committerAdolfo Fitoria <adolfo.fitoria@gmail.com>2011-08-18 21:45:39 -0400
commit54c77d5126b37e19ee32993057f7816936131ce0 (patch)
treeaa7c034d7688453b3564b4bb8660ec7f0774ec57
parentc5eea5fdfa917192a065580f2810d982e6cfc758 (diff)
downloadaskbot-54c77d5126b37e19ee32993057f7816936131ce0.tar.gz
askbot-54c77d5126b37e19ee32993057f7816936131ce0.tar.bz2
askbot-54c77d5126b37e19ee32993057f7816936131ce0.zip
adding self hosted wordpress blog as a login provider
-rw-r--r--askbot/conf/login_providers.py20
-rw-r--r--askbot/deps/livesettings/values.py10
2 files changed, 29 insertions, 1 deletions
diff --git a/askbot/conf/login_providers.py b/askbot/conf/login_providers.py
index 56423ca4..50597f62 100644
--- a/askbot/conf/login_providers.py
+++ b/askbot/conf/login_providers.py
@@ -29,6 +29,26 @@ settings.register(
)
)
+settings.register(
+ livesettings.BooleanValue(
+ LOGIN_PROVIDERS,
+ 'WORDPRESS_SITE_LOGIN',
+ default = False,
+ description=_('Activate to allow login with self-hosted wordpress site'),
+ help_text=_('to activate this feature you must fill out the wordpress xml-rpc setting bellow')
+ )
+)
+
+settings.register(
+ livesettings.URLValue(
+ LOGIN_PROVIDERS,
+ 'WORDPRESS_SITE_URL',
+ default = '',
+ description=_('Fill it with the wordpress url to the xml-rpc, normally http://mysite.com/xmlrpc.php'),
+ help_text=_('To enable, go to Settings->Writing->Remote Publishing and check the box for XML-RPC')
+ )
+)
+
providers = (
'local',
'AOL',
diff --git a/askbot/deps/livesettings/values.py b/askbot/deps/livesettings/values.py
index 740d9884..6372e656 100644
--- a/askbot/deps/livesettings/values.py
+++ b/askbot/deps/livesettings/values.py
@@ -21,7 +21,7 @@ import os
__all__ = ['BASE_GROUP', 'ConfigurationGroup', 'Value', 'BooleanValue', 'DecimalValue', 'DurationValue',
'FloatValue', 'IntegerValue', 'ModuleValue', 'PercentValue', 'PositiveIntegerValue', 'SortedDotDict',
- 'StringValue', 'ImageValue', 'LongStringValue', 'MultipleStringValue']
+ 'StringValue', 'ImageValue', 'LongStringValue', 'MultipleStringValue', 'URLValue']
_WARN = {}
@@ -545,6 +545,14 @@ class StringValue(Value):
to_editor = to_python
+class URLValue(Value):
+
+ class field(forms.URLField):
+
+ def __init__(self, *args, **kwargs):
+ kwargs['required'] = False
+ forms.URLField.__init__(self, *args, **kwargs)
+
class LongStringValue(Value):
class field(forms.CharField):