PATH:
opt
/
hc_php
/
unversioned
<?php namespace HcEventPublisher; include_once('JsonRPC/Client.php'); use JsonRPC; const USER_AGENT_SOCKET = '/var/run/hc_cpanelsharedhosting_agent/rpc_user.sock'; const ROOT_AGENT_SOCKET = '/var/run/hc_cpanelsharedhosting_agent/rpc.sock'; const METHOD = 'event.publish'; const DEBUG = false; const BASE_PATH = '/var/cpanel/userdata'; const TOKEN_FILE = 'hc_agent.token'; class EventPublisher extends JsonRPC\Client { public function __construct() { $processUser = posix_getpwuid(posix_geteuid()); $this->user = $processUser['name']; if ($this->user == 'root') { parent::__construct(ROOT_AGENT_SOCKET); } else { parent::__construct(USER_AGENT_SOCKET); } $this->debug = DEBUG; } public function send($params=array()) { // Add token to the request if user is not root. if ($this->user != 'root') { $full_token_path = sprintf('%s/%s/%s', BASE_PATH, $this->user, TOKEN_FILE); if (file_exists($full_token_path)) { $params['metadata']['token'] = trim(file_get_contents($full_token_path)); } } return $this->execute(METHOD, $params); } } ?>
[-] SoftaculousPHPSwitcher.php
[edit]
[-] EventPublisher.php
[edit]
[+]
..
[-] SoftaculousEventsHandler.php
[edit]
[+]
JsonRPC
[-] SoftaculousHtaccessRewriter.php
[edit]