Conditionalize wiki auth for staging

This commit is contained in:
Kevin Fenzi 2014-06-15 18:41:57 +00:00
parent ffba0668c2
commit 5388cb70a8
2 changed files with 5 additions and 1 deletions

View file

@ -29,7 +29,7 @@
- packages
- name: adding FAS auth
copy: src=Auth_FAS.php dest=/usr/share/mediawiki119/extensions/Auth_FAS.php owner=root group=root mode=775
template: src=Auth_FAS.php.j2 dest=/usr/share/mediawiki119/extensions/Auth_FAS.php owner=root group=root mode=775
tags:
- config

View file

@ -9,7 +9,11 @@ class Auth_FAS extends AuthPlugin {
$username = strtolower( $username);
$ch = curl_init();
{% if env == 'staging' %}
curl_setopt($ch, CURLOPT_URL, 'https://admin.stg.fedoraproject.org/accounts/json/person_by_username?tg_format=json');
{% else %}
curl_setopt($ch, CURLOPT_URL, 'https://admin.fedoraproject.org/accounts/json/person_by_username?tg_format=json');
{% endif %}
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Auth_FAS 0.9");
curl_setopt($ch, CURLOPT_POSTFIELDS, "username=".urlencode($username)."&user_name=".urlencode($username)."&password=".urlencode($password)."&login=Login");