Code Duplication    Length = 7-8 lines in 2 locations

main/inc/lib/api.lib.php 2 locations

@@ 3344-3351 (lines=8) @@
3341
        if ($casEnabled) {
3342
            $msg .= "</div>";
3343
        }
3344
    } else {
3345
        // we were not in a course, return to home page
3346
        $msg = Display::return_message(
3347
            get_lang('NotAllowed').'<br/><br/><a href="'.$home_url.'">'.get_lang('BackHome').'</a><br />',
3348
            'error',
3349
            false
3350
        );
3351
    }
3352
3353
    $tpl->assign('content', $msg);
3354
    $tpl->display_one_col_template();
@@ 3197-3203 (lines=7) @@
3194
    $msg = null;
3195
    if (isset($message)) {
3196
        $msg = $message;
3197
    } else {
3198
        $msg = Display::return_message(
3199
            get_lang('NotAllowedClickBack').'<br/><br/><a href="'.$home_url.'">'.get_lang('ReturnToCourseHomepage').'</a>',
3200
            'error',
3201
            false
3202
        );
3203
    }
3204
3205
    $msg = Display::div($msg, array('align'=>'center'));
3206