Code Duplication    Length = 8-8 lines in 2 locations

main/auth/cas/lib/CAS/client.php 2 locations

@@ 1437-1444 (lines=8) @@
1434
                        $text_response);
1435
                }
1436
                // insure that tag name is 'serviceResponse'
1437
                if ($tree_response->node_name() != 'serviceResponse') {
1438
                    phpCAS::trace('bad XML root node (should be `serviceResponse\' instead of `' . $tree_response->node_name() . '\'');
1439
                    $this->authError('ST not validated',
1440
                        $validate_url,
1441
                        false/*$no_response*/,
1442
                        true/*$bad_response*/,
1443
                        $text_response);
1444
                }
1445
                if (sizeof($success_elements = $tree_response->get_elements_by_tagname("authenticationSuccess")) != 0) {
1446
                    // authentication succeded, extract the user name
1447
                    if (sizeof($user_elements = $success_elements[0]->get_elements_by_tagname("user")) == 0) {
@@ 1546-1553 (lines=8) @@
1543
                        $text_response);
1544
                }
1545
                // insure that tag name is 'Envelope'
1546
                if ($tree_response->node_name() != 'Envelope') {
1547
                    phpCAS::trace('bad XML root node (should be `Envelope\' instead of `' . $tree_response->node_name() . '\'');
1548
                    $this->authError('SA not validated',
1549
                        $validate_url,
1550
                        false/*$no_response*/,
1551
                        true/*$bad_response*/,
1552
                        $text_response);
1553
                }
1554
                // check for the NameIdentifier tag in the SAML response
1555
                if (sizeof($success_elements = $tree_response->get_elements_by_tagname("NameIdentifier")) != 0) {
1556
                    phpCAS::trace('NameIdentifier found');