require_once(SM_PATH . 'plugins/change_password/backend/'.$cpw_backend.'.php');
- $msgs = do_hook_function('change_password_dochange',
- array (
- 'username' => $username,
- 'curpw' => $curpw,
- 'newpw' => $newpw
+ $msgs = do_hook('change_password_dochange',
+ $temp=array (
+ 'username' => &$username,
+ 'curpw' => &$curpw,
+ 'newpw' => &$newpw
) );
/* something bad happened, return */
displayPageHeader($color, 'None');
-do_hook('change_password_init');
+do_hook('change_password_init', $null);
?>
<br />
</form>
</td></tr>
</table>
-</body></html>
\ No newline at end of file
+</body></html>
$squirrelmail_plugin_hooks['optpage_register_block']['filters'] = 'filters_optpage_register_block_hook';
$squirrelmail_plugin_hooks['special_mailbox']['filters'] = 'filters_special_mailbox';
$squirrelmail_plugin_hooks['rename_or_delete_folder']['filters'] = 'update_for_folder_hook';
- $squirrelmail_plugin_hooks['webmail_bottom']['filters'] = 'start_filters_hook';
+ $squirrelmail_plugin_hooks['template_construct_login_webmail.tpl']['filters'] = 'start_filters_hook';
$squirrelmail_plugin_hooks['folder_status']['filters'] = 'filters_folder_status';
}
*
* Hook allows attaching plugin to bottom of info plugin
*/
-do_hook('info_bottom');
+do_hook('info_bottom', $null);
?>
</body></html>
$oTemplate->display('addressbook_search_form.tpl');
echo "</form>\n";
-do_hook('addrbook_html_search_below');
+do_hook('addrbook_html_search_below', $null);
/* End search form */
/* List addresses. Show personal addressbook */
echo '<hr />';
$oTemplate->display('footer.tpl');
-?>
\ No newline at end of file
+?>
$oTemplate->display('addressbook_list.tpl');
+//FIXME: Remove HTML from here!
echo "</form>\n";
}
/* Display the "new address" form */
+//FIXME: Remove HTML from here!
echo '<a name="AddAddress"></a>' . "\n";
abook_create_form($form_url,'addaddr',_("Add to address book"),_("Add address"),$defdata);
echo "</form>\n";
/* Hook for extra address book blocks */
-echo "<!-- start of addressbook_bottom hook-->\n";
-do_hook('addressbook_bottom');
-echo "\n<!-- end of addressbook_bottom hook-->\n";
+do_hook('addressbook_bottom', $null);
$oTemplate->display('footer.tpl');
-?>
\ No newline at end of file
+?>
$Result = deliverMessage($composeMessage);
- do_hook('compose_send_after', $Result, $composeMessage);
+ // NOTE: this hook changed in 1.5.2 from sending $Result and
+ // $composeMessage as args #2 and #3 to being in an array
+ // under arg #2
+ do_hook('compose_send_after', $temp=array(&$Result, &$composeMessage));
if (! $Result) {
showInputForm($session);
exit();
'enctype="multipart/form-data"';
$compose_onsubmit = array();
- do_hook('compose_form');
+ global $null;
+ do_hook('compose_form', $null);
// Plugins that use compose_form hook can add an array entry
// to the globally scoped $compose_onsubmit; we add them up
. "</p>\r\n";
}
- do_hook('compose_bottom');
+ do_hook('compose_bottom', $null);
if ($compose_new_win=='1') {
$oTemplate->display('compose_newwin_close.tpl');
$composeMessage->rfc822_header = $rfc822_header;
/* Here you can modify the message structure just before we hand
- it over to deliver */
- $hookReturn = do_hook('compose_send', $composeMessage);
- /* Get any changes made by plugins to $composeMessage. */
- if ( is_object($hookReturn[1]) ) {
- $composeMessage = $hookReturn[1];
- }
+ it over to deliver; plugin authors note that $composeMessage
+ is sent and modified by reference since 1.5.2 */
+ do_hook('compose_send', $composeMessage);
if (!$useSendmail && !$draft) {
require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
}
return $success;
}
-?>
\ No newline at end of file
+?>
do_err($plugin_load_error);
}
/**
- * Hook is added in 1.5.2. Plugins should print error message and return true
- * if there is an error in plugin.
+ * This hook was added in 1.5.2. Each plugins should print an error
+ * message and return TRUE if there are any errors in its setup/configuration.
*/
- $plugin_err = boolean_hook_function('configtest');
+ $plugin_err = boolean_hook_function('configtest', $null);
if($plugin_err) {
do_err('Some plugin tests failed.');
} else {
$td_str = _("Unsubscribed successfully.");
break;
default:
- // TODO: add hook for plugin action processing.
- $td_str = '';
+// TODO: this is a new hook for plugin action processing that has not been TESTED.
+ $td_str = do_hook('folder_action', $action);
break;
}
$oTemplate->display('folder_manip.tpl');
$oTemplate->display('footer.tpl');
-?>
\ No newline at end of file
+?>
/**************[ END HELP FUNCTIONS ]******************/
-do_hook('help_top');
+do_hook('help_top', $null);
if (!isset($squirrelmail_language)) {
$squirrelmail_language = 'en_US';
}
// Provide hook for external help scripts.
- do_hook('help_chapter');
+ do_hook('help_chapter', $null);
$new_toc = array();
foreach ($toc as $ch) {
$oTemplate->display('help_chapter.tpl');
}
-do_hook('help_bottom');
+do_hook('help_bottom', $null);
$oTemplate->display('footer.tpl');
-?>
\ No newline at end of file
+?>
}
}
-do_hook('login_cookie');
+do_hook('login_cookie', $null);
$loginname_value = (sqGetGlobalVar('loginname', $loginname) ? htmlspecialchars($loginname) : '');
+//FIXME: should be part of the template, not the core!
/* Output the javascript onload function. */
$header = "<script type=\"text/javascript\">\n" .
"<!--\n".
displayHtmlHeader( "$org_name - " . _("Login"), $header, FALSE );
+//FIXME: need to remove *ALL* HTML from this file!
+
/* If they don't have a logo, don't bother.. */
$logo_str = '';
if (isset($org_logo) && $org_logo) {
echo '<body onLoad="squirrelmail_loginpage_onload()">'."\n";
echo '<form action="redirect.php" method="post" onSubmit="document.forms[0].js_autodetect_results.value='. SMPREF_JS_ON .'">'."\n";
-do_hook('login_top');
+do_hook('login_top', $null);
$oTemplate->display('login.tpl');
echo "</form>\n";
-do_hook('login_bottom');
+do_hook('login_bottom', $null);
// Turn off delayed error handling to make sure all errors are dumped.
$oErrorHandler->setDelayedErrors(false);
$optpage_loader = 'load_optpage_data_order';
$optpage_loadhook = 'optpage_loadhook_order';
break;
- default: do_hook('optpage_set_loadinfo');
+ default: do_hook('optpage_set_loadinfo', $null);
}
/**********************************************************/
/* Assemble the data for this option page. */
$optpage_data = array();
$optpage_data = $optpage_loader();
- do_hook($optpage_loadhook);
+ do_hook($optpage_loadhook, $null);
$optpage_data['options'] = create_option_groups($optpage_data['grps'], $optpage_data['vals']);
}
}
/* Run the options save hook. */
- do_hook($save_hook_name);
+ do_hook($save_hook_name, $null);
}
/***************************************************************/
);
/* Build a section for plugins wanting to register an optionpage. */
- do_hook('optpage_register_block');
+ do_hook('optpage_register_block', $null);
/*****************************************************/
/* Let's sort Javascript Option Pages to the bottom. */
$oTemplate->display('option_groups.tpl');
- do_hook('options_link_and_description');
+ do_hook('options_link_and_description', $null);
/*************************************************************************/
/* If it is not empty, trigger the inside hook. */
if ($inside_hook_name != '') {
- do_hook($inside_hook_name);
+ do_hook($inside_hook_name, $null);
}
//FIXME: need to remove HTML from here!
/* If it is not empty, trigger the bottom hook. */
if ($bottom_hook_name != '') {
- do_hook($bottom_hook_name);
+ do_hook($bottom_hook_name, $null);
}
}
echo "</form>\n";
}
-do_hook('options_highlight_bottom');
+do_hook('options_highlight_bottom', $null);
$oTemplate->display('footer.tpl');
-?>
\ No newline at end of file
+?>
displayPageHeader($color, 'None');
/* since 1.1.3 */
-do_hook('options_identities_top');
+do_hook('options_identities_top', $null);
$i = array();
foreach ($identities as $key=>$ident) {
$return_str .= sti_input( _("E-Mail Address") , sprintf($name, $id, 'email_address'), $identity['email_address'], $bg);
$return_str .= sti_input( _("Reply To"), sprintf($name, $id, 'reply_to'), $identity['reply_to'], $bg);
$return_str .= sti_textarea( _("Signature"), sprintf($name, $id, 'signature'), $identity['signature'], $bg);
- $return_str .= concat_hook_function('options_identities_table', array($bg, $empty, $id));
+ $return_str .= concat_hook_function('options_identities_table', $temp=array(&$bg, &$empty, &$id));
$return_str .= '<tr' . $bg . '> ' . "\n";
$return_str .= ' <td> </td>' . "\n";
$return_str .= ' <td>' . "\n";
}
- $return_str .= concat_hook_function('options_identities_buttons', array($empty, $id));
+ $return_str .= concat_hook_function('options_identities_buttons', $temp=array(&$empty, &$id));
$return_str .= ' </td>' . "\n";
$return_str .= '</tr>' . "\n";
$return_str .= '<tr>' . "\n";
}
-?>
\ No newline at end of file
+?>
$body .= '<hr />';
}
}
- $hookResults = do_hook('message_body', $body);
- $body = $hookResults[1];
+ /* Note that $body is passed to this hook (and modified) by reference as of 1.5.2 */
+ do_hook('message_body', $body);
} else {
$body = _("Message not printable");
}
$oTemplate->display('read_menubar_nav.tpl');
}
- do_hook('read_body_menu_bottom');
+ global $null;
+ do_hook('read_body_menu_bottom', $null);
}
function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
/***********************************************/
$messagebody = '';
-do_hook('read_body_top');
+do_hook('read_body_top', $null);
if ($show_html_default == 1) {
$ent_ar = $message->findDisplayEntity(array());
} else {
formatMenuBar($aMailbox, $passed_id, $passed_ent_id, $message, false, FALSE);
-do_hook('read_body_bottom');
+do_hook('read_body_bottom', $null);
sqimap_logout($imapConnection);
$oTemplate->display('footer.tpl');
?>
}
if (!sqsession_is_registered('user_is_logged_in')) {
- do_hook ('login_before');
+ do_hook('login_before', $null);
$onetimepad = OneTimePadCreate(strlen($secretkey));
$key = OneTimePadEncrypt($secretkey, $onetimepad);
$username = $login_username;
sqsession_register ($username, 'username');
- do_hook ('login_verified');
+ do_hook('login_verified', $null);
}
/* Set the login variables. */
displayPageHeader($color, $mailbox);
}
-do_hook('right_main_after_header');
+do_hook('right_main_after_header', $null);
/* display a message to the user that their mail has been sent */
if (isset($mail_sent) && $mail_sent == 'yes') {
$oTemplate->display('empty_folder.tpl');
}
-do_hook('right_main_bottom');
+do_hook('right_main_bottom', $null);
sqimap_logout ($imapConnection);
$oTemplate->display('footer.tpl');
$oTemplate->display('note.tpl');
}
-do_hook('search_before_form');
+do_hook('search_before_form', $null);
if (!$search_silent) {
asearch_print_saved($boxes);
}
}
-do_hook('search_after_form');
+do_hook('search_after_form', $null);
if ($submit == $search_button_text) {
$msgsfound = false;
}
}
-do_hook('search_bottom');
+do_hook('search_bottom', $null);
sqimap_logout($imapConnection);
$oTemplate->display('footer.tpl');
sqsession_register($mailbox_cache,'mailbox_cache');
-?>
\ No newline at end of file
+?>
$login_uri = 'login.php';
-$hook_results = do_hook('logout', $login_uri);
-if (!empty($hook_results[1])) $login_uri = $hook_results[1];
+do_hook('logout', $login_uri);
sqsession_destroy();
$body = mime_fetch_body($imap_stream, $passed_id, $ent_id);
$body = decodeBody($body, $encoding);
-$hookResults = do_hook('message_body', $body);
-$body = $hookResults[1];
+do_hook('message_body', $body);
/**
* TODO: check if xtra_code is needed.
$body = mime_fetch_body($imapConnection, $passed_id, $ent_id);
$body = decodeBody($body, $encoding);
-$hookResults = do_hook('message_body', $body);
-$body = $hookResults[1];
+do_hook('message_body', $body);
if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
function_exists($languages[$squirrelmail_language]['XTRA_CODE'].'_decode')) {
$oTemplate->display('view_text.tpl');
$oTemplate->display('footer.tpl');
-?>
\ No newline at end of file
+?>
displayHtmlHeader($org_title, '', false, true);
$oErrorHandler->setDelayedErrors(true);
-do_hook('webmail_top');
+do_hook('webmail_top', $null);
$oTemplate->assign('nav_size', $left_size);
$oTemplate->assign('nav_on_left', $location_of_bar=='left');
</td>
</tr>
</table>
-<?php do_hook('folders_bottom'); ?>
-</div>
\ No newline at end of file
+<?php /* FIXME: no hooks in templates!! */ global $null; do_hook('folders_bottom', $null); ?>
+</div>
/********
* Pulling imapConnection due to segfaults that cannot be tracked down. Best
- * we can determine,its some combination of this var and >= 4 plugins enabled.
+ * we can determine, it's some combination of this var and >= 4 plugins enabled.
* No further clue from anyone.
+ ********
+ * Update: syntax of this hook call changed a bit, so if the error is so anomalous,
+ * it might be worth trying this again to see if it is still segfaulting
********
// let plugins fiddle with end of line
+// FIXME: no hooks in templates!
$end .= concat_hook_function('left_main_after_each_folder',
- array(isset($numMessages) ? $numMessages : '',
- $box['MailboxFullName'], $settings['imapConnection']));
+ $temp=array(isset($numMessages) ? &$numMessages : '',
+ &$box['MailboxFullName'], &$settings['imapConnection']));
*/
$end .= '</span>';
?>
<body class="sqm_leftMain">
<div class="sqm_leftMain">
-<?php do_hook('left_main_before'); ?>
+<?php /* FIXME: no hooks in templates! */ global $null; do_hook('left_main_before', $null); ?>
<table class="sqm_wrapperTable" cellspacing="0">
<tr>
<td>
</td>
</tr>
</table>
-<?php do_hook('left_main_after'); ?>
+<?php /* FIXME: no hooks in templates! */ do_hook('left_main_after', $null); ?>
</div>
/* retrieve the template vars */
extract($t);
-do_hook('mailbox_index_before');
+//FIXME: no hooks in templates!
+global $null;
+do_hook('mailbox_index_before', $null);
/**
* Calculate string "Viewing message x to y (z total)"
?>
</table>
<?php
- do_hook('mailbox_form_before');
+ //FIXME: no hooks in templates!
+ do_hook('mailbox_form_before', $null);
?>
</td>
</tr>
</tr>
<tr>
<td>
- <?php do_hook('mailbox_index_after');?>
+ <?php /* FIXME: no hooks in templates!! */ do_hook('mailbox_index_after', $null); ?>
</td>
</tr>
</table>
<textarea name="newidentities[<?php echo $index; ?>][signature]" cols="50" rows="5"><?php echo $identity['Signature']; ?></textarea>
</td>
</tr>
- <?php echo concat_hook_function('options_identities_table', array('', $identity['New'], $index)); ?>
+ <?php /* FIXME: No hooks in templates! */ echo concat_hook_function('options_identities_table', $temp=array('', &$identity['New'], &$index)); ?>
<tr>
<td colspan="2" class="actionButtons">
<input type="submit" name="smaction[save][<?php echo $index; ?>]" value="<?php echo _("Save / Update"); ?>" />
<input type="submit" name="smaction[move][<?php echo $index; ?>]" value="<?php echo _("Move Up"); ?>" />
<?php
}
- echo concat_hook_function('options_identities_buttons', array($identity['New'], $index));
+ /* FIXME: No hooks in templates! */ echo concat_hook_function('options_identities_buttons', $temp=array(&$identity['New'], &$index));
?>
</td>
</tr>
</td>
</tr>
</table>
-</div>
\ No newline at end of file
+</div>
<?php echo $options_link; ?>
<?php echo $search_link; ?>
<?php echo $help_link; ?>
- <?php do_hook('menuline'); ?>
+ <?php /* FIXME: no hooks in templates!! */ global $null; do_hook('menuline', $null); ?>
</td>
<?php echo $sm_attribute_str."\n"; ?>
</tr>
/* retrieve the template vars */
extract($t);
-$plugin_message = concat_hook_function('logout_above_text');
?>
<body>
$output .= $right_frame . $left_frame;
}
-// Add the hook
-$ret = concat_hook_function('webmail_bottom', $output);
-if ($ret != '') {
- $output = $ret;
-}
-
echo $output ."\n</frameset>";
//-->
</script>
<div class="sqm_leftMain">
-<?php do_hook('left_main_before'); ?>
+<?php /* FIXME: no hooks in templates! */ global $null; do_hook('left_main_before', $null); ?>
<div class="dtree">
<table class="sqm_wrapperTable" cellspacing="0">
<tr>