Setting a conditional for username in URL?
If you're looking for the current (logged in) user, you should use the global variable currentUser.

{% if currentUser %}
    {# currentUser returns a User Model if there is one, so do with it whatever you like #}
{% endif %}


However, if you want to find a user through a URL segment, you might want to get into using routes. If you use advanced routing, you can get what (I think) you want by adding following to your craft/config/routes.php:

return array(
    '(?P&lt;category&gt;[^/\]+)/(?P&lt;user&gt;[^/\]+)/' =&gt; 'path/to/template',
)


In your template, you can then use the variables {{ category }} and {{ user }}. Don't hang me on the RegExp-pattern, this is not tested but should get you further.