Módulo VPSManager para WHMCS con configuración externa, acceso seguro al panel y métricas Graphite para LX.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

35 lines
1.5 KiB

  1. <?php
  2. // Representative WHMCS boundary only: not an implementation of the encrypted router.
  3. namespace WHMCS\Authentication {
  4. class CurrentUser {
  5. public function isAuthenticatedAdmin() { return $GLOBALS['isAdmin'] ?? false; }
  6. public function client() { return $GLOBALS['actor'] ?? null; }
  7. public function isAuthenticatedUser() { return isset($GLOBALS['actor']); }
  8. }
  9. }
  10. namespace WHMCS\Database {
  11. class Capsule {
  12. public static function table($table) { return new Query($table); }
  13. }
  14. class Query {
  15. private $table; private $where = [];
  16. public function __construct($table) { $this->table = $table; }
  17. public function where($key, $value) { $this->where[$key] = $value; return $this; }
  18. public function get() {
  19. return array_values(array_filter($GLOBALS['db'][$this->table] ?? [], function ($row) {
  20. foreach ($this->where as $key => $value) if ($row->$key != $value) return false;
  21. return true;
  22. }));
  23. }
  24. public function first() { return $this->get()[0] ?? null; }
  25. }
  26. }
  27. namespace {
  28. class BackupTestClient {
  29. public $id; public $permitted;
  30. public function __construct($id, $permitted = true) { $this->id = $id; $this->permitted = $permitted; }
  31. public function hasPermission($permission) { return $permission === 'products' && $this->permitted; }
  32. }
  33. function logActivity($message) { $GLOBALS['safeLogs'][] = $message; }
  34. }