Example #1
0
 /**
  * Crear el nodo con metainformaciĆ³n del archivo XML
  *
  * @throws SPException
  */
 private function createMeta()
 {
     try {
         $nodeMeta = $this->_xml->createElement('Meta');
         $metaGenerator = $this->_xml->createElement('Generator', 'sysPass');
         $metaVersion = $this->_xml->createElement('Version', implode('.', Util::getVersion()));
         $metaTime = $this->_xml->createElement('Time', time());
         $metaUser = $this->_xml->createElement('User', Session::getUserLogin());
         $metaUser->setAttribute('id', Session::getUserId());
         $metaGroup = $this->_xml->createElement('Group', Session::getUserGroupName());
         $metaGroup->setAttribute('id', Session::getUserGroupId());
         $nodeMeta->appendChild($metaGenerator);
         $nodeMeta->appendChild($metaVersion);
         $nodeMeta->appendChild($metaTime);
         $nodeMeta->appendChild($metaUser);
         $nodeMeta->appendChild($metaGroup);
         $this->_root->appendChild($nodeMeta);
     } catch (\DOMException $e) {
         throw new SPException(SPException::SP_WARNING, $e->getMessage(), __FUNCTION__);
     }
 }