[Plugin: iMasters WP Files to Users] Permission access
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 ?
I believe it has to do with this:
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….
if ( function_exists(‘add_menu_page’) ):
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.
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…
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.
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.
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.
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
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/). 😉
Here’s the ugly hack guys.
Let me know if you need any help. In the meantime, I’ll keep working on writing it into one single plugin.
- The topic ‘[Plugin: iMasters WP Files to Users] Permission access’ is closed to new replies.