Issue #2062211 by rych, m1r1k, joelpittet, dstorozhuk: Remove calls to deprecated global $user in system module (first part).