Test Failed
Push — master ( a13d19...6b96b9 )
by Tomasz
03:24
created
web/lib/admin/UIElements.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                         }
123 123
                         break;
124 124
                     case "boolean":
125
-                        $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off") ) . "</strong></td></tr>";
125
+                        $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off")) . "</strong></td></tr>";
126 126
                         break;
127 127
                     default:
128 128
                         $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>$content</strong></td></tr>";
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
         $details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']);
193 193
         $details['name'] = preg_replace('/\//', "", $details['name']);
194
-        $certstatus = ( $details['root'] == 1 ? "R" : "I");
194
+        $certstatus = ($details['root'] == 1 ? "R" : "I");
195 195
         if ($details['ca'] == 0 && $details['root'] != 1) {
196 196
             return "<div class='ca-summary' style='background-color:red'><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:maroon;  border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . _("This is a <strong>SERVER</strong> certificate!") . "<br/>" . $details['name'] . "</div>";
197 197
         }
Please login to merge, or discard this patch.
Doc Comments   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -120,6 +120,9 @@  discard block
 block discarded – undo
120 120
         return $find[0];
121 121
     }
122 122
 
123
+    /**
124
+     * @param string $input
125
+     */
123 126
     public function tooltip($input) {
124 127
         $descriptions = [];
125 128
         if (count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0) {
@@ -256,6 +259,10 @@  discard block
 block discarded – undo
256 259
         return $number . " B";
257 260
     }
258 261
 
262
+    /**
263
+     * @param string $ref
264
+     * @param boolean $checkpublic
265
+     */
259 266
     public static function getBlobFromDB($ref, $checkpublic) {
260 267
         $validator = new \web\lib\common\InputValidation();
261 268
         $reference = $validator->databaseReference($ref);
@@ -402,7 +409,7 @@  discard block
 block discarded – undo
402 409
      * @param string $text the text to display
403 410
      * @param string $caption the caption to display
404 411
      * @param bool $omittabletags the output usually has tr/td table tags, this option suppresses them
405
-     * @return type
412
+     * @return string
406 413
      */
407 414
     public function boxOkay(string $text = NULL, string $caption = NULL, bool $omittabletags = FALSE) {
408 415
         return $this->boxFlexible(\core\common\Entity::L_OK, $text, $caption, $omittabletags);
@@ -414,7 +421,7 @@  discard block
 block discarded – undo
414 421
      * @param string $text the text to display
415 422
      * @param string $caption the caption to display
416 423
      * @param bool $omittabletags the output usually has tr/td table tags, this option suppresses them
417
-     * @return type
424
+     * @return string
418 425
      */
419 426
     public function boxRemark(string $text = NULL, string $caption = NULL, bool $omittabletags = FALSE) {
420 427
         return $this->boxFlexible(\core\common\Entity::L_REMARK, $text, $caption, $omittabletags);
@@ -426,7 +433,7 @@  discard block
 block discarded – undo
426 433
      * @param string $text the text to display
427 434
      * @param string $caption the caption to display
428 435
      * @param bool $omittabletags the output usually has tr/td table tags, this option suppresses them
429
-     * @return type
436
+     * @return string
430 437
      */
431 438
     public function boxWarning(string $text = NULL, string $caption = NULL, bool $omittabletags = FALSE) {
432 439
         return $this->boxFlexible(\core\common\Entity::L_WARN, $text, $caption, $omittabletags);
@@ -438,7 +445,7 @@  discard block
 block discarded – undo
438 445
      * @param string $text the text to display
439 446
      * @param string $caption the caption to display
440 447
      * @param bool $omittabletags the output usually has tr/td table tags, this option suppresses them
441
-     * @return type
448
+     * @return string
442 449
      */
443 450
     public function boxError(string $text = NULL, string $caption = NULL, bool $omittabletags = FALSE) {
444 451
         return $this->boxFlexible(\core\common\Entity::L_ERROR, $text, $caption, $omittabletags);
Please login to merge, or discard this patch.
web/admin/inc/manageAdmins.inc.php 2 patches
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -97,14 +97,14 @@
 block discarded – undo
97 97
         case "SUCCESS":
98 98
             $cryptText = "";
99 99
             switch ($_GET['transportsecurity']) {
100
-            case "ENCRYPTED":
101
-                $cryptText = _("and <b>encrypted</b> to the mail domain");
102
-                break;
103
-            case "CLEAR":
104
-                $cryptText = _("but <b>in clear text</b> to the mail domain");
105
-                break;
106
-            default:
107
-                throw new Exception("Error: unknown encryption status of invitation!?!");
100
+                case "ENCRYPTED":
101
+                    $cryptText = _("and <b>encrypted</b> to the mail domain");
102
+                    break;
103
+                case "CLEAR":
104
+                    $cryptText = _("but <b>in clear text</b> to the mail domain");
105
+                    break;
106
+                default:
107
+                    throw new Exception("Error: unknown encryption status of invitation!?!");
108 108
             }
109 109
             echo $uiElements->boxRemark(sprintf(_("The invitation email was sent successfully %s."), $cryptText), _("The invitation email was sent."));
110 110
             break;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             $ownermgmt = new \core\UserManagement();
80 80
             $ownermgmt->addAdminToIdp($my_inst, $_SESSION['user']);
81 81
         } else {
82
-            echo "Fatal Error: you wanted to take control over an ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'].", but are not a ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation']." operator!";
82
+            echo "Fatal Error: you wanted to take control over an " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . ", but are not a " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation'] . " operator!";
83 83
             exit(1);
84 84
         }
85 85
     }
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
 
123 123
 if ($isFedAdmin) {
124 124
     echo "<div class='ca-summary' style='position:relative;'><table>";
125
-    echo $uiElements->boxRemark(sprintf(_("You are the %s administrator of this %s. You can invite new administrators, who can in turn appoint further administrators on their own."),$uiElements->nomenclature_fed, $uiElements->nomenclature_inst), sprintf(_("%s Administrator"),$uiElements->nomenclature_fed));
125
+    echo $uiElements->boxRemark(sprintf(_("You are the %s administrator of this %s. You can invite new administrators, who can in turn appoint further administrators on their own."), $uiElements->nomenclature_fed, $uiElements->nomenclature_inst), sprintf(_("%s Administrator"), $uiElements->nomenclature_fed));
126 126
     echo "</table></div>";
127 127
 }
128 128
 
129 129
 if (!$isFedAdmin && $is_admin_with_blessing) {
130 130
     echo "<div class='ca-summary' style='position:relative;'><table>";
131
-    echo $uiElements->boxRemark(sprintf(_("You are an administrator of this %s, and were directly appointed by the %s administrator. You can appoint further administrators, but these can't in turn appoint any more administrators."),$uiElements->nomenclature_inst ,$uiElements->nomenclature_fed), _("Directly Appointed IdP Administrator"));
131
+    echo $uiElements->boxRemark(sprintf(_("You are an administrator of this %s, and were directly appointed by the %s administrator. You can appoint further administrators, but these can't in turn appoint any more administrators."), $uiElements->nomenclature_inst, $uiElements->nomenclature_fed), _("Directly Appointed IdP Administrator"));
132 132
     echo "</table></div>";
133 133
 }
134 134
 ?>
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
         echo "</td>
158 158
               <td>
159
-                <form action='inc/manageAdmins.inc.php?inst_id=" . $my_inst->identifier . "' method='post' " . ( $oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : "" ) . " accept-charset='UTF-8'>
159
+                <form action='inc/manageAdmins.inc.php?inst_id=" . $my_inst->identifier . "' method='post' " . ($oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : "") . " accept-charset='UTF-8'>
160 160
                 <input type='hidden' name='admin_id' value='" . $oneowner['ID'] . "'></input>
161 161
                 <button type='submit' name='submitbutton' class='delete' value='" . web\lib\admin\FormElements::BUTTON_DELETE . "'>" . _("Delete Administrator") . "</button>
162 162
                 </form>
Please login to merge, or discard this patch.
web/lib/admin/view/TabbedElementInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * @author Zilvinas Vaira
7 7
  *
8 8
  */
9
-interface TabbedElementInterface extends PageElementInterface{
9
+interface TabbedElementInterface extends PageElementInterface {
10 10
     
11 11
     /**
12 12
      * @return boolean
Please login to merge, or discard this patch.
web/lib/admin/view/TabbedPanelsBox.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @author Zilvinas Vaira
11 11
  *
12 12
  */
13
-class TabbedPanelsBox implements PageElementInterface{
13
+class TabbedPanelsBox implements PageElementInterface {
14 14
 
15 15
     /**
16 16
      * 
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
      * @param integer $index
42 42
      * @return string
43 43
      */
44
-    private function composeTabId($index){
45
-        return PageElementInterface::TABS_CLASS.'-'.($index+1);
44
+    private function composeTabId($index) {
45
+        return PageElementInterface::TABS_CLASS . '-' . ($index + 1);
46 46
     }
47 47
     
48 48
     /**
@@ -50,15 +50,15 @@  discard block
 block discarded – undo
50 50
      * @param string $title
51 51
      * @param TabbedElementInterface $element
52 52
      */
53
-    public function addTabbedPanel($title, $element){
53
+    public function addTabbedPanel($title, $element) {
54 54
         $li = new CompositeTag('li');
55 55
         $a = new Tag('a');
56
-        $a->addAttribute('href', '#'.$this->composeTabId($this->index));
56
+        $a->addAttribute('href', '#' . $this->composeTabId($this->index));
57 57
         $a->addText($title);
58 58
         $li->addTag($a);
59 59
         $this->titles [$this->index] = $li;
60 60
         $this->elements [$this->index] = $element;
61
-        if($element->isActive()){
61
+        if ($element->isActive()) {
62 62
             $this->active = $this->index;
63 63
         }
64 64
         $this->index++;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      * {@inheritDoc}
70 70
      * @see \web\lib\admin\view\PageElementInterface::render()
71 71
      */
72
-    public function render(){
72
+    public function render() {
73 73
         ?>
74 74
         <div id="<?php echo PageElementInterface::TABS_CLASS; ?>" active="<?php echo $this->active; ?>">
75 75
             <ul>
Please login to merge, or discard this patch.
web/lib/admin/http/AddUsersCommand.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
                     $userCount++;
33 33
                 }
34 34
             }else{
35
-                 $this->storeErrorMessage(sprintf(_('Username or expiry date missing for %s record!'), $userCount + 1));
35
+                    $this->storeErrorMessage(sprintf(_('Username or expiry date missing for %s record!'), $userCount + 1));
36 36
             }
37 37
         }
38 38
         if($userCount>0){
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @author Zilvinas Vaira
9 9
  *
10 10
  */
11
-class AddUsersCommand extends AbstractInvokerCommand{
11
+class AddUsersCommand extends AbstractInvokerCommand {
12 12
 
13 13
     const COMMAND = 'newusers';
14 14
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      * @param string $commandToken
24 24
      * @param SilverbulletContext $context
25 25
      */
26
-    public function __construct($commandToken, $context){
26
+    public function __construct($commandToken, $context) {
27 27
         parent::__construct($commandToken, $context);
28 28
         $this->context = $context;
29 29
     }
@@ -33,27 +33,27 @@  discard block
 block discarded – undo
33 33
      * {@inheritDoc}
34 34
      * @see \web\lib\admin\http\AbstractCommand::execute()
35 35
      */
36
-    public function execute(){
36
+    public function execute() {
37 37
         $parser = new CSVParser($_FILES[self::COMMAND], "\n", ',');
38
-        if(!$parser->isValid()){
38
+        if (!$parser->isValid()) {
39 39
             $this->storeErrorMessage(_('File either is empty or is not CSV file!'));
40 40
         }
41 41
         $userCount = 0;
42 42
         $invitationsCount = 0;
43
-        while($parser->hasMoreRows()){
43
+        while ($parser->hasMoreRows()) {
44 44
             $row = $parser->nextRow();
45
-            if(isset($row[0]) && isset($row[1])){
45
+            if (isset($row[0]) && isset($row[1])) {
46 46
                 $user = $this->context->createUser($row[0], $row[1], $this);
47 47
                 $max = empty($row[2]) ? 1 : intval($row[2]);
48
-                if(!empty($user->getIdentifier())){
48
+                if (!empty($user->getIdentifier())) {
49 49
                     $this->context->createInvitation($user, $this, $max);
50 50
                     $userCount++;
51 51
                 }
52
-            }else{
52
+            } else {
53 53
                  $this->storeErrorMessage(sprintf(_('Username or expiry date missing for %s record!'), $userCount + 1));
54 54
             }
55 55
         }
56
-        if($userCount>0){
56
+        if ($userCount > 0) {
57 57
             $this->storeInfoMessage(sprintf(_('%s total users were imported and %s invitations created!'), $userCount, $invitationsCount));
58 58
         }
59 59
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
                     $this->context->createInvitation($user, $this, $max);
50 50
                     $userCount++;
51 51
                 }
52
-            }else{
52
+            } else{
53 53
                  $this->storeErrorMessage(sprintf(_('Username or expiry date missing for %s record!'), $userCount + 1));
54 54
             }
55 55
         }
Please login to merge, or discard this patch.
web/lib/admin/view/AbstractForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @author Zilvinas Vaira
7 7
  *
8 8
  */
9
-abstract class AbstractForm implements TabbedElementInterface{
9
+abstract class AbstractForm implements TabbedElementInterface {
10 10
     
11 11
     /**
12 12
      * @var string
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      *
41 41
      * @return boolean
42 42
      */
43
-    public function isActive(){
43
+    public function isActive() {
44 44
         return $this->messageBox->hasMessages();
45 45
     }
46 46
 }
Please login to merge, or discard this patch.
web/lib/admin/view/AddNewUserForm.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @author Zilvinas Vaira
10 10
  *
11 11
  */
12
-class AddNewUserForm extends AbstractForm{
12
+class AddNewUserForm extends AbstractForm {
13 13
     
14 14
     const ADDNEWUSER_CLASS = 'sb-add-new-user';
15 15
     
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
      * {@inheritDoc}
29 29
      * @see \web\lib\admin\view\PageElementInterface::render()
30 30
      */
31
-    public function render(){
31
+    public function render() {
32 32
         ?>
33
-        <form method="post" action="<?php echo $this->action;?>" accept-charset="utf-8">
33
+        <form method="post" action="<?php echo $this->action; ?>" accept-charset="utf-8">
34 34
             <div class="<?php echo self::ADDNEWUSER_CLASS; ?>">
35
-                <?php $this->messageBox->render();?>
35
+                <?php $this->messageBox->render(); ?>
36 36
                 <label for="<?php echo AddUserCommand::PARAM_NAME; ?>"><?php echo $this->description; ?></label>
37 37
                 <div style="margin: 5px 0px 10px 0px;">
38 38
                     <input type="text" name="<?php echo AddUserCommand::PARAM_NAME; ?>">
Please login to merge, or discard this patch.
core/User.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                 }
185 185
                 $lookFor .= "$name";
186 186
             }
187
-            $finding = preg_match("/^(".$lookFor."):(.*)/", $oneRow->user_id, $matches);
187
+            $finding = preg_match("/^(" . $lookFor . "):(.*)/", $oneRow->user_id, $matches);
188 188
             if ($finding === 0 || $finding === FALSE) {
189 189
                 return FALSE;
190 190
             }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                 case $providerStrings[3]:
207 207
                 case $providerStrings[4]:
208 208
                 case $providerStrings[5]:
209
-                    if (!in_array(User::PROVIDER_STRINGS[$matches[1]],$listOfProviders)) {
209
+                    if (!in_array(User::PROVIDER_STRINGS[$matches[1]], $listOfProviders)) {
210 210
                         $listOfProviders[] = User::PROVIDER_STRINGS[$matches[1]];
211 211
                     }
212 212
                     break;
Please login to merge, or discard this patch.
web/lib/common/InputValidation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@
 block discarded – undo
134 134
      */
135 135
     public function string($input, $allowWhitespace = FALSE) {
136 136
     // always chop out invalid characters, and surrounding whitespace
137
-    $retvalStep0 =  iconv("UTF-8", "UTF-8//TRANSLIT", $input);
137
+    $retvalStep0 = iconv("UTF-8", "UTF-8//TRANSLIT", $input);
138 138
     if ($retvalStep0 === FALSE) {
139 139
         throw new Exception("iconv failure for string sanitisation. With TRANSLIT, this should never happen!");
140 140
     }
Please login to merge, or discard this patch.