Code Duplication    Length = 10-11 lines in 2 locations

locallib.php 2 locations

@@ 1053-1063 (lines=11) @@
1050
            $file = reset($files);
1051
            unset($files);
1052
            $pnoncevalue = null;
1053
            if (!is_null($id)) {
1054
                // Create the nonce component for granting a temporary public access.
1055
                $cache = cache::make_from_params(
1056
                    cache_store::MODE_APPLICATION,
1057
                    'mod_bigbluebuttonbn',
1058
                    'presentationdefault_cache'
1059
                );
1060
                $pnoncekey = sha1(context_system::instance()->id);
1061
                /* The item id was adapted for granting public access to the presentation once in order
1062
                 * to allow BigBlueButton to gather the file. */
1063
                $pnoncevalue = bigbluebuttonbn_generate_nonce();
1064
                $cache->set($pnoncekey, array('value' => $pnoncevalue, 'counter' => 0));
1065
            }
1066
@@ 1096-1105 (lines=10) @@
1093
    $file = reset($files);
1094
    unset($files);
1095
    $pnoncevalue = null;
1096
    if (!is_null($id)) {
1097
        // Create the nonce component for granting a temporary public access.
1098
        $cache = cache::make_from_params(
1099
            cache_store::MODE_APPLICATION,
1100
            'mod_bigbluebuttonbn',
1101
            'presentation_cache'
1102
        );
1103
        $pnoncekey = sha1($id);
1104
        /* The item id was adapted for granting public access to the presentation once in order
1105
         * to allow BigBlueButton to gather the file. */
1106
        $pnoncevalue = bigbluebuttonbn_generate_nonce();
1107
        $cache->set($pnoncekey, array('value' => $pnoncevalue, 'counter' => 0));
1108
    }