Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Interchange: cvs

interchange - racke modified 3 files

 

 

Interchange cvs RSS feed   Index | Next | Previous | View Threaded


interchange-cvs at icdevgroup

Apr 27, 2009, 3:00 AM

Post #1 of 3 (476 views)
Permalink
interchange - racke modified 3 files

User: racke
Date: 2009-04-27 10:00:17 GMT
Modified: . WHATSNEW-5.7
Modified: lib/Vend Dispatch.pm File.pm
Log:
Encoding and fallback for reading/writing files while in UTF-8 mode.

Revision Changes Path
2.40 interchange/WHATSNEW-5.7


rev 2.40, prev_rev 2.39
Index: WHATSNEW-5.7
===================================================================
RCS file: /var/lib/cvs/interchange/WHATSNEW-5.7,v
retrieving revision 2.39
retrieving revision 2.40
diff -u -r2.39 -r2.40
--- WHATSNEW-5.7 16 Apr 2009 16:58:31 -0000 2.39
+++ WHATSNEW-5.7 27 Apr 2009 10:00:17 -0000 2.40
@@ -103,6 +103,8 @@
would break sessions up into separate directories instead of putting all
sessions in a huge directory.

+* Encoding and fallback for reading/writing files while in UTF-8 mode.
+
Payment
-------




1.112 interchange/lib/Vend/Dispatch.pm


rev 1.112, prev_rev 1.111
Index: Dispatch.pm
===================================================================
RCS file: /var/lib/cvs/interchange/lib/Vend/Dispatch.pm,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -r1.111 -r1.112
--- Dispatch.pm 6 Apr 2009 12:23:22 -0000 1.111
+++ Dispatch.pm 27 Apr 2009 10:00:17 -0000 1.112
@@ -1,6 +1,6 @@
# Vend::Dispatch - Handle Interchange page requests
#
-# $Id: Dispatch.pm,v 1.111 2009-04-06 12:23:22 markj Exp $
+# $Id: Dispatch.pm,v 1.112 2009-04-27 10:00:17 racke Exp $
#
# Copyright (C) 2002-2009 Interchange Development Group
# Copyright (C) 2002 Mike Heins <mike [at] perusion>
@@ -26,7 +26,7 @@
package Vend::Dispatch;

use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.111 $, 10);
+$VERSION = substr(q$Revision: 1.112 $, 10);

use POSIX qw(strftime);
use Vend::Util;
@@ -370,7 +370,10 @@
Content-Type: $CGI::values{mv_content_type}
Content-Length: $size
EOF
- ::response( Vend::Util::readfile ($CGI::values{mv_data_file}) );
+ ::response(
+ Vend::Util::readfile($CGI::values{mv_data_file}, undef, undef,
+ {encoding => 'raw'}));
+
return 0;
}




2.31 interchange/lib/Vend/File.pm


rev 2.31, prev_rev 2.30
Index: File.pm
===================================================================
RCS file: /var/lib/cvs/interchange/lib/Vend/File.pm,v
retrieving revision 2.30
retrieving revision 2.31
diff -u -r2.30 -r2.31
--- File.pm 22 Mar 2009 19:32:31 -0000 2.30
+++ File.pm 27 Apr 2009 10:00:17 -0000 2.31
@@ -1,6 +1,6 @@
# Vend::File - Interchange file functions
#
-# $Id: File.pm,v 2.30 2009-03-22 19:32:31 mheins Exp $
+# $Id: File.pm,v 2.31 2009-04-27 10:00:17 racke Exp $
#
# Copyright (C) 2002-2008 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -61,13 +61,18 @@
use File::Copy;
use subs qw(logError logGlobal);
use vars qw($VERSION @EXPORT @EXPORT_OK $errstr);
-$VERSION = substr(q$Revision: 2.30 $, 10);
+$VERSION = substr(q$Revision: 2.31 $, 10);

sub writefile {
my($file, $data, $opt) = @_;
+ my($encoding, $fallback);

- my $is_utf8;
- $is_utf8 = is_utf8(ref $data ? $$data : $data) if $::Variable->{MV_UTF8};
+ if ($::Variable->{MV_UTF8}) {
+ $encoding = $opt->{encoding} ||= 'utf-8';
+ undef $encoding if $encoding eq 'raw';
+ $fallback = $opt->{fallback};
+ $fallback = Encode::PERLQQ unless defined $fallback;
+ }

$file = ">>$file" unless $file =~ /^[|>]/;
if (ref $opt and $opt->{umask}) {
@@ -91,7 +96,11 @@
}
# We have checked for beginning > or | previously
open(MVLOGDATA, $file) or die "open\n";
- binmode(MVLOGDATA, ":utf8") if $is_utf8;
+ if ($encoding) {
+ local $PerlIO::encoding::fallback = $fallback;
+ binmode(MVLOGDATA, ":encoding($encoding)");
+ }
+
lockfile(\*MVLOGDATA, 1, 1) or die "lock\n";
seek(MVLOGDATA, 0, 2) or die "seek\n";
if(ref $data) {
@@ -105,7 +114,10 @@
else {
my (@args) = grep /\S/, Text::ParseWords::shellwords($file);
open(MVLOGDATA, "|-") || exec @args;
- binmode(MVLOGDATA, ":utf8") if $is_utf8;
+ if ($encoding) {
+ local $PerlIO::encoding::fallback = $fallback;
+ binmode(MVLOGDATA, ":encoding($encoding)");
+ }
if(ref $data) {
print(MVLOGDATA $$data) or die "pipe to\n";
}
@@ -181,10 +193,19 @@
# the file from the database.

sub readfile {
- my($ifile, $no, $loc) = @_;
- my($contents);
+ my($ifile, $no, $loc, $opt) = @_;
+ my($contents,$encoding,$fallback);
local($/);

+ $opt ||= {};
+
+ if ($::Variable->{MV_UTF8}) {
+ $encoding = $opt->{encoding} ||= 'utf-8';
+ $fallback = $opt->{fallback};
+ $fallback = Encode::PERLQQ unless defined $fallback;
+ undef $encoding if $encoding eq 'raw';
+ }
+
unless(allowed_file($ifile)) {
log_file_violation($ifile);
return undef;
@@ -204,6 +225,7 @@
}

if(! $file) {
+
$contents = readfile_db($ifile);
return undef unless defined $contents;
}
@@ -212,7 +234,12 @@
$Global::Variable->{MV_FILE} = $file;

binmode(READIN) if $Global::Windows;
- binmode(READIN, ":utf8") if $::Variable->{MV_UTF8};
+
+ if ($encoding) {
+ local $PerlIO::encoding::fallback = Encode::PERLQQ;
+ binmode(READIN, ":encoding($encoding)");
+ }
+
undef $/;
$contents = <READIN>;
close(READIN);





_______________________________________________
interchange-cvs mailing list
interchange-cvs [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-cvs


interchange-cvs at icdevgroup

May 7, 2009, 12:34 AM

Post #2 of 3 (421 views)
Permalink
interchange - racke modified 3 files [In reply to]

User: racke
Date: 2009-05-07 07:34:40 GMT
Modified: . MANIFEST WHATSNEW-5.7
Removed: dist/standard/dbconf/sqlite component.dbm
Log:
Removed spurious SQLite database configuration file.

Revision Changes Path
2.239 interchange/MANIFEST


rev 2.239, prev_rev 2.238
Index: MANIFEST
===================================================================
RCS file: /var/cvs/interchange/MANIFEST,v
retrieving revision 2.238
retrieving revision 2.239
diff -u -r2.238 -r2.239
--- MANIFEST 16 Mar 2009 19:34:00 -0000 2.238
+++ MANIFEST 7 May 2009 07:34:40 -0000 2.239
@@ -705,7 +705,6 @@
dist/standard/dbconf/sqlite/affiliate.lite
dist/standard/dbconf/sqlite/area.lite
dist/standard/dbconf/sqlite/cat.lite
-dist/standard/dbconf/sqlite/component.dbm
dist/standard/dbconf/sqlite/country.lite
dist/standard/dbconf/sqlite/forum.lite
dist/standard/dbconf/sqlite/gift_certs.lite



2.41 interchange/WHATSNEW-5.7


rev 2.41, prev_rev 2.40
Index: WHATSNEW-5.7
===================================================================
RCS file: /var/cvs/interchange/WHATSNEW-5.7,v
retrieving revision 2.40
retrieving revision 2.41
diff -u -r2.40 -r2.41
--- WHATSNEW-5.7 27 Apr 2009 10:00:17 -0000 2.40
+++ WHATSNEW-5.7 7 May 2009 07:34:40 -0000 2.41
@@ -138,6 +138,11 @@

* Allow custom error messages for email_only check.

+Standard demo
+-------------
+
+* Removed spurious SQLite database configuration file.
+

------------------------------------------------------------------------------






_______________________________________________
interchange-cvs mailing list
interchange-cvs [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-cvs


interchange-cvs at icdevgroup

May 20, 2009, 2:39 AM

Post #3 of 3 (408 views)
Permalink
interchange - racke modified 3 files [In reply to]

User: racke
Date: 2009-05-20 09:39:19 GMT
Modified: . WHATSNEW-5.7
Modified: code/Widget uploadhelper.widget
Modified: dist/lib/UI/profiles process_filter
Log:
Allow file removal with uploadhelper widget (#180).

Revision Changes Path
2.43 interchange/WHATSNEW-5.7


rev 2.43, prev_rev 2.42
Index: WHATSNEW-5.7
===================================================================
RCS file: /var/cvs/interchange/WHATSNEW-5.7,v
retrieving revision 2.42
retrieving revision 2.43
diff -u -r2.42 -r2.43
--- WHATSNEW-5.7 20 May 2009 02:40:11 -0000 2.42
+++ WHATSNEW-5.7 20 May 2009 09:39:19 -0000 2.43
@@ -160,6 +160,11 @@

* Allow custom error messages for email_only check.

+Admin UI
+--------
+
+* Allow file removal with uploadhelper widget (#180).
+
Standard demo
-------------




1.7 interchange/code/Widget/uploadhelper.widget


rev 1.7, prev_rev 1.6
Index: uploadhelper.widget
===================================================================
RCS file: /var/cvs/interchange/code/Widget/uploadhelper.widget,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- uploadhelper.widget 17 Jul 2008 14:37:09 -0000 1.6
+++ uploadhelper.widget 20 May 2009 09:39:19 -0000 1.7
@@ -5,7 +5,7 @@
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. See the LICENSE file for details.
#
-# $Id: uploadhelper.widget,v 1.6 2008-07-17 14:37:09 racke Exp $
+# $Id: uploadhelper.widget,v 1.7 2009-05-20 09:39:19 racke Exp $

CodeDef uploadhelper Widget 1
CodeDef uploadhelper Description File upload
@@ -30,7 +30,11 @@
$out .= qq{<A HREF="$view_url">};
}
$out .= $val;
- $out .= "</A>" if $path;
+ if ($path) {
+ $out .= "</A>";
+ $out .= qq{<input type="checkbox" name="ui_upload_file_delete:$name" value="1">};
+ $out .= errmsg('Delete');
+ }
$out .= qq{&nbsp;<INPUT TYPE=file NAME="$name" VALUE="$val">
<INPUT TYPE=hidden NAME="ui_upload_file_path:$name" VALUE="$path">
<INPUT TYPE=hidden NAME="$name" VALUE="$val">};



2.4 interchange/dist/lib/UI/profiles/process_filter


rev 2.4, prev_rev 2.3
Index: process_filter
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/profiles/process_filter,v
retrieving revision 2.3
retrieving revision 2.4
diff -u -r2.3 -r2.4
--- process_filter 14 Jan 2003 02:25:53 -0000 2.3
+++ process_filter 20 May 2009 09:39:19 -0000 2.4
@@ -1,7 +1,7 @@
__NAME__ process_filter
[flag type=write table="[cgi mv_data_table]"]
[perl tables="[list-databases]"]
-# $Id: process_filter,v 2.3 2003-01-14 02:25:53 mheins Exp $
+# $Id: process_filter,v 2.4 2009-05-20 09:39:19 racke Exp $
my @filters = grep /^ui_filter:/, keys %$CGI;
FILTERS: {
last FILTERS unless @filters;
@@ -71,6 +71,20 @@
next unless defined $CGI->{$key};
$CGI->{$key} =~ s/\0(.*)//s;
my $old = $1;
+ if ($CGI->{"ui_upload_file_delete:$key"}) {
+ if ($Tag->if_mm({function => 'files', name => "$path/$old",
+ body => 1})) {
+ unless ($Tag->unlink_file("$path/$old", $path)) {
+ $Tag->error({name => "$path/$old",
+ set => 'Failed to delete file'});
+ }
+ }
+ else {
+ $Tag->error({name => "$path/$old",
+ set => 'Not allowed to delete file'});
+ }
+ $old = '';
+ }
unless($CGI->{$key}) {
$CGI->{$key} = $old;
next;
@@ -84,6 +98,7 @@
$fn =~ s,.*\\,,;
$fn = $Tag->filter('filesafe', $fn);
#Debug("cgi->$key now='$CGI->{$key}'");
+ $CGI->{$key} = $fn;
my $out = "$path/$fn";
unless ($Tag->value_extended( { name => $key, outfile => $out , yes => 1} ) ) {
$Scratch->{ui_failure} .= "\nFailed to write upload file $out";





_______________________________________________
interchange-cvs mailing list
interchange-cvs [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-cvs

Interchange cvs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.