From c97ede2bd7038150e28ec4b266c6c02e8b6ed913 Mon Sep 17 00:00:00 2001 From: bettina Date: Tue, 27 Mar 2001 07:27:01 +0000 Subject: [PATCH] added cat_access --- addressbook/addcategory.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/addressbook/addcategory.php b/addressbook/addcategory.php index 3b23398a5b..503e301948 100644 --- a/addressbook/addcategory.php +++ b/addressbook/addcategory.php @@ -24,13 +24,10 @@ if ($submit) { $errorcount = 0; - $exists_main = $c->exists('main',$cat_name); - if ($exists_main == True) { $error[$errorcount++] = lang('That main category name has been used already !'); } - - $exists_sub = $c->exists('subs',$cat_name); - if ($exists_subs == True) { $error[$errorcount++] = lang('That sub category name has been used already !'); } - - if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); } + if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); } + if (!$cat_parent) { $exists = $c->exists('mains',$cat_name); } + else { $exists = $c->exists('subs',$cat_name); } + if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } if (! $error) { $cat_name = addslashes($cat_name);