Project

General

Profile

Download (21.7 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/usr/local/bin/php
2
<?php
3
/*
4
    pkg_mgr_install.php
5
    part of pfSense (http://www.pfSense.com)
6
    Copyright (C) 2004 Scott Ullrich
7
    All rights reserved.
8

    
9
    Redistribution and use in source and binary forms, with or without
10
    modification, are permitted provided that the following conditions are met:
11

    
12
    1. Redistributions of source code must retain the above copyright notice,
13
       this list of conditions and the following disclaimer.
14

    
15
    2. Redistributions in binary form must reproduce the above copyright
16
       notice, this list of conditions and the following disclaimer in the
17
       documentation and/or other materials provided with the distribution.
18

    
19
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
    POSSIBILITY OF SUCH DAMAGE.
29
*/
30

    
31
require("guiconfig.inc");
32
require("xmlparse_pkg.inc");
33

    
34
if(!file_exists("/usr/local/pkg/")) mwexec("mkdir -p /usr/local/pkg/");
35
if(!file_exists("/usr/local/www/ext/")) mwexec("mkdir -p /usr/local/www/ext");
36

    
37
$pb_percent = 1;
38

    
39
/*
40
 *   update_output_window: update top textarea dynamically.
41
 */
42
function update_status($status) {
43
            echo "\n<script language=\"JavaScript\">document.forms[0].status.value=\"" . $status . "\";</script>";
44
}
45

    
46
/*
47
 *   update_output_window: update bottom textarea dynamically.
48
 */
49
function update_output_window($text) {
50
            $log = ereg_replace("\n", "\\n", $text);
51
            echo "\n<script language=\"JavaScript\">this.document.forms[0].output.value = \"" . $log . "\";</script>";
52
}
53

    
54
/*
55
 *   get_dir: return an array of $dir
56
 */
57
function get_dir($dir) {
58
            $dir_array = array();
59
            $d = dir($dir);
60
            while (false !== ($entry = $d->read())) {
61
                        array_push($dir_array, $entry);
62
            }
63
            $d->close();
64
            return $dir_array;
65
}
66

    
67
/*
68
 *   exec_command_and_return_text_array: execute command and return output
69
 */
70
function exec_command_and_return_text_array($command) {
71
            $counter = 0;
72
            $fd = popen($command . " 2>&1 ", "r");
73
            echo "\n<script language=\"JavaScript\">this.document.forms[0].output.value = '';</script>\n";
74
            while(!feof($fd)) {
75
                        $tmp .= fread($fd,49);
76
                        echo "\n<script language=\"JavaScript\">this.document.forms[0].output.value = this.document.forms[0].output.value + \"" . $tmp . $extrabreak .  "\"; </script>";
77
            }
78
            fclose($fd);
79
            $temp_array = split("\n", $tmp);
80
            return $tmp_array;
81
}
82

    
83
/*
84
 *   exec_command_and_return_text: execute command and return output
85
 */
86
function exec_command_and_return_text($command) {
87
            $counter = 0;
88
            $tmp = "";
89
            $fd = popen($command . " 2>&1 ", "r");
90
            echo "\n<script language=\"JavaScript\">this.document.forms[0].output.value = '';</script>\n";
91
            while(!feof($fd)) {
92
                        $tmp .= fread($fd,49);
93
                        echo "\n<script language=\"JavaScript\">this.document.forms[0].output.value = this.document.forms[0].output.value + \"" . $tmp . $extrabreak .  "\"; </script>";
94
            }
95
            fclose($fd);
96
            return $tmp;
97
}
98

    
99
/*
100
 *   exec_command_and_return_text: execute command and update output window dynamically
101
 */
102
function execute_command_return_output($command) {
103
    global $fd_log, $pb_percent;
104
    if($pb_percent > 100) $pb_percent = 1;
105
    update_progress_bar($pb_percent);
106
    $fd = popen($command . " 2>&1 ", "r");
107
    echo "\n<script language=\"JavaScript\">this.document.forms[0].output.value = \"\";</script>";
108
    $counter = 0;
109
    $counter2 = 0;
110
    while(!feof($fd)) {
111
	$tmp = fread($fd, 50);
112
        fwrite($fd_log, $tmp);
113
	$tmp1 = ereg_replace("\n","\\n", $tmp);
114
	$text = ereg_replace("\"","'", $tmp1);
115
	echo "\n<script language=\"JavaScript\">this.document.forms[0].output.value = this.document.forms[0].output.value + \"" . $tmp . $extrabreak .  "\"; f('output'); </script>";
116
    }
117
    $pb_percent++;
118
    fclose($fd);
119
}
120

    
121
function update_progress_bar($percent) {
122
            if($percent > 100) $percent = 1;
123
            echo "\n<script type=\"text/javascript\" language=\"javascript\">";
124
            echo "\ndocument.progressbar.style.width='" . $percent . "%';";
125
            echo "\n</script>";
126
}
127

    
128
$a_out = &$pkg_config['packages'];
129

    
130
$packages_to_install = Array();
131

    
132
?>
133
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
134
<html>
135
<head>
136
<title><?=gentitle("System: Package Manager: Install Package");?></title>
137
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
138
<link href="gui.css" rel="stylesheet" type="text/css">
139
</head>
140

    
141
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
142
<?php
143
include("fbegin.inc");
144
?>
145
<p class="pgtitle">System: Package Manager: Install Package</p>
146
<form action="firewall_nat_out_load_balancing.php" method="post">
147

    
148
<?php if ($savemsg) print_info_box($savemsg); ?>
149
<?php
150

    
151
if($_GET['showlog'] <> "") {
152
            echo "<table>";
153
            echo "<tr><td>";
154
            echo "<pre>";
155
            // reopen and read log in
156
            $fd = fopen("/tmp/pkg_mgr.log", "r");
157
            $tmp = "";
158
            while(!feof($fd)) {
159
                        $tmp .= fread($fd,49);
160
            }
161
            fclose($fd);
162
            echo $tmp;
163
            echo "</pre>";
164
            echo "</td></tr>";
165
            echo "</table>";
166
            exit;
167
}
168

    
169
/*
170
 *   open logging facility
171
 */
172
$fd_log = fopen("/tmp/pkg_mgr.log", "w");
173
fwrite($fd_log, "Begin of Package Manager installation session.\n");
174

    
175
if(!file_exists("/tmp/pkg_config.xml")) {
176
            mwexec("cd {$g['tmp_path']} && /usr/bin/fetch \"http://www.pfsense.com/packages/pkg_config.xml\" >/dev/null 2>&1 ");
177
            if(!file_exists("{$g['tmp_path']}/pkg_config.xml")) {
178
                        print_info_box_np("Could not download pkg_config.xml from pfSense.com.  Check your DNS settings.");
179
                        die;
180
            }
181
}
182

    
183
$pkg_config = parse_xml_config_pkg("{$g['tmp_path']}/pkg_config.xml", "pfsensepkgs");
184

    
185
if(!$pkg_config['packages'])
186
    print_info_box_np("Could not find any packages in pkg_config.xml");
187

    
188
?>
189
<table width="100%" border="0" cellpadding="0" cellspacing="0">  <tr><td>
190
  <ul id="tabnav">
191
    <li class="tabinact"><a href="pkg_mgr.php">Available Packages</a></li>
192
    <li class="tabact">Installed Packages</a></li>
193
  </ul>
194
  </td></tr>
195
  <tr>
196
    <td class="tabcont">
197
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
198
               <tr>
199
                 <td>
200
                     <!-- progress bar -->
201
                     <center>
202
                     <table id="progholder" name="progholder" height='20' border='1' bordercolor='black' width='420' bordercolordark='#000000' bordercolorlight='#000000' style='border-collapse: collapse' colspacing='2' cellpadding='2' cellspacing='2'><tr><td><img border='0' src='progress_bar.gif' width='280' height='23' name='progressbar' id='progressbar'></td></tr></table>
203
                     <br>
204
	             <!-- status box -->
205
                     <textarea cols="60" rows="1" name="status" id="status" wrap="hard">One moment please... This will take a while!</textarea>
206
                     <!-- command output box -->
207
	             <textarea cols="60" rows="25" name="output" id="output" wrap="hard"></textarea>
208
                     </center>
209
                 </td>
210
               </tr>
211
        </table>
212
    </td>
213
  </tr>
214
</table>
215
</form>
216
<?php include("fend.inc"); ?>
217
</body>
218
</html>
219

    
220
<?php
221

    
222
if($_GET['mode'] == "reinstallall") {
223
    /*
224
     *  Loop through installed packages and if name matches
225
     *  push the package id onto array to reinstall
226
     */
227
    $counter = 0;
228
    foreach($pkg_config['packages']['package'] as $available_package) {
229
        foreach($config['installedpackages']['package'] as $package) {
230
            if($package['name'] == $available_package['name']) {
231
                array_push($packages_to_install, $counter);
232
                update_status("Adding package " . $package['name']);
233
                fwrite($fd_log, "Adding (" . $counter . ") " . $package['name'] . " to package installation array.\n" . $status);
234
            }
235
        }
236
        $counter++;
237
    }
238
} else {
239
    /*
240
     * Push the desired package id onto the install packages array
241
     */
242
    fwrite($fd_log, "Single package installation started.\n");
243
    array_push($packages_to_install, $_GET['id']);
244
}
245

    
246
/*
247
 *  Loop through packages_to_install, installing needed packages
248
 */
249
foreach ($packages_to_install as $id) {
250

    
251
    $pkg_config = parse_xml_config_pkg("{$g['tmp_path']}/pkg_config.xml", "pfsensepkgs");
252

    
253
    update_progress_bar($pb_percent);
254
    $pb_percent += 10;
255

    
256
    /*
257
     * install the package
258
    */
259

    
260
    // Ensure directories are in place for pkg_add.
261
    mwexec("mkdir /usr/local/www/ext/Services >/dev/null 2>&1");
262
    mwexec("mkdir /usr/local/www/ext/System >/dev/null 2>&1");
263
    mwexec("mkdir /usr/local/www/ext/Interfaces >/dev/null 2>&1");
264
    mwexec("mkdir /usr/local/www/ext/Firewall >/dev/null 2>&1");
265
    mwexec("mkdir /usr/local/www/ext/VPN >/dev/null 2>&1");
266
    mwexec("mkdir /usr/local/www/ext/Status >/dev/null 2>&1");
267
    mwexec("mkdir /usr/local/www/ext/Diagnostics >/dev/null 2>&1");
268
    mwexec("mkdir /usr/local/pkg >/dev/null 2>&1");
269

    
270
    update_progress_bar($pb_percent);
271
    $pb_percent += 10;
272

    
273
    $a_out = &$pkg_config['packages']['package'];
274
    $pkgent = array();
275
    $pkgent['name'] = $pkg_config['packages']['package'][$id]['name'];
276
    $pkgent['descr'] = $pkg_config['packages']['package'][$id]['descr'];
277
    $pkgent['category'] = $pkg_config['packages']['package'][$id]['category'];
278

    
279
    $pkgent['version'] = $pkg_config['packages']['package'][$id]['version'];
280

    
281
    $pkgent['depends_on_package'] = $a_out[$id]['depends_on_package'];
282
    $pkgent['depends_on_package_base_url'] = $a_out[$id]['depends_on_package_base_url'];
283
    $pkgent['pfsense_package'] = $a_out[$id]['pfsense_package'];
284
    $pkgent['pfsense_package_base_url'] = $a_out[$id]['pfsense_package_base_url'];
285
    $pkgent['configurationfile'] = $a_out[$id]['configurationfile'];
286
    if($pkg_config['packages']['package'][$id]['logging']) {
287
        // logging facilities.
288
        $pkgent['logging']['facility'] = $pkg_config['packages']['package'][$id]['logging']['facility'];
289
        $pkgent['logging']['logfile_name'] = $pkg_config['packages']['package'][$id]['logging']['logfile_name'];
290
        mwexec("/usr/sbin/clog -i -s 32768 /var/log/" . $pkgent['logging']['logfile_name']);
291
        mwexec("chmod 0600 /var/log/" . $pkgent['logging']['logfile_name']);
292
        fwrite($fd_log, "Adding text to file /etc/syslog.conf\n");
293
        add_text_to_file("/etc/syslog.conf", $pkgent['logging']['facilityname'] . "\t\t\t" . $pkgent['logging']['logfilename']);
294
        mwexec("/usr/bin/killall -HUP syslogd");
295
    }
296
    $a_out = &$config['packages']['package']; // save item to installedpkgs
297

    
298
    fwrite($fd_log, "Begining (" . $id. ") " . $pkgent['name'] . " package installation.\n" . $status);
299

    
300
    update_progress_bar($pb_percent);
301
    $pb_percent += 10;
302

    
303
    fwrite($fd_log, "ls /var/db/pkg | grep " . $pkgent['name'] . "\n" . $status);
304
    if($status <> "") {
305
                // package is already installed!?
306
                if(!$_GET['mode'] == "reinstallall")
307
                    print_info_box_np("NOTICE! " . $pkgent['name'] . " is already installed!  Installation will be registered.");
308
    }
309

    
310
    if($pkg_config['packages']['package'][$id]['config_file'] <> "") {
311
        update_status("Downloading configuration file.");
312
        fwrite($fd_log, "Downloading configuration file " . $pkg_config['packages']['package'][$id]['config_file'] . " ... \n");
313
        update_progress_bar($pb_percent);
314
        $pb_percent += 10;
315
        mwexec("cd /usr/local/pkg/ && fetch " . $pkg_config['packages']['package'][$id]['config_file']);
316
        if(!file_exists("/usr/local/pkg/" . $pkgent['name'] . ".xml")) {
317
            update_output_window("ERROR!  Could not fetch " . $pkg_config['packages']['package'][$id]['config_file'] . "\n");
318
            exit;
319
        }
320
    }
321

    
322
    update_status("Downloading and installing " . $pkgent['name'] . " - " . $pkgent['pfsense_package'] . " and its dependencies ... This could take a moment ...");
323
    fwrite($fd_log, "Downloading and installing " . $pkgent['name'] . " ... \n");
324

    
325
    update_progress_bar($pb_percent);
326
    $pb_percent += 10;
327

    
328
    if ($pkgent['pfsense_package_base_url'] <> "") {
329
        $text = exec_command_and_return_text("cd /tmp/ && /usr/sbin/pkg_add -r " . $pkgent['pfsense_package_base_url'] . "/" . $pkgent['pfsense_package']);
330
        update_output_window($text);
331
        fwrite($fd_log, "Executing: cd /tmp/ && /usr/sbin/pkg_add -r " . $pkgent['pfsense_package_base_url'] . "/" . $pkgent['pfsense_package'] . "\n" . $text);
332
    }
333

    
334
    update_progress_bar($pb_percent);
335
    $pb_percent += 10;
336

    
337
    if ($pkgent['depends_on_package_base_url'] <> "") {
338
                update_status("Downloading and installing " . $pkgent['name'] . " and its dependencies ... This could take a moment ...");
339
                $text = exec_command_and_return_text("cd /tmp/ && /usr/sbin/pkg_add -r " . $pkgent['depends_on_package_base_url'] . "/" . $pkgent['depends_on_package']);
340
                update_output_window($text);
341
                fwrite($fd_log, "cd /tmp/ && /usr/sbin/pkg_add -r " . $pkgent['depends_on_package_base_url'] . "/" . $pkgent['depends_on_package'] . "\n" . $text);;
342
    }
343

    
344
    if ($pkgent['depends_on_package_base_url'] <> "" or $pkgent['pfsense_package_base_url'] <> "") {
345
        $status = exec_command_and_return_text("ls /var/db/pkg | grep " . $pkgent['name']);
346
        fwrite($fd_log, "ls /var/db/pkg | grep " . $pkgent['name'] . "\n" . $status);
347
        if($status <> "") {
348
                    update_status("Package installed.  Lets finish up.");
349
                    fwrite($fd_log, "Package installed.  Lets finish up.\n");
350
        } else {
351
                    fwrite($fd_log, "Package WAS NOT installed properly.\n");
352
                    fclose($fd_log);
353
                    $filecontents = exec_command_and_return_text("cat " . $file);
354
                    update_progress_bar(100);
355
                    echo "\n<script language=\"JavaScript\">document.progressbar.style.visibility='hidden';</script>";
356
                    echo "\n<script language=\"JavaScript\">document.progholder.style.visibility='hidden';</script>";
357
                    update_status("Package WAS NOT installed properly...Something went wrong..\n" . $filecontents);
358
                    update_output_window("Error during package installation.");
359
                    sleep(1);
360
                    die;
361
        }
362
    }
363

    
364
    update_progress_bar($pb_percent);
365
    $pb_percent += 10;
366

    
367
    $config = parse_xml_config("{$g['conf_path']}/config.xml", $g['xml_rootobj']);
368

    
369
    update_progress_bar($pb_percent);
370
    $pb_percent += 10;
371

    
372
    $config['installedpackages']['package'][] = $pkgent;
373

    
374
    if (isset($id) && $a_out[$id])
375
            $a_out[$id] = $pkgent;
376
    else
377
            $a_out[] = $pkgent;
378

    
379
    update_progress_bar($pb_percent);
380
    $pb_percent += 10;
381

    
382
    if(!$_GET['mode'] == "reinstallall")
383
        write_config();
384

    
385
    update_progress_bar($pb_percent);
386
    $pb_percent += 10;
387

    
388
    $name = $pkgent['name'];
389

    
390
    update_progress_bar($pb_percent);
391
    $pb_percent++;
392

    
393
    /*
394
     * parse the config file for this package and install neededtext items.
395
     *
396
    */
397
    if(file_exists("/usr/local/pkg/" . $pkgent['name'] . ".xml")) {
398
                $package_conf = parse_xml_config_pkg("/usr/local/pkg/" . $pkgent['name'] . ".xml", "packagegui");
399
                if($package_conf['modify_system']['item'] <> "") {
400
                    foreach ($package_conf['modify_system']['item'] as $ms) {
401
                        update_progress_bar($pb_percent);
402
                        $pb_percent += 10;
403
                        if($ms['textneeded']) {
404
                            add_text_to_file($ms['modifyfilename'],$ms['textneeded']);
405
                        }
406
                    }
407
                }
408

    
409
                /*
410
                 * fetch additional files needed for package if defined
411
                 * and uncompress if needed.
412
                 */
413
                if ($package_conf['additional_files_needed'] <> "") {
414
                            foreach($package_conf['additional_files_needed']['item'] as $afn) {
415
                                        update_progress_bar($pb_percent);
416
                                        $pb_percent += 10;
417
                                        $filename = get_filename_from_url($afn);
418
                                        update_status("Downloading additional files needed for package " . $filename . " ...");
419
                                        system("cd /usr/local/pkg && /usr/bin/fetch " .  $afn . " 2>/dev/null");
420
                                        if(stristr($filename, '.tgz') <> "")
421
                                                    system("cd /usr/local/pkg && tar xzvf " . $filename . " -C / >/dev/null 2>&1");
422
                            }
423
                }
424

    
425
                /*
426
                 * loop through menu installation items
427
                 * installing multiple items if need be.
428
                */
429
                if(is_array($package_conf['menu']))
430
                    foreach ($package_conf['menu'] as $menu) {
431
                                // install menu item into the ext folder
432
                                fwrite($fd_log, "Adding menu option to " . $menu['section'] . "/" . $menu['name'] . "\n");
433
                                $fd = fopen("/usr/local/www/ext/" . $menu['section'] . "/" . $menu['name'] , "w");
434
                                if($menu['url'] <> "") {
435
                                            // override $myurl for script.
436
                                            $toeval = "\$myurl = \"" . getenv("HTTP_HOST") . "\"; \n";
437
                                            eval($toeval);
438
                                            // eval url so that above $myurl item can be processed if need be.
439
                                            $urltmp = $menu['url'];
440
                                            $toeval = "\$url = \"" . $urltmp . "\"; \n";
441
                                            eval($toeval);
442
                                            fwrite($fd, $url . "\n");
443
                                } else {
444
                                            $xml = "";
445
                                            if(stristr($menu['configfile'],".xml") == "") $xml = ".xml";
446
                                            fwrite($fd, "/pkg.php?xml=" . $menu['configfile'] . $xml . "\n");
447
                                }
448
                                fclose($fd);
449
                }
450
    } else {
451
                update_output_window("WARNING! /usr/local/pkg/" . $pkgent['name'] . ".xml" . " does not exist!\n");
452
                fwrite($fd_log, "WARNING! /usr/local/pkg/" . $pkgent['name'] . ".xml" . " does not exist!\n");
453
    }
454
    fwrite($fd_log, "End of Package Manager installation session.\n");
455

    
456
    update_progress_bar($pb_percent);
457
    $pb_percent += 10;
458

    
459
    // return dependency list to output later.
460
    $command = "TODELETE=`ls /var/db/pkg | grep " . $name . "` && /usr/sbin/pkg_info -r \$TODELETE | grep Dependency: | cut -d\" \" -f2";
461
    $dependencies = exec_command_and_return_text($command);
462
    fwrite($fd_log, "Installed " . $name . " and the following dependencies:\n" . $dependencies);
463

    
464
    update_progress_bar($pb_percent);
465
    $pb_percent += 10;
466

    
467
    if($package_conf['custom_php_install_command']) {
468
        update_status("Executing post install commands...");
469
        $pb_percent += 50;
470
        update_progress_bar(50);
471
        eval($package_conf['custom_php_install_command']);
472
    }
473

    
474
    $pb_percent += 10;
475
    update_progress_bar($pb_percent);
476

    
477
    if ($pkgent['depends_on_package_base_url'] <> "" or $pkgent['pfsense_package_base_url'] <> "") {
478
        $status = exec_command_and_return_text("ls /var/db/pkg | grep " . $pkgent['name']);
479
        fwrite($fd_log, "ls /var/db/pkg | grep " . $pkgent['name'] . "\n" . $status);
480
        if($status <> "") {
481
                    update_status("Package installation completed.");
482
                    fwrite($fd_log, "Package installation completed.\n");
483
        } else {
484
                    update_status("Package WAS NOT installed properly.");
485
                    fwrite($fd_log, "Package WAS NOT installed properly.\n");
486
        }
487
    } else {
488
        update_status("Package installation completed.");
489
        fwrite($fd_log, "Package installation completed.\n");
490
    }
491

    
492
    update_progress_bar(100);
493

    
494
}
495

    
496
// close log
497
fclose($fd_log);
498

    
499
echo "<p><center>Installation completed.  Show <a href=\"pkg_mgr_install.php?showlog=true\">install log</a></center>";
500

    
501
echo "\n<script language=\"JavaScript\">document.progressbar.style.visibility='hidden';</script>";
502
echo "\n<script language=\"JavaScript\">document.progholder.style.visibility='hidden';</script>";
503

    
504
function add_text_to_file($file, $text) {
505
    global $fd_log;
506
    fwrite($fd_log, "Adding needed text items:\n");
507
    $filecontents = exec_command_and_return_text("cat " . $file);
508
    $filecontents = str_replace($text, "", $filecontents);
509
    $text = $filecontents . $text;
510
    fwrite($fd_log, $text . "\n");
511
    $fd = fopen($file, "w");
512
    fwrite($fd, $text . "\n");
513
    fclose($fd);
514
}
515

    
516
function get_filename_from_url($url) {
517
            $filenamesplit = split("/", $url);
518
            foreach($filenamesplit as $fn) $filename = $fn;
519
            return $filename;
520
}
521

    
522
?>
523

    
524

    
525

    
526

    
527

    
528

    
529

    
530

    
531

    
(56-56/100)