Code Duplication    Length = 7-7 lines in 2 locations

message_ajax.php 1 location

@@ 40-46 (lines=7) @@
37
$page    = 'index';
38
$id      = Constants::DEFAULT_UID;
39
$profile = Constants::PROFILE_NONE;
40
if (($GLOBALS['xoopsUser'] && ($GLOBALS['xoopsUser'] instanceof \XoopsUser))) {
41
    $id      = $GLOBALS['xoopsUser']->uid();
42
    //$check   = new Smallworld\User();
43
    //$profile = $check->checkIfProfile($id);
44
    $swUserHandler = $helper->getHandler('SwUser');
45
    $profile = $swUserHandler->checkIfProfile($id);
46
}
47
48
if ($profile >= Constants::PROFILE_HAS_BOTH) {
49
    $username = $GLOBALS['xoopsUser']->uname();

publicindex.php 1 location

@@ 50-56 (lines=7) @@
47
$username = '';
48
$profile  = Constants::PROFILE_NONE;
49
50
if ($GLOBALS['xoopsUser'] instanceof \XoopsUser) {
51
    $id       = $GLOBALS['xoopsUser']->uid();
52
    $username = $GLOBALS['xoopsUser']->uname();
53
    //$check    = new Smallworld\User();
54
    //$profile  = $check->checkIfProfile($id);
55
    $profile  = $helper->getHandler('SwUser')->checkIfProfile($id);
56
}
57
58
$pub     = smallworld_checkUserPubPostPerm();
59
$wall    = new Smallworld\PublicWallUpdates();