Whenever such action shall be brought against a person for usurping an office, the attorney general, district attorney or person complaining, in addition to the statement of the cause of action, shall also set forth in the complaint the name of the person rightfully entitled to the office with a statement of his right thereto, and in such cases, upon proof by affidavit that the defendant has received or is about to receive the fees and emoluments of the office by virtue of his usurpation thereof, the judge of the district court wherein such proceeding is pending, or a justice of the supreme court, if the proceeding be therein pending, may by order require the defendant to furnish a good and sufficient bond, within a designated time not exceeding fifteen days, executed and acknowledged as required by law in the case of supersedeas bonds on appeal, to be approved by said judge, conditioned that in case the person alleged to be entitled to the office should prevail, the defendant will repay to him all fees and emoluments of the office received by him and by means of his usurpation thereof, and in addition to said bond, or in case of a failure to give said bond, the said judge or justice shall upon good cause shown, issue a writ of injunction directed to the proper disbursing officer enjoining and restraining him from issuing to the defendant or his assigns any warrant, check, certificate or certificates of indebtedness representing fees or emoluments of said office, until the final adjudication of said cause.
NMS § 44-3-6