index.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. if (cfr('ROOT')) {
  3. //key deletion
  4. if (ubRouting::checkGet('licensedelete')) {
  5. $avarice = new Avarice();
  6. $avarice->deleteKey(ubRouting::get('licensedelete'));
  7. ubRouting::nav('?module=licensekeys');
  8. }
  9. //key installation
  10. if (ubRouting::checkPost('createlicense')) {
  11. $avarice = new Avarice();
  12. if ($avarice->createKey(ubRouting::post('createlicense'))) {
  13. ubRouting::nav('?module=licensekeys');
  14. } else {
  15. show_error(__('Unacceptable license key'));
  16. }
  17. }
  18. //key editing
  19. if (ubRouting::checkPost(array('editlicense', 'editdbkey'))) {
  20. $avarice = new Avarice();
  21. if ($avarice->updateKey(ubRouting::post('editdbkey'), ubRouting::post('editlicense'))) {
  22. ubRouting::nav('?module=licensekeys');
  23. } else {
  24. show_error(__('Unacceptable license key'));
  25. }
  26. }
  27. //displaying Ubilling serial for license offering
  28. $hostid_q = "SELECT `value` from `ubstats` WHERE `key`='ubid'";
  29. $hostid = simple_query($hostid_q);
  30. if (empty($hostid)) {
  31. //on second refresh, key will be generated
  32. ubRouting::nav('?module=licensekeys');
  33. } else {
  34. //render current Ubilling serial info
  35. show_info(__('Use this Ubilling serial for license keys purchase') . ': ' . wf_tag('b') . $hostid['value'] . wf_tag('b', true));
  36. }
  37. //show available license keys
  38. zb_LicenseLister();
  39. zb_BillingStats();
  40. } else {
  41. show_error(__('Access denied'));
  42. }
  43. ?>