Projet

Général

Profil

0001-handle-form_submit_elt-key-in-login-info-9477.patch

Josué Kouka, 04 janvier 2016 12:26

Télécharger (2,79 ko)

Voir les différences:

Subject: [PATCH] handle form_submit_elt key in login info (#9477)

 README                     | 5 ++++-
 mandayejs/do_login.js      | 2 +-
 mandayejs/mandaye/views.py | 3 ++-
 mandayejs/settings.py      | 1 +
 4 files changed, 8 insertions(+), 3 deletions(-)
README
47 47

  
48 48
    SITE_DOMAIN =  'example.com'
49 49
    SITE_LOGIN_PATH = '/'
50
    SITE_HOME_PATH = '/profile' # Not required
51 50
    SITE_CA_URL = 'https://myidp/account/' # Citizen account
52 51
    
53 52
    SITE_LOCATORS = [
......
101 100
        'css': 'css/example_associate.css',
102 101
        'js': 'js/example_associate.js',
103 102
    }
103

  
104
    # DOM Element used to validate the logon form
105
    # If not provided, default is 'input[type=submit]'
106
    SITE_FORM_SUBMIT_ELT = 'button[type=submit]' 
104 107
    
105 108
    # Mellon Settings
106 109
    MELLON_IDENTITY_PROVIDERS = [
mandayejs/do_login.js
57 57
              }   
58 58
          }   
59 59
      }
60
      $(key).parents('form').find('input[type=submit]').click();
60
      $(key).parents('form').find(input.form_submit_elt).click();
61 61
  }, input);
62 62
});
mandayejs/mandaye/views.py
135 135
    credentials = get_object_or_404(UserCredentials, user=request.user)
136 136
    site_static_root = os.path.join(getattr(settings, 'STATIC_ROOT'), getattr(settings, 'SITE_STATIC_ROOT_PATH', ''))
137 137
    site_auth_checker = getattr(settings, 'SITE_AUTH_CHECKER', '')
138
    site_form_submit_elt = getattr(settings, 'SITE_FORM_SUBMIT_ELT', 'input[type=submit]')
138 139
    login_info = {
139 140
        'address': request.build_absolute_uri(settings.SITE_LOGIN_PATH),
140 141
        'cookies': [],
141 142
        'locators': [ credentials.to_login_info() ],
142
        'homepath': getattr(settings, 'SITE_HOME_PATH', '/'),
143
        'form_submit_elt': site_form_submit_elt,
143 144
        'auth_checker': os.path.join(site_static_root, site_auth_checker)
144 145
    }
145 146
    logger.debug(login_info)
mandayejs/settings.py
56 56
    'django.contrib.staticfiles',
57 57
    'mandayejs.mandaye',
58 58
    'mandayejs.sites.vincennes',
59
    'mandayejs.sites.montpellier3m',
59 60
    'gadjo',
60 61
    'mellon'
61 62
)
62
-