Change use of dirname() in register_user.php

Current use of dirname() in register_user.php does not allow it to be
copied and used in user plugin folder. Removed dirname() and used path
and folder constants instead.