<commit_before><?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="authSources/authSources_SearchUsers" type="xmlform" enableTemplate="1" width="95%">

<TITLE type="title">
  <en>Search for user</en>
</TITLE>

<AUTH_SOURCE_UID type="hidden"/>

<KEYWORD type="text" size="50" maxlength="50" required="0">
  <en>Keyword</en>
</KEYWORD>

<btnSearch type="button" onclick="searchUsers();">
  <en>Search</en>
</btnSearch>

<btnImport type="button" onclick="importUsers(this.form);">
  <en>Import</en>
</btnImport>

<BTN_CANCEL type="button" onclick="cancel();">
  <en>Cancel</en>
</BTN_CANCEL>

<JS type="javascript"><![CDATA[

getField('btnImport').style.visibility = 'hidden';

function disableEnterKey(e)
{
  var key;
  if(window.event)
    key = window.event.keyCode;     //IE
  else
    key = e.which;     //firefox

  if(key == 13) {
    searchUsers();
    e.cancelBubble = true;
    e.returnValue = false;
    if (e.stopPropagation) {
      e.stopPropagation();
      e.preventDefault();
    }
    return false;
  } else {
    return true;
  }
}

var searchUsers = function() {
  var oRPC = new leimnud.module.rpc.xmlhttp({
    url     : 'authSources_Ajax',
    args    : 'action=searchUsers&sUID=' + getField('AUTH_SOURCE_UID').value + "&sKeyword=" + getField('KEYWORD').value
  });
  oRPC.callback = function(rpc){
    document.getElementById('spanUsers').innerHTML = rpc.xmlhttp.responseText;
    if (checkInfo()) {
      getField('btnImport').style.visibility = 'visible';
    }
    else {
      getField('btnImport').style.visibility = 'hidden';
    }
    var scs = rpc.xmlhttp.responseText.extractScript();
    scs.evalScript();

  }.extend(this);
  oRPC.make();

};

function checkInfo() {
  var input_obj = document.getElementsByTagName("input");
  for (i = 0; i < input_obj.length; i++) {
    if (input_obj.item(i).type == 'checkbox')
    {
      return true;
    }
  }
  return false;
}

var importUsers = function(oForm) {
  var bContinue = false;
  var i = 0;
  var oAux;
  while (oAux = document.getElementById('aUsers[' + i + ']')) {
    if (oAux.checked) {
      bContinue = true;
    }
    i++;
  }
  if (bContinue) {
    oForm.submit();
  }
  else {
    //alert(666);
  }
};

function cancel(){
  window.location = 'authSources_List';
}

leimnud.event.add(getField('KEYWORD'), 'keypress', function(event) {
  return disableEnterKey(event);
});

]]></JS>

</dynaForm><commit_msg>BUG 9218 Con el plugin ldap v.1.4.26, haciendo upgrade... SOLVED<commit_after><?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="authSources/authSources_SearchUsers" type="xmlform" enableTemplate="1" width="95%">

<TITLE type="title">
  <en>Search for user</en>
</TITLE>

<AUTH_SOURCE_UID type="hidden"/>

<KEYWORD type="text" size="50" maxlength="50" required="0">
  <en>Keyword</en>
</KEYWORD>

<btnSearch type="button" onclick="searchUsers();">
  <en>Search</en>
</btnSearch>

<btnImport type="button" onclick="importUsers(this.form);">
  <en>Import</en>
</btnImport>

<BTN_CANCEL type="button" onclick="cancel();">
  <en>Cancel</en>
</BTN_CANCEL>

<JS type="javascript"><![CDATA[
function disableEnterKey(e)
{
  var key;
  if(window.event)
    key = window.event.keyCode;     //IE
  else
    key = e.which;     //firefox

  if(key == 13) {
    searchUsers();
    e.cancelBubble = true;
    e.returnValue = false;
    if (e.stopPropagation) {
      e.stopPropagation();
      e.preventDefault();
    }
    return false;
  } else {
    return true;
  }
}

var searchUsers = function() {
  var oRPC = new leimnud.module.rpc.xmlhttp({
    url     : 'authSources_Ajax',
    args    : 'action=searchUsers&sUID=' + getField('AUTH_SOURCE_UID').value + "&sKeyword=" + getField('KEYWORD').value
  });
  oRPC.callback = function(rpc){
    document.getElementById('spanUsers').innerHTML = rpc.xmlhttp.responseText;
    var scs = rpc.xmlhttp.responseText.extractScript();
    scs.evalScript();
  }.extend(this);
  oRPC.make();
};

function checkInfo() {
  var input_obj = document.getElementsByTagName("input");
  for (i = 0; i < input_obj.length; i++) {
    if (input_obj.item(i).type == 'checkbox' && input_obj.item(i).checked == true)
    {
      return true;
    }
  }
  return false;
}

var importUsers = function(oForm) {
  if (checkInfo()) {
    oForm.submit();
  }
  else {
    alert(_('ID_NO_SELECTION_WARNING'));
  }
};

function cancel(){
  window.location = 'authSources_List';
}

leimnud.event.add(getField('KEYWORD'), 'keypress', function(event) {
  return disableEnterKey(event);
});

]]></JS>

</dynaForm>
{'fraction_non_alphanumeric': 0.17980513728963685, 'fraction_numerical': 0.008857395925597875, 'mean_word_length': 3.7748414376321353, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 2, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5999713', 'n_tokens_mistral': 1655, 'n_tokens_neox': 1628, 'n_words': 294}