The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ftp module does not work!!!

Discussion in 'cPanel Developers' started by solcre, Apr 19, 2011.

  1. solcre

    solcre Registered

    Joined:
    Apr 19, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Grrrr i'm pissed off at the ftp module on the xmlapi. When i create an ftp with the addftp account, for some f... reason it creates an annonymous account which i cannot delete later. It is not listed anywhere it really sux!

    I tried to create css@mydomain.com and templates@mydomain.com and images@mydomain.com and all this created in parallel an annonymous account. What the hell with this?!?! To make matter worse this is undeletable. Nice very nice... grrrrr


    array(
    ['apiversion'] =>
    2
    ...
    ['data'] =>
    array(
    ... 4 elements ... )

    [0] =>
    array(
    ... 15 elements ... )

    ['_diskquota'] =>
    232
    ...
    ['_diskused'] =>
    0
    ...
    ['accttype'] =>
    'anonymous'
    ...
    ['deleteable'] =>
    1
    ...
    ['dir'] =>
    ...
    ['diskquota'] =>
    232
    ...
    ['diskused'] =>
    0
    ...
    ['diskusedpercent'] =>
    0
    ...
    ['diskusedpercent20'] =>
    0
    ...
    ['htmldir'] =>
    ...
    ['humandiskquota'] =>
    '232 MB'
    ...
    ['humandiskused'] =>
    'None'
    ...
    ['login'] =>
    'css@mydomaincom'
    ...
    ['reldir'] =>
    ...
    ['serverlogin'] =>
    'css@mydomaincom'
    ...
    )
    [1] =>
    array(
    ... 15 elements ... )

    ['_diskquota'] =>
    0
    ...
    ['_diskused'] =>
    0
    ...
    ['accttype'] =>
    'logaccess'
    ...
    ['deleteable'] =>
    1
    ...
    ['dir'] =>
    '/usr/local/apache/domlogs/demo'
    ...
    ['diskquota'] =>
    'unlimited'
    ...
    ['diskused'] =>
    0
    ...
    ['diskusedpercent'] =>
    0
    ...
    ['diskusedpercent20'] =>
    0
    ...
    ['htmldir'] =>
    ...
    ['humandiskquota'] =>
    'None'
    ...
    ['humandiskused'] =>
    'None'
    ...
    ['login'] =>
    'demo_logs'
    ...
    ['reldir'] =>
    'usr/local/apache/domlogs/demo'
    ...
    ['serverlogin'] =>
    'demo_logs'
    ...
    )
    [2] =>
    array(
    ... 15 elements ... )

    ['_diskquota'] =>
    10
    ...
    ['_diskused'] =>
    0
    ...
    ['accttype'] =>
    'anonymous'
    ...
    ['deleteable'] =>
    1
    ...
    ['dir'] =>
    ...
    ['diskquota'] =>
    10
    ...
    ['diskused'] =>
    0
    ...
    ['diskusedpercent'] =>
    0
    ...
    ['diskusedpercent20'] =>
    0
    ...
    ['htmldir'] =>
    ...
    ['humandiskquota'] =>
    '10 MB'
    ...
    ['humandiskused'] =>
    'None'
    ...
    ['login'] =>
    'images@mydomaincom'
    ...
    ['reldir'] =>
    ...
    ['serverlogin'] =>
    'images@mydomaincom'
    ...
    )
    [3] =>
    array(
    ... 15 elements ... )

    ['_diskquota'] =>
    111
    ...
    ['_diskused'] =>
    0
    ...
    ['accttype'] =>
    'anonymous'
    ...
    ['deleteable'] =>
    1
    ...
    ['dir'] =>
    ...
    ['diskquota'] =>
    111
    ...
    ['diskused'] =>
    0
    ...
    ['diskusedpercent'] =>
    0
    ...
    ['diskusedpercent20'] =>
    0
    ...
    ['htmldir'] =>
    ...
    ['humandiskquota'] =>
    '111 MB'
    ...
    ['humandiskused'] =>
    'None'
    ...
    ['login'] =>
    'templates@mydomaincom'
    ...
    ['reldir'] =>
    ...
    ['serverlogin'] =>
    'templates@mydomaincom'
    ...
    )
    )
    ['event'] =>
    array(
    ... 1 element ... )

    ['result'] =>
    1
    ...
    )
    ['func'] =>
    'listftpwithdisk'
    ...
    ['module'] =>
    'Ftp'
    ...
    )
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi solcre,

    In general, placing an incomplete result object will obscure the details necessary to determine if an error is due to a bug in the product or by-product of user error. In the future, please obfuscate your personal data and leave the rest of the result structure untouched for complete diagnosis. Also, you can use the forum's WYSIWYG editor to encapsulate the output you need to post within a CODE, QUOTE or PHP pre-formatted HTML element (that has CSS and JS rules that create scrollbars and syntax highlighting).

    I created an FTP account, as described in my response to your other post, and then listed my FTP accounts. Here are the results, which clear outline that the newly created "templates" FTP user is a 'type' of 'sub' and not 'anonymous'.

    Code:
    URL: https://10.1.4.1:2087/xml-api/cpanel
    DATA: cpanel_xmlapi_user=dave&cpanel_xmlapi_module=Ftp&cpanel_xmlapi_func=listftp&cpanel_xmlapi_apiversion=2
    Authentication Header: Authorization: Basic cm9vdDpyb29--snip--
    
    
    RESPONSE:
     <?xml version="1.0" ?>
      <cpanelresult>
        <apiversion>2</apiversion>
        <data>
          <homedir>/home/dave/public_html/templates</homedir>
          <type>sub</type>
          <user>templates</user>
        </data>
        <data>
          <homedir>/home/dave</homedir>
          <type>main</type>
          <user>dave</user>
        </data>
        <data>
          <homedir>/home/dave/public_ftp</homedir>
          <type>anonymous</type>
          <user>ftp</user>
        </data>
        <data>
          <homedir>/home/dave/public_ftp</homedir>
          <type>anonymous</type>
          <user>anonymous</user>
        </data>
        <data>
          <homedir>/usr/local/apache/domlogs/dave</homedir>
          <type>logaccess</type>
          <user>dave_logs</user>
        </data>
        <event>
          <result>1</result>
        </event>
        <func>listftp</func>
        <module>Ftp</module>
        <postevent>
          <result>1</result>
        </postevent>
        <preevent>
          <result>1</result>
        </preevent>
      </cpanelresult>
    
    SimpleXML var_dump:
    SimpleXMLElement Object
    (
        [apiversion] => 2
        [data] => Array
            (
                [0] => SimpleXMLElement Object
                    (
                        [homedir] => /home/dave/public_html/templates
                        [type] => sub
                        [user] => templates
                    )
    
                [1] => SimpleXMLElement Object
                    (
                        [homedir] => /home/dave
                        [type] => main
                        [user] => dave
                    )
    
                [2] => SimpleXMLElement Object
                    (
                        [homedir] => /home/dave/public_ftp
                        [type] => anonymous
                        [user] => ftp
                    )
    
                [3] => SimpleXMLElement Object
                    (
                        [homedir] => /home/dave/public_ftp
                        [type] => anonymous
                        [user] => anonymous
                    )
    
                [4] => SimpleXMLElement Object
                    (
                        [homedir] => /usr/local/apache/domlogs/dave
                        [type] => logaccess
                        [user] => dave_logs
                    )
    
            )
    
        [event] => SimpleXMLElement Object
            (
                [result] => 1
            )
    
        [func] => listftp
        [module] => Ftp
        [postevent] => SimpleXMLElement Object
            (
                [result] => 1
            )
    
        [preevent] => SimpleXMLElement Object
            (
                [result] => 1
            )
    
    )
    
    As I recall, all cPanel accounts, by default, will have an anonymous FTP account. This default behavior has nothing to do with the creation of new accounts. If you do not wish to have an anonymous account, that is a different discussion that I'm happy to work with you on.

    Regards,
    -DavidN
     
Loading...

Share This Page