606fdfddf6064cebdc64f75c7ce1a4562a291366
[squirrelmail-change-pass-cn.git] / change_pass / setup.php
1 <?php
2     /* change_pass
3      *
4      * $Id: setup.php,v 1.6 2007/06/09 22:55:25 indiri69 Exp $
5      */
6 function squirrelmail_plugin_init_change_pass() {
7     global $squirrelmail_plugin_hooks;
8
9     $squirrelmail_plugin_hooks['optpage_register_block']['change_pass'] = 'change_pass_opt';
10     $squirrelmail_plugin_hooks['options_save']['change_pass'] = 'change_pass_save_pref';
11 }
12
13 function change_pass_opt() {
14     global $optpage_blocks;
15
16     include_once(SM_PATH . 'functions/i18n.php');
17     bindtextdomain('change_pass', SM_PATH . 'plugins/change_pass/locale');
18     textdomain('change_pass');
19
20     $optpage_blocks[] = array(
21         'name' => _("Change Password"),
22         'url'  => SM_PATH . 'plugins/change_pass/options.php',
23         'desc' => _("This connects to your local Password Server to change your email password."),
24         'js'   => false
25     );
26
27     bindtextdomain('squirrelmail', SM_PATH . 'locale');
28     textdomain('squirrelmail');
29 }
30
31 function change_pass_save_pref() {
32     if(sqgetGlobalVar('plugin_change_pass', $plugin_change_pass)) {
33         include_once(SM_PATH . 'functions/i18n.php');
34         bindtextdomain('change_pass', SM_PATH . 'plugins/change_pass/locale');
35         textdomain('change_pass');
36
37         echo '<p align="center">' .
38              _("Password changed successfully.") .
39              "</p>\n";
40
41         bindtextdomain('squirrelmail', SM_PATH . 'locale');
42         textdomain('squirrelmail');
43     }
44 }
45
46     function change_pass_version() {
47         return '2.7a-1.4.x';
48     }
49 ?>