Limited permissions problem I have a custom page for submitting downloads which use PAD files on my site. Using your suggestion in this thread http://www.esselbach.com/thread.php?id=517 , I've made it so only logged in users can submit downloads using that page. Problem is that I need those users to have limited privileges for the downloads section so I've given them "limited" privileges for the download section. I have 3 problems. These limited users (I have set up such a dummy limited user for me to test with) 1) can't edit the downloads they submit through that page, This is because the form on my custom file submit page doesn't insert author $_POST in the db table and I can't tell why. I've tried setting the value of the "author" field for my custom form to $insert[login_name] and it didn't work, the value stays empty and so does $author. 2) they can see commands and things they shouldn't see Overview Last 5 Downloads Clear Cache and 3) they can see other people's downloads even though they can only edit their own. If they can't edit them and they are not submitted by them, they shouldn't be visible. Please help. Edit: Also, after using this mod (downloads as news on the front page) here http://www.esselbach.com/thread.php?id=328 even if a file is set to "hold back=yes" it will still show up on the frontpage.
Limited permissions problem Please post your code. To remove overview, open cadmin/index.php and find: Code: MkTabHeader("$words[MN]"); MkTabOption("$words[OV]","CP_main"); MkTabFooter(); and replace with: Code: if ($admin[user_candownload] == 1) { MkTabHeader("$words[MN]"); MkTabOption("$words[OV]","CP_main"); MkTabFooter(); } For last 5 downloads find: Code: if ($admin[user_candownload]) { $result = DBQuery("SELECT download_website, download_title, download_id, download_hook FROM esselbach_st_downloads ORDER BY download_id DESC LIMIT 5"); and replace with: Code: if ($admin[user_candownload] == 1) { $result = DBQuery("SELECT download_website, download_title, download_id, download_hook FROM esselbach_st_downloads ORDER BY download_id DESC LIMIT 5"); For clear cache find: Code: } MkTabOption("$words[CN]","clearcache&opts=download"); and replace with: Code: MkTabOption("$words[CN]","clearcache&opts=download"); } Open cadmin/mod_downloads.php and find: Code: $result = DBQuery("SELECT download_website, download_title, download_id, download_hook FROM esselbach_st_downloads ORDER BY download_id DESC LIMIT 100"); while (list($download_website, $download_title, $download_id, $download_hook) = mysql_fetch_row($result)) { if ($download_hook) { $download_title = "<font color="red">$download_title</font>"; } TblMiddle2("$download_id / $download_website", "$download_title", "editdownload&opts=editdownload-$download_id", "editdownload&opts=deletedownload-$download_id"); } and replace with: Code: $result = DBQuery("SELECT download_website, download_author, download_title, download_id, download_hook FROM esselbach_st_downloads ORDER BY download_id DESC LIMIT 100"); while (list($download_website, $download_author, $download_title, $download_id, $download_hook) = mysql_fetch_row($result)) { if ($download_hook) { $download_title = "<font color="red">$download_title</font>"; } if ($download_author == $admin[user_name]) { TblMiddle2("$download_id / $download_website", "$download_title", "editdownload&opts=editdownload-$download_id", "editdownload&opts=deletedownload-$download_id"); } } Replace: Code: $result = DBQuery("SELECT * FROM esselbach_st_downloads WHERE (download_time LIKE '%$story_date_array[$a]%') ORDER BY download_time DESC"); with: Code: $result = DBQuery("SELECT * FROM esselbach_st_downloads WHERE (download_time LIKE '%$story_date_array[$a]%') AND download_hook = '0' ORDER BY download_time DESC");
Limited permissions problem Found it in the mail server log. It didn't pass the spam filter on the server by 0.3 points. Please try to re-send it from a different account.
Limited permissions problem I have another problem. Now only the limited user who created a download can delete it. The admin can't see it at all.
Limited permissions problem Replace: Code: if ($download_author == $admin[user_name]) { with: Code: if ($download_author == $admin[user_name]) or ($admin[user_candownload]) == 1) {
Limited permissions problem I suppose that goes in mod_downloads.php Did that, now none of the links under the downloads section work, the pages just stay blank.
Limited permissions problem Sorry, it should be: Code: if (($download_author == $admin[user_name]) or ($admin[user_candownload]) == 1)) {
Limited permissions problem Another attempt: Code: if (($download_author == $admin[user_name]) or ($admin[user_candownload] == 1)) { This one should work (hopefully)