roundcubemail/plugins/password/drivers/plesk.php
function change_mailbox_password($mailbox, $newpass)
    {
        list($user, $domain) = explode("@", $mailbox);
        $domain_id = $this->get_domain_id($domain);

        // if domain cannot be resolved to an id, do not continue
        if (!$domain_id) {
            return false;
        }

        // build xml-packet
        $request = $this    -> get_request_obj();
        $mail    = $request -> addChild("mail");
        $update  = $mail    -> addChild("update");
        $add     = $update  -> addChild("set");
        $filter  = $add     -> addChild("filter");
        $filter->addChild("site-id", $domain_id);

        $mailname = $filter->addChild("mailname");
        $mailname->addChild("name", $user);

        $password = $mailname->addChild("password");
        $password->addChild("value", $newpass);
        $password->addChild("type", "plain");

        $packet = $request->asXML();

        // send the request to plesk
        $res = $this->send_request($packet);
        $xml = new SimpleXMLElement($res);
        $res = strval($xml->mail->update->set->result->status);

        return $res == "ok";
    }
function change_mailbox_password($mailbox, $newpass)
    {
        list($user, $domain) = explode("@", $mailbox);
        $domain_id = $this->get_domain_id($domain);

        // if domain cannot be resolved to an id, do not continue
        if (!$domain_id) {
            return false;
        }

        // build xml-packet
        $request = $this    -> get_request_obj();
        $mail    = $request -> addChild("mail");
        $update  = $mail    -> addChild("update");
        $add     = $update  -> addChild("set");
        $filter  = $add     -> addChild("filter");
        $filter->addChild("site-id", $domain_id);

        $mailname = $filter->addChild("mailname");
        $mailname->addChild("name", $user);

        $password = $mailname->addChild("password");
        $password->addChild("value", $newpass);
        $password->addChild("type", "plain");

        $packet = $request->asXML();

        // send the request to plesk
        $res = $this->send_request($packet);
        $xml = new SimpleXMLElement($res);
        $res = strval($xml->mail->update->set->result->status);

        return $res == "ok";
    }
function change_mailbox_password ( $ mailbox , $ newpass ) { list ( $ user , $ domain ) = explode ( "@" , $ mailbox ) ; $ domain_id = $ this -> get_domain_id ( $ domain ) ; // if domain cannot be resolved to an id, do not continue if ( ! $ domain_id ) { return false ; } // build xml-packet $ request = $ this -> get_request_obj ( ) ; $ mail = $ request -> addChild ( "mail" ) ; $ update = $ mail -> addChild ( "update" ) ; $ add = $ update -> addChild ( "set" ) ; $ filter = $ add -> addChild ( "filter" ) ; $ filter -> addChild ( "site-id" , $ domain_id ) ; $ mailname = $ filter -> addChild ( "mailname" ) ; $ mailname -> addChild ( "name" , $ user ) ; $ password = $ mailname -> addChild ( "password" ) ; $ password -> addChild ( "value" , $ newpass ) ; $ password -> addChild ( "type" , "plain" ) ; $ packet = $ request -> asXML ( ) ; // send the request to plesk $ res = $ this -> send_request ( $ packet ) ; $ xml = new SimpleXMLElement ( $ res ) ; $ res = strval ( $ xml -> mail -> update -> set -> result -> status ) ; return $ res == "ok" ; }
Change Password of a mailbox

@param string $mailbox full email-address (user@domain.tld)
@param string $newpass new password of mailbox

@returns bool
Change Password of a mailbox