roundcubemail/plugins/password/drivers/cpanel_webmail.php
public static function decode_response($response)
    {
        if (!$response) {
            return PASSWORD_CONNECT_ERROR;
        }

        // $result should be `null` or `stdClass` object
        $result = json_decode($response);

        // The UAPI may return HTML instead of JSON on missing authentication
        if ($result && $result->status === 1) {
            return PASSWORD_SUCCESS;
        }

        if ($result && is_array($result->errors) && count($result->errors) > 0) {
            return array(
                'code'    => PASSWORD_ERROR,
                'message' => $result->errors[0],
            );
        }

        return PASSWORD_ERROR;
    }
public static function decode_response($response)
    {
        if (!$response) {
            return PASSWORD_CONNECT_ERROR;
        }

        // $result should be `null` or `stdClass` object
        $result = json_decode($response);

        // The UAPI may return HTML instead of JSON on missing authentication
        if ($result && $result->status === 1) {
            return PASSWORD_SUCCESS;
        }

        if ($result && is_array($result->errors) && count($result->errors) > 0) {
            return array(
                'code'    => PASSWORD_ERROR,
                'message' => $result->errors[0],
            );
        }

        return PASSWORD_ERROR;
    }
public static function decode_response ( $ response ) { if ( ! $ response ) { return PASSWORD_CONNECT_ERROR ; } // $result should be `null` or `stdClass` object $ result = json_decode ( $ response ) ; // The UAPI may return HTML instead of JSON on missing authentication if ( $ result && $ result -> status === 1 ) { return PASSWORD_SUCCESS ; } if ( $ result && is_array ( $ result -> errors ) && count ( $ result -> errors ) > 0 ) { return array ( 'code' => PASSWORD_ERROR , 'message' => $ result -> errors [ 0 ] , ) ; } return PASSWORD_ERROR ; }
Converts a UAPI response to a password driver response.

@param string $response JSON response by the Cpanel UAPI

@return mixed response code or array, see <code>save</code>
Converts a UAPI response to a password driver response .