Conditionalize wiki auth for staging
This commit is contained in:
parent
ffba0668c2
commit
5388cb70a8
2 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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");
|
Loading…
Add table
Add a link
Reference in a new issue