Code Duplication    Length = 10-11 lines in 2 locations

locallib.php 2 locations

@@ 1082-1092 (lines=11) @@
1079
            $file = reset($files);
1080
            unset($files);
1081
            $pnoncevalue = null;
1082
            if (!is_null($id)) {
1083
                // Create the nonce component for granting a temporary public access.
1084
                $cache = cache::make_from_params(
1085
                    cache_store::MODE_APPLICATION,
1086
                    'mod_bigbluebuttonbn',
1087
                    'presentationdefault_cache'
1088
                );
1089
                $pnoncekey = sha1(context_system::instance()->id);
1090
                /* The item id was adapted for granting public access to the presentation once in order
1091
                 * to allow BigBlueButton to gather the file. */
1092
                $pnoncevalue = bigbluebuttonbn_generate_nonce();
1093
                $cache->set($pnoncekey, array('value' => $pnoncevalue, 'counter' => 0));
1094
            }
1095
@@ 1125-1134 (lines=10) @@
1122
    $file = reset($files);
1123
    unset($files);
1124
    $pnoncevalue = null;
1125
    if (!is_null($id)) {
1126
        // Create the nonce component for granting a temporary public access.
1127
        $cache = cache::make_from_params(
1128
            cache_store::MODE_APPLICATION,
1129
            'mod_bigbluebuttonbn',
1130
            'presentation_cache'
1131
        );
1132
        $pnoncekey = sha1($id);
1133
        /* The item id was adapted for granting public access to the presentation once in order
1134
         * to allow BigBlueButton to gather the file. */
1135
        $pnoncevalue = bigbluebuttonbn_generate_nonce();
1136
        $cache->set($pnoncekey, array('value' => $pnoncevalue, 'counter' => 0));
1137
    }