only remember password if the user changes the permissions, otherwise the user disabled the password protection

Conflicts:
	lib/public/share.php
make sure that both $permissions and $oldPermissions have the same type
calculate correct permissions while toggle the password protection
initialize variable