Project

General

Profile

« Previous | Next » 

Revision c9b3fcf5

Added by Andreas Kohlbecker about 7 years ago

fix #6382 option to supply user credentials in the admin setting for the freetext index

View differences:

modules/cdm_dataportal/settings.php
1103 1103
  $frontentURL = urlencode(variable_get('cdm_webservice_url', ''));
1104 1104
  $trigger_link_options = array(
1105 1105
    'attributes' => array(
1106
      'class' => 'index-trigger',
1106
      'class' => 'index-trigger'
1107 1107
    ),
1108 1108
  );
1109 1109
  $form['cdm_webservice']['freetext_index']['operations'] = array(
......
1113 1113
      ))
1114 1114
    . '<div id="index-progress"></div></div>',
1115 1115
  );
1116

  
1117
  $form['cdm_webservice']['freetext_index']['cdm_login'] = array(
1118
    // this must not be stored, it is only used by the _add_js_cdm_ws_progressbar
1119
    '#type' => 'textfield',
1120
    '#title' => t('Login'),
1121
    '#description' => t('Your cdm user credentials in the following form: <code>user:password</code>')
1122
  );
1123
  drupal_add_js('
1124
        jQuery(document).ready(function() {
1125
             jQuery("#edit-cdm-login").change(function (e) {
1126
                var login = jQuery(e.target).val();
1127
                jQuery("#edit-freetext-index .index-trigger").each(function(index){
1128
                   var url = jQuery(this).attr("href");
1129
                   url = url.replace(/:\/\/[^@]+@|:\/\//, "://" + login + "@");
1130
                   jQuery(this).attr("href", url);
1131
                });
1132
            });
1133
        });
1134
      ',
1135
    array(
1136
      'type' => 'inline',
1137
      'scope' => 'footer'
1138
    )
1139
  );
1116 1140
  _add_js_cdm_ws_progressbar(".index-trigger", "#index-progress");
1117 1141

  
1118 1142
    $form['cdm_webservice']['freetext_index']['cdm_dataportal_taxon_auto_suggest'] = array(
......
3294 3318
function cdm_settings_general_submit($form, &$form_state){
3295 3319
  // clear the [cdm][taxonomictree_uuid] session variable since this taxonomictree_uuid might no longer bee valid
3296 3320
  unset($_SESSION['cdm']['taxonomictree_uuid']);
3321
  unset($_SESSION['cdm_login']);
3297 3322
}
3298 3323

  
3299 3324
/**

Also available in: Unified diff