Hi,
after a long time, I thought I could try to investigate the code some further,
and maybe I found some hint.
The page where I expected the options to show was (probably) the one generated by this function:
void show_admin_page(LOGBOOK * lbs, char *top_group)
Inside, it, the buttons are generated by following code snippets:
(elogd.c:10443)
if (is_admin_user_global(getparam("unm"))) {
sprintf(str, loc("Change %s"), "[global]");
rsprintf("<input type=submit name=cmd value=\"%s\">\n", str);
}
(elogd.c:10461)
if (is_admin_user("global", getparam("unm"))) {
rsprintf("<input type=submit name=cmd value=\"%s\">\n", loc("Delete this logbook"));
rsprintf("<input type=submit name=cmd value=\"%s\">\n", loc("Rename this logbook"));
rsprintf("<input type=submit name=cmd value=\"%s\">\n", loc("Create new logbook"));
}
The functions called to validate the user are following:
(elogd.c:21298)
BOOL is_admin_user(char *logbook, char *user):
//...
if (user == NULL)
return FALSE;
(elogd.c:21324)
BOOL is_admin_user_global(char *user)
{
//...
if (user == NULL)
return FALSE;
Since I assume that I'm probably in the "userless" case (no users are defined in the configuration,
and no usernames are set when launching elog either), I would understand that this causes the options for
global config editing etc etc not to be shown on the admin page.
In my opinion (and given that my interpretation of the code flow isn't wrong), the "null"
user should be indeed considered admin, at least as long as no user management is defined whatsoever.
(If I got it right, if user==NULL, but a password file exists, user management is applied,
thus we're in the case of anonymous user which is correctly not admin).
Again, I might be wrong, but I would be curious to hear an opinion from you about this issue.
Thanks again for your attention.
GiorgioCC |