Current time: 04-20-2024, 05:01 PM Hello There, Guest! (LoginRegister)


Post Reply 
webmail client change pass
Author Message
mafia Offline
Banned

Posts: 170
Joined: May 2008
Post: #21
RE: webmail client change pass
Hello, thanks

Can I ask if this script and instructions are always
updated at this time?ispCP 1.0.5
(This post was last modified: 05-11-2010 07:04 PM by mafia.)
05-11-2010 01:51 AM
Find all posts by this user Quote this message in a reply
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 


Forum Jump:


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