File: uploadfile.proc

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (32 lines) | stat: -rw-r--r-- 1,065 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
!if . isin $user or $tchat_configfilesize<=0
  job=edit
  !changeto $job.proc
!endif

!if $wims_deposit!=$empty and / notin $wims_deposit and .. notin $wims_deposit and noname.file!=$wims_deposit
  du=!sh du -ks $wims_home/sessions/$wims_session/user-deposit;
  du=!word 1 of $du
  filesize=$[$du/1024]
  !ifval $filesize>$tchat_configfilesize*0.25
     error=toobigfile
  !else
    newfilename=!text select 1234567890azertyuiopqsdfghjklmwxcvbnAZERTYUIOPMLKJHGFDSQWXCVBN. in $wims_deposit
    ext=!replace internal . by , in $newfilename
    ext=!item -1 of $ext
    nbchar=!charcnt $newfilename
    nbext=!charcnt $ext
    !if $nbchar<4 or . notin $newfilename or $nbext<2
      error=badfilename
    !else
      newfilename=$user.$ext
      !sh cd $wims_home/sessions/$wims_session;\
          mkdir -p getfile;\
          cd getfile;\
          rm -rf tchat;\
          mkdir tchat;\
          mv $wims_home/sessions/$wims_session/user-deposit $wims_home/sessions/$wims_session/getfile/tchat/$newfilename;
    !endif
  !endif
!endif
job=edit
!changeto $job.proc