An action may be brought by any person whose property is injuriously affected, or whose personal enjoyment is lessened by a nuisance, as the same is defined in section thirty-four hundred and seventy-nine of the Civil Code, and by the judgment in such action the nuisance may be enjoined or abated as well as damages recovered therefor. A civil action may be brought in the name of the people of the State of California to abate a public nuisance, as the same is defined in section thirty-four hundred and eighty of the Civil Code, by the district attorney of any county in which such nuisance exists, or by the city attorney of any town or city in which such nuisance exists, and each of said officers shall have concurrent right to bring such action for a public nuisance existing within a town or city, and such district attorney, or city attorney, of any county or city in which such nuisance exists must bring such action whenever directed by the board of supervisors of such county or whenever directed by the legislative authority of such town or city.