rejetto forum

Software => HFS ~ HTTP File Server => Beta => Topic started by: simbadda on July 30, 2010, 01:04:45 AM

Title: uploads and new folders
Post by: simbadda on July 30, 2010, 01:04:45 AM
Thanks for your great software.

I have a few questions. I am new here so sorry if these are already covered elsewhere.  I did a little searching but didn't find anything on these.

First, the log does not seem to be logging uploads even though "Uploads" is checked.  Is this a known issue?

Second, is there a way to tell the software to log the creation of folders?
Title: uploads and new folders
Post by: SilentPliz on July 30, 2010, 02:25:16 AM
Welcome simbadda !  :)


First, the log does not seem to be logging uploads even though "Uploads" is checked.  Is this a known issue?

It work fine for me.

Try/verify:

right click in the log box -> Log what -> check Uploads

Second, is there a way to tell the software to log the creation of folders?

Right click on the Home/ root of the VFS box -> Properties... -> add in the Diff template tab:

[ajax.mkdir|no log]
{.if|{.can mkdir.}|{:
   {.set|x|{.force ansi|%folder%{.postvar|name.}.}.}
   {.if|{.exists|{.^x.}.}|{.!exists.}|{:
      {.if|{.length|{.mkdir|{.^x.}.}.}|ok|{.!failed.}.}
     {.add to log|%user% {.!has created this folder:.} {.^x.}.}
   :}.}
:}|{.!forbidden.}.}

 
! This only works with the default template of HFS beta above.

Edit: message updated for compatibility with latest beta (266)
Title: uploads and new folders
Post by: simbadda on July 30, 2010, 05:17:10 AM
Hello SP, thanks for the welcome!

right click in the log box -> Log what -> check Uploads

This option is checked but the log does not change when something is uploaded.  I have tried this on two different computers.

Right click on the Home/ root of the VFS box -> Properties... -> add in the Diff template tab:

This worked.  Thanks!
Title: uploads and new folders
Post by: SilentPliz on July 30, 2010, 07:22:24 AM
This option is checked but the log does not change when something is uploaded.  I have tried this on two different computers.

I have no idea what this could be, sorry. :-\
Title: Re: uploads and new folders
Post by: rejetto on July 30, 2010, 02:04:20 PM
works fine here too.
try posting your Menu > debug > show customized options
Title: Re: uploads and new folders
Post by: SilentPliz on July 31, 2010, 05:50:17 PM
Second, is there a way to tell the software to log the creation of folders?

For the latest beta (266) you should use this corrected section in the Diff template tab.

[ajax.mkdir|no log]
{.if|{.can mkdir.}|{:
   {.set|x|{.force ansi|%folder%{.postvar|name.}.}.}
   {.if|{.exists|{.^x.}.}|{.!exists.}|{:
      {.if|{.length|{.mkdir|{.^x.}.}.}|ok|{.!failed.}.}
     {.add to log|%user% {.!has created this folder:.} {.^x.}.}
   :}.}
:}|{.!forbidden.}.}
Title: Re: uploads and new folders
Post by: rejetto on August 01, 2010, 12:44:15 PM
you are very effective SP :D
Title: Re: uploads and new folders
Post by: SilentPliz on August 01, 2010, 01:01:30 PM

Isn't it !  :D
Title: Re: uploads and new folders
Post by: simbadda on August 02, 2010, 12:34:42 AM
Here is my output for Menu->Debug->Show customized options.  By the way, I noticed that entries get created in this list when options are changed to the non-default setting.  However, when I uncheck "Uploads", no entry is created (e.g. "log-uploads").

window-max=yes
# default: no

easy=no
# default: yes

port=8080
# default:

log-file-name=.\Log\HFSlog%y%-%m%.txt
# default:

log-date=yes
# default: no

log-only-served=no
# default: yes

log-server-start=yes
# default: no

log-server-stop=yes
# default: no

log-browsing=no
# default: yes

tpl-file=hfs.tpl
# default:

confirm-exit=yes
# default: no

search-better-ip=no
# default: yes

