Exemplo n.º 1
0
function registration($login, $password1, $password2, $email)
{
    //++
    $verification_data_err = verification_reg_data($login, $password1, $password2, $email);
    if ($verification_data_err) {
        $feedback = $verification_data_err;
    } else {
        $password = $password1;
        prepare_reg_data(&$login, &$password, &$email);
        $salt = salting();
        $hash = crypt($password, $salt);
        $feedback = user_register($login, $hash, $salt, $email);
    }
    return $feedback;
}
Exemplo n.º 2
0
    } else {
        unlink('../setup.php');
        rename('../_installFolder/login.php', '../login.php');
        rename('setupScript.js', '../_installFolder/setupScript.js');
        rename('setupStyle.css', '../_installFolder/setupStyle.css');
        rename('../_installFolder/board.php', '../board.php');
        echoResponse('yes', "Yes! We did it!\nEnjoy your board!");
    }
}
//login procedure
if (isset($_POST['login'])) {
    require_once 'db.php';
    require_once ROOT . '/function/funcs.php';
    $username = sanitizeInput($_POST['username']);
    $password = sanitizeInput($_POST['password']);
    $password = salting($password, SALT, PEPPER);
    $connection = new mysqli(HOST, USER, PSW, DB);
    if ($connection->connect_error) {
        echo $connection->connect_error;
        die('error' . $connection->connect_error);
    } else {
        $query = "SELECT * FROM users WHERE username='******' AND password='******'";
        $check = $connection->query($query);
        if (!$check) {
            die($connection->error);
        }
        $row = $check->num_rows;
        if ($row == 1) {
            $res = $check->fetch_assoc();
            session_start();
            $_SESSION['logged'] = 1;