Please add a new variable, then construct the query using that variable.
```php
$can_ignore_allow_pm = ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'));
$sql_user_allow = $can_ignore_allow_pm ? ' OR user_allow_pm = 0' : '';
$sql = ...
```