Start of topic | Skip to actions
TWiki Source Code PackagesThis documentation is automatically generated from thepod , so it always matches the running code
TWiki::AccessControlExceptionException used raise an access control violation. This package doesn't smellTWiki::AccessA singleton object of this class manages the access control database. This package has smell factor of 1TWiki::AttachA singleton object of this class is used to deal with attachments to topics. This package has smell factor of 2TWiki::AttrsClass of attribute sets, designed for parsing and storing attribute values from a TWiki tag e.g.%TAG{fred='bad' "sad" joe="mad"}%
An attribute set is a map containing an entry for each parameter. The
default parameter (unnamed quoted string) is named _DEFAULT in the map.
Attributes declared later in the string will override those of the same
name defined earlier. The one exception to this is the _DEFAULT key, where
the first instance of a setting is always taken.
As well as standard TWiki syntax (parameter values double-quoted)
it also parses single-quoted values, unquoted spaceless
values, spaces around the =, and commas as well as spaces separating values,
though none of these alternatives is advertised in documentation and
the extended syntax can be turned off by passing the 'strict' parameter
to new .
This class replaces the old TWiki::extractNameValuePair and
TWiki::extractParameters.
This package doesn't smell
TWiki::Client::ApacheLoginThis is login manager that you can specify in the security setup section of configure. It instructs TWiki to cooperate with your web server (typically Apache) to require authentication information (username & password) from users. It requires that you configure your web server to demand authentication for scripts named "login" and anything ending in "auth". The latter should be symlinks to existing scripts; e.g.,viewauth -> view , editauth -> edit , and so on.
See also TWikiUserAuthentication.
Subclass of TWiki::Client; see that class for documentation of the
methods of this class.
This package doesn't smell
TWiki::ClientThe package is also a Factory for login managers and also the base class for all login managers. On it's own, an object of this class is used when you specify 'none' in the security setup section of configure. When it is used, logins are not supported. If you want to authenticate users then you should consider TemplateLogin? or ApacheLogin?, which are subclasses of this class. If you are building a new login manager, then you should write a new subclass of this class, implementing the methods marked as VIRTUAL. There are already examples in thelib/TWiki/Client directory.
This package has smell factor of 3
TWiki::Client::TemplateLoginThis is a login manager that you can specify in the security setup section of configure. It provides users with a template-based form to enter usernames and passwords, and works with the PasswordManager? that you specify to verify those passwords. Subclass of TWiki::Client; see that class for documentation of the methods of this class. This package has smell factor of 2TWiki::CompatibilitySupport for compatibility with old TWiki versions. Packaged separately because 99.999999% of the time this won't be needed. =end sub _upgradeCategoryItem { my ( $catitems, $ctext ) = @_; my $catname = ''; my $scatname = ''; my $catmodifier = ''; my $catvalue = ''; my @cmd = split( /\|/, $catitems ); my $src = ''; my $len = @cmd; if( $len < '2' ) { # FIXME return ( $catname, $catmodifier, $catvalue ) } my $svalue = ''; my $i; my $itemsPerLine; # check for CategoryName?=CategoryValue parameter my $paramCmd = ''; my $cvalue = ''; # was$query->param( $cmd[1] ); if( $cvalue ) { $src = "$cvalue"; } elsif( $ctext ) { foreach( split( /\r?\n/, $ctext ) ) { if( /$cmd[1]/ ) { $src = $_; last; } } } if( $cmd[0] eq 'select' || $cmd[0] eq 'radio') { $catname = $cmd[1]; $scatname = $catname; #$scatname =~ s/[^a-zA-Z0-9]//g; my $size = $cmd[2]; for( $i = 3; $i < $len; $i++ ) { my $value = $cmd[$i]; $svalue = $value; if( $src =~ /$value/ ) { $catvalue = $svalue; } } } elsif( $cmd[0] eq 'checkbox' ) { $catname = $cmd[1]; $scatname = $catname; #$scatname =~ s/[^a-zA-Z0-9]//g; if( $cmd[2] eq 'true' || $cmd[2] eq '1' ) { $i = $len - 4; $catmodifier = 1; } $itemsPerLine = $cmd[3]; for( $i = 4; $i < $len; $i++ ) { my $value = $cmd[$i]; $svalue = $value; # I18N: FIXME - need to look at this, but since it's upgrading # old forms that probably didn't use I18N, it's not a high # priority. if( $src =~ /$value[^a-zA-Z0-9\.]/ ) { $catvalue .= ", " if( $catvalue ); $catvalue .= $svalue; } } } elsif( $cmd[0] eq 'text' ) { $catname = $cmd[1]; $scatname = $catname; #$scatname =~ s/[^a-zA-Z0-9]//g; $src =~ /(.*)/; if( $1 ) { $src = $1; } else { $src = ''; } $catvalue = $src; } return ( $catname, $catmodifier, $catvalue ) } This package has smell factor of 2TWikiTWiki operates by creating a singleton object (known as the Session object) that acts as a point of reference for all the different modules in the system. This package is the class for this singleton, and also contains the vast bulk of the basic constants and the per- site configuration mechanisms. Global variables are avoided wherever possible to avoid problems with CGI accelerators such as mod_perl. This package has smell factor of 29TWiki::FormObject representing a single form definition. This package has smell factor of 11TWiki::FuncOfficial list of stable TWiki functions for Plugin developers This module defines official functions that Plugins can use to interact with the TWiki engine and content. Refer to EmptyPlugin and lib/TWiki/Plugins/EmptyPlugin.pm for a template Plugin and documentation on how to write a Plugin. Plugins should only use functions published in this module. If you use functions in other TWiki libraries you might create a security hole and you will probably need to change your Plugin when you upgrade TWiki. Deprecated functions will still work in older code, though they should not be called in new Plugins and should be replaced in older Plugins as soon as possible. The version of the TWiki::Func module is defined by the VERSION number of the TWiki::Plugins module, currently 1.1. This can be shown by the%PLUGINVERSION% variable. The 'Since' field in the function
documentation refers to the VERSION number and the date that the function
was addded.
Note: Beware! These methods should only ever be called
from the context of a TWiki Plugin. They require a Plugins SESSION context to be
established before they are called, and will not work if simply called from
another TWiki module. For example,
use TWiki; print TWiki::Func::getSkin(),"\n";will fail with Can't call method "getSkin" on an undefined value at TWiki/Func.pm line 83 .
If you want to call the methods outside the context of a plugin, you can create a Plugins SESSION object. For example,
the script:
use TWiki: $TWiki::Plugins::SESSION = new TWiki(); print TWiki::Func::getSkin(),"\n";will work happily. This package has smell factor of 1 TWiki::I18NSupport for strings translation and language detection. This package has smell factor of 1TWiki::I18N::ExtractSupport translatable strings extraction from TWiki topics and templates. Depends on Locale::Maketext::Extract (part of CPAN::Locale::Maketext::Lexicon). This package has smell factor of 1TWiki::IfSupport for the conditions in %IF{} statements. Basically a simple stack-based parser for infix expressions that generates a parse tree that can subsequently be evaluated. This package doesn't smellTWiki::MergeSupport for 3-way merging of strings. Similar to Merge.pm, except that: a) it's considers the ancestor revision of the string, and b) it works. :-P This package doesn't smellTWiki::MergeSupport for merging strings This package doesn't smellTWiki::MetaMeta-data handling. A meta-data object is a hash of different types of meta-data (keyed on the type, such as 'FIELD' and 'TOPICINFO'). Each entry in the hash is an array, where each entry in the array contains another hash of the key=value pairs, corresponding to a single meta-datum. If there may be multiple entries of the same top-level type (i.e. for FIELD and FILEATTACHMENT) then the array hash multiple entries. These types are referred to as "keyed" types. The array entries are keyed with the attribute 'name' which must be in each entry in the array. For unkeyed types, the array has only one entry. The module knows nothing about how meta-data is stored. That is entirely the responsibility of the Store module. Meta-data objects are created by the Store engine when topics are read. They are populated using theput method.
This package has smell factor of 6
TWiki::NetObject that brokers access to network resources. This package has smell factor of 2TWiki::OopsExceptionException used to raise a request to redirect to an Oops URL. An OopsException? thrown anywhere in the code will redirect the browser to a url based on theoops script. oops requires a
template parameter, that is the name of a template file from
the templates directory. This file will be expanded and the
parameter values passed to the exception instantiated. The
result will be shown in the browser.
This package doesn't smell
[[TWikiPluginDotPm][]]This package has smell factor of 2TWiki::PluginsThis module defines the singleton object that handles Plugins loading, initialization and execution. This class uses Chain of Responsibility (GOF) pattern to dispatch handler calls to registered plugins. This package doesn't smellTWiki::PluralsHandle conversion of plural topic names to singular form. This package has smell factor of 3TWiki::PrefsThe Prefs class is a singleton that implements management of preferences. It uses a stack of TWiki::Prefs::PrefsCache objects to store the preferences for global, web, user and topic contexts, and provides the means to look up preferences in these. Preferences from different places stack on top of each other, so there are global preferences, then site, then web (and subweb and subsubweb), then topic, included topic and so on. Each level of the stack is tagged with a type identifier. The module also maintains a separate of the preferences found in every topic and web it reads. This supports the lookup of preferences for webs and topics that are not on the stack, and must not be chained in (you can't allow a user to override protections from their home topic!) This package has smell factor of 1TWiki::Prefs::ParserThis Prefs-internal class is used to parse * Set and * Local statements from arbitrary text, and extract settings from meta objects. It is used by TopicPrefs? to parse preference settings from topics. This class does no validation or duplicate-checking on the settings; it simply returns the recognized settings in the order it sees them in. This package has smell factor of 1TWiki::Prefs::PrefsCache?The PrefsCache? package holds a cache of topics that have been read in, using the TopicPrefs? class. These functions manage that cache. We maintain 2 hashes of values:
TWiki::RenderThis module provides most of the actual HTML rendering code in TWiki. This package has smell factor of 23TWiki::SandboxThis object provides an interface to the outside world. All calls to system functions, or handling of file names, should be brokered by this object. This package has smell factor of 3TWiki::SearchThis module implements all the search functionality. This package has smell factor of 22TWiki::StoreThis module hosts the generic storage backend. This module provides the interface layer between the "real" store provider - which is hidden behind a handler - and the rest of the system. it is responsible for checking for topic existance, access permissions, and all the other general admin tasks that are common to all store implementations. This module knows nothing about how the data is actually stored - that knowledge is entirely encapsulated in the handlers. The general contract for methods in the class requires that errors are signalled using exceptions. TWiki::AccessControlException is used for access control exceptions, and Error::Simple for all other types of error. This package has smell factor of 17TWiki::Store::RcsFileThis class is PACKAGE PRIVATE to Store, and should never be used from anywhere else. Base class of implementations of stores that manipulate RCS format files. The general contract of the methods on this class and its subclasses calls for errors to be signalled by Error::Simple exceptions. Refer to Store.pm for models of usage. This package has smell factor of 10TWiki::Store::RcsLiteThis package does not publish any methods. It implements the virtual methods of the TWiki::Store::RcsFile superclass. Simple replacement for RCS. Doesn't support:
File formatrcstext ::= admin {delta}* desc {deltatext}* admin ::= head {num}; { branch {num}; } access {id}*; symbols {sym : num}*; locks {id : num}*; {strict ;} { comment {string}; } { expand {string}; } { newphrase }* delta ::= num date num; author id; state {id}; branches {num}*; next {num}; { newphrase }* desc ::= desc string deltatext ::= num log string { newphrase }* text string num ::= {digit | .}+ digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 id ::= {num} idchar {idchar | num }* sym ::= {digit}* idchar {idchar | digit }* idchar ::= any visible graphic character except special special ::= $ | , | . | : | ; | @ string ::= @{any character, with @ doubled}*@ newphrase ::= id word* ; word ::= id | num | string | :Identifiers are case sensitive. Keywords are in lower case only. The sets of keywords and identifiers can overlap. In most environments RCS uses the ISO 8859/1 encoding: visible graphic characters are codes 041-176 and 240-377, and white space characters are codes 010-015 and 040. Dates, which appear after the date keyword, are of the form Y.mm.dd.hh.mm.ss, where Y is the year, mm the month (01-12), dd the day (01-31), hh the hour (00-23), mm the minute (00-59), and ss the second (00-60). Y contains just the last two digits of the year for years from 1900 through 1999, and all the digits of years thereafter. Dates use the Gregorian calendar; times use UTC. The newphrase productions in the grammar are reserved for future extensions to the format of RCS files. No newphrase will begin with any keyword already in use. Revisions consist of a sequence of 'a' and 'd' edits that need to be applied to rev N+1 to get rev N. Each edit has an offset (number of lines from start) and length (number of lines). For 'a', the edit is followed by length lines (the lines to be inserted in the text). For example: d1 3 means "delete three lines starting with line 1 a4 2 means "insert two lines at line 4' xxxxxx is the new line 4 yyyyyy is the new line 5 This package has smell factor of 2 TWiki::Store::RcsWrapThis package does not publish any methods. It implements the virtual methods of the TWiki::Store::RcsFile superclass. Wrapper around the RCS commands required by TWiki. There is one of these object for each file stored under RCS. This package has smell factor of 2TWiki::TemplatesSupport for the TWiki template language. This package has smell factor of 2TWiki::TimeTime handling functions. This package has smell factor of 10TWiki::UI::ChangeFormService functions used by the UI packages This package doesn't smellTWiki::UIService functions used by the UI packages This package doesn't smellTWiki::UI::EditEdit command handler This package has smell factor of 1TWiki::UI::ManageUI functions for web, topic and user management This package has smell factor of 5TWiki::UI::OopsUI delegate for oops function This package has smell factor of 1TWiki::UI::RDiffUI functions for diffing. This package has smell factor of 12TWiki::UI::RegisterUser registration handling. This package has smell factor of 28TWiki::UI::RestRest delegate for view function This package doesn't smellTWiki::UI::SaveUI delegate for save function This package has smell factor of 1TWiki::UI::SearchUI functions for searching. This package has smell factor of 3TWiki::UI::StatisticsStatistics extraction and presentation This package has smell factor of 4TWiki::UI::UploadUI delegate for attachment management functions This package has smell factor of 5TWiki::UI::ViewUI delegate for view function This package has smell factor of 1TWiki::UserA User object is an internal representation of a user in the real world. The object knows about users having login names, wiki names, personal topics, and email addresses. This package has smell factor of 5TWiki::Users::ApacheHtpasswdUserPassword manager that uses Apache::HtPasswd to manage users and passwords. Subclass ofTWiki::Users::Password .
See documentation of that class for descriptions of the methods of this class.
Duplicates functionality of
=TWiki::Users::HtPasswdUser=?;
provided mainly as an example of how to write a new password manager.
This package doesn't smell
TWiki::UsersSingleton object that handles mapping of users to wikinames and vice versa, and user authentication checking. This package has smell factor of 4TWiki::Users::PasswordBase class of all password handlers. Default behaviour is no passwords, so anyone can be anyone they like. The methods of this class should be overridded by subclasses that want to implement other password handling methods. This package doesn't smell There were a total of 230 smells |