Add sort_name to pluser.
Allow parenthesis before hasPerm in smarty templates

In smarty templates, this syntax works fine:

    {if !hasPerm('directory_private') && other_test() }

... but not this one:

    {if (!hasPerm('directory_private') || test1()) && test2()}

... because the regexp which handle hasPerm "function" in smarty does
not support parenthesis.

Fix this bug by explicitly allowing space and open parenthesis before
hasPerm().