Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  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. }