mirror of https://github.com/BOINC/boinc.git
Fixed bug preventing changes to Transifex auth settings
(DBOINCP-141)
This commit is contained in:
parent
042ccc9faa
commit
e0c1a257ec
|
@ -219,7 +219,7 @@ function boinctranslate_admin_settings_validate($form, &$form_state) {
|
||||||
// Test authentication
|
// Test authentication
|
||||||
$authenticated = FALSE;
|
$authenticated = FALSE;
|
||||||
$path = "project/{$boinc_name}/resource/{$boinc_resources[0]}/translation/en";
|
$path = "project/{$boinc_name}/resource/{$boinc_resources[0]}/translation/en";
|
||||||
$response = boinctranslate_transifex_request($path);
|
$response = boinctranslate_transifex_request($path, NULL, TRUE, FALSE, $username, $password);
|
||||||
|
|
||||||
if ($response) {
|
if ($response) {
|
||||||
if ($response == '401 UNAUTHORIZED') {
|
if ($response == '401 UNAUTHORIZED') {
|
||||||
|
|
|
@ -459,11 +459,11 @@ function boinctranslate_update_official_boinc_translations() {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function boinctranslate_transifex_request($path, $post = NULL, $json = TRUE, $use_put = FALSE) {
|
function boinctranslate_transifex_request($path, $post = NULL, $json = TRUE, $use_put = FALSE, $username = '', $password = '') {
|
||||||
// Transifex details
|
// Transifex details
|
||||||
$api_base_url = 'https://www.transifex.com/api/2';
|
$api_base_url = 'https://www.transifex.com/api/2';
|
||||||
$username = variable_get('boinc_translate_transifex_user', '');
|
if (!$username) $username = variable_get('boinc_translate_transifex_user', '');
|
||||||
$password = variable_get('boinc_translate_transifex_pass', '');
|
if (!$password) $password = variable_get('boinc_translate_transifex_pass', '');
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, "{$api_base_url}/{$path}");
|
curl_setopt($ch, CURLOPT_URL, "{$api_base_url}/{$path}");
|
||||||
|
|
Loading…
Reference in New Issue