Comment 15 for bug 286529

Revision history for this message
Even Nedberg (nedberg) wrote : Re: Should not be able to restrict first user

In /usr/share/python-support/timekpr/timekpr-gui.py find

def isnormal(username):

change

if userid == uidmin:
        return False
    elif uidmin < userid <= uidmax:
        return True

into

if userid == <your admin userid>:
        return False
    elif uidmin <= userid <= uidmax:
        return True

It should work after this. We will try to fix this in a later release!

If you apply this "fix" it will be overwritten if you update timekpr.

Savvas, would it be possible to get the username of the user running timekpr-gui? Then make it impossible to restrict oneself?
What about sorting the list of users in reverse order. That way the pre-selected user would not be the first user created (who, most probably, is an administrator).
Make a list of users NOT to be restricted and check against this when populating the drop down? The list could be created when a user first starts timekpr-gui.

I am just making suggestions here. But I think we need to get this sorted out...