Minor - format code

skala
Julio Montoya 12 years ago
parent 9a6e72760b
commit ca198a488b
  1. 37
      main/inc/ajax/admin.ajax.php

@ -12,29 +12,29 @@ api_protect_admin_script();
$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : null;
switch ($action) {
case 'update_changeable_setting':
case 'update_changeable_setting':
$url_id = api_get_current_access_url_id();
if (api_is_global_platform_admin() && $url_id == 1) {
if (isset($_GET['id']) && !empty($_GET['id'])) {
if (api_is_global_platform_admin() && $url_id == 1) {
if (isset($_GET['id']) && !empty($_GET['id'])) {
$params = array('variable = ? ' => array($_GET['id']));
$data = api_get_settings_params($params);
$data = api_get_settings_params($params);
if (!empty($data)) {
foreach ($data as $item) {
foreach ($data as $item) {
$params = array('id' =>$item['id'], 'access_url_changeable' => $_GET['changeable']);
api_set_setting_simple($params);
api_set_setting_simple($params);
}
}
}
echo '1';
}
}
}
break;
case 'version':
echo version_check();
break;
}
/**
* Displays either the text for the registration or the message that the installation is (not) up to date
@ -44,7 +44,8 @@ switch ($action) {
* @version august 2006
* @todo have a 6monthly re-registration
*/
function version_check() {
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);
@ -75,7 +76,8 @@ function version_check() {
* @copyright (C) 2001 The phpBB Group
* @return language string with some layout (color)
*/
function check_system_version() {
function check_system_version()
{
global $_configuration;
$system_version = trim($_configuration['system_version']); // the chamilo version of your installation
@ -85,7 +87,7 @@ function check_system_version() {
// The number of users
$number_of_users = statistics::count_users();
$number_of_active_users = statistics::count_users(null,null,null,true);
$number_of_active_users = statistics::count_users(null, null, null, true);
$data = array(
'url' => api_get_path(WEB_PATH),
@ -133,7 +135,8 @@ function check_system_version() {
* @param bool Include HTTP Request headers?
* @param bool Include HTTP Response headers?
*/
function _http_request($ip, $port = 80, $uri = '/', $getdata = array(), $timeout = 1, $req_hdr = false, $res_hdr = false) {
function _http_request($ip, $port = 80, $uri = '/', $getdata = array(), $timeout = 1, $req_hdr = false, $res_hdr = false)
{
$verb = 'GET';
$ret = '';
$getdata_str = count($getdata) ? '?' : '';
@ -153,7 +156,9 @@ function _http_request($ip, $port = 80, $uri = '/', $getdata = array(), $timeout
$req .= $crlf;
if ($req_hdr) { $ret .= $req; }
if ($req_hdr) {
$ret .= $req;
}
if (($fp = @fsockopen($ip, $port, $errno, $errstr, $timeout)) == false) {
return "Error $errno: $errstr\n";
}

Loading…
Cancel
Save