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

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