Modify is working now. Here is what I did:
In sub validate_record:
Make sure quotes are around "$SAVE_DIRECTORY/$newdirname" in this line:
else {
opendir (GRAPHIC, "$SAVE_DIRECTORY/$newdirname") or &cgierr("unable to open directory. Reason: $!");
I had a hell of a time with this since it wasn't in there originally.
Next in sub modify_record, replace:
($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);
with:
($auth_user_field >= 0) and ($in{$auth_user_field} = $db_userid);
Replace everything between
"# Check to make sure the record passes the reg exp and null checks."
and:
"# Build the SET string to be used in the SQL query. We quote all input and int all"
with:
foreach $key (keys %in) {
if ($in{$key} eq 'delete') {
unlink "$SAVE_DIRECTORY/$in{$db_key}/$key";
}
}
$num_files=0;
if (-e "$SAVE_DIRECTORY/$in{$db_key}") {
opendir (GRAPHIC, "$SAVE_DIRECTORY/$in{$db_key}") or &cgierr("unable to open directory: $SAVE_DIRECTORY/$rec{$db_key}. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
foreach $file (@files) {
next if ($file =~ /^\./); # Skip "." and ".." entries..
next if ($file =~ /^index/); # Skip index.htm type files..
++$num_files;
}
}
if ($num_files or $in{'file-to-upload-1'}) { $in{'Graphic'} = 'Yes'; }
else { $in{'Graphic'} = ''; }
$status = &validate_record; # Check to make sure the modifications are ok!
if (($status eq "ok") && ($in{'file-to-upload-1'})) { $status = &validate_upload; } #Validate Pictures
if ($status eq "ok") {
Should be good to go with those changes!
This only took about 6 hours and 4 packs of cigs for this newbie to figure out.. lol (not kidding about the cigs!)
Guess I'm off to try getting the validate mod working.
DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)
In sub validate_record:
Make sure quotes are around "$SAVE_DIRECTORY/$newdirname" in this line:
else {
opendir (GRAPHIC, "$SAVE_DIRECTORY/$newdirname") or &cgierr("unable to open directory. Reason: $!");
I had a hell of a time with this since it wasn't in there originally.
Next in sub modify_record, replace:
($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);
with:
($auth_user_field >= 0) and ($in{$auth_user_field} = $db_userid);
Replace everything between
"# Check to make sure the record passes the reg exp and null checks."
and:
"# Build the SET string to be used in the SQL query. We quote all input and int all"
with:
foreach $key (keys %in) {
if ($in{$key} eq 'delete') {
unlink "$SAVE_DIRECTORY/$in{$db_key}/$key";
}
}
$num_files=0;
if (-e "$SAVE_DIRECTORY/$in{$db_key}") {
opendir (GRAPHIC, "$SAVE_DIRECTORY/$in{$db_key}") or &cgierr("unable to open directory: $SAVE_DIRECTORY/$rec{$db_key}. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
foreach $file (@files) {
next if ($file =~ /^\./); # Skip "." and ".." entries..
next if ($file =~ /^index/); # Skip index.htm type files..
++$num_files;
}
}
if ($num_files or $in{'file-to-upload-1'}) { $in{'Graphic'} = 'Yes'; }
else { $in{'Graphic'} = ''; }
$status = &validate_record; # Check to make sure the modifications are ok!
if (($status eq "ok") && ($in{'file-to-upload-1'})) { $status = &validate_upload; } #Validate Pictures
if ($status eq "ok") {
Should be good to go with those changes!
This only took about 6 hours and 4 packs of cigs for this newbie to figure out.. lol (not kidding about the cigs!)
Guess I'm off to try getting the validate mod working.
DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)