<commit_before><?php

  define('Install', '');
  define('BASEPATH', 'Staff');
  require_once('../applications/wrapper.php');

  if( !isset($_SESSION['tangobb_install_step2']) ) {
      die('Installation access denied.');
  }

  require_once('assets/top.php');

  function randomString($length) {
      $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
      $randomString = '';
      for ($i = 0; $i < $length; $i++) {
          $randomString .= $characters[rand(0, strlen($characters) - 1)];
      }
      return $randomString;
  }
  function encrypt($password) {
      $salty    = randomString(16);
      $salt     = hash('sha256', $salty);
      $password = hash('<PASSWORD>', $password);
      $password = hash('<PASSWORD>', $password . $<PASSWORD>);
      return '$SHA$' . $salty . '$' . $password;
      //return $password;
  }

  if( isset($_POST['continue']) ) {
      try {

          foreach( $_POST as $parent => $child ) {
              $_POST[$parent] = htmlentities($child);
          }

          $username = $_POST['username'];
          $password = encrypt($_POST['password']);
          $email    = $_POST['email'];
          $date     = time();

          if( !$username or !$password or !$email ) {
              throw new Exception ('All fields are required!');
          } else {

              $data = array(
                  'username' => $username,
                  'user_password' => <PASSWORD>,
                  'user_email' => $email,
                  'date_joined' => $date,
                  'user_group' => ADMIN_ID
              );

              if( $MYSQL->insert('{prefix}users', $data) ) {
                  echo '<div class="alert alert-success">TangoBB has been successfully installed! Please delete the installation folder.</div>';
              } else {
                  throw new Exception ('Error inserting user into database!');
              }

          }

      } catch ( Exception $e ) {
          echo '<div class="alert alert-danger">' . $e->getMessage() . '</div>';
      }
  }

?>
<form action="" method="POST">
	<label for="username">Username</label>
    <input type="text" name="username" id="username" class="form-control" />
    <label for="password">Password</label>
    <input type="password" name="password" id="password" class="form-control" />
    <label for="email">Email</label>
    <input type="text" name="email" id="email" class="form-control" />
    <br />
	<input type="submit" name="continue" value="Continue" class="btn btn-default" />
</form>
<?php

  require_once('assets/bot.php');

?><commit_msg>Use standard hash function during installation procedure<commit_after><?php

  define('Install', '');
  define('BASEPATH', 'Staff');
  require_once('../applications/wrapper.php');
  require_once('../applications/functions.php');

  if( !isset($_SESSION['tangobb_install_step2']) ) {
      die('Installation access denied.');
  }

  require_once('assets/top.php');

  if( isset($_POST['continue']) ) {
      try {

          foreach( $_POST as $parent => $child ) {
              $_POST[$parent] = htmlentities($child);
          }

          $username = $_POST['username'];
          $password = encrypt($_POST['password']);
          $email    = $_POST['email'];
          $date     = time();

          if( !$username or !$password or !$email ) {
              throw new Exception ('All fields are required!');
          } else {

              $data = array(
                  'username' => $username,
                  'user_password' => $password,
                  'user_email' => $email,
                  'date_joined' => $date,
                  'user_group' => ADMIN_ID
              );

              if( $MYSQL->insert('{prefix}users', $data) ) {
                  echo '<div class="alert alert-success">TangoBB has been successfully installed! Please delete the installation folder.</div>';
              } else {
                  throw new Exception ('Error inserting user into database!');
              }

          }

      } catch ( Exception $e ) {
          echo '<div class="alert alert-danger">' . $e->getMessage() . '</div>';
      }
  }

?>
<form action="" method="POST">
	<label for="username">Username</label>
    <input type="text" name="username" id="username" class="form-control" />
    <label for="password">Password</label>
    <input type="password" name="password" id="password" class="form-control" />
    <label for="email">Email</label>
    <input type="text" name="email" id="email" class="form-control" />
    <br />
	<input type="submit" name="continue" value="Continue" class="btn btn-default" />
</form>
<?php

  require_once('assets/bot.php');

?>
{'fraction_non_alphanumeric': 0.17294994675186368, 'fraction_numerical': 0.004259850905218318, 'mean_word_length': 2.3447293447293447, 'pattern_counts': {'":': 0, '<': 46, '<?xml version=': 0, '>': 61, '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': '3779822', 'n_tokens_mistral': 1390, 'n_tokens_neox': 1333, 'n_words': 290}