webui: Allow admin users to modify hostnames in web UI #3445

This commit is contained in:
jonathon-k
2016-11-12 17:19:22 -07:00
committed by Neil Lathwood
parent 79d3daabf2
commit 0955d0271e
2 changed files with 43 additions and 3 deletions

View File

@@ -212,8 +212,12 @@ function renamehost($id, $new, $source = 'console')
dbUpdate(array('hostname' => $new), 'devices', 'device_id=?', array($id));
log_event("Hostname changed -> $new ($source)", $id, 'system');
} else {
echo "Renaming of $host failed\n";
log_event("Renaming of $host failed", $id, 'system');
if (__FILE__ === $_SERVER['SCRIPT_FILE_NAME']) {
echo "Renaming of $host failed\n";
} else {
return "Renaming of $host failed\n";
}
}
}