<commit_before><?php

$content = '';
if (isset($_POST["usercheck"])) {
  $lsexist = new WebblerListing($GLOBALS["I18N"]->get("existingusers"));
  $lsnonexist = new WebblerListing($GLOBALS["I18N"]->get("nonexistingusers"));
  $users = explode("\n",$_POST["usercheck"]);
  foreach ($users as $user) {
    $user = trim($user);
    if (isset($_POST['check']) && $_POST["check"] == "foreignkey") {
      $exists = Sql_Query(sprintf('select id,foreignkey,email from %s where foreignkey = "%s"',$tables["user"],sql_escape($user)));
    } else {
      $exists = Sql_Query(sprintf('select id,foreignkey,email from %s where email = "%s"',$tables["user"],sql_escape($user)));
    }
    if (Sql_Num_Rows($exists)) {
      $id = Sql_Fetch_Array($exists);
      $lsexist->addElement($user,PageUrl2("user&amp;id=".$id["id"]));
      $lsexist->addColumn($user,$GLOBALS["I18N"]->get('email'),$id['email']);
      $lsexist->addColumn($user,$GLOBALS["I18N"]->get('key'),$id['Foreign Key']);
    } else {
      $lsnonexist->addElement($user);
    }
  }
  print $lsexist->display();
  print $lsnonexist->display();
} else {
  $_POST['usercheck'] = '';
}

/*
print $GLOBALS["I18N"]->get("existcheckintro");
*/

$content .=  '<form method="post" action="">';
$content .=  '<table class="usercheckForm">';
$content .=  '<tr><td>'.$GLOBALS["I18N"]->get("whatistype").'</td></tr>';
$content .=  '<tr><td><label for="foreignkey">'.$GLOBALS["I18N"]->get("foreignkey").'</label> <input type="radio" id="foreignkey" name="check" value="foreignkey"></td></tr>';
$content .=  '<tr><td><label for="email">'.$GLOBALS["I18N"]->get("email").'</label> <input type="radio" id="email" name="check" value="email"></td></tr>';
$content .=  '<tr><td>'.$GLOBALS["I18N"]->get("pastevalues").'</td></tr>';
$content .=  '<tr><td><input type="submit" name="continue" value="'.$GLOBALS["I18N"]->get("continue").'" class="button"></td></tr>';
$content .=  '<tr><td><textarea name="usercheck" rows=30 cols=65>'.htmlspecialchars(stripslashes($_POST['usercheck'])).'</textarea></td></tr>';
$content .=  '<tr><td><input type="submit" name="continue" value="'.$GLOBALS["I18N"]->get("continue").'" class="button"></td></tr>';
$content .=  '</table></form>';

$p = new UIPanel('',$content);
print $p->display();<commit_msg>fix strings<commit_after><?php

$content = '';
if (isset($_POST["usercheck"])) {
  $lsexist = new WebblerListing($GLOBALS["I18N"]->get("Existing Users"));
  $lsnonexist = new WebblerListing($GLOBALS["I18N"]->get("Non Existing Users "));
  $users = explode("\n",$_POST["usercheck"]);
  foreach ($users as $user) {
    $user = trim($user);
    if (isset($_POST['check']) && $_POST["check"] == "foreignkey") {
      $exists = Sql_Query(sprintf('select id,foreignkey,email from %s where foreignkey = "%s"',$tables["user"],sql_escape($user)));
    } else {
      $exists = Sql_Query(sprintf('select id,foreignkey,email from %s where email = "%s"',$tables["user"],sql_escape($user)));
    }
    if (Sql_Num_Rows($exists)) {
      $id = Sql_Fetch_Array($exists);
      $lsexist->addElement($user,PageUrl2("user&amp;id=".$id["id"]));
      $lsexist->addColumn($user,$GLOBALS["I18N"]->get('email'),$id['email']);
      $lsexist->addColumn($user,$GLOBALS["I18N"]->get('key'),$id['foreignkey']);
    } else {
      $lsnonexist->addElement($user);
    }
  }
  print $lsexist->display();
  print $lsnonexist->display();
} else {
  $_POST['usercheck'] = '';
}

/*
print $GLOBALS["I18N"]->get("Page to check the existence of users in the database");
*/

$content .=  '<form method="post" action="">';
$content .=  '<table class="usercheckForm">';
$content .=  '<tr><td>'.$GLOBALS["I18N"]->get("What is the type of information you want to check").'</td></tr>';
$content .=  '<tr><td><label for="foreignkey">'.$GLOBALS["I18N"]->get("Foreign Key").'</label> <input type="radio" id="foreignkey" name="check" value="foreignkey"></td></tr>';
$content .=  '<tr><td><label for="email">'.$GLOBALS["I18N"]->get("Email").'</label> <input type="radio" id="email" name="check" value="email"></td></tr>';
$content .=  '<tr><td>'.$GLOBALS["I18N"]->get("Paste the values to check in this box, one per line").'</td></tr>';
$content .=  '<tr><td><input type="submit" name="continue" value="'.$GLOBALS["I18N"]->get("Continue").'" class="button"></td></tr>';
$content .=  '<tr><td><textarea name="usercheck" rows=30 cols=65>'.htmlspecialchars(stripslashes($_POST['usercheck'])).'</textarea></td></tr>';
$content .=  '<tr><td><input type="submit" name="continue" value="'.$GLOBALS["I18N"]->get("Continue").'" class="button"></td></tr>';
$content .=  '</table></form>';

$p = new UIPanel('',$content);
print $p->display();
{'fraction_non_alphanumeric': 0.2736457437661221, 'fraction_numerical': 0.011607910576096303, 'mean_word_length': 6.028700906344411, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 123, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3937189', 'n_tokens_mistral': 1657, 'n_tokens_neox': 1644, 'n_words': 247}