Code Duplication    Length = 4-4 lines in 4 locations

admin/file.php 1 location

@@ 168-171 (lines=4) @@
165
        $fileObj->setVar('status', (int)$_POST['file_status']);
166
167
        // Storing the file
168
        if (!$fileObj->store()) {
169
            redirect_header('partner.php?op=mod&id=' . $fileObj->id(), 3, _AM_SPARTNER_FILE_EDITING_ERROR . smartpartner_formatErrors($fileObj->getErrors()));
170
            exit;
171
        }
172
173
        redirect_header('partner.php?op=mod&id=' . $fileObj->id(), 2, _AM_SPARTNER_FILE_EDITING_SUCCESS);
174

join.php 1 location

@@ 80-83 (lines=4) @@
77
        }
78
79
        // Storing the partner
80
        if (!$partnerObj->store()) {
81
            redirect_header('javascript:history.go(-1)', 3, _MD_SPARTNER_SUBMIT_ERROR . smartpartner_formatErrors($partnerObj->getErrors()));
82
            exit;
83
        }
84
85
        if (isset($_POST['notifypub']) && $_POST['notifypub'] === 1) {
86
            include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';

admin/category.php 2 locations

@@ 360-363 (lines=4) @@
357
            $redirect_to  = 'category.php';
358
        }
359
360
        if (!$categoryObj->store()) {
361
            redirect_header('javascript:history.go(-1)', 3, _AM_SPARTNER_CATEGORY_SAVE_ERROR . smartpartner_formatErrors($categoryObj->getErrors()));
362
            exit;
363
        }
364
        //Added by fx2024
365
        $parentCat = $categoryObj->categoryid();
366
@@ 373-376 (lines=4) @@
370
                $categoryObj->setVar('name', $_POST['scname'][$i]);
371
                $categoryObj->setVar('parentid', $parentCat);
372
373
                if (!$categoryObj->store()) {
374
                    redirect_header('javascript:history.go(-1)', 3, _AM_SPARTNER_CATEGORY_SUBCAT_SAVE_ERROR . smartpartner_formatErrors($categoryObj->getErrors()));
375
                    exit;
376
                }
377
            }
378
        }
379