Current time: 05-27-2024, 06:45 PM Hello There, Guest! (LoginRegister)


Post Reply 
webmail client change pass
Author Message
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #22
RE: webmail client change pass
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
05-11-2010 05:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
webmail client change pass - deptrai - 09-29-2007, 10:43 AM
RE: webmail client change pass - joximu - 09-29-2007, 05:28 PM
RE: webmail client change pass - BeNe - 09-29-2007, 07:03 PM
RE: webmail client change pass - joximu - 09-29-2007, 07:36 PM
RE: webmail client change pass - Esni - 09-29-2007, 07:13 PM
RE: webmail client change pass - joximu - 09-30-2007, 07:00 AM
RE: webmail client change pass - BeNe - 09-30-2007, 07:21 AM
RE: webmail client change pass - joximu - 09-30-2007, 09:03 AM
RE: webmail client change pass - joximu - 09-30-2007, 09:51 AM
RE: webmail client change pass - BeNe - 09-30-2007, 06:48 PM
RE: webmail client change pass - joximu - 09-30-2007, 07:04 PM
RE: webmail client change pass - MicCo - 10-02-2007, 09:09 AM
RE: webmail client change pass - deptrai - 10-04-2007, 10:51 PM
RE: webmail client change pass - joximu - 10-05-2007, 05:29 AM
RE: webmail client change pass - grungy - 10-21-2007, 09:58 AM
RE: webmail client change pass - joximu - 10-21-2007, 10:13 AM
RE: webmail client change pass - grungy - 10-21-2007, 10:18 AM
RE: webmail client change pass - grungy - 10-21-2007, 10:23 AM
RE: webmail client change pass - joximu - 10-21-2007, 06:15 PM
RE: webmail client change pass - grungy - 10-21-2007, 07:33 PM
RE: webmail client change pass - mafia - 05-11-2010, 01:51 AM
RE: webmail client change pass - joximu - 05-11-2010 05:16 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)