Code Duplication    Length = 14-27 lines in 2 locations

htdocs/lib2/logic/cachelog.class.php 1 location

@@ 311-337 (lines=27) @@
308
        );
309
    }
310
311
    public function allowView()
312
    {
313
        global $login;
314
315
        $login->verify();
316
        $allow = sql_value(
317
            "SELECT `cache_status`.`allow_user_view`
318
             FROM `caches`
319
             INNER JOIN `cache_status`
320
                 ON `caches`.`status`=`cache_status`.`id`
321
             WHERE `caches`.`cache_id`='&1'",
322
            0,
323
            $this->getCacheId()
324
        );
325
        if ($allow == 1) {
326
            return true;
327
        } elseif ($login->userid == sql_value(
328
            "SELECT `user_id` FROM `caches` WHERE `cache_id`='&1'",
329
            0,
330
            $this->getCacheId()
331
        )) {
332
            return true;
333
        }
334
335
        return false;
336
    }
337
338
    public function allowEdit()
339
    {
340
        global $login;

htdocs/lib2/logic/picture.class.php 1 location

@@ 696-709 (lines=14) @@
693
        return substr($dp, 1);
694
    }
695
696
    public function allowEdit()
697
    {
698
        global $login;
699
700
        $login->verify();
701
702
        if (sql_value(
703
            "SELECT COUNT(*)
704
            FROM `caches`
705
            INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`
706
            WHERE (`cache_status`.`allow_user_view`=1 OR `caches`.`user_id`='&1')
707
            AND `caches`.`cache_id`='&2'",
708
            0,
709
            $login->userid,
710
            $this->getCacheId()
711
        ) == 0) {
712
            return false;