db =& JFactory :: getDBO(); $this -> log =& JLog :: getInstance(); } public function getInvenioUrl() { $this -> db -> setQuery('SELECT `value` FROM `#__openaire` WHERE `key` = \'invenioUrl\''); $invenioUrl = $this -> db -> loadResult(); if ($invenioUrl === NULL) $this -> log -> addEntry(array('level' => 'error', 'comment' => ('Error retrieving Invenio URL: ' . $this -> db -> getErrorMsg() . ' (' . $this -> db -> getErrorNum() . ')'))); else $this -> log -> addEntry(array('level' => 'info', 'comment' => "Invenio URL is $invenioUrl")); return $invenioUrl; } public function setInvenioUrl($invenioUrl) { $this -> db -> setQuery('UPDATE `#__openaire` SET `value` = ' . $this -> db -> quote($invenioUrl) . ' WHERE `key` = \'invenioUrl\''); if ($this -> db -> query() === FALSE) $this -> log -> addEntry(array('level' => 'error', 'comment' => ("Error setting Invenio URL to $invenioUrl: " . $this -> db -> getErrorMsg() . ' (' . $this -> db -> getErrorNum() . ')'))); else $this -> log -> addEntry(array('level' => 'info', 'comment' => "Set Invenio URL to $invenioUrl")); } public function getInvenioPassword() { $this -> db -> setQuery('SELECT `value` FROM `#__openaire` WHERE `key` = \'invenioPassword\''); $invenioPassword = $this -> db -> loadResult(); if ($invenioPassword === NULL) $this -> log -> addEntry(array('level' => 'error', 'comment' => ('Error retrieving Invenio password: ' . $this -> db -> getErrorMsg() . ' (' . $this -> db -> getErrorNum() . ')'))); else $this -> log -> addEntry(array('level' => 'info', 'comment' => "Invenio password is $invenioPassword")); return $invenioPassword; } public function setInvenioPassword($invenioPassword) { $this -> db -> setQuery('UPDATE `#__openaire` SET `value` = ' . $this -> db -> quote($invenioPassword) . ' WHERE `key` = \'invenioPassword\''); if ($this -> db -> query() === FALSE) $this -> log -> addEntry(array('level' => 'error', 'comment' => ("Error setting Invenio password to $invenioPassword: " . $this -> db -> getErrorMsg() . ' (' . $this -> db -> getErrorNum() . ')'))); else $this -> log -> addEntry(array('level' => 'info', 'comment' => "Set Invenio password to $invenioPassword")); } } ?>