Advertisement
Guest User

Untitled

a guest
Jun 8th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.3
  8. * @ Author : DeZender
  9. * @ Release on : 06.05.2013
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. define("IPBWI_ROOT_COOKIE", "/");
  15. if (!(function_exists("wp_set_auth_cookie"))) {
  16. function wp_set_auth_cookie($user_id, $remember = false, $secure = "") {
  17. define("IPBWI_ROOT_COOKIE", "/");
  18. $domain = $GLOBALS["ipbwi"]->getBoardVar("cookie_domain");
  19. if ($remember) {
  20. $expiration = $expire = time() + 1209600;
  21. }
  22. else {
  23. $expiration = time() + 172800;
  24. $expire = 0;
  25. }
  26. if ("" === $secure) {
  27. $secure = is_ssl() ? true : false;
  28. }
  29. if ($secure) {
  30. $auth_cookie_name = SECURE_AUTH_COOKIE;
  31. $scheme = "secure_auth";
  32. }
  33. else {
  34. $auth_cookie_name = AUTH_COOKIE;
  35. $scheme = "auth";
  36. }
  37. $auth_cookie = wp_generate_auth_cookie($user_id, $expiration, $scheme);
  38. $logged_in_cookie = wp_generate_auth_cookie($user_id, $expiration, "logged_in");
  39. do_action("set_auth_cookie", $auth_cookie, $expire, $expiration, $user_id, $scheme);
  40. do_action("set_logged_in_cookie", $logged_in_cookie, $expire, $expiration, $user_id, "logged_in");
  41. if (version_compare(phpversion(), "5.2.0", "ge")) {
  42. setcookie($auth_cookie_name, $auth_cookie, $expire, IPBWI_ROOT_COOKIE, $domain, $secure);
  43. setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, IPBWI_ROOT_COOKIE, $domain);
  44. if (COOKIEPATH != SITECOOKIEPATH) {
  45. setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, IPBWI_ROOT_COOKIE, $domain, false, true);
  46. return null;
  47. }
  48. }
  49. $cookie_domain = $domain;
  50. if (!(empty($cookie_domain))) {
  51. $cookie_domain .= "; HttpOnly";
  52. ...................................................................
  53. ..................................
  54. .................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement