|
From: <ix...@us...> - 2002-01-04 00:33:53
|
ixjonez 02/01/03 16:33:52
Modified: lib/LiveFrame/Lab Tag: XÚ `¶@h¶@h¶@¸ ¸ àz P ÀQ
ÀQ @¹ @¹ ¶@¶@P¸ P¸
¶@ ¶@¨¶@¨¶@°¶@°¶@¸¸ ¸¸ À¶@À¶@ȶ@ȶ@´
´ ض@ض@à¶@à¶@è¶@è¶@ð¶@ð¶@ø¶@ø¶@
/tmp/cvs-serv13287/lib/LiveFrame/Lab/StartForm.pm
No tag StartForm.pm
Log:
untaint site_dir so it can be used for filesystem commands. create the
specified site if it does not already exist so that its order file can
be listed on the spec page.
Revision Changes Path
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
1.3 +17 -0 lab/lib/LiveFrame/Lab/StartForm.pm
Index: /tmp/cvs-serv13287/lib/LiveFrame/Lab/StartForm.pm
===================================================================
RCS file: /cvsroot/liveframe/lab/lib/LiveFrame/Lab/StartForm.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /tmp/cvs-serv13287/lib/LiveFrame/Lab/StartForm.pm 2001/12/02 12:45:22 1.2
+++ /tmp/cvs-serv13287/lib/LiveFrame/Lab/StartForm.pm 2002/01/04 00:33:52 1.3
@@ -34,6 +34,23 @@
$errors->add_error('upload_directory not specified');
die $errors;
}
+
+ # untaint $site_dir so the directory can be created if necessary.
+ # XXX: what characters would be considered unsafe? all valid UTF-8
+ # should be allowed
+ ($site_dir) = ($site_dir =~ /(.+)/);
+
+ # pre-create the site if necessary, so that gallery ordering will
+ # work on the next page
+ my $site = LiveFrame::Site->new($site_dir);
+ unless ($site->exists()) {
+ eval { $site->create() };
+ if ($@) {
+ my $errors = LiveFrame::Errors->new();
+ $errors->add_error("problem creating site: $@");
+ die $errors;
+ }
+ }
}
1;
No revision
No revision
1.3 +17 -0 lab/lib/LiveFrame/Lab/StartForm.pm
Index: StartForm.pm
===================================================================
RCS file: /cvsroot/liveframe/lab/lib/LiveFrame/Lab/StartForm.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StartForm.pm 2001/12/02 12:45:22 1.2
+++ StartForm.pm 2002/01/04 00:33:52 1.3
@@ -34,6 +34,23 @@
$errors->add_error('upload_directory not specified');
die $errors;
}
+
+ # untaint $site_dir so the directory can be created if necessary.
+ # XXX: what characters would be considered unsafe? all valid UTF-8
+ # should be allowed
+ ($site_dir) = ($site_dir =~ /(.+)/);
+
+ # pre-create the site if necessary, so that gallery ordering will
+ # work on the next page
+ my $site = LiveFrame::Site->new($site_dir);
+ unless ($site->exists()) {
+ eval { $site->create() };
+ if ($@) {
+ my $errors = LiveFrame::Errors->new();
+ $errors->add_error("problem creating site: $@");
+ die $errors;
+ }
+ }
}
1;
|