Code Duplication    Length = 19-19 lines in 2 locations

class/utility.php 1 location

@@ 315-333 (lines=19) @@
312
    /**
313
     * @return bool
314
     */
315
    public static function sf_moderator()
316
    {
317
        global $xoopsUser;
318
319
        if (!$xoopsUser) {
320
            $result = false;
321
        } else {
322
            $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq');
323
324
            $categories = $smartPermHandler->getPermissions('moderation');
325
            if (count($categories) == 0) {
326
                $result = false;
327
            } else {
328
                $result = true;
329
            }
330
        }
331
332
        return $result;
333
    }
334
335
    /**
336
     * @return string

include/functions.php 1 location

@@ 175-193 (lines=19) @@
172
/**
173
 * @return bool
174
 */
175
function sf_moderator()
176
{
177
    global $xoopsUser;
178
179
    if (!$xoopsUser) {
180
        $result = false;
181
    } else {
182
        $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq');
183
184
        $categories = $smartPermHandler->getPermissions('moderation');
185
        if (count($categories) == 0) {
186
            $result = false;
187
        } else {
188
            $result = true;
189
        }
190
    }
191
192
    return $result;
193
}
194
195
/**
196
 * @return string