Пример #1
0
 /**
  * gets one node.
  * @param	integer The node id
  * @param	boolean Whether to include list of parents
  * @param	boolean Whether to include joinable content
  *
  * @return Array.  A node record, optionally including attachment and ancestry.
  **/
 public function getNode($nodeid, $withParents = false, $withJoinableContent = false)
 {
     $node = $this->library->getNode($nodeid, $withParents, $withJoinableContent);
     //check permissions.
     $approved = $this->validateNodeList(array($nodeid => $node));
     if (!empty($approved['errors'])) {
         throw new vB_Exception_Api('invalid_request');
     } else {
         if (empty($approved) or empty($approved[$nodeid])) {
             throw new vB_Exception_Api('no_permission');
         } else {
             if (!vB::getUserContext()->getChannelPermission('moderatorpermission', 'canviewips', $nodeid)) {
                 $approved[$nodeid]['ipaddress'] = '';
             }
             return $approved[$nodeid];
         }
     }
 }