Novi izvorni kod change_pass dodatka (inacica 3.0).
[squirrelmail-change-pass-cn.git] / change_pass / setup.php
index 606fdfd..a9f58fc 100644 (file)
@@ -1,49 +1,34 @@
 <?php
     /* change_pass
      *
-     * $Id: setup.php,v 1.6 2007/06/09 22:55:25 indiri69 Exp $
+     * Licensed under the GNU GPL. For full terms see the file COPYING.
+     *
+     * $Id: setup.php,v 1.8 2009/05/05 03:09:22 indiri69 Exp $
      */
+
 function squirrelmail_plugin_init_change_pass() {
     global $squirrelmail_plugin_hooks;
 
     $squirrelmail_plugin_hooks['optpage_register_block']['change_pass'] = 'change_pass_opt';
-    $squirrelmail_plugin_hooks['options_save']['change_pass'] = 'change_pass_save_pref';
+    $squirrelmail_plugin_hooks['optpage_set_loadinfo']['change_pass']   = 'change_pass_loadinfo';
 }
 
-function change_pass_opt() {
-    global $optpage_blocks;
-
-    include_once(SM_PATH . 'functions/i18n.php');
-    bindtextdomain('change_pass', SM_PATH . 'plugins/change_pass/locale');
-    textdomain('change_pass');
-
-    $optpage_blocks[] = array(
-        'name' => _("Change Password"),
-        'url'  => SM_PATH . 'plugins/change_pass/options.php',
-        'desc' => _("This connects to your local Password Server to change your email password."),
-        'js'   => false
-    );
-
-    bindtextdomain('squirrelmail', SM_PATH . 'locale');
-    textdomain('squirrelmail');
+function change_pass_info() {
+    include_once(SM_PATH . 'plugins/change_pass/functions.php');
+    return change_pass_info_real();
 }
 
-function change_pass_save_pref() {
-    if(sqgetGlobalVar('plugin_change_pass', $plugin_change_pass)) {
-        include_once(SM_PATH . 'functions/i18n.php');
-        bindtextdomain('change_pass', SM_PATH . 'plugins/change_pass/locale');
-        textdomain('change_pass');
-
-        echo '<p align="center">' .
-             _("Password changed successfully.") .
-             "</p>\n";
+function change_pass_version() {
+    $info = change_pass_info();
+    return $info['version'];
+}
 
-        bindtextdomain('squirrelmail', SM_PATH . 'locale');
-        textdomain('squirrelmail');
-    }
+function change_pass_opt() {
+    include_once(SM_PATH . 'plugins/change_pass/functions.php');
+    change_pass_option_link_do();
 }
 
-    function change_pass_version() {
-        return '2.7a-1.4.x';
-    }
-?>
+function change_pass_loadinfo() {
+    include_once(SM_PATH . 'plugins/change_pass/functions.php');
+    change_pass_loadinfo_real();
+}