<commit_before><?php
/**
 * Boostack: registration.php
 * ========================================================================
 * Copyright 2014-2017 <NAME>
 * Licensed under MIT (https://github.com/offmania9/Boostack/blob/master/LICENSE)
 * ========================================================================
 * @author <NAME> <<EMAIL>>
 * @version 2.4
 */

// #######################
require_once "core/environment_init.php";
$boostack->renderOpenHtmlHeadTags("Registration");
// #######################

require_once $boostack->registerTemplateFile("boostack/header.phtml");

if(isset($_POST["email"]) && isset($_POST["psw1"]) && isset($_POST["psw2"])) {
    $email = Utils::sanitizeInput($_POST["email"]);
    $psw1 = Utils::sanitizeInput($_POST["psw1"]);
    $psw2 = Utils::sanitizeInput($_POST["psw2"]);
    if(Utils::checkEmailFormat($email) && $psw1 === $psw2) {
        $user = new User();
        $user->username = $email;
        $user->email = $email;
        $user->pwd = $<PASSWORD>;
        $user->save();
        require_once $boostack->registerTemplateFile("boostack/content_login_logged.phtml");
    }
    else
        require_once $boostack->registerTemplateFile("boostack/content_registration.phtml");
}
else {
    require_once $boostack->registerTemplateFile("boostack/content_registration.phtml");
}

require_once $boostack->registerTemplateFile("boostack/footer.phtml");

// #######################
$boostack->renderCloseHtmlTag();
$boostack->writeLog("Registration Page");
// #######################
?><commit_msg>Added user active by default after registration<commit_after><?php
/**
 * Boostack: registration.php
 * ========================================================================
 * Copyright 2014-2017 <NAME>
 * Licensed under MIT (https://github.com/offmania9/Boostack/blob/master/LICENSE)
 * ========================================================================
 * @author <NAME> <<EMAIL>>
 * @version 2.4
 */

// #######################
require_once "core/environment_init.php";
$boostack->renderOpenHtmlHeadTags("Registration");
// #######################

require_once $boostack->registerTemplateFile("boostack/header.phtml");

if(isset($_POST["email"]) && isset($_POST["psw1"]) && isset($_POST["psw2"])) {
    $email = Utils::sanitizeInput($_POST["email"]);
    $psw1 = Utils::sanitizeInput($_POST["psw1"]);
    $psw2 = Utils::sanitizeInput($_POST["psw2"]);
    if(Utils::checkEmailFormat($email) && $psw1 === $psw2) {
        $user = new User();
        $user->username = $email;
        $user->email = $email;
        $user->active = true;
        $user->pwd = $<PASSWORD>;
        $user->save();
        require_once $boostack->registerTemplateFile("boostack/content_login_logged.phtml");
    }
    else
        require_once $boostack->registerTemplateFile("boostack/content_registration.phtml");
}
else {
    require_once $boostack->registerTemplateFile("boostack/content_registration.phtml");
}

require_once $boostack->registerTemplateFile("boostack/footer.phtml");

// #######################
$boostack->renderCloseHtmlTag();
$boostack->writeLog("Registration Page");
// #######################
?>
{'fraction_non_alphanumeric': 0.304939835338822, 'fraction_numerical': 0.012032932235592146, 'mean_word_length': 5.51340206185567, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 40, 'https://': 2, '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': '2799182', 'n_tokens_mistral': 940, 'n_tokens_neox': 915, 'n_words': 118}