$Log$
+ Revision 601.71 2002/11/25 04:57:43 ajc
+ * Allow set/clear of per-user Internet mail privilege
+ * Honor that flag
+
Revision 601.70 2002/11/23 13:35:47 error
* Makefile.in: Alphabetized all the source files
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
}
+/*
+ * Check to see if the specified user has Internet mail permission
+ * (returns nonzero if permission is granted)
+ */
+int CtdlCheckInternetMailPermission(struct usersupp *who) {
+
+ /* Globally enabled? */
+ if (config.c_restrict == 0) return(1);
+
+ /* User flagged ok? */
+ if (who->flags & US_INTERNET) return(2);
+
+ /* Aide level access? */
+ if (who->axlevel >= 6) return(3);
+
+ /* No mail for you! */
+ return(0);
+}
+
+
+
/*
* Validate recipients, count delivery types and errors, and handle aliasing
* FIXME check for dupes!!!!!
phree(valid);
return;
}
+ if (valid->num_internet > 0) {
+ if (CtdlCheckInternetMailPermission(&CC->usersupp)==0) {
+ cprintf("%d You do not have permission "
+ "to send Internet mail.\n",
+ ERROR + HIGHER_ACCESS_REQUIRED);
+ phree(valid);
+ return;
+ }
+ }
if ( ( (valid->num_internet + valid->num_ignet) > 0)
&& (CC->usersupp.axlevel < 4) ) {
char *subject, /* Subject (optional) */
char *preformatted_text /* ...or NULL to read text from client */
);
+int CtdlCheckInternetMailPermission(struct usersupp *who);
}
user->axlevel = intprompt("Access level", user->axlevel, 0, 6);
+
+ user->flags = set_attr(ipc, user->flags,
+ "Permission to send/receive Internet mail",
+ US_INTERNET, 0);
+
if (boolprompt("Ask user to register again", !(user->flags & US_REGIS)))
user->flags &= ~US_REGIS;
else
void strproc(char *string);
void back(int spaces);
void progress(unsigned long curr, unsigned long cmax);
+int set_attr(CtdlIPC *ipc, unsigned int sval, char *prompt, unsigned int sbit, int backwards);