roundcubemail/plugins/password/drivers/plesk.php
function save($currpass, $newpass)
    {
        // get config
        $rcmail = rcmail::get_instance();
        $host   = $rcmail->config->get('password_plesk_host');
        $user   = $rcmail->config->get('password_plesk_user');
        $pass   = $rcmail->config->get('password_plesk_pass');
        $port   = $rcmail->config->get('password_plesk_rpc_port');
        $path   = $rcmail->config->get('password_plesk_rpc_path');

        // create plesk-object
        $plesk = new plesk_rpc;
        $plesk->init($host, $port, $path, $user, $pass);

        // try to change password and return the status
        $result = $plesk->change_mailbox_password($_SESSION['username'], $newpass);
        //$plesk->destroy();

        if ($result) {
            return PASSWORD_SUCCESS;
        }

        return PASSWORD_ERROR;
    }
function save($currpass, $newpass)
    {
        // get config
        $rcmail = rcmail::get_instance();
        $host   = $rcmail->config->get('password_plesk_host');
        $user   = $rcmail->config->get('password_plesk_user');
        $pass   = $rcmail->config->get('password_plesk_pass');
        $port   = $rcmail->config->get('password_plesk_rpc_port');
        $path   = $rcmail->config->get('password_plesk_rpc_path');

        // create plesk-object
        $plesk = new plesk_rpc;
        $plesk->init($host, $port, $path, $user, $pass);

        // try to change password and return the status
        $result = $plesk->change_mailbox_password($_SESSION['username'], $newpass);
        //$plesk->destroy();

        if ($result) {
            return PASSWORD_SUCCESS;
        }

        return PASSWORD_ERROR;
    }
function save ( $ currpass , $ newpass ) { // get config $ rcmail = rcmail :: get_instance ( ) ; $ host = $ rcmail -> config -> get ( 'password_plesk_host' ) ; $ user = $ rcmail -> config -> get ( 'password_plesk_user' ) ; $ pass = $ rcmail -> config -> get ( 'password_plesk_pass' ) ; $ port = $ rcmail -> config -> get ( 'password_plesk_rpc_port' ) ; $ path = $ rcmail -> config -> get ( 'password_plesk_rpc_path' ) ; // create plesk-object $ plesk = new plesk_rpc ; $ plesk -> init ( $ host , $ port , $ path , $ user , $ pass ) ; // try to change password and return the status $ result = $ plesk -> change_mailbox_password ( $ _SESSION [ 'username' ] , $ newpass ) ; //$plesk->destroy(); if ( $ result ) { return PASSWORD_SUCCESS ; } return PASSWORD_ERROR ; }
this method is called from roundcube to change the password

roundcube allready validated the old password so we just need to change it at this point

@author Cyrill von Wattenwyl <cyrill.vonwattenwyl@adfinis-sygroup.ch>
@param string $curpass Current password
@param string $newpass New password
@returns int PASSWORD_SUCCESS|PASSWORD_ERROR
this method is called from roundcube to change the password