exit; } if (isset($_GET["messages"])) { messages(); exit; } if (isset($_GET["add"])) { messages_add(); exit; } if (isset($_POST["upload-message"])) { message_upload(); exit; } if (isset($_GET["messages-list"])) { messages_list(); exit; } if (isset($_GET["show-results"])) { message_results(); exit; } if (isset($_GET["analyze-message"])) { message_analyze(); exit; } if (isset($_GET["delete-message"])) { message_delete(); exit; } js();
jscript_go_back(); break; case 'read': traffa_draw_user_div($_SESSION['login']['id'], $_SESSION); if (!messages_view($_GET['message_id'], $_SESSION['login']['id']) || !is_numeric($_GET['message_id'])) { jscript_alert('Ett problem uppstod när meddelandet skulle visas. Du kanske inte kan läsa detta meddelande.'); jscript_location($_SERVER['PHP_SELF']); } break; case 'conversation': $options = array('mode' => 'conversation', 'user' => $_GET['user'], 'order' => $_GET['order'], 'direction' => $_GET['direction'], 'offset' => $_GET['offset']); messages_list($_SESSION['login']['id'], $options); break; case 'list_sent': traffa_draw_user_div($_SESSION['login']['id'], $_SESSION); $options = array('order' => $_GET['order'], 'mode' => 'sent', 'direction' => $_GET['direction'], 'offset' => $_GET['offset']); messages_list($_SESSION['login']['id'], $options); break; case 'inbox': traffa_draw_user_div($_SESSION['login']['id'], $_SESSION); $options = array('order' => $_GET['order'], 'mode' => 'recieved', 'direction' => $_GET['direction'], 'offset' => $_GET['offset']); messages_list($_SESSION['login']['id'], $options); messages_pre_compose(); break; default: jscript_alert('Ett okänt action-värde skickades! Dödar scriptet.'); die; break; } echo '</div>'; ui_bottom();
include_once('ressources/class.ini.inc'); include_once('ressources/class.spamassassin.inc'); include_once('ressources/class.mime.parser.inc'); include_once(dirname(__FILE__).'/ressources/class.rfc822.addresses.inc'); $user=new usersMenus(); if($user->AsPostfixAdministrator==false){ $tpl=new templates(); echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');"; die();exit(); } if(isset($_GET["tabs"])){tabs();exit;} if(isset($_GET["messages"])){messages();exit;} if(isset($_GET["add"])){messages_add();exit;} if(isset($_POST["upload-message"])){message_upload();exit;} if(isset($_GET["messages-list"])){messages_list();exit;} if(isset($_GET["show-results"])){message_results();exit;} if(isset($_GET["analyze-message"])){message_analyze();exit;} if(isset($_GET["delete-message"])){message_delete();exit;} js(); function js(){ $tpl=new templates(); $page=CurrentPageName(); $title=$tpl->_ENGINE_parse_body("{APP_SPAMASSASSIN}::{message_analyze}"); echo "YahooWin3('700','$page?tabs=yes','$title');";
function messages_view($message_id, $user_id, $quoting = 0) { $query = 'SELECT m.id, m.timestamp, m.recipient_status AS recipient_status, CONCAT(mm.title, m.title) AS title, '; $query .= 'CONCAT(mm.message, m.message) AS message, '; $query .= 'm.discussion AS discussion, m.recipient AS recipient_id, m.sender AS sender_id, rlogin.username AS recipient_username, '; $query .= 'slogin.username AS sender_username, rinfo.birthday AS recipient_birthday, sinfo.birthday AS sender_birthday, '; $query .= 'rinfo.gender AS recipient_gender, sinfo.gender AS sender_gender, rzip.spot AS recipient_location, '; $query .= 'szip.spot AS sender_location, rinfo.image AS recipient_image, sinfo.image AS sender_image '; $query .= 'FROM messages_new AS m, mass_messages AS mm, login AS slogin, login AS rlogin, userinfo AS sinfo, userinfo AS rinfo, zip_codes AS szip, zip_codes AS rzip '; $query .= 'WHERE mm.id = m.mass_message_id AND rlogin.id = m.recipient AND slogin.id = m.sender AND rinfo.userid = m.recipient AND rzip.zip_code = rinfo.zip_code AND szip.zip_code = sinfo.zip_code AND '; $query .= 'sinfo.userid = m.sender AND (m.sender = ' . $user_id . ' OR m.recipient = ' . $user_id . ') AND m.id = "' . $message_id . '"'; $result = mysql_query($query) or die(report_sql_error($query)); if (mysql_num_rows($result) != 1) { return false; } $data = mysql_fetch_assoc($result); if ($data['recipient_status'] == 0 && $data['recipient_id'] == $user_id) { mysql_query('UPDATE messages_new SET recipient_status = 1 WHERE id = ' . $data['id'] . ' LIMIT 1'); $_SESSION['notices']['unread_messages'] -= 1; } echo '<div class="grey_faded_div">'; $tooltip_sender = '<b>' . $data['sender_username'] . '</b>'; if ($data['sender_image'] == 1 || $data['sender_image'] == 2) { $tooltip_sender .= '<br /><img src=' . IMAGE_URL . '/images/users/thumb/' . $data['sender_id'] . '.jpg />'; } if ($data['sender_gender'] == 'P') { $tooltip_sender .= '<br />Kön: kille'; } elseif ($data['sender_gender'] == 'F') { $tooltip_sender .= '<br />Kön: tjej'; } if (isset($data['sender_birthday']) && $data['sender_birthday'] != '0000-00-00') { $tooltip_sender .= '<br />Ålder: ' . date_get_age($data['sender_birthday']) . 'år'; } if (strlen($data['sender_location']) > 1) { $tooltip_sender .= '<br />Bor: ' . trim($data['sender_location']); } $sender_link = '<a href="/traffa/profile.php?id=' . $data['sender_id'] . '" '; $sender_link .= 'onmouseover="return makeTrue(domTT_activate(this, event, \'content\', \'' . $tooltip_sender . '\', \'trail\', true));">'; $sender_link .= $data['sender_username'] . '</a>'; $tooltip_recipient = '<b>' . $data['recipient_username'] . '</b>'; if ($data['recipient_image'] == 1 || $data['recipient_image'] == 2) { $tooltip_recipient .= '<br /><img src=' . IMAGE_URL . '/images/users/thumb/' . $data['recipient_id'] . '.jpg />'; } if ($data['recipient_gender'] == 'P') { $tooltip_recipient .= '<br />Kön: kille'; } elseif ($data['recipient_gender'] == 'F') { $tooltip_recipient .= '<br />Kön: tjej'; } if (isset($data['recipient_birthday']) && $data['recipient_birthday'] != '0000-00-00') { $tooltip_recipient .= '<br />Ålder: ' . date_get_age($data['recipient_birthday']) . 'år'; } if (strlen($data['recipient_location']) > 1) { $tooltip_recipient .= '<br />Bor: ' . trim($data['recipient_location']); } $recipient_link = '<a href="/traffa/profile.php?id=' . $data['recipient_id'] . '" '; $recipient_link .= 'onmouseover="return makeTrue(domTT_activate(this, event, \'content\', \'' . $tooltip_recipient . '\', \'trail\', true));">'; $recipient_link .= $data['recipient_username'] . '</a>'; echo '<h2 style="margin-bottom: 2px;">Meddelande '; if ($user_id != $data['sender_id']) { echo 'från ' . $sender_link; } if ($user_id != $data['recipient_id']) { echo ' till ' . $recipient_link; } echo '</h2>'; echo '<b style="margin-left: 3px;">Skickades ' . fix_time($data['timestamp']) . '</b>'; echo '<p style="margin-left: 3px;">'; echo '<b>' . $data['title'] . '</b><br />'; echo setsmilies($data['message']); echo '</p></div>'; if ($data['sender_id'] == $user_id) { echo '<input type="button" value="Nytt meddelande till ' . $data['recipient_username'] . '" class="button" '; echo 'onclick="window.location=\'' . $_SERVER['PHP_SELF'] . '?action=compose&recipient_id=' . $data['recipient_id'] . '\';" />'; } elseif ($quoting == 1) { return true; } else { if (substr($data['title'], 0, 5) != 'Svar:') { $title = 'Svar: ' . $data['title']; } else { $title = $data['title']; } $answer_url = $_SERVER['PHP_SELF'] . '?action=compose&recipient_id=' . $data['sender_id'] . '&title=' . addslashes($title); $answer_url .= '"e&message_id=' . $message_id; echo '<input type="button" value="Svara" class="button" onclick="window.location=\'' . $answer_url . '\';" />'; } echo '<h2>Relaterade meddelanden</h2>'; $options = array('mode' => 'associated', 'user' => $data['sender_id'], 'discussion' => $data['discussion']); if ($data['sender_id'] == $user_id) { $options['user'] = $data['recipient_id']; } messages_list($user_id, $options); return true; }