diff --git a/src/core/commands.c b/src/core/commands.c
index c86fe2f..678cb45 100644
--- a/src/core/commands.c
+++ b/src/core/commands.c
@@ -1,6 +1,6 @@
/*
* uhub - A tiny ADC p2p connection hub
- * Copyright (C) 2007-2010, Jan Vidar Krey
+ * Copyright (C) 2007-2011, Jan Vidar Krey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -732,15 +732,22 @@ static int command_register(struct hub_info* hub, struct hub_user* user, struct
data.password[MAX_PASS_LEN] = '\0';
data.credentials = auth_cred_user;
- if (acl_register_user(hub, &data))
+ if (hub->config->register_self)
{
- sprintf(tmp, "User \"%s\" registered.", user->id.nick);
- return command_status(hub, user, cmd, tmp);
+ if (acl_register_user(hub, &data))
+ {
+ sprintf(tmp, "User \"%s\" registered.", user->id.nick);
+ return command_status(hub, user, cmd, tmp);
+ }
+ else
+ {
+ sprintf(tmp, "Unable to register user \"%s\".", user->id.nick);
+ return command_status(hub, user, cmd, tmp);
+ }
}
else
{
- sprintf(tmp, "Unable to register user \"%s\".", user->id.nick);
- return command_status(hub, user, cmd, tmp);
+ return command_status(hub, user, cmd, "You are not allowed to register.");
}
}
diff --git a/src/core/config.xml b/src/core/config.xml
index 895314c..8e81403 100644
--- a/src/core/config.xml
+++ b/src/core/config.xml
@@ -108,6 +108,15 @@
0.1.1
+
+