start-minimized=yes
# default: no

delete-partial-uploads=yes
# default: no

default-sorting=
# default: name

last-dialog-folder=C:\Software\HFS\Internet
# default: C:\HFS

last-update-check=40389.3519287037
# default: 0

last-file-open=C:\HFS\Config.vfs
# default:

mime-types=*.js|text/javascript|*.htm;*.html|text/html|*.jpg;*.jpeg;*.jpe|image/jpeg|*.gif|image/gif|*.png|image/png|*.bmp|image/bmp|*.ico|image/x-icon|*.mpeg;*.mpg;*.mpe|video/mpeg|*.avi|video/x-msvideo|*.txt|text/plain|*.css|text/css
# default: *.htm;*.html|text/html|*.jpg;*.jpeg;*.jpe|image/jpeg|*.gif|image/gif|*.png|image/png|*.bmp|image/bmp|*.ico|image/x-icon|*.mpeg;*.mpg;*.mpe|video/mpeg|*.avi|video/x-msvideo|*.txt|text/plain|*.css|text/css|*.js|text/javascript

recent-files=C:\HFS\Config.vfs
# default:

trusted-files=C:\HFS\Config.vfs
# default:

number-files-on-upload=no
# default: yes

out-total=59366341
# default: 0

in-total=54115303
# default: 0

hits-total=6724
# default: 0

downloads-total=9
# default: 0

upload-total=8
# default: 0

connections-columns=IP address;206|File;206|Status;180|Speed;60|Time left;55|Progress;50|
# default: IP address;206|File;206|Status;206|Speed;50|Time left;50|Progress;50|

auto-comment=yes
# default: no

update-daily=no
# default: yes
Title: Re: uploads and new folders
Post by: rejetto on August 03, 2010, 11:44:00 AM
Here is my output for Menu->Debug->Show customized options.  By the way, I noticed that entries get created in this list when options are changed to the non-default setting.  However, when I uncheck "Uploads", no entry is created (e.g. "log-uploads").

indeed, there'a a bug. That option is neither saved, and you lose the setting at every restart. Fixed in next release (265).

Thanks to the customized options you posted i got to reproduced the bug. It's likely to be fixed for the next release, I'm working on it right now.
In the while you may workaround it by enabling the "browsing" in the log menu.
Title: Re: uploads and new folders
Post by: simbadda on August 03, 2010, 11:16:04 PM
Awesome.  Thanks for all of your work on this rejetto!
Title: Re: uploads and new folders
Post by: SilentPliz on August 10, 2010, 02:57:14 AM
For the latest beta (266) you should use this corrected section in the Diff template tab.

[ajax.mkdir|no log]
{.if|{.can mkdir.}|{:
   {.set|x|{.force ansi|%folder%{.postvar|name.}.}.}
   {.if|{.exists|{.^x.}.}|{.!exists.}|{:
      {.if|{.length|{.mkdir|{.^x.}.}.}|ok|{.!failed.}.}
     {.add to log|%user% {.!has created this folder:.} {.^x.}.}
   :}.}
:}|{.!forbidden.}.}

Hopefully this will be also valid for the next beta ... but I dare not assert. :D
Title: Re: uploads and new folders
Post by: r][m on August 23, 2010, 04:57:19 PM
For the latest beta (266) you should use this corrected section in the Diff template tab.

[ajax.mkdir|no log]
{.if|{.can mkdir.}|{:
   {.set|x|{.force ansi|%folder%{.postvar|name.}.}.}
   {.if|{.exists|{.^x.}.}|{.!exists.}|{:
      {.if|{.length|{.mkdir|{.^x.}.}.}|ok|{.!failed.}.}
     {.add to log|%user% {.!has created this folder:.} {.^x.}.}
   :}.}
:}|{.!forbidden.}.}

Hopefully this will be also valid for the next beta ... but I dare not assert. :D
@ SilentPliz
Is there a way to make this work without ajax? I'd like to use this in my tpl, or in events.
Tried code below in events, but it doesn't work.
Code: [Select]
[+request]
{.set|z|%folder%{.postvar|fldname.}.}.}
{.add to log|%user% {.!added this folder:.} {.^z.}.}
.}
I use
Code: [Select]
[special:begin]
{.if|{.and|{.get|can delete.}|{.postvar|createfolder.}.}|{: {.mkdir|%folder-resource%\{.postvar|fldname.}.}
 :}/if.}
And in tpl main section
Code: [Select]
<form>
Folder name: <input type='text' name='fldname'><input type='submit' name='createfolder' value='Add Folder'>
</form>
Logging user created folder is my need.
Title: Re: uploads and new folders
Post by: SilentPliz on August 23, 2010, 07:02:17 PM
Hi r][m !  ;)

Try this:
Add the blue line in the code that you already have in your template.

[special:begin]
{.if|{.and|{.get|can delete.}|{.postvar|createfolder.}.}|{: {.mkdir|%folder-resource%\{.postvar|fldname.}.}
{.add to log|%user% added this folder: %folder%{.postvar|fldname.}.}
 :}/if.}

Replace %folder% by %folder-resource%\ if you want see Windows paths, rather than Web based paths.

Remove %folder% if you want only see the folder name displayed in the log.

 :)
Title: Re: uploads and new folders
Post by: r][m on August 24, 2010, 05:01:32 AM
@ SilentPliz
I had tried with [special:begin] but I was over complicating it, as usual.
Works perfectly  ;D
Many thanks
Title: Re: uploads and new folders
Post by: SilentPliz on September 16, 2010, 07:29:05 AM
For the beta buid #270 and its default template, this should/must be used in /home > Diff template tab:

Quote
[ajax.mkdir|no log]
{.break|if={.not|{.can mkdir.}.}|result={.!forbidden.}.}
{.set|x|{.force ansi|%folder%{.postvar|name.}.}.}
{.break|if={.exists|{.^x.}.}|result={.!exists.}.}
{.if|{.length|{.mkdir|{.^x.}.}.}|ok|{.!failed.}.}
{.add to log|%user% {.!has created this folder:.} {.^x.}.}

[ajax.rename|no log]
{.break|if={.not|{.can rename.}.}|result={.!forbidden.}.}
{.set|x|{.force ansi|%folder%{.postvar|from.}.}.}
{.set|y|{.force ansi|%folder%{.postvar|to.}.}.}
{.break|if={.not|{.exists|{.^x.}.}.}|result={.!not found.}.}
{.break|if={.exists|{.^y.}.}|result={.!exists.}.}
{.if|{.length|{.rename|{.^x.}|{.^y.}.}.}|ok|{.!failed.}.}
{.add to log|%user% {.!has renamed an item:.} {.^x.} --> {.^y.}.}

[ajax.move|no log]
{.set|dst|{.force ansi|{.postvar|dst.}.}.}
{.break|if={.not|{.and|{.get|can delete.}|{.get|can upload|path={.^dst.}.}/and.}.} |result={.!forbidden.}.}
{.for each|fn|{.replace|:|{.no pipe||.}|{.postvar|files.}.}|{:
    {.set|x|{.force ansi|%folder%{.^fn.}.}.}
    {.set|y|{.^dst.}/{.^fn.}.}
    {.if not |{.exists|{.^x.}.}|{.^x.}{.!:.} {.!not found.}|{:
        {.if|{.exists|{.^y.}.}|{.^y.}{.!:.} {.!already exists.}|{:
         {.if not|{.length|{.move|{.^x.}|{.^y.}.}.}|{.^fn.}{.!:.} {.!not moved.}.}
            {.add to log|%user% {.!has moved an item:.} {.^x.} --> {.^y.}.}
        :}.}
    :}.}
    ;
:}.}
Title: Re: uploads and new folders
Post by: rejetto on September 17, 2010, 09:47:46 AM
i will include it in the default tpl
Title: Re: uploads and new folders
Post by: SilentPliz on September 17, 2010, 09:52:32 AM
Thank you very much! ;)

I could forget this topic. :D