[case 45745] livephp/API2 Fileman::fileop issue

kris.x15

Member
Sep 20, 2010
8
0
51
Hi,

I've recently stumbled upon a problem, i think its something with api2.
Using /usr/local/cpanel/php/cpanel.php class I'm trying to extract zip archive which is placed in home directory of user.

- archive is correct, using Fileman frontend i'm able to extract it correctly
- i'm sending valid details, i've compared them to those which are send with ajax by Fileman
- other calls to API2 works fine

I'm using following code (in a file with .live.php extension) :
PHP:
$cp = new CPANEL();
$cp->api2("Fileman","fileop",array(
                   'destfiles'=>'public_html',
                    'sourcefiles'=>'/home/acctst/archive.zip',
                    'op'=>'extract',
                    'doubledecode'=>'0',
                    'metadata'=>''
                ));
Api call returns:
PHP:
array(1) {
  ["cpanelresult"]=>
  array(4) {
    ["apiversion"]=>
    string(1) "2"
    ["event"]=>
    array(1) {
      ["result"]=>
      string(1) "1"
    }
    ["func"]=>
    string(6) "fileop"
    ["module"]=>
    string(7) "Fileman"
  }
}
but no data, and archive is not extracted ;( Am I missing something?
 

cPanelDavidN

Well-Known Member
Staff member
Dec 17, 2009
571
3
68
Houston, TX
cPanel Access Level
Root Administrator
Hi kris.x15,

I also tried to execute the API2 Fileman::fileop via LivePHP without success. The same arguments, when used via XML-API, work as expected. So, something is amiss or I'm unclear about some internal process of the Fileman module.

I will post back after I've had an opportunity to investigate it further.

Best Regards,
-DavidN
 

cPanelDavidN

Well-Known Member
Staff member
Dec 17, 2009
571
3
68
Houston, TX
cPanel Access Level
Root Administrator
Hi all,

This issue has been resolved in cPanel version 11.28.63 and beyond. You can watch the change log for internal case number 45757 for confirmation of the fix in your cPanel build.

Regards,
-DavidN

TESTING via PHP client class with "archive.zip" in the user's home directory (/home/ctest1):
PHP:
<?php
include("xmlapi.php");

$ip = "10.1.1.1";
$user = 'ctest1';
$upass = 'secr3t!';

$xmlapi = new xmlapi($ip);
$xmlapi->password_auth($user,$upass);
$xmlapi->set_port('2083');
$xmlapi->set_debug(1);

$args = array(
           'destfiles'=>'/public_html',          
           'sourcefiles'=>'archive.zip',             
           'op'=>'extract',
           'doubledecode'=>'0',
           'metadata'=>''
       );

$xmlapi->api2_query($user,"Fileman","fileop",$args);