$postTo = $_POST['msg_to'];
} else {
    // message when no receiver is given
    $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('SYS_TO')));
}
if ($postSubjectSQL === '') {
    // message when no subject is given
    $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('MAI_SUBJECT')));
}
if ($postBodySQL === '') {
    // message when no subject is given
    $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('SYS_MESSAGE')));
}
$message = new TableMessage($gDb, $getMsgId);
if ($getMsgId > 0) {
    $getMsgType = $message->getValue('msg_type');
}
// if message not PM it must be Email and then directly check the parameters
if ($getMsgType !== 'PM') {
    $getMsgType = 'EMAIL';
    // Stop if mail should be send and mail module is disabled
    if ($gPreferences['enable_mail_module'] != 1) {
        $gMessage->show($gL10n->get('SYS_MODULE_DISABLED'));
    }
    // allow option to send a copy to your email address only for registered users because of spam abuse
    if ($gValidLogin) {
        $postCarbonCopy = admFuncVariableIsValid($_POST, 'carbon_copy', 'bool');
    } else {
        $postCarbonCopy = 0;
    }
    // if Attachmentsize is higher than max_post_size from php.ini, then $_POST is empty.
Ejemplo n.º 2
0
        $receiverName = $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME');
        $message = new TableMessage($gDb, $row['msg_id']);
        ++$key;
        $messageAdministration = $part1 . $key . '&name=' . urlencode($message->getValue('msg_subject')) . '&database_id=' . $message->getValue('msg_id') . $part2;
        $table->addRowByArray(array('<a class="admidio-icon-link" ' . $href . $message->getValue('msg_id') . '">
                <img class="admidio-icon-info" src="' . THEME_PATH . '/icons/pm.png" alt="' . $gL10n->get('PMS_MESSAGE') . '" title="' . $gL10n->get('PMS_MESSAGE') . '" />', '<a ' . $href . $message->getValue('msg_id') . '">' . $message->getValue('msg_subject') . '</a>', $receiverName, $message->getValue('msg_timestamp'), $messageAdministration), 'row_message_' . $key, array('style' => 'font-weight: bold'));
    }
}
// find all read or own PM messages
$statement = $modulemessages->msgGetUser($gCurrentUser->getValue('usr_id'));
if (isset($statement)) {
    while ($row = $statement->fetch()) {
        if ($row['msg_usr_id_sender'] == $gCurrentUser->getValue('usr_id')) {
            $user = new User($gDb, $gProfileFields, $row['msg_usr_id_receiver']);
        } else {
            $user = new User($gDb, $gProfileFields, $row['msg_usr_id_sender']);
        }
        $receiverName = $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME');
        $message = new TableMessage($gDb, $row['msg_id']);
        ++$key;
        $messageAdministration = $part1 . $key . '&amp;name=' . urlencode($message->getValue('msg_subject')) . '&amp;database_id=' . $message->getValue('msg_id') . $part2;
        $table->addRowByArray(array('<a class="admidio-icon-link" ' . $href . $message->getValue('msg_id') . '">
                <img class="admidio-icon-info" src="' . THEME_PATH . '/icons/pm.png" alt="' . $gL10n->get('PMS_MESSAGE') . '" title="' . $gL10n->get('PMS_MESSAGE') . '" />', '<a ' . $href . $message->getValue('msg_id') . '">' . $message->getValue('msg_subject') . '</a>', $receiverName, $message->getValue('msg_timestamp'), $messageAdministration), 'row_message_' . $key);
    }
}
// special settings for the table
$table->setDatatablesOrderColumns(array(array(4, 'desc')));
// add table to the form
$page->addHtml($table->show(false));
// add form to html page and show page
$page->show();
Ejemplo n.º 3
0
if (isset($message_result)) {
    $page->addHtml('<br>');
    while ($row = $gDb->fetch_array($message_result)) {
        if ($row['msc_usr_id'] == $gCurrentUser->getValue('usr_id')) {
            $sentUser = $gCurrentUser->getValue('FIRST_NAME') . ' ' . $gCurrentUser->getValue('LAST_NAME');
        } else {
            $sentUser = $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME');
        }
        $ReceiverName = '';
        $message_text = htmlspecialchars_decode($row['msc_message']);
        if ($getMsgType == 'PM') {
            // list history of this PM
            $message_text = nl2br($row['msc_message']);
        } else {
            $message = new TableMessage($gDb, $getMsgId);
            $receivers = $message->getValue('msg_usr_id_receiver');
            // open some additonal functions for messages
            $modulemessages = new ModuleMessages();
            $ReceiverName = "";
            if (strpos($receivers, '|') == true) {
                $reciversplit = explode('|', $receivers);
                foreach ($reciversplit as $value) {
                    if (strpos($value, ':') == true) {
                        $ReceiverName .= "; " . $modulemessages->msgGroupNameSplit($value);
                    } else {
                        $user = new User($gDb, $gProfileFields, $value);
                        $ReceiverName .= "; " . $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME');
                    }
                }
            } else {
                if (strpos($receivers, ':') == true) {