Ignore:
Timestamp:
3 Sep 2025, 07:38:18 (15 months ago)
Author:
Henrik Bettermann
Message:

Implement student password expiration feature.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/authentication.py

    r15606 r18166  
    2020"""
    2121import grok
    22 import time
     22from datetime import datetime
    2323from zope.component import getUtility
    2424from zope.password.interfaces import IPasswordManager
    … …  
    109109        passwordmanager = getUtility(IPasswordManager, 'SSHA')
    110110        self.context.password = passwordmanager.encodePassword(password)
     111        self.context.password_updated = datetime.utcnow()
    111112
    112113    def checkPassword(self, password):
    … …  
    114115        students, the temporary password was set by officers or
    115116        the parents_password was set by parents.
    116         We additionally check if student account has been suspended
    117         or if the portal is blocked.
     117        We additionally check if student account has been suspended,
     118        if the portal is blocked or the password has expired.
    118119        """
    119120        try:
    … …  
    137138        if self.context.suspended == True:
    138139            return False
     140        if self.context.password_expired:
     141            return False
    139142        return passwordmanager.checkPassword(self.context.password, password)
    140143
Note: See TracChangeset for help on using the changeset viewer.