$prefs = new Preferences_admin(); $prefs->deleteConfFile(); $prefs = new Preferences_admin(); } catch (Exception $e) { } $prefs->initialize(); $prefs->set('general', 'sql', $elements_form['general']['sql']); } else { $elements_form = formToArray($_POST); $prefs = new Preferences_admin($elements_form); } $ret = $prefs->isValid(); if ($ret === true) { $ret = $prefs->backup(); if ($ret > 0) { $buf = $prefs->get('general', 'admin_language'); $language = locale2unix($buf); setlocale(LC_ALL, $language . '.UTF-8'); // configuration saved popup_info(_('Configuration successfully saved')); redirect('index.php'); } else { header_static(_('Configuration')); echo 'problem : configuration not saved<br>'; // TODO (class msg...) + gettext footer_static(); } } else { // conf not valid if ($setup) { popup_error('Error : ' . $ret);
* along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/../includes/core-minimal.inc.php'; if (!defined('STDIN')) { echo "This script cannot be used in CGI mode.\n"; exit(1); } // Check if session manager is in maintenance try { $prefs = new Preferences_admin(); } catch (Exception $e) { echo "Internal error while loading settings, unable to continue.\n"; exit(2); } if ($prefs->isValid() !== true) { // First install exit(0); } $system_in_maintenance = $prefs->get('general', 'system_in_maintenance'); if ($system_in_maintenance != '1') { echo "The Session Manager is in production mode. It's not possible to perform an upgrade until it's on maintenance mode.\n"; exit(3); } // Check if there still have sessions $nb_sessions = Abstract_Session::countByStatus(); if ($nb_sessions != 0) { echo "There are running sessions on the OVD farm. It's not possible to perform an upgrade until there are running sessions\n"; exit(4); } exit(0);
function cleanup_preferences() { $userGroupDB = UserGroupDB::getInstance(); $prefs = new Preferences_admin(); $default_usergroup_id = $prefs->get('general', 'user_default_group'); if ($default_usergroup_id != '') { $group = $userGroupDB->import($default_usergroup_id); if (!is_object($group)) { // unset the default usergroup $mods_enable = $prefs->set('general', 'user_default_group', ''); $prefs->backup(); } } }
* This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/../../includes/core.inc.php'; if (!isset($_REQUEST['tempnam'])) { header('HTTP/1.1 400 Bad Request'); die; } $prefs = new Preferences_admin(); if (!$prefs) { header('HTTP/1.1 500 Internal Error'); die; } $mods_enable = $prefs->get('general', 'module_enable'); if (!in_array('ApplicationDB', $mods_enable)) { header('HTTP/1.1 500 Internal Error'); die; } if (!file_exists('/tmp/ico' . substr($_REQUEST['tempnam'], 3))) { header('HTTP/1.1 404 Not Found'); die; } header('Content-Type: image/png'); echo @file_get_contents('/tmp/ico' . substr($_REQUEST['tempnam'], 3)); @unlink('/tmp/ico' . substr($_REQUEST['tempnam'], 3));
public function cleanup_preferences() { $this->check_authorized('manageConfiguration'); $userGroupDB = UserGroupDB::getInstance(); $prefs = new Preferences_admin(); $default_usergroup_id = $prefs->get('general', 'user_default_group'); if ($default_usergroup_id != '') { $group = $userGroupDB->import($default_usergroup_id); if (!is_object($group)) { // unset the default usergroup $mods_enable = $prefs->set('general', 'user_default_group', ''); $prefs->backup(); } } $this->log_action('cleanup_preferences'); return true; }