Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
910 B

9 years ago
9 years ago
  1. <?php
  2. require_once('include/crypto.php');
  3. function hostxrd_init(&$a) {
  4. header('Access-Control-Allow-Origin: *');
  5. header("Content-type: text/xml");
  6. $pubkey = get_config('system','site_pubkey');
  7. if(! $pubkey) {
  8. $res = new_keypair(1024);
  9. set_config('system','site_prvkey', $res['prvkey']);
  10. set_config('system','site_pubkey', $res['pubkey']);
  11. }
  12. //$tpl = file_get_contents('view/xrd_host.tpl');
  13. /*echo str_replace(array(
  14. '$zhost','$zroot','$domain','$zot_post','$bigkey'),array($a->get_hostname(),z_root(),z_path(),z_root() . '/post', salmon_key(get_config('system','site_pubkey'))),$tpl);*/
  15. $tpl = get_markup_template('xrd_host.tpl');
  16. echo replace_macros($tpl, array(
  17. '$zhost' => $a->get_hostname(),
  18. '$zroot' => z_root(),
  19. '$domain' => z_path(),
  20. '$zot_post' => z_root() . '/post',
  21. '$bigkey' => salmon_key(get_config('system','site_pubkey')),
  22. ));
  23. session_write_close();
  24. exit();
  25. }