Adds phpdoc comments

main
Yasen Pramatarov 2024-11-27 16:34:16 +02:00
parent 4f5557f6ca
commit 69ac69f41c
1 changed files with 10 additions and 4 deletions

View File

@ -1,9 +1,17 @@
<?php
// registration is allowed, go on
/**
* User registration
*
* This page ("register") handles user registration if the feature is enabled in the configuration.
* It accepts a POST request with a username and password, attempts to register the user,
* and redirects to the login page on success or displays an error message on failure.
*/
// check if the registration is allowed
if ($config['registration_enabled'] === true) {
// require '../app/classes/user.php';
// clear any previous error messages
unset($error);
try {
@ -11,8 +19,6 @@ if ($config['registration_enabled'] === true) {
// connect to database
$dbWeb = connectDB($config);
// $userObject = new User($dbWeb);
if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
$username = $_POST['username'];
$password = $_POST['password'];