From 57a92dbdcd1ecd27bde621e9a51dbbd11ed82845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Sat, 6 Dec 2014 18:10:27 +0100 Subject: [PATCH] add opt-in bool for shiftinfo mails and remove icq from users --- db/update.sql | 6 ++++++ includes/controller/api.php | 2 +- includes/helper/email_helper.php | 2 +- includes/model/User_model.php | 2 +- includes/pages/admin_user.php | 2 -- includes/pages/guest_login.php | 6 +----- includes/pages/user_settings.php | 6 +----- locale/de_DE.UTF-8/LC_MESSAGES/default.mo | Bin 27829 -> 27828 bytes locale/de_DE.UTF-8/LC_MESSAGES/default.po | 4 ++-- public/index.php | 3 +-- 10 files changed, 14 insertions(+), 19 deletions(-) diff --git a/db/update.sql b/db/update.sql index 9862c027..7caf7223 100644 --- a/db/update.sql +++ b/db/update.sql @@ -1,3 +1,9 @@ +/* cleanup */ +ALTER TABLE `User` DROP `ICQ` ; + +/* opt-in field for user shiftinfo mails */ +ALTER TABLE `User` ADD `email_shiftinfo` BOOLEAN NOT NULL DEFAULT FALSE COMMENT 'User wants to be informed by mail about changes in his shifts' AFTER `email` ; + /* fix questions */ ALTER TABLE `Questions` CHANGE `AID` `AID` INT( 11 ) NULL DEFAULT NULL ; diff --git a/includes/controller/api.php b/includes/controller/api.php index 4403b984..9ecd3a2f 100644 --- a/includes/controller/api.php +++ b/includes/controller/api.php @@ -63,7 +63,7 @@ getUser id (integer) - User ID Return Example: [{"UID":"1"},{"UID":"23"},{"UID":"42"}] - {"UID":"1","Nick":"admin","Name":"Gates","Vorname":"Bill","Telefon":"","DECT":"","Handy":"","email":"","ICQ":"","jabber":"","Avatar":"115"} + {"UID":"1","Nick":"admin","Name":"Gates","Vorname":"Bill","Telefon":"","DECT":"","Handy":"","email":"","jabber":"","Avatar":"115"} getShift Description: diff --git a/includes/helper/email_helper.php b/includes/helper/email_helper.php index 98cfd0f3..b8ccabc4 100644 --- a/includes/helper/email_helper.php +++ b/includes/helper/email_helper.php @@ -13,4 +13,4 @@ function engelsystem_email($address, $title, $message) { return mail($address, $title, $message, "Content-Type: text/plain; charset=UTF-8\r\nFrom: Engelsystem "); } -?> \ No newline at end of file +?> diff --git a/includes/model/User_model.php b/includes/model/User_model.php index 45ed2700..2d2b1afb 100644 --- a/includes/model/User_model.php +++ b/includes/model/User_model.php @@ -132,7 +132,7 @@ function User($id) { * @param $id UID */ function mUser_Limit($id) { - $user_source = sql_select("SELECT `UID`, `Nick`, `Name`, `Vorname`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Avatar` FROM `User` WHERE `UID`=" . sql_escape($id) . " LIMIT 1"); + $user_source = sql_select("SELECT `UID`, `Nick`, `Name`, `Vorname`, `Telefon`, `DECT`, `Handy`, `email`, `jabber`, `Avatar` FROM `User` WHERE `UID`=" . sql_escape($id) . " LIMIT 1"); if ($user_source === false) return false; if (count($user_source) > 0) diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index 26bf18b5..09398f6f 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -33,7 +33,6 @@ function admin_user() { $html .= " Handy" . "\n"; $html .= " DECT" . "\n"; $html .= " email" . "\n"; - $html .= " ICQ" . "\n"; $html .= " jabber" . "\n"; $html .= " Size" . html_select_key('size', 'eSize', $tshirt_sizes, $user_source['Size']) . "\n"; @@ -236,7 +235,6 @@ function admin_user() { `Alter` = '" . sql_escape($_POST["eAlter"]) . "', `DECT` = '" . sql_escape($_POST["eDECT"]) . "', `email` = '" . sql_escape($_POST["eemail"]) . "', - `ICQ` = '" . sql_escape($_POST["eICQ"]) . "', `jabber` = '" . sql_escape($_POST["ejabber"]) . "', `Size` = '" . sql_escape($_POST["eSize"]) . "', `Gekommen`= '" . sql_escape($_POST["eGekommen"]) . "', diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index c2bdfe97..b23f82e6 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -25,7 +25,6 @@ function guest_register() { $dect = ""; $mobile = ""; $mail = ""; - $icq = ""; $jabber = ""; $hometown = ""; $comment = ""; @@ -66,8 +65,6 @@ function guest_register() { $msg .= error(_("Please enter your e-mail."), true); } - if (isset($_REQUEST['icq'])) - $icq = strip_request_item('icq'); if (isset($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) { $jabber = strip_request_item('jabber'); if (! check_email($jabber)) { @@ -119,7 +116,7 @@ function guest_register() { $comment = strip_request_item_nl('comment'); if ($ok) { - sql_query("INSERT INTO `User` SET `color`=" . sql_escape($default_theme) . ", `Nick`='" . sql_escape($nick) . "', `Vorname`='" . sql_escape($prename) . "', `Name`='" . sql_escape($lastname) . "', `Alter`='" . sql_escape($age) . "', `Telefon`='" . sql_escape($tel) . "', `DECT`='" . sql_escape($dect) . "', `Handy`='" . sql_escape($mobile) . "', `email`='" . sql_escape($mail) . "', `ICQ`='" . sql_escape($icq) . "', `jabber`='" . sql_escape($jabber) . "', `Size`='" . sql_escape($tshirt_size) . "', `Passwort`='" . sql_escape($password_hash) . "', `kommentar`='" . sql_escape($comment) . "', `Hometown`='" . sql_escape($hometown) . "', `CreateDate`=NOW(), `Sprache`='" . sql_escape($_SESSION["locale"]) . "'"); + sql_query("INSERT INTO `User` SET `color`=" . sql_escape($default_theme) . ", `Nick`='" . sql_escape($nick) . "', `Vorname`='" . sql_escape($prename) . "', `Name`='" . sql_escape($lastname) . "', `Alter`='" . sql_escape($age) . "', `Telefon`='" . sql_escape($tel) . "', `DECT`='" . sql_escape($dect) . "', `Handy`='" . sql_escape($mobile) . "', `email`='" . sql_escape($mail) . "', `jabber`='" . sql_escape($jabber) . "', `Size`='" . sql_escape($tshirt_size) . "', `Passwort`='" . sql_escape($password_hash) . "', `kommentar`='" . sql_escape($comment) . "', `Hometown`='" . sql_escape($hometown) . "', `CreateDate`=NOW(), `Sprache`='" . sql_escape($_SESSION["locale"]) . "'"); // Assign user-group and set password $user_id = sql_id(); @@ -198,7 +195,6 @@ function guest_register() { form_info(entry_required() . ' = ' . _("Entry required!")) )) )), - // form_text('icq', _("ICQ"), $icq), // form_textarea('comment', _("Did you help at former CCC events and which tasks have you performed then?"), $comment), form_submit('submit', _("Register")) )) diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index 1e593652..d39793ee 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -16,7 +16,6 @@ function user_settings() { $dect = $user['DECT']; $mobile = $user['Handy']; $mail = $user['email']; - $icq = $user['ICQ']; $jabber = $user['jabber']; $hometown = $user['Hometown']; $tshirt_size = $user['Size']; @@ -59,8 +58,6 @@ function user_settings() { $msg .= error(_("Please enter your e-mail."), true); } - if (isset($_REQUEST['icq'])) - $icq = strip_request_item('icq'); if (isset($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) { $jabber = strip_request_item('jabber'); if (! check_email($jabber)) { @@ -97,7 +94,7 @@ function user_settings() { $hometown = strip_request_item('hometown'); if ($ok) { - sql_query("UPDATE `User` SET `Nick`='" . sql_escape($nick) . "', `Vorname`='" . sql_escape($prename) . "', `Name`='" . sql_escape($lastname) . "', `Alter`='" . sql_escape($age) . "', `Telefon`='" . sql_escape($tel) . "', `DECT`='" . sql_escape($dect) . "', `Handy`='" . sql_escape($mobile) . "', `email`='" . sql_escape($mail) . "', `ICQ`='" . sql_escape($icq) . "', `jabber`='" . sql_escape($jabber) . "', `Size`='" . sql_escape($tshirt_size) . "', `Hometown`='" . sql_escape($hometown) . "' WHERE `UID`=" . sql_escape($user['UID'])); + sql_query("UPDATE `User` SET `Nick`='" . sql_escape($nick) . "', `Vorname`='" . sql_escape($prename) . "', `Name`='" . sql_escape($lastname) . "', `Alter`='" . sql_escape($age) . "', `Telefon`='" . sql_escape($tel) . "', `DECT`='" . sql_escape($dect) . "', `Handy`='" . sql_escape($mobile) . "', `email`='" . sql_escape($mail) . "', `jabber`='" . sql_escape($jabber) . "', `Size`='" . sql_escape($tshirt_size) . "', `Hometown`='" . sql_escape($hometown) . "' WHERE `UID`=" . sql_escape($user['UID'])); // Assign angel-types $user_angel_type_info = array(); @@ -178,7 +175,6 @@ function user_settings() { form_text('dect', _("DECT"), $dect), form_text('mobile', _("Mobile"), $mobile), form_text('mail', _("E-Mail") . "*", $mail), - form_text('icq', _("ICQ"), $icq), form_text('jabber', _("Jabber"), $jabber), form_text('hometown', _("Hometown"), $hometown), $enable_tshirt_size ? form_select('tshirt_size', _("Shirt size"), $tshirt_sizes, $tshirt_size) : '', diff --git a/locale/de_DE.UTF-8/LC_MESSAGES/default.mo b/locale/de_DE.UTF-8/LC_MESSAGES/default.mo index 582ca04e4cd764d7447a7ef6eb24c4a7930c3673..0fbe8254ed491187091f189d68286a3c87b44e38 100644 GIT binary patch delta 550 zcmXZZu}eZx6vy%NN=ma-%1UUlA~HnEAeD*?n?z_6nuIbY65tLg5)f$#M zG=&7wzaTVAM9|vM(D%@rKIhzfx#xGe&9>2K8?}bl>=%*8tVj}{@fIE1B3`^lAHJX) z-?0n7FoWMXgzGtxRoub^-rzEJa0MsxA|c(!D4yX3zU9S~F^bHN$UatZ7eDbF(*==f z{J>H46h+Dyz$v`OL3~AhNE-v#!6kHaSp-w4L5?wwEu2B4WQufC1WO`zoW(wjVK1(s z15@b4GOFU8!x}oVi5jS7^*<(s4zTV0>$3FWFzXZ8gE4D8 zjxPEnYLE@ofkkV-j5_EDHQ)*ALoQK+UZH;B0~%PbjpTyP@O)@4;txj`7h-jPqB?F= J>QC8U`ya|)Q5paM delta 545 zcmXZZ&nv@m9LMqZ_v_be*f76xnGg%*G%aG53$5H%94KEKHs#rkt0wa#aqV?|e^>_xtnt^m)I&-%qh@Jd}-G(Qh}4NZt~e$7jr4HdOy}< z*jbNY3;hCWkR{ZCDQABlb\n" "Language-Team: \n" "Language: de_DE\n" @@ -1713,7 +1713,7 @@ msgstr "Summe:" #: /Users/msquare/workspace/projects/engelsystem/includes/view/User_view.php:152 msgid "User state" -msgstr "Engel Zustand" +msgstr "Engelzustand" #: /Users/msquare/workspace/projects/engelsystem/includes/view/User_view.php:155 msgid "Not arrived" diff --git a/public/index.php b/public/index.php index 67f9ee11..f6dca310 100644 --- a/public/index.php +++ b/public/index.php @@ -1,5 +1,4 @@