Advertisement
wiredrat

ngg validate cookie fail

Jun 27th, 2013
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. if (wp_validate_auth_cookie()) {
  2.         $results = wp_parse_auth_cookie();
  3.         $logged_in = FALSE;
  4.         if (isset($results['username']) && isset($results['expiration'])) {
  5.                 if (time() < floatval($results['expiration'])) {
  6.                         if (($userdata = get_user_by('login', $results['username'])))
  7.                                 $logged_in = $userdata->ID;
  8.                 }
  9.         }
  10.  
  11.         if (!$logged_in) die("Login failure. -1");
  12.         else if (!user_can($logged_in, 'NextGEN Upload images')) {
  13.                 die('You do not have permission to upload files. -2');
  14.         }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement