From 9ff73b79e46be2022c861ef332f22b73d6dbe973 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 19 Oct 2010 12:51:12 -0400 Subject: Convert fullname field on users to descr, so it gains CDATA protection. --- conf.default/config.xml | 2 +- etc/inc/auth.inc | 2 +- etc/inc/globals.inc | 2 +- etc/inc/upgrade_config.inc | 15 ++++++++++++++- usr/local/www/system_usermanager.php | 8 ++++---- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/conf.default/config.xml b/conf.default/config.xml index 4d4729d..35d2c75 100644 --- a/conf.default/config.xml +++ b/conf.default/config.xml @@ -159,7 +159,7 @@ admin - System Administrator + System Administrator system admins $1$dSJImFph$GvZ7.1UbuWu.Yb8etC0re. diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index ac1e4ec..0097e10 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -333,7 +333,7 @@ function local_user_set(& $user) { /* add or mod pw db */ $cmd = "/usr/sbin/pw {$user_op} -q -u {$user_uid} -n {$user_name}". " -g {$user_group} -s {$user_shell} -d {$user_home}". - " -c ".escapeshellarg($user['fullname'])." -H 0 2>&1"; + " -c ".escapeshellarg($user['descr'])." -H 0 2>&1"; if($debug) log_error("Running: {$cmd}"); diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc index fcb9026..b11e17b 100644 --- a/etc/inc/globals.inc +++ b/etc/inc/globals.inc @@ -89,7 +89,7 @@ $g = array( "disablehelpmenu" => false, "disablehelpicon" => false, "debug" => false, - "latest_config" => "7.3", + "latest_config" => "7.4", "nopkg_platforms" => array("cdrom"), "minimum_ram_warning" => "105", "minimum_ram_warning_text" => "128 MB", diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index f4f8bb6..71644fa 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -590,7 +590,7 @@ function upgrade_039_to_040() { $config['system']['user'] = array(); $config['system']['user'][0]['name'] = "{$config['system']['username']}"; - $config['system']['user'][0]['fullname'] = "System Administrator"; + $config['system']['user'][0]['descr'] = "System Administrator"; $config['system']['user'][0]['scope'] = "system"; $config['system']['user'][0]['groupname'] = "admins"; $config['system']['user'][0]['password'] = "{$config['system']['password']}"; @@ -2245,4 +2245,17 @@ function upgrade_072_to_073() { desc_to_descr($config['load_balancer']['lbprotocol']); desc_to_descr($config['load_balancer']['virtual_server']); } + +function upgrade_073_to_074() { + global $config; + + if (is_array($config['system']['user'])) { + foreach($config['system']['user'] as & $userent) { + if (!empty($userent['fullname'])) { + $userent['descr'] = $userent['fullname']; + unset($userent['fullname']); + } + } + } +} ?> diff --git a/usr/local/www/system_usermanager.php b/usr/local/www/system_usermanager.php index 0527594..a80ba00 100644 --- a/usr/local/www/system_usermanager.php +++ b/usr/local/www/system_usermanager.php @@ -152,7 +152,7 @@ if (isAllowedPage("system_usermanager")) { if ($_GET['act'] == "edit") { if (isset($id) && $a_user[$id]) { $pconfig['usernamefld'] = $a_user[$id]['name']; - $pconfig['fullname'] = $a_user[$id]['fullname']; + $pconfig['descr'] = $a_user[$id]['descr']; $pconfig['expires'] = $a_user[$id]['expires']; $pconfig['groups'] = local_user_get_groups($a_user[$id]); $pconfig['utype'] = $a_user[$id]['scope']; @@ -284,7 +284,7 @@ if (isAllowedPage("system_usermanager")) { local_user_set_password($userent, $_POST['passwordfld1']); $userent['name'] = $_POST['usernamefld']; - $userent['fullname'] = $_POST['fullname']; + $userent['descr'] = $_POST['descr']; $userent['expires'] = $_POST['expires']; $userent['authorizedkeys'] = base64_encode($_POST['authorizedkeys']); $userent['ipsecpsk'] = $_POST['ipsecpsk']; @@ -496,7 +496,7 @@ function sshkeyClicked(obj) { - /> + />
@@ -812,7 +812,7 @@ function sshkeyClicked(obj) { -   +   -- cgit v1.1