[MKDoc-dev] Upgrading sites to use current 1.6 CVS

Bruno Postle bruno at mkdoc.com
Tue Feb 8 14:29:37 GMT 2005


On Fri 04-Feb-2005 at 14:28 +0000, Bruno Postle wrote:

> 1.6 has some new user group functionality which involves upgrading 
> existing sites.
>
> Until we have an upgrade script, these are basic instructions for 
> upgrading for anyone who wants to try the new functionality:
>
> Create the missing tables using the attached SQL script:
>
>    mysql -umkdoc1 -pmkdoc1 mkdoc1 \
>      < create-missing-mkdoc-tables-1.6-timerange-groups.sql
>
> These tables need database definition files which you need to copy 
> from a freshly installed site:
>
>    cd /path/to/example.com/su
>    cp Document_TimeRange.def *Grp.def $SITE_DIR/su/

In addition you might want to actually enable the groups 
functionality...

Edit the $SITE_DIR/httpd/httpd-authenticate.conf file and add a 
single line PerlAuthzHandler for logged-in users so it looks 
something like this:

  <Location />
    PerlAuthenHandler MKDoc::Handler::Authenticate
    PerlAuthzHandler  MKDoc::Handler::GroupAuthz
    AuthName "Please enter your user credentials"
    AuthType Basic
    require valid-user
  </Location>

Similarly, edit the $SITE_DIR/httpd/httpd.conf file and add a new 
Location directive to the www (non-logged-in) interface:

  <Location />
    PerlModule MKDoc::Handler::GroupAuthz
    PerlAuthenHandler MKDoc::Handler::GroupAuthz->null_authen_handler
    PerlAuthzHandler  MKDoc::Handler::GroupAuthz
    AuthName "Group Authorization"
    AuthType GroupAuthz
    require valid-group
  </Location>

> - Add some groups in the Grp table.  As agreed there is no GUI for
>   this.  Example:
> 
>    INSERT INTO Grp (Name) VALUES ('Blue Bloods'), ('Peasants');
> 
> - Associate the groups with some protected content by adding values
>   in Document_Grp.  There's no GUI for this either.  Example:
> 
>    INSERT INTO Document_Grp (Document_ID, Grp_ID) VALUES (2, 1);
> 
> - Add some users and assign them to your groups.  You'll find a GUI
>   for this in the user editor, accessible by the admin user.
> 
> - Now try access the protected documents.  Users in the right groups
>   should get the pages, users not in the groups should get 403
>   Forbidden pages.

-- 
Bruno

CREATE TABLE IF NOT EXISTS Document_TimeRange (
  ID int(11) NOT NULL auto_increment,
  Document_ID int(11) NOT NULL default '0',
  FromDate datetime NOT NULL default '0000-00-00 00:00:00',
  ToDate datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (ID),
  KEY DocIndex (Document_ID),
  KEY FromIndex (FromDate),
  KEY ToIndex (ToDate)
) TYPE=MyISAM;

CREATE TABLE IF NOT EXISTS Document_Grp (
  Document_ID int(11) NOT NULL default '0',
  Grp_ID int(11) NOT NULL default '0',
  PRIMARY KEY  (Document_ID,Grp_ID),
  KEY ReverseGrpDocumentIndex (Grp_ID,Document_ID)
) TYPE=MyISAM;

CREATE TABLE IF NOT EXISTS Editor_Grp (
  Editor_ID int(11) NOT NULL default '0',
  Grp_ID int(11) NOT NULL default '0',
  PRIMARY KEY  (Editor_ID,Grp_ID),
  KEY ReverseGrpEditorIndex (Grp_ID,Editor_ID)
) TYPE=MyISAM;

CREATE TABLE IF NOT EXISTS Grp (
  ID int(11) NOT NULL auto_increment,
  Name char(255) default NULL,
  Description char(255) default NULL,
  PRIMARY KEY  (ID)
) TYPE=MyISAM;



More information about the MKDoc-dev mailing list