diff --git a/Rocksolid_Light/spoolnews/user.php b/Rocksolid_Light/spoolnews/user.php
index a3e0d2f..cf952ff 100644
--- a/Rocksolid_Light/spoolnews/user.php
+++ b/Rocksolid_Light/spoolnews/user.php
@@ -205,18 +205,52 @@ if ($_POST['command'] != 'Configuration' && $_POST['command'] != 'SaveConfig') {
// Apply Config
if (isset($_POST['command']) && $_POST['command'] == 'SaveConfig') {
if ($OVERRIDES['disable_change_name'] != true) {
+ if (trim($_POST['display_name']) == '') {
+ $_POST['display_name'] = $user;
+ }
+ if (trim($_POST['display_email']) == '') {
+ $_POST['display_email'] = get_user_config($user, 'email');
+ }
+ // Don't allow using already existing username or alias
+ $value = get_user_config($_POST['display_name'], 'encryptionkey');
+ if (! $value) {
+ $value = get_config_file_value($config_dir . '/aliases.conf', strtolower($_POST['display_name']));
+ // Alias exists if $value is true
+ if (strtolower($value) == $user) {
+ // But it's our alias so it's ok to use
+ $value = false;
+ }
+ }
+ if ($value && (strtolower($_POST['display_name']) != $user)) {
+ // It's someone else's username or alias
+ echo '' . $_POST['display_name'] . " is unavailable.
Please try again";
+ echo '