3 require_once('include/crypto.php');
5 if(! function_exists('hostxrd_init')) {
6 function hostxrd_init(&$a) {
7 header('Access-Control-Allow-Origin: *');
8 header("Content-type: text/xml");
9 $pubkey = get_config('system','site_pubkey');
12 $res = new_keypair(1024);
14 set_config('system','site_prvkey', $res['prvkey']);
15 set_config('system','site_pubkey', $res['pubkey']);
18 //$tpl = file_get_contents('view/xrd_host.tpl');
19 /*echo str_replace(array(
20 '$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);*/
21 $tpl = get_markup_template('xrd_host.tpl');
22 echo replace_macros($tpl, array(
23 '$zhost' => $a->get_hostname(),
25 '$domain' => z_path(),
26 '$zot_post' => z_root() . '/post',
27 '$bigkey' => salmon_key(get_config('system','site_pubkey')),
29 session_write_close();