]>
git.p6c8.net - devedit.git/blob - modules/Command.pm
8e4716365ea22c0c082755da4f0fc7bb8b205db5
4 # Dev-Editor - Module Command
6 # Execute Dev-Editor's commands
8 # Author: Patrick Canterino <patshaping@gmx.net>
9 # Last modified: 2004-07-28
20 use POSIX qw(strftime);
28 my $script = $ENV{'SCRIPT_NAME'};
29 my $users = eval("getpwuid(0)") && eval("getgrgid(0)");
31 my %dispatch = ('show' => \
&exec_show
,
32 'beginedit' => \
&exec_beginedit
,
33 'canceledit' => \
&exec_canceledit
,
34 'endedit' => \
&exec_endedit
,
35 'mkdir' => \
&exec_mkdir
,
36 'mkfile' => \
&exec_mkfile
,
37 'upload' => \
&exec_upload
,
38 'copy' => \
&exec_copy
,
39 'rename' => \
&exec_rename
,
40 'remove' => \
&exec_remove
,
41 'chprop' => \
&exec_chprop
,
42 'unlock' => \
&exec_unlock
,
43 'about' => \
&exec_about
48 use base
qw(Exporter);
50 @EXPORT = qw(exec_command);
54 # Execute the specified command
56 # Params: 1. Command to execute
57 # 2. Reference to user input hash
58 # 3. Reference to config hash
60 # Return: Output of the command (Scalar Reference)
64 my ($command,$data,$config) = @_;
66 foreach(keys(%dispatch))
68 if(lc($_) eq lc($command))
70 my $output = &{$dispatch{$_}}($data,$config);
75 return error
($config->{'errors'}->{'cmd_unknown'},'/',{COMMAND
=> $command});
80 # View a directory or a file
82 # Params: 1. Reference to user input hash
83 # 2. Reference to config hash
85 # Return: Output of the command (Scalar Reference)
89 my ($data,$config) = @_;
90 my $physical = $data->{'physical'};
91 my $virtual = $data->{'virtual'};
92 my $uselist = $data->{'uselist'};
94 my $tpl = new Template
;
98 # Create directory listing
100 my $direntries = dir_read
($physical);
101 return error
($config->{'dir_read_failed'},upper_path
($virtual),{DIR
=> '$virtual'}) unless($direntries);
103 my $files = $direntries->{'files'};
104 my $dirs = $direntries->{'dirs'};
108 # Create the link to the upper directory
109 # (only if we are not in the root directory)
111 unless($virtual eq "/")
113 my @stat = stat($physical."/..");
115 my $udtpl = new Template
;
116 $udtpl->read_file($config->{'templates'}->{'dirlist_up'});
118 $udtpl->fillin("UPPER_DIR",encode_entities
(upper_path
($virtual)));
119 $udtpl->fillin("DATE",strftime
($config->{'timeformat'},localtime($stat[9])));
121 $dirlist .= $udtpl->get_template;
126 foreach my $dir(@
$dirs)
128 my @stat = stat($physical."/".$dir);
129 my $virt_path = encode_entities
($virtual.$dir."/");
131 my $dtpl = new Template
;
132 $dtpl->read_file($config->{'templates'}->{'dirlist_dir'});
134 $dtpl->fillin("DIR",$virt_path);
135 $dtpl->fillin("DIR_NAME",$dir);
136 $dtpl->fillin("DATE",strftime
($config->{'timeformat'},localtime($stat[9])));
137 $dtpl->fillin("URL",equal_url
($config->{'httproot'},$virt_path));
139 $dtpl->parse_if_block("users",$users && -o
$physical."/".$dir);
141 $dirlist .= $dtpl->get_template;
146 foreach my $file(@
$files)
148 my $phys_path = $physical."/".$file;
149 my $virt_path = encode_entities
($virtual.$file);
151 my @stat = stat($phys_path);
152 my $in_use = $uselist->in_use($virtual.$file);
154 my $ftpl = new Template
;
155 $ftpl->read_file($config->{'templates'}->{'dirlist_file'});
157 $ftpl->fillin("FILE",$virt_path);
158 $ftpl->fillin("FILE_NAME",$file);
159 $ftpl->fillin("SIZE",$stat[7]);
160 $ftpl->fillin("DATE",strftime
($config->{'timeformat'},localtime($stat[9])));
161 $ftpl->fillin("URL",equal_url
($config->{'httproot'},$virt_path));
163 $ftpl->parse_if_block("not_readable",not -r
$phys_path);
164 $ftpl->parse_if_block("binary",-B
$phys_path);
165 $ftpl->parse_if_block("readonly",not -w
$phys_path);
167 $ftpl->parse_if_block("viewable",-r
$phys_path && -T
$phys_path && not ($config->{'max_file_size'} && $stat[7] > $config->{'max_file_size'}));
169 $ftpl->parse_if_block("editable",-r
$phys_path && -w
$phys_path && -T
$phys_path && not ($config->{'max_file_size'} && $stat[7] > $config->{'max_file_size'}) && not $in_use);
171 $ftpl->parse_if_block("in_use",$in_use);
172 $ftpl->parse_if_block("unused",not $in_use);
174 $ftpl->parse_if_block("too_large",$config->{'max_file_size'} && $stat[7] > $config->{'max_file_size'});
176 $ftpl->parse_if_block("users",$users && -o
$phys_path);
178 $dirlist .= $ftpl->get_template;
181 $tpl->read_file($config->{'templates'}->{'dirlist'});
183 $tpl->fillin("DIRLIST",$dirlist);
184 $tpl->fillin("DIR",$virtual);
185 $tpl->fillin("SCRIPT",$script);
186 $tpl->fillin("URL",equal_url
($config->{'httproot'},$virtual));
192 return error
($config->{'errors'}->{'noview'},upper_path
($virtual)) unless(-r
$physical);
194 # Check on binary files
195 # We have to do it in this way, or empty files
196 # will be recognized as binary files
202 return error
($config->{'errors'}->{'binary'},upper_path
($virtual));
208 my $size = (stat($physical))[7];
210 if($config->{'max_file_size'} && $size > $config->{'max_file_size'})
212 return error
($config->{'errors'}->{'file_too_large'},upper_path
($virtual),{SIZE
=> $config->{'max_file_size'}})
216 my $content = file_read
($physical);
217 $$content =~ s/\015\012|\012|\015/\n/g;
219 $tpl->read_file($config->{'templates'}->{'viewfile'});
221 $tpl->fillin("FILE",$virtual);
222 $tpl->fillin("DIR",upper_path
($virtual));
223 $tpl->fillin("URL",equal_url
($config->{'httproot'},$virtual));
224 $tpl->fillin("SCRIPT",$script);
225 $tpl->fillin("CONTENT",encode_entities
($$content));
227 $tpl->parse_if_block("editable",-r
$physical && -w
$physical && -T
$physical && not ($config->{'max_file_size'} && $size > $config->{'max_file_size'}) && $uselist->unused($virtual));
232 my $output = header
(-type
=> "text/html");
233 $output .= $tpl->get_template;
240 # Lock a file and display a form to edit it
242 # Params: 1. Reference to user input hash
243 # 2. Reference to config hash
245 # Return: Output of the command (Scalar Reference)
247 sub exec_beginedit
($$)
249 my ($data,$config) = @_;
250 my $physical = $data->{'physical'};
251 my $virtual = $data->{'virtual'};
252 my $uselist = $data->{'uselist'};
254 return error
($config->{'errors'}->{'editdir'},upper_path
($virtual)) if(-d
$physical);
255 return error
($config->{'errors'}->{'in_use'},upper_path
($virtual),{FILE
=> $virtual}) if($uselist->in_use($virtual));
256 return error
($config->{'errors'}->{'noedit'},upper_path
($virtual)) unless(-r
$physical && -w
$physical);
258 # Check on binary files
264 return error
($config->{'errors'}->{'binary'},upper_path
($virtual));
268 if($config->{'max_file_size'} && (stat($physical))[7] > $config->{'max_file_size'})
270 return error
($config->{'errors'}->{'file_too_large'},upper_path
($virtual),{SIZE
=> $config->{'max_file_size'}})
276 $uselist->add_file($virtual);
279 my $content = file_read
($physical);
280 $$content =~ s/\015\012|\012|\015/\n/g;
282 my $tpl = new Template
;
283 $tpl->read_file($config->{'templates'}->{'editfile'});
285 $tpl->fillin("FILE",$virtual);
286 $tpl->fillin("DIR",upper_path
($virtual));
287 $tpl->fillin("URL",equal_url
($config->{'httproot'},$virtual));
288 $tpl->fillin("SCRIPT",$script);
289 $tpl->fillin("CONTENT",encode_entities
($$content));
291 my $output = header
(-type
=> "text/html");
292 $output .= $tpl->get_template;
303 # Params: 1. Reference to user input hash
304 # 2. Reference to config hash
306 # Return: Output of the command (Scalar Reference)
308 sub exec_canceledit
($$)
310 my ($data,$config) = @_;
311 my $virtual = $data->{'virtual'};
313 file_unlock
($data->{'uselist'},$virtual);
314 return devedit_reload
({command
=> 'show', file
=> upper_path
($virtual)});
319 # Save a file, unlock it and return to directory view
321 # Params: 1. Reference to user input hash
322 # 2. Reference to config hash
324 # Return: Output of the command (Scalar Reference)
328 my ($data,$config) = @_;
329 my $physical = $data->{'physical'};
330 my $virtual = $data->{'virtual'};
331 my $content = $data->{'cgi'}->param('filecontent');
332 my $uselist = $data->{'uselist'};
336 $content =~ s/\015\012|\012|\015/\n/g;
338 if($data->{'cgi'}->param('encode_iso'))
340 # Encode all ISO-8859-1 special chars
342 $content = encode_entities
($content,"\200-\377");
345 if($data->{'cgi'}->param('saveas'))
347 # Create the new filename
349 $physical = $data->{'new_physical'};
350 $virtual = $data->{'new_virtual'};
352 # Check if someone else is editing the new file
354 return error
($config->{'errors'}->{'in_use'},upper_path
($virtual),{FILE
=> $virtual}) if($uselist->in_use($virtual));
357 return error
($config->{'errors'}->{'editdir'},upper_path
($virtual)) if(-d
$physical);
358 return error
($config->{'errors'}->{'noedit'}, upper_path
($virtual)) unless(-r
$physical && -w
$physical);
360 if(file_save
($physical,\
$content))
362 # Saving of the file was successful - so unlock it!
364 file_unlock
($uselist,$data->{'virtual'});
366 # Maybe the user saved the file using another filename...
367 # But we have to unlock the original file!
369 return devedit_reload
({command
=> 'show', file
=> upper_path
($virtual)});
373 return error
($config->{'errors'}->{'edit_failed'},upper_path
($virtual),{FILE
=> $virtual});
379 # Create a file and return to directory view
381 # Params: 1. Reference to user input hash
382 # 2. Reference to config hash
384 # Return: Output of the command (Scalar Reference)
388 my ($data,$config) = @_;
389 my $new_physical = $data->{'new_physical'};
390 my $new_virtual = $data->{'new_virtual'};
391 my $dir = upper_path
($new_virtual);
392 $new_virtual = encode_entities
($new_virtual);
396 return error
($config->{'errors'}->{'file_exists'},$dir,{FILE
=> $new_virtual}) if(-e
$new_physical);
398 file_create
($new_physical) or return error
($config->{'errors'}->{'mkfile_failed'},$dir,{FILE
=> $new_virtual});
399 return devedit_reload
({command
=> 'show', file
=> $dir});
403 my $tpl = new Template
;
404 $tpl->read_file($config->{'templates'}->{'mkfile'});
406 $tpl->fillin("DIR","/");
407 $tpl->fillin("SCRIPT",$script);
409 my $output = header
(-type
=> "text/html");
410 $output .= $tpl->get_template;
418 # Create a directory and return to directory view
420 # Params: 1. Reference to user input hash
421 # 2. Reference to config hash
423 # Return: Output of the command (Scalar Reference)
427 my ($data,$config) = @_;
428 my $new_physical = $data->{'new_physical'};
429 my $new_virtual = $data->{'new_virtual'};
430 my $dir = upper_path
($new_virtual);
431 $new_virtual = encode_entities
($new_virtual);
433 return error
($config->{'errors'}->{'file_exists'},$dir,{FILE
=> $new_virtual}) if(-e
$new_physical);
437 mkdir($new_physical,0777) or return error
($config->{'errors'}->{'mkdir_failed'},$dir,{DIR
=> $new_virtual});
438 return devedit_reload
({command
=> 'show', file
=> $dir});
442 my $tpl = new Template
;
443 $tpl->read_file($config->{'templates'}->{'mkdir'});
445 $tpl->fillin("DIR","/");
446 $tpl->fillin("SCRIPT",$script);
448 my $output = header
(-type
=> "text/html");
449 $output .= $tpl->get_template;
459 # Params: 1. Reference to user input hash
460 # 2. Reference to config hash
462 # Return: Output of the command (Scalar Reference)
466 my ($data,$config) = @_;
467 my $physical = $data->{'physical'};
468 my $virtual = $data->{'virtual'};
469 my $cgi = $data->{'cgi'};
471 if(my $uploaded_file = $cgi->param('uploaded_file'))
473 # Process file upload
475 my $filename = file_name
($uploaded_file);
476 my $file_phys = $physical."/".$filename;
477 my $file_virt = $virtual."".$filename;
479 return error
($config->{'errors'}->{'file_exists'},$virtual,{FILE
=> $file_virt}) if(-e
$file_phys);
481 my $ascii = $cgi->param('ascii');
482 my $handle = $cgi->upload('uploaded_file');
486 open(FILE
,">$file_phys") or return error
($config->{'errors'}->{'mkfile_failed'},$virtual,{FILE
=> $file_virt});
487 binmode(FILE
) unless($ascii);
489 # Read transferred file and write it to disk
491 read($handle, my $data, -s
$handle);
492 $data =~ s/\015\012|\012|\015/\n/g if($ascii); # Replace line separators if transferring in ASCII mode
497 return devedit_reload
({command
=> "show", file
=> $virtual});
501 my $tpl = new Template
;
502 $tpl->read_file($config->{'templates'}->{'upload'});
504 $tpl->fillin("DIR",$virtual);
505 $tpl->fillin("URL",equal_url
($config->{'httproot'},$virtual));
506 $tpl->fillin("SCRIPT",$script);
508 my $output = header
(-type
=> "text/html");
509 $output .= $tpl->get_template;
517 # Copy a file and return to directory view
519 # Params: 1. Reference to user input hash
520 # 2. Reference to config hash
522 # Return: Output of the command (Scalar Reference)
526 my ($data,$config) = @_;
527 my $physical = $data->{'physical'};
528 my $virtual = encode_entities
($data->{'virtual'});
529 my $new_physical = $data->{'new_physical'};
531 return error
($config->{'errors'}->{'nocopy'}) unless(-r
$physical);
535 my $new_virtual = $data->{'new_virtual'};
536 my $dir = upper_path
($new_virtual);
537 $new_virtual = encode_entities
($new_virtual);
541 return error
($config->{'errors'}->{'exist_edited'},$dir,{FILE
=> $new_virtual}) if($data->{'uselist'}->in_use($data->{'new_virtual'}));
545 return error
($config->{'errors'}->{'dircopy'});
547 elsif(not $data->{'cgi'}->param('confirmed'))
549 my $tpl = new Template
;
550 $tpl->read_file($config->{'templates'}->{'confirm_replace'});
552 $tpl->fillin("FILE",$virtual);
553 $tpl->fillin("NEW_FILE",$new_virtual);
554 $tpl->fillin("NEW_FILENAME",file_name
($new_virtual));
555 $tpl->fillin("NEW_DIR",$dir);
556 $tpl->fillin("DIR",upper_path
($virtual));
558 $tpl->fillin("COMMAND","copy");
559 $tpl->fillin("URL",equal_url
($config->{'httproot'},$virtual));
560 $tpl->fillin("SCRIPT",$script);
562 my $output = header
(-type
=> "text/html");
563 $output .= $tpl->get_template;
569 copy
($physical,$new_physical) or return error
($config->{'errors'}->{'copy_failed'},upper_path
($virtual),{FILE
=> $virtual, NEW_FILE
=> $new_virtual});
570 return devedit_reload
({command
=> 'show', file
=> $dir});
574 my $tpl = new Template
;
575 $tpl->read_file($config->{'templates'}->{'copyfile'});
577 $tpl->fillin("FILE",$virtual);
578 $tpl->fillin("DIR",upper_path
($virtual));
579 $tpl->fillin("URL",equal_url
($config->{'httproot'},$virtual));
580 $tpl->fillin("SCRIPT",$script);
582 my $output = header
(-type
=> "text/html");
583 $output .= $tpl->get_template;
591 # Rename/move a file and return to directory view
593 # Params: 1. Reference to user input hash
594 # 2. Reference to config hash
596 # Return: Output of the command (Scalar Reference)
600 my ($data,$config) = @_;
601 my $physical = $data->{'physical'};
602 my $virtual = $data->{'virtual'};
603 my $new_physical = $data->{'new_physical'};
605 return error
($config->{'errors'}->{'rename_root'},"/") if($virtual eq "/");
606 return error
($config->{'errors'}->{'in_use'},upper_path
($virtual),{FILE
=> $virtual}) if($data->{'uselist'}->in_use($virtual));
610 my $new_virtual = $data->{'new_virtual'};
611 my $dir = upper_path
($new_virtual);
612 $new_virtual = encode_entities
($new_virtual);
616 return error
($config->{'errors'}->{'exist_edited'},$dir,{FILE
=> $new_virtual}) if($data->{'uselist'}->in_use($data->{'new_virtual'}));
620 return error
($config->{'errors'}->{'dircopy'});
622 elsif(not $data->{'cgi'}->param('confirmed'))
624 my $tpl = new Template
;
625 $tpl->read_file($config->{'templates'}->{'confirm_replace'});
627 $tpl->fillin("FILE",$virtual);
628 $tpl->fillin("NEW_FILE",$new_virtual);
629 $tpl->fillin("NEW_FILENAME",file_name
($new_virtual));
630 $tpl->fillin("NEW_DIR",$dir);
631 $tpl->fillin("DIR",upper_path
($virtual));
633 $tpl->fillin("COMMAND","rename");
634 $tpl->fillin("URL",equal_url
($config->{'httproot'},$virtual));
635 $tpl->fillin("SCRIPT",$script);
637 my $output = header
(-type
=> "text/html");
638 $output .= $tpl->get_template;
644 rename($physical,$new_physical) or return error
($config->{'errors'}->{'rename_failed'},upper_path
($virtual),{FILE
=> $virtual, NEW_FILE
=> $new_virtual});
645 return devedit_reload
({command
=> 'show', file
=> $dir});
649 my $tpl = new Template
;
650 $tpl->read_file($config->{'templates'}->{'renamefile'});
652 $tpl->fillin("FILE",$virtual);
653 $tpl->fillin("DIR",upper_path
($virtual));
654 $tpl->fillin("URL",equal_url
($config->{'httproot'},$virtual));
655 $tpl->fillin("SCRIPT",$script);
657 my $output = header
(-type
=> "text/html");
658 $output .= $tpl->get_template;
666 # Remove a file or a directory and return to directory view
668 # Params: 1. Reference to user input hash
669 # 2. Reference to config hash
671 # Return: Output of the command (Scalar Reference)
675 my ($data,$config) = @_;
676 my $physical = $data->{'physical'};
677 my $virtual = $data->{'virtual'};
679 return error
($config->{'errors'}->{'remove_root'},"/") if($virtual eq "/");
685 if($data->{'cgi'}->param('confirmed'))
688 return devedit_reload
({command
=> 'show', file
=> upper_path
($virtual)});
692 my $tpl = new Template
;
693 $tpl->read_file($config->{'templates'}->{'confirm_rmdir'});
695 $tpl->fillin("DIR",$virtual);
696 $tpl->fillin("UPPER_DIR",upper_path
($virtual));
697 $tpl->fillin("URL",equal_url
($config->{'httproot'},$virtual));
698 $tpl->fillin("SCRIPT",$script);
700 my $output = header
(-type
=> "text/html");
701 $output .= $tpl->get_template;
710 return error
($config->{'errors'}->{'in_use'},upper_path
($virtual),{FILE
=> $virtual}) if($data->{'uselist'}->in_use($virtual));
712 if($data->{'cgi'}->param('confirmed'))
714 unlink($physical) or return error
($config->{'errors'}->{'delete_failed'},upper_path
($virtual),{FILE
=> $virtual});
715 return devedit_reload
({command
=> 'show', file
=> upper_path
($virtual)});
719 my $tpl = new Template
;
720 $tpl->read_file($config->{'templates'}->{'confirm_rmfile'});
722 $tpl->fillin("FILE",$virtual);
723 $tpl->fillin("DIR",upper_path
($virtual));
724 $tpl->fillin("URL",equal_url
($config->{'httproot'},$virtual));
725 $tpl->fillin("SCRIPT",$script);
727 my $output = header
(-type
=> "text/html");
728 $output .= $tpl->get_template;
737 # Change the mode and the group of a file or a directory
739 # Params: 1. Reference to user input hash
740 # 2. Reference to config hash
742 # Return: Output of the command (Scalar Reference)
746 my ($data,$config) = @_;
747 my $physical = $data->{'physical'};
748 my $virtual = $data->{'virtual'};
749 my $dir = upper_path
($virtual);
750 my $cgi = $data->{'cgi'};
751 my $mode = $cgi->param('mode');
752 my $group = $cgi->param('group');
762 my $oct_mode = $mode;
763 $oct_mode = "0".$oct_mode if(length($oct_mode) == 3);
764 $oct_mode = oct($oct_mode);
766 chmod($oct_mode,$physical);
769 chgrp
($group,$physical) if($group);
771 return devedit_reload
({command
=> 'show', file
=> $dir});
775 my @stat = lstat($physical);
778 my $mode_oct = substr(sprintf("%04o",$mode),-4);
780 my $group = getgrgid($gid);
782 my $tpl = new Template
;
783 $tpl->read_file($config->{'templates'}->{'chprop'});
785 $tpl->fillin("MODE_OCTAL",$mode_oct);
786 $tpl->fillin("MODE_STRING",mode_string
($mode));
787 $tpl->fillin("GID",$gid);
788 $tpl->fillin("GROUP",$group);
790 $tpl->fillin("FILE",$virtual);
791 $tpl->fillin("DIR",$dir);
792 $tpl->fillin("URL",equal_url
($config->{'httproot'},$virtual));
793 $tpl->fillin("SCRIPT",$script);
795 my $output = header
(-type
=> "text/html");
796 $output .= $tpl->get_template;
803 return error
($config->{'errors'}->{'not_owner'},$dir,{FILE
=> $virtual});
808 return error
($config->{'errors'}->{'no_users'},$dir,{FILE
=> $virtual});
814 # Remove a file from the list of used files and
815 # return to directory view
817 # Params: 1. Reference to user input hash
818 # 2. Reference to config hash
820 # Return: Output of the command (Scalar Reference)
824 my ($data,$config) = @_;
825 my $virtual = $data->{'virtual'};
827 if($data->{'cgi'}->param('confirmed'))
829 file_unlock
($data->{'uselist'},$virtual);
830 return devedit_reload
({command
=> 'show', file
=> upper_path
($virtual)});
834 my $tpl = new Template
;
835 $tpl->read_file($config->{'templates'}->{'confirm_unlock'});
837 $tpl->fillin("FILE",$virtual);
838 $tpl->fillin("DIR",upper_path
($virtual));
839 $tpl->fillin("URL",equal_url
($config->{'httproot'},$virtual));
840 $tpl->fillin("SCRIPT",$script);
842 my $output = header
(-type
=> "text/html");
843 $output .= $tpl->get_template;
851 # Display some information about Dev-Editor
853 # Params: 1. Reference to user input hash
854 # 2. Reference to config hash
856 # Return: Output of the command (Scalar Reference)
860 my ($data,$config) = @_;
862 my $tpl = new Template
;
863 $tpl->read_file($config->{'templates'}->{'about'});
865 $tpl->fillin("SCRIPT",$script);
867 # Dev-Editor's version number
869 $tpl->fillin("VERSION",$data->{'version'});
871 # Some path information
873 $tpl->fillin("SCRIPT_PHYS",$ENV{'SCRIPT_FILENAME'});
874 $tpl->fillin("CONFIG_PATH",$data->{'configfile'});
875 $tpl->fillin("FILE_ROOT",$config->{'fileroot'});
876 $tpl->fillin("HTTP_ROOT",$config->{'httproot'});
880 $tpl->fillin("PERL_PROG",$^X
);
881 $tpl->fillin("PERL_VER",sprintf("%vd",$^V
));
883 # Information about the server
885 $tpl->fillin("HTTPD",$ENV{'SERVER_SOFTWARE'});
886 $tpl->fillin("OS",$^O
);
887 $tpl->fillin("TIME",strftime
($config->{'timeformat'},localtime));
889 # Process information
891 $tpl->fillin("PID",$$);
893 # Check if the functions getpwuid() and getgrgid() are available
897 # Dev-Editor is running on a system which allows users and groups
898 # So we display the user and the group of our process
900 $tpl->parse_if_block("users",1);
902 # ID's of user and group
904 $tpl->fillin("UID",$<);
905 $tpl->fillin("GID",$();
907 # Names of user and group
909 $tpl->fillin("USER",getpwuid($<));
910 $tpl->fillin("GROUP",getgrgid($());
914 $tpl->parse_if_block("users",0);
917 my $output = header
(-type
=> "text/html");
918 $output .= $tpl->get_template;
923 # it's true, baby ;-)
patrick-canterino.de