app_defaults.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <[email protected]>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2019
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <[email protected]>
  20. */
  21. if ($domains_processed == 1) {
  22. //remove old rows
  23. $sql = "delete from v_software where software_uuid <> '7de057e7-333b-4ebf-9466-315ae7d44efd' ";
  24. $database = new database;
  25. $database->execute($sql, null);
  26. //update the software table
  27. $sql = "select count(*) from v_software ";
  28. $database = new database;
  29. $num_rows = $database->select($sql, null, 'column');
  30. if ($num_rows == 0) {
  31. $array['software'][0]['software_uuid'] = '7de057e7-333b-4ebf-9466-315ae7d44efd';
  32. $array['software'][0]['software_name'] = 'FusionPBX';
  33. $array['software'][0]['software_url'] = 'https://www.fusionpbx.com';
  34. $array['software'][0]['software_version'] = software::version();
  35. }
  36. else {
  37. $array['software'][0]['software_uuid'] = '7de057e7-333b-4ebf-9466-315ae7d44efd';
  38. $array['software'][0]['software_version'] = software::version();
  39. }
  40. $database = new database;
  41. $database->app_name = 'software';
  42. $database->app_uuid = 'b88c795f-7dea-4fc8-9ab7-edd555242cff';
  43. $database->save($array);
  44. unset($array);
  45. }
  46. ?>