Update locallib.php

Fix flaw in POST (now check if 'REMOTE_ADDR' and 'HTTP_USER_AGENT' is defined)