Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace MoSharePointObjectSync\API; use MoSharePointObjectSync\Wrappers\pl..
Decoded Output download
<?php
namespace MoSharePointObjectSync\API;
use MoSharePointObjectSync\Wrappers\pluginConstants;
use MoSharePointObjectSync\Wrappers\wpWrapper;
class SharePoint
{
private static $obj;
private $endpoints;
private $config;
private $scope = "https://graph.microsoft.com/.default";
private $access_token;
private $handler;
private function __construct($u8)
{
$this->config = $u8;
$this->handler = Authorization::getController();
}
public static function getClient($u8)
{
if (isset(self::$obj)) {
goto cQ;
}
self::$obj = new SharePoint($u8);
self::$obj->setEndpoints();
cQ:
return self::$obj;
}
private function setEndpoints()
{
$this->endpoints["token"] = "https://login.microsoftonline.com/" . $this->config["tenant_id"] . "/oauth2/v2.0/token";
$this->endpoints["sps_common_token"] = "https://login.microsoftonline.com/common/oauth2/token";
$this->endpoints["sites"] = "https://graph.microsoft.com/v1.0/sites?search=*&$select=id,displayName";
$this->endpoints["drives"] = "https://graph.microsoft.com/v1.0/sites/%s/drives";
$this->endpoints["docs"] = "https://graph.microsoft.com/v1.0/drives/%s/root/children";
$this->endpoints["folder_items"] = "https://graph.microsoft.com/v1.0/drives/%s/items/%s/children";
$this->endpoints["file_thumbnails"] = "https://graph.microsoft.com/v1.0/drives/%s/items/%s/thumbnails";
$this->endpoints["file_preview"] = "https://graph.microsoft.com/v1.0/drives/%s/items/%s/preview";
$this->endpoints["search_driveitems"] = "https://graph.microsoft.com/v1.0/drives/%s/root/search(q='%s')";
$this->endpoints["upload_items"] = "https://graph.microsoft.com/v1.0/drives/%s/items/%s:/%s:/createUploadSession";
$this->endpoints["download_items"] = "https://graph.microsoft.com/v1.0/drives/%s/items/%s/content";
$this->endpoints["file_item"] = "https://graph.microsoft.com/v1.0/drives/%s/items/%s";
$this->endpoints["personal_drives"] = "https://graph.microsoft.com/v1.0/users/%s/drives";
}
public function mo_sps_get_new_access_token()
{
$vI = "manual";
if ($vI == "manual") {
goto Vi;
}
$dw = $this->handler->mo_sps_get_access_token_using_authorization_code($this->endpoints, $this->config, $this->scope);
goto RH;
Vi:
$dw = $this->handler->mo_sps_get_access_token_using_client_credentials($this->endpoints, $this->config, $this->scope);
RH:
$this->access_token = $dw;
if (!$dw["status"]) {
goto Rn;
}
$i9 = ["Authorization" => "Bearer " . $this->access_token["data"]];
return $this->access_token["data"];
Rn:
return false;
}
public function mo_sps_get_all_sites()
{
$dT = $this->mo_sps_get_new_access_token();
$tV = wpWrapper::mo_sps_get_option(pluginConstants::APP_CONFIG);
if ($dT) {
goto Ce;
}
return $this->access_token;
Ce:
$i9 = ["Authorization" => "Bearer " . $dT];
if (isset($tV["site_url"]) && $tV["site_url"] != '') {
goto YF;
}
$fF = $this->endpoints["sites"];
goto CG;
YF:
$fF = $tV["site_url"];
$my = parse_url($fF);
$G_ = explode("/", $my["host"]);
$iU = "https://graph.microsoft.com/v1.0/sites/" . $my["host"] . ":" . $my["path"] . "?search=*&$select=id,displayName";
$fF = $iU;
CG:
$dw = $this->handler->mo_sps_get_request($fF, $i9);
return $dw;
}
public function mo_sps_get_all_drives($xk)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto Xc;
}
return $this->access_token;
Xc:
$i9 = ["Authorization" => "Bearer " . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["drives"], $xk), $i9);
return $dw;
}
public function mo_sps_get_all_personal_drives($CI)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto O5;
}
return $this->access_token;
O5:
$i9 = ["Authorization" => "Bearer " . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["personal_drives"], $CI), $i9);
return $dw;
}
public function mo_sps_get_all_docs($xc)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto v8;
}
return $this->access_token;
v8:
$i9 = ["Authorization" => "Bearer " . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["docs"], $xc), $i9);
return $dw;
}
public function mo_sps_get_all_folder_items($xc, $K2)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto ku;
}
return $this->access_token;
ku:
$i9 = ["Authorization" => "Bearer " . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["folder_items"], $xc, $K2), $i9);
return $dw;
}
public function mo_sps_get_file_thumbnails($xc, $bH)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto PV;
}
return $this->access_token;
PV:
$i9 = ["Authorization" => "Bearer " . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["file_thumbnails"], $xc, $bH), $i9);
return $dw;
}
public function mo_sps_get_file_details($xc, $bH)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto OD;
}
return $this->access_token;
OD:
$i9 = ["Authorization" => "Bearer " . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["file_item"], $xc, $bH), $i9, []);
return $dw;
}
public function mo_sps_get_file_preview($xc, $bH)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto uV;
}
return $this->access_token;
uV:
$i9 = ["Authorization" => "Bearer " . $dT];
$dw = $this->handler->mo_sps_post_request(sprintf($this->endpoints["file_preview"], $xc, $bH), $i9, []);
return $dw;
}
public function mo_sps_get_download_content($xc, $bH)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto OZ;
}
return $this->access_token;
OZ:
$i9 = ["Authorization" => "Bearer " . $dT];
$dw = $this->handler->mo_sps_get_request_for_url(sprintf($this->endpoints["download_items"], $xc, $bH), $i9);
return $dw;
}
public function mo_sps_search_through_drive_items($xc, $qg)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto tv;
}
return $this->access_token;
tv:
$i9 = ["Authorization" => "Bearer " . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["search_driveitems"], $xc, $qg), $i9);
return $dw;
}
public function mo_sps_get_upload_session($xc, $K2, $Ya)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto eW;
}
return $this->access_token;
eW:
$i9 = ["Authorization" => "Bearer " . $dT, "Content-Type" => "application/x-www-form-urlencoded"];
$K2 = $K2 == '' ? "root" : $K2;
$dw = $this->handler->mo_sps_post_request(sprintf($this->endpoints["upload_items"], $xc, $K2, $Ya), $i9, '');
return $dw;
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace MoSharePointObjectSync\API;
use MoSharePointObjectSync\Wrappers\pluginConstants;
use MoSharePointObjectSync\Wrappers\wpWrapper;
class SharePoint
{
private static $obj;
private $endpoints;
private $config;
private $scope = "\x68\x74\x74\160\x73\x3a\x2f\57\147\162\141\x70\150\56\x6d\151\143\162\x6f\x73\x6f\146\x74\56\x63\157\155\57\x2e\x64\145\146\x61\165\154\x74";
private $access_token;
private $handler;
private function __construct($u8)
{
$this->config = $u8;
$this->handler = Authorization::getController();
}
public static function getClient($u8)
{
if (isset(self::$obj)) {
goto cQ;
}
self::$obj = new SharePoint($u8);
self::$obj->setEndpoints();
cQ:
return self::$obj;
}
private function setEndpoints()
{
$this->endpoints["\164\x6f\153\x65\156"] = "\150\x74\164\160\163\72\x2f\57\x6c\157\x67\151\x6e\56\155\x69\143\x72\157\163\x6f\x66\164\157\x6e\x6c\x69\156\145\56\143\x6f\x6d\x2f" . $this->config["\x74\145\x6e\141\x6e\164\137\x69\x64"] . "\57\x6f\141\x75\164\150\62\x2f\x76\x32\56\x30\x2f\164\x6f\153\x65\x6e";
$this->endpoints["\163\x70\x73\137\x63\157\x6d\x6d\157\156\x5f\x74\x6f\153\x65\156"] = "\x68\164\164\x70\163\x3a\x2f\x2f\154\157\x67\151\156\56\155\151\x63\162\x6f\163\157\146\x74\157\156\x6c\151\156\145\56\x63\157\155\57\143\x6f\155\155\157\x6e\x2f\x6f\141\x75\164\150\62\x2f\x74\157\153\x65\x6e";
$this->endpoints["\x73\151\164\x65\163"] = "\x68\x74\164\x70\163\x3a\57\57\x67\x72\141\160\x68\56\155\151\143\x72\157\x73\x6f\146\x74\x2e\x63\157\x6d\57\x76\61\x2e\60\x2f\163\151\x74\x65\x73\77\x73\x65\141\162\x63\x68\75\x2a\x26\44\x73\x65\154\x65\143\x74\75\151\x64\54\144\x69\163\160\154\x61\x79\116\141\x6d\x65";
$this->endpoints["\144\x72\x69\166\x65\x73"] = "\150\x74\164\160\x73\72\57\57\147\162\141\x70\150\56\155\151\x63\162\157\163\157\x66\x74\56\143\157\155\x2f\166\61\56\x30\57\x73\x69\x74\145\x73\57\x25\163\x2f\144\x72\x69\x76\x65\x73";
$this->endpoints["\x64\157\143\163"] = "\x68\164\x74\160\163\72\57\57\147\x72\141\x70\x68\x2e\155\x69\143\162\x6f\x73\x6f\146\164\x2e\143\157\155\57\166\61\x2e\x30\x2f\x64\162\151\x76\145\163\57\45\163\57\162\x6f\x6f\x74\x2f\143\150\x69\154\144\162\x65\x6e";
$this->endpoints["\146\x6f\x6c\144\145\x72\137\151\x74\145\x6d\x73"] = "\x68\164\x74\x70\163\72\57\57\x67\162\x61\160\x68\56\155\151\x63\x72\x6f\x73\x6f\x66\x74\56\x63\157\155\x2f\x76\61\x2e\60\x2f\144\x72\151\166\x65\163\57\x25\163\57\x69\164\x65\155\163\x2f\45\x73\x2f\143\150\151\154\x64\x72\145\x6e";
$this->endpoints["\146\x69\x6c\145\x5f\x74\x68\x75\155\142\x6e\141\151\x6c\163"] = "\150\164\x74\160\x73\x3a\x2f\57\x67\x72\141\160\x68\56\x6d\x69\x63\162\x6f\163\x6f\146\164\56\143\x6f\x6d\x2f\x76\61\x2e\x30\57\x64\x72\151\166\145\163\x2f\45\163\57\151\164\145\155\x73\57\x25\163\57\x74\150\x75\x6d\142\156\141\x69\x6c\163";
$this->endpoints["\x66\x69\154\x65\137\x70\x72\145\x76\151\145\167"] = "\x68\164\164\160\163\x3a\57\x2f\x67\162\x61\160\x68\x2e\x6d\151\x63\x72\x6f\x73\x6f\146\x74\56\143\x6f\x6d\x2f\x76\x31\56\60\x2f\144\162\151\166\145\x73\x2f\45\163\x2f\x69\164\145\155\163\57\45\x73\57\x70\162\145\x76\151\x65\x77";
$this->endpoints["\163\x65\141\162\143\150\x5f\144\x72\151\166\x65\151\x74\x65\x6d\163"] = "\150\164\x74\160\163\72\x2f\57\147\x72\141\x70\150\x2e\155\151\x63\162\x6f\x73\x6f\x66\x74\x2e\143\157\x6d\57\166\61\x2e\x30\x2f\x64\x72\x69\x76\145\x73\57\45\x73\x2f\x72\x6f\x6f\164\57\163\x65\141\162\x63\150\50\161\75\47\x25\163\x27\x29";
$this->endpoints["\x75\x70\x6c\x6f\141\144\137\151\x74\145\x6d\x73"] = "\x68\x74\x74\x70\x73\x3a\57\x2f\147\x72\x61\x70\150\56\155\x69\x63\x72\x6f\x73\157\x66\x74\x2e\x63\157\155\x2f\166\61\56\60\x2f\x64\162\x69\x76\x65\x73\57\45\x73\x2f\x69\164\x65\x6d\x73\x2f\x25\x73\72\57\x25\x73\72\57\x63\x72\x65\x61\164\145\125\160\x6c\x6f\x61\144\x53\145\x73\x73\x69\x6f\156";
$this->endpoints["\x64\x6f\x77\x6e\154\157\141\144\137\151\164\x65\x6d\x73"] = "\x68\x74\x74\160\x73\72\57\57\x67\162\141\160\x68\56\155\x69\x63\x72\157\x73\157\x66\x74\56\143\x6f\155\57\166\61\56\x30\57\144\162\x69\x76\145\163\x2f\x25\x73\x2f\x69\164\x65\155\x73\57\x25\x73\57\143\x6f\156\164\145\156\164";
$this->endpoints["\x66\x69\154\x65\x5f\151\164\145\155"] = "\x68\x74\164\x70\163\72\57\57\147\x72\141\160\x68\56\155\151\143\162\x6f\x73\157\x66\x74\x2e\143\157\155\x2f\x76\x31\56\60\57\144\162\151\x76\145\x73\x2f\x25\x73\57\x69\164\145\x6d\163\x2f\x25\163";
$this->endpoints["\x70\x65\x72\163\x6f\156\x61\154\x5f\x64\x72\x69\x76\145\163"] = "\x68\x74\164\160\163\72\57\x2f\x67\162\x61\160\150\56\x6d\151\x63\162\157\163\x6f\x66\164\x2e\x63\x6f\x6d\x2f\x76\x31\56\60\57\165\x73\145\162\x73\57\x25\x73\x2f\144\x72\151\166\145\163";
}
public function mo_sps_get_new_access_token()
{
$vI = "\x6d\141\x6e\165\x61\x6c";
if ($vI == "\x6d\x61\x6e\x75\x61\x6c") {
goto Vi;
}
$dw = $this->handler->mo_sps_get_access_token_using_authorization_code($this->endpoints, $this->config, $this->scope);
goto RH;
Vi:
$dw = $this->handler->mo_sps_get_access_token_using_client_credentials($this->endpoints, $this->config, $this->scope);
RH:
$this->access_token = $dw;
if (!$dw["\x73\x74\141\x74\165\x73"]) {
goto Rn;
}
$i9 = ["\x41\x75\x74\150\x6f\x72\x69\x7a\x61\164\151\157\x6e" => "\x42\x65\x61\x72\x65\162\x20" . $this->access_token["\144\x61\x74\141"]];
return $this->access_token["\x64\x61\164\x61"];
Rn:
return false;
}
public function mo_sps_get_all_sites()
{
$dT = $this->mo_sps_get_new_access_token();
$tV = wpWrapper::mo_sps_get_option(pluginConstants::APP_CONFIG);
if ($dT) {
goto Ce;
}
return $this->access_token;
Ce:
$i9 = ["\x41\165\x74\150\157\x72\151\x7a\141\164\151\x6f\x6e" => "\102\x65\x61\x72\145\x72\x20" . $dT];
if (isset($tV["\163\151\164\x65\x5f\x75\x72\x6c"]) && $tV["\163\151\164\x65\137\165\x72\x6c"] != '') {
goto YF;
}
$fF = $this->endpoints["\x73\x69\x74\145\163"];
goto CG;
YF:
$fF = $tV["\163\151\164\145\137\x75\x72\154"];
$my = parse_url($fF);
$G_ = explode("\x2f", $my["\150\157\163\x74"]);
$iU = "\150\164\x74\160\163\x3a\57\57\147\162\141\x70\x68\x2e\x6d\151\143\162\157\x73\x6f\x66\x74\x2e\143\157\155\57\x76\x31\x2e\x30\57\163\x69\164\x65\163\57" . $my["\150\x6f\163\x74"] . "\72" . $my["\160\x61\x74\150"] . "\77\163\x65\x61\x72\143\150\x3d\x2a\46\x24\x73\x65\154\x65\x63\x74\75\x69\x64\54\x64\151\x73\160\x6c\x61\171\x4e\141\155\145";
$fF = $iU;
CG:
$dw = $this->handler->mo_sps_get_request($fF, $i9);
return $dw;
}
public function mo_sps_get_all_drives($xk)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto Xc;
}
return $this->access_token;
Xc:
$i9 = ["\101\165\x74\x68\x6f\x72\151\x7a\x61\164\151\157\156" => "\102\145\x61\162\x65\x72\40" . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\144\162\151\166\x65\163"], $xk), $i9);
return $dw;
}
public function mo_sps_get_all_personal_drives($CI)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto O5;
}
return $this->access_token;
O5:
$i9 = ["\x41\x75\164\x68\157\162\151\x7a\141\x74\151\157\156" => "\x42\145\x61\162\x65\162\x20" . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\160\145\x72\x73\157\156\141\154\137\144\162\x69\166\x65\163"], $CI), $i9);
return $dw;
}
public function mo_sps_get_all_docs($xc)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto v8;
}
return $this->access_token;
v8:
$i9 = ["\x41\x75\164\x68\x6f\162\151\172\141\164\151\x6f\x6e" => "\x42\x65\x61\x72\145\x72\40" . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\x64\157\143\x73"], $xc), $i9);
return $dw;
}
public function mo_sps_get_all_folder_items($xc, $K2)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto ku;
}
return $this->access_token;
ku:
$i9 = ["\101\165\x74\x68\157\x72\x69\x7a\141\164\x69\157\x6e" => "\x42\x65\141\x72\145\x72\x20" . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\146\x6f\154\144\145\162\137\x69\164\145\155\163"], $xc, $K2), $i9);
return $dw;
}
public function mo_sps_get_file_thumbnails($xc, $bH)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto PV;
}
return $this->access_token;
PV:
$i9 = ["\x41\165\x74\x68\157\162\x69\x7a\x61\x74\151\157\156" => "\102\145\x61\x72\145\162\40" . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\x66\151\154\145\137\x74\150\x75\x6d\x62\156\141\151\x6c\x73"], $xc, $bH), $i9);
return $dw;
}
public function mo_sps_get_file_details($xc, $bH)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto OD;
}
return $this->access_token;
OD:
$i9 = ["\101\165\x74\x68\x6f\162\151\x7a\x61\x74\151\x6f\156" => "\102\145\x61\162\x65\x72\40" . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\146\x69\x6c\145\x5f\151\164\145\155"], $xc, $bH), $i9, []);
return $dw;
}
public function mo_sps_get_file_preview($xc, $bH)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto uV;
}
return $this->access_token;
uV:
$i9 = ["\101\x75\x74\150\157\x72\x69\x7a\x61\x74\151\157\x6e" => "\102\x65\141\162\x65\162\x20" . $dT];
$dw = $this->handler->mo_sps_post_request(sprintf($this->endpoints["\146\x69\154\x65\137\160\x72\145\x76\x69\145\167"], $xc, $bH), $i9, []);
return $dw;
}
public function mo_sps_get_download_content($xc, $bH)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto OZ;
}
return $this->access_token;
OZ:
$i9 = ["\x41\x75\x74\x68\157\x72\x69\172\x61\x74\151\x6f\x6e" => "\102\145\141\x72\x65\162\x20" . $dT];
$dw = $this->handler->mo_sps_get_request_for_url(sprintf($this->endpoints["\144\x6f\167\156\154\157\141\144\137\x69\164\x65\x6d\163"], $xc, $bH), $i9);
return $dw;
}
public function mo_sps_search_through_drive_items($xc, $qg)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto tv;
}
return $this->access_token;
tv:
$i9 = ["\101\165\164\x68\x6f\162\151\x7a\x61\164\151\157\156" => "\x42\145\141\x72\x65\162\x20" . $dT];
$dw = $this->handler->mo_sps_get_request(sprintf($this->endpoints["\x73\x65\x61\x72\x63\x68\137\144\162\x69\x76\x65\151\x74\x65\155\x73"], $xc, $qg), $i9);
return $dw;
}
public function mo_sps_get_upload_session($xc, $K2, $Ya)
{
$dT = $this->mo_sps_get_new_access_token();
if ($dT) {
goto eW;
}
return $this->access_token;
eW:
$i9 = ["\x41\x75\x74\x68\x6f\x72\151\x7a\141\164\x69\157\x6e" => "\102\145\141\162\145\x72\40" . $dT, "\103\157\156\164\145\156\x74\x2d\x54\x79\160\145" => "\x61\160\x70\x6c\151\x63\141\164\x69\157\156\x2f\170\55\167\167\x77\x2d\x66\x6f\162\x6d\x2d\165\x72\x6c\145\x6e\x63\x6f\144\x65\144"];
$K2 = $K2 == '' ? "\162\x6f\x6f\164" : $K2;
$dw = $this->handler->mo_sps_post_request(sprintf($this->endpoints["\x75\x70\x6c\157\141\x64\137\x69\x74\145\x6d\x73"], $xc, $K2, $Ya), $i9, '');
return $dw;
}
}
Function Calls
None |
Stats
MD5 | 29c02bcc65771057c6104fb571ad3243 |
Eval Count | 0 |
Decode Time | 58 ms |