# File lib/openshift-origin-controller/app/controllers/legacy_broker_controller.rb, line 9
  def user_info_post
    if @cloud_user
      user_info = @cloud_user.as_json
      #FIXME: This is redundant, for now keeping it for backward compatibility
      key_info = @cloud_user.get_ssh_key
      if key_info
        user_info["ssh_key"] = key_info['key']
        user_info["ssh_type"] = key_info['type']
      else
        user_info["ssh_key"] = ""
        user_info["ssh_type"] = ""
      end
        
      user_info["rhlogin"] = user_info["login"]
      user_info.delete("login") 
      # this is to support old version of client tools
      if @cloud_user.domains and @cloud_user.domains.length > 0
        user_info["namespace"] = @cloud_user.domains.first.namespace
      end
      user_info[:rhc_domain] = Rails.configuration.openshift[:domain_suffix]
      app_info = {}
      unless @cloud_user.applications.nil?
        @cloud_user.applications.each do |app|
          app_info[app.name] = {
            "framework" => app.framework,
            "creation_time" => app.creation_time,
            "uuid" => app.uuid,
            "aliases" => app.aliases,
            "embedded" => app.embedded
          }
        end
      end
      
      log_action(@request_id, @cloud_user.uuid, @login, "LEGACY_USER_INFO")
      @reply.data = {:user_info => user_info, :app_info => app_info}.to_json
      render :json => @reply
    else
      log_action(@request_id, "nil", @login, "LEGACY_USER_INFO", false, "User not found")
      # Return a 404 to denote the user doesn't exist
      @reply.resultIO << "User does not exist"
      @reply.exitcode = 99
      
      render :json => @reply, :status => :not_found
    end
  end