Kannst du mir bei meinem Board helfen?
Was mir momentan fehlt ist die einteilung in die User-Recht.
Was mir momentan fehlt ist die einteilung in die User-Recht.
# phpMyAdmin MySQL-Dump # version 2.2.6-rc1 # [url]http://phpwizard.net/phpMyAdmin/[/url] # [url]http://phpmyadmin.sourceforge.net/[/url] (download page) # # Host: localhost # Erstellungszeit: 01. Oktober 2002 um 15:05 # Server Version: 3.23.38 # PHP-Version: 4.2.1 # Datenbank : `phorumtest` # -------------------------------------------------------- # # Tabellenstruktur für Tabelle `forum_permission` # CREATE TABLE forum_permission ( forum_id tinyint(4) NOT NULL default '0', group_id tinyint(4) NOT NULL default '0', cat_erstellen tinyint(4) NOT NULL default '0', cat_aendern tinyint(4) NOT NULL default '0', cat_loeschen tinyint(4) NOT NULL default '0', forum_erstellen tinyint(4) NOT NULL default '0', forum_aendern tinyint(4) NOT NULL default '0', forum_loeschen tinyint(4) NOT NULL default '0', user_erstellen tinyint(4) NOT NULL default '0', user_aendern tinyint(4) NOT NULL default '0', user_loeschen tinyint(4) NOT NULL default '0', user_freischalten tinyint(4) NOT NULL default '0', user_sperren tinyint(4) NOT NULL default '0', user_profil_alle tinyint(4) NOT NULL default '0', user_profil tinyint(4) NOT NULL default '0', post_erstellen tinyint(4) NOT NULL default '0', post_aendern tinyint(4) NOT NULL default '0', post_loeschen tinyint(4) NOT NULL default '0', post_lesen tinyint(4) NOT NULL default '0', post_verschieben tinyint(4) NOT NULL default '0', post_schliessen tinyint(4) NOT NULL default '0', post_aendern_alle tinyint(4) NOT NULL default '0', ankuendigung_erstellen tinyint(4) NOT NULL default '0', ankuendigung_aendern tinyint(4) NOT NULL default '0', ankuendigung_loeschen tinyint(4) NOT NULL default '0', ankuendigung_lesen tinyint(4) NOT NULL default '0', post_wichtig tinyint(4) NOT NULL default '0', forum_suchen tinyint(4) NOT NULL default '0', profil_lesen tinyint(4) NOT NULL default '0', mail_user tinyint(4) NOT NULL default '0', pm_user tinyint(4) NOT NULL default '0' ) TYPE=MyISAM; # # Daten für Tabelle `forum_permission` #
# phpMyAdmin MySQL-Dump # version 2.2.6-rc1 # [url]http://phpwizard.net/phpMyAdmin/[/url] # [url]http://phpmyadmin.sourceforge.net/[/url] (download page) # # Host: localhost # Erstellungszeit: 01. Oktober 2002 um 15:08 # Server Version: 3.23.38 # PHP-Version: 4.2.1 # Datenbank : `phorumtest` # -------------------------------------------------------- # # Tabellenstruktur für Tabelle `forum_usergroup` # CREATE TABLE forum_usergroup ( user_group tinyint(4) NOT NULL default '0', group_id varchar(255) NOT NULL default '', group_name varchar(255) NOT NULL default '', cat_erstellen tinyint(4) NOT NULL default '0', cat_aendern tinyint(4) NOT NULL default '0', cat_loeschen tinyint(4) NOT NULL default '0', forum_erstellen tinyint(4) NOT NULL default '0', forum_aendern tinyint(4) NOT NULL default '0', forum_loeschen tinyint(4) NOT NULL default '0', user_erstellen tinyint(4) NOT NULL default '0', user_aendern tinyint(4) NOT NULL default '0', user_loeschen tinyint(4) NOT NULL default '0', user_freischalten tinyint(4) NOT NULL default '0', user_sperren tinyint(4) NOT NULL default '0', user_profil_alle tinyint(4) NOT NULL default '0', user_profil tinyint(4) NOT NULL default '0', post_erstellen tinyint(4) NOT NULL default '0', post_aendern tinyint(4) NOT NULL default '0', post_loeschen tinyint(4) NOT NULL default '0', post_lesen tinyint(4) NOT NULL default '0', post_verschieben tinyint(4) NOT NULL default '0', post_schliessen tinyint(4) NOT NULL default '0', post_aendern_alle tinyint(4) NOT NULL default '0', ankuendigung_erstellen tinyint(4) NOT NULL default '0', ankuendigung_aendern tinyint(4) NOT NULL default '0', ankuendigung_loeschen tinyint(4) NOT NULL default '0', ankuendigung_lesen tinyint(4) NOT NULL default '0', post_wichtig tinyint(4) NOT NULL default '0', forum_suchen tinyint(4) NOT NULL default '0', profil_lesen tinyint(4) NOT NULL default '0', mail_user tinyint(4) NOT NULL default '0', pm_user tinyint(4) NOT NULL default '0' ) TYPE=MyISAM; # # Daten für Tabelle `forum_usergroup` # INSERT INTO forum_usergroup VALUES (1, 'gast', 'Gast', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0); INSERT INTO forum_usergroup VALUES (2, 'user_un', 'User nocht nicht aktiviert', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0); INSERT INTO forum_usergroup VALUES (3, 'user_reg', 'User registriert und frei geschaltet', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1); INSERT INTO forum_usergroup VALUES (4, 'mod', 'Moderator', 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1); INSERT INTO forum_usergroup VALUES (5, 'admin', 'Administrator', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
# phpMyAdmin MySQL-Dump # version 2.2.6-rc1 # [url]http://phpwizard.net/phpMyAdmin/[/url] # [url]http://phpmyadmin.sourceforge.net/[/url] (download page) # # Host: localhost # Erstellungszeit: 01. Oktober 2002 um 15:09 # Server Version: 3.23.38 # PHP-Version: 4.2.1 # Datenbank : `phorumtest` # -------------------------------------------------------- # # Tabellenstruktur für Tabelle `forum_user` # CREATE TABLE forum_user ( id int(4) NOT NULL auto_increment, user_name varchar(255) NOT NULL default '', user_pass varchar(255) NOT NULL default '', user_email varchar(255) NOT NULL default '', user_brith date NOT NULL default '0000-00-00', user_city varchar(255) NOT NULL default '', user_signatur text NOT NULL, user_job text NOT NULL, user_hobby text NOT NULL, user_last datetime NOT NULL default '0000-00-00 00:00:00', user_first datetime NOT NULL default '0000-00-00 00:00:00', user_activ enum('0','1') NOT NULL default '0', user_hits tinyint(5) NOT NULL default '0', user_title varchar(255) NOT NULL default '', user_avatar varchar(255) NOT NULL default '', user_group enum('gast','user_un','user_reg','mod','admin') NOT NULL default 'user_un', user_www varchar(255) NOT NULL default '', user_icq varchar(255) NOT NULL default '', user_aol varchar(255) NOT NULL default '', user_yahoo varchar(255) NOT NULL default '', PRIMARY KEY (id,user_email) ) TYPE=MyISAM; # # Daten für Tabelle `forum_user` # INSERT INTO forum_user VALUES (1, 'wotan', 'pebbles', 'Webmaster@domain.com', '0000-00-00', '', '', '', '', '2002-09-30 20:27:26', '2002-09-01 09:24:29', '1', 0, '', '', 'admin', '', '', '', ''); INSERT INTO forum_user VALUES (176, 'tabata', 'pebbles', 'gibt@es.nicht', '0000-00-00', '', '', '', '', '2002-09-30 20:46:48', '2002-09-30 20:30:29', '0', 0, '', '', '', '', '', '', '');
<?
session_start();
if (session_is_registered("myuser") && session_is_registered("mypass"))
{
$user = $myuser;
$passwort = $mypass;
}
include("../inc/db_data.inc.php");
$res = mysql_query("select *,DATE_FORMAT(user_last,'%d.%m.%y um %H:%i') AS last from forum_user where (user_name='$user') and (user_pass='$passwort')");
$num = mysql_num_rows($res);
if ($num == 0)
{
// kein User, zurück zum Login
$login_flag = false;
$gruppe = gast;
}
else
{
// Anmeldung war erfolgreich, jetzt den Krempel als Session speichern, falls noch nicht passiert
if (!session_is_registered("myuser") && !session_is_registered("mypass"))
{
session_register("myuser","mypass");
$myuser = $user;
$mypass = $passwort;
}
$datum = date("Y-m-d H:i:s");
$ret = mysql_query("UPDATE forum_user SET user_last='$datum' WHERE user_name='$user'");
$i=0;
$gruppe = mysql_result($res, 0, "user_group"); // welche Gruppe ist der User
$last_log = mysql_result($res, 0, "last"); // wann das lette Mal angemeldet
$login_flag = true;
}
?>
Kommentar