mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-25 14:45:55 -05:00
implement configfile for the no_access page
This commit is contained in:
parent
704822faa0
commit
b3682a2d11
@ -75,6 +75,7 @@ static void config_emit_readonly(WS_CONNINFO *pwsc, void *value, char *arg);
|
||||
static void config_emit_version(WS_CONNINFO *pwsc, void *value, char *arg);
|
||||
static void config_emit_system(WS_CONNINFO *pwsc, void *value, char *arg);
|
||||
static void config_emit_flags(WS_CONNINFO *pwsc, void *value, char *arg);
|
||||
static void config_emit_conffile(WS_CONNINFO *pwsc, void *value, char *arg);
|
||||
static void config_emit_host(WS_CONNINFO *pwsc, void *value, char *arg);
|
||||
static void config_subst_stream(WS_CONNINFO *pwsc, int fd_src);
|
||||
static void config_content_type(WS_CONNINFO *pwsc, char *path);
|
||||
@ -139,6 +140,7 @@ CONFIGELEMENT config_elements[] = {
|
||||
{ 1,0,0,CONFIG_TYPE_STRING,"logfile",(void*)&config.logfile, config_emit_string },
|
||||
{ 1,0,0,CONFIG_TYPE_STRING,"art_filename",(void*)&config.artfilename,config_emit_string },
|
||||
*/
|
||||
{ 0,0,0,CONFIG_TYPE_SPECIAL,"conffile",(void*)NULL,config_emit_conffile },
|
||||
{ 0,0,0,CONFIG_TYPE_SPECIAL,"host",(void*)NULL,config_emit_host },
|
||||
{ 0,0,0,CONFIG_TYPE_SPECIAL,"release",(void*)VERSION,config_emit_literal },
|
||||
{ 0,0,0,CONFIG_TYPE_SPECIAL,"package",(void*)PACKAGE,config_emit_literal },
|
||||
@ -428,6 +430,22 @@ void config_emit_host(WS_CONNINFO *pwsc, void *value, char *arg) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* emit the path to the current config file
|
||||
*
|
||||
* \param pwsc web connection
|
||||
* \param value the variable that was requested
|
||||
* \param arg any args passwd with the meta command
|
||||
*/
|
||||
void config_emit_conffile(WS_CONNINFO *pwsc, void *value, char *arg) {
|
||||
char fullpath[PATH_MAX];
|
||||
|
||||
realpath(conf_get_filename(),fullpath);
|
||||
ws_writefd(pwsc,"%s",fullpath);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit a string to the admin page. This is an actual string,
|
||||
* not a pointer to a string pointer, like emit_string.
|
||||
|
Loading…
Reference in New Issue
Block a user