Shorter sentence:
Er erfährt, wen man ihm abgewiesen hat.
He learns who he has been refused.
Without "ihm":
Er erfährt, wen man abgewiesen hat.
He learns who has been refused.
The part after the comma as a question:
Wen hat man abgewiesen?
Who has been refused?
This part as a statement:
Man hat jemanden abgewiesen.
Someone has refused someone.
The word »man« is the first »someone«, the word »jemand« is the second.
So, the word »man« names the person that decided to reject. This person is not closer determined, and the English word »someone« does exactly the same.
I think, what you confuses even more, is the word »ihm« (English: him) which is the dative form of the personal pronoun »er« (Englisch: he). This word exists in the sentence as a free dative. This means, it is not a mandatory object of the verb and it is also not the inner part of a prepositional phrase. This free dative is also called »dativus incommodi« and it indicates the party, that suffers from the action. The thing or person, that is named in a dativus incommodi is neither the cause of the action (this is here »man« or »somebody«), nor is it the thing or person that is the direct victim of the action (this is the rejected person). It is a third party or thing that indirectly bears the consequences.
Here is an example:
Barbara is the boss of a company. Martin is her human resources manager, and Simon has applied for a job in Barbara's company. Barbara knows Simon very well, and knows that he would be ideally suited for the open position. But she knows nothing about Simon's application, and Martin knows nothing about Simon's particular suitability. For some reason, Martin decides to reject Simon. But from Barbara's point of view, Simon would still have been the best choice for the vacant position. So Barbara also suffers from the fact that Martin rejected Simon.
Barbara wird sich sehr ärgern, wenn sie erfährt, wen Martin ihr da abgewiesen hat.
Barbara will be very upset when she finds out who Martin turned her away from.
Barbara wird sich sehr ärgern, wenn sie erfährt, wen man ihr da abgewiesen hat.
Barbara will be very upset when she finds out who someone turned her away from.