Compare commits

...

3 Commits

Author SHA1 Message Date
Yasen Pramatarov 3279a565aa Adds phpdoc comments 2024-11-27 16:36:56 +02:00
Yasen Pramatarov 69ac69f41c Adds phpdoc comments 2024-11-27 16:34:16 +02:00
Yasen Pramatarov 4f5557f6ca Adds phpdoc comments 2024-11-27 16:26:55 +02:00
3 changed files with 36 additions and 8 deletions

View File

@ -1,8 +1,11 @@
<?php
//
// logs listings
//
/**
* Logs Listings
*
* This page ("logs") retrieves and displays logs for a specified user within a time range.
* It supports pagination and filtering, and generates a widget to display the logs.
*/
// specify time range
include '../app/helpers/time_range.php';
@ -13,7 +16,7 @@ $browse_page = $_REQUEST['p'] ?? 1;
$browse_page = (int)$browse_page;
$offset = ($browse_page -1) * $items_per_page;
// user or system
// logs scope: user or system
$scope = 'user';
// prepare the result

View File

@ -1,5 +1,24 @@
<?php
/**
* User Profile Management
*
* This page ("profile") handles user profile actions such as updating user details,
* avatar management, and assigning or removing user rights.
* It supports both form submissions and displaying profile templates.
*
* Actions handled:
* - `remove`: Remove a user's avatar.
* - `edit`: Edit user profile details, rights, or avatar.
*
* Global Variables Used:
* - `$userObject`: Instance of the user management class.
* - `$userDetails`: Current user details array.
* - `$userRights`: Array of user's current rights.
* - `$config`: Configuration array for avatars and other settings.
* - `$app_root`: Base URL of the application.
*/
$action = $_REQUEST['action'] ?? '';
// if a form is submitted, it's from the edit page

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'];