Prepared some of the authmode stuff for the imminent addition
[citadel.git] / citadel / modules / expire / serv_expire.c
index 4ba4de53e2cc66c2bad0d0a68186f00110e00d22..eaff4280b9831e6ebcb1da5efc345e70180a0bc0 100644 (file)
@@ -460,15 +460,18 @@ int PurgeUsers(void) {
        lprintf(CTDL_DEBUG, "PurgeUsers() called\n");
        users_not_purged = 0;
 
-       if (config.c_auth_mode == 1) {
-               /* host auth mode */
-               ForEachUser(do_uid_user_purge, NULL);
-       }
-       else {
-               /* native auth mode */
-               if (config.c_userpurge > 0) {
-                       ForEachUser(do_user_purge, NULL);
-               }
+       switch(config.c_auth_mode) {
+               case AUTHMODE_NATIVE:
+                       if (config.c_userpurge > 0) {
+                               ForEachUser(do_user_purge, NULL);
+                       }
+                       break;
+               case AUTHMODE_HOST:
+                       ForEachUser(do_uid_user_purge, NULL);
+                       break;
+               default:
+                       lprintf(CTDL_DEBUG, "Unknown authentication mode!\n");
+                       break;
        }
 
        transcript = malloc(SIZ);