Title: jaytango's Replies | WordPress.org

---

# jaytango

  [  ](https://wordpress.org/support/users/jaytango/)

 *   [Profile](https://wordpress.org/support/users/jaytango/)
 *   [Topics Started](https://wordpress.org/support/users/jaytango/topics/)
 *   [Replies Created](https://wordpress.org/support/users/jaytango/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/jaytango/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/jaytango/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/jaytango/engagements/)
 *   [Favorites](https://wordpress.org/support/users/jaytango/favorites/)

 Search replies:

## Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)

 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [REST request works with PAW but not from a browser call](https://wordpress.org/support/topic/rest-request-works-with-paw-but-not-from-a-browser-call/)
 *  Thread Starter [jaytango](https://wordpress.org/support/users/jaytango/)
 * (@jaytango)
 * [9 years ago](https://wordpress.org/support/topic/rest-request-works-with-paw-but-not-from-a-browser-call/#post-9054960)
 * Thanks [@bcworkz](https://wordpress.org/support/users/bcworkz/)!!! It was the
   missing nonce. I added the beforeSend: param with the proper nonce and it worked.
   I didn’t need the Authorization: header anymore.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [REST request works with PAW but not from a browser call](https://wordpress.org/support/topic/rest-request-works-with-paw-but-not-from-a-browser-call/)
 *  Thread Starter [jaytango](https://wordpress.org/support/users/jaytango/)
 * (@jaytango)
 * [9 years ago](https://wordpress.org/support/topic/rest-request-works-with-paw-but-not-from-a-browser-call/#post-9053723)
 * I checked out the $currentuser value from inside current_user_can():
 * When run through PAW:
    WP_User Object ( [data] => stdClass Object ( [ID] => 1[
   user_login] => admin [user_pass] => _-redacted-_ [user_nicename] => admin [user_email]
   => [info@atgconnect.com](https://wordpress.org/support/users/jaytango/replies/info@atgconnect.com?output_format=md)[
   user_url] => [user_registered] => 2017-03-08 20:15:48 [user_activation_key] =
   > [user_status] => 0 [display_name] => admin ) [ID] => 1 [caps] => Array ( [administrator]
   => 1 ) ………….
 * And when run through the browser call:
    WP_User Object ( [data] => stdClass Object()[
   ID] => 0 [caps] => Array ( ) [cap_key] => [roles] => Array ( ) [allcaps] => Array()[
   filter] => )
 * So it looks like somehow, the user is not being properly set through the browser
   call.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[iMasters WP Files to Users] [Plugin: iMasters WP Files to Users] Permission access](https://wordpress.org/support/topic/plugin-imasters-wp-files-to-users-permission-access/)
 *  [jaytango](https://wordpress.org/support/users/jaytango/)
 * (@jaytango)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-imasters-wp-files-to-users-permission-access/#post-1682903)
 * Sorry about the broken link above guys. I forgot to convert the spaces to underscores.
   Go ahead and try it again. It should work now.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[iMasters WP Files to Users] [Plugin: iMasters WP Files to Users] Permission access](https://wordpress.org/support/topic/plugin-imasters-wp-files-to-users-permission-access/)
 *  [jaytango](https://wordpress.org/support/users/jaytango/)
 * (@jaytango)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-imasters-wp-files-to-users-permission-access/#post-1682889)
 * Here’s the ugly hack guys.
 * [http://www.wazuru.com/iMasters_WP_Files_to_Users_hack.zip](http://www.wazuru.com/iMasters_WP_Files_to_Users_hack.zip)
 * Let me know if you need any help. In the meantime, I’ll keep working on writing
   it into one single plugin.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[iMasters WP Files to Users] [Plugin: iMasters WP Files to Users] Permission access](https://wordpress.org/support/topic/plugin-imasters-wp-files-to-users-permission-access/)
 *  [jaytango](https://wordpress.org/support/users/jaytango/)
 * (@jaytango)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-imasters-wp-files-to-users-permission-access/#post-1682885)
 * Here’s what I ended up doing… Once I had the admin portion working:
 * 1)I created a custom function getMyFiles() which checks the logged in user’s 
   ID against the plugin’s table in the database to see if their are any files there
   for him. It displays the results as a simple Filename | Filesize | Date Uploaded
   table. I placed this function in my theme folder’s functions.php file.
 * 2) Created a page template which calls that function right after it calls the_content();
 * 3) Next, created a page called My Files. I assigned the aforementioned page template
   to this file in the “Page Attributes” drop-down on the right of the Edit Page.
 * 4)Finally, created a file “download.php” and placed it in my theme’s folder. 
   This file basically gets a file ID as a $_GET variable from the My Files page
   and references the DB to retrieve the corresponding filename. Then using headers,
   it prompts the user to dowloand the file instead of just opening the file in 
   the browser. This is the ugliest part of the process because it runs completely
   out of the wordpress scope. It opens it’s own mysql_connect and mysql_select_db
   by referencing the wp-config.php
 * So basically, when the user logs in and then clicks on the link to the page “
   My Files”, the page loads using the custom template php file which in turn calls
   the getMyFile() function which makes a list of files. Finally, when the user 
   clicks on one of the files, it sends the file ID value to download.php which 
   gets the filename from the DB and prompts the user to download it.
 * I’m trying to learn how to incorporate all of this into one plugin. If I succeed
   I’ll let you guys know.
 *   Forum: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
   
   In reply to: [Can't log in to Plugin developer center](https://wordpress.org/support/topic/cant-log-in-to-plugin-developer-center/)
 *  [jaytango](https://wordpress.org/support/users/jaytango/)
 * (@jaytango)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/cant-log-in-to-plugin-developer-center/#post-1686937)
 * Yep… waiting overnight fixed it for me.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[iMasters WP Files to Users] [Plugin: iMasters WP Files to Users] Permission access](https://wordpress.org/support/topic/plugin-imasters-wp-files-to-users-permission-access/)
 *  [jaytango](https://wordpress.org/support/users/jaytango/)
 * (@jaytango)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-imasters-wp-files-to-users-permission-access/#post-1682862)
 * LOL, I too have been scratching my head about this. It seems that only admins
   can use the tool, and only in the backend at that. So, until I find a better 
   plugin, I’m gonna just write a function to plug into a front-end page template
   that basically displays the logged-in user’s files. So basically the process 
   would be:
 * -Admin uploads file and assigns them to users via the backend.
 * -Users who log into the front end have access to a page “My Files” or whatever
   you want to call it.
 * -In that page’s template there will be a function that queries the plugin’s database
   and displays any files that that particular user has access too.
 * I know, a lot of customizing, but until now, aside from coding something from
   scratch, this is the closest I’ve gotten to having a admin-to-user file sharing
   utility. Oh well. Hopefully something better will show up. Hey, if you find a
   better tool before i do, let me know. Merci.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[iMasters WP Files to Users] [Plugin: iMasters WP Files to Users] Permission access](https://wordpress.org/support/topic/plugin-imasters-wp-files-to-users-permission-access/)
 *  [jaytango](https://wordpress.org/support/users/jaytango/)
 * (@jaytango)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-imasters-wp-files-to-users-permission-access/#post-1682859)
 * I believe it has to do with this:
    [http://ilikewordpress.com/357/you-do-not-have-sufficient-permissions-to-access-this-page/](http://ilikewordpress.com/357/you-do-not-have-sufficient-permissions-to-access-this-page/)
 * In the meantime, I plugged in this dirty bit of code to get me around until I
   figure out the proper fix. In the main file ‘imasters-wp-files-to-users.php’ 
   change line 66….
 * from:
    if ( function_exists(‘add_menu_page’) ):
 * to:
    if ( function_exists(‘add_menu_page’) && $_GET[‘page’]!=’imasters-wp-files-
   to-users/imasters-wp-files-to-users-manager.php’):
 * This basically forces the dashboard to only show the main menu button ON the 
   main view and not when viewing the manager.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[iMasters WP Files to Users] [Plugin: iMasters WP Files to Users] Permission access](https://wordpress.org/support/topic/plugin-imasters-wp-files-to-users-permission-access/)
 *  [jaytango](https://wordpress.org/support/users/jaytango/)
 * (@jaytango)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-imasters-wp-files-to-users-permission-access/#post-1682858)
 * Same here. Can’t figure out what’s wrong. Using WP 3.0

Viewing 9 replies - 1 through 9 (of 9 total)