#include "defs.h"
#include "authorize.h"
#include "vector.h"
+#include "version.h"
static disorder_client *client;
exit(0);
}
-/* display version number and terminate */
-static void version(void) {
- xprintf("%s", disorder_version_string);
- xfclose(stdout);
- exit(0);
-}
-
static disorder_client *getclient(void) {
if(!client) {
if(!(client = disorder_new(1))) exit(EXIT_FAILURE);
default: fatal(0, "invalid option");
}
}
+ if(online_registration && !config->mail_sender)
+ fatal(0, "you MUST set mail_sender if you want online registration");
if(disorder_adduser(getclient(), "guest", "",
online_registration ? "read,register" : "read"))
exit(EXIT_FAILURE);
pcre_malloc = xmalloc;
pcre_free = xfree;
if(!setlocale(LC_CTYPE, "")) fatal(errno, "error calling setlocale");
- while((n = getopt_long(argc, argv, "hVc:dHlNu:p:", options, 0)) >= 0) {
+ while((n = getopt_long(argc, argv, "+hVc:dHlNu:p:", options, 0)) >= 0) {
switch(n) {
case 'h': help();
case 'H': help_commands();
- case 'V': version();
+ case 'V': version("disorder");
case 'c': configfile = optarg; break;
case 'd': debugging = 1; break;
case 'l': local = 1; break;