course_id = $course_id; $this->hasPermit = hasModlosPermit($course_id); if (!$this->hasPermit) { $this->hasError = true; $this->errorMsg[] = get_string('modlos_access_forbidden', 'block_modlos'); return; } $this->action_url = CMS_MODULE_URL."/admin/actions/updatedb.php"; } function execute() { if (data_submitted()) { // POST if (!$this->hasPermit) { $this->hasError = true; $this->errorMsg[] = get_string('modlos_access_forbidden', 'block_modlos'); return false; } if (!confirm_sesskey()) { $this->hasError = true; $this->errorMsg[] = get_string("modlos_sesskey_error", "block_modlos"); return false; } $quest = optional_param('quest', 'no', PARAM_ALPHA); if ($quest=="yes") { $ret = opensim_check_db(); if (!$ret['grid_status']) { $this->hasError = true; $this->errorMsg[] = get_string('modlos_db_connect_error', 'block_modlos'); return false; } //opensim_supply_passwordSalt(); opensim_succession_data(OPENSIM_HMREGION); opensim_recreate_presence(); $profs = opensim_get_avatars_profiles_from_users(); if ($profs!=null) modlos_set_profiles_from_users($profs, false); // not over write $this->dbupdated = true; } } return $this->dbupdated; } function print_page() { global $CFG; $grid_name = $CFG->modlos_grid_name; $updatedb_ttl = get_string("modlos_updatedb_ttl", "block_modlos"); $updatedb_msg = get_string("modlos_updatedb_updated", "block_modlos"); $updatedb_submit= get_string("modlos_updatedb_submit", "block_modlos"); $content = "