If the underlined phrase is having been warned by her mother, then this is a nonessential perfect participial phrase.
Nonessential phrases are separated from the rest of the sentence by commas, and since this is a perfect participle, this is the only correct option.