|
getCanonicalUserID( $user ) -> $cUID |
|
> > |
-
$user can be a login, wikiname or web.wikiname
|
| Return the cUID of the specified user. A cUID is a unique identifier which
is assigned by TWiki for each user.
BEWARE: While the default TWikiUserMapping uses a cUID that looks like a user's
LoginName, some characters are modified to make them compatible with rcs. |
|
< < | Additionally, other usermappings will use other conventions - the JoomlauserMapping |
> > | Other usermappings may use other conventions - the JoomlaUserMapping |
| for example, has cUIDs like 'JoomlaeUserMapping_1234'.
|
|
< < | If $user is undefined Get the cUID of logged in user, and will generally be
'BaseUserMapping_666' |
> > | If $user is undefined, it assumes the currently logged-in user. |
| |
|
< < |
- $user can be a cUID, login, wikiname or web.wikiname
Return: $cUID an internal unique and transportable escaped identifier for
registered users (they can be autogenerated for an authenticated but unregistered
user) |
> > | Return: $cUID , an internal unique and portable escaped identifier for
registered users. This may be autogenerated for an authenticated but
unregistered user. |
|
Since: TWiki::Plugins::VERSION 1.2 |
| Since: TWiki::Plugins::VERSION 1.000 (7 Dec 2002) |
|
< < | wikiToUserName( $wikiName ) -> $loginName
Translate a Wiki name (or login name or cUID, if it can) to a login name.
-
$wikiName - Wiki name, e.g. 'Main.JohnDoe' or 'JohnDoe'
|
> > | wikiToUserName( $id ) -> $loginName
Translate a Wiki name to a login name.
-
$id - Wiki name, e.g. 'Main.JohnDoe' or 'JohnDoe' . Since TWiki 4.2.1, $id may also be a login name. This will normally be transparent, but should be borne in mind if you have login names that are also legal wiki names.
|
| Return: $loginName Login name of user, e.g. 'jdoe' , or undef if not
matched. |
|
userToWikiName( $loginName, $dontAddWeb ) -> $wikiName
Translate a login name to a Wiki name |
|
< < |
-
$loginName - Login name, e.g. 'jdoe'
|
> > |
-
$loginName - Login name, e.g. 'jdoe' . Since TWiki 4.2.1 this may also be a wiki name. This will normally be transparent, but may be relevant if you have login names that are also valid wiki names.
|
|
-
$dontAddWeb - Do not add web prefix if "1"
Return: $wikiName Wiki name of user, e.g. 'Main.JohnDoe' or 'JohnDoe' |
|
< < | userToWikiName will always return a name, if the user does not |
> > | userToWikiName will always return a name. If the user does not |
| exist in the mapping, the $loginName parameter is returned. (backward compatibility)
Since: TWiki::Plugins::VERSION 1.000 (7 Dec 2002) |
| Since: TWiki::Plugins::VERSION 1.2 |
|
< < | wikiNameToEmails( $wikiname ) -> @emails
-
$wikiname - wikiname of user to look up
Returns the registered email addresses of the named user. If $wikiname is |
> > | wikinameToEmails( $user ) -> @emails
-
$user - wikiname of user to look up
Returns the registered email addresses of the named user. If $user is |
| undef, returns the registered email addresses for the logged-in user. |
|
> > | Since TWiki 4.2.1, $user may also be a login name, or the name of a group. |
| Since: TWiki::Plugins::VERSION 1.2 |
| Since: TWiki::Plugins::VERSION 1.000 (7 Dec 2002) |
|
< < | isAnAdmin( $login ) -> $boolean |
> > | isAnAdmin( $id ) -> $boolean |
|
Find out if the user is an admin or not. If the user is not given,
the currently logged-in user is assumed. |
|
< < |
- $login can be either a login, or a CUID
|
> > |
- $id can be either a login name or a WikiName
|
|
Since: TWiki::Plugins::VERSION 1.2 |
|
< < | isGroupMember( $group, $login ) -> $boolean |
> > | isGroupMember( $group, $id ) -> $boolean |
| |
|
< < | Find out if $login is in the named group. e.g. |
> > | Find out if $id is in the named group. e.g. |
|
if( TWiki::Func::isGroupMember( "HesperionXXGroup", "jordi" )) {
... |
|
If $user is undef , it defaults to the currently logged-in user. |
|
< < |
- $login can be a login name, or a cUID, or WikiName
|
> > | |
|
Since: TWiki::Plugins::VERSION 1.2 |
| Since: TWiki::Plugins::VERSION 1.2 |
|
< < | eachMembership($wikiname) -> $iterator |
> > | eachMembership($id) -> $iterator
-
$id - WikiName or login name of the user. If $id is undef , defaults to the currently logged-in user.
|
| Get an iterator over the names of all groups that the user is a member of. |
|
< < | If $wikiname is undef , defaults to the currently logged-in user. |
|
Since: TWiki::Plugins::VERSION 1.2 |
| Since: TWiki::Plugins::VERSION 1.2 |
|
< < | checkAccessPermission( $type, $wikiName, $text, $topic, $web, $meta ) -> $boolean |
> > | checkAccessPermission( $type, $id, $text, $topic, $web, $meta ) -> $boolean |
|
Check access permission for a topic based on the
TWiki.TWikiAccessControl rules
-
$type - Access type, required, e.g. 'VIEW' , 'CHANGE' .
|
|
< < |
-
$wikiName - WikiName of remote user, required, e.g. "PeterThoeny" . If $wikiName is '', 0 or undef then access is always permitted.
|
> > |
-
$id - WikiName of remote user, required, e.g. "PeterThoeny" . From TWiki 4.2.1, $id may also be a login name. If $id is '', 0 or undef then access is always permitted.
|
|
-
$text - Topic text, optional. If 'perl false' (undef, 0 or ''), topic $web.$topic is consulted. $text may optionally contain embedded %META:PREFERENCE tags. Provide this parameter if:
|
| Settings in $meta override Set settings in $text.
A perl true result indicates that access is permitted. |
|
< < | Note the wierd parameter order is due to compatibility constraints with |
> > | Note the weird parameter order is due to compatibility constraints with |
| earlier TWiki releases.
Tip if you want, you can use this method to check your own access control types. For example, if you: |
|
my $iterator = TWiki::Func::eachChangeSince(
$web, time() - 7 * 24 * 60 * 60); # the last 7 days |
|
< < | while ($it->hasNext()) {
my $change = $it->next(); |
> > | while ($iterator->hasNext()) {
my $change = $iterator->next(); |
| # $change is a perl hash that contains the following fields:
# topic => topic name
# user => wikiname - wikiname of user who made the change |
|
-
\%options - ref to hash of save options \%options may include: dontlog | don't log this change in twiki log |
|
|
< < |
|
> > |
forcenewrevision |
force the save to increment the revision counter |
|
|
minor |
True if this is a minor change, and is not to be notified |
Return: error message or undef. |
|
my( $meta, $text ) = TWiki::Func::readTopic( $web, $topic )
$text =~ s/APPLE/ORANGE/g; |
|
< < | TWiki::Func::saveTopic( $web, $topic, $meta, $text, { comment => 'refruited' } ); |
> > | TWiki::Func::saveTopic( $web, $topic, $meta, $text, { forcenewrevision => 1 } ); |
|
Note: Plugins handlers ( e.g. beforeSaveHandler ) will be called as |
| fully documented in the source code documentation shipped with the
release, or can be inspected in the lib/TWiki/Meta.pm file. |
|
< < | This method ignores topic access permissions. You should be careful to use checkAccessPermissions to ensure the current user has read access to the topic. |
> > | This method ignores topic access permissions. You should be careful to use
checkAccessPermissions to ensure the current user has read access to the
topic. |
|
Since: TWiki::Plugins::VERSION 1.000 (7 Dec 2002) |
|
wikiToEmail( $wikiName ) -> $email |
|
< < |
-
$wikiName - wiki name of the user
|
> > |
-
$wikiname - wiki name of the user
|
| Get the e-mail address(es) of the named user. If the user has multiple
e-mail addresses (for example, the user is a group), then the list will
be comma-separated.
Since: TWiki::Plugins::VERSION 1.1 |
|
> > | Deprecated in favour of wikinameToEmails, because this function only
returns a single email address, where a user may in fact have several.
Since TWiki 4.2.1, $wikiName may also be a login name. |
|
Creating New Topics |