I assume status of 1 means on? 0 is off? I suggest the below.
ON:
Code:
( SELECT `status` FROM `#__vw_sessions` WHERE `user_id` = ue.`id` ) = 1
OFF:
Code:
( SELECT `status` FROM `#__vw_sessions` WHERE `user_id` = ue.`id` ) != 1
You don't want to use substitutions as you don't want the query changed based off the viewing user, but instead based off the user rows returned. This causes the user row which is ue. (their _comprofiler row) to be checked against.