'index.php', 'name' => $nameTools); // Setting the name of the tool. $tool_name = get_lang('PlatformAdmin'); // Displaying the header Display::display_header($nameTools); if (api_is_platform_admin()) { if (is_dir(api_get_path(SYS_CODE_PATH).'install/') && is_readable(api_get_path(SYS_CODE_PATH).'install/index.php')) { Display::display_normal_message(get_lang('InstallDirAccessibleSecurityThreat')); } /* ACTION HANDLING */ if (!empty($_POST['Register'])) { register_site(); Display :: display_confirmation_message(get_lang('VersionCheckEnabled')); } /* MAIN SECTION */ $keyword_url = Security::remove_XSS((empty($_GET['keyword']) ? '' : $_GET['keyword'])); } if (api_is_platform_admin()) { ?>

'22px')); ?>



Chamilo.org

, Ghent University * @version august 2006 * @todo have a 6monthly re-registration */ function version_check() { $tbl_settings = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT); $sql = 'SELECT selected_value FROM '.$tbl_settings.' WHERE variable="registered" '; $result = Database::query($sql); $row = Database::fetch_array($result, 'ASSOC'); // The site has not been registered yet. //if (api_get_setting('registered') == 'false') $return = ''; if ($row['selected_value'] == 'false') { $return .= '
'; $return .= get_lang('VersionCheckExplanation'); $return .= ''.get_lang('HideCampusFromPublicDokeosPlatformsList'); $return .= ''; $return .= '
'; } else { // The site has been registered already but is seriously out of date (registration date + 15552000 seconds). /* if ((api_get_setting('registered') + 15552000) > mktime()) { $return = 'It has been a long time since about your campus has been updated on chamilo.org'; $return .= '
'; $return .= ''; $return .= '
'; } else { */ $return = 'site registered. '; $return .= check_system_version(); //} } return $return; } /** * This setting changes the registration status for the campus * * @author Patrick Cool , Ghent University * @version August 2006 * * @todo the $_settings should be reloaded here. => write api function for this and use this in global.inc.php also. */ function register_site() { $tbl_settings = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT); $sql = "UPDATE $tbl_settings SET selected_value='true' WHERE variable='registered'"; $result = Database::query($sql); if ($_POST['donotlistcampus']) { $sql = "UPDATE $tbl_settings SET selected_value='true' WHERE variable='donotlistcampus'"; $result = Database::query($sql); } // Reload the settings. } /** * Check if the current installation is up to date * The code is borrowed from phpBB and slighlty modified * @author The phpBB Group (the code) * @author Patrick Cool , Ghent University (the modifications) * @copyright (C) 2001 The phpBB Group * @return language string with some layout (color) */ function check_system_version() { global $_configuration; $system_version = trim($_configuration['system_version']); // the chamilo version of your installation if (ini_get('allow_url_fopen') == 1) { // The number of courses $number_of_courses = statistics::count_courses(); // The number of users $number_of_users = statistics::count_users(); $version_url = 'http://version.chamilo.org/version.php?url='.urlencode(api_get_path(WEB_PATH)).'&campus='.urlencode(api_get_setting('siteName')).'&contact='.urlencode(api_get_setting('emailAdministrator')).'&version='.urlencode($system_version).'&numberofcourses='.urlencode($number_of_courses).'&numberofusers='.urlencode($number_of_users).'&donotlistcampus='.api_get_setting('donotlistcampus').'&organisation='.urlencode(api_get_setting('Institution')).'&adminname='.urlencode(api_get_setting('administratorName').' '.api_get_setting('administratorSurname')); $handle = @fopen($version_url, 'r'); if ($handle !== false) { $version_info = trim(@fread($handle, 1024)); if ($system_version != $version_info) { $output = '
' . get_lang('YourVersionNotUpToDate') . '. '.get_lang('LatestVersionIs').' Chamilo '.$version_info.'. '.get_lang('YourVersionIs').' Chamilo '.$system_version. '. '.str_replace('http://www.chamilo.org', 'http://www.chamilo.org', get_lang('PleaseVisitDokeos')).''; } else { $output = '
'.get_lang('VersionUpToDate').': Chamilo '.$version_info.''; } } else { $output = '' . get_lang('ImpossibleToContactVersionServerPleaseTryAgain') . ''; } } else { $output = '' . get_lang('AllowurlfopenIsSetToOff') . ''; } return $output; } /* FOOTER */ Display::display_footer();