Последнии сообщения форума
Adds the GeoLite2 Country and ASN binary database files to storage/geoip/. These files are read directly by the pure-PHP MMDB parser in core/classes/geoip.php.
Core changes:
- Country database (storage/geoip/country.mmdb):
- GeoLite2-Country MMDB, ~8.9 MB
- ASN database (storage/geoip/asn.mmdb):
- GeoLite2-ASN MMDB, ~12 MB
Benefits: - GeoIP lookups work out of the box without a separate download step - Both country and ASN resolution available immediately after clone
Technical notes: - Files are binary MMDB format, read via file_get_contents() and cached - Web access blocked by storage/geoip/.htaccess (deny from all) - Database files should be updated periodically from maxmind.com
Updates the two directory protection files in storage/geoip/ to remove trailing newlines and condense index.html to a single-line redirect. Deletes templates/admin/images/misc/sprite.png which is no longer referenced.
Core changes:
- Storage protection (storage/geoip/.htaccess):
- Removed trailing newline (content unchanged: deny from all)
- Storage index (storage/geoip/index.html):
- Condensed to single-line HTML with meta-refresh redirect to slaed.net
- Removed multi-line doctype/head/body boilerplate
- Admin image cleanup (templates/admin/images/misc/sprite.png):
- Deleted; file is no longer used after icon migration to SVG/Bootstrap-Icons
Benefits: - Consistent with project-wide one-liner protection file convention - Removes orphaned binary asset from admin theme
Technical notes: - No functional changes to directory access control - sprite.png was the last remaining PNG in templates/admin/images/misc/
Removes the legacy user_geo_ip() function from core/system.php and replaces all call sites across admin modules, frontend modules, and core files with the typed Geoip class methods (getIpHtml, getFlagHtml, getCountry, getInfo). Also removes the now-redundant getGeoipInfo() and getGeoipCountry() wrappers.
Core changes:
- System core (core/system.php):
- Removed user_geo_ip() function (flag + IP link rendering with legacy $id param)
- Removed getGeoipInfo() and getGeoipCountry() thin wrapper functions
getUserSessionInfo(): replaced user_geo_ip($host, 3) with Geoip::getFlagHtml() * 2 call sites updated (registered user, bot)
- getUserSessionAdminInfo(): replaced 5 call sites with Geoip::getFlagHtml()
- ashowcom(): replaced user_geo_ip($com_host, 4) with Geoip::getIpHtml()
- Core user (core/user.php):
- getPrivateMessageView(): user_geo_ip($ip_sender, 4) → Geoip::getIpHtml()
- Frontend entry (index.php):
Language auto-detection: replaced user_geo_ip(getIp(), 2) with Geoip::getCountry() using ISO 2-letter code lookup table * Removed string-matching against country names * Added compact array map: ['GB'=>'en','US'=>'en','CA'=>'en','AU'=>'en',
'FR'=>'fr','DE'=>'de','PL'=>'pl','RU'=>'ru','UA'=>'uk']- Admin modules (comments, security, config):
- comments.php: 2 call sites → Geoip::getIpHtml()
- security.php: 1 call site → Geoip::getIpHtml()
- config.php: getGeoipRows() calls Geoip::getInfo() directly
- Frontend/admin modules (13 files):
account/admin/index.php, account/index.php, auto_links/admin/index.php, faq/admin/index.php, files/admin/index.php, forum/index.php, help/admin/index.php, jokes/admin/index.php, links/admin/index.php, media/admin/index.php, money/admin/index.php, news/admin/index.php, order/admin/index.php, pages/admin/index.php, users/index.php, whois/admin/index.php
- All user_geo_ip($ip, 4) → Geoip::getIpHtml($ip)
- account/index.php: user_geo_ip($ip, 2) → Geoip::getInfo() with country_name
Benefits: - user_geo_ip() fully removed; all IP display goes through the Geoip class - ISO code-based language detection is cleaner and extensible - No functional regression: output HTML shape unchanged
Technical notes: - user_geo_ip() $id param modes (1=ip, 2=country_name, 3=flag, 4=flag+link) replaced by explicit Geoip method names - getip() renamed to getIp() in index.php call (case correction) - All replacements are one-to-one; no logic change in surrounding code
Removes the separate config/geoip.php file and merges GeoIP settings directly into config/global.php as flat top-level keys (geoip_anon, geoip_asn, geoip_cache, geoip_country, geoip_enabled, geoip_store, geoip_test). Aligns config schema with the Geoip class refactor.
Core changes:
- Config migration (config/global.php):
- Removed legacy geo_ip key
- Added flat geoip_* keys replacing nested geoip.php structure
- Config deletion (config/geoip.php):
- File removed; settings now live in global.php
- Config fingerprint (config/local.php):
- Updated base_fingerprint after schema change
- Admin config panel (admin/modules/config.php):
- getGeoipPanel(): reads $conf['geoip_*'] flat keys instead of $conf['geoip'][...]
- getGeoipRows(): calls Geoip::getInfo() directly; removed getGeoipInfo() wrapper
- Removed checkPerms(CONFIG_DIR.'/geoip.php') call from panel output
- save(): GeoIP settings now written into global.php via existing setConfigFile()
- Removed separate setConfigFile('geoip.php', ...) block
Redirect simplified: testip param removed from redirect; test IP persisted in geoip_test key of global.php instead
Benefits: - Single config file for all settings; no extra file to manage - Consistent with existing global.php admin save pattern
Technical notes: - Old geo_ip boolean key removed; replaced by geoip_enabled int key - setConfigFile('geoip.php') call and geoip.php file both eliminated - No URL or DB schema changes
Removes the geoip2/geoip2 Composer dependency and replaces the MaxMind PHP SDK reader with a self-contained pure-PHP MMDB binary parser inside the Geoip class. All lookup results and public API shape remain unchanged.
Core changes:
- Geoip class (core/classes/geoip.php):
- Removed getReader() which required GeoIp2\Database\Reader
- Added getMmdb(): loads and caches the raw MMDB binary payload + metadata
- Added getRecord(): walks the radix search tree to locate a data record
Added getMmdbNode(), getMmdbDecode(), getMmdbValue(), getMmdbSize(), getMmdbPointer(), getMmdbUint(): pure-PHP MMDB binary format decoder
- Extracted getCountryData() and getAsnData() private helpers with own caches
- Config keys changed from nested $conf['geoip'][...] to flat $conf['geoip_*']
- Added getFlagHtml(): returns flag <span> HTML for a given IP
- Added getIpHtml(): returns flag + IP link HTML for admin display
- getCountry(): now calls getCountryData() directly; avoids full getInfo() cost
- Composer (composer.json):
- Removed geoip2/geoip2 ^3.1 requirement
Benefits: - Zero external runtime dependency for GeoIP lookups - Database files read with file_get_contents() and cached in static property - Fully self-contained; works without Composer autoload for GeoIP
Technical notes: - Supports MMDB record sizes 24, 28, and 32 bits - IPv4-in-IPv6 mapping handled via 96-bit prefix traversal - Backward compatible: getInfo(), getCountry(), getEmpty(), getFileInfo() unchanged
Adds 14 new i18n constants for GeoIP UI labels across all six admin language files (de, en, fr, pl, ru, uk) and updates the existing _GEO_IP constant with clearer active-voice phrasing aligned to the new panel.
Core changes:
- Language files (admin/lang/*.php — all six locales):
- Updated _GEO_IP to shorter active-voice phrasing
- Added _GEOLOCATION section heading
Added GeoIP-specific constants: _GEOIP_ANON, _GEOIP_ASN, _GEOIP_ASNDB, _GEOIP_CACHE, _GEOIP_CONTINENT, _GEOIP_COUNTRYDB, _GEOIP_COUNTRYNAME, _GEOIP_ORG, _GEOIP_PROVIDER, _GEOIP_STORE, _GEOIP_TESTIP
- Added generic reusable constants: _FOUND, _NOTFOUND, _PARAMETERS, _VALUE
Benefits: - All GeoIP panel labels are fully localized in six languages - Generic constants (_FOUND, _NOTFOUND, _PARAMETERS, _VALUE) are reusable across other admin modules
Technical notes: - Constants inserted in alphabetical order at the existing _GEO_IP position - No logic changes; pure i18n additions
Extends admin/modules/config.php with a GeoIP configuration section rendered on the Multilingual tab and a save handler that persists settings to config/geoip.php. The panel also shows live database status and a per-IP lookup test.
Core changes:
- Admin config panel (admin/modules/config.php):
getGeoipPanel(): renders GeoIP settings form rows, DB status table, and test-IP result * getGeoipBadge(): renders found/not-found status badge via inline-badge fragment * getGeoipFileRow(): renders one DB file status row (name, status, size, date, path) * getGeoipRows(): renders live lookup result for a test IP address
- config(): merged GeoIP panel into tab 2 (Multilingual / Geolocation)
- save(): persists geoipenabled, geoipcache, geoipanon, geoipstore via setConfigFile()
- Redirect preserves testip query param so the test result survives after save
Benefits: - Operators can verify database files and test IP lookup without shell access - All GeoIP settings (TTL, anonymization, IP storage) are configurable via UI
Technical notes: - geoip.php is written by setConfigFile(), aligned with the global.php pattern - Tab label changed from Multilingual to Multilingual / Geolocation - No schema or URL contract changes; redirect path extended with optional testip param
Introduces the Geoip class, configuration, and system-level autoloading to resolve visitor country and ASN data from MaxMind GeoIP2 databases. The subsystem is opt-in, isolated in core/classes/geoip.php, and exposes two thin wrappers in core/system.php.
Core changes:
- GeoIP class (core/classes/geoip.php):
Static class with in-request per-process cache keyed on IP hash * getInfo(): returns country, continent, ASN, organization, provider, status * getCountry(): shorthand returning the ISO country code * getFileInfo(): returns database file metadata for admin UI
- IP anonymization: SHA-1 hash used as cache key unless store_ip is set
- MaxMind reader lazily opened once per process per DB path
- System bootstrap (core/system.php):
- Added require_once for geoip.php after parser.php
- Exposed getGeoipInfo() and getGeoipCountry() as public system helpers
- GeoIP configuration (config/geoip.php):
New config file with enabled, country_database, asn_database, cache_ttl, anonymize_ip, store_ip keys
- GeoIP storage directory (storage/geoip/):
- Added .htaccess and index.html directory protection files
- Composer dependency (composer.json):
- Added geoip2/geoip2 ^3.1 requirement
- Config fingerprint (config/local.php):
- Updated base_fingerprint after adding config/geoip.php
Benefits: - Country and ASN resolution available project-wide without additional setup - Opt-in: gracefully no-ops when databases are absent - IP anonymization on by default; full IP storage is opt-in
Technical notes: - Databases expected at storage/geoip/country.mmdb and storage/geoip/asn.mmdb - Reader is opened lazily and cached statically per process - Backward compatible: existing code unchanged; new functions are additive
All theme directories now have index.html protection files redirecting to https://slaed.net. The default theme's outdated 212-line demo template is replaced with the same one-line redirect. All existing redirects are updated from http://www.slaed.net to https://slaed.net.
Core changes:
- New protection files:
- Add templates/admin/index.html (redirect to https://slaed.net)
- Add templates/lite/index.html (redirect to https://slaed.net)
- Add templates/simple/index.html (redirect to https://slaed.net)
- Add templates/simple/.htaccess (deny .html direct access)
- Replace outdated demo template (templates/default/index.html):
- Remove 212-line legacy demo HTML
- Replace with standard one-line directory protection redirect
- URL normalization (templates/*/images/index.html):
Update http://www.slaed.net to https://slaed.net * default/images/, lite/images/, simple/images/
Benefits: - Consistent directory protection across all four themes - No stale http:// redirect URLs remain in template directories
Technical notes: - Redirect target: https://slaed.net (no www, HTTPS)
The admin theme already received its favicon.svg in a prior commit. The remaining three themes now get the same file in their images/ dirs so all favicon lookups via is_file() resolve correctly.
Core changes:
- SVG favicon (templates/default/images/favicon.svg):
- Add favicon.svg (8998 bytes)
- SVG favicon (templates/lite/images/favicon.svg):
- Add favicon.svg (8998 bytes)
- SVG favicon (templates/simple/images/favicon.svg):
- Add favicon.svg (8998 bytes)
Benefits: - All four themes now have a valid favicon.svg at the expected path - is_file() guards in core will resolve to true for all themes
Technical notes: - Path convention: templates/{theme}/images/favicon.svg





