Passed
Push — master ( dd80fa...a058f0 )
by Tomasz
03:06
created
web/lib/admin/http/SilverbulletContext.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * @author Zilvinas Vaira
12 12
  *
13 13
  */
14
-class SilverbulletContext extends DefaultContext  implements MessageDistributor{
14
+class SilverbulletContext extends DefaultContext  implements MessageDistributor {
15 15
     
16 16
     const STATS_TOTAL = 'total';
17 17
     const STATS_ACTIVE = 'active';
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      * 
62 62
      * @param SilverbulletController $controller
63 63
      */
64
-    public function setController($controller){
64
+    public function setController($controller) {
65 65
         $this->controller = $controller;
66 66
     }
67 67
     
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      *
71 71
      * @return ProfileSilverbullet
72 72
      */
73
-    public function getProfile(){
73
+    public function getProfile() {
74 74
         return $this->profile;
75 75
     }
76 76
     
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      *
80 80
      * @return InstitutionPageBuilder
81 81
      */
82
-    public function getBuilder(){
82
+    public function getBuilder() {
83 83
         return $this->builder;
84 84
     }
85 85
     
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      *
89 89
      * @return boolean
90 90
      */
91
-    public function isAgreementSigned(){
91
+    public function isAgreementSigned() {
92 92
         $agreement_attributes = $this->profile->getAttributes("hiddenprofile:tou_accepted");
93 93
         return count($agreement_attributes) > 0;
94 94
     }
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
     /**
97 97
      * Marks agreement as signed inside the database
98 98
      */
99
-    public function signAgreement(){
100
-        $this->profile->addAttribute("hiddenprofile:tou_accepted",NULL,TRUE);
99
+    public function signAgreement() {
100
+        $this->profile->addAttribute("hiddenprofile:tou_accepted", NULL, TRUE);
101 101
     }
102 102
     
103 103
     /**
@@ -108,18 +108,18 @@  discard block
 block discarded – undo
108 108
      * @param AbstractInvokerCommand $command
109 109
      * @return SilverbulletUser
110 110
      */
111
-    public function createUser($username, $expiry, $command){
111
+    public function createUser($username, $expiry, $command) {
112 112
         $user = new SilverbulletUser($this->profile->identifier, $username);
113
-        if(empty($username)){
113
+        if (empty($username)) {
114 114
             $command->storeErrorMessage(_('User name should not be empty!'));
115
-        }elseif(empty($expiry)){
115
+        }elseif (empty($expiry)) {
116 116
             $command->storeErrorMessage(_('No expiry date has been provided!'));
117
-        }else{
117
+        } else {
118 118
             $user->setExpiry($expiry);
119 119
             $user->save();
120
-            if(empty($user->get(SilverbulletUser::EXPIRY))){
120
+            if (empty($user->get(SilverbulletUser::EXPIRY))) {
121 121
                 $command->storeErrorMessage(sprintf(_("Expiry date was incorect for '%s'!"), $username));
122
-            }elseif(empty($user->getIdentifier())){
122
+            }elseif (empty($user->getIdentifier())) {
123 123
                 $command->storeErrorMessage(sprintf(_("Username '%s' already exist!"), $username));
124 124
             }
125 125
         }
@@ -133,13 +133,13 @@  discard block
 block discarded – undo
133 133
      * @param AbstractInvokerCommand $command
134 134
      * @return SilverbulletInvitation
135 135
      */
136
-    public function createInvitation($user, $command, $quantity = 1){
136
+    public function createInvitation($user, $command, $quantity = 1) {
137 137
         $invitation = new SilverbulletInvitation($user);
138
-        if($quantity > 1){
138
+        if ($quantity > 1) {
139 139
             $invitation->setQuantity($quantity);
140 140
         }
141 141
         $invitation->save();
142
-        if(empty($invitation->getIdentifier())){
142
+        if (empty($invitation->getIdentifier())) {
143 143
             $command->storeErrorMessage(_('Could not create invitation!'));
144 144
         }
145 145
         return $invitation;
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      *
151 151
      * @return SilverbulletUser
152 152
      */
153
-    public function createUsers(){
153
+    public function createUsers() {
154 154
         $this->users = SilverbulletUser::getList($this->profile->identifier);
155 155
         return $this->users;
156 156
     }
@@ -160,16 +160,16 @@  discard block
 block discarded – undo
160 160
      *
161 161
      * @return array
162 162
      */
163
-    public function getUserStats(){
163
+    public function getUserStats() {
164 164
         $silverbulletMaxUsers = $this->profile->getAttributes("internal:silverbullet_maxusers");
165 165
         $count = array();
166 166
         $count[self::STATS_TOTAL] = isset($silverbulletMaxUsers[0]['value']) ? $silverbulletMaxUsers[0]['value'] : -1;
167 167
         $count[self::STATS_ACTIVE] = 0;
168 168
         $count[self::STATS_PASSIVE] = 0;
169 169
         foreach ($this->users as $user) {
170
-            if($user->hasActiveCertificates()){
170
+            if ($user->hasActiveCertificates()) {
171 171
                 $count[self::STATS_ACTIVE]++;
172
-            }else{
172
+            } else {
173 173
                 $count[self::STATS_PASSIVE]++;
174 174
             }
175 175
         }
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
     /**
180 180
      * Redirects page to itself in order to prevent acidental form resubmition
181 181
      */
182
-    public function redirectAfterSubmit(){
183
-        if(isset($_SERVER['REQUEST_URI'])){
182
+    public function redirectAfterSubmit() {
183
+        if (isset($_SERVER['REQUEST_URI'])) {
184 184
             $location = $this->addQuery($_SERVER['SCRIPT_NAME']);
185
-            header('Location: ' . $location );
185
+            header('Location: ' . $location);
186 186
             exit;
187 187
         }
188 188
     }
@@ -193,11 +193,11 @@  discard block
 block discarded – undo
193 193
      * @param string $url
194 194
      * @return string
195 195
      */
196
-    public function addQuery($url){
196
+    public function addQuery($url) {
197 197
         $query = '';
198 198
         if (is_array($_GET) && count($_GET)) {
199
-            foreach($_GET as $key => $val) {
200
-                if(strpos($key , '/') === false){
199
+            foreach ($_GET as $key => $val) {
200
+                if (strpos($key, '/') === false) {
201 201
                     if (empty($key) || empty($val)) { continue; }
202 202
                     $query .= ($query == '') ? '?' : "&";
203 203
                     $query .= urlencode($key) . '=' . urlencode($val);
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      * {@inheritDoc}
213 213
      * @see \web\lib\admin\http\MessageDistributor::addMessageInvoker()
214 214
      */
215
-    public function addMessageInvoker($commandToken, $invoker){
215
+    public function addMessageInvoker($commandToken, $invoker) {
216 216
         $this->invokers[$commandToken] = $invoker;
217 217
     }
218 218
     
@@ -221,10 +221,10 @@  discard block
 block discarded – undo
221 221
      * {@inheritDoc}
222 222
      * @see \web\lib\admin\http\MessageDistributor::distributeMessages()
223 223
      */
224
-    public function distributeMessages($commandToken, $receiver){
225
-        if($this->controller != null){
224
+    public function distributeMessages($commandToken, $receiver) {
225
+        if ($this->controller != null) {
226 226
             $this->controller->createCommand($commandToken);
227
-            if(isset($this->invokers[$commandToken])){
227
+            if (isset($this->invokers[$commandToken])) {
228 228
                 $this->invokers[$commandToken]->publishMessages($receiver);
229 229
             }
230 230
         }
Please login to merge, or discard this patch.
web/lib/admin/http/AddInvitationCommand.php 1 patch
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.
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.
utils/notify_invitation_expiry.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     $admins = $this_fed->listFederationAdmins();
45 45
     $mailtext = "Hello,
46 46
 
47
-invitation tokens for the following new ". CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] ." have recently expired:
47
+invitation tokens for the following new ". CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " have recently expired:
48 48
 
49 49
 ";
50 50
     foreach ($listofinstnames as $instname) {
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     if ($numberofexistingidps > 0) {
55 55
         $mailtext .= "
56 56
 
57
-Additionally, $numberofexistingidps invitations for an existing ". CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." have expired.
57
+Additionally, $numberofexistingidps invitations for an existing " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " have expired.
58 58
         ";
59 59
     }
60 60
     $mailtext .= "
Please login to merge, or discard this patch.