/** * Function similar to the one above. This one is a general wrapper * for the Squirrelspell pop-up window. It's called form nearly * everywhere, except the check_me module, since that one is highly * customized. * * @param string $onload Used to indicate and pass the name of a js function * to call in a <body onload="function()" for automatic * onload script execution. * @param string $title Title of the page. * @param string $scriptsrc If defined, link this javascript source page into * the document using <script src="file.js"> format. * @param string $body The content to include. * @return void */ function sqspell_makeWindow($onload, $title, $scriptsrc, $body) { global $color, $SQSPELL_VERSION; displayHtmlHeader($title, $scriptsrc ? "\n<script type=\"text/javascript\" src=\"js/{$scriptsrc}\"></script>\n" : ''); echo "<body text=\"{$color['8']}\" bgcolor=\"{$color['4']}\" link=\"{$color['7']}\" " . "vlink=\"{$color['7']}\" alink=\"{$color['7']}\""; /** * Provide an onload="jsfunction()" if asked to. */ if ($onload) { echo " onload=\"{$onload}\""; } /** * Draw the rest of the page. */ echo ">\n" . html_tag('table', "\n" . html_tag('tr', "\n" . html_tag('td', '<strong>' . $title . '</strong>', 'center', $color[9])) . "\n" . html_tag('tr', "\n" . html_tag('td', '<hr />', 'left')) . "\n" . html_tag('tr', "\n" . html_tag('td', $body, 'left')) . "\n" . html_tag('tr', "\n" . html_tag('td', '<hr />', 'left')) . "\n" . html_tag('tr', "\n" . html_tag('td', 'SquirrelSpell ' . $SQSPELL_VERSION, 'center', $color[9])), '', '', 'width="100%" border="0" cellpadding="2"') . "</body>\n</html>\n"; }
<?php /** * newmail.php * * Copyright (c) 1999-2006 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Displays all options relating to new mail sounds * * $Id: newmail.php 10633 2006-02-03 22:27:56Z jervfors $ * @package plugins * @subpackage newmail */ /** @ignore */ define('SM_PATH', '../../'); /* SquirrelMail required files. */ require_once SM_PATH . 'include/validate.php'; require_once SM_PATH . 'include/load_prefs.php'; require_once SM_PATH . 'functions/page_header.php'; sqGetGlobalVar('numnew', $numnew, SQ_GET); $numnew = (int) $numnew; displayHtmlHeader(_("New Mail"), '', FALSE); echo '<body bgcolor="' . $color[4] . '" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">' . "\n" . '<center>' . "\n" . html_tag('table', "\n" . html_tag('tr', "\n" . html_tag('td', '<b>' . _("SquirrelMail Notice:") . '</b>', 'center', $color[0])) . html_tag('tr', "\n" . html_tag('td', '<br /><big><font color="' . $color[2] . '">' . sprintf($numnew == 1 ? _("You have %s new message") : _("You have %s new messages"), $numnew) . '</font><br /></big><br />' . "\n" . '<form name="nm">' . "\n" . '<input type="button" name="bt" value="' . _("Close Window") . '" onClick="javascript:window.close();" />' . "\n" . '</form>', 'center')), '', '', 'width="100%" cellpadding="2" cellspacing="2" border="0"') . '</center>' . "<script language=javascript>\n" . "<!--\n" . "document.nm.bt.focus();\n" . "-->\n" . "</script>\n" . "</body></html>\n";
sqgetGlobalVar('fold', $fold, SQ_GET); sqgetGlobalVar('unfold', $unfold, SQ_GET); sqgetGlobalVar('auto_create_done', $auto_create_done, SQ_SESSION); /* end globals */ // open a connection on the imap port (143) $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); // the 10 is to hide the output /** * Using stristr since older preferences may contain "None" and "none". */ if (isset($left_refresh) && $left_refresh != '' && !stristr($left_refresh, 'none')) { $xtra = "\n<meta http-equiv=\"Expires\" content=\"Thu, 01 Dec 1994 16:00:00 GMT\">\n" . "<meta http-equiv=\"Pragma\" content=\"no-cache\">\n" . "<meta http-equiv=\"REFRESH\" content=\"{$left_refresh};URL=left_main.php\">\n"; } else { $xtra = ''; } displayHtmlHeader($org_title, $xtra); /* If requested and not yet complete, attempt to autocreate folders. */ if ($auto_create_special && !$auto_create_done) { $autocreate = array($sent_folder, $trash_folder, $draft_folder); foreach ($autocreate as $folder) { if ($folder != '' && $folder != 'none') { if (!sqimap_mailbox_exists($imapConnection, $folder)) { sqimap_mailbox_create($imapConnection, $folder, ''); } else { if (!sqimap_mailbox_is_subscribed($imapConnection, $folder)) { sqimap_subscribe($imapConnection, $folder); } } } } /* Let the world know that autocreation is complete! Hurrah! */
* @copyright (c) 1999-2004 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id: printer_friendly_main.php,v 1.20 2004/10/02 17:21:32 jervfors Exp $ * @package squirrelmail */ /** * Path for SquirrelMail required files. * @ignore */ define('SM_PATH', '../'); /* SquirrelMail required files. */ require_once SM_PATH . 'include/validate.php'; /* get those globals into gear */ global $color; if (!sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET)) { $passed_ent_id = 0; } if (!sqgetGlobalVar('mailbox', $mailbox, SQ_GET) || !sqgetGlobalVar('passed_id', $passed_id, SQ_GET)) { error_box(_("Invalid URL"), $color); } else { $passed_id = (int) $passed_id; /* end globals */ displayHtmlHeader(_("Printer Friendly"), '', false, true); echo '<frameset rows="60, *">' . "\n"; echo '<frame src="printer_friendly_top.php" name="top_frame" ' . 'scrolling="no" noresize="noresize" frameborder="0" />' . "\n"; echo '<frame src="printer_friendly_bottom.php?passed_ent_id=' . urlencode($passed_ent_id) . '&mailbox=' . urlencode($mailbox) . '&passed_id=' . $passed_id . '" name="bottom_frame" frameborder="0" />' . "\n"; echo "</frameset>\n"; } ?> </html>
padding-right:4px; margin-left:4px; padding-left:4px; border: groove; border-width:0.1em; border-color:{$color['9']}; background: {$color['0']}; } --> </style> ECHO; } displayHtmlHeader('SquirrelMail', $xtra); sqgetGlobalVar('auto_create_done', $auto_create_done, SQ_SESSION); /* If requested and not yet complete, attempt to autocreate folders. */ if ($auto_create_special && !isset($auto_create_done)) { $autocreate = array($sent_folder, $trash_folder, $draft_folder); foreach ($autocreate as $folder) { if ($folder != '' && $folder != 'none') { if (!sqimap_mailbox_exists($imapConnection, $folder)) { sqimap_mailbox_create($imapConnection, $folder, ''); } else { //if (!sqimap_mailbox_is_subscribed($imapConnection, $folder)) { // check for subscription is useless and expensive just // surpress the NO response sqimap_subscribe($imapConnection, $folder, false); } }
<?php /** * Message Details plugin - top frame with buttons * * Plugin to view the RFC822 raw message output and the bodystructure of a message * * @author Marc Groot Koerkamp * @copyright Copyright © 2002 Marc Groot Koerkamp, The Netherlands * @copyright Copyright © 2004-2009 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id: message_details_top.php 13549 2009-04-15 22:00:49Z jervfors $ * @package plugins * @subpackage message_details */ /** @ignore */ define('SM_PATH', '../../'); /* SquirrelMail required files. */ require_once SM_PATH . 'include/validate.php'; displayHtmlHeader(_("Message Details"), "<script language=\"javascript\">\n" . "<!--\n" . "function printPopup() {\n" . "parent.frames[1].focus();\n" . "parent.frames[1].print();\n" . "}\n" . "-->\n" . "</script>\n", FALSE); sqgetGlobalVar('passed_id', $passed_id, SQ_GET); if (!sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET)) { $passed_ent_id = 0; } sqgetGlobalVar('mailbox', $mailbox, SQ_GET); echo "<body text=\"{$color['8']}\" bgcolor=\"{$color['3']}\" link=\"{$color['7']}\" vlink=\"{$color['7']}\" alink=\"{$color['7']}\">\n" . '<center><b>' . '<form action="' . SM_PATH . 'src/download.php" method="GET">' . '<input type="button" value="' . _("Print") . '" onClick="printPopup()" /> ' . '<input type="button" value="' . _("Close Window") . '" onClick="window.parent.close()" /> ' . '<input type="submit" value="' . _("Save Message") . '" /> ' . '<input type="hidden" name="mailbox" value="' . urlencode($mailbox) . '" />' . '<input type="hidden" name="passed_id" value="' . urlencode($passed_id) . '" />' . '<input type="hidden" name="ent_id" value="' . urlencode($passed_ent_id) . '" />' . '<input type="hidden" name="absolute_dl" value="true" />' . '</form>' . '</b>' . '</body>' . "</html>\n";
/** * Displays error message * * Since 1.4.1 function checks if page header is already displayed. * * Since 1.4.3 and 1.5.1, this function contains the error_box hook. * Use plain_error_message() and make sure that page header is created, * if you want compatibility with 1.4.0 and older. * * In 1.5.2 second function argument is changed. Older functions used it * for $color array, new function uses it for optional link data. Function * will ignore color array and use standard colors instead. * * The $return_output argument was added in 1.5.2 * * @param string $string Error message to be displayed * @param array $link Optional array containing link details to be displayed. * Array uses three keys. 'URL' key is required and should contain link URL. * 'TEXT' key is optional and should contain link name. 'FRAME' key is * optional and should contain link target attribute. * @param boolean $return_output When TRUE, output is returned to caller * instead of being sent to browser (OPTIONAL; * default = FALSE) * * @since 1.3.2 */ function error_box($string, $link = NULL, $return_output = FALSE) { global $pageheader_sent, $oTemplate, $org_title; $err = _("ERROR"); do_hook('error_box', $string); if (!isset($org_title)) { $org_title = 'SquirrelMail'; } // check if the page header has been sent; if not, send it! // // (however, if $return_output is turned on, the output of this // should be being used in some other page, so we don't have // to worry about page headers in that case) // if (!$return_output && empty($pageheader_sent)) { displayHtmlHeader($org_title . ': ' . $err); $pageheader_sent = TRUE; echo create_body(); // this is template-safe (see create_body() function) } // Double check the link for everything we need if (!is_null($link)) { // safety check for older code if (isset($link['URL'])) { if (!isset($link['FRAME'])) { $link['FRAME'] = ''; } if (!isset($link['TEXT'])) { $link['TEXT'] = $link['URL']; } } else { // somebody used older error_box() code $link = null; } } /** ERROR is pre-translated to avoid multiple translation calls. **/ $oTemplate->assign('error', $err); $oTemplate->assign('errorMessage', $string); $oTemplate->assign('link', $link); $output = $oTemplate->fetch('error_box.tpl'); if ($return_output) { return $output; } echo $output; }
// $body = pf_clean_string($body, 0); // clean up everything else... $subject = pf_clean_string($subject, $num_leading_spaces); $from = pf_clean_string($from, $num_leading_spaces); $date = pf_clean_string($date, $num_leading_spaces); } // end cleanup $to = decodeHeader($to); $cc = decodeHeader($cc); $from = decodeHeader($from); $subject = decodeHeader($subject); // load attachments $attachments = pf_show_attachments($message, $ent_ar, $mailbox, $passed_id); // --end display setup-- /* --start browser output-- */ displayHtmlHeader($subject, '', FALSE); echo '<body text="#000000" bgcolor="#FFFFFF" link="#000000" vlink="#000000" alink="#000000">' . "\n" . html_tag('table', '', 'center', '', 'cellspacing="0" cellpadding="0" border="0" width="100%"') . html_tag('tr', html_tag('td', _("From") . ': ', 'left', '', 'valign="top"') . html_tag('td', $from, 'left')) . "\n" . html_tag('tr', html_tag('td', _("Subject") . ': ', 'left', '', 'valign="top"') . html_tag('td', $subject, 'left')) . "\n" . html_tag('tr', html_tag('td', _("Date") . ': ', 'left') . html_tag('td', htmlspecialchars($date), 'left')) . "\n" . html_tag('tr', html_tag('td', _("To") . ': ', 'left', '', 'valign="top"') . html_tag('td', $to, 'left')) . "\n"; if (strlen($cc) > 0) { /* only show Cc: if it's there... */ echo html_tag('tr', html_tag('td', _("Cc") . ': ', 'left', '', 'valign="top"') . html_tag('td', $cc, 'left')); } /* body */ echo html_tag('tr', html_tag('td', '<hr noshade size="1" /><br />' . "\n" . $body, 'left', '', 'colspan="2"')) . "\n"; if (!empty($attachments)) { // attachments title echo html_tag('tr', html_tag('td', '<b>' . _("Attachments:") . '</b>', 'left', '', 'colspan="2"')) . "\n"; // list of attachments echo html_tag('tr', html_tag('td', $attachments, 'left', '', 'colspan="2"')) . "\n"; // add separator line echo html_tag('tr', html_tag('td', '<hr style="height: 1px;" />', 'left', '', 'colspan="2"')) . "\n"; }
global $plugins; if (!in_array('newmail', $plugins)) { exit; } /** load default config */ if (file_exists(SM_PATH . 'plugins/newmail/config_default.php')) { include_once SM_PATH . 'plugins/newmail/config_default.php'; } /** load config */ if (file_exists(SM_PATH . 'config/newmail_config.php')) { include_once SM_PATH . 'config/newmail_config.php'; } elseif (file_exists(SM_PATH . 'plugins/newmail/config.php')) { include_once SM_PATH . 'plugins/newmail/config.php'; } sqGetGlobalVar('numnew', $numnew, SQ_GET); $numnew = (int) $numnew; global $username, $org_title, $newmail_popup_title_bar_singular, $newmail_popup_title_bar_plural; // make sure default strings are in pot file $ignore = _("New Mail"); $singular_title = "New Mail"; $plural_title = "New Mail"; if (!empty($newmail_popup_title_bar_singular)) { $singular_title = $newmail_popup_title_bar_singular; } if (!empty($newmail_popup_title_bar_plural)) { $plural_title = $newmail_popup_title_bar_plural; } list($singular_title, $plural_title) = str_replace(array('###USERNAME###', '###ORG_TITLE###'), array($username, $org_title), array($singular_title, $plural_title)); $title = sprintf(ngettext($singular_title, $plural_title, $numnew), $numnew); displayHtmlHeader($title, '', FALSE); echo '<body bgcolor="' . $color[4] . '" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">' . "\n" . '<div style="text-align: center;">' . "\n" . html_tag('table', "\n" . html_tag('tr', "\n" . html_tag('td', '<b>' . sprintf(_("%s notice:"), $org_name) . '</b>', 'center', $color[0])) . html_tag('tr', "\n" . html_tag('td', '<br /><big><font color="' . $color[2] . '">' . sprintf(ngettext("You have %s new message", "You have %s new messages", $numnew), $numnew) . '</font><br /></big><br />' . "\n" . '<form name="nm">' . "\n" . '<input type="button" name="bt" value="' . _("Close Window") . '" onclick="javascript:window.close();" />' . "\n" . '</form>', 'center')), '', '', 'width="100%" cellpadding="2" cellspacing="2" border="0"') . '</div>' . "<script type=\"text/javascript\">\n" . "<!--\n" . "document.nm.bt.focus();\n" . "-->\n" . "</script>\n" . "</body></html>\n";
function error_box($string, $color) { global $pageheader_sent; if (!isset($color)) { $color = array(); $color[0] = '#dcdcdc'; /* light gray TitleBar */ $color[1] = '#800000'; /* red */ $color[2] = '#cc0000'; /* light red Warning/Error Messages */ $color[4] = '#ffffff'; /* white Normal Background */ $color[7] = '#0000cc'; /* blue Links */ $color[8] = '#000000'; /* black Normal text */ $color[9] = '#ababab'; /* mid-gray Darker version of #0 */ } $err = _("ERROR"); $ret = concat_hook_function('error_box', $string); if ($ret != '') { $string = $ret; } /* check if the page header has been sent; if not, send it! */ if (!isset($pageheader_sent) && !$pageheader_sent) { /* include this just to be sure */ include_once SM_PATH . 'functions/page_header.php'; displayHtmlHeader('SquirrelMail: ' . $err); $pageheader_sent = TRUE; echo "<body text=\"{$color['8']}\" bgcolor=\"{$color['4']}\" link=\"{$color['7']}\" vlink=\"{$color['7']}\" alink=\"{$color['7']}\">\n\n"; } echo '<table width="100%" cellpadding="1" cellspacing="0" align="center" border="0" bgcolor="' . $color[9] . '">' . '<tr><td>' . '<table width="100%" cellpadding="0" cellspacing="0" align="center" border="0" bgcolor="' . $color[4] . '">' . '<tr><td align="center" bgcolor="' . $color[0] . '">' . '<font color="' . $color[2] . '"><b>' . $err . ':</b></font>' . '</td></tr><tr><td>' . '<table cellpadding="1" cellspacing="5" align="center" border="0">' . '<tr>' . html_tag('td', $string . "\n", 'left') . '</tr></table>' . '</td></tr></table></td></tr></table>'; }
} .header { display:inline; } .entheader { display:inline; width:99%; } //--> </style> ECHO; displayHtmlHeader(_("Message Details"), $xtra, FALSE); /* body */ echo "<body text=\"{$color['8']}\" bgcolor=\"{$color['4']}\" link=\"{$color['7']}\" vlink=\"{$color['7']}\" alink=\"{$color['7']}\">\n"; echo '<code>' . "\n"; echo '<font face = "monospace">' . "\n"; echo '<br />' . "\n"; if (count($content) > 0) { echo '<h2>' . _("Bodystructure") . "</h2>\n\n"; echo '<table border=1 width="98%"><thead>' . '<tr bgcolor="' . "{$color['7']}" . '">' . '<td><b><font color="' . "{$color['5']}" . '">' . _("Entity") . '</font></b></td>' . '<td><b><font color="' . "{$color['5']}" . '">' . _("Content-Type") . '</font></b></td>' . '<td><b><font color="' . "{$color['5']}" . '">' . _("Name") . '</font></b></td>' . '<td><b><font color="' . "{$color['5']}" . '">' . _("Encoding") . '</font></b></td>' . '</tr>' . '</thead><tbody>'; for ($i = 0; $i < count($content); $i++) { echo '<tr><td>'; echo $content[$i]['ent'] . '</td><td>'; if (isset($content[$i]['type'])) { echo $content[$i]['type']; } else { echo 'TEXT/PLAIN';
<?php /** * printer_friendly top frame * * top frame of printer_friendly_main.php * displays some javascript buttons for printing & closing * * @copyright © 1999-2007 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id: printer_friendly_top.php 12127 2007-01-13 20:07:24Z kink $ * @package squirrelmail */ /** * Path for SquirrelMail required files. * @ignore */ define('SM_PATH', '../'); /* SquirrelMail required files. */ require_once SM_PATH . 'include/validate.php'; displayHtmlHeader(_("Printer Friendly"), "<script language=\"javascript\" type=\"text/javascript\">\n" . "<!--\n" . "function printPopup() {\n" . "parent.frames[1].focus();\n" . "parent.frames[1].print();\n" . "}\n" . "-->\n" . "</script>\n", FALSE); echo '<body text="' . $color[8] . '" bgcolor="' . $color[3] . '" link="' . $color[7] . '" vlink="' . $color[7] . '" alink="' . $color[7] . "\">\n" . html_tag('div', '<b>' . '<form>' . '<input type="button" value="' . _("Print") . '" onclick="printPopup()" /> ' . '<input type="button" value="' . _("Close") . '" onclick="window.parent.close()" />' . '</form>' . '</b>', 'right'); ?> </body></html>
function compose_Header($color, $mailbox) { global $delimiter, $hide_sm_attributions, $base_uri, $data_dir, $username, $frame_top, $compose_new_win; if (!isset($frame_top)) { $frame_top = '_top'; } /* Locate the first displayable form element */ if (!defined('PAGE_NAME')) { define('PAGE_NAME', NULL); } switch (PAGE_NAME) { case 'search': $pos = getPref($data_dir, $username, 'search_pos', 0) - 1; $onload = "onload=\"document.forms[{$pos}].elements[2].focus();\""; displayHtmlHeader(_("Compose")); break; default: $js = '<script language="JavaScript" type="text/javascript">' . "\n<!--\n" . "var alreadyFocused = false;\n" . "function checkForm() {\n" . "\n if (alreadyFocused) return;\n"; global $action, $reply_focus; if (strpos($action, 'reply') !== FALSE && $reply_focus) { if ($reply_focus == 'select') { $js .= "document.forms['compose'].body.select();}\n"; } else { if ($reply_focus == 'focus') { $js .= "document.forms['compose'].body.focus();}\n"; } else { if ($reply_focus == 'none') { $js .= "}\n"; } } } } else { if ($reply_focus == 'none') { $js .= "}\n"; } else { $js .= "var f = document.forms.length;\n" . "var i = 0;\n" . "var pos = -1;\n" . "while( pos == -1 && i < f ) {\n" . "var e = document.forms[i].elements.length;\n" . "var j = 0;\n" . "while( pos == -1 && j < e ) {\n" . "if ( document.forms[i].elements[j].type == 'text' ) {\n" . "pos = j;\n" . "}\n" . "j++;\n" . "}\n" . "i++;\n" . "}\n" . "if( pos >= 0 ) {\n" . "document.forms[i-1].elements[pos].focus();\n" . "}\n" . "}\n"; } } $js .= "// -->\n" . "</script>\n"; $onload = 'onload="checkForm();"'; displayHtmlHeader(_("Compose"), $js); break; } echo "<body text=\"{$color['8']}\" bgcolor=\"{$color['4']}\" link=\"{$color['7']}\" vlink=\"{$color['7']}\" alink=\"{$color['7']}\" {$onload}>\n\n"; }
/** * Custom Error handler (set with set_error_handler() ) * @private * @since 1.5.1 */ function SquirrelMailErrorhandler($iErrNo, $sErrStr, $sErrFile, $iErrLine, $aContext) { $aError = array('type' => SQM_NOTICE, 'category' => NULL, 'message' => NULL, 'extra' => NULL, 'link' => NULL, 'tip' => NULL); $iType = NULL; $aErrorCategory = array(); /** * Get current error reporting level. * * PHP 4.1.2 does not return current error reporting level in ini_get (php 5.1b3 and * 4.3.10 does). Retrieve current error reporting level while setting error reporting * to ini value and reset it to retrieved value. */ $iCurErrLevel = error_reporting(ini_get('error_reporting')); error_reporting($iCurErrLevel); /** * Check error_reporting value before logging error. * Don't log errors that are disabled by @ (error_reporting = 0). Some SquirrelMail scripts * (sq_mb_list_encodings(), ldap function calls in functions/abook_ldap_server.php) * handle errors themselves and @ is used to disable generic php error messages. */ if ($iErrNo & $iCurErrLevel) { /* * The following errors cannot be handled by a user defined error handler: * E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING */ switch ($iErrNo) { case E_STRICT: $iType = is_null($iType) ? SQM_STRICT : $iType; case E_NOTICE: $iType = is_null($iType) ? SQM_NOTICE : $iType; case E_WARNING: $iType = is_null($iType) ? SQM_WARNING : $iType; $aErrorCategory[] = 'PHP'; $aError['message'] = $sErrStr; $aError['extra'] = array('FILE' => $sErrFile, 'LINE' => $iErrLine); // what todo with $aContext? break; case E_USER_ERROR: $iType = is_null($iType) ? SQM_ERROR : $iType; case E_USER_NOTICE: $iType = is_null($iType) ? SQM_NOTICE : $iType; case E_USER_WARNING: $iType = is_null($iType) ? SQM_WARNING : $iType; if ($sErrFile == __FILE__) { // Error is triggered in this file and probably by sqm_trigger_error $aErrorTemp = @unserialize($sErrStr); if (!is_array($aErrorTemp)) { $aError['message'] = $sErrStr; $aErrorCategory[] = 'UNDEFINED'; } else { $aError = array_merge($aError, $aErrorTemp); // special error handling below if ($aError['category'] & SQM_ERROR_IMAP) { $aErrorCategory[] = 'IMAP'; // imap related error handling inside } if ($aError['category'] & SQM_ERROR_FS) { $aErrorCategory[] = 'FILESYSTEM'; // filesystem related error handling inside } if ($aError['category'] & SQM_ERROR_SMTP) { $aErrorCategory[] = 'SMTP'; // smtp related error handling inside } if ($aError['category'] & SQM_ERROR_LDAP) { $aErrorCategory[] = 'LDAP'; // ldap related error handling inside } if ($aError['category'] & SQM_ERROR_DB) { $aErrorCategory[] = 'DATABASE'; // db related error handling inside } if ($aError['category'] & SQM_ERROR_PLUGIN) { $aErrorCategory[] = 'PLUGIN'; do_hook('error_handler_plugin', $aError); // plugin related error handling inside } //if ($aError['category'] & SQM_ERROR_X) { // $aErrorCategory[] = 'X'; // place holder for a new category //} } unset($aErrorTemp); } else { $aError['message'] = $sErrStr; $aErrorCategory[] = 'SQM_NOTICE'; } break; default: break; } /** * If delayed error handling is enabled, always record the location * and tag the error is delayed to make debugging easier. */ if (isset($this->Template->values['delayed_errors']) && $this->Template->values['delayed_errors']) { $aErrorCategory[] = 'Delayed'; $aError['extra'] = array('FILE' => $sErrFile, 'LINE' => $iErrLine); } $aErrorTpl = array('type' => $iType, 'category' => $aErrorCategory, 'message' => $aError['message'], 'link' => $aError['link'], 'tip' => $aError['tip'], 'extra' => $aError['extra']); // Add the notice/warning/error to the existing list of notices/warnings $this->aErrors[] = $aErrorTpl; $this->Template->assign('aErrors', $this->aErrors); } // Show the error immediate in case of fatal errors if ($iType == SQM_ERROR) { if (isset($this->Template->values['header_sent']) && !$this->Template->values['header_sent']) { // TODO replace this with template that can be assigned // UPDATE: displayHtmlHeader() no longer sends anything // directly to the browser itself and instead // displays all output through the template file // "protocol_header" as well as calls to the // template's header() method, so perhaps the // above TODO is alleviated?? (however, I don't fully // understand the problem behind the TODO comment myself (Paul)) displayHtmlHeader(_("Error"), '', false); } $this->DisplayErrors(); exit(_("Terminating SquirrelMail due to a fatal error")); } }
// This Report uses the both the queue logs and the cdr logs to populate data include 'php/config.php'; set_time_limit(600); $curTime = time(); global $DB; $DB = str_replace("\"", "", $DB); $connection_string = odbc_connect($DB, "", ""); $conn = mysql_connect('localhost', 'root', 'Summer01'); if (!$conn) { die('Could not connect: ' . mysql_error()); } mysql_select_db("usi_misc", $conn); echo "<h1>Daily Report</h1><br>"; echo "<body >"; displayHtmlHeader(); echo "<div id=\"divCallReport\" style=\"width:1150px\">"; displayPage($curDate); echo "</div>"; displayDates(); echo "</body>"; echo "</html>"; function displayPage($date) { global $DB, $connection_string, $conn; // ****************************************************************************************************** // ***** DAILY CALL ACTIVITY REPORT ***** // ****************************************************************************************************** echo "<div id=\"tabs\" class=\"tabs\" style=\"font-size:x-small; visibility:visible\">"; echo "<h4 style=\"font-variant: small-caps; font-size:large\">daily call center flash activity report</h4>"; // ******************* Create All The Tabs *************************
} else { $right_frame_file = $right_frame; } if (empty($right_frame_url)) { switch ($right_frame) { case 'right_main.php': $right_frame_url = "right_main.php?mailbox=" . urlencode($mailbox) . (!empty($sort) ? "&sort={$sort}" : '') . (!empty($startMessage) ? "&startMessage={$startMessage}" : ''); break; case 'options.php': $right_frame_url = 'options.php'; break; case 'folders.php': $right_frame_url = 'folders.php'; break; case 'compose.php': $right_frame_url = 'compose.php?' . $mailtourl; break; case '': $right_frame_url = 'right_main.php'; break; default: $right_frame_url = urlencode($right_frame); break; } } $oErrorHandler->setDelayedErrors(true); $oTemplate->assign('nav_size', $left_size); $oTemplate->assign('nav_on_left', $location_of_bar == 'left'); $oTemplate->assign('right_frame_url', $right_frame_url); displayHtmlHeader($org_title, '', false, true); $oTemplate->display('webmail.tpl');
$string = _("The IMAP server is reporting that plain text logins are disabled.") . '<br />' . _("Using CRAM-MD5 or DIGEST-MD5 authentication instead may work.") . '<br />'; if (!$use_imap_tls) { $string .= _("Also, the use of TLS may allow SquirrelMail to login.") . '<br />'; } $string .= _("Please contact your system administrator and report this error."); error_box($string, $color); exit; } } do_hook('login_cookie'); /* Output the javascript onload function. */ $header = "<script language=\"JavaScript\" type=\"text/javascript\">\n" . "<!--\n" . " function squirrelmail_loginpage_onload() {\n" . " var textElements = 0;\n" . " for (i = 0; i < document.forms[0].elements.length; i++) {\n" . " if (document.forms[0].elements[i].type == \"text\" || document.forms[0].elements[i].type == \"password\") {\n" . " textElements++;\n" . " if (textElements == " . (isset($loginname) ? 2 : 1) . ") {\n" . " document.forms[0].elements[i].focus();\n" . " break;\n" . " }\n" . " }\n" . " }\n" . " }\n" . "// -->\n" . "</script>\n"; if (@file_exists($theme[$theme_default]['PATH'])) { @(include $theme[$theme_default]['PATH']); } displayHtmlHeader("{$org_name} - " . _("Login"), $header, FALSE); echo "<body text=\"{$color['8']}\" bgcolor=\"{$color['4']}\" link=\"{$color['7']}\" vlink=\"{$color['7']}\" alink=\"{$color['7']}\" onLoad=\"squirrelmail_loginpage_onload()\">" . "\n" . '<form action="redirect.php" method="post" onSubmit="document.forms[0].js_autodetect_results.value=\'' . SMPREF_JS_ON . '\';">' . "\n"; $username_form_name = 'login_username'; $password_form_name = 'secretkey'; do_hook('login_top'); $loginname_value = sqGetGlobalVar('loginname', $loginname) ? htmlspecialchars($loginname) : ''; /* If they don't have a logo, don't bother.. */ if (isset($org_logo) && $org_logo) { /* Display width and height like good little people */ $width_and_height = ''; if (isset($org_logo_width) && is_numeric($org_logo_width) && $org_logo_width > 0) { $width_and_height = " width=\"{$org_logo_width}\""; } if (isset($org_logo_height) && is_numeric($org_logo_height) && $org_logo_height > 0) { $width_and_height .= " height=\"{$org_logo_height}\""; }
/** * Blatantly copied/truncated/modified from displayPageHeader. * Outputs a page header specifically for the compose_in_new popup window * * @param array color the array of theme colors * @param string mailbox the current mailbox name to display * @return void */ function compose_Header($color, $mailbox) { global $javascript_on; /* * Locate the first displayable form element (only when JavaScript on) */ if ($javascript_on) { global $delimiter, $base_uri, $PHP_SELF, $data_dir, $username; $module = substr($PHP_SELF, (strlen($PHP_SELF) - strlen($base_uri)) * -1); switch ($module) { case 'src/search.php': $pos = getPref($data_dir, $username, 'search_pos', 0) - 1; $onload = "onload=\"document.forms[{$pos}].elements[2].focus();\""; displayHtmlHeader(_("Compose")); break; default: $js = '<script language="JavaScript" type="text/javascript">' . "\n<!--\n" . "function checkForm() {\n"; global $action, $reply_focus; if (strpos($action, 'reply') !== FALSE && $reply_focus) { if ($reply_focus == 'select') { $js .= "document.forms['compose'].body.select();}\n"; } else { if ($reply_focus == 'focus') { $js .= "document.forms['compose'].body.focus();}\n"; } else { if ($reply_focus == 'none') { $js .= "}\n"; } } } } else { if ($reply_focus == 'none') { $js .= "}\n"; } else { $js .= "var f = document.forms.length;\n" . "var i = 0;\n" . "var pos = -1;\n" . "while( pos == -1 && i < f ) {\n" . "var e = document.forms[i].elements.length;\n" . "var j = 0;\n" . "while( pos == -1 && j < e ) {\n" . "if ( document.forms[i].elements[j].type == 'text' ) {\n" . "pos = j;\n" . "}\n" . "j++;\n" . "}\n" . "i++;\n" . "}\n" . "if( pos >= 0 ) {\n" . "document.forms[i-1].elements[pos].focus();\n" . "}\n" . "}\n"; } } $js .= "// -->\n" . "</script>\n"; $onload = 'onload="checkForm();"'; displayHtmlHeader(_("Compose"), $js); break; } } else { /* javascript off */ displayHtmlHeader(_("Compose")); $onload = ''; } echo "<body text=\"{$color['8']}\" bgcolor=\"{$color['4']}\" link=\"{$color['7']}\" vlink=\"{$color['7']}\" alink=\"{$color['7']}\" {$onload}>\n\n"; }
function logout_error($errString, $errTitle = '') { global $frame_top, $org_logo, $org_name, $org_logo_width, $org_logo_height, $hide_sm_attributions, $version, $squirrelmail_language; $base_uri = sqm_baseuri(); include_once SM_PATH . 'functions/page_header.php'; if (!isset($org_logo)) { // Don't know yet why, but in some accesses $org_logo is not set. include SM_PATH . 'config/config.php'; } /* Display width and height like good little people */ $width_and_height = ''; if (isset($org_logo_width) && is_numeric($org_logo_width) && $org_logo_width > 0) { $width_and_height = " WIDTH=\"{$org_logo_width}\""; } if (isset($org_logo_height) && is_numeric($org_logo_height) && $org_logo_height > 0) { $width_and_height .= " HEIGHT=\"{$org_logo_height}\""; } if (!isset($frame_top) || $frame_top == '') { $frame_top = '_top'; } if (!isset($color)) { $color = array(); $color[0] = '#DCDCDC'; /* light gray TitleBar */ $color[1] = '#800000'; /* red */ $color[2] = '#CC0000'; /* light red Warning/Error Messages */ $color[4] = '#FFFFFF'; /* white Normal Background */ $color[7] = '#0000CC'; /* blue Links */ $color[8] = '#000000'; /* black Normal text */ } if ($errTitle == '') { $errTitle = $errString; } set_up_language($squirrelmail_language, true); displayHtmlHeader($errTitle, '', false); echo "<BODY TEXT=\"{$color['8']}\" BGCOLOR=\"{$color['4']}\" LINK=\"{$color['7']}\" VLINK=\"{$color['7']}\" ALINK=\"{$color['7']}\">\n\n" . '<CENTER>'; if (isset($org_logo) && $org_logo != '') { echo "<IMG SRC=\"{$org_logo}\" ALT=\"" . sprintf(_("%s Logo"), $org_name) . "\"{$width_and_height}><BR>\n"; } echo ($hide_sm_attributions ? '' : '<SMALL>' . sprintf(_("SquirrelMail version %s"), $version) . "<BR>\n" . ' ' . _("By the SquirrelMail Development Team") . "<BR></SMALL>\n") . "<table cellspacing=1 cellpadding=0 bgcolor=\"{$color['1']}\" width=\"70%\"><tr><td>" . "<TABLE WIDTH=\"100%\" BORDER=\"0\" BGCOLOR=\"{$color['4']}\" ALIGN=CENTER>" . "<TR><TD BGCOLOR=\"{$color['0']}\" ALIGN=\"center\">" . "<FONT COLOR=\"{$color['2']}\"><B>" . _("ERROR") . '</B></FONT></TD></TR>' . '<TR><TD ALIGN="center">' . $errString . '</TD></TR>' . "<TR><TD BGCOLOR=\"{$color['0']}\" ALIGN=\"center\">" . "<FONT COLOR=\"{$color['2']}\"><B>" . '<a href="' . $base_uri . 'src/login.php" target="' . $frame_top . '">' . _("Go to the login page") . "</a></B></FONT>" . '</TD></TR>' . '</TABLE></td></tr></table></center></body></html>'; }
<?php /** * SquirrelMail Preview Pane Plugin * * @copyright 1999-2016 The SquirrelMail Project Team * @author Paul Lesniewski <*****@*****.**> * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package plugins * @subpackage preview_pane */ include_once '../../include/init.php'; global $org_title; displayHtmlHeader($org_title, '', FALSE, FALSE); $oTemplate->display('plugins/preview_pane/empty_frame.tpl'); $oTemplate->display('footer.tpl');
/** * Message Details plugin - main frame * * Plugin to view the RFC822 raw message output and the bodystructure of * a message * * @author Marc Groot Koerkamp * @copyright Copyright © 2002 Marc Groot Koerkamp, The Netherlands * @copyright Copyright © 2004-2009 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id: message_details_main.php 13549 2009-04-15 22:00:49Z jervfors $ * @package plugins * @subpackage message_details */ /** * Path for SquirrelMail required files. * @ignore */ define('SM_PATH', '../../'); /* SquirrelMail required files. */ require_once SM_PATH . 'include/validate.php'; displayHtmlHeader(_("Message Details"), '', FALSE); sqgetGlobalVar('mailbox', $mailbox, SQ_GET); sqgetGlobalVar('passed_id', $passed_id, SQ_GET); if (!sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET)) { $passed_ent_id = 0; } echo "<frameset rows=\"60, *\" noresize border=\"0\">\n"; echo '<frame src="message_details_top.php?mailbox=' . urlencode($mailbox) . '&passed_id=' . $passed_id . '&passed_ent_id=' . $passed_ent_id . '" name="top_frame" scrolling="off">'; echo '<frame src="message_details_bottom.php?mailbox=' . urlencode($mailbox) . '&passed_id=' . $passed_id . '&passed_ent_id=' . $passed_ent_id . '" name="bottom_frame">'; echo '</frameset>' . "\n" . "</html>\n";
<?php /** * testsound.php * * Copyright (c) 1999-2006 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * $Id: testsound.php 10633 2006-02-03 22:27:56Z jervfors $ */ define('SM_PATH', '../../'); /* SquirrelMail required files. */ require_once SM_PATH . 'include/validate.php'; require_once SM_PATH . 'functions/global.php'; require_once SM_PATH . 'functions/html.php'; displayHtmlHeader(_("Test Sound"), '', FALSE); echo '<body bgcolor="' . $color[4] . '" topmargin=0 leftmargin=0 rightmargin=0 marginwidth=0 marginheight=0>' . "\n"; if (!sqgetGlobalVar('sound', $sound, SQ_GET)) { $sound = 'Click.wav'; } elseif ($sound == '(none)') { echo '<center><form><br /><br />' . '<b>' . _("No sound specified") . '</b><br /><br />' . '<input type="button" name="close" value="' . _("Close") . '" onClick="window.close()">' . '</form></center>' . '</body></html>'; return; } echo html_tag('table', html_tag('tr', html_tag('td', '<embed src="' . htmlspecialchars($sound) . '" hidden="true" autostart="true" width="2" height="2">' . '<br>' . '<b>' . _("Loading the sound...") . '</b><br>' . '<form>' . '<input type="button" name="close" value=" ' . _("Close") . ' " onClick="window.close()">' . '</form>', 'center')), 'center') . '</body></html>';
<?php /** * addrbook_popup.php * * Frameset for the JavaScript version of the address book. * * @copyright 1999-2016 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail * @subpackage addressbook */ /** This is the addrbook_popup page */ define('PAGE_NAME', 'addrbook_popup'); /** * Include the SquirrelMail initialization file. */ include '../include/init.php'; displayHtmlHeader($org_title . ': ' . _("Addresses"), '', false, true); $oTemplate->display('addressbook_popup.tpl');