.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::Citadel 3pm" .TH Net::Citadel 3pm "2011-12-11" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::Citadel \- Citadel.org protocol coverage .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& use Net::Citadel; \& my $c = new Net::Citadel (host => \*(Aqcitadel.example.org\*(Aq); \& $c\->login (\*(AqAdministrator\*(Aq, \*(Aqgoodpassword\*(Aq); \& my @floors = $c\->floors; \& \& eval { \& $c\->assert_floor (\*(AqLevel 6 (Management)\*(Aq); \& }; warn $@ if $@; \& \& $c\->retract_floor (\*(AqLevel 6 (Management)\*(Aq); \& \& $c\->logout; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Citadel is a \*(L"turnkey open-source solution for email and collaboration\*(R" (this is as far as marketing can go :\-). The main component is the \fIcitadel server\fR. To communicate with it you can use either a web interface, or \- if you have to automate things \- with a protocol .PP .Vb 1 \& http://www.citadel.org/doku.php/documentation:appproto:start .Ve .PP This package tries to do a bit of abstraction (more could be done) and handles some of the protocol handling. The basic idea is that the application using the package deals with Citadel's objects: rooms, floors, users. .SH "INTERFACE" .IX Header "INTERFACE" .SS "Constructor" .IX Subsection "Constructor" The constructor creates a handle to the citadel server (and creates the \s-1TCP\s0 connection). It expects the following named parameters: .ie n .IP "\fIhost\fR (default: ""localhost"")" 4 .el .IP "\fIhost\fR (default: \f(CWlocalhost\fR)" 4 .IX Item "host (default: localhost)" The hostname (or \s-1IP\s0 address) where the citadel server is running on. Defaults to \f(CW\*(C`localhost\*(C'\fR. .ie n .IP "\fIport\fR (default: ""CITADEL_PORT"")" 4 .el .IP "\fIport\fR (default: \f(CWCITADEL_PORT\fR)" 4 .IX Item "port (default: CITADEL_PORT)" The port there. .PP The constructor will die if no connection can be established. .SS "Methods" .IX Subsection "Methods" \fIAuthentication\fR .IX Subsection "Authentication" .IP "\fIlogin\fR" 4 .IX Item "login" \&\fI\f(CI$c\fI\fR\->login (\fI\f(CI$user\fI\fR, \fI\f(CI$pwd\fI\fR) .Sp Logs in this user, or will die if that fails. .IP "\fIlogout\fR" 4 .IX Item "logout" \&\fI\f(CI$c\fI\fR\->logout .Sp Well, logs out the current user. .PP \fIFloors\fR .IX Subsection "Floors" .IP "\fIfloors\fR" 4 .IX Item "floors" \&\fI\f(CI@floors\fI\fR = \fI\f(CI$c\fI\fR\->floors .Sp Retrieves a list (\s-1ARRAY\s0) of known floors. Each entry is a hash reference with the name, the number of rooms in that floor and the index as \s-1ID\s0. The index within the array is also the \s-1ID\s0 of the floor. .IP "\fIassert_floor\fR" 4 .IX Item "assert_floor" \&\fI\f(CI$c\fI\fR\->assert_floor (\fI\f(CI$floor_name\fI\fR) .Sp Creates the floor with the name provided, or if it already exists simply returns. This only dies if there are insufficient privileges. .IP "\fIretract_floor\fR" 4 .IX Item "retract_floor" \&\fI\f(CI$c\fI\fR\->retract_floor (\fI\f(CI$floor_name\fI\fR) .Sp Retracts a floor with this name. Dies if that fails because of insufficient privileges. Does not die if the floor did not exist. .Sp \&\fB\s-1NOTE\s0\fR: Citadel server (v7.20) seems to have the bug that you cannot delete an empty floor without restarting the server. Not much I can do here about that. .IP "\fIrooms\fR" 4 .IX Item "rooms" \&\fI\f(CI@rooms\fI\fR = \fI\f(CI$c\fI\fR\->rooms (\fI\f(CI$floor_name\fI\fR) .Sp Retrieves the rooms on that given floor. .PP \fIRooms\fR .IX Subsection "Rooms" .IP "\fIassert_room\fR" 4 .IX Item "assert_room" \&\fI\f(CI$c\fI\fR\->assert_room (\fI\f(CI$floor_name\fI\fR, \fI\f(CI$room_name\fI\fR, [ \fI\f(CI$room_attributes\fI\fR ]) .Sp Creates the room on the given floor. If the room already exists there, nothing else happens. If the floor does not exist, it will complain. .Sp The optional room attributes are provided as hash with the following fields .RS 4 .ie n .IP """access"" (default: ""PUBLIC"")" 4 .el .IP "\f(CWaccess\fR (default: \f(CWPUBLIC\fR)" 4 .IX Item "access (default: PUBLIC)" One of the constants \f(CW\*(C`PUBLIC\*(C'\fR, \f(CW\*(C`PRIVATE\*(C'\fR, \f(CW\*(C`PRIVATE_PASSWORD\*(C'\fR, \f(CW\*(C`PRIVATE_INVITATION\*(C'\fR or \&\f(CW\*(C`PERSONAL\*(C'\fR. .ie n .IP """password"" (default: empty)" 4 .el .IP "\f(CWpassword\fR (default: empty)" 4 .IX Item "password (default: empty)" .PD 0 .ie n .IP """default_view"" (default: empty)" 4 .el .IP "\f(CWdefault_view\fR (default: empty)" 4 .IX Item "default_view (default: empty)" .RE .RS 4 .RE .IP "\fIretract_room\fR" 4 .IX Item "retract_room" .PD \&\fI\f(CI$c\fI\fR\->retract_room (\fI\f(CI$floor_name\fI\fR, \fI\f(CI$room_name\fI\fR) .Sp \&\fB\s-1NOTE\s0\fR: Not implemented yet. .PP \fIUsers\fR .IX Subsection "Users" .IP "\fIcreate_user\fR" 4 .IX Item "create_user" \&\fI\f(CI$c\fI\fR\->create_user (\fI\f(CI$username\fI\fR, \fI\f(CI$password\fI\fR) .Sp Tries to create a user with name and password. Fails if this user already exists (or some other reason). .IP "\fIchange_user\fR" 4 .IX Item "change_user" \&\fI\f(CI$c\fI\fR\->change_user (\fI\f(CI$user_name\fI\fR, \fI\f(CI$aspect\fI\fR => \fI\f(CI$value\fI\fR) .Sp Changes certain aspects of a user. Currently understood aspects are .RS 4 .ie n .IP """password"" (string)" 4 .el .IP "\f(CWpassword\fR (string)" 4 .IX Item "password (string)" .PD 0 .ie n .IP """access_level"" (0..6, constants available)" 4 .el .IP "\f(CWaccess_level\fR (0..6, constants available)" 4 .IX Item "access_level (0..6, constants available)" .RE .RS 4 .RE .IP "\fIremove_user\fR" 4 .IX Item "remove_user" .PD \&\fI\f(CI$c\fI\fR\->remove_user (\fI\f(CI$name\fI\fR) .Sp Removes the user (actually sets level to \f(CW\*(C`DELETED_USER\*(C'\fR). .PP \fIMiscellaneous\fR .IX Subsection "Miscellaneous" .IP "\fIecho\fR" 4 .IX Item "echo" \&\fI\f(CI$c\fI\fR\->echo (\fI\f(CI$string\fI\fR) .Sp Tests the connection. .IP "\fItime\fR" 4 .IX Item "time" \&\fI\f(CI$t\fI\fR = \fI\f(CI$c\fI\fR\->time .Sp Gets the \s-1UNIX\s0 time from the server. .Sp \&\f(CW\*(C`TODO\*(C'\fR: timezone handling .SH "TODOs" .IX Header "TODOs" \&\- Decent \s-1GUI\s0 using Mason + \s-1AJAX\s0 .SH "SEE ALSO" .IX Header "SEE ALSO" .Vb 1 \& http://www.citadel.org/doku.php/documentation:appproto:app_proto .Ve .SH "AUTHOR" .IX Header "AUTHOR" Robert Barta, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 200[78] by Robert Barta .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.