From a3be0289286c43d8656052217457d9162261ba90 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Thu, 2 Jun 2011 00:48:29 +0200 Subject: rewrite --- includes/sys_menu.php | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 includes/sys_menu.php (limited to 'includes/sys_menu.php') diff --git a/includes/sys_menu.php b/includes/sys_menu.php new file mode 100644 index 00000000..8c993d1b --- /dev/null +++ b/includes/sys_menu.php @@ -0,0 +1,72 @@ +

' . Get_Text('/') . '

'; + return $menu; +} + +function make_menu() { + return make_navigation() . make_onlineusers() . make_langselect(); +} + +function make_onlineusers() { + global $privileges, $user; + $html = ''; + return $html; +} + +function make_langselect() { + if (strpos($_SERVER["REQUEST_URI"], "?") > 0) + $URL = $_SERVER["REQUEST_URI"] . "&SetLanguage="; + else + $URL = $_SERVER["REQUEST_URI"] . "?SetLanguage="; + + $html = '

DE'; + $html .= 'EN

'; + return ''; +} +?> \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 10683c4759c2c3563ff7ed48b15d12e85cd0631b Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Thu, 2 Jun 2011 01:09:03 +0200 Subject: counter --- includes/crypt.php | 12 ------------ includes/funktion_counter.php | 14 -------------- includes/sys_counter.php | 10 ++++++++++ includes/sys_menu.php | 4 ++-- www-ssl/index.php | 3 +++ 5 files changed, 15 insertions(+), 28 deletions(-) delete mode 100644 includes/crypt.php delete mode 100644 includes/funktion_counter.php create mode 100644 includes/sys_counter.php (limited to 'includes/sys_menu.php') diff --git a/includes/crypt.php b/includes/crypt.php deleted file mode 100644 index 8de22030..00000000 --- a/includes/crypt.php +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/includes/funktion_counter.php b/includes/funktion_counter.php deleted file mode 100644 index 39d65a1f..00000000 --- a/includes/funktion_counter.php +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/includes/sys_counter.php b/includes/sys_counter.php new file mode 100644 index 00000000..abcb652b --- /dev/null +++ b/includes/sys_counter.php @@ -0,0 +1,10 @@ + diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 8c993d1b..6a24deaf 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -36,8 +36,8 @@ function make_onlineusers() { $html .= "
  • "; - if (isset ($user)) - $html .= DisplayAvatar($online_user['UID']); + //if (isset ($user)) + //$html .= DisplayAvatar($online_user['UID']); // Show Admin Page if (in_array("admin_user_edit", $privileges)) { diff --git a/www-ssl/index.php b/www-ssl/index.php index 5126981c..1e63ede7 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -1,6 +1,7 @@ make_menu(), 'content' => $content )); + +counter(); ?> -- cgit v1.2.3-70-g09d2 From de66e87c6f0c81d73a27d62a38c162a7aba905ad Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Thu, 2 Jun 2011 17:09:19 +0200 Subject: fix register --- includes/pages/guest_login.php | 2 +- includes/sys_menu.php | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'includes/sys_menu.php') diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index 7fe081fc..bbf36b6d 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -170,7 +170,7 @@ function guest_register() { $html .= "" . Get_Text("makeuser_Engelart") . "\n"; $html .= "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + break; + + case 'newsave' : + $vars = $_GET; + $count = count($vars) - 1; + $vars = array_splice($vars, 0, $count); + $Keys = ""; + $Values = ""; + foreach ($vars as $key => $value) { + $Keys .= ", `$key`"; + $Values .= ", '$value'"; + } + + if (runSQL_log("INSERT INTO `EngelType` (" . substr($Keys, 2) . ") VALUES (" . substr($Values, 2) . ")", "save new EngelType")) { + SetHeaderGo2Back(); + + $SQL2 = "SELECT * FROM `EngelType` WHERE `Name`='" . $_GET["Name"] . "'"; + $ERG = mysql_query($SQL2, $con); + + if (mysql_num_rows($ERG) == 1) + runSQL_log("ALTER TABLE `Room` ADD `DEFAULT_EID_" . mysql_result($ERG, 0, 0) . + "` INT DEFAULT '0' NOT NULL;", "add new EngelType in Romm Table"); + } + break; + + case 'change' : + if (!IsSet ($_GET["TID"])) + echo "Fehlerhafter Aufruf!"; + else { + echo "Raum abändern:\n"; + echo "Hier kannst du eintragen, den EngelType ändern."; + echo "
    \n"; + echo "\n"; + + $SQL2 = "SELECT * FROM `EngelType` WHERE `TID`='" . $_GET["TID"] . "'"; + $ERG = mysql_query($SQL2, $con); + + for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++) + echo "" . + "\n"; + + echo "
    " . mysql_field_name($ERG, $Uj) . "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    "; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo ""; + echo "
    "; + } + break; + + case 'changesave' : + $vars = $_GET; + $count = count($vars) - 2; + $vars = array_splice($vars, 0, $count); + $keys = ""; + $sql = ""; + foreach ($vars as $key => $value) { + $keys = substr($key, 1); + $sql .= ", `" . $keys . "`='" . $value . "'"; + } + runSQL_log("UPDATE `EngelType` SET " . substr($sql, 2) . " WHERE `TID`='" . $_GET["eTID"] . "'", "Save Change EngelType"); + SetHeaderGo2Back(); + break; + + case 'delete' : + if (IsSet ($_GET["TID"])) { + if (runSQL_log("DELETE FROM `EngelType` WHERE `TID`='" . $_GET["TID"] . "'", "delete EngelType")) + runSQL_log("ALTER TABLE `Room` DROP `DEFAULT_EID_" . $_GET["TID"] . "`;", "delete EngelType in Room Table"); + } else + echo "Fehlerhafter Aufruf"; + SetHeaderGo2Back(); + break; + } + } + + include ("includes/footer.php"); +} +?> diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 924d8e64..3b8847de 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -26,6 +26,7 @@ function make_navigation() { // Admin Navigation $menu .= make_navigation_for(Get_Text('admin/'), array ( + "admin_angel_types", "admin_rooms" )); return $menu; diff --git a/templates/admin_angel_types.html b/templates/admin_angel_types.html new file mode 100644 index 00000000..4ad8e9f1 --- /dev/null +++ b/templates/admin_angel_types.html @@ -0,0 +1,41 @@ +Angel types: + + + + + + + + + + %table% + +
    + Name + + Man + + Action +
    +
    +

    Create new Angel type:

    +
    + + + + + + + + + +
    + Name + + +
    + Man + + +
    +
    \ No newline at end of file diff --git a/www-ssl/index.php b/www-ssl/index.php index 184702c8..e8c900a5 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -45,6 +45,10 @@ if (in_array($p, $privileges)) { require_once ('includes/pages/guest_login.php'); $content = guest_logout(); } + elseif ($p == "admin_angel_types") { + require_once ('includes/pages/admin_angel_types.php'); + $content = admin_angel_types(); + } elseif ($p == "admin_rooms") { require_once ('includes/pages/admin_rooms.php'); $content = admin_rooms(); -- cgit v1.2.3-70-g09d2 From d381f57951463a366b5264986a147ef5798ba205 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Thu, 2 Jun 2011 20:18:01 +0200 Subject: user settings --- DB/db_rewrite.sql | 40 +++--- includes/pages/user_settings.php | 252 ++++++++++++++++++++++++++++++++++++ includes/sys_menu.php | 3 +- includes/sys_template.php | 11 ++ templates/user_settings.html | 106 +++++++++++++++ templates/user_settings_tshirt.html | 4 + txt/TODO | 5 + www-ssl/css/base.css | 4 - www-ssl/css/style10.css | 4 + www-ssl/index.php | 4 + www/404.php | 3 - www/index.php | 3 - 12 files changed, 410 insertions(+), 29 deletions(-) create mode 100644 includes/pages/user_settings.php create mode 100644 templates/user_settings.html create mode 100644 templates/user_settings_tshirt.html delete mode 100644 www/404.php delete mode 100644 www/index.php (limited to 'includes/sys_menu.php') diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index 64fe75e8..71b968e7 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 02. Juni 2011 um 15:48 +-- Erstellungszeit: 02. Juni 2011 um 18:17 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -25,7 +25,7 @@ CREATE TABLE IF NOT EXISTS `AngelTypes` ( `Man` text, PRIMARY KEY (`TID`), UNIQUE KEY `Name` (`Name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Daten für Tabelle `AngelTypes` @@ -33,7 +33,8 @@ CREATE TABLE IF NOT EXISTS `AngelTypes` ( INSERT INTO `AngelTypes` (`TID`, `Name`, `Man`) VALUES (1, 'Sex', ''), -(4, 'Audio', ''); +(4, 'Audio', ''), +(5, 'Massage', ''); -- -------------------------------------------------------- @@ -70,15 +71,16 @@ CREATE TABLE IF NOT EXISTS `Counter` ( -- INSERT INTO `Counter` (`URL`, `Anz`) VALUES -('news', 39), -('login', 5), -('logout', 2), -('start', 8), +('news', 44), +('login', 12), +('logout', 5), +('start', 13), ('faq', 4), -('credits', 2), -('register', 1), -('admin_rooms', 64), -('admin_angel_types', 58); +('credits', 3), +('register', 3), +('admin_rooms', 70), +('admin_angel_types', 68), +('user_settings', 109); -- -------------------------------------------------------- @@ -122,7 +124,7 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ; -- -- Daten für Tabelle `GroupPrivileges` @@ -135,7 +137,8 @@ INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES (4, -2, 4), (5, -1, 5), (6, -4, 6), -(7, -4, 7); +(7, -4, 7), +(8, -2, 8); -- -------------------------------------------------------- @@ -241,7 +244,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ; -- -- Daten für Tabelle `Privileges` @@ -254,7 +257,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (4, 'logout', 'User darf sich ausloggen'), (5, 'register', 'Einen neuen Engel registerieren'), (6, 'admin_rooms', 'Räume administrieren'), -(7, 'admin_angel_types', 'Engel Typen administrieren'); +(7, 'admin_angel_types', 'Engel Typen administrieren'), +(8, 'user_settings', 'User profile settings'); -- -------------------------------------------------------- @@ -606,7 +610,7 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('pub_menu_Wecken', 'DE', 'Wecken'), ('pub_menu_mySchichtplan', 'DE', 'Mein Schichtplan'), ('pub_menu_questionEngel', 'DE', 'Anfragen an die Dispatcher'), -('pub_menu_Einstellungen', 'DE', 'Einstellungen'), +('user_settings', 'DE', 'Einstellungen'), ('pub_menu_Engelbesprechung', 'EN', 'Drone meeting'), ('logout', 'DE', 'Abmelden'), ('pub_menu_Schichtplan', 'EN', 'Available Shifts'), @@ -615,7 +619,7 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('pub_menu_mySchichtplan', 'EN', 'My Shifts'), ('pub_menu_questionEngel', 'EN', 'Questions for the Dispatcher'), ('logout', 'EN', 'Logout'), -('pub_menu_Einstellungen', 'EN', 'Options'), +('user_settings', 'EN', 'Settings'), ('menu_Name', 'DE', 'Garage'), ('menu_Name', 'EN', 'Garage'), ('menu_MakeUser', 'DE', 'Benutzer anlegen'), @@ -1022,7 +1026,7 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', '', '', 0, '', '', '', '', NULL, NULL, '', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307029663, '0000-00-00 00:00:00', '', '', ''), +(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307038600, '0000-00-00 00:00:00', '', '', ''), (147, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', 'L', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, 0, 6, 'EN', 0, 'L', 1306971362, '2011-06-02 00:55:09', '', '', ''); -- -------------------------------------------------------- diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php new file mode 100644 index 00000000..97c8626f --- /dev/null +++ b/includes/pages/user_settings.php @@ -0,0 +1,252 @@ + Get_Text("makeuser_T-Shirt"), + 'size_select' => ($user['Tshirt'] == 0) ? html_select_key('size', array ( + 'S' => "S", + 'M' => "M", + 'L' => "L", + 'XL' => "XL", + '2XL' => "2XL", + '3XL' => "3XL", + '4XL' => "4XL", + '5XL' => "5XL", + 'S-G' => "S Girl", + 'M-G' => "M Girl", + 'L-G' => "L Girl", + 'XL-G' => "XL Girl" + ), $user['Size']) : $user['Size'] + )); + + return template_render('../templates/user_settings.html', array ( + 'link' => page_link_to("user_settings"), + 'greeting' => Get_Text("Hallo") . $user['Nick'] . ",
    " . Get_Text(13), + 'text_user_data' => Get_Text("pub_einstellungen_Text_UserData"), + 'label_nick' => Get_Text("pub_einstellungen_Nick"), + 'label_name' => Get_Text("pub_einstellungen_Name"), + 'label_prename' => Get_Text("pub_einstellungen_Vorname"), + 'label_age' => Get_Text("pub_einstellungen_Alter"), + 'label_tel' => Get_Text("pub_einstellungen_Telefon"), + 'label_mobile' => Get_Text("pub_einstellungen_Handy"), + 'label_dect' => Get_Text("pub_einstellungen_DECT"), + 'label_mail' => Get_Text("pub_einstellungen_Email"), + 'label_hometown' => Get_Text("pub_einstellungen_Hometown"), + 'nick' => $user['Nick'], + 'name' => $user['Name'], + 'prename' => $user['Vorname'], + 'age' => $user['Alter'], + 'tel' => $user['Telefon'], + 'mobile' => $user['Handy'], + 'dect' => $user['DECT'], + 'mail' => $user['email'], + 'icq' => $user['ICQ'], + 'jabber' => $user['jabber'], + 'hometown' => $user['Hometown'], + 'label_save' => Get_Text("save"), + 'tshirts' => $tshirt_html, + 'text_password' => Get_Text(14), + 'current_pw_label' => Get_Text(15), + 'new_pw_label' => Get_Text(16), + 'new_pw2_label' => Get_Text(17), + 'text_theme' => Get_Text(18), + 'theme_label' => Get_Text(19), + 'theme_select' => html_select_key('theme', array ( + "1" => "Standard-Style", + "2" => "ot/Gelber Style", + "3" => "Club-Mate Style", + "5" => "Debian Style", + "6" => "c-base Style", + "7" => "Blau/Gelber Style", + "8" => "Pastel Style", + "4" => "Test Style", + "9" => "Test Style 21c3", + "10" => "msquare (cccamp2011)" + ), $user['color']), + 'text_language' => Get_Text(20), + 'language_label' => Get_Text(21), + 'language_select' => html_select_key('language', array ( + 'DE' => "Deutsch", + 'EN' => "English" + ), $user['Sprache']) + )); + } else { + switch ($_REQUEST['action']) { + case 'sprache' : + if (isset ($_REQUEST['language']) && preg_match("/^DE|EN$/", $_REQUEST['language'])) + $language = $_REQUEST['language']; + else + $language = "EN"; + sql_query("UPDATE `User` SET " . "`Sprache`='" . sql_escape($language) . "' WHERE `UID`=" . sql_escape($user['UID']) . " LIMIT 1"); + $_SESSION['Sprache'] = $language; + header("Location: " . page_link_to("user_settings")); + break; + + case 'colour' : + $theme = preg_replace("/([^0-9]{1,})/ui", '', strip_tags($_REQUEST['theme'])); + sql_query("UPDATE `User` SET " . "`color`='" . sql_escape($theme) . "' WHERE `UID`=" . sql_escape($user['UID']) . " LIMIT 1"); + header("Location: " . page_link_to("user_settings")); + break; + + case 'set' : + $html = ""; + if ($_REQUEST["new_pw"] == $_REQUEST["new_pw2"]) { + if (PassCrypt($_REQUEST["current_pw"]) == $user['Passwort']) { + sql_query("UPDATE `User` SET `Passwort`='" . sql_escape(PassCrypt($_REQUEST['new_pw'])) . "' WHERE `UID`=" . sql_escape($user['UID']) . " LIMIT 1"); + header("Location: " . page_link_to("user_settings")); + } else { + $html .= error(Get_Text(30)); + } + } else { + $html .= error(Get_Text(31)); + } + return $html; + break; + + case "setUserData" : + $nick = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}]{1,})/ui", '', strip_tags($_REQUEST['nick'])); + $name = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}]{1,})/ui", '', strip_tags($_REQUEST['name'])); + $prename = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}]{1,})/ui", '', strip_tags($_REQUEST['prename'])); + $age = preg_replace("/([^0-9]{1,})/ui", '', strip_tags($_REQUEST['age'])); + $tel = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}]{1,})/ui", '', strip_tags($_REQUEST['tel'])); + $mobile = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}]{1,})/ui", '', strip_tags($_REQUEST['mobile'])); + $dect = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}]{1,})/ui", '', strip_tags($_REQUEST['dect'])); + $mail = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}]{1,})/ui", '', strip_tags($_REQUEST['mail'])); + $icq = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}]{1,})/ui", '', strip_tags($_REQUEST['icq'])); + $jabber = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}]{1,})/ui", '', strip_tags($_REQUEST['jabber'])); + $hometown = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}]{1,})/ui", '', strip_tags($_REQUEST['hometown'])); + $size = ($user['TShirt'] == 0) ? preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}]{1,})/ui", '', strip_tags($_REQUEST['size'])) : $user['Size']; + + sql_query("UPDATE `User` SET " . + "`Nick`='" . sql_escape($nick) . "', " . + "`Name`='" . sql_escape($name) . "', " . + "`Vorname`='" . sql_escape($prename) . "', " . + "`Alter`='" . sql_escape($age) . "', " . + "`Telefon`='" . sql_escape($tel) . "', " . + "`Handy`='" . sql_escape($mobile) . "', " . + "`DECT`='" . sql_escape($dect) . "', " . + "`email`='" . sql_escape($mail) . "', " . + "`ICQ`='" . sql_escape($icq) . "', " . + "`jabber`='" . sql_escape($jabber) . "', " . + "`Hometown`='" . sql_escape($hometown) . "', " . + "`Size`='" . sql_escape($size) . "' " . + "WHERE `UID`=" . sql_escape($user['UID']) . " LIMIT 1"); + header("Location: " . page_link_to("user_settings")); + break; + } + } + + // AVATARE + /* + if (get_cfg_var("file_uploads")) { + echo "
    \n
    \n
    \n\n"; + echo Get_Text('pub_einstellungen_PictureUpload') . "
    "; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "(max " . get_cfg_var("post_max_size") . "Byte)
    \n"; + echo "\n"; + echo "
    \n"; + } + + switch (GetPicturShow($_SESSION['UID'])) { + case 'Y' : + echo Get_Text('pub_einstellungen_PictureShow') . "
    "; + echo displayPictur($_SESSION['UID'], 0); + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + break; + case 'N' : + echo Get_Text('pub_einstellungen_PictureNoShow') . "
    "; + echo displayPictur($_SESSION['UID'], 0); + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "
    \n
    \n
    \n\n"; + case '' : + echo "
    \n
    \n
    \n\n"; + echo Get_Text(22) . "
    "; + echo "\n
    \n"; + echo "\n"; + echo "\n"; + echo "\n\n\n"; + echo "\n"; + echo "\n\n"; + echo "
    " . Get_Text(23) . "
    \n"; + echo "  \n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "
    \n"; + break; + } //CASE + + } else { + switch ($_POST["action"]) { + + case 'avatar' : + $chsql = "UPDATE `User` SET `Avatar`='" . $_POST["eAvatar"] . "' WHERE `UID`='" . $_SESSION['UID'] . "' LIMIT 1"; + $Erg = mysql_query($chsql, $con); + $_SESSION['Avatar'] = $_POST["eAvatar"]; + if ($Erg == 1) + Print_Text(34); + else + Print_Text(29); + break; + + case 'setUserData' : + + break; + + case 'sendPicture' : + if ($_FILES["file"]["size"] > 0) { + if (($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/gif")) { + $data = addslashes(fread(fopen($_FILES["file"]["tmp_name"], "r"), filesize($_FILES["file"]["tmp_name"]))); + + if (GetPicturShow($_SESSION['UID']) == "") + $SQL = "INSERT INTO `UserPicture` " . + "( `UID`,`Bild`, `ContentType`, `show`) " . + "VALUES ('" . $_SESSION['UID'] . "', '$data', '" . $_FILES["file"]["type"] . "', 'N')"; + else + $SQL = "UPDATE `UserPicture` SET " . + "`Bild`='$data', " . + "`ContentType`='" . $_FILES["file"]["type"] . "', " . + "`show`='N' " . + "WHERE `UID`='" . $_SESSION['UID'] . "'"; + + $res = mysql_query($SQL, $con); + if ($res) + Print_Text("pub_einstellungen_send_OK"); + else + Print_Text("pub_einstellungen_send_KO"); + + echo "
    ('" . $_FILES["file"]["name"] . "', MIME-Type: " . $_FILES["file"]["type"] . ", " . $_FILES["file"]["size"] . " Byte)
    "; + } else + Print_Text("pub_einstellungen_send_KO"); + } else + Print_Text("pub_einstellungen_send_KO"); + break; + + case 'delPicture' : + $chsql = "DELETE FROM `UserPicture` WHERE `UID`='" . $_SESSION['UID'] . "' LIMIT 1"; + $Erg = mysql_query($chsql, $con); + if ($Erg == 1) + Print_Text("pub_einstellungen_del_OK"); + else + Print_Text("pub_einstellungen_del_KO"); + Break; + } + } + */ +} +?> diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 3b8847de..da9d5666 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -21,7 +21,8 @@ function make_navigation() { // Engel Navigation $menu .= make_navigation_for(Get_Text('inc_schicht_engel'), array ( - "news" + "news", + "user_settings" )); // Admin Navigation diff --git a/includes/sys_template.php b/includes/sys_template.php index 2c7f4f22..893d2d7e 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -22,4 +22,15 @@ function html_options($name, $options, $selected = "") { return $html; } + +function html_select_key($name, $rows, $selected) { + $html = ''; + return $html; +} ?> \ No newline at end of file diff --git a/templates/user_settings.html b/templates/user_settings.html new file mode 100644 index 00000000..08790d33 --- /dev/null +++ b/templates/user_settings.html @@ -0,0 +1,106 @@ +%greeting% + +
    +%text_user_data% +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +%tshirts% +
    %label_nick%
    %label_name%
    %label_prename%
    %label_age%
    %label_tel%
    %label_mobile%
    %label_dect%
    %label_mail%
    ICQ
    jabber
    %label_hometown%
    + +
    + +
    + +%text_password% +
    + + + + +
    %current_pw_label%
    %new_pw_label%
    %new_pw2_label%
    + +
    + +
    + +%text_theme% +
    + + + + + +
    %theme_label% + %theme_select% +
    + +
    + +
    + +%text_language% +
    + + + + + +
    %language_label% + %language_select% +
    + +
    diff --git a/templates/user_settings_tshirt.html b/templates/user_settings_tshirt.html new file mode 100644 index 00000000..e147acae --- /dev/null +++ b/templates/user_settings_tshirt.html @@ -0,0 +1,4 @@ + + %label_size% + %size_select% + \ No newline at end of file diff --git a/txt/TODO b/txt/TODO index 21ea5ecc..c6d32b39 100644 --- a/txt/TODO +++ b/txt/TODO @@ -1,3 +1,8 @@ + * MD5-Passwörter mit Salt speichern + * Passwort-Mindestanforderungen stellen + * Avatare + + * schichten ueber monatsgrenzen einbaue im moment werden die tage nur hochgezaehlt und die monatzgrenzen werden ignoriert * verify use of dect_clear.php and jabberserver.php diff --git a/www-ssl/css/base.css b/www-ssl/css/base.css index 3a1a545f..5731fec0 100644 --- a/www-ssl/css/base.css +++ b/www-ssl/css/base.css @@ -101,10 +101,6 @@ table { border-collapse: collapse; } -tr:hover > td { - background: #f0f0f0; -} - th { background: #f0f0f0; } diff --git a/www-ssl/css/style10.css b/www-ssl/css/style10.css index 311097c7..fdaf9398 100644 --- a/www-ssl/css/style10.css +++ b/www-ssl/css/style10.css @@ -5,3 +5,7 @@ margin: 10px auto; width: 523px; } + +tr:hover > td { + background: #f0f0f0; +} \ No newline at end of file diff --git a/www-ssl/index.php b/www-ssl/index.php index e8c900a5..6b2e267b 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -33,6 +33,10 @@ if (in_array($p, $privileges)) { require_once ('includes/pages/user_news.php'); $content = user_news(); } + elseif ($p == "user_settings") { + require_once ('includes/pages/user_settings.php'); + $content = user_settings(); + } elseif ($p == "login") { require_once ('includes/pages/guest_login.php'); $content = guest_login(); diff --git a/www/404.php b/www/404.php deleted file mode 100644 index dc19cd26..00000000 --- a/www/404.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/www/index.php b/www/index.php deleted file mode 100644 index 9105555e..00000000 --- a/www/index.php +++ /dev/null @@ -1,3 +0,0 @@ - -- cgit v1.2.3-70-g09d2 From c0b15dfe0dce7c4603cc7ec7c19b5a6cf226dc95 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Thu, 2 Jun 2011 21:38:19 +0200 Subject: user messages --- DB/db_rewrite.sql | 64 +++--- includes/pages/user_messages.php | 216 +++++++++++++++++++++ includes/sys_menu.php | 1 + templates/user_messages.html | 50 +++++ txt/TODO | 5 +- www-ssl/css/base.css | 11 ++ www-ssl/css/style6.css | 2 +- www-ssl/index.php | 11 +- www-ssl/nonpublic/einstellungen.php | 376 ------------------------------------ www-ssl/nonpublic/index.php | 77 -------- 10 files changed, 331 insertions(+), 482 deletions(-) create mode 100644 includes/pages/user_messages.php create mode 100644 templates/user_messages.html delete mode 100644 www-ssl/nonpublic/einstellungen.php delete mode 100644 www-ssl/nonpublic/index.php (limited to 'includes/sys_menu.php') diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index 71b968e7..d4811235 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 02. Juni 2011 um 18:17 +-- Erstellungszeit: 02. Juni 2011 um 19:37 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -71,16 +71,17 @@ CREATE TABLE IF NOT EXISTS `Counter` ( -- INSERT INTO `Counter` (`URL`, `Anz`) VALUES -('news', 44), -('login', 12), -('logout', 5), -('start', 13), +('news', 73), +('login', 18), +('logout', 11), +('start', 23), ('faq', 4), ('credits', 3), ('register', 3), ('admin_rooms', 70), -('admin_angel_types', 68), -('user_settings', 109); +('admin_angel_types', 69), +('user_settings', 111), +('user_messages', 102); -- -------------------------------------------------------- @@ -124,7 +125,7 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; -- -- Daten für Tabelle `GroupPrivileges` @@ -138,7 +139,8 @@ INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES (5, -1, 5), (6, -4, 6), (7, -4, 7), -(8, -2, 8); +(8, -2, 8), +(9, -2, 9); -- -------------------------------------------------------- @@ -170,18 +172,28 @@ INSERT INTO `Groups` (`Name`, `UID`) VALUES -- CREATE TABLE IF NOT EXISTS `Messages` ( - `Datum` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `id` int(11) NOT NULL AUTO_INCREMENT, + `Datum` int(11) NOT NULL, `SUID` int(11) NOT NULL DEFAULT '0', `RUID` int(11) NOT NULL DEFAULT '0', `isRead` char(1) NOT NULL DEFAULT 'N', `Text` text NOT NULL, - PRIMARY KEY (`Datum`,`SUID`,`RUID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Fuers interen Communikationssystem'; + PRIMARY KEY (`id`), + KEY `Datum` (`Datum`), + KEY `SUID` (`SUID`), + KEY `RUID` (`RUID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Fuers interen Communikationssystem' AUTO_INCREMENT=8 ; -- -- Daten für Tabelle `Messages` -- +INSERT INTO `Messages` (`id`, `Datum`, `SUID`, `RUID`, `isRead`, `Text`) VALUES +(2, 1307042342, 1, 147, 'Y', 'asdfasdfasdfasdf'), +(4, 1307042622, 1, 147, 'Y', 'asdfasdfasdf'), +(5, 1307042643, 1, 147, 'Y', 'foobar'), +(6, 1307042663, 1, 147, 'Y', 'foobar'), +(7, 1307042692, 147, 1, 'Y', 'foobar'); -- -------------------------------------------------------- @@ -197,19 +209,16 @@ CREATE TABLE IF NOT EXISTS `News` ( `UID` int(11) NOT NULL DEFAULT '0', `Treffen` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`ID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Daten für Tabelle `News` -- INSERT INTO `News` (`ID`, `Datum`, `Betreff`, `Text`, `UID`, `Treffen`) VALUES -(3, '2011-06-02 01:32:31', '', '', 0, 0), -(4, '2011-06-02 01:36:27', 'Darf ich News erstellen?', 'Darf ich.', 0, 0), -(5, '2011-06-02 01:36:35', 'Darf ich News erstellen?', 'asdfasdfasdf', 1, 0), -(6, '2011-06-02 01:38:59', '"''>', '"''>\r\n', 1, 0), -(7, '2011-06-02 01:38:59', '"''>', '"''>\r\n', 1, 0), -(8, '2011-06-02 01:38:59', '"''>', '"''>\r\n', 1, 0); +(1, '2011-06-02 21:35:27', '', '', 1, 0), +(2, '2011-06-02 21:36:57', '', '', 1, 0), +(3, '2011-06-02 21:36:57', '', '', 1, 0); -- -------------------------------------------------------- @@ -244,7 +253,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; -- -- Daten für Tabelle `Privileges` @@ -258,7 +267,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (5, 'register', 'Einen neuen Engel registerieren'), (6, 'admin_rooms', 'Räume administrieren'), (7, 'admin_angel_types', 'Engel Typen administrieren'), -(8, 'user_settings', 'User profile settings'); +(8, 'user_settings', 'User profile settings'), +(9, 'user_messages', 'Writing and reading messages from user to user'); -- -------------------------------------------------------- @@ -800,8 +810,8 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('pub_einstellungen_Hometown', 'EN', 'hometown'), ('makeuser_error_Alter', 'DE', 'Fehler: Dein Alter muss eine Zahl oder leer sein'), ('makeuser_error_Alter', 'EN', 'error: your age must be a number or empty'), -('pub_menu_messages', 'DE', 'Nachrichten'), -('pub_menu_messages', 'EN', 'messages'), +('user_messages', 'DE', 'Nachrichten'), +('user_messages', 'EN', 'Messages'), ('pub_messages_Datum', 'DE', 'Datum'), ('pub_messages_Datum', 'EN', 'date'), ('pub_messages_Von', 'DE', 'Gesendet'), @@ -983,7 +993,9 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('login', 'DE', 'Login'), ('login', 'EN', 'Login'), ('credits', 'DE', 'Credits'), -('credits', 'EN', 'Credits'); +('credits', 'EN', 'Credits'), +('pub_messages_Neu', 'DE', 'Neu'), +('pub_messages_Neu', 'EN', 'New'); -- -------------------------------------------------------- @@ -1026,8 +1038,8 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307038600, '0000-00-00 00:00:00', '', '', ''), -(147, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', 'L', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, 0, 6, 'EN', 0, 'L', 1306971362, '2011-06-02 00:55:09', '', '', ''); +(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307043433, '0000-00-00 00:00:00', '', '', ''), +(147, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', 'L', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, 0, 6, 'EN', 0, 'L', 1307042703, '2011-06-02 00:55:09', '', '', ''); -- -------------------------------------------------------- diff --git a/includes/pages/user_messages.php b/includes/pages/user_messages.php new file mode 100644 index 00000000..e3e9a469 --- /dev/null +++ b/includes/pages/user_messages.php @@ -0,0 +1,216 @@ + 0) + return '

    ' . Get_Text("pub_messages_new1") . " " . $new_messages . " " . Get_Text("pub_messages_new2") . '


    '; + + return ""; +} + +function user_messages() { + global $user; + + if (!isset ($_REQUEST['action'])) { + $users = sql_select("SELECT * FROM `User` WHERE NOT `UID`=" . sql_escape($user['UID']) . " ORDER BY `Nick`"); + $to_select_data = array ( + "" => "Select receiver..." + ); + foreach ($users as $u) + $to_select_data[$u['UID']] = $u['Nick']; + $to_select = html_select_key('to', $to_select_data, ''); + + $messages_html = ""; + $messages = sql_select("SELECT * FROM `Messages` WHERE `SUID`=" . sql_escape($user['UID']) . " OR `RUID`=" . sql_escape($user['UID']) . " ORDER BY `isRead`,`Datum` DESC"); + foreach ($messages as $message) { + $messages_html .= ''; + $messages_html .= '' . ($message['isRead'] == 'N' ? '•' : '') . ''; + $messages_html .= '' . date("Y-m-d H:i", $message['Datum']) . ''; + $messages_html .= '' . UID2Nick($message['SUID']) . ''; + $messages_html .= '' . UID2Nick($message['RUID']) . ''; + $messages_html .= '' . str_replace("\n", '
    ', $message['Text']) . ''; + $messages_html .= ''; + if ($message['RUID'] == $user['UID']) { + if ($message['isRead'] == 'N') + $messages_html .= '' . Get_Text("pub_messages_MarkRead") . ''; + } else { + $messages_html .= '' . Get_Text("pub_messages_DelMsg") . ''; + } + $messages_html .= ''; + } + + return template_render('../templates/user_messages.html', array ( + 'link' => page_link_to("user_messages"), + 'greeting' => Get_Text("Hello") . $user['Nick'] . ",
    \n" . Get_Text("pub_messages_text1") . "

    \n", + 'messages' => $messages_html, + 'new_label' => Get_Text("pub_messages_Neu"), + 'date_label' => Get_Text("pub_messages_Datum"), + 'from_label' => Get_Text("pub_messages_Von"), + 'to_label' => Get_Text("pub_messages_An"), + 'text_label' => Get_Text("pub_messages_Text"), + 'date' => date("Y-m-d H:i"), + 'from' => $user['Nick'], + 'to_select' => $to_select, + 'submit_label' => Get_Text("save") + )); + } else { + switch ($_REQUEST['action']) { + case "read" : + if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) + $id = $_REQUEST['id']; + else + return error("Incomplete call, missing Message ID."); + + $message = sql_select("SELECT * FROM `Messages` WHERE `id`=" . sql_escape($id) . " LIMIT 1"); + if (count($message) > 0 && $message[0]['RUID'] == $user['UID']) { + sql_query("UPDATE `Messages` SET `isRead`='Y' WHERE `id`=" . sql_escape($id) . " LIMIT 1"); + header("Location: " . page_link_to("user_messages")); + } else + return error("No Message found."); + break; + + case "delete" : + if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) + $id = $_REQUEST['id']; + else + return error("Incomplete call, missing Message ID."); + + $message = sql_select("SELECT * FROM `Messages` WHERE `id`=" . sql_escape($id) . " LIMIT 1"); + if (count($message) > 0 && $message[0]['SUID'] == $user['UID']) { + sql_query("DELETE FROM `Messages` WHERE `id`=" . sql_escape($id) . " LIMIT 1"); + header("Location: " . page_link_to("user_messages")); + } else + return error("No Message found."); + break; + + case "send" : + $text = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['text'])); + $to = preg_replace("/([^0-9]{1,})/ui", '', strip_tags($_REQUEST['to'])); + if ($text != "" && is_numeric($to) && sql_num_query("SELECT * FROM `User` WHERE `UID`=" . sql_escape($to) . " AND NOT `UID`=" . sql_escape($user['UID']) . " LIMIT 1") > 0) { + sql_query("INSERT INTO `Messages` SET `Datum`=" . sql_escape(time()) . ", `SUID`=" . sql_escape($user['UID']) . ", `RUID`=" . sql_escape($to) . ", `Text`='" . sql_escape($text) . "'"); + header("Location: " . page_link_to("user_messages")); + } else { + return error(Get_Text("pub_messages_Send_Error")); + } + break; + } + return ""; + } + + if (!isset ($_GET["action"])) + $_GET["action"] = "start"; + + switch ($_GET["action"]) { + case "start" : + echo Get_Text("Hello") . $_SESSION['Nick'] . ",
    \n"; + echo Get_Text("pub_messages_text1") . "

    \n"; + + //show exist Messages + $SQL = "SELECT * FROM `Messages` WHERE `SUID`='" . $_SESSION["UID"] . "' OR `RUID`='" . $_SESSION["UID"] . "'"; + $erg = mysql_query($SQL, $con); + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + for ($i = 0; $i < mysql_num_rows($erg); $i++) { + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + // send Messeges + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + + // Listet alle Nicks auf + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + + echo "
    " . Get_Text("pub_messages_Datum") . "" . Get_Text("pub_messages_Von") . "" . Get_Text("pub_messages_An") . "" . Get_Text("pub_messages_Text") . "
    " . mysql_result($erg, $i, "Datum") . "" . UID2Nick(mysql_result($erg, $i, "SUID")) . "" . UID2Nick(mysql_result($erg, $i, "RUID")) . "" . mysql_result($erg, $i, "Text") . ""; + + if (mysql_result($erg, $i, "RUID") == $_SESSION["UID"]) { + echo "" . Get_Text("pub_messages_DelMsg") . ""; + + if (mysql_result($erg, $i, "isRead") == "N") + echo "" . Get_Text("pub_messages_MarkRead") . ""; + } else { + if (mysql_result($erg, $i, "isRead") == "N") + echo Get_Text("pub_messages_NotRead"); + } + + echo "
    \n"; + break; + + case "SendMsg" : + echo Get_Text("pub_messages_Send1") . "...
    \n"; + + $SQL = "INSERT INTO `Messages` ( `Datum` , `SUID` , `RUID` , `Text` ) VALUES (" . + "'" . gmdate("Y-m-j H:i:s", time()) . "', " . + "'" . $_SESSION["UID"] . "', " . + "'" . $_POST["RUID"] . "', " . + "'" . $_POST["Text"] . "');"; + + $Erg = mysql_query($SQL, $con); + + if ($Erg == 1) + echo Get_Text("pub_messages_Send_OK") . "\n"; + else + echo Get_Text("pub_messages_Send_Error") . "...\n(" . mysql_error($con) . ")"; + break; + + case "MarkRead" : + $SQL = "UPDATE `Messages` SET `isRead` = 'Y' " . + "WHERE `Datum` = '" . $_GET["Datum"] . "' AND `RUID`='" . $_SESSION["UID"] . "' " . + "LIMIT 1 ;"; + $Erg = mysql_query($SQL, $con); + + if ($Erg == 1) + echo Get_Text("pub_messages_MarkRead_OK") . "\n"; + else + echo Get_Text("pub_messages_MarkRead_KO") . "...\n(" . mysql_error($con) . ")"; + break; + + case "DelMsg" : + $SQL = "DELETE FROM `Messages` " . + "WHERE `Datum` = '" . $_GET["Datum"] . "' AND `RUID` ='" . $_SESSION["UID"] . "' " . + "LIMIT 1;"; + $Erg = mysql_query($SQL, $con); + + if ($Erg == 1) + echo Get_Text("pub_messages_DelMsg_OK") . "\n"; + else + echo Get_Text("pub_messages_DelMsg_KO") . "...\n(" . mysql_error($con) . ")"; + break; + + default : + echo Get_Text("pub_messages_NoCommand"); + } +} +?> diff --git a/includes/sys_menu.php b/includes/sys_menu.php index da9d5666..822d558f 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -22,6 +22,7 @@ function make_navigation() { // Engel Navigation $menu .= make_navigation_for(Get_Text('inc_schicht_engel'), array ( "news", + "user_messages", "user_settings" )); diff --git a/templates/user_messages.html b/templates/user_messages.html new file mode 100644 index 00000000..b7bb26fb --- /dev/null +++ b/templates/user_messages.html @@ -0,0 +1,50 @@ +%greeting% +
    + + + + + + + + + + + + + %messages% + + + + + + + + + +
    + %new_label% + + %date_label% + + %from_label% + + %to_label% + + %text_label% + +   +
    +   + + %date% + + %from% + + %to_select% + + + + +
    +
    \ No newline at end of file diff --git a/txt/TODO b/txt/TODO index c6d32b39..fbaf4377 100644 --- a/txt/TODO +++ b/txt/TODO @@ -1,6 +1,9 @@ * MD5-Passwörter mit Salt speichern * Passwort-Mindestanforderungen stellen - * Avatare + * User-Avatare + * user_messages schön machen + * Formulare weg von Tabellen + * user_news lässt sich nicht bedienen (POST ohne redirects...) * schichten ueber monatsgrenzen einbaue im moment werden die tage nur diff --git a/www-ssl/css/base.css b/www-ssl/css/base.css index 5731fec0..bfe050a5 100644 --- a/www-ssl/css/base.css +++ b/www-ssl/css/base.css @@ -128,3 +128,14 @@ td, th { .success { color: #090; } + +.notice { + background: #f0f0f0; + border: 2px solid #888; + margin: 10px; + padding: 10px; +} + +.new_message { + font-weight: bold; +} diff --git a/www-ssl/css/style6.css b/www-ssl/css/style6.css index 2272f598..8dc008e7 100644 --- a/www-ssl/css/style6.css +++ b/www-ssl/css/style6.css @@ -71,6 +71,6 @@ h4.menu { font-size : 6pt; } -h4, h1 { +h4, h1, th { background: #333E47; } diff --git a/www-ssl/index.php b/www-ssl/index.php index 6b2e267b..48aea75c 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -13,6 +13,8 @@ require_once ('includes/sys_user.php'); require_once ('config/config.php'); require_once ('config/config_db.php'); +require_once ('includes/pages/user_messages.php'); + session_start(); sql_connect($config['host'], $config['user'], $config['pw'], $config['db']); @@ -20,7 +22,7 @@ sql_connect($config['host'], $config['user'], $config['pw'], $config['db']); load_auth(); // Gewünschte Seite/Funktion -$p = "start"; +$p = isset ($user) ? "news" : "start"; if (isset ($_REQUEST['p'])) $p = $_REQUEST['p']; @@ -33,6 +35,9 @@ if (in_array($p, $privileges)) { require_once ('includes/pages/user_news.php'); $content = user_news(); } + elseif ($p == "user_messages") { + $content = user_messages(); + } elseif ($p == "user_settings") { require_once ('includes/pages/user_settings.php'); $content = user_settings(); @@ -79,6 +84,10 @@ elseif ($p == "faq") { } } +// Hinweis für ungelesene Nachrichten +if (isset ($user) && $p != "user_messages") + $content = user_unread_messages() . $content; + echo template_render('../templates/layout.html', array ( 'theme' => isset ($user) ? $user['color'] : $default_theme, 'title' => $title, diff --git a/www-ssl/nonpublic/einstellungen.php b/www-ssl/nonpublic/einstellungen.php deleted file mode 100644 index 713425bb..00000000 --- a/www-ssl/nonpublic/einstellungen.php +++ /dev/null @@ -1,376 +0,0 @@ -\n\n"; - Print_Text(13); -?> -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ">
    ICQ
    jabber
    - "> -
    -
    - -
    - -
    - - - - - -
    - "> -
    -
    - -
    -
    - -
    - - - - - - - - - - -
    - -
    Menu>L - >R -
    - "> -
    -
    -
    -
    - -
    - - - - - -
    - -
    - "> -
    - -\n
    \n
    \n\n"; - echo Get_Text('pub_einstellungen_PictureUpload') . "
    "; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "(max " . get_cfg_var("post_max_size") . "Byte)
    \n"; - echo "\n"; - echo "
    \n"; - } - - switch (GetPicturShow($_SESSION['UID'])) { - case 'Y' : - echo Get_Text('pub_einstellungen_PictureShow') . "
    "; - echo displayPictur($_SESSION['UID'], 0); - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "
    \n"; - break; - case 'N' : - echo Get_Text('pub_einstellungen_PictureNoShow') . "
    "; - echo displayPictur($_SESSION['UID'], 0); - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "
    \n
    \n
    \n\n"; - case '' : - echo "
    \n
    \n
    \n\n"; - echo Get_Text(22) . "
    "; - echo "\n
    \n"; - echo "\n"; - echo "\n"; - echo "\n\n\n"; - echo "\n"; - echo "\n\n"; - echo "
    " . Get_Text(23) . "
    \n"; - echo "  \n"; - echo "\n"; - echo "
    \n"; - echo "\n"; - echo "
    \n"; - break; - } //CASE - -} else { - switch ($_POST["action"]) { - case 'set' : - if ($_POST["new1"] == $_POST["new2"]) { - Print_Text(25); - $sql = "SELECT * FROM `User` WHERE `UID`='" . $_SESSION['UID'] . "'"; - $Erg = mysql_query($sql, $con); - - if (PassCrypt($_POST["old"]) == mysql_result($Erg, 0, "Passwort")) { - Print_Text(26); - Print_Text(27); - $usql = "UPDATE `User` SET `Passwort`='" . PassCrypt($_POST["new1"]) . "' WHERE `UID`='" . $_SESSION['UID'] . "' LIMIT 1"; - $Erg = mysql_query($usql, $con); - - if ($Erg == 1) { - Print_Text(28); - } else { - Print_Text(29); - } - } else { - Print_Text(30); - } - } else { - Print_Text(31); - } - break; - - case 'colour' : - - $chsql = "UPDATE `User` SET " . - "`color`= '" . $_POST["colourid"] . "', " . - "`Menu`= '" . $_POST["eMenu"] . "' " . - "WHERE `UID`='" . $_SESSION['UID'] . "' LIMIT 1"; - $Erg = mysql_query($chsql, $con); - echo mysql_error($con); - $_SESSION['color'] = $_POST["colourid"]; - $_SESSION['Menu'] = $_POST["eMenu"]; - if ($Erg == 1) { - Print_Text(32); - } else { - Print_Text(29); - } - break; - - case 'sprache' : - - $chsql = "UPDATE `User` SET `Sprache` = '" . $_POST["language"] . "' WHERE `UID`='" . $_SESSION['UID'] . "' LIMIT 1"; - $Erg = mysql_query($chsql, $con); - $_SESSION['Sprache'] = $_POST["language"]; - if ($Erg == 1) { - Print_Text(33); - } else { - Print_Text(29); - } - break; - - case 'avatar' : - $chsql = "UPDATE `User` SET `Avatar`='" . $_POST["eAvatar"] . "' WHERE `UID`='" . $_SESSION['UID'] . "' LIMIT 1"; - $Erg = mysql_query($chsql, $con); - $_SESSION['Avatar'] = $_POST["eAvatar"]; - if ($Erg == 1) - Print_Text(34); - else - Print_Text(29); - break; - - case 'setUserData' : - if ($_SESSION['CVS']["Change T_Shirt Size"] == "Y") { - $chsql = "UPDATE `User` SET " . - "`Nick`='" . $_POST["eNick"] . "', `Name`='" . $_POST["eName"] . "', " . - "`Vorname`='" . $_POST["eVorname"] . "', `Alter`='" . $_POST["eAlter"] . "', " . - "`Telefon`='" . $_POST["eTelefon"] . "', `Handy`='" . $_POST["eHandy"] . "', " . - "`DECT`='" . $_POST["eDECT"] . "', `email`='" . $_POST["eemail"] . "', " . - "`ICQ`='" . $_POST["eICQ"] . "', `jabber`='" . $_POST["ejabber"] . "', " . - "`Hometown`='" . $_POST["Hometown"] . "', `Size`='" . $_POST["Sizeid"] . "' " . - "WHERE `UID`='" . $_SESSION['UID'] . "' LIMIT 1;"; - } else { - $chsql = "UPDATE `User` SET " . - "`Nick`='" . $_POST["eNick"] . "', `Name`='" . $_POST["eName"] . "', " . - "`Vorname`='" . $_POST["eVorname"] . "', `Alter`='" . $_POST["eAlter"] . "', " . - "`Telefon`='" . $_POST["eTelefon"] . "', `Handy`='" . $_POST["eHandy"] . "', " . - "`DECT`='" . $_POST["eDECT"] . "', `email`='" . $_POST["eemail"] . "', " . - "`ICQ`='" . $_POST["eICQ"] . "', `jabber`='" . $_POST["ejabber"] . "', " . - "`Hometown`='" . $_POST["Hometown"] . "' " . - "WHERE `UID`='" . $_SESSION['UID'] . "' LIMIT 1;"; - } - $Erg = mysql_query($chsql, $con); - - if ($Erg == 1) { - $_SESSION['Nick'] = $_POST["eNick"]; - $_SESSION['Name'] = $_POST["eName"]; - $_SESSION['Vorname'] = $_POST["eVorname"]; - $_SESSION['Alter'] = $_POST["eAlter"]; - $_SESSION['Telefon'] = $_POST["eTelefon"]; - $_SESSION['Handy'] = $_POST["eHandy"]; - $_SESSION['DECT'] = $_POST["eDECT"]; - $_SESSION['email'] = $_POST["eemail"]; - $_SESSION['ICQ'] = $_POST["eICQ"]; - $_SESSION['jabber'] = $_POST["ejabber"]; - $_SESSION['Hometown'] = $_POST["Hometown"]; - if ($_SESSION['CVS']["Change T_Shirt Size"] == "Y") { - $_SESSION['Size'] = $_POST["Sizeid"]; - } else - if ($_SESSION['Size'] != $_POST["Sizeid"]) { - array_push($error_messages, "einstellungen.php, change t-shirt size not allowed\n"); - } - - Print_Text("pub_einstellungen_UserDateSaved"); - } else { - Print_Text(29); - echo mysql_error($con); - } - break; - - case 'sendPicture' : - if ($_FILES["file"]["size"] > 0) { - if (($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/gif")) { - $data = addslashes(fread(fopen($_FILES["file"]["tmp_name"], "r"), filesize($_FILES["file"]["tmp_name"]))); - - if (GetPicturShow($_SESSION['UID']) == "") - $SQL = "INSERT INTO `UserPicture` " . - "( `UID`,`Bild`, `ContentType`, `show`) " . - "VALUES ('" . $_SESSION['UID'] . "', '$data', '" . $_FILES["file"]["type"] . "', 'N')"; - else - $SQL = "UPDATE `UserPicture` SET " . - "`Bild`='$data', " . - "`ContentType`='" . $_FILES["file"]["type"] . "', " . - "`show`='N' " . - "WHERE `UID`='" . $_SESSION['UID'] . "'"; - - $res = mysql_query($SQL, $con); - if ($res) - Print_Text("pub_einstellungen_send_OK"); - else - Print_Text("pub_einstellungen_send_KO"); - - echo "
    ('" . $_FILES["file"]["name"] . "', MIME-Type: " . $_FILES["file"]["type"] . ", " . $_FILES["file"]["size"] . " Byte)
    "; - } else - Print_Text("pub_einstellungen_send_KO"); - } else - Print_Text("pub_einstellungen_send_KO"); - break; - - case 'delPicture' : - $chsql = "DELETE FROM `UserPicture` WHERE `UID`='" . $_SESSION['UID'] . "' LIMIT 1"; - $Erg = mysql_query($chsql, $con); - if ($Erg == 1) - Print_Text("pub_einstellungen_del_OK"); - else - Print_Text("pub_einstellungen_del_KO"); - Break; - } -} -include ("includes/footer.php"); -?> diff --git a/www-ssl/nonpublic/index.php b/www-ssl/nonpublic/index.php deleted file mode 100644 index b53f8088..00000000 --- a/www-ssl/nonpublic/index.php +++ /dev/null @@ -1,77 +0,0 @@ - 1 --> keine Anmeldung - if ($user_anz == 0) - $ErrorText = "pub_index_User_unset"; - else - $ErrorText = "pub_index_User_more_as_one"; - } // Ende Check, ob User angemeldet wurde -} -include ("includes/header.php"); -if (isset ($ErrorText)) - echo "

    " . Get_Text($ErrorText) . "


    \n"; -include ("includes/login_eingabefeld.php"); -include ("includes/footer.php"); -?> - - -- cgit v1.2.3-70-g09d2 From 3afd05636e46aedb53e1c1d954d23d6563b5e104 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Thu, 2 Jun 2011 22:40:08 +0200 Subject: admin groups --- DB/db_rewrite.sql | 28 ++++---- includes/funktion_menu.php | 40 ----------- includes/pages/admin_groups.php | 73 ++++++++++++++++++++ includes/sys_menu.php | 3 +- templates/admin_groups.html | 21 ++++++ templates/admin_groups_edit_form.html | 21 ++++++ txt/TODO | 2 + www-ssl/admin/group.php | 49 -------------- www-ssl/index.php | 4 ++ www-ssl/nonpublic/messages.php | 124 ---------------------------------- 10 files changed, 139 insertions(+), 226 deletions(-) delete mode 100644 includes/funktion_menu.php create mode 100644 includes/pages/admin_groups.php create mode 100644 templates/admin_groups.html create mode 100644 templates/admin_groups_edit_form.html delete mode 100644 www-ssl/admin/group.php delete mode 100644 www-ssl/nonpublic/messages.php (limited to 'includes/sys_menu.php') diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index d4811235..5041ce9b 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 02. Juni 2011 um 19:37 +-- Erstellungszeit: 02. Juni 2011 um 20:39 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -80,8 +80,9 @@ INSERT INTO `Counter` (`URL`, `Anz`) VALUES ('register', 3), ('admin_rooms', 70), ('admin_angel_types', 69), -('user_settings', 111), -('user_messages', 102); +('user_settings', 115), +('user_messages', 102), +('admin_groups', 86); -- -------------------------------------------------------- @@ -125,22 +126,22 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=28 ; -- -- Daten für Tabelle `GroupPrivileges` -- INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES -(1, -1, 1), -(2, -1, 2), +(24, -1, 5), (3, -2, 3), (4, -2, 4), -(5, -1, 5), +(23, -1, 2), (6, -4, 6), (7, -4, 7), (8, -2, 8), -(9, -2, 9); +(9, -2, 9), +(12, -5, 10); -- -------------------------------------------------------- @@ -253,7 +254,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; -- -- Daten für Tabelle `Privileges` @@ -268,7 +269,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (6, 'admin_rooms', 'Räume administrieren'), (7, 'admin_angel_types', 'Engel Typen administrieren'), (8, 'user_settings', 'User profile settings'), -(9, 'user_messages', 'Writing and reading messages from user to user'); +(9, 'user_messages', 'Writing and reading messages from user to user'), +(10, 'admin_groups', 'Manage usergroups and their rights'); -- -------------------------------------------------------- @@ -995,7 +997,9 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('credits', 'DE', 'Credits'), ('credits', 'EN', 'Credits'), ('pub_messages_Neu', 'DE', 'Neu'), -('pub_messages_Neu', 'EN', 'New'); +('pub_messages_Neu', 'EN', 'New'), +('admin_groups', 'DE', 'Gruppenrechte'), +('admin_groups', 'EN', 'Grouprights'); -- -------------------------------------------------------- @@ -1038,7 +1042,7 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307043433, '0000-00-00 00:00:00', '', '', ''), +(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307046926, '0000-00-00 00:00:00', '', '', ''), (147, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', 'L', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, 0, 6, 'EN', 0, 'L', 1307042703, '2011-06-02 00:55:09', '', '', ''); -- -------------------------------------------------------- diff --git a/includes/funktion_menu.php b/includes/funktion_menu.php deleted file mode 100644 index 0a324758..00000000 --- a/includes/funktion_menu.php +++ /dev/null @@ -1,40 +0,0 @@ - $Entry) - if (strpos($Key, ".php") > 0) - if ((strpos("00$Key", "0$MenuName") > 0) || ((strlen($MenuName) == 0) && (strpos("0$Key", "/") == 0))) { - $TempName = Get_Text($Key, true); - - if ((true || $debug) && ($TempName == "")) - $TempName = "not found: \"$Key\""; - - if ($Entry == "Y") { - //zum absichtlkichen ausblenden von einträgen - if (strlen($TempName) > 1) { - //sonderfälle: - - if ($Key == "admin/faq.php") - $TempName .= " (" . noAnswer() . ")"; - elseif ($Key == "credits.php") continue; - //ausgabe - $Text .= "
  • $TempName
  • \n"; - $Gefunden = true; - } - } - elseif ($debug) { - $Gefunden = true; - $Text .= "
  • $TempName ($Key)
  • \n"; - } - } - if ($Gefunden) - echo ''; -} //function ShowMenue -?> diff --git a/includes/pages/admin_groups.php b/includes/pages/admin_groups.php new file mode 100644 index 00000000..5d9d8180 --- /dev/null +++ b/includes/pages/admin_groups.php @@ -0,0 +1,73 @@ +'; + $groups_html .= '' . $group['Name'] . ''; + $privileges = sql_select("SELECT * FROM `GroupPrivileges` JOIN `Privileges` ON (`GroupPrivileges`.`privilege_id` = `Privileges`.`id`) WHERE `group_id`=" . sql_escape($group['UID'])); + $privileges_html = array (); + foreach ($privileges as $priv) + $privileges_html[] = $priv['name']; + $groups_html .= '' . join(", ", $privileges_html) . ''; + $groups_html .= 'Ändern'; + $groups_html .= ''; + } + + return template_render('../templates/admin_groups.html', array ( + 'nick' => $user['Nick'], + 'groups' => $groups_html + )); + } else { + switch ($_REQUEST["action"]) { + case 'edit' : + if (isset ($_REQUEST['id']) && preg_match("/^-[0-9]{1,11}$/", $_REQUEST['id'])) + $id = $_REQUEST['id']; + else + return error("Incomplete call, missing Groups ID."); + + $room = sql_select("SELECT * FROM `Groups` WHERE `UID`=" . sql_escape($id) . " LIMIT 1"); + if (count($room) > 0) { + list ($room) = $room; + $privileges = sql_select("SELECT `Privileges`.*, `GroupPrivileges`.`group_id` FROM `Privileges` LEFT OUTER JOIN `GroupPrivileges` ON (`Privileges`.`id` = `GroupPrivileges`.`privilege_id` AND `GroupPrivileges`.`group_id`=" . sql_escape($id) . ") ORDER BY `Privileges`.`name`"); + $privileges_html = ""; + foreach ($privileges as $priv) + $privileges_html .= '' . $priv['name'] . '' . $priv['desc'] . ''; + + $html .= template_render('../templates/admin_groups_edit_form.html', array ( + 'link' => page_link_to("admin_groups"), + 'id' => $id, + 'privileges' => $privileges_html + )); + } else + return error("No Group found."); + break; + + case 'save' : + if (isset ($_REQUEST['id']) && preg_match("/^-[0-9]{1,11}$/", $_REQUEST['id'])) + $id = $_REQUEST['id']; + else + return error("Incomplete call, missing Groups ID."); + + $room = sql_select("SELECT * FROM `Groups` WHERE `UID`=" . sql_escape($id) . " LIMIT 1"); + if (!is_array($_REQUEST['privileges'])) + $_REQUEST['privileges'] = array (); + if (count($room) > 0) { + list ($room) = $room; + sql_query("DELETE FROM `GroupPrivileges` WHERE `group_id`=" . sql_escape($id)); + foreach ($_REQUEST['privileges'] as $priv) + if (preg_match("/^[0-9]{1,}$/", $priv) && sql_num_query("SELECT * FROM `Privileges` WHERE `id`=" . sql_escape($priv)) > 0) + sql_query("INSERT INTO `GroupPrivileges` SET `group_id`=" . sql_escape($id) . ", `privilege_id`=" . sql_escape($priv)); + header("Location: " . page_link_to("admin_groups")); + } else + return error("No Group found."); + break; + } + } + return $html; +} +?> diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 822d558f..739cb9d1 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -29,7 +29,8 @@ function make_navigation() { // Admin Navigation $menu .= make_navigation_for(Get_Text('admin/'), array ( "admin_angel_types", - "admin_rooms" + "admin_rooms", + "admin_groups" )); return $menu; } diff --git a/templates/admin_groups.html b/templates/admin_groups.html new file mode 100644 index 00000000..c5b4ac57 --- /dev/null +++ b/templates/admin_groups.html @@ -0,0 +1,21 @@ +Hallo %nick%, +
    +hier hast du die Möglichkeit Gruppenrechte zu ändern: + + + + + + + + + + %groups% + +
    + Name + + Rechte + +   +
    diff --git a/templates/admin_groups_edit_form.html b/templates/admin_groups_edit_form.html new file mode 100644 index 00000000..5729df64 --- /dev/null +++ b/templates/admin_groups_edit_form.html @@ -0,0 +1,21 @@ +
    + + + + + + + + + + %privileges% + +
    +   + + Name + + Description +
    + +
    \ No newline at end of file diff --git a/txt/TODO b/txt/TODO index fbaf4377..1ebf5e52 100644 --- a/txt/TODO +++ b/txt/TODO @@ -4,6 +4,8 @@ * user_messages schön machen * Formulare weg von Tabellen * user_news lässt sich nicht bedienen (POST ohne redirects...) + * Privilegien korrigieren (an die vom CVS anpassen) + * Beim Raum-Management die benötigten Engel anzeigen * schichten ueber monatsgrenzen einbaue im moment werden die tage nur diff --git a/www-ssl/admin/group.php b/www-ssl/admin/group.php deleted file mode 100644 index b8a52ec2..00000000 --- a/www-ssl/admin/group.php +++ /dev/null @@ -1,49 +0,0 @@ -\n"; - echo "\n"; - echo "\tGroupname\n"; - echo "\tLink\n"; - echo "\n"; - - for ($n = 0; $n < $Zeilen; $n++) { - echo "\n"; - echo "\t" . mysql_result($Erg, $n, "Name") . "\n"; - - echo "change\n"; - echo "\n"; - } - - // new form - echo "\n"; - echo "\t
    \n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t
    \n"; - echo "\n"; - - echo "\t\n"; - // Ende Userliste -} - -include ("includes/footer.php"); -?> - - diff --git a/www-ssl/index.php b/www-ssl/index.php index 48aea75c..6bfbcc32 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -61,6 +61,10 @@ if (in_array($p, $privileges)) { elseif ($p == "admin_rooms") { require_once ('includes/pages/admin_rooms.php'); $content = admin_rooms(); + } + elseif ($p == "admin_groups") { + require_once ('includes/pages/admin_groups.php'); + $content = admin_groups(); } else { require_once ('includes/pages/guest_start.php'); $content = guest_start(); diff --git a/www-ssl/nonpublic/messages.php b/www-ssl/nonpublic/messages.php deleted file mode 100644 index 4868136d..00000000 --- a/www-ssl/nonpublic/messages.php +++ /dev/null @@ -1,124 +0,0 @@ -\n"; - echo Get_Text("pub_messages_text1") . "

    \n"; - - //show exist Messages - $SQL = "SELECT * FROM `Messages` WHERE `SUID`='" . $_SESSION["UID"] . "' OR `RUID`='" . $_SESSION["UID"] . "'"; - $erg = mysql_query($SQL, $con); - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - for ($i = 0; $i < mysql_num_rows($erg); $i++) { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - - // send Messeges - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - - // Listet alle Nicks auf - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - - echo "
    " . Get_Text("pub_messages_Datum") . "" . Get_Text("pub_messages_Von") . "" . Get_Text("pub_messages_An") . "" . Get_Text("pub_messages_Text") . "
    " . mysql_result($erg, $i, "Datum") . "" . UID2Nick(mysql_result($erg, $i, "SUID")) . "" . UID2Nick(mysql_result($erg, $i, "RUID")) . "" . mysql_result($erg, $i, "Text") . ""; - - if (mysql_result($erg, $i, "RUID") == $_SESSION["UID"]) { - echo "" . Get_Text("pub_messages_DelMsg") . ""; - - if (mysql_result($erg, $i, "isRead") == "N") - echo "" . Get_Text("pub_messages_MarkRead") . ""; - } else { - if (mysql_result($erg, $i, "isRead") == "N") - echo Get_Text("pub_messages_NotRead"); - } - - echo "
    \n"; - break; - - case "SendMsg" : - echo Get_Text("pub_messages_Send1") . "...
    \n"; - - $SQL = "INSERT INTO `Messages` ( `Datum` , `SUID` , `RUID` , `Text` ) VALUES (" . - "'" . gmdate("Y-m-j H:i:s", time()) . "', " . - "'" . $_SESSION["UID"] . "', " . - "'" . $_POST["RUID"] . "', " . - "'" . $_POST["Text"] . "');"; - - $Erg = mysql_query($SQL, $con); - - if ($Erg == 1) - echo Get_Text("pub_messages_Send_OK") . "\n"; - else - echo Get_Text("pub_messages_Send_Error") . "...\n(" . mysql_error($con) . ")"; - break; - - case "MarkRead" : - $SQL = "UPDATE `Messages` SET `isRead` = 'Y' " . - "WHERE `Datum` = '" . $_GET["Datum"] . "' AND `RUID`='" . $_SESSION["UID"] . "' " . - "LIMIT 1 ;"; - $Erg = mysql_query($SQL, $con); - - if ($Erg == 1) - echo Get_Text("pub_messages_MarkRead_OK") . "\n"; - else - echo Get_Text("pub_messages_MarkRead_KO") . "...\n(" . mysql_error($con) . ")"; - break; - - case "DelMsg" : - $SQL = "DELETE FROM `Messages` " . - "WHERE `Datum` = '" . $_GET["Datum"] . "' AND `RUID` ='" . $_SESSION["UID"] . "' " . - "LIMIT 1;"; - $Erg = mysql_query($SQL, $con); - - if ($Erg == 1) - echo Get_Text("pub_messages_DelMsg_OK") . "\n"; - else - echo Get_Text("pub_messages_DelMsg_KO") . "...\n(" . mysql_error($con) . ")"; - break; - - default : - echo Get_Text("pub_messages_NoCommand"); -} - -include "includes/footer.php"; -?> -- cgit v1.2.3-70-g09d2 From 0d6499f7f1aadabc345f6896fa3ad26f7a299150 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Thu, 2 Jun 2011 23:45:54 +0200 Subject: user questions --- DB/db_rewrite.sql | 45 ++++++++++++++++++--------------- includes/pages/user_questions.php | 41 ++++++++++++++++++++++++++++++ includes/sys_menu.php | 1 + templates/user_questions.html | 52 +++++++++++++++++++++++++++++++++++++++ txt/TODO | 4 +-- www-ssl/admin/dect_call.php | 8 ------ www-ssl/index.php | 4 +++ 7 files changed, 125 insertions(+), 30 deletions(-) create mode 100644 includes/pages/user_questions.php create mode 100644 templates/user_questions.html delete mode 100644 www-ssl/admin/dect_call.php (limited to 'includes/sys_menu.php') diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index 5041ce9b..6a259c61 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 02. Juni 2011 um 20:39 +-- Erstellungszeit: 02. Juni 2011 um 21:45 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -71,18 +71,19 @@ CREATE TABLE IF NOT EXISTS `Counter` ( -- INSERT INTO `Counter` (`URL`, `Anz`) VALUES -('news', 73), -('login', 18), -('logout', 11), -('start', 23), +('news', 78), +('login', 20), +('logout', 12), +('start', 24), ('faq', 4), ('credits', 3), ('register', 3), ('admin_rooms', 70), ('admin_angel_types', 69), -('user_settings', 115), -('user_messages', 102), -('admin_groups', 86); +('user_settings', 116), +('user_messages', 107), +('admin_groups', 94), +('user_questions', 30); -- -------------------------------------------------------- @@ -126,21 +127,22 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=28 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=33 ; -- -- Daten für Tabelle `GroupPrivileges` -- INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES +(32, -2, 8), (24, -1, 5), -(3, -2, 3), -(4, -2, 4), +(31, -2, 11), +(30, -2, 9), (23, -1, 2), (6, -4, 6), (7, -4, 7), -(8, -2, 8), -(9, -2, 9), +(29, -2, 3), +(28, -2, 4), (12, -5, 10); -- -------------------------------------------------------- @@ -192,8 +194,6 @@ CREATE TABLE IF NOT EXISTS `Messages` ( INSERT INTO `Messages` (`id`, `Datum`, `SUID`, `RUID`, `isRead`, `Text`) VALUES (2, 1307042342, 1, 147, 'Y', 'asdfasdfasdfasdf'), (4, 1307042622, 1, 147, 'Y', 'asdfasdfasdf'), -(5, 1307042643, 1, 147, 'Y', 'foobar'), -(6, 1307042663, 1, 147, 'Y', 'foobar'), (7, 1307042692, 147, 1, 'Y', 'foobar'); -- -------------------------------------------------------- @@ -254,7 +254,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ; -- -- Daten für Tabelle `Privileges` @@ -270,7 +270,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (7, 'admin_angel_types', 'Engel Typen administrieren'), (8, 'user_settings', 'User profile settings'), (9, 'user_messages', 'Writing and reading messages from user to user'), -(10, 'admin_groups', 'Manage usergroups and their rights'); +(10, 'admin_groups', 'Manage usergroups and their rights'), +(11, 'user_questions', 'Let users ask questions'); -- -------------------------------------------------------- @@ -285,12 +286,14 @@ CREATE TABLE IF NOT EXISTS `Questions` ( `AID` int(11) NOT NULL DEFAULT '0', `Answer` text NOT NULL, PRIMARY KEY (`QID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Fragen und Antworten' AUTO_INCREMENT=21 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Fragen und Antworten' AUTO_INCREMENT=4 ; -- -- Daten für Tabelle `Questions` -- +INSERT INTO `Questions` (`QID`, `UID`, `Question`, `AID`, `Answer`) VALUES +(3, 1, 'Ficken?', 0, ''); -- -------------------------------------------------------- @@ -999,7 +1002,9 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('pub_messages_Neu', 'DE', 'Neu'), ('pub_messages_Neu', 'EN', 'New'), ('admin_groups', 'DE', 'Gruppenrechte'), -('admin_groups', 'EN', 'Grouprights'); +('admin_groups', 'EN', 'Grouprights'), +('user_questions', 'DE', 'Erzengel fragen'), +('user_questions', 'EN', 'Ask arch angel'); -- -------------------------------------------------------- @@ -1042,7 +1047,7 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307046926, '0000-00-00 00:00:00', '', '', ''), +(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307051093, '0000-00-00 00:00:00', '', '', ''), (147, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', 'L', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, 0, 6, 'EN', 0, 'L', 1307042703, '2011-06-02 00:55:09', '', '', ''); -- -------------------------------------------------------- diff --git a/includes/pages/user_questions.php b/includes/pages/user_questions.php new file mode 100644 index 00000000..8201c6d6 --- /dev/null +++ b/includes/pages/user_questions.php @@ -0,0 +1,41 @@ +' . $question['Question'] . 'Delete'; + + return template_render('../templates/user_questions.html', array ( + 'link' => page_link_to("user_questions"), + 'open_questions' => $open_questions + )); + } else { + switch ($_REQUEST['action']) { + case 'ask' : + $question = trim(preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['question']))); + if ($question != "") { + sql_query("INSERT INTO `Questions` SET `UID`=" . sql_escape($user['UID']) . ", `Question`='" . sql_escape($question) . "'"); + header("Location: " . page_link_to("user_questions")); + } else + return error("Please enter a Question!"); + break; + case 'delete' : + if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) + $id = $_REQUEST['id']; + else + return error("Incomplete call, missing Question ID."); + + $question = sql_select("SELECT * FROM `Questions` WHERE `QID`=" . sql_escape($id) . " LIMIT 1"); + if (count($question) > 0 && $question[0]['UID'] == $user['UID']) { + sql_query("DELETE FROM `Questions` WHERE `QID`=" . sql_escape($id) . " LIMIT 1"); + header("Location: " . page_link_to("user_questions")); + } else + return error("No Question found."); + break; + } + } +} +?> \ No newline at end of file diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 739cb9d1..6cddf66a 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -23,6 +23,7 @@ function make_navigation() { $menu .= make_navigation_for(Get_Text('inc_schicht_engel'), array ( "news", "user_messages", + "user_questions", "user_settings" )); diff --git a/templates/user_questions.html b/templates/user_questions.html new file mode 100644 index 00000000..96b1e980 --- /dev/null +++ b/templates/user_questions.html @@ -0,0 +1,52 @@ +Not yet answered questions: + + + + + + + + + %open_questions% + +
    + Question + +   +
    +
    Answered questions: + + + + + + + + + + + %answered_questions% + +
    + Question + + From + + Answer + +   +
    +
    +
    + + + + + +
    + Question: + + +
    + +
    \ No newline at end of file diff --git a/txt/TODO b/txt/TODO index 1ebf5e52..14188a6f 100644 --- a/txt/TODO +++ b/txt/TODO @@ -1,12 +1,12 @@ * MD5-Passwörter mit Salt speichern * Passwort-Mindestanforderungen stellen - * User-Avatare + * User-Avatare (code liegt auskommentiert in user_settings.php) * user_messages schön machen * Formulare weg von Tabellen * user_news lässt sich nicht bedienen (POST ohne redirects...) * Privilegien korrigieren (an die vom CVS anpassen) * Beim Raum-Management die benötigten Engel anzeigen - + * Löschen nur mit Rückfrage * schichten ueber monatsgrenzen einbaue im moment werden die tage nur hochgezaehlt und die monatzgrenzen werden ignoriert diff --git a/www-ssl/admin/dect_call.php b/www-ssl/admin/dect_call.php deleted file mode 100644 index 0799c2be..00000000 --- a/www-ssl/admin/dect_call.php +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/www-ssl/index.php b/www-ssl/index.php index 6bfbcc32..831225e6 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -38,6 +38,10 @@ if (in_array($p, $privileges)) { elseif ($p == "user_messages") { $content = user_messages(); } + elseif ($p == "user_questions") { + require_once ('includes/pages/user_questions.php'); + $content = user_questions(); + } elseif ($p == "user_settings") { require_once ('includes/pages/user_settings.php'); $content = user_settings(); -- cgit v1.2.3-70-g09d2 From 32b3ce5f900cf0d378f77a6675b989ee0e641f13 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 3 Jun 2011 00:22:11 +0200 Subject: admin questions --- DB/db_rewrite.sql | 43 +++++++++++---------- includes/pages/admin_questions.php | 76 ++++++++++++++++++++++++++++++++++++++ includes/pages/user_messages.php | 10 +++-- includes/pages/user_questions.php | 17 +++++++-- includes/sys_menu.php | 7 +++- templates/admin_questions.html | 47 +++++++++++++++++++++++ templates/user_questions.html | 2 +- www-ssl/index.php | 8 ++++ 8 files changed, 181 insertions(+), 29 deletions(-) create mode 100644 includes/pages/admin_questions.php create mode 100644 templates/admin_questions.html (limited to 'includes/sys_menu.php') diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index 6a259c61..5d6b4e2c 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 02. Juni 2011 um 21:45 +-- Erstellungszeit: 02. Juni 2011 um 22:21 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -71,19 +71,20 @@ CREATE TABLE IF NOT EXISTS `Counter` ( -- INSERT INTO `Counter` (`URL`, `Anz`) VALUES -('news', 78), -('login', 20), -('logout', 12), -('start', 24), -('faq', 4), +('news', 80), +('login', 24), +('logout', 13), +('start', 25), +('faq', 6), ('credits', 3), ('register', 3), ('admin_rooms', 70), ('admin_angel_types', 69), ('user_settings', 116), -('user_messages', 107), -('admin_groups', 94), -('user_questions', 30); +('user_messages', 108), +('admin_groups', 99), +('user_questions', 53), +('admin_questions', 41); -- -------------------------------------------------------- @@ -127,7 +128,7 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=33 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=36 ; -- -- Daten für Tabelle `GroupPrivileges` @@ -139,11 +140,12 @@ INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES (31, -2, 11), (30, -2, 9), (23, -1, 2), -(6, -4, 6), -(7, -4, 7), +(34, -4, 12), +(33, -4, 7), (29, -2, 3), (28, -2, 4), -(12, -5, 10); +(12, -5, 10), +(35, -4, 6); -- -------------------------------------------------------- @@ -254,7 +256,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ; -- -- Daten für Tabelle `Privileges` @@ -271,7 +273,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (8, 'user_settings', 'User profile settings'), (9, 'user_messages', 'Writing and reading messages from user to user'), (10, 'admin_groups', 'Manage usergroups and their rights'), -(11, 'user_questions', 'Let users ask questions'); +(11, 'user_questions', 'Let users ask questions'), +(12, 'admin_questions', 'Answer user''s questions'); -- -------------------------------------------------------- @@ -286,14 +289,14 @@ CREATE TABLE IF NOT EXISTS `Questions` ( `AID` int(11) NOT NULL DEFAULT '0', `Answer` text NOT NULL, PRIMARY KEY (`QID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Fragen und Antworten' AUTO_INCREMENT=4 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Fragen und Antworten' AUTO_INCREMENT=5 ; -- -- Daten für Tabelle `Questions` -- INSERT INTO `Questions` (`QID`, `UID`, `Question`, `AID`, `Answer`) VALUES -(3, 1, 'Ficken?', 0, ''); +(4, 1, 'Hallo?\nEy?', 1, 'Jo,\nJo!'); -- -------------------------------------------------------- @@ -1004,7 +1007,9 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('admin_groups', 'DE', 'Gruppenrechte'), ('admin_groups', 'EN', 'Grouprights'), ('user_questions', 'DE', 'Erzengel fragen'), -('user_questions', 'EN', 'Ask arch angel'); +('user_questions', 'EN', 'Ask arch angel'), +('admin_questions', 'DE', 'Fragen beantworten'), +('admin_questions', 'EN', 'Answer questions'); -- -------------------------------------------------------- @@ -1047,7 +1052,7 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307051093, '0000-00-00 00:00:00', '', '', ''), +(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307053257, '0000-00-00 00:00:00', '', '', ''), (147, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', 'L', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, 0, 6, 'EN', 0, 'L', 1307042703, '2011-06-02 00:55:09', '', '', ''); -- -------------------------------------------------------- diff --git a/includes/pages/admin_questions.php b/includes/pages/admin_questions.php new file mode 100644 index 00000000..5355dd86 --- /dev/null +++ b/includes/pages/admin_questions.php @@ -0,0 +1,76 @@ + 0) + return '

    There are unanswered questions!


    '; + } + + return ""; +} + +function admin_questions() { + global $user; + + if (!isset ($_REQUEST['action'])) { + $open_questions = ""; + $questions = sql_select("SELECT * FROM `Questions` WHERE `AID`=0"); + foreach ($questions as $question) { + $open_questions .= '' . UID2Nick($question['UID']) . '' . str_replace("\n", '
    ', $question['Question']) . ''; + $open_questions .= '

    '; + $open_questions .= 'Delete'; + } + + $answered_questions = ""; + $questions = sql_select("SELECT * FROM `Questions` WHERE `AID`>0"); + foreach ($questions as $question) { + $answered_questions .= '' . UID2Nick($question['UID']) . '' . str_replace("\n", '
    ', $question['Question']) . ''; + $answered_questions .= '' . UID2Nick($question['AID']) . '' . str_replace("\n", '
    ', $question['Answer']) . ''; + $answered_questions .= 'Delete'; + } + + return template_render('../templates/admin_questions.html', array ( + 'link' => page_link_to("admin_questions"), + 'open_questions' => $open_questions, + 'answered_questions' => $answered_questions + )); + } else { + switch ($_REQUEST['action']) { + case 'answer' : + if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) + $id = $_REQUEST['id']; + else + return error("Incomplete call, missing Question ID."); + + $question = sql_select("SELECT * FROM `Questions` WHERE `QID`=" . sql_escape($id) . " LIMIT 1"); + if (count($question) > 0 && $question[0]['AID'] == "0") { + $answer = trim(preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['answer']))); + + if ($answer != "") { + sql_query("UPDATE `Questions` SET `AID`=" . sql_escape($user['UID']) . ", `Answer`='" . sql_escape($answer) . "' WHERE `QID`=" . sql_escape($id) . " LIMIT 1"); + header("Location: " . page_link_to("admin_questions")); + } else + return error("Please enter an answer!"); + } else + return error("No question found."); + break; + case 'delete' : + if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) + $id = $_REQUEST['id']; + else + return error("Incomplete call, missing Question ID."); + + $question = sql_select("SELECT * FROM `Questions` WHERE `QID`=" . sql_escape($id) . " LIMIT 1"); + if (count($question) > 0) { + sql_query("DELETE FROM `Questions` WHERE `QID`=" . sql_escape($id) . " LIMIT 1"); + header("Location: " . page_link_to("admin_questions")); + } else + return error("No question found."); + break; + } + } +} +?> \ No newline at end of file diff --git a/includes/pages/user_messages.php b/includes/pages/user_messages.php index e3e9a469..30871d9d 100644 --- a/includes/pages/user_messages.php +++ b/includes/pages/user_messages.php @@ -1,11 +1,13 @@ 0) - return '

    ' . Get_Text("pub_messages_new1") . " " . $new_messages . " " . Get_Text("pub_messages_new2") . '


    '; + if ($new_messages > 0) + return '

    ' . Get_Text("pub_messages_new1") . " " . $new_messages . " " . Get_Text("pub_messages_new2") . '


    '; + } return ""; } diff --git a/includes/pages/user_questions.php b/includes/pages/user_questions.php index 8201c6d6..4e9daa5a 100644 --- a/includes/pages/user_questions.php +++ b/includes/pages/user_questions.php @@ -6,11 +6,20 @@ function user_questions() { $open_questions = ""; $questions = sql_select("SELECT * FROM `Questions` WHERE `AID`=0 AND `UID`=" . sql_escape($user['UID'])); foreach ($questions as $question) - $open_questions .= '' . $question['Question'] . 'Delete'; + $open_questions .= '' . str_replace("\n", '
    ', $question['Question']) . 'Delete'; + + $answered_questions = ""; + $questions = sql_select("SELECT * FROM `Questions` WHERE `AID`>0 AND `UID`=" . sql_escape($user['UID'])); + foreach ($questions as $question) { + $answered_questions .= '' . str_replace("\n", '
    ', $question['Question']) . ''; + $answered_questions .= '' . UID2Nick($question['AID']) . '' . str_replace("\n", '
    ', $question['Answer']) . ''; + $answered_questions .= 'Delete'; + } return template_render('../templates/user_questions.html', array ( 'link' => page_link_to("user_questions"), - 'open_questions' => $open_questions + 'open_questions' => $open_questions, + 'answered_questions' => $answered_questions )); } else { switch ($_REQUEST['action']) { @@ -20,7 +29,7 @@ function user_questions() { sql_query("INSERT INTO `Questions` SET `UID`=" . sql_escape($user['UID']) . ", `Question`='" . sql_escape($question) . "'"); header("Location: " . page_link_to("user_questions")); } else - return error("Please enter a Question!"); + return error("Please enter a question!"); break; case 'delete' : if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) @@ -33,7 +42,7 @@ function user_questions() { sql_query("DELETE FROM `Questions` WHERE `QID`=" . sql_escape($id) . " LIMIT 1"); header("Location: " . page_link_to("user_questions")); } else - return error("No Question found."); + return error("No question found."); break; } } diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 6cddf66a..c3dfa041 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -29,6 +29,7 @@ function make_navigation() { // Admin Navigation $menu .= make_navigation_for(Get_Text('admin/'), array ( + "admin_questions", "admin_angel_types", "admin_rooms", "admin_groups" @@ -39,9 +40,13 @@ function make_navigation() { function make_navigation_for($name, $pages) { global $privileges, $p; + $specials = array ( + "faq" + ); + $menu = ""; foreach ($pages as $page) - if (in_array($page, $privileges)) + if (in_array($page, $privileges) || in_array($page, $specials)) $menu .= '' . Get_Text($page) . ''; if ($menu != "") diff --git a/templates/admin_questions.html b/templates/admin_questions.html new file mode 100644 index 00000000..ad8d6572 --- /dev/null +++ b/templates/admin_questions.html @@ -0,0 +1,47 @@ +Not yet answered questions: + + + + + + + + + + + %open_questions% + +
    + From + + Question + + Answer + +   +
    +
    Answered questions: + + + + + + + + + + + + %answered_questions% + +
    + Question + + From + + Answer + + From + +   +
    diff --git a/templates/user_questions.html b/templates/user_questions.html index 96b1e980..f5fb46ae 100644 --- a/templates/user_questions.html +++ b/templates/user_questions.html @@ -36,7 +36,7 @@ Not yet answered questions: %answered_questions% -
    +
    Ask an arch angel:
    diff --git a/www-ssl/index.php b/www-ssl/index.php index 831225e6..d722de32 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -13,6 +13,7 @@ require_once ('includes/sys_user.php'); require_once ('config/config.php'); require_once ('config/config_db.php'); +require_once ('includes/pages/admin_questions.php'); require_once ('includes/pages/user_messages.php'); session_start(); @@ -58,6 +59,9 @@ if (in_array($p, $privileges)) { require_once ('includes/pages/guest_login.php'); $content = guest_logout(); } + elseif ($p == "admin_questions") { + $content = admin_questions(); + } elseif ($p == "admin_angel_types") { require_once ('includes/pages/admin_angel_types.php'); $content = admin_angel_types(); @@ -96,6 +100,10 @@ elseif ($p == "faq") { if (isset ($user) && $p != "user_messages") $content = user_unread_messages() . $content; +// Erzengel Hinweis für unbeantwortete Fragen +if (isset ($user) && $p != "admin_questions") + $content = admin_new_questions() . $content; + echo template_render('../templates/layout.html', array ( 'theme' => isset ($user) ? $user['color'] : $default_theme, 'title' => $title, -- cgit v1.2.3-70-g09d2 From 626b9a81f303a07fab5be1302496d8823d1fede4 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 3 Jun 2011 01:03:39 +0200 Subject: admin faq --- DB/db_rewrite.sql | 65 +++++---- includes/pages/admin_faq.php | 85 ++++++++++++ includes/pages/guest_faq.php | 32 ++--- includes/sys_menu.php | 3 +- templates/admin_faq.html | 56 ++++++++ templates/admin_faq_edit_form.html | 41 ++++++ txt/TODO | 1 + www-ssl/admin/faq.1.php | 6 - www-ssl/admin/faq.php | 271 ------------------------------------- www-ssl/css/base.css | 5 + www-ssl/index.php | 4 + www-ssl/nonpublic/faq.php | 73 ---------- 12 files changed, 240 insertions(+), 402 deletions(-) create mode 100644 includes/pages/admin_faq.php create mode 100644 templates/admin_faq.html create mode 100644 templates/admin_faq_edit_form.html delete mode 100644 www-ssl/admin/faq.1.php delete mode 100644 www-ssl/admin/faq.php delete mode 100644 www-ssl/nonpublic/faq.php (limited to 'includes/sys_menu.php') diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index 5d6b4e2c..fa31c6f8 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 02. Juni 2011 um 22:21 +-- Erstellungszeit: 02. Juni 2011 um 23:02 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -75,16 +75,17 @@ INSERT INTO `Counter` (`URL`, `Anz`) VALUES ('login', 24), ('logout', 13), ('start', 25), -('faq', 6), +('faq', 16), ('credits', 3), ('register', 3), ('admin_rooms', 70), ('admin_angel_types', 69), ('user_settings', 116), -('user_messages', 108), -('admin_groups', 99), -('user_questions', 53), -('admin_questions', 41); +('user_messages', 111), +('admin_groups', 104), +('user_questions', 54), +('admin_questions', 41), +('admin_faq', 53); -- -------------------------------------------------------- @@ -94,27 +95,29 @@ INSERT INTO `Counter` (`URL`, `Anz`) VALUES CREATE TABLE IF NOT EXISTS `FAQ` ( `FID` bigint(20) NOT NULL AUTO_INCREMENT, - `Frage` text NOT NULL, - `Antwort` text NOT NULL, + `Frage_de` text NOT NULL, + `Antwort_de` text NOT NULL, + `Frage_en` text NOT NULL, + `Antwort_en` text NOT NULL, PRIMARY KEY (`FID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=24 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=26 ; -- -- Daten für Tabelle `FAQ` -- -INSERT INTO `FAQ` (`FID`, `Frage`, `Antwort`) VALUES -(1, 'Komme ich als Engel billiger/kostenlos auf den Congress?
    \r\nDo I get in cheaper / for free to the congress as an angel ?', 'Nein, jeder Engel muss normal Eintritt bezahlen.
    \r\nNo, every angel has to pay full price.'), -(2, 'Was bekomme ich für meine Mitarbeit?
    \r\nWhat can i expect in return for my help? \r\n', 'Jeder Engel der arbeitet bekommt ein kostenloses T-Shirt nach der Veranstalltung
    \r\nEvery working angel gets a free shirt after the event. '), -(3, 'Wie lange muss ich als Engel arbeiten?
    \r\nHow long do I have to work as an angel ?', 'Diese Frage ist schwer zu beantworten. Es hängt z.B. davon ab, was man macht (z.B. Workshop-Engel) und wieviele Engel wir zusammen bekommen.
    \r\nThis is difficult to answer. It depends on what you decide to do (e.g. workshop angel) and how many people will attend. '), -(6, 'Ich bin erst XX Jahre alt. Kann ich überhaupt helfen?
    \r\nI''m only XX years old. Can I help anyway?', 'Wir können jede helfende Hand gebrauchen. Wenn du alt genug bist, um zum Congress zu kommen, bist du auch alt genug zu helfen.
    \r\nWe need every help we can get. If your old enough to come to the congress, your old enough to help.'), -(8, 'Wer sind eigentlich die Erzengel?
    \r\nWho are the Arch-Angels?\r\n', 'Erzengel sind dieses Jahr: BugBlue, TabascoEye, Jeedi, Daizy, volty
    \r\nThe ArchAngels for this year are: BugBlue, TabascoEye, Jeedi, Daizy, volty\r\n'), -(9, 'Gibt es dieses Jahr wieder einen IRC-Channel für Engel?
    \r\nWill there be an IRC-channel for angels again?', 'Ja, im IRC-Net existiert #chaos-angel. Einfach mal reinschaun!
    \r\nYes, in the IRC-net there''s #chaos-angel. Just have a look!'), -(10, 'Wie gehe ich mit den Besuchern um?
    \r\nHow do I treat visitors?', 'Man soll gegenüber den Besuchern immer höflich und freundlich sein, auch wenn diese gestresst sind. Wenn man das Gefühl hat, dass man mit der Situation nicht mehr klarkommt, sollte man sich jemanden zur Unterstützung holen, bevor man selbst auch gestresst wird :-)
    \r\nYou should always be polite and friendly, especially if they are stressed. When you feel you can''t handle it on your own, get someone to help you out before you get so stressed yourself that you get impolite.'), -(11, 'Wann sind die Engelbesprechungen?
    \r\nWhen are the angels briefings?', 'Das wird vor Ort noch festgelegt und steht im Himmelnewssystem.
    \r\nThe information on the Angel Briefings will be in the news section of this system.'), -(12, 'Was muss ich noch bedenken?
    \r\nAnything else I should know?', 'Man sollte nicht total übermüdet oder ausgehungert, wenn n man einen Einsatz hat. Eine gewisse Fitness ist hilfreich.
    \r\nYou should not be exhausted or starving when you arrive for a shift. A reasonable amount of fitness for work would be very helpful.'), -(13, 'Ich habe eine Frage, auf die ich in der FAQ keine Antwort gefunden habe. Wohin soll ich mich wenden?
    \r\nI have a guestion not answered here. Who can I ask?', 'Bei weitere Fragen kannst du die Anfragen an die Erzengel Formular benutzen.
    \r\nIf you have further questions, you can use the Questions for the ArchAngels form.'), -(20, 'Wer muss alles Eintritt zahlen?
    \r\nWho has to pay the full entrance price?', 'Jeder. Zumindest, solange er/sie älter als 12 Jahre ist...
    \r\nEveryone who is at older than 12 years old.'); +INSERT INTO `FAQ` (`FID`, `Frage_de`, `Antwort_de`, `Frage_en`, `Antwort_en`) VALUES +(1, 'Komme ich als Engel billiger/kostenlos auf den Congress?', 'Nein, jeder Engel muss normal Eintritt bezahlen.', 'Do I get in cheaper / for free to the congress as an angel ?', 'No, every angel has to pay full price.'), +(2, 'Was bekomme ich für meine Mitarbeit?', 'Jeder Engel der arbeitet bekommt ein kostenloses T-Shirt nach der Veranstalltung', 'What can i expect in return for my help?', 'Every working angel gets a free shirt after the event.'), +(3, 'Wie lange muss ich als Engel arbeiten?', 'Diese Frage ist schwer zu beantworten. Es hängt z.B. davon ab, was man macht (z.B. Workshop-Engel) und wieviele Engel wir zusammen bekommen.', 'How long do I have to work as an angel ?', 'This is difficult to answer. It depends on what you decide to do (e.g. workshop angel) and how many people will attend.'), +(6, 'Ich bin erst XX Jahre alt. Kann ich überhaupt helfen?', 'Wir können jede helfende Hand gebrauchen. Wenn du alt genug bist, um zum Congress zu kommen, bist du auch alt genug zu helfen.', 'I''m only XX years old. Can I help anyway?', 'We need every help we can get. If your old enough to come to the congress, your old enough to help.'), +(8, 'Wer sind eigentlich die Erzengel?', 'Erzengel sind dieses Jahr: BugBlue, TabascoEye, Jeedi, Daizy, volty', 'Who are the Arch-Angels?', 'The ArchAngels for this year are: BugBlue, TabascoEye, Jeedi, Daizy, volty'), +(9, 'Gibt es dieses Jahr wieder einen IRC-Channel für Engel?', 'Ja, im IRC-Net existiert #chaos-angel. Einfach mal reinschaun!', 'Will there be an IRC-channel for angels again?', 'Yes, in the IRC-net there''s #chaos-angel. Just have a look!'), +(10, 'Wie gehe ich mit den Besuchern um?', 'Man soll gegenüber den Besuchern immer höflich und freundlich sein, auch wenn diese gestresst sind. Wenn man das Gefühl hat, dass man mit der Situation nicht mehr klarkommt, sollte man sich jemanden zur Unterstützung holen, bevor man selbst auch gestresst wird :-)', 'How do I treat visitors?', 'You should always be polite and friendly, especially if they are stressed. When you feel you can''t handle it on your own, get someone to help you out before you get so stressed yourself that you get impolite.'), +(11, 'Wann sind die Engelbesprechungen?', 'Das wird vor Ort noch festgelegt und steht im Himmelnewssystem.', 'When are the angels briefings?', 'The information on the Angel Briefings will be in the news section of this system.'), +(12, 'Was muss ich noch bedenken?', 'Man sollte nicht total übermüdet oder ausgehungert, wenn n man einen Einsatz hat. Eine gewisse Fitness ist hilfreich.', 'Anything else I should know?', 'You should not be exhausted or starving when you arrive for a shift. A reasonable amount of fitness for work would be very helpful.'), +(13, 'Ich habe eine Frage, auf die ich in der FAQ keine Antwort gefunden habe. Wohin soll ich mich wenden?', 'Bei weitere Fragen kannst du die Anfragen an die Erzengel Formular benutzen.', 'I have a guestion not answered here. Who can I ask?', 'If you have further questions, you can use the Questions for the ArchAngels form.'), +(20, 'Wer muss alles Eintritt zahlen?', 'Jeder. Zumindest, solange er/sie älter als 12 Jahre ist...', 'Who has to pay the full entrance price?', 'Everyone who is at older than 12 years old.'); -- -------------------------------------------------------- @@ -128,7 +131,7 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=36 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=40 ; -- -- Daten für Tabelle `GroupPrivileges` @@ -140,12 +143,13 @@ INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES (31, -2, 11), (30, -2, 9), (23, -1, 2), -(34, -4, 12), -(33, -4, 7), +(36, -4, 7), +(37, -4, 13), (29, -2, 3), (28, -2, 4), (12, -5, 10), -(35, -4, 6); +(38, -4, 12), +(39, -4, 6); -- -------------------------------------------------------- @@ -256,7 +260,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ; -- -- Daten für Tabelle `Privileges` @@ -274,7 +278,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (9, 'user_messages', 'Writing and reading messages from user to user'), (10, 'admin_groups', 'Manage usergroups and their rights'), (11, 'user_questions', 'Let users ask questions'), -(12, 'admin_questions', 'Answer user''s questions'); +(12, 'admin_questions', 'Answer user''s questions'), +(13, 'admin_faq', 'Edit FAQs'); -- -------------------------------------------------------- @@ -1009,7 +1014,9 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('user_questions', 'DE', 'Erzengel fragen'), ('user_questions', 'EN', 'Ask arch angel'), ('admin_questions', 'DE', 'Fragen beantworten'), -('admin_questions', 'EN', 'Answer questions'); +('admin_questions', 'EN', 'Answer questions'), +('admin_faq', 'DE', 'FAQs bearbeiten'), +('admin_faq', 'EN', 'Edit FAQs'); -- -------------------------------------------------------- @@ -1052,7 +1059,7 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307053257, '0000-00-00 00:00:00', '', '', ''), +(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307055685, '0000-00-00 00:00:00', '', '', ''), (147, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', 'L', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, 0, 6, 'EN', 0, 'L', 1307042703, '2011-06-02 00:55:09', '', '', ''); -- -------------------------------------------------------- diff --git a/includes/pages/admin_faq.php b/includes/pages/admin_faq.php new file mode 100644 index 00000000..5b9a338f --- /dev/null +++ b/includes/pages/admin_faq.php @@ -0,0 +1,85 @@ +
    '; + $faqs_html .= ''; + } + return template_render('../templates/admin_faq.html', array ( + 'link' => page_link_to("admin_faq"), + 'faqs' => $faqs_html + )); + } else { + switch ($_REQUEST['action']) { + case 'create' : + $frage = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['frage'])); + $antwort = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['antwort'])); + $question = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['question'])); + $answer = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['answer'])); + sql_query("INSERT INTO `FAQ` SET `Frage_de`='" . sql_escape($frage) . "', `Frage_en`='" . sql_escape($question) . "', `Antwort_de`='" . sql_escape($antwort) . "', `Antwort_en`='" . sql_escape($answer) . "'"); + header("Location: " . page_link_to("admin_faq")); + break; + + case 'save' : + if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) + $id = $_REQUEST['id']; + else + return error("Incomplete call, missing FAQ ID."); + + $faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1"); + if (count($faq) > 0) { + list ($faq) = $faq; + + $frage = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['frage'])); + $antwort = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['antwort'])); + $question = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['question'])); + $answer = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['answer'])); + sql_query("UPDATE `FAQ` SET `Frage_de`='" . sql_escape($frage) . "', `Frage_en`='" . sql_escape($question) . "', `Antwort_de`='" . sql_escape($antwort) . "', `Antwort_en`='" . sql_escape($answer) . "' WHERE `FID`=" . sql_escape($id) . " LIMIT 1"); + header("Location: " . page_link_to("admin_faq")); + } else + return error("No FAQ found."); + break; + + case 'edit' : + if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) + $id = $_REQUEST['id']; + else + return error("Incomplete call, missing FAQ ID."); + + $faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1"); + if (count($faq) > 0) { + list ($faq) = $faq; + + return template_render('../templates/admin_faq_edit_form.html', array ( + 'link' => page_link_to("admin_faq"), + 'id' => $id, + 'frage' => $faq['Frage_de'], + 'antwort' => $faq['Antwort_de'], + 'question' => $faq['Frage_en'], + 'answer' => $faq['Antwort_en'] + )); + } else + return error("No FAQ found."); + break; + + case 'delete' : + if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) + $id = $_REQUEST['id']; + else + return error("Incomplete call, missing FAQ ID."); + + $faq = sql_select("SELECT * FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1"); + if (count($faq) > 0) { + list ($faq) = $faq; + + sql_query("DELETE FROM `FAQ` WHERE `FID`=" . sql_escape($id) . " LIMIT 1"); + header("Location: " . page_link_to("admin_faq")); + } else + return error("No FAQ found."); + break; + } + } +} +?> \ No newline at end of file diff --git a/includes/pages/guest_faq.php b/includes/pages/guest_faq.php index 48e75d16..c4bcd0bb 100644 --- a/includes/pages/guest_faq.php +++ b/includes/pages/guest_faq.php @@ -2,29 +2,17 @@ function guest_faq() { $html = ""; $faqs = sql_select("SELECT * FROM `FAQ`"); - foreach ($faqs as $faq) - if ($faq['Antwort'] != "") { - list ($frage_de, $frage_en) = explode('
    ', $faq['Frage']); - list ($antwort_de, $antwort_en) = explode('
    ', $faq['Antwort']); - $html .= "
    "; - if ($_SESSION['Sprache'] == "DE") { - $html .= "
    " . $frage_de . "
    "; - $html .= "
    " . $antwort_de . "
    "; - } else { - $html .= "
    " . $frage_en . "
    "; - $html .= "
    " . $antwort_en . "
    "; - } - $html .= "
    "; + foreach ($faqs as $faq) { + $html .= "
    "; + if ($_SESSION['Sprache'] == "DE") { + $html .= "
    " . $faq['Frage_de'] . "
    "; + $html .= "
    " . $faq['Antwort_de'] . "
    "; + } else { + $html .= "
    " . $faq['Frage_en'] . "
    "; + $html .= "
    " . $faq['Antwort_en'] . "
    "; } + $html .= "
    "; + } return $html; } - -function noAnswer() { - global $con; - - $SQL = "SELECT UID FROM Questions WHERE `AID`='0'"; - $Res = mysql_query($SQL, $con); - - return mysql_num_rows($Res); -} ?> diff --git a/includes/sys_menu.php b/includes/sys_menu.php index c3dfa041..ca34ee6c 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -32,7 +32,8 @@ function make_navigation() { "admin_questions", "admin_angel_types", "admin_rooms", - "admin_groups" + "admin_groups", + "admin_faq" )); return $menu; } diff --git a/templates/admin_faq.html b/templates/admin_faq.html new file mode 100644 index 00000000..5dacf522 --- /dev/null +++ b/templates/admin_faq.html @@ -0,0 +1,56 @@ +
    ' . $faq['Frage_de'] . '
    ' . $faq['Antwort_de'] . '
    ' . $faq['Frage_en'] . '
    ' . $faq['Antwort_en'] . '
    Edit
    + + + + + + + + + %faqs% + +
    + Deutsch + + English + +   +
    +
    Create new FAQ: + + + + + + + + + + + + + + + + + + +
    + Frage + + +
    + Antwort + + +
    + Question + + +
    + Answer + + +
    + +
    \ No newline at end of file diff --git a/templates/admin_faq_edit_form.html b/templates/admin_faq_edit_form.html new file mode 100644 index 00000000..1ef791aa --- /dev/null +++ b/templates/admin_faq_edit_form.html @@ -0,0 +1,41 @@ +Edit FAQ: +
    + + + + + + + + + + + + + + + + + +
    + Frage + + +
    + Antwort + + +
    + Question + + +
    + Answer + + +
    + +

    +
    + Delete FAQ: +
    \ No newline at end of file diff --git a/txt/TODO b/txt/TODO index 14188a6f..5609482b 100644 --- a/txt/TODO +++ b/txt/TODO @@ -7,6 +7,7 @@ * Privilegien korrigieren (an die vom CVS anpassen) * Beim Raum-Management die benötigten Engel anzeigen * Löschen nur mit Rückfrage + * FAQ ordentlich mehrsprachig machen * schichten ueber monatsgrenzen einbaue im moment werden die tage nur hochgezaehlt und die monatzgrenzen werden ignoriert diff --git a/www-ssl/admin/faq.1.php b/www-ssl/admin/faq.1.php deleted file mode 100644 index 04dda6aa..00000000 --- a/www-ssl/admin/faq.1.php +++ /dev/null @@ -1,6 +0,0 @@ - - -
  • Alle Anfragen
  • -
  • Offene Anfragen ()
  • -
  • FAQ-Liste editiern
  • - diff --git a/www-ssl/admin/faq.php b/www-ssl/admin/faq.php deleted file mode 100644 index 779d8822..00000000 --- a/www-ssl/admin/faq.php +++ /dev/null @@ -1,271 +0,0 @@ - - Alle Anfragen:
    - - - - - - - - - - -\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } else { - echo "Nein\n"; - echo "\n"; - echo "\n"; - } - echo ""; - echo "\n"; - } - echo "
    FrageAnfragenderBeantwortet?AntwortAntwort vonchange
    " . mysql_result($Erg, $n, "Question") . "" . UID2Nick(mysql_result($Erg, $n, "UID")) . ""; - if (mysql_result($Erg, $n, "AID") > 0) { - echo "Ja" . mysql_result($Erg, $n, "Answer") . "" . UID2Nick(mysql_result($Erg, $n, "AID")) . "  xxx
    \n"; - break; - - case "open" : - $SQL = "SELECT * FROM `Questions` WHERE `AID`='0' ORDER BY `QID` DESC"; - $quest_bearb = 1; // Fragenliste anzeigen - echo "\t\tOffene Anfragen:
    \n"; - break; - - case "edit" : - if (!IsSet ($_GET["QID"])) - echo "\t\tFehlerhafter Aufruf...
    Bitte die Bearbeitung nochmals beginnen :)\n"; - else { - $SQL = "SELECT * FROM `Questions` WHERE `QID`='" . $_GET["QID"] . "'"; - $Erg = mysql_query($SQL, $con); - echo "\t\t
    \n"; - echo "\t\tAnfrage von " . UID2NICK(mysql_result($Erg, 0, "UID")) . ":
    \n"; - echo "\t\t\n"; - echo "

    Antwort der Erzengel:
    \n"; - if (mysql_result($Erg, 0, "Answer") == "") - echo "\t\t
    \n"; - else - echo "\t\t\n
    \n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t\t\n"; - echo "\t
    \n"; - if (mysql_result($Erg, 0, "AID") <> "0") { - echo "\tDu kannst diese Anfrage so wie sie ist, als Engel-FAQ eintrag übernehmen.
    \n"; - echo "Als FAQ-Eintrag sichern...\n"; - } - } // Abfrage der QID - break; - - case "save" : - if (!IsSet ($_GET["QID"])) - echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten..."; - else { - $SQL = "UPDATE `Questions` SET `Question`='" . $_GET["Question"] . - "', `AID`='" . $_SESSION['UID'] . "' , `Answer`='" . $_GET["Answer"] . "' " . - "WHERE `QID`='" . $_GET["QID"] . "' LIMIT 1"; - $Erg = db_query($SQL, "save Question"); - if ($Erg == 1) { - echo "\tDer Eintrag wurde geändert
    \n"; - SetHeaderGo2Back(); - } else - echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n"; - } - break; - - case "transfer" : - if (!IsSet ($_GET["QID"])) - echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n"; - else { - $SQL1 = "SELECT * FROM `Questions` WHERE `QID`='" . $_GET["QID"] . "'"; - $Erg = mysql_query($SQL1, $con); - $SQL2 = "INSERT INTO `FAQ` Values ('', '" . - mysql_result($Erg, 0, "Question") . "', '" . mysql_result($Erg, 0, "Answer") . "')"; - $Erg = db_query($SQL2, "trasfert to request to the FAQ"); - if ($Erg == 1) - echo "\tDer Eintrag wurde übertragen.
    \n"; - else - echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n"; - } - - break; - - // *--------------------------------------------------------------------------- - // * FAQ - Bearbeitung - // *--------------------------------------------------------------------------- - // * je nach �bergabeoption ($quest) koennen FAQ's erfasst werden, - // * geaendert oder geloscht werden... - // *--------------------------------------------------------------------------- - case "faq" : - $quest_bearb = 0; // keine Fragenliste anzeigen, FAQ editieren... - echo "\tFAQ-Liste:
    "; - echo "Neuen Eintrag"; - - $SQL = "SELECT * FROM `FAQ`"; - $Erg = mysql_query($SQL, $con); - - // anzahl zeilen - $Zeilen = mysql_num_rows($Erg); - - for ($n = 0; $n < $Zeilen; $n++) - if (mysql_result($Erg, $n, "Antwort") != "") { - echo "\t

    " . mysql_result($Erg, $n, "Frage") . "

    \n"; - echo "\t

    " . mysql_result($Erg, $n, "Antwort") . "

    \n"; - echo "\tBearbeiten\n
    ---
    \n"; - } - break; - - case "faqedit" : - if (!IsSet ($_GET["FAQID"])) - echo "\tFehlerhafter Aufruf...
    Bitte die Bearbeitung nochmals beginnen :)\n"; - else { - $SQL = "SELECT * FROM `FAQ` WHERE `FID`='" . $_GET["FAQID"] . "'"; - $Erg = mysql_query($SQL, $con); - - // anzahl zeilen - $Zeilen = mysql_num_rows($Erg); -?> -
    - Frage:
    - -

    - Antwort:
    -
    - "> - - -
    -
    - "> - - -
    -\n"; - else - echo "\tEin Fehler ist aufgetreten. Ist der Eintag bereits gelöscht gewesen?\n"; - } - break; - - case "faqsave"; - if (!IsSet ($_GET["FAQID"])) - echo "\tFehlerhafter Aufruf... Bitte die Bearbeitung nochmal starten...\n"; - else { - $SQL = "UPDATE `FAQ` SET `Frage`='" . $_GET["Frage"] . "', `Antwort`='" . $_GET["Antwort"] . - "' WHERE `FID`='" . $_GET["FAQID"] . "' LIMIT 1"; - $Erg = db_query($SQL, $con); - if ($Erg == 1) - echo "\tDer Eintrag wurde geändert
    \n"; - else - echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n"; - } - break; - - case "faqnew" : -?> -
    - Frage:
    -

    - Antwort:
    -
    - - -
    -\n"; - else - echo "\tEin Fehler ist aufgetreten. Sorry, du kannst es aber ja nochmal probieren :)\n"; - break; - - } //switch ($_GET["quest"]) - - // Hilfsroutine f�r die Anfragen: - // Fragenliste anzeigen??? - if ($quest_bearb == 1) { - $Erg = mysql_query($SQL, $con); - // anzahl zeilen - $Zeilen = mysql_num_rows($Erg); - - if ($Zeilen == 0) - echo "\tkeine vorhanden...\n"; - else - for ($n = 0; $n < $Zeilen; $n++) { - echo "\t

    " . nl2br(mysql_result($Erg, $n, "Question")) . "\n


    \n"; - echo "\tBearbeiten\n"; - echo "
    ---
    \n"; - } - - } - -} //if (IsSet($_GET["quest"])) -else { - echo "Bitte wähle aus, ob du:\n"; - echo "\n"; -} - -include ("includes/footer.php"); -?> diff --git a/www-ssl/css/base.css b/www-ssl/css/base.css index bfe050a5..44e1959c 100644 --- a/www-ssl/css/base.css +++ b/www-ssl/css/base.css @@ -109,6 +109,11 @@ td, th { border: 1px solid #888; } +textarea { + height: 200px; + width: 300px; +} + .background { background: #f0f0f0; } diff --git a/www-ssl/index.php b/www-ssl/index.php index d722de32..8ad025aa 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -73,6 +73,10 @@ if (in_array($p, $privileges)) { elseif ($p == "admin_groups") { require_once ('includes/pages/admin_groups.php'); $content = admin_groups(); + } + elseif ($p == "admin_faq") { + require_once ('includes/pages/admin_faq.php'); + $content = admin_faq(); } else { require_once ('includes/pages/guest_start.php'); $content = guest_start(); diff --git a/www-ssl/nonpublic/faq.php b/www-ssl/nonpublic/faq.php deleted file mode 100644 index fcc17158..00000000 --- a/www-ssl/nonpublic/faq.php +++ /dev/null @@ -1,73 +0,0 @@ - -

    -
    - -

    - "> -
    -" . Get_Text(37) . "

    \n" . nl2br($_POST["frage"]) . "

    \n" . Get_Text(38) . "
    \n"; - - $SQL = "INSERT INTO `Questions` VALUES ('', '" . $_SESSION['UID'] . "', '" . $_POST["frage"] . "', '', '')"; - $Erg = mysql_query($SQL, $con); - -} -// Bisherige Anfragen: -echo "
    \n" . Get_Text(39) . "
    \n"; -echo "
    \n"; -echo "
    " . Get_Text(40) . "
    \n"; - -$SQL = "SELECT * FROM `Questions` WHERE `UID` = " . $_SESSION['UID'] . " AND `AID`='0' ORDER BY 'QID' DESC"; -$Erg = mysql_query($SQL, $con); - -// anzahl zeilen -$Zeilen = mysql_num_rows($Erg); - -if ($Zeilen == 0) { - Print_Text(41); - -} else { - for ($n = 0; $n < $Zeilen; $n++) { - echo "

    " . nl2br(mysql_result($Erg, $n, "Question")) . "
    \n"; - // Es gibt ja noch keine Antwort: - // echo "

    ".nl2br(mysql_result($Erg, $n, "Answer"))."

    \n"; - echo "\n
    ---
    "; - } -} - -echo "
    \n"; -echo "
    " . Get_Text(42) . "
    \n"; -$SQL = "SELECT * FROM `Questions` WHERE `UID`='" . $_SESSION['UID'] . "' and `AID`<>'0' ORDER BY 'QID' DESC"; -$Erg = mysql_query($SQL, $con); - -// anzahl zeilen -$Zeilen = mysql_num_rows($Erg); - -if ($Zeilen == 0) { - Print_Text(41); -} else { - for ($n = 0; $n < $Zeilen; $n++) { - echo "

    " . nl2br(mysql_result($Erg, $n, "Question")) . "
    \n"; - echo "

    " . nl2br(mysql_result($Erg, $n, "Answer")) . - "@" . UID2Nick(mysql_result($Erg, $n, "AID")) . "\n"; - echo "\n
    ---
    "; - } -} - -include ("includes/footer.php"); -?> -- cgit v1.2.3-70-g09d2 From d5d3db847e5202d2e0cc52881c5ecb970f2c7b98 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 3 Jun 2011 01:40:25 +0200 Subject: cleanup, preparation --- includes/sys_menu.php | 4 ++++ txt/TODO | 12 ++++++++++++ 2 files changed, 16 insertions(+) (limited to 'includes/sys_menu.php') diff --git a/includes/sys_menu.php b/includes/sys_menu.php index ca34ee6c..2a05fdb4 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -22,6 +22,8 @@ function make_navigation() { // Engel Navigation $menu .= make_navigation_for(Get_Text('inc_schicht_engel'), array ( "news", + "user_myshifts", + "user_shifts", "user_messages", "user_questions", "user_settings" @@ -29,8 +31,10 @@ function make_navigation() { // Admin Navigation $menu .= make_navigation_for(Get_Text('admin/'), array ( + "admin_usershifts", "admin_questions", "admin_angel_types", + "admin_shifts", "admin_rooms", "admin_groups", "admin_faq" diff --git a/txt/TODO b/txt/TODO index 5609482b..cebcb0de 100644 --- a/txt/TODO +++ b/txt/TODO @@ -1,3 +1,15 @@ +jetzt: + * news kommentieren + * news administrieren + * user administrieren + * schichtimport + * schichtadministration + * meine schichten + * schichten + * meetings + * weckservice? + +später: * MD5-Passwörter mit Salt speichern * Passwort-Mindestanforderungen stellen * User-Avatare (code liegt auskommentiert in user_settings.php) -- cgit v1.2.3-70-g09d2 From 35fe4b3ed65718e9d09951b8879cc7cc69f7c1ef Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 3 Jun 2011 06:40:29 +0200 Subject: admin user --- DB/db_rewrite.sql | 36 ++++++++------ includes/funktion_db_list.php | 27 +++++----- includes/pages/admin_user.php | 111 ++++++++++++++++++++++++++++++++++++++++++ includes/sys_menu.php | 1 + www-ssl/css/base.css | 16 ++++++ www-ssl/index.php | 4 ++ 6 files changed, 165 insertions(+), 30 deletions(-) create mode 100644 includes/pages/admin_user.php (limited to 'includes/sys_menu.php') diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index f5ba1c6d..f713c813 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 03. Juni 2011 um 03:49 +-- Erstellungszeit: 03. Juni 2011 um 04:40 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -71,23 +71,24 @@ CREATE TABLE IF NOT EXISTS `Counter` ( -- INSERT INTO `Counter` (`URL`, `Anz`) VALUES -('news', 187), +('news', 190), ('login', 26), ('logout', 13), ('start', 26), ('faq', 19), ('credits', 3), -('register', 3), +('register', 8), ('admin_rooms', 89), ('admin_angel_types', 71), ('user_settings', 126), ('user_messages', 113), -('admin_groups', 117), +('admin_groups', 125), ('user_questions', 55), ('admin_questions', 42), ('admin_faq', 55), ('admin_news', 32), -('news_comments', 151); +('news_comments', 151), +('admin_user', 55); -- -------------------------------------------------------- @@ -133,7 +134,7 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=51 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=64 ; -- -- Daten für Tabelle `GroupPrivileges` @@ -145,15 +146,17 @@ INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES (40, -2, 4), (41, -2, 3), (23, -1, 2), -(48, -4, 14), -(46, -4, 7), +(62, -4, 16), +(61, -4, 6), (44, -2, 11), (43, -2, 9), (12, -5, 10), -(47, -4, 13), -(49, -4, 12), +(60, -4, 12), +(59, -4, 14), (45, -2, 8), -(50, -4, 6); +(58, -4, 13), +(57, -4, 7), +(63, -4, 5); -- -------------------------------------------------------- @@ -265,7 +268,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ; -- -- Daten für Tabelle `Privileges` @@ -286,7 +289,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (12, 'admin_questions', 'Answer user''s questions'), (13, 'admin_faq', 'Edit FAQs'), (14, 'admin_news', 'Administrate the news section'), -(15, 'news_comments', 'User can comment news'); +(15, 'news_comments', 'User can comment news'), +(16, 'admin_user', 'Administrate the angels'); -- -------------------------------------------------------- @@ -984,8 +988,8 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('admin/dect.php', 'EN', 'Dect'), ('admin/dect_call.php', 'DE', ' '), ('admin/dect_call.php', 'EN', ' '), -('admin/user.php', 'DE', 'Engelliste'), -('admin/user.php', 'EN', 'Drone-list'), +('admin_user', 'DE', 'Engelliste'), +('admin_user', 'EN', 'Manage angels'), ('admin/userDefaultSetting.php', 'DE', 'Engel Voreinstellungen'), ('admin/userDefaultSetting.php', 'EN', 'Drone Default Setting'), ('admin/UserPicture.php', 'DE', 'Benutzerbilder'), @@ -1072,7 +1076,7 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307072950, '0000-00-00 00:00:00', '', '', ''), +(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307075960, '0000-00-00 00:00:00', '', '', ''), (147, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', 'L', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, 0, 6, 'EN', 0, 'L', 1307042703, '2011-06-02 00:55:09', '', '', ''); -- -------------------------------------------------------- diff --git a/includes/funktion_db_list.php b/includes/funktion_db_list.php index 44e3d865..3e2878da 100644 --- a/includes/funktion_db_list.php +++ b/includes/funktion_db_list.php @@ -34,32 +34,31 @@ function funktion_db_element_list_2row( $TopicName, $SQL) { - global $con; + $html = ""; + $html .= "\n"; + $html .= ""; +# $html .= "\n"; - echo "
    $TopicName

    $TopicName

    \n"; - echo ""; -# echo "\n"; - - $Erg = mysql_query($SQL, $con); - echo mysql_error($con); + $Erg = sql_query($SQL); - echo ""; + $html .= ""; for ($m = 0 ; $m < mysql_num_fields($Erg) ; $m++) { - echo ""; + $html .= ""; } - echo ""; + $html .= ""; for ($n = 0 ; $n < mysql_num_rows($Erg) ; $n++) { - echo ""; + $html .= ""; for ($m = 0 ; $m < mysql_num_fields($Erg) ; $m++) { - echo ""; + $html .= ""; } - echo ""; + $html .= ""; } - echo "
    $TopicName

    $TopicName

    ". mysql_field_name($Erg, $m). "". mysql_field_name($Erg, $m). "
    ".mysql_result($Erg, $n, $m). "".mysql_result($Erg, $n, $m). "
    \n"; + $html .= "\n"; + return $html; } ?> diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php new file mode 100644 index 00000000..b64c9678 --- /dev/null +++ b/includes/pages/admin_user.php @@ -0,0 +1,111 @@ +Neuen Engel eintragen »

    \n"; + + if (!isset ($_GET["OrderBy"])) + $_GET["OrderBy"] = "Nick"; + $SQL = "SELECT * FROM `User` ORDER BY `" . $_GET["OrderBy"] . "` ASC"; + $Erg = sql_query($SQL); + + // anzahl zeilen + $Zeilen = mysql_num_rows($Erg); + + $html .= "Anzahl Engel: $Zeilen

    \n"; + $html .= ' + + + + + + + + + + + + + '; + $Gekommen = 0; + $Active = 0; + $Tshirt = 0; + + for ($n = 0; $n < $Zeilen; $n++) { + $title = ""; + $user_groups = sql_select("SELECT * FROM `UserGroups` JOIN `Groups` ON (`Groups`.`UID` = `UserGroups`.`group_id`) WHERE `UserGroups`.`uid`=" . sql_escape(mysql_result($Erg, $n, "UID")) . " ORDER BY `Groups`.`Name`"); + $groups = array (); + foreach ($user_groups as $user_group) { + $groups[] = $user_group['Name']; + } + $title .= 'Groups: ' . join(", ", $groups) . "
    "; + if (strlen(mysql_result($Erg, $n, "Telefon")) > 0) + $title .= "Tel: " . mysql_result($Erg, $n, "Telefon") . "
    "; + if (strlen(mysql_result($Erg, $n, "Handy")) > 0) + $title .= "Handy: " . mysql_result($Erg, $n, "Handy") . "
    "; + if (strlen(mysql_result($Erg, $n, "DECT")) > 0) + $title .= "DECT: " . + mysql_result($Erg, $n, "DECT") . "
    "; + if (strlen(mysql_result($Erg, $n, "Hometown")) > 0) + $title .= "Hometown: " . mysql_result($Erg, $n, "Hometown") . "
    "; + if (strlen(mysql_result($Erg, $n, "lastLogIn")) > 0) + $title .= "Last login: " . date("Y-m-d H:i", mysql_result($Erg, $n, "lastLogIn")) . "
    "; + if (strlen(mysql_result($Erg, $n, "Art")) > 0) + $title .= "Type: " . mysql_result($Erg, $n, "Art") . "
    "; + if (strlen(mysql_result($Erg, $n, "ICQ")) > 0) + $title .= "ICQ: " . mysql_result($Erg, $n, "ICQ") . "
    "; + if (strlen(mysql_result($Erg, $n, "jabber")) > 0) + $title .= "jabber: " . mysql_result($Erg, $n, "jabber") . "
    "; + + $html .= "\n"; + $html .= "\t\n"; + $html .= "\t\n"; + $html .= "\t\n"; + $html .= "\t\n"; + $html .= "\t\n"; + $Gekommen += mysql_result($Erg, $n, "Gekommen"); + $html .= "\t\n"; + $Active += mysql_result($Erg, $n, "Aktiv"); + $html .= "\t\n"; + $Tshirt += mysql_result($Erg, $n, "Tshirt"); + $html .= "\t\n"; + $html .= ""; + $html .= "\t\n"; + $html .= "\n"; + } + $html .= "" . + "" . + "\n"; + $html .= "\t
    + Nick + Vorname NameAlter + E-Mail + GrößeGekommenAktivT-ShirtRegistrierÄnd.
    " . mysql_result($Erg, $n, "Nick") . "" . mysql_result($Erg, $n, "Vorname") . " " . mysql_result($Erg, $n, "Name") . "" . mysql_result($Erg, $n, "Alter") . ""; + if (strlen(mysql_result($Erg, $n, "email")) > 0) + $html .= "" . + mysql_result($Erg, $n, "email") . ""; + $html .= ''; + $html .= "" . mysql_result($Erg, $n, "Size") . "" . mysql_result($Erg, $n, "Gekommen") . "" . mysql_result($Erg, $n, "Aktiv") . "" . mysql_result($Erg, $n, "Tshirt") . "" . mysql_result($Erg, $n, "CreateDate") . "" . 'Edit' . + "
    $Gekommen$Active$Tshirt
    \n"; + // Ende Userliste + + $html .= "


    Statistics

    "; + $html .= funktion_db_element_list_2row("Hometown", "SELECT COUNT(`Hometown`), `Hometown` FROM `User` GROUP BY `Hometown`"); + + $html .= "
    \n"; + + $html .= funktion_db_element_list_2row("Engeltypen", "SELECT COUNT(`Art`), `Art` FROM `User` GROUP BY `Art`"); + + $html .= "
    \n"; + + $html .= funktion_db_element_list_2row("Used Groups", "SELECT Groups.Name AS 'GroupName', COUNT(Groups.Name) AS Count FROM `UserGroups` " . + "LEFT JOIN `Groups` ON Groups.UID = UserGroups.group_id " . + "WHERE (UserGroups.group_id!='NULL') " . + "GROUP BY `GroupName` " . + ""); + return $html; +} +?> \ No newline at end of file diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 2a05fdb4..6a10c32b 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -31,6 +31,7 @@ function make_navigation() { // Admin Navigation $menu .= make_navigation_for(Get_Text('admin/'), array ( + "admin_user", "admin_usershifts", "admin_questions", "admin_angel_types", diff --git a/www-ssl/css/base.css b/www-ssl/css/base.css index 0a137099..236eba81 100644 --- a/www-ssl/css/base.css +++ b/www-ssl/css/base.css @@ -120,6 +120,22 @@ textarea { width: 300px; } +.hidden { + background: #fff; + border: 1px solid #888; + display: none; + font-size: 12px; + padding: 4px; +} + +td .hidden { + position: absolute; +} + +tr:hover .hidden { + display: block; +} + .clear { clear: both; } diff --git a/www-ssl/index.php b/www-ssl/index.php index c62b03e0..f6c6aaa2 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -66,6 +66,10 @@ if (in_array($p, $privileges)) { elseif ($p == "admin_questions") { $content = admin_questions(); } + elseif ($p == "admin_user") { + require_once ('includes/pages/admin_user.php'); + $content = admin_user(); + } elseif ($p == "admin_news") { require_once ('includes/pages/admin_news.php'); $content = admin_news(); -- cgit v1.2.3-70-g09d2 From 11e274a6fedc639223285557766b13b405c03be8 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 3 Jun 2011 06:47:35 +0200 Subject: user meetings --- DB/db_rewrite.sql | 43 ++++++----- includes/pages/user_news.php | 71 ++++++++++++------ includes/sys_menu.php | 1 + www-ssl/admin/user.php | 133 --------------------------------- www-ssl/index.php | 4 + www-ssl/nonpublic/engelbesprechung.php | 29 ------- 6 files changed, 80 insertions(+), 201 deletions(-) delete mode 100644 www-ssl/admin/user.php delete mode 100644 www-ssl/nonpublic/engelbesprechung.php (limited to 'includes/sys_menu.php') diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index f713c813..20a23f1e 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 03. Juni 2011 um 04:40 +-- Erstellungszeit: 03. Juni 2011 um 04:47 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -71,7 +71,7 @@ CREATE TABLE IF NOT EXISTS `Counter` ( -- INSERT INTO `Counter` (`URL`, `Anz`) VALUES -('news', 190), +('news', 192), ('login', 26), ('logout', 13), ('start', 26), @@ -82,13 +82,14 @@ INSERT INTO `Counter` (`URL`, `Anz`) VALUES ('admin_angel_types', 71), ('user_settings', 126), ('user_messages', 113), -('admin_groups', 125), +('admin_groups', 129), ('user_questions', 55), ('admin_questions', 42), ('admin_faq', 55), -('admin_news', 32), +('admin_news', 33), ('news_comments', 151), -('admin_user', 55); +('admin_user', 59), +('user_meetings', 5); -- -------------------------------------------------------- @@ -134,29 +135,30 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=64 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=71 ; -- -- Daten für Tabelle `GroupPrivileges` -- INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES -(42, -2, 15), +(69, -2, 11), (24, -1, 5), -(40, -2, 4), -(41, -2, 3), +(68, -2, 9), +(67, -2, 17), (23, -1, 2), (62, -4, 16), (61, -4, 6), -(44, -2, 11), -(43, -2, 9), +(66, -2, 15), +(65, -2, 3), (12, -5, 10), (60, -4, 12), (59, -4, 14), -(45, -2, 8), +(64, -2, 4), (58, -4, 13), (57, -4, 7), -(63, -4, 5); +(63, -4, 5), +(70, -2, 8); -- -------------------------------------------------------- @@ -223,12 +225,14 @@ CREATE TABLE IF NOT EXISTS `News` ( `UID` int(11) NOT NULL DEFAULT '0', `Treffen` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`ID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Daten für Tabelle `News` -- +INSERT INTO `News` (`ID`, `Datum`, `Betreff`, `Text`, `UID`, `Treffen`) VALUES +(4, 1307076340, 'Achtung, Treffen!', '', 1, 1); -- -------------------------------------------------------- @@ -268,7 +272,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ; -- -- Daten für Tabelle `Privileges` @@ -290,7 +294,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (13, 'admin_faq', 'Edit FAQs'), (14, 'admin_news', 'Administrate the news section'), (15, 'news_comments', 'User can comment news'), -(16, 'admin_user', 'Administrate the angels'); +(16, 'admin_user', 'Administrate the angels'), +(17, 'user_meetings', 'Lists meetings (news)'); -- -------------------------------------------------------- @@ -1033,7 +1038,9 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('news_comments', 'DE', 'News Kommentare'), ('news_comments', 'EN', 'News comments'), ('admin_news', 'DE', 'News verwalten'), -('admin_news', 'EN', 'Manage news'); +('admin_news', 'EN', 'Manage news'), +('user_meetings', 'DE', 'Treffen'), +('user_meetings', 'EN', 'Meetings'); -- -------------------------------------------------------- @@ -1076,7 +1083,7 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307075960, '0000-00-00 00:00:00', '', '', ''), +(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307076377, '0000-00-00 00:00:00', '', '', ''), (147, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', 'L', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, 0, 6, 'EN', 0, 'L', 1307042703, '2011-06-02 00:55:09', '', '', ''); -- -------------------------------------------------------- diff --git a/includes/pages/user_news.php b/includes/pages/user_news.php index 7b4f9482..818c2da2 100644 --- a/includes/pages/user_news.php +++ b/includes/pages/user_news.php @@ -1,16 +1,45 @@ \n\n"; + $dis_rows = ceil(sql_num_query("SELECT * FROM `News` WHERE `Treffen`=1") / $DISPLAY_NEWS); + + $html .= Get_Text(5); + + for ($i = 0; $i < $dis_rows; $i++) { + if ($i == $_REQUEST['page']) + $html .= ($i +1) . "  "; + else + $html .= '' . ($i +1) . '  '; + } + $html .= ''; + return $html; +} + function display_news($news) { global $privileges, $p; $html .= ""; $html .= '
    '; $html .= '
    '; - $html .= date("Y-m-d H:i",$news['Datum']) . ', '; + $html .= date("Y-m-d H:i", $news['Datum']) . ', '; $html .= UID2Nick($news['UID']); if ($p != "news_comments") $html .= ', Kommentare (' . sql_num_query("SELECT * FROM `news_comments` WHERE `Refid`='" . sql_escape($news['ID']) . "'") . ') »'; $html .= '
    '; - $html .= '

    '.($news['Treffen'] == 1 ? '[Meeting] ' : '') . ReplaceSmilies($news['Betreff']) . '

    '; + $html .= '

    ' . ($news['Treffen'] == 1 ? '[Meeting] ' : '') . ReplaceSmilies($news['Betreff']) . '

    '; $html .= '

    ' . ReplaceSmilies(nl2br($news['Text'])) . '

    '; if (in_array("admin_news", $privileges)) $html .= "
    Edit
    \n"; @@ -51,22 +80,22 @@ function user_news_comments() { $html .= ""; $html .= ' -
    -
    -

    Neuer Kommentar:

    -   - -
    - - - - - - -
    Text:
    -
    - -
    '; +
    +
    +

    Neuer Kommentar:

    +   + +
    + + + + + + +
    Text:
    +
    + +
    '; } else { $html .= "Fehlerhafter Aufruf!"; } @@ -125,9 +154,9 @@ function user_news() { '; if (in_array('admin_news', $privileges)) { $html .= ' - ' . Get_Text(9) . ' - - '; + ' . Get_Text(9) . ' + + '; } $html .= ' diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 6a10c32b..d5543f97 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -22,6 +22,7 @@ function make_navigation() { // Engel Navigation $menu .= make_navigation_for(Get_Text('inc_schicht_engel'), array ( "news", + "user_meetings", "user_myshifts", "user_shifts", "user_messages", diff --git a/www-ssl/admin/user.php b/www-ssl/admin/user.php deleted file mode 100644 index 0b31c97c..00000000 --- a/www-ssl/admin/user.php +++ /dev/null @@ -1,133 +0,0 @@ -Neuen Engel eintragen

    \n"; - - if (!isset ($_GET["OrderBy"])) - $_GET["OrderBy"] = "Nick"; - $SQL = "SELECT User.*, UserGroups.Name AS 'Group' FROM `User` " . - "LEFT JOIN `UserCVS` ON User.UID = UserCVS.UID " . - "LEFT JOIN `UserGroups` ON UserGroups.UID = UserCVS.GroupID " . - "ORDER BY `" . $_GET["OrderBy"] . "` ASC"; - $Erg = mysql_query($SQL, $con); - echo mysql_error($con); - - // anzahl zeilen - $Zeilen = mysql_num_rows($Erg); - - echo "Anzahl Engel: $Zeilen

    \n"; -?> - - - - - - - - - - - - - - - - \n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - $Gekommen += mysql_result($Erg, $n, "Gekommen"); - echo "\t\n"; - $Active += mysql_result($Erg, $n, "Aktiv"); - echo "\t\n"; - $Tshirt += mysql_result($Erg, $n, "Tshirt"); - echo "\t\n"; - echo "\t\n"; - echo "\t\n"; - echo "\n"; - } - echo "" . - "" . - "\n"; - echo "\t
    - ?OrderBy=Nick">Nick | - ?OrderBy=CreateDate">CreateDate - ?OrderBy=Name">Name?OrderBy=Vorname">Vorname?OrderBy=Alter">Alter - ?OrderBy=email">@ | - ?OrderBy=DECT">DECT | - ?OrderBy=Hometown">Hometown | - ?OrderBy=lastLogIn">lastLogIn | - ?OrderBy=Art">Type | - ?OrderBy=ICQ">ICQ | - ?OrderBy=jabber">jabber | - ?OrderBy=Group">Group - ?OrderBy=Size">Größe?OrderBy=Gekommen">G?OrderBy=Aktiv">A?OrderBy=Tshirt">TÄnd.Secure
    " . mysql_result($Erg, $n, "Nick") . "
    (Create: " . mysql_result($Erg, $n, "CreateDate") . ")
    " . mysql_result($Erg, $n, "Name") . "" . mysql_result($Erg, $n, "Vorname") . "" . mysql_result($Erg, $n, "Alter") . ""; - if (strlen(mysql_result($Erg, $n, "Telefon")) > 0) - echo "\n\t\tTel: " . mysql_result($Erg, $n, "Telefon") . "
    "; - if (strlen(mysql_result($Erg, $n, "Handy")) > 0) - echo "\n\t\tHandy: " . mysql_result($Erg, $n, "Handy") . "
    "; - if (strlen(mysql_result($Erg, $n, "DECT")) > 0) - echo "\n\t\tDECT: " . - mysql_result($Erg, $n, "DECT") . "
    "; - if (strlen(mysql_result($Erg, $n, "email")) > 0) - echo "\n\t\temail: " . - mysql_result($Erg, $n, "email") . "
    "; - if (strlen(mysql_result($Erg, $n, "Hometown")) > 0) - echo "\n\t\tHometown: " . mysql_result($Erg, $n, "Hometown") . "
    "; - if (strlen(mysql_result($Erg, $n, "lastLogIn")) > 0) - echo "\n\t\tlastLogIn: " . mysql_result($Erg, $n, "lastLogIn") . "
    "; - if (strlen(mysql_result($Erg, $n, "Art")) > 0) - echo "\n\t\tType: " . mysql_result($Erg, $n, "Art") . "
    "; - if (strlen(mysql_result($Erg, $n, "ICQ")) > 0) - echo "\n\t\tICQ: " . mysql_result($Erg, $n, "ICQ") . "
    "; - if (strlen(mysql_result($Erg, $n, "jabber")) > 0) - echo "\n\t\tjabber: " . mysql_result($Erg, $n, "jabber") . "
    "; - echo "\n\t\tGroup: " . mysql_result($Erg, $n, "Group") . "
    "; - echo "
    " . mysql_result($Erg, $n, "Size") . "" . mysql_result($Erg, $n, "Gekommen") . "" . mysql_result($Erg, $n, "Aktiv") . "" . mysql_result($Erg, $n, "Tshirt") . "" . funktion_isLinkAllowed_addLink_OrEmpty("admin/userChangeNormal.php?enterUID=" . - mysql_result($Erg, $n, "UID") . "&Type=Normal", "Änd.") . - "" . funktion_isLinkAllowed_addLink_OrEmpty("admin/userChangeSecure.php?enterUID=" . - mysql_result($Erg, $n, "UID") . "&Type=Secure", "Secure") . - "
    $Gekommen$Active$Tshirt
    \n"; - // Ende Userliste - - echo "

    Statistics

    "; - funktion_db_element_list_2row("Hometown", "SELECT COUNT(`Hometown`), `Hometown` FROM `User` GROUP BY `Hometown`"); - - echo "
    \n"; - - funktion_db_element_list_2row("Engeltypen", "SELECT COUNT(`Art`), `Art` FROM `User` GROUP BY `Art`"); - - echo "
    \n"; - - funktion_db_element_list_2row("Used Groups", "SELECT UserGroups.Name AS 'GroupName', COUNT(UserGroups.Name) AS Count FROM `UserCVS` " . - "LEFT JOIN `UserGroups` ON UserGroups.UID = UserCVS.GroupID " . - "WHERE (UserCVS.GroupID!='NULL') " . - "GROUP BY `GroupName` " . - ""); -} else { - echo "error"; -} - -include ("includes/footer.php"); -?> - - diff --git a/www-ssl/index.php b/www-ssl/index.php index f6c6aaa2..ded6c110 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -40,6 +40,10 @@ if (in_array($p, $privileges)) { require_once ('includes/pages/user_news.php'); $content = user_news_comments(); } + elseif ($p == "user_meetings") { + require_once ('includes/pages/user_news.php'); + $content = user_meetings(); + } elseif ($p == "user_messages") { $content = user_messages(); } diff --git a/www-ssl/nonpublic/engelbesprechung.php b/www-ssl/nonpublic/engelbesprechung.php deleted file mode 100644 index 7ff684d4..00000000 --- a/www-ssl/nonpublic/engelbesprechung.php +++ /dev/null @@ -1,29 +0,0 @@ -" . mysql_result($Erg, $n, "Betreff") . ""; - - // Show Admin Page - if ($_SESSION['CVS']["admin/news.php"] == "Y") - echo " [edit]"; - - echo "
       " . mysql_result($Erg, $n, "Datum") . ", "; - echo UID2Nick(mysql_result($Erg, $n, "UID")) . "

    \n"; - echo "

    " . nl2br(mysql_result($Erg, $n, "Text")) . "

    \n"; - } -} - -include ("includes/footer.php"); -?> -- cgit v1.2.3-70-g09d2 From e7a25448f2e922cdcb38f3745cf88fa744a3f20b Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 3 Jun 2011 14:38:12 +0200 Subject: admin language / translation --- DB/db_rewrite.sql | 47 +++++++++--------- includes/pages/admin_language.php | 100 ++++++++++++++++++++++++++++++++++++++ includes/pages/admin_user.php | 2 +- includes/sys_menu.php | 3 +- txt/TODO | 5 ++ www-ssl/index.php | 4 ++ 6 files changed, 137 insertions(+), 24 deletions(-) create mode 100644 includes/pages/admin_language.php (limited to 'includes/sys_menu.php') diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index 19a82c05..8758c191 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 03. Juni 2011 um 06:12 +-- Erstellungszeit: 03. Juni 2011 um 12:37 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -71,25 +71,26 @@ CREATE TABLE IF NOT EXISTS `Counter` ( -- INSERT INTO `Counter` (`URL`, `Anz`) VALUES -('news', 193), -('login', 28), -('logout', 14), -('start', 27), +('news', 198), +('login', 34), +('logout', 15), +('start', 28), ('faq', 19), -('credits', 3), +('credits', 7), ('register', 10), -('admin_rooms', 89), +('admin_rooms', 90), ('admin_angel_types', 71), ('user_settings', 134), ('user_messages', 113), -('admin_groups', 130), +('admin_groups', 135), ('user_questions', 55), ('admin_questions', 43), ('admin_faq', 55), ('admin_news', 33), ('news_comments', 151), -('admin_user', 196), -('user_meetings', 5); +('admin_user', 206), +('user_meetings', 5), +('admin_language', 22); -- -------------------------------------------------------- @@ -135,7 +136,7 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=71 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=73 ; -- -- Daten für Tabelle `GroupPrivileges` @@ -151,14 +152,15 @@ INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES (61, -4, 6), (66, -2, 15), (65, -2, 3), -(12, -5, 10), +(71, -5, 10), (60, -4, 12), (59, -4, 14), (64, -2, 4), (58, -4, 13), (57, -4, 7), (63, -4, 5), -(70, -2, 8); +(70, -2, 8), +(72, -5, 18); -- -------------------------------------------------------- @@ -272,7 +274,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=19 ; -- -- Daten für Tabelle `Privileges` @@ -295,7 +297,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (14, 'admin_news', 'Administrate the news section'), (15, 'news_comments', 'User can comment news'), (16, 'admin_user', 'Administrate the angels'), -(17, 'user_meetings', 'Lists meetings (news)'); +(17, 'user_meetings', 'Lists meetings (news)'), +(18, 'admin_language', 'Translate the system'); -- -------------------------------------------------------- @@ -1040,7 +1043,9 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('admin_news', 'DE', 'News verwalten'), ('admin_news', 'EN', 'Manage news'), ('user_meetings', 'DE', 'Treffen'), -('user_meetings', 'EN', 'Meetings'); +('user_meetings', 'EN', 'Meetings'), +('admin_language', 'DE', 'Übersetzung'), +('admin_language', 'EN', 'Translation'); -- -------------------------------------------------------- @@ -1083,8 +1088,8 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', 'Gates', 'Bill', 42, '', '', '', '', '', '', '', '4297f44b13955235245b2497399d7a93', 1, 1, 0, 10, 'DE', 115, 'L', 1307081238, '0000-00-00 00:00:00', '', '', ''), -(148, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', '', '4297f44b13955235245b2497399d7a93', 0, 1, 1, 10, 'DE', 0, 'L', 1307081543, '2011-06-03 07:55:24', 'AudioEngel', '', ''); +(1, 'admin', 'Gates', 'Bill', 42, '', '', '', '', '', '', '', '4297f44b13955235245b2497399d7a93', 1, 1, 0, 10, 'DE', 115, 'L', 1307104634, '0000-00-00 00:00:00', '', '', ''), +(148, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', '', '4297f44b13955235245b2497399d7a93', 0, 1, 1, 10, 'DE', 0, 'L', 1307082872, '2011-06-03 07:55:24', 'AudioEngel', '', ''); -- -------------------------------------------------------- @@ -1174,7 +1179,7 @@ CREATE TABLE IF NOT EXISTS `UserGroups` ( `group_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `uid` (`uid`,`group_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ; -- -- Daten für Tabelle `UserGroups` @@ -1185,9 +1190,7 @@ INSERT INTO `UserGroups` (`id`, `uid`, `group_id`) VALUES (2, 1, -3), (3, 1, -5), (4, 1, -4), -(8, 148, -2), -(9, 148, -3), -(10, 148, -4); +(11, 148, -2); -- -------------------------------------------------------- diff --git a/includes/pages/admin_language.php b/includes/pages/admin_language.php new file mode 100644 index 00000000..a866528e --- /dev/null +++ b/includes/pages/admin_language.php @@ -0,0 +1,100 @@ +\n"; + $html .= Get_Text("pub_sprache_text1") . "

    \n"; + + $html .= "" . Get_Text("pub_sprache_ShowEntry") . ""; + // ausgabe Tabellenueberschift + $SQL_Sprachen = "SELECT `Sprache` FROM `Sprache` GROUP BY `Sprache`;"; + $erg_Sprachen = sql_query($SQL_Sprachen); + + for ($i = 0; $i < mysql_num_rows($erg_Sprachen); $i++) + $Sprachen[mysql_result($erg_Sprachen, $i, "Sprache")] = $i; + + $html .= "\t\n\t\t"; + $html .= "\t\t"; + foreach ($Sprachen as $Name => $Value) + $html .= ""; + $html .= "\t\t"; + $html .= "\t\t"; + + if (isset ($_GET["ShowEntry"])) { + // ausgabe eintraege + $SQL = "SELECT * FROM `Sprache` ORDER BY `TextID`;"; + $erg = sql_query($SQL); + + $TextID_Old = mysql_result($erg, 0, "TextID"); + for ($i = 0; $i < mysql_num_rows($erg); $i++) { + $TextID_New = mysql_result($erg, $i, "TextID"); + if ($TextID_Old != $TextID_New) { + $html .= ""; + $html .= "\n"; + $html .= "\t\t\n"; + + foreach ($Sprachen as $Name => $Value) { + $Value = html_entity_decode($Value, ENT_QUOTES); + $html .= "\t\t\n"; + $Sprachen[$Name] = ""; + } + + $html .= "\t\t\n"; + $html .= ""; + $html .= "\n"; + $TextID_Old = $TextID_New; + } + $Sprachen[mysql_result($erg, $i, "Sprache")] = mysql_result($erg, $i, "Text"); + } /*FOR*/ + } + + //fuer neu eintraege + $html .= ""; + $html .= "\n"; + $html .= "\t\t\n"; + + foreach ($Sprachen as $Name => $Value) + $html .= "\t\t\n"; + + $html .= "\t\t\n"; + $html .= ""; + $html .= "\n"; + + $html .= "
    " . Get_Text("pub_sprache_TextID") . "" . + Get_Text("pub_sprache_Sprache") . " " . $Name . + "" . Get_Text("pub_sprache_Edit") . "
    $TextID_Old " . + "
    \n"; + } /*if( !isset( $TextID ) )*/ + else { + $html .= "edit: " . $_POST["TextID"] . "

    "; + foreach ($_POST as $k => $v) { + if ($k != "TextID") { + $sql_test = "SELECT * FROM `Sprache` " . + "WHERE `TextID`='" . $_POST["TextID"] . "' AND `Sprache`='$k'"; + $erg_test = sql_query($sql_test); + + if (mysql_num_rows($erg_test) == 0) { + $sql_save = "INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) " . + "VALUES ('" . $_POST["TextID"] . "', '$k', '$v')"; + $html .= $sql_save . "
    "; + $Erg = sql_query($sql_save); + $html .= success("$k Save: OK
    \n"); + } else + if (mysql_result($erg_test, 0, "Text") != $v) { + $sql_save = "UPDATE `Sprache` SET `Text`='$v' " . + "WHERE `TextID`='" . $_POST["TextID"] . "' AND `Sprache`='$k' "; + $html .= $sql_save . "
    "; + $Erg = sql_query($sql_save); + $html .= success(" $k Update: OK
    \n"); + } else + $html .= "\t $k no changes
    \n"; + } + } + + } + return $html; +} +?> + diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index 630ca772..0399dda8 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -243,7 +243,7 @@ function admin_user() { Gekommen Aktiv T-Shirt - Registrier + Registriert Änd. '; $Gekommen = 0; diff --git a/includes/sys_menu.php b/includes/sys_menu.php index d5543f97..744d28d5 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -39,7 +39,8 @@ function make_navigation() { "admin_shifts", "admin_rooms", "admin_groups", - "admin_faq" + "admin_faq", + "admin_language" )); return $menu; } diff --git a/txt/TODO b/txt/TODO index d78d3198..62bbe106 100644 --- a/txt/TODO +++ b/txt/TODO @@ -1,8 +1,13 @@ jetzt: + * aktiv + * gekommen + * tshirt * schichtimport * schichtadministration * meine schichten * schichten + * Services? + * DECT-kram? * weckservice? später: diff --git a/www-ssl/index.php b/www-ssl/index.php index ded6c110..fe8c4795 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -93,6 +93,10 @@ if (in_array($p, $privileges)) { elseif ($p == "admin_faq") { require_once ('includes/pages/admin_faq.php'); $content = admin_faq(); + } + elseif ($p == "admin_language") { + require_once ('includes/pages/admin_language.php'); + $content = admin_language(); } else { require_once ('includes/pages/guest_start.php'); $content = guest_start(); -- cgit v1.2.3-70-g09d2 From 7e91f4821aee41589dd744a9540f15b76d729bab Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 3 Jun 2011 14:44:01 +0200 Subject: recentchanges -> admin log --- DB/db_rewrite.sql | 23 ++++++++++++++--------- includes/pages/admin_log.php | 25 +++++++++++++++++++++++++ includes/sys_menu.php | 3 ++- www-ssl/admin/Recentchanges.php | 29 ----------------------------- www-ssl/index.php | 4 ++++ 5 files changed, 45 insertions(+), 39 deletions(-) create mode 100644 includes/pages/admin_log.php delete mode 100644 www-ssl/admin/Recentchanges.php (limited to 'includes/sys_menu.php') diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index 8758c191..525d6e7b 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 03. Juni 2011 um 12:37 +-- Erstellungszeit: 03. Juni 2011 um 12:43 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -82,7 +82,7 @@ INSERT INTO `Counter` (`URL`, `Anz`) VALUES ('admin_angel_types', 71), ('user_settings', 134), ('user_messages', 113), -('admin_groups', 135), +('admin_groups', 141), ('user_questions', 55), ('admin_questions', 43), ('admin_faq', 55), @@ -90,7 +90,8 @@ INSERT INTO `Counter` (`URL`, `Anz`) VALUES ('news_comments', 151), ('admin_user', 206), ('user_meetings', 5), -('admin_language', 22); +('admin_language', 25), +('admin_log', 5); -- -------------------------------------------------------- @@ -136,7 +137,7 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=73 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=74 ; -- -- Daten für Tabelle `GroupPrivileges` @@ -160,7 +161,8 @@ INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES (57, -4, 7), (63, -4, 5), (70, -2, 8), -(72, -5, 18); +(72, -5, 18), +(73, -3, 19); -- -------------------------------------------------------- @@ -274,7 +276,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=19 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=20 ; -- -- Daten für Tabelle `Privileges` @@ -298,7 +300,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (15, 'news_comments', 'User can comment news'), (16, 'admin_user', 'Administrate the angels'), (17, 'user_meetings', 'Lists meetings (news)'), -(18, 'admin_language', 'Translate the system'); +(18, 'admin_language', 'Translate the system'), +(19, 'admin_log', 'Display recent changes'); -- -------------------------------------------------------- @@ -1045,7 +1048,9 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('user_meetings', 'DE', 'Treffen'), ('user_meetings', 'EN', 'Meetings'), ('admin_language', 'DE', 'Übersetzung'), -('admin_language', 'EN', 'Translation'); +('admin_language', 'EN', 'Translation'), +('admin_log', 'EN', 'Log'), +('admin_log', 'DE', 'Log'); -- -------------------------------------------------------- @@ -1088,7 +1093,7 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', 'Gates', 'Bill', 42, '', '', '', '', '', '', '', '4297f44b13955235245b2497399d7a93', 1, 1, 0, 10, 'DE', 115, 'L', 1307104634, '0000-00-00 00:00:00', '', '', ''), +(1, 'admin', 'Gates', 'Bill', 42, '', '', '', '', '', '', '', '4297f44b13955235245b2497399d7a93', 1, 1, 0, 10, 'DE', 115, 'L', 1307105002, '0000-00-00 00:00:00', '', '', ''), (148, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', '', '4297f44b13955235245b2497399d7a93', 0, 1, 1, 10, 'DE', 0, 'L', 1307082872, '2011-06-03 07:55:24', 'AudioEngel', '', ''); -- -------------------------------------------------------- diff --git a/includes/pages/admin_log.php b/includes/pages/admin_log.php new file mode 100644 index 00000000..5f112f03 --- /dev/null +++ b/includes/pages/admin_log.php @@ -0,0 +1,25 @@ + 0) { + $html .= "\n"; + $html .= "\n\t\n\t\n\t\n\t\n\n"; + for ($n = 0; $n < mysql_num_rows($Erg); $n++) { + $html .= "\n"; + $html .= "\t\n"; + $html .= "\t\n"; + $html .= "\t\n"; + $html .= "\t\n"; + $html .= "\n"; + } + $html .= "
    TimeUserCommendSQL Command
    " . mysql_result($Erg, $n, "Time") . "" . UID2Nick(mysql_result($Erg, $n, "UID")) . displayavatar(mysql_result($Erg, $n, "UID")) . "" . mysql_result($Erg, $n, "Commend") . "" . mysql_result($Erg, $n, "SQLCommad") . "
    \n"; + } else { + $html .= "Log is empty..."; + } + return $html; +} +?> + diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 744d28d5..e81bed8d 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -40,7 +40,8 @@ function make_navigation() { "admin_rooms", "admin_groups", "admin_faq", - "admin_language" + "admin_language", + "admin_log" )); return $menu; } diff --git a/www-ssl/admin/Recentchanges.php b/www-ssl/admin/Recentchanges.php deleted file mode 100644 index 26324406..00000000 --- a/www-ssl/admin/Recentchanges.php +++ /dev/null @@ -1,29 +0,0 @@ -\n"; -echo "\n\tTime\n\tUser\n\tCommend\n\tSQL Commad\n\n"; - -for ($n = 0; $n < mysql_num_rows($Erg); $n++) { - echo "\n"; - echo "\t" . mysql_result($Erg, $n, "Time") . "\n"; - echo "\t" . UID2Nick(mysql_result($Erg, $n, "UID")) . displayavatar(mysql_result($Erg, $n, "UID")) . "\n"; - echo "\t" . mysql_result($Erg, $n, "Commend") . "\n"; - echo "\t" . mysql_result($Erg, $n, "SQLCommad") . "\n"; - echo "\n"; -} - -echo "\n"; - -include ("includes/footer.php"); -?> - diff --git a/www-ssl/index.php b/www-ssl/index.php index fe8c4795..7c65abb2 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -97,6 +97,10 @@ if (in_array($p, $privileges)) { elseif ($p == "admin_language") { require_once ('includes/pages/admin_language.php'); $content = admin_language(); + } + elseif ($p == "admin_log") { + require_once ('includes/pages/admin_log.php'); + $content = admin_log(); } else { require_once ('includes/pages/guest_start.php'); $content = guest_start(); -- cgit v1.2.3-70-g09d2 From 7a6f4b2750465da6f59b13aefa575d734f5471f3 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 3 Jun 2011 16:22:33 +0200 Subject: wake-up calls --- DB/db_rewrite.sql | 73 +++++++++++++++++-------------- includes/pages/user_wakeup.php | 92 ++++++++++++++++++++++++++++++++++++++++ includes/sys_menu.php | 1 + www-ssl/index.php | 4 ++ www-ssl/nonpublic/waeckliste.php | 46 -------------------- www-ssl/nonpublic/wecken.php | 86 ------------------------------------- 6 files changed, 138 insertions(+), 164 deletions(-) create mode 100644 includes/pages/user_wakeup.php delete mode 100644 www-ssl/nonpublic/waeckliste.php delete mode 100644 www-ssl/nonpublic/wecken.php (limited to 'includes/sys_menu.php') diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index 525d6e7b..e4bb6689 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 03. Juni 2011 um 12:43 +-- Erstellungszeit: 03. Juni 2011 um 14:20 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -71,27 +71,28 @@ CREATE TABLE IF NOT EXISTS `Counter` ( -- INSERT INTO `Counter` (`URL`, `Anz`) VALUES -('news', 198), -('login', 34), -('logout', 15), -('start', 28), -('faq', 19), +('news', 206), +('login', 42), +('logout', 19), +('start', 32), +('faq', 27), ('credits', 7), -('register', 10), +('register', 12), ('admin_rooms', 90), ('admin_angel_types', 71), -('user_settings', 134), +('user_settings', 137), ('user_messages', 113), -('admin_groups', 141), +('admin_groups', 149), ('user_questions', 55), ('admin_questions', 43), -('admin_faq', 55), +('admin_faq', 56), ('admin_news', 33), ('news_comments', 151), ('admin_user', 206), ('user_meetings', 5), -('admin_language', 25), -('admin_log', 5); +('admin_language', 29), +('admin_log', 19), +('user_wakeup', 61); -- -------------------------------------------------------- @@ -137,32 +138,34 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=74 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=85 ; -- -- Daten für Tabelle `GroupPrivileges` -- INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES -(69, -2, 11), +(83, -2, 8), (24, -1, 5), -(68, -2, 9), -(67, -2, 17), +(82, -2, 11), +(81, -2, 9), (23, -1, 2), (62, -4, 16), (61, -4, 6), -(66, -2, 15), -(65, -2, 3), -(71, -5, 10), +(80, -2, 17), +(79, -2, 15), +(75, -5, 18), (60, -4, 12), (59, -4, 14), -(64, -2, 4), +(78, -2, 3), (58, -4, 13), (57, -4, 7), (63, -4, 5), -(70, -2, 8), -(72, -5, 18), -(73, -3, 19); +(77, -2, 4), +(74, -5, 10), +(73, -3, 19), +(76, -5, 20), +(84, -2, 20); -- -------------------------------------------------------- @@ -276,7 +279,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=20 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ; -- -- Daten für Tabelle `Privileges` @@ -301,7 +304,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (16, 'admin_user', 'Administrate the angels'), (17, 'user_meetings', 'Lists meetings (news)'), (18, 'admin_language', 'Translate the system'), -(19, 'admin_log', 'Display recent changes'); +(19, 'admin_log', 'Display recent changes'), +(20, 'user_wakeup', 'User wakeup-service organization'); -- -------------------------------------------------------- @@ -557,7 +561,7 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('inc_schicht_noch_gesucht', 'DE', ' noch gesucht'), ('inc_schicht_und', 'DE', ' und '), ('pub_wake_beschreibung', 'DE', 'hier kannst du dich zum Wecken eintragen. Dazu sage einfach wann und wo und der Engel vom Dienst wird dich wecken.'), -('pub_wake_beschreibung2', 'DE', 'Deine bisherigen eingetragenen Zeiten:'), +('pub_wake_beschreibung2', 'DE', 'Alle eingetragenen Weckwünsche, die nächsten zuerst.'), ('pub_wake_Datum', 'DE', 'Datum'), ('pub_wake_Ort', 'DE', 'Ort'), ('pub_wake_Bemerkung', 'DE', 'Bermerkung'), @@ -601,7 +605,7 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('inc_schicht_wird', 'EN', ' is '), ('inc_schicht_noch_gesucht', 'EN', ' still needed '), ('inc_schicht_und', 'EN', ' and '), -('pub_wake_beschreibung2', 'EN', 'The wake-up calls you have ordered:\r\n'), +('pub_wake_beschreibung2', 'EN', 'All ordered wake-up calls, next first.'), ('pub_wake_Datum', 'EN', 'Date'), ('pub_wake_Ort', 'EN', 'Place'), ('pub_wake_change', 'EN', 'delete'), @@ -1050,7 +1054,9 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('admin_language', 'DE', 'Übersetzung'), ('admin_language', 'EN', 'Translation'), ('admin_log', 'EN', 'Log'), -('admin_log', 'DE', 'Log'); +('admin_log', 'DE', 'Log'), +('user_wakeup', 'DE', 'Weckservice'), +('user_wakeup', 'EN', 'Wakeup service'); -- -------------------------------------------------------- @@ -1093,8 +1099,8 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', 'Gates', 'Bill', 42, '', '', '', '', '', '', '', '4297f44b13955235245b2497399d7a93', 1, 1, 0, 10, 'DE', 115, 'L', 1307105002, '0000-00-00 00:00:00', '', '', ''), -(148, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', '', '4297f44b13955235245b2497399d7a93', 0, 1, 1, 10, 'DE', 0, 'L', 1307082872, '2011-06-03 07:55:24', 'AudioEngel', '', ''); +(1, 'admin', 'Gates', 'Bill', 42, '', '', '', '', '', '', '', '21232f297a57a5a743894a0e4a801fc3', 1, 1, 0, 10, 'DE', 115, 'L', 1307110821, '0000-00-00 00:00:00', '', '', ''), +(148, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', '', '4297f44b13955235245b2497399d7a93', 0, 1, 1, 10, 'DE', 0, 'L', 1307110798, '2011-06-03 07:55:24', 'AudioEngel', '', ''); -- -------------------------------------------------------- @@ -1227,13 +1233,16 @@ INSERT INTO `UserPicture` (`UID`, `Bild`, `ContentType`, `show`) VALUES CREATE TABLE IF NOT EXISTS `Wecken` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `UID` int(11) NOT NULL DEFAULT '0', - `Date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `Date` int(11) NOT NULL, `Ort` text NOT NULL, `Bemerkung` text NOT NULL, PRIMARY KEY (`ID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; -- -- Daten für Tabelle `Wecken` -- +INSERT INTO `Wecken` (`ID`, `UID`, `Date`, `Ort`, `Bemerkung`) VALUES +(4, 1, 1307109840, 'Tent 23', 'knock knock leo, follow the white rabbit to the blue tent'), +(5, 1, 1307109840, 'Tent 23', 'knock knock leo, follow the white rabbit to the blue tent'); diff --git a/includes/pages/user_wakeup.php b/includes/pages/user_wakeup.php new file mode 100644 index 00000000..b6955669 --- /dev/null +++ b/includes/pages/user_wakeup.php @@ -0,0 +1,92 @@ +getTimestamp(); + $bemerkung = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['Bemerkung'])); + $ort = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}]{1,})/ui", '', strip_tags($_REQUEST['Ort'])); + $SQL = "INSERT INTO `Wecken` (`UID`, `Date`, `Ort`, `Bemerkung`) " . + "VALUES ('" . $user['UID'] . "', '" . $date . "', '" . $ort . "', " . + "'" . $bemerkung . "')"; + sql_query($SQL); + $html .= success(Get_Text(4)); + } else + $html .= error("Broken date!"); + break; + + case 'delete' : + if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) + $id = $_REQUEST['id']; + else + return error("Incomplete call, missing wake-up ID."); + + $wakeup = sql_select("SELECT * FROM `Wecken` WHERE `ID`=" . sql_escape($id) . " LIMIT 1"); + if (count($wakeup) > 0 && $wakeup[0]['UID'] == $user['UID']) { + sql_query("DELETE FROM `Wecken` WHERE `ID`=" . sql_escape($id) . " LIMIT 1"); + $html .= success("Wake-up call deleted."); + } else + return error("No wake-up found."); + break; + } + } + + $html .= "

    " . Get_Text("Hello") . $user['Nick'] . ",
    " . Get_Text("pub_wake_beschreibung") . "

    \n\n"; + $html .= Get_Text("pub_wake_beschreibung2"); + $html .= ' + + + + + + + + +'; + + $sql = "SELECT * FROM `Wecken` ORDER BY `Date` ASC"; + $Erg = sql_query($sql); + $count = mysql_num_rows($Erg); + + for ($i = 0; $i < $count; $i++) { + $row = mysql_fetch_row($Erg); + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + if (mysql_result($Erg, $i, "UID") == $user['UID']) + $html .= ''; + else + $html .= ''; + $html .= ''; + } + + $html .= '
    ' . Get_Text("pub_wake_Datum") . '' . Get_Text("pub_waeckliste_Nick") . '' . Get_Text("pub_wake_Ort") . '' . Get_Text("pub_wake_Bemerkung") . '
    ' . date("Y-m-d H:i", mysql_result($Erg, $i, "Date")) . ' ' . UID2Nick(mysql_result($Erg, $i, "UID")) . ' ' . mysql_result($Erg, $i, "Ort") . ' ' . mysql_result($Erg, $i, "Bemerkung") . ' " . Get_Text("pub_wake_del") . '

    ' . Get_Text("pub_wake_Text2") . ' +
    + + + + + + + + + + + + + +
    ' . Get_Text("pub_wake_Datum") . ':
    ' . Get_Text("pub_wake_Ort") . '
    ' . Get_Text("pub_wake_Bemerkung") . '
    + +
    '; + + return $html; +} +?> \ No newline at end of file diff --git a/includes/sys_menu.php b/includes/sys_menu.php index e81bed8d..b651a002 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -27,6 +27,7 @@ function make_navigation() { "user_shifts", "user_messages", "user_questions", + "user_wakeup", "user_settings" )); diff --git a/www-ssl/index.php b/www-ssl/index.php index 214ec54a..71c13d15 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -55,6 +55,10 @@ if (in_array($p, $privileges)) { require_once ('includes/pages/user_questions.php'); $content = user_questions(); } + elseif ($p == "user_wakeup") { + require_once ('includes/pages/user_wakeup.php'); + $content = user_wakeup(); + } elseif ($p == "user_settings") { require_once ('includes/pages/user_settings.php'); $content = user_settings(); diff --git a/www-ssl/nonpublic/waeckliste.php b/www-ssl/nonpublic/waeckliste.php deleted file mode 100644 index d98dd455..00000000 --- a/www-ssl/nonpublic/waeckliste.php +++ /dev/null @@ -1,46 +0,0 @@ - - -

    \n" . Get_Text("pub_waeckliste_Text1"); ?>

    - - - - - - - - - - - - - - - - -
    - - diff --git a/www-ssl/nonpublic/wecken.php b/www-ssl/nonpublic/wecken.php deleted file mode 100644 index 0d44b48d..00000000 --- a/www-ssl/nonpublic/wecken.php +++ /dev/null @@ -1,86 +0,0 @@ -" . Get_Text("Hello") . $_SESSION['Nick'] . ",
    " . Get_Text("pub_wake_beschreibung") . "

    \n\n"; -echo Get_Text("pub_wake_beschreibung2"); -?> - - - - - - - - - - - - - - - - - -
    " . Get_Text("pub_wake_del"); ?>
    -

    - -

    - -
    - - - - - - - - - - - - - -
    :
    -" /> -
    - -- cgit v1.2.3-70-g09d2 From 586272ccec099913814c0171d7616ad737421ac7 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 3 Jun 2011 16:52:57 +0200 Subject: begin pentabarf import --- includes/funktion_xml.php | 244 +++++++++++++++++++------------------- includes/pages/admin_import.php | 253 ++++++++++++++++++++++++++++++++++++++++ includes/sys_menu.php | 1 + www-ssl/index.php | 4 + 4 files changed, 380 insertions(+), 122 deletions(-) create mode 100644 includes/pages/admin_import.php (limited to 'includes/sys_menu.php') diff --git a/includes/funktion_xml.php b/includes/funktion_xml.php index 60eb26fa..87fd72d0 100644 --- a/includes/funktion_xml.php +++ b/includes/funktion_xml.php @@ -1,154 +1,154 @@ sub[ $XMLpos[$Tiefe] ]->data .= htmlentities( convertValues($Data), ENT_QUOTES); - - if($XMLDEBUG) - echo "???". $Objekt->sub[ $XMLpos[$Tiefe] ]->name. "|$Data|$Tiefe???
    "; - } else - dataXMLmain( $Data, $Objekt->sub[ $XMLpos[$Tiefe] ], $Tiefe+1); +function dataXMLmain($Data, & $Objekt, $Tiefe) { + global $XMLmain, $XMLpos, $depth, $XMLDEBUG; + + if ($XMLDEBUG) + echo "?$Tiefe$depth"; + + if (($depth -1) == $Tiefe) { + $Objekt->sub[$XMLpos[$Tiefe]]->data .= htmlentities(convertValues($Data), ENT_QUOTES); + + if ($XMLDEBUG) + echo "???" . $Objekt->sub[$XMLpos[$Tiefe]]->name . "|$Data|$Tiefe???
    "; + } else + dataXMLmain($Data, $Objekt->sub[$XMLpos[$Tiefe]], $Tiefe +1); } -function startXMLmain( $Data, &$Objekt, $Tiefe ) { - global $XMLpos, $depth, $XMLDEBUG; - - if( $XMLDEBUG) - if($Tiefe==1) - { print_r(array_values ($XMLpos)); echo "--".$Data->name; - echo " #$Tiefe/$depth#"; - } - - if( $depth==$Tiefe) - { - $Objekt->sub[ $XMLpos[$Tiefe] ] = $Data; - if( $XMLDEBUG) - echo "|". $XMLpos[$Tiefe]."|". $Objekt->sub[ $XMLpos[$Tiefe] ]->name. " ". $Data->name." save|". "#-#
    "; - } - else - startXMLmain( $Data, $Objekt->sub[ $XMLpos[$Tiefe] ], $Tiefe+1); +function startXMLmain($Data, & $Objekt, $Tiefe) { + global $XMLpos, $depth, $XMLDEBUG; + + if ($XMLDEBUG) + if ($Tiefe == 1) { + print_r(array_values($XMLpos)); + echo "--" . $Data->name; + echo " #$Tiefe/$depth#"; + } + + if ($depth == $Tiefe) { + $Objekt->sub[$XMLpos[$Tiefe]] = $Data; + if ($XMLDEBUG) + echo "|" . $XMLpos[$Tiefe] . "|" . $Objekt->sub[$XMLpos[$Tiefe]]->name . " " . $Data->name . " save|" . "#-#
    "; + } else + startXMLmain($Data, $Objekt->sub[$XMLpos[$Tiefe]], $Tiefe +1); } -function start_element_handler($parser, $name, $attribs) -{ - global $depth, $XMLmain, $XMLpos; +function start_element_handler($parser, $name, $attribs) { + global $depth, $XMLmain, $XMLpos; - $Data = new element; - $Data->name = $name; - while(list($key, $value) = each($attribs)) - $Data->attributes[$key] = convertValues($value); - $Data->depth = $depth; - $XMLpos[$depth]++; + $Data = new element; + $Data->name = $name; + while (list ($key, $value) = each($attribs)) + $Data->attributes[$key] = convertValues($value); + $Data->depth = $depth; + $XMLpos[$depth]++; - if( $depth==0) - $XMLmain= $Data; - else - startXMLmain( $Data, $XMLmain, 1); + if ($depth == 0) + $XMLmain = $Data; + else + startXMLmain($Data, $XMLmain, 1); - $depth++; + $depth++; } -function end_element_handler($parser, $name) -{ - global $depth, $XMLpos; - $XMLpos[$depth]=0; - $depth--; +function end_element_handler($parser, $name) { + global $depth, $XMLpos; + $XMLpos[$depth] = 0; + $depth--; } -function character_data_handler($parser, $data) -{ - global $XMLmain; - if( strlen(trim($data)) ) - dataXMLmain( $data, $XMLmain, 1); +function character_data_handler($parser, $data) { + global $XMLmain; + if (strlen(trim($data))) + dataXMLmain($data, $XMLmain, 1); } /*#######################################################################################*/ -function readXMLfile( $file ) -{ - global $XMLDEBUG; - - //$xml_parser = xml_parser_create_ns(); - $xml_parser = xml_parser_create("UTF-8"); - xml_set_element_handler($xml_parser, "start_element_handler", "end_element_handler"); - xml_set_character_data_handler($xml_parser, "character_data_handler"); - - if (file_exists($file)) - { - if (!($fp = fopen($file, "r"))) - { - echo("

    could not open XML file \"$file\"

    "); - return -1; - } - } - else - { - echo("

    XML file \"$file\" not exist

    "); - return -1; - } - - if( $XMLDEBUG) echo "
    ";
    -  while ($data = fread($fp, 4096)) 
    -  {
    -    if (!xml_parse($xml_parser, $data, feof($fp))) 
    -    {
    -      die(sprintf("XML error: %s at line %d",
    -            xml_error_string(xml_get_error_code($xml_parser)),
    -            xml_get_current_line_number($xml_parser)));
    -    }
    -  }
    -  if( $XMLDEBUG)  echo "
    "; - xml_parser_free($xml_parser); - return 0; +function readXMLfile($file) { + global $XMLDEBUG; + + //$xml_parser = xml_parser_create_ns(); + $xml_parser = xml_parser_create("UTF-8"); + xml_set_element_handler($xml_parser, "start_element_handler", "end_element_handler"); + xml_set_character_data_handler($xml_parser, "character_data_handler"); + + if (file_exists($file)) { + if (!($fp = fopen($file, "r"))) { + echo ("

    could not open XML file \"$file\"

    "); + return -1; + } + } else { + echo ("

    XML file \"$file\" not exist

    "); + return -1; + } + + if ($XMLDEBUG) + echo "
    ";
    +	while ($data = fread($fp, 4096)) {
    +		if (!xml_parse($xml_parser, $data, feof($fp))) {
    +			die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)));
    +		}
    +	}
    +	if ($XMLDEBUG)
    +		echo "
    "; + xml_parser_free($xml_parser); + return 0; } /*#######################################################################################*/ -function getXMLsubPease( $Sourse, $Name ) -{ - foreach($Sourse->sub as $key => $value) { - if ($value->name == $Name) { - return $value; - } - } - - echo "

    Fehler: getXMLsubPease( $Sourse, $Name ) not found

    "; -// die; +function getXMLsubPease($Sourse, $Name) { + foreach ($Sourse->sub as $key => $value) { + if ($value->name == $Name) { + return $value; + } + } + + echo "

    Fehler: getXMLsubPease( $Sourse, $Name ) not found

    "; + // die; } /*#######################################################################################*/ -function getXMLsubData( $Sourse, $Name ) -{ - $XML = getXMLsubPease( $Sourse, $Name); - return $XML->data; +function getXMLsubData($Sourse, $Name) { + $XML = getXMLsubPease($Sourse, $Name); + return $XML->data; } ?> diff --git a/includes/pages/admin_import.php b/includes/pages/admin_import.php new file mode 100644 index 00000000..9b8af2e2 --- /dev/null +++ b/includes/pages/admin_import.php @@ -0,0 +1,253 @@ +\n

    XML File:

    \n"; + if (isset ($_POST["PentabarfUser"]) && isset ($_POST["password"]) && isset ($_POST["PentabarfURL"])) { + $html .= "Update XCAL-File from Pentabarf.."; + if ($PentabarfGetWith == "fsockopen") { + + //backup error messeges and delate + $Backuperror_messages = $error_messages; + $fp = fsockopen("ssl://$PentabarfXMLhost", 443, $errno, $errstr, 30); + // $error_messages = $Backuperror_messages; + + if (!$fp) { + $html .= "

    fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . "' not readable!" . + "[$errstr ($errno)]

    "; + } else { + if (($fileOut = fopen("$Tempdir/engelXML", "w")) != FALSE) { + $head = 'GET /' . $PentabarfXMLpath . $_POST["PentabarfURL"] . ' HTTP/1.1' . "\r\n" . + 'Host: ' . $PentabarfXMLhost . "\r\n" . + 'User-Agent: Engelsystem' . "\r\n" . + 'Authorization: Basic ' . + base64_encode($_POST["PentabarfUser"] . ':' . $_POST["password"]) . "\r\n" . + "\r\n"; + fputs($fp, $head); + $Zeilen = -1; + while (!feof($fp)) { + $Temp = fgets($fp, 1024); + + // ende des headers + if ($Temp == "f20\r\n") { + $Zeilen = 0; + $Temp = ""; + } + + //file ende? + if ($Temp == "0\r\n") + break; + + if (($Zeilen > -1) && ($Temp != "ffb\r\n")) { + //steuerzeichen ausfiltern + if (strpos("#$Temp", "\r\n") > 0) + $Temp = substr($Temp, 0, strlen($Temp) - 2); + if (strpos("#$Temp", "1005") > 0) + $Temp = ""; + if (strpos("#$Temp", "783") > 0) + $Temp = ""; + //schreiben in file + fputs($fileOut, $Temp); + $Zeilen++; + } + } + fclose($fileOut); + + $html .= "
    Es wurden $Zeilen Zeilen eingelesen
    "; + } else + $html .= "

    fail: File '$Tempdir/engelXML' not writeable!

    "; + fclose($fp); + } + } + elseif ($PentabarfGetWith == "fopen") { + //user uns password in url einbauen + $FileNameIn = "https://" . $_POST["PentabarfUser"] . ':' . $_POST["password"] . "@" . + $PentabarfXMLhost . "/" . $PentabarfXMLpath . $_POST["PentabarfURL"]; + + if (($fileIn = fopen($FileNameIn, "r")) != FALSE) { + if (($fileOut = fopen("$Tempdir/engelXML", "w")) != FALSE) { + $Zeilen = 0; + while (!feof($fileIn)) { + $Zeilen++; + fputs($fileOut, fgets($fileIn)); + } + fclose($fileOut); + $html .= "
    Es wurden $Zeilen Zeilen eingelesen
    "; + } else + $html .= "

    fail: File '$Tempdir/engelXML' not writeable!

    "; + fclose($fileIn); + } else + $html .= "

    fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . "' not readable!

    "; + } + elseif ($PentabarfGetWith == "wget") { + $Command = "wget --http-user=" . $_POST["PentabarfUser"] . " --http-passwd=" . $_POST["password"] . " " . + "https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . + " --output-file=$Tempdir/engelXMLwgetLog --output-document=$Tempdir/engelXML" . + " --no-check-certificate"; + $html .= system($Command, $Status); + if ($Status == 0) + $html .= "OK.
    "; + else + $html .= "fail ($Status)($Command).
    "; + } + elseif ($PentabarfGetWith == "lynx") { + $Command = "lynx -auth=" . $_POST["PentabarfUser"] . ":" . $_POST["password"] . " -dump " . + "https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . " > $Tempdir/engelXML"; + $html .= system($Command, $Status); + if ($Status == 0) + $html .= "OK.
    "; + else + $html .= "fail ($Status)($Command).
    "; + } + elseif ($PentabarfGetWith == "fopen") { + //user uns password in url einbauen + $FileNameIn = "https://" . $_POST["PentabarfUser"] . ':' . $_POST["password"] . "@" . + $PentabarfXMLhost . "/" . $PentabarfXMLpath . $_POST["PentabarfURL"]; + + if (($fileIn = fopen($FileNameIn, "r")) != FALSE) { + if (($fileOut = fopen("$Tempdir/engelXML", "w")) != FALSE) { + $Zeilen = 0; + while (!feof($fileIn)) { + $Zeilen++; + fputs($fileOut, fgets($fileIn)); + } + fclose($fileOut); + $html .= "
    Es wurden $Zeilen Zeilen eingelesen
    "; + } else + $html .= "

    fail: File '$Tempdir/engelXML' not writeable!

    "; + fclose($fileIn); + } else + $html .= "

    fail: File 'https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . "' not readable!

    "; + } + elseif ($PentabarfGetWith == "wget") { + $Command = "wget --http-user=" . $_POST["PentabarfUser"] . " --http-passwd=" . $_POST["password"] . " " . + "https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . + " --output-file=$Tempdir/engelXMLwgetLog --output-document=$Tempdir/engelXML" . + " --no-check-certificate"; + $html .= system($Command, $Status); + if ($Status == 0) + $html .= "OK.
    "; + else + $html .= "fail ($Status)($Command).
    "; + } + elseif ($PentabarfGetWith == "lynx") { + $Command = "lynx -auth=" . $_POST["PentabarfUser"] . ":" . $_POST["password"] . " -dump " . + "https://$PentabarfXMLhost/$PentabarfXMLpath" . $_POST["PentabarfURL"] . " > $Tempdir/engelXML"; + $html .= system($Command, $Status); + if ($Status == 0) + $html .= "OK.
    "; + else + $html .= "fail ($Status)($Command).
    "; + } else + $html .= "

    The PentabarfGetWith='$PentabarfGetWith' not supported

    "; + } else { + $html .= "
    \n"; + $html .= "\n"; + $html .= "\t" . + "\n"; + $html .= "\t" . + "\n"; + $html .= "\t" . + "\n"; + $html .= "\t\n"; + $html .= "
    XCAL-File: https://$PentabarfXMLhost/$PentabarfXMLpath
    Username:
    Password:
    \n"; + $html .= "
    \n"; + } + + //readXMLfile("xml.php.xml"); + if (readXMLfile("$Tempdir/engelXML") == 0) { + $XMLmain = getXMLsubPease($XMLmain, "VCALENDAR"); + + if ($ShowDataStrukture) { + $html .= "

    "; + $html .= $XMLmain->name; + $html .= "
    "; + print_r(array_values($XMLmain->sub)); + $html .= "
    "; + } + + /* + $html .= "
    "; + $Feld=7; + $html .= "$Feld#". $XMLmain->sub[$Feld]->name. "
    "; + $html .= "$Feld#". $XMLmain->sub[$Feld]->sub; + //print_r(array_values ($XMLmain->sub[$Feld]->sub)); + while(list($key, $value) = each($XMLmain->sub[$Feld]->sub)) + $html .= "?ID".$value->sub[1]->data. "=". $value->sub[2]->data. "\n"; + $html .= ""; + */ + + /*############################################################################################## + V e r s i o n + ##############################################################################################*/ + + $html .= "
    \n"; + $XMLrelease = getXMLsubPease($XMLmain, "X-WR-CALDESC"); + $html .= "release: " . $XMLrelease->data . "
    \n"; + //$XMLreleaseDate = getXMLsubPease( $XMLmain, "RELEASE-DATE"); + //$html .= "release date: ". $XMLreleaseDate->data. "
    \n"; + $html .= "
    \n"; + + /*############################################################################################## + V e r s i o n + ##############################################################################################*/ + if ($EnableRoomFunctions) + include ("includes/funktion_xml_room.php"); + + if ($EnableSchudleFunctions) + include ("includes/funktion_xml_schudle.php"); + + /*############################################################################################## + U P D A T E A L L + ##############################################################################################*/ + $html .= "\n\n
    \n

    Update ALL:

    \n"; + + $html .= "
    \n"; + $html .= "\t\n"; + $html .= "
    \n"; + + } //if XMLopenOOK + return $html; +} + +/*############################################################################################## + erstellt Arrays der Reume + ##############################################################################################*/ +function CreateRoomArrays() { + global $Room, $RoomID, $RoomName, $con; + + $sql = "SELECT `RID`, `Name` FROM `Room` " . + "WHERE `Show`='Y'" . + "ORDER BY `Number`, `Name`;"; + $Erg = mysql_query($sql, $con); + $rowcount = mysql_num_rows($Erg); + + for ($i = 0; $i < $rowcount; $i++) { + $Room[$i]["RID"] = mysql_result($Erg, $i, "RID"); + $Room[$i]["Name"] = mysql_result($Erg, $i, "Name"); + $RoomID[mysql_result($Erg, $i, "RID")] = mysql_result($Erg, $i, "Name"); + $RoomName[mysql_result($Erg, $i, "Name")] = mysql_result($Erg, $i, "RID"); + } +} +?> + diff --git a/includes/sys_menu.php b/includes/sys_menu.php index b651a002..dfe33216 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -42,6 +42,7 @@ function make_navigation() { "admin_groups", "admin_faq", "admin_language", + "admin_import", "admin_log" )); return $menu; diff --git a/www-ssl/index.php b/www-ssl/index.php index 71c13d15..e1a4496f 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -106,6 +106,10 @@ if (in_array($p, $privileges)) { require_once ('includes/pages/admin_language.php'); $content = admin_language(); } + elseif ($p == "admin_import") { + require_once ('includes/pages/admin_import.php'); + $content = admin_import(); + } elseif ($p == "admin_log") { require_once ('includes/pages/admin_log.php'); $content = admin_log(); -- cgit v1.2.3-70-g09d2