Jump to content

cjsmith87

Members
  • Content count

    9
  • Joined

  • Last visited

  1. cjsmith87

    Help translating the licence module plugin

    Thanks, I hit a brick wall with it and have decided to re implement my own classes for License Manager plugin
  2. cjsmith87

    Help translating the licence module plugin

    Ok so its not going! I just want to be able to Decrypt the data client side so I have been looking at the decrypt method on the Licence Manager. It looks like the Key and IV values for the Decryption are hashes of various bits of info. For reference this is how far I have got... Dim decryptedData As String = Decrypt(EncryptedLicenseData, Security.GenerateHashSHA256(LicenseKey, SecretKey), Security.GenerateHashSHA256(PublicKey, SecretKey)) Public Shared Function GenerateHashSHA256(ByVal SourceText As String, SecretKey As String) As String Dim Ue As New UnicodeEncoding() Dim test As New HMACSHA256(Ue.GetBytes(SecretKey)) Dim ByteHash() As Byte = test.ComputeHash(Ue.GetBytes(SourceText)) Return Convert.ToBase64String(ByteHash) End Function Public Shared Function Decrypt(ByVal cipherText As String, xKey As String, xIV As String) As String Dim Ue As New UnicodeEncoding() Dim plaintext As String = Nothing Using aesAlg As New AesCryptoServiceProvider() aesAlg.Key = Ue.GetBytes(xKey.ToCharArray, 0, 8) aesAlg.IV = Ue.GetBytes(xIV.ToCharArray, 0, 8) Dim decryptor As ICryptoTransform = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV) Using msDecrypt As New MemoryStream(System.Text.Encoding.Unicode.GetBytes(cipherText)) Using csDecrypt As New CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read) Using srDecrypt As New StreamReader(csDecrypt) plaintext = srDecrypt.ReadToEnd() End Using End Using End Using End Using Return plaintext End Function Currently it is not working. It complains about Block Length: {"The input data is not a complete block."}
  3. I am trying to use the licence module paid addon to licence desktop software. I have got the licence module working but I would ideally like to pass the encrypted data object back to the client and have the client decrypt it instead of having to pass the client info in clear text. I am using the plugins\licence_manager\dist folder as my reference and trying to work out if i could translate this into vb or c# so i can use it in our .net app. Has any one else done this or is anyone able to offer any advice on the best way to do this? Thanks
  4. cjsmith87

    Client Upgrade Issue

    No not using any coupon codes
  5. cjsmith87

    Client Upgrade Issue

    Any thoughts on this Paul? Is there something I am doing wrong or anything I can change?
  6. cjsmith87

    Client Upgrade Issue

    Packages are setup within the same Package group and upgrades are allowed:Standard - 1 Year (£1195) 3 Years (£3155)Pro - 1 Year (£1395) 3 Years (£3685)If they are on a a 1 year Standard licence and choose to upgrade to a 3 year Pro licence, it invoices them for £33!! I am guessing this is because it is doing (£3685/3) - the £1195 they have already paid. This means they are getting a 1 year pro licence for £1228 when it should be £1395 saving them £167! Plus it is confusing because it does not extend their service by 2 years, it just amends the cost of their current licence
  7. cjsmith87

    Client Upgrade Issue

    We have setup a package group with 3 packages: Standard, Pro and Enterprise. We offer a 1 year licence and a 3 year licence. I have set it up so users can upgrade themselves but if they are on a 1 year standard licence and they choose to upgrade to 3 Year Pro licence it is pro rata-ing their current licence to the end of its term (1 year from start date) but at the 3 year price for a single year! This is giving them the discount of a 3 year deal but on a 1 year subscription. What am I doing wrong? It should either only allow them to upgrade within the same level, e.g. 1 year OR extend their current licence date
  8. cjsmith87

    Post New Support Ticket Knowledgebase check

    I am not trying to auto complete the text, I am trying to lookup content, we currently use Hesk for our ticketing system and I want to switch this over to blesta. http://help.4matrix.com/index.php?a=add that is our current ticket page, if you type 'install' in the subject and message box, it will auto suggest some Knowledgebase articles related to what you have typed. ClientExec also have an this feature, http://demo.clientexec.com/index.php?fuse=support&controller=ticket&view=submitticket type 'totam' in the subject form and it will suggest articles. I want them to then be able to click the link and hopefully not need to post a ticket! $('#ticket_number').autocomplete({ minLength: 3, appendTo: ".with_ticket", position: { my: "left bottom", at: "left top"}, source: function(request, response) { $(document).blestaRequest('POST', '<?php echo $this->Html->safe($this->base_uri . 'plugin/support_manager/admin_tickets/searchbycode/');?>', { _csrf_token: $('#tickets').find('input[name=_csrf_token]').val(), search: request.term}, function(data) { if (data && data.tickets) { // Build the response to show var tickets = new Array(); for (var id in data.tickets) tickets.push({label:data.tickets[id], value:data.tickets[id], id:id}); response(tickets); // No results if (tickets.length == 0) $('#no_tickets').show(); else $('#no_tickets').hide(); } }, null, {dataType:'json'} ); }, select: function(event, ui) { $('#ticket_id').val(ui.item.id); } }); I have tried using variations of this but I cant get it to work. I am probably missing something obvious, bit of a newbie!
  9. I am trying to tweak /plugins/support_manager/views/default/client_tickets_add.pdt so that is shows similar knowledgebase questions to what the user types in the Ticket Summary box. So far i have added a DIV to put the similar KB's in and set a key press event: <div class="form-group"> <?php $this->Form->label($this->_('ClientTickets.add.field_summary', true), 'summary'); $this->Form->fieldText('summary', $this->Html->ifSet($vars->summary), ['id' => 'summary', 'class' => 'form-control', 'onkeyup' => 'loadKBArticles(event)', 'placeholder' => $this->_('ClientTickets.add.placeholder_summary', true)]); ?> <div id="matchingKB" style="display: none;"> </div> </div> I have added a script to the bottom of the page but I cant seem to get anywhere with accessing the model to search the KBs: <script> function loadKBArticles( value ) { $element = document.getElementById("matchingKB"); $element.style.display="block"; $element.innerText =<Similar KB Links Here>; } </script> I have tried lots of different ways of accessing the API to get the data. I know I need to access the model SupportManagerKbArticles and use the search function but i cant work it out. Anyone able to help a novice out?! I am keen to learn
×