<?php if (!defined('PROPER_START')) { header("HTTP/1.0 403 Forbidden"); exit; } api::send('self/message/update', array('id' => $_POST['id'], 'content' => bbcode::encode($_POST['content']))); if (isset($_GET['redirect'])) { template::redirect($_GET['redirect']); } else { $template->redirect('/panel/messages/detail?id=' . security::encode($_POST['parent'])); }
} if (!$_POST['parent']) { $message = "[i]{$lang['type']}[/i] {$lang['quota']}\n[i]{$lang['select']}[/i] {$_POST['quota']}\n[i]{$lang['request']}[/i] {$_POST['max']}\n\n{$_POST['content']}\n\t"; } else { $message = $_POST['content']; api::send('message/update', array('id' => $_POST['parent'], 'status' => 2)); // send email $msg = api::send('message/list', array('id' => $_POST['parent'])); $msg = $msg[0]; $user = api::send('user/list', array('id' => $msg['user']['id'])); $user = $user[0]; $email = str_replace(array('{ID}'), array($msg['id']), $lang['content']); mail($user['email'], $lang['subject'], str_replace('{CONTENT}', $email, $GLOBALS['CONFIG']['MAIL_TEMPLATE']), "MIME-Version: 1.0\r\nContent-type: text/html; charset=utf-8\r\nFrom: Olympe <*****@*****.**>\r\n"); } $params = array(); $params['content'] = bbcode::encode($message); $params['type'] = 1; if ($_POST['title']) { $params['title'] = $_POST['title']; } if ($_POST['parent']) { $params['parent'] = $_POST['parent']; } try { api::send('self/message/add', $params); } catch (Exception $e) { $_SESSION['MESSAGE']['TYPE'] = 'error'; $_SESSION['MESSAGE']['TEXT'] = $lang['error']; } if (isset($_GET['redirect'])) { template::redirect($_GET['redirect']);