mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
Userlist filtering fix.
This commit is contained in:
parent
010ba14c73
commit
5f005b50b2
@ -1067,7 +1067,9 @@ class e_form
|
||||
* @param array $options
|
||||
* @param string $options['group'] if == 'class' then users will be sorted into userclass groups.
|
||||
* @param string $options['fields']
|
||||
* @param string $options['classes']
|
||||
* @param string $options['classes'] - single or comma-separated list of user-classes members to include.
|
||||
* @param string $options['excludeSelf'] = exlude logged in user from list.
|
||||
* @param string $options['return'] if == 'array' an array is returned.
|
||||
* @return string select form element.
|
||||
*/
|
||||
public function userlist($name, $val=null, $options=array())
|
||||
@ -1133,9 +1135,16 @@ class e_form
|
||||
foreach($users as $u)
|
||||
{
|
||||
$uclass = explode(',',$u['user_class']);
|
||||
if(($classList == e_UC_ADMIN) || ($classList = e_UC_MEMBER) || in_array($cls,$uclass))
|
||||
|
||||
if(($classList == e_UC_ADMIN) || ($classList == e_UC_MEMBER) || in_array($cls,$uclass))
|
||||
{
|
||||
$id = $u['user_id'];
|
||||
|
||||
if(!empty($options['excludeSelf']) && ($id == USERID))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$opt[$cname][$id] = $u['user_name'];
|
||||
}
|
||||
}
|
||||
@ -1154,6 +1163,15 @@ class e_form
|
||||
|
||||
}
|
||||
|
||||
|
||||
ksort($opt);
|
||||
|
||||
|
||||
if(!empty($options['return']) && $options['return'] == 'array') // can be used by user.php ajax method..
|
||||
{
|
||||
return $opt;
|
||||
}
|
||||
|
||||
return $this->select($name,$opt,$val,$options, varset($options['default'],null));
|
||||
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
|
||||
else
|
||||
{
|
||||
$frm = e107::getForm();
|
||||
$ret = $frm->userlist('pm_to',null,array('default'=>'blank', 'classes'=>varset($this->pmPrefs['send_to_class'], e_UC_MEMBER)));
|
||||
$ret = $frm->userlist('pm_to',null,array('excludeSelf'=>true, 'default'=>'blank', 'classes'=>varset($this->pmPrefs['send_to_class'], e_UC_MEMBER)));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user