Passed
Push — master ( 1b0b1a...3e2a55 )
by Tomasz
03:37
created
tests/unit/web/lib/admin/domain/SilverBulletUserTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 use web\lib\admin\domain\Attribute;
6 6
 use web\lib\admin\domain\SilverbulletInvitation;
7 7
 
8
-class SilverbulletUserTest extends PHPUnit_Framework_TestCase{
8
+class SilverbulletUserTest extends PHPUnit_Framework_TestCase {
9 9
     
10 10
     private $username = 'testusername';
11 11
     
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         $this->newUser->setExpiry('now');
27 27
     }
28 28
     
29
-    public function testNewUser(){
29
+    public function testNewUser() {
30 30
         $this->newUser->save();
31 31
         $this->assertNotEmpty($this->newUser->getIdentifier());
32 32
         
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $list = SilverbulletUser::getList($this->profileId);
51 51
         $found = false;
52 52
         foreach ($list as $user) {
53
-            if($user->getIdentifier() == $this->newUser->getIdentifier()){
53
+            if ($user->getIdentifier() == $this->newUser->getIdentifier()) {
54 54
                 $found = true;
55 55
                 break;
56 56
             }
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
         $this->assertTrue($result);
62 62
     }
63 63
     
64
-    public function testInactiveUser(){
64
+    public function testInactiveUser() {
65 65
         $this->newUser->save();
66 66
         $this->assertFalse($this->newUser->hasCertificates());
67 67
     }
68 68
     
69
-    public function testActiveUser(){
69
+    public function testActiveUser() {
70 70
         $this->newUser->save();
71 71
         $invitation = new SilverbulletInvitation($this->newUser);
72 72
         $invitation->setQuantity(2);
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
         $this->assertEquals(2, count($certificates));
84 84
     }
85 85
     
86
-    public function testSetDeactivated(){
86
+    public function testSetDeactivated() {
87 87
         $serial = '29837498273948';
88 88
         $cn = 'testCommonName';
89
-        $expiry = date('Y-m-d',strtotime("tomorrow"));
89
+        $expiry = date('Y-m-d', strtotime("tomorrow"));
90 90
         
91 91
         //Testing new user deactivation
92 92
         $this->newUser->save();
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         $this->assertEquals(SilverbulletUser::ACTIVE, $existingUser->get(SilverbulletUser::DEACTIVATION_STATUS));
131 131
     }
132 132
     
133
-    protected function tearDown(){
133
+    protected function tearDown() {
134 134
         $this->newUser->delete();
135 135
         $this->profile->delete();
136 136
     }
Please login to merge, or discard this patch.
tests/unit/web/lib/admin/domain/SilverbulletControllerTest.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,9 @@
 block discarded – undo
15 15
 use web\lib\admin\http\SilverbulletContext;
16 16
 use web\lib\admin\domain\SilverbulletInvitation;
17 17
 
18
-if ( !isset( $_SESSION ) ) $_SESSION = array();
18
+if ( !isset( $_SESSION ) ) {
19
+    $_SESSION = array();
20
+}
19 21
 
20 22
 class MockInstitutionPageBuilder extends InstitutionPageBuilder{
21 23
     
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -15,24 +15,24 @@  discard block
 block discarded – undo
15 15
 use web\lib\admin\http\SilverbulletContext;
16 16
 use web\lib\admin\domain\SilverbulletInvitation;
17 17
 
18
-if ( !isset( $_SESSION ) ) $_SESSION = array();
18
+if (!isset($_SESSION)) $_SESSION = array();
19 19
 
20
-class MockInstitutionPageBuilder extends InstitutionPageBuilder{
20
+class MockInstitutionPageBuilder extends InstitutionPageBuilder {
21 21
     
22 22
     private $profile;
23 23
     
24
-    public function __construct($profile){
24
+    public function __construct($profile) {
25 25
         parent::__construct(new DefaultHtmlPage("Test Page"));
26 26
         $this->profile = $profile; 
27 27
     }
28 28
     
29
-    public function getProfile(){
29
+    public function getProfile() {
30 30
         return $this->profile;
31 31
     }
32 32
     
33 33
 }
34 34
 
35
-class SilverbulletControllerTest extends PHPUnit_Framework_TestCase{
35
+class SilverbulletControllerTest extends PHPUnit_Framework_TestCase {
36 36
     
37 37
     private $username = 'testusername';
38 38
     
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     
45 45
     private $factory;
46 46
     
47
-    protected function setUp(){
47
+    protected function setUp() {
48 48
         $this->databaseHandle = \core\DBConnection::handle('INST');
49 49
         
50 50
         $this->profile = new MockProfileSilverbullet($this->databaseHandle);
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $usersAfter = count(SilverbulletUser::getList($this->profile->identifier));
65 65
         $this->assertFalse($usersAfter > $usersBefore);
66 66
         
67
-        $_POST[AddUserCommand::PARAM_EXPIRY] = date('Y-m-d',strtotime("tomorrow"));
67
+        $_POST[AddUserCommand::PARAM_EXPIRY] = date('Y-m-d', strtotime("tomorrow"));
68 68
         $this->factory->parseRequest();
69 69
 
70 70
         // Is not going to work since the $_POST variables can't be modified at runtime for filter_input function
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
         
74 74
     }
75 75
 
76
-    private function countActiveUsers($users){
76
+    private function countActiveUsers($users) {
77 77
         $count = 0;
78 78
         foreach ($users as $user) {
79
-            if(!$user->isDeactivated()){
79
+            if (!$user->isDeactivated()) {
80 80
                 $count++;
81 81
             }
82 82
         }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     public function testRevokeGeneratedCertificate() {
155 155
         $serial = '29837498273948';
156 156
         $cn = 'testCommonName';
157
-        $expiry = date('Y-m-d',strtotime("tomorrow"));
157
+        $expiry = date('Y-m-d', strtotime("tomorrow"));
158 158
         
159 159
         $this->user->save();
160 160
 
@@ -181,9 +181,9 @@  discard block
 block discarded – undo
181 181
         
182 182
     }
183 183
     
184
-    protected function tearDown(){
184
+    protected function tearDown() {
185 185
         $this->user->delete();
186
-        $this->databaseHandle->exec("DELETE FROM `".SilverbulletUser::TABLE."` WHERE `".SilverbulletUser::USERNAME."`='".$this->username."'");
186
+        $this->databaseHandle->exec("DELETE FROM `" . SilverbulletUser::TABLE . "` WHERE `" . SilverbulletUser::USERNAME . "`='" . $this->username . "'");
187 187
         $this->profile->delete();
188 188
     }
189 189
 }
Please login to merge, or discard this patch.
web/lib/admin/http/AddInvitationCommand.php 2 patches
Spacing   +7 added lines, -7 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 AddInvitationCommand extends AbstractInvokerCommand{
11
+class AddInvitationCommand extends AbstractInvokerCommand {
12 12
 
13 13
     const COMMAND = 'newinvitation';
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,7 +33,7 @@  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
         $userIndex = $this->parseInt($_POST[self::COMMAND]);
38 38
         $userIds = $this->parseArray($_POST[SaveUsersCommand::PARAM_ID]);
39 39
         $invitationsQuantities = $this->parseArray($_POST[SaveUsersCommand::PARAM_QUANTITY]);
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
         $user = SilverbulletUser::prepare($userId);
44 44
         $user->load();
45 45
         
46
-        if($user->isExpired()){
46
+        if ($user->isExpired()) {
47 47
             $this->storeErrorMessage(sprintf(_("User '%s' has expired. In order to generate credentials please extend the expiry date!"), $user->getUsername()));
48
-        }else{
48
+        } else {
49 49
             $this->context->createInvitation($user, $this, (int) $invitationsQuantity);
50
-            if(!is_numeric($invitationsQuantity)){
50
+            if (!is_numeric($invitationsQuantity)) {
51 51
                 $this->storeErrorMessage(sprintf(_("Invitations quantity '%' provided for user '%s' was not numeric. Assumed quantity as '1' !"), $invitationsQuantity, $user->getUsername()));
52 52
             }
53
-            if($user->isDeactivated()){
53
+            if ($user->isDeactivated()) {
54 54
                 $user->setDeactivated(false, $this->context->getProfile());
55 55
                 $user->save();
56 56
             }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
         
46 46
         if($user->isExpired()){
47 47
             $this->storeErrorMessage(sprintf(_("User '%s' has expired. In order to generate credentials please extend the expiry date!"), $user->getUsername()));
48
-        }else{
48
+        } else{
49 49
             $this->context->createInvitation($user, $this, (int) $invitationsQuantity);
50 50
             if(!is_numeric($invitationsQuantity)){
51 51
                 $this->storeErrorMessage(sprintf(_("Invitations quantity '%' provided for user '%s' was not numeric. Assumed quantity as '1' !"), $invitationsQuantity, $user->getUsername()));
Please login to merge, or discard this patch.
web/skins/classic/basic.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     public function listIdPs() {
143 143
         $instList = $this->orderIdentityProviders($this->country->identifier);
144 144
         $out = '';
145
-        $out .= sprintf(_("Select your %s"), $this->nomenclature_inst );
145
+        $out .= sprintf(_("Select your %s"), $this->nomenclature_inst);
146 146
         $out .= '<select name="idp" onchange="submit_form(this)">';
147 147
         if (!empty($instList)) {
148 148
             if (!isset($this->idp)) {
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                 }
237 237
             }
238 238
             $out .= '>' . $disp . '</option>';
239
-            $deviceRedirects .= 'redirects[' . $iterator . '] = ' . ( $oneDevice['redirect'] ? 1 : 0 ) . ';';
239
+            $deviceRedirects .= 'redirects[' . $iterator . '] = ' . ($oneDevice['redirect'] ? 1 : 0) . ';';
240 240
             $iterator++;
241 241
         }
242 242
         $out .= '</select>';
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
         </script>
431 431
     </head>
432 432
     <body style="">
433
-        <?php print '<div id="motd">' . ( isset(CONFIG['APPEARANCE']['MOTD']) ? CONFIG['APPEARANCE']['MOTD'] : '&nbsp' ) . '</div>'; ?>
433
+        <?php print '<div id="motd">' . (isset(CONFIG['APPEARANCE']['MOTD']) ? CONFIG['APPEARANCE']['MOTD'] : '&nbsp') . '</div>'; ?>
434 434
         <form name="my_form" method="POST" action="<?php echo $_SERVER['SCRIPT_NAME'] ?>" accept-charset='UTF-8'>
435 435
             <img src="<?php echo $skinObject->findResourceUrl("IMAGES", "consortium_logo.png"); ?>" style="width: 20%; padding-right:20px; padding-top:0px; float:right" alt="logo" />
436 436
             <?php
Please login to merge, or discard this patch.
web/admin/edit_federation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         ?>
41 41
     </h1>
42 42
     <div class='infobox'>
43
-        <h2><?php echo sprintf(_("%s Properties"),$uiElements->nomenclature_fed); ?></h2>
43
+        <h2><?php echo sprintf(_("%s Properties"), $uiElements->nomenclature_fed); ?></h2>
44 44
         <table>
45 45
             <tr>
46 46
                 <td><?php echo _("Country:"); ?></td>
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
               <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE'] . "'>";
58 58
     ?>
59 59
     <fieldset class="option_container">
60
-        <legend><strong><?php echo sprintf(_("%s Properties"),$uiElements->nomenclature_fed); ?></strong></legend>
60
+        <legend><strong><?php echo sprintf(_("%s Properties"), $uiElements->nomenclature_fed); ?></strong></legend>
61 61
         <?php
62 62
         $optionDisplay = new \web\lib\admin\OptionDisplay($fed_options, "FED");
63 63
         echo $optionDisplay->prefilledOptionTable("fed");
Please login to merge, or discard this patch.
web/lib/admin/GeoWidget.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      */
38 38
     public function insertInHead($inst_country, $inst_name) {
39 39
         $cat = new \core\CAT();
40
-        return "<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=".CONFIG['APPEARANCE']['google_maps_api_key']."'></script>
40
+        return "<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=" . CONFIG['APPEARANCE']['google_maps_api_key'] . "'></script>
41 41
     <script type='text/javascript'>
42 42
         // some global variables;
43 43
         var center_lat=49.6114885608729;
Please login to merge, or discard this patch.
web/admin/edit_idp_result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 
91 91
 if (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) && count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0) {
92 92
     foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'] as $ssidname) {
93
-        $ssids[] = $ssidname . " " . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)") );
93
+        $ssids[] = $ssidname . " " . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)"));
94 94
     }
95 95
 }
96 96
 
Please login to merge, or discard this patch.
web/user/tou.inc.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
 /* 
12 12
 */
13 13
 
14
-        $Tou =  [
14
+        $Tou = [
15 15
     'title' => _("Terms of Use"),
16 16
     'short' => "<p>The purpose of this service is to make eduroam configuration easier for end users and eduroam
17 17
 Identity Providers by making available customised and securely configured eduroam installers.</p>
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     they are from the same user group. You are not allowed to share them to an unlimited
50 50
     audience (e.g. on a publicly accessible web server).</li>
51 51
 <li>If You are an eduroam Identity Provider administrator, you are allowed to download and pass on the Installers to
52
-your own ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." end users, e.g. on the support web pages of your ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'].", on Welcome Package CDs or USB sticks, etc.</li>
52
+your own ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " end users, e.g. on the support web pages of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . ", on Welcome Package CDs or USB sticks, etc.</li>
53 53
 <li>If You are a third-party not affiliated with eduroam, you are only allowed to download and pass on
54 54
 the Metadata and/or the Installers after having received written permission by the eduroam Operations team.</li>
55 55
 </ul>
Please login to merge, or discard this patch.
web/user/tou.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
     they are from the same user group. You are not allowed to share them to an unlimited
53 53
     audience (e.g. on a publicly accessible web server).</li>
54 54
 <li>If You are an eduroam Identity Provider administrator, you are allowed to download and pass on the Installers to
55
-your own <?php echo CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'];?> end users, e.g. on the support web pages of your <?php echo CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'];?>, on Welcome Package CDs or USB sticks, etc.</li>
55
+your own <?php echo CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']; ?> end users, e.g. on the support web pages of your <?php echo CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']; ?>, on Welcome Package CDs or USB sticks, etc.</li>
56 56
 <li>If You are a third-party not affiliated with eduroam, you are only allowed to download and pass on
57 57
 the Metadata and/or the Installers after having received written permission by the eduroam Operations team.</li>
58 58
 </ul>
Please login to merge, or discard this patch.