Code Duplication    Length = 21-22 lines in 2 locations

include/functions.php 1 location

@@ 727-747 (lines=21) @@
724
/**
725
 * Validate userid
726
 */
727
function lx_val_user_data($uids) {
728
    global $xoopsDB,$xoopsUser, $xoopsUserIsAdmin;
729
730
    if ($uids<=0) {
731
        return false;
732
    }
733
    if ($uids > 0) {
734
        $member_handler = xoops_gethandler('member');
735
        $user = $member_handler->getUser($uids);
736
        if (!is_object($user)) {
737
            return false;
738
        }
739
    }
740
    $result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("users")." WHERE uid='$uids'");
741
    if ($xoopsDB->getRowsNum($result)<=0) {
742
        return false;
743
    }
744
    $row = $xoopsDB->fetchArray($result);
745
746
    return $row;
747
}
748
749
// Get all terms published by an author
750
function lx_AuthorProfile($uid ) {

class/Utility.php 1 location

@@ 1041-1062 (lines=22) @@
1038
     * @param $uids
1039
     * @return bool
1040
     */
1041
public static function getUserData($uids)
1042
{
1043
    global $xoopsDB, $xoopsUser, $xoopsUserIsAdmin;
1044
1045
    if ($uids <= 0) {
1046
        return false;
1047
    }
1048
    if ($uids > 0) {
1049
        $memberHandler = xoops_getHandler('member');
1050
        $user          = $memberHandler->getUser($uids);
1051
        if (!is_object($user)) {
1052
            return false;
1053
        }
1054
    }
1055
    $result = $xoopsDB->query('SELECT * FROM '
1056
                              . $xoopsDB->prefix('users')
1057
                              . " WHERE uid='$uids'");
1058
    if ($xoopsDB->getRowsNum($result) <= 0) {
1059
        return false;
1060
    }
1061
    $row = $xoopsDB->fetchArray($result);
1062
1063
    return $row;
1064
}
1065