]> git.parisson.com Git - django-social-auth.git/commitdiff
Merge remote branch 'upstream/master'
authorStas Kravets <skravets@applebough.(none)>
Mon, 4 Jul 2011 07:59:23 +0000 (11:59 +0400)
committerStas Kravets <skravets@applebough.(none)>
Mon, 4 Jul 2011 07:59:23 +0000 (11:59 +0400)
Conflicts:
example/templates/done.html
example/templates/home.html

1  2 
example/app/views.py
example/settings.py
example/templates/done.html
example/templates/home.html
social_auth/backends/__init__.py
social_auth/backends/facebook.py

index 2977d74b6266d79ac7b85286b9c8aeece5cc6269,8033c23b4ff34f9b87e74db32e825b831b25af0a..11d2b38a22f17b4d6e21585095181758b7082c61
@@@ -6,7 -6,9 +6,8 @@@ from django.template import RequestCont
  from django.shortcuts import render_to_response
  
  from social_auth import __version__ as version
+ from social_auth.backends import BACKENDS, OpenIdAuth, BaseOAuth, BaseOAuth2
  
 -
  def home(request):
      """Home view, displays login mechanism"""
      if request.user.is_authenticated():
Simple merge
index e2279d76dcda67bf5f84f628ca66f30cb7a2e6d5,1c99150ee04687cc7521c7e99309f35279aef038..974fbecce14e17ecff2966c7ab7817b278fdfb55
  </div>
  
  <div>
-   <h3>Associate new OAuth credentials:</h3>
+ {% if accounts %}
+   <h3>Disconnect accounts</h3>
    <ul>
+   {% for account in accounts %}
      <li>
-       <a rel="nofollow" href="{% url associate_begin "twitter" %}">Twitter</a>
-       {% if twitter %}<span class="disconnect">(<a href="{% url disconnect "twitter" %}">disconnect</a>)</span>{% endif %}
-     </li>
-     <li>
-       <a rel="nofollow" href="{% url associate_begin "facebook" %}">Facebook</a>
-       {% if facebook %}<span class="disconnect">(<a href="{% url disconnect "facebook" %}">disconnect</a>)</span>{% endif %}
-     </li>
-     <li>
-       <a rel="nofollow" href="{% url associate_begin "linkedin" %}">LinkedIn</a>
-       {% if linkedin %}<span class="disconnect">(<a href="{% url disconnect "linkedin" %}">disconnect</a>)</span>{% endif %}
-     </li>
-     <li>
-       <a rel="nofollow" href="{% url associate_begin "orkut" %}">Orkut</a>
-       {% if orkut %}<span class="disconnect">(<a href="{% url disconnect "orkut" %}">disconnect</a>)</span>{% endif %}
-     </li>
-     <li>
-       <a rel="nofollow" href="{% url associate_begin "google-oauth" %}">Google OAuth</a>
-       {% if google_oauth %}<span class="disconnect">(<a href="{% url disconnect "google-oauth" %}">disconnect</a>)</span>{% endif %}
+         <span class="disconnect"><a href={% url socialauth_disconnect_individual account.provider account.id %}>{{ account.provider|title }} (ID {{ account.id }})</a></span>
      </li>
+   {% endfor %}
    </ul>
+ {% endif %}
  
-   <h3>Associate new OAuth2 credentials:</h3>
+   <h3>Associate new <a href="http://oauth.net/" title="OAuth">OAuth</a> credentials:</h3>
    <ul>
-     <li>
-       <a rel="nofollow" href="{% url associate_begin "google-oauth2" %}">Google OAuth2</a>
-       {% if google_oauth2 %}<span class="disconnect">(<a href="{% url disconnect "google-oauth2" %}">disconnect</a>)</span>{% endif %}
+   {% for name, backend in backends.oauth %}
+     <li><a rel="nofollow" href="{% url socialauth_associate_begin name %}">{{ name|title }}</a></li>
+   {% endfor %}
 +        <li><a rel="nofollow" href="{% url associate_begin "odnoklassniki" %}">Odnoklassniki OAuth 2.0</a></li>
 +        {% if odnoklassniki %}<span class="disconnect">(<a href="{% url disconnect "odnoklassniki" %}">disconnect</a>)</span>{% endif %}
 +        <li><a rel="nofollow" href="{% url associate_begin "vkontakte-oauth2" %}">VKontakte OAuth 2.0</a></li>
 +        {% if vkontakte_oauth2 %}<span class="disconnect">(<a href="{% url disconnect "vkontakte-oauth2" %}">disconnect</a>)</span>{% endif %}
 +        <li><a rel="nofollow" href="{% url associate_begin "mailru-oauth2" %}">Mail.ru OAuth 2.0</a></li>
 +        {% if mailru_oauth2 %}<span class="disconnect">(<a href="{% url disconnect "mailru-oauth2" %}">disconnect</a>)</span>{% endif %}
-     </li>
-     <li>
-       <a rel="nofollow" href="{% url associate_begin "foursquare" %}">Foursquare</a>
-       {% if foursquare %}<span class="disconnect">(<a href="{% url disconnect "foursquare" %}">disconnect</a>)</span>{% endif %}
-     </li>
    </ul>
  
