WordPress.org

Ready to get started?Download WordPress

Forums

iMasters WP Files to Users
Permission access (14 posts)

  1. Aurélien Denis
    Member
    Posted 3 years ago #

    HI,

    I think your plugin is exactly what I need but when I try to configure it, I got this message :

    "You do not have permission to access this page."

    Could you help me ?

    Regards,
    Aurélien Denis
    http://wpchannel.com/

    http://wordpress.org/extend/plugins/imasters-wp-files-to-users/

  2. crowntastic
    Member
    Posted 3 years ago #

    I got the same error message too.

  3. jaytango
    Member
    Posted 3 years ago #

    Same here. Can't figure out what's wrong. Using WP 3.0

  4. jaytango
    Member
    Posted 3 years ago #

    I believe it has to do with this:
    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.

  5. Aurélien Denis
    Member
    Posted 3 years ago #

    Thanks jaytango ! It works for me too...

    But could you say how to really use this plugin ? I do not understand how users are able to download the files...

  6. jaytango
    Member
    Posted 3 years ago #

    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.

  7. sbdesign
    Member
    Posted 3 years ago #

    Hey Jaytango,
    I'm looking for the exact same thing as well.. were you able to modify the plugin? Got the admin portion working from your replacement code above.

  8. jaytango
    Member
    Posted 3 years ago #

    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.

  9. sbdesign
    Member
    Posted 3 years ago #

    Awesome! Would you be willing to send me the files/codes? I'd be able to put it together without a plugin, just don't have the codes to actually create the process.. Let me know :) I'd be forever greatful

  10. Aurélien Denis
    Member
    Posted 3 years ago #

    Awesome job ! I'll try this next time... but if you could make a plugin, be sure that I'll review it on WordPress Channel (http://wpchannel.com/). ;)

    Thanks !

  11. jaytango
    Member
    Posted 3 years ago #

    Here's the ugly hack guys.

    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.

  12. sbdesign
    Member
    Posted 3 years ago #

    OH god your awesome, but i got a file not found?

  13. sbdesign
    Member
    Posted 3 years ago #

    Any chance at getting that zip file?

  14. jaytango
    Member
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic