Passed
Push — master ( 6af608...f4805a )
by Patrick
03:21
created
application/controllers/StatusController.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@  discard block
 block discarded – undo
41 41
  			
42 42
 			$this->view->trap_days_delete=$this->getDBConfigValue('db_remove_days');
43 43
 			
44
-		}
45
-		catch (Exception $e)
44
+		} catch (Exception $e)
46 45
 		{
47 46
 			$this->displayExitError('status',$e->getMessage());
48 47
 		}
@@ -56,8 +55,7 @@  discard block
 block discarded – undo
56 55
 			$this->view->currentLogFile=$this->getDBConfigValue('log_file');
57 56
 			$this->view->logLevels=$this->getModuleConfig()->getlogLevels();
58 57
 			$this->view->currentLogLevel=$this->getDBConfigValue('log_level');
59
-		}
60
-		catch (Exception $e)
58
+		} catch (Exception $e)
61 59
 		{
62 60
 			$this->displayExitError('status',$e->getMessage());
63 61
 		}		
@@ -107,8 +105,7 @@  discard block
 block discarded – undo
107 105
 					if ($retVal == 0)
108 106
 					{ // process is alive
109 107
 						$this->_helper->json(array('status'=>'Alive and kicking'));
110
-					}
111
-					else
108
+					} else
112 109
 					{ // process is dead
113 110
 					    $this->_helper->json(array('status'=>'tu quoque fili','err'=>'no proc'.$pid));
114 111
 					}
@@ -124,21 +121,18 @@  discard block
 block discarded – undo
124 121
 				if (!is_dir($destDir))
125 122
 				{
126 123
 				    $this->view->uploadStatus="ERROR : no $destDir directory, check module configuration";
127
-				}
128
-				else
124
+				} else
129 125
 				{
130 126
 				    if (!is_writable($destDir))
131 127
 				    {
132 128
 				        $this->view->uploadStatus="ERROR : $destDir directory is not writable";
133
-				    }
134
-				    else
129
+				    } else
135 130
 				    {
136 131
 				        $destination = $destDir .'/'.$name; //$this->Module()->getBaseDir() . "/mibs/$name";
137 132
     				    if (move_uploaded_file($_FILES['mibfile']['tmp_name'],$destination)===false)
138 133
     				    {
139 134
     				        $this->view->uploadStatus="ERROR, file $destination not loaded. Check file and path name or selinux violations";
140
-    				    }
141
-    				    else
135
+    				    } else
142 136
     				    {
143 137
     				        $this->view->uploadStatus="File $name uploaded in $destDir";
144 138
     				    }
@@ -160,13 +154,11 @@  discard block
 block discarded – undo
160 154
 			{
161 155
 				$this->view->snmptranslate='works fine';
162 156
 				$this->view->snmptranslate_state='ok';
163
-			}
164
-			else
157
+			} else
165 158
 			{
166 159
 				$this->view->snmptranslate='can execute but no resolution';
167 160
 			}
168
-		}
169
-		else
161
+		} else
170 162
 		{
171 163
 			$this->view->snmptranslate='cannot execute';
172 164
 		}
@@ -187,15 +179,13 @@  discard block
 block discarded – undo
187 179
 		if ($retVal==0)
188 180
 		{
189 181
 			$dirArray=array_merge($dirArray,explode(':',$sysDirs));
190
-		}
191
-		else
182
+		} else
192 183
 		{
193 184
 			$translateOut=exec($this->Config()->get('config', 'snmptranslate') . ' -Dinit_mib .1.3 2>&1 | grep MIBDIRS');
194 185
 			if (preg_match('/MIBDIRS.*\'([^\']+)\'/',$translateOut,$matches))
195 186
 			{
196 187
 				$dirArray=array_merge($dirArray,explode(':',$matches[1]));
197
-			}
198
-			else
188
+			} else
199 189
 			{
200 190
 				array_push($dirArray,'Install net-snmp-config to see system directories');
201 191
 			}
Please login to merge, or discard this patch.