We represent a user who has never authed with lastauth=0. Expiry of never-authed users can be done based on creation time.
Updated the import script to behave accordingly.
rup->suspendreason=0;
}
- if (UIsNeedAuth(rup))
- rup->flags&=~(QUFLAG_NEEDAUTH);
csdb_updateuser(rup);
if (UIsDelayedGline(rup)) {
{ 'G', QUFLAG_DELAYEDGLINE },
{ 'h', QUFLAG_HELPER },
{ 'i', QUFLAG_INFO },
- { 'l', QUFLAG_NEEDAUTH },
{ 'L', QUFLAG_NOAUTHLIMIT },
{ 'n', QUFLAG_NOTICE },
{ 'o', QUFLAG_OPER },
/* User flags */
-#define QUFLAG_NEEDAUTH 0x0001 /* +l */
+/* SPARE FLAG 0x0001 */
#define QUFLAG_GLINE 0x0002 /* +g */
#define QUFLAG_NOTICE 0x0004 /* +n */
#define QUFLAG_RESTRICTED 0x0008 /* +r */
#define QUFLAG_NOAUTHLIMIT 0x1000 /* +L */
#define QUFLAG_CLEANUPEXEMPT 0x4000 /* +D */
#define QUFLAG_TRUST 0x8000 /* +T */
-#define QUFLAG_ALL 0xdfff
+#define QUFLAG_ALL 0xdffe
-#define UIsNeedAuth(x) ((x)->flags & QUFLAG_NEEDAUTH)
#define UIsGline(x) ((x)->flags & QUFLAG_GLINE)
#define UIsNotice(x) ((x)->flags & QUFLAG_NOTICE)
#define UIsRestricted(x) ((x)->flags & QUFLAG_RESTRICTED)
#define UIsNoAuthLimit(x) ((x)->flags & QUFLAG_NOAUTHLIMIT)
#define UIsCleanupExempt(x) ((x)->flags & QUFLAG_CLEANUPEXEMPT)
-#define UHasSuspension(x) ((x)->flags & (QUFLAG_GLINE|QUFLAG_DELAYEDGLINE|QUFLAG_SUSPENDED|QUFLAG_NEEDAUTH))
+#define UHasSuspension(x) ((x)->flags & (QUFLAG_GLINE|QUFLAG_DELAYEDGLINE|QUFLAG_SUSPENDED))
#define UHasHelperPriv(x) ((x)->flags & (QUFLAG_HELPER | QUFLAG_OPER | QUFLAG_ADMIN | QUFLAG_DEV))
#define UHasOperPriv(x) ((x)->flags & (QUFLAG_OPER | QUFLAG_ADMIN | QUFLAG_DEV))
#define UHasAdminPriv(x) ((x)->flags & (QUFLAG_ADMIN | QUFLAG_DEV))
-#define USetNeedAuth(x) ((x)->flags |= QUFLAG_NEEDAUTH)
#define USetGline(x) ((x)->flags |= QUFLAG_GLINE)
#define USetNotice(x) ((x)->flags |= QUFLAG_NOTICE)
#define USetRestricted(x) ((x)->flags |= QUFLAG_RESTRICTED)
#define USetCleanupExempt(x) ((x)->flags |= QUFLAG_CLEANUPEXEMPT)
#define USetTrust(x) ((x)->flags |= QUFLAG_TRUST)
-#define UClearNeedAuth(x) ((x)->flags &= ~QUFLAG_NEEDAUTH)
#define UClearGline(x) ((x)->flags &= ~QUFLAG_GLINE)
#define UClearNotice(x) ((x)->flags &= ~QUFLAG_NOTICE)
#define UClearRestricted(x) ((x)->flags &= ~QUFLAG_RESTRICTED)
lastuserID=rup->ID;
strncpy(rup->username,np->authname,NICKLEN); rup->username[NICKLEN]='\0';
rup->created=time(NULL);
- rup->lastauth=time(NULL); /* questionable */
+ rup->lastauth=0;
rup->lastemailchange=0;
rup->flags=QUFLAG_NOTICE;
rup->languageid=0;
else if (UIsSuspended(vrup)) {
strcpy(action, "unsuspended");
}
- else if (UIsNeedAuth(vrup)) {
- strcpy(action, "enabled");
- }
else {
chanservsendmessage(sender, "Unknown suspend type encountered.");
return CMD_ERROR;
}
- vrup->flags&=(~(QUFLAG_GLINE|QUFLAG_DELAYEDGLINE|QUFLAG_SUSPENDED|QUFLAG_NEEDAUTH));
+ vrup->flags&=(~(QUFLAG_GLINE|QUFLAG_DELAYEDGLINE|QUFLAG_SUSPENDED));
vrup->suspendby=0;
vrup->suspendexp=0;
freesstring(vrup->suspendreason);
my $suspendtime=0;
my $suspendexp=0;
my $suspendreason="";
+ my $created=0;
while (<USERLIST>) {
chomp;
}
if (exists $suspends{$username}) {
my $ar=$suspends{$username};
- if ($$ar[0] == 7) { # never authed
- $uflags |= 0x1;
+ $created=0; # Q doesn't have created time for auths so default it to 0
+ if ($$ar[0] == 7) { # never authed - copy the "last auth" time into "created time".
+ $created=$lastauth;
+ $lastauth=0; # new Q uses lastauth=0 to indicate an unused account
} elsif ($$ar[0] == 5) { # delayed gline
$uflags |= 0x0800;
} elsif ($$ar[0] == 6) { # instant gline
$suspendtime=0;
$suspendexp=0;
$suspendreason="";
+ $created=0;
}
- print USERS "$userid,".doquote($username).",0,$lastauth,$lastemailrq,$uflags,0,$suspendwho,$suspendexp,$suspendtime,$lockuntil,".doquote($password).",".doquote($emailaddr).",".doquote($lastemail).",".doquote("${lastusername}\@${lasthostname}").",,,\n";
+ print USERS "$userid,".doquote($username).",$created,$lastauth,$lastemailrq,$uflags,0,$suspendwho,$suspendexp,$suspendtime,$lockuntil,".doquote($password).",".doquote($emailaddr).",".doquote($lastemail).",".doquote("${lastusername}\@${lasthostname}").",".$suspendreason.",,\n";
$users{irc_lc($username)}=$userid;
$state=-1;
$usercount++;