Merge pull request #3444 from annando/1705-mail-duplicates
[friendica.git/.git] / mod / hostxrd.php
1 <?php
2
3 use Friendica\App;
4
5 require_once('include/crypto.php');
6
7 function hostxrd_init(App $a) {
8         header('Access-Control-Allow-Origin: *');
9         header("Content-type: text/xml");
10         $pubkey = get_config('system','site_pubkey');
11
12         if(! $pubkey) {
13                 $res = new_keypair(1024);
14
15                 set_config('system','site_prvkey', $res['prvkey']);
16                 set_config('system','site_pubkey', $res['pubkey']);
17         }
18
19         //$tpl = file_get_contents('view/xrd_host.tpl');
20         /*echo str_replace(array(
21                 '$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);*/
22         $tpl = get_markup_template('xrd_host.tpl');
23         echo replace_macros($tpl, array(
24                 '$zhost' => $a->get_hostname(),
25                 '$zroot' => z_root(),
26                 '$domain' => z_path(),
27                 '$zot_post' => z_root() . '/post',
28                 '$bigkey' => salmon_key(get_config('system','site_pubkey')),
29         ));
30         exit();
31
32 }