Net::Citadel(3pm) | User Contributed Perl Documentation | Net::Citadel(3pm) |
Net::Citadel - Citadel.org protocol coverage
Version 0.25
use Net::Citadel; my $c = new Net::Citadel (host => 'citadel.example.org'); $c->login ('Administrator', 'goodpassword'); my @floors = $c->floors; eval { $c->assert_floor ('Level 6 (Management)'); }; warn $@ if $@; $c->retract_floor ('Level 6 (Management)'); $c->logout;
Citadel is a "turnkey open-source solution for email and collaboration" (this is as far as marketing can go :-). The main component is the citadel server. To communicate with it you can use either a web interface, or - if you have to automate things - with a protocol
L<http://www.citadel.org/doku.php?id=documentation:appproto:start>
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.
"$c = new Net::Citadel (host =" $ctdl_host)>
The constructor creates a handle to the citadel server (and creates the TCP connection). It uses the following named parameters:
The constructor will croak if no connection can be established.
Authentication
Logs in this user, or will croak if that fails.
Well, logs out the current user.
Floors
Retrieves a list (ARRAY) of known floors. Each entry is a hash reference with the name, the number of rooms in that floor and the index as ID. The index within the array is also the ID of the floor.
Creates the floor with the name provided, or if it already exists simply returns. This only croaks if there are insufficient privileges.
Retracts a floor with this name. croaks if that fails because of insufficient privileges. Does not croak if the floor did not exist.
NOTE: 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.
Retrieves the rooms on that given floor.
Rooms
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.
The optional room attributes are provided as hash with the following fields
NOTE: Not implemented yet.
Users
Tries to create a user with name and password. Fails if this user already exists (or some other reason).
Changes certain aspects of a user. Currently understood aspects are
Removes the user (actually sets level to "DELETED_USER").
Miscellaneous
Tests a connection to the Citadel server by sending a message string to it and then checking to see if that same string is echoed back.
Sends the "INFO" command to the Citadel server and returns the lines it receives from that as a reference to an array. An example of getting and then displaying the server information lines the following:
my $c = new Net::Citadel (host => $host_name); my $info_aref = $c->citadel_info; foreach $line (@{$info_aref}) { print $line; }
For more details about the server information lines that are returned, see the "INFO" entry at <http://www.citadel.org/doku.php/documentation:appproto:connection>.
Sends the "MRTG" command to the Citadel server. It expects a type of either "users" or "messages" to be passed to it and returns a hash containing the information from the server.
Gets the current system time and time zone offset from UTC in UNIX timestamp format from the Citadel server.
"TODO": Rewrite function to return the unpacked parameters as a hash upon success.
- Decent GUI using Mason + AJAX
L<http://www.citadel.org/doku.php?id=documentation:appproto:app_proto>
Robert Barta, <drrho@cpan.org> Robert James Clay, <jame@rocasa.us>
Copyright (C) 2007-2008 by Robert Barta Copyright (C) 2012-2018 by Robert James Clay
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.
2018-06-28 | perl v5.26.2 |