Passed
Push — master ( 76b6cd...eff2d4 )
by Tomasz
07:37 queued 02:58
created
web/skins/classic/index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
 
61 61
 $deco = new \web\lib\admin\PageDecoration();
62 62
 ?>
63
-<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $Gui->skinObject->findResourceUrl("CSS","cat-user.css");?>" />
63
+<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $Gui->skinObject->findResourceUrl("CSS", "cat-user.css"); ?>" />
64 64
 <!-- JQuery -->
65
-<script type="text/javascript" src="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL","jquery/jquery.js") ?>"></script>
66
-<script type="text/javascript" src="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL","jquery/jquery-migrate.js") ?>"></script>
67
-<script type="text/javascript" src="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL","jquery/jquery-ui.js") ?>"></script>
65
+<script type="text/javascript" src="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL", "jquery/jquery.js") ?>"></script>
66
+<script type="text/javascript" src="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL", "jquery/jquery-migrate.js") ?>"></script>
67
+<script type="text/javascript" src="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL", "jquery/jquery-ui.js") ?>"></script>
68 68
 <!-- JQuery -->
69 69
 <script type="text/javascript">
70 70
     if (screen.width <= 480) {
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     <div id="heading">
107 107
         <?php
108 108
         print '<img src="' . $Gui->skinObject->findResourceUrl("IMAGES", "consortium_logo.png") . '" alt="Consortium Logo" style="float:right; padding-right:20px; padding-top:20px"/>';
109
-        print '<div id="motd">' . ( isset(CONFIG['APPEARANCE']['MOTD']) ? CONFIG['APPEARANCE']['MOTD'] : '&nbsp' ) . '</div>';
109
+        print '<div id="motd">' . (isset(CONFIG['APPEARANCE']['MOTD']) ? CONFIG['APPEARANCE']['MOTD'] : '&nbsp') . '</div>';
110 110
         print '<h1 style="padding-bottom:0px; height:1em;">' . sprintf(_("Welcome to %s"), CONFIG['APPEARANCE']['productname']) . '</h1>
111 111
 <h2 style="padding-bottom:0px; height:0px; vertical-align:bottom;">' . CONFIG['APPEARANCE']['productname_long'] . '</h2>';
112 112
         echo '<table id="lang_select"><tr><td>';
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                                             <span id="line1"><?php printf(_("%s installation made easy:"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) ?></span>
161 161
                                             <span id="line2"></span>
162 162
                                             <span id="line3"></span>
163
-                                            <span id="line4"><?php echo sprintf(_("Custom built for your %s"),$Gui->nomenclature_inst) ?></span>
163
+                                            <span id="line4"><?php echo sprintf(_("Custom built for your %s"), $Gui->nomenclature_inst) ?></span>
164 164
                                             <span id="line5">
165 165
                                                 <?php
166 166
                                                 if (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) && CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'] != "") {
Please login to merge, or discard this patch.
web/skins/modern/test.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
          <?php if (empty($_REQUEST['idp'])) { ?>
82 82
               <div id="front_page">
83 83
                   <?php
84
-                         echo $divs->div_top_welcome();
84
+                            echo $divs->div_top_welcome();
85 85
 //                         echo $divs->div_roller();
86 86
 //                         echo $divs->div_main_button(); ?>
87 87
               </div> <!-- id="front_page" -->
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 ?>
19 19
 
20 20
 <!-- JQuery -->
21
-<script type="text/javascript" src="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL","jquery/jquery.js") ?>"></script>
22
-<script type="text/javascript" src="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL","jquery/jquery-migrate-1.2.1.js") ?>"></script>
23
-<script type="text/javascript" src="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL","jquery/jquery-ui.js") ?>"></script>
21
+<script type="text/javascript" src="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL", "jquery/jquery.js") ?>"></script>
22
+<script type="text/javascript" src="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL", "jquery/jquery-migrate-1.2.1.js") ?>"></script>
23
+<script type="text/javascript" src="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL", "jquery/jquery-ui.js") ?>"></script>
24 24
 <!-- JQuery -->
25 25
 
26 26
 <script type="text/javascript">
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 include("user/js/cat_js.php");
49 49
 ?>
50 50
     var loading_ico = new Image();
51
-    loading_ico.src = "<?php echo $Gui->skinObject->findResourceUrl("IMAGES","icons/loading51.gif")?>";
51
+    loading_ico.src = "<?php echo $Gui->skinObject->findResourceUrl("IMAGES", "icons/loading51.gif")?>";
52 52
 </script>
53 53
 <?php $Gui->langObject->setTextDomain("web_user"); ?>
54 54
 <!-- DiscoJuice -->
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
     front_page = 0;
58 58
     var lang = "<?php echo($Gui->langObject->getLang()) ?>";
59 59
 </script>
60
-<link rel="stylesheet" type="text/css" href="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL","discojuice/css/discojuice.css")?>" />
60
+<link rel="stylesheet" type="text/css" href="<?php echo $Gui->skinObject->findResourceUrl("EXTERNAL", "discojuice/css/discojuice.css")?>" />
61 61
 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
62
-<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $Gui->skinObject->findResourceUrl("CSS","cat-user.css");?>" />
62
+<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $Gui->skinObject->findResourceUrl("CSS", "cat-user.css"); ?>" />
63 63
 </head>
64 64
 <body>
65 65
 <div id="wrap">
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
     <?php echo $divs->div_heading($visibility); ?>
68 68
     <div id="main_page">
69 69
         <div id="loading_ico">
70
-          <?php echo _("Authenticating") . "..." ?><br><img src="<?php echo $Gui->skinObject->findResourceUrl("IMAGES","icons/loading51.gif")?>" alt="Authenticating ..."/>
70
+          <?php echo _("Authenticating") . "..." ?><br><img src="<?php echo $Gui->skinObject->findResourceUrl("IMAGES", "icons/loading51.gif")?>" alt="Authenticating ..."/>
71 71
         </div>
72 72
         <div id="info_overlay"> <!-- device info -->
73 73
             <div id="info_window"></div>
74
-            <img id="info_menu_close" class="close_button" src="<?php echo $Gui->skinObject->findResourceUrl("IMAGES","icons/button_cancel.png")?>" ALT="Close"/>
74
+            <img id="info_menu_close" class="close_button" src="<?php echo $Gui->skinObject->findResourceUrl("IMAGES", "icons/button_cancel.png")?>" ALT="Close"/>
75 75
         </div>
76 76
         <div id="main_menu_info" style="display:none"> <!-- stuff triggered form main menu -->
77
-          <img id="main_menu_close" class="close_button" src="<?php echo $Gui->skinObject->findResourceUrl("IMAGES","icons/button_cancel.png")?>" ALT="Close"/>
77
+          <img id="main_menu_close" class="close_button" src="<?php echo $Gui->skinObject->findResourceUrl("IMAGES", "icons/button_cancel.png")?>" ALT="Close"/>
78 78
           <div id="main_menu_content"></div>
79 79
         </div>
80 80
         <div id="main_body">
Please login to merge, or discard this patch.
web/skins/modern/resources/css/cat-basic.css.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
    font-size:25px;
22 22
    font-size:5vw;
23 23
    width: 100%;
24
-   background: <?php echo $colour2;?>;
24
+   background: <?php echo $colour2; ?>;
25 25
    color: #ffffff;
26 26
 }
27 27
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
    font-size:25px;
49 49
    font-size:5vw;
50 50
    width: 100%;
51
-   background: <?php echo $colour2;?>;
51
+   background: <?php echo $colour2; ?>;
52 52
    color: #ffffff;
53 53
    border-radius:10px ; 
54 54
    border-radius:2vw ; 
Please login to merge, or discard this patch.
core/DBConnection.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         if ($types == NULL) {
84 84
             $result = $this->connection->query($querystring);
85 85
             if ($result === FALSE) {
86
-                throw new Exception("DB: Unable to execute simple statement! Error was --> ". $this->connection->error ." <--");
86
+                throw new Exception("DB: Unable to execute simple statement! Error was --> " . $this->connection->error . " <--");
87 87
             }
88 88
         } else {
89 89
             // fancy! prepared statement with dedicated argument list
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             }
97 97
             $prepResult = $statementObject->prepare($querystring);
98 98
             if ($prepResult === FALSE) {
99
-                throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> ". $statementObject->error ." <--.");
99
+                throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> " . $statementObject->error . " <--.");
100 100
             }
101 101
 
102 102
             // we have a variable number of arguments packed into the ... array
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
             array_unshift($localArray, $types);
109 109
             $retval = call_user_func_array([$statementObject, "bind_param"], $localArray);
110 110
             if ($retval === FALSE) {
111
-                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> ". var_export($localArray, TRUE) ." <--. Error was --> ". $statementObject->error ." <--");
111
+                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> " . var_export($localArray, TRUE) . " <--. Error was --> " . $statementObject->error . " <--");
112 112
             }
113 113
             $result = $statementObject->execute();
114 114
             if ($result === FALSE) {
115
-                throw new Exception("DB: Unable to execute prepared statement! Error was --> ". $statementObject->error ." <--");
115
+                throw new Exception("DB: Unable to execute prepared statement! Error was --> " . $statementObject->error . " <--");
116 116
             }
117 117
             $selectResult = $statementObject->get_result();
118 118
             if ($selectResult !== FALSE) {
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         }
124 124
 
125 125
         if ($result === FALSE && $this->connection->errno) {
126
-            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was ".$this->connection->errno."!");
126
+            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was " . $this->connection->errno . "!");
127 127
         }
128 128
 
129 129
         // log exact query to audit log, if it's not a SELECT
Please login to merge, or discard this patch.
core/CAT.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
         $dummy_inst2 = _("organisation");
138 138
         $dummy_inst3 = _("Identity Provider");
139 139
         // and do something useless with the strings so that there's no "unused" complaint
140
-        if (strlen($dummy_NRO . $dummy_inst1 . $dummy_inst2 . $dummy_inst3) < 0 ) {
140
+        if (strlen($dummy_NRO . $dummy_inst1 . $dummy_inst2 . $dummy_inst3) < 0) {
141 141
             throw new \Exception("Strings are usually not shorter than 0 characters. We've encountered a string blackhole.");
142 142
         }
143 143
 
Please login to merge, or discard this patch.
core/IdP.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $this->entityOptionTable = "institution_option";
64 64
         $this->entityIdColumn = "institution_id";
65 65
         if (!is_numeric($instId)) {
66
-            throw new Exception("An ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_inst']." is identified by an integer index!");
66
+            throw new Exception("An " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_inst'] . " is identified by an integer index!");
67 67
         }
68 68
         $this->identifier = (int) $instId;
69 69
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
             $alreadyUsed = $this->databaseHandle->exec("SELECT DISTINCT external_db_id FROM institution WHERE external_db_id = ? AND external_db_syncstate = ?", "si", $identifier, $syncState);
324 324
             // SELECT -> resource, not boolean
325 325
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $alreadyUsed) == 0) {
326
-                $this->databaseHandle->exec("UPDATE institution SET external_db_id = ?, external_db_syncstate = ? WHERE inst_id = ?", "sii", $identifier, $syncState, $this->identifier );
326
+                $this->databaseHandle->exec("UPDATE institution SET external_db_id = ?, external_db_syncstate = ? WHERE inst_id = ?", "sii", $identifier, $syncState, $this->identifier);
327 327
             }
328 328
         }
329 329
     }
Please login to merge, or discard this patch.
core/common/Logging.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 namespace core\common;
12 12
 use \Exception;
13 13
 
14
-require_once(dirname(dirname(__DIR__))."/config/_config.php");
14
+require_once(dirname(dirname(__DIR__)) . "/config/_config.php");
15 15
 
16 16
 class Logging {
17 17
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 echo " ($category) ";
87 87
                 echo " " . $user . ": ";
88 88
                 if (is_string($message)) {
89
-                    echo $message ."\n";
89
+                    echo $message . "\n";
90 90
                 } else {
91 91
                     var_export($message);
92 92
                 }
Please login to merge, or discard this patch.
core/ProfileRADIUS.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                 "row" => $attributeQuery->row,
177 177
                 "flag" => $optinfo['flag'],
178 178
                 "device" => ($devicesOrEAPMethods == "DEVICES" ? $attributeQuery->deviceormethod : NULL),
179
-                "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep() )];
179
+                "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep())];
180 180
         }
181 181
         return $temparray;
182 182
     }
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
      */
277 277
     public function setRealmCheckUser($shallwe, $localpart = NULL) {
278 278
         $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = " . ($shallwe === true ? "1" : "0") .
279
-                ( $localpart !== NULL ? ", checkuser_value = '$localpart' " : "") .
279
+                ($localpart !== NULL ? ", checkuser_value = '$localpart' " : "") .
280 280
                 " WHERE profile_id = $this->identifier");
281 281
     }
282 282
 
Please login to merge, or discard this patch.
core/ProfileSilverbullet.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 // realm is automatically calculated, then stored in DB
101 101
 
102 102
         $this->realm = "opaquehash@$myInst->identifier-$this->identifier." . strtolower($myInst->federation) . CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix'];
103
-        $this->setRealm($myInst->identifier."-".$this->identifier."." . strtolower($myInst->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
103
+        $this->setRealm($myInst->identifier . "-" . $this->identifier . "." . strtolower($myInst->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
104 104
         $localValueIfAny = "";
105 105
 
106 106
 // but there's some common internal attributes populated directly
@@ -176,11 +176,11 @@  discard block
 block discarded – undo
176 176
     public function invitationMailBody($invitationLink) {
177 177
         $text = _("Hello!");
178 178
         $text .= "\n\n";
179
-        $text .= sprintf(_("A new %s access credential has been created for you by your network administrator."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
179
+        $text .= sprintf(_("A new %s access credential has been created for you by your network administrator."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
180 180
         $text .= " ";
181 181
         $text .= sprintf(_("Please follow the following link with the device you want to enable for %s to get a custom %s installation program just for you. You can click on the link, copy and paste it into a browser or scan the attached QR code."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
182 182
         $text .= "\n\n$invitationLink\n\n"; // gets replaced with the token value by getBody()
183
-        $text .= sprintf(_("Please keep this email or bookmark this link for future use. After picking up your %s installation program, you can use the same link to get status information about your %s account."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
183
+        $text .= sprintf(_("Please keep this email or bookmark this link for future use. After picking up your %s installation program, you can use the same link to get status information about your %s account."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
184 184
         $text .= "\n\n";
185 185
         $text .= _("Regards,");
186 186
         $text .= "\n\n";
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
                 $indexStatement = "$certstatus\t$expiryIndexTxt\t" . ($certstatus == "R" ? "$nowIndexTxt,unspecified" : "") . "\t$serialHex\tunknown\t/O=" . CONFIG_CONFASSISTANT['CONSORTIUM']['name'] . "/OU=$federation/CN=$cn/emailAddress=$cn\n";
465 465
                 $logHandle->debug(4, "index.txt contents-to-be: $indexStatement");
466 466
                 if (!file_put_contents($tempdir . "/index.txt", $indexStatement)) {
467
-                $logHandle->debug(1,"Unable to write openssl index.txt file for revocation handling!");
467
+                $logHandle->debug(1, "Unable to write openssl index.txt file for revocation handling!");
468 468
                 }
469 469
                 // index.txt.attr is dull but needs to exist
470 470
                 file_put_contents($tempdir . "/index.txt.attr", "unique_subject = yes\n");
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
         if ($invitationsResult->num_rows == 0) {
575 575
             $loggerInstance->debug(2, "Token  $tokenvalue not found in database or database query error!\n");
576 576
             return ["status" => self::SB_TOKENSTATUS_INVALID,
577
-                "cert_status" => [],];
577
+                "cert_status" => [], ];
578 578
         }
579 579
         // if not returned, we found the token in the DB
580 580
         $invitationRow = mysqli_fetch_object(/** @scrutinizer ignore-type */ $invitationsResult);
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
                 throw new Exception("Impossible: the string ends with '/admin' but it's not possible to cut six characters from the end?!");
745 745
             }
746 746
         }
747
-        $link .= '/accountstatus/accountstatus.php?token='.$token;
747
+        $link .= '/accountstatus/accountstatus.php?token=' . $token;
748 748
         return $link;
749 749
     }
750 750
 
Please login to merge, or discard this patch.
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -56,6 +56,9 @@  discard block
 block discarded – undo
56 56
 
57 57
     const PRODUCTNAME = "Managed IdP";
58 58
 
59
+    /**
60
+     * @param integer $length
61
+     */
59 62
     public static function randomString(
60 63
     $length, $keyspace = '23456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
61 64
     ) {
@@ -238,6 +241,7 @@  discard block
 block discarded – undo
238 241
     /**
239 242
      * create a CSR
240 243
      * 
244
+     * @param resource $privateKey
241 245
      * @return 
242 246
      */
243 247
     private function generateCsr($privateKey) {
@@ -277,6 +281,7 @@  discard block
 block discarded – undo
277 281
      * take a CSR and sign it with our issuing CA's certificate
278 282
      * 
279 283
      * @param mixed $csr the CSR
284
+     * @param integer $expiryDays
280 285
      */
281 286
     private function signCsr($csr, $expiryDays) {
282 287
         switch (CONFIG_CONFASSISTANT['SILVERBULLET']['CA']['type']) {
Please login to merge, or discard this patch.