From: Jan T. <de...@us...> - 2002-09-24 22:22:05
|
Update of /cvsroot/net-script/netscript2/src/perl/NetScript/Libraries In directory usw-pr-cvs1:/tmp/cvs-serv18815 Modified Files: ControlStructuresLibrary.pm FormsLibrary.pm StringsLibrary.pm Log Message: * added documentation Index: ControlStructuresLibrary.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Libraries/ControlStructuresLibrary.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ControlStructuresLibrary.pm 14 Aug 2002 22:23:35 -0000 1.9 --- ControlStructuresLibrary.pm 24 Sep 2002 22:22:03 -0000 1.10 *************** *** 473,476 **** --- 473,484 ---- $fileURL = $this -> checkURL( $fileURL ); + if ( $fileURL =~ /^http:/ || $fileURL =~ /^ftp:/ ) { + unless ( $this -> interpreter() -> getConfig() -> getSetting( "ALLOW_REMOTE_SCRIPTS" ) =~ /yes/ ) { + $this -> getEventRelay() -> createAndRaiseEvent( + $NetScript::Interpreter::FATAL_EVENT, + "Cannot import $fileURL,\n local security settings forbid to import scripts from foreign hosts!" ); + } + } + my $fileData = $this -> interpreter() -> getFileRetriever() -> retrieveFile( $fileURL ); Index: FormsLibrary.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Libraries/FormsLibrary.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FormsLibrary.pm 18 Sep 2002 13:20:09 -0000 1.6 --- FormsLibrary.pm 24 Sep 2002 22:22:03 -0000 1.7 *************** *** 27,33 **** # Use it like this: # <pre> ! # <ns:cookie name="<cookie name>" val="<cookie value>" ! # expires="<expire date>"/> # </pre> #*/ package NetScript::Libraries::FormsLibrary; --- 27,57 ---- # Use it like this: # <pre> ! # <ns:cookie name="<cookie name>" val="<cookie value>" expires="<expire date>"/> # </pre> + # + # You can upload files using the upload-function. + # <pre> + # <ns:upload parameter="<parameter>" directory="<directory>" + # [filename="<filename>"] [limit="<limit>"] + # [bytes="<bytes>"] [file="<file>"] + # [mode="<DELETE_ON_FAIL|KEEP_ON_FAIL>"] [overwrite="<yes|no>"]/> + # </pre> + # Uploads the file which has been sent with the parameter <parameter> to + # the specified <directory> on the server. You can rename the filename + # on the server by specifying the new filename in <filename>. You can + # set a maximum filesize in bytes with <limit>. You can specify a variable + # name in <bytes>. This variable will receive the number of uploaded bytes. + # You can specify a variable name in <file>, this will receive the filename on + # the server.You can specify if the file on the server should be deleted if + # it exceeds the maximum limit (DELETE_ON_FAIL), or if it should be kept. + # Default is KEEP_ON_FAIL. You can also specify if the file should be overwritten + # if it already exists. The bytes-variable returns: + # <ul> + # <li>-3 - if the parameter contained no file</li> + # <li>-2 - if the file exists on the server and overwrite is not "yes"</li> + # <li>-1 - if any other error occured</li> + # </ul> + # + # #*/ package NetScript::Libraries::FormsLibrary; *************** *** 190,208 **** #* bytes and the filename on the server into file. Number of written bytes is #* -1 if an error occured. ! # ! #* Attribute: parameter - name of the parameter, which contains the file ! #* Attribute: directory - location on the server where the file should be copied to ! #* Attribute: filename - optional, the name of file as it should be stored on the server ! #* Attribute: limit - optional, the maximum number of 1k-blocks that should be uploaded ! #* Attribute: bytes- optional, the name of the variable, where the number of read bytes is stored into ! #* Attribute: file - optional, the name of the variable, where the filename on the server should be stored into. ! #* Attribute: mode - optional, one of the following modes: ! #* DELETE_ON_FAIL - default, if file exceeds the set limit, file is deleted on the server. ! #* KEEP_ON_FAIL - file is kept, even if it was cut down to the set limit ! #* Attribute: overwrite - optional, set to yes if existing files should be overwritten, set to no ! #* if existing files should not be overwritten. If omitted, existing files will ! #* NOT be overwritten. If file exists and overwrite is set to no, then ! #* the value in bytes will be set to -2 and the function will return. ! #* sub doUpload { my ( $this, $node, $domWalker ) = @_; --- 214,218 ---- #* bytes and the filename on the server into file. Number of written bytes is #* -1 if an error occured. ! #*/ sub doUpload { my ( $this, $node, $domWalker ) = @_; Index: StringsLibrary.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Libraries/StringsLibrary.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StringsLibrary.pm 14 Aug 2002 22:23:35 -0000 1.1 --- StringsLibrary.pm 24 Sep 2002 22:22:03 -0000 1.2 *************** *** 20,26 **** # </pre> # <pre> ! # <ns:split string="{any string}" delim="{a delimiter regexp}" # var|name="var1 [var2 var3 ...]"/> ! # <pre> # Splits the given string using the given delimiter and puts the # substrings into the given variables. If there is only one variable name --- 20,26 ---- # </pre> # <pre> ! # <str:split string="{any string}" delim="{a delimiter regexp}" # var|name="var1 [var2 var3 ...]"/> ! # </pre> # Splits the given string using the given delimiter and puts the # substrings into the given variables. If there is only one variable name *************** *** 28,32 **** # variable name. # <pre> ! # <ns:replace string="{any string}" search="{a regexp}" # replace="{a string containg backreferences}" var|name="var1"/> # </pre> --- 28,32 ---- # variable name. # <pre> ! # <str:replace string="{any string}" search="{a regexp}" # replace="{a string containg backreferences}" var|name="var1"/> # </pre> |