Contentteller

Contentteller Support Forums
Home Forums > Contentteller > Version 1.x >

Limited permissions problem

Discussion in 'Version 1.x' started by cosmin, Oct 26, 2007.

  1. cosmin Guest

    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,
    (Sorry. You can edit/remove only your own downloads)
    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.
    cosmin, Oct 26, 2007
    #1
  2. Philipp Guest

    Limited permissions problem

    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.
    Please post your code.

    2) they can see commands and things they shouldn't see
    Overview
    Last 5 Downloads
    Clear Cache
    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");
        }
    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.
    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");
                }
            }
    even if a file is set to "hold back=yes" it will still show up on the frontpage.
    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");
    Philipp, Oct 27, 2007
    #2
  3. cosmin Guest

    Limited permissions problem

    Philipp, did you get my email?
    cosmin, Oct 31, 2007
    #3
  4. Philipp Guest

    Limited permissions problem

    No. When did you send it?
    Philipp, Oct 31, 2007
    #4
  5. cosmin Guest

    Limited permissions problem

    This morning 9:20 your time.
    cosmin, Oct 31, 2007
    #5
  6. Philipp Guest

    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.
    Philipp, Oct 31, 2007
    #6
  7. cosmin Guest

    Limited permissions problem

    OK, I sent it again.
    cosmin, Oct 31, 2007
    #7
  8. Philipp Guest

    Limited permissions problem

    I will look into it tomorrow after I am in back in the office
    Philipp, Oct 31, 2007
    #8
  9. cosmin Guest

    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.
    cosmin, Nov 2, 2007
    #9
  10. Philipp Guest

    Limited permissions problem

    Replace:

    Code:
    if ($download_author == $admin[user_name]) 
    { 
    with:

    Code:
    if ($download_author == $admin[user_name]) or ($admin[user_candownload]) == 1)
    { 
    Philipp, Nov 3, 2007
    #10
  11. cosmin Guest

    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.
    cosmin, Nov 4, 2007
    #11
  12. Philipp Guest

    Limited permissions problem

    Sorry, it should be:

    Code:
    if (($download_author == $admin[user_name]) or ($admin[user_candownload]) == 1)) 
    {
    Philipp, Nov 4, 2007
    #12
  13. cosmin Guest

    Limited permissions problem

    Still nothing. It does the same thing.
    cosmin, Nov 4, 2007
    #13
  14. Philipp Guest

    Limited permissions problem

    Another attempt:

    Code:
    if (($download_author == $admin[user_name]) or ($admin[user_candownload] == 1)) 
    {
    This one should work (hopefully)
    Philipp, Nov 4, 2007
    #14
  15. cosmin Guest

    Limited permissions problem

    Yes it does, there was an extra round bracket it seems.
    cosmin, Nov 5, 2007
    #15
Tweet
Facebook:
Forgot your password?
Contentteller Support Forums
Home Forums > Contentteller > Version 1.x >
  • Home
  • Forums

    Forums

    Quick Links
    • Search Forums
    • What's New?
  • Members

    Members

    Quick Links
    • Registered Members
    • Current Visitors
    • Recent Activity
  • Help

    Help

    Quick Links
    • Smilies
    • BB Codes
    • Trophies

Separate names with a comma.

Advanced search...
    Forum software by XenForo™ ©2011 XenForo Ltd.