Code Duplication    Length = 12-12 lines in 2 locations

src/projects/gperms.php 1 location

@@ 153-164 (lines=12) @@
150
151
$rs = dal_query('templates/list.sql', $pid, 'template_name');
152
153
while (($row = $rs->fetch()))
154
{
155
    $permissions = group_get_permissions($id, $row['template_id']);
156
157
    foreach ($gperms as $gperm)
158
    {
159
        $xml .= sprintf('%s["t%d"] = %s;',
160
                        $gperm[GPERMS_CONTROL],
161
                        $row['template_id'],
162
                        (($permissions & $gperm[GPERMS_PERMISSION]) == 0 ? 'false' : 'true'));
163
    }
164
}
165
166
// local JS functions
167

src/projects/tperms.php 1 location

@@ 176-187 (lines=12) @@
173
174
$rs = dal_query('groups/list.sql', $template['project_id'], 'is_global, group_name');
175
176
while (($row = $rs->fetch()))
177
{
178
    $permissions = group_get_permissions($row['group_id'], $id);
179
180
    foreach ($gperms as $gperm)
181
    {
182
        $xml .= sprintf('%s["g%d"] = %s;',
183
                        $gperm[GPERMS_CONTROL],
184
                        $row['group_id'],
185
                        (($permissions & $gperm[GPERMS_PERMISSION]) == 0 ? 'false' : 'true'));
186
    }
187
}
188
189
// local JS functions
190