Wasn't "Require registered users?" checkbox supposed to interdict anonymous users to ask questions?

With this field checked or not, anonymous users still can ask question.

It is supposed to work this way? Because I don't want to permit anonymous users to ask question and I wonder if I've misunderstood something.

Comments

preferred name’s picture

Status: Active » Reviewed & tested by the community

replace the function theme_question_qform() {} block with...

 function theme_question_qform() {
   global $user;
   if ($user->uid > 0 || !variable_get('question_require_registered', FALSE)) {
//     $output = drupal_get_form('question_qform');
   }
   else {
//   // if we are requiring registered users, but user is not logged in
     $output .= t('<br></br>Please login to submit questions.');
   return $output;
   }   
 }

the link in the $output was removed to make it XHTML 1.0 Strict

codepoet’s picture

Assigned: mishhh » codepoet

I actually just rewrote that function entirely. Works like a charm now. I'll commit it shortly.

function theme_question_qform() {
   global $user;
   // if we are requiring registered users, but user is not logged in
   if (!$user->uid && variable_get('question_require_registered', TRUE)) {
     $output .= t('<p />Please <a href="!login">login or register</a> to submit questions.', array("!login" => url('user/login', drupal_get_destination())));
     return $output;
   }  
}
codepoet’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)