|
![](http://www.flexcms.com/templates/innovation_fawn/spacer.gif) |
Due to the volume of spam happening on our forums, posting is now restricted to verified members only. If you're not verified, drop us a note with your username.
|
|
![](http://www.flexcms.com/templates/innovation_fawn/spacer.gif) Home > FlexCMS Support Forum > User Help > General Support Requests > Article permission level
![](http://www.flexcms.com/images/spacer.gif)
FlexCMS Support Forum
![](http://www.flexcms.com/templates/innovation_fawn/spacer.gif)
![](http://www.flexcms.com/images/spacer.gif)
Article permission level Started February 13, 2008 @ 12:45pm by David
![](http://www.flexcms.com/images/spacer.gif) |
Post Message |
|
|
Article permission level | February 13, 2008 @ 12:45pm | Hi,
I have a number of article teasers on one page that anybody can / should see, but want to limit the possibility to view the actual article to only registered users; and if they are not, they receive an error message "You do not have permission ...". Is there an easy way to set permission level to see article to > 0?
Thanks, David
|
|
|
|
Last Edit: February 13, 2008 @ 12:52pm by David | |
|
|
|
| |
DCSun Administrator
![](http://www.flexcms.com/images/user_avatars/2_avatar.png)
Posts: 625 |
|
|
| February 13, 2008 @ 5:11pm | David,
If you want all articles to behave the same, it's pretty straightforward:
inc-na-idx.php, line 36 should be "if ($Arguments2 == 'view') {". You could replace that with:![](http://www.flexcms.com/images/spacer.gif)
Code
if ($Arguments2 == 'view' && $UserLevel < 1) { RedirectToLogin(); } else if ($Arguments2 == 'view') { |
|
If you want to allow viewing of some articles but not others, it's going to get more complicated.
David
![](http://www.flexcms.com/images/spacer.gif)
![](http://www.flexcms.com/images/spacer.gif) FlexCMS v3.2 Has Been Released! |
|
|
|
|
|
|
| |
|
|
| February 14, 2008 @ 2:31am | This was perfect. Thanks. Only thing to keep in mind is that one might want to consider to modify the text on the login page so userrs understand whats going on.
Thanks again, David
|
|
|
|
|
|
|
| |
DCSun Administrator
![](http://www.flexcms.com/images/user_avatars/2_avatar.png)
Posts: 625 |
|
|
| February 14, 2008 @ 2:50pm | Yes, you have many options there. If you wanted to display a message instead of going straight to the login page you could use ![](http://www.flexcms.com/images/spacer.gif)
Code
print "your message here"; |
| in place of the "RedirectToLogin();" part.
David
![](http://www.flexcms.com/images/spacer.gif)
![](http://www.flexcms.com/images/spacer.gif) FlexCMS v3.2 Has Been Released! |
|
|
|
|
|
|
| |
|
|
articles permissions per article basis? | July 31, 2008 @ 12:25am | ![](http://www.flexcms.com/images/spacer.gif)
Quote (DCSun)
David,
If you want all articles to behave the same, it's pretty straightforward:
inc-na-idx.php, line 36 should be "if ($Arguments2 == 'view') {". You could replace that with:![](http://www.flexcms.com/images/spacer.gif)
Code
if ($Arguments2 == 'view' && $UserLevel < 1) { RedirectToLogin(); } else if ($Arguments2 == 'view') { |
|
If you want to allow viewing of some articles but not others, it's going to get more complicated.
David |
|
how much more complicated? i think I would like to be able to do this...is this already covered somewhere else?
best, heather |
|
|
|
|
|
|
| |
DCSun Administrator
![](http://www.flexcms.com/images/user_avatars/2_avatar.png)
Posts: 625 |
|
|
| July 31, 2008 @ 12:47am | Heather,
You could do it one of two ways - either with a new field in the database (na-Articles table), that identified the minimum permission level (the current user's level is stored in the $UserLevel variable - such as 1 for basic members, 100 for admins, etc) - or hard code the various article ID's into the inc-na-idx.php file.
David
![](http://www.flexcms.com/images/spacer.gif)
![](http://www.flexcms.com/images/spacer.gif) FlexCMS v3.2 Has Been Released! |
|
|
|
|
|
|
| |
|
|
articles with permission | July 31, 2008 @ 12:58pm | David~ The database option is doable to me as I am fairly comfortable with mySQLadmin. That said, I am sure that I can create a new field - but what to do after that? (yes, i am hogging your attention to teach me how to do things.)
any help is beyond appreciated. i am currently testing everything i can in the demo before getting the license and going live.
best, heather |
|
|
|
|
|
|
| |
DCSun Administrator
![](http://www.flexcms.com/images/user_avatars/2_avatar.png)
Posts: 625 |
|
|
| July 31, 2008 @ 11:23pm | Heather,
There's really three parts to it;
1 - Min permission level stored somewhere (ie added field in db table)
2 - Ability to edit permission setting (either manually through the db, or alongside the rest of the article in the edit form)
3 - Determine whether person viewing article meets the min level required (in inc-na-idx.php)
Pretty busy with a myriad of things at the moment, but I'm happy to put something together for you if/when I get some free time. Entirely possible something like that will make it into a future version of FlexCMS too.
David
![](http://www.flexcms.com/images/spacer.gif)
![](http://www.flexcms.com/images/spacer.gif) FlexCMS v3.2 Has Been Released! |
|
|
|
|
|
|
| |
|
|
articles by permission | August 1, 2008 @ 12:49am | aha! you rule. sounds like a good project for me to learn on...and then see how you would do it whenever you get to it.
again, million thanks
~h |
|
|
|
|
|
|
| |
|
|
Viewable Articles By Guests | December 7, 2008 @ 3:57pm | I've created articles that I was non-registered guests to be able to view. I put the code into a page that will list each article in my specified group. However, when the non-registered guest clicks on the article for it to open it automatically kicks the user to my home page. Is there something restricting them from opening the actual article? Please help! Thanks.
Rich |
|
|
|
|
|
|
| |
DCSun Administrator
![](http://www.flexcms.com/images/user_avatars/2_avatar.png)
Posts: 625 |
|
|
| December 7, 2008 @ 4:14pm | ![](http://www.flexcms.com/images/spacer.gif)
Quote (mrimen2004)
Is there something restricting them from opening the actual article? |
|
Maybe I'm missing something, but that's exactly what the code above was supposed to accomplish!
David
![](http://www.flexcms.com/images/spacer.gif)
![](http://www.flexcms.com/images/spacer.gif) FlexCMS v3.2 Has Been Released! |
|
|
|
|
|
|
| |
|
|
Article permission level | December 7, 2008 @ 4:23pm | David,
Thanks for your reply. I checked the file that you specified and see the following code:
"if ($Arguments2 == 'view') {"
I would assume that each article should be able to be viewed by all but somehow, it's kicking guests out of the article and back to my home page instead of opening the full article.
On my group of articles, I have about 10 snippets that the viewer should be able to see and should be able to click on each to view the full article. It does show the list of 10 snippets with the compressed code, however, when the user clicks on the title of each snippet, he's kicked out.
Rich |
|
|
|
|
|
|
| |
DCSun Administrator
![](http://www.flexcms.com/images/user_avatars/2_avatar.png)
Posts: 625 |
|
|
| December 7, 2008 @ 4:50pm | Yes, that code is doing as it's supposed to. You'll see the line below that is "RedirectToLogin();", which is the part kicking them back.
Essentially that code in descriptive terms is "if viewing an article (the Arguments2 == 'view' part) and user is less than basic member level (the UserLevel < 1 part), then redirect them to the login page; otherwise show them the article".
If you want guest to be able to view all your articles, lose the code above that you added. It does exactly the opposite of what you wanted (the person it was written for didn't want guests to view the full articles).
If you do want some articles restricted, but others visible, you'll have to give it some way to tell which is which. The easiest if those 10 or so articles will always be the same, would be something like:![](http://www.flexcms.com/images/spacer.gif)
Code
if ($Arguments2 == 'view' && $Arguments3 != 4 && $Arguments3 != 7 && $Arguments3 != 10 && $Arguments3 != 11 && $Arguments3 != 12) { RedirectToLogin(); } else {
} |
| (with the numbers there being the numbers of the articles guests are allowed to view in full -- others not listed there would still be redirected back)
David
![](http://www.flexcms.com/images/spacer.gif)
![](http://www.flexcms.com/images/spacer.gif) FlexCMS v3.2 Has Been Released! |
|
|
|
Last Edit: December 7, 2008 @ 4:52pm by DCSun | |
|
|
|
| |
|
|
| December 7, 2008 @ 7:14pm | ![](http://www.flexcms.com/images/spacer.gif)
Quote (DCSun)
You'll see the line below that is "RedirectToLogin();", which is the part kicking them back.
Essentially that code in descriptive terms is "if viewing an article (the Arguments2 == 'view' part) and user is less than basic member level (the UserLevel < 1 part), then redirect them to the login page; otherwise show them the article".
|
|
There is nothing in that program using $UserLevel. I list the specific sponsors I want by have the following code in a page I created:
{FlexCMS-Articles|2|0,100|2}
As I walked through inc-na-idx.php, I think I may be past the part you're describing to me. I actually see the individual articles being listed, however, when I click on the article being displayed that should direct me to the actual article page,
<a href="'.$MainURL.'/articles/'.$row100['RecordNumber'].'.html">
that is when it seems to fail and kick guests back to the home page.
Rich |
|
|
|
|
|
|
| |
DCSun Administrator
![](http://www.flexcms.com/images/user_avatars/2_avatar.png)
Posts: 625 |
|
|
| December 7, 2008 @ 9:06pm | Lets go back a step and clarify something before we go any further. Since you posted in reply to a piece of custom code I presumed you had added that code to your site, is that correct?
David
![](http://www.flexcms.com/images/spacer.gif)
![](http://www.flexcms.com/images/spacer.gif) FlexCMS v3.2 Has Been Released! |
|
|
|
|
|
|
| |
|
|
| December 7, 2008 @ 11:57pm | David,
My mistake then. I didn't mean to reply to the custom code that you specified to the other user writing in. I was asking my own question that I'm experiencing. I added nothing to any code. I'm just having troubles viewing articles when they're clicked so I thought this was the place to write my message. |
|
|
|
|
|
|
| |
DCSun Administrator
![](http://www.flexcms.com/images/user_avatars/2_avatar.png)
Posts: 625 |
|
|
| December 8, 2008 @ 12:13pm | Did you make any changes to any source files on the site? Perhaps any code added to blocks on the site? I'm not aware of any problems like that with FlexCMS.
David
![](http://www.flexcms.com/images/spacer.gif)
![](http://www.flexcms.com/images/spacer.gif) FlexCMS v3.2 Has Been Released! |
|
|
|
Last Edit: December 8, 2008 @ 12:14pm by DCSun | |
|
|
|
| |
|
|
| December 8, 2008 @ 10:01pm | No changes that I'm aware of. I'll check with one other person that has done some customizing on our site to find out.
Richard |
|
|
|
|
|
|
|
![](http://www.flexcms.com/images/spacer.gif)
![](http://www.flexcms.com/templates/innovation_fawn/spacer.gif)
|
|
![](http://www.flexcms.com/templates/innovation_fawn/spacer.gif) | MEMBERS ![](http://www.flexcms.com/templates/innovation_fawn/spacer.gif)
|
![](http://www.flexcms.com/templates/innovation_fawn/spacer.gif)
|
|