27663afe |
1 | <?php |
2 | |
087508d9 |
3 | /** |
4 | * setup.php - Generic Change Password plugin |
5 | * |
27663afe |
6 | * This plugin aims to provide a general framework for all password |
7 | * changing methods that currently have their own plugins. |
8 | * |
4b4abf93 |
9 | * @copyright © 2003-2005 The SquirrelMail Project Team |
10 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
882acf90 |
11 | * @version $Id$ |
087508d9 |
12 | * @package plugins |
13 | * @subpackage change_password |
27663afe |
14 | */ |
15 | |
882acf90 |
16 | /** |
17 | * Plugin init function |
18 | */ |
27663afe |
19 | function squirrelmail_plugin_init_change_password() { |
20 | global $squirrelmail_plugin_hooks; |
21 | |
22 | $squirrelmail_plugin_hooks['optpage_register_block']['change_password'] = 'change_password_optpage'; |
75adae57 |
23 | $squirrelmail_plugin_hooks['optpage_set_loadinfo']['change_password'] = 'change_password_loadinfo'; |
27663afe |
24 | } |
25 | |
882acf90 |
26 | /** |
27 | * Add plugin option block |
28 | */ |
27663afe |
29 | function change_password_optpage() { |
30 | global $optpage_blocks; |
31 | |
76063016 |
32 | // SM14 code: use change_password gettext domain binding for 1.4.x |
33 | if (! check_sm_version(1,5,0)) { |
34 | bindtextdomain('change_password',SM_PATH . 'locale'); |
35 | textdomain('change_password'); |
36 | } |
37 | |
27663afe |
38 | $optpage_blocks[] = array( |
39 | 'name' => _("Change Password"), |
40 | 'url' => '../plugins/change_password/options.php', |
41 | 'desc' => _("Use this to change your email password."), |
42 | 'js' => FALSE |
43 | ); |
76063016 |
44 | |
45 | // SM14 code: revert to squirrelmail domain for 1.4.x |
46 | if (! check_sm_version(1,5,0)) { |
47 | bindtextdomain('squirrelmail',SM_PATH . 'locale'); |
48 | textdomain('squirrelmail'); |
49 | } |
27663afe |
50 | } |
51 | |
75adae57 |
52 | /** |
53 | * Displays information after "Successfully Saved Options:" |
54 | * @since 1.5.1 |
55 | */ |
56 | function change_password_loadinfo() { |
57 | global $optpage, $optpage_name; |
58 | if ($optpage=='change_password') { |
76063016 |
59 | // SM14 code: use change_password gettext domain binding for 1.4.x |
60 | if (! check_sm_version(1,5,0)) { |
61 | bindtextdomain('change_password',SM_PATH . 'locale'); |
62 | textdomain('change_password'); |
63 | } |
64 | |
75adae57 |
65 | // i18n: is displayed after "Successfully Saved Options:" |
66 | $optpage_name=_("User's Password"); |
75adae57 |
67 | |
76063016 |
68 | // SM14 code: revert to squirrelmail domain for 1.4.x |
69 | if (! check_sm_version(1,5,0)) { |
70 | bindtextdomain('squirrelmail',SM_PATH . 'locale'); |
71 | textdomain('squirrelmail'); |
72 | } |
73 | } |
75adae57 |
74 | } |
75 | |
882acf90 |
76 | /** |
77 | * Return version information |
78 | * @return string version number |
79 | */ |
27663afe |
80 | function change_password_version() { |
087508d9 |
81 | return '0.2'; |
27663afe |
82 | } |
882acf90 |
83 | ?> |