<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def login(self, year, firstname, lastname, passwd, with_year=True):
 """ Authenticate an user """

        firstname = firstname.upper()
        lastname = lastname.upper()

        if with_year and not self.set_year(year):
            return False

        url = URLS['login']
        params = {
            'prenom': firstname,
            'nom': lastname,
            'pwd': passwd,
        }

        soup = self.post_soup(url, data=params)

        return not soup.select('font[color=red]')