1 --- squirrelmail-1.2.8/plugins/fortune/setup.php.orig Mon Mar 5 16:21:41 2001
2 +++ squirrelmail-1.2.8/plugins/fortune/setup.php Wed Sep 18 16:50:05 2002
4 $squirrelmail_plugin_hooks["options_display_inside"]['fortune'] = 'fortune_options';
5 $squirrelmail_plugin_hooks['options_display_save']['fortune'] = 'fortune_save';
6 $squirrelmail_plugin_hooks['loading_prefs']['fortune'] = 'fortune_load';
12 if( !$fortune_visible ) {
15 - $fortune_location = "/usr/games/fortune";
16 + $fortune_location = "/usr/bin/fortune";
18 $exist = file_exists("$fortune_location");
19 echo "<center><table cellpadding=0 cellspacing=0 border=0 bgcolor=$color[10]><tr><td><table width=100% cellpadding=2 cellspacing=1 border=0 bgcolor=\"$color[5]\"><tr><td align=center>";
21 global $fortune_visible;
23 $fortune_visible = getPref($data_dir, $username, 'fortune_visible');
28 function fortune_options() {
29 global $fortune_visible;
30 echo "<tr><td align=right nowrap>Fortunes:</td>\n";
32 echo "> Show fortunes at top of mailbox</td></tr>\n";
35 -function fortune_save()
37 - global $username,$data_dir;
38 - global $fortune_fortune_visible;
40 - if (isset($fortune_fortune_visible))
42 - setPref($data_dir, $username, 'fortune_visible', '1');
46 - setPref($data_dir, $username, 'fortune_visible', '');
48 +function fortune_save() {
49 + global $username,$data_dir;
50 + if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
54 + if(isset($_POST['fortune_fortune_visible'])) {
55 + setPref($data_dir, $username, 'fortune_visible', '1');
57 + setPref($data_dir, $username, 'fortune_visible', '');