I am trying to send a list of users to the Xerox for network accounting purposes.
I successfully do this with 2 Xerox models (XEROX WorkCentre 7556 and XEROX WorkCentre 7830), following sudo code in PHP:
functionSendUsersToXerox($ip,$users){ $url="{$ip}/acct/set_auth"; $auth='account:jbaserve'; $post="+aaav1.0\n+purge\n";foreach($users as $u){ $post.="+u\"{$u->login}\"\"{$u->code}\"\n";} $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT,'EQ Device Control Engine'); curl_setopt($ch,CURLOPT_POST,1); curl_setopt($ch,CURLOPT_POSTFIELDS,$post); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,5); curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE); curl_setopt($ch, CURLOPT_TIMEOUT,5); curl_setopt($ch, CURLOPT_USERPWD,"$auth"); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_HTTPHEADER,['Content-Type: application/xrx-acct-data']); $data = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch);// echo "HTTP CODE: {$httpcode}<br/>";// echo $data;}
This code works perfectly on the above named Xerox's but fails on the C70 with a 401 error and the following message:
Invalid accounting authentication version
Network accounting is enabled on the device, and I can collect all jobs from the printer at the URL acct/get_acct
If I pass in bad post data I get a different error message:Click here
HTTP Return400TheRequest had invalid syntax
I can't find any references to JBA or Network Accounting anywhere and am not sure how to find out if the format has changed on set_auth or if it's version difference that needs to be set.
I know there are differences in the get_acct output that does point to a different version of the accounting.