loginname is not necessarily username

Fixes what was caused here https://github.com/owncloud/core/pull/6048/files#r7983142

@schiesbn @DeepDiver1975 @icewind1991