Guest User

Untitled

a guest
Oct 5th, 2020
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. error_reporting(32757);
  15. include_once 'async.php';
  16. include_once 'function.php';
  17. include_once 'datastore.php';
  18. include_once 'provision.php';
  19. include_once 'wbxml.php';
  20. define('catASync', 12);
  21. init_global_account();
  22. global $_ACCOUNT;
  23. init_global_api();
  24. global $_API;
  25. $_GET['LogLevel'] = $_API->GetProperty('C_System_Log_Services_ActiveSync');
  26.  
  27. if (!$_API->GetProperty('C_ActiveSync_Active')) {
  28. do_log('!!! Forbidden !!! (EAS is disabled)', 2, true);
  29. header('HTTP/1.1 403 Forbidden');
  30. exit();
  31. }
  32.  
  33. if (!isset($_SERVER['PHP_AUTH_USER'])) {
  34. do_log('!!! Unauthorized !!! (User identification cannot found)', 2, true);
  35. header('HTTP/1.1 401 Unauthorized');
  36. header('WWW-Authenticate: Basic realm="ASync"');
  37. exit();
  38. }
  39.  
  40. icewarp_getlock('EAS_PHP', 1);
  41.  
  42. if (icewarp_getlock('EAS_MIGRATION', 0)) {
  43. icewarp_releaselock('EAS_MIGRATION');
  44. icewarp_releaselock('EAS_PHP');
  45. }
  46. else {
  47. icewarp_releaselock('EAS_PHP');
  48. do_log('!!! Service unavailable !!! (DB migration)', 2, true);
  49. header('HTTP/1.1 503 Service Unavailable');
  50. exit();
  51. }
  52.  
  53. $username = $_SERVER['PHP_AUTH_USER'];
  54. $pos = strpos($username, chr(92));
  55.  
  56. if ($pos !== false) {
  57. $username = substr($username, $pos + 1);
  58. if (!strpos($username, '@') && $pos) {
  59. $username .= '@' . substr($_SERVER['PHP_AUTH_USER'], 0, $pos);
  60. }
  61. }
  62.  
  63. $_GET['PolicyKey'] = $_SERVER['HTTP_X_MS_POLICYKEY'];
  64. if (strlen($_SERVER['QUERY_STRING']) && !strlen($_GET['DeviceId']) && !strlen($_GET['DeviceType'])) {
  65. $commands = ['Sync', 'SendMail', 'SmartForward', 'SmartReply', 'GetAttachment', 'GetHierarchy', 'CreateCollection', 'DeleteCollection', 'MoveCollection', 'FolderSync', 'FolderCreate', 'FolderDelete', 'FolderUpdate', 'MoveItems', 'GetItemEstimate', 'MeetingResponse', 'Search', 'Settings', 'Ping', 'ItemOperations', 'Provision', 'ResolveRecipients', 'ValidateCert'];
  66. $parameters = ['AttachmentName', 'CollectionId', 'CollectionName', 'ItemId', 'LongId', 'ParentId', 'Occurence', 'Options', 'RoundTripId'];
  67. $query = base64_decode($_SERVER['QUERY_STRING']);
  68. $_SERVER['HTTP_MS_ASPROTOCOLVERSION'] = ord($query[0]) / 10;
  69. $_GET['Cmd'] = $commands[ord($query[1])];
  70. $len = ord($query[4]);
  71. $_GET['DeviceId'] = bin2hex(substr($query, 5, $len));
  72. ................................................................
  73. ...........................................
  74. ................
Add Comment
Please, Sign In to add comment