579 lines
23 KiB
SQL
579 lines
23 KiB
SQL
# The contents of this file are subject to the Mozilla Public License Version 1.1
|
|
# (the "License"); you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
|
#
|
|
# Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
|
# WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
|
# language governing rights and limitations under the License.
|
|
#
|
|
# The Original Code is the Venice Web Communities System.
|
|
#
|
|
# The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
|
# for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
|
# Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
|
#
|
|
# Contributor(s):
|
|
#
|
|
|
|
##############################################################################
|
|
# Database Creation
|
|
##############################################################################
|
|
|
|
DROP DATABASE IF EXISTS venice;
|
|
CREATE DATABASE venice;
|
|
USE venice;
|
|
|
|
##############################################################################
|
|
# Table Creation
|
|
##############################################################################
|
|
|
|
# The "namespace cache" table, used to map string namespaces (used in the code) to integer IDs
|
|
# (used in the database).
|
|
CREATE TABLE namespaces (
|
|
nsid INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
namespace VARCHAR(255) BINARY NOT NULL,
|
|
UNIQUE INDEX on_namespace (namespace)
|
|
);
|
|
|
|
# The global properties table.
|
|
CREATE TABLE globalprop (
|
|
nsid INT NOT NULL,
|
|
prop_name VARCHAR(255) BINARY NOT NULL,
|
|
prop_value VARCHAR(255),
|
|
PRIMARY KEY (nsid, prop_name)
|
|
);
|
|
|
|
# The global "blocks" table, used to store fragments of text/HTML for later use.
|
|
CREATE TABLE globalblock (
|
|
nsid INT NOT NULL,
|
|
block_name VARCHAR(255) BINARY NOT NULL,
|
|
block TEXT,
|
|
PRIMARY KEY (nsid, block_name)
|
|
);
|
|
|
|
# The main user information table.
|
|
CREATE TABLE users (
|
|
uid INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
username VARCHAR(64) NOT NULL,
|
|
email VARCHAR(255) NOT NULL,
|
|
is_anon TINYINT DEFAULT 0,
|
|
locked TINYINT DEFAULT 0,
|
|
nospam TINYINT DEFAULT 0,
|
|
created DATETIME NOT NULL,
|
|
last_accessed DATETIME,
|
|
UNIQUE INDEX on_username (username)
|
|
);
|
|
|
|
# The user authentication data table. We identify authentication methods by namespace ID
|
|
# and name, and provide "source data" to allow multiple sources for the same type of
|
|
# authentication (such as browser cookies for multiple browsers).
|
|
CREATE TABLE userauth (
|
|
uid INT NOT NULL,
|
|
nsid INT NOT NULL,
|
|
method VARCHAR(255) BINARY NOT NULL,
|
|
source_data VARCHAR(255),
|
|
auth_data VARCHAR(255),
|
|
PRIMARY KEY (uid, nsid, method)
|
|
);
|
|
|
|
# The user properties table.
|
|
CREATE TABLE userprop (
|
|
uid INT NOT NULL,
|
|
nsid INT NOT NULL,
|
|
prop_name VARCHAR(255) BINARY NOT NULL,
|
|
prop_value VARCHAR(255),
|
|
PRIMARY KEY (uid, nsid, prop_name)
|
|
);
|
|
|
|
# The groups table.
|
|
CREATE TABLE groups (
|
|
gid INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
groupname VARCHAR(64) NOT NULL,
|
|
gaclid INT NOT NULL DEFAULT -1,
|
|
UNIQUE INDEX on_groupname (groupname)
|
|
);
|
|
|
|
# The group membership table.
|
|
CREATE TABLE groupmembers (
|
|
gid INT NOT NULL,
|
|
uid INT NOT NULL,
|
|
PRIMARY KEY (gid, uid),
|
|
UNIQUE INDEX reverse_index (uid, gid)
|
|
);
|
|
|
|
# The group properties table.
|
|
CREATE TABLE groupprop (
|
|
gid INT NOT NULL,
|
|
nsid INT NOT NULL,
|
|
prop_name VARCHAR(255) BINARY NOT NULL,
|
|
prop_value VARCHAR(255),
|
|
PRIMARY KEY (gid, nsid, prop_name)
|
|
);
|
|
|
|
# The main ACL table. Each ACL has a numeric ID, a name, an unordered collection of owners (which may
|
|
# be groups or users), and an ordered collection of entries (ACEs).
|
|
CREATE TABLE acl (
|
|
aclid INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
aclname VARCHAR(255) NOT NULL,
|
|
INDEX on_name (aclname)
|
|
);
|
|
|
|
# The table of owners for ACLs. Each ACL has one or more owners.
|
|
# Flags Bit 0: 0=user, 1=group
|
|
CREATE TABLE aclowner (
|
|
aclid INT NOT NULL,
|
|
ownerid INT NOT NULL,
|
|
flags TINYINT NOT NULL,
|
|
INDEX on_acl (aclid)
|
|
);
|
|
|
|
# The table mapping ACLs to ACEs. Each ACL has zero or more ACEs.
|
|
CREATE TABLE acldata (
|
|
aclid INT NOT NULL,
|
|
seq INT NOT NULL,
|
|
aceid INT NOT NULL,
|
|
PRIMARY KEY (aclid, seq)
|
|
);
|
|
|
|
# The main ACE table. Each ACE has a numeric ID, a principal reference (which may be a user or
|
|
# group ID), a "negative" flag, and an unordered collection of permissions.
|
|
# Flags Bit 0: 0=user, 1=group
|
|
# Flags Bit 4: 0=positive ACE, 1=negative ACE
|
|
CREATE TABLE ace (
|
|
aceid INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
pri INT,
|
|
flags TINYINT NOT NULL DEFAULT 0
|
|
);
|
|
|
|
# The table mapping permissions into ACEs. Permissions are identified by namespace and name.
|
|
CREATE TABLE acedata (
|
|
aceid INT NOT NULL,
|
|
perm_nsid INT NOT NULL,
|
|
perm_name VARCHAR(255) BINARY NOT NULL,
|
|
INDEX on_ace (aceid)
|
|
);
|
|
|
|
# Global security data table.
|
|
CREATE TABLE globalsec (
|
|
admin_uid INT NOT NULL,
|
|
admin_gid INT NOT NULL,
|
|
global_aclid INT NOT NULL,
|
|
alluser_gid INT NOT NULL,
|
|
verified_gid INT NOT NULL
|
|
);
|
|
|
|
# The audit information table. Each audit "event" can have up to 8 properties defined with it,
|
|
# which are serialized as other "properties."
|
|
CREATE TABLE audit (
|
|
record BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
on_date DATETIME NOT NULL,
|
|
event INT NOT NULL,
|
|
uid INT NOT NULL,
|
|
subid INT NOT NULL DEFAULT 0,
|
|
ip VARCHAR(48),
|
|
prop0 VARCHAR(255),
|
|
prop1 VARCHAR(255),
|
|
prop2 VARCHAR(255),
|
|
prop3 VARCHAR(255),
|
|
prop4 VARCHAR(255),
|
|
prop5 VARCHAR(255),
|
|
prop6 VARCHAR(255),
|
|
prop7 VARCHAR(255),
|
|
INDEX by_date (on_date),
|
|
INDEX sub_view (subid, on_date)
|
|
);
|
|
|
|
# The table where events are assigned "event IDs" in the master audit record,
|
|
# to cut down on space usage in the audit table. Event IDs can be predefined
|
|
# at database create time, or defined dynamically, or both.
|
|
CREATE TABLE auditevent (
|
|
eventid INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
event_nsid INT NOT NULL,
|
|
event_name VARCHAR(255) BINARY NOT NULL,
|
|
descr TINYTEXT,
|
|
UNIQUE INDEX by_event (event_nsid, event_name)
|
|
);
|
|
|
|
# The image store table. This is used to store relatively small images like
|
|
# user photos and logos.
|
|
CREATE TABLE imagestore (
|
|
imageid INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
typecode INT NOT NULL,
|
|
ownerid INT NOT NULL,
|
|
ownerflag TINYINT NOT NULL DEFAULT 0,
|
|
mimetype VARCHAR(128),
|
|
length INT,
|
|
data MEDIUMBLOB
|
|
);
|
|
|
|
# The image type table, used to differentiate between images stored in the table.
|
|
CREATE TABLE imagetype (
|
|
typecode INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
nsid INT NOT NULL,
|
|
name VARCHAR(255) BINARY NOT NULL
|
|
);
|
|
|
|
#### following this line are Venice-specific tables ####
|
|
|
|
# The table which defines menus.
|
|
CREATE TABLE menus (
|
|
menuid INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
menu_nsid INT NOT NULL,
|
|
menu_name VARCHAR(255) BINARY NOT NULL,
|
|
title VARCHAR(255) NOT NULL,
|
|
subtitle VARCHAR(255) NULL,
|
|
UNIQUE INDEX by_name (menu_nsid, menu_name)
|
|
);
|
|
|
|
# Definitions of variables for menus.
|
|
CREATE TABLE menuvars (
|
|
menuid INT NOT NULL,
|
|
var_name VARCHAR(255) NOT NULL,
|
|
default_val VARCHAR(255) NULL,
|
|
PRIMARY KEY (menuid, var_name)
|
|
);
|
|
|
|
# Definitions of menu items.
|
|
CREATE TABLE menuitems (
|
|
menuid INT NOT NULL,
|
|
sequence INT NOT NULL,
|
|
itemtype VARCHAR(32) NOT NULL,
|
|
enable TINYINT NOT NULL DEFAULT 1,
|
|
indent INT NOT NULL DEFAULT 0,
|
|
text VARCHAR(255) NULL,
|
|
linktype VARCHAR(32) NULL,
|
|
link VARCHAR(255) NULL,
|
|
target VARCHAR(255) NULL,
|
|
title VARCHAR(255) NULL,
|
|
on_click VARCHAR(255) NULL,
|
|
perm_nsid INT NULL,
|
|
perm_name VARCHAR(255) BINARY NULL,
|
|
ifdef_var VARCHAR(255) NULL,
|
|
ifndef_var VARCHAR(255) NULL,
|
|
PRIMARY KEY (menuid, sequence)
|
|
);
|
|
|
|
##############################################################################
|
|
# Set table access rights
|
|
##############################################################################
|
|
|
|
# this is a test only - remove when we go to production
|
|
GRANT ALL PRIVILEGES ON venice.*
|
|
TO erbo@localhost IDENTIFIED BY 'meesatest'
|
|
WITH GRANT OPTION;
|
|
|
|
GRANT INSERT, DELETE, UPDATE, SELECT, LOCK TABLES ON venice.*
|
|
TO veniceuser@localhost IDENTIFIED BY 'XYZZY0099';
|
|
|
|
##############################################################################
|
|
# Initialization data
|
|
##############################################################################
|
|
|
|
# Initial namespaces setup
|
|
INSERT INTO namespaces (nsid, namespace) VALUES
|
|
(1, 'http://www.silverwrist.com/NS/venice/2002/12/21/frame.look.and.feel' ),
|
|
(2, 'http://www.silverwrist.com/NS/venice/2002/12/22/stylesheets' ),
|
|
(3, 'http://www.silverwrist.com/NS/dynamo/2002/12/13/user.information' ),
|
|
(4, 'http://www.silverwrist.com/NS/dynamo/2002/12/27/group.permissions' ),
|
|
(5, 'http://www.silverwrist.com/NS/venice/2002/12/28/mail.properties' ),
|
|
(6, 'http://www.silverwrist.com/NS/venice/2002/12/28/content.look.and.feel'),
|
|
(7, 'http://www.silverwrist.com/NS/venice/2002/12/30/session.control' ),
|
|
(8, 'http://www.silverwrist.com/NS/venice/2002/12/31/system.events' ),
|
|
(9, 'http://www.silverwrist.com/NS/venice/2002/12/31/user.events' ),
|
|
(10, 'http://www.silverwrist.com/NS/venice/2002/12/31/user.settings' ),
|
|
(11, 'http://www.silverwrist.com/NS/venice/2002/12/31/user.profile' ),
|
|
(12, 'http://www.silverwrist.com/NS/venice/2003/01/03/system.mail.messages' );
|
|
|
|
# Initial global properties setup
|
|
INSERT INTO globalprop (nsid, prop_name, prop_value) VALUES
|
|
(1, 'site.title', '!Venice Test' ),
|
|
(1, 'optionset', '_OS:AC' ),
|
|
(1, 'site.url', '!http://localhost:8080/venice/' ),
|
|
(1, 'site.logo.url', '!temp/site-logo.jpg' ),
|
|
(1, 'site.logo.url.type', '!IMAGE' ),
|
|
(1, 'site.logo.width', 'I140' ),
|
|
(1, 'site.logo.height', 'I80' ),
|
|
(1, 'frame.template', '!frame.vm' ),
|
|
(1, 'footer.logo.scale', 'I100' ),
|
|
(1, 'page.icon.url', '!venice-icon.png' ),
|
|
(1, 'page.icon.url.type', '!IMAGE' ),
|
|
(1, 'page.icon.type', '!image/png' ),
|
|
(1, 'page.favicon.url', '!venice-favicon.ico' ),
|
|
(1, 'page.favicon.url.type', '!IMAGE' ),
|
|
(2, 'sheet.base.normal', '!stylesheets/normal_base.vm' ),
|
|
(2, 'sheet.adv.normal', '!stylesheets/adv_base.vm' ),
|
|
(5, 'smtp.host', '!localhost' ),
|
|
(5, 'system.mail.from.addr', '!nobody@delenn.silverwrist.internal'),
|
|
(5, 'system.mail.from.name', '!Venice Mail System' ),
|
|
(5, 'mailer.name', '!Venice AutoMail System' ),
|
|
(5, 'user.info.header', '!X-Venice-User-Info' ),
|
|
(6, 'subdir.buttons', '!buttons/classic' ),
|
|
(6, 'std.button.width', 'I80' ),
|
|
(6, 'std.button.height', 'I24' ),
|
|
(6, 'bn.cancel', '!cancel.jpg' ),
|
|
(6, 'bnc.cancel', '!Cancel' ),
|
|
(6, 'bn.create', '!create.jpg' ),
|
|
(6, 'bnc.create', '!Create' ),
|
|
(6, 'bn.i.accept', '!user_accept.jpg' ),
|
|
(6, 'bnc.i.accept', '!I Accept' ),
|
|
(6, 'bn.i.decline', '!user_decline.jpg' ),
|
|
(6, 'bnc.i.decline', '!I Decline' ),
|
|
(6, 'bn.login', '!login.jpg' ),
|
|
(6, 'bnc.login', '!Log In' ),
|
|
(6, 'bn.ok', '!ok.jpg' ),
|
|
(6, 'bnc.ok', '!OK' ),
|
|
(6, 'bn.reminder', '!reminder.jpg' ),
|
|
(6, 'bnc.reminder', '!Reminder' ),
|
|
(6, 'bn.send.again', '!send_again.jpg' ),
|
|
(6, 'bnc.send.again', '!Send Again' ),
|
|
(6, 'bn.send.email', '!send_email.jpg' ),
|
|
(6, 'bnc.send.email', '!Send E-Mail' ),
|
|
(6, 'bn.set', '!set.jpg' ),
|
|
(6, 'bnc.set', '!Set' ),
|
|
(6, 'bn.update', '!update.jpg' ),
|
|
(6, 'bnc.update', '!Update' ),
|
|
(6, 'user.agreement.title', '!Venice User Agreement' ),
|
|
(6, 'user.photo.width', 'I100' ),
|
|
(6, 'user.photo.height', 'I100' ),
|
|
(6, 'user.nophoto.url', '!photo_not_avail.gif' ),
|
|
(6, 'user.nophoto.url.type', '!IMAGE' ),
|
|
(7, 'session.init.script', '!/util/session_init.js' ),
|
|
(7, 'login.cookie', '!VeniceAuth' ),
|
|
(7, 'login.cookie.maxage', 'I365' ),
|
|
(7, 'password.recovery.time', 'I60' ),
|
|
(10, 'timezone', '_TZ:UTC' ),
|
|
(10, 'locale', '_LOC:en_US' ),
|
|
(10, 'admin.flags', '_OS:' ),
|
|
(11, 'privacy', '_OS:' ),
|
|
(12, 'confirm.message.title', '!Venice E-Mail Confirmation' ),
|
|
(12, 'password.change.message.title', '!Venice Password Changed' ),
|
|
(12, 'reminder.message.title', '!Venice Password Reminder Message' );
|
|
|
|
# Initial global blocks setup
|
|
INSERT INTO globalblock (nsid, block_name, block) VALUES
|
|
(1, 'footer',
|
|
'All trademarks and copyrights on this page are owned by their respective companies.
|
|
All messages posted by users on this page are owned by those users.
|
|
The rest: Copyright © 2002-2003 Silverwrist Design Studios, All Rights Reserved.
|
|
See our <a href="TODO">Policy Page</a> for our copyright and privacy policies.'),
|
|
(5, 'user.disclaimer',
|
|
'Message sent via Venice Web Communities System - <http://venice.sourceforge.net>
|
|
The Venice Project is not responsible for the contents of this message
|
|
Report abuses to: <abuse@example.com>'),
|
|
(5, 'signature',
|
|
'Venice - community services, conferencing and more. <http://venice.sourceforge.net>'),
|
|
(6, 'content.header',
|
|
'<span class="chdrtitle">$title</span>
|
|
#if( $subtitle )
|
|
<span class="chdrsubtitle">$subtitle</span>
|
|
#end
|
|
<hr align="left" size="2" width="90%" noshade="noshade" />'),
|
|
(6, 'std.bullet',
|
|
'<img src="#formatURL( "IMAGE" "purple-ball.gif" )" alt="*" width="14" height="14" border="0" />'),
|
|
(6, 'error.box',
|
|
'<p><table align="center" width="70%" border="1" cellpadding="2" cellspacing="1">
|
|
<tr valign="middle"><td class="errorhead">
|
|
#encodeHTML( $title )
|
|
</td></tr>
|
|
<tr valign="middle"><td class="errorbody">
|
|
<p>#encodeHTML( $message )</p>
|
|
<p>
|
|
#if( $back )
|
|
<a href="#formatURL( $backtype $back )">Go back.</a>
|
|
#else
|
|
Use your browser''s <b>Back</b> button to go back.
|
|
#end
|
|
</p>
|
|
</td></tr>
|
|
</table></p>
|
|
#if( $except )
|
|
<!--
|
|
#stacktrace( $except )
|
|
-->
|
|
#end'),
|
|
(6, 'user.agreement',
|
|
'Text of this agreement is to be determined.'),
|
|
(12, 'confirm.message',
|
|
'Welcome to the Venice Web Communities System! In order to fully activate your
|
|
account after you register or change your E-mail address, you must provide a
|
|
confirmation number to the system. Please enter this number into the "Confirm
|
|
E-mail Address" dialog on the system when indicated.
|
|
|
|
Your confirmation number for your account "$username" is $confnum.
|
|
|
|
Access the E-mail verification dialog at <http://localhost/venice/verifyemail>.
|
|
|
|
Thank you, and enjoy the Venice Web Communities System!
|
|
|
|
-- The Management'),
|
|
(12, 'password.change.message',
|
|
'The password for your account "$username" has been changed. The new
|
|
password is "$password".
|
|
|
|
You should log into Venice immediately and change the password to something
|
|
else. You can change the password for your account, once you are logged in,
|
|
by clicking on the "Profile" link in the top bar.
|
|
|
|
If you did NOT request a password change on your account, please notify the
|
|
system administrator IMMEDIATELY.
|
|
|
|
-- The Management'),
|
|
(12, 'reminder.message',
|
|
'Here is the password reminder for your account "$username" as you requested:
|
|
|
|
$reminder
|
|
|
|
If this reminder is not sufficient for you to remember what your password is,
|
|
then the system can change your password for you. To do so, please visit
|
|
the following URL:
|
|
|
|
http://localhost/venice/passrecovery/$uid/$auth
|
|
|
|
Your password will be changed and a new password will be E-mailed to you
|
|
at this address.
|
|
|
|
If you did NOT request a password reminder, then this message was sent
|
|
by someone attempting to access your account without your knowledge. Do
|
|
not panic! Nothing has happened to your account or password yet, but
|
|
please do notify the system administrator.
|
|
|
|
-- The Management');
|
|
|
|
# Initial users setup
|
|
# (UID 1 and 2)
|
|
INSERT INTO users (uid, username, email, is_anon, nospam, created) VALUES
|
|
(1, 'Anonymous_Honyak', 'nobody@localhost', 1, 1, '2002-12-15 12:00:00'),
|
|
(2, 'Administrator', 'root@localhost', 0, 0, '2002-12-26 18:00:00');
|
|
|
|
# Set up properties for Anonymous_Honyak.
|
|
INSERT INTO userprop (uid, nsid, prop_name, prop_value) VALUES
|
|
(1, 10, 'timezone', '_TZ:UTC' ),
|
|
(1, 10, 'locale', '_LOC:en_US'),
|
|
(1, 10, 'admin.flags', '_OS:A' ),
|
|
(1, 11, 'privacy', '_OS:' ),
|
|
(1, 11, 'name.given', '!Anonymous'),
|
|
(1, 11, 'name.family', '!Honyak' ),
|
|
(1, 11, 'locality', '!Nowhere' ),
|
|
(1, 11, 'region', '!XX' ),
|
|
(1, 11, 'postal.code', '!00000' ),
|
|
(1, 11, 'country', '_CTRY:US' );
|
|
|
|
# Add authentication for Administrator (no password by default)
|
|
INSERT INTO userauth (uid, nsid, method, source_data, auth_data) VALUES
|
|
(2, 3, 'default.hash.password', '', '');
|
|
|
|
# Set up properties for Administrator.
|
|
INSERT INTO userprop (uid, nsid, prop_name, prop_value) VALUES
|
|
(2, 10, 'timezone', '_TZ:UTC' ),
|
|
(2, 10, 'locale', '_LOC:en_US' ),
|
|
(2, 10, 'admin.flags', '_OS:' ),
|
|
(2, 11, 'privacy', '_OS:' ),
|
|
(2, 11, 'name.given', '!System' ),
|
|
(2, 11, 'name.family', '!Administrator'),
|
|
(2, 11, 'locality', '!Nowhere' ),
|
|
(2, 11, 'region', '!XX' ),
|
|
(2, 11, 'postal.code', '!00000' ),
|
|
(2, 11, 'country', '_CTRY:US' );
|
|
|
|
# Create a group for site administrators.
|
|
# (GID 1)
|
|
INSERT INTO groups (gid, groupname) VALUES (1, 'Site_Administration');
|
|
INSERT INTO groupmembers (gid, uid) VALUES (1, 2);
|
|
|
|
# Create an ACL for the site administrator group. The ACL is owned by Administrator
|
|
# and grants "add" and "remove" permissions to Administrator only.
|
|
# (ACL 1, ACE 1)
|
|
INSERT INTO acl (aclid, aclname) VALUES (1, 'Site_Administration');
|
|
INSERT INTO aclowner (aclid, ownerid, flags) VALUES (1, 2, 0);
|
|
INSERT INTO ace (aceid, pri, flags) VALUES (1, 2, 0);
|
|
INSERT INTO acldata (aclid, seq, aceid) VALUES (1, 0, 1);
|
|
INSERT INTO acedata (aceid, perm_nsid, perm_name) VALUES
|
|
(1, 4, 'add.member' ),
|
|
(1, 4, 'remove.member');
|
|
UPDATE groups SET gaclid = 1 WHERE gid = 1;
|
|
|
|
# Create the "all users" group.
|
|
# (GID 2)
|
|
INSERT INTO groups (gid, groupname) VALUES (2, 'All_Users');
|
|
INSERT INTO groupmembers (gid, uid) VALUES (2, 2);
|
|
|
|
# Create the "all verified users" group.
|
|
# (GID 3)
|
|
INSERT INTO groups (gid, groupname) VALUES (3, 'Verified_Users');
|
|
INSERT INTO groupmembers (gid, uid) VALUES (3, 2);
|
|
|
|
# Create the global ACL. This ACL is owned by the Administrator and grants
|
|
# permissions to the site administration group and to the Administrator specifically.
|
|
# (ACL 2, ACEs 2 and 3)
|
|
INSERT INTO acl (aclid, aclname) VALUES (2, 'Global_Permissions');
|
|
INSERT INTO aclowner (aclid, ownerid, flags) VALUES (2, 2, 0);
|
|
INSERT INTO ace (aceid, pri, flags) VALUES (2, 1, 1);
|
|
INSERT INTO acldata (aclid, seq, aceid) VALUES (2, 0, 2);
|
|
INSERT INTO acedata (aceid, perm_nsid, perm_name) VALUES
|
|
(2, 1, 'set.property' ),
|
|
(2, 1, 'set.block' ),
|
|
(2, 2, 'set.property' ),
|
|
(2, 3, 'edit.all' ),
|
|
(2, 3, 'bypass.email.verify'),
|
|
(2, 3, 'view.all' ),
|
|
(2, 5, 'set.property' ),
|
|
(2, 5, 'set.block' ),
|
|
(2, 6, 'set.property' ),
|
|
(2, 6, 'set.block' ),
|
|
(2, 7, 'set.property' ),
|
|
(2, 10, 'set.property' ),
|
|
(2, 10, 'remove.property' ),
|
|
(2, 11, 'set.property' ),
|
|
(2, 11, 'remove.property' ),
|
|
(2, 12, 'set.property' ),
|
|
(2, 12, 'set.block' );
|
|
INSERT INTO ace (aceid, pri, flags) VALUES (3, 2, 0);
|
|
INSERT INTO acldata (aclid, seq, aceid) VALUES (2, 1, 3);
|
|
INSERT INTO acedata (aceid, perm_nsid, perm_name) VALUES
|
|
(3, 1, 'remove.property'),
|
|
(3, 1, 'remove.block' ),
|
|
(3, 2, 'remove.property'),
|
|
(3, 5, 'remove.property'),
|
|
(3, 5, 'remove.block' ),
|
|
(3, 6, 'remove.property'),
|
|
(3, 6, 'remove.block' ),
|
|
(3, 7, 'remove.property'),
|
|
(3, 12, 'remove.property'),
|
|
(3, 12, 'remove.block' );
|
|
|
|
# Create the entries in the global security table.
|
|
INSERT INTO globalsec (admin_uid, admin_gid, global_aclid, alluser_gid, verified_gid)
|
|
VALUES (2, 1, 2, 2, 3);
|
|
|
|
# Insert some audit event type records.
|
|
INSERT INTO auditevent (eventid, event_nsid, event_name, descr) VALUES
|
|
(1, 8, 'system.startup', 'Venice Server Startup' ),
|
|
(2, 8, 'system.shutdown', 'Venice Server Shutdown' ),
|
|
(3, 9, 'login.ok', 'Successful User Login' ),
|
|
(4, 9, 'login.fail', 'Failed User Login' ),
|
|
(5, 9, 'verify.ok', 'Successful E-Mail Address Verification'),
|
|
(6, 9, 'verify.fail', 'Failed E-Mail Address Verification' ),
|
|
(7, 9, 'resend.confirm.email', 'Re-Sent E-Mail Confirmation Message' ),
|
|
(8, 9, 'send.confirm.email', 'Sent E-Mail Confirmation Message' ),
|
|
(9, 9, 'user.created', 'New User Created' );
|
|
|
|
# Insert some image types.
|
|
INSERT INTO imagetype (typecode, nsid, name) VALUES
|
|
(1, 11, 'user.photo');
|
|
|
|
#### following this line is initialization of Venice-specific tables ####
|
|
|
|
# Create the "global" menu.
|
|
INSERT INTO menus (menuid, menu_nsid, menu_name, title, subtitle)
|
|
VALUES (1, 1, 'fixed.menu', 'About This Site', NULL);
|
|
INSERT INTO menuitems (menuid, sequence, itemtype, text, linktype, link) VALUES
|
|
(1, 0, 'TEXT', 'Documentation', 'ABSOLUTE', 'TODO' ),
|
|
(1, 1, 'TEXT', 'About Venice', 'FRAME', 'about-venice.html');
|
|
UPDATE menuitems SET enable = 0 WHERE menuid = 1 AND sequence = 0;
|
|
|
|
# Create the user profile menu.
|
|
INSERT INTO menus (menuid, menu_nsid, menu_name, title, subtitle)
|
|
VALUES (2, 11, 'user.profile.menu', '', NULL);
|
|
INSERT INTO menuitems (menuid, sequence, itemtype, text, linktype, link) VALUES
|
|
(2, 0, 'TEXT', 'Profile', 'SERVLET', 'profile.js.vs?tgt=${target}');
|