diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb
index e3f62d736ef48b57cc217cff76b4fbd89aa25e80..3ef6d5977cf29d864115f43c0e918dff5d56168f 100644
--- a/app/workers/post_receive.rb
+++ b/app/workers/post_receive.rb
@@ -21,14 +21,18 @@ class PostReceive
       return false
     end
 
-    # Ignore push from non-gitlab users
-    user = if identifier.nil?
-             raise identifier.inspect
+    user = if identifier.blank?
+             # Local push from gitlab
              email = project.repository.commit(newrev).author.email rescue nil
              User.find_by_email(email) if email
-           elsif /^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier)
-             User.find_by_email(identifier)
-           elsif identifier =~ /key/
+
+           elsif identifier =~ /\Auser-\d+\Z/
+             # git push over http
+             user_id = identifier.gsub("user-", "")
+             User.find_by_id(user_id)
+
+           elsif identifier =~ /\Akey-\d+\Z/
+             # git push over ssh
              key_id = identifier.gsub("key-", "")
              Key.find_by_id(key_id).try(:user)
            end
diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb
index a2d15d5703445ec3ee2190071ef6daf429f9fcb9..8fcafe4ea9df442fd3c41bffa1f366af41839de9 100644
--- a/lib/gitlab/backend/grack_auth.rb
+++ b/lib/gitlab/backend/grack_auth.rb
@@ -7,9 +7,6 @@ module Grack
       @request = Rack::Request.new(env)
       @auth = Request.new(env)
 
-      # Pass Gitolite update hook
-      ENV['GL_BYPASS_UPDATE_HOOK'] = "true"
-
       # Need this patch due to the rails mount
       @env['PATH_INFO'] = @request.path
       @env['SCRIPT_NAME'] = ""
@@ -35,8 +32,8 @@ module Grack
         self.user = User.find_by_email(login) || User.find_by_username(login)
         return false unless user.try(:valid_password?, password)
 
-        # Set GL_USER env variable
-        ENV['GL_USER'] = user.email
+        # Set GL_ID env variable
+        ENV['GL_ID'] = "user-#{user.id}"
       end
 
       # Git upload and receive