-   <h3>Associate new OpenID credentials:</h3>
+   <h3>Associate new <a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-10" title="OAuth2">OAuth2</a> credentials:</h3>
    <ul>
+   {% for name, backend in backends.oauth2 %}
+     <li><a rel="nofollow" href="{% url socialauth_associate_begin name %}">{{ name|title }}</a></li>
+   {% endfor %}
+   </ul>
+   <h3>Associate new <a href="http://openid.net/" title="OpenId">OpenId</a> credentials:</h3>
+   <ul>
+     {% for name, backend in backends.openid %}
+       {% if name != "livejournal" and name != "openid" %}
+       <li>
+         <a rel="nofollow" href="{% url socialauth_begin name %}">{{ name|title }}</a>
+       </li>
+       {% endif %}
+     {% endfor %}
      <li>
-       <a rel="nofollow" href="{% url associate_begin "google" %}">Google OpenID</a>
-       {% if google %}<span class="disconnect">(<a href="{% url disconnect "google" %}">disconnect</a>)</span>{% endif %}
-     </li>
-     <li>
-       <a rel="nofollow" href="{% url associate_begin "yahoo" %}">Yahoo</a>
-       {% if yahoo %}<span class="disconnect">(<a href="{% url disconnect "yahoo" %}">disconnect</a>)</span>{% endif %}
-     </li>
-     <li>
-       <form action="{% url associate_begin "livejournal" %}" method="post">{% csrf_token %}
+       <form action="{% url socialauth_associate_begin "livejournal" %}" method="post">{% csrf_token %}
          <div>
            <label for="openid_lj_user">LiveJournal user
-             {% if livejournal %}(<span class="disconnect"><a href="{% url disconnect "livejournal" %}">disconnect</a>)</span>{% endif %}
            </label>
            <input id="openid_lj_user" type="text" value="" name="openid_lj_user" />
            <input type="submit" value="Login"/>
          </div>
        </form>
      </li>
 +    <li>
 +      <form action="{% url associate_begin "yandex" %}" method="post">{% csrf_token %}
 +        <div>
 +          <label for="openid_ya_user">Yandex user
 +            {% if yandex %}(<span class="disconnect"><a href="{% url disconnect "yandex" %}">disconnect</a>)</span>{% endif %}
 +          </label>
 +          <input id="openid_ya_user" type="text" value="" name="openid_ya_user" />
 +          <input type="submit" value="Login"/>
 +        </div>
 +      </form>
 +    </li>
      <li>
-       <form action="{% url associate_begin "openid" %}" method="post">{% csrf_token %}
+       <form action="{% url socialauth_associate_begin "openid" %}" method="post">{% csrf_token %}
          <div>
            <label for="openid_identifier">Other provider:</label>
            <input id="openid_identifier" type="text" value="" name="openid_identifier" />
index 36347560a68c4a697951af898065dadc101f660b,d72bc6be094f978c09f4014e67c3c7ca2003c9b1..ab10673ded2403eaf9703c09616ea15bf7746e4c
  <div>
    <h3>Login using <a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-10" title="OAuth2">OAuth2</a> from:</h3>
    <ul>
-     <li><a rel="nofollow" href="{% url begin "google-oauth2" %}">Google OAuth2</a></li>
-     <li><a rel="nofollow" href="{% url begin "foursquare" %}">Foursquare</a></li>
-       <li><a rel="nofollow" href="{% url begin "odnoklassniki" %}">Odnoklassniki OAuth 2.0</a></li>
+   {% for name, backend in backends.oauth2 %}
+     <li><a rel="nofollow" href="{% url socialauth_begin name %}">{{ name|title }}</a></li>
+   {% endfor %}
 +      <li><a rel="nofollow" href="{% url begin "vkontakte-oauth2" %}">VKontakte OAuth 2.0</a></li>
 +      <li><a rel="nofollow" href="{% url begin "mailru-oauth2" %}">Mail.ru OAuth 2.0</a></li>
    </ul>
  </div>
  
        </form>
      </li>
      <li>
-       <form action="{% url begin "yandex" %}" method="post">{% csrf_token %}
 -      <form action="{% url socialauth_begin "openid" %}" method="post">{% csrf_token %}
++      <form action="{% url socialauth_begin "yandex" %}" method="post">{% csrf_token %}
 +        <div>
 +          <label for="openid_ya_user">Yandex user(optional):</label>
 +          <input id="openid_ya_user" type="text" value="" name="openid_ya_user" />
 +          <input type="submit" value="Login"/>
 +        </div>
 +      </form>
 +    </li>
 +      <li><a rel="nofollow" href="{% url begin "yandex" %}">Yandex OpenID 2.0</a></li>
 +    <li>
-       <form action="{% url begin "openid" %}" method="post">{% csrf_token %}
++<form action="{% url socialauth_begin "openid" %}" method="post">{% csrf_token %}
          <div>
            <label for="openid_identifier">Other provider</label>
            <input id="openid_identifier" type="text" value="" name="openid_identifier" />
Simple merge
Simple merge