--
-- Tabellenstruktur für Tabelle `users`
--
CREATE TABLE `users` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`name` varchar(40) character set latin1 collate latin1_german1_ci default NULL,
`pwd` varchar(200) character set latin1 collate latin1_german1_ci default NULL,
`realname` varchar(100) character set latin1 collate latin1_german1_ci NOT NULL default 'besucher',
`email` varchar(255) NOT NULL default '',
`mod` timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`stimeout` bigint(32) unsigned default '600',
`startpage` varchar(100) character set latin1 collate latin1_german1_ci NOT NULL default '/index.html',
`new` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
--
-- Daten für Tabelle `users`
--
INSERT INTO `users` (`id`, `name`, `pwd`, `realname`, `email`, `mod`, `stimeout`, `startpage`, `new`) VALUES (1, 'gf', 'f08b658d0819053ef77cdef03d4f035d', 'Gerd Muster', 'rrs@muster.de', '2005-12-03 22:16:19', 600, '/index.html', '2005-12-03 22:16:19');
INSERT INTO `users` (`id`, `name`, `pwd`, `realname`, `email`, `mod`, `stimeout`, `startpage`, `new`) VALUES (2, 'ami', '5fa1cbe27dd8ccee7fa49f93265b696f', 'Amin Sid', 'siso2@net.de', '2005-12-03 22:16:51', 600, '/index.html', '2005-12-03 22:16:19');
INSERT INTO `users` (`id`, `name`, `pwd`, `realname`, `email`, `mod`, `stimeout`, `startpage`, `new`) VALUES (3, 'www', '4eae35f1b35977a00ebd8086c259d4c9', 'erster besucher', 'xy@web.de', '2005-12-03 22:21:42', 600, '/index.html', '2005-12-03 22:21:42');
INSERT INTO `users` (`id`, `name`, `pwd`, `realname`, `email`, `mod`, `stimeout`, `startpage`, `new`) VALUES (4, 'www2', '31ff9a549ff2986e45fbe72e7ec91238', 'zweiter besucher', 'sidi2@net.de', '2005-12-03 22:21:42', 600, '/index.html', '2005-12-03 22:21:42');
INSERT INTO `users` (`id`, `name`, `pwd`, `realname`, `email`, `mod`, `stimeout`, `startpage`, `new`) VALUES (5, 'moderator', '0408f3c997f309c03b08bf3a4bc7b730', 'moderator', 'mail@moderator.de', '2005-12-07 20:29:08', 600, '/index.html', '0000-00-00 00:00:00');
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `usertogroup`
--
CREATE TABLE `usertogroup` (
`id` bigint(32) unsigned NOT NULL auto_increment,
`userid` bigint(32) unsigned NOT NULL default '0',
`groupid` bigint(32) unsigned NOT NULL default '0',
`flag` set('r','e') collate latin1_german1_ci NOT NULL default 'r',
`von` datetime NOT NULL default '0000-00-00 00:00:00',
`bis` datetime NOT NULL default '0000-00-00 00:00:00',
`mod` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci AUTO_INCREMENT=6 ;
--
-- Daten für Tabelle `usertogroup`
--
INSERT INTO `usertogroup` (`id`, `userid`, `groupid`, `flag`, `von`, `bis`, `mod`) VALUES (1, 1, 1, 'r', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '2005-12-07 18:24:21');
INSERT INTO `usertogroup` (`id`, `userid`, `groupid`, `flag`, `von`, `bis`, `mod`) VALUES (2, 2, 1, 'r', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '2005-12-07 18:24:21');
INSERT INTO `usertogroup` (`id`, `userid`, `groupid`, `flag`, `von`, `bis`, `mod`) VALUES (3, 3, 5, 'r', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '2005-12-07 18:26:23');
INSERT INTO `usertogroup` (`id`, `userid`, `groupid`, `flag`, `von`, `bis`, `mod`) VALUES (4, 4, 5, 'r', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '2005-12-07 18:26:23');
INSERT INTO `usertogroup` (`id`, `userid`, `groupid`, `flag`, `von`, `bis`, `mod`) VALUES (5, 5, 3, 'r', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '2005-12-07 20:32:38');
--
-- Tabellenstruktur für Tabelle `groups`
--
CREATE TABLE `groups` (
`id` bigint(32) unsigned NOT NULL auto_increment,
`name` varchar(255) collate latin1_german1_ci NOT NULL default '',
`von` datetime NOT NULL default '0000-00-00 00:00:00',
`bis` datetime NOT NULL default '0000-00-00 00:00:00',
`mod` timestamp NOT NULL default CURRENT_TIMESTAMP,
`new` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci AUTO_INCREMENT=7 ;
--
-- Daten für Tabelle `groups`
--
INSERT INTO `groups` (`id`, `name`, `von`, `bis`, `mod`, `new`) VALUES (1, 'superadmin', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '2005-12-03 21:57:28', '2005-12-03 21:57:28');
INSERT INTO `groups` (`id`, `name`, `von`, `bis`, `mod`, `new`) VALUES (2, 'admin', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '2005-12-03 21:57:28', '2005-12-03 21:57:28');
INSERT INTO `groups` (`id`, `name`, `von`, `bis`, `mod`, `new`) VALUES (3, 'moderator', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '2005-12-07 20:31:43', '2005-12-03 21:58:26');
INSERT INTO `groups` (`id`, `name`, `von`, `bis`, `mod`, `new`) VALUES (4, 'useredit', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '2005-12-03 21:58:26', '2005-12-03 21:58:26');
INSERT INTO `groups` (`id`, `name`, `von`, `bis`, `mod`, `new`) VALUES (5, 'www_generic', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '2005-12-07 18:25:41', '0000-00-00 00:00:00');
INSERT INTO `groups` (`id`, `name`, `von`, `bis`, `mod`, `new`) VALUES (6, 'registered_generic', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '2005-12-07 18:25:41', '0000-00-00 00:00:00');
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `grouptoaction`
--
CREATE TABLE `grouptoaction` (
`id` bigint(32) unsigned NOT NULL auto_increment,
`groupid` bigint(32) unsigned NOT NULL default '0',
`actionid` bigint(32) unsigned NOT NULL default '0',
`mod` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci AUTO_INCREMENT=5 ;
--
-- Daten für Tabelle `grouptoaction`
--
INSERT INTO `grouptoaction` (`id`, `groupid`, `actionid`, `mod`) VALUES (1, 2, 3, '2005-12-07 20:59:49');
INSERT INTO `grouptoaction` (`id`, `groupid`, `actionid`, `mod`) VALUES (2, 2, 4, '2005-12-07 20:59:49');
INSERT INTO `grouptoaction` (`id`, `groupid`, `actionid`, `mod`) VALUES (3, 3, 5, '2005-12-07 21:17:16');
INSERT INTO `grouptoaction` (`id`, `groupid`, `actionid`, `mod`) VALUES (4, 3, 6, '2005-12-07 21:17:16');
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `actions`
--
CREATE TABLE `actions` (
`id` bigint(32) unsigned NOT NULL auto_increment,
`modul` varchar(64) collate latin1_german1_ci NOT NULL default '',
`instance` varchar(64) collate latin1_german1_ci NOT NULL default '',
`name` varchar(64) collate latin1_german1_ci NOT NULL default '',
`rating` int(10) unsigned NOT NULL default '1000',
`mod` timestamp NOT NULL default CURRENT_TIMESTAMP,
`new` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci AUTO_INCREMENT=7 ;
--
-- Daten für Tabelle `actions`
--
INSERT INTO `actions` (`id`, `instance`, `name`, `rating`, `mod`, `new`) VALUES (1, 'mygaestebuch', 'edit::user_text', 10, '2005-12-07 17:53:54', '0000-00-00 00:00:00');
INSERT INTO `actions` (`id`, `instance`, `name`, `rating`, `mod`, `new`) VALUES (2, 'mygaestebuch', 'edit::user_delete', 10, '2005-12-07 17:55:03', '0000-00-00 00:00:00');
INSERT INTO `actions` (`id`, `instance`, `name`, `rating`, `mod`, `new`) VALUES (3, 'user', 'edit::rights::all', 0, '2005-12-07 18:23:25', '0000-00-00 00:00:00');
INSERT INTO `actions` (`id`, `instance`, `name`, `rating`, `mod`, `new`) VALUES (4, 'user', 'edit::groups::all', 4, '2005-12-07 18:23:25', '0000-00-00 00:00:00');
INSERT INTO `actions` (`id`, `instance`, `name`, `rating`, `mod`, `new`) VALUES (5, 'mygaestebuch', 'edit::all_text', 1000, '2005-12-07 20:34:39', '0000-00-00 00:00:00');
INSERT INTO `actions` (`id`, `instance`, `name`, `rating`, `mod`, `new`) VALUES (6, 'mygaestebuch', 'edit::delete_text', 1000, '2005-12-07 20:34:39', '0000-00-00 00:00:00');
-- ------------------------------------------------------------------------------------------------
Alle "Rechte"="erlaubte Aktionen" eines Users:
SELECT actions.name as Rechte
FROM `users`
INNER JOIN usertogroup ON usertogroup.userid = users.id
INNER JOIN groups ON groups.id = usertogroup.groupid
INNER JOIN grouptoaction ON grouptoaction.groupid = groups.id
INNER JOIN actions ON actions.id = grouptoaction.rightid
WHERE users.name=\"$myuser\" ";