miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
The Other miniBB Support Forums / The Other /   

" You are not allowed... " Alert Box when posting a message

Author Thats Me
Registered
#1 | Posted: 24 Jun 2006 18:13 
I searched the forums for an answer to this and found none.

Whenever any user, whether admin or member, clicks on the "Post topic" button after composing their post, an alert box pops up which just says "You are not allowed to perform this action". No other explanation or anything.

Any idea why this might happen? I searched through a few files for any reference and couldn't find any. Also, I'm not completely comfortable fiddling with these files, other than the obvious customization ones.

Thanks a lot for any help.

Author Thats Me
Registered
#2 | Posted: 24 Jun 2006 21:00 | Edited by: Thats Me 
Hmmm, this is strange. It wasn't working with the title: "Test Post"

But it does work when the title is: "This is a Test Post"

Is this related to a minimum title length variable? If so, where can I edit that? I mean the alert box really doesn't explain what the issue really is, no?

Author marsbar
Associated Member
#3 | Posted: 25 Jun 2006 01:57 
Thats Me wrote: Is this related to a minimum title length variable? If so, where can I edit that?

It probably is. setup_options.php is the file to edit; for more information, look up $post_text_minlength in the miniBB Manual.
All the best -
mb

Author Paul
Lead Developer
#4 | Posted: 25 Jun 2006 08:03 | Edited by: Paul 
In the new version, this will be replaced to "You are not allowed to perform this action" ($l_forbidden variable), or even some kind of special variable...

Yes, $post_text_minlength could be the reason of you're getting this error... also, some user can get such kind of warning, if they are not typing their username/password in registered-users-only forums, or leaving message area, or topic title, or both empty. We think these errors are some kind rare and do not need special processing (which will take actually a lot of code to program).

Author Thats Me
Registered
#5 | Posted: 25 Jun 2006 19:03 
Awesome, thanks for the help, guys. That did the trick.

Author myarbro
Registered
#6 | Posted: 28 May 2008 10:23 
When posting a new message, if the user forgets to enter a Title the system warning message simply says "You are not allowed to do this".

That give the user no indication of what corrective action is needed, and actually sounds more like a security or permissions error.

I'd suggest something friendly like "Please add a Title to your message".

Author Paul
Lead Developer
#7 | Posted: 28 May 2008 11:15 
We know such error often happens when testing the board. When you as admin are typing tons of test messages and really forget you should type the subject of the message. But in practice, this happens very rarely.

You should not rate all users as complete idiots. In most cases users will understand they are doing something wrong, and will find the reason of it.

For any case you can edit message form template and put some explanation text, that users should enter meaningful topic subject and message, else they would receive such error. Users themselves also should care about what they do and what they type. Why would you care about such dumb people which will never profit you anyway?

Implementing it like you see it, would take really a lot of job. First of all, to introduce new language variable and then someway bring it to .js file which actually means editing of major templates. Then to change the JS code itself, making it very big, because if we check a specific case and assign a special warning to it, it brings nothing than extra lines of code. A lot of code.

We just think we will skip carrying about idiots for a while and leave it in a compact form now as it is. It's not an important issue for us now to hold it up.

Anyway thanks for suggestion.

Author myarbro
Registered
#8 | Posted: 28 May 2008 11:52 | Edited by: myarbro 
Isn't it funny how seemingly insignificant tasks can require Herculean efforts, while apparently difficult tasks are sometimes trivial. Programming is a funny business.

Author Paul
Lead Developer
#9 | Posted: 2 Sep 2009 10:41 
Here is actually some pretty easy solution on how to introduce these errors about the filling the Subject and the Message (may be at some later time I will also include them in miniBB package). This solution is for the latest miniBB 2.4 (and up).

Under your language pack, add the following variables:

$l_enterSubject='Please enter Subject!';
$l_enterMessage='Please enter Message!';

Modify templates/main_post_form.html and before the code which says <!--BBJSBUTTONS-->, paste the following JavaScript:

<script type="text/javascript">
<!--
var enterSubject='{$l_enterSubject}';
var enterMessage='{$l_enterMessage}';
//-->
</script>

Modify templates/form.js, specifically, function submitForm. To the vars definition, add warn=l_accessDenied so it looks like:

var ftitle=false, ftext=false, flogin=false, fpass=false, user_usr='', user_pwd='', topicTitle='', postText='', fsubmit=true, warn=l_accessDenied;

Then modify the below code so it has new definitions and conditions:

if(fsubmit) {
pf.elements['subbut'].disabled=true; document.forms['postMsg'].submit();
}
else {
if(ftitle && topicTitle=='') warn=warn+'\n'+enterSubject;
if(ftext && postText=='') warn=warn+'\n'+enterMessage;
alert(warn);

return;
}

That would make the trick... In addition to "You are not allowed..." sentence, now you should see either Subject or Message warning, or both.

Hope this helps the newbies! :)

Author manas
Registered
#10 | Posted: 8 Sep 2010 04:34 | Edited by: manas 
Hello Paul, My forum is for register user means only registered user can post new messages and guest only can view. While guest user is trying to post there message pup up is showing that You are not allowed to perform this action. Can we show in pup up to the guest that You are not allowed to perform this action with Only registered users are allowed to post here. Please enter your login/password details upon posting a message?

Author Paul
Lead Developer
#11 | Posted: 8 Sep 2010 05:59 
We are considering to work out the two issues mentioned above in the upcoming new miniBB version, and I will try to take your suggestions into consideration too, thanks.

Author manas
Registered
#12 | Posted: 8 Sep 2010 06:41 
For the time being any suggestion how to display this message to user? Give me your idea and i will implement and let you know?

Author manas
Registered
#13 | Posted: 8 Sep 2010 12:08 
Ok. can you please let me know where exactly we are calling this functionality?

Author Paul
Lead Developer
#14 | Posted: 9 Sep 2010 06:54 | Edited by: Paul 
In templates/main_post_form.html, following the example above, add:

var enterLogin='Please enter your login/password details upon posting a message.';

In templates/form.js following the example above, you should add:

if(flogin && fpass && anonPost==0 && user_pwd=='') warn=warn+'\n'+enterLogin;


The Other miniBB Support Forums / The Other / " You are not allowed... " Alert Box when posting a message Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB