Completed
Branch master (6ed6e7)
by Lars
07:57
created
src/Intraface/modules/filemanager/ImageHandler.php 4 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     /**
29 29
      * Constructor
30 30
      *
31
-     * @param object $file_handler
31
+     * @param FileHandler $file_handler
32 32
      *
33 33
      * @return void
34 34
      */
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
      *
144 144
      * @param float  $width  Width
145 145
      * @param float  $height Height
146
-     * @param float $offset_x offset x
147
-     * @param float $offset_y offset y
146
+     * @param integer $offset_x offset x
147
+     * @param integer $offset_y offset y
148 148
      *
149 149
      * @return string new file name
150 150
      */
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2
- /**
3
-  * Image handler. Klarer h�ndtering af billeder.
4
-  *
5
-  * @package Intraface
6
-  * @author: Sune
7
-  * @version: 1.0
8
-  *
9
-  */
2
+    /**
3
+     * Image handler. Klarer h�ndtering af billeder.
4
+     *
5
+     * @package Intraface
6
+     * @author: Sune
7
+     * @version: 1.0
8
+     *
9
+     */
10 10
 
11 11
 class ImageHandler extends Intraface_Standard
12 12
 {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $this->image_library = IMAGE_LIBRARY;
55 55
 
56 56
         if ($this->file_handler->get('is_image') != 1) {
57
-            throw new Exception("Filtypen " . $file_handler->get('mime_type') . " er ikke et billede, og kan derfor ikke manipuleres i ImageHandler");
57
+            throw new Exception("Filtypen ".$file_handler->get('mime_type')." er ikke et billede, og kan derfor ikke manipuleres i ImageHandler");
58 58
         }
59 59
 
60 60
         $this->tempdir_path = $this->file_handler->getTemporaryDirectory();
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
         $image = Image_Transform::factory($this->image_library);
82 82
         if (PEAR::isError($image)) {
83
-            throw new Exception($image->getMessage() . $image->getUserInfo());
83
+            throw new Exception($image->getMessage().$image->getUserInfo());
84 84
         }
85 85
 
86 86
         if ($this->tmp_file_name != NULL && file_exists($this->tmp_file_name)) {
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             }
117 117
 
118 118
             // die($image->new_x.':'.$image->new_y.':'.$width.':'.$height.': '.$offset_x.': '.$offset_y);
119
-            if ($image->crop($width, $height, $offset_x, $offset_y) !== true){
119
+            if ($image->crop($width, $height, $offset_x, $offset_y) !== true) {
120 120
                 throw new Exception("Der opstod en fejl under formatering (crop) af billedet i ImageHandler->resize");
121 121
             }
122 122
         } else {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     {
153 153
         $image = Image_Transform::factory($this->image_library);
154 154
         if (PEAR::isError($image)) {
155
-            throw new Exception($image->getMessage() . $image->getUserInfo());
155
+            throw new Exception($image->getMessage().$image->getUserInfo());
156 156
         }
157 157
 
158 158
         if ($this->tmp_file_name != NULL && file_exists($this->tmp_file_name)) {
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         $result = $image->crop($width, $height, $offset_x, $offset_y);
171 171
 
172 172
         if (PEAR::isError($result)) {
173
-            throw new Exception("Der opstod en fejl under formatering (crop) af billedet i ImageHandler->crop: " . $result->getMessage());
173
+            throw new Exception("Der opstod en fejl under formatering (crop) af billedet i ImageHandler->crop: ".$result->getMessage());
174 174
         }
175 175
 
176 176
         $file_type = $this->file_handler->get('file_type');
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@
 block discarded – undo
85 85
 
86 86
         if ($this->tmp_file_name != NULL && file_exists($this->tmp_file_name)) {
87 87
             $error = $image->load($this->tmp_file_name);
88
-        }
89
-        else {
88
+        } else {
90 89
             $error = $image->load($this->file_handler->get('file_path'));
91 90
         }
92 91
 
Please login to merge, or discard this patch.
src/Intraface/modules/filemanager/ImageRandomizer.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
     /**
87 87
      * return an file object with random image
88 88
      *
89
-     * @return object file_manager with random image loaded
89
+     * @return FileHandler file_manager with random image loaded
90 90
      */
91 91
     public function getRandomImage()
92 92
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
     public function getRandomImage()
92 92
     {
93 93
         require_once 'Intraface/modules/filemanager/FileHandler.php';
94
-        $key = rand(0, count($this->file_list)-1);
94
+        $key = rand(0, count($this->file_list) - 1);
95 95
         $filehandler = new FileHandler($this->file_manager->getKernel(), $this->file_list[$key]);
96 96
         return $filehandler;
97 97
     }
Please login to merge, or discard this patch.
src/Intraface/modules/filemanager/InstanceHandler.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      * @param object  $file_handler File handler object
35 35
      * @param integer $id           Optional id
36 36
      *
37
-     * @return void
37
+     * @return string
38 38
      */
39 39
     function __construct($file_handler, $id = 0)
40 40
     {
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
     /**
66 66
      * Factory
67 67
      *
68
-     * @param object $file_handler File handler
69
-     * @param string $type         the instance type
68
+     * @param FileHandler $file_handler File handler
70 69
      * @param array  $param        one or more of crop_width, crop_height, crop_offset_x, crop_offset_y
70
+     * @param string $type_name
71 71
      *
72
-     * @return object
72
+     * @return InstanceHandler
73 73
      */
74 74
     function factory($file_handler, $type_name, $param = array())
75 75
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                 type_key = ".$type['type_key'].",
124 124
                 file_size = ".(int)$file_size.",
125 125
                 width = ".(int)$width.",
126
-                height = ".(int)$height.", " .
126
+                height = ".(int)$height.", ".
127 127
                 "crop_parameter = \"".safeToDb($crop_param_string)."\"");
128 128
 
129 129
             $id = $db->insertedId();
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         //$this->value['predefined_size'] = $db->f('predefined_size');
188 188
         $this->value['server_file_name'] = $db->f('server_file_name');
189 189
         $this->value['file_size'] = $db->f('file_size');
190
-        $this->value['file_path'] = $this->instance_path . $db->f('server_file_name');
190
+        $this->value['file_path'] = $this->instance_path.$db->f('server_file_name');
191 191
 
192 192
         $this->value['last_modified'] = filemtime($this->get('file_path'));
193 193
         // $this->value['file_uri'] = FILE_VIEWER.'?id='.$this->get('id').'&type='.$this->get('type').'&name=/'.urlencode($this->file_handler->get('file_name'));
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
         $db = new DB_sql;
341 341
         $db->query("SELECT id FROM file_handler_instance WHERE intranet_id = ".$this->file_handler->kernel->intranet->get('id')." AND file_handler_id = ".$this->file_handler->get('id')." AND active = 1");
342
-        while($db->nextRecord()) {
342
+        while ($db->nextRecord()) {
343 343
             $instance = new InstanceHandler($this->file_handler, $db->f('id'));
344 344
             $instance->delete();
345 345
         }
Please login to merge, or discard this patch.
src/Intraface/modules/filemanager/InstanceManager.php 4 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -225,7 +225,6 @@  discard block
 block discarded – undo
225 225
      * Checks whether a name is free to use
226 226
      * 
227 227
      * @param string $name 
228
-     * @param integer $id integer which should not be checked
229 228
      * @return boolean true or false
230 229
      */
231 230
     private function isNameFree($name, $type_key = 0) 
@@ -367,7 +366,7 @@  discard block
 block discarded – undo
367 366
     /**
368 367
      * returns the resize types
369 368
      * 
370
-     * @return array resize types
369
+     * @return string[] resize types
371 370
      */
372 371
     public function getResizeTypes() {
373 372
         return array(0 => 'relative', 1 => 'strict'); 
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -329,10 +329,10 @@
 block discarded – undo
329 329
                 }
330 330
             }
331 331
             else {
332
-               $type[$i] = $custom_types[$c];
333
-               $type[$i]['resize_type'] = $resize_types[$type[$i]['resize_type_key']];
334
-               $type[$i]['origin'] = 'custom';
335
-               $c++; 
332
+                $type[$i] = $custom_types[$c];
333
+                $type[$i]['resize_type'] = $resize_types[$type[$i]['resize_type_key']];
334
+                $type[$i]['origin'] = 'custom';
335
+                $c++; 
336 336
             } 
337 337
             
338 338
             $i++;
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
             return false;
157 157
         }
158 158
         
159
-        $sql = 'name = '.$this->db->quote($input['name'], 'text').', ' .
160
-                'max_width = '.$this->db->quote($input['max_width'], 'integer').', ' .
161
-                'max_height = '.$this->db->quote($input['max_height'], 'integer').', ' .
159
+        $sql = 'name = '.$this->db->quote($input['name'], 'text').', '.
160
+                'max_width = '.$this->db->quote($input['max_width'], 'integer').', '.
161
+                'max_height = '.$this->db->quote($input['max_height'], 'integer').', '.
162 162
                 'resize_type_key = '.$this->db->quote($resize_type_key);
163 163
         
164 164
         if ($this->type_key == 0 || $this->get('origin') == 'standard') {
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
                 $type_key = $this->type_key;
170 170
             }
171 171
             
172
-            $result = $this->db->exec('INSERT INTO file_handler_instance_type SET ' .
173
-                    'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').', ' .
174
-                    'type_key = '.$this->db->quote($type_key, 'integer').', ' .
172
+            $result = $this->db->exec('INSERT INTO file_handler_instance_type SET '.
173
+                    'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').', '.
174
+                    'type_key = '.$this->db->quote($type_key, 'integer').', '.
175 175
                     'active = 1, '.$sql);
176 176
             if (PEAR::isError($result)) {
177 177
                 throw new Exception('Error in exec: '.$result->getUserInfo());
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
             return $this->type_key;
186 186
         }
187 187
         else {
188
-            $result = $this->db->exec('UPDATE file_handler_instance_type SET '.$sql.' ' .
189
-                    'WHERE intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' ' .
188
+            $result = $this->db->exec('UPDATE file_handler_instance_type SET '.$sql.' '.
189
+                    'WHERE intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' '.
190 190
                             'AND type_key = '.$this->db->quote($this->type_key, 'integer'));
191 191
             if (PEAR::isError($result)) {
192 192
                 throw new Exception('Error in exec: '.$result->getUserInfo());
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
             }
239 239
         }
240 240
         
241
-        $result = $this->db->query('SELECT type_key FROM file_handler_instance_type WHERE ' .
242
-                'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' AND ' .
243
-                'name = '.$this->db->quote($name, 'text').' AND ' .
244
-                'type_key != '.$this->db->quote((int)$type_key, 'integer').' AND ' .
241
+        $result = $this->db->query('SELECT type_key FROM file_handler_instance_type WHERE '.
242
+                'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' AND '.
243
+                'name = '.$this->db->quote($name, 'text').' AND '.
244
+                'type_key != '.$this->db->quote((int)$type_key, 'integer').' AND '.
245 245
                 'active = 1');
246 246
         if (PEAR::isError($result)) {
247 247
             throw new Exception('Error in query: '.$result->getUserInfo());
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     private function getNextFreeTypeKey() 
265 265
     {
266 266
         // We do not active = 1, then it is possible to recreate deleted items without messing everything up.
267
-        $result = $this->db->query('SELECT MAX(type_key) AS max_key FROM file_handler_instance_type WHERE ' .
267
+        $result = $this->db->query('SELECT MAX(type_key) AS max_key FROM file_handler_instance_type WHERE '.
268 268
                 'intranet_id = '.$this->db->quote($this->intranet_id, 'integer'));
269 269
         if (PEAR::isError($result)) {
270 270
             throw new Exception('Error in query: '.$result->getUserInfo());
Please login to merge, or discard this patch.
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -86,20 +86,17 @@  discard block
 block discarded – undo
86 86
             $this->value['resize_type'] = $resize_types[$this->value['resize_type_key']];
87 87
             $this->value['origin'] = 'overwritten';
88 88
             return true;
89
-        }
90
-        elseif (isset($standard_type)) {
89
+        } elseif (isset($standard_type)) {
91 90
             $this->value = $standard_type;
92 91
             $this->value['origin'] = 'standard';
93 92
             return true;           
94
-        }
95
-        elseif (isset($custom_type)) {
93
+        } elseif (isset($custom_type)) {
96 94
             $this->value = $custom_type;
97 95
             $resize_types = $this->getResizeTypes();
98 96
             $this->value['resize_type'] = $resize_types[$this->value['resize_type_key']];
99 97
             $this->value['origin'] = 'custom';
100 98
             return true;
101
-        }
102
-        else {
99
+        } else {
103 100
             $this->type_key = 0;
104 101
             $this->value['type_key'] = 0;
105 102
             return false;
@@ -164,8 +161,7 @@  discard block
 block discarded – undo
164 161
         if ($this->type_key == 0 || $this->get('origin') == 'standard') {
165 162
             if ($this->type_key == 0) {
166 163
                 $type_key = $this->getNextFreeTypeKey();
167
-            }
168
-            else {
164
+            } else {
169 165
                 $type_key = $this->type_key;
170 166
             }
171 167
             
@@ -183,8 +179,7 @@  discard block
 block discarded – undo
183 179
             }
184 180
             $this->type_key = $type_key;
185 181
             return $this->type_key;
186
-        }
187
-        else {
182
+        } else {
188 183
             $result = $this->db->exec('UPDATE file_handler_instance_type SET '.$sql.' ' .
189 184
                     'WHERE intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' ' .
190 185
                             'AND type_key = '.$this->db->quote($this->type_key, 'integer'));
@@ -275,8 +270,7 @@  discard block
 block discarded – undo
275 270
         
276 271
         if ($row['max_key'] >= InstanceManager::MIN_CUSTOM_TYPE_KEY_VALUE) {
277 272
             return $row['max_key'] + 1;
278
-        }
279
-        else {
273
+        } else {
280 274
             return InstanceManager::MIN_CUSTOM_TYPE_KEY_VALUE; 
281 275
         }  
282 276
     }
@@ -322,13 +316,11 @@  discard block
 block discarded – undo
322 316
                     $type[$i]['resize_type'] = $resize_types[$type[$i]['resize_type_key']];
323 317
                     $type[$i]['origin'] = 'overwritten';
324 318
                     $c++;
325
-                }
326
-                else {
319
+                } else {
327 320
                     $type[$i] = $standard_types[$s];
328 321
                     $type[$i]['origin'] = 'standard';
329 322
                 }
330
-            }
331
-            else {
323
+            } else {
332 324
                $type[$i] = $custom_types[$c];
333 325
                $type[$i]['resize_type'] = $resize_types[$type[$i]['resize_type_key']];
334 326
                $type[$i]['origin'] = 'custom';
@@ -386,8 +378,7 @@  discard block
 block discarded – undo
386 378
         if (!empty($key)) {
387 379
             if (isset($this->value[$key])) {
388 380
                 return($this->value[$key]);
389
-            }
390
-            else {
381
+            } else {
391 382
                 return '';
392 383
             }
393 384
         }
Please login to merge, or discard this patch.
src/Intraface/modules/filemanager/TemporaryFile.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     /**
34 34
      * Constructor
35 35
      * 
36
-     * @param object $file_handler
36
+     * @param FileHandler $filehandler
37 37
      * @param string $file_name the name of the temporary file.
38 38
      */
39 39
     public function __construct($filehandler, $file_name = NULL)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     /**
24 24
      * @var string $file_path
25 25
      */
26
-    private $file_path ;
26
+    private $file_path;
27 27
     
28 28
     /**
29 29
      * @var string $file_dir
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         if (strlen($file_name) > 50) {
115 115
             $extension = strrchr($file_name, '.');
116 116
             if ($extension !== false && (strlen($extension) == 4 || strlen($extension) == 5)) {
117
-                $file_name = substr($file_name, 0, 50-strlen($extension)).$extension;
117
+                $file_name = substr($file_name, 0, 50 - strlen($extension)).$extension;
118 118
             }
119 119
             else {
120 120
                 $file_name = substr($file_name, 0, 50);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,8 +115,7 @@
 block discarded – undo
115 115
             $extension = strrchr($file_name, '.');
116 116
             if ($extension !== false && (strlen($extension) == 4 || strlen($extension) == 5)) {
117 117
                 $file_name = substr($file_name, 0, 50-strlen($extension)).$extension;
118
-            }
119
-            else {
118
+            } else {
120 119
                 $file_name = substr($file_name, 0, 50);
121 120
             }   
122 121
         }
Please login to merge, or discard this patch.
src/Intraface/modules/filemanager/UploadHandler.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
      *       then the filehandler->save method should rather accept some kind of file object which this
71 71
      *       object could generate?
72 72
      *
73
-     * @param object $file_handler A filehandler
73
+     * @param FileHandler $file_handler A filehandler
74 74
      *
75 75
      * @return void
76 76
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -290,7 +290,7 @@
 block discarded – undo
290 290
                     CONTINUE;
291 291
                 }
292 292
 
293
-                $ext = substr($file, strrpos($file, ".")+1);
293
+                $ext = substr($file, strrpos($file, ".") + 1);
294 294
 
295 295
                 if (strlen($ext) < 3 || strlen($ext) > 4) {
296 296
                     $this->file_handler->error->set("Filen \"".$file."\" har ikke en gyldig endelse, f.eks. .pdf");
Please login to merge, or discard this patch.
src/Intraface/modules/intranetmaintenance/Controller/Intranet/Show.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -207,6 +207,9 @@
 block discarded – undo
207 207
     	$this->removeDir('/home/intraface/upload/' . $intranet_id . '/');
208 208
     }
209 209
 
210
+    /**
211
+     * @param string $path
212
+     */
210 213
     protected function removeDir($path)
211 214
     {
212 215
 		// Add trailing slash to $path if one is not there
Please login to merge, or discard this patch.
Indentation   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -118,137 +118,137 @@
 block discarded – undo
118 118
         $modul = $this->getKernel()->module("intranetmaintenance");
119 119
         $intranet = new IntranetMaintenance(intval($_POST["id"]));
120 120
 
121
-    	$value = $_POST;
122
-    	$address_value = $_POST;
123
-    	$address_value["name"] = $_POST["address_name"];
124
-
125
-    	if ($intranet->save($_POST) && $intranet->setMaintainedByUser($_POST['maintained_by_user_id'], $this->getKernel()->intranet->get('id'))) {
126
-    		if ($intranet->address->save($address_value)) {
127
-    			return new k_SeeOther($this->url(null));
128
-    		}
129
-    	}
130
-    	return $this->render();
121
+        $value = $_POST;
122
+        $address_value = $_POST;
123
+        $address_value["name"] = $_POST["address_name"];
124
+
125
+        if ($intranet->save($_POST) && $intranet->setMaintainedByUser($_POST['maintained_by_user_id'], $this->getKernel()->intranet->get('id'))) {
126
+            if ($intranet->address->save($address_value)) {
127
+                return new k_SeeOther($this->url(null));
128
+            }
129
+        }
130
+        return $this->render();
131 131
     }
132 132
 
133 133
     function DELETE()
134 134
     {
135
-    	$db = new DB_Sql;
136
-    	$db2 = new DB_Sql;
135
+        $db = new DB_Sql;
136
+        $db2 = new DB_Sql;
137 137
 
138
-    	$intranet_id = intval($_POST['intranet_id']);
138
+        $intranet_id = intval($_POST['intranet_id']);
139 139
 
140
-    	if (!array_key_exists($intranet_id, $allowed_delete)) {
141
-    		throw new Exception('Du kan kun slette bambus beta og bambus - sune og lars');
142
-    	}
140
+        if (!array_key_exists($intranet_id, $allowed_delete)) {
141
+            throw new Exception('Du kan kun slette bambus beta og bambus - sune og lars');
142
+        }
143 143
 
144
-    	$db->query("DELETE FROM accounting_account WHERE intranet_id = " . $intranet_id);
145
-    	$db->query("DELETE FROM accounting_post WHERE intranet_id = " . $intranet_id);
146
-    	$db->query("DELETE FROM accounting_vat_period WHERE intranet_id = " . $intranet_id);
147
-    	$db->query("DELETE FROM accounting_voucher WHERE intranet_id = " . $intranet_id);
148
-    	$db->query("DELETE FROM accounting_voucher_file WHERE intranet_id = " . $intranet_id);
149
-    	$db->query("DELETE FROM accounting_year WHERE intranet_id = " . $intranet_id);
150
-    	$db->query("DELETE FROM accounting_year_end WHERE intranet_id = " . $intranet_id);
151
-    	$db->query("DELETE FROM accounting_year_end_action WHERE intranet_id = " . $intranet_id);
144
+        $db->query("DELETE FROM accounting_account WHERE intranet_id = " . $intranet_id);
145
+        $db->query("DELETE FROM accounting_post WHERE intranet_id = " . $intranet_id);
146
+        $db->query("DELETE FROM accounting_vat_period WHERE intranet_id = " . $intranet_id);
147
+        $db->query("DELETE FROM accounting_voucher WHERE intranet_id = " . $intranet_id);
148
+        $db->query("DELETE FROM accounting_voucher_file WHERE intranet_id = " . $intranet_id);
149
+        $db->query("DELETE FROM accounting_year WHERE intranet_id = " . $intranet_id);
150
+        $db->query("DELETE FROM accounting_year_end WHERE intranet_id = " . $intranet_id);
151
+        $db->query("DELETE FROM accounting_year_end_action WHERE intranet_id = " . $intranet_id);
152 152
 
153
-    	// her skulle vi slette noget address
153
+        // her skulle vi slette noget address
154 154
 
155
-    	$db->query("DELETE FROM contact WHERE intranet_id = " . $intranet_id);
156
-    	$db->query("DELETE FROM contact_person WHERE intranet_id = " . $intranet_id);
157
-    	$db->query("DELETE FROM contact_message WHERE intranet_id  = " . $intranet_id);
155
+        $db->query("DELETE FROM contact WHERE intranet_id = " . $intranet_id);
156
+        $db->query("DELETE FROM contact_person WHERE intranet_id = " . $intranet_id);
157
+        $db->query("DELETE FROM contact_message WHERE intranet_id  = " . $intranet_id);
158 158
 
159
-    	$db->query("DELETE FROM cms_element WHERE intranet_id = " . $intranet_id);
160
-    	$db->query("DELETE FROM cms_page WHERE intranet_id = " . $intranet_id);
161
-    	$db->query("DELETE FROM cms_parameter WHERE intranet_id = " . $intranet_id);
162
-    	$db->query("DELETE FROM cms_section WHERE intranet_id = " . $intranet_id);
163
-    	$db->query("DELETE FROM cms_site WHERE intranet_id = " . $intranet_id);
164
-    	$db->query("DELETE FROM cms_template WHERE intranet_id = " . $intranet_id);
165
-    	$db->query("DELETE FROM cms_template_section WHERE intranet_id = " . $intranet_id);
159
+        $db->query("DELETE FROM cms_element WHERE intranet_id = " . $intranet_id);
160
+        $db->query("DELETE FROM cms_page WHERE intranet_id = " . $intranet_id);
161
+        $db->query("DELETE FROM cms_parameter WHERE intranet_id = " . $intranet_id);
162
+        $db->query("DELETE FROM cms_section WHERE intranet_id = " . $intranet_id);
163
+        $db->query("DELETE FROM cms_site WHERE intranet_id = " . $intranet_id);
164
+        $db->query("DELETE FROM cms_template WHERE intranet_id = " . $intranet_id);
165
+        $db->query("DELETE FROM cms_template_section WHERE intranet_id = " . $intranet_id);
166 166
 
167
-    	$db->query("DELETE FROM comment WHERE intranet_id = " . $intranet_id);
167
+        $db->query("DELETE FROM comment WHERE intranet_id = " . $intranet_id);
168 168
 
169
-    	$db->query("DELETE FROM debtor WHERE intranet_id = " . $intranet_id);
170
-    	$db->query("DELETE FROM debtor_item WHERE intranet_id = " . $intranet_id);
169
+        $db->query("DELETE FROM debtor WHERE intranet_id = " . $intranet_id);
170
+        $db->query("DELETE FROM debtor_item WHERE intranet_id = " . $intranet_id);
171 171
 
172
-    	$db->query("DELETE FROM email WHERE intranet_id = " . $intranet_id);
173
-    	$db->query("DELETE FROM email_attachment WHERE intranet_id = " . $intranet_id);
172
+        $db->query("DELETE FROM email WHERE intranet_id = " . $intranet_id);
173
+        $db->query("DELETE FROM email_attachment WHERE intranet_id = " . $intranet_id);
174 174
 
175
-    	$db->query("DELETE FROM file_handler WHERE intranet_id = " . $intranet_id);
176
-    	$db->query("DELETE FROM file_handler_instance WHERE intranet_id = " . $intranet_id);
177
-    	$db->query("DELETE FROM filehandler_append_file WHERE intranet_id = " . $intranet_id);
175
+        $db->query("DELETE FROM file_handler WHERE intranet_id = " . $intranet_id);
176
+        $db->query("DELETE FROM file_handler_instance WHERE intranet_id = " . $intranet_id);
177
+        $db->query("DELETE FROM filehandler_append_file WHERE intranet_id = " . $intranet_id);
178 178
 
179
-    	$db->query("DELETE FROM invoice_payment WHERE intranet_id = " . $intranet_id);
180
-    	$db->query("DELETE FROM invoice_reminder WHERE intranet_id = " . $intranet_id);
181
-    	$db->query("DELETE FROM invoice_reminder_item WHERE intranet_id = " . $intranet_id);
182
-    	$db->query("DELETE FROM invoice_reminder_unpaid_reminder WHERE intranet_id = " . $intranet_id);
179
+        $db->query("DELETE FROM invoice_payment WHERE intranet_id = " . $intranet_id);
180
+        $db->query("DELETE FROM invoice_reminder WHERE intranet_id = " . $intranet_id);
181
+        $db->query("DELETE FROM invoice_reminder_item WHERE intranet_id = " . $intranet_id);
182
+        $db->query("DELETE FROM invoice_reminder_unpaid_reminder WHERE intranet_id = " . $intranet_id);
183 183
 
184
-    	$db->query("DELETE FROM keyword WHERE intranet_id = " . $intranet_id);
185
-    	$db->query("DELETE FROM keyword_x_object WHERE intranet_id = " . $intranet_id);
184
+        $db->query("DELETE FROM keyword WHERE intranet_id = " . $intranet_id);
185
+        $db->query("DELETE FROM keyword_x_object WHERE intranet_id = " . $intranet_id);
186 186
 
187
-    	$db->query("DELETE FROM newsletter_archieve WHERE intranet_id = " . $intranet_id);
188
-    	$db->query("DELETE FROM newsletter_list WHERE intranet_id = " . $intranet_id);
189
-    	$db->query("DELETE FROM newsletter_subscriber WHERE intranet_id = " . $intranet_id);
187
+        $db->query("DELETE FROM newsletter_archieve WHERE intranet_id = " . $intranet_id);
188
+        $db->query("DELETE FROM newsletter_list WHERE intranet_id = " . $intranet_id);
189
+        $db->query("DELETE FROM newsletter_subscriber WHERE intranet_id = " . $intranet_id);
190 190
 
191
-    	$db->query("DELETE FROM onlinepayment WHERE intranet_id = " . $intranet_id);
191
+        $db->query("DELETE FROM onlinepayment WHERE intranet_id = " . $intranet_id);
192 192
 
193
-    	$db->query("DELETE FROM procurement WHERE intranet_id = " . $intranet_id);
194
-    	$db->query("DELETE FROM procurement_item WHERE intranet_id = " . $intranet_id);
193
+        $db->query("DELETE FROM procurement WHERE intranet_id = " . $intranet_id);
194
+        $db->query("DELETE FROM procurement_item WHERE intranet_id = " . $intranet_id);
195 195
 
196
-    	$db->query("DELETE FROM product WHERE intranet_id = " . $intranet_id);
197
-    	$db->query("DELETE FROM product_detail WHERE intranet_id = " . $intranet_id);
198
-    	$db->query("DELETE FROM product_related WHERE intranet_id = " . $intranet_id);
196
+        $db->query("DELETE FROM product WHERE intranet_id = " . $intranet_id);
197
+        $db->query("DELETE FROM product_detail WHERE intranet_id = " . $intranet_id);
198
+        $db->query("DELETE FROM product_related WHERE intranet_id = " . $intranet_id);
199 199
 
200
-    	$db->query("DELETE FROM stock_adaptation WHERE intranet_id = " . $intranet_id);
201
-    	$db->query("DELETE FROM stock_regulation WHERE intranet_id = " . $intranet_id);
200
+        $db->query("DELETE FROM stock_adaptation WHERE intranet_id = " . $intranet_id);
201
+        $db->query("DELETE FROM stock_regulation WHERE intranet_id = " . $intranet_id);
202 202
 
203
-    	$db->query("DELETE FROM todo_list WHERE intranet_id = " . $intranet_id);
204
-    	$db->query("DELETE FROM todo_item WHERE intranet_id = " . $intranet_id);
205
-    	$db->query("DELETE FROM todo_contact WHERE intranet_id = " . $intranet_id);
203
+        $db->query("DELETE FROM todo_list WHERE intranet_id = " . $intranet_id);
204
+        $db->query("DELETE FROM todo_item WHERE intranet_id = " . $intranet_id);
205
+        $db->query("DELETE FROM todo_contact WHERE intranet_id = " . $intranet_id);
206 206
 
207
-    	$this->removeDir('/home/intraface/upload/' . $intranet_id . '/');
207
+        $this->removeDir('/home/intraface/upload/' . $intranet_id . '/');
208 208
     }
209 209
 
210 210
     protected function removeDir($path)
211 211
     {
212
-		// Add trailing slash to $path if one is not there
213
-		if (substr($path, -1, 1) != "/") {
214
-			$path .= "/";
215
-		}
216
-
217
-		$normal_files = glob($path . "*");
218
-		$hidden_files = glob($path . "\.?*");
219
-		$all_files = array_merge($normal_files, $hidden_files);
220
-
221
-		foreach ($all_files as $file) {
222
-			# Skip pseudo links to current and parent dirs (./ and ../).
223
-			if (preg_match("/(\.|\.\.)$/", $file)) {
224
-               continue;
225
-			}
226
-
227
-			if (is_file($file) === TRUE) {
228
-				// Remove each file in this Directory
229
-				unlink($file);
230
-				echo "Removed File: " . $file . "<br>";
231
-			}
232
-			else if (is_dir($file) === TRUE) {
233
-				// If this Directory contains a Subdirectory, run this Function on it
234
-				removeDir($file);
235
-			}
236
-		}
237
-		// Remove Directory once Files have been removed (If Exists)
238
-		if (is_dir($path) === TRUE) {
239
-			rmdir($path);
240
-			//echo "<br>Removed Directory: " . $path . "<br><br>";
241
-		}
242
-	}
212
+        // Add trailing slash to $path if one is not there
213
+        if (substr($path, -1, 1) != "/") {
214
+            $path .= "/";
215
+        }
216
+
217
+        $normal_files = glob($path . "*");
218
+        $hidden_files = glob($path . "\.?*");
219
+        $all_files = array_merge($normal_files, $hidden_files);
220
+
221
+        foreach ($all_files as $file) {
222
+            # Skip pseudo links to current and parent dirs (./ and ../).
223
+            if (preg_match("/(\.|\.\.)$/", $file)) {
224
+                continue;
225
+            }
226
+
227
+            if (is_file($file) === TRUE) {
228
+                // Remove each file in this Directory
229
+                unlink($file);
230
+                echo "Removed File: " . $file . "<br>";
231
+            }
232
+            else if (is_dir($file) === TRUE) {
233
+                // If this Directory contains a Subdirectory, run this Function on it
234
+                removeDir($file);
235
+            }
236
+        }
237
+        // Remove Directory once Files have been removed (If Exists)
238
+        if (is_dir($path) === TRUE) {
239
+            rmdir($path);
240
+            //echo "<br>Removed Directory: " . $path . "<br><br>";
241
+        }
242
+    }
243 243
 
244 244
     function getValues()
245 245
     {
246 246
         $intranet = new IntranetMaintenance($this->name());
247 247
         $value = $intranet->get();
248 248
         if (isset($intranet->address)) {
249
-        	$address_value = $intranet->address->get();
249
+            $address_value = $intranet->address->get();
250 250
         } else {
251
-        	$address_value = array();
251
+            $address_value = array();
252 252
         }
253 253
 
254 254
         return array_merge($value, $address_value);
Please login to merge, or discard this patch.
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                 $contact_module = $this->getKernel()->useModule('contact');
49 49
 
50 50
                 $redirect = Intraface_Redirect::factory($kernel, 'go');
51
-                $url = $redirect->setDestination($contact_module->getPath()."select_contact", NET_SCHEME . NET_HOST . $this->url());
51
+                $url = $redirect->setDestination($contact_module->getPath()."select_contact", NET_SCHEME.NET_HOST.$this->url());
52 52
                 $redirect->askParameter('contact_id');
53 53
                 $redirect->setIdentifier('contact');
54 54
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         // add existing user
62 62
         if ($this->query('add_user') == 1) {
63 63
             $redirect = Intraface_Redirect::factory($this->getKernel(), 'go');
64
-            $url = $redirect->setDestination(NET_SCHEME . NET_HOST . $this->url('../../user'), NET_SCHEME . NET_HOST . $this->url(null));
64
+            $url = $redirect->setDestination(NET_SCHEME.NET_HOST.$this->url('../../user'), NET_SCHEME.NET_HOST.$this->url(null));
65 65
             $redirect->askParameter('user_id');
66 66
             $redirect->setIdentifier('add_user');
67 67
             return new k_SeeOther($url);
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                 $user = new UserMaintenance($redirect->getParameter('user_id'));
78 78
                 $user->setIntranetAccess($intranet->get('id'));
79 79
                 $user_id = $user->get('id');
80
-                return new k_SeeOther($this->url('../../user/' . $user->get('id'), array('intranet_id' => $this->name())));
80
+                return new k_SeeOther($this->url('../../user/'.$user->get('id'), array('intranet_id' => $this->name())));
81 81
             }
82 82
         }
83 83
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $gateway = new Intraface_ModuleGateway($this->mdb2);
93 93
         $modules = $gateway->getList();
94 94
 
95
-        $smarty = $this->template->create(dirname(__FILE__) . '/../templates/intranet/show');
95
+        $smarty = $this->template->create(dirname(__FILE__).'/../templates/intranet/show');
96 96
         return $smarty->render($this, array('modules' => $modules));
97 97
     }
98 98
 
@@ -103,13 +103,13 @@  discard block
 block discarded – undo
103 103
         $modul = $this->getKernel()->module("intranetmaintenance");
104 104
         $translation = $this->getKernel()->getTranslation('intranetmaintenance');
105 105
 
106
-        $smarty = $this->template->create(dirname(__FILE__) . '/../templates/intranet/edit');
106
+        $smarty = $this->template->create(dirname(__FILE__).'/../templates/intranet/edit');
107 107
         return $smarty->render($this);
108 108
     }
109 109
 
110 110
     function renderHtmlDelete()
111 111
     {
112
-        $smarty = $this->template->create(dirname(__FILE__) . '/../templates/intranet/delete');
112
+        $smarty = $this->template->create(dirname(__FILE__).'/../templates/intranet/delete');
113 113
         return $smarty->render($this);
114 114
     }
115 115
 
@@ -141,70 +141,70 @@  discard block
 block discarded – undo
141 141
     		throw new Exception('Du kan kun slette bambus beta og bambus - sune og lars');
142 142
     	}
143 143
 
144
-    	$db->query("DELETE FROM accounting_account WHERE intranet_id = " . $intranet_id);
145
-    	$db->query("DELETE FROM accounting_post WHERE intranet_id = " . $intranet_id);
146
-    	$db->query("DELETE FROM accounting_vat_period WHERE intranet_id = " . $intranet_id);
147
-    	$db->query("DELETE FROM accounting_voucher WHERE intranet_id = " . $intranet_id);
148
-    	$db->query("DELETE FROM accounting_voucher_file WHERE intranet_id = " . $intranet_id);
149
-    	$db->query("DELETE FROM accounting_year WHERE intranet_id = " . $intranet_id);
150
-    	$db->query("DELETE FROM accounting_year_end WHERE intranet_id = " . $intranet_id);
151
-    	$db->query("DELETE FROM accounting_year_end_action WHERE intranet_id = " . $intranet_id);
144
+    	$db->query("DELETE FROM accounting_account WHERE intranet_id = ".$intranet_id);
145
+    	$db->query("DELETE FROM accounting_post WHERE intranet_id = ".$intranet_id);
146
+    	$db->query("DELETE FROM accounting_vat_period WHERE intranet_id = ".$intranet_id);
147
+    	$db->query("DELETE FROM accounting_voucher WHERE intranet_id = ".$intranet_id);
148
+    	$db->query("DELETE FROM accounting_voucher_file WHERE intranet_id = ".$intranet_id);
149
+    	$db->query("DELETE FROM accounting_year WHERE intranet_id = ".$intranet_id);
150
+    	$db->query("DELETE FROM accounting_year_end WHERE intranet_id = ".$intranet_id);
151
+    	$db->query("DELETE FROM accounting_year_end_action WHERE intranet_id = ".$intranet_id);
152 152
 
153 153
     	// her skulle vi slette noget address
154 154
 
155
-    	$db->query("DELETE FROM contact WHERE intranet_id = " . $intranet_id);
156
-    	$db->query("DELETE FROM contact_person WHERE intranet_id = " . $intranet_id);
157
-    	$db->query("DELETE FROM contact_message WHERE intranet_id  = " . $intranet_id);
155
+    	$db->query("DELETE FROM contact WHERE intranet_id = ".$intranet_id);
156
+    	$db->query("DELETE FROM contact_person WHERE intranet_id = ".$intranet_id);
157
+    	$db->query("DELETE FROM contact_message WHERE intranet_id  = ".$intranet_id);
158 158
 
159
-    	$db->query("DELETE FROM cms_element WHERE intranet_id = " . $intranet_id);
160
-    	$db->query("DELETE FROM cms_page WHERE intranet_id = " . $intranet_id);
161
-    	$db->query("DELETE FROM cms_parameter WHERE intranet_id = " . $intranet_id);
162
-    	$db->query("DELETE FROM cms_section WHERE intranet_id = " . $intranet_id);
163
-    	$db->query("DELETE FROM cms_site WHERE intranet_id = " . $intranet_id);
164
-    	$db->query("DELETE FROM cms_template WHERE intranet_id = " . $intranet_id);
165
-    	$db->query("DELETE FROM cms_template_section WHERE intranet_id = " . $intranet_id);
159
+    	$db->query("DELETE FROM cms_element WHERE intranet_id = ".$intranet_id);
160
+    	$db->query("DELETE FROM cms_page WHERE intranet_id = ".$intranet_id);
161
+    	$db->query("DELETE FROM cms_parameter WHERE intranet_id = ".$intranet_id);
162
+    	$db->query("DELETE FROM cms_section WHERE intranet_id = ".$intranet_id);
163
+    	$db->query("DELETE FROM cms_site WHERE intranet_id = ".$intranet_id);
164
+    	$db->query("DELETE FROM cms_template WHERE intranet_id = ".$intranet_id);
165
+    	$db->query("DELETE FROM cms_template_section WHERE intranet_id = ".$intranet_id);
166 166
 
167
-    	$db->query("DELETE FROM comment WHERE intranet_id = " . $intranet_id);
167
+    	$db->query("DELETE FROM comment WHERE intranet_id = ".$intranet_id);
168 168
 
169
-    	$db->query("DELETE FROM debtor WHERE intranet_id = " . $intranet_id);
170
-    	$db->query("DELETE FROM debtor_item WHERE intranet_id = " . $intranet_id);
169
+    	$db->query("DELETE FROM debtor WHERE intranet_id = ".$intranet_id);
170
+    	$db->query("DELETE FROM debtor_item WHERE intranet_id = ".$intranet_id);
171 171
 
172
-    	$db->query("DELETE FROM email WHERE intranet_id = " . $intranet_id);
173
-    	$db->query("DELETE FROM email_attachment WHERE intranet_id = " . $intranet_id);
172
+    	$db->query("DELETE FROM email WHERE intranet_id = ".$intranet_id);
173
+    	$db->query("DELETE FROM email_attachment WHERE intranet_id = ".$intranet_id);
174 174
 
175
-    	$db->query("DELETE FROM file_handler WHERE intranet_id = " . $intranet_id);
176
-    	$db->query("DELETE FROM file_handler_instance WHERE intranet_id = " . $intranet_id);
177
-    	$db->query("DELETE FROM filehandler_append_file WHERE intranet_id = " . $intranet_id);
175
+    	$db->query("DELETE FROM file_handler WHERE intranet_id = ".$intranet_id);
176
+    	$db->query("DELETE FROM file_handler_instance WHERE intranet_id = ".$intranet_id);
177
+    	$db->query("DELETE FROM filehandler_append_file WHERE intranet_id = ".$intranet_id);
178 178
 
179
-    	$db->query("DELETE FROM invoice_payment WHERE intranet_id = " . $intranet_id);
180
-    	$db->query("DELETE FROM invoice_reminder WHERE intranet_id = " . $intranet_id);
181
-    	$db->query("DELETE FROM invoice_reminder_item WHERE intranet_id = " . $intranet_id);
182
-    	$db->query("DELETE FROM invoice_reminder_unpaid_reminder WHERE intranet_id = " . $intranet_id);
179
+    	$db->query("DELETE FROM invoice_payment WHERE intranet_id = ".$intranet_id);
180
+    	$db->query("DELETE FROM invoice_reminder WHERE intranet_id = ".$intranet_id);
181
+    	$db->query("DELETE FROM invoice_reminder_item WHERE intranet_id = ".$intranet_id);
182
+    	$db->query("DELETE FROM invoice_reminder_unpaid_reminder WHERE intranet_id = ".$intranet_id);
183 183
 
184
-    	$db->query("DELETE FROM keyword WHERE intranet_id = " . $intranet_id);
185
-    	$db->query("DELETE FROM keyword_x_object WHERE intranet_id = " . $intranet_id);
184
+    	$db->query("DELETE FROM keyword WHERE intranet_id = ".$intranet_id);
185
+    	$db->query("DELETE FROM keyword_x_object WHERE intranet_id = ".$intranet_id);
186 186
 
187
-    	$db->query("DELETE FROM newsletter_archieve WHERE intranet_id = " . $intranet_id);
188
-    	$db->query("DELETE FROM newsletter_list WHERE intranet_id = " . $intranet_id);
189
-    	$db->query("DELETE FROM newsletter_subscriber WHERE intranet_id = " . $intranet_id);
187
+    	$db->query("DELETE FROM newsletter_archieve WHERE intranet_id = ".$intranet_id);
188
+    	$db->query("DELETE FROM newsletter_list WHERE intranet_id = ".$intranet_id);
189
+    	$db->query("DELETE FROM newsletter_subscriber WHERE intranet_id = ".$intranet_id);
190 190
 
191
-    	$db->query("DELETE FROM onlinepayment WHERE intranet_id = " . $intranet_id);
191
+    	$db->query("DELETE FROM onlinepayment WHERE intranet_id = ".$intranet_id);
192 192
 
193
-    	$db->query("DELETE FROM procurement WHERE intranet_id = " . $intranet_id);
194
-    	$db->query("DELETE FROM procurement_item WHERE intranet_id = " . $intranet_id);
193
+    	$db->query("DELETE FROM procurement WHERE intranet_id = ".$intranet_id);
194
+    	$db->query("DELETE FROM procurement_item WHERE intranet_id = ".$intranet_id);
195 195
 
196
-    	$db->query("DELETE FROM product WHERE intranet_id = " . $intranet_id);
197
-    	$db->query("DELETE FROM product_detail WHERE intranet_id = " . $intranet_id);
198
-    	$db->query("DELETE FROM product_related WHERE intranet_id = " . $intranet_id);
196
+    	$db->query("DELETE FROM product WHERE intranet_id = ".$intranet_id);
197
+    	$db->query("DELETE FROM product_detail WHERE intranet_id = ".$intranet_id);
198
+    	$db->query("DELETE FROM product_related WHERE intranet_id = ".$intranet_id);
199 199
 
200
-    	$db->query("DELETE FROM stock_adaptation WHERE intranet_id = " . $intranet_id);
201
-    	$db->query("DELETE FROM stock_regulation WHERE intranet_id = " . $intranet_id);
200
+    	$db->query("DELETE FROM stock_adaptation WHERE intranet_id = ".$intranet_id);
201
+    	$db->query("DELETE FROM stock_regulation WHERE intranet_id = ".$intranet_id);
202 202
 
203
-    	$db->query("DELETE FROM todo_list WHERE intranet_id = " . $intranet_id);
204
-    	$db->query("DELETE FROM todo_item WHERE intranet_id = " . $intranet_id);
205
-    	$db->query("DELETE FROM todo_contact WHERE intranet_id = " . $intranet_id);
203
+    	$db->query("DELETE FROM todo_list WHERE intranet_id = ".$intranet_id);
204
+    	$db->query("DELETE FROM todo_item WHERE intranet_id = ".$intranet_id);
205
+    	$db->query("DELETE FROM todo_contact WHERE intranet_id = ".$intranet_id);
206 206
 
207
-    	$this->removeDir('/home/intraface/upload/' . $intranet_id . '/');
207
+    	$this->removeDir('/home/intraface/upload/'.$intranet_id.'/');
208 208
     }
209 209
 
210 210
     protected function removeDir($path)
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
 			$path .= "/";
215 215
 		}
216 216
 
217
-		$normal_files = glob($path . "*");
218
-		$hidden_files = glob($path . "\.?*");
217
+		$normal_files = glob($path."*");
218
+		$hidden_files = glob($path."\.?*");
219 219
 		$all_files = array_merge($normal_files, $hidden_files);
220 220
 
221 221
 		foreach ($all_files as $file) {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 			if (is_file($file) === TRUE) {
228 228
 				// Remove each file in this Directory
229 229
 				unlink($file);
230
-				echo "Removed File: " . $file . "<br>";
230
+				echo "Removed File: ".$file."<br>";
231 231
 			}
232 232
 			else if (is_dir($file) === TRUE) {
233 233
 				// If this Directory contains a Subdirectory, run this Function on it
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -228,8 +228,7 @@
 block discarded – undo
228 228
 				// Remove each file in this Directory
229 229
 				unlink($file);
230 230
 				echo "Removed File: " . $file . "<br>";
231
-			}
232
-			else if (is_dir($file) === TRUE) {
231
+			} else if (is_dir($file) === TRUE) {
233 232
 				// If this Directory contains a Subdirectory, run this Function on it
234 233
 				removeDir($file);
235 234
 			}
Please login to merge, or discard this patch.
src/Intraface/modules/intranetmaintenance/IntranetMaintenance.php 3 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      * Removes the intranets access to a module
117 117
      *
118 118
      * @param mixed module_id either name or id on module
119
-     * @return boolean true on success
119
+     * @return null|boolean true on success
120 120
      */
121 121
     public function removeModuleAccess($module_id)
122 122
     {
@@ -323,7 +323,6 @@  discard block
 block discarded – undo
323 323
     /**
324 324
      * returns the RandomKeyGenerator
325 325
      *
326
-     * @param integer $length the length of the generated key
327 326
      * @return object RandomKeyGenerator
328 327
      */
329 328
     private function getRandomKeyGenerator()
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@
 block discarded – undo
219 219
             $this->id = $this->db->lastInsertID('intranet', 'id');
220 220
 
221 221
             if (PEAR::isError($this->id)) {
222
-                   throw new Exception("Error in IntranetMaintenance: ".$id->getMessage());
222
+                    throw new Exception("Error in IntranetMaintenance: ".$id->getMessage());
223 223
             }
224 224
             $this->load();
225 225
         } else {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
         $intranet = array();
289 289
         $db = $this->dbquery->getRecordset('DISTINCT(intranet.id), intranet.name');
290 290
         while ($db->nextRecord()) {
291
-            $intranet[$i]['id'] =   $db->f('id');
291
+            $intranet[$i]['id'] = $db->f('id');
292 292
             $intranet[$i]['name'] = $db->f('name');
293 293
             $i++;
294 294
         }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
      */
317 317
     function setContact($contact_id)
318 318
     {
319
-        $this->db->query("UPDATE intranet SET contact_id = ".intval($contact_id)." WHERE id = " . intval($this->id));
319
+        $this->db->query("UPDATE intranet SET contact_id = ".intval($contact_id)." WHERE id = ".intval($this->id));
320 320
         return true;
321 321
     }
322 322
 
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 
334 334
     private function identifierIsUnique($identifier)
335 335
     {
336
-        $result = $this->db->query("SELECT identifier FROM intranet WHERE identifier = ".$this->db->quote($identifier, 'text')." AND id <> " . intval($this->id));
336
+        $result = $this->db->query("SELECT identifier FROM intranet WHERE identifier = ".$this->db->quote($identifier, 'text')." AND id <> ".intval($this->id));
337 337
         if ($result->numRows() > 1) {
338 338
             return false;
339 339
         }
Please login to merge, or discard this patch.
src/Intraface/modules/intranetmaintenance/UserMaintenance.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -193,7 +193,7 @@
 block discarded – undo
193 193
      * @param mixed sub_access_id either id or name of sub_access
194 194
      * @param integer intranet_id id of intranet to give access
195 195
      *
196
-     * @return void
196
+     * @return boolean
197 197
      */
198 198
     function setSubAccess($module_id, $sub_access_id, $intranet_id = 0)
199 199
     {
Please login to merge, or discard this patch.