Moved this out of admin.inc as it has nothing to do with admin pages.