Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions server/app/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,18 @@
// Hashing the given password
$password = hash('sha256', $password);

// Sending a request to the database to add the user
Core\Queries::execute('INSERT INTO openauth_users (guid, uuid, username, password) VALUES (:guid, :uuid, :username, :password)', ['username' => $username, 'uuid' => $uuid, "password" => $password, 'guid' => $guid]);
$accessToken = md5(uniqid(rand(), true));
$clientToken = getClientToken();

Core\Queries::execute(
'INSERT INTO openauth_users (guid, uuid, username, password, accessToken, clientToken) VALUES (:guid, :uuid, :username, :password, :accessToken, :clientToken)', [
'username' => $username,
'uuid' => $uuid,
'password' => $password,
'guid' => $guid,
'accessToken' => $accessToken,
'clientToken' => $clientToken]
);

// Setting the 'You are now suscribed' message
$notif = "Vous êtes bien inscrits !";
Expand Down Expand Up @@ -120,4 +130,4 @@
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</body>
</html>
</html>