Subversion Repositories oidplus

Rev

Rev 496 | Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. /*
  4.  * OIDplus 2.0
  5.  * Copyright 2019 - 2021 Daniel Marschall, ViaThinkSoft
  6.  *
  7.  * Licensed under the Apache License, Version 2.0 (the "License");
  8.  * you may not use this file except in compliance with the License.
  9.  * You may obtain a copy of the License at
  10.  *
  11.  *     http://www.apache.org/licenses/LICENSE-2.0
  12.  *
  13.  * Unless required by applicable law or agreed to in writing, software
  14.  * distributed under the License is distributed on an "AS IS" BASIS,
  15.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16.  * See the License for the specific language governing permissions and
  17.  * limitations under the License.
  18.  */
  19.  
  20. require_once __DIR__ . '/../../../../includes/oidplus.inc.php';
  21.  
  22. OIDplus::init(true);
  23. set_exception_handler(array('OIDplusGui', 'html_exception_handler'));
  24.  
  25. originHeaders();
  26.  
  27. // Step 0: Get request parameter
  28.  
  29. if (PHP_SAPI == 'cli') {
  30.         if ($_SERVER['argc'] != 2) {
  31.                 echo _L('Syntax').': '.$_SERVER['argv'][0].' <query>'."\n";
  32.                 exit(2);
  33.         }
  34.         $query = $_SERVER['argv'][1];
  35. } else {
  36.         if (!isset($_REQUEST['query'])) {
  37.                 http_response_code(400);
  38.                 die('<h1>'._L('Error').'</h1><p>'._L('Argument "%1" is missing','query').'<p>');
  39.         }
  40.         $query = $_REQUEST['query'];
  41. }
  42.  
  43. $authTokens = explode('$', $query);
  44. $query = array_shift($authTokens);
  45.  
  46. $query = str_replace('oid:.', 'oid:', $query); // allow leading dot
  47.  
  48. // Step 1: Collect data
  49.  
  50. $out = array();
  51.  
  52. $out[] = "query: $query";
  53.  
  54. $distance = null;
  55. $found = null;
  56.  
  57. try {
  58.         $obj = OIDplusObject::findFitting($query);
  59.         if (!$obj) $obj = OIDplusObject::parse($query); // in case we didn't find anything fitting, we take it as it is and later use getParent() to find something else
  60.         $query = $obj->nodeId();
  61. } catch (Exception $e) {
  62.         $obj = null;
  63. }
  64.  
  65. $only_wellknown_ids_found = false;
  66. $continue = false;
  67.  
  68. if (!$obj) {
  69.         $out[] = "result: Not found"; // DO NOT TRANSLATE!
  70.         $continue = false;
  71. } else {
  72.         $obj = null;
  73.         $distance = 0;
  74.  
  75.         $init_query = $query;
  76.         while (true) {
  77.                 $res = OIDplus::db()->query("select * from ###objects where id = ?", array($query));
  78.                 if ($res->num_rows() > 0) {
  79.                         $obj = OIDplusObject::parse($query);
  80.                         if ($distance > 0) {
  81.                                 $out[] = "result: Not found; superior object found"; // DO NOT TRANSLATE!
  82.                                 $out[] = "distance: $distance"; // DO NOT TRANSLATE
  83.                         } else {
  84.                                 $out[] = "result: Found"; // DO NOT TRANSLATE!
  85.                         }
  86.                         $continue = true;
  87.                         break;
  88.                 }
  89.  
  90.                 if (substr($query,0,4) === 'oid:') {
  91.                         $query_prev = $query;
  92.                         $query = 'oid:'.oid_up(explode(':',$query,2)[1]);
  93.                         if ($query == $query_prev) break;
  94.                         $distance++;
  95.                 } else {
  96.                         $obj = OIDplusObject::parse($query)->getParent(); // For objects, we assume that they are parents of each other
  97.                         if ($obj) {
  98.                                 $res = OIDplus::db()->query("select * from ###objects where id = ?", array($obj->nodeId()));
  99.                                 $distance = $obj->distance($query);
  100.                                 assert($res->num_rows() > 0);
  101.  
  102.                                 $query = $obj->nodeId();
  103.                         }
  104.                         break;
  105.                 }
  106.         }
  107.  
  108.         if ((substr($query,0,4) === 'oid:') && (!$obj)) {
  109.                 $query = $init_query;
  110.                 $distance = 0;
  111.                 while (true) {
  112.                         $res = OIDplus::db()->query("select * from ###asn1id where oid = ? union select * from ###iri where oid = ?", array($query, $query));
  113.                         if ($res->num_rows() > 0) {
  114.                                 $obj = OIDplusObject::parse($query);
  115.                                 $res = null;
  116.                                 if ($distance > 0) {
  117.                                         $out[] = "result: Not found; superior object found"; // DO NOT TRANSLATE!
  118.                                         $out[] = "distance: $distance"; // DO NOT TRANSLATE
  119.                                 } else {
  120.                                         $out[] = "result: Found"; // DO NOT TRANSLATE!
  121.                                 }
  122.                                 $only_wellknown_ids_found = true; // Information partially available
  123.                                 $continue = true;
  124.                                 break;
  125.                         }
  126.                         $query_prev = $query;
  127.                         $query = 'oid:'.oid_up(explode(':',$query,2)[1]);
  128.                         if ($query == $query_prev) break;
  129.                         $distance++;
  130.                 }
  131.         }
  132.  
  133.         if (!$obj) {
  134.                 $out[] = "result: Not found"; // DO NOT TRANSLATE!
  135.                 $continue = false;
  136.         }
  137.  
  138.         $found = $distance == 0;
  139. }
  140.  
  141. if ($continue) {
  142.         $out[] = "";
  143.         $out[] = "object: $query"; // DO NOT TRANSLATE!
  144.         if (!allowObjectView($obj, $authTokens)) {
  145.                 $out[] = "status: Information unavailable"; // DO NOT TRANSLATE!
  146.                 $out[] = "attribute: confidential"; // DO NOT TRANSLATE!
  147.         } else {
  148.                 if ($only_wellknown_ids_found) {
  149.                         $out[] = "status: Information partially available"; // DO NOT TRANSLATE!
  150.                 } else {
  151.                         $out[] = "status: Information available"; // DO NOT TRANSLATE!
  152.                 }
  153.  
  154.                 $row = $res ? $res->fetch_object() : null;
  155.  
  156.                 if (!is_null($row)) $out[] = 'name: ' . $row->title; // DO NOT TRANSLATE!
  157.  
  158.                 if (!is_null($row)) {
  159.                         $cont = $row->description;
  160.                         $cont = preg_replace('@<a[^>]+href\s*=\s*["\']([^\'"]+)["\'][^>]*>(.+)<\s*/\s*a\s*>@ismU', '\2 (\1)', $cont);
  161.                         $cont = preg_replace('@<br.*>@', "\n", $cont);
  162.                         $cont = preg_replace('@\\n+@', "\n", $cont);
  163.                         $out[] = 'description: ' . trim(html_entity_decode(strip_tags($cont))); // DO NOT TRANSLATE!
  164.                 }
  165.  
  166.                 if (substr($query,0,4) === 'oid:') {
  167.                         $out[] = 'asn1-notation: ' . $obj->getAsn1Notation(false); // DO NOT TRANSLATE!
  168.                         $out[] = 'iri-notation: ' . $obj->getIriNotation(false); // DO NOT TRANSLATE!
  169.  
  170.                         $res2 = OIDplus::db()->query("select * from ###asn1id where oid = ?", array($obj->nodeId()));
  171.                         while ($row2 = $res2->fetch_object()) {
  172.                                 $out[] = 'identifier: ' . $row2->name; // DO NOT TRANSLATE!
  173.                         }
  174.  
  175.                         $res2 = OIDplus::db()->query("select * from ###asn1id where standardized = ? and oid = ?", array(true, $obj->nodeId()));
  176.                         while ($row2 = $res2->fetch_object()) {
  177.                                 $out[] = 'standardized-id: ' . $row2->name; // DO NOT TRANSLATE!
  178.                         }
  179.  
  180.                         $res2 = OIDplus::db()->query("select * from ###iri where oid = ?", array($obj->nodeId()));
  181.                         while ($row2 = $res2->fetch_object()) {
  182.                                 $out[] = 'unicode-label: ' . $row2->name; // DO NOT TRANSLATE!
  183.                         }
  184.  
  185.                         $res2 = OIDplus::db()->query("select * from ###iri where longarc = ? and oid = ?", array(true, $obj->nodeId()));
  186.                         while ($row2 = $res2->fetch_object()) {
  187.                                 $out[] = 'long-arc: ' . $row2->name; // DO NOT TRANSLATE!
  188.                         }
  189.                 }
  190.  
  191.                 if ($obj->isConfidential()) { // yes, we use isConfidential() instead of allowObjectView()!
  192.                         $out[] = 'attribute: confidential';
  193.                 }
  194.  
  195.                 foreach (OIDplus::getPagePlugins() as $plugin) {
  196.                         if ($plugin->implementsFeature('1.3.6.1.4.1.37476.2.5.2.3.4')) {
  197.                                 $plugin->whoisObjectAttributes($obj->nodeId(), $out);
  198.                         }
  199.                 }
  200.  
  201.                 if (substr($query,0,4) === 'oid:') {
  202.                         $sParent = 'oid:'.oid_up(explode(':',$query,2)[1]);
  203.  
  204.                         $objTest = OIDplusObject::parse($sParent);
  205.                         if (allowObjectView($objTest, $authTokens)) {
  206.                                 $out[] = 'parent: ' . $sParent . show_asn1_appendix($sParent); // DO NOT TRANSLATE!
  207.                         } else {
  208.                                 $out[] = 'parent: ' . $sParent; // DO NOT TRANSLATE!
  209.                         }
  210.                 } else if (!is_null($row) && !empty($row->parent) && (!is_root($row->parent))) {
  211.                         $sParent = $row->parent;
  212.                         $out[] = 'parent: ' . $row->parent; // DO NOT TRANSLATE!
  213.                 }
  214.  
  215.                 $res2 = OIDplus::db()->query("select * from ###objects where parent = ? order by ".OIDplus::db()->natOrder('id'), array($obj->nodeId()));
  216.                 while ($row2 = $res2->fetch_object()) {
  217.                         $objTest = OIDplusObject::parse($row2->id);
  218.                         if (allowObjectView($objTest, $authTokens)) {
  219.                                 $out[] = 'subordinate: ' . $row2->id . show_asn1_appendix($row2->id); // DO NOT TRANSLATE!
  220.                         } else {
  221.                                 $out[] = 'subordinate: ' . $row2->id; // DO NOT TRANSLATE!
  222.                         }
  223.                 }
  224.  
  225.                 if (!is_null($row)) {
  226.                         if ($row->created) $out[] = 'created: ' . date('Y-m-d H:i:s', strtotime($row->created)); // DO NOT TRANSLATE!
  227.                         if ($row->updated) $out[] = 'updated: ' . date('Y-m-d H:i:s', strtotime($row->updated)); // DO NOT TRANSLATE!
  228.                 }
  229.  
  230.                 $out[] = '';
  231.  
  232.                 $res2 = OIDplus::db()->query("select * from ###ra where email = ?", array(is_null($row) ? '' : $row->ra_email));
  233.                 if ($row2 = $res2->fetch_object()) {
  234.                         $out[] = 'ra: '.(!empty($row2->ra_name) ? $row2->ra_name : (!empty($row2->email) ? $row2->email : _L('Unknown'))); // DO NOT TRANSLATE!
  235.                         $out[] = 'ra-status: Information available'; // DO NOT TRANSLATE!
  236.  
  237.                         $tmp = array();
  238.                         if (!empty($row2->office)) $tmp[] = $row2->office;
  239.                         if (!empty($row2->organization)) $tmp[] = $row2->organization;
  240.                         $tmp = implode(', ', $tmp);
  241.  
  242.                         $out[] = 'ra-contact-name: ' . $row2->personal_name.(!empty($tmp) ? " ($tmp)" : ''); // DO NOT TRANSLATE!
  243.                         if (!allowRAView($row2, $authTokens)) {
  244.                                 if (!empty($row2->street) || !empty($row2->zip_town) || !empty($row2->country)) {
  245.                                         $out[] = 'ra-address: '._L('(redacted)'); // DO NOT TRANSLATE!
  246.                                 }
  247.                                 $out[] = 'ra-phone: ' . (!empty($row2->phone) ? _L('(redacted)') : ''); // DO NOT TRANSLATE!
  248.                                 $out[] = 'ra-mobile: ' . (!empty($row2->mobile) ? _L('(redacted)') : ''); // DO NOT TRANSLATE!
  249.                                 $out[] = 'ra-fax: ' . (!empty($row2->fax) ? _L('(redacted)') : ''); // DO NOT TRANSLATE!
  250.                         } else {
  251.                                 if (!empty($row2->street))   $out[] = 'ra-address: ' . $row2->street; // DO NOT TRANSLATE!
  252.                                 if (!empty($row2->zip_town)) $out[] = 'ra-address: ' . $row2->zip_town; // DO NOT TRANSLATE!
  253.                                 if (!empty($row2->country))  $out[] = 'ra-address: ' . $row2->country; // DO NOT TRANSLATE!
  254.                                 $out[] = 'ra-phone: ' . $row2->phone; // DO NOT TRANSLATE!
  255.                                 $out[] = 'ra-mobile: ' . $row2->mobile; // DO NOT TRANSLATE!
  256.                                 $out[] = 'ra-fax: ' . $row2->fax; // DO NOT TRANSLATE!
  257.                         }
  258.                         $out[] = 'ra-email: ' . $row->ra_email; // DO NOT TRANSLATE!
  259.                         foreach (OIDplus::getPagePlugins() as $plugin) {
  260.                                 if ($plugin->implementsFeature('1.3.6.1.4.1.37476.2.5.2.3.4')) {
  261.                                         $plugin->whoisRaAttributes($row->ra_email, $out);
  262.                                 }
  263.                         }
  264.  
  265.                         if ($row2->privacy) { // yes, we use row2->privacy() instead of allowRAView()!
  266.                                 $out[] = 'ra-attribute: confidential';
  267.                         }
  268.  
  269.                         if ($row2->registered) $out[] = 'ra-created: ' . date('Y-m-d H:i:s', strtotime($row2->registered)); // DO NOT TRANSLATE!
  270.                         if ($row2->updated)    $out[] = 'ra-updated: ' . date('Y-m-d H:i:s', strtotime($row2->updated)); // DO NOT TRANSLATE!
  271.                 } else {
  272.                         $out[] = 'ra: '.(!is_null($row) && !empty($row->ra_email) ? $row->ra_email : _L('Unknown')); // DO NOT TRANSLATE!
  273.                         if (!is_null($row)) {
  274.                                 foreach (OIDplus::getPagePlugins() as $plugin) {
  275.                                         if ($plugin->implementsFeature('1.3.6.1.4.1.37476.2.5.2.3.4')) {
  276.                                                 $plugin->whoisRaAttributes($row->ra_email, $out);
  277.                                         }
  278.                                 }
  279.                         }
  280.                         $out[] = "ra-status: Information unavailable"; // DO NOT TRANSLATE!
  281.                 }
  282.         }
  283. }
  284.  
  285. // Step 2: Format output
  286.  
  287. ob_start();
  288.  
  289. $format = isset($_REQUEST['format']) ? $_REQUEST['format'] : 'txt';
  290.  
  291. if ($format == 'txt') {
  292.         header('Content-Type:text/plain; charset=UTF-8');
  293.  
  294.         $longest_key = 0;
  295.         foreach ($out as $line) {
  296.                 $longest_key = max($longest_key, strlen(trim(explode(':',$line,2)[0])));
  297.         }
  298.  
  299.         //echo '% ' . str_repeat('*', OIDplus::config()->getValue('webwhois_output_format_max_line_length', 80)-2)."\n";
  300.  
  301.         foreach ($out as $line) {
  302.                 if (trim($line) == '') {
  303.                         echo "\n";
  304.                         continue;
  305.                 }
  306.  
  307.                 $ary = explode(':', $line, 2);
  308.  
  309.                 $key = trim($ary[0]);
  310.  
  311.                 $value = isset($ary[1]) ? trim($ary[1]) : '';
  312.                 $value = mb_wordwrap($value, OIDplus::config()->getValue('webwhois_output_format_max_line_length', 80) - $longest_key - strlen(':') - OIDplus::config()->getValue('webwhois_output_format_spacer', 2));
  313.                 $value = str_replace("\n", "\n$key:".str_repeat(' ', $longest_key-strlen($key)) . str_repeat(' ', OIDplus::config()->getValue('webwhois_output_format_spacer', 2)), $value);
  314.  
  315.                 if (!empty($value)) {
  316.                         echo $key.':' . str_repeat(' ', $longest_key-strlen($key)) . str_repeat(' ', OIDplus::config()->getValue('webwhois_output_format_spacer', 2)) . $value . "\n";
  317.                 }
  318.         }
  319.  
  320.         //echo '% ' . str_repeat('*', OIDplus::config()->getValue('webwhois_output_format_max_line_length', 80)-2)."\n";
  321.  
  322.         $cont = ob_get_contents();
  323.         ob_end_clean();
  324.  
  325.         echo $cont;
  326.  
  327.         if (OIDplus::getPkiStatus(true)) {
  328.                 $signature = '';
  329.                 if (@openssl_sign($cont, $signature, OIDplus::config()->getValue('oidplus_private_key'))) {
  330.                         $signature = base64_encode($signature);
  331.                         $signature = mb_wordwrap($signature, OIDplus::config()->getValue('webwhois_output_format_max_line_length', 80) - strlen('% '), "\n", true);
  332.                         $signature = "% -----BEGIN RSA SIGNATURE-----\n".
  333.                                      preg_replace('/^/m', '% ', $signature)."\n".
  334.                                      "% -----END RSA SIGNATURE-----\n";
  335.                         echo $signature;
  336.                 }
  337.         }
  338. }
  339.  
  340. if ($format == 'json') {
  341.         $ary = array();
  342.  
  343.         $current_section = array();
  344.         $ary[] = &$current_section;
  345.  
  346.         foreach ($out as $line) {
  347.                 if ($line == '') {
  348.                         unset($current_section);
  349.                         $current_section = array();
  350.                         $ary[] = &$current_section;
  351.                 } else {
  352.                         list($key,$val) = explode(':', $line, 2);
  353.                         $val = trim($val);
  354.                         if (!empty($val)) {
  355.                                 if (!isset($current_section[$key])) {
  356.                                         $current_section[$key] = $val;
  357.                                 } elseif (is_array($current_section[$key])) {
  358.                                         $current_section[$key][] = $val;
  359.                                 } else {
  360.                                         $current_section[$key] = array($current_section[$key], $val);
  361.                                 }
  362.                         }
  363.                 }
  364.         }
  365.         $ary = array(
  366.                 // https://code.visualstudio.com/docs/languages/json#_mapping-in-the-json
  367.                 // Note that this syntax is VS Code-specific and not part of the JSON Schema specification.
  368.                 //'$schema' => 'https://oidplus.viathinksoft.com/oidplus/plugins/publicPages/100_whois/whois/json_schema.json',
  369.                 '$schema' => OIDplus::webpath().'plugins/publicPages/100_whois/whois/json_schema.json',
  370.  
  371.                 // we need this NAMED root, otherwise PHP will name the sections "0", "1", "2" if the array is not sequencial (e.g. because "signature" is added)
  372.                 'whois' => $ary
  373.         );
  374.  
  375.         if (OIDplus::getPkiStatus(true)) {
  376.                 $cont = json_encode($ary);
  377.                 $signature = '';
  378.                 if (@openssl_sign($cont, $signature, OIDplus::config()->getValue('oidplus_private_key'))) {
  379.                         $signature = base64_encode($signature);
  380.                         $ary['signature'] = array('content' => $cont, 'signature' => $signature);
  381.                 }
  382.         }
  383.  
  384.         // Good JSON schema validator here: https://www.jsonschemavalidator.net
  385.         header('Content-Type:application/json; charset=UTF-8');
  386.         echo json_encode($ary);
  387. }
  388.  
  389. if ($format == 'xml') {
  390.         $xml = '<whois><section>';
  391.         foreach ($out as $line) {
  392.                 if ($line == '') {
  393.                         $xml .= '</section><section>';
  394.                 } else {
  395.                         list($key,$val) = explode(':', $line, 2);
  396.                         $val = trim($val);
  397.                         if (!empty($val)) {
  398.                                 $xml .= "<$key>".htmlspecialchars($val)."</$key>";
  399.                         }
  400.                 }
  401.         }
  402.         $xml .= '</section></whois>';
  403.  
  404.         $xml = preg_replace('@<section><(.+)>(.+)</section>@ismU', '<\\1Section><\\1>\\2</\\1Section>', $xml);
  405.  
  406.         if (OIDplus::getPkiStatus(true)) {
  407.                 $cont = $xml;
  408.                 $signature = '';
  409.                 if (@openssl_sign($cont, $signature, OIDplus::config()->getValue('oidplus_private_key'))) {
  410.                         $signature = base64_encode($signature);
  411.                         $xml .= "<signature><content>".htmlspecialchars($cont)."</content><signature>".htmlspecialchars($signature)."</signature></signature>";
  412.                 }
  413.         }
  414.  
  415.         // Good XSD validator here: https://www.liquid-technologies.com/online-xsd-validator
  416.         header('Content-Type:application/xml; charset=UTF-8');
  417.         echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
  418.         echo '<root xmlns="urn:oid:1.3.6.1.4.1.37476.2.5.2.5.1.1"';
  419.         echo '      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"';
  420.         //echo '      xsi:schemaLocation="urn:oid:1.3.6.1.4.1.37476.2.5.2.5.1.1 https://oidplus.viathinksoft.com/oidplus/plugins/publicPages/100_whois/whois/xml_schema.xsd">';
  421.         echo '      xsi:schemaLocation="urn:oid:1.3.6.1.4.1.37476.2.5.2.5.1.1 '.OIDplus::webpath().'plugins/publicPages/100_whois/whois/xml_schema.xsd">';
  422.         echo $xml;
  423.         echo '</root>';
  424. }
  425.  
  426. # ---
  427.  
  428. function show_asn1_appendix($id) {
  429.         if (substr($id,0,4) === 'oid:') {
  430.                 $appendix_asn1ids = array();
  431.                 $res3 = OIDplus::db()->query("select * from ###asn1id where oid = ?", array($id));
  432.                 while ($row3 = $res3->fetch_object()) {
  433.                         $appendix_asn1ids[] = $row3->name;
  434.                 }
  435.  
  436.                 $appendix = implode(', ', $appendix_asn1ids);
  437.                 if (!empty($appendix)) $appendix = " ($appendix)";
  438.         } else {
  439.                 $appendix = '';
  440.         }
  441.         return $appendix;
  442. }
  443.  
  444. function is_root($id) {
  445.         return empty(explode(':',$id,2)[1]);
  446. }
  447.  
  448. function authTokenAccepted($content, $authTokens) {
  449.         foreach ($authTokens as $token) {
  450.                 if (OIDplusPagePublicWhois::genWhoisAuthToken($content) == $token) return true;
  451.         }
  452.         return false;
  453. }
  454.  
  455. function allowObjectView($obj, $authTokens) {
  456.         // Master auth token
  457.         $authToken = trim(OIDplus::config()->getValue('whois_auth_token'));
  458.         if (empty($authToken)) $authToken = false;
  459.         if ($authToken && in_array($authToken, $authTokens)) return true;
  460.  
  461.         // Per-OID auth tokens
  462.         $curid = $obj->nodeId();
  463.         while (($res = OIDplus::db()->query("select parent, confidential from ###objects where id = ?", array($curid)))->num_rows() > 0) {
  464.                 $row = $res->fetch_array();
  465.                 // Example: You have an auth Token for 2.999.1.2.3
  466.                 // This allows you to view 2.999.1.2.3 and all of its children,
  467.                 // as long as they are not confidential (then you need their auth token).
  468.                 // 2, 2.999, 2.999.1 and 2.999.1.2 are visible,
  469.                 // (because their existence is now obvious).
  470.                 if ($row['confidential'] && !authTokenAccepted($curid, $authTokens)) return false;
  471.                 $curid = $row['parent'];
  472.         }
  473.  
  474.         // Allow
  475.         return true;
  476. }
  477.  
  478. function allowRAView($row, $authTokens) {
  479.         // Master auth token
  480.         $authToken = trim(OIDplus::config()->getValue('whois_auth_token'));
  481.         if (empty($authToken)) $authToken = false;
  482.         if ($authToken && in_array($authToken, $authTokens)) return true;
  483.  
  484.         // Per-RA auth tokens
  485.         if ($row->privacy && !authTokenAccepted('ra:'.$row->ra_name, $authTokens)) return false;
  486.  
  487.         // Allow
  488.         return true;
  489. }