added deleteAllScratch routine

This commit is contained in:
Len Kranendonk 2004-07-28 09:00:34 +00:00
parent c66b30eb11
commit abb8dde6c8

View file

@ -49,6 +49,7 @@ TIP: The $session variable is a case-insensitive hash. The contents of the has v
use WebGUI::Session;
WebGUI::Session::close();
WebGUI::Session::convertVisitorToUser($sessionId,$userId);
WebGUI::Session::deleteAllScratch($name);
WebGUI::Session::deleteScratch($name);
WebGUI::Session::end($sessionId);
WebGUI::Session::open($webguiRoot,$configFilename);
@ -223,6 +224,29 @@ sub convertVisitorToUser {
#-------------------------------------------------------------------
=head2 deleteAllScratch ( name )
Deletes a scratch variable for all users. This function should be used with care.
=over
=item name
The name of the scratch variable.
=back
=cut
sub deleteAllScratch {
my ($name) = @_;
return "" if ($name eq "");
WebGUI::SQL->write("delete from userSessionScratch where name=".quote($name));
$session{scratch}{$name} = "";
}
#-------------------------------------------------------------------
=head2 deleteScratch ( name )
Deletes a scratch variable.