remotebridge improvement, whmcs plugin rewrited

  • Hi team,


    Thx for the great job you're doing. we really appreciate.
    I would like to share with you
    - an improvement i've done in remotebridge plugin, support for usage statistics (disk, bandwith, ...). Please see remotebridge.action.usage.patch file in attachment
    - i've rewrite whmcs module to work with remotebridge plugin. Please see imscp.php in attachment


    regards.

  • Hello Sascha.
    Really happy to see you add my patch in the plugin :D, really happy.
    I've seen you made a little change, checking if the domain is filled.


    case 'collectusagedata':
    if (empty($postData['domain'])) {
    logoutReseller();
    exit(
    createJsonMessage(
    array(
    'level' => 'Error',
    'message' => 'No domain in post data available!'
    )
    )
    );
    }
    collectUsageData($resellerId, $postData['domain']);


    in fact, i made that value optional. so then, if empty, statistics for all domains of a reseller could be load at once. if filled, stats will be return only for that domain. i've done it in this way to avoid too much calls of the remotebridge.
    On another side, requesting stats for all domains may generate a large amount of data. maybe it's the reason of the restriction you added.


    Please let'me know your opinion. if we are going to keep that restriction, i will then make some changes in the whmcs module too.


    regards


  • On another side, requesting stats for all domains may generate a large amount of data. maybe it's the reason of the restriction you added.


    Please let'me know your opinion. if we are going to keep that restriction, i will then make some changes in the whmcs module too.


    regards


    Hi bristohn,
    you are right... That was my thoughts about the empty var. But i can add it again. Then we use the param "all" and not empty.


    Edit:
    Where will this Var to be set in WHM?

    Code
    1. $postData['domain']

    Edited once, last by TheCry ().

  • I agree. better to use 'all' instead of empty value. Please set it in whmcs as shown below


    Code
    1. function imscp_UsageUpdate($params) {
    2. $accData = array(
    3. 'action' => 'collectusagedata',
    4. 'reseller_username' => $params['serverusername'],
    5. 'reseller_password' => $params['serverpassword'],
    6. 'domain' => 'all',
    7. );


    Regards