Code Duplication    Length = 14-14 lines in 3 locations

plugins/cpanel-change-password/xmlapi.php 3 locations

@@ 1759-1772 (lines=14) @@
1756
    * @return mixed
1757
    * @link http://docs.cpanel.net/twiki/bin/view/AllDocumentation/AutomationIntegration/SetResellerIps XML API Call documentation
1758
    */
1759
    public function setresellerips($user, $ip = null)
1760
    {
1761
        if (!isset($user) ) {
1762
            error_log("setresellerips requires that a username is passed to it");
1763
1764
            return false;
1765
        }
1766
        $params = array("user" => $user);
1767
        if ($ip != null) {
1768
            $params['ip'] = $ip;
1769
        }
1770
1771
        return $this->xmlapi_query('setresellerips',$params);
1772
    }
1773
1774
    /**
1775
    * Set Accounting Limits for a reseller account
@@ 1873-1886 (lines=14) @@
1870
    * @return mixed
1871
    * @link http://docs.cpanel.net/twiki/bin/view/AllDocumentation/AutomationIntegration/SuspendReseller XML API Call documentation
1872
    */
1873
    public function suspendreseller($reseller, $reason = null)
1874
    {
1875
        if (!isset($reseller) ) {
1876
            error_log("suspendreseller requires that the reseller's username is passed to it");
1877
1878
            return false;
1879
        }
1880
        $params = array("user" => $reseller);
1881
        if ($reason) {
1882
            $params['reason'] = $reason;
1883
        }
1884
1885
        return $this->xmlapi_query('suspendreseller', $params);
1886
    }
1887
1888
1889
    /**
@@ 1937-1950 (lines=14) @@
1934
    * @return mixed
1935
    * @link http://docs.cpanel.net/twiki/bin/view/AllDocumentation/AutomationIntegration/SetResellerNameservers XML API Call documentation
1936
    */
1937
    public function setresellernameservers($user, $nameservers = null)
1938
    {
1939
        if (!isset($user)) {
1940
            error_log("setresellernameservers requires that a username is passed to it");
1941
1942
            return false;
1943
        }
1944
        $params = array('user' => $user);
1945
        if ($nameservers) {
1946
            $params['nameservers'] = $nameservers;
1947
        }
1948
1949
        return $this->xmlapi_query('setresellernameservers', $params);
1950
    }
1951
1952
    ####
1953
    # Server information