only remember password if the user changes the permissions, otherwise the user disabled the password protection
make sure that both $permissions and $oldPermissions have the same type
calculate correct permissions while toggle the password protection
initialize variable
Merge pull request #4896 from owncloud/sharing_allow_disable_password

sharing, allow user to disable password protection