J-Soft
Now With Sprinkles!!!
Back to Homepage
Web based programs I have written
Info on my web design experience
A bunch of BASIC programs I wrote a while ago. Pong is fun.
Who am I anyway?
My weblog. I wonder if I can keep it up this time?
This is where I will put anything that I feel deserves a more permanent home than a simple blog entry
Webmail for those who have an email address @jsoft.ca
Contacts

Personal: jmalone@jsoft.ca

Anything to do with Reblogger: reblogger@jsoft.ca

Anything to do with Chorus: chorus@jsoft.ca

The IT Resource

Valid XHTML 1.0!

This website created by Jesse Malone
Home Web Apps Web Design Basic
About Me Blog Noteworthy Webmail
Chorus WebCMS
Chorus-lib Overview Bug Reports

Chorus-lib: Overview



Chorus WebCMS is intended to allow groups of people to collaborate on the maintenance of a website. Site administrators will be able to mark off sections of a webpage with tags that chorus will recognize. With these tags a site administrator will be able to delegate responsibility for the various parts of a website to any number of people. The way sections(blocks) are defined will be very flexible and will allow for nested blocks and subblocks.
A block defined by a chorus tag has the following properties:
Each block and subblock has the same permissions. If no permissions are given, it is assumed to have the same owner and permissions as its parent(in the case of an entire page, the admin). A page is the largest possible block. each block has the following parameters defining who owns the block, and who can edit the block.
name:name;owner:owner;group:group;owner-edit:yes|no;group-edit:yes|no;other-edit:yes|no

name - name of the block
owner - owner of the block
group - group that owns the block(if any)
owner-edit - can the owner edit the block?
group-edit - can any member of the group that owns the block edit it?
other-edit - can any user edit the block?


if ommited owner-edit and group-edit default to yes and other-edit to no.

blocks are opened with a <!--chorus -paramater list- --> tag and closed with a <!--/chorus--> tag


When a user reads a file, chorus will parse the file and return only those blocks in the file that the user has permission to edit.
Initially only the 'root' user can add users to the system, however, some user's can be granted administrator privileges, which can allow them most of the abilities of the 'root' user. Just how much they have control of can be specified in chorus's configuration. The priveleges include adding or modifying users, creating/modifying groups, adding pages to a website. In addition the 'root' user, and administrators can modify any block, regardless of ownership or permissions.

chorus-lib: perl module
module name: chorus-wcms.pm
Public Methods:

In general return 0 if an error occurs. Some return a string containing information about the error.

login($username,$password):
login and return the chorus-wcms object. takes username and
password.
cont($username,$auth,$cwd):
verify user and create chorus-wcms object for a logged
in user. - requires username, auth(a session id number generated when a
user logs in) and cwd(current working directory) as arguments.
fread($file):
reads an html file and returns all blocks within
the file for which the user has or user's group has edit
permission for.
fwrite($modified,$file):
writes any changes made to a block back into the html file from
which it came
fnew($file):
creates a new blank file, or if specified in configuration,
a new file created from a template and returns the contents(if any) of the new file, or 0 if not permitted.
(does not write file)
grplist($grpname):
takes as an arguement group name, returns list of
group members.
grpmodify($grpname,$members):
takes as argument a group name and list of members
and writes that list to the group.
grpadd($grpname):
takes a group name and checks that it does not yet exist.
If not it creates that group, otherwise it returns an error
adduser($username,$password,$admin,$realname):
takes username, password, admin status, realname and creates
a user if the caller has permission
rmuser($username):
takes username and removes that user if caller has permission
chuser($action,$username,$parameter):
changes a user's admin status, realname, or
password(depending on $action) to the value of $parameter
if the caller has permission
userinfo():
returns username, realname. and admin status(hash reference);
auth():
returns current session number
userperm($username):
takes a username and returns a hash reference of boolean values
indicating what if any changes the current user can make to the
user named $username

$result->{modify} - can user change $username's admin status
or realname
$result->{add} - can user add new users to the system
$result->{pass} - can the user modify $username's password
$result->{remove} - can the user remove $username
grperm($grpname,$owner):
takes a group name (and optionally a group owner) and
returns hash of boolean values for view permission,
write permission and group add permission for the
current user.



$result->{view},$result->{modify},$result->{create}



Private:


Properties


$self->{auth}:
session number placed in logged in list
$self->{username}:
username of current user
$self->{admin}:
boolean, is the current user an admin
$self->{isFwrite}:
boolean indicating whether a file is being written, and
permission is needed for all blocks

The following properties are all loaded from the config
file("settings")
$self->{chorusHome}:
path to chorus
$self->{template}:
location of template file
$self->{grpFile}:
location of groups file
$self->{pwFile}:
path to password file
$self->{authFile}:
path to list of current users
$self->{usercreate}:
boolean, can users create new files
$self->{grpVwho}:
who can view group members
$self->{grpMadmin}:
boolean, can admins modify groups
$self->{grpAwho}:
who can add groups
$self->{adminUmod}:
boolean, can admins modify users
$self->{adminUpass}:
boolean, can admins change passwords
$self->{adminUadd}:
boolean, can admins add users
$self->{adminUremove}
boolean, can admins remove users