/usr/share/squirrelmail/plugins/quicksave/setup.php is in squirrelmail-quicksave 2.4.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | <?php
/**
* SquirrelMail Quick Save Plugin
* Copyright (c) 2001-2002 Ray Black <allah@accessnode.net>
* Copyright (c) 2003-2010 Paul Lesniewski <paul@squirrelmail.org>
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* @package plugins
* @subpackage quicksave
*
*/
/**
* Register this plugin with SquirrelMail
*
*/
function squirrelmail_plugin_init_quicksave()
{
global $squirrelmail_plugin_hooks;
$squirrelmail_plugin_hooks['compose_bottom']['quicksave']
= 'quicksave_compose_functions';
$squirrelmail_plugin_hooks['generic_header']['quicksave']
= 'quicksave_clear';
$squirrelmail_plugin_hooks['configtest']['quicksave']
= 'quicksave_check_configuration';
// SquirrelMail 1.4.x (although the first two hooks here
// also have a touch of 1.5.x code in them too)
//
$squirrelmail_plugin_hooks['right_main_after_header']['quicksave']
= 'quicksave_check_recovery_upon_login';
$squirrelmail_plugin_hooks['compose_send']['quicksave']
= 'quicksave_message_sent';
$squirrelmail_plugin_hooks['compose_button_row']['quicksave']
= 'quicksave_cancel_button';
$squirrelmail_plugin_hooks['optpage_loadhook_display']['quicksave']
= 'quicksave_options_14';
// SquirrelMail 1.5.x
//
$squirrelmail_plugin_hooks['template_construct_motd.tpl']['quicksave']
= 'quicksave_check_recovery_upon_login';
$squirrelmail_plugin_hooks['compose_send_after']['quicksave']
= 'quicksave_message_sent';
$squirrelmail_plugin_hooks ['template_construct_compose_buttons.tpl']['quicksave']
= 'quicksave_cancel_button';
$squirrelmail_plugin_hooks['optpage_loadhook_compose']['quicksave']
= 'quicksave_options_15';
}
/** @ignore */
if (!defined('SM_PATH'))
define('SM_PATH', '../');
/**
* Returns info about this plugin
*
*/
function quicksave_info()
{
return array(
'english_name' => 'Quick Save',
'authors' => array(
'Paul Lesniewski' => array(
'email' => 'paul@squirrelmail.org',
'sm_site_username' => 'pdontthink',
),
),
'summary' => 'Automatically saves messages as they are being composed to prevent accidental loss due to leaving the compose screen or browser/computer crashes.',
'details' => 'This plugin automatically saves messages as they are being composed in order to prevent accidental loss of message content due to having browsed away from the compose screen or more serious problems such as browser or computer crashes. When a message appears to have been lost and is available for recovery, the user will be prompted about whether or not the recovery should proceed.',
'version' => '2.4.5',
'required_sm_version' => '1.2.9',
'requires_configuration' => 0,
'requires_source_patch' => 0,
// NOTE: could just require Compatibility 2.0.7 for all SM versions,
// but the following is intended as an example for how plugin
// authors can indicate different requirements for different
// SM versions. Also note that other requirements such as
// "requires_configuration" may also be overridden in the same
// fashion.
// FYI, when SM looks for one of these requirement values, it
// takes the highest one it can find (so for example, when
// running SM 1.5.2, and the needed requirement value is only
// listed here under 1.2.9 and 1.4.10, it will take the value
// from the 1.4.10 settings), or will use the "global" value
// above if not found herein.
'per_version_requirements' => array(
'1.5.2' => array(
'requires_source_patch' => 0,
'required_plugins' => array(
'compatibility' => array(
'version' => '2.0.5',
'activate' => FALSE,
)
)
),
'1.5.0' => array(
'requires_source_patch' => 0,
'required_plugins' => array(
'compatibility' => array(
'version' => '2.0.7',
'activate' => FALSE,
)
)
),
'1.4.10' => array(
'requires_source_patch' => 0,
'required_plugins' => array(
'compatibility' => array(
'version' => '2.0.5',
'activate' => FALSE,
)
)
),
'1.2.9' => array(
'requires_source_patch' => 0,
'required_plugins' => array(
'compatibility' => array(
'version' => '2.0.7',
'activate' => FALSE,
)
)
),
),
);
}
/**
* Returns version info about this plugin
*
*/
function quicksave_version()
{
$info = quicksave_info();
return $info['version'];
}
/**
* Determine whether or not to offer message
* recovery upon login
*
*/
function quicksave_check_recovery_upon_login($args)
{
include_once(SM_PATH . 'plugins/quicksave/login_functions.php');
return quicksave_check_recovery_upon_login_do($args);
}
/**
* Present user quicksave preferences on display/compose
* options page for SquirrelMail 1.5.x
*
*/
function quicksave_options_15()
{
include_once(SM_PATH . 'plugins/quicksave/functions.php');
quicksave_options_15_do();
}
/**
* Present user quicksave preferences on display/compose
* options page for SquirrelMail 1.4.x
*
*/
function quicksave_options_14()
{
include_once(SM_PATH . 'plugins/quicksave/functions.php');
quicksave_options_14_do();
}
/**
* Set flag indicating message was sent
*
*/
function quicksave_message_sent($args)
{
include_once(SM_PATH . 'plugins/quicksave/functions.php');
quicksave_message_sent_do($args);
}
/**
* Turn off quicksave if "message sent" flag is set
*
*/
function quicksave_clear()
{
include_once(SM_PATH . 'plugins/quicksave/functions.php');
quicksave_clear_do();
}
/**
* Add "cancel" button to the compose page
*
*/
function quicksave_cancel_button()
{
include_once(SM_PATH . 'plugins/quicksave/functions.php');
return quicksave_cancel_button_do();
}
/**
* Add the code that does all the work onto the compose page
*
*/
function quicksave_compose_functions()
{
include_once(SM_PATH . 'plugins/quicksave/functions.php');
quicksave_compose_functions_do();
}
/**
* Validate that this plugin is configured correctly
*
*/
function quicksave_check_configuration()
{
include_once(SM_PATH . 'plugins/quicksave/common_functions.php');
return quicksave_check_configuration_do();
}
|