Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 3235-3241 (lines=7) @@
3232
    $msg = null;
3233
    if (isset($message)) {
3234
        $msg = $message;
3235
    } else {
3236
        $msg = Display::return_message(
3237
            get_lang('NotAllowedClickBack').'<br/><br/><a href="'.$home_url.'">'.get_lang('ReturnToCourseHomepage').'</a>',
3238
            'error',
3239
            false
3240
        );
3241
    }
3242
3243
    $msg = Display::div($msg, array('align'=>'center'));
3244
@@ 3382-3389 (lines=8) @@
3379
        if ($casEnabled) {
3380
            $msg .= "</div>";
3381
        }
3382
    } else {
3383
        // we were not in a course, return to home page
3384
        $msg = Display::return_message(
3385
            get_lang('NotAllowed').'<br/><br/><a href="'.$home_url.'">'.get_lang('BackHome').'</a><br />',
3386
            'error',
3387
            false
3388
        );
3389
    }
3390
3391
    $tpl->assign('content', $msg);
3392
    $tpl->display_one_col_template();