NOTE: I set this up this way to be able to run from an admin panel so that’s why there’s the permission_class and _method tables to be referenced in the admin panel so even a not so smart person could setup new permissions
-- phpMyAdmin SQL Dump
-- version 2.11.6
-- <a href="http://www.phpmyadmin.net">http://www.phpmyadmin.net</a>
--
-- Host: localhost
-- Generation Time: Dec 02, 2008 at 06:43 PM
-- Server version: 5.0.51
-- PHP Version: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `fourtwo1_offroadwars`
--
-- --------------------------------------------------------
--
-- Table structure for table `group`
--
CREATE TABLE IF NOT EXISTS `group` (
`group_id` int(10) unsigned NOT NULL auto_increment,
`group_name` varchar(255) NOT NULL,
`group_desciption` text,
PRIMARY KEY (`group_id`),
UNIQUE KEY `group_name` (`group_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `group`
--
INSERT INTO `group` (`group_id`, `group_name`, `group_desciption`) VALUES
(0, 'Public', 'Public Group, Everyone not logged in is assigned to this group by default'),
(1, 'Members', 'Registered Members'),
(2, 'Moderators', 'Moderators'),
(3, 'Administrators', 'Administrators'),
(4, 'Super Administrators', 'Super Administrators');
-- --------------------------------------------------------
--
-- Table structure for table `group_module_permission`
--
CREATE TABLE IF NOT EXISTS `group_module_permission` (
`group_id` int(10) unsigned NOT NULL default '0',
`class_id` int(10) unsigned NOT NULL default '0',
`method_id` int(10) unsigned NOT NULL default '0',
`permission` tinyint(1) NOT NULL default '0',
UNIQUE KEY `group_module_permission` (`group_id`,`class_id`,`method_id`,`permission`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `group_module_permission`
--
INSERT INTO `group_module_permission` (`group_id`, `class_id`, `method_id`, `permission`) VALUES
(0, 1, 1, 1),
(0, 1, 2, 1),
(0, 1, 3, 1),
(0, 1, 4, 1);
-- --------------------------------------------------------
--
-- Table structure for table `permission_class`
--
CREATE TABLE IF NOT EXISTS `permission_class` (
`id` int(10) unsigned NOT NULL auto_increment,
`class` varchar(255) NOT NULL,
`description` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `permission_class`
--
INSERT INTO `permission_class` (`id`, `class`, `description`) VALUES
(1, 'authentication', '');
-- --------------------------------------------------------
--
-- Table structure for table `permission_method`
--
CREATE TABLE IF NOT EXISTS `permission_method` (
`id` int(10) unsigned NOT NULL auto_increment,
`class_id` int(10) unsigned NOT NULL default '0',
`method` varchar(255) NOT NULL,
`description` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `permission_method`
--
INSERT INTO `permission_method` (`id`, `class_id`, `method`, `description`) VALUES
(1, 1, 'index', ''),
(2, 1, 'login', ''),
(3, 1, 'register', ''),
(4, 1, 'process_login', '');
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`user_id` int(10) unsigned NOT NULL auto_increment,
`username` varchar(255) NOT NULL,
`email_address` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`register_date` int(10) unsigned NOT NULL,
`account_status` int(11) NOT NULL default '1',
`account_status_reason` text NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`user_id`, `username`, `email_address`, `password`, `register_date`, `account_status`, `account_status_reason`) VALUES
(1, 'administrator', '[email protected]', 'this was a password', 1224537739, 1, 'Your account is active. If you experience any problems please contact an administrator.');
-- --------------------------------------------------------
--
-- Table structure for table `user_group`
--
CREATE TABLE IF NOT EXISTS `user_group` (
`user_id` int(10) unsigned NOT NULL,
`group_id` int(10) unsigned NOT NULL default '1',
UNIQUE KEY `user_group` (`user_id`,`group_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `user_group`
--
INSERT INTO `user_group` (`user_id`, `group_id`) VALUES
(1, 4);