Jump to content

Recommended Posts

Posted

@Marc This is about the auto-complete field when you're creating a new PM.

 

The member search when you type a name loads banned accounts:

Sio5ITJ.gif

 

The member you see above is permanently banned. The problem is the code in applications/core/modules/front/system/ajax.php that doesn't skip banned members when loading the results:

	/**
	 * Find Member
	 *
	 * @return	void
	 */
	public function findMember()
	{
		$results = array();
		
		$input = str_replace( array( '%', '_' ), array( '\%', '\_' ), mb_strtolower( \IPS\Request::i()->input ) );
		
		$where = array( "name LIKE CONCAT(?, '%')" );
		$binds = array( $input );
		if ( \IPS\Dispatcher::i()->controllerLocation === 'admin' OR ( \IPS\Member::loggedIn()->modPermission('can_see_emails') AND \IPS\Request::i()->type == 'mod' ) )
		{
			$where[] = "email LIKE CONCAT(?, '%')";
			$binds[] = $input;
		}

		if ( \IPS\Dispatcher::i()->controllerLocation === 'admin' )
		{
			if ( \is_numeric( \IPS\Request::i()->input ) )
			{
				$where[] = "member_id=?";
				$binds[] = \intval( \IPS\Request::i()->input );
			}
		}
			
		/* Build the array item for this member after constructing a record */
		/* The value should be just the name so that it's inserted into the input properly, but for display, we wrap it in the group *fix */
		foreach ( \IPS\Db::i()->select( '*', 'core_members', array_merge( array( implode( ' OR ', $where ) ), $binds ), 'LENGTH(name) ASC', array( 0, 20 ) ) as $row )
		{

 

The code should be updated to skip banned members unless you're an admin/moderator maybe? Admins could still need banned members to show up when doing something in ACP, etc.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...