Jump to content

cats

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by cats

  1. Hi Adam

    I'm running Blesta 5.4 and Cerb 10.2.5. 

    http_date was being set successfully by cerb_api.php. I tested that first by setting it to display the output of http_date. I then set curl option for verbose, which showed the cerb-auth header was being sent successfully. The date and time sent by the server matched what http_date was set as. 

    That's when I checked the Cerb side of the REST API to see what it was validating: https://github.com/jstanden/cerb/blob/10.2.5/features/cerberusweb.restapi/api/App.php

    If no X-Date is set in the header, it uses $_SERVER['HTTP_DATE'] to validate the timestamp.

    I did some more testing today and it seems like for whatever reason, it is ignoring all header[] lines except the last one, being cerb-auth, and not adding them to the header array (or it is creating a new array each time). This means that the PUT POST etc don't work, as it doesn't add the relevant line to the header. I changed them all to be array_push($header, ...) and it adds them to the header, even though PHP recommends $array[] if adding a single element. Not sure why that is happening, but array_push fixed that.

    The http_date issue remains even with array_push. If I add date: $http_date to the header, I get an invalid timestamp error. But X-Date: $http_date works fine. Strange.

  2. I had an issue with an invalid timestamp error being returned from Cerb API when viewing the helpdesk link from Blesta client view. The time was set correctly, and I couldn't see a difference in time in the verbose output from CURL. After some digging around, I saw that Cerb looks for X-Date custom header before falling back to $_SERVER['HTTP_DATE']:

    Quote

    $header_date = $_SERVER['HTTP_X_DATE'] ?? null;

    // If the custom X-Date: header isn't provided, fall back to Date:
            if(empty($header_date))
                $header_date = $_SERVER['HTTP_DATE'] ?? null;

    I changed the cerb_api.php for the plugin to add in the custom X-Date:

    Quote

    $header = array ('X-Date: '.$http_date, 'Cerb-Auth: '.sprintf("%s:%s",$this->_access_key,$hash));

    This fixed the error.

    Not sure if it is just my setup but I thought I would share in case it is a widespread error or affecting anyone else.

  3. On 8/15/2021 at 6:46 AM, Adam said:

    fixed what I could reproduce:

    • Enforce services to be selected by users

    This should remove the "undefined index" error you were getting. 

     

    Thanks Adam. Whilst I do have a heavily customised theme, I think we are talking about the same thing, just my shorthand getting in the way. I was mentioning that when a user that had multiple services selected one from the dropdown box, they couldn't go back to having none selected - obviously a design feature - but they were able to switch between services.

    Thanks for fixing it so quickly.

  4. Just upgraded to Blesta 5 and latest version of the plugin. 

    In doing some tests, the submit new ticket form doesn't require a client to select a service from the drop down menu. If they don't, submitting a ticket returns an error which is: "Undefined index: service_id."

    Once a service is selected, it cannot be unselected.

    Not sure if it's just my installation that doesn't require a service to be selected, will keep testing variations.

    Edit: quick update; seems to only be a problem for clients with multiple services. For clients with one service, it selects that service by default.

  5. On 1/15/2021 at 2:14 PM, Adam said:

    Cats,

    Plugin has been updated to address this issue. v.1.20 has been tested and releasted with the latest version of Cerb and Blesta 4 series. Blesta 5 support is being test now.

    https://github.com/SolidNetSoftware/plugin-cerberus/issues/1

    https://github.com/SolidNetSoftware/plugin-cerberus/releases/tag/v1.2.0

    Follow the upgrade process here: https://docs.solidnet.software/blesta-cerb/getting-started/upgrade/

    Thanks,

    -Adam

    Thanks Adam. Really appreciate your quick response and fix, especially as it's a plugin you've provided for free.

  6. It's a little unclear what you're seeking to do. You can change client signup dates in the database.

    You can change a service renewal date by clicking manage next to the service, then action > change renew date.

    If you want to change date created of the service to reflect when the client actually first signed up, you can do that in the database.

  7. Hey Adam

    Thanks very much for this plugin, it's great. One thing I can't figure out is the event to use as the trigger in a bot to email staff about a new ticket created and email the client an acknowledgement.

    Cerb doesn't seem to treat a ticket created through the plugin the same event as a new ticket. I've also tried new record or modify record events as the trigger to no avail.

    Any ideas?

    Thanks again for the plugin, much appreciated.

×
×
  • Create New...