Completed
Push — master ( f19613...bc8e7d )
by Stefan
06:53
created

footer.php ➔ footer()   B

Complexity

Conditions 6
Paths 4

Size

Total Lines 44
Code Lines 27

Duplication

Lines 5
Ratio 11.36 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 6
eloc 27
c 1
b 0
f 0
nc 4
nop 0
dl 5
loc 44
rs 8.439
1
<?php
2
/* * *********************************************************************************
3
 * (c) 2011-15 GÉANT on behalf of the GN3, GN3plus and GN4 consortia
4
 * License: see the LICENSE file in the root directory
5
 * ********************************************************************************* */
6
?>
7
<?php
8
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php");
9
require_once(dirname(dirname(dirname(__FILE__))) . "/admin/inc/input_validation.inc.php");
10
require_once("CAT.php");
11
12
function footer() {
13
    echo "</div><!-- trick -->
14
          </div><!-- pagecontent -->";
15
    ?>
16
    <div class='footer'>
17
        <hr />
18
        <table style='width:100%'>
19
            <tr>
20
                <td style='padding-left:20px; padding-right:20px; text-align:left; vertical-align:top;'>
21
                    <?php
22
                    echo Config::$APPEARANCE['productname'] . " - " . CAT::$VERSION;
23
                    ?>
24
                    "&nbsp;&copy; 2011-15 G&Eacute;ANT on behalf of the GN3, GN3plus, GN4 consortia and others <a href='copyright.php'>Full Copyright and Licenses</a>
25
                </td>
26
                <td style='padding-left:80px; padding-right:20px; text-align:right; vertical-align:top;'>
27
                    <?php
28
                    if (Config::$CONSORTIUM['name'] == "eduroam" && isset(Config::$CONSORTIUM['deployment-voodoo']) && Config::$CONSORTIUM['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
29
                        $logoBase = valid_host($_SERVER['HTTP_HOST']);
30
                        if ($logoBase === FALSE) {
31
                            throw new Exception("We don't know our own hostname?!");
32
                        }
33 View Code Duplication
                        if (strpos($_SERVER['PHP_SELF'], "admin/") === FALSE) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
34
                            $logoBase .= substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], "/")) . "/resources/images";
35
                        } else {
36
                            $logoBase .= substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], "/admin/")) . "/resources/images";
37
                        }
38
                        $logoBase = "//" . $logoBase;
39
40
                        echo "<span id='logos' style='position:fixed; left:50%;'><img src='$logoBase/dante.png' alt='DANTE' style='height:23px;width:47px'/>
41
              <img src='$logoBase/eu.png' alt='EU' style='height:23px;width:27px;border-width:0px;'/></span>
42
              <span id='eu_text' style='text-align:right;'><a href='http://ec.europa.eu/dgs/connect/index_en.htm' style='text-decoration:none; vertical-align:top;'>European Commission Communications Networks, Content and Technology</a></span>";
43
                    } else {
44
                        echo "&nbsp;";
45
                    }
46
                    ?>
47
                </td>
48
            </tr>
49
        </table>
50
    </div><!-- footer -->
51
    <?php echo "</div><!-- maincontent -->"; // was opened in header ?>
52
    </body>
53
    </html>
54
    <?php
55
}
56