Advertisement
Guest User

Untitled

a guest
Aug 30th, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 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. function _error()
  15. {
  16. return sm_error(_('The request could not be completed due to unexpected error. Please contact support.'));
  17. }
  18.  
  19. function start_session($uid, $type, $global, $user_email, $external_auth = NULL, $user_name = '')
  20. {
  21. $_SESSION['uid'] = $uid;
  22. $_SESSION['usertype'] = $type;
  23. $_SESSION['userglobal'] = $global;
  24. $_SESSION['useremail'] = $user_email;
  25. $_SESSION['user_name'] = $user_name;
  26.  
  27. if (isset($external_auth)) {
  28. $_SESSION['externalauth'] = $external_auth;
  29. }
  30.  
  31. $_SESSION['SERVER_NAME'] = SM_HTTP_URL;
  32. $_SESSION['PHP_SELF'] = $_SERVER['PHP_SELF'];
  33. $_SESSION['checkhost'] = md5(@$_SERVER['HTTP_USER_AGENT']);
  34.  
  35. if ($type != 'PW_EXT') {
  36. $_SERVER['REQUEST_URI'] = preg_replace('/smlang=[^&]+/', '', $_SERVER['REQUEST_URI']);
  37. sm_set_lang();
  38. SM_Action_Log::login();
  39. }
  40. if (!defined('SM_HTTPS_FORCE') || !SM_HTTPS_FORCE || (SM_HTTPS_FORCE == 2)) {
  41. sm_redirect('nonssl');
  42. }
  43. else {
  44. header('Location: /' . sm_parse_login_querystring(false));
  45. exit();
  46. }
  47. }
  48.  
  49. function check_user_privileges($appname, $uid, $type)
  50. {
  51. $privileges = [];
  52. $has_all_privileges = false;
  53. $q = sm_privileges('pbxware', 'tag, value', $uid, $type);
  54.  
  55. if ($q !== true) {
  56. $q .= ' AND p.tag LIKE \'%server_%\'';
  57. }
  58.  
  59. $privileges = sm_privileges_fetch($q);
  60.  
  61. if (!isset($privileges['server_all_enabled'])) {
  62. $q = 'SELECT id, hostname FROM pbxware_servers ';
  63. $servers = dbexec($q);
  64.  
  65. while ($row = mysql_fetch_assoc($servers)) {
  66. if (isset($privileges['server_' . $row['hostname']])) {
  67. $has_all_privileges = true;
  68. break;
  69. }
  70. }
  71. }
  72. else {
  73. $has_all_privileges = true;
  74. }
  75.  
  76. return $has_all_privileges;
  77. }
  78.  
  79. session_name('SMSESSID');
  80. require_once 'lib/headers.php';
  81. require_once 'lib/standard.php';
  82. require_once 'lib/database.php';
  83. include_once 'lib/ip_check.php';
  84. ..............................................................
  85. ................................
  86. ..............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement