security hotfix (lame transports)
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / transports.inc
index 6c595c354aec6007d386a9c7d2343c850fd06ebd..b8ab4b1d60b296809c8ef9792376348f5056a8b4 100644 (file)
@@ -1,6 +1,32 @@
 <?php
 
 function transport_load($transport) {
-       require_once(TRANSPORT_DIR.$transport.'.inc');
+
+       // XXX security hotfix, TODO harvie rewrite
+       require_once(TRANSPORT_DIR.'kyberia.sk.inc');
+}
+
+function transport_link($url) {
+       return "<a href='$url'>$url</a>";
+}
+
+function transport_translate($transport_handle) {
+       $transport = preg_split('/[:@]/',trim($transport_handle));
+       transport_load($transport[0]);
+       global $transports;
+       
+       $id=$transport[1];
+       $domain='defaulthost'; if(isset($transport[2])) $domain=$transport[2];
+       $transport=$transport[0];
+
+       $node['node_status']='linked';
+       $node['node_name']="$transport:$id@$domain";
+       $node['url']=$transports[$transport]['get_node_url']($id);
+       $node['node_content']='Source: '.transport_link($node['url']).';<hr />'.$transports[$transport]['get_node_content']($id);
+
+       return $node;
 }
 
+function transport_process_node(&$node) {
+  if($node['external_link']=='transport') $node = array_merge($node, transport_translate($node['node_content']));
+}
This page took 0.130235 seconds and 4 git commands to generate.