Code Duplication    Length = 19-20 lines in 2 locations

htdocs/lib2/logic/cachelog.class.php 2 locations

@@ 46-65 (lines=20) @@
43
        return new self($logid);
44
    }
45
46
    public static function createNew($nCacheId, $nUserId)
47
    {
48
        global $opt;
49
50
        // check if user is allowed to log this cache!
51
        $cache = new cache($nCacheId);
52
        if ($cache->exist() == false) {
53
            return false;
54
        }
55
        if ($cache->allowLog() == false) {
56
            return false;
57
        }
58
59
        $oCacheLog = new self(ID_NEW);
60
        $oCacheLog->setUserId($nUserId);
61
        $oCacheLog->setCacheId($nCacheId);
62
        $oCacheLog->setNode($opt['logic']['node']['id']);
63
64
        return $oCacheLog;
65
    }
66
67
    public static function createNewFromCache($oCache, $nUserId)
68
    {
@@ 67-85 (lines=19) @@
64
        return $oCacheLog;
65
    }
66
67
    public static function createNewFromCache($oCache, $nUserId)
68
    {
69
        global $opt;
70
71
        // check if user is allowed to log this cache!
72
        if ($oCache->exist() == false) {
73
            return false;
74
        }
75
        if ($oCache->allowLog() == false) {
76
            return false;
77
        }
78
79
        $oCacheLog = new self(ID_NEW);
80
        $oCacheLog->setUserId($nUserId);
81
        $oCacheLog->setCacheId($oCache->getCacheId());
82
        $oCacheLog->setNode($opt['logic']['node']['id']);
83
84
        return $oCacheLog;
85
    }
86
87
    public function __construct($nNewLogId = ID_NEW)
88
    {