Skip to content

Commit a549dc2

Browse files
docs: Enhance README with project metadata and screenshot
- The README update adds comprehensive project badges (release, license, build status, dependencies, etc.) and a project screenshot, improving project visibility and information. - In the UserSessionModel, the geolocation API call to `ip-api.com` now explicitly requests the `status` field. This ensures the `success` check is more robust and reliable against unexpected API responses.
1 parent 44f10f8 commit a549dc2

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,18 @@
22

33
CI4MS is a CodeIgniter 4-based CMS skeleton that delivers a production-ready, modular architecture with RBAC authorization and theme support. It combines CMS workflows, developer-focused CLI commands, an extensible module system, and customizable front-end themes in a single package.
44

5-
[![Patreon](https://img.shields.io/badge/Patreon-Support%20Us-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://patreon.com/cw/bertugfahriozer)
6-
5+
[![Release](https://img.shields.io/github/v/release/ci4-cms-erp/ci4ms?style=for-the-badge&label=release)](https://github.com/ci4-cms-erp/ci4ms/releases)
6+
[![License](https://img.shields.io/github/license/ci4-cms-erp/ci4ms?style=for-the-badge)](https://github.com/ci4-cms-erp/ci4ms/blob/main/LICENSE)
7+
[![Build](https://img.shields.io/github/actions/workflow/status/ci4-cms-erp/ci4ms/docker-test.yml?style=for-the-badge&label=build)](https://github.com/ci4-cms-erp/ci4ms/actions)
8+
![PHP](https://img.shields.io/badge/PHP-%3E%3D8.1-777BB4?style=for-the-badge&logo=php&logoColor=white)
9+
![CodeIgniter](https://img.shields.io/badge/CodeIgniter-4.x-EF4223?style=for-the-badge&logo=codeigniter&logoColor=white)
10+
![Packagist Downloads](https://img.shields.io/packagist/dt/ci4-cms-erp/ci4ms?style=for-the-badge)
11+
[![Stars](https://img.shields.io/github/stars/ci4-cms-erp/ci4ms?style=for-the-badge)](https://github.com/ci4-cms-erp/ci4ms/stargazers)
12+
[![Forks](https://img.shields.io/github/forks/ci4-cms-erp/ci4ms?style=for-the-badge)](https://github.com/ci4-cms-erp/ci4ms/network/members)
13+
14+
[![Patreon](https://img.shields.io/badge/Patreon-Support%20Me-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://patreon.com/cw/bertugfahriozer)
15+
16+
![ci4ms-screenshot](https://bertugfahriozer.com/uploads/media/ci4ms-screenshot.webp)
717

818
## Key Features
919

modules/Auth/Models/UserSessionModel.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class UserSessionModel extends Model
4141
* Creates a new session record after a login request.
4242
* To prevent duplicate records, if an existing session matching the provided
4343
* tracking ID is found, it will update the existing data instead.
44-
*
44+
*
4545
* @param int $userId System ID of the user
4646
* @param string $sessionId Permanent device identifier (Tracker ID)
4747
* @param array $deviceInfo Device details returned from the device helper
@@ -66,7 +66,7 @@ public function recordLogin(int $userId, string $sessionId, array $deviceInfo, s
6666
'is_active' => 1,
6767
];
6868

69-
$geo = @json_decode(file_get_contents("http://ip-api.com/json/{$ip}?fields=city,country,regionName"), true);
69+
$geo = @json_decode(file_get_contents("http://ip-api.com/json/{$ip}?fields=city,country,regionName,status"), true);
7070
if ($geo && $geo['status'] ?? '' === 'success') {
7171
$data['city'] = $geo['city'] ?? null;
7272
$data['country'] = $geo['country'] ?? null;
@@ -82,7 +82,7 @@ public function recordLogin(int $userId, string $sessionId, array $deviceInfo, s
8282

8383
/**
8484
* Updates the last activity date for the active session upon every page request.
85-
* To optimize database performance, it utilizes a caching mechanism (cooldown) to ensure
85+
* To optimize database performance, it utilizes a caching mechanism (cooldown) to ensure
8686
* a maximum of one UPDATE query is executed per 60 seconds for the same session.
8787
*
8888
* @param string $sessionId Permanent device identifier
@@ -107,7 +107,7 @@ public function touchSession(string $sessionId): void
107107

108108
/**
109109
* Terminates a defined device/session record for a specific user.
110-
* Instead of physically deleting the session file, it safely disables the session
110+
* Instead of physically deleting the session file, it safely disables the session
111111
* at the Filter level by utilizing the database's "is_active" flag logic.
112112
*
113113
* @param int $userId System ID of the user

0 commit comments

Comments
 (0)