Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 700 of 806  Not logged in ELOG logo
ID Date Icon Author Author Email Category OS ELOG Version Subject
  927   Wed Feb 9 15:40:12 2005 Question Tim Fowlertimfowler1@gmail.comQuestionLinux | WindowsV2.5.6-2ELOG Command Line Utility
I am trying to use the command line utility elog. Some of the attributes 
that I have setup are multiple options. When I run the command line 
utility to create a new message, any attribute that is setup with multiple 
options will not be filled in. The syntax I am using is as  follows:

elog -h localhost -p 8080 -l Lab -a "Site=xxxx" -a "Area=System" -
a "Priority=Low" -a "Shift=1" -a "Status=Open" -m text.txt

Site and Area are defined in the config file as MOptions. Is there a way 
to use this feature with multiple options on attributes with the 
attributes = to one or more variables?
  926   Tue Feb 8 19:04:25 2005 Blink Emiliano GabrielliAlberT@SuperAlberT.itCommentLinux2.5.6 cvs[patch] Re: images attached shown as inline
> > uhm ok .. can I expect to get a release with this feature in the near future ?
> 
> I checked how I would do that and did not find a good solution. If I put a
> 
> <img width=300 ...> 
> 
> for example, this scales down a big picture to only 300 pixels width. But if you submit a small
> picture, like just an icon, it blows it up to 300 pixels as well, which does not look nice.
> Unfortunatle I don't know of any option like "maxwidth=x" which only scales pictures down if they
> are larger than x. Do you know?

the following patch should do the job:


#################################################################################
--- elogd_orig.c        2005-02-03 16:46:10.000000000 +0100
+++ elogd_imgscale.c    2005-02-08 18:58:14.000000000 +0100
@@ -13690,9 +13690,14 @@
                       ("<tr><td colspan=%d class=\"attachment\">%s %d: <a href=\"%s\">%s</a>\n",
                        colspan, loc("Attachment"), index + 1, ref, attachment[index] + 14);
                   if (show_attachments)
-                     rsprintf
-                         ("</td></tr><tr><td colspan=%d class=\"messagelist\"><img
src=\"%s\"></td></tr>",
-                          colspan, ref);
+                     if (!getcfg(lbs->name, "Attached image width", str, sizeof(str))) {
+                        rsprintf("</td></tr><tr><td colspan=%d class=\"messagelist\"><img
src=\"%s\"></td></tr>",
+                                 colspan, ref);
+                    } else {
+                        rsprintf("</td></tr><tr><td colspan=%d class=\"messagelist\">"
+                                 "<div style=\"width: %s\"><img src=\"%s\" style=\"width:
100%\"></div></td></tr>",
+                                 colspan, str, ref);
+                    }
                } else {
                   rsprintf
                       ("<tr><td colspan=%d class=\"attachment\">%s %d: <a href=\"%s\">%s</a>\n",
@@ -18090,7 +18095,10 @@
                   if (is_image(att)) {
                      rsprintf("<tr><td class=\"messageframe\">\n");
                      rsprintf("<a name=\"att%d\"></a>\n", index + 1);
-                     rsprintf("<img src=\"%s\"></td></tr>", ref);
+                     if (!getcfg(lbs->name, "Attached image width entry", str, sizeof(str)))
+                        rsprintf("<img src=\"%s\"></td></tr>", ref);
+                    else
+                        rsprintf("<div style=\"width: %s\"><img src=\"%s\" style=\"width:
100%\"></div></td></tr>", str, ref);
                      rsprintf("</td></tr>\n\n");
                   } else {
                      if (is_ascii(file_name)) {
##########################################################################################

two new elog.conf parameters are defined:
Attached image width          ; width of full view image attached
Attached image width entry    ; width of attached image in the entry list view

plz apply :-)
  925   Tue Feb 8 17:40:54 2005 Idea Emiliano GabrielliAlberT@SuperAlberT.itBug fixAll2.5.6 cvs[patch]: fixed wrong extention check
current version uses strstr() to check if the file has the expected ascii
text extension ... this is buggy becouse this way a file named
".txt_hidden_file" or "foo.config.dat" are both seen as .txt files.

the following patch fixes the problem, plz apply to cvs:



#######################################################################
--- elogd_orig.c        2005-02-03 16:46:10.000000000 +0100
+++ elogd_extchk_fix.c  2005-02-08 17:32:21.000000000 +0100
@@ -1160,6 +1160,28 @@

 #define my_toupper(_c)    ( ((_c)>='a' && (_c)<='z') ? ((_c)-'a'+'A') : (_c) )

+static BOOL chkext(const char *str, const char *ext)
+{
+   int extl, strl;
+   char c1, c2;
+
+   if (ext == NULL || str == NULL)
+      return FALSE;
+
+   extl = strlen(ext);
+   strl = strlen(str);
+   if (extl >= strl)
+      return FALSE;
+   str = str+strl-extl;
+   while (*str) {
+      c1 = *str++;
+      c2 = *ext++;
+      if (my_toupper(c1) != my_toupper(c2))
+         return FALSE;
+   }
+   return TRUE;
+}
+
 BOOL strieq(const char *str1, const char *str2)
 {
    char c1, c2;
@@ -1168,6 +1190,8 @@
       return TRUE;
    if (str1 == NULL || str2 == NULL)
       return FALSE;
+   if (strlen(str1)!=strlen(str2))
+      return FALSE;

    while (*str1) {
       c1 = *str1++;
@@ -13698,8 +13722,8 @@
                       ("<tr><td colspan=%d class=\"attachment\">%s %d: <a
href=\"%s\">%s</a>\n",
                        colspan, loc("Attachment"), index + 1, ref,
attachment[index] + 14);

-                  if ((strstr(str, ".TXT") || strstr(str, ".ASC") ||
strstr(str, ".CFG")
-                       || strstr(str, ".CONF")
+                  if ((chkext(str, ".TXT") || chkext(str, ".ASC") ||
chkext(str, ".CFG")
+                       || chkext(str, ".CONF")
                        || strchr(str, '.') == NULL) && show_attachments) {
                      /* display attachment */
                      rsprintf("</td></tr><tr><td colspan=%d
class=\"messagelist\"><pre>", colspan);
@@ -14779,7 +14803,7 @@
    regex_t re_buf[MAX_N_ATTR + 1];
    regmatch_t pmatch[10];

-   /* redirect if enpty parameters */
+   /* redirect if empty parameters */
    if (strstr(_cmdline, "=&")) {
       while ((pt1 = strstr(_cmdline, "=&")) != NULL) {
          pt2 = pt1;
#######################################################################
  924   Tue Feb 8 15:41:55 2005 Agree Emiliano GabrielliAlberT@SuperAlberT.itBug fixLinux2.5.6Re: erroneus encoding
the following patch corrects the problem, plz apply :


--- elogd.c     2005-02-03 16:46:10.000000000 +0100
+++ elogd_albert.c      2005-02-08 15:40:36.000000000 +0100
@@ -6178,7 +6178,7 @@
    if (getcfg("global", "charset", str, sizeof(str)))
       rsprintf("Content-Type: text/html;charset=%s\r\n", str);
    else
-      rsprintf("Content-Type: text/html;charset=%S\r\n", DEFAULT_HTTP_CHARSET);
+      rsprintf("Content-Type: text/html;charset=%s\r\n", DEFAULT_HTTP_CHARSET);

    if (use_keepalive) {
       rsprintf("Connection: Keep-Alive\r\n");
@@ -11267,7 +11267,7 @@
    rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
    rsprintf("Accept-Ranges: bytes\r\n");
    rsprintf("Connection: close\r\n");
-   rsprintf("Content-Type: text/plain;charset=%S\r\n", DEFAULT_HTTP_CHARSET);
+   rsprintf("Content-Type: text/plain;charset=%s\r\n", DEFAULT_HTTP_CHARSET);
    rsprintf("Pragma: no-cache\r\n");
    rsprintf("Expires: Fri, 01 Jan 1983 00:00:00 GMT\r\n\r\n");
  923   Tue Feb 8 14:55:26 2005 Smile Rob de Bruinrdbruin@zernike.nl Linux2.5.6.1Re: Page not found after login or create useraccount
Sorry people,

I did not use de - n host/ip syntax at the startup of elogd.
Now it's working properly.

> As you can see the password is also visable in the addressbar??
> 
> 
> > best all,
> > 
> > I'm having trouble with redirecting after creating an account or login.
> > For example when i create an account with an Admin user when i click on 
> > Save i recieve the following error:
> > Error finding page!
> > And this is what de browser address tels me.
> > 
> > http://192.168.71.26/ZC004/?
> > cmd=Save&new_user_name=zcpvenema&new_full_name=Peter+Venema&new_user_email=p
> > venema@zernike.nl&email_notify=all&newpwd=123456&newpwd2=123456
> > 
> > But when i remove the line frome the ? and than press enter then i'll while 
> > be able to just elog again.
> > 
> > here is my Global cfg file setting.
> > 
> > What did i do wrong??
> > 
> > ########################################
> > 
> > Port = 80
> > Grp = elog 
> > Usr = elog 
> > Password file = /usr/local/elog/elog-2.5.6/passwd
> > User login = /usr/local/elog/elog-2.5.6/passwd
> > Admin user = rdbruin
> > Resource dir = /usr/local/elog/elog-2.5.6/
> > Logbook dir = /usr/local/bin/logbooks/
> > time format = %d %B %Y %H:%M
> > SMTP host = smtp.xs4all.nl
> > Main tab = Startpagina
> > Page Title = Logboeken Zernike College 
> > IOptions Icon = icon1.gif, icon3.gif, icon4.gif, icon5.gif, icon6.gif, 
> > icon7.gif, icon8.gif, icon12.gif, icon13.gif, icon14.gif
> > Submit page = /usr/local/elog/elog-2.5.6/bericht
> > Attributes = Author, Type, Category, Subject, Owner, Email
> > Group Zernike college = Desktops, Servers, Printers, Ribox, Switches, 
> > Routers, Algemeen, Documentatie, XafaX
> > Options OS = Windows XP, Novell, Windows 2003, Windows 2000, Windows 98
> > Options Type = Software, Hardware, Besturingssysteem, Monitor
> > Group Desktops = Harmjan, Helperbrink, Julianalaan, Rummerinkhof, 
> > Westersedrift
> > Group Helperbrink = ZC004, ZC006, ZC026, ZC155, ZC209, ZC241, ZC246, ZC247, 
> > ZC248, ZC267, ZC288, ZC307, ZC308, ZC446, ZC475, ZC600, ZC601, ZC602, 
> > ZC603, ZC604, ZC605, ZC606, ZC607, ZC608, ZC609, ZC610, ZC611, ZC612, 
> > ZC613, ZC614, ZC615, ZC616, ZC617, ZC618, ZC619, ZC620, ZC621, ZC622, 
> > ZC623, ZC624, ZC625, ZC626, ZC627, ZC628, ZC629, ZC630, ZC631, ZC632, 
> > ZC633, ZC634, ZC635, ZC636, ZC637, ZC638, ZC639, ZC640, ZC641, ZC642, 
> > ZC643, ZC644, ZC645, ZC646, ZC647, ZC648, ZC649, ZC650, ZC651, ZC652, 
> > ZC653, ZC654, ZC655, ZC656, ZC657, ZC658, ZC659, ZC660, ZC662, ZC708, 
> > ZC712, ZC707, ZC711, ZC900, ZC901, ZC902, ZC903, ZC904, ZC905, ZC906, 
> > ZC907, ZC908, ZC909, ZC910, ZC911, ZC912, ZC913, ZC914, ZC915, ZC916, 
> > ZC917, ZC918, ZC919, ZC920, ZC921, ZC922, ZC923
> > Group Servers = HJZ1, HPB2, HRN1, HRN2, RHF1, ZDL1, ZC-ROOT1, ZC-ROOT2
> > Group Ribox = HPB, HJZ, HRN, WD, ZDL
> > Group Printers = HP, Canon
> > Group HP = 4L, 6L, 2100, 4000, 4050, 4550 kleur, 8000
> > Group Documentatie = Administratief, Educatief, Systeembeheer, Software, 
> > Hardware
> > Group Xafax = Pasjes, Chipnet, Smartprinter, Docs
> > 
> > ###################################################
  922   Tue Feb 8 14:49:40 2005 Smile Rob de Bruinrdbruin@zernike.nl Linux2.5.6.1Re: Page not found after login or create useraccount
Sorry people,

I did not use de - n host/ip syntax at the startup of elogd.
Now it's working properly.

> As you can see the password is also visable in the addressbar??
> 
> 
> > best all,
> > 
> > I'm having trouble with redirecting after creating an account or login.
> > For example when i create an account with an Admin user when i click on 
> > Save i recieve the following error:
> > Error finding page!
> > And this is what de browser address tels me.
> > 
> > http://192.168.71.26/ZC004/?
> > cmd=Save&new_user_name=zcpvenema&new_full_name=Peter+Venema&new_user_email=p
> > venema@zernike.nl&email_notify=all&newpwd=123456&newpwd2=123456
> > 
> > But when i remove the line frome the ? and than press enter then i'll while 
> > be able to just elog again.
> > 
> > here is my Global cfg file setting.
> > 
> > What did i do wrong??
> > 
> > ########################################
> > 
> > Port = 80
> > Grp = elog 
> > Usr = elog 
> > Password file = /usr/local/elog/elog-2.5.6/passwd
> > User login = /usr/local/elog/elog-2.5.6/passwd
> > Admin user = rdbruin
> > Resource dir = /usr/local/elog/elog-2.5.6/
> > Logbook dir = /usr/local/bin/logbooks/
> > time format = %d %B %Y %H:%M
> > SMTP host = smtp.xs4all.nl
> > Main tab = Startpagina
> > Page Title = Logboeken Zernike College 
> > IOptions Icon = icon1.gif, icon3.gif, icon4.gif, icon5.gif, icon6.gif, 
> > icon7.gif, icon8.gif, icon12.gif, icon13.gif, icon14.gif
> > Submit page = /usr/local/elog/elog-2.5.6/bericht
> > Attributes = Author, Type, Category, Subject, Owner, Email
> > Group Zernike college = Desktops, Servers, Printers, Ribox, Switches, 
> > Routers, Algemeen, Documentatie, XafaX
> > Options OS = Windows XP, Novell, Windows 2003, Windows 2000, Windows 98
> > Options Type = Software, Hardware, Besturingssysteem, Monitor
> > Group Desktops = Harmjan, Helperbrink, Julianalaan, Rummerinkhof, 
> > Westersedrift
> > Group Helperbrink = ZC004, ZC006, ZC026, ZC155, ZC209, ZC241, ZC246, ZC247, 
> > ZC248, ZC267, ZC288, ZC307, ZC308, ZC446, ZC475, ZC600, ZC601, ZC602, 
> > ZC603, ZC604, ZC605, ZC606, ZC607, ZC608, ZC609, ZC610, ZC611, ZC612, 
> > ZC613, ZC614, ZC615, ZC616, ZC617, ZC618, ZC619, ZC620, ZC621, ZC622, 
> > ZC623, ZC624, ZC625, ZC626, ZC627, ZC628, ZC629, ZC630, ZC631, ZC632, 
> > ZC633, ZC634, ZC635, ZC636, ZC637, ZC638, ZC639, ZC640, ZC641, ZC642, 
> > ZC643, ZC644, ZC645, ZC646, ZC647, ZC648, ZC649, ZC650, ZC651, ZC652, 
> > ZC653, ZC654, ZC655, ZC656, ZC657, ZC658, ZC659, ZC660, ZC662, ZC708, 
> > ZC712, ZC707, ZC711, ZC900, ZC901, ZC902, ZC903, ZC904, ZC905, ZC906, 
> > ZC907, ZC908, ZC909, ZC910, ZC911, ZC912, ZC913, ZC914, ZC915, ZC916, 
> > ZC917, ZC918, ZC919, ZC920, ZC921, ZC922, ZC923
> > Group Servers = HJZ1, HPB2, HRN1, HRN2, RHF1, ZDL1, ZC-ROOT1, ZC-ROOT2
> > Group Ribox = HPB, HJZ, HRN, WD, ZDL
> > Group Printers = HP, Canon
> > Group HP = 4L, 6L, 2100, 4000, 4050, 4550 kleur, 8000
> > Group Documentatie = Administratief, Educatief, Systeembeheer, Software, 
> > Hardware
> > Group Xafax = Pasjes, Chipnet, Smartprinter, Docs
> > 
> > ###################################################
  921   Tue Feb 8 13:13:22 2005 Blink Emiliano GabrielliAlberT@SuperAlberT.itBug reportLinux2.5.6Re: preselected values and conditional options
 up :-)
  920   Tue Feb 8 13:11:30 2005 Warning Emiliano GabrielliAlberT@SuperAlberT.itBug reportAll2.5.6Re: HTML 4.1 transitional validation fails
> as this url shows http://www.htmlhelp.com/tools/validator/problems.html#amp

> it should be used an HTML entity instead of the ampersand sign.<p> another problem with validation: required attribute "ALT" not specified in every <img> tag used in the elog (icons) here is an example of the validator results: http://validator.w3.org/check?uri=http%3A%2F%2Fmidas.psi.ch%2Felogs%2FLinux+Demo%2F&charset=iso-8859-1+%28Western+Europe%29&verbose=1
ELOG V3.1.5-3fb85fa6