From f75a66cc05e1df93ce2b7a3a6858d027b9971dc8 Mon Sep 17 00:00:00 2001 From: alpeb Date: Fri, 7 May 2004 16:49:17 +0000 Subject: [PATCH] fix bug 948702. User won't be allowed to change an app name 'cause it breaks it. --- admin/inc/class.soapplications.inc.php | 4 ++-- admin/inc/class.uiapplications.inc.php | 19 ++----------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/admin/inc/class.soapplications.inc.php b/admin/inc/class.soapplications.inc.php index b342941e44..603e4d93b6 100644 --- a/admin/inc/class.soapplications.inc.php +++ b/admin/inc/class.soapplications.inc.php @@ -78,9 +78,9 @@ function save($data) { - $sql = "UPDATE phpgw_applications SET app_name='" . addslashes($data['n_app_name']) . "'," + $sql = "UPDATE phpgw_applications SET " . "app_enabled='" . $data['n_app_status'] . "',app_order='" . $data['app_order'] - . "' WHERE app_name='" . $data['old_app_name'] . "'"; + . "' WHERE app_name='" . $data['app_name'] . "'"; $this->db->query($sql,__LINE__,__FILE__); return True; diff --git a/admin/inc/class.uiapplications.inc.php b/admin/inc/class.uiapplications.inc.php index 05de0a397b..c29d6d5e2e 100644 --- a/admin/inc/class.uiapplications.inc.php +++ b/admin/inc/class.uiapplications.inc.php @@ -287,29 +287,14 @@ $totalerrors = 0; $app_order = $_POST['app_order'] ? $_POST['app_order'] : 0; - $n_app_name = chop($_POST['n_app_name']); $n_app_status = $_POST['n_app_status']; - if (! $n_app_name) - { - $error[$totalerrors++] = lang('You must enter an application name.'); - } - - if ($app_name != $n_app_name) - { - if ($this->bo->exists($n_app_name)) - { - $error[$totalerrors++] = lang('That application name already exists.'); - } - } - if (! $totalerrors) { $this->bo->save(array( - 'n_app_name' => $n_app_name, 'n_app_status' => $n_app_status, 'app_order' => $app_order, - 'old_app_name' => urldecode($app_name) + 'app_name' => urldecode($app_name) )); $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); @@ -339,7 +324,7 @@ $GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']); $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.edit')); - $this->display_row(lang('application name'),''); + $this->display_row(lang('application name'), $n_app_name ); $GLOBALS['phpgw']->template->set_var('lang_status',lang('Status')); $GLOBALS['phpgw']->template->set_var('lang_save_button',lang('Save'));