mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-04 20:03:11 +02:00
feat(active-codes): Smart Activation Codes system
Pre-generated stock voucher codes that pair with an auto-created line and count down only on the client's first activation. Full admin + reseller management — list, generate wizard, batch manager, mass edit — plus an activation portal and a public activation API. - schema: activation_codes table (migration 019 + database.sql) - domain: ActiveCodeService (generate / activate / mass actions / export / batch summary; view queries live here, not in the templates) - admin + reseller controllers and views; PortalController + activation API - nginx routes for /active_code.php and the active_code API endpoint - wired into auth, users, reseller dispatcher, table/player APIs and navbar Passes phpstan, phpcs, make gates, and the unit suite (524 tests).
This commit is contained in:
@@ -393,6 +393,22 @@ class UserRepository {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a line by username.
|
||||
*
|
||||
* @param string $rUsername Line username.
|
||||
* @return array|null The line row, or null if not found.
|
||||
*/
|
||||
public static function getLineByUsername($rUsername) {
|
||||
$db = self::db();
|
||||
$db->query('SELECT * FROM `lines` WHERE `username` = ?;', $rUsername);
|
||||
|
||||
if ($db->num_rows() == 1) {
|
||||
return $db->get_row();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a registered (panel) user by id.
|
||||
*
|
||||
@@ -409,6 +425,16 @@ class UserRepository {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for getRegisteredUserById.
|
||||
*
|
||||
* @param int $rID User id.
|
||||
* @return array|null
|
||||
*/
|
||||
public static function getUserById($rID) {
|
||||
return self::getRegisteredUserById($rID);
|
||||
}
|
||||
|
||||
/**
|
||||
* List registered users under an owner.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user