Jump to content

tolja

Member
  • Posts

    4
  • Joined

  • Last visited

About tolja

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

tolja's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. Local api accepts both the username and id as admin parameter. // these produce the same result localAPI('getinvoice', array('invoiceid' => 1000), 'admin'); localAPI('getinvoice', array('invoiceid' => 1000), 1); The problems is that localAPI('getinvoice') sometimes returns invalid results with valid parameters.
  2. function get_admin_user(){ return $_SESSION['adminid'] ?: get_setting('admin_user'); } function get_setting($setting){ $result = nv_full_query("SELECT setting, value FROM tbladdonmodules WHERE module = 'mymodule' AND setting = '$setting'"); $data = $result->fetch(); return $data ? $data['value'] : null; } - - - Updated - - - I have also verified that the get_admin_user function returns a proper username even when I'm getting the error.
  3. Any idea what's causing this? We can't upgrade to v7 just yet to test out if things work better on that side.
  4. With the following code on a cron hook, I occasionally get "No matching admin user found" error message instead of the invoice I'm after. $values["invoiceid"] = $data['whmcs_id']; $invoice = localAPI('getinvoice', $values, get_admin_user()); (get_admin_user function just returns the admin user I have set in my module settings) I'm using a cron task to add invoice payments for invoices and lately the amount of invoices I'm processing at the same time has been increasing. This same piece of code worked properly up until now and the only ways I'm able to get around this error are: Switch my function get_admin_user to return id instead of the admin username, but this fixed the problem only for a few days Use a different admin account Run my script through admin rather than on cron hook However, switching the accounts isn't a proper fix and I need to be able to run my script through cron. The admin user I'm using primarly for this has full permissions and it's account is active and the WHMCS version I'm using is 6.3.1.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated