*** ./elogd.c Tue Aug 23 21:27:39 2016
--- ../../elog-3.1.1.orig/src/elogd.c Tue Aug 4 09:30:54 2015
***************
*** 80,84 ****
int _verbose_level, _current_message_id;
int _logging_level, _ssl_flag;
- BOOL just_registered = FALSE; /* flag to supress erroneous error */
LOGBOOK *lb_list = NULL;
--- 80,83 ----
***************
*** 13363,13369 ****
if (new_user) {
- write_logfile(lbs,"In save_user_config() with new_user==TRUE, setting just_registered=TRUE");
- just_registered = TRUE;
-
node = mxml_find_node(lbs->pwd_xml_tree, "/list");
if (!node) {
--- 13362,13365 ----
***************
*** 13432,13436 ****
mxml_write_tree(file_name, lbs->pwd_xml_tree);
-
/* if requested, send notification email to user or admin user */
if (new_user && !first_user && (self_register == 2 || self_register == 3 || self_register == 4)
--- 13428,13431 ----
***************
*** 13616,13619 ****
--- 13611,13615 ----
};
}
+
pl = strtok(NULL, " ,");
}
***************
*** 26649,26666 ****
/* save user info if "save" is pressed */
if (strieq(command, loc("Save")) && isparam("new_user_name") && !isparam("config")) {
! if (!save_user_config(lbs, getparam("new_user_name"), TRUE)) {
return 0;
! }
! if ( just_registered ) {
! write_logfile(lbs,"In do_self_register with just_registered==TRUE, resetting flag, calling show_login_page(NULL,\"\",0)");
! just_registered = FALSE;
! show_login_page(NULL, "", 0);
! } else {
! if (lbs)
! sprintf(str, "../%s/", lbs->name_enc);
! else
! sprintf(str, ".");
! redirect(lbs, str);
! }
return 0;
}
--- 26645,26655 ----
/* save user info if "save" is pressed */
if (strieq(command, loc("Save")) && isparam("new_user_name") && !isparam("config")) {
! if (!save_user_config(lbs, getparam("new_user_name"), TRUE))
return 0;
! if (lbs)
! sprintf(str, "../%s/", lbs->name_enc);
! else
! sprintf(str, ".");
! redirect(lbs, str);
return 0;
}
***************
*** 27355,27364 ****
/* check if user has access to logbook */
if (!check_login_user(lbs, getparam("uname"))) {
! sprintf(str, "check_login_user access failure: user \"%s\", logbook \"%s\"", uname, lbs->name);
! write_logfile(lbs, str);
! show_error("User has no access to this logbook.");
! strlcpy(str, loc("New user"), sizeof(str));
! url_encode(str, sizeof(str));
! rsprintf("
<b><center><a href=\"?cmd=%s\">%s</a></center></b></td></tr>", str, loc("Register as new user"));
return;
}
--- 27344,27348 ----
/* check if user has access to logbook */
if (!check_login_user(lbs, getparam("uname"))) {
! show_error("Use has no access to this logbook");
return;
}
***************
*** 27728,27747 ****
strencode2(str2, command, sizeof(str2));
strencode2(str3, full_name, sizeof(str3));
!
! if (strieq(str2,"Config") && just_registered == TRUE ) {
! /* this is the only time to skip the error that "Config" is not an allowed command...as the Config was really
! called in order to complete the self-registration
!
! now, reset the flag */
! write_logfile(lbs,"In interprete() with just_registered==TRUE, resetting flag, skipping error message that user is not allowed to run command \"Config\"");
! just_registered = FALSE;
! } else {
! sprintf(str, "Error: Command \"%s\" is not allowed for uname \"%s\", full name \"%s\"", str2, uname,str3);
! write_logfile(lbs, str);
!
! sprintf(str, loc("Error: Command \"<b>%s</b>\" is not allowed for login \"<b>%s</b>\", user \"<b>%s</b>\""), str2,uname,str3);
! show_error(str);
! return;
! }
}
--- 27712,27718 ----
strencode2(str2, command, sizeof(str2));
strencode2(str3, full_name, sizeof(str3));
! sprintf(str, loc("Error: Command \"<b>%s</b>\" is not allowed for user \"<b>%s</b>\""), str2, str3);
! show_error(str);
! return;
}
|
Hello,
I'm new to elog. I've installed it under Slackware 11. Everything worked smoothly until I wanted to establish access control. I followed the steps described under Access control heading in Syntax of elog.cfg chapter. I specified a new password file name and the following steps with no problem. After having created a new user I stopped elogd and added Admin user to config file. And here is my problem - each time I want to login to elog, I get "Invalid user name or password!" message. The meaning of it is obvious. So I have repeated all the steps several times. Of course I paid attention to enter user name and password correctly but I can't get rid of this message. For sure I making something wrong, but what it is ?
Here is part of my elogd.cfg:
[global]
Port=8080
Logfile = elogd.log
Logging level = 3
Password file = passwd
Self register = 1
Admin user = eloga
charset = utf-8
Here is what happens after elog restart:
elogd 2.8.0 built Oct 22 2010, 11:04:31 revision 2313
Falling back to default group "elog"
Falling back to default user "elog"
Falling back to default group "elog"
Falling back to default user "elog"
ImageMagick detected
Indexing logbooks ... Converting password file for logbook "Demo" to new encoding ... ok
done
Server listening on port 8080 ...
Here is the password file :
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- created by MXML on Wed Nov 24 13:13:43 2010 -->
<list>
<user>
<name>eloga</name>
<password encoding="SHA256">vnpfrWa8wmxFsLFjlY/poXdz3wh6RLt9BT.D1O52Xl9</password>
<full_name>Mariusz Stakowski</full_name>
<last_logout>0</last_logout>
<last_activity>Wed Nov 24 13:13:43 2010</last_activity>
<email>Mariusz.Stakowski@asseco.pl</email>
<email_notify/>
</user>
</list>
And here is what I found in elogd.log file:
24-Nov-2010 13:50:06 [] Server listening on port 8080 ...
24-Nov-2010 13:50:53 [eloga@xx.xx.xx.xx] {Demo} LOGIN user "eloga" (attempt)
Could somebody help me please ?
Best regards
Mariusz Stakowski
|