Difference: TWikiScripts (1 vs. 16)

Revision 162015-07-07 - TWikiContributor

Line: 1 to 1
 

TWiki CGI and Command Line Scripts

Line: 8 to 8
 
Added:
>
>
 

CGI Scripts

Details on CGI scripts located in the twiki/bin directory.

Added:
>
>
 

General Information

Added:
>
>
 

CGI environment

In the CGI environment parameters are passed to the scripts via the URL and URL parameters. Environment variables are also used to determine the user performing the action. If the environment is not set up, the default TWiki user is used (usually guest).

Added:
>
>
 

Command-line

You must have the twiki/bin directory on the perl path to run the scripts from the command line. To avoid issues with file permissions, run the scripts as the web server user such as nobody or www.

Line: 25 to 29
 Parameters are passed on the command line using '-name' - for example,
$ cd /usr/local/twiki/bin
Changed:
<
<
$ save -topic MyTopic -user admin -action save -text "New text of the topic"
>
>
$ save -topic MyTopic -user admin -method POST -action save -text "New text of the topic"
  All parameters require a value, even if that is the empty string.
Added:
>
>
 

Common parameters

All the scripts accept a number of common parameters. The first two components of the URL after the script name are taken as the web and the topic, respectively. Standard URL parameters are:

Parameter Description Default
topic If this is set to a URL, TWiki will immediately redirect to that URL. Otherwise it overrides the URL and is taken as the topic name (you can pass Web.TopicName)  
Changed:
<
<
user Command-line only; set the name of the user performing the action. Note: this usage is inherently insecure, as it bypasses webserver login constraints. For this reason only authorized users should be allowed to execute scripts from the command line.  
>
>
user Command-line only; set the name of the user performing the action. Note: this usage is inherently insecure, as it bypasses webserver login constraints. For this reason only authorized users should be allowed to execute scripts from the command line. TWikiAdminGroup
method Commad-line only; set the HTTP request method. Some scripts requires the POST method under certain circumstances. In such a case, you need to specify the POST method to run the script from a command line. GET
 
skin Overrides the default skin path (see TWikiSkins)  
cover Specifies temporary skin path to prepend to the skin path for this script only (see TWikiSkins)  
Added:
>
>
 

attach

Despite the name, this script doesn't actually attach a file to a topic - for that, use upload. This script is part of the transactions sequence executed when a file is uploaded from the browser. it just generates the "new attachment" page for a topic.

Line: 46 to 53
 
Parameter Description Default
filename Name of existing attachment (if provided, this is a "manage attachment" action) none (in which case this is a "new attachment" action)
Added:
>
>
 

changes

Shows all the changes in the given web.

Line: 59 to 67
  Note: The result from changes script and the topic WebChanges can be different, if the changes file is deleted from a web. In particular, in new installations the changes script will return no results while the WebChanges topic will.
Added:
>
>
 

configure

configure is the browser script used for inspection and configuration of the TWiki configuration. None of the parameters to this script are useable for any purpose except configure. See configure.

Added:
>
>
 

edit

The edit script understands the following parameters, typically supplied by HTML input fields:

Line: 87 to 97
  Note: Most skins support the definition of EDIT_SKIN, which is used as the value of the cover parameter in edit URLs. This allows you to override the default edit skin on a web, topic or user basis.
Added:
>
>
 

login

Used for logging in when TWiki login is being used (e.g TemplateLoginManager).

Line: 95 to 106
 
username username of user logging in none
password password of user logging in none
Added:
>
>
 

logon

Used for logging in when Web Server authentication is being used (e.g. ApacheLoginManager). The script does nothing; it is purely a placeholder for triggering the login process. The webserver will be set up to require a valid user to access this script, thus triggering the webserver login process.

Added:
>
>
 

manage

Performs a range of management functions.

Line: 107 to 120
  Note: The manage script can only be called via http POST method for createweb renameweb, and deleteUserAccount.
Added:
>
>
 

action=createweb

Parameter Description Default
Line: 116 to 130
 
sitemapwhat Value for SITEMAPWHAT ''
nosearchall Value for NOSEARCHALL ''
Added:
>
>
 

action=renameweb

Parameter Description Default
Line: 123 to 138
 
newparentweb New parent web name ''
confirm If defined, requires a second level of confirmation. Supported values are "getlock", "continue", and "cancel" ''
Added:
>
>
 

action=editSettings

No parameters

Added:
>
>
 

action=saveSettings

Parameter