<commit_before><?php
// Initialization
require_once('tiki-setup.php');

/*
if(!isset($_REQUEST["login"])) {
  header("location: $HTTP_REFERER");
  die;  
}
*/
$isvalid = false;
$isdue=false;
if(($_REQUEST["user"] == 'admin') && (!$userlib->user_exists("admin"))) {
  if($_REQUEST["pass"]==<PASSWORD>) {
     $isvalid = true;
     $userlib->add_user("admin",ADMIN_PASSWORD,'<PASSWORD>');
  }  
} else {
  if(!isset($_REQUEST["challenge"])) $_REQUEST["challenge"]='';
  if(!isset($_REQUEST["response"])) $_REQUEST["reponse"]='';
  $isvalid = $userlib->validate_user($_REQUEST["user"],$_REQUEST["pass"],$_REQUEST["challenge"],$_REQUEST["response"]);
  // If the password is valid but it is due then force the user to change the password by
  // sending the user to the new password change screen without letting him use tiki
  // The user must re-nter the old password so no secutiry risk here
}

if($isdue) {

}

if($isvalid) {
  session_register("user",$_REQUEST["user"]);
  $user = $_REQUEST["user"];
  $smarty->assign_by_ref('user',$user);
  header("location: $tikiIndex");
  die;
} else {
  $error=tra("Invalid username or password");
  header("location: tiki-error.php?error=$error");
  die;  
  
  
}
?><commit_msg>Fixed typo<commit_after><?php
// Initialization
require_once('tiki-setup.php');

/*
if(!isset($_REQUEST["login"])) {
  header("location: $HTTP_REFERER");
  die;  
}
*/
$isvalid = false;
$isdue=false;
if(($_REQUEST["user"] == 'admin') && (!$userlib->user_exists("admin"))) {
  if($_REQUEST["pass"]==<PASSWORD>) {
     $isvalid = true;
     $userlib->add_user("admin",ADMIN_PASSWORD,'<PASSWORD>');
  }  
} else {
  if(!isset($_REQUEST["challenge"])) $_REQUEST["challenge"]='';
  if(!isset($_REQUEST["response"])) $_REQUEST["response"]='';
  $isvalid = $userlib->validate_user($_REQUEST["user"],$_REQUEST["pass"],$_REQUEST["challenge"],$_REQUEST["response"]);
  // If the password is valid but it is due then force the user to change the password by
  // sending the user to the new password change screen without letting him use tiki
  // The user must re-nter the old password so no secutiry risk here
}

if($isdue) {

}

if($isvalid) {
  session_register("user",$_REQUEST["user"]);
  $user = $_REQUEST["user"];
  $smarty->assign_by_ref('user',$user);
  header("location: $tikiIndex");
  die;
} else {
  $error=tra("Invalid username or password");
  header("location: tiki-error.php?error=$error");
  die;  
  
  
}
?>
{'fraction_non_alphanumeric': 0.2044334975369458, 'fraction_numerical': 0.0, 'mean_word_length': 5.313471502590674, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, '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': '3351540', 'n_tokens_mistral': 828, 'n_tokens_neox': 817, 'n_words': 171}