miniBB ®
 
miniBB Community Forum
 | Forums | File Bank | Sign Up | Reply | Search | Statistics | Manual |
Polls addon for miniBB Organize opinions on miniBB-forums, collecting them with the Polls & Surveys add-on!
The Other miniBB Community Forum / The Other /
Short link for this topic:

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

Author Thats Me
Forums Member
#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
Forums Member
#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
CEO
#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
Forums Member
#5 | Posted: 25 Jun 2006 19:03
Awesome, thanks for the help, guys. That did the trick.
Author myarbro
Forums Member
#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
CEO
#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
Forums Member
#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
CEO
#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! :)
The Other miniBB Community Forum / 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

» Username  » Password 
You are welcome to post anonymously by entering a nickname with no password (if that nickname has not been taken by another member) or by leaving both fields empty. If you have a forums membership 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 Community Forum Powered by Free Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts