Passed
Pull Request — master (#37)
by
unknown
01:55
created
application/controllers/SettingsController.php 1 patch
Braces   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
               $this->Config()->saveIni();
53 53
               $this->view->configErrorDetected='Configuration is empty : you can run install script with parameters (see Automatic installation below)';
54 54
               //$emptyConfig=1;
55
-          }
56
-          catch (Exception $e)
55
+          } catch (Exception $e)
57 56
           {
58 57
               $this->view->configErrorDetected=$e->getMessage();
59 58
           }
@@ -141,8 +140,7 @@  discard block
 block discarded – undo
141 140
               $this->view->apimessage='API config : ' . $e->getMessage();
142 141
               $this->view->apimessageError=true;
143 142
           }
144
-      }
145
-      else
143
+      } else
146 144
       {
147 145
           $this->view->apimessage='API parameters not configured';
148 146
           $this->view->apimessageError=true;
@@ -208,7 +206,9 @@  discard block
 block discarded – undo
208 206
           $input="154865134987aaaa";
209 207
           exec("$phpBin -r \"echo '$input';\"",$output,$retCode);
210 208
           
211
-          if (! isset($output[0])) $output[0]="NO OUT";
209
+          if (! isset($output[0])) {
210
+          	$output[0]="NO OUT";
211
+          }
212 212
           
213 213
           if ($retCode == 0 && preg_match("/$input/",$output[0]) == 1)
214 214
           {
@@ -310,8 +310,7 @@  discard block
 block discarded – undo
310 310
 	    $this->getUIDatabase()->testGetDb(); // Get DB in test mode
311 311
 	    printf('Schema already exists');
312 312
 	    
313
-	} 
314
-	catch (DBException $e) 
313
+	} catch (DBException $e) 
315 314
 	{
316 315
 
317 316
 		printf('Creating schema : <br>');
@@ -367,8 +366,7 @@  discard block
 block discarded – undo
367 366
           $this->getUIDatabase()->testGetDb(); // Get DB in test mode
368 367
           echo 'Schema already exists and is up to date<br>';
369 368
           return;
370
-      }
371
-      catch (DBException $e)
369
+      } catch (DBException $e)
372 370
       {
373 371
           $dberror=$e->getArray(); 
374 372
       }
@@ -452,16 +450,18 @@  discard block
 block discarded – undo
452 450
           }
453 451
           // Assume there is only one line... TODO : see if there is a better way to do this
454 452
           $line = preg_replace('/^.*snmptrapd /','',$psOutput[0]);
455
-          if (!preg_match('/-n/',$line))
456
-              return array(1,'snmptrapd has no -n option : '.$line);
457
-          if (!preg_match('/-O[^ ]*n/',$line))
458
-              return array(1,'snmptrapd has no -On option : '.$line);
459
-          if (!preg_match('/-O[^ ]*e/',$line))
460
-              return array(1,'snmptrapd has no -Oe option : '.$line);
453
+          if (!preg_match('/-n/',$line)) {
454
+                        return array(1,'snmptrapd has no -n option : '.$line);
455
+          }
456
+          if (!preg_match('/-O[^ ]*n/',$line)) {
457
+                        return array(1,'snmptrapd has no -On option : '.$line);
458
+          }
459
+          if (!preg_match('/-O[^ ]*e/',$line)) {
460
+                        return array(1,'snmptrapd has no -Oe option : '.$line);
461
+          }
461 462
 
462 463
           return array(0,'snmptrapd listening to UDP/162, options : '.$line);
463
-      }
464
-      else
464
+      } else
465 465
       {
466 466
           return array(0,'A daemon (hidden by SELinux) is listening on UDP/162');
467 467
       }
Please login to merge, or discard this patch.