summaryrefslogtreecommitdiff
path: root/store.py
diff options
context:
space:
mode:
Diffstat (limited to 'store.py')
-rw-r--r--store.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/store.py b/store.py
index 7c1b684..385a624 100644
--- a/store.py
+++ b/store.py
@@ -1653,6 +1653,23 @@ class Store:
)
return otkv
+ def user_active(self, username):
+ """
+ Determines if the user is active (allowed to login)
+ """
+ cursor = self.get_cursor()
+ sql = "SELECT is_active FROM accounts_user WHERE username = %s"
+ safe_execute(cursor, sql, (username,))
+ return cursor.fetchone()[0]
+
+ def activate_user(self, username):
+ """
+ Activates the given user
+ """
+ cursor = self.get_cursor()
+ sql = "UPDATE accounts_user SET is_active = TRUE WHERE username = %s"
+ safe_execute(cursor, sql, (username,))
+
_User = FastResultRow('name password email gpg_keyid last_login!')
def get_user(self, name):
''' Retrieve info about the user from the database.