ispCP - Board - Support
webmail client change pass - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Contributions Area (/forum-40.html)
+--- Forum: Enhancements (/forum-43.html)
+--- Thread: webmail client change pass (/thread-1422.html)

Pages: 1 2 3


RE: webmail client change pass - mafia - 05-11-2010 01:51 AM

Hello, thanks

Can I ask if this script and instructions are always
updated at this time?ispCP 1.0.5


RE: webmail client change pass - joximu - 05-11-2010 05:16 PM

Hm, I'm afraid...

I only can give you some help...

you need to encrypt the passwords befor storing in the DB:

add this function:
Code:
function encrypt_db_password($db_pass) {
    require '/var/www/ispcp/gui/include/ispcp-db-keys.php';
#    global $ispcp_db_pass_key, $ispcp_db_pass_iv;

    if (extension_loaded('mcrypt') || @dl('mcrypt.' . PHP_SHLIB_SUFFIX)) {
        $td = @mcrypt_module_open(MCRYPT_BLOWFISH, '', 'cbc', '');
        // Create key
        $key = $ispcp_db_pass_key;
        // Create the IV and determine the keysize length
        $iv = $ispcp_db_pass_iv;

        // compatibility with used perl pads
        $block_size = @mcrypt_enc_get_block_size($td);
        $strlen = strlen($db_pass);

        $pads = $block_size-$strlen % $block_size;

        $db_pass .= str_repeat(' ', $pads);

        // Initialize encryption
        @mcrypt_generic_init($td, $key, $iv);
        // Encrypt string
        $encrypted = @mcrypt_generic ($td, $db_pass);
        @mcrypt_generic_deinit($td);
        @mcrypt_module_close($td);

        $text = @base64_encode("$encrypted");

        // Show encrypted string
        return trim($text);
    } else {
        //system_message("ERROR: The php-extension 'mcrypt' not loaded!");
        die("ERROR: The php-extension 'mcrypt' not loaded!");
    }
}

and call it in the right moment/place...

/Joxi