Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
641 views
in Q2A Core by
edited by

1) What does it mean flag=257?

Is it 1+256 (EMAIL_CONFIRMED + NO_WALL_POSTS)?

I am considering this http://www.question2answer.org/qa/16098/how-to-find-flag-qa_user_flags_user_blocked-from-user-flag?show=16102#a16102

2) It seems that the usual way (maybe the only way) to get the 256 flag is when the user ticks the checkbox "wall" in his/her account. Is there another way for this? This is really puzzling me, since I have a plugin to unset this check box and it is working (I am not able to see this check box in the account page). See by yourself (please)

class qa_html_theme_layer extends qa_html_theme_base {
    public function initialize() {
        if ($this->template === 'account') {
            unset($this->content['form_profile']['fields']['wall']);
        }
        parent::initialize();
    }
}

Just to be clear, I did this because I have another part of this plugin that overrides the function 

qa_wall_error_html and allows only users to post on their walls (and it is working). You can see this here: http://www.question2answer.org/qa/43652/there-way-hack-wall-permission-order-allow-user-post-her-wall

So I have no idea how some users arise with the 257 flag!?

 

 

 

 

Q2A version: 1.7.0

1 Answer

+1 vote
by
selected by
 
Best answer

1) Correct. In fact, there is no other way to get a 257 if it wasn't that way

2) This happens because this line will always receive a NULL value. In PHP, NULL value is negated it becomes true.

In order to avoid modifying the core so that it could now process the abscense of that value, it is better to send a default value as a hidden value, as you can do that from the plugin itself:

unset($this->content['form_profile']['fields']['wall']);
$this->content['form_profile']['hidden']['wall'] = 1;

Note that with or without these changes, any user could send a modified HTTP POST that would set that flag to 0. Of course, they should know enough about the HTTP protocol to do so, take the time to analyze the code in your page, know enough Q2A to know they can actually change that and, most important, they should take the time to do so. If you still want to tackle those unlikely cases, other approaches should be followed.

...