- // endElement - callback handler for the closing tag of an XML element.
- // When we are here, currentElement is an array of the element attributes (as set in startElement).
- // Here we do the actual import of data into the database.
- function endElement($parser, $name) {
- // Do nothing here. Everything is done in startElement to keep things simple.
- /*
- // During first pass we only check user logins.
- if ($this->firstPass) {
- if ($name == 'USER' && $this->canImport) {
- if ('' != $this->currentElement['STATUS'] && ttUserHelper::getUserByLogin($this->currentElement['LOGIN'])) {
- // We have a login collision, cannot import any data.
- $this->canImport = false;
- }
- }
- $this->currentTag = '';
- }
-
- // During second pass we import data.
- if (!$this->firstPass && $this->canImport) {
- // Nothing is done here, see startElement for second pass.
- }*/
- }
-
- // dataElement - callback handler for text data fragments. It builds up currentElement array with text pieces from XML.
- function dataElement($parser, $data) {
- // New approach is to do nothing here. Everything is now done when processing start tag (startElement).
- /*
- if ($this->currentTag == 'NAME'
- || $this->currentTag == 'DESCRIPTION'
- || $this->currentTag == 'LABEL'
- || $this->currentTag == 'VALUE'
- || $this->currentTag == 'COMMENT'
- || $this->currentTag == 'ADDRESS'
- || $this->currentTag == 'ALLOW_IP'
- || $this->currentTag == 'PASSWORD_COMPLEXITY') {
- if (isset($this->currentElement[$this->currentTag]))
- $this->currentElement[$this->currentTag] .= trim($data);
- else
- $this->currentElement[$this->currentTag] = trim($data);
- }
- * */
- }
-