aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/Fit123/bin/afc/reset_states.sh7
-rw-r--r--config/Fit123/bin/cpaddon/filter.inc3332
-rwxr-xr-xconfig/Fit123/bin/cpaddon/services_captiveportal.abc608
-rwxr-xr-xconfig/Fit123/bin/date/index.abc264
-rwxr-xr-xconfig/Fit123/bin/dnssrv/system.abc347
-rw-r--r--config/Fit123/bin/ltsp/services.inc1320
-rwxr-xr-xconfig/Fit123/bin/ltsp/services_dhcp.abc696
-rw-r--r--config/Fit123/cass.xml59
-rw-r--r--config/Fit123/ddns.xml72
-rw-r--r--config/Fit123/fit123.inc428
-rw-r--r--config/Fit123/fit123.xml84
-rw-r--r--config/archive/assp.xml79
-rw-r--r--config/archive/clamsmtp.inc57
-rw-r--r--config/archive/clamsmtp.xml69
-rw-r--r--config/archive/doorman.xml157
-rw-r--r--config/archive/doormanusers.xml142
-rw-r--r--config/archive/dspam/conf.default/config.xml1020
-rw-r--r--config/archive/dspam/pear/Image/Canvas.php733
-rw-r--r--config/archive/dspam/pear/Image/Canvas/Color.php182
-rw-r--r--config/archive/dspam/pear/Image/Canvas/Fonts/README12
-rw-r--r--config/archive/dspam/pear/Image/Canvas/Fonts/fontmap.txt25
-rw-r--r--config/archive/dspam/pear/Image/Canvas/GD.php1693
-rw-r--r--config/archive/dspam/pear/Image/Canvas/GD/JPG.php119
-rw-r--r--config/archive/dspam/pear/Image/Canvas/GD/PNG.php125
-rw-r--r--config/archive/dspam/pear/Image/Canvas/ImageMap.php354
-rw-r--r--config/archive/dspam/pear/Image/Canvas/PDF.php1007
-rw-r--r--config/archive/dspam/pear/Image/Canvas/SVG.php918
-rw-r--r--config/archive/dspam/pear/Image/Canvas/Tool.php217
-rw-r--r--config/archive/dspam/pear/Image/Canvas/WithMap.php278
-rw-r--r--config/archive/dspam/pear/Image/Color.php719
-rw-r--r--config/archive/dspam/pear/Image/Graph.php851
-rw-r--r--config/archive/dspam/pear/Image/Graph/Axis.php1690
-rw-r--r--config/archive/dspam/pear/Image/Graph/Axis/Category.php437
-rw-r--r--config/archive/dspam/pear/Image/Graph/Axis/Logarithmic.php152
-rw-r--r--config/archive/dspam/pear/Image/Graph/Axis/Marker/Area.php156
-rw-r--r--config/archive/dspam/pear/Image/Graph/Axis/Marker/Line.php124
-rw-r--r--config/archive/dspam/pear/Image/Graph/Axis/Radar.php204
-rw-r--r--config/archive/dspam/pear/Image/Graph/Common.php313
-rw-r--r--config/archive/dspam/pear/Image/Graph/Config.php30
-rw-r--r--config/archive/dspam/pear/Image/Graph/Constants.php225
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataPreprocessor.php74
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataPreprocessor/Array.php103
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataPreprocessor/Currency.php66
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataPreprocessor/Date.php90
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataPreprocessor/Formatted.php90
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataPreprocessor/Function.php92
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataPreprocessor/NumberText.php89
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataPreprocessor/RomanNumerals.php79
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataPreprocessor/Sequential.php67
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataSelector.php67
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataSelector/EveryNthPoint.php97
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataSelector/NoZeros.php68
-rw-r--r--config/archive/dspam/pear/Image/Graph/DataSelector/Values.php90
-rw-r--r--config/archive/dspam/pear/Image/Graph/Dataset.php483
-rw-r--r--config/archive/dspam/pear/Image/Graph/Dataset/Function.php147
-rw-r--r--config/archive/dspam/pear/Image/Graph/Dataset/Random.php77
-rw-r--r--config/archive/dspam/pear/Image/Graph/Dataset/Sequential.php114
-rw-r--r--config/archive/dspam/pear/Image/Graph/Dataset/Trivial.php260
-rw-r--r--config/archive/dspam/pear/Image/Graph/Dataset/VectorFunction.php185
-rw-r--r--config/archive/dspam/pear/Image/Graph/Element.php763
-rw-r--r--config/archive/dspam/pear/Image/Graph/Figure/Circle.php64
-rw-r--r--config/archive/dspam/pear/Image/Graph/Figure/Ellipse.php97
-rw-r--r--config/archive/dspam/pear/Image/Graph/Figure/Polygon.php94
-rw-r--r--config/archive/dspam/pear/Image/Graph/Figure/Rectangle.php96
-rw-r--r--config/archive/dspam/pear/Image/Graph/Fill.php63
-rw-r--r--config/archive/dspam/pear/Image/Graph/Fill/Array.php137
-rw-r--r--config/archive/dspam/pear/Image/Graph/Fill/Gradient.php149
-rw-r--r--config/archive/dspam/pear/Image/Graph/Fill/Image.php97
-rw-r--r--config/archive/dspam/pear/Image/Graph/Font.php158
-rw-r--r--config/archive/dspam/pear/Image/Graph/Grid.php175
-rw-r--r--config/archive/dspam/pear/Image/Graph/Grid/Bars.php117
-rw-r--r--config/archive/dspam/pear/Image/Graph/Grid/Lines.php114
-rw-r--r--config/archive/dspam/pear/Image/Graph/Grid/Polar.php111
-rw-r--r--config/archive/dspam/pear/Image/Graph/Images/Icons/pinpoint.pngbin452 -> 0 bytes
-rw-r--r--config/archive/dspam/pear/Image/Graph/Images/Icons/pinpointr.pngbin437 -> 0 bytes
-rw-r--r--config/archive/dspam/pear/Image/Graph/Images/Maps/README17
-rw-r--r--config/archive/dspam/pear/Image/Graph/Layout.php219
-rw-r--r--config/archive/dspam/pear/Image/Graph/Layout/Horizontal.php186
-rw-r--r--config/archive/dspam/pear/Image/Graph/Layout/Matrix.php201
-rw-r--r--config/archive/dspam/pear/Image/Graph/Layout/Vertical.php108
-rw-r--r--config/archive/dspam/pear/Image/Graph/Legend.php385
-rw-r--r--config/archive/dspam/pear/Image/Graph/Line/Array.php129
-rw-r--r--config/archive/dspam/pear/Image/Graph/Line/Dashed.php76
-rw-r--r--config/archive/dspam/pear/Image/Graph/Line/Dotted.php67
-rw-r--r--config/archive/dspam/pear/Image/Graph/Line/Formatted.php90
-rw-r--r--config/archive/dspam/pear/Image/Graph/Line/Solid.php105
-rw-r--r--config/archive/dspam/pear/Image/Graph/Logo.php153
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker.php123
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Array.php105
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Asterisk.php109
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Average.php91
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Box.php76
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Bubble.php91
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Circle.php96
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Cross.php114
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Diamond.php73
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Icon.php133
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Pinpoint.php65
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Plus.php98
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Pointing.php140
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Pointing/Angular.php105
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Pointing/Radial.php91
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/ReversePinpoint.php65
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Star.php88
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Triangle.php75
-rw-r--r--config/archive/dspam/pear/Image/Graph/Marker/Value.php214
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot.php824
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Area.php194
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Band.php205
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Bar.php307
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/BoxWhisker.php298
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/CandleStick.php251
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Dot.php99
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Fit/Line.php118
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Impulse.php204
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Line.php171
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Odo.php719
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Pie.php623
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Radar.php118
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Area.php145
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Bezier.php173
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Line.php172
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Radar.php142
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plot/Step.php200
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plotarea.php1145
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plotarea/Element.php87
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plotarea/Map.php304
-rw-r--r--config/archive/dspam/pear/Image/Graph/Plotarea/Radar.php243
-rw-r--r--config/archive/dspam/pear/Image/Graph/Simple.php121
-rw-r--r--config/archive/dspam/pear/Image/Graph/Title.php194
-rw-r--r--config/archive/dspam/pear/Image/Graph/Tool.php291
-rw-r--r--config/archive/dspam/pkg/000.mysql.sh68
-rw-r--r--config/archive/dspam/pkg/010.clamav-clamd.sh56
-rw-r--r--config/archive/dspam/pkg/020.clamav-freshclam.sh33
-rw-r--r--config/archive/dspam/pkg/030.p3scan.sh60
-rw-r--r--config/archive/dspam/pkg/clamd.conf299
-rw-r--r--config/archive/dspam/pkg/default.prefs.sample43
-rw-r--r--config/archive/dspam/pkg/dspam-config.inc42
-rw-r--r--config/archive/dspam/pkg/dspam-guifunc.inc2606
-rw-r--r--config/archive/dspam/pkg/dspam-pkgfunc.inc548
-rw-r--r--config/archive/dspam/pkg/dspam-utilfunc.inc458
-rw-r--r--config/archive/dspam/pkg/dspam.inc360
-rw-r--r--config/archive/dspam/pkg/dspam.xml342
-rw-r--r--config/archive/dspam/pkg/dspam_alerts.xml147
-rw-r--r--config/archive/dspam/pkg/freshclam.conf110
-rw-r--r--config/archive/dspam/pkg/p3scan-pf-emer.xml127
-rw-r--r--config/archive/dspam/pkg/p3scan-pf-msg.xml198
-rw-r--r--config/archive/dspam/pkg/p3scan-pf-spam.xml119
-rw-r--r--config/archive/dspam/pkg/p3scan-pf-vir.xml162
-rw-r--r--config/archive/dspam/pkg/p3scan-pf.xml211
-rw-r--r--config/archive/dspam/pkg/p3scan.inc277
-rw-r--r--config/archive/dspam/pkg/verdana.ttfbin139640 -> 0 bytes
-rw-r--r--config/archive/dspam/www/dspam-admin-graph.php201
-rw-r--r--config/archive/dspam/www/dspam-admin-prefs.php249
-rw-r--r--config/archive/dspam/www/dspam-admin-stats.php123
-rw-r--r--config/archive/dspam/www/dspam-admin.php207
-rw-r--r--config/archive/dspam/www/dspam-analysis-graph.php137
-rw-r--r--config/archive/dspam/www/dspam-analysis.php147
-rw-r--r--config/archive/dspam/www/dspam-hfragment.php90
-rw-r--r--config/archive/dspam/www/dspam-history.php172
-rw-r--r--config/archive/dspam/www/dspam-perf.php222
-rw-r--r--config/archive/dspam/www/dspam-prefs.php234
-rw-r--r--config/archive/dspam/www/dspam-quarantine.php178
-rw-r--r--config/archive/dspam/www/dspam-settings-algo.php204
-rw-r--r--config/archive/dspam/www/dspam-settings-bmta.php202
-rw-r--r--config/archive/dspam/www/dspam-settings-feat.php203
-rw-r--r--config/archive/dspam/www/dspam-settings-header.php197
-rw-r--r--config/archive/dspam/www/dspam-settings-overr.php197
-rw-r--r--config/archive/dspam/www/dspam-settings-prefs.php197
-rw-r--r--config/archive/dspam/www/dspam-settings-spwd.php197
-rw-r--r--config/archive/dspam/www/dspam-settings-tuser.php195
-rw-r--r--config/archive/dspam/www/dspam-settings.php2955
-rw-r--r--config/archive/dspam/www/dspam-train.php284
-rw-r--r--config/archive/dspam/www/dspam-viewmsg.php158
-rw-r--r--config/archive/dspam/www/dspam.php264
-rw-r--r--config/archive/dspam/www/themes/metallic/dspam.css115
-rw-r--r--config/archive/dspam/www/wizards/dspam-lda-proxy.pngbin20556 -> 0 bytes
-rw-r--r--config/archive/dspam/www/wizards/dspam-pop-proxy.pngbin18247 -> 0 bytes
-rw-r--r--config/archive/dspam/www/wizards/dspam-smtp-relay.pngbin30404 -> 0 bytes
-rw-r--r--config/archive/dspam/www/wizards/dspam_wizard.xml1848
-rw-r--r--config/archive/freenas/bin/ext2fs.kobin61544 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/geom_concat.kobin20068 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/geom_gpt.kobin6277 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/geom_mirror.kobin78213 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/geom_stripe.kobin24734 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/geom_vinum.kobin70268 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/iscontrolbin86231 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/iscsi_initiator.kobin47530 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/kernel.gzbin3798453 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/mountdbin27112 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/nfsdbin14004 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/ntfs.kobin44199 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/rpc.lockdbin39404 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/rpc.statdbin11724 -> 0 bytes
-rw-r--r--config/archive/freenas/bin/rpcbindbin39540 -> 0 bytes
-rw-r--r--config/archive/freenas/conf.default/config.xml179
-rw-r--r--config/archive/freenas/conf.kernel/pfSense.6.freenas433
-rw-r--r--config/archive/freenas/diffs/netatalk-2.0.3-afpd-zeroconf.patch1386
-rw-r--r--config/archive/freenas/doc/README.txt52
-rw-r--r--config/archive/freenas/pkg/freenas.inc297
-rw-r--r--config/archive/freenas/pkg/freenas.xml570
-rw-r--r--config/archive/freenas/pkg/freenas_config.inc45
-rw-r--r--config/archive/freenas/pkg/freenas_disks.inc1256
-rw-r--r--config/archive/freenas/pkg/freenas_functions.inc49
-rw-r--r--config/archive/freenas/pkg/freenas_guiconfig.inc288
-rw-r--r--config/archive/freenas/pkg/freenas_services.inc2025
-rw-r--r--config/archive/freenas/pkg/freenas_system.inc838
-rw-r--r--config/archive/freenas/pkg/freenas_utils.inc1049
-rw-r--r--config/archive/freenas/pkg/rc.freenas102
-rw-r--r--config/archive/freenas/www/diag_ad_infos.php159
-rw-r--r--config/archive/freenas/www/diag_ataidle_infos.php149
-rw-r--r--config/archive/freenas/www/diag_disk_infos.php143
-rw-r--r--config/archive/freenas/www/diag_fn_logs_daemon.php119
-rw-r--r--config/archive/freenas/www/diag_fn_logs_ftp.php118
-rw-r--r--config/archive/freenas/www/diag_fn_logs_rsyncd.php117
-rw-r--r--config/archive/freenas/www/diag_fn_logs_samba.php174
-rw-r--r--config/archive/freenas/www/diag_fn_logs_settings.php313
-rw-r--r--config/archive/freenas/www/diag_fn_logs_smartd.php118
-rw-r--r--config/archive/freenas/www/diag_fn_logs_sshd.php117
-rw-r--r--config/archive/freenas/www/diag_iscsi_infos.php142
-rw-r--r--config/archive/freenas/www/diag_mounts_infos.php137
-rw-r--r--config/archive/freenas/www/diag_part_infos.php141
-rw-r--r--config/archive/freenas/www/diag_raid_infos.php163
-rw-r--r--config/archive/freenas/www/diag_smart_infos.php141
-rw-r--r--config/archive/freenas/www/diag_space_infos.php136
-rw-r--r--config/archive/freenas/www/disks_manage.php208
-rw-r--r--config/archive/freenas/www/disks_manage_edit.php275
-rw-r--r--config/archive/freenas/www/disks_manage_init.php511
-rw-r--r--config/archive/freenas/www/disks_manage_iscsi.php209
-rw-r--r--config/archive/freenas/www/disks_manage_tools.php331
-rw-r--r--config/archive/freenas/www/disks_mount.php235
-rw-r--r--config/archive/freenas/www/disks_mount_edit.php307
-rw-r--r--config/archive/freenas/www/disks_mount_tools.php233
-rw-r--r--config/archive/freenas/www/disks_raid_gconcat.php236
-rw-r--r--config/archive/freenas/www/disks_raid_gconcat_edit.php256
-rw-r--r--config/archive/freenas/www/disks_raid_gconcat_infos.php143
-rw-r--r--config/archive/freenas/www/disks_raid_gconcat_tools.php187
-rw-r--r--config/archive/freenas/www/disks_raid_gmirror.php236
-rw-r--r--config/archive/freenas/www/disks_raid_gmirror_edit.php277
-rw-r--r--config/archive/freenas/www/disks_raid_gmirror_infos.php143
-rw-r--r--config/archive/freenas/www/disks_raid_gmirror_init.php179
-rw-r--r--config/archive/freenas/www/disks_raid_gmirror_tools.php191
-rw-r--r--config/archive/freenas/www/disks_raid_graid5.php236
-rw-r--r--config/archive/freenas/www/disks_raid_graid5_edit.php258
-rw-r--r--config/archive/freenas/www/disks_raid_graid5_infos.php143
-rw-r--r--config/archive/freenas/www/disks_raid_graid5_tools.php190
-rw-r--r--config/archive/freenas/www/disks_raid_gstripe.php236
-rw-r--r--config/archive/freenas/www/disks_raid_gstripe_edit.php258
-rw-r--r--config/archive/freenas/www/disks_raid_gstripe_infos.php143
-rw-r--r--config/archive/freenas/www/disks_raid_gstripe_tools.php187
-rw-r--r--config/archive/freenas/www/disks_raid_gvinum.php235
-rw-r--r--config/archive/freenas/www/disks_raid_gvinum_edit.php277
-rw-r--r--config/archive/freenas/www/disks_raid_gvinum_infos.php144
-rw-r--r--config/archive/freenas/www/disks_raid_gvinum_init.php181
-rw-r--r--config/archive/freenas/www/disks_raid_gvinum_tools.php220
-rw-r--r--config/archive/freenas/www/services_afp.php199
-rw-r--r--config/archive/freenas/www/services_ftp.php392
-rw-r--r--config/archive/freenas/www/services_nfs.php243
-rw-r--r--config/archive/freenas/www/services_nfs_export.php165
-rw-r--r--config/archive/freenas/www/services_nfs_export_edit.php783
-rw-r--r--config/archive/freenas/www/services_rsyncd.php277
-rw-r--r--config/archive/freenas/www/services_rsyncd_client.php585
-rw-r--r--config/archive/freenas/www/services_rsyncd_local.php579
-rw-r--r--config/archive/freenas/www/services_samba.php431
-rw-r--r--config/archive/freenas/www/services_samba_share.php165
-rw-r--r--config/archive/freenas/www/services_samba_share_edit.php157
-rw-r--r--config/archive/freenas/www/services_unison.php249
-rw-r--r--config/archive/freenas/www/status_disks.php127
-rwxr-xr-xconfig/archive/frickin/bin/frickinbin470088 -> 0 bytes
-rwxr-xr-xconfig/archive/frickin/bin/frickin2bin58984 -> 0 bytes
-rw-r--r--config/archive/frickin/frickin.inc147
-rw-r--r--config/archive/frickin/frickin.xml90
-rw-r--r--config/archive/jail_template.xml36
-rw-r--r--config/archive/jail_template/jail_template.img.uzipbin63200768 -> 0 bytes
-rw-r--r--config/archive/jail_template/jail_template.inc32
-rw-r--r--config/archive/jailctl.xml233
-rwxr-xr-xconfig/archive/jailctl/jailctl1053
-rw-r--r--config/archive/jailctl/jailctl-utils.inc272
-rw-r--r--config/archive/jailctl/jailctl.inc217
-rw-r--r--config/archive/jailctl/jailctl.xml233
-rw-r--r--config/archive/jailctl/jailctl_defaults.xml122
-rw-r--r--config/archive/jailctl/jailctl_list.inc112
-rw-r--r--config/archive/jailctl/jailctl_settings.xml118
-rwxr-xr-xconfig/archive/jailctl/sysinstallbin447888 -> 0 bytes
-rw-r--r--config/archive/p3scan-pf/p3scan-pf-emer.xml131
-rw-r--r--config/archive/p3scan-pf/p3scan-pf-msg.xml202
-rw-r--r--config/archive/p3scan-pf/p3scan-pf-spam.xml122
-rw-r--r--config/archive/p3scan-pf/p3scan-pf-transex.xml124
-rw-r--r--config/archive/p3scan-pf/p3scan-pf-vir.xml166
-rw-r--r--config/archive/p3scan-pf/p3scan-pf.inc395
-rw-r--r--config/archive/p3scan-pf/p3scan-pf.xml218
-rw-r--r--config/archive/p3scan.inc63
-rw-r--r--config/archive/p3scan.mail15
-rw-r--r--config/archive/p3scan.xml73
-rw-r--r--config/archive/phpmrss.xml59
-rw-r--r--config/archive/portsentry/portsentry.inc292
-rw-r--r--config/archive/portsentry/portsentry.xml120
-rw-r--r--config/archive/powerdns.xml248
-rw-r--r--config/archive/quagga/quagga.sh75
-rw-r--r--config/archive/quagga/quagga.xml69
-rw-r--r--config/archive/sassassin.inc63
-rw-r--r--config/archive/sassassin.xml159
-rw-r--r--config/archive/sassassin_bl.xml95
-rw-r--r--config/archive/sassassin_wl.xml95
-rw-r--r--config/archive/upclient.xml126
-rw-r--r--config/archive/viralator.inc86
-rw-r--r--config/archive/viralator.xml61
-rw-r--r--config/arpwatch/arpwatch.xml (renamed from config/arpwatch.xml)4
-rwxr-xr-xconfig/arpwatch/arpwatch_reports.php (renamed from config/arpwatch_reports.php)0
-rw-r--r--config/arpwatch/sm.php (renamed from config/sm.php)0
-rwxr-xr-xconfig/bsdstats/bin/digbin1083772 -> 0 bytes
-rw-r--r--config/bsdstats/bsdstats.xml83
-rw-r--r--config/cg2/sample/i18n/messages_de.xml7
-rw-r--r--config/cg2/sample/i18n/messages_en.xml7
-rw-r--r--config/cg2/sample/sample.inc37
-rw-r--r--config/cg2/sample/sample.xml18
-rw-r--r--config/cg2/sample/sample_ui.xml156
-rw-r--r--config/cg2/sample/sample_ui2.xml29
-rw-r--r--config/clamav.inc264
-rw-r--r--config/clamav.xml131
-rw-r--r--config/countryblock/class.phpmailer.tmp1909
-rw-r--r--config/countryblock/class.smtp.tmp1062
-rw-r--r--config/countryblock/countryblock.inc146
-rwxr-xr-xconfig/countryblock/countryblock.sh85
-rw-r--r--config/countryblock/countryblock.tmp2699
-rw-r--r--config/countryblock/countryblock.xml200
-rw-r--r--config/countryblock/countryblock_IPBlocklist.widget.tmp116
-rw-r--r--config/countryblock/countryblock_if.tmp206
-rw-r--r--config/countryblock/ddaccordion.js209
-rw-r--r--config/countryblock/email.tmp291
-rwxr-xr-xconfig/countryblock/execute.sh85
-rw-r--r--config/countryblock/firewall_shaper.tmp11
-rw-r--r--config/countryblock/help.tmp148
-rw-r--r--config/countryblock/index.tmp11
-rw-r--r--config/countryblock/interfaces.txt1
-rw-r--r--config/countryblock/jquery.min.js19
-rw-r--r--config/countryblock/public_smo_scripts.js160
-rw-r--r--config/countryblock/purge.tmp26
-rw-r--r--config/countryblock/settings.tmp220
-rw-r--r--config/countryblock/titlebar-active.pngbin90 -> 0 bytes
-rw-r--r--config/countryblock/titlebar.pngbin90 -> 0 bytes
-rw-r--r--config/countryblock/whitelist.tmp241
-rw-r--r--config/dashboard/dashboard.inc41
-rw-r--r--config/dashboard/dashboard.xml65
-rw-r--r--config/denyhosts/denyhosts.inc199
-rw-r--r--config/denyhosts/denyhosts.xml121
-rw-r--r--config/denyhosts/denyhosts_log.tmp177
-rw-r--r--config/developers/developers.xml63
-rw-r--r--config/dnsblacklist/dnsblacklist.inc106
-rw-r--r--config/dnsblacklist/dnsblacklist.tmp217
-rw-r--r--config/dnsblacklist/dnsblacklist.tmp.old276
-rw-r--r--config/dnsblacklist/dnsblacklist.xml110
-rw-r--r--config/dnsmasq-edns/dnsmasq-edns.inc18
-rw-r--r--config/dnsmasq-edns/dnsmasq-edns.patch13
-rw-r--r--config/dnsmasq-edns/dnsmasq-edns.xml65
-rw-r--r--config/dyntables/pkg/dyntables.inc117
-rw-r--r--config/dyntables/pkg/dyntables.xml139
-rw-r--r--config/dyntables/pkg/dyntables_classdefs.inc146
-rw-r--r--config/dyntables/www/js/dyntables.js287
-rw-r--r--config/dyntables/www/php/diag_dhcp_leases.php440
-rw-r--r--config/freeradius/freeradius.inc (renamed from config/freeradius.inc)0
-rw-r--r--config/freeradius/freeradius.xml (renamed from config/freeradius.xml)8
-rw-r--r--config/freeradius/freeradiusclients.xml (renamed from config/freeradiusclients.xml)0
-rw-r--r--config/freeradius/freeradiussettings.xml (renamed from config/freeradiussettings.xml)0
-rw-r--r--config/haproxy-stable/haproxy.inc581
-rw-r--r--config/haproxy-stable/haproxy.xml110
-rwxr-xr-xconfig/haproxy-stable/haproxy_global.php382
-rwxr-xr-xconfig/haproxy-stable/haproxy_listeners.php172
-rwxr-xr-xconfig/haproxy-stable/haproxy_listeners_edit.php779
-rwxr-xr-xconfig/haproxy-stable/haproxy_pool_edit.php509
-rwxr-xr-xconfig/haproxy-stable/haproxy_pools.php166
-rw-r--r--config/havp.inc219
-rw-r--r--config/havp.sh85
-rw-r--r--config/havp.xml220
-rw-r--r--config/havp_blacklist.xml116
-rw-r--r--config/havp_startup.inc12
-rw-r--r--config/havp_trans_exclude.xml116
-rw-r--r--config/havp_whitelist.xml116
-rw-r--r--config/hula.xml109
-rw-r--r--config/ifdepd.xml118
-rw-r--r--config/ifstated.xml140
-rw-r--r--config/igmpproxy/filter.tmp3315
-rwxr-xr-xconfig/igmpproxy/firewall_rules_edit.tmp879
-rw-r--r--config/igmpproxy/igmpproxy.inc86
-rw-r--r--config/igmpproxy/igmpproxy.xml160
-rwxr-xr-xconfig/ipblocklist/7/IP-Blocklist.sh131
-rwxr-xr-xconfig/ipblocklist/7/OUTBOUND0
-rwxr-xr-xconfig/ipblocklist/7/class.phpmailer.tmp1909
-rwxr-xr-xconfig/ipblocklist/7/class.smtp.tmp1062
-rwxr-xr-xconfig/ipblocklist/7/convert-execute.sh126
-rwxr-xr-xconfig/ipblocklist/7/convert.pl67
-rwxr-xr-xconfig/ipblocklist/7/email.tmp268
-rwxr-xr-xconfig/ipblocklist/7/firewall_shaper.tmp11
-rwxr-xr-xconfig/ipblocklist/7/index.tmp11
-rwxr-xr-xconfig/ipblocklist/7/interfaces.txt1
-rwxr-xr-xconfig/ipblocklist/7/ipblocklist.inc130
-rwxr-xr-xconfig/ipblocklist/7/ipblocklist.tmp241
-rwxr-xr-xconfig/ipblocklist/7/ipblocklist.xml185
-rwxr-xr-xconfig/ipblocklist/7/ipblocklist_if.tmp217
-rwxr-xr-xconfig/ipblocklist/7/ipblocklist_list.tmp113
-rw-r--r--config/ipblocklist/7/lists.txt1
-rwxr-xr-xconfig/ipblocklist/7/manual_add.tmp69
-rwxr-xr-xconfig/ipblocklist/7/purge.tmp20
-rwxr-xr-xconfig/ipblocklist/7/purgeip.tmp26
-rwxr-xr-xconfig/ipblocklist/7/settings.tmp198
-rwxr-xr-xconfig/ipblocklist/7/whitelist.tmp175
-rwxr-xr-xconfig/ipblocklist/8/IP-Blocklist.sh131
-rwxr-xr-xconfig/ipblocklist/8/OUTBOUND0
-rwxr-xr-xconfig/ipblocklist/8/class.phpmailer.tmp1909
-rwxr-xr-xconfig/ipblocklist/8/class.smtp.tmp1062
-rwxr-xr-xconfig/ipblocklist/8/convert-execute.sh126
-rwxr-xr-xconfig/ipblocklist/8/convert.pl67
-rw-r--r--config/ipblocklist/8/countryblock_IPBlocklist.widget.tmp116
-rwxr-xr-xconfig/ipblocklist/8/email.tmp268
-rwxr-xr-xconfig/ipblocklist/8/firewall_shaper.tmp11
-rwxr-xr-xconfig/ipblocklist/8/index.tmp11
-rwxr-xr-xconfig/ipblocklist/8/interfaces.txt1
-rwxr-xr-xconfig/ipblocklist/8/ipblocklist.inc140
-rwxr-xr-xconfig/ipblocklist/8/ipblocklist.tmp244
-rwxr-xr-xconfig/ipblocklist/8/ipblocklist.xml190
-rwxr-xr-xconfig/ipblocklist/8/ipblocklist_if.tmp217
-rwxr-xr-xconfig/ipblocklist/8/ipblocklist_list.tmp113
-rw-r--r--config/ipblocklist/8/lists.txt1
-rwxr-xr-xconfig/ipblocklist/8/manual_add.tmp69
-rwxr-xr-xconfig/ipblocklist/8/purge.tmp20
-rwxr-xr-xconfig/ipblocklist/8/purgeip.tmp26
-rwxr-xr-xconfig/ipblocklist/8/settings.tmp198
-rwxr-xr-xconfig/ipblocklist/8/whitelist.tmp175
-rw-r--r--config/iperf/iperf.xml (renamed from config/iperf.xml)4
-rw-r--r--config/iperf/iperfserver.xml (renamed from config/iperfserver.xml)0
-rw-r--r--config/iprangealiases/iprangealiases.inc18
-rw-r--r--config/iprangealiases/iprangealiases.patch265
-rw-r--r--config/iprangealiases/iprangealiases.xml65
-rw-r--r--config/mactovendor/bin/diag_arp.php_339
-rw-r--r--config/mactovendor/bin/mac-prefixes12557
-rw-r--r--config/mactovendor/bin/status_dhcp_leases.php_434
-rw-r--r--config/mactovendor/bin/status_interfaces.php_353
-rw-r--r--config/mactovendor/bin/status_wireless.php_208
-rw-r--r--config/mactovendor/mactovendor.inc54
-rw-r--r--config/mactovendor/mactovendor.xml46
-rw-r--r--config/miniupnpd/miniupnpd.inc290
-rw-r--r--config/miniupnpd/miniupnpd.xml182
-rwxr-xr-xconfig/miniupnpd/sbin/miniupnpdbin56203 -> 0 bytes
-rw-r--r--config/miniupnpd/status_upnp.php120
-rw-r--r--config/mtr-nox11/mtr-nox11.xml (renamed from config/mtr-nox11.xml)0
-rw-r--r--config/netio-newpkg.xml119
-rw-r--r--config/netio/netio.xml (renamed from config/netio.xml)2
-rw-r--r--config/netio/netioserver.xml (renamed from config/netioserver.xml)0
-rw-r--r--config/netioserver-newpkg.xml83
-rw-r--r--config/olsrd/olsrd.inc (renamed from config/olsrd.inc)0
-rw-r--r--config/olsrd/olsrd.xml (renamed from config/olsrd.xml)2
-rw-r--r--config/onatproto/onatproto.inc18
-rw-r--r--config/onatproto/onatproto.patch267
-rw-r--r--config/onatproto/onatproto.xml65
-rw-r--r--config/openospfd/openospfd.inc249
-rw-r--r--config/openospfd/openospfd.xml141
-rw-r--r--config/openospfd/openospfd_interfaces.xml122
-rw-r--r--config/openospfd/status_ospfd.php147
-rw-r--r--config/openvpn-status/openvpn-status.xml70
-rw-r--r--config/openvpn-status/status_openvpn.php249
-rw-r--r--config/ovpnenhance/openvpn.inc_tls671
-rw-r--r--config/ovpnenhance/openvpn.xml_tls329
-rw-r--r--config/ovpnenhance/openvpn_cli.xml_tls240
-rw-r--r--config/ovpnenhance/openvpn_csc.xml_tls169
-rw-r--r--config/ovpnenhance/ovpnenhance.inc14
-rw-r--r--config/ovpnenhance/ovpnenhance.xml40
-rw-r--r--config/packetcapturefix/packetcapturefix.inc18
-rw-r--r--config/packetcapturefix/packetcapturefix.patch19
-rw-r--r--config/packetcapturefix/packetcapturefix.xml65
-rw-r--r--config/per-user-bandwidth-distribution.xml145
-rw-r--r--config/pfflowd/pfflowd.xml (renamed from config/pfflowd.xml)0
-rw-r--r--config/pfstat.php70
-rw-r--r--config/pfstat.xml324
-rw-r--r--config/postfix.xml117
-rw-r--r--config/pre2upgrade/pre2upgrade.php76
-rw-r--r--config/pre2upgrade/pre2upgrade.xml57
-rw-r--r--config/pubkey.xml52
-rw-r--r--config/pure-ftpd/pure-ftpd.xml (renamed from config/pure-ftpd.xml)2
-rw-r--r--config/pure-ftpd/pure-ftpdsettings.xml (renamed from config/pure-ftpdsettings.xml)0
-rw-r--r--config/rate/bandwidth_by_ip.php77
-rw-r--r--config/rate/rate.inc34
-rw-r--r--config/rate/rate.xml73
-rw-r--r--config/rate/status_graph.php291
-rw-r--r--config/siproxd/siproxd.inc (renamed from config/siproxd.inc)0
-rw-r--r--config/siproxd/siproxd.xml (renamed from config/siproxd.xml)6
-rw-r--r--config/siproxd/siproxd_registered_phones.php (renamed from config/siproxd_registered_phones.php)0
-rw-r--r--config/siproxd/siproxdusers.xml (renamed from config/siproxdusers.xml)0
-rw-r--r--config/squid-head/squid.inc864
-rw-r--r--config/squid-head/squid.xml215
-rw-r--r--config/squid-head/squid_auth.xml202
-rw-r--r--config/squid-head/squid_cache.xml180
-rw-r--r--config/squid-head/squid_monitor.sh69
-rw-r--r--config/squid-head/squid_nac.xml147
-rw-r--r--config/squid-head/squid_traffic.xml179
-rw-r--r--config/squid-head/squid_upstream.xml133
-rw-r--r--config/squid-head/squid_users.xml120
-rw-r--r--config/squidGuard.xml125
-rw-r--r--config/sshterm/diag_shell_head.php82
-rw-r--r--config/sshterm/diag_shell_releng.php75
-rw-r--r--config/sshterm/sshterm.xml101
-rw-r--r--config/states-summary/diag_states_summary.php161
-rw-r--r--config/states-summary/states-summary.xml70
-rw-r--r--config/stunnel/stunnel.xml (renamed from config/stunnel.xml)0
-rw-r--r--config/urltables/urltables.inc18
-rw-r--r--config/urltables/urltables.patch364
-rw-r--r--config/urltables/urltables.xml65
-rw-r--r--config/widentd/widentd.xml (renamed from config/widentd.xml)0
-rw-r--r--config/widget-snort/snort_alerts.js90
-rw-r--r--config/widget-snort/snort_alerts.widget.php180
-rw-r--r--config/widget-snort/widget-snort.inc29
-rw-r--r--config/widget-snort/widget-snort.xml70
-rwxr-xr-xconfig/zebedee/zebedee.inc329
-rwxr-xr-xconfig/zebedee/zebedee.sh6
-rw-r--r--config/zebedee/zebedee.xml304
-rw-r--r--config/zebedee/zebedee_del_key.php54
-rw-r--r--config/zebedee/zebedee_get_key.php44
-rw-r--r--config/zebedee/zebedee_key_details.xml115
-rw-r--r--config/zebedee/zebedee_keys.php145
-rw-r--r--config/zebedee/zebedee_log.php112
-rw-r--r--config/zebedee/zebedee_sync.xml117
-rwxr-xr-xconfig/zebedee/zebedee_tunnels.xml127
-rw-r--r--config/zebedee/zebedee_view_config.php97
-rw-r--r--pkg_config.10.xml18
-rw-r--r--pkg_config.7.xml1061
-rw-r--r--pkg_config.8.xml22
-rw-r--r--pkg_config.8.xml.amd6422
526 files changed, 45 insertions, 133311 deletions
diff --git a/config/Fit123/bin/afc/reset_states.sh b/config/Fit123/bin/afc/reset_states.sh
deleted file mode 100644
index 4a7eb7e7..00000000
--- a/config/Fit123/bin/afc/reset_states.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-echo "Runnig the After Filter Change reset_states script" | logger
-sleep 60
-/sbin/pfctl -F state
-sleep 40
-/sbin/pfctl -F state
-echo "States has been reset" | logger
diff --git a/config/Fit123/bin/cpaddon/filter.inc b/config/Fit123/bin/cpaddon/filter.inc
deleted file mode 100644
index e9ca153a..00000000
--- a/config/Fit123/bin/cpaddon/filter.inc
+++ /dev/null
@@ -1,3332 +0,0 @@
-<?php
-/* $Id$ */
-/*
- filter.inc
- Copyright (C) 2004-2006 Scott Ullrich
- Copyright (C) 2005 Bill Marquette
- Copyright (C) 2006 Peter Allgeyer
- All rights reserved.
-
- originally part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-/* include all configuration functions */
-require_once("functions.inc");
-require_once("pkg-utils.inc");
-require_once("notices.inc");
-
-if(!function_exists("filter_configure"))
- require_once("filter.inc");
-
-if($config['system']['shapertype'] <> "m0n0")
- require_once ("shaper.inc");
-
-/* holds the items that will be executed *AFTER* the filter is fully loaded */
-$after_filter_configure_run = array();
-
-function filter_pflog_start() {
- global $config, $g;
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_pflog_start() being called $mt\n";
- }
-
- mute_kernel_msgs();
-
- $pid = `ps awwwux | grep -v "grep" | grep "tcpdump -s 256 -v -l -n -e -ttt -i pflog0" | awk '{ print $2 }'`;
- if(!$pid)
- mwexec_bg("/usr/sbin/tcpdump -s 256 -v -l -n -e -ttt -i pflog0 | logger -t pf -p local0.info");
-
- unmute_kernel_msgs();
-
-}
-
-/* reload filter async */
-function filter_configure() {
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_configure() being called $mt\n";
- }
- global $g;
-
- touch($g['tmp_path'] . "/filter_dirty");
-}
-
-/* reload filter sync */
-function filter_configure_sync() {
- global $config, $g, $after_filter_configure_run;
- filter_pflog_start();
- update_filter_reload_status("Initializing");
- /* invalidate interface cache */
- get_interface_arr(true);
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_configure_sync() being called $mt\n";
- }
-
- /* load ipfw / dummynet early on if required */
- if($config['system']['dummynetshaper']) {
- $status = intval(`kldstat | grep ipfw | wc -l | awk '{ print $1 }'`);
- if($status == "0") {
- mwexec("/sbin/kldload ipfw");
- mwexec("/sbin/kldload dummynet");
- }
- } else {
- /* check to see if any rules reference a schedule
- * and if so load ipfw for later usage.
- */
- foreach($config['filter']['rule'] as $rule) {
- if($rule['sched'])
- $time_based_rules = true;
- }
- if($time_based_rules == true) {
- $status = intval(`kldstat | grep ipfw | wc -l | awk '{ print $1 }'`);
- if($status == "0") {
- mute_kernel_msgs();
- mwexec("/sbin/kldload ipfw");
- unmute_kernel_msgs();
- }
- if ($config['system']['maximumstates'] <> "" && is_numeric($config['system']['maximumstates'])) {
- /* Set ipfw states to user defined maximum states in Advanced menu. */
- mwexec("sysctl net.inet.ip.fw.dyn_max={$config['system']['maximumstates']}");
- } else {
- /* Set to default 10,000 */
- mwexec("sysctl net.inet.ip.fw.dyn_max=10000");
- }
- exec("/sbin/ipfw delete set 9");
- exec("/sbin/ipfw delete 2");
- exec("/sbin/ipfw delete 3");
- }
- }
-
- $lan_if = $config['interfaces']['lan']['if'];
- $wan_if = get_real_wan_interface();
-
- /* generate aliases */
- if($g['booting'] == true) echo ".";
- update_filter_reload_status("Creating aliases");
- $aliases = filter_generate_aliases();
- /* generate nat rules */
- if($g['booting'] == true) echo ".";
- update_filter_reload_status("Generating NAT rules");
- $natrules = filter_nat_rules_generate();
- /* generate pfctl rules */
- if($g['booting'] == true) echo ".";
- update_filter_reload_status("Generating filter rules");
- $pfrules = filter_rules_generate();
-
- if (isset($config['shaper']['enable']) and $config['system']['shapertype'] <> "m0n0") {
- /* generate altq interface setup parms */
- if($g['booting'] == true) echo ".";
- update_filter_reload_status("Generating ALTQ interfaces");
- $altq_ints = filter_setup_altq_interfaces();
- /* generate altq queues */
- if($g['booting'] == true) echo ".";
- update_filter_reload_status("Generating ALTQ queues");
- $altq_queues = filter_generate_altq_queues($altq_ints);
- /* generate altq rules */
- if($g['booting'] == true) echo ".";
- /* Setup a default rule that tags ALL packets as unshaped
- * we'll match only unshaped packets in the shaper code later
- * this allows the shaper to be first match
- */
- $pf_altq_rules = "block in all tag unshaped label \"SHAPER: first match rule\"\n";
- update_filter_reload_status("Generating ALTQ rules");
- $pf_altq_rules .= filter_generate_pf_altq_rules();
- }
-
- update_filter_reload_status("Loading filter rules");
-
- /* enable pf if we need to, otherwise disable */
- if (!isset ($config['system']['disablefilter'])) {
- mwexec("/sbin/pfctl -e", true);
- } else {
- mwexec("/sbin/pfctl -d");
- unlink_if_exists("{$g['tmp_path']}/filter_loading");
- update_filter_reload_status("Filter is disabled. Not loading rules.");
- return;
- }
-
- // Copy rules.debug to rules.debug.old
- if(file_exists("{$g['tmp_path']}/rules.debug"))
- exec("cp {$g['tmp_path']}/rules.debug {$g['tmp_path']}/rules.debug.old");
-
- $fd = fopen("{$g['tmp_path']}/rules.debug", "w");
- $rules = $aliases . " \n";
-
- update_filter_reload_status("Setting up logging information");
-
- $rules .= setup_logging_interfaces();
-
- if ($config['system']['optimization'] <> "") {
- $rules .= "set optimization {$config['system']['optimization']}\n";
- if ($config['system']['optimization'] == "conservative") {
- $rules .= "set timeout { udp.first 300, udp.single 150, udp.multiple 900 }\n";
- }
- } else {
- $rules .= "set optimization normal\n";
- }
-
- if ($config['system']['maximumstates'] <> "" && is_numeric($config['system']['maximumstates'])) {
- /* User defined maximum states in Advanced menu. */
- $rules .= "set limit states {$config['system']['maximumstates']}\n";
- }
- $rules .= "\n";
-
- update_filter_reload_status("Setting up SCRUB information");
- /* get our wan interface? */
- $wanif = get_real_wan_interface();
-
- /* disable scrub option */
- if(!isset($config['system']['disablescrub'])) {
- /* set up MSS clamping */
- if ($config['interfaces']['wan']['mtu'] <> "" and is_numeric($config['interfaces']['wan']['mtu']))
- $mssclamp = "max-mss " . (intval($config['interfaces']['wan']['mtu'] - 40));
- else
- if ($config['interfaces']['wan']['ipaddr'] == "pppoe")
- $mssclamp = "max-mss 1452";
- else
- $mssclamp = "";
-
- /* configure no-df for linux nfs and others */
- if ($config['system']['scrubnodf'])
- $scrubnodf = "no-df random-id";
- else
- $scrubnodf = "random-id";
- $rules .= "scrub all {$scrubnodf} {$mssclamp} fragment reassemble\n"; // reassemble all directions
- } else if ($config['interfaces']['wan']['mtu'] <> "" and is_numeric($config['interfaces']['wan']['mtu'])) {
- $rules .= "scrub {$mssclamp}\n"; // reassemble all directions
- }
-
- if($config['system']['shapertype'] <> "m0n0") {
- $rules.= "{$altq_ints}\n";
- $rules.= "{$altq_queues}\n";
- }
- $rules.= "{$natrules}\n";
- if($config['system']['shapertype'] <> "m0n0")
- $rules.= "{$pf_altq_rules}\n";
- $rules.= "{$pfrules}\n";
- fwrite($fd, $rules);
- fclose($fd);
-
- $rules = "1"; // force to be diff from oldrules
- $oldrules = "2"; // force to be diff from rules
-
- if(file_exists("{$g['tmp_path']}/rules.debug"))
- $rules = file_get_contents("{$g['tmp_path']}/rules.debug");
- if(file_exists("{$g['tmp_path']}/rules.debug.old"))
- $oldrules = file_get_contents("{$g['tmp_path']}/rules.debug.old");
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "pfctl being called at $mt\n";
- }
- $rules_loading = mwexec("/sbin/pfctl -o basic -f {$g['tmp_path']}/rules.debug");
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "pfctl done at $mt\n";
- }
-
- /* check for a error while loading the rules file. if an error has occured
- then output the contents of the error to the caller */
- if($rules_loading <> 0) {
- $rules_error = exec_command("/sbin/pfctl -f {$g['tmp_path']}/rules.debug");
- $line_error = split("\:", $rules_error);
- $line_number = $line_error[1];
- $rules_file = `/bin/cat {$g['tmp_path']}/rules.debug`;
- $line_split = split("\n", $rules_file);
- if(is_array($line_split))
- $line_error = "The line in question reads [{$line_number}]: {$line_split[$line_number-1]}";
- if($line_error and $line_number) {
- file_notice("filter_load", "There were error(s) loading the rules: {$rules_error} {$line_error}", "Filter Reload", "");
- log_error("There were error(s) loading the rules: {$rules_error} - {$line_error}");
- update_filter_reload_status("There were error(s) loading the rules: {$rules_error} - {$line_error}");
- return;
- }
- }
-
- unlink_if_exists("/usr/local/pkg/pf/carp_sync_client.php");
-
- /* run items scheduled for after filter configure run */
- $fda = fopen("/tmp/commands.txt", "w");
- foreach($after_filter_configure_run as $afcr)
- fwrite($fda, $afcr . "\n");
- fclose($fda);
- if(file_exists("/tmp/commands.txt")) {
- mwexec("sh /tmp/commands.txt &");
- unlink("/tmp/commands.txt");
- }
-
- update_filter_reload_status("Running plugins");
-
- if(is_dir("/usr/local/pkg/pf/")) {
- /* process packager manager custom rules */
- update_filter_reload_status("Running plugins (pf)");
- run_plugins("/usr/local/pkg/pf/");
- update_filter_reload_status("Plugins completed.");
- }
-
- system_start_ftp_helpers();
-
- if($config['system']['shapertype'] == "m0n0") {
- require_once ("/etc/inc/m0n0/shaper.inc");
- shaper_configure();
- }
-
- /* if time based rules are enabled then swap in the set */
- if($time_based_rules == true) {
- tdr_install_cron(true);
- tdr_install_set();
- } else {
- tdr_install_cron(false);
- }
-
- /*
- we need a way to let a user run a shell cmd after each
- filter_configure() call. run this xml command after
- each change.
- */
- if($config['system']['afterfilterchangeshellcmd'] <> "")
- mwexec($config['system']['afterfilterchangeshellcmd']);
-
- /* sync carp entries to other firewalls */
- update_filter_reload_status("Syncing CARP data");
- carp_sync_client();
-
- system_routing_configure();
-
- update_filter_reload_status("Done");
-
- return 0;
-}
-
-function filter_generate_aliases() {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_generate_aliases() being called $mt\n";
- }
- $aliases = "";
-
- $i = 0;
-
- $lanip = find_interface_ip($config['interfaces']['lan']['if']);
- $wanip = find_interface_ip(get_real_wan_interface());
-
- $aliases .= "# System Aliases \n";
- $aliases .= "loopback = \"{ lo0 }\"\n";
- $aliases .= "lan = \"{ {$config['interfaces']['lan']['if']}{$lan_aliases} }\"\n";
-
- if($config['interfaces']['wan']['ipaddr'] == "pppoe" or $config['interfaces']['wan']['ipaddr'] == "pptp") {
- $aliases .= "ng0 = \"{ " . $config['interfaces']['wan']['if'] . " " . get_real_wan_interface() . " }\" \n";
- $aliases .= "wan = \"{ " . $config['interfaces']['wan']['if'] . " ng0 }\"\n";
- } else {
- $aliases .= "wan = \"{ " . get_real_wan_interface() . " }\"\n";
- }
-
- $aliases .= "enc0 = \"{ enc0 }\"\n";
-
- /* used to count netgraph interfaces */
- $counter = 0;
-
- /* ng ordering is VERY important here. do not alter order */
- if($config['pptpd']['mode'] == "server") {
- /* build pptp alias */
- $tmp = "pptp = \"{ ";
- $starting_pptp = 1;
- if($config['interfaces']['wan']['ipaddr'] == "pppoe")
- $starting_pptp = 1;
- for($x=$starting_pptp; $x<$g["n_pptp_units"]+$starting_pptp; $x++)
- $tmp .= "ng{$x} ";
- $counter = $x;
- $tmp .= "}\" \n";
- if($counter > 0)
- $aliases .= $tmp;
- }
- if($config['pppoe']['mode'] == "server") {
- /* build pppoe alias */
- $tmp = "pppoe = \"{ ";
- $starting_pppoe = 1;
- if($config['interfaces']['wan']['ipaddr'] == "pppoe")
- $starting_pppoe = 1;
- for($x=0; $x<$g["n_pppoe_units"]+$starting_pppoe; $x++) {
- $tmp .= "ng{$counter} ";
- $counter++;
- }
- $tmp .= "}\" \n";
- if($x > 0)
- $aliases .= $tmp;
- }
-
- $ifdescrs = array();
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- $ifdescrs['opt' . $j] = "opt" . $j;
- }
- $bridgetracker = 0;
- foreach ($ifdescrs as $ifdescr => $ifname) {
- /* do not process tun interfaces */
- /* do process tun interfaces for openvpn compatibility */
- /* if(stristr(filter_opt_interface_to_real($ifname), "tun") == true) continue; */
- $aliases .= convert_friendly_interface_to_friendly_descr($ifname) . " = \"{ " . filter_opt_interface_to_real($ifname);
-// if(link_int_to_bridge_interface($ifname))
-// $aliases .= " " . link_int_to_bridge_interface($ifname);
- $optip = find_interface_ip($config['interfaces'][$ifname]['if']);
- if($optip) {
- $opt_carp_ints = link_ip_to_carp_interface($optip);
- if($opt_carp_ints)
- $aliases .= $opt_carp_ints;
- }
- $aliases .= " }\"\n";
- }
- $aliases .= "# User Aliases \n";
- /* Setup pf groups */
- if (isset($config['aliases']['alias'])) {
- foreach ($config['aliases']['alias'] as $alias) {
- $extraalias = "";
- $ip = find_interface_ip($alias['address']);
- $extraalias = " " . link_ip_to_carp_interface($ip);
- $aliases .= "{$alias['name']} = \"{ {$alias['address']}{$extralias} }\"\n";
- }
- }
-
- return $aliases;
-}
-
-function get_vpns_list() {
- global $config;
- /* build list of vpns */
- $vpns = "";
- $isfirst = true;
- /* ipsec */
- if ($config['ipsec']['tunnel']) {
- foreach ($config['ipsec']['tunnel'] as $tunnel) {
- if ($isfirst == false)
- $vpns .= " ";
- $vpns .= $tunnel['remote-subnet'];
- $isfirst = false;
- }
- }
- /* openvpn */
- foreach (array('client', 'server') as $type) {
- $conf =& $config['installedpackages']["openvpn$type"]['config'];
- if (!is_array($conf)) continue;
- foreach ($conf as $tunnel) {
- if ($isfirst == false)
- $vpns .= " ";
- $vpns .= $tunnel['remote_network'];
- $isfirst = false;
- }
- }
- /* pppoe */
- if ($config['pppoe']['remoteip']) {
- if ($isfirst == false)
- $vpns .= " ";
- $vpns .= $config['pppoe']['remoteip'] ."/". $config['pppoe']['pppoe_subnet'];
- $isfirst = false;
- }
- $vpns .= " ";
- return $vpns;
-}
-
-function generate_optcfg_array(& $optcfg) {
- global $config;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "generate_optcfg_array() being called $mt\n";
- }
-
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $oc = $config['interfaces']['opt' . $i];
-
- if (isset($oc['enable']) && $oc['if']) {
- $oic = array();
- $oic['if'] = $oc['if'];
-
- if ($oc['bridge']) {
- if (!strstr($oc['bridge'], "opt") ||
- isset($config['interfaces'][$oc['bridge']]['enable'])) {
- if (is_ipaddr($config['interfaces'][$oc['bridge']]['ipaddr'])) {
- $oic['ip'] = $config['interfaces'][$oc['bridge']]['ipaddr'];
- $oic['sn'] = $config['interfaces'][$oc['bridge']]['subnet'];
- $oic['sa'] = gen_subnet($oic['ip'], $oic['sn']);
- }
- }
- $oic['bridge'] = 1;
- } else {
- $oic['ip'] = $oc['ipaddr'];
- $oic['sn'] = $oc['subnet'];
- $oic['sa'] = gen_subnet($oic['ip'], $oic['sn']);
- $oic['descr'] = $oc['descr'];
- }
-
- $optcfg['opt' . $i] = $oic;
- }
- }
-}
-
-function filter_flush_nat_table() {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_flush_nat_table() being called $mt\n";
- }
- return mwexec("/sbin/pfctl -F nat");
-}
-
-function filter_flush_state_table() {
- global $config, $g;
-
- return mwexec("/sbin/pfctl -F state");
-}
-
-/* Generate a 'nat on' or 'no nat on' rule for given interface */
-function filter_nat_rules_generate_if($if, $src = "any", $srcport = "", $dst = "any", $dstport = "", $natip = "", $natport = "", $nonat = false, $staticnatport = false) {
- global $config;
-
- /* XXX: billm - any idea if this code is needed? */
- if($src == "/32" || $src{0} == "/")
- return;
-
- /* Use interface name if IP isn't specified */
- if ($natip != "")
- $tgt = "{$natip}/32";
- else
- $tgt = "($if)";
-
- /* Add the hard set source port (useful for ISAKMP) */
- if ($natport != "")
- $tgt .= " port {$natport}";
-
- /* sometimes this gets called with "" instead of a value */
- if ($src == "")
- $src = "any";
-
- /* Match on this source port */
- if ($srcport != "")
- $src .= " port {$srcport}";
-
- /* sometimes this gets called with "" instead of a value */
- if ($dst == "")
- $dst = "any";
-
- /* Match on this dest port */
- if ($dstport != "")
- $dst .= " port {$dstport}";
-
- /* Allow for negating NAT entries */
- if ($nonat) {
- $nat = "no nat";
- $target = "";
- } else {
- $nat = "nat";
- $target = "-> {$tgt}";
- }
-
- /* outgoing static-port option, hamachi, Grandstream, VOIP, etc */
- if($staticnatport)
- $staticnatport_txt = " static-port";
- else
- if(!$natport)
- $staticnatport_txt = " port 1024:65535"; // set source port range
- else
- $staticnatport_txt = "";
-
- $if_friendly = convert_real_interface_to_friendly_descr($if);
-
- /* Put all the pieces together */
- if($if_friendly)
- $natrule = "{$nat} on \${$if_friendly} from {$src} to {$dst} {$target}{$staticnatport_txt}\n";
-
- return $natrule;
-}
-
-function is_one_to_one_or_server_nat_rule($iptocheck) {
- global $config, $target;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "is_one_to_one_or_server_nat_rule() being called $mt\n";
- }
-
- if($config['nat']['onetoone'] <> "")
- foreach($config['nat']['onetoone'] as $onetoone) {
- if(ip_in_subnet($iptocheck,$onetoone['internal']."/".$onetoone['subnet']) == true)
- return true;
- if($onetoone['internal'] == $target)
- return true;
- }
-
- if($config['nat']['servernat'] <> "")
- foreach($config['nat']['servernat'] as $onetoone) {
- $int = explode("/", $onetoone['ipaddr']);
- if(ip_in_subnet($iptocheck,$onetoone['ipaddr']."/".$onetoone['subnet']) == true)
- return true;
- if($onetoone['ipaddr'] == $target)
- return true;
- }
-
- if($config['nat']['rule'] <> "")
- foreach($config['nat']['rule'] as $onetoone) {
- $int = explode("/", $onetoone['target']);
- if(ip_in_subnet($iptocheck,$onetoone['target']."/".$onetoone['subnet']) == true)
- return true;
- if($onetoone['target'] == $target)
- return true;
- }
-
- return FALSE;
-}
-
-function filter_nat_rules_generate() {
- global $config, $g, $after_filter_configure_run;
-
- $wancfg = $config['interfaces']['wan'];
- $lancfg = $config['interfaces']['lan'];
-
- $pptpdcfg = $config['pptpd'];
- $pppoecfg = $config['pppoe'];
- $wanif = get_real_wan_interface();
-
- $lanif = $config['interfaces']['lan']['if'];
- $lanip = $config['interfaces']['lan']['ipaddr'];
-
- $lansa = gen_subnet($lancfg['ipaddr'], $lancfg['subnet']);
-
- $natrules .= "nat-anchor \"pftpx/*\"\n";
-
- $natrules .= "nat-anchor \"natearly/*\"\n";
- $natrules .= "nat-anchor \"natrules/*\"\n";
-
- $natrules .= "# FTP proxy\n";
- $natrules .= "rdr-anchor \"pftpx/*\"\n";
-
- update_filter_reload_status("Creating 1:1 rules...");
-
- /* any 1:1 mappings? */
- if (is_array($config['nat']['onetoone'])) {
- foreach ($config['nat']['onetoone'] as $natent) {
- if (!is_numeric($natent['subnet']))
- $sn = 32;
- else
- $sn = $natent['subnet'];
-
- if (!$natent['interface'] || ($natent['interface'] == "wan"))
- $natif = $wanif;
- else
- $natif = $config['interfaces'][$natent['interface']]['if'];
-
- if($natif)
- $natrules .= "binat on $natif from {$natent['internal']}/{$sn} to any -> {$natent['external']}/{$sn}\n";
- }
- }
-
- $natrules .= "\n# Outbound NAT rules\n";
-
- /* outbound rules - advanced or standard */
- if (isset($config['nat']['advancedoutbound']['enable'])) {
- /* advanced outbound rules */
- if (is_array($config['nat']['advancedoutbound']['rule'])) {
- foreach ($config['nat']['advancedoutbound']['rule'] as $obent) {
-
- update_filter_reload_status("Creating advanced outbound rule {$obent['descr']}");
-
- $src = $obent['source']['network'];
- if (isset($obent['destination']['not']) && !isset($obent['destination']['any']))
- $dst = "!" . $obent['destination']['address'];
- else
- $dst = $obent['destination']['address'];
-
-
- if (!$obent['interface'] || ($obent['interface'] == "wan"))
- $natif = $wanif;
- else
- $natif = $config['interfaces'][$obent['interface']]['if'];
-
- $natrules .= filter_nat_rules_generate_if($natif,
- $src,
- $obent['sourceport'],
- $dst,
- $obent['dstport'],
- $obent['target'],
- $obent['natport'],
- isset($obent['nonat']),
- isset($obent['staticnatport'])
- );
- }
- }
- } else {
- /* standard outbound rules (one for each interface) */
- update_filter_reload_status("Creating outbound NAT rules");
-
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$lansa}/{$lancfg['subnet']}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$lansa}/{$lancfg['subnet']}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$lansa}/{$lancfg['subnet']}");
-
- $optints = array();
- generate_optcfg_array($optints);
-
- /* generate lan nat mappings for opts with a gateway opts */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if (interface_has_gateway("$opt_interface")) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$lansa}/{$lancfg['subnet']}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$lansa}/{$lancfg['subnet']}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$lansa}/{$lancfg['subnet']}");
- }
- }
-
- /* optional interfaces */
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- update_filter_reload_status("Creating outbound rules (opt{$i})");
- $optcfg = $config['interfaces']['opt' . $i];
-
- if ((isset ($optcfg['enable'])) && (!$optcfg['bridge']) && (!interface_has_gateway("opt{$i}"))) {
- $optsa = gen_subnet($optcfg['ipaddr'], $optcfg['subnet']);
-
- /* create outbound nat entries for primary wan */
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$optsa}/{$optcfg['subnet']}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$optsa}/{$optcfg['subnet']}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$optsa}/{$optcfg['subnet']}", null, "", null, null, null, isset($optcfg['nonat']));
-
- /* create outbound nat entries for all opt wans */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if (interface_has_gateway("$opt_interface")) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$optsa}/{$optcfg['subnet']}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$optsa}/{$optcfg['subnet']}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$optsa}/{$optcfg['subnet']}", null, "", null, null, null, isset($optcfg['nonat']));
- }
- }
- }
- }
-
- /* PPTP subnet */
- if ($pptpdcfg['mode'] == "server") {
- $pptp_subnet = $g['pptp_subnet'];
- if($config['pptp']['pptp_subnet'] <> "")
- $pptp_subnet = $config['pptp']['pptp_subnet'];
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}");
-
- /* generate nat mappings for opts with a gateway opts */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if ((is_private_ip($pptpdcfg['remoteip'])) && (interface_has_gateway($opt_interface))) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}");
- }
- }
- }
-
- /* PPPoE subnet */
- if ($pppoecfg['mode'] == "server") {
- $pppoe_subnet = $g['pppoe_subnet'];
- if($config['pppoe']['pppoe_subnet'] <> "")
- $pppoe_subnet = $config['pppoe']['pppoe_subnet'];
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}");
-
- /* generate nat mappings for opts with a gateway opts */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if ((is_private_ip($pppoecfg['remoteip'])) && (interface_has_gateway($opt_interface))) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}");
- }
- }
- }
-
- /* static routes */
- if (is_array($config['staticroutes']['route'])) {
- foreach ($config['staticroutes']['route'] as $route) {
- $netip = explode("/", $route['network']);
- if ((! interface_has_gateway($route['interface'])) && (is_private_ip($netip[0]))) {
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$route['network']}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$route['network']}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$route['network']}", "", null);
- }
- /* generate nat mapping for static routes on opts */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if ((! interface_has_gateway($route['interface'])) && (is_private_ip($netip[0])) && (interface_has_gateway($opt_interface))) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$route['network']}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$route['network']}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$route['network']}", "", null);
- }
- }
-
- }
- }
-
- }
-
- $natrules .= "\n#SSH Lockout Table\n";
- $natrules .= "table <sshlockout> persist\n\n";
-
- /* is SPAMD insalled? */
- if (is_package_installed("spamd") == 1) {
- $natrules .= "\n# spam table \n";
-
- $natrules .= "table <whitelist> persist\n";
- $natrules .= "table <blacklist> persist\n";
- $natrules .= "table <spamd> persist\n";
- if(file_exists("/var/db/whitelist.txt"))
- $natrules .= "table <spamd-white> persist file \"/var/db/whitelist.txt\"\n";
- $natrules .= "rdr pass on {$wanif} proto tcp from <blacklist> to port smtp -> 127.0.0.1 port spamd\n";
- $natrules .= "rdr pass on {$wanif} proto tcp from <spamd> to port smtp -> 127.0.0.1 port spamd\n";
- $natrules .= "rdr pass on {$wanif} proto tcp from !<spamd-white> to port smtp -> 127.0.0.1 port spamd\n";
- if($config['installedpackages']['spamdsettings']['config'])
- foreach($config['installedpackages']['spamdsettings']['config'] as $ss)
- $nextmta = $ss['nextmta'];
- if($nextmta <> "") {
- $natrules .= "rdr pass on {$wanif} proto tcp from <spamd-white> to port smtp -> {$nextmta} port smtp\n";
- }
- }
-
- /* load balancer anchor */
- $natrules .= "\n# Load balancing anchor - slbd updates\n";
- $natrules .= "rdr-anchor \"slb\"\n";
-
- update_filter_reload_status("Setting up FTP helper");
-
- $natrules .= "\n# FTP Proxy/helper\n";
- /* build an array of interfaces to work with */
- $iflist = array("lan" => "LAN");
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
- $iflist['opt' . $i] = "opt{$i}";
- $interface_counter = 0;
- $vpns_list = get_vpns_list();
- /* prevent 1:1 ips from pftpx, they will be handled by ftp-sesame */
- if($config['nat']['onetoone'])
- foreach ($config['nat']['onetoone'] as $vipent)
- $onetoone_list .= "{$vipent['internal']} ";
- if($onetoone_list)
- $natrules .= "table <onetoonelist> { $onetoone_list }\n";
- if($vpns_list)
- $natrules .= "table <vpns> { $vpns_list }\n";
- /* loop through all interfaces and handle pftpx redirections */
- foreach ($iflist as $ifent => $ifname) {
- $ifname_lower = convert_friendly_interface_to_friendly_descr(strtolower($ifname));
- $realif = convert_friendly_interface_to_real_interface_name(strtolower($ifname));
- $int_ip = find_interface_ip($realif);
- if(isset($config['interfaces'][strtolower($ifname)]['disableftpproxy'])) {
- if($g['debug'])
- log_error("Filter: FTP proxy disabled for interface {$ifname} - ignoring.");
- $interface_counter++;
- continue;
- }
- if(stristr($ifname, "opt")) {
- if(!isset($config['interfaces'][$ifname]['enable'])) {
- continue;
- }
- }
- /* are we in routed mode? no source nat rules and not a outside interface? */
- /* If we have advanced outbound nat we skip the FTP proxy, we use ftpsesame */
- if((isset($config['nat']['advancedoutbound']['enable'])) && (! interface_has_gateway($ifname))) {
- $sourcenat = 0;
- /* we are using advanced outbound nat, are we in routing mode? */
- $realif = convert_friendly_interface_to_real_interface_name($ifname);
- /* if the interface address lies within a outbound NAT source network we should skip */
- if(! empty($config['nat']['advancedoutbound']['rule'])) {
- foreach($config['nat']['advancedoutbound']['rule'] as $natnetwork) {
- if(ip_in_subnet($int_ip, $natnetwork['source']['network'])) {
- /* if the interface address is matched in the AON Rule we need the ftp proxy */
- $sourcenat++;
- }
- }
- }
- if($sourcenat == 0) {
- if($g['debug'])
- log_error("Filter: No AON rule matched for interface {$ifname} - not using the FTP proxy");
- $interface_counter++;
- continue;
- } else {
- if($g['debug'])
- log_error("Filter: AON Rule matched for interface {$ifname} - using FTP proxy");
- }
- }
- $tmp_port = 8021 + $interface_counter;
- $tmp_interface = convert_friendly_interface_to_real_interface_name($ifname);
- $ifname_lower = strtolower(convert_friendly_interface_to_friendly_descr($ifname));
- $vpns = get_vpns_list();
- /* if the user has defined, include the alias so that we do not redirect ftp
- connections across the tunnels to pftpx */
- $int_ip = find_interface_ip($tmp_interface);
- /* if interface lacks an ip, dont setup a rdr for ftp. they are most likely on a bridged interface */
- if($int_ip and $vpns_list)
- if($ifname_lower) {
- $natrules .= "no rdr on $tmp_interface proto tcp from any to <vpns> port 21\n";
- if($onetoone_list)
- $natrules .= "no rdr on $tmp_interface proto tcp from <onetoonelist> to any port 21\n";
- }
- if($ifname_lower)
- $natrules .= "rdr on $tmp_interface proto tcp from any to any port 21 -> 127.0.0.1 port {$tmp_port}\n";
- $interface_counter++;
- }
- $natrules .= "\n";
-
- /* DIAG: add ipv6 NAT, if requested */
- if (isset($config['diag']['ipv6nat']['enable']) and $config['diag']['ipv6nat']['ipaddr'] <> "") {
- /* XXX: FIX ME! IPV6 */
- $natrules .= "rdr on \$wan proto ipv6 from any to any -> {$config['diag']['ipv6nat']['ipaddr']}\n";
- }
-
- if(file_exists("/var/etc/inetd.conf"))
- mwexec("rm /var/etc/inetd.conf");
- touch("/var/etc/inetd.conf");
-
- if (isset($config['nat']['rule'])) {
- $natrules .= "# NAT Inbound Redirects\n";
-
- if(!isset($config['system']['disablenatreflection'])) {
- $inetd_fd = fopen("/var/etc/inetd.conf","w");
- /* start redirects on port 19000 of localhost */
- $starting_localhost_port = 19000;
- }
-
- foreach ($config['nat']['rule'] as $rule) {
-
- update_filter_reload_status("Creating NAT rule {$rule['descr']}");
-
- /* if item is an alias, expand */
- $extport = "";
- unset($extport);
- if(alias_expand($rule['external-port']))
- $extport[0] = alias_expand_value($rule['external-port']);
- else
- $extport = explode("-", $rule['external-port']);
-
- /* if item is an alias, expand */
- if(alias_expand($rule['local-port']))
- $localport = "";
- else
- $localport = " port {$rule['local-port']}";
-
- $target = alias_expand_host($rule['target']);
-
- if (!$target) {
- $natrules .= "# Unresolvable alias {$rule['target']}\n";
- continue; /* unresolvable alias */
- }
-
- # use tables for aliases in rdr
- if (!is_ipaddr($target)) {
- $natrules .= "table <{$rule['target']}> { $target }\n";
- $target = "<{$rule['target']}>";
- }
-
- if ($rule['external-address'])
- if($rule['external-address'] <> "any")
- $extaddr = $rule['external-address'] . "/32";
- else
- $extaddr = $rule['external-address'];
- else
- $extaddr = get_current_wan_address($rule['interface']);
-
- if (!$rule['interface'] || ($rule['interface'] == "wan"))
- $natif = $wanif;
- else if($rule['interface'] == "\$pptp")
- $natif = "pptp";
- else if($rule['interface'] == "\$pppoe")
- $natif = "pppoe";
- else
- $natif = $config['interfaces'][$rule['interface']]['if'];
-
- $lanif = $lancfg['if'];
-
- /*
- * Expand aliases
- * XXX: may want to integrate this into pf macros
- */
- if(alias_expand($target))
- $target = alias_expand($target);
- if(alias_expand($extaddr))
- $extaddr = alias_expand($extaddr);
-
- /*
- * If FTP Proxy Helper is enabled and the
- * operator has requested a port forward to
- * a ftp server then launch a helper
- */
- $dontinstallrdr = false;
- if($target <> "") {
- $external_address = $rule['external-address'];
- if($extport[0] == "21" and !isset($config['interfaces'][strtolower($rule['interface'])]['disableftpproxy'])) {
- $helpers = exec("/bin/ps awux | grep \"{$target} -b {$external_address}\" | grep -v grep");
- if(!$helpers) {
- if($external_address == "")
- $external_address = find_interface_ip(get_real_wan_interface());
- /* install a pftpx helper, do not set a rule. also use the delay filter configure run
- * routines because if this is the first bootup the filter is not completely configured
- * and thus pf is not fully running. otherwise we end up with: pftpx: pf is disabled
- */
- if(isset($config['shaper']['enable'])) {
- if(isset($config['ezshaper']['step5']['p2pcatchall'])) {
- $shaper_queue = "-q qP2PUp ";
- } else {
- $upq = "q" . convert_friendly_interface_to_friendly_descr($config['ezshaper']['step2']['outside_int']);
- $shaper_queue = "-q {$upq}def ";
- }
- } else {
- $shaper_queue = "";
- }
- $after_filter_configure_run[] = "/usr/local/sbin/pftpx {$shaper_queue}-f {$target} -b {$external_address} -c 21 -g 21";
- }
- $dontinstallrdr = true;
- }
- }
-
- if($extaddr == "")
- $dontinstallrdr = true;
-
- $rdr_on = convert_real_interface_to_friendly_descr($rule['interface']);
-
- if($dontinstallrdr == false) {
- /* is rule a port range? */
- if ((!$extport[1]) || ($extport[0] == $extport[1])) {
-
- switch ($rule['protocol']) {
- case "tcp/udp":
- if($natif) {
- if($rule['external-port'] <> $rule['local-port'])
- $natrules .= "{$nordr}rdr on $natif proto { tcp udp } from any to {$extaddr} port { {$extport[0]} } -> {$target}{$localport}";
- else
- $natrules .= "{$nordr}rdr on $natif proto { tcp udp } from any to {$extaddr} port { {$extport[0]} } -> {$target}";
- }
- break;
- case "udp":
- case "tcp":
- if($extport[0])
- if($natif) {
- if($rule['external-port'] <> $rule['local-port'])
- $natrules .= "rdr on $natif proto {$rule['protocol']} from any to {$extaddr} port { {$extport[0]} } -> {$target}{$localport}";
- else
- $natrules .= "rdr on $natif proto {$rule['protocol']} from any to {$extaddr} port { {$extport[0]} } -> {$target}";
- }
- else
- if($natif)
- $natrules .= "rdr on $natif proto {$rule['protocol']} from any to {$extaddr} -> {$target}{$localport}";
- break;
- default:
- $natrules .= "rdr on $natif proto {$rule['protocol']} from any to {$extaddr} -> {$target}";
- break;
- }
- } else {
- switch ($rule['protocol']) {
- case "tcp/udp":
- if($natif)
- $natrules .= "{$nordr}rdr on $natif proto { tcp udp } from any to {$extaddr} port {$extport[0]}:{$extport[1]} -> {$target}{$localport}:*";
- break;
- case "udp":
- case "tcp":
- if($natif)
- $natrules .= "{$nordr}rdr on $natif proto {$rule['protocol']} from any to {$extaddr} port {$extport[0]}:{$extport[1]} -> {$target}{$localport}:*";
- break;
- default:
- if($natif)
- $natrules .= "{$nordr}rdr on $natif proto {$rule['protocol']} from any to {$extaddr} -> {$target}";
- }
- }
- }
-
- /* does this rule redirect back to a internal host?
- * if so, add some extra goo to help this work.
- */
- $rule_friendly_if = convert_friendly_interface_to_real_interface_name($rule['interface']);
- $rule_interface_ip = find_interface_ip($rule_friendly_if);
- $rule_interface_subnet = $config['interfaces'][$rule['interface']]['subnet'];
- $rule_subnet = gen_subnet($rule_interface_ip, $rule_interface_subnet);
- if($rule['external-address'] == "any" and $rule['interface'] == "lan") {
- $natrules .= "\n";
- if($rule_friendly_if)
- $natrules .= "no nat on {$rule_friendly_if} proto tcp from {$rule_friendly_if} to {$rule_subnet}/{$rule_interface_subnet}\n";
- if($rule_friendly_if)
- $natrules .= "nat on {$rule_friendly_if} proto tcp from {$rule_subnet}/{$rule_interface_subnet} to {$target} port {$extport[0]} -> {$rule_friendly_if}\n";
- }
-
- if(!isset($config['system']['disablenatreflection'])) {
-
- update_filter_reload_status("Setting up reflection");
-
- $natrules .= "\n# Reflection redirects\n";
- foreach ($iflist as $ifent => $ifname) {
-
- /* do not process interfaces with gateways*/
- if($config['interfaces'][$ifname]['gateway'] <> "")
- continue;
-
- /* do not process interfaces that will end up with gateways */
- if($config['interfaces'][$ifname]['ipaddr'] == "dhcp" or
- $config['interfaces'][$ifname]['ipaddr'] == "bigpond" or
- $config['interfaces'][$ifname]['ipaddr'] == "pppoe" or
- $config['interfaces'][$ifname]['ipaddr'] == "pptp")
- continue;
-
- $ifname_real = convert_friendly_interface_to_real_interface_name($ifname);
-
- if($extport[1])
- $range_end = ($extport[1]);
- else
- $range_end = ($extport[0]);
-
- $range_end++;
-
- if($rule['local-port'])
- $lrange_start = $rule['local-port'];
-
- if($range_end - $extport[0] > 500) {
- $range_end = $extport[0]+1;
- log_error("Not installing nat reflection rules for a port range > 500");
- } else {
- /* only install reflection rules for < 19991 items */
- if($starting_localhost_port < 19991) {
- $loc_pt = $lrange_start;
- for($x=$extport[0]; $x<$range_end; $x++) {
-
- $xxx = $x;
-
- /* do not install reflection rules for FTP. This simply
- * opens up pandoras box.
- */
- if($xxx == "21")
- continue;
-
- update_filter_reload_status("Creating reflection rule for {$rule['descr']}...");
-
- $ifname_real = convert_friendly_interface_to_friendly_descr(strtolower($ifname));
-
- if($config['system']['reflectiontimeout'])
- $reflectiontimeout = $config['system']['reflectiontimeout'];
- else
- $reflectiontimeout = "2000";
-
- switch($rule['protocol']) {
-
- case "tcp/udp":
- $protocol = "{ tcp udp }";
- $toadd_array = array();
- if(is_alias($loc_pt)) {
- $loc_pt_translated = alias_expand_value($loc_pt);
- if(stristr($loc_pt_translated, " ")) {
- /* XXX: we should deal with multiple ports */
- $loc_pt_translated_split = split(" ", $loc_pt_translated);
- foreach($loc_pt_translated_split as $lpts)
- $toadd_array[] = $lpts;
- } else {
- $toadd_array[] = $loc_pt_translated;
- }
- } else {
- $loc_pt_translated = $loc_pt;
- $toadd_array[] = $loc_pt_translated;
- }
- foreach($toadd_array as $tda){
- fwrite($inetd_fd, "{$starting_localhost_port}\tstream\ttcp/udp\tnowait/0\tnobody\t/usr/bin/nc nc -w {$reflectiontimeout} {$target} {$tda}\n");
- if($ifname_real)
- $natrules .= "rdr on \${$ifname_real} proto tcp from any to {$extaddr} port { {$xxx} } -> 127.0.0.1 port {$starting_localhost_port}\n";
- $starting_localhost_port++;
- fwrite($inetd_fd, "{$starting_localhost_port}\tstream\ttcp/udp\tnowait/0\tnobody\t/usr/bin/nc nc -u -w {$reflectiontimeout} {$target} {$tda}\n");
- if($ifname_real)
- $natrules .= "rdr on \${$ifname_real} proto udp from any to {$extaddr} port { {$xxx} } -> 127.0.0.1 port {$starting_localhost_port}\n";
- $xxx++;
- $starting_localhost_port++;
- }
- break;
- case "tcp":
- case "udp":
- $protocol = $rule['protocol'];
- $toadd_array = array();
- if(is_alias($loc_pt)) {
- $loc_pt_translated = alias_expand_value($loc_pt);
- if(stristr($loc_pt_translated, " ")) {
- /* XXX: we should deal with multiple ports */
- $loc_pt_translated_split = split(" ", $loc_pt_translated);
- foreach($loc_pt_translated_split as $lpts)
- $toadd_array[] = $lpts;
- } else {
- $toadd_array[] = $loc_pt_translated;
- }
- } else {
- $loc_pt_translated = $loc_pt;
- $toadd_array[] = $loc_pt_translated;
- }
- foreach($toadd_array as $tda){
- if($protocol == "udp")
- $dash_u = "-u ";
- else
- $dash_u = "";
- if($config['system']['reflectiontimeout'])
- $reflectiontimeout = $config['system']['reflectiontimeout'];
- else
- $reflectiontimeout = "2000";
- fwrite($inetd_fd, "{$starting_localhost_port}\tstream\t{$protocol}\tnowait/0\tnobody\t/usr/bin/nc nc {$dash_u}-w {$reflectiontimeout} {$target} {$tda}\n");
- if($ifname_real)
- $natrules .= "rdr on \${$ifname_real} proto {$protocol} from any to {$extaddr} port { {$xxx} } -> 127.0.0.1 port {$starting_localhost_port}\n";
- $xxx++;
- $starting_localhost_port++;
- }
- break;
- default:
- break;
- }
- $loc_pt++;
- if($starting_localhost_port > 19990) {
- log_error("Not installing nat reflection rules. Maximum 1,000 reached.");
- $x = $range_end+1;
- }
- }
- }
- }
-
- }
-
- }
-
- $natrules .= "\n";
- }
-
- if(!isset($config['system']['disablenatreflection'])) {
- fclose($inetd_fd);
- $helpers = trim(exec("/bin/ps ax | /usr/bin/grep inetd | /usr/bin/grep -v grep | /usr/bin/grep 127"));
- if(!$helpers)
- mwexec("/usr/sbin/inetd -wW -R 0 -a 127.0.0.1 /var/etc/inetd.conf");
- else
- mwexec("/usr/bin/killall -HUP inetd", true);
-
- }
- }
-
- if ($pptpdcfg['mode'] && $pptpdcfg['mode'] != "off") {
-
- if ($pptpdcfg['mode'] == "server")
- $pptpdtarget = "127.0.0.1";
- else if ($pptpdcfg['mode'] == "redir")
- $pptpdtarget = $pptpdcfg['redir'];
-
- if ($pptpdcfg['mode'] == "redir") {
-
- $natrules .= <<<EOD
-
-# PPTP
-rdr on \$wan proto gre from any to any -> $pptpdtarget
-rdr on \$wan proto tcp from any to any port 1723 -> $pptpdtarget
-
-EOD;
- }
- }
-
- if (is_package_installed('squid') && file_exists('/usr/local/pkg/squid.inc')) {
- require_once('squid.inc');
- $natrules .= squid_generate_rules('nat');
- }
-
- if (is_package_installed('clamav') && file_exists('/usr/local/pkg/clamav.inc')) {
- require_once('clamav.inc');
- $natrules .= clamav_generate_rules('nat');
- }
-
- if (is_package_installed('frickin') && file_exists('/usr/local/pkg/frickin.inc')) {
- require_once ('frickin.inc');
- $natrules .= frickin_generate_rules('nat');
- }
-
- if (is_package_installed('siproxd') && file_exists('/usr/local/pkg/sipproxd.inc')) {
- require_once('sipproxd.inc');
- $natrules .= siproxd_generate_rules('nat');
- }
-
- $natrules .= process_carp_nat_rules();
-
- $natrules .= "# IMSpector rdr anchor\n";
- $natrules .= "rdr-anchor \"imspector\"\n";
-
- $natrules .= "# UPnPd rdr anchor\n";
- $natrules .= "rdr-anchor \"miniupnpd\"\n";
-
- return $natrules;
-}
-
-function run_command_return_string($cmd) {
- global $config;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "generate_user_filter_rule() being called $mt\n";
- }
-
- $fd = popen($cmd, "r");
- while(!feof($fd)) {
- $tmp .= fread($fd,49);
- }
- fclose($fd);
- return $tmp;
-}
-
-function generate_user_filter_rule_arr($rule, $ngcounter) {
- global $config;
- update_filter_reload_status("Creating filter rules {$rule['descr']} ...");
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "generate_user_filter_rule() being called $mt\n";
- }
- $ret = array();
- $line = generate_user_filter_rule($rule, $ngcounter);
- $ret['rule'] = $line;
- $ret['interface'] = $rule['interface'];
- if ($line[0] != '#') {
- if($rule['descr'] != "" and $line != "")
- $ret['descr'] = "label \"USER_RULE: " . str_replace('"', '', $rule['descr']) . "\"";
- else
- $ret['descr'] = "label \"USER_RULE\"";
- }
- $ret['ackq'] = get_ack_queue($rule['interface']);
-
- return $ret;
-}
-
-function generate_user_filter_rule($rule, $ngcounter) {
- global $config, $g;
- global $table_cache;
- global $schedule_enabled;
-
- if($config['schedules']) {
- foreach($config['schedules']['schedule'] as $sched) {
- $schedule_enabled = true;
- break;
- }
- }
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "generate_user_filter_rule() being called $mt\n";
- }
-
- /* Setup cache array if not already existing */
- if (!isset($table_cache)) {
- if ($g['debug'])
- echo "Creating table cache\n";
- $table_cache = array();
- }
-
- update_filter_reload_status("Creating filter rules {$rule['descr']} ...");
-
- $wancfg = $config['interfaces']['wan'];
- $lancfg = $config['interfaces']['lan'];
- $pptpdcfg = $config['pptpd'];
- $pppoecfg = $config['pppoe'];
-
- $lanif = $lancfg['if'];
- $wanif = get_real_wan_interface();
-
- $lanip = $lancfg['ipaddr'];
- $lansa = gen_subnet($lancfg['ipaddr'], $lancfg['subnet']);
- $lansn = $lancfg['subnet'];
-
- $int = "";
-
- $optcfg = array();
- generate_optcfg_array($optcfg);
-
- $curwanip = get_current_wan_address();
-
- /* don't include disabled rules */
- if (isset($rule['disabled'])) {
- return "# rule " . $rule['descr'] . " disabled ";
- }
-
- $pptpdcfg = $config['pptpd'];
- $pppoecfg = $config['pppoe'];
-
- if ($pptpdcfg['mode'] == "server") {
- $pptpip = $pptpdcfg['localip'];
- $pptpsa = $pptpdcfg['remoteip'];
- $pptpsn = $g['pptp_subnet'];
- if($config['pptp']['pptp_subnet'] <> "")
- $pptpsn = $config['pptp']['pptp_subnet'];
- }
-
- if ($pppoecfg['mode'] == "server") {
- $pppoeip = $pppoecfg['localip'];
- $pppoesa = $pppoecfg['remoteip'];
- $pppoesn = $g['pppoe_subnet'];
- if($config['pppoe']['pppoe_subnet'] <> "")
- $pppoesn = $config['pppoe']['pppoe_subnet'];
- }
-
- /* does the rule deal with a PPTP interface? */
- if ($rule['interface'] == "pptp") {
- if ($pptpdcfg['mode'] != "server")
- return "";
- $nif = $g['n_pptp_units'];
- if($config['pptp']['n_pptp_units'] <> "")
- $nif = $config['pptp']['n_pptp_units'];
- $ispptp = true;
- } else if($rule['interface'] == "pppoe") {
- if ($pppoecfg['mode'] != "server") {
- return " # Error creating pppoe rule";
- }
- $nif = $g['n_pppoe_units'];
- if($config['pppoe']['n_pppoe_units'] <> "")
- $nif = $config['pppoe']['n_pppoe_units'];
- $ispppoe = true;
- } else if(!isset($rule['interface'])) {
- return '# Interface empty for rule: '.$rule['descr'];
- } else {
-
- /* Check to see if the interface is opt and in our opt list */
- if (strstr($rule['interface'], "opt")) {
- if (!array_key_exists($rule['interface'], $optcfg)) {
- $item = "";
- foreach($optcfg as $oc) $item .= $oc['if'];
- return "# {$real_int} {$item} {$rule['interface']} array key does not exist for " . $rule['descr'];
- }
- }
-
- $nif = 1;
- $ispptp = false;
- $ispppoe = false;
- }
-
- if ($pptpdcfg['mode'] != "server") {
- if (($rule['source']['network'] == "pptp") ||
- ($rule['destination']['network'] == "pptp")) {
- return "# source network or destination network == pptp on " . $rule['descr'];
- }
- }
-
- if ($rule['source']['network'] && strstr($rule['source']['network'], "opt")) {
- if (!array_key_exists($rule['source']['network'], $optcfg)) {
- $optmatch = "";
- if(preg_match("/opt([0-999])/", $rule['source']['network'], $optmatch)) {
- $real_opt_int = convert_friendly_interface_to_real_interface_name("opt" . $optmatch[1]);
- $opt_ip = find_interface_ip($real_opt_int);
- if(!$opt_ip)
- return "# unresolvable optarray $real_opt_int - $optmatch[0] - $opt_ip";
- } else {
- return "# {$rule['source']['network']} !array_key_exists source network " . $rule['descr'];
- }
- }
- }
- if ($rule['destination']['network'] && strstr($rule['destination']['network'], "opt")) {
- if (!array_key_exists($rule['destination']['network'], $optcfg)) {
- if(preg_match("/opt([0-999])/", $rule['destination']['network'], $optmatch)) {
- $real_opt_int = convert_friendly_interface_to_real_interface_name("opt" . $optmatch[1]);
- $opt_ip = find_interface_ip($real_opt_int);
- if(!$opt_ip)
- return "# unresolvable oparray $real_opt_int - $optmatch[0] - $opt_ip";
- } else {
- return "# {$item} {$rule['destination']['network']} !array_key_exists dest network " . $rule['descr'];
- }
- }
- }
-
- /* check for unresolvable aliases */
- if ($rule['source']['address'] && !alias_expand($rule['source']['address'])) {
- file_notice("Filter_Reload", "# unresolvable source aliases {$rule['descr']}");
- return "# unresolvable source aliases {$rule['descr']}";
- }
- if ($rule['destination']['address'] && !alias_expand($rule['destination']['address'])) {
- file_notice("Filter_Reload", "# unresolvable dest aliases {$rule['descr']}");
- return "# unresolvable dest aliases {$rule['descr']}";
- }
-
- $ifdescrs = array();
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
- $ifdescrs[] = "opt" . $i;
-
- update_filter_reload_status("Setting up pass/block rules");
-
- for ($iif = 0; $iif < $nif; $iif++) {
-
- $type = $rule['type'];
-
-
- if ($type != "pass" && $type != "block" && $type != "reject") {
- /* default (for older rules) is pass */
- $type = "pass";
- }
-
- if ($type == "reject") {
- /* special reject packet */
- $aline['type'] = "block return";
- } else {
- $aline['type'] = $type;
- }
-
- /* ensure the direction is in */
- $aline['direction'] = " in ";
-
- if (isset($rule['log']))
- $aline['log'] = "log ";
-
- $aline['quick'] = "quick ";
-
- if ($ispptp) {
- $aline['interface'] = "on \$pptp ";
- } else if ($ispppoe) {
- $aline['interface'] = "on \$pppoe ";
- } else {
- // translate wan, man, lan, opt to real interface.
- $interface = $rule['interface'];
- $temp = filter_get_opt_interface_descr($interface);
- if($temp <> "") $interface = $temp;
- if(isset($rule['destination']['address'])) {
- $canadd = 0; // XXX: billm - eh? this is a nice little noop
- /* because pf will not allow a interface for proxyARP
- type traffic lets check if its in use and if so leave
- off the interface */
- if(is_one_to_one_or_server_nat_rule($rule['destination']['address']))
- $canadd = 0;
- }
- if($canadd == 0)
- $aline['interface'] = "on \$" . convert_real_interface_to_friendly_descr($rule['interface']) . " ";
- }
-
-
- /* set the gateway interface */
- $ri = filter_translate_type_to_real_interface($rule['interface']);
-
- update_filter_reload_status("Setting up pass/block rules {$rule['descr']}");
-
- /*
- * check to see if /tmp/{${ri}_router exists. This file
- * is created by dhclient for 2nd wan interfaces, etc.
- * else get gateway from the interface config
- */
- if(file_exists("{$g['tmp_path']}/{$ri}_router")) {
- $rg = file_get_contents("{$g['tmp_path']}/{$ri}_router");
- $rg = rtrim($rg);
- } elseif ($config['interfaces'][$rule['interface']]['gateway'] <> "") {
- $rg = $config['interfaces'][$rule['interface']]['gateway'];
- }
-
- /* do not process reply-to for gateway'd rules */
- if(($rule['gateway'] == "") and ($ri != "") and ($rg != "")) {
- $aline['reply'] = "reply-to (" . $ri . " " . $rg . ") ";
- }
-
- /* if user has selected a custom gateway, lets work with it */
- if($rule['gateway'] <> "") {
- $foundlb = 0;
- $routeto = " route-to { ";
- if(is_array($config['load_balancer']['lbpool'])) {
- foreach($config['load_balancer']['lbpool'] as $lb) {
- update_filter_reload_status("Creating load balancing item...");
- if($lb['name'] == $rule['gateway']) {
- $gateway = $rule['gateway'];
- /*
- * is $gateway a interface name?
- * if so, lets find out the gateway address
- * from /tmp/router_bleh.router
- */
- if(in_array($gateway, $ifdescrs)==true) {
- if(is_file("{$g['tmp_path']}/{$gateway}_router")) {
- $return_gateway = file_get_contents("{$g['tmp_path']}/{$gateway}_router");
- } else {
- log_error("Could not find {$g['tmp_path']}/{$gateway}_router. Needed for dhcp gateway information");
- continue;
- }
- }
- /* if /tmp/$lbname.pool exists then read in our gateway hints from slbd */
- if(file_exists("{$g['tmp_path']}/{$lb['name']}.pool")) {
- $lbs_tmp = split("\n", file_get_contents("{$g['tmp_path']}/{$lb['name']}.pool"));
- $lbs = array();
- /* process the entire file to prevent empty lines */
- foreach($lbs_tmp as $lb_tmp) {
- if(is_ipaddr($lb_tmp)) {
- $lbs[] = $lb_tmp;
- }
- }
- $lbs_count = count($lbs);
- if($g['debug'])
- log_error("We found $lbs_count valid entries in status file {$g['tmp_path']}/{$lb['name']}.pool");
-
- if(count($lbs) == 0) {
- if($g['debug'])
- log_error("There are no servers found in the status file, using XML config settings!");
- foreach ($lb['servers'] as $lbsvr) {
- $lbsvr_split = split("\|", $lbsvr);
- $lbs[] = $lbsvr_split[1];
- }
- }
- } else {
- if($g['debug'])
- log_error("There is no server status file, using XML config settings!");
- $lbs = array();
- foreach ($lb['servers'] as $lbsvr) {
- $lbsvr_split = split("\|", $lbsvr);
- $lbs[] = $lbsvr_split[1];
- }
- }
- /* If we want failover we only return the first (top) server from the list
- * and work our way down from there. This way we order the failover order.
- */
- if($lb['behaviour'] == "failover") {
- $firstsrv = $lbs[0];
- $lbs = array("$firstsrv");
- }
-
- /* create server/gateway gateway/monitor array */
- $l = 0;
- $lbconfig = array();
- foreach ($lb['servers'] as $lbsvr) {
- $lbsvr_split=split("\|", $lbsvr);
- $lbconfig['gateway'][$l] = $lbsvr_split[0];
- $lbconfig['monitor'][$l] = $lbsvr_split[1];
- $l++;
- }
- $lbconfig_count = count($lbconfig['gateway']);
-
- $l = 0;
- while($l < $lbconfig_count) {
- /* iterate through $lbs and setup items accordingly */
- foreach($lbs as $server) {
- if ($server == "")
- continue;
- unset($gateway, $int);
- if ($lbconfig['monitor'][$l] == $server) {
- /* determine interface gateway */
- if(is_ipaddr($lbconfig['gateway'][$l])) {
- $int = guess_interface_from_ip($lbconfig['gateway'][$l]);
- $gateway = $lbconfig['gateway'][$l];
- log_error("SLBD pool {$lb['name']} is old style. Please recreate.");
- } else if(interface_has_gateway($lbconfig['gateway'][$l])) {
- $int = convert_friendly_interface_to_real_interface_name($lbconfig['gateway'][$l]);
- $gateway = get_interface_gateway($lbconfig['gateway'][$l]);
- }
- if(($int <> "") && ($gateway <> "")) {
- if($g['debug'])
- log_error("Setting up route with {$lbconfig['gateway'][$l]} om $int for monitor {$lbconfig['monitor'][$l]} on gateway $gateway");
- if($foundlb == 1)
- $routeto .= ", ";
- $routeto .= "( {$int} {$gateway} ) ";
- $foundlb = 1;
- }
- /* we have a match, go forth and try the next LB item so we don't setup multiples incorrectly */
- $l++;
- continue;
- }
- }
- $l++;
- }
- /* If we want failover just use route-to else round-robin */
- if($lb['behaviour'] == "failover") {
- $routeto .= "} ";
- } else {
- $routeto .= "} round-robin ";
- if(isset($config['system']['lb_use_sticky']))
- $routeto .= " sticky-address ";
- }
- }
- }
- /* Add the load balanced gateways */
- if ($foundlb == 1)
- $aline['route'] = $routeto;
- }
- /* we're not using load balancing, just setup gateway */
- if($foundlb == 0) {
- $gateway = $rule['gateway'];
- /*
- * is $gateway a interface name?
- * if so, lets find out the gateway address
- * from /tmp/router_bleh.router
- */
- if(in_array($gateway, $ifdescrs)==true) {
- $int=filter_opt_interface_to_real($gateway);
- if(is_file("{$g['tmp_path']}/{$int}_router")) {
- $gatewayip = file_get_contents("{$g['tmp_path']}/{$int}_router");
- $gatewayip = rtrim($gatewayip);
- if (is_ipaddr($gatewayip)) {
- if($int)
- $aline['route'] = " route-to ( {$int} {$gatewayip} ) ";
- log_error("An error occurred while trying to determine the real interface name for the gateway $gateway");
- }
- } else {
- log_error("Could not find {$g['tmp_path']}/{$int}_router. Needed for dhcp gateway information");
- continue;
- }
- } else {
- /* user picked a real gateway ip */
- if(is_ipaddr($rule['gateway'])) {
- $gatewayip = $rule['gateway'];
- $int = guess_interface_from_ip($gatewayip);
- $aline['route'] = " route-to ( " . guess_interface_from_ip($rule['gateway']) . " {$rule['gateway']} ) ";
- }
- }
- }
- }
-
- if (isset($rule['protocol'])) {
- if($rule['protocol'] == "tcp/udp")
- $aline['prot'] = "proto { tcp udp } ";
- elseif($rule['protocol'] == "icmp")
- $aline['prot'] = "inet proto icmp ";
- else
- $aline['prot'] = "proto {$rule['protocol']} ";
- } else {
- if($rule['source']['port'] <> "" || $rule['destination']['port'] <> "") {
- $aline['prot'] = "proto tcp ";
- }
- }
-
- update_filter_reload_status("Creating rule {$rule['descr']}");
-
- /* source address */
- if (isset($rule['source']['any'])) {
- $src = "any";
- } else if ($rule['source']['network']) {
-
- if (strstr($rule['source']['network'], "opt")) {
- $src = $optcfg[$rule['source']['network']]['sa'] . "/" .
- $optcfg[$rule['source']['network']]['sn'];
- if (isset($rule['source']['not'])) $src = " !{$src}";
- /* check for opt$NUMip here */
- $matches = "";
- if (preg_match("/opt([0-9999])ip/", $rule['source']['network'], $matches)) {
- $optnum = $matches[1];
- $real_int = convert_friendly_interface_to_real_interface_name("opt{$optnum}");
- $src = find_interface_ip($real_int);
- }
- } else {
- switch ($rule['source']['network']) {
- case 'wanip':
- $src = $curwanip;
- break;
- case 'lanip':
- $src = $lanip;
- break;
- case 'lan':
- $src = "{$lansa}/{$lansn}";
- break;
- case 'pptp':
- $src = "{$pptpsa}/{$pptpsn}";
- break;
- case 'pppoe':
- $src = "{$pppoesa}/{$pppoesn}";
- break;
- }
- if (isset($rule['source']['not'])) $src = "!{$src}";
- }
- } else if ($rule['source']['address']) {
- $expsrc = alias_expand($rule['source']['address']);
-
- if (isset($rule['source']['not']))
- $not = "!";
- else
- $not = "";
-
- if (stristr($expsrc, "$")) {
- if($not) {
- $src = "{";
- foreach(preg_split("/[\s]+/", alias_expand_value($rule['source']['address'])) as $item) {
- if($item != "") {
- $src .= " {$not}{$item}";
- }
- }
- /* added support for tables */
- $src .= " 0/0 }";
- $src_table = "<not" . $rule['source']['address'] . ">";
- }
- else {
- $src = "{ {$not} " . alias_expand_value($rule['source']['address']) . " } ";
- $src_table = "<" . $rule['source']['address'] . ">";
- }
-
- /* support for tables */
- $src_table_line = "table $src_table {$src}\n";
- $src = $src_table;
- }
- else
- $src = "{ {$not} {$expsrc} }";
- }
-
- if (!$src || ($src == "/")) {
- return "# at the break!";
- }
-
- $aline['src'] = "from $src ";
-
- if (in_array($rule['protocol'], array("tcp","udp","tcp/udp"))) {
-
- if ($rule['source']['port']) {
- $srcport = explode("-", $rule['source']['port']);
- if(alias_expand($srcport[0]))
- $srcporta = alias_expand($srcport[0]);
- else
- $srcporta = $srcport[0];
- if ((!$srcport[1]) || ($srcport[0] == $srcport[1])) {
- if(alias_expand($srcport[0]))
- $aline['srcport'] = "port {$srcporta} ";
- else
- $aline['srcport'] = "port = {$srcporta} ";
- } else if (($srcport[0] == 1) && ($srcport[1] == 65535)) {
- /* no need for a port statement here */
- } else if ($srcport[1] == 65535) {
- $aline['srcport'] = "port >= {$srcport[0]} ";
- } else if ($srcport[0] == 1) {
- $aline['srcport']= "port <= {$srcport[1]} ";
- } else {
- $srcport[0]--;
- $srcport[1]++;
- $aline['srcport'] = "port {$srcport[0]} >< {$srcport[1]} ";
- }
- }
- /* OS signatures */
- if (($rule['protocol'] == "tcp") && ($rule['os'] <> ""))
- $aline['os'] = "os {$rule['os']} ";
-
- }
-
- /* destination address */
- if (isset($rule['destination']['any'])) {
- $dst = "any";
- } else if ($rule['destination']['network']) {
-
- if (strstr($rule['destination']['network'], "opt")) {
- $dst = $optcfg[$rule['destination']['network']]['sa'] . "/" .
- $optcfg[$rule['destination']['network']]['sn'];
- /* check for opt$NUMip here */
- $matches = "";
- if (preg_match("/opt([0-9999])ip/", $rule['destination']['network'], $matches)) {
- $optnum = $matches[1];
- $real_int = convert_friendly_interface_to_real_interface_name("opt{$optnum}");
- $dst = find_interface_ip($real_int);
- }
- if (isset($rule['destination']['not'])) $dst = " !{$dst}";
- } else {
- switch ($rule['destination']['network']) {
- case 'wanip':
- $dst = $curwanip;
- break;
- case 'lanip':
- $dst = $lanip;
- break;
- case 'lan':
- $dst = "{$lansa}/{$lansn}";
- break;
- case 'pptp':
- $dst = "{$pptpsa}/{$pptpsn}";
- break;
- case 'pppoe':
- $dst = "{$ppoesa}/{$pppoesn}";
- break;
- }
- if (isset($rule['destination']['not'])) $dst = " !{$dst}";
- }
- } else if ($rule['destination']['address']) {
- $expdst = alias_expand($rule['destination']['address']);
-
- if (isset($rule['destination']['not']))
- $not = "!";
- else
- $not = "";
-
- if (stristr($expdst, "$")) {
- if($not) {
- $dst = "{";
- foreach(preg_split("/[\s]+/", alias_expand_value($rule['destination']['address'])) as $item) {
- if($item != "") {
- $dst .= " {$not}{$item}";
- }
- }
- /* added support for tables */
- $dst .= " 0/0 }";
- $dst_table = "<not" . $rule['destination']['address'] . ">";
- }
- else {
- $dst = "{ {$not} " . alias_expand_value($rule['destination']['address']) . " } ";
- $dst_table = "<" . $rule['destination']['address'] . ">";
- }
-
- /* support for tables */
- $dst_table_line = "table $dst_table {$dst}\n";
- $dst = $dst_table;
- }
- else
- $dst = "{ {$not} {$expdst} }";
- }
-
- if (!$dst || ($dst == "/")) {
- return "# returning at dst $dst == \"/\"";
- }
-
- $aline['dst'] = "to $dst ";
-
- if (in_array($rule['protocol'], array("tcp","udp","tcp/udp"))) {
-
- if ($rule['destination']['port']) {
- $dstport = explode("-", $rule['destination']['port']);
- if(alias_expand($dstport[0]))
- $dstporta = alias_expand($dstport[0]);
- else
- $dstporta = $dstport[0];
- if ((!$dstport[1]) || ($dstport[0] == $dstport[1])) {
- if(alias_expand($dstport[0]))
- $aline['dstport'] = "port {$dstporta} ";
- else
- $aline['dstport'] = "port = {$dstporta} ";
- } else if (($dstport[0] == 1) && ($dstport[1] == 65535)) {
- /* no need for a port statement here */
- } else if ($dstport[1] == 65535) {
- $aline['dstport'] = "port >= {$dstport[0]} ";
- } else if ($dstport[0] == 1) {
- $aline['dstport'] = "port <= {$dstport[1]} ";
- } else {
- $dstport[0]--;
- $dstport[1]++;
- $aline['dstport'] = "port {$dstport[0]} >< {$dstport[1]} ";
- }
- }
- }
-
- if (($rule['protocol'] == "icmp") && $rule['icmptype']) {
- $aline['icmp-type'] = "icmp-type {$rule['icmptype']} ";
- }
-
- if ($type == "pass") {
-
- if( isset($rule['source-track']) or isset($rule['max-src-nodes']) or isset($rule['max-src-states']) )
- if($rule['protocol'] == "tcp")
- $aline['flags'] = "flags S/SA ";
- /*
- # keep state
- works with TCP, UDP, and ICMP.
- # modulate state
- works only with TCP. pfSense will generate strong Initial Sequence Numbers (ISNs)
- for packets matching this rule.
- # synproxy state
- proxies incoming TCP connections to help protect servers from spoofed TCP SYN floods.
- This option includes the functionality of keep state and modulate state combined.
- # none
- do not use state mechanisms to keep track. this is only useful if your doing advanced
- queueing in certain situations. please check the faq.
- */
- $noadvoptions = false;
- if(isset($rule['statetype']) && $rule['statetype'] <> "") {
- switch($rule['statetype']) {
- case "none":
- $noadvoptions = true;
- $aline['flags'] = "no state ";
- break;
- case "modulate state":
- case "synproxy state":
- if($rule['protocol'] == "tcp")
- $aline['flags'] = "{$rule['statetype']} ";
- break;
- default:
- $aline['flags'] = "{$rule['statetype']} ";
- }
- } else {
- $aline['flags'] = "keep state ";
- }
- if($noadvoptions == false)
- if( isset($rule['source-track']) and $rule['source-track'] <> "" or
- isset($rule['max-src-nodes']) and $rule['max-src-nodes'] <> "" or
- isset($rule['max-src-conn-rate']) and $rule['max-src-conn-rate'] <> "" or
- isset($rule['max-src-conn-rates']) and $rule['max-src-conn-rates'] <> "" or
- isset($rule['max-src-states']) and $rule['max-src-states'] <> "" or
- isset($rule['statetimeout']) and $rule['statetimeout'] <> "") {
- $aline['flags'] .= "( ";
- if(isset($rule['source-track']) and $rule['source-track'] <> "")
- $aline['flags'] .= "source-track rule ";
- if(isset($rule['max-src-nodes']) and $rule['max-src-nodes'] <> "")
- $aline['flags'] .= "max-src-nodes " . $rule['max-src-nodes'] . " ";
- if(isset($rule['max-src-states']) and $rule['max-src-states'] <> "")
- $aline['flags'] .= "max-src-states " . $rule['max-src-states'] . " ";
- if(isset($rule['statetimeout']) and $rule['statetimeout'] <> "")
- $aline['flags'] .= "tcp.established " . $rule['statetimeout'] . " ";
- if(isset($rule['max-src-conn-rate']) and $rule['max-src-conn-rate'] <> ""
- and isset($rule['max-src-conn-rates']) and $rule['max-src-conn-rates'] <> "") {
- $aline['flags'] .= "max-src-conn-rate " . $rule['max-src-conn-rate'] . " ";
- $aline['flags'] .= "/" . $rule['max-src-conn-rates'] . ", overload <virusprot> flush global ";
- }
- $aline['flags'] .= " ) ";
- }
- }
- if ($type == "reject" && $rule['protocol'] == "tcp") {
- /* special reject packet */
- $aline['flags'] .= "flags S/SA ";
- }
- }
-
- /* cache entries */
- if (isset($src_table))
- if (isset($table_cache[$src_table])) {
- if ($g['debug'])
- echo "{$src_table} found in cache\n";
- } else {
- if ($g['debug'])
- echo "{$src_table} NOT found in cache...adding\n";
- $table_cache[$src_table] = $src_table_line;
- }
- if (isset($dst_table))
- if (isset($table_cache[$dst_table])) {
- if ($g['debug'])
- echo "{$dst_table} found in cache\n";
- } else {
- if ($g['debug'])
- echo "{$dst_table} NOT found in cache...adding\n";
- $table_cache[$dst_table] = $dst_table_line;
- }
-
- /* exception(s) to a user rules can go here. */
- /* rules with a gateway or pool should create another rule for routing to local networks or vpns */
- /* we only trigger this for a rule with the destination of any and without a gateway */
- if (($aline['route'] <> "") && ($aline['type'] == "pass") && ($dst == "any") && (! interface_has_gateway($aline['interface']))) {
- /* negate VPN/PPTP/PPPoE networks for load balancer rules */
- $vpns = " to <vpns> ";
- $line .= $aline['type'] . $aline['direction'] . $aline['log'] . $aline['quick'] . $aline['interface'] . $aline['prot'] .
- $aline['src'] . $aline['srcport'] . $aline['os'] . $vpns . $aline['dstport'].
- $aline['icmp-type'] . $aline['flags'] .
- " label \"NEGATE_ROUTE: Negate policy route for local network(s)\"\n";
- }
-
- /* piece together the actual user rule */
- $line .= $aline['type'] . $aline['direction'] . $aline['log'] . $aline['quick'] . $aline['interface'] . $aline['reply'] .
- $aline['route'] . $aline['prot'] . $aline['src'] . $aline['srcport'] . $aline['os'] . $aline['dst'] .
- $aline['dstport'] . $aline['icmp-type'] . $aline['flags'];
-
- /* is a time based rule schedule attached? */
- if($rule['sched']) {
- if($config['schedules']) {
- foreach($config['schedules']['schedule'] as $sched) {
- if($sched['name'] == $rule['sched'])
- $schedule_xml_block = $sched;
- $schedule_enabled = true;
- }
- }
- if($schedule_xml_block)
- $status = get_time_based_rule_status($schedule_xml_block);
- if($status) {
- if($g['debug'])
- log_error("[TDR DEBUG] status true -- rule type '$type'");
- if($type == "block") {
- // active deny rules should deny
- $ipfw_rule = tdr_create_ipfw_rule($rule, "deny");
- tdr_install_rule($ipfw_rule);
- } else {
- // active allow rules should allow
- $ipfw_rule = tdr_create_ipfw_rule($rule, "allow");
- tdr_install_rule($ipfw_rule);
- }
- return "$line";
- } else {
- /* rule is turned off, if type == pass, deny traffic until
- * active else allow traffic until active
- */
- if($type == "pass") {
- // inactive pass rules should deny
- $ipfw_rule = tdr_create_ipfw_rule($rule, "deny");
- tdr_install_rule($ipfw_rule);
- } else {
- // inactive block rules should skipto
- $ipfw_rule = tdr_create_ipfw_rule($rule, "skipto");
- tdr_install_rule($ipfw_rule);
- }
- return "# $line";
- }
- } else {
- if($schedule_enabled) {
- // no schedule allow rules should simply allow
- $ipfw_rule = tdr_create_ipfw_rule($rule, "allow");
- tdr_install_rule($ipfw_rule);
- }
- return $line;
- }
-}
-
-function filter_rules_generate() {
- global $config, $g, $table_cache;
-
- update_filter_reload_status("Creating default rules");
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_rules_generate() being called $mt\n";
- }
-
- $wancfg = $config['interfaces']['wan'];
- $lancfg = $config['interfaces']['lan'];
- $pptpdcfg = $config['pptpd'];
- $pppoecfg = $config['pppoe'];
-
- $lanif = $lancfg['if'];
- $wanif = get_real_wan_interface();
-
- $lanip = $lancfg['ipaddr'];
- $lansa = gen_subnet($lancfg['ipaddr'], $lancfg['subnet']);
- $lansn = $lancfg['subnet'];
-
- $wanip = find_interface_ip(get_real_wan_interface());
-
- if($lansa)
- $lansa_sn_combo = "{$lansa}/{$lansn}";
- else
- $lansa_sn_combo = "192.168.1.1/32";
-
- /* optional interfaces */
- $optcfg = array();
- generate_optcfg_array($optcfg);
-
- if (is_package_installed('squid') && file_exists('/usr/local/pkg/squid.inc')) {
- require_once('squid.inc');
- $ipfrules .= squid_generate_rules('filter');
- }
-
- if (is_package_installed('clamav') && file_exists('/usr/local/pkg/clamav.inc')) {
- require_once('clamav.inc');
- $ipfrules .= clamav_generate_rules('filter');
- }
-
- if (is_package_installed('clamav') && file_exists('/usr/local/pkg/clamav.inc')) {
- require_once('clamav.inc');
- $ipfrules .= clamav_generate_rules('filter');
- }
-
- if (is_package_installed('frickin') && file_exists('/usr/local/pkg/frickin.inc')) {
- require_once ('frickin.inc');
- $ipfrules .= frickin_generate_rules('filter');
- }
-
- if (is_package_installed('siproxd') && file_exists('/usr/local/pkg/sipproxd.inc')) {
- require_once('sipproxd.inc');
- $ipfrules .= siproxd_generate_rules('filter');
- }
-
- /* if captive portal is enabled, ensure that access to this port
- * is allowed on a locked down interface
- */
- if (isset($config['captiveportal']['enable'])) {
- $cp_interface = $config['captiveportal']['interface'];
- $cp_interface_real = convert_friendly_interface_to_real_interface_name($cp_interface);
- $cp_interface_ip = find_interface_ip($cp_interface_real);
- if (isset($config['captiveportal']['peruserbw']))
- mwexec("kldload dummynet");
- if($cp_interface_ip and $cp_interface_real)
- $ipfrules .= "pass in quick on {$cp_interface_real} proto tcp from any to {$cp_interface_ip} port { 8000 8001 } keep state\n";
- }
-
- /* ftp-sesame */
- $ipfrules .= "anchor \"ftpsesame/*\" \n";
-
- # BEGIN OF firewall rules
- $ipfrules .= "anchor \"firewallrules\"\n";
-
- if ($pptpdcfg['mode'] == "server") {
- $pptpip = $pptpdcfg['localip'];
- $pptpsa = $pptpdcfg['remoteip'];
- $pptpsn = $g['pptp_subnet'];
- if($config['pptp']['pptp_subnet'] <> "")
- $pptpsn = $config['pptp']['pptp_subnet'];
- }
-
- if ($pppoecfg['mode'] == "server") {
- $pppoeip = $pppoecfg['localip'];
- $pppoesa = $pppoecfg['remoteip'];
- $pppoesn = $g['pppoe_subnet'];
- if($config['pppoe']['pppoe_subnet'] <> "")
- $pppoesn = $config['pppoe']['pppoe_subnet'];
- }
-
- /* default block logging? */
- if (!isset($config['syslog']['nologdefaultblock']))
- $log = "log";
- else
- $log = "";
-
- $ipfrules .= <<<EOD
-
-# We use the mighty pf, we cannot be fooled.
-block quick proto { tcp, udp } from any port = 0 to any
-block quick proto { tcp, udp } from any to any port = 0
-
-# snort2c
-table <snort2c> persist
-block quick from <snort2c> to any label "Block snort2c hosts"
-block quick from any to <snort2c> label "Block snort2c hosts"
-
-EOD;
-
- if(!isset($config['system']['ipv6allow'])) {
- $ipfrules .= "# Block all IPv6\n";
- $ipfrules .= "block in quick inet6 all\n";
- $ipfrules .= "block out quick inet6 all\n";
- }
-
- $ipfrules .= <<<EOD
-# loopback
-anchor "loopback"
-pass in quick on \$loopback all label "pass loopback"
-pass out quick on \$loopback all label "pass loopback"
-
-# package manager early specific hook
-anchor "packageearly"
-
-
-# carp
-anchor "carp"
-
-EOD;
-
-if($wanip)
- $ipfrules .= <<<EOD
-
-# permit wan interface to ping out (ping_hosts.sh)
-pass quick proto icmp from {$wanip} to any keep state
-
-EOD;
-
- $ipfrules .= <<<EOD
-
-# NAT Reflection rules
-
-EOD;
-
- if (isset($config['nat']['rule'])) {
- $natrules .= "# NAT Inbound Redirects\n";
-
- if(!isset($config['system']['disablenatreflection'])) {
- //$fd = fopen("/var/etc/inetd.conf","w");
- /* start redirects on port 19000 of localhost */
- $starting_localhost_port = 18999;
- }
-
- foreach ($config['nat']['rule'] as $rule) {
-
- update_filter_reload_status("Creating NAT rule {$rule['descr']}");
-
- /* if item is an alias, expand */
- if(alias_expand($rule['external-port']))
- $extport[0] = alias_expand_value($rule['external-port']);
- else
- $extport = explode("-", $rule['external-port']);
-
- /* if item is an alias, expand */
- if(alias_expand($rule['local-port']))
- $localport = "";
- else
- $localport = " port {$rule['local-port']}";
-
- $target = alias_expand_host($rule['target']);
-
- if (!$target)
- continue; /* unresolvable alias */
-
- if ($rule['external-address'])
- if($rule['external-address'] <> "any")
- $extaddr = $rule['external-address'] . "/32";
- else
- $extaddr = $rule['external-address'];
- else
- $extaddr = get_current_wan_address($rule['interface']);
-
- if (!$rule['interface'] || ($rule['interface'] == "wan"))
- $natif = $wanif;
- else if($rule['interface'] == "\$pptp")
- $natif = "pptp";
- else if($rule['interface'] == "\$pppoe")
- $natif = "pppoe";
- else
- $natif = $config['interfaces'][$rule['interface']]['if'];
-
- $lanif = $lancfg['if'];
-
- /*
- * Expand aliases
- * XXX: may want to integrate this into pf macros
- */
- if(alias_expand($target))
- $target = alias_expand($target);
- if(alias_expand($extaddr))
- $extaddr = alias_expand($extaddr);
-
- if(!isset($config['system']['disablenatreflection'])) {
-
- /* if list */
- $iflist = array("lan" => "LAN");
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
- $iflist['opt' . $i] = "opt{$i}";
-
- foreach ($iflist as $ifent => $ifname) {
-
- /* do not process interfaces with gateways*/
- if($config['interfaces'][$ifname]['gateway'] <> "")
- continue;
-
- /* do not process interfaces that will end up with gateways */
- if($config['interfaces'][$ifname]['ipaddr'] == "dhcp" or
- $config['interfaces'][$ifname]['ipaddr'] == "bigpond" or
- $config['interfaces'][$ifname]['ipaddr'] == "pppoe" or
- $config['interfaces'][$ifname]['ipaddr'] == "pptp")
-
- continue;
-
- $ifname_real = convert_friendly_interface_to_real_interface_name($ifname);
-
- if($extport[1])
- $range_end = ($extport[1]);
- else
- $range_end = ($extport[0]);
-
- $range_end++;
-
- if($rule['local-port'])
- $lrange_start = $rule['local-port'];
-
- if($range_end - $extport[0] > 500) {
- $range_end = $extport[0]+1;
- log_error("Not installing nat reflection rules for a port range > 500");
- } else {
- /* only install reflection rules for < 19991 items */
- if($starting_localhost_port < 19991) {
- $loc_pt = $lrange_start;
- for($x=$extport[0]; $x<$range_end; $x++) {
-
- $starting_localhost_port++;
- $ifname_real = convert_friendly_interface_to_friendly_descr(strtolower($ifname));
-
- switch($rule['protocol']) {
- case "tcp/udp":
- $protocol = "{ tcp udp }";
- $ipfrules .= "pass in quick on \${$ifname_real} inet proto tcp from any to \$loopback port {$starting_localhost_port} keep state label \"NAT REFLECT: Allow traffic to localhost\"\n";
- $starting_localhost_port++;
- $ipfrules .= "pass in quick on \${$ifname_real} inet proto udp from any to \$loopback port {$starting_localhost_port} keep state label \"NAT REFLECT: Allow traffic to localhost\"\n";
- break;
- case "tcp":
- case "udp":
- $protocol = $rule['protocol'];
- $ipfrules .= "pass in quick on \${$ifname_real} inet proto {$rule['protocol']} from any to \$loopback port {$starting_localhost_port} keep state label \"NAT REFLECT: Allow traffic to localhost\"\n";
- break;
- default:
- break;
- }
- $loc_pt++;
- if($starting_localhost_port > 19990) {
- log_error("Not installing nat reflection rules. Maximum 1,000 reached.");
- $x = $range_end+1;
- }
- }
- }
- }
- }
-
- }
- }
- }
-
- $ipfrules .= <<<EOD
-
-# allow access to DHCP server on LAN
-anchor "dhcpserverlan"
-pass in quick on \$lan proto udp from any port = 68 to 255.255.255.255 port = 67 label "allow access to DHCP server on LAN"
-pass in quick on \$lan proto udp from any port = 68 to $lanip port = 67 label "allow access to DHCP server on LAN"
-pass out quick on \$lan proto udp from $lanip port = 67 to any port = 68 label "allow access to DHCP server on LAN"
-
-EOD;
-
- /* allow access to DHCP server on optional interfaces */
- foreach ($optcfg as $on => $oc) {
- if ($config[interfaces][$on][ipaddr] == "dhcp" ) {
- $friendly_on = filter_get_opt_interface_descr($on);
- $ipfrules .= <<<EOD
-
-# Not installing DHCP server firewall rules for $friendly_on which is configured for DHCP.
-
-EOD;
- } elseif (isset($config['dhcpd'][$on]['enable']) && (!$oc['bridge']) ||
- ($oc['bridge'] && isset($config['dhcpd'][$oc['bridge']]['enable']))) {
-
- $friendly_on = filter_get_opt_interface_descr($on);
-
- $ipfrules .= <<<EOD
-
-# allow access to DHCP server on {$on}
-anchor "dhcpserver{$friendly_on}"
-pass in quick on \${$friendly_on} proto udp from any port = 68 to 255.255.255.255 port = 67 label "allow access to DHCP server"
-pass in quick on \${$friendly_on} proto udp from any port = 68 to {$oc['ip']} port = 67 label "allow access to DHCP server"
-pass out quick on \${$friendly_on} proto udp from {$oc['ip']} port = 67 to any port = 68 label "allow access to DHCP server"
-
-EOD;
- }
- }
-
- /* pass traffic between statically routed subnets and the subnet on the
- interface in question to avoid problems with complicated routing
- topologies */
- $sa = "";
- if (isset($config['filter']['bypassstaticroutes']) && is_array($config['staticroutes']['route']) && count($config['staticroutes']['route'])) {
- $ipfrules .= <<<EOD
-anchor "staticroutes"
-
-EOD;
- foreach ($config['staticroutes']['route'] as $route) {
- unset($sa);
- $friendly_int = convert_friendly_interface_to_friendly_descr($route['interface']);
- if ($route['interface'] == "lan") {
- $sa = $lansa;
- $sn = $lansn;
- $if = $lanif;
- $friendly_int = "lan";
- } else if (strstr($route['interface'], "opt")) {
- $oc = $optcfg[$route['interface']];
- if ($oc['ip']) {
- $sa = $oc['sa'];
- $sn = $oc['sn'];
- $if = $oc['if'];
- }
- }
-
- if ($sa) {
- $ipfrules .= <<<EOD
-pass in quick on \${$friendly_int} from {$sa}/{$sn} to {$route['network']} no state label "pass traffic between statically routed subnets"
-pass in quick on \${$friendly_int} from {$route['network']} to {$sa}/{$sn} no state label "pass traffic between statically routed subnets"
-pass out quick on \${$friendly_int} from {$sa}/{$sn} to {$route['network']} no state label "pass traffic between statically routed subnets"
-pass out quick on \${$friendly_int} from {$route['network']} to {$sa}/{$sn} no state label "pass traffic between statically routed subnets"
-
-EOD;
- }
- }
- }
-
- /* install wan spoof check rule if lan address exists */
- if($lansa) {
- if(!isset($config['interfaces']['wan']['spoofmac'])) {
- $ipfrules .= <<<EOD
-
-# WAN spoof check
-anchor "wanspoof"
-block in $log quick on \$wan from $lansa/$lansn to any label "WAN spoof check"
-
-EOD;
-
- }
- }
-
- foreach ($optcfg as $oc) {
- if (!$oc['bridge'])
- if($oc['sa'] <> "")
- if(isset($oc['enable']))
- $ipfrules .= "block in $log quick on \$wan from {$oc['sa']}/{$oc['sn']} to any label \"interface spoof check\"\n";
- }
-
- /* allow PPTP traffic if PPTP client is enabled on WAN */
- if ($wancfg['ipaddr'] == "pptp") {
- $ipfrules .= <<<EOD
-
-# allow PPTP client
-anchor "pptpclient"
-pass in quick on \$wan proto gre from any to any modulate state label "allow PPTP client"
-pass in quick on \$wan proto gre from any to any modulate state label "allow PPTP client"
-pass in quick on \$wan proto tcp from any port = 1723 to any flags S/SA modulate state label "allow PPTP client"
-pass in quick on \$wan proto tcp from any to any port = 1723 flags S/SA modulate state label "allow PPTP client"
-
-EOD;
- }
-
- if ($wancfg['ipaddr'] == "dhcp") {
-
- $ipfrules .= <<<EOD
-
-# allow our DHCP client out to the WAN
-anchor "wandhcp"
-pass out quick on \$wan proto udp from any port = 68 to any port = 67 label "allow dhcp client out wan"
-
-EOD;
- }
-
-if($config['interfaces']['lan']['bridge'] <> "wan" and $config['interfaces']['wan']['bridge'] <> "lan")
- $ipfrules .= "block in $log quick on \$wan proto udp from any port = 67 to {$lansa_sn_combo} port = 68 label \"block dhcp client out wan\"\n";
-
- $ipfrules .= <<<EOD
-
-# LAN/OPT spoof check (needs to be after DHCP because of broadcast addresses)
-
-EOD;
-
- /* LAN spoof check */
- $lanbridge = false;
- foreach($config['interfaces'] as $int)
- if($int['bridge'] == "lan")
- $lanbridge = true;
- if(!$lanbridge)
- $ipfrules .= filter_rules_spoofcheck_generate('lan', $lanif, $lansa, $lansn, $log);
- $wanbridge = false;
- foreach($config['interfaces'] as $int)
- if($int['bridge'] == "wan")
- $lanbridge = true;
- if($config['interfaces']['lan']['bridge'] == "wan")
- $wanbridge = true;
-
- /* OPT spoof check */
- foreach ($optcfg as $on => $oc) {
- $isbridged = false;
- foreach ($optcfg as $on2 => $oc2) {
- if ($oc2['bridge'] && $oc2['bridge'] == $on) {
- $isbridged = true;
- break;
- }
- }
- if ($oc['ip'] && !(($oc['bridge'] || $isbridged) && isset($config['bridge']['filteringbridge'])))
- $ipfrules .= filter_rules_spoofcheck_generate($on, $oc['if'], $oc['sa'], $oc['sn'], $log);
- }
-
- $ipfrules .= "\nanchor \"spoofing\"\n";
-
- /* block private networks on WAN? */
- if (isset($config['interfaces']['wan']['blockpriv'])) {
- if($wanbridge == false) {
- $ipfrules .= <<<EOD
-
-# block anything from private networks on WAN interface
-anchor "spoofing"
-antispoof for \$wan
-block in $log quick on \$wan from 10.0.0.0/8 to any label "block private networks from wan block 10/8"
-block in $log quick on \$wan from 127.0.0.0/8 to any label "block private networks from wan block 127/8"
-block in $log quick on \$wan from 172.16.0.0/12 to any label "block private networks from wan block 172.16/12"
-block in $log quick on \$wan from 192.168.0.0/16 to any label "block private networks from wan block 192.168/16"
-
-EOD;
-
- }
- }
-
- /*
- * Support for allow limiting of TCP connections by establishment rate
- * Useful for protecting against sudden outburts, etc.
- */
- $ipfrules .= <<<EODF
-# Support for allow limiting of TCP connections by establishment rate
-anchor "limitingesr"
-table <virusprot>
-block in quick from <virusprot> to any label "virusprot overload table"
-
-EODF;
-
- /* block bogon networks on WAN */
- /* http://www.cymru.com/Documents/bogon-bn-nonagg.txt */
- /* file is automatically in cron every 3000 minutes */
- if (isset($config['interfaces']['wan']['blockbogons'])) {
- $ipfrules .= <<<EOD
-
-# block bogon networks
-# http://www.cymru.com/Documents/bogon-bn-nonagg.txt
-anchor "wanbogons"
-table <bogons> persist file "/etc/bogons"
-block in $log quick on \$wan from <bogons> to any label "block bogon networks from wan"
-
-EOD;
- }
-
-if (!isset($config['shaper']['enable']) && !is_array($config['shaper']['queue']) and $config['system']['shapertype'] <> "m0n0") {
-
- $ipfrules .= <<<EOD
-
-# let out anything from the firewall host itself and decrypted IPsec traffic
-pass out quick on \$lan proto icmp keep state label "let out anything from firewall host itself"
-pass out quick on \$wan proto icmp keep state label "let out anything from firewall host itself"
-
-# tcp.closed 5 is a workaround for load balancing, squid and a few other issues.
-# ticket (FEN-857512) in centipede tracker.
-pass out quick on $wanif all keep state ( tcp.closed 5 ) label "let out anything from firewall host itself"
-
-EOD;
-
-}
-
- $ipfrules .= create_firewall_outgoing_rules_to_itself();
-
- /* group heads for optional interfaces */
- foreach ($optcfg as $on => $oc) {
-
- $friendly_on = convert_friendly_interface_to_friendly_descr($on);
-
- if($oc['descr'])
- $friendly_on = $oc['descr'];
-
- $ipfrules .= <<<EOD
-
-
-# let out anything from the firewall host itself and decrypted IPsec traffic
-pass out quick on {$oc['if']} proto icmp keep state ( tcp.closed 5 ) label "let out anything from firewall host itself"
-pass out quick on \${$friendly_on} all keep state ( tcp.closed 5 ) label "let out anything from firewall host itself"
-
-EOD;
-
- }
-
- if($config['interfaces']['wan']['ipaddr'] == "pppoe")
- $ipfrules .= <<<EOD
-# permit wan interface to ping out (ping_hosts.sh)
-pass out quick on ng0 proto icmp keep state ( tcp.closed 5 ) label "let out anything from firewall host itself"
-
-EOD;
-
- if (!isset($config['system']['webgui']['noantilockout'])) {
-
- if($lansa and $lansn) {
-
- $ipfrules .= <<<EOD
-
-# make sure the user cannot lock himself out of the webGUI or SSH
-anchor "anti-lockout"
-pass in quick on $lanif from any to $lanip keep state label "anti-lockout web rule"
-
-EOD;
- }
- }
-
- /* PPTPd enabled? */
- if ($pptpdcfg['mode'] && ($pptpdcfg['mode'] != "off")) {
-
- if ($pptpdcfg['mode'] == "server")
- $pptpdtarget = get_current_wan_address();
- else
- $pptpdtarget = $pptpdcfg['redir'];
-
- if($pptpdtarget) {
- if(!isset($config['system']['disablevpnrules'])) {
- $ipfrules .= <<<EOD
-
-# PPTPd rules
-anchor "pptp"
-pass in quick on \$wan proto gre from any to $pptpdtarget keep state label "allow gre pptpd"
-pass in quick on \$wan proto tcp from any to $pptpdtarget port = 1723 modulate state label "allow pptpd {$pptpdtarget}"
-
-EOD;
- }
-
- } else {
- /* this shouldnt ever happen but instead of breaking the clients ruleset
- * log an error.
- */
- log_error("ERROR! PPTP enabled but could not resolve the \$pptpdtarget");
- }
- }
-
- /* BigPond client enabled? */
- if ($wancfg['ipaddr'] == "bigpond") {
-
- $ipfrules .= <<<EOD
-
-# BigPond heartbeat rules
-anchor "bigpond"
-pass in quick proto udp from any to any port = 5050 keep state label "BigPond heartbeat"
-
-# package manager late specific hook
-anchor "packagelate"
-
-
-
-EOD;
- }
-
- $ipfrules .= "\n# SSH lockout\n";
- $ipfrules .= "block in log quick proto tcp from <sshlockout> to any port 22 label \"sshlockout\"\n\n";
-
- $ipfrules .= "anchor \"ftpproxy\"\n";
- $ipfrules .= "anchor \"pftpx/*\"\n";
-
- $ipfrules .= process_carp_rules();
-
- if (isset($config['filter']['rule'])) {
- /* Pre-cache all our rules so we only have to generate them once */
- $rule_arr = array();
- foreach ($config['filter']['rule'] as $rule) {
- update_filter_reload_status("Pre-caching {$rule['descr']}...");
- $line = "";
- if (!isset($rule['disabled'])) {
- if ($rule['interface'] == "pptp") {
- /* we have a pptp rule but its turned off, ignore */
- if(!$config['pptpd']['mode'] == "server")
- continue;
- $n_pptp_units = $g['n_pptp_units'];
- if($config['pptp']['n_pptp_units'] <> "")
- $nif = $config['pptp']['n_pptp_units'];
- /*
- * now that PPTP server are user rules, detect
- * that user is setting the pptp server rule
- * and setup for all netgraph interfaces
- */
- $rule_arr[] = generate_user_filter_rule_arr($rule, 0);
- } else if($rule['interface'] == "pppoe") {
- if(!$config['pppoe']['mode'] == "server")
- continue;
- $n_pppoe_units = $g['n_pppoe_units'];
- if($config['pppoe']['n_pppoe_units'] <> "")
- $nif = $config['pppoe']['n_pppoe_units'];
- /*
- * now that pppoe server are user rules, detect
- * that user is setting the pppoe server rule
- * and setup for all netgraph interfaces
- */
- $rule_arr[] = generate_user_filter_rule_arr($rule, 0);
- } else {
- $rule_arr[] = generate_user_filter_rule_arr($rule, 0);
- }
- }
- }
-
- $ipfrules .= "\n# User-defined aliases follow\n";
- /* tables for aliases */
- foreach($table_cache as $table) {
- $ipfrules .= $table;
- }
-
- /* Shaper rules */
- if (isset($config['shaper']['enable']) && is_array($config['shaper']['queue']) && isset($config['filter']['rule']) and $config['system']['shapertype'] <> "m0n0") {
-
- $ipfrules .= "\n# Anchors for rules that might be matched by queues\n";
-
- /* This is ugly, but we generate one anchor per queue */
- foreach ($config['shaper']['queue'] as $queue) {
- update_filter_reload_status("Creating filter anchor for {$queue['name']} ...");
- /* Add anchor to rules */
- $ipfrules .= "anchor {$queue['name']} tagged {$queue['name']}\n";
- $ipfrules .= "load anchor {$queue['name']} from \"{$g['tmp_path']}/{$queue['name']}.rules\"\n";
- /* Create rules for anchors */
- $fd = fopen("{$g['tmp_path']}/{$queue['name']}.rules", "w");
- /* aliases don't recurse to anchors */
- $line = filter_generate_aliases();
- fwrite($fd, $line);
- foreach($rule_arr as $rule) {
- if($rule['ackq'] != "")
- $line = "{$rule['rule']} queue ({$queue['name']}, {$rule['ackq']}) {$rule['descr']}\n";
- else
- $line = "{$rule['rule']} queue {$queue['name']} {$rule['descr']}\n";
- fwrite($fd, $line);
- }
- fclose($fd);
- }
- }
-
- $ipfrules .= "\n# User-defined rules follow\n";
- /* Generate user rule lines */
- foreach($rule_arr as $rule) {
- $line = "";
- if (!isset($rule['disabled'])) {
- $line = $rule['rule'];
- if($line <> "") {
- /* Add default queue if we're using the shaper */
- if (isset($config['shaper']['enable']) && is_array($config['shaper']['queue']) and $config['system']['shapertype'] <> "m0n0") {
- $defq = find_default_queue($rule['interface']);
- $ackq = $rule['ackq'];
- if (($defq != "") and ($ackq != ""))
- $line .= " queue ({$defq}, {$ackq}) ";
- }
- /* label */
- $line .= " {$rule['descr']}";
- }
- }
- $line .= "\n";
- $ipfrules .= $line;
- }
- }
-
- update_filter_reload_status("Creating carp rules...");
-
- $ipfrules .= "\n# VPN Rules\n";
- $lan_ip = $config['interfaces']['lan']['ipaddr'];
- $lan_subnet = $config['interfaces']['lan']['subnet'];
- $wanif = get_real_wan_interface();
- $wan_ip = find_interface_ip($wanif);
- if($wan_ip) {
- $internal_subnet = gen_subnet($lan_ip, $lan_subnet) . "/" . $config['interfaces']['lan']['subnet'];
- /* Is IP Compression enabled? */
- if(isset($config['ipsec']['ipcomp']))
- exec("/sbin/sysctl net.inet.ipcomp.ipcomp_enable=1");
- else
- exec("/sbin/sysctl net.inet.ipcomp.ipcomp_enable=0");
-
- /* build an interface collection */
- $ifdescrs = array ("wan");
- for ($j = 1; isset ($config['interfaces']['opt' . $j]); $j++) {
- if(isset($config['interfaces']['opt' . $j]['enable']))
- $ifdescrs['opt' . $j] = filter_get_opt_interface_descr("opt" . $j);
- }
-
- if(is_array($config['ipsec']['tunnel']) && isset($config['ipsec']['enable'])) {
- foreach ($config['ipsec']['tunnel'] as $tunnel) {
- if(isset($tunnel['disabled']))
- continue;
- update_filter_reload_status("Creating IPSEC tunnel items {$tunnel['descr']}...");
- /* if tunnel is disabled, lets skip to next item */
- $ipsec_ips = array(get_current_wan_address($tunnel['interface']));
- /* is this a dynamic dns hostname? */
- if(!is_ipaddr($tunnel['remote-gateway'])) {
- $remote_gateway = resolve_retry($tunnel['remote-gateway']);
- } else {
- $remote_gateway = $tunnel['remote-gateway'];
- }
- /* do not add items with blank remote_gateway */
- if(!is_ipaddr($remote_gateway)) {
- $ipfrules .= "# ERROR! Remote gateway not found on {$tunnel['remote-gateway']}\n";
- continue;
- }
- $local_subnet = return_vpn_subnet($tunnel['local-subnet']);
- foreach($ifdescrs as $iface) {
- foreach($ipsec_ips as $interface_ip) {
- if($iface == "wan")
- $interface_ip = find_interface_ip(get_real_wan_interface());
- else
- $interface_ip = find_interface_ip(convert_friendly_interface_to_real_interface_name($iface));
- if(!$interface_ip)
- continue;
- if(!$remote_gateway)
- continue;
- if(isset($config['system']['disablevpnrules']))
- continue;
-
- $shorttunneldescr = substr($tunnel['descr'], 0, 26);
- $ipfrules .= "pass out quick on \${$iface} proto udp from any to {$remote_gateway} port = 500 keep state label \"IPSEC: {$shorttunneldescr} - outbound isakmp\"\n";
- $ipfrules .= "pass in quick on \${$iface} proto udp from {$remote_gateway} to any port = 500 keep state label \"IPSEC: {$shorttunneldescr} - inbound isakmp\"\n";
- if ($tunnel['p2']['protocol'] == 'esp') {
- $ipfrules .= "pass out quick on \${$iface} proto esp from any to {$remote_gateway} keep state label \"IPSEC: {$shorttunneldescr} - outbound esp proto\"\n";
- $ipfrules .= "pass in quick on \${$iface} proto esp from {$remote_gateway} to any keep state label \"IPSEC: {$shorttunneldescr} - inbound esp proto\"\n";
- }
- if ($tunnel['p2']['protocol'] == 'ah') {
- $ipfrules .= "pass out quick on \${$iface} proto ah from any to {$remote_gateway} keep state label \"IPSEC: {$shorttunneldescr} - outbound ah proto\"\n";
- $ipfrules .= "pass in quick on \${$iface} proto ah from {$remote_gateway} to any keep state label \"IPSEC: {$shorttunneldescr} - inbound ah proto\"\n";
- }
- }
- }
- }
- }
-
- /* is mobile ipsec enabled? if so lets allow some pretty
- * loose rules to allow mobile clients to phone in.
- */
- $ipseccfg = $config['ipsec'];
- if (isset($ipseccfg['mobileclients']['enable'])) {
- if(!isset($config['system']['disablevpnrules'])) {
- foreach($ifdescrs as $iface) {
- $ipfrules .= "pass in quick on \${$iface} proto udp from any to any port = 500 keep state label \"IPSEC: Mobile - inbound isakmp\"\n";
- $ipfrules .= "pass in quick on \${$iface} proto esp from any to any keep state label \"IPSEC: Mobile - inbound esp proto\"\n";
- $ipfrules .= "pass in quick on \${$iface} proto ah from any to any keep state label \"IPSEC: Mobile - inbound ah proto\"\n";
- }
- }
- }
- }
- $ipfrules .= <<<EOD
-
-pass in quick on $lanif inet proto tcp from any to \$loopback port 8021 keep state label "FTP PROXY: Allow traffic to localhost"
-pass in quick on $lanif inet proto tcp from any to \$loopback port 21 keep state label "FTP PROXY: Allow traffic to localhost"
-pass in quick on $wanif inet proto tcp from port 20 to ($wanif) port > 49000 flags S/SA keep state label "FTP PROXY: PASV mode data connection"
-
-EOD;
-
- if(!isset($config['system']['disableftpproxy'])) {
-
- $ipfrules .= "# enable ftp-proxy\n";
-
- $optcfg = array();
- generate_optcfg_array($optcfg);
- $ftp_counter = "8022";
- foreach($optcfg as $oc) {
- if(!isset($oc['gateway']) && $oc['if'] <> "") {
- $ipfrules .= "pass in quick on " . $oc['if'] . " inet proto tcp from any to \$loopback port {$ftp_counter} keep state label \"FTP PROXY: Allow traffic to localhost\"\n";
- $ipfrules .= "pass in quick on " . $oc['if'] . " inet proto tcp from any to \$loopback port 21 keep state label \"FTP PROXY: Allow traffic to localhost\"\n";
- }
- $ftp_counter++;
- }
-
- if(isset($config['system']['rfc959workaround'])) {
- $ipfrules .= <<<EODEOD
-
-# Fix sites that violate RFC 959 which specifies that the data connection
-# be sourced from the command port - 1 (typically port 20)
-# This workaround doesn't expose us to any extra risk as we'll still only allow
-# connections to the firewall on a port that ftp-proxy is listening on
-pass in quick on $wanif inet proto tcp from any to ($wanif) port > 49000 flags S/SA keep state label "FTP PROXY: RFC959 violation workaround"
-
-EODEOD;
-
- $optcfg = array();
- generate_optcfg_array($optcfg);
- foreach($optcfg as $oc) {
- if($oc['gateway'] <> "")
- $ipfrules .= "pass in quick on {$oc['if']} inet proto tcp from any to ({$oc['if']}) port > 49000 flags S/SA keep state label \"FTP PROXY: RFC959 violation workaround\" \n";
- }
- }
- }
-
- $ipfrules .= <<<EOD
-
-# IMSpector
-anchor "imspector"
-
-# uPnPd
-anchor "miniupnpd"
-
-#---------------------------------------------------------------------------
-# default deny rules
-#---------------------------------------------------------------------------
-block in $log quick all label "Default deny rule"
-block out $log quick all label "Default deny rule"
-
-EOD;
-
- return $ipfrules;
-}
-
-function filter_rules_spoofcheck_generate($ifname, $if, $sa, $sn, $log) {
-
- global $g, $config;
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_rules_spoofcheck_generate() being called $mt\n";
- }
-
- $ipfrules = "antispoof for {$if}\n";
-
- return $ipfrules;
-
-}
-
-function setup_logging_interfaces() {
- global $config;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "setup_logging_interfaces() being called $mt\n";
- }
- $rules = "";
- $i = 0;
- $ifdescrs = array('wan', 'lan');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- $ifdescrs['opt' . $j] = "opt" . $j;
- }
- foreach ($ifdescrs as $ifdescr => $ifname) {
- /* do not work with tun interfaces */
- if(stristr(filter_translate_type_to_real_interface($ifname), "tun") == true) continue;
- $int = filter_translate_type_to_real_interface($ifname);
- $rules .= "set loginterface {$int}\n";
- }
- return $rules;
-}
-
-function create_firewall_outgoing_rules_to_itself() {
- global $config, $g;
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "create_firewall_outgoing_rules_to_itself() being called $mt\n";
- }
-
- $i = 0;
- $rule .= "# pass traffic from firewall -> out\n";
- $rule .= "anchor \"firewallout\"\n";
- $ifdescrs = array('wan', 'lan');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++)
- $ifdescrs['opt' . $j] = "opt" . $j;
-
- /* go through primary and optional interfaces */
- foreach ($ifdescrs as $ifdescr => $ifname) {
- $return_gateway = $config['interfaces'][$ifname]['gateway'];
- $ints = array();
- $int = filter_translate_type_to_real_interface($ifname);
- /* if the interface is pppoe, set the ng0 interface */
- update_filter_reload_status("Creating IPSEC tunnel items {$tunnel['descr']}...");
- $ip = find_interface_ip($int);
- if ($config['interfaces'][$ifname]['ipaddr'] == "pppoe")
- $int = " { " . filter_translate_type_to_real_interface($ifname) . " ng0 } ";
- if (isset($config['shaper']['enable']) && is_array($config['shaper']['queue']) and $config['system']['shapertype'] <> "m0n0") {
- $ackq = get_ack_queue($ifname);
- $defq = find_default_queue($ifname);
- /* Handle all tagged packets */
- foreach ($config['shaper']['queue'] as $queue) {
- if(!filter_is_queue_being_used_on_interface($queue['name'], $ifname, 'out'))
- continue;
- if ($ackq == "" || $defq == "") {
- /* Shaper must not be enabled on this interface */
- $q = "";
- } else {
- $q = "queue ({$queue['name']}, {$ackq})";
- }
- $rule .="pass out quick on {$int} all keep state tagged {$queue['name']} {$q} label \"let out anything from firewall host itself\"\n";
- }
- /* Handle untagged packets */
- if ($ackq == "" || $defq == "") {
- /* Shaper must not be enabled on this interface */
- $q = "";
- } else {
- $q = "queue ({$defq}, {$ackq})";
- }
- $rule .="pass out quick on {$int} all keep state {$q} label \"let out anything from firewall host itself\"\n";
- } else {
- /* first add a rule for the real interface, then for ng0 */
- $rule .="pass out quick on {$int} all keep state label \"let out anything from firewall host itself\"\n";
- }
- }
-/*
- update_filter_reload_status("Setting up bridging items");
- // is bridging turned on?
- for($x=0; $x<10; $x++) {
- if(does_interface_exist("bridge{$x}") == true)
- $rule .="pass out quick on bridge{$x} all keep state label \"let out anything from firewall host itself\"\n";
- }
-*/
- update_filter_reload_status("Setting up pptp items");
- if($config['pptpd']['mode'] == "server")
- $rule .="pass out quick on \$pptp all keep state label \"let out anything from firewall host itself pptp\"\n";
-
- update_filter_reload_status("Setting up pppoe items");
- if($config['pppoe']['mode'] == "server")
- $rule .="pass out quick on \$pppoe all keep state label \"let out anything from firewall host itself pppoe\"\n";
-
- update_filter_reload_status("Setting up gif tunnels");
- /* setup outgoing gif tunnels */
- $number_of_gifs = find_last_gif_device();
- $number_of_gifs++;
- for($x=0; $x<$number_of_gifs; $x++) {
- if(does_interface_exist("gif{$x}") == true)
- $rule .="pass out quick on gif{$x} all keep state label \"let out anything from firewall host itself ipsec gif\"\n";
- }
-
- update_filter_reload_status("Setting up tun interfaces (openvpn)");
- /* openvpn tun interfaces. check for 100. */
- for($x=0; $x<100; $x++) {
- if(does_interface_exist("tun{$x}") == true) {
- $rule .="pass out quick on tun{$x} all keep state label \"let out anything from firewall host itself openvpn\"\n";
- $friendlytunif = convert_real_interface_to_friendly_interface_name("tun{$x}");
- /* If the interface has a gateway we do not add a pass in rule. */
- /* Some people use a TUN tunnel with public IP as a Multiwan interface */
- if(interface_has_gateway("tun{$x}")) {
- $rule .= "# Not adding default pass in rule for interface $friendlytunif - tun{$x} with a gateway!\n";
- } elseif (!isset($config['system']['disablevpnrules'])) {
- $rule .="pass in quick on tun{$x} all keep state label \"let out anything from firewall host itself openvpn\"\n";
- }
- }
- }
- for($x=0; $x<100; $x++) {
- if(does_interface_exist("tap{$x}") == true) {
- $rule .="pass out quick on tap{$x} all keep state label \"let out anything from firewall host itself openvpn\"\n";
- $friendlytapif = convert_real_interface_to_friendly_interface_name("tap{$x}");
- /* If the interface has a gateway we do not add a pass in rule. */
- /* Some people use a TAP tunnel with public IP as a Multiwan interface */
- if(interface_has_gateway("tap{$x}")) {
- $rule .= "# Not adding default pass in rule for interface $friendlytapif - tap{$x} with a gateway!\n";
- } elseif (!isset($config['system']['disablevpnrules'])) {
- $rule .="pass in quick on tap{$x} all keep state label \"let out anything from firewall host itself openvpn\"\n";
- }
- }
- }
-
- /* permit internal ipsec outbound traffic */
- $rule .="pass out quick on \$enc0 keep state label \"IPSEC internal host to host\"";
-
- return $rule;
-}
-
-function process_carp_nat_rules() {
- global $g, $config;
-
- update_filter_reload_status("Creating CARP NAT rules");
-
- $wan_interface = get_real_wan_interface();
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "process_carp_nat_rules() being called $mt\n";
- }
- $lines = "";
- if($config['installedpackages']['carp']['config'] != "")
- foreach($config['installedpackages']['carp']['config'] as $carp) {
- $ip = $carp['ipaddress'];
- if($ip <> "any") {
- $ipnet = "any";
- } else {
- $int = find_ip_interface($ip);
- $carp_int = find_carp_interface($ip);
- }
- if($int != false and $int != $wan_interface) {
- $ipnet = convert_ip_to_network_format($ip, $carp['netmask']);
- if($int)
- $lines .= "nat on {$int} inet from {$ipnet} to any -> ({$carp_int}) \n";
- }
- }
- return $lines;
-}
-
-function process_carp_rules() {
- global $g, $config;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "process_carp_rules() being called $mt\n";
- }
- $lines = "";
- /* return if there are no carp configured items */
- if($config['installedpackages']['carpsettings']['config'] <> "" or
- $config['virtualip']['vip'] <> "") {
- $lines .= "pass quick proto carp\n";
- $lines .= "pass quick proto pfsync";
- }
- return $lines;
-}
-
-function remove_special_characters($string) {
- $match_array = "";
- preg_match_all("/[a-zA-Z0-9\_\-]+/",$string,$match_array);
- $string = "";
- foreach($match_array[0] as $ma) {
- if($string <> "")
- $string .= " ";
- $string .= $ma;
- }
- return $string;
-}
-
-function carp_sync_xml($url, $password, $sections, $port = 80, $method = 'pfsense.restore_config_section') {
- global $config, $g;
-
- if($g['booting'])
- return;
-
- update_filter_reload_status("Syncing CARP data to {$url}");
-
- /* make a copy of config */
- $config_copy = $config;
-
- /* strip out nosync items */
- for ($x = 0; $x < count($config_copy['nat']['advancedoutbound']['rule']); $x++) {
- if (isset ($config_copy['nat']['advancedoutbound']['rule'][$x]['nosync']))
- unset ($config_copy['nat']['advancedoutbound']['rule'][$x]);
- $config_copy['nat']['advancedoutbound']['rule'][$x]['descr'] = remove_special_characters($config_copy['nat']['advancedoutbound']['rule'][$x]['descr']);
- }
- for ($x = 0; $x < count($config_copy['nat']['rule']); $x++) {
- if (isset ($config_copy['nat']['rule'][$x]['nosync']))
- unset ($config_copy['nat']['rule'][$x]);
- $config_copy['nat']['rule'][$x]['descr'] = remove_special_characters($config_copy['nat']['rule'][$x]['descr']);
- }
- for ($x = 0; $x < count($config_copy['filter']['rule']); $x++) {
- if (isset ($config_copy['filter']['rule'][$x]['nosync']))
- unset ($config_copy['filter']['rule'][$x]);
- $config_copy['filter']['rule'][$x]['descr'] = remove_special_characters($config_copy['filter']['rule'][$x]['descr']);
- }
- for ($x = 0; $x < count($config_copy['aliases']['alias']); $x++) {
- if (isset ($config_copy['aliases']['alias'][$x]['nosync']))
- unset ($config_copy['aliases']['alias'][$x]);
- $config_copy['aliases']['alias'][$x]['descr'] = remove_special_characters($config_copy['aliases']['alias'][$x]['descr']);
- }
- for ($x = 0; $x < count($config_copy['dnsmasq']['hosts']); $x++) {
- if (isset ($config_copy['dnsmasq']['hosts'][$x]['nosync']))
- unset ($config_copy['dnsmasq']['hosts'][$x]);
- $config_copy['dnsmasq']['hosts'][$x]['descr'] = remove_special_characters($config_copy['dnsmasq']['hosts'][$x]['descr']);
- }
- for ($x = 0; $x < count($config_copy['virtualip']['vip']); $x++) {
- if (isset ($config_copy['virtualip']['vip'][$x]['nosync']) or $config_copy['virtualip']['vip'][$x]['mode'] == "proxyarp")
- unset ($config_copy['virtualip']['vip'][$x]);
- $config_copy['virtualip']['vip'][$x]['descr'] = remove_special_characters($config_copy['virtualip']['vip'][$x]['descr']);
- }
- for ($x = 0; $x < count($config_copy['ipsec']['tunnel']); $x++) {
- if (isset ($config_copy['ipsec']['tunnel'][$x]['nosync']))
- unset ($config_copy['ipsec']['tunnel'][$x]);
- $config_copy['ipsec']['tunnel'][$x]['descr'] = remove_special_characters($config_copy['ipsec']['tunnel'][$x]['descr']);
- }
-
- foreach($sections as $section) {
- /* we can't use array_intersect_key()
- due to the vip 'special case' */
- if($section != 'virtualip') {
- $xml[$section] = $config_copy[$section];
- } else {
- $xml[$section] = backup_vip_config_section();
- }
- }
-
- $params = array(
- XML_RPC_encode($password),
- XML_RPC_encode($xml)
- );
-
- $numberofruns = 0;
- while($numberofruns < 2) {
- log_error("Beginning XMLRPC sync to {$url}:{$port}.");
- $msg = new XML_RPC_Message($method, $params);
- $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
- $username = $config['system']['username'];
- $cli->setCredentials($username, $password);
- if($numberofruns == 1)
- $cli->setDebug(1);
- /* send our XMLRPC message and timeout after 240 seconds */
- $resp = $cli->send($msg, "240");
- if(!$resp) {
- $error = "A communications error occured while attempting XMLRPC sync with username {$username} {$url}:{$port}.";
- log_error($error);
- file_notice("sync_settings", $error, "Settings Sync", "");
- } elseif($resp->faultCode()) {
- $error = "An error code was received while attempting XMLRPC sync with username {$username} {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
- log_error($error);
- file_notice("sync_settings", $error, "Settings Sync", "");
- } else {
- log_error("XMLRPC sync successfully completed with {$url}:{$port}.");
- $numberofruns = 3;
- }
- $numberofruns++;
- }
-}
-
-function carp_sync_client() {
-
- global $config, $g;
-
- update_filter_reload_status("Building CARP sync information");
-
- if($g['booting'])
- return;
-
- if(is_array($config['installedpackages']['carpsettings']['config'])) {
- foreach($config['installedpackages']['carpsettings']['config'] as $carp) {
- if($carp['synchronizetoip'] != "" ) {
- /*
- * XXX: The way we're finding the port right now is really suboptimal -
- * we can't assume that the other machine is setup identically.
- */
- if($config['system']['webgui']['protocol'] != "") {
- $synchronizetoip = $config['system']['webgui']['protocol'];
- $synchronizetoip .= "://";
- }
- $port = $config['system']['webgui']['port'];
- /* if port is empty lets rely on the protocol selection */
- if($port == "") {
- if($config['system']['webgui']['protocol'] == "http") {
- $port = "80";
- } else {
- $port = "443";
- }
- }
- $synchronizetoip .= $carp['synchronizetoip'];
- if($carp['synchronizerules'] != "" and is_array($config['filter'])) {
- $sections[] = 'filter';
- }
- if($carp['synchronizenat'] != "" and is_array($config['nat'])) {
- $sections[] = 'nat';
- }
- if($carp['synchronizealiases'] != "" and is_array($config['aliases'])) {
- $sections[] = 'aliases';
- }
- if($carp['synchronizedhcpd'] != "" and is_array($config['dhcpd'])) {
- $sections[] = 'dhcpd';
- }
- if($carp['synchronizewol'] != "" and is_array($config['wol'])) {
- $sections[] = 'wol';
- }
- if($carp['synchronizetrafficshaper'] != "" and is_array($config['shaper'])) {
- $sections[] = 'shaper';
- }
- if($carp['synchronizestaticroutes'] != "" and is_array($config['staticroutes'])) {
- $sections[] = 'staticroutes';
- }
- if($carp['synchronizevirtualip'] != "" and is_array($config['virtualip'])) {
- $sections[] = 'virtualip';
- }
- if($carp['synchronizelb'] != "" and is_array($config['load_balancer'])) {
- $sections[] = 'load_balancer';
- }
- if($carp['synchronizeipsec'] != "" and is_array($config['ipsec'])) {
- $sections[] = 'ipsec';
- }
- if($carp['synchronizednsforwarder'] != "" and is_array($config['dnsmasq'])) {
- $sections[] = 'dnsmasq';
- }
- if($carp['synchronizeschedules'] != "" and is_array($config['schedules'])) {
- $sections[] = 'schedules';
- }
- if(count($sections) > 0) {
- update_filter_reload_status("Signaling CARP reload signal...");
- carp_sync_xml($synchronizetoip, $carp['password'], $sections, $port);
- $cli = new XML_RPC_Client('/xmlrpc.php', $synchronizetoip, $port);
- $msg = new XML_RPC_Message('pfsense.filter_configure', array(new XML_RPC_Value($carp['password'], 'string')));
- $username = $config['system']['username'];
- $cli->setCredentials($username, $carp['password']);
- $cli->send($msg, "900");
- /* signal a carp reload */
- $msg = new XML_RPC_Message('pfsense.interfaces_carp_configure');
- $cli->send($msg, "900");
- }
- }
- }
- }
-
-}
-
-function return_vpn_subnet($adr) {
- global $config;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "return_vpn_subnet() being called $mt\n";
- }
-
- if ($adr['address']) {
- list($padr, $pmask) = explode("/", $adr['address']);
- if (is_null($pmask))
- return "{$padr}/32";
- return "{$padr}/{$pmask}";
- }
-
- /* XXX: do not return wan, lan, etc */
- if(strstr($adr['network'], "wan") or strstr($adr['network'], "lan") or strstr($adr['network'], "opt"))
- return convert_ip_to_network_format($config['interfaces'][$adr['network']]['ipaddr'],
- $config['interfaces'][$adr['network']]['subnet']);
-
- /* fallback - error */
- return " # error - {$adr['network']} ";
-
-}
-
-?>
diff --git a/config/Fit123/bin/cpaddon/services_captiveportal.abc b/config/Fit123/bin/cpaddon/services_captiveportal.abc
deleted file mode 100755
index bafb27a7..00000000
--- a/config/Fit123/bin/cpaddon/services_captiveportal.abc
+++ /dev/null
@@ -1,608 +0,0 @@
-<?php
-/*
- services_captiveportal.php
- part of m0n0wall (http://m0n0.ch/wall)
-
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = "Services:Captive portal";
-require("guiconfig.inc");
-
-if (!is_array($config['captiveportal'])) {
- $config['captiveportal'] = array();
- $config['captiveportal']['page'] = array();
- $config['captiveportal']['timeout'] = 60;
-}
-
-if ($_GET['act'] == "viewhtml") {
- echo base64_decode($config['captiveportal']['page']['htmltext']);
- exit;
-} else if ($_GET['act'] == "viewerrhtml") {
- echo base64_decode($config['captiveportal']['page']['errtext']);
- exit;
-}
-
-$pconfig['cinterface'] = $config['captiveportal']['interface'];
-$pconfig['maxproc'] = $config['captiveportal']['maxproc'];
-$pconfig['maxprocperip'] = $config['captiveportal']['maxprocperip'];
-$pconfig['timeout'] = $config['captiveportal']['timeout'];
-$pconfig['idletimeout'] = $config['captiveportal']['idletimeout'];
-$pconfig['enable'] = isset($config['captiveportal']['enable']);
-$pconfig['auth_method'] = $config['captiveportal']['auth_method'];
-$pconfig['radacct_enable'] = isset($config['captiveportal']['radacct_enable']);
-$pconfig['radmac_enable'] = isset($config['captiveportal']['radmac_enable']);
-$pconfig['radmac_secret'] = $config['captiveportal']['radmac_secret'];
-$pconfig['reauthenticate'] = isset($config['captiveportal']['reauthenticate']);
-$pconfig['reauthenticateacct'] = $config['captiveportal']['reauthenticateacct'];
-$pconfig['httpslogin_enable'] = isset($config['captiveportal']['httpslogin']);
-$pconfig['httpsname'] = strtolower($config['captiveportal']['httpsname']);
-$pconfig['cert'] = base64_decode($config['captiveportal']['certificate']);
-$pconfig['key'] = base64_decode($config['captiveportal']['private-key']);
-$pconfig['logoutwin_enable'] = isset($config['captiveportal']['logoutwin_enable']);
-$pconfig['peruserbw'] = isset($config['captiveportal']['peruserbw']);
-$pconfig['bwdefaultdn'] = $config['captiveportal']['bwdefaultdn'];
-$pconfig['bwdefaultup'] = $config['captiveportal']['bwdefaultup'];
-$pconfig['nomacfilter'] = isset($config['captiveportal']['nomacfilter']);
-$pconfig['noconcurrentlogins'] = isset($config['captiveportal']['noconcurrentlogins']);
-$pconfig['redirurl'] = $config['captiveportal']['redirurl'];
-$pconfig['radiusip'] = $config['captiveportal']['radiusip'];
-$pconfig['radiusip2'] = $config['captiveportal']['radiusip2'];
-$pconfig['radiusport'] = $config['captiveportal']['radiusport'];
-$pconfig['radiusport2'] = $config['captiveportal']['radiusport2'];
-$pconfig['radiusacctport'] = $config['captiveportal']['radiusacctport'];
-$pconfig['radiuskey'] = $config['captiveportal']['radiuskey'];
-$pconfig['radiuskey2'] = $config['captiveportal']['radiuskey2'];
-$pconfig['radiusvendor'] = $config['captiveportal']['radiusvendor'];
-
-//$pconfig['radiussession_timeout'] = isset($config['captiveportal']['radiussession_timeout']);
-
-if ($_POST) {
-
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- if ($_POST['enable']) {
- $reqdfields = explode(" ", "cinterface");
- $reqdfieldsn = explode(",", "Interface");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- /* make sure no interfaces are bridged */
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $coptif = $config['interfaces']['opt' . $i];
- if (isset($coptif['enable']) && $coptif['bridge'] == $pconfig['cinterface']) {
- $input_errors[] = "The captive portal cannot be used when one or more interfaces are bridged.";
- break;
- }
- }
-
- if ($_POST['httpslogin_enable']) {
- if (!$_POST['cert'] || !$_POST['key']) {
- $input_errors[] = "Certificate and key must be specified for HTTPS login.";
- } else {
- if (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE"))
- $input_errors[] = "This certificate does not appear to be valid.";
- if (!strstr($_POST['key'], "BEGIN RSA PRIVATE KEY") || !strstr($_POST['key'], "END RSA PRIVATE KEY"))
- $input_errors[] = "This key does not appear to be valid.";
- }
-
- if (!$_POST['httpsname'] || !is_domain($_POST['httpsname'])) {
- $input_errors[] = "The HTTPS server name must be specified for HTTPS login.";
- }
- }
- }
-
- if ($_POST['timeout'] && (!is_numeric($_POST['timeout']) || ($_POST['timeout'] < 1))) {
- $input_errors[] = "The timeout must be at least 1 minute.";
- }
- if ($_POST['idletimeout'] && (!is_numeric($_POST['idletimeout']) || ($_POST['idletimeout'] < 1))) {
- $input_errors[] = "The idle timeout must be at least 1 minute.";
- }
- if (($_POST['radiusip'] && !is_ipaddr($_POST['radiusip']))) {
- $input_errors[] = "A valid IP address must be specified. [".$_POST['radiusip']."]";
- }
- if (($_POST['radiusip2'] && !is_ipaddr($_POST['radiusip2']))) {
- $input_errors[] = "A valid IP address must be specified. [".$_POST['radiusip2']."]";
- }
- if (($_POST['radiusport'] && !is_port($_POST['radiusport']))) {
- $input_errors[] = "A valid port number must be specified. [".$_POST['radiusport']."]";
- }
- if (($_POST['radiusport2'] && !is_port($_POST['radiusport2']))) {
- $input_errors[] = "A valid port number must be specified. [".$_POST['radiusport2']."]";
- }
- if (($_POST['radiusacctport'] && !is_port($_POST['radiusacctport']))) {
- $input_errors[] = "A valid port number must be specified. [".$_POST['radiusacctport']."]";
- }
- if ($_POST['maxproc'] && (!is_numeric($_POST['maxproc']) || ($_POST['maxproc'] < 4) || ($_POST['maxproc'] > 100))) {
- $input_errors[] = "The total maximum number of concurrent connections must be between 4 and 100.";
- }
- $mymaxproc = $_POST['maxproc'] ? $_POST['maxproc'] : 16;
- if ($_POST['maxprocperip'] && (!is_numeric($_POST['maxprocperip']) || ($_POST['maxprocperip'] > $mymaxproc))) {
- $input_errors[] = "The maximum number of concurrent connections per client IP address may not be larger than the global maximum.";
- }
-
- if (!$input_errors) {
- $config['captiveportal']['interface'] = $_POST['cinterface'];
- $config['captiveportal']['maxproc'] = $_POST['maxproc'];
- $config['captiveportal']['maxprocperip'] = $_POST['maxprocperip'] ? $_POST['maxprocperip'] : false;
- $config['captiveportal']['timeout'] = $_POST['timeout'];
- $config['captiveportal']['idletimeout'] = $_POST['idletimeout'];
- $config['captiveportal']['enable'] = $_POST['enable'] ? true : false;
- $config['captiveportal']['auth_method'] = $_POST['auth_method'];
- $config['captiveportal']['radacct_enable'] = $_POST['radacct_enable'] ? true : false;
- $config['captiveportal']['reauthenticate'] = $_POST['reauthenticate'] ? true : false;
- $config['captiveportal']['radmac_enable'] = $_POST['radmac_enable'] ? true : false;
- $config['captiveportal']['radmac_secret'] = $_POST['radmac_secret'] ? $_POST['radmac_secret'] : false;
- $config['captiveportal']['reauthenticateacct'] = $_POST['reauthenticateacct'];
- $config['captiveportal']['httpslogin'] = $_POST['httpslogin_enable'] ? true : false;
- $config['captiveportal']['httpsname'] = $_POST['httpsname'];
- $config['captiveportal']['peruserbw'] = $_POST['peruserbw'] ? true : false;
- $config['captiveportal']['bwdefaultdn'] = $_POST['bwdefaultdn'];
- $config['captiveportal']['bwdefaultup'] = $_POST['bwdefaultup'];
- $config['captiveportal']['certificate'] = base64_encode($_POST['cert']);
- $config['captiveportal']['private-key'] = base64_encode($_POST['key']);
- $config['captiveportal']['logoutwin_enable'] = $_POST['logoutwin_enable'] ? true : false;
- $config['captiveportal']['nomacfilter'] = $_POST['nomacfilter'] ? true : false;
- $config['captiveportal']['noconcurrentlogins'] = $_POST['noconcurrentlogins'] ? true : false;
- $config['captiveportal']['redirurl'] = $_POST['redirurl'];
- $config['captiveportal']['radiusip'] = $_POST['radiusip'];
- $config['captiveportal']['radiusip2'] = $_POST['radiusip2'];
- $config['captiveportal']['radiusport'] = $_POST['radiusport'];
- $config['captiveportal']['radiusport2'] = $_POST['radiusport2'];
- $config['captiveportal']['radiusacctport'] = $_POST['radiusacctport'];
- $config['captiveportal']['radiuskey'] = $_POST['radiuskey'];
- $config['captiveportal']['radiuskey2'] = $_POST['radiuskey2'];
- $config['captiveportal']['radiusvendor'] = $_POST['radiusvendor'] ? $_POST['radiusvendor'] : false;
- //$config['captiveportal']['radiussession_timeout'] = $_POST['radiussession_timeout'] ? true : false;
-
- /* file upload? */
- if (is_uploaded_file($_FILES['htmlfile']['tmp_name']))
- $config['captiveportal']['page']['htmltext'] = base64_encode(file_get_contents($_FILES['htmlfile']['tmp_name']));
- if (is_uploaded_file($_FILES['errfile']['tmp_name']))
- $config['captiveportal']['page']['errtext'] = base64_encode(file_get_contents($_FILES['errfile']['tmp_name']));
-
- write_config();
-
- $retval = 0;
-
- config_lock();
- $retval = captiveportal_configure();
- config_unlock();
-
- $savemsg = get_std_save_message($retval);
- }
-}
-include("head.inc");
-?>
-<?php include("fbegin.inc"); ?>
-<script language="JavaScript">
-<!--
-function enable_change(enable_change) {
- var endis, radius_endis;
- endis = !(document.iform.enable.checked || enable_change);
- radius_endis = !((!endis && document.iform.auth_method[2].checked) || enable_change);
-
- document.iform.cinterface.disabled = endis;
- //document.iform.maxproc.disabled = endis;
- document.iform.maxprocperip.disabled = endis;
- document.iform.idletimeout.disabled = endis;
- document.iform.timeout.disabled = endis;
- document.iform.redirurl.disabled = endis;
- document.iform.radiusip.disabled = radius_endis;
- document.iform.radiusip2.disabled = radius_endis;
- document.iform.radiusport.disabled = radius_endis;
- document.iform.radiusport2.disabled = radius_endis;
- document.iform.radiuskey.disabled = radius_endis;
- document.iform.radiuskey2.disabled = radius_endis;
- document.iform.radacct_enable.disabled = radius_endis;
- document.iform.peruserbw.disabled = endis;
- document.iform.bwdefaultdn.disabled = endis;
- document.iform.bwdefaultup.disabled = endis;
- document.iform.reauthenticate.disabled = radius_endis;
- document.iform.auth_method[0].disabled = endis;
- document.iform.auth_method[1].disabled = endis;
- document.iform.auth_method[2].disabled = endis;
- document.iform.radmac_enable.disabled = radius_endis;
- document.iform.httpslogin_enable.disabled = endis;
- document.iform.httpsname.disabled = endis;
- document.iform.cert.disabled = endis;
- document.iform.key.disabled = endis;
- document.iform.logoutwin_enable.disabled = endis;
- document.iform.nomacfilter.disabled = endis;
- document.iform.noconcurrentlogins.disabled = endis;
- document.iform.radiusvendor.disabled = radius_endis;
- //document.iform.radiussession_timeout.disabled = radius_endis;
- document.iform.htmlfile.disabled = endis;
- document.iform.errfile.disabled = endis;
-
- document.iform.radiusacctport.disabled = (radius_endis || !document.iform.radacct_enable.checked) && !enable_change;
-
- document.iform.radmac_secret.disabled = (radius_endis || !document.iform.radmac_enable.checked) && !enable_change;
-
- var reauthenticate_dis = (radius_endis || !document.iform.reauthenticate.checked) && !enable_change;
- document.iform.reauthenticateacct[0].disabled = reauthenticate_dis;
- document.iform.reauthenticateacct[1].disabled = reauthenticate_dis;
- document.iform.reauthenticateacct[2].disabled = reauthenticate_dis;
-}
-//-->
-</script>
-<p class="pgtitle"><?=$pgtitle?></p>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<form action="services_captiveportal.php" method="post" enctype="multipart/form-data" name="iform" id="iform">
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[] = array("Captive portal", true, "services_captiveportal.php");
- $tab_array[] = array("Pass-through MAC", false, "services_captiveportal_mac.php");
- $tab_array[] = array("Allowed IP addresses", false, "services_captiveportal_ip.php");
- $tab_array[] = array("Users", false, "services_captiveportal_users.php");
- $tab_array[] = array("File Manager", false, "services_captiveportal_filemanager.php");
- display_top_tabs($tab_array);
-?> </td></tr>
- <tr>
- <td class="tabcont">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vtable">&nbsp;</td>
- <td width="78%" class="vtable">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
- <strong>Enable captive portal </strong></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Interface</td>
- <td width="78%" class="vtable">
- <select name="cinterface" class="formfld" id="cinterface">
- <?php $interfaces = array('lan' => 'LAN');
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- if (isset($config['interfaces']['opt' . $i]['enable']))
- $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
- }
- foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?php if ($iface == $pconfig['cinterface']) echo "selected"; ?>>
- <?=htmlspecialchars($ifacename);?>
- </option>
- <?php endforeach; ?>
- </select> <br>
- <span class="vexpl">Choose which interface to run the captive portal on.</span></td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Maximum concurrent connections</td>
- <td class="vtable">
- <table cellpadding="0" cellspacing="0">
- <tr>
- <td><input name="maxprocperip" type="text" class="formfld" id="maxprocperip" size="5" value="<?=htmlspecialchars($pconfig['maxprocperip']);?>"> per client IP address (0 = no limit)</td>
- </tr>
- </table>
-This setting limits the number of concurrent connections to the captive portal HTTP(S) server. This does not set how many users can be logged in
-to the captive portal, but rather how many users can load the portal page or authenticate at the same time!
-Default is 4 connections per client IP address, with a total maximum of 16 connections.</td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Idle timeout</td>
- <td class="vtable">
- <input name="idletimeout" type="text" class="formfld" id="idletimeout" size="6" value="<?=htmlspecialchars($pconfig['idletimeout']);?>">
-minutes<br>
-Clients will be disconnected after this amount of inactivity. They may log in again immediately, though. Leave this field blank for no idle timeout.</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Hard timeout</td>
- <td width="78%" class="vtable">
- <input name="timeout" type="text" class="formfld" id="timeout" size="6" value="<?=htmlspecialchars($pconfig['timeout']);?>">
- minutes<br>
- Clients will be disconnected after this amount of time, regardless of activity. They may log in again immediately, though. Leave this field blank for no hard timeout (not recommended unless an idle timeout is set).</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Logout popup window</td>
- <td width="78%" class="vtable">
- <input name="logoutwin_enable" type="checkbox" class="formfld" id="logoutwin_enable" value="yes" <?php if($pconfig['logoutwin_enable']) echo "checked"; ?>>
- <strong>Enable logout popup window</strong><br>
- If enabled, a popup window will appear when clients are allowed through the captive portal. This allows clients to explicitly disconnect themselves before the idle or hard timeout occurs.</td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Redirection URL</td>
- <td class="vtable">
- <input name="redirurl" type="text" class="formfld" id="redirurl" size="60" value="<?=htmlspecialchars($pconfig['redirurl']);?>">
- <br>
-If you provide a URL here, clients will be redirected to that URL instead of the one they initially tried
-to access after they've authenticated.</td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Concurrent user logins</td>
- <td class="vtable">
- <input name="noconcurrentlogins" type="checkbox" class="formfld" id="noconcurrentlogins" value="yes" <?php if ($pconfig['noconcurrentlogins']) echo "checked"; ?>>
- <strong>Disable concurrent logins</strong><br>
- If this option is set, only the most recent login per username will be active. Subsequent logins will cause machines previously logged in with the same username to be disconnected.</td>
- </tr>
- <tr>
- <td valign="top" class="vncell">MAC filtering </td>
- <td class="vtable">
- <input name="nomacfilter" type="checkbox" class="formfld" id="nomacfilter" value="yes" <?php if ($pconfig['nomacfilter']) echo "checked"; ?>>
- <strong>Disable MAC filtering</strong><br>
- If this option is set, no attempts will be made to ensure that the MAC address of clients stays the same while they're logged in.
- This is required when the MAC address of the client cannot be determined (usually because there are routers between <?=$g['product_name']; ?> and the clients).
- If this is enabled, RADIUS MAC authentication cannot be used.</td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Per-user bandwidth restriction</td>
- <td class="vtable">
- <input name="peruserbw" type="checkbox" class="formfld" id="peruserbw" value="yes" <?php if ($pconfig['peruserbw']) echo "checked"; ?>>
- <strong>Enable per-user bandwidth restriction</strong><br><br>
- <table cellpadding="0" cellspacing="0">
- <tr>
- <td>Default download</td>
- <td><input type="text" class="formfld" name="bwdefaultdn" id="bwdefaultdn" size="10" value="<?=htmlspecialchars($pconfig['bwdefaultdn']);?>"> Kbit/s</td>
- </tr>
- <tr>
- <td>Default upload</td>
- <td><input type="text" class="formfld" name="bwdefaultup" id="bwdefaultup" size="10" value="<?=htmlspecialchars($pconfig['bwdefaultup']);?>"> Kbit/s</td>
- </tr></table>
- <br>
- If this option is set, the captive portal will restrict each user who logs in to the specified default bandwidth. RADIUS can override the default settings. Leave empty or set to 0 for no limit.</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Authentication</td>
- <td width="78%" class="vtable">
- <table cellpadding="0" cellspacing="0">
- <tr>
- <td colspan="2"><input name="auth_method" type="radio" id="auth_method" value="none" onClick="enable_change(false)" <?php if($pconfig['auth_method']!="local" && $pconfig['auth_method']!="radius") echo "checked"; ?>>
- No authentication</td>
- </tr>
- <tr>
- <td colspan="2"><input name="auth_method" type="radio" id="auth_method" value="local" onClick="enable_change(false)" <?php if($pconfig['auth_method']=="local") echo "checked"; ?>>
- Local <a href="services_captiveportal_users.php">user manager</a></td>
- </tr>
- <tr>
- <td colspan="2"><input name="auth_method" type="radio" id="auth_method" value="radius" onClick="enable_change(false)" <?php if($pconfig['auth_method']=="radius") echo "checked"; ?>>
- RADIUS authentication</td>
- </tr><tr>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- </tr>
- </table>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td colspan="2" valign="top" class="optsect_t2">Primary RADIUS server</td>
- </tr>
- <tr>
- <td class="vncell" valign="top">IP address</td>
- <td class="vtable"><input name="radiusip" type="text" class="formfld" id="radiusip" size="20" value="<?=htmlspecialchars($pconfig['radiusip']);?>"><br>
- Enter the IP address of the RADIUS server which users of the captive portal have to authenticate against.</td>
- </tr>
- <tr>
- <td class="vncell" valign="top">Port</td>
- <td class="vtable"><input name="radiusport" type="text" class="formfld" id="radiusport" size="5" value="<?=htmlspecialchars($pconfig['radiusport']);?>"><br>
- Leave this field blank to use the default port (1812).</td>
- </tr>
- <tr>
- <td class="vncell" valign="top">Shared secret&nbsp;&nbsp;</td>
- <td class="vtable"><input name="radiuskey" type="text" class="formfld" id="radiuskey" size="16" value="<?=htmlspecialchars($pconfig['radiuskey']);?>"><br>
- Leave this field blank to not use a RADIUS shared secret (not recommended).</td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12"></td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="optsect_t2">Secondary RADIUS server</td>
- </tr>
- <tr>
- <td class="vncell" valign="top">IP address</td>
- <td class="vtable"><input name="radiusip2" type="text" class="formfld" id="radiusip2" size="20" value="<?=htmlspecialchars($pconfig['radiusip2']);?>"><br>
- If you have a second RADIUS server, you can activate it by entering its IP address here.</td>
- </tr>
- <tr>
- <td class="vncell" valign="top">Port</td>
- <td class="vtable"><input name="radiusport2" type="text" class="formfld" id="radiusport2" size="5" value="<?=htmlspecialchars($pconfig['radiusport2']);?>"></td>
- </tr>
- <tr>
- <td class="vncell" valign="top">Shared secret&nbsp;&nbsp;</td>
- <td class="vtable"><input name="radiuskey2" type="text" class="formfld" id="radiuskey2" size="16" value="<?=htmlspecialchars($pconfig['radiuskey2']);?>"></td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12"></td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="optsect_t2">Accounting</td>
- </tr>
- <tr>
- <td class="vncell">&nbsp;</td>
- <td class="vtable"><input name="radacct_enable" type="checkbox" id="radacct_enable" value="yes" onClick="enable_change(false)" <?php if($pconfig['radacct_enable']) echo "checked"; ?>>
- <strong>send RADIUS accounting packets</strong><br>
- If this is enabled, RADIUS accounting packets will be sent to the primary RADIUS server.</td>
- </tr>
- <tr>
- <td class="vncell" valign="top">Accounting port</td>
- <td class="vtable"><input name="radiusacctport" type="text" class="formfld" id="radiusacctport" size="5" value="<?=htmlspecialchars($pconfig['radiusacctport']);?>"><br>
- Leave blank to use the default port (1813).</td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12"></td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="optsect_t2">Reauthentication</td>
- </tr>
- <tr>
- <td class="vncell">&nbsp;</td>
- <td class="vtable"><input name="reauthenticate" type="checkbox" id="reauthenticate" value="yes" onClick="enable_change(false)" <?php if($pconfig['reauthenticate']) echo "checked"; ?>>
- <strong>Reauthenticate connected users every minute</strong><br>
- If reauthentication is enabled, Access-Requests will be sent to the RADIUS server for each user that is
- logged in every minute. If an Access-Reject is received for a user, that user is disconnected from the captive portal immediately.</td>
- </tr>
- <tr>
- <td class="vncell" valign="top">Accounting updates</td>
- <td class="vtable">
- <input name="reauthenticateacct" type="radio" value="" <?php if(!$pconfig['reauthenticateacct']) echo "checked"; ?>> no accounting updates<br>
- <input name="reauthenticateacct" type="radio" value="stopstart" <?php if($pconfig['reauthenticateacct'] == "stopstart") echo "checked"; ?>> stop/start accounting<br>
- <input name="reauthenticateacct" type="radio" value="interimupdate" <?php if($pconfig['reauthenticateacct'] == "interimupdate") echo "checked"; ?>> interim update
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12"></td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="optsect_t2">RADIUS MAC authentication</td>
- </tr>
- <tr>
- <td class="vncell">&nbsp;</td>
- <td class="vtable">
- <input name="radmac_enable" type="checkbox" id="radmac_enable" value="yes" onClick="enable_change(false)" <?php if ($pconfig['radmac_enable']) echo "checked"; ?>><strong>Enable RADIUS MAC authentication</strong><br>
- If this option is enabled, the captive portal will try to authenticate users by sending their MAC address as the username and the password
- entered below to the RADIUS server.</td>
- </tr>
- <tr>
- <td class="vncell">Shared secret</td>
- <td class="vtable"><input name="radmac_secret" type="text" class="formfld" id="radmac_secret" size="16" value="<?=htmlspecialchars($pconfig['radmac_secret']);?>"></td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12"></td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="optsect_t2">RADIUS options</td>
- </tr>
-
- <!--
- <tr>
- <td class="vncell" valign="top">Session-Timeout</td>
- <td class="vtable"><input name="radiussession_timeout" type="checkbox" id="radiussession_timeout" value="yes" <?php if ($pconfig['radiussession_timeout']) echo "checked"; ?>><strong>Use RADIUS Session-Timeout attributes</strong><br>
- When this is enabled, clients will be disconnected after the amount of time retrieved from the RADIUS Session-Timeout attribute.</td>
- </tr>
- -->
-
- <tr>
- <td class="vncell" valign="top">Type</td>
- <td class="vtable"><select name="radiusvendor" id="radiusvendor">
- <option>default</option>
- <?php
- $radiusvendors = array("cisco");
- foreach ($radiusvendors as $radiusvendor){
- if ($pconfig['radiusvendor'] == $radiusvendor)
- echo "<option selected value=\"$radiusvendor\">$radiusvendor</option>\n";
- else
- echo "<option value=\"$radiusvendor\">$radiusvendor</option>\n";
- }
- ?></select><br>
- If RADIUS type is set to Cisco, in Access-Requests the value of Calling-Station-Id will be set to the client's IP address and
- the Called-Station-Id to the client's MAC address. Default behaviour is Calling-Station-Id = client's MAC address and Called-Station-Id = <?=$g['product_name'];?>'s WAN IP address.</td>
- </tr>
- </table>
- </tr>
- <tr>
- <td valign="top" class="vncell">HTTPS login</td>
- <td class="vtable">
- <input name="httpslogin_enable" type="checkbox" class="formfld" id="httpslogin_enable" value="yes" <?php if($pconfig['httpslogin_enable']) echo "checked"; ?>>
- <strong>Enable HTTPS login</strong><br>
- If enabled, the username and password will be transmitted over an HTTPS connection to protect against eavesdroppers. A server name, certificate and matching private key must also be specified below.</td>
- </tr>
- <tr>
- <td valign="top" class="vncell">HTTPS server name </td>
- <td class="vtable">
- <input name="httpsname" type="text" class="formfld" id="httpsname" size="30" value="<?=htmlspecialchars($pconfig['httpsname']);?>"><br>
- This name will be used in the form action for the HTTPS POST and should match the Common Name (CN) in your certificate (otherwise, the client browser will most likely display a security warning). Make sure captive portal clients can resolve this name in DNS and verify on the client that the IP resolves to the correct interface IP on <?=$g['product_name'];?>.. </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">HTTPS certificate</td>
- <td class="vtable">
- <textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
- <br>
- Paste a signed certificate in X.509 PEM format here.</td>
- </tr>
- <tr>
- <td valign="top" class="vncell">HTTPS private key</td>
- <td class="vtable">
- <textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
- <br>
- Paste an RSA private key in PEM format here.</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Portal page contents</td>
- <td width="78%" class="vtable">
- <?=$mandfldhtml;?><input type="file" name="htmlfile" class="formfld" id="htmlfile"><br>
- <?php
- list($host) = explode(":", $_SERVER['HTTP_HOST']);
- if(isset($config['captiveportal']['httpslogin'])) {
- $href = "https://$host:8001";
- } else {
- $href = "http://$host:8000";
- }
- ?>
- <?php if ($config['captiveportal']['page']['htmltext']): ?>
- <a href="<?=$href?>" target="_new">View current page</a>
- <br>
- <br>
- <?php endif; ?>
- Upload an HTML file for the portal page here (leave blank to keep the current one). Make sure to include a form (POST to &quot;$PORTAL_ACTION$&quot;)
-with a submit button (name=&quot;accept&quot;) and a hidden field with name=&quot;redirurl&quot; and value=&quot;$PORTAL_REDIRURL$&quot;.
-Include the &quot;auth_user&quot; and &quot;auth_pass&quot; input fields if authentication is enabled, otherwise it will always fail.
-Example code for the form:<br>
- <br>
- <tt>&lt;form method=&quot;post&quot; action=&quot;$PORTAL_ACTION$&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&lt;input name=&quot;auth_user&quot; type=&quot;text&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&lt;input name=&quot;auth_pass&quot; type=&quot;password&quot;&gt;<br>
- &nbsp;&nbsp;&nbsp;&lt;input name=&quot;redirurl&quot; type=&quot;hidden&quot; value=&quot;$PORTAL_REDIRURL$&quot;&gt;<br>
-&nbsp;&nbsp;&nbsp;&lt;input name=&quot;accept&quot; type=&quot;submit&quot; value=&quot;Continue&quot;&gt;<br>
- &lt;/form&gt;</tt></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Authentication<br>
- error page<br>
- contents</td>
- <td class="vtable">
- <input name="errfile" type="file" class="formfld" id="errfile"><br>
- <?php if ($config['captiveportal']['page']['errtext']): ?>
- <a href="?act=viewerrhtml" target="_blank">View current page</a>
- <br>
- <br>
- <?php endif; ?>
-The contents of the HTML file that you upload here are displayed when an authentication error occurs.
-You may include &quot;$PORTAL_MESSAGE$&quot;, which will be replaced by the error or reply messages from the RADIUS server, if any.</td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" onClick="enable_change(true)">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%"><span class="vexpl"><span class="red"><strong>Note:<br>
- </strong></span>Changing any settings on this page will disconnect all clients! Don't forget to enable the DHCP server on your captive portal interface! Make sure that the default/maximum DHCP lease time is higher than the timeout entered on this page. Also, the DNS forwarder needs to be enabled for DNS lookups by unauthenticated clients to work. </span></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
-</form>
-<script language="JavaScript">
-<!--
-enable_change(false);
-//-->
-</script>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/Fit123/bin/date/index.abc b/config/Fit123/bin/date/index.abc
deleted file mode 100755
index f63b7001..00000000
--- a/config/Fit123/bin/date/index.abc
+++ /dev/null
@@ -1,264 +0,0 @@
-<?php
-/* $Id$ */
-/*
- index.php
- Copyright (C) 2004, 2005 Scott Ullrich
- All rights reserved.
-
- Originally part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- oR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
- ## Load Essential Includes
- require_once('guiconfig.inc');
- require_once('notices.inc');
-
-
- ## Load Functions Files
- require_once('includes/functions.inc.php');
-
-
- ## Load AJAX, Initiate Class ###############################################
- require_once('includes/sajax.class.php');
-
- ## Initiate Class and Set location of ajax file containing
- ## the information that we need for this page. Also set functions
- ## that SAJAX will be using.
- $oSajax = new sajax();
- $oSajax->sajax_remote_uri = 'sajax/index.sajax.php';
- $oSajax->sajax_request_type = 'POST';
- $oSajax->sajax_export("get_stats");
- $oSajax->sajax_handle_client_request();
- ############################################################################
-
-
- ## Check to see if we have a swap space,
- ## if true, display, if false, hide it ...
- if(file_exists("/usr/sbin/swapinfo")) {
- $swapinfo = `/usr/sbin/swapinfo`;
- if(stristr($swapinfo,'%') == true) $showswap=true;
- }
-
-
- ## User recently restored his config.
- ## If packages are installed lets resync
- if(file_exists('/conf/needs_package_sync')) {
- if($config['installedpackages'] <> '') {
- conf_mount_rw();
- unlink('/conf/needs_package_sync');
- header('Location: pkg_mgr_install.php?mode=reinstallall');
- exit;
- }
- }
-
-
- ## If it is the first time webGUI has been
- ## accessed since initial install show this stuff.
- if(file_exists('/conf/trigger_initial_wizard')) {
-
- echo <<<EOF
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
- <title>{$g['product_name']}.local - {$g['product_name']} first time setup</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <link rel="stylesheet" type="text/css" href="/niftycssprintCode.css" media="print" />
- <script type="text/javascript">var theme = "nervecenter"</script>
- <script type="text/javascript" src="/themes/nervecenter/loader.js"></script>
-
-EOF;
- echo "<body link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">\n";
-
- if(file_exists("/usr/local/www/themes/{$g['theme']}/wizard.css"))
- echo "<link rel=\"stylesheet\" href=\"/themes/{$g['theme']}/wizard.css\" media=\"all\" />\n";
- else
- echo "<link rel=\"stylesheet\" href=\"/themes/{$g['theme']}/all.css\" media=\"all\" />";
-
- echo "<form>\n";
- echo "<center>\n";
- echo "<img src=\"/themes/{$g['theme']}/images/logo.gif\" border=\"0\"><p>\n";
- echo "<div \" style=\"width:700px;background-color:#ffffff\" id=\"nifty\">\n";
- echo "Welcome to {$g['product_name']}!<p>\n";
- echo "One moment while we start the initial setup wizard.<p>\n";
- echo "Embedded platform users: Please be patient, the wizard takes a little longer to run than the normal GUI.<p>\n";
- echo "To bypass the wizard, click on the {$g['product_name']} logo on the initial page.\n";
- echo "</div>\n";
- echo "<meta http-equiv=\"refresh\" content=\"1;url=wizard.php?xml=setup_wizard.xml\">\n";
- echo "<script type=\"text/javascript\">\n";
- echo "NiftyCheck();\n";
- echo "Rounded(\"div#nifty\",\"all\",\"#AAA\",\"#FFFFFF\",\"smooth\");\n";
- echo "</script>\n";
- exit;
- }
-
-
- ## Find out whether there's hardware encryption or not
- unset($hwcrypto);
- $fd = @fopen("{$g['varlog_path']}/dmesg.boot", "r");
- if ($fd) {
- while (!feof($fd)) {
- $dmesgl = fgets($fd);
- if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches)) {
- $hwcrypto = $matches[1];
- break;
- }
- }
- fclose($fd);
- }
-
-
- ## Set Page Title and Include Header
- $pgtitle = "{$g['product_name']} webGUI";
- include("head.inc");
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<script language="javascript">
-var ajaxStarted = false;
-</script>
-<?php
-include("fbegin.inc");
- if(!file_exists("/usr/local/www/themes/{$g['theme']}/no_big_logo"))
- echo "<center><img src=\"./themes/".$g['theme']."/images/logobig.jpg\"></center><br>";
-?>
-<?
-exec("/bin/date", $dateOutput, $dateStatus);
-$currentDate = $dateOutput[0];
-?>
-<p class="pgtitle">System Overview</p>
-
-<div id="niftyOutter">
-<form action="index.php" method="post">
-<table bgcolor="#990000" width="100%" border="0" cellspacing="0" cellpadding="0">
- <tbody>
- <tr>
- <td colspan="2" class="listtopic">System information</td>
- </tr>
- <tr>
- <td width="25%" class="vncellt">Name</td>
- <td width="75%" class="listr"><?php echo $config['system']['hostname'] . "." . $config['system']['domain']; ?></td>
- </tr>
- <tr>
- <td width="25%" valign="top" class="vncellt">Version</td>
- <td width="75%" class="listr">
- <strong><?php readfile("/etc/version"); ?></strong>
- <br />
- built on <?php readfile("/etc/version.buildtime"); ?>
- </td>
- </tr>
- <?php if(!$g['hideplatform']): ?>
- <tr>
- <td width="25%" class="vncellt">Platform / Current Date</td>
- <td width="75%" class="listr"><?=htmlspecialchars($g['platform']);?> / <?=$currentDate;?></td>
- </tr>
- <?php endif; ?>
- <?php if ($hwcrypto): ?>
- <tr>
- <td width="25%" class="vncellt">Hardware crypto</td>
- <td width="75%" class="listr"><?=htmlspecialchars($hwcrypto);?></td>
- </tr>
- <?php endif; ?>
- <tr>
- <td width="25%" class="vncellt">Uptime</td>
- <td width="75%" class="listr"><input style="border: 0px solid white;" size="30" name="uptime" id="uptime" value="<?= htmlspecialchars(get_uptime()); ?>" /></td>
- </tr>
- <?php if ($config['lastchange']): ?>
- <tr>
- <td width="25%" class="vncellt">Last config change</td>
- <td width="75%" class="listr"><?= htmlspecialchars(date("D M j G:i:s T Y", $config['revision']['time']));?></td>
- </tr>
- <?php endif; ?>
- <tr>
- <td width="25%" class="vncellt">State table size</td>
- <td width="75%" class="listr">
- <input style="border: 0px solid white;" size="30" name="pfstate" id="pfstate" value="<?= htmlspecialchars(get_pfstate()); ?>" />
- <br />
- <a href="diag_dump_states.php">Show states</a>
- </td>
- </tr>
- <tr>
- <td width="25%" class="vncellt">MBUF Usage</td>
- <td width="75%" class="listr">
- <?php
- $mbufs_inuse=`netstat -mb | grep "mbufs in use" | awk '{ print $1 }' | cut -d"/" -f1`;
- $mbufs_total=`netstat -mb | grep "mbufs in use" | awk '{ print $1 }' | cut -d"/" -f3`;
- ?>
- <?=$mbufs_inuse?>/<?=$mbufs_total?>
- </td>
- </tr>
- <tr>
- <td width="25%" class="vncellt">CPU usage</td>
- <td width="75%" class="listr">
- <?php $cpuUsage = "0"; ?>
- <img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" name="cpuwidtha" id="cpuwidtha" width="<?= $cpuUsage; ?>" border="0" align="middle" alt="red bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" name="cpuwidthb" id="cpuwidthb" width="<?= (100 - $cpuUsage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" />
- &nbsp;
- <input style="border: 0px solid white;" size="30" name="cpumeter" id="cpumeter" value="(Updating in 5 seconds)" />
- </td>
- </tr>
- <tr>
- <td width="25%" class="vncellt">Memory usage</td>
- <td width="75%" class="listr">
- <?php $memUsage = mem_usage(); ?>
- <img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" name="memwidtha" id="memwidtha" width="<?= $memUsage; ?>" border="0" align="middle" alt="red bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" name="memwidthb" id="memwidthb" width="<?= (100 - $memUsage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" />
- &nbsp;
- <input style="border: 0px solid white;" size="30" name="memusagemeter" id="memusagemeter" value="<?= $memUsage.'%'; ?>" />
- </td>
- </tr>
- <?php if($showswap == true): ?>
- <tr>
- <td width="25%" class="vncellt">SWAP usage</td>
- <td width="75%" class="listr">
- <?php $swapUsage = swap_usage(); ?>
- <img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" width="<?= $swapUsage; ?>" border="0" align="middle" alt="red bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" width="<?= (100 - $swapUsage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" />
- &nbsp;
- <input style="border: 0px solid white;" size="30" name="swapusagemeter" id="swapusagemeter" value="<?= $swapUsage.'%'; ?>" />
- </td>
- </tr>
- <?php endif; ?>
- <tr>
- <td width="25%" class="vncellt">Disk usage</td>
- <td width="75%" class="listr">
- <?php $diskusage = disk_usage(); ?>
- <img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_blue.gif" height="15" width="<?= $diskusage; ?>" border="0" align="middle" alt="red bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_gray.gif" height="15" width="<?= (100 - $diskusage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" />
- &nbsp;
- <input style="border: 0px solid white;" size="30" name="diskusagemeter" id="diskusagemeter" value="<?= $diskusage.'%'; ?>" />
- </td>
- </tr>
- </tbody>
-</table>
-</form>
-</div>
-
-<?php include("fend.inc"); ?>
-
-<script type="text/javascript">
- NiftyCheck();
- Rounded("div#nifty","top","#FFF","#EEEEEE","smooth");
-</script>
-
-</body>
-</html>
diff --git a/config/Fit123/bin/dnssrv/system.abc b/config/Fit123/bin/dnssrv/system.abc
deleted file mode 100755
index 898505b9..00000000
--- a/config/Fit123/bin/dnssrv/system.abc
+++ /dev/null
@@ -1,347 +0,0 @@
-<?php
-/* $Id$ */
-/*
- system.php
- part of m0n0wall (http://m0n0.ch/wall)
-
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-
-$pconfig['hostname'] = $config['system']['hostname'];
-$pconfig['domain'] = $config['system']['domain'];
-list($pconfig['dns1'],$pconfig['dns2'],$pconfig['dns3'],$pconfig['dns4']) = $config['system']['dnsserver'];
-
-$pconfig['dnsallowoverride'] = isset($config['system']['dnsallowoverride']);
-$pconfig['username'] = $config['system']['username'];
-if (!$pconfig['username'])
- $pconfig['username'] = "admin";
-$pconfig['webguiproto'] = $config['system']['webgui']['protocol'];
-if (!$pconfig['webguiproto'])
- $pconfig['webguiproto'] = "http";
-$pconfig['webguiport'] = $config['system']['webgui']['port'];
-$pconfig['timezone'] = $config['system']['timezone'];
-$pconfig['timeupdateinterval'] = $config['system']['time-update-interval'];
-$pconfig['timeservers'] = $config['system']['timeservers'];
-$pconfig['theme'] = $config['system']['theme'];
-
-if (!isset($pconfig['timeupdateinterval']))
- $pconfig['timeupdateinterval'] = 300;
-if (!$pconfig['timezone'])
- $pconfig['timezone'] = "Etc/UTC";
-if (!$pconfig['timeservers'])
- $pconfig['timeservers'] = "pool.ntp.org";
-
-$changedesc = "System: ";
-$changecount = 0;
-
-function is_timezone($elt) {
- return !preg_match("/\/$/", $elt);
-}
-
-if($pconfig['timezone'] <> $_POST['timezone']) {
- /* restart firewall log dumper helper */
- require_once("functions.inc");
- $pid = `ps awwwux | grep -v "grep" | grep "tcpdump -v -l -n -e -ttt -i pflog0" | awk '{ print $2 }'`;
- if($pid) {
- mwexec("kill $pid");
- usleep(1000);
- }
- filter_pflog_start();
-}
-
-exec('/usr/bin/tar -tzf /usr/share/zoneinfo.tgz', $timezonelist);
-$timezonelist = array_filter($timezonelist, 'is_timezone');
-sort($timezonelist);
-
-if ($_POST) {
-
- $changecount++;
-
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = split(" ", "hostname domain username");
- $reqdfieldsn = split(",", "Hostname,Domain,Username");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if ($_POST['hostname'] && !is_hostname($_POST['hostname'])) {
- $input_errors[] = "The hostname may only contain the characters a-z, 0-9 and '-'.";
- }
- if ($_POST['domain'] && !is_domain($_POST['domain'])) {
- $input_errors[] = "The domain may only contain the characters a-z, 0-9, '-' and '.'.";
- }
- if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2'])) || ($_POST['dns3'] && !is_ipaddr($_POST['dns3'])) || ($_POST['dns4'] && !is_ipaddr($_POST['dns4']))) {
- $input_errors[] = "A valid IP address must be specified for the primary/secondary DNS server.";
- }
- if ($_POST['username'] && !preg_match("/^[a-zA-Z0-9]*$/", $_POST['username'])) {
- $input_errors[] = "The username may only contain the characters a-z, A-Z and 0-9.";
- }
- if ($_POST['webguiport'] && (!is_numericint($_POST['webguiport']) ||
- ($_POST['webguiport'] < 1) || ($_POST['webguiport'] > 65535))) {
- $input_errors[] = "A valid TCP/IP port must be specified for the webGUI port.";
- }
- if (($_POST['password']) && ($_POST['password'] != $_POST['password2'])) {
- $input_errors[] = "The passwords do not match.";
- }
-
- $t = (int)$_POST['timeupdateinterval'];
- if (($t < 0) || (($t > 0) && ($t < 6)) || ($t > 1440)) {
- $input_errors[] = "The time update interval must be either 0 (disabled) or between 6 and 1440.";
- }
- foreach (explode(' ', $_POST['timeservers']) as $ts) {
- if (!is_domain($ts)) {
- $input_errors[] = "A NTP Time Server name may only contain the characters a-z, 0-9, '-' and '.'.";
- }
- }
-
- if (!$input_errors) {
- update_if_changed("hostname", $config['system']['hostname'], strtolower($_POST['hostname']));
- update_if_changed("domain", $config['system']['domain'], strtolower($_POST['domain']));
- update_if_changed("username", $config['system']['username'], $_POST['username']);
-
- if (update_if_changed("webgui protocol", $config['system']['webgui']['protocol'], $_POST['webguiproto']))
- $restart_webgui = true;
- if (update_if_changed("webgui port", $config['system']['webgui']['port'], $_POST['webguiport']))
- $restart_webgui = true;
-
- update_if_changed("timezone", $config['system']['timezone'], $_POST['timezone']);
- update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers']));
- update_if_changed("NTP update interval", $config['system']['time-update-interval'], $_POST['timeupdateinterval']);
-
- /* pfSense themes */
- update_if_changed("System Theme", $config['theme'], $_POST['theme']);
-
- /* XXX - billm: these still need updating after figuring out how to check if they actually changed */
- unset($config['system']['dnsserver']);
- if ($_POST['dns1'])
- $config['system']['dnsserver'][] = $_POST['dns1'];
- if ($_POST['dns2'])
- $config['system']['dnsserver'][] = $_POST['dns2'];
- if ($_POST['dns3'])
- $config['system']['dnsserver'][] = $_POST['dns3'];
- if ($_POST['dns4'])
- $config['system']['dnsserver'][] = $_POST['dns4'];
-
- $olddnsallowoverride = $config['system']['dnsallowoverride'];
-
- unset($config['system']['dnsallowoverride']);
- $config['system']['dnsallowoverride'] = $_POST['dnsallowoverride'] ? true : false;
- if ($_POST['password']) {
- $config['system']['password'] = crypt($_POST['password']);
- update_changedesc("password changed via webConfigurator");
- sync_webgui_passwords();
- }
-
- if ($changecount > 0)
- write_config($changedesc);
-
- if ($restart_webgui) {
- global $_SERVER;
- list($host) = explode(":", $_SERVER['HTTP_HOST']);
- if ($config['system']['webgui']['port']) {
- $url="{$config['system']['webgui']['protocol']}://{$host}:{$config['system']['webgui']['port']}/system.php";
- } else {
- $url = "{$config['system']['webgui']['protocol']}://{$host}/system.php";
- }
- }
-
- $retval = 0;
- config_lock();
- $retval = system_hostname_configure();
- $retval |= system_hosts_generate();
- $retval |= system_resolvconf_generate();
- $retval |= system_password_configure();
- $retval |= services_dnsmasq_configure();
- $retval |= system_timezone_configure();
- $retval |= system_ntp_configure();
-
- if ($olddnsallowoverride != $config['system']['dnsallowoverride'])
- $retval |= interfaces_wan_configure();
-
- config_unlock();
-
- // Reload filter -- plugins might need to run
- filter_configure();
-
- $savemsg = get_std_save_message($retval);
- if ($restart_webgui)
- $savemsg .= "<br />One moment...redirecting to {$url} in 10 seconds.";
- }
-}
-
-$pgtitle = "System: General Setup";
-include("head.inc");
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<form action="system.php" method="post">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq">Hostname</td>
- <td width="78%" class="vtable"> <input name="hostname" type="text" class="formfld" id="hostname" size="40" value="<?=htmlspecialchars($pconfig['hostname']);?>">
- <br> <span class="vexpl">name of the firewall host, without
- domain part<br>
- e.g. <em>firewall</em></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Domain</td>
- <td width="78%" class="vtable"> <input name="domain" type="text" class="formfld" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>">
- <br> <span class="vexpl">e.g. <em>mycorp.com</em> </span></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">DNS servers</td>
- <td width="78%" class="vtable"> <p>
- <input name="dns1" type="text" class="formfld" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>">
- <br>
- <input name="dns2" type="text" class="formfld" id="dns22" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>">
- <br>
- <input name="dns3" type="text" class="formfld" id="dns3" size="20" value="<?=htmlspecialchars($pconfig['dns3']);?>">
- <br>
- <input name="dns4" type="text" class="formfld" id="dns4" size="20" value="<?=htmlspecialchars($pconfig['dns4']);?>">
- <br>
- <span class="vexpl">IP addresses; these are also used for
- the DHCP service, DNS forwarder and for PPTP VPN clients<br>
- <br>
- <input name="dnsallowoverride" type="checkbox" id="dnsallowoverride" value="yes" <?php if ($pconfig['dnsallowoverride']) echo "checked"; ?>>
- <strong>Allow DNS server list to be overridden by DHCP/PPP
- on WAN</strong><br>
- If this option is set, <?=$g['product_name']?> will use DNS servers assigned
- by a DHCP/PPP server on WAN for its own purposes (including
- the DNS forwarder). They will not be assigned to DHCP and
- PPTP VPN clients, though.</span></p></td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Username</td>
- <td class="vtable"> <input name="username" type="text" class="formfld" id="username" size="20" value="<?=$pconfig['username'];?>">
- <br>
- <span class="vexpl">If you want
- to change the username for accessing the webGUI, enter it
- here.</span></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Password</td>
- <td width="78%" class="vtable"> <input name="password" type="password" class="formfld" id="password" size="20">
- <br> <input name="password2" type="password" class="formfld" id="password2" size="20">
- &nbsp;(confirmation) <br> <span class="vexpl">If you want
- to change the password for accessing the webGUI, enter it
- here twice.</span></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">webGUI protocol</td>
- <td width="78%" class="vtable"> <input name="webguiproto" type="radio" value="http" <?php if ($pconfig['webguiproto'] == "http") echo "checked"; ?>>
- HTTP &nbsp;&nbsp;&nbsp; <input type="radio" name="webguiproto" value="https" <?php if ($pconfig['webguiproto'] == "https") echo "checked"; ?>>
- HTTPS</td>
- </tr>
- <tr>
- <td valign="top" class="vncell">webGUI port</td>
- <td class="vtable"> <input name="webguiport" type="text" class="formfld" id="webguiport" "size="5" value="<?=htmlspecialchars($config['system']['webgui']['port']);?>">
- <br>
- <span class="vexpl">Enter a custom port number for the webGUI
- above if you want to override the default (80 for HTTP, 443
- for HTTPS). Changes will take effect immediately after save.</span></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Time zone</td>
- <td width="78%" class="vtable"> <select name="timezone" id="timezone">
- <?php foreach ($timezonelist as $value): ?>
- <option value="<?=htmlspecialchars($value);?>" <?php if ($value == $pconfig['timezone']) echo "selected"; ?>>
- <?=htmlspecialchars($value);?>
- </option>
- <?php endforeach; ?>
- </select> <br> <span class="vexpl">Select the location closest
- to you</span></td>
- </tr>
- <!--
- <tr>
- <td width="22%" valign="top" class="vncell">Time update interval</td>
- <td width="78%" class="vtable"> <input name="timeupdateinterval" type="text" class="formfld" id="timeupdateinterval" size="4" value="<?=htmlspecialchars($pconfig['timeupdateinterval']);?>">
- <br> <span class="vexpl">Minutes between network time sync.;
- 300 recommended, or 0 to disable </span></td>
- </tr>
- -->
- <tr>
- <td width="22%" valign="top" class="vncell">NTP time server</td>
- <td width="78%" class="vtable"> <input name="timeservers" type="text" class="formfld" id="timeservers" size="40" value="<?=htmlspecialchars($pconfig['timeservers']);?>">
- <br> <span class="vexpl">Use a space to separate multiple
- hosts (only one required). Remember to set up at least one
- DNS server if you enter a host name here!</span></td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic">Theme</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <select name="theme">
-<?php
- $files = return_dir_as_array("/usr/local/www/themes/");
- foreach($files as $f) {
- if ( (substr($f, 0, 1) == "_") && !isset($config['system']['developer']) ) continue;
- if($f == "CVS") continue;
- $selected = "";
- if($f == $config['theme'])
- $selected = " SELECTED";
- if($config['theme'] == "" and $f == "pfsense")
- $selceted = " SELECTED";
- echo "\t\t\t\t\t"."<option{$selected}>{$f}</option>\n";
- }
-?>
- </select>
- <strong>This will change the look and feel of <?=$g['product_name']?></strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%"> <input name="Submit" type="submit" class="formbtn" value="Save">
- </td>
- </tr>
- </table>
-</form>
-<?php include("fend.inc"); ?>
-<?php
- // restart webgui if proto or port changed
- if ($restart_webgui) {
- echo "<meta http-equiv=\"refresh\" content=\"10;url={$url}\">";
- }
-?>
-</body>
-</html>
-<?php
-if ($restart_webgui) {
- touch("/tmp/restart_webgui");
-}
-?>
diff --git a/config/Fit123/bin/ltsp/services.inc b/config/Fit123/bin/ltsp/services.inc
deleted file mode 100644
index f999868a..00000000
--- a/config/Fit123/bin/ltsp/services.inc
+++ /dev/null
@@ -1,1320 +0,0 @@
-<?php
-/* $Id$ */
-/*
- services.inc
- part of m0n0wall (http://m0n0.ch/wall)
-
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/* include all configuration functions */
-require_once("functions.inc");
-
-function load_balancer_use_sticky() {
- global $config, $g;
- if (isset ($config['system']['lb_use_sticky']))
- touch("/var/etc/use_pf_pool__stickyaddr");
- else
- unlink_if_exists("/var/etc/use_pf_pool__stickyaddr");
-}
-
-function services_dhcpd_configure() {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "services_dhcpd_configure($if) being called $mt\n";
- }
-
- /* if OLSRD is enabled, allow WAN to house DHCP. */
- if($config['installedpackages']['olsrd'])
- foreach($config['installedpackages']['olsrd']['config'] as $olsrd)
- if($olsrd['enable'])
- $is_olsr_enabled = true;
-
- /* configure DHCPD chroot */
- $fd = fopen("/tmp/dhcpd.sh","w");
- $status = `mount | grep "{$g['dhcpd_chroot_path']}/dev"`;
- fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}\n");
- fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/dev\n");
- fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/etc\n");
- fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/usr/local/sbin\n");
- fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/var/db\n");
- fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/var/run\n");
- fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/usr\n");
- fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/lib\n");
- fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/run\n");
- fwrite($fd, "chown -R dhcpd:_dhcp {$g['dhcpd_chroot_path']}/*\n");
- fwrite($fd, "cp /lib/libc.so.* {$g['dhcpd_chroot_path']}/lib/\n");
- fwrite($fd, "cp /usr/local/sbin/dhcpd {$g['dhcpd_chroot_path']}/usr/local/sbin/\n");
- fwrite($fd, "chmod a+rx {$g['dhcpd_chroot_path']}/usr/local/sbin/dhcpd\n");
- if(!trim($status))
- fwrite($fd, "mount -t devfs devfs {$g['dhcpd_chroot_path']}/dev\n");
- fclose($fd);
- mwexec("/bin/sh /tmp/dhcpd.sh");
-
- /* kill any running dhcpd */
- if(is_process_running("dhcpd"))
- mwexec("killall dhcpd", true);
-
- $syscfg = $config['system'];
- $dhcpdcfg = $config['dhcpd'];
-
- /* DHCP enabled on any interfaces? */
- $dhcpdenable = false;
- if(is_array($dhcpdcfg))
- foreach ($dhcpdcfg as $dhcpif => $dhcpifconf) {
- if (isset($dhcpifconf['enable']) &&
- (($dhcpif == "lan") ||
- (isset($config['interfaces'][$dhcpif]['enable']) &&
- $config['interfaces'][$dhcpif]['if'] && (!$config['interfaces'][$dhcpif]['bridge']))))
- $dhcpdenable = true;
- if (isset($dhcpifconf['enable']) &&
- (($dhcpif == "wan") || (isset($config['interfaces'][$dhcpif]['enable']) &&
- $config['interfaces'][$dhcpif]['if'] && (!$config['interfaces'][$dhcpif]['bridge']))))
- $dhcpdenable = true;
- }
-
- if (!$dhcpdenable)
- return 0;
-
- if ($g['booting'])
- echo "Starting DHCP service...";
- else
- sleep(1);
-
- /* write dhcpd.conf */
- $fd = fopen("{$g['dhcpd_chroot_path']}/etc/dhcpd.conf", "w");
- if (!$fd) {
- printf("Error: cannot open dhcpd.conf in services_dhcpd_configure().\n");
- return 1;
- }
-
-
-
- $dhcpdconf = <<<EOD
-option domain-name "{$syscfg['domain']}";
-default-lease-time 7200;
-max-lease-time 86400;
-authoritative;
-log-facility local7;
-ddns-update-style none;
-one-lease-per-client true;
-deny duplicates;
-
-EOD;
-
- $dhcpdifs = array();
-
- /* loop through and deterimine if we need to setup
- * failover peer "bleh" entries
- */
- $dhcpnum = 0;
- foreach ($dhcpdcfg as $dhcpif => $dhcpifconf) {
- if($dhcpifconf['failover_peerip'] <> "") {
- /*
- * yep, failover peer is defined.
- * does it match up to a defined vip?
- */
- $skew = 110;
- $a_vip = &$config['virtualip']['vip'];
- if(is_array($a_vip)) {
- foreach ($a_vip as $vipent) {
- $int = guess_interface_from_ip($dhcpifconf['failover_peerip']);
- $intip = find_interface_ip($int);
- $real_dhcpif = convert_friendly_interface_to_real_interface_name($dhcpif);
- if($int == $real_dhcpif) {
- /* this is the interface! */
- if($vipent['advskew'] < "20")
- $skew = 0;
- }
- }
- } else {
- log_error("Warning! DHCP Failover setup and no CARP virtual IP's defined!");
- }
- if($skew > 10) {
- $type = "secondary";
- $dhcpdconf_pri = "mclt 600;\n";
- $my_port = "520";
- $peer_port = "519";
- } else {
- $my_port = "519";
- $peer_port = "520";
- $type = "primary";
- $dhcpdconf_pri = "split 128;\n";
- $dhcpdconf_pri .= " mclt 600;\n";
- }
- $dhcpdconf .= <<<EOPP
-failover peer "dhcp{$dhcpnum}" {
- {$type};
- address {$intip};
- port {$my_port};
- peer address {$dhcpifconf['failover_peerip']};
- peer port {$peer_port};
- max-response-delay 10;
- max-unacked-updates 10;
- {$dhcpdconf_pri}
- load balance max seconds 3;
-}
-
-EOPP;
- $dhcpnum++;
- }
- }
-
- $dhcpnum = 0;
-
- foreach ($dhcpdcfg as $dhcpif => $dhcpifconf) {
-
- $ifcfg = $config['interfaces'][$dhcpif];
-
- if (!isset($dhcpifconf['enable']) ||
- ($ifcfg['ipaddr'] == "dhcp") ||
- (($dhcpif != "lan") &&
- (!isset($ifcfg['enable']) || !$ifcfg['if'] || $ifcfg['bridge'])))
- continue;
-
- if($dhcpif == "lan" && $ifcfg['bridge'])
- log_error("NOTE: DHCP Server on LAN is enabled.");
-
- $subnet = gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']);
- $subnetmask = gen_subnet_mask($ifcfg['subnet']);
-
- if($is_olsr_enabled == true)
- if($dhcpifconf['netmask'])
- $subnetmask = gen_subnet_mask($dhcpifconf['netmask']);
-
- $dnscfg = "";
-
- if ($dhcpifconf['domain']) {
- $dnscfg .= " option domain-name \"{$dhcpifconf['domain']}\";\n";
- }
- if (isset($dhcpifconf['ddnsupdate'])) {
- if($dhcpifconf['ddnsdomain'] <> "") {
- $dnscfg .= " ddns-domainname \"{$dhcpifconf['ddnsdomain']}\";\n";
- }
- $dnscfg .= " ddns-update-style interim;\n";
- }
-
-
- if (is_array($dhcpifconf['dnsserver']) && ($dhcpifconf['dnsserver'][0])) {
- $dnscfg .= " option domain-name-servers " . join(",", $dhcpifconf['dnsserver']) . ";";
- } else if (isset($config['dnsmasq']['enable'])) {
- $dnscfg .= " option domain-name-servers " . $ifcfg['ipaddr'] . ";";
- } else if (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
- $dnscfg .= " option domain-name-servers " . join(",", $syscfg['dnsserver']) . ";";
- }
-
- $dhcpdconf .= "subnet $subnet netmask $subnetmask {\n";
- $dhcpdconf .= " pool {\n";
-
- /* is failover dns setup? */
- if (is_array($dhcpifconf['dnsserver']) && $dhcpifconf['dnsserver'][0] <> "") {
- $dhcpdconf .= " option domain-name-servers {$dhcpifconf['dnsserver'][0]}";
- if($dhcpifconf['dnsserver'][1] <> "")
- $dhcpdconf .= ",{$dhcpifconf['dnsserver'][1]}";
- $dhcpdconf .= ";\n";
- }
-
- if($dhcpifconf['failover_peerip'] <> "")
- $dhcpdconf .= " deny dynamic bootp clients;\n";
-
- if (isset($dhcpifconf['denyunknown']))
- $dhcpdconf .= " deny unknown clients;\n";
-
- if ($dhcpifconf['gateway'])
- $routers = $dhcpifconf['gateway'];
- else
- $routers = $ifcfg['ipaddr'];
-
- if($dhcpifconf['failover_peerip'] <> "") {
- $dhcpdconf .= " failover peer \"dhcp{$dhcpnum}\";\n";
- $dhcpnum++;
- }
-
- $dhcpdconf .= <<<EOD
- range {$dhcpifconf['range']['from']} {$dhcpifconf['range']['to']};
- }
- option routers {$routers};
-$dnscfg
-
-EOD;
-
- if ($dhcpifconf['defaultleasetime'])
- $dhcpdconf .= " default-lease-time {$dhcpifconf['defaultleasetime']};\n";
- if ($dhcpifconf['maxleasetime'])
- $dhcpdconf .= " max-lease-time {$dhcpifconf['maxleasetime']};\n";
-
- if (is_array($dhcpifconf['winsserver']) && $dhcpifconf['winsserver'][0]) {
- $dhcpdconf .= " option netbios-name-servers " . join(",", $dhcpifconf['winsserver']) . ";\n";
- $dhcpdconf .= " option netbios-node-type 8;\n";
- }
-
- if (is_array($dhcpifconf['ntpserver']) && $dhcpifconf['ntpserver'][0])
- $dhcpdconf .= " option ntp-servers " . join(",", $dhcpifconf['ntpserver']) . ";\n";
-
- if(isset($dhcpifconf['netboot'])) {
- if (($dhcpifconf['next-server'] <> "") && ($dhcpifconf['filename'] <> "")) {
- $dhcpdconf .= " next-server {$dhcpifconf['next-server']};\n";
- $dhcpdconf .= " filename \"{$dhcpifconf['filename']}\";\n";
- }
- if ($dhcpifconf['rootpath'] <> "") {
- $dhcpdconf .= " option root-path \"{$dhcpifconf['rootpath']}\";\n";
- }
- }
- $dhcpdconf .= <<<EOD
-}
-
-EOD;
-
- /* add static mappings */
- if (is_array($dhcpifconf['staticmap'])) {
-
- $i = 0;
- foreach ($dhcpifconf['staticmap'] as $sm) {
- $dhcpdconf .= <<<EOD
-host s_{$dhcpif}_{$i} {
- hardware ethernet {$sm['mac']};
-
-EOD;
- if ($sm['ipaddr'])
- $dhcpdconf .= " fixed-address {$sm['ipaddr']};\n";
-
- $dhcpdconf .= "}\n";
- $i++;
- }
- }
-
- $dhcpdifs[] = $ifcfg['if'];
- }
-
- fwrite($fd, $dhcpdconf);
- fclose($fd);
-
- /* create an empty leases database */
- touch("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases");
-
- /* fire up dhcpd in a chroot */
- mwexec("/usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot {$g['dhcpd_chroot_path']} -cf {$g['dhcpd_chroot_path']}/etc/dhcpd.conf " .
- join(" ", $dhcpdifs));
-
- if ($g['booting']) {
- print "done.\n";
- }
-
- return 0;
-}
-
-function interfaces_staticarp_configure($if) {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "interfaces_staticarp_configure($if) being called $mt\n";
- }
-
- $ifcfg = $config['interfaces'][$if];
-
- /* Enable staticarp, if enabled */
- if(isset($config['dhcpd'][$if]['staticarp'])) {
- mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " staticarp " );
- mwexec("/usr/sbin/arp -ad > /dev/null 2>&1 ");
- if (is_array($config['dhcpd'][$if]['staticmap'])) {
-
- foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) {
- mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
- log_error("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
- }
-
- }
- } else {
- mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " -staticarp " );
- mwexec("/usr/sbin/arp -da > /dev/null 2>&1 ");
- }
-
- return 0;
-}
-
-function services_dhcrelay_configure() {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "services_dhcrelay_configure() being called $mt\n";
- }
-
- /* kill any running dhcrelay */
- killbypid("{$g['varrun_path']}/dhcrelay.pid");
-
- $dhcrelaycfg = $config['dhcrelay'];
-
- /* DHCPRelay enabled on any interfaces? */
- $dhcrelayenable = false;
- if(is_array($dhcrelaycfg)) {
- foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) {
- if (isset($dhcrelayifconf['enable']) &&
- (($dhcrelayif == "lan") ||
- (isset($config['interfaces'][$dhcrelayif]['enable']) &&
- $config['interfaces'][$dhcrelayif]['if'] && (!$config['interfaces'][$dhcrelayif]['bridge']))))
- $dhcrelayenable = true;
- }
- }
-
- if (!$dhcrelayenable)
- return 0;
-
- if ($g['booting'])
- echo "Starting DHCP relay service...";
- else
- sleep(1);
-
- $dhcrelayifs = array();
- foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) {
-
- $ifcfg = $config['interfaces'][$dhcrelayif];
-
- if (!isset($dhcrelayifconf['enable']) ||
- (($dhcrelayif != "lan") &&
- (!isset($ifcfg['enable']) || !$ifcfg['if'] || $ifcfg['bridge'])))
- continue;
-
- $dhcrelayifs[] = $ifcfg['if'];
- }
-
- /* In order for the relay to work, it needs to be active on the
- interface in which the destination server sits */
- foreach ($config['interfaces'] as $ifname) {
- $subnet = $ifname['ipaddr'] . "/" . $ifname['subnet'];
- if (ip_in_subnet($dhcrelaycfg['server'],$subnet))
- $destif = $ifname['if'];
- }
-
- if (!isset($destif))
- $destif = $config['interfaces']['wan']['if'];
-
- $dhcrelayifs[] = $destif;
- $dhcrelayifs = array_unique($dhcrelayifs);
-
- /* fire up dhcrelay */
- $cmd = "/usr/local/sbin/dhcrelay -i " . join(" -i ", $dhcrelayifs);
-
- if (isset($dhcrelaycfg['agentoption']))
- $cmd .= " -a -m replace";
-
- $cmd .= " {$dhcrelaycfg['server']}";
- mwexec($cmd);
-
- if (!$g['booting']) {
- /* set the reload filter dity flag */
- touch("{$g['tmp_path']}/filter_dirty");
- }
-
- return 0;
-}
-
-function services_dyndns_reset() {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "services_dyndns_reset() being called $mt\n";
- }
-
- if (file_exists("{$g['vardb_path']}/ez-ipupdate.cache")) {
- conf_mount_rw();
- unlink("{$g['vardb_path']}/ez-ipupdate.cache");
- conf_mount_ro();
- }
-
- if (file_exists("{$g['conf_path']}/ez-ipupdate.cache")) {
- conf_mount_rw();
- unlink("{$g['conf_path']}/ez-ipupdate.cache");
- conf_mount_ro();
- }
-
- if (file_exists("{$g['conf_path']}/dyndns.cache")) {
- conf_mount_rw();
- unlink("{$g['conf_path']}/dyndns.cache");
- conf_mount_ro();
- }
-
- return 0;
-}
-
-function services_dyndns_configure() {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "services_dyndns_configure() being called $mt\n";
- }
-
- $dyndnscfg = $config['dyndns'];
- $wancfg = $config['interfaces']['wan'];
-
- if (isset($dyndnscfg['enable'])) {
-
- if ($g['booting']) {
- echo "Starting DynDNS client...";
- if(isset($config['system']['use_old_dyndns'])) {
- echo " [Using ez-ipupdate] ";
- services_dyndns_configure_old();
- return;
- }
- } else {
- sleep(1);
- if(isset($config['system']['use_old_dyndns'])) {
- services_dyndns_configure_old();
- return;
- }
- }
-
- /* load up the dyndns.class */
- require_once("dyndns.class");
-
- log_error("DynDns: Running updatedns()");
-
- /* determine WAN interface name */
- $wanif = get_real_wan_interface();
- /* get ip */
- $ip = find_interface_ip($wanif);
-
- $dns = new updatedns($dnsService = $config['dyndns']['type'],
- $dnsHost = $config['dyndns']['host'],
- $dnsUser = $config['dyndns']['username'],
- $dnsPass = $config['dyndns']['password'],
- $dnsWilcard = $config['dyndns']['wildcard'],
- $dnsMX = $config['dyndns']['mx']);
-
- if ($g['booting'])
- echo "done.\n";
- }
-
- return 0;
-}
-
-function services_dyndns_configure_old() {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "services_dyndns_configure_old() being called $mt\n";
- }
-
- /* kill any running ez-ipupdate */
- /* ez-ipupdate needs SIGQUIT instead of SIGTERM */
- sigkillbypid("{$g['varrun_path']}/ez-ipupdate.pid", "QUIT");
-
- $dyndnscfg = $config['dyndns'];
- $wancfg = $config['interfaces']['wan'];
-
- if (isset($dyndnscfg['enable'])) {
-
- if ($g['booting'])
- echo "Starting DynDNS client...";
- else
- sleep(1);
-
- /* determine WAN interface name */
- $wanif = get_real_wan_interface();
-
- /* write ez-ipupdate.conf */
- $fd = fopen("{$g['varetc_path']}/ez-ipupdate.conf", "w");
- if (!$fd) {
- printf("Error: cannot open ez-ipupdate.conf in services_dyndns_configure().\n");
- return 1;
- }
-
- $ezipupdateconf = <<<EOD
-service-type={$dyndnscfg['type']}
-user={$dyndnscfg['username']}:{$dyndnscfg['password']}
-host={$dyndnscfg['host']}
-interface={$wanif}
-max-interval=2073600
-pid-file={$g['varrun_path']}/ez-ipupdate.pid
-cache-file={$g['vardb_path']}/ez-ipupdate.cache
-execute=/etc/rc.dyndns.storecache
-daemon
-
-EOD;
-
- /* enable server[:port]? */
- if ($dyndnscfg['server']) {
- if ($dyndnscfg['port'])
- $ezipupdateconf .= "server={$dyndnscfg['server']}:{$dyndnscfg['port']}\n";
- else
- $ezipupdateconf .= "server={$dyndnscfg['server']}\n";
- }
-
- /* enable MX? */
- if ($dyndnscfg['mx']) {
- $ezipupdateconf .= "mx={$dyndnscfg['mx']}\n";
- }
-
- /* enable wildcards? */
- if (isset($dyndnscfg['wildcard'])) {
- $ezipupdateconf .= "wildcard\n";
- }
-
- fwrite($fd, $ezipupdateconf);
- fclose($fd);
-
- /* if we're booting, copy the cache file from /conf */
- if ($g['booting']) {
- if (file_exists("{$g['conf_path']}/ez-ipupdate.cache")) {
- copy("{$g['conf_path']}/ez-ipupdate.cache", "{$g['vardb_path']}/ez-ipupdate.cache");
- }
- }
-
- /* run ez-ipupdate */
- mwexec("/usr/local/bin/ez-ipupdate -c {$g['varetc_path']}/ez-ipupdate.conf");
-
- if ($g['booting'])
- echo "done\n";
- }
-
- return 0;
-}
-
-function services_dnsmasq_configure() {
- global $config, $g;
- $return = 0;
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "services_dnsmasq_configure() being called $mt\n";
- }
-
- /* kill any running dnsmasq */
- sigkillbypid("{$g['varrun_path']}/dnsmasq.pid", "TERM");
-
- if (isset($config['dnsmasq']['enable'])) {
-
- if ($g['booting'])
- echo "Starting DNS forwarder...";
- else
- sleep(1);
-
- /* generate hosts file */
- if(system_hosts_generate()!=0)
- $return = 1;
-
- $args = "";
-
- if (isset($config['dnsmasq']['regdhcp'])) {
-
- $args .= " -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases" .
- " -s {$config['system']['domain']}";
- }
-
- if (isset($config['dnsmasq']['domainoverrides']) && is_array($config['dnsmasq']['domainoverrides'])) {
- foreach($config['dnsmasq']['domainoverrides'] as $override) {
- $args .= ' --server=/' . $override['domain'] . '/' . $override['ip'];
- }
- }
-
- /* suppose that dnsmasq handles our domain and don't send
- requests for our local domain to upstream servers */
- //if (!empty($config['system']['domain'])) {
- // $args .= sprintf(' --local=/%s/', $config['system']['domain']);
- //}
-
- /* run dnsmasq */
- mwexec("/usr/local/sbin/dnsmasq --all-servers {$args}");
-
- if ($g['booting'])
- echo "done.\n";
- }
-
- if (!$g['booting']) {
- if(services_dhcpd_configure()!=0)
- $return = 1;
- }
-
- return $return;
-}
-
-function services_snmpd_configure() {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "services_snmpd_configure() being called $mt\n";
- }
-
- /* kill any running snmpd */
- sigkillbypid("{$g['varrun_path']}/snmpd.pid", "TERM");
- if(is_process_running("bsnmpd"))
- mwexec("/usr/bin/killall bsnmpd", true);
-
- if (isset($config['snmpd']['enable'])) {
-
- if ($g['booting'])
- echo "Starting SNMP daemon... ";
-
- /* generate snmpd.conf */
- $fd = fopen("{$g['varetc_path']}/snmpd.conf", "w");
- if (!$fd) {
- printf("Error: cannot open snmpd.conf in services_snmpd_configure().\n");
- return 1;
- }
-
-
- $snmpdconf = <<<EOD
-location := "{$config['snmpd']['syslocation']}"
-contact := "{$config['snmpd']['syscontact']}"
-read := "{$config['snmpd']['rocommunity']}"
-
-EOD;
-
-/* No docs on what write strings do there for disable for now.
- if(isset($config['snmpd']['rwenable']) && preg_match('/^\S+$/', $config['snmpd']['rwcommunity'])){
- $snmpdconf .= <<<EOD
-# write string
-write := "{$config['snmpd']['rwcommunity']}"
-
-EOD;
- }
-*/
-
-
- if(isset($config['snmpd']['trapenable']) && preg_match('/^\S+$/', $config['snmpd']['trapserver'])){
- $snmpdconf .= <<<EOD
-# SNMP Trap support.
-traphost := {$config['snmpd']['trapserver']}
-trapport := {$config['snmpd']['trapserverport']}
-trap := "{$config['snmpd']['trapstring']}"
-
-
-EOD;
- }
-
-
- $snmpdconf .= <<<EOD
-system := 1 # pfSense
-%snmpd
-begemotSnmpdDebugDumpPdus = 2
-begemotSnmpdDebugSyslogPri = 7
-begemotSnmpdCommunityString.0.1 = $(read)
-
-EOD;
-
-/* No docs on what write strings do there for disable for now.
- if(isset($config['snmpd']['rwcommunity']) && preg_match('/^\S+$/', $config['snmpd']['rwcommunity'])){
- $snmpdconf .= <<<EOD
-begemotSnmpdCommunityString.0.2 = $(write)
-
-EOD;
- }
-*/
-
-
- if(isset($config['snmpd']['trapenable']) && preg_match('/^\S+$/', $config['snmpd']['trapserver'])){
- $snmpdconf .= <<<EOD
-begemotTrapSinkStatus.[$(traphost)].$(trapport) = 4
-begemotTrapSinkVersion.[$(traphost)].$(trapport) = 2
-begemotTrapSinkComm.[$(traphost)].$(trapport) = $(trap)
-
-EOD;
- }
-
-
- $snmpdconf .= <<<EOD
-begemotSnmpdCommunityDisable = 1
-
-EOD;
-
- if(isset($config['snmpd']['bindlan'])) {
- $bind_to_ip = $config['interfaces']['lan']['ipaddr'];
- } else {
- $bind_to_ip = "0.0.0.0";
- }
-
- if(is_port( $config['snmpd']['pollport'] )) {
- $snmpdconf .= <<<EOD
-begemotSnmpdPortStatus.{$bind_to_ip}.{$config['snmpd']['pollport']} = 1
-
-EOD;
-
- }
-
- $snmpdconf .= <<<EOD
-begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1
-begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4
-
-# These are bsnmp macros not php vars.
-sysContact = $(contact)
-sysLocation = $(location)
-sysObjectId = 1.3.6.1.4.1.12325.1.1.2.1.$(system)
-
-snmpEnableAuthenTraps = 2
-
-EOD;
-
- if (is_array( $config['snmpd']['modules'] )) {
- if(isset($config['snmpd']['modules']['mibii'])) {
- $snmpdconf .= <<<EOD
-begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so"
-
-EOD;
- }
-
- if(isset($config['snmpd']['modules']['netgraph'])) {
- $snmpdconf .= <<<EOD
-begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so"
-%netgraph
-begemotNgControlNodeName = "snmpd"
-
-EOD;
- }
-
- if(isset($config['snmpd']['modules']['pf'])) {
- $snmpdconf .= <<<EOD
-begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so"
-
-EOD;
- }
-
- if(isset($config['snmpd']['modules']['hostres'])) {
- $snmpdconf .= <<<EOD
-begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so"
-
-EOD;
- }
- if(isset($config['snmpd']['modules']['bridge'])) {
- $snmpdconf .= <<<EOD
-begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so"
-# config must end with blank line
-
-
-EOD;
- }
- }
-
- fwrite($fd, $snmpdconf);
- fclose($fd);
-
- if (isset($config['snmpd']['bindlan'])) {
- $bindlan = "";
- }
-
- /* run bsnmpd */
- mwexec("/usr/sbin/bsnmpd -c {$g['varetc_path']}/snmpd.conf" .
- "{$bindlan} -p {$g['varrun_path']}/snmpd.pid");
-
- if ($g['booting'])
- echo "done.\n";
- }
-
- return 0;
-}
-
-function services_proxyarp_configure() {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "services_proxyarp_configure() being called $mt\n";
- }
-
- /* kill any running choparp */
- killbyname("choparp");
-
- if (isset($config['virtualip']) && is_array($config['virtualip']['vip'])) {
- $paa = array();
-
- /* group by interface */
- foreach ($config['virtualip']['vip'] as $vipent) {
- if ($vipent['mode'] === "proxyarp") {
- if ($vipent['interface'])
- $if = $vipent['interface'];
- else
- $if = "wan";
-
- if (!is_array($paa[$if]))
- $paa[$if] = array();
-
- $paa[$if][] = $vipent;
- }
- }
-
- if (count($paa))
- foreach ($paa as $paif => $paents) {
- if ($paif == "wan" && !(is_ipaddr($config['interfaces']['wan']['ipaddr']) ||
- ($config['interfaces']['wan']['ipaddr'] == "dhcp") ||
- ($config['interfaces']['wan']['ipaddr'] == "bigpond")))
- continue;
-
- $args = $config['interfaces'][$paif]['if'] . " auto";
-
- foreach ($paents as $paent) {
-
- if (isset($paent['subnet']))
- $args .= " " . escapeshellarg("{$paent['subnet']}/{$paent['subnet_bits']}");
- else if (isset($paent['range']))
- $args .= " " . escapeshellarg($paent['range']['from'] . "-" .
- $paent['range']['to']);
- }
-
- mwexec_bg("/usr/local/sbin/choparp " . $args);
- }
- }
-}
-
-function services_dnsupdate_process() {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "services_dnsupdate_process() being called $mt\n";
- }
-
- /* Dynamic DNS updating active? */
- if (isset($config['dnsupdate']['enable'])) {
-
- $wanip = get_current_wan_address();
- if ($wanip) {
-
- $keyname = $config['dnsupdate']['keyname'];
- /* trailing dot */
- if (substr($keyname, -1) != ".")
- $keyname .= ".";
-
- $hostname = $config['dnsupdate']['host'];
- /* trailing dot */
- if (substr($hostname, -1) != ".")
- $hostname .= ".";
-
- /* write private key file
- this is dumb - public and private keys are the same for HMAC-MD5,
- but nsupdate insists on having both */
- $fd = fopen("{$g['varetc_path']}/K{$keyname}+157+00000.private", "w");
- $privkey .= <<<EOD
-Private-key-format: v1.2
-Algorithm: 157 (HMAC)
-Key: {$config['dnsupdate']['keydata']}
-
-EOD;
- fwrite($fd, $privkey);
- fclose($fd);
-
- /* write public key file */
- if ($config['dnsupdate']['keytype'] == "zone") {
- $flags = 257;
- $proto = 3;
- } else if ($config['dnsupdate']['keytype'] == "host") {
- $flags = 513;
- $proto = 3;
- } else if ($config['dnsupdate']['keytype'] == "user") {
- $flags = 0;
- $proto = 2;
- }
-
- $fd = fopen("{$g['varetc_path']}/K{$keyname}+157+00000.key", "w");
- fwrite($fd, "{$keyname} IN KEY {$flags} {$proto} 157 {$config['dnsupdate']['keydata']}\n");
- fclose($fd);
-
- /* generate update instructions */
- $upinst = "";
- if ($config['dnsupdate']['server'])
- $upinst .= "server {$config['dnsupdate']['server']}\n";
- $upinst .= "update delete {$config['dnsupdate']['host']} A\n";
- $upinst .= "update add {$config['dnsupdate']['host']} {$config['dnsupdate']['ttl']} A {$wanip}\n";
- $upinst .= "\n"; /* mind that trailing newline! */
-
- $fd = fopen("{$g['varetc_path']}/nsupdatecmds", "w");
- fwrite($fd, $upinst);
- fclose($fd);
-
- /* invoke nsupdate */
- $cmd = "/usr/bin/nsupdate -k {$g['varetc_path']}/K{$keyname}+157+00000.key";
- if (isset($config['dnsupdate']['usetcp']))
- $cmd .= " -v";
- $cmd .= " {$g['varetc_path']}/nsupdatecmds";
-
- mwexec_bg($cmd);
- }
- }
-
- return 0;
-}
-
-function setup_wireless_olsr() {
- global $config, $g;
- if(!$config['installedpackages']['olsrd'] || !$config['installedpackages'])
- return;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "setup_wireless_olsr($interface) being called $mt\n";
- }
- conf_mount_rw();
- foreach($config['installedpackages']['olsrd']['config'] as $olsrd) {
- $olsr_enable = $olsrd['enable'];
- if($olsr_enable <> "on")
- return;
- $fd = fopen("{$g['varetc_path']}/olsr.conf", "w");
-
- if($olsrd['announcedynamicroute'] or $olsrd['enableannounce'] == "on") {
- $enableannounce .= "\nHna4\n";
- $enableannounce .= "{\n";
- if($olsrd['announcedynamicroute'])
- $enableannounce .= "\t{$olsrd['announcedynamicroute']}\n";
- if($olsrd['enableannounce'] == "on")
- $enableannounce .= "0.0.0.0 0.0.0.0";
- $enableannounce .= "\n}\n";
- } else {
- $enableannounce = "";
- }
-
- $olsr .= <<<EODA
-#
-# olsr.org OLSR daemon config file
-#
-# Lines starting with a # are discarded
-#
-# This file was generated by setup_wireless_olsr() in services.inc
-#
-
-# This file is an example of a typical
-# configuration for a mostly static
-# network(regarding mobility) using
-# the LQ extention
-
-# Debug level(0-9)
-# If set to 0 the daemon runs in the background
-
-DebugLevel 2
-
-# IP version to use (4 or 6)
-
-IpVersion 4
-
-# Clear the screen each time the internal state changes
-
-ClearScreen yes
-
-{$enableannounce}
-
-# Should olsrd keep on running even if there are
-# no interfaces available? This is a good idea
-# for a PCMCIA/USB hotswap environment.
-# "yes" OR "no"
-
-AllowNoInt yes
-
-# TOS(type of service) value for
-# the IP header of control traffic.
-# If not set it will default to 16
-
-#TosValue 16
-
-# The fixed willingness to use(0-7)
-# If not set willingness will be calculated
-# dynamically based on battery/power status
-# if such information is available
-
-#Willingness 4
-
-# Allow processes like the GUI front-end
-# to connect to the daemon.
-
-IpcConnect
-{
- # Determines how many simultaneously
- # IPC connections that will be allowed
- # Setting this to 0 disables IPC
-
- MaxConnections 0
-
- # By default only 127.0.0.1 is allowed
- # to connect. Here allowed hosts can
- # be added
-
- Host 127.0.0.1
- #Host 10.0.0.5
-
- # You can also specify entire net-ranges
- # that are allowed to connect. Multiple
- # entries are allowed
-
- #Net 192.168.1.0 255.255.255.0
-}
-
-# Wether to use hysteresis or not
-# Hysteresis adds more robustness to the
-# link sensing but delays neighbor registration.
-# Used by default. 'yes' or 'no'
-
-UseHysteresis no
-
-# Hysteresis parameters
-# Do not alter these unless you know
-# what you are doing!
-# Set to auto by default. Allowed
-# values are floating point values
-# in the interval 0,1
-# THR_LOW must always be lower than
-# THR_HIGH.
-
-#HystScaling 0.50
-#HystThrHigh 0.80
-#HystThrLow 0.30
-
-
-# Link quality level
-# 0 = do not use link quality
-# 1 = use link quality for MPR selection
-# 2 = use link quality for MPR selection and routing
-# Defaults to 0
-
-LinkQualityLevel {$olsrd['enablelqe']}
-
-# Link quality window size
-# Defaults to 10
-
-LinkQualityWinSize 10
-
-# Polling rate in seconds(float).
-# Default value 0.05 sec
-
-Pollrate 0.05
-
-
-# TC redundancy
-# Specifies how much neighbor info should
-# be sent in TC messages
-# Possible values are:
-# 0 - only send MPR selectors
-# 1 - send MPR selectors and MPRs
-# 2 - send all neighbors
-#
-# defaults to 0
-
-TcRedundancy 2
-
-#
-# MPR coverage
-# Specifies how many MPRs a node should
-# try select to reach every 2 hop neighbor
-#
-# Can be set to any integer >0
-#
-# defaults to 1
-
-MprCoverage 3
-
-# Example plugin entry with parameters:
-
-EODA;
-
-if($olsrd['enablehttpinfo'] == "on") {
- $olsr .= <<<EODB
-
-LoadPlugin "/usr/local/lib/olsrd_httpinfo.so.0.1"
-{
- PlParam "port" "{$olsrd['port']}"
- PlParam "Net" "{$olsrd['allowedhttpinfohost']} {$olsrd['allowedhttpinfosubnet']}"
-}
-
-EODB;
-
-}
-
-if($olsrd['enabledsecure'] == "on") {
- $olsr .= <<<EODC
-
-LoadPlugin "/usr/local/lib/olsrd_secure.so.0.5"
-{
- PlParam "Keyfile" "/usr/local/etc/olsrkey.txt"
-}
-
-EODC;
-
-}
-
-if($olsrd['enabledyngw'] == "on") {
-
- /* unset default route, olsr auto negotiates */
- mwexec("/sbin/route delete default");
-
- $olsr .= <<<EODE
-
-LoadPlugin "/usr/local/lib/olsrd_dyn_gw.so.0.4"
-{
- # how often to look for a inet gw, in seconds
- # defaults to 5 secs, if commented out
- PlParam "Interval" "{$olsrd['polling']}"
-
- # if one or more IPv4 addresses are given, do a ping on these in
- # descending order to validate that there is not only an entry in
- # routing table, but also a real internet connection. If any of
- # these addresses could be pinged successfully, the test was
- # succesful, i.e. if the ping on the 1st address was successful,the
- # 2nd won't be pinged
- PlParam "Ping" "{$olsrd['ping']}"
- #PlParam "HNA" "192.168.81.0 255.255.255.0"
-}
-
-EODE;
-
-}
-
-foreach($config['installedpackages']['olsrd']['config'] as $conf) {
- $interfaces = explode(',', $conf['iface_array']);
- foreach($interfaces as $interface) {
- $realinterface = convert_friendly_interface_to_real_interface_name($interface);
-$olsr .= <<<EODAD
-Interface "{$realinterface}"
-{
-
- # Hello interval in seconds(float)
- HelloInterval 2.0
-
- # HELLO validity time
- HelloValidityTime 20.0
-
- # TC interval in seconds(float)
- TcInterval 5.0
-
- # TC validity time
- TcValidityTime 30.0
-
- # MID interval in seconds(float)
- MidInterval 5.0
-
- # MID validity time
- MidValidityTime 30.0
-
- # HNA interval in seconds(float)
- HnaInterval 5.0
-
- # HNA validity time
- HnaValidityTime 30.0
-
- # When multiple links exist between hosts
- # the weight of interface is used to determine
- # the link to use. Normally the weight is
- # automatically calculated by olsrd based
- # on the characteristics of the interface,
- # but here you can specify a fixed value.
- # Olsrd will choose links with the lowest value.
-
- # Weight 0
-
-
-}
-
-EODAD;
-
- }
- break;
-}
- fwrite($fd, $olsr);
- fclose($fd);
- }
-
- if(is_process_running("olsrd"))
- mwexec("/usr/bin/killall olsrd", true);
-
- sleep(2);
-
- mwexec_bg("/usr/local/sbin/olsrd -f {$g['varetc_path']}/olsr.conf");
-
- conf_mount_ro();
-}
-
-/* configure cron service */
-function configure_cron() {
- global $g, $config;
- conf_mount_rw();
- /* preserve existing crontab entries */
- $crontab_contents = file_get_contents("/etc/crontab");
- $crontab_contents_a = split("\n", $crontab_contents);
-
- for ($i = 0; $i < count($crontab_contents_a); $i++) {
- $item =& $crontab_contents_a[$i];
- if (strpos($item, "# pfSense specific crontab entries") !== false) {
- array_splice($crontab_contents_a, $i - 1);
- break;
- }
- }
- $crontab_contents = implode("\n", $crontab_contents_a) . "\n";
-
-
- if (is_array($config['cron']['item'])) {
- $crontab_contents .= "#\n";
- $crontab_contents .= "# pfSense specific crontab entries\n";
- $crontab_contents .= "# Created: " . date("F j, Y, g:i a") . "\n";
- $crontab_contents .= "#\n";
-
- foreach ($config['cron']['item'] as $item) {
- $crontab_contents .= "\n{$item['minute']}\t";
- $crontab_contents .= "{$item['hour']}\t";
- $crontab_contents .= "{$item['mday']}\t";
- $crontab_contents .= "{$item['month']}\t";
- $crontab_contents .= "{$item['wday']}\t";
- $crontab_contents .= "{$item['who']}\t";
- $crontab_contents .= "{$item['command']}";
- }
-
- $crontab_contents .= "\n#\n";
- $crontab_contents .= "# If possible do not add items to this file manually.\n";
- $crontab_contents .= "# If you do so, this file must be terminated with a blank line (e.g. new line)\n";
- $crontab_contents .= "#\n\n";
- }
-
- /* please maintain the newline at the end of file */
- file_put_contents("/etc/crontab", $crontab_contents);
-
- if (!$g['booting'])
- conf_mount_ro();
-}
-
-function upnp_action ($action) {
- switch($action) {
- case "start":
- if(file_exists('/var/etc/miniupnpd.conf'))
- mwexec_bg('/usr/local/sbin/miniupnpd -f /var/etc/miniupnpd.conf');
- break;
- case "stop":
- while((int)exec("pgrep miniupnpd | wc -l") > 0)
- mwexec('killall miniupnpd 2>/dev/null', true);
- mwexec('/sbin/pfctl -aminiupnpd -Fr 2>&1 >/dev/null');
- mwexec('/sbin/pfctl -aminiupnpd -Fn 2>&1 >/dev/null');
- break;
- case "restart":
- upnp_action('stop');
- upnp_action('start');
- break;
- }
-}
-
-function upnp_start() {
- global $config, $g;
- if($config['installedpackages']['miniupnpd']['config'][0]['enable']) {
- if($g['booting']) {
- echo "Starting UPnP service...";
- include('/usr/local/pkg/miniupnpd.inc');
- sync_package_miniupnpd();
- echo "done.\n";
- }
- else {
- upnp_action('start');
- }
- }
-}
-
-?>
diff --git a/config/Fit123/bin/ltsp/services_dhcp.abc b/config/Fit123/bin/ltsp/services_dhcp.abc
deleted file mode 100755
index 7a203491..00000000
--- a/config/Fit123/bin/ltsp/services_dhcp.abc
+++ /dev/null
@@ -1,696 +0,0 @@
-<?php
-/* $Id$ */
-/*
- services_dhcp.php
- part of m0n0wall (http://m0n0.ch/wall)
-
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-
-/* Fix failover DHCP problem
- * http://article.gmane.org/gmane.comp.security.firewalls.pfsense.support/18749
- */
-ini_set("memory_limit","64M");
-
-/* This function will remove entries from dhcpd.leases that would otherwise
- * overlap with static DHCP reservations. If we don't clean these out,
- * then DHCP will print a warning in the logs about a duplicate lease
- */
-function dhcp_clean_leases() {
- global $g, $config;
- $leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases";
- if (!file_exists($leasesfile))
- return;
- /* Build list of static MACs */
- $staticmacs = array();
- foreach($config['interfaces'] as $ifname => $ifarr)
- if (is_array($config['dhcpd'][$ifname]['staticmap']))
- foreach($config['dhcpd'][$ifname]['staticmap'] as $static)
- $staticmacs[] = $static['mac'];
- /* Read existing leases */
- $leases_contents = explode("\n", file_get_contents($leasesfile));
- $newleases_contents = array();
- $i=0;
- while ($i < count($leases_contents)) {
- /* Find a lease definition */
- if (substr($leases_contents[$i], 0, 6) == "lease ") {
- $templease = array();
- $thismac = "";
- /* Read to the end of the lease declaration */
- do {
- if (substr($leases_contents[$i], 0, 20) == " hardware ethernet ")
- $thismac = substr($leases_contents[$i], 20, 17);
- $templease[] = $leases_contents[$i];
- $i++;
- } while ($leases_contents[$i-1] != "}");
- /* Check for a matching MAC address and if not present, keep it. */
- if (! in_array($thismac, $staticmacs))
- $newleases_contents = array_merge($newleases_contents, $templease);
- } else {
- /* It's a line we want to keep, copy it over. */
- $newleases_contents[] = $leases_contents[$i];
- $i++;
- }
- }
- /* Write out the new leases file */
- $fd = fopen($leasesfile, 'w');
- fwrite($fd, implode("\n", $newleases_contents));
- fclose($fd);
-}
-
-$if = $_GET['if'];
-if ($_POST['if'])
- $if = $_POST['if'];
-
-/* if OLSRD is enabled, allow WAN to house DHCP. */
-if($config['installedpackages']['olsrd']) {
- foreach($config['installedpackages']['olsrd']['config'] as $olsrd) {
- if($olsrd['enable']) {
- $iflist = array("lan" => "LAN", "wan" => "WAN");
- $is_olsr_enabled = true;
- break;
- }
- }
-}
-
-if(!$iflist)
- $iflist = array("lan" => "LAN");
-
-for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $oc = $config['interfaces']['opt' . $i];
-
- if (isset($oc['enable']) && $oc['if'] && (!$oc['bridge'])) {
- $iflist['opt' . $i] = $oc['descr'];
- }
-}
-
-if (!$if || !isset($iflist[$if]))
- $if = "lan";
-
-$pconfig['range_from'] = $config['dhcpd'][$if]['range']['from'];
-$pconfig['range_to'] = $config['dhcpd'][$if]['range']['to'];
-$pconfig['deftime'] = $config['dhcpd'][$if]['defaultleasetime'];
-$pconfig['maxtime'] = $config['dhcpd'][$if]['maxleasetime'];
-$pconfig['gateway'] = $config['dhcpd'][$if]['gateway'];
-list($pconfig['wins1'],$pconfig['wins2']) = $config['dhcpd'][$if]['winsserver'];
-list($pconfig['dns1'],$pconfig['dns2']) = $config['dhcpd'][$if]['dnsserver'];
-$pconfig['enable'] = isset($config['dhcpd'][$if]['enable']);
-$pconfig['denyunknown'] = isset($config['dhcpd'][$if]['denyunknown']);
-$pconfig['staticarp'] = isset($config['dhcpd'][$if]['staticarp']);
-$pconfig['ddnsdomain'] = $config['dhcpd'][$if]['ddnsdomain'];
-$pconfig['ddnsupdate'] = isset($config['dhcpd'][$if]['ddnsupdate']);
-list($pconfig['ntp1'],$pconfig['ntp2']) = $config['dhcpd'][$if]['ntpserver'];
-$pconfig['netboot'] = isset($config['dhcpd'][$if]['netboot']);
-$pconfig['nextserver'] = $config['dhcpd'][$if]['next-server'];
-$pconfig['filename'] = $config['dhcpd'][$if]['filename'];
-$pconfig['rootpath'] = $config['dhcpd'][$if]['rootpath'];
-$pconfig['failover_peerip'] = $config['dhcpd'][$if]['failover_peerip'];
-$pconfig['netmask'] = $config['dhcpd'][$if]['netmask'];
-
-$ifcfg = $config['interfaces'][$if];
-
-/* set the enabled flag which will tell us if DHCP relay is enabled
- * on any interface. We will use this to disable DHCP server since
- * the two are not compatible with each other.
- */
-
-$dhcrelay_enabled = false;
-$dhcrelaycfg = $config['dhcrelay'];
-
-if(is_array($dhcrelaycfg)) {
- foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) {
- if (isset($dhcrelayifconf['enable']) &&
- (($dhcrelayif == "lan") ||
- (isset($config['interfaces'][$dhcrelayif]['enable']) &&
- $config['interfaces'][$dhcrelayif]['if'] && (!$config['interfaces'][$dhcrelayif]['bridge']))))
- $dhcrelay_enabled = true;
- }
-}
-
-
-if (!is_array($config['dhcpd'][$if]['staticmap'])) {
- $config['dhcpd'][$if]['staticmap'] = array();
-}
-staticmaps_sort($if);
-$a_maps = &$config['dhcpd'][$if]['staticmap'];
-
-function is_inrange($test, $start, $end) {
- if ( (ip2long($test) < ip2long($end)) && (ip2long($test) > ip2long($start)) )
- return true;
- else
- return false;
-}
-
-if ($_POST) {
-
- unset($input_errors);
-
- $pconfig = $_POST;
-
- /* input validation */
- if ($_POST['enable']) {
- $reqdfields = explode(" ", "range_from range_to");
- $reqdfieldsn = explode(",", "Range begin,Range end");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- foreach($a_maps as $mapent) {
- if(is_inrange($mapent['ipaddr'], $_POST['range_from'], $_POST['range_to'])) {
- $input_errors[] = "{$mapent['ipaddr']} is inside the range you specified.";
- }
-
- }
-
- if (($_POST['range_from'] && !is_ipaddr($_POST['range_from']))) {
- $input_errors[] = "A valid range must be specified.";
- }
- if (($_POST['range_to'] && !is_ipaddr($_POST['range_to']))) {
- $input_errors[] = "A valid range must be specified.";
- }
- if (($_POST['gateway'] && !is_ipaddr($_POST['gateway']))) {
- $input_errors[] = "A valid IP address must be specified for the gateway.";
- }
- if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2']))) {
- $input_errors[] = "A valid IP address must be specified for the primary/secondary WINS servers.";
- }
- if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) {
- $input_errors[] = "A valid IP address must be specified for the primary/secondary DNS servers.";
- }
- if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60))) {
- $input_errors[] = "The default lease time must be at least 60 seconds.";
- }
- if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime']))) {
- $input_errors[] = "The maximum lease time must be at least 60 seconds and higher than the default lease time.";
- }
- if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain']))) {
- $input_errors[] = "A valid domain name must be specified for the dynamic DNS registration.";
- }
- if (($_POST['ntp1'] && !is_ipaddr($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddr($_POST['ntp2']))) {
- $input_errors[] = "A valid IP address must be specified for the primary/secondary NTP servers.";
- }
- if (($_POST['nextserver'] && !is_ipaddr($_POST['nextserver']))) {
- $input_errors[] = "A valid IP address must be specified for the network boot server.";
- }
-
-
- if (!$input_errors) {
- /* make sure the range lies within the current subnet */
- $subnet_start = (ip2long($ifcfg['ipaddr']) & gen_subnet_mask_long($ifcfg['subnet']));
- $subnet_end = (ip2long($ifcfg['ipaddr']) | (~gen_subnet_mask_long($ifcfg['subnet'])));
-
- if ((ip2long($_POST['range_from']) < $subnet_start) || (ip2long($_POST['range_from']) > $subnet_end) ||
- (ip2long($_POST['range_to']) < $subnet_start) || (ip2long($_POST['range_to']) > $subnet_end)) {
- $input_errors[] = "The specified range lies outside of the current subnet.";
- }
-
- if (ip2long($_POST['range_from']) > ip2long($_POST['range_to']))
- $input_errors[] = "The range is invalid (first element higher than second element).";
-
- /* make sure that the DHCP Relay isn't enabled on this interface */
- if (isset($config['dhcrelay'][$if]['enable']))
- $input_errors[] = "You must disable the DHCP relay on the {$iflist[$if]} interface before enabling the DHCP server.";
- }
- }
-
- if (!$input_errors) {
- $config['dhcpd'][$if]['range']['from'] = $_POST['range_from'];
- $config['dhcpd'][$if]['range']['to'] = $_POST['range_to'];
- $config['dhcpd'][$if]['defaultleasetime'] = $_POST['deftime'];
- $config['dhcpd'][$if]['maxleasetime'] = $_POST['maxtime'];
- $config['dhcpd'][$if]['netmask'] = $_POST['netmask'];
- $previous = $config['dhcpd'][$if]['failover_peerip'];
- if($previous <> $_POST['failover_peerip']) {
- mwexec("rm -rf /var/dhcpd/var/db/*");
- }
- $config['dhcpd'][$if]['failover_peerip'] = $_POST['failover_peerip'];
-
- unset($config['dhcpd'][$if]['winsserver']);
- if ($_POST['wins1'])
- $config['dhcpd'][$if]['winsserver'][] = $_POST['wins1'];
- if ($_POST['wins2'])
- $config['dhcpd'][$if]['winsserver'][] = $_POST['wins2'];
-
- unset($config['dhcpd'][$if]['dnsserver']);
- if ($_POST['dns1'])
- $config['dhcpd'][$if]['dnsserver'][] = $_POST['dns1'];
- if ($_POST['dns2'])
- $config['dhcpd'][$if]['dnsserver'][] = $_POST['dns2'];
-
- $config['dhcpd'][$if]['gateway'] = $_POST['gateway'];
- $config['dhcpd'][$if]['denyunknown'] = ($_POST['denyunknown']) ? true : false;
- $config['dhcpd'][$if]['enable'] = ($_POST['enable']) ? true : false;
- $config['dhcpd'][$if]['staticarp'] = ($_POST['staticarp']) ? true : false;
- $config['dhcpd'][$if]['ddnsdomain'] = $_POST['ddnsdomain'];
- $config['dhcpd'][$if]['ddnsupdate'] = ($_POST['ddnsupdate']) ? true : false;
-
- unset($config['dhcpd'][$if]['ntpserver']);
- if ($_POST['ntp1'])
- $config['dhcpd'][$if]['ntpserver'][] = $_POST['ntp1'];
- if ($_POST['ntp2'])
- $config['dhcpd'][$if]['ntpserver'][] = $_POST['ntp2'];
-
- $config['dhcpd'][$if]['netboot'] = ($_POST['netboot']) ? true : false;
- $config['dhcpd'][$if]['next-server'] = $_POST['nextserver'];
- $config['dhcpd'][$if]['filename'] = $_POST['filename'];
- $config['dhcpd'][$if]['rootpath'] = $_POST['rootpath'];
-
- write_config();
-
- /* static arp configuration */
- interfaces_staticarp_configure($if);
-
- $retval = 0;
- $retvaldhcp = 0;
- $retvaldns = 0;
- config_lock();
- /* Stop DHCP so we can cleanup leases */
- killbyname("dhcpd");
- dhcp_clean_leases();
- /* dnsmasq_configure calls dhcpd_configure */
- /* no need to restart dhcpd twice */
- if (isset($config['dnsmasq']['regdhcpstatic'])) {
- $retvaldns = services_dnsmasq_configure();
- if ($retvaldns == 0) {
- if (file_exists($d_hostsdirty_path))
- unlink($d_hostsdirty_path);
- if (file_exists($d_staticmapsdirty_path))
- unlink($d_staticmapsdirty_path);
- }
- } else {
- $retvaldhcp = services_dhcpd_configure();
- if ($retvaldhcp == 0) {
- if (file_exists($d_staticmapsdirty_path))
- unlink($d_staticmapsdirty_path);
- }
- }
- config_unlock();
- if($retvaldhcp == 1 || $retvaldns == 1)
- $retval = 1;
- $savemsg = get_std_save_message($retval);
- }
-}
-
-if ($_GET['act'] == "del") {
- if ($a_maps[$_GET['id']]) {
- unset($a_maps[$_GET['id']]);
- write_config();
- if(isset($config['dhcpd'][$if]['enable'])) {
- touch($d_staticmapsdirty_path);
- if (isset($config['dnsmasq']['regdhcpstatic']))
- touch($d_hostsdirty_path);
- }
- header("Location: services_dhcp.php?if={$if}");
- exit;
- }
-}
-
-$pgtitle = "Services: DHCP server";
-include("head.inc");
-
-?>
-
-<script type="text/javascript" language="JavaScript">
-
-function enable_change(enable_over) {
- var endis;
- endis = !(document.iform.enable.checked || enable_over);
- document.iform.range_from.disabled = endis;
- document.iform.range_to.disabled = endis;
- document.iform.wins1.disabled = endis;
- document.iform.wins2.disabled = endis;
- document.iform.dns1.disabled = endis;
- document.iform.dns2.disabled = endis;
- document.iform.deftime.disabled = endis;
- document.iform.maxtime.disabled = endis;
- document.iform.gateway.disabled = endis;
- document.iform.failover_peerip.disabled = endis;
- document.iform.staticarp.disabled = endis;
- document.iform.ddnsdomain.disabled = endis;
- document.iform.ddnsupdate.disabled = endis;
- document.iform.ntp1.disabled = endis;
- document.iform.ntp2.disabled = endis;
- document.iform.netboot.disabled = endis;
- document.iform.nextserver.disabled = endis;
- document.iform.filename.disabled = endis;
- document.iform.rootpath.disabled = endis;
- document.iform.denyunknown.disabled = endis;
-}
-
-function show_ddns_config() {
- document.getElementById("showddnsbox").innerHTML='';
- aodiv = document.getElementById('showddns');
- aodiv.style.display = "block";
-}
-
-function show_ntp_config() {
- document.getElementById("showntpbox").innerHTML='';
- aodiv = document.getElementById('showntp');
- aodiv.style.display = "block";
-}
-
-function show_netboot_config() {
- document.getElementById("shownetbootbox").innerHTML='';
- aodiv = document.getElementById('shownetboot');
- aodiv.style.display = "block";
-}
-
-</script>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<form action="services_dhcp.php" method="post" name="iform" id="iform">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<?php
- if ($dhcrelay_enabled) {
- echo "DHCP Relay is currently enabled. Cannot enable the DHCP Server service while the DHCP Relay is enabled on any interface.";
- include("fend.inc");
- echo "</body>";
- echo "</html>";
- exit;
- }
-?>
-<?php if (file_exists($d_staticmapsdirty_path)): ?><p>
-<?php print_info_box_np("The static mapping configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
-<?php endif; ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
- <?php
- /* active tabs */
- $tab_array = array();
- $tabscounter = 0;
- $i = 0;
- foreach ($iflist as $ifent => $ifname) {
- if ($ifent == $if)
- $active = true;
- else
- $active = false;
- $tab_array[] = array($ifname, $active, "services_dhcp.php?if={$ifent}");
- }
- display_top_tabs($tab_array);
- ?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vtable">&nbsp;</td>
- <td width="78%" class="vtable">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
- <strong>Enable DHCP server on
- <?=htmlspecialchars($iflist[$if]);?>
- interface</strong></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vtable">&nbsp;</td>
- <td width="78%" class="vtable">
- <input name="denyunknown" id="denyunknown" type="checkbox" value="yes" <?php if ($pconfig['denyunknown']) echo "checked"; ?>>
- <strong>Deny unknown clients</strong><br>
- If this is checked, only the clients defined below will get DHCP leases from this server. </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Subnet</td>
- <td width="78%" class="vtable">
- <?=gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']);?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Subnet
- mask</td>
- <td width="78%" class="vtable">
- <?=gen_subnet_mask($ifcfg['subnet']);?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Available
- range</td>
- <td width="78%" class="vtable">
- <?=long2ip(ip2long($ifcfg['ipaddr']) & gen_subnet_mask_long($ifcfg['subnet']));?>
- -
- <?=long2ip(ip2long($ifcfg['ipaddr']) | (~gen_subnet_mask_long($ifcfg['subnet']))); ?>
- </td>
- </tr>
- <?php if($is_olsr_enabled): ?>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Subnet Mask</td>
- <td width="78%" class="vtable">
- <select name="netmask" class="formfld" id="netmask">
- <?php
- for ($i = 32; $i > 0; $i--) {
- if($i <> 31) {
- echo "<option value=\"{$i}\" ";
- if ($i == $pconfig['netmask']) echo "selected";
- echo ">" . $i . "</option>";
- }
- }
- ?>
- </select>
- </td>
- </tr>
- <?php endif; ?>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Range</td>
- <td width="78%" class="vtable">
- <input name="range_from" type="text" class="formfld" id="range_from" size="20" value="<?=htmlspecialchars($pconfig['range_from']);?>">
- &nbsp;to&nbsp; <input name="range_to" type="text" class="formfld" id="range_to" size="20" value="<?=htmlspecialchars($pconfig['range_to']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">WINS servers</td>
- <td width="78%" class="vtable">
- <input name="wins1" type="text" class="formfld" id="wins1" size="20" value="<?=htmlspecialchars($pconfig['wins1']);?>"><br>
- <input name="wins2" type="text" class="formfld" id="wins2" size="20" value="<?=htmlspecialchars($pconfig['wins2']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">DNS servers</td>
- <td width="78%" class="vtable">
- <input name="dns1" type="text" class="formfld" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>"><br>
- <input name="dns2" type="text" class="formfld" id="dns2" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>"><br>
- NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Gateway</td>
- <td width="78%" class="vtable">
- <input name="gateway" type="text" class="formfld" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>"><br>
- The default is to use the IP on this interface of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Default lease
- time</td>
- <td width="78%" class="vtable">
- <input name="deftime" type="text" class="formfld" id="deftime" size="10" value="<?=htmlspecialchars($pconfig['deftime']);?>">
- seconds<br>
- This is used for clients that do not ask for a specific
- expiration time.<br>
- The default is 7200 seconds.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Maximum lease
- time</td>
- <td width="78%" class="vtable">
- <input name="maxtime" type="text" class="formfld" id="maxtime" size="10" value="<?=htmlspecialchars($pconfig['maxtime']);?>">
- seconds<br>
- This is the maximum lease time for clients that ask
- for a specific expiration time.<br>
- The default is 86400 seconds.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Failover peer IP:</td>
- <td width="78%" class="vtable">
- <input name="failover_peerip" type="text" class="formfld" id="failover_peerip" size="20" value="<?=htmlspecialchars($pconfig['failover_peerip']);?>"><br>
- Leave blank to disable. Enter the REAL address of the other machine. Machines must be using CARP.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Static ARP</td>
- <td width="78%" class="vtable">
- <table>
- <tr>
- <td>
- <input valign="middle" type="checkbox" value="yes" name="staticarp" id="staticarp" <?php if($pconfig['staticarp']) echo " checked"; ?>>&nbsp;
- </td>
- <td>
- <b>Enable Static ARP entries</b>
- </td>
- </tr>
- <tr>
- <td>
- &nbsp;
- </td>
- <td>
- <span class="red"><strong>Note:</strong></span> Only the machines listed below will be able to communicate with the firewall on this NIC.
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Dynamic DNS</td>
- <td width="78%" class="vtable">
- <div id="showddnsbox">
- <input type="button" onClick="show_ddns_config()" value="Advanced"></input> - Show Dynamic DNS</a>
- </div>
- <div id="showddns" style="display:none">
- <input valign="middle" type="checkbox" value="yes" name="ddnsupdate" id="ddnsupdate" <?php if($pconfig['ddnsupdate']) echo " checked"; ?>>&nbsp;
- <b>Enable registration of DHCP client names in DNS.</b><br />
- <p>
- <input name="ddnsdomain" type="text" class="formfld" id="ddnsdomain" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomain']);?>"><br />
- Note: Leave blank to disable dynamic DNS registration.<br />
- Enter the dynamic DNS domain which will be used to register client names in the DNS server.
- </div>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">NTP servers</td>
- <td width="78%" class="vtable">
- <div id="showntpbox">
- <input type="button" onClick="show_ntp_config()" value="Advanced"></input> - Show NTP configuration</a>
- </div>
- <div id="showntp" style="display:none">
- <input name="ntp1" type="text" class="formfld" id="ntp1" size="20" value="<?=htmlspecialchars($pconfig['ntp1']);?>"><br>
- <input name="ntp2" type="text" class="formfld" id="ntp2" size="20" value="<?=htmlspecialchars($pconfig['ntp2']);?>">
- </div>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Enable Network booting</td>
- <td width="78%" class="vtable">
- <div id="shownetbootbox">
- <input type="button" onClick="show_netboot_config()" value="Advanced"></input> - Show Network booting</a>
- </div>
- <div id="shownetboot" style="display:none">
- <input valign="middle" type="checkbox" value="yes" name="netboot" id="netboot" <?php if($pconfig['netboot']) echo " checked"; ?>>&nbsp;
- <b>Enables network booting.</b>
- <p>
- <input name="nextserver" type="text" class="formfld" id="nextserver" size="20" value="<?=htmlspecialchars($pconfig['nextserver']);?>"><br>
- Enter the IP address from the network boot server.
- <p>
- <input name="filename" type="text" class="formfld" id="filename" size="20" value="<?=htmlspecialchars($pconfig['filename']);?>"><br>
- Enter the filename used for network booting.<br />
- Note: You need both a filename and a boot server configured for this to work!<br />
- <p>
- <input name="rootpath" type="text" class="formfld" id="rootpath" size="20" value="<?=htmlspecialchars($pconfig['rootpath']);?>"><br>
- Enter option root-path.
- </div>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="if" type="hidden" value="<?=$if;?>">
- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%"> <p><span class="vexpl"><span class="red"><strong>Note:<br>
- </strong></span>The DNS servers entered in <a href="system.php">System:
- General setup</a> (or the <a href="services_dnsmasq.php">DNS
- forwarder</a>, if enabled) </span><span class="vexpl">will
- be assigned to clients by the DHCP server.<br>
- <br>
- The DHCP lease table can be viewed on the <a href="diag_dhcp_leases.php">Status:
- DHCP leases</a> page.<br>
- </span></p>
- </td>
- </tr>
- </table>
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="25%" class="listhdrr">MAC address</td>
- <td width="15%" class="listhdrr">IP address</td>
- <td width="20%" class="listhdrr">Hostname</td>
- <td width="30%" class="listhdr">Description</td>
- <td width="10%" class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle" width="17"></td>
- <td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <?php if(is_array($a_maps)): ?>
- <?php $i = 0; foreach ($a_maps as $mapent): ?>
- <?php if($mapent['mac'] <> "" or $mapent['ipaddr'] <> ""): ?>
- <tr>
- <td class="listlr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
- <?=htmlspecialchars($mapent['mac']);?>
- </td>
- <td class="listr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
- <?=htmlspecialchars($mapent['ipaddr']);?>&nbsp;
- </td>
- <td class="listr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
- <?=htmlspecialchars($mapent['hostname']);?>&nbsp;
- </td>
- <td class="listbg" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
- <font color="#FFFFFF"><?=htmlspecialchars($mapent['descr']);?>&nbsp;</font>
- </td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="services_dhcp.php?if=<?=$if;?>&act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this mapping?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <?php endif; ?>
- <?php $i++; endforeach; ?>
- <?php endif; ?>
- <tr>
- <td class="list" colspan="4"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle" width="17"></td>
- <td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<script language="JavaScript">
-<!--
-enable_change(false);
-//-->
-</script>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/Fit123/cass.xml b/config/Fit123/cass.xml
deleted file mode 100644
index 7539d63b..00000000
--- a/config/Fit123/cass.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright></copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>cass</name>
- <title>CASS</title>
- <include_file>/usr/local/pkg/fit123.inc</include_file>
- <tabs>
- <tab>
- <text>Fit123</text>
- <url>/pkg_edit.php?xml=fit123.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>DDNS</text>
- <url>/pkg_edit.php?xml=ddns.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>CASS</text>
- <url>/pkg_edit.php?xml=cass.xml&amp;id=0</url>
- <active/>
- </tab>
- </tabs>
- <fields>
- <field>
- <fielddescr>Clear a single state</fielddescr>
- <fieldname>cass2</fieldname>
- <description>
- When your dynamic ip on wan changes, the states of your voip phone needs to be cleared. </description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Your phone ip address</fielddescr>
- <fieldname>ypia</fieldname>
- <description>
- </description>
- <type>input</type>
- <size>15</size>
- </field>
- <field>
- <fielddescr>IP address of your VOIP </fielddescr>
- <fieldname>iaoyv</fieldname>
- <description>
- </description>
- <type>input</type>
- <size>15</size>
- </field>
- </fields>
- <custom_add_php_command></custom_add_php_command>
- <custom_php_command_before_form>cass_config();</custom_php_command_before_form>
- <custom_php_after_form_command></custom_php_after_form_command>
- <custom_php_validation_command></custom_php_validation_command>
- <custom_php_resync_config_command></custom_php_resync_config_command>
- <custom_php_install_command>Fit123_install_config();</custom_php_install_command>
- <custom_php_deinstall_command>Fit123_install_deinstall();</custom_php_deinstall_command>
-</packagegui>
diff --git a/config/Fit123/ddns.xml b/config/Fit123/ddns.xml
deleted file mode 100644
index cbc6348b..00000000
--- a/config/Fit123/ddns.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright></copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>ddns</name>
- <title>DDNS</title>
- <include_file>/usr/local/pkg/fit123.inc</include_file>
- <tabs>
- <tab>
- <text>Fit123</text>
- <url>/pkg_edit.php?xml=fit123.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>DDNS</text>
- <url>/pkg_edit.php?xml=ddns.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>CASS</text>
- <url>/pkg_edit.php?xml=cass.xml&amp;id=0</url>
- </tab>
- </tabs>
- <fields>
- <field>
- <fielddescr>Dynamic DNS</fielddescr>
- <fieldname>enable</fieldname>
- <description>
- A more customize way to update dynamic dns and mainly for IP's that doesn't change very often.&lt;br&gt;
- Will check for ip change every 5 min via local shell script and will only contact provider on change.&lt;br&gt;
- </description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Enter string that should be phrased</fielddescr>
- <fieldname>line1</fieldname>
- <description>
- String for OpenDNS should look like:&lt;br&gt;
- https://username:password@updates.opendns.com/nic/update?hostname=
- </description>
- <type>textarea</type>
- <cols>80</cols>
- <rows>1</rows>
- </field>
- <field>
- <fielddescr>Enter 2th string that should be phrased</fielddescr>
- <fieldname>line2</fieldname>
- <description>Leave empty if not used</description>
- <type>textarea</type>
- <cols>80</cols>
- <rows>1</rows>
- </field>
- <field>
- <fielddescr>Enter 3th string that should be phrased</fielddescr>
- <fieldname>line3</fieldname>
- <description>Leave empty if not used</description>
- <type>textarea</type>
- <cols>80</cols>
- <rows>1</rows>
- </field>
- </fields>
- <custom_add_php_command></custom_add_php_command>
- <custom_php_command_before_form>ddns_config();</custom_php_command_before_form>
- <custom_php_after_form_command></custom_php_after_form_command>
- <custom_php_validation_command></custom_php_validation_command>
- <custom_php_resync_config_command></custom_php_resync_config_command>
- <custom_php_install_command>Fit123_install_config();</custom_php_install_command>
- <custom_php_deinstall_command>Fit123_install_deinstall();</custom_php_deinstall_command>
-</packagegui>
diff --git a/config/Fit123/fit123.inc b/config/Fit123/fit123.inc
deleted file mode 100644
index b1338df2..00000000
--- a/config/Fit123/fit123.inc
+++ /dev/null
@@ -1,428 +0,0 @@
-<?php
-
-function Fit123_install_deinstall() {
- conf_mount_rw();
- config_lock();
- exec("cd ..");
- exec("rm -d -R /usr/local/pkg/Fit123");
- conf_mount_ro();
- config_unlock();
-}
-
-function Fit123_install_config() {
- conf_mount_rw();
- config_lock();
- exec("cd ..");
-//Adding new themes
-// exec("tar -zxovf /usr/local/pkg/code-red.tar.gz");
-// exec("mv code-red /usr/local/www/themes/code-red");
-//Creating backup directory
- exec("mkdir /usr/local/pkg/Fit123");
- exec("mkdir /usr/local/pkg/Fit123/backup");
-//Copy orignal files to backup dir
- //Date
- exec("cp /usr/local/www/index.php /usr/local/pkg/Fit123/backup/");
- //Captive Portal Add-On
-// exec("cp /etc/inc/filter.inc /usr/local/pkg/Fit123/backup/");
-// exec("cp /usr/local/www/services_captiveportal.php /usr/local/pkg/Fit123/backup/");
- //LTSP network boot Option
- exec("cp /etc/inc/services.inc /usr/local/pkg/Fit123/backup/");
- exec("cp /usr/local/www/services_dhcp.php /usr/local/pkg/Fit123/backup/");
- //DNS Server adds option for a 3th and 4th DNS Server
- exec("cp /usr/local/www/system.php /usr/local/pkg/Fit123/backup/");
-//Greate directories and downloading files to them
- //Date
- exec("mkdir /usr/local/pkg/Fit123/date");
- exec("fetch -o /usr/local/pkg/Fit123/date/index.php https://packages.pfsense.org/packages/config/Fit123/bin/date/index.abc");
- //Captive Portal Add-On
- exec("mkdir /usr/local/pkg/Fit123/cpaddon");
- exec("fetch -o /usr/local/pkg/Fit123/cpaddon/filter.inc https://packages.pfsense.org/packages/config/Fit123/bin/cpaddon/filter.inc");
- exec("fetch -o /usr/local/pkg/Fit123/cpaddon/services_captiveportal.php https://packages.pfsense.org/packages/config/Fit123/bin/cpaddon/services_captiveportal.abc");
- //LTSP 3th network boot Option
- exec("mkdir /usr/local/pkg/Fit123/LTSP");
- exec("fetch -o /usr/local/pkg/Fit123/LTSP/ https://packages.pfsense.org/packages/config/Fit123/bin/ltsp/services.inc");
- exec("fetch -o /usr/local/pkg/Fit123/LTSP/services_dhcp.php https://packages.pfsense.org/packages/config/Fit123/bin/ltsp/services_dhcp.abc");
- //AFC Reset's states after filter change
- exec("mkdir /usr/local/pkg/Fit123/afc");
- exec("fetch -o /usr/local/pkg/Fit123/afc/reset_states.sh https://packages.pfsense.org/packages/config/Fit123/bin/afc/reset_states.sh");
- exec("chmod 744 /usr/local/pkg/Fit123/afc/reset_states.sh");
- //DDNS
- exec("mkdir /usr/local/pkg/Fit123/ddns");
- //DNS Server adds option for a 3th and 4th DNS Server
- exec("mkdir /usr/local/pkg/Fit123/dnssrv");
- exec("fetch -o /usr/local/pkg/Fit123/dnssrv/system.php https://packages.pfsense.org/packages/config/Fit123/bin/dnssrv/system.abc");
- conf_mount_ro();
- config_unlock();
-}
-
-function Fit123_config() {
-global $config;
-
- $adddate = $config['installedpackages']['fit123']['config'][0]['adddate'];
- if($adddate)
- exec("cp /usr/local/pkg/Fit123/date/index.php /usr/local/www/index.php");
- else
- exec("cp /usr/local/pkg/Fit123/backup/index.php /usr/local/www/index.php");
-
- $cpaddon = $config['installedpackages']['fit123']['config'][0]['cpaddon'];
- if($cpaddon){
- exec("cp /usr/local/pkg/Fit123/cpaddon/filter.inc /etc/inc/filter.inc");
- exec("cp /usr/local/pkg/Fit123/cpaddon/services_captiveportal.php /usr/local/www/services_captiveportal.php");
- }
- else
- {
- exec("cp /usr/local/pkg/Fit123/backup/filter.inc /etc/inc/filter.inc");
- exec("cp /usr/local/pkg/Fit123/backup/services_captiveportal.php /usr/local/www/services_captiveportal.php");
- }
-
- $ltsp = $config['installedpackages']['fit123']['config'][0]['ltsp'];
- if($ltsp){
- exec("cp /usr/local/pkg/Fit123/LTSP/services.inc /etc/inc/services.inc");
- exec("cp /usr/local/pkg/Fit123/LTSP/services_dhcp.php /usr/local/www/services_dhcp.php");
- }
- else
- {
- exec("cp /usr/local/pkg/Fit123/backup/services.inc /etc/inc/services.inc");
- exec("cp /usr/local/pkg/Fit123/backup/services_dhcp.php /usr/local/www/services_dhcp.php");
- }
-
- $afc = $config['installedpackages']['fit123']['config'][0]['afc'];
- if($afc)
- $config['system']['afterfilterchangeshellcmd'] = "/usr/local/pkg/Fit123/afc/reset_states.sh";
- else
- $config['system']['afterfilterchangeshellcmd'] = "";
-
- $dnssrv = $config['installedpackages']['fit123']['config'][0]['dnssrv'];
- if($dnssrv)
- exec("cp /usr/local/pkg/Fit123/dnssrv/system.php /usr/local/www/system.php");
- else
- exec("cp /usr/local/pkg/Fit123/backup/system.php /usr/local/www/system.php");
-}
-
-function cass_config(){
-global $config;
-// Is CASS enable or not
- $hoba2 = $config['installedpackages']['cass']['config'][0]['cass2'];
- if($hoba2){
- // Is CASS.sh already added as a conjob
- $task_key = '/usr/local/pkg/Fit123/CASS.sh';
- $x_name='';
- $x=0;
- foreach($config['cron']['item'] as $item) {
- if($item['command']==$task_key) {
- $x_name = $x;
- }
- $x++;
- }
- unset($x);
- if(!$x_name > 0)
- {
- // Add cron job CASS.sh to config.xml
- $cron_item = array();
- $cron_item['minute'] = "*/1";
- $cron_item['hour'] = "*";
- $cron_item['mday'] = "*";
- $cron_item['month'] = "*";
- $cron_item['wday'] = "*";
- $cron_item['who'] = "root";
- $cron_item['command'] = "/usr/local/pkg/Fit123/CASS.sh";
- $config['cron']['item'][] = $cron_item;
- write_config();
- configure_cron();
- }
- }
- else
- {
- // Remove CASS.sh cron entry from config.xml
- $task_key = '/usr/local/pkg/Fit123/CASS.sh';
- $x_name='';
- $x=0;
- foreach($config['cron']['item'] as $item) {
- if($item['command']==$task_key) {
- $x_name = $x;
- }
- $x++;
- }
- unset($x);
- if($x_name > 0)
- {
- unset($config['cron']['item'][$x_name]);
- write_config();
- }
- configure_cron();
-}
-
-// Create local shell script to watch for wan ip change
- $local_voip = $config['installedpackages']['cass']['config'][0]['ypia'];
- $voip_p = $config['installedpackages']['cass']['config'][0]['iaoyv'];
-
- //Open CASS.sh for writing
- $hfd = fopen("/usr/local/pkg/Fit123/CASS.sh","w");
- if(!$hfd) {
- log_error("could not open /usr/local/pkg/Fit123/CASS.sh for writing");
- exit;
- }
- // The start of the config file
- fwrite($hfd, '#!/bin/sh');
- fwrite($hfd, "\n");
- fwrite($hfd, 'lip="');
- fwrite($hfd, $local_voip);
- fwrite($hfd, '"');
- fwrite($hfd, "\n");
- fwrite($hfd, 'rip="');
- fwrite($hfd, $voip_p);
- fwrite($hfd, '"');
- fwrite($hfd, "\n");
- fwrite($hfd, 'dns_file="/usr/local/pkg/Fit123/CASS.ip"');
- fwrite($hfd, "\n");
- fwrite($hfd, 'EXIT_SUCCESS=0');
- fwrite($hfd, "\n");
- fwrite($hfd, 'EXIT_FAILURE=1');
- fwrite($hfd, "\n");
- fwrite($hfd, 'if [ `id -u` -ne 0 ]');
- fwrite($hfd, "\n");
- fwrite($hfd, 'then');
- fwrite($hfd, "\n");
- fwrite($hfd, ' echo "Only root may run this program."');
- fwrite($hfd, "\n");
- fwrite($hfd, ' exit $EXIT_FAILURE');
- fwrite($hfd, "\n");
- fwrite($hfd, 'fi');
- fwrite($hfd, "\n");
- fwrite($hfd, 'get_ip(){');
- fwrite($hfd, "\n");
- fwrite($hfd, ' if [ -f $dns_file ]');
- fwrite($hfd, "\n");
- fwrite($hfd, ' then');
- fwrite($hfd, "\n");
- fwrite($hfd, ' registered_ip=`cat ${dns_file}`');
- fwrite($hfd, "\n");
- fwrite($hfd, ' else');
- fwrite($hfd, "\n");
- fwrite($hfd, ' registered_ip=""');
- fwrite($hfd, "\n");
- fwrite($hfd, ' fi');
- fwrite($hfd, "\n");
- fwrite($hfd, ' current_ip=`fetch -qo- http://jackson.io/ip/`');
- fwrite($hfd, "\n");
- fwrite($hfd, '}');
- fwrite($hfd, "\n");
- fwrite($hfd, 'update_hosts(){');
- fwrite($hfd, "\n");
- fwrite($hfd, ' if [ "$registered_ip" != "$current_ip" ]');
- fwrite($hfd, "\n");
- fwrite($hfd, ' then');
- fwrite($hfd, "\n");
- fwrite($hfd, ' /sbin/pfctl -k $lip -k $rip');
- fwrite($hfd, "\n");
- fwrite($hfd, ' echo $current_ip > $dns_file');
- fwrite($hfd, "\n");
- fwrite($hfd, ' echo "WAN ip address changed, clearing states entries.." | logger');
- fwrite($hfd, "\n");
- fwrite($hfd, ' fi');
- fwrite($hfd, "\n");
- fwrite($hfd, '}');
- fwrite($hfd, "\n");
- fwrite($hfd, 'get_ip');
- fwrite($hfd, "\n");
- fwrite($hfd, 'update_hosts');
- fwrite($hfd, "\n");
- fwrite($hfd, 'exit $EXIT_SUCCESS');
- fwrite($hfd, "\n");
- fclose($hfd);
-
- exec("chmod 744 /usr/local/pkg/Fit123/CASS.sh");
-}
-
-function ddns_config(){
-global $config;
-
-// Is DDNS enable or not
- $hoba = $config['installedpackages']['ddns']['config'][0]['enable'];
- if($hoba){
- // Is DDNS.sh already added as a conjob
- $task_key = '/usr/local/pkg/Fit123/ddns/DDNS.sh';
- $x_name='';
- $x=0;
- foreach($config['cron']['item'] as $item) {
- if($item['command']==$task_key) {
- $x_name = $x;
- }
- $x++;
- }
- unset($x);
- if(!$x_name > 0)
- {
- // Add cron job DDNS.sh to config.xml
- $cron_item = array();
- $cron_item['minute'] = "*/5";
- $cron_item['hour'] = "*";
- $cron_item['mday'] = "*";
- $cron_item['month'] = "*";
- $cron_item['wday'] = "*";
- $cron_item['who'] = "root";
- $cron_item['command'] = "/usr/local/pkg/Fit123/ddns/DDNS.sh";
- $config['cron']['item'][] = $cron_item;
- write_config();
- configure_cron();
- }
- }
- else
- {
- // Remove DDNS.sh cron entry from config.xml
- $task_key = '/usr/local/pkg/Fit123/ddns/DDNS.sh';
- $x_name='';
- $x=0;
- foreach($config['cron']['item'] as $item) {
- if($item['command']==$task_key) {
- $x_name = $x;
- }
- $x++;
- }
- unset($x);
- if($x_name > 0)
- {
- unset($config['cron']['item'][$x_name]);
- write_config();
- }
- configure_cron();
- }
-
-// Created DDNS updater file ddns.php
-
- //Get user entry from config.xml
- $line1text = $config['installedpackages']['ddns']['config'][0]['line1'];
- $line2text = $config['installedpackages']['ddns']['config'][0]['line2'];
- $line3text = $config['installedpackages']['ddns']['config'][0]['line3'];
-
- // Open ddns.php for writing
- $hf = fopen("/usr/local/pkg/Fit123/ddns/ddns.php","w");
- if(!$hf) {
- log_error("could not open /usr/local/pkg/Fit123/ddns/ddns.php for writing");
- exit;
- }
-
- // The start of the config file
- fwrite($hf, '<?php');
- fwrite($hf, "\n");
- fwrite($hf, '$ch = curl_init();');
- fwrite($hf, "\n");
- fwrite($hf, 'curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);');
- fwrite($hf, "\n");
- // add to config file
- if ($line1text != ""){
- fwrite($hf, 'curl_setopt($ch, CURLOPT_URL, "');
- fwrite($hf, $line1text);
- fwrite($hf, '");');
- fwrite($hf, "\n");
- fwrite($hf, '$result = curl_exec($ch);');
- fwrite($hf, "\n");
- }
- if ($line2text != ""){
- fwrite($hf, 'curl_setopt($ch, CURLOPT_URL, "');
- fwrite($hf, $line2text);
- fwrite($hf, '");');
- fwrite($hf, "\n");
- fwrite($hf, '$result = curl_exec($ch);');
- fwrite($hf, "\n");
- }
- if ($line3text != ""){
- fwrite($hf, 'curl_setopt($ch, CURLOPT_URL, "');
- fwrite($hf, $line3text);
- fwrite($hf, '");');
- fwrite($hf, "\n");
- fwrite($hf, '$result = curl_exec($ch);');
- fwrite($hf, "\n");
- }
- // The end of the config file
- fwrite($hf, 'curl_close ($ch);');
- fwrite($hf, "\n");
- fwrite($hf, '?>');
- fwrite($hf, "\n");
- fclose($hf);
-
-// Create local shell script to watch for wan ip change
-
- // Get WAN nic name from config.xml
- $wannic = $config['interfaces']['wan']['if'];
-
- //Open DDNS.sh for writing
- $hfd = fopen("/usr/local/pkg/Fit123/ddns/DDNS.sh","w");
- if(!$hfd) {
- log_error("could not open /usr/local/pkg/Fit123/ddns/DDNS.sh for writing");
- exit;
- }
- // The start of the config file
- fwrite($hfd, '#!/bin/sh');
- fwrite($hfd, "\n");
- fwrite($hfd, 'ext_if="');
- fwrite($hfd, $wannic);
- fwrite($hfd, '"');
- fwrite($hfd, "\n");
- fwrite($hfd, 'dns_file="/usr/local/pkg/Fit123/ddns/DDNS.ip"');
- fwrite($hfd, "\n");
- fwrite($hfd, 'update_file="/usr/local/bin/php /usr/local/pkg/Fit123/ddns/ddns.php"');
- fwrite($hfd, "\n");
- fwrite($hfd, 'EXIT_SUCCESS=0');
- fwrite($hfd, "\n");
- fwrite($hfd, 'EXIT_FAILURE=1');
- fwrite($hfd, "\n");
- fwrite($hfd, 'if [ `id -u` -ne 0 ]');
- fwrite($hfd, "\n");
- fwrite($hfd, 'then');
- fwrite($hfd, "\n");
- fwrite($hfd, ' echo "Only root may run this program."');
- fwrite($hfd, "\n");
- fwrite($hfd, ' exit $EXIT_FAILURE');
- fwrite($hfd, "\n");
- fwrite($hfd, 'fi');
- fwrite($hfd, "\n");
- fwrite($hfd, 'get_ip(){');
- fwrite($hfd, "\n");
- fwrite($hfd, ' if [ -f $dns_file ]');
- fwrite($hfd, "\n");
- fwrite($hfd, ' then');
- fwrite($hfd, "\n");
- fwrite($hfd, ' registered_ip=`cat ${dns_file}`');
- fwrite($hfd, "\n");
- fwrite($hfd, ' else');
- fwrite($hfd, "\n");
- fwrite($hfd, ' registered_ip=""');
- fwrite($hfd, "\n");
- fwrite($hfd, ' fi');
- fwrite($hfd, "\n");
- fwrite($hfd, ' current_ip=`ifconfig ${ext_if} | awk ');
- fwrite($hfd, "'");
- fwrite($hfd, '/inet / { print $2 }');
- fwrite($hfd, "'");
- fwrite($hfd, '`');
- fwrite($hfd, "\n");
- fwrite($hfd, '}');
- fwrite($hfd, "\n");
- fwrite($hfd, 'update_hosts(){');
- fwrite($hfd, "\n");
- fwrite($hfd, ' if [ "$registered_ip" != "$current_ip" ]');
- fwrite($hfd, "\n");
- fwrite($hfd, ' then');
- fwrite($hfd, "\n");
- fwrite($hfd, ' $update_file');
- fwrite($hfd, "\n");
- fwrite($hfd, ' echo $current_ip > $dns_file');
- fwrite($hfd, "\n");
- fwrite($hfd, ' echo "Your DDNS records have been updated" | logger');
- fwrite($hfd, "\n");
- fwrite($hfd, ' fi');
- fwrite($hfd, "\n");
- fwrite($hfd, '}');
- fwrite($hfd, "\n");
- fwrite($hfd, 'get_ip');
- fwrite($hfd, "\n");
- fwrite($hfd, 'update_hosts');
- fwrite($hfd, "\n");
- fwrite($hfd, 'exit $EXIT_SUCCESS');
- fwrite($hfd, "\n");
- fclose($hfd);
-
- exec("chmod 744 /usr/local/pkg/Fit123/ddns/DDNS.sh");
-}
-?>
diff --git a/config/Fit123/fit123.xml b/config/Fit123/fit123.xml
deleted file mode 100644
index 0ff202f9..00000000
--- a/config/Fit123/fit123.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright></copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>Fit123</name>
- <version>0.0.0.1</version>
- <title>Fit123</title>
- <include_file>/usr/local/pkg/fit123.inc</include_file>
- <menu>
- <name>Fit123</name>
- <tooltiptext></tooltiptext>
- <section>Status</section>
- <url>/pkg_edit.php?xml=fit123.xml&amp;id=0</url>
- </menu>
- <tabs>
- <tab>
- <text>Fit123</text>
- <url>/pkg_edit.php?xml=fit123.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>DDNS</text>
- <url>/pkg_edit.php?xml=ddns.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>CASS</text>
- <url>/pkg_edit.php?xml=cass.xml&amp;id=0</url>
- </tab>
- </tabs>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/Fit123/fit123.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/Fit123/ddns.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/Fit123/cass.xml</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Date</fielddescr>
- <fieldname>adddate</fieldname>
- <description>Adds current date to front page</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>LTSP</fielddescr>
- <fieldname>ltsp</fieldname>
- <description>Adds 3th network boot option</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>After Filter Change</fielddescr>
- <fieldname>afc</fieldname>
- <description>
- When using voip behind a multiwan failover setup, states needs to be cleared.&lt;br&gt;
- (Press save twice to activate and deactivate)
- </description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>DNS Servers</fielddescr>
- <fieldname>dnssrv</fieldname>
- <description>Adds option for a 3th and 4th DNS Server</description>
- <type>checkbox</type>
- </field>
- </fields>
- <custom_php_command_before_form>Fit123_config();</custom_php_command_before_form>
- <custom_php_after_form_command></custom_php_after_form_command>
- <custom_php_validation_command></custom_php_validation_command>
- <custom_php_resync_config_command></custom_php_resync_config_command>
- <custom_php_install_command>Fit123_install_config();</custom_php_install_command>
- <custom_php_deinstall_command>Fit123_install_deinstall();</custom_php_deinstall_command>
-</packagegui>
diff --git a/config/archive/assp.xml b/config/archive/assp.xml
deleted file mode 100644
index 626b2438..00000000
--- a/config/archive/assp.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>assp</name>
- <version>0.1.0</version>
- <title>Services: ASSP</title>
- <!-- Menu is where this packages menu will appear -->
- <menu>
- <name>ASSP</name>
- <tooltiptext>Access ASSP</tooltiptext>
- <section>Services</section>
- <url>http://$myurl:55555</url>
- </menu>
- <service>
- <name>assp</name>
- <rcfile>assp.sh</rcfile>
- <executable>perl</executable>
- </service>
- <additional_files_needed>
- <item>https://www.pfsense.org/packages/All/assp-1.0.tgz</item>
- </additional_files_needed>
- <custom_php_install_command>
- $start = "/usr/bin/perl /usr/local/assp/assp.pl &amp;\necho $! > /var/run/assp.pid";
- write_rcfile(array(
- "file" => 'assp.sh',
- "start" => $start,
- "stop" => '/usr/bin/killall perl'
- )
- );
- start_service("assp");
- </custom_php_install_command>
- <custom_php_deinstall_command>
- rmdir_recursive("/usr/local/assp");
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/archive/clamsmtp.inc b/config/archive/clamsmtp.inc
deleted file mode 100644
index cc16cf82..00000000
--- a/config/archive/clamsmtp.inc
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-require_once('globals.inc');
-require_once('config.inc');
-require_once('service-utils.inc');
-
-if(!function_exists("filter_configure"))
- require_once("filter.inc");
-
-function clamsmtp_install_command() {
- global $g;
-
- $clamav_rundir = "{$g['varrun_path']}/clamav";
- $pidfile = "$clamav_rundir/clamsmtpd.pid";
- $rcfile = array();
- $rcfile['file'] = 'clamsmtp.sh';
- $rcfile['start'] = "mkdir -p $clamav_rundir\n\tchown proxy:proxy $clamav_rundir\n\tclamsmtpd";
- $rcfile['stop'] = "kill `cat $pidfile`";
- write_rcfile($rcfile);
-
- clamsmtp_resync();
-}
-
-function clamsmtp_validate_input($post, &$input_errors) {
- if (!is_ipaddr(trim($post['smtp_server'])))
- $input_errors[] = 'The field \'SMTP server\' must contain a valid IP address.';
- $port = trim($post['smtp_port']);
- if (!is_numeric($port) || ($port < 0) || ($port > 65535))
- $input_errors[] = 'The field \'SMTP server\' must contain a port ranging from 0 to 65535';
-}
-
-function clamsmtp_resync() {
- global $g, $config;
-
- $avconf = $config['installedpackages']['clamav']['config'][0];
- if ($avconf['scan_smtp'] == 'on')
- $outaddress = "{$avconf['smtp_server']}:{$avconf['smtp_port']}";
- else
- $outaddress = '127.0.0.1:25';
- $clamav_rundir = "{$g['varrun_path']}/clamav";
- $clamsocket = "$clamav_rundir/clamd.socket";
- $pidfile = "$clamav_rundir/clamsmtpd.pid";
- $conf = <<<EOD
-Listen: 127.0.0.1:10025
-OutAddress: $outaddress
-ClamAddress: $clamsocket
-User: proxy
-PidFile: $pidfile
-
-EOD;
-
- file_put_contents('/usr/local/etc/clamsmtpd.conf', $conf);
-
- restart_service('clamsmtp');
- filter_configure();
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/clamsmtp.xml b/config/archive/clamsmtp.xml
deleted file mode 100644
index 4f2bf443..00000000
--- a/config/archive/clamsmtp.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>none</name>
- <version>none</version>
- <title>none</title>
- <include_file>clamsmtp.inc</include_file>
- <service>
- <name>clamsmtp</name>
- <rcfile>clamsmtp.sh</rcfile>
- <executable>clamsmtpd</executable>
- <description>SMTP virus scanner.</description>
- </service>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/clamsmtp.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/bin/</prefix>
- <chmod>0755</chmod>
- <item>https://www.pfsense.org/packages/All/clamsmtpd</item>
- </additional_files_needed>
- <custom_php_install_command>
- clamsmtp_install_command();
- </custom_php_install_command>
-</packagegui>
diff --git a/config/archive/doorman.xml b/config/archive/doorman.xml
deleted file mode 100644
index c2a5f18e..00000000
--- a/config/archive/doorman.xml
+++ /dev/null
@@ -1,157 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>doorman</name>
- <version>none</version>
- <title>doorman: Settings</title>
- <aftersaveredirect>pkg_edit.php?xml=doorman.xml&amp;id=0</aftersaveredirect>
- <menu>
- <name>doorman</name>
- <tooltiptext>Modify doorman settings and users.</tooltiptext>
- <section>Services</section>
- <configfile>doorman.xml</configfile>
- <url>/pkg_edit.php?xml=doorman.xml&amp;id=0</url>
- </menu>
- <service>
- <name>doorman</name>
- <rcfile>doorman.sh</rcfile>
- <executable>doormand</executable>
- </service>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=doorman.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Users</text>
- <url>/pkg.php?xml=doormanusers.xml</url>
- </tab>
- </tabs>
- <configpath>installedpackages->package->$packagename->configuration->settings</configpath>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/doormanusers.xml</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Initial connection timeout</fielddescr>
- <fieldname>initdelay</fieldname>
- <description>Enter the desired number of *microseconds* to wait for a complete 3-way handshake between the client and requested service. (default one half second)</description>
- <type>input</type>
- <value>500000</value>
- </field>
- <field>
- <fielddescr>Connection check interval</fielddescr>
- <fieldname>checkdelay</fieldname>
- <description>Enter the desired number of *seconds* between checking for broken connections. (default 5 seconds)</description>
- <type>input</type>
- <value>5</value>
- </field>
- <field>
- <fielddescr>Connection initiation timeout</fielddescr>
- <fieldname>inittimeout</fieldname>
- <description>Enter the desired number of *seconds* to wait for a connection to be established after a successful knock.i (default 10 seconds)</description>
- <type>input</type>
- <value>10</value>
- </field>
- <!--
- <field>
- <fielddescr>Listening interface(s)</fielddescr>
- <fieldname>interface</fieldname>
- <description>Select the interfaces that doormand should listen on. (default WAN)</description>
- <value>wan</value>
- <type>interfaces_selection</type>
- </field>
- -->
- <field>
- <fielddescr>Listening port</fielddescr>
- <fieldname>port</fieldname>
- <description>Enter the port that doormand should listen on. (default 1001)</description>
- <type>input</type>
- <value>1001</value>
- </field>
- </fields>
- <custom_php_global_functions>
- function sync_package_doorman() {
- conf_mount_rw();
- config_lock();
- global $config;
- $fout = fopen("/usr/local/etc/doormand/doormand.cf","w");
- fwrite($fout, "# This file was automatically generated by the pfSense\n# package management system.\n\n");
- /*
- * $int = convert_friendly_interface_to_real_interface_name($_POST['interface']);
- * fwrite($fout, "interface " . $int . "\n");
- */
- fwrite($fout, "interface " . $config['interfaces']['wan']['if'] . "\n");
- if($_POST['port'] != "") fwrite($fout, "port " . $_POST['port'] . "\n");
- if($_POST['inittimeout'] != "") fwrite($fout, "waitfor " . $_POST['inittimeout'] . "\n");
- if($_POST['initdelay'] != "") fwrite($fout, "connection_delay_1 " . $_POST['initdelay'] . "\n");
- if($_POST['checkdelay'] != "") fwrite($fout, "connection_delay_2 " . $_POST['checkdelay'] . "\n");
- fwrite($fout, "pidfile /var/run/doormand.pid\nlogfile /var/log/messages\nloglevel NOTICE\nguestlist /usr/local/etc/doormand/guestlist\nfirewall-add /usr/local/etc/doormand/pfctl_add\nfirewall-del /usr/local/etc/doormand/pfctl_del\ntag-queue-length 100000\ntag-queue /var/doorman_tag_queue\ntag-db /var/doorman_tag_db.db\n");
- fwrite($fout, "hash-archive-size 50000\n");
- fwrite($fout, "hash-archive /tmp/doormand.hash-archive\n");
- fclose($fout);
- restart_service("doorman");
- conf_mount_ro();
- config_unlock();
- }
- </custom_php_global_functions>
- <custom_add_php_command>
- sync_package_doorman();
- </custom_add_php_command>
- <custom_php_install_command>
- global $config;
- $start = "/usr/local/sbin/doormand -D &amp;";
- write_rcfile(array(
- "file" => "doorman.sh",
- "start" => $start,
- "stop" => "/usr/bin/killall doormand"
- )
- );
- </custom_php_install_command>
-</packagegui>
-
diff --git a/config/archive/doormanusers.xml b/config/archive/doormanusers.xml
deleted file mode 100644
index a1887b28..00000000
--- a/config/archive/doormanusers.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>doormanusers</name>
- <version>none</version>
- <title>Doorman: Users</title>
- <menu>
- <name>Doorman</name>
- <tooltiptext>Modify doormand settings and users.</tooltiptext>
- <section>Services</section>
- <configfile>doorman.xml</configfile>
- <url>/pkg_edit.php?xml=doorman.xml&amp;id=0</url>
- </menu>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=doorman.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Users</text>
- <url>/pkg.php?xml=doormanusers.xml</url>
- <active/>
- </tab>
- </tabs>
- <configpath>installedpackages->package->$packagename->configuration->settings</configpath>
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Username</fielddescr>
- <fieldname>username</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Ports</fielddescr>
- <fieldname>ports</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Addresses</fielddescr>
- <fieldname>addresses</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
- <fields>
- <field>
- <fielddescr>Username</fielddescr>
- <fieldname>username</fieldname>
- <description>Enter the username here. This may be up to 32 characters in length.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Password</fielddescr>
- <fieldname>password</fieldname>
- <description>Enter the password here. This may be up to 64 characters in length.</description>
- <type>password</type>
- </field>
- <field>
- <fielddescr>Allowed ports</fielddescr>
- <fieldname>ports</fieldname>
- <description>Enter a whitespace-delimited list of the ports or service names *to* which this user may connect.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Allowed addresses</fielddescr>
- <fieldname>addresses</fieldname>
- <description>Enter a whitespace-delimited list of the IP addresses or hostnames *from* which this user may connect. Addresses may be unique or expressed as ranges using CIDR notation.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>Enter a description for this user here.</description>
- <type>input</type>
- </field>
- </fields>
- <custom_php_global_functions>
- function sync_package_doorman_users() {
- if ($_POST == "") $_POST = $config['installedpackages']['doormanusers']['config'];
- conf_mount_rw();
- config_lock();
- global $config;
- $fout = fopen("/usr/local/etc/doormand/guestlist","w");
- fwrite($fout, "# This file was automatically generated by the pfSense\n# package management system.\n\n");
- if($config['installedpackages']['doormanusers'])
- foreach($config['installedpackages']['doormanusers']['config'] as $rowhelper) {
- fwrite($fout, $rowhelper['username'] . "\t" . $rowhelper['password'] . "\n\t" . $rowhelper['ports'] . "\n\t" . $rowhelper['addresses'] . "\n\n");
- }
- fclose($fout);
- restart_service("doorman");
- conf_mount_ro();
- config_unlock();
- }
- </custom_php_global_functions>
- <custom_add_php_command>
- sync_package_doorman_users();
- </custom_add_php_command>
-</packagegui>
-
diff --git a/config/archive/dspam/conf.default/config.xml b/config/archive/dspam/conf.default/config.xml
deleted file mode 100644
index 9aabd08e..00000000
--- a/config/archive/dspam/conf.default/config.xml
+++ /dev/null
@@ -1,1020 +0,0 @@
-<?xml version="1.0"?>
-<!-- pfSense default system configuration -->
-<pfsense>
- <version>2.1</version>
- <lastchange></lastchange>
- <theme>nione</theme>
- <system>
- <disablenatreflection/>
- <optimization>normal</optimization>
- <hostname>nione</hostname>
- <domain>local</domain>
- <dnsserver></dnsserver>
- <dnsallowoverride/>
- <timezone>Etc/UTC</timezone>
- <time-update-interval>300</time-update-interval>
- <timeservers>pool.ntp.org</timeservers>
- <group>
- <name>admins</name>
- <description>System Administrators</description>
- <scope>system</scope>
- <pages>ANY</pages>
- <home>index.php</home>
- </group>
- <group>
- <name>dspam_users</name>
- <description>DSPAM Users</description>
- <scope>user</scope>
- <home>dspam.php</home>
- <pages>
- <page>dspam.php</page>
- <page>wizard.php</page>
- <page>system_usermanager.php</page>
- <page>license.php</page>
- <page>pkg.php</page>
- <page>pkg_edit.php</page>
- <page>index.php</page>
- <page>dspam_alerts.xml</page>
- <page>dspam.xml</page>
- <page>dspam-perf.php</page>
- <page>dspam-prefs.php</page>
- <page>dspam-train.php</page>
- <page>dspam-quarantine.php</page>
- <page>dspam-viewmsg.php</page>
- <page>dspam-hfragment.php</page>
- <page>dspam-history.php</page>
- <page>dspam-analysis-graph.php</page>
- <page>dspam-analysis.php</page>
- <page>ifstats.php</page>
- <page>xmlrpc.php</page>
- <page>preload.php</page>
- <page>functions.inc.php</page>
- <page>javascript.inc.php</page>
- <page>sajax.class.php</page>
- </pages>
- </group>
- <group>
- <name>dspam_admins</name>
- <description>DSPAM Administrators</description>
- <scope>user</scope>
- <home>dspam.php</home>
- <pages>
- <page>dspam.php</page>
- <page>dspam_wizard.xml</page>
- <page>wizard.php</page>
- <page>system_usermanager.php</page>
- <page>license.php</page>
- <page>pkg.php</page>
- <page>pkg_edit.php</page>
- <page>index.php</page>
- <page>status_services.php</page>
- <page>dspam-admin-prefs.php</page>
- <page>dspam_alerts.xml</page>
- <page>dspam.xml</page>
- <page>dspam-perf.php</page>
- <page>dspam-prefs.php</page>
- <page>dspam-train.php</page>
- <page>dspam-admin-stats.php</page>
- <page>dspam-admin-graph.php</page>
- <page>dspam-admin.php</page>
- <page>dspam-quarantine.php</page>
- <page>dspam-viewmsg.php</page>
- <page>dspam-hfragment.php</page>
- <page>dspam-history.php</page>
- <page>dspam-analysis-graph.php</page>
- <page>dspam-analysis.php</page>
- <page>dspam-settings-algo.php</page>
- <page>dspam-settings-bmta.php</page>
- <page>dspam-settings-feat.php</page>
- <page>dspam-settings-prefs.php</page>
- <page>dspam-settings-header.php</page>
- <page>dspam-settings-overr.php</page>
- <page>dspam-settings-spwd.php</page>
- <page>dspam-settings-tuser.php</page>
- <page>dspam-settings.php</page>
- <page>p3scan-pf-emer.xml</page>
- <page>p3scan-pf.xml</page>
- <page>p3scan-pf-msg.xml</page>
- <page>p3scan-pf-spam.xml</page>
- <page>p3scan-pf-vir.xml</page>
- <page>p3scan-pf-transex.xml</page>
- <page>ifstats.php</page>
- <page>xmlrpc.php</page>
- <page>preload.php</page>
- <page>functions.inc.php</page>
- <page>javascript.inc.php</page>
- <page>sajax.class.php</page>
- </pages>
- </group>
- <user>
- <name>admin</name>
- <fullname>System Administrator</fullname>
- <scope>system</scope>
- <groupname>admins</groupname>
- <password>$1$pHZLmGLm$rtBJza55tMwVbJNkr0qCz/</password>
- <priv>
- <id>lockwc</id>
- <name>Lock webConfigurator</name>
- <descr>Indicates whether this user will lock access to the webConfigurator for other users.</descr>
- </priv>
- <priv>
- <id>lock-ipages</id>
- <name>Lock individual pages</name>
- <descr>Indicates whether this user will lock individual HTML pages after having accessed a particular page(the lock will be freed if the user leaves or saves the page form).</descr>
- </priv>
- <priv>
- <id>hasshell</id>
- <name>Has shell access</name>
- <descr>Indicates whether this user is able to login for example via SSH.</descr>
- </priv>
- <priv>
- <id>isroot</id>
- <name>Is root user</name>
- <descr>This user is associated with the UNIX root user (you should associate this privilege only with one single user).</descr>
- </priv>
- </user>
- <user>
- <name>dspamadm</name>
- <fullname>DSPAM Administrator</fullname>
- <scope>user</scope>
- <groupname>dspam_admins</groupname>
- <password>$1$utl.fBcK$ZDnGqMSm2fJHi8vxQ6EfT1</password>
- </user>
- <webgui>
- <protocol>http</protocol>
- <!--
- <port></port>
- <certificate></certificate>
- <private-key></private-key>
- <noassigninterfaces/>
- <expanddiags/>
- <noantilockout></noantilockout>
- -->
- </webgui>
- <!-- <disableconsolemenu/> -->
- <!-- <disablefirmwarecheck/> -->
- <!-- <shellcmd></shellcmd> -->
- <!-- <earlyshellcmd></earlyshellcmd> -->
- <!-- <harddiskstandby></harddiskstandby> -->
- </system>
- <interfaces>
- <lan>
- <if>sis0</if>
- <ipaddr>192.168.1.1</ipaddr>
- <subnet>24</subnet>
- <media></media>
- <mediaopt></mediaopt>
- <bandwidth>100</bandwidth>
- <bandwidthtype>Mb</bandwidthtype>
- <!--
- <wireless>
- *see below (opt[n])*
- </wireless>
- -->
- </lan>
- <wan>
- <if>sis1</if>
- <mtu></mtu>
- <ipaddr>dhcp</ipaddr>
- <!-- *or* ipv4-address *or* 'pppoe' *or* 'pptp' *or* 'bigpond' -->
- <subnet></subnet>
- <gateway></gateway>
- <blockpriv/>
- <disableftpproxy/>
- <dhcphostname></dhcphostname>
- <media></media>
- <mediaopt></mediaopt>
- <bandwidth>100</bandwidth>
- <bandwidthtype>Mb</bandwidthtype>
- <!--
- <wireless>
- *see below (opt[n])*
- </wireless>
- -->
- </wan>
- <!--
- <opt[n]>
- <enable/>
- <descr></descr>
- <if></if>
- <ipaddr></ipaddr>
- <subnet></subnet>
- <media></media>
- <mediaopt></mediaopt>
- <bridge>lan|wan|opt[n]</bridge>
- <wireless>
- <mode>hostap *or* bss *or* ibss</mode>
- <ssid></ssid>
- <channel></channel>
- <wep>
- <enable/>
- <key>
- <txkey/>
- <value></value>
- </key>
- </wep>
- </wireless>
- </opt[n]>
- -->
- </interfaces>
- <!--
- <vlans>
- <vlan>
- <tag></tag>
- <if></if>
- <descr></descr>
- </vlan>
- </vlans>
- -->
- <staticroutes>
- <!--
- <route>
- <interface>lan|opt[n]|pptp</interface>
- <network>xxx.xxx.xxx.xxx/xx</network>
- <gateway>xxx.xxx.xxx.xxx</gateway>
- <descr></descr>
- </route>
- -->
- </staticroutes>
- <pppoe>
- <username></username>
- <password></password>
- <provider></provider>
- <!--
- <ondemand/>
- <timeout></timeout>
- -->
- </pppoe>
- <pptp>
- <username></username>
- <password></password>
- <local></local>
- <subnet></subnet>
- <remote></remote>
- <!--
- <ondemand/>
- <timeout></timeout>
- -->
- </pptp>
- <bigpond>
- <username></username>
- <password></password>
- <authserver></authserver>
- <authdomain></authdomain>
- <minheartbeatinterval></minheartbeatinterval>
- </bigpond>
- <dyndns>
- <!-- <enable/> -->
- <type>dyndns</type>
- <username></username>
- <password></password>
- <host></host>
- <mx></mx>
- <!-- <wildcard/> -->
- </dyndns>
- <dhcpd>
- <lan>
- <enable/>
- <range>
- <from>192.168.1.100</from>
- <to>192.168.1.199</to>
- </range>
- <!--
- <winsserver>xxx.xxx.xxx.xxx</winsserver>
- <defaultleasetime></defaultleasetime>
- <maxleasetime></maxleasetime>
- <gateway>xxx.xxx.xxx.xxx</gateway>
- <domain></domain>
- <dnsserver></dnsserver>
- <next-server></next-server>
- <filename></filename>
- -->
- </lan>
- <!--
- <opt[n]>
- ...
- </opt[n]>
- -->
- <!--
- <staticmap>
- <mac>xx:xx:xx:xx:xx:xx</mac>
- <ipaddr>xxx.xxx.xxx.xxx</ipaddr>
- <descr></descr>
- </staticmap>
- -->
- </dhcpd>
- <pptpd>
- <mode><!-- off *or* server *or* redir --></mode>
- <redir></redir>
- <localip></localip>
- <remoteip></remoteip>
- <!-- <accounting/> -->
- <!--
- <user>
- <name></name>
- <password></password>
- </user>
- -->
- </pptpd>
- <ovpn>
- <!--
- <server>
- <enable/>
- <ca_cert></ca_cert>
- <srv_cert></srv_cert>
- <srv_key></srv_key>
- <dh_param></dh_param>
- <verb></verb>
- <tun_iface></tun_iface>
- <port></port>
- <bind_iface></bind_iface>
- <cli2cli/>
- <maxcli></maxcli>
- <prefix></prefix>
- <ipblock></ipblock>
- <crypto></crypto>
- <dupcn/>
- <psh_options>
- <redir></redir>
- <redir_loc></redir_loc>
- <rte_delay></rte_delay>
- <ping></ping>
- <pingrst></pingrst>
- <pingexit></pingexit>
- <inact></inact>
- </psh_options>
- </server>
- <client>
- <tunnel></tunnel>
- <ca_cert></ca_cert>
- <cli_cert></cli_cert>
- <cli_key></cli_key>
- <type></type>
- <tunnel>
- <if></if>
- <proto></proto>
- <cport></cport>
- <saddr></saddr>
- <sport></sport>
- <crypto></crypto>
- </tunnel>
- </client>
- -->
- </ovpn>
- <dnsmasq>
- <enable/>
- <!--
- <hosts>
- <host></host>
- <domain></domain>
- <ip></ip>
- <descr></descr>
- </hosts>
- -->
- </dnsmasq>
- <snmpd>
- <!-- <enable/> -->
- <syslocation></syslocation>
- <syscontact></syscontact>
- <rocommunity>public</rocommunity>
- </snmpd>
- <diag>
- <ipv6nat>
- <!-- <enable/> -->
- <ipaddr></ipaddr>
- </ipv6nat>
- </diag>
- <bridge>
- <!-- <filteringbridge/> -->
- </bridge>
- <syslog>
- <!--
- <reverse/>
- <enable/>
- <remoteserver>xxx.xxx.xxx.xxx</remoteserver>
- <filter/>
- <dhcp/>
- <system/>
- <nologdefaultblock/>
- -->
- </syslog>
- <!--
- <captiveportal>
- <enable/>
- <interface>lan|opt[n]</interface>
- <idletimeout>minutes</idletimeout>
- <timeout>minutes</timeout>
- <page>
- <htmltext></htmltext>
- <errtext></errtext>
- </page>
- <httpslogin/>
- <httpsname></httpsname>
- <certificate></certificate>
- <private-key></private-key>
- <redirurl></redirurl>
- <radiusip></radiusip>
- <radiusport></radiusport>
- <radiuskey></radiuskey>
- <nomacfilter/>
- </captiveportal>
- -->
- <nat>
- <ipsecpassthru>
- <enable/>
- </ipsecpassthru>
- <!--
- <rule>
- <interface></interface>
- <external-address></external-address>
- <protocol></protocol>
- <external-port></external-port>
- <target></target>
- <local-port></local-port>
- <descr></descr>
- </rule>
- -->
- <!--
- <onetoone>
- <interface></interface>
- <external>xxx.xxx.xxx.xxx</external>
- <internal>xxx.xxx.xxx.xxx</internal>
- <subnet></subnet>
- <descr></descr>
- </onetoone>
- -->
- <!--
- <advancedoutbound>
- <enable/>
- <rule>
- <interface></interface>
- <source>
- <network>xxx.xxx.xxx.xxx/xx</network>
- </source>
- <destination>
- <not/>
- <any/>
- *or*
- <network>xxx.xxx.xxx.xxx/xx</network>
- </destination>
- <target>xxx.xxx.xxx.xxx</target>
- <descr></descr>
- </rule>
- </advancedoutbound>
- -->
- <!--
- <servernat>
- <ipaddr></ipaddr>
- <descr></descr>
- </servernat>
- -->
- </nat>
- <filter>
- <!-- <tcpidletimeout></tcpidletimeout> -->
- <rule>
- <type>pass</type>
- <descr>Default LAN -&gt; any</descr>
- <interface>lan</interface>
- <source>
- <network>lan</network>
- </source>
- <destination>
- <any/>
- </destination>
- </rule>
- <!-- rule syntax:
- <rule>
- <disabled/>
- <type>pass|block|reject</type>
- <descr>...</descr>
- <interface>lan|opt[n]|wan|pptp</interface>
- <protocol>tcp|udp|tcp/udp|...</protocol>
- <icmptype></icmptype>
- <source>
- <not/>
-
- <address>xxx.xxx.xxx.xxx(/xx) or alias</address>
- *or*
- <network>lan|opt[n]|pptp</network>
- *or*
- <any/>
-
- <port>a[-b]</port>
- </source>
- <destination>
- *same as for source*
- </destination>
- <frags/>
- <log/>
- </rule>
- -->
- </filter>
- <shaper>
- <!-- <enable/> -->
- <!-- <schedulertype>hfsc</schedulertype> -->
- <!-- rule syntax:
- <rule>
- <disabled/>
- <descr></descr>
-
- <targetpipe>number (zero based)</targetpipe>
- *or*
- <targetqueue>number (zero based)</targetqueue>
-
- <interface>lan|wan|opt[n]|pptp</interface>
- <protocol>tcp|udp</protocol>
- <direction>in|out</direction>
- <source>
- <not/>
-
- <address>xxx.xxx.xxx.xxx(/xx)</address>
- *or*
- <network>lan|opt[n]|pptp</network>
- *or*
- <any/>
-
- <port>a[-b]</port>
- </source>
- <destination>
- *same as for source*
- </destination>
-
- <iplen>from[-to]</iplen>
- <iptos>(!)lowdelay,throughput,reliability,mincost,congestion</iptos>
- <tcpflags>(!)fin,syn,rst,psh,ack,urg</tcpflags>
- </rule>
- <pipe>
- <descr></descr>
- <bandwidth></bandwidth>
- <delay></delay>
- <mask>source|destination</mask>
- </pipe>
- <queue>
- <descr></descr>
- <targetpipe>number (zero based)</targetpipe>
- <weight></weight>
- <mask>source|destination</mask>
- </queue>
- -->
- </shaper>
- <ipsec>
- <preferredoldsa/>
- <!-- <enable/> -->
- <!-- syntax:
- <tunnel>
- <disabled/>
- <auto/>
- <descr></descr>
- <interface>lan|wan|opt[n]</interface>
- <local-subnet>
- <address>xxx.xxx.xxx.xxx(/xx)</address>
- *or*
- <network>lan|opt[n]</network>
- </local-subnet>
- <remote-subnet>xxx.xxx.xxx.xxx/xx</remote-subnet>
- <remote-gateway></remote-gateway>
- <p1>
- <mode></mode>
- <myident>
- <myaddress/>
- *or*
- <address>xxx.xxx.xxx.xxx</address>
- *or*
- <fqdn>the.fq.dn</fqdn>
- </myident>
- <encryption-algorithm></encryption-algorithm>
- <hash-algorithm></hash-algorithm>
- <dhgroup></dhgroup>
- <lifetime></lifetime>
- <pre-shared-key></pre-shared-key>
- </p1>
- <p2>
- <protocol></protocol>
- <encryption-algorithm-option></encryption-algorithm-option>
- <hash-algorithm-option></hash-algorithm-option>
- <pfsgroup></pfsgroup>
- <lifetime></lifetime>
- </p2>
- </tunnel>
- <mobileclients>
- <enable/>
- <p1>
- <mode></mode>
- <myident>
- <myaddress/>
- *or*
- <address>xxx.xxx.xxx.xxx</address>
- *or*
- <fqdn>the.fq.dn</fqdn>
- </myident>
- <encryption-algorithm></encryption-algorithm>
- <hash-algorithm></hash-algorithm>
- <dhgroup></dhgroup>
- <lifetime></lifetime>
- </p1>
- <p2>
- <protocol></protocol>
- <encryption-algorithm-option></encryption-algorithm-option>
- <hash-algorithm-option></hash-algorithm-option>
- <pfsgroup></pfsgroup>
- <lifetime></lifetime>
- </p2>
- </mobileclients>
- <mobilekey>
- <ident></ident>
- <pre-shared-key></pre-shared-key>
- </mobilekey>
- -->
- </ipsec>
- <aliases>
- <!--
- <alias>
- <name></name>
- <address>xxx.xxx.xxx.xxx(/xx)</address>
- <descr></descr>
- </alias>
- -->
- </aliases>
- <proxyarp>
- <!--
- <proxyarpnet>
- <network>xxx.xxx.xxx.xxx/xx</network>
- *or*
- <range>
- <from>xxx.xxx.xxx.xxx</from>
- <to>xxx.xxx.xxx.xxx</to>
- </range>
- </proxyarpnet>
- -->
- </proxyarp>
- <wol>
- <!--
- <wolentry>
- <interface>lan|opt[n]</interface>
- <mac>xx:xx:xx:xx:xx:xx</mac>
- <descr></descr>
- </wolentry>
- -->
- </wol>
- <installedpackages>
- <dspam>
- <config>
- <!-- ============================================ -->
- <!-- == Database Settings == -->
- <!-- ============================================ -->
- <storage-driver>mysql</storage-driver>
- <dbsettings>
- <mysql-server>/tmp/mysql.sock</mysql-server>
- <mysql-port />
- <mysql-user>dspam</mysql-user>
- <mysql-password>dspam</mysql-password>
- <mysql-database>dspam</mysql-database>
- <mysql-ccache>10</mysql-ccache>
- <mysql-compress>yes</mysql-compress>
- <mysql-uid>yes</mysql-uid>
- </dbsettings>
- <!-- ============================================ -->
- <!-- == Delivery Settings == -->
- <!-- ============================================ -->
- <tdelivery-agent>mail</tdelivery-agent>
- <tcpip-delivery>yes</tcpip-delivery>
- <tcpip-delivery-host>192.168.1.6</tcpip-delivery-host>
- <tcpip-delivery-port>24</tcpip-delivery-port>
- <tcpip-delivery-ident>localhost</tcpip-delivery-ident>
- <tcpip-delivery-proto>smtp</tcpip-delivery-proto>
- <delivery-onfail>error</delivery-onfail>
- <!-- ============================================ -->
- <!-- == DSPAM Privileges == -->
- <!-- ============================================ -->
- <tuser>
- <name>root</name>
- <descr>root desc</descr>
- </tuser>
- <tuser>
- <name>mail</name>
- <descr>mail desc</descr>
- </tuser>
- <tuser>
- <name>mailnull</name>
- <descr>mailnull desc</descr>
- </tuser>
- <tuser>
- <name>smmsp</name>
- <descr>smmsp desc</descr>
- </tuser>
- <tuser>
- <name>daemon</name>
- <descr>daemon desc</descr>
- </tuser>
- <!-- ============================================ -->
- <!-- == DSPAM Engine Settings == -->
- <!-- ============================================ -->
- <training-mode>teft</training-mode>
- <test-cond-training>yes</test-cond-training>
- <feature>
- <name>chained</name>
- <descr>feat desc</descr>
- </feature>
- <feature>
- <name>whitelist</name>
- <descr>whitelist desc</descr>
- </feature>
- <algorithm>
- <name>graham</name>
- <descr>naive desc</descr>
- </algorithm>
- <algorithm>
- <name>burton</name>
- <descr>naive desc</descr>
- </algorithm>
- <pvalue>graham</pvalue>
- <improbability-drive>yes</improbability-drive>
- <preference>
- <value>&quot;spamAction=quarantine&quot;</value>
- <descr>desc</descr>
- </preference>
- <preference>
- <value>&quot;signatureLocation=message&quot;</value>
- <descr>&apos;message&apos; or &apos;headers&apos;</descr>
- </preference>
- <preference>
- <value>&quot;showFactors=on&quot;</value>
- <descr>desc</descr>
- </preference>
- <override>
- <value>trainingMode</value>
- <descr>tmode desc</descr>
- </override>
- <override>
- <value>spamAction spamSubject</value>
- <descr>desc</descr>
- </override>
- <override>
- <value>statisticalSedation</value>
- <descr>desc</descr>
- </override>
- <override>
- <value>enableBNR</value>
- <descr>desc</descr>
- </override>
- <override>
- <value>enableWhitelist</value>
- <descr>desc</descr>
- </override>
- <override>
- <value>signatureLocation</value>
- <descr>desc</descr>
- </override>
- <override>
- <value>showFactors</value>
- <descr>desc</descr>
- </override>
- <override>
- <value>optIn optOut</value>
- <descr>desc</descr>
- </override>
- <override>
- <value>whitelistThreshold</value>
- <descr>desc</descr>
- </override>
- <!-- ============================================ -->
- <!-- == Miscellaneous Settings == -->
- <!-- ============================================ -->
- <failover-attempts>1</failover-attempts>
- <notification-email>yes</notification-email>
- <dspam-contact>support</dspam-contact>
- <!-- ============================================ -->
- <!-- == Maintainance Settings == -->
- <!-- ============================================ -->
- <purge-signatures>14</purge-signatures>
- <purge-neutral>90</purge-neutral>
- <purge-unused>90</purge-unused>
- <purge-hapaxes>30</purge-hapaxes>
- <purge-hits-1s>15</purge-hits-1s>
- <purge-hits-1i>15</purge-hits-1i>
- <!-- ============================================ -->
- <!-- == System Settings == -->
- <!-- ============================================ -->
- <local-mx>127.0.0.1</local-mx>
- <system-log>yes</system-log>
- <user-log>yes</user-log>
- <filter-opt>out</filter-opt>
- <parse-to-headers>yes</parse-to-headers>
- <change-mode-on-parse>yes</change-mode-on-parse>
- <max-message-size>307200</max-message-size>
- <processor-bias>yes</processor-bias>
- <!-- ============================================ -->
- <!-- == ClamAV Engine Settings == -->
- <!-- ============================================ -->
- <clamav-enable>yes</clamav-enable>
- <clamav-port>3310</clamav-port>
- <clamav-host>127.0.0.1</clamav-host>
- <clamav-response>accept</clamav-response>
- <!-- ============================================ -->
- <!-- == DSPAM Daemon Settings (Server) == -->
- <!-- ============================================ -->
- <dspam-server-port>24</dspam-server-port>
- <dspam-server-queue-size>32</dspam-server-queue-size>
- <dspam-server-pid>/var/run/dspam/dspam.pid</dspam-server-pid>
- <dspam-server-mode>standard</dspam-server-mode>
- <dspam-server-params>--deliver=innocent -d %u</dspam-server-params>
- <dspam-server-id>abysseleven.abyssworld.de</dspam-server-id>
- <dspam-server-socket>/var/run/dspam/dspam.sock</dspam-server-socket>
- </config>
- </dspam>
- <package>
- <name>dspam</name>
- <website>http://dspam.nuclearelephant.com/</website>
- <descr>
- DSPAM is a scalable and open-source content-based spam filter designed for multi-user enterprise systems.
- On a properly configured system, many users experience results between 99.5% - 99.95%, or one error for
- every 200 to 2000 messages. DSPAM supports many different MTAs and can also be deployed as a stand-alone
- SMTP appliance.
- </descr>
- <config_file>http://www.abyssworld.de/packages/config/dspam.xml</config_file>
- <depends_on_package_base_url>http://www.abyssworld.de/packages/All/</depends_on_package_base_url>
- <depends_on_package>dspam-devel-3.6.4.20060315.1518.tbz</depends_on_package>
- <version>3.6.6</version>
- <status>ALPHA</status>
- <maintainer>me@daniel.stefan.haischt.name</maintainer>
- <logging>
- <facilityname>dspam</facilityname>
- </logging>
- </package>
- <package>
- <name>p3scan-pf</name>
- <descr>A transparent POP3-Proxy with virus-scanning- and spam-scanning-capabilities.</descr>
- <website>http://www.undergroundsecurity.com/p3scan/</website>
- <category>Security</category>
- <version>0.1</version>
- <status>ALPHA</status>
- <maintainer>fernando@netfilter.com.br</maintainer>
- <depends_on_package_base_url>https://www.pfsense.org/packages/All/</depends_on_package_base_url>
- <depends_on_package>p3scan-pf-2.3.2.tbz</depends_on_package>
- <config_file>https://packages.pfsense.org/packages/config/p3scan-pf/p3scan-pf.xml</config_file>
- <configurationfile>p3scan-pf.xml</configurationfile>
- </package>
- <package>
- <name>mysql</name>
- <website>http://www.mysql.com/</website>
- <descr>
- MySQL RDBMS.
- </descr>
- <config_file>http://www.abyssworld.de/packages/config/mysql.xml</config_file>
- <depends_on_package_base_url>http://www.abyssworld.de/packages/All/</depends_on_package_base_url>
- <depends_on_package>mysql-server-5.0.21.tbz</depends_on_package>
- <version>5.0.21</version>
- <status>ALPHA</status>
- <maintainer>me@daniel.stefan.haischt.name</maintainer>
- <logging>
- <facilityname>mysql</facilityname>
- </logging>
- </package>
- <package>
- <name>clamav</name>
- <website>http://www.clamav.net/</website>
- <descr>
- Clam Antivirus.
- </descr>
- <config_file>http://www.abyssworld.de/packages/config/clamav.xml</config_file>
- <depends_on_package_base_url>http://www.abyssworld.de/packages/All/</depends_on_package_base_url>
- <depends_on_package>clamav-devel-20060503_1.tbz</depends_on_package>
- <version>20060503_1</version>
- <status>ALPHA</status>
- <maintainer>me@daniel.stefan.haischt.name</maintainer>
- <logging>
- <facilityname>clamav</facilityname>
- </logging>
- </package>
- <package>
- <name>sshterm</name>
- <descr>
- This is a package of the SSHTools SSHTerm Java Applet. SSHTools is a
- suite of Java SSH applications providing a Java SSH API,
- SSH Terminal, SSH secured VNC client, SFTP client and SSH Daemon.
- </descr>
- <website>http://sourceforge.net/projects/sshtools/</website>
- <category>Security</category>
- <version>0.1</version>
- <status>ALPHA</status>
- <maintainer>me@daniel.stefan.haischt.name</maintainer>
- <depends_on_package_base_url>https://www.pfsense.org/packages/All/</depends_on_package_base_url>
- <depends_on_package>sshtools-0.2.2.tbz</depends_on_package>
- <config_file>https://packages.pfsense.org/packages/config/sshterm/sshterm.xml</config_file>
- <configurationfile>sshterm.xml</configurationfile>
- </package>
- <menu>
- <name>POP3 Proxy</name>
- <section>Services</section>
- <configfile>p3scan-pf.xml</configfile>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- <tooltiptext>A transparent POP3-Proxy with virus-scanning capabilities</tooltiptext>
- </menu>
- <menu>
- <name>DSPAM</name>
- <section>Services</section>
- <configfile>dspam.inc</configfile>
- <url>/dspam.php</url>
- </menu>
- <menu>
- <name>DSPAM Wizard</name>
- <section>Services</section>
- <configfile>dspam.inc</configfile>
- <url>/wizard.php?xml=dspam_wizard.xml</url>
- </menu>
- <menu>
- <name>Shell</name>
- <section>Diagnostics</section>
- <configfile>sshterm.xml</configfile>
- <url>/diag_shell.php</url>
- </menu>
- <service>
- <name>dspam</name>
- <description>DSPAM content-based spam filter</description>
- <rcfile>dspam.sh</rcfile>
- <executable>dspam</executable>
- </service>
- <service>
- <name>clamd</name>
- <description>Clam AntiVirus Scanner</description>
- <rcfile>010.clamav-clamd.sh</rcfile>
- <executable>clamd</executable>
- </service>
- <service>
- <description>Deamon that receives new AntiVirus signatures</description>
- <name>freshclam</name>
- <rcfile>020.clamav-freshclam.sh</rcfile>
- <executable>freshclam</executable>
- </service>
- <service>
- <name>mysql</name>
- <description>MySQL RDBMS</description>
- <rcfile>000.mysql.sh</rcfile>
- <executable>mysqld_safe</executable>
- </service>
- <service>
- <name>p3scan-pf</name>
- <description>
- p3scan is a pop3 antivirus proxy that can be used completely transparently with any pop3 mail client.
- </description>
- <rcfile>030.p3scan.sh</rcfile>
- <executable>p3scan</executable>
- </service>
- </installedpackages>
- <cron>
- <item>
- <minute>0</minute>
- <hour>*</hour>
- <mday>*</mday>
- <month>*</month>
- <wday>*</wday>
- <who>root</who>
- <command>/usr/bin/nice -n20 newsyslog</command>
- </item>
- <item>
- <minute>1,31</minute>
- <hour>0-5</hour>
- <mday>*</mday>
- <month>*</month>
- <wday>*</wday>
- <who>root</who>
- <command>/usr/bin/nice -n20 adjkerntz -a</command>
- </item>
- <item>
- <minute>1</minute>
- <hour>*</hour>
- <mday>1</mday>
- <month>*</month>
- <wday>*</wday>
- <who>root</who>
- <command>/usr/bin/nice -n20 /etc/rc.update_bogons.sh</command>
- </item>
- <item>
- <minute>*/60</minute>
- <hour>*</hour>
- <mday>*</mday>
- <month>*</month>
- <wday>*</wday>
- <who>root</who>
- <command>/usr/bin/nice -n20 /usr/local/sbin/expiretable -v -t 3600 sshlockout</command>
- </item>
- <item>
- <minute>1</minute>
- <hour>1</hour>
- <mday>*</mday>
- <month>*</month>
- <wday>*</wday>
- <who>root</who>
- <command>/usr/bin/nice -n20 /etc/rc.dyndns.update</command>
- </item>
- <item>
- <minute>*/5</minute>
- <hour>*</hour>
- <mday>*</mday>
- <month>*</month>
- <wday>*</wday>
- <who>root</who>
- <command>/usr/bin/nice -n20 /etc/ping_hosts.sh</command>
- </item>
- </cron>
-</pfsense>
diff --git a/config/archive/dspam/pear/Image/Canvas.php b/config/archive/dspam/pear/Image/Canvas.php
deleted file mode 100644
index e669807a..00000000
--- a/config/archive/dspam/pear/Image/Canvas.php
+++ /dev/null
@@ -1,733 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Canvas
- *
- * Canvas based creation of images to facilitate different output formats
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-
-/**
- * Specfies the path to the system location of font files.
- *
- * Remember trailing slash!
- *
- * This is set by default on Windows systems to %SystemRoot%\Fonts\
- */
-if (!defined('IMAGE_CANVAS_SYSTEM_FONT_PATH')) {
- if (isset($_SERVER['SystemRoot'])) {
- define('IMAGE_CANVAS_SYSTEM_FONT_PATH', $_SERVER['SystemRoot'] . '/Fonts/');
- } else {
- /**
- * @ignore
- */
- define('IMAGE_CANVAS_SYSTEM_FONT_PATH', '');
- }
-}
-
-/**
- * Class for handling different output formats
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- * @abstract
- */
-class Image_Canvas
-{
-
- /**
- * The leftmost pixel of the element on the canvas
- * @var int
- * @access private
- */
- var $_left = 0;
-
- /**
- * The topmost pixel of the element on the canvas
- * @var int
- * @access private
- */
- var $_top = 0;
-
- /**
- * The width of the graph
- * @var int
- * @access private
- */
- var $_width = 0;
-
- /**
- * The height of the graph
- * @var int
- * @access private
- */
- var $_height = 0;
-
- /**
- * Polygon vertex placeholder
- * @var array
- * @access private
- */
- var $_polygon = array();
-
- /**
- * The thickness of the line(s)
- * @var int
- * @access private
- */
- var $_thickness = 1;
-
- /**
- * The line style
- * @var mixed
- * @access private
- */
- var $_lineStyle = 'transparent';
-
- /**
- * The fill style
- * @var mixed
- * @access private
- */
- var $_fillStyle = 'transparent';
-
- /**
- * The font options
- * @var array
- * @access private
- */
- var $_font = array();
-
- /**
- * The default font
- * @var array
- * @access private
- */
- var $_defaultFont = array('name' => 'Courier New', 'color' => 'black', 'size' => 9);
-
- /**
- * Create the canvas.
- *
- * Parameters available:
- *
- * 'width' The width of the graph on the canvas
- *
- * 'height' The height of the graph on the canvas
- *
- * 'left' The left offset of the graph on the canvas
- *
- * 'top' The top offset of the graph on the canvas
- *
- * @param array $params Parameter array
- * @abstract
- */
- function Image_Canvas($params)
- {
- if (isset($params['left'])) {
- $this->_left = $params['left'];
- }
-
- if (isset($params['top'])) {
- $this->_top = $params['top'];
- }
-
- if (isset($params['width'])) {
- $this->_width = $params['width'];
- }
-
- if (isset($params['height'])) {
- $this->_height = $params['height'];
- }
-
- $this->setDefaultFont($this->_defaultFont);
- }
-
- /**
- * Get the x-point from the relative to absolute coordinates
- *
- * @param float $x The relative x-coordinate (in percentage of total width)
- * @return float The x-coordinate as applied to the canvas
- * @access private
- */
- function _getX($x)
- {
- return floor($this->_left + $x);
- }
-
- /**
- * Get the y-point from the relative to absolute coordinates
- *
- * @param float $y The relative y-coordinate (in percentage of total width)
- * @return float The y-coordinate as applied to the canvas
- * @access private
- */
- function _getY($y)
- {
- return floor($this->_top + $y);
- }
-
- /**
- * Get the width of the canvas
- *
- * @return int The width
- */
- function getWidth()
- {
- return $this->_width;
- }
-
- /**
- * Get the height of the canvas
- *
- * @return int The height
- */
- function getHeight()
- {
- return $this->_height;
- }
-
- /**
- * Sets the thickness of the line(s) to be drawn
- *
- * @param int $thickness The actual thickness (in pixels)
- */
- function setLineThickness($thickness)
- {
- $this->_thickness = $thickness;
- }
-
- /**
- * Sets the color of the line(s) to be drawn
- *
- * @param mixed $color The color of the line
- */
- function setLineColor($color)
- {
- $this->_lineStyle = $color;
- }
-
- /**
- * Sets the style of the filling of drawn objects.
- *
- * This method gives simple access to setFillColor(), setFillImage() and
- * setGradientFill()
- *
- * @param mixed $fill The fill style
- */
- function setFill($fill)
- {
- if (is_array($fill)) {
- $this->setGradientFill($fill);
- } elseif (file_exists($fill)) {
- $this->setFillImage($fill);
- } else {
- $this->setFillColor($fill);
- }
- }
-
- /**
- * Sets the color of the filling of drawn objects
- *
- * @param mixed $color The fill color
- */
- function setFillColor($color)
- {
- $this->_fillStyle = $color;
- }
-
- /**
- * Sets an image that should be used for filling
- *
- * @param string $filename The filename of the image to fill with
- */
- function setFillImage($filename)
- {
- }
-
- /**
- * Sets a gradient fill
- *
- * @param array $gradient Gradient fill options
- */
- function setGradientFill($gradient)
- {
- $this->_fillStyle = $gradient;
- }
-
- /**
- * Sets the font options.
- *
- * The $font array may have the following entries:
- *
- * 'name' The name of the font. This name must either be supported
- * natively by the canvas or mapped to a font using the font-mapping scheme
- *
- * 'size' Size in pixels
- *
- * 'angle' The angle with which to write the text
- *
- * @param array $fontOptions The font options.
- */
- function setFont($fontOptions)
- {
- $this->_font = $fontOptions;
-
- if (!isset($this->_font['color'])) {
- $this->_font['color'] = 'black';
- }
-
- if (!(isset($this->_font['angle'])) || ($this->_font['angle'] === false)) {
- $this->_font['angle'] = 0;
- }
-
- if (isset($this->_font['angle'])) {
- if ((($this->_font['angle'] > 45) && ($this->_font['angle'] < 135)) ||
- (($this->_font['angle'] > 225) && ($this->_font['angle'] < 315))
- ) {
- $this->_font['vertical'] = true;
- }
- }
-
- if ((!isset($this->_font['file'])) && (isset($this->_font['name']))) {
- include_once 'Image/Canvas/Tool.php';
- $this->_font['file'] = Image_Canvas_Tool::fontMap($this->_font['name']);
- }
- }
-
- /**
- * Sets the default font options.
- *
- * The $font array may have the following entries:
- *
- * 'name' The name of the font. This name must either be supported
- * natively by the canvas or mapped to a font using the font-mapping scheme
- *
- * 'size' Size in pixels
- *
- * 'angle' The angle with which to write the text
- *
- * @param array $fontOptions The font options.
- */
- function setDefaultFont($fontOptions)
- {
- $this->setFont($fontOptions);
- $this->_defaultFont = $this->_font;
- }
-
- /**
- * Resets the canvas.
- *
- * Includes fillstyle, linestyle, thickness and polygon
- *
- * @access private
- */
- function _reset()
- {
- $this->_lineStyle = false;
- $this->_fillStyle = false;
- $this->_thickness = 1;
- $this->_polygon = array();
- $this->_font = $this->_defaultFont;
- }
-
- /**
- * Reset the canvas.
- *
- * Includes fillstyle, linestyle, thickness and polygon
- */
- function reset()
- {
- $this->_reset();
- }
-
- /**
- * Draw a line end
- *
- * Parameter array:
- * 'x': int X point
- * 'y': int Y point
- * 'end': string The end type of the end
- * 'angle': int [optional] The angle with which to draw the end
- * @param array $params Parameter array
- */
- function drawEnd($params)
- {
- }
-
- /**
- * Draw a line
- *
- * Parameter array:
- * 'x0': int X start point
- * 'y0': int Y start point
- * 'x1': int X end point
- * 'y1': int Y end point
- * 'end0': string [optional] The end type of end0 (the start)
- * 'end1': string [optional] The end type of end1 (the end)
- * 'size0': int [optional] The size of end0
- * 'size1': int [optional] The size of end1
- * 'color': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function line($params)
- {
- $x0 = $this->_getX($params['x0']);
- $y0 = $this->_getY($params['y0']);
- $x1 = $this->_getX($params['x1']);
- $y1 = $this->_getY($params['y1']);
- if (isset($params['end0'])) {
- $angle = Image_Canvas_Tool::getAngle($x1, $y1, $x0, $y0);
- $this->drawEnd(
- array(
- 'end' => $params['end0'],
- 'x' => $params['x0'],
- 'y' => $params['y0'],
- 'angle' => $angle,
- 'color' => (isset($params['color0']) ? $params['color0'] : false),
- 'size' => $params['size0']
- )
- );
- }
- if (isset($params['end1'])) {
- $angle = Image_Canvas_Tool::getAngle($x0, $y0, $x1, $y1);
- //print "<pre>"; var_dump($params, $angle); print "</pre>";
- $this->drawEnd(
- array(
- 'end' => $params['end1'],
- 'x' => $params['x1'],
- 'y' => $params['y1'],
- 'angle' => $angle,
- 'color' => (isset($params['color1']) ? $params['color1'] : false),
- 'size' => $params['size1']
- )
- );
- }
- $this->_reset();
- }
-
- /**
- * Adds vertex to a polygon
- *
- * Parameter array:
- * 'x': int X point
- * 'y': int Y point
- * 'url': string [optional] URL to link the vertex to (must be used with 'map_vertices' in polygon() on a canvas that support image maps)
- * 'alt': string [optional] Alternative text to show in the image map (must be used with 'map_vertices' in polygon() on a canvas that support image maps)
- * 'target': string [optional] The link target on the image map (must be used with 'map_vertices' in polygon() on a canvas that support image maps)
- * 'mapsize': int [optional] The size of the "map", i.e. the size of the hot spot (must be used with 'map_vertices' in polygon() on a canvas that support image maps)
- * @param array $params Parameter array
- */
- function addVertex($params)
- {
- $params['X'] = $this->_getX($params['x']);
- $params['Y'] = $this->_getY($params['y']);
- $this->_polygon[] = $params;
- }
-
- /**
- * Adds "splined" vertex to a polygon
- *
- * Parameter array:
- * 'x': int X point
- * 'y': int Y point
- * 'p1x': int X Control point 1
- * 'p1y': int Y Control point 1
- * 'p2x': int X Control point 2
- * 'p2y': int Y Control point 2
- * 'url': string [optional] URL to link the vertex to (must be used with 'map_vertices' in polygon() on a canvas that support image maps)
- * 'alt': string [optional] Alternative text to show in the image map (must be used with 'map_vertices' in polygon() on a canvas that support image maps)
- * 'target': string [optional] The link target on the image map (must be used with 'map_vertices' in polygon() on a canvas that support image maps)
- * 'mapsize': int [optional] The size of the "map", i.e. the size of the hot spot (must be used with 'map_vertices' in polygon() on a canvas that support image maps)
- * @param array $params Parameter array
- */
- function addSpline($params)
- {
- $params['X'] = $this->_getX($params['x']);
- $params['Y'] = $this->_getY($params['y']);
- $params['P1X'] = $this->_getX($params['p1x']);
- $params['P1Y'] = $this->_getY($params['p1y']);
- $params['P2X'] = $this->_getX($params['p2x']);
- $params['P2Y'] = $this->_getY($params['p2y']);
- $this->_polygon[] = $params;
- }
-
- /**
- * Draws a polygon
- *
- * Parameter array:
- * 'connect': bool [optional] Specifies whether the start point should be
- * connected to the endpoint (closed polygon) or not (connected line)
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function polygon($params)
- {
- $this->_reset();
- }
-
- /**
- * Draw a rectangle
- *
- * Parameter array:
- * 'x0': int X start point
- * 'y0': int Y start point
- * 'x1': int X end point
- * 'y1': int Y end point
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function rectangle($params)
- {
- $this->_reset();
- }
-
- /**
- * Draw an ellipse
- *
- * Parameter array:
- * 'x': int X center point
- * 'y': int Y center point
- * 'rx': int X radius
- * 'ry': int Y radius
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function ellipse($params)
- {
- $this->_reset();
- }
-
- /**
- * Draw a pie slice
- *
- * Parameter array:
- * 'x': int X center point
- * 'y': int Y center point
- * 'rx': int X radius
- * 'ry': int Y radius
- * 'v1': int The starting angle (in degrees)
- * 'v2': int The end angle (in degrees)
- * 'srx': int [optional] Starting X-radius of the pie slice (i.e. for a doughnut)
- * 'sry': int [optional] Starting Y-radius of the pie slice (i.e. for a doughnut)
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function pieslice($params)
- {
- $this->_reset();
- }
-
- /**
- * Get the width of a text,
- *
- * @param string $text The text to get the width of
- * @return int The width of the text
- */
- function textWidth($text)
- {
- }
-
- /**
- * Get the height of a text,
- *
- * @param string $text The text to get the height of
- * @return int The height of the text
- */
- function textHeight($text)
- {
- }
-
- /**
- * Writes text
- *
- * Parameter array:
- * 'x': int X-point of text
- * 'y': int Y-point of text
- * 'text': string The text to add
- * 'alignment': array [optional] Alignment
- * 'color': mixed [optional] The color of the text
- */
- function addText($params)
- {
- $this->_reset();
- }
-
- /**
- * Overlay image
- *
- * Parameter array:
- * 'x': int X-point of overlayed image
- * 'y': int Y-point of overlayed image
- * 'filename': string The filename of the image to overlay
- * 'width': int [optional] The width of the overlayed image (resizing if possible)
- * 'height': int [optional] The height of the overlayed image (resizing if possible)
- * 'alignment': array [optional] Alignment
- */
- function image($params)
- {
- }
-
- /**
- * Set clipping to occur
- *
- * Parameter array:
- *
- * 'x0': int X point of Upper-left corner
- * 'y0': int X point of Upper-left corner
- * 'x1': int X point of lower-right corner
- * 'y1': int Y point of lower-right corner
- */
- function setClipping($params = false)
- {
- }
-
- /**
- * Start a group.
- *
- * What this does, depends on the canvas/format.
- *
- * @param string $name The name of the group
- */
- function startGroup($name = false)
- {
- }
-
- /**
- * End the "current" group.
- *
- * What this does, depends on the canvas/format.
- */
- function endGroup()
- {
- }
-
- /**
- * Output the result of the canvas to the browser
- *
- * @param array $params Parameter array, the contents and meaning depends on the actual Canvas
- * @abstract
- */
- function show($params = false)
- {
- if ($params === false) {
- header('Expires: Tue, 2 Jul 1974 17:41:00 GMT'); // Date in the past
- header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified
- header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1
- header('Pragma: no-cache');
- }
- }
-
- /**
- * Save the result of the canvas to a file
- *
- * Parameter array:
- * 'filename': string The file to output to
- * @param array $params Parameter array, the contents and meaning depends on the actual Canvas
- * @abstract
- */
- function save($params = false)
- {
- }
-
- /**
- * Get a canvas specific HTML tag.
- *
- * This method implicitly saves the canvas to the filename in the
- * filesystem path specified and parses it as URL specified by URL path
- *
- * Parameter array:
- * 'filename': string
- * 'filepath': string Path to the file on the file system. Remember the final slash
- * 'urlpath': string Path to the file available through an URL. Remember the final slash
- */
- function toHtml($params)
- {
- $this->save(array('filename' => $params['filepath'] . $params['filename']));
- }
-
- /**
- * Canvas factory method.
- *
- * Supported canvass are:
- *
- * 'png': output in PNG format (using GD)
- *
- * 'jpg': output in JPEG format (using GD)
- *
- * 'pdf': output in PDF format (using PDFlib)
- *
- * 'svg': output in SVG format
- *
- * 'imagemap': output as a html image map
- *
- * An example of usage:
- *
- * <code>
- * <?php
- * $Canvas =& Image_Graph::factory('png',
- * array('width' => 800, 'height' => 600, 'antialias' => 'native')
- * );
- * ?>
- * </code>
- *
- * @param string $canvas The canvas type
- * @param array $params The parameters for the canvas constructor
- * @return Image_Canvas The newly created canvas
- * @static
- */
- function &factory($canvas, $params)
- {
- $canvas = strtoupper($canvas);
-
- if (($canvas == 'PNG') || ($canvas == 'GD')) {
- $canvas = 'GD_PNG';
- }
- if (($canvas == 'JPG') || ($canvas == 'JPEG')) {
- $canvas = 'GD_JPG';
- }
-
- if ($canvas == 'IMAGEMAP') {
- $canvas = 'ImageMap';
- }
-
- $class = 'Image_Canvas_'. $canvas;
- include_once 'Image/Canvas/'. str_replace('_', '/', $canvas) . '.php';
-
- $obj =& new $class($params);
- return $obj;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Canvas/Color.php b/config/archive/dspam/pear/Image/Canvas/Color.php
deleted file mode 100644
index 0ac78553..00000000
--- a/config/archive/dspam/pear/Image/Canvas/Color.php
+++ /dev/null
@@ -1,182 +0,0 @@
-<?php
-/* vim: set expandtab tabstop=4 shiftwidth=4: */
-// +----------------------------------------------------------------------+
-// | PHP Version 4 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2003 The PHP Group |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license, |
-// | that is bundled with this package in the file LICENSE, and is |
-// | available at through the world-wide-web at |
-// | http://www.php.net/license/2_02.txt. |
-// | If you did not receive a copy of the PHP license and are unable to |
-// | obtain it through the world-wide-web, please send a note to |
-// | license@php.net so we can mail you a copy immediately. |
-// +----------------------------------------------------------------------+
-// | Author: Stefan Neufeind <pear.neufeind@speedpartner.de> |
-// +----------------------------------------------------------------------+
-//
-// $Id$
-
-/**
-* Class for color-handling
-*
-* @author Stefan Neufeind <pear.neufeind@speedpartner.de>
-* @package Image_Canvas
-* @category images
-* @license The PHP License, version 2.02
-*/
-
-/**
-* Color class to be extended; from package PEAR::Image_Color
-*/
-require_once 'Image/Color.php';
-
-/**
-* Class for color-handling
-*
-* This is used to extend the functionality of the current PEAR::Image_Color v0.4.
-* I hope to be allowed to incorporate some of the improvements in a new Image_Color release.
-*
-* @author Stefan Neufeind <pear.neufeind@speedpartner.de>
-* @package Image_Canvas
-* @access public
-*/
-class Image_Canvas_Color extends Image_Color
-{
- /**
- * Allocates a color in the given image.
- *
- * Userdefined color specifications get translated into
- * an array of rgb values.
- *
- * @param resource GD-resource
- * @param mixed any color representation supported by color2RGB()
- * @return resource Image color handle
- * @see color2RGB()
- * @access public
- * @static
- */
- function allocateColor(&$img, $color)
- {
- $color = Image_Canvas_Color::color2RGB($color);
-
- if (($color[3] == 255) || (!function_exists("imagecolorallocatealpha"))) {
- return imagecolorallocate($img, $color[0], $color[1], $color[2]);
- } else {
- return imagecolorallocatealpha($img, $color[0], $color[1], $color[2], 127-round(($color[3]*127)/255));
- }
- }
-
- /**
- * Convert any color-representation into an array of 4 ints (RGBA).
- *
- * Userdefined color specifications get translated into
- * an array of rgb values.
- *
- * @param mixed any color representation supported by Image_Canvas_Color::color2RGB()
- * @return array Array of 4 ints (RGBA-representation)
- * @access public
- * @static
- */
- function color2RGB($color)
- {
- if (is_array($color)) {
- if (!is_numeric($color[0])) {
- return null; // error
- }
- if (count($color) == 3) { // assume RGB-color
-
- // 255 = alpha-value; full opaque
- return array((int) $color[0],
- (int) $color[1],
- (int) $color[2],
- 255);
- }
- if (count($color) == 4) { // assume RGBA-color
-
- // 255 = alpha-value; full opaque
- return array((int) $color[0],
- (int) $color[1],
- (int) $color[2],
- (int) $color[3]);
- }
- return null; // error
- } elseif (is_string($color)) {
- $alphaPos = strpos($color, '@');
- if ($alphaPos === false) {
- $alpha = 255;
- } else {
- $alphaFloat = (float) substr($color, $alphaPos+1);
- // restrict to range 0..1
- $alphaFloat = max(min($alphaFloat, 1), 0);
- $alpha = (int) round((float) 255 * $alphaFloat);
- $color = substr($color, 0, $alphaPos);
- }
- if ($color[0] == '#') { // hex-color given, e.g. #FFB4B4
- $tempColor = parent::hex2rgb($color);
- return array((int) $tempColor[0],
- (int) $tempColor[1],
- (int) $tempColor[2],
- $alpha);
- }
- if (strpos($color,'%') !== false) {
- $tempColor = parent::percentageColor2RGB($color);
- return array((int) $tempColor[0],
- (int) $tempColor[1],
- (int) $tempColor[2],
- $alpha);
- } else {
- $tempColor = parent::namedColor2RGB($color);
- return array((int) $tempColor[0],
- (int) $tempColor[1],
- (int) $tempColor[2],
- $alpha);
- }
- } else {
- return null; // error
- }
- }
-
- /**
- * getRange
- * Given a degree, you can get the range of colors between one color and
- * another color.
- *
- * @access public
- * @param string How much each 'step' between the colors we should take.
- * @return array Returns an array of all the colors, one element for each color.
- */
- function getRange ($degrees)
- {
- $tempColors = parent::getRange($degrees);
-
- // now add alpha-channel information
- $steps = count($tempColors);
- for($counter=0;$counter<$steps;$counter++) {
- $tempColors[$counter] = parent::hex2rgb($tempColors[$counter]);
- unset($tempColors[$counter]['hex']);
- $tempColors[$counter][3] = (int) round(
- (((float) $this->color1[3]*($steps-$counter))+
- ((float) $this->color2[3]*($counter))
- ) / $steps
- );
- }
-
- return $tempColors;
- }
-
- /**
- * Internal method to correctly set the colors.
- *
- * @param mixed color 1
- * @param mixed color 2
- * @access private
- */
- function _setColors ( $col1, $col2 )
- {
- $this->color1 = Image_Canvas_Color::color2RGB($col1);
- $this->color2 = Image_Canvas_Color::color2RGB($col2);
- }
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Canvas/Fonts/README b/config/archive/dspam/pear/Image/Canvas/Fonts/README
deleted file mode 100644
index 0a836147..00000000
--- a/config/archive/dspam/pear/Image/Canvas/Fonts/README
+++ /dev/null
@@ -1,12 +0,0 @@
-This is where the font files are located.
-
-Font files can be found at:
-
-MS CoreFonts
- http://corefonts.sourceforge.net/
-
-Divide By Zero (most are cartoonish)
- http://fonts.tom7.com/
-
-MING FDB Fonts
- http://ming.sf.net/ \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Canvas/Fonts/fontmap.txt b/config/archive/dspam/pear/Image/Canvas/Fonts/fontmap.txt
deleted file mode 100644
index ccec67dd..00000000
--- a/config/archive/dspam/pear/Image/Canvas/Fonts/fontmap.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-Arial,arial.ttf
-Arial Bold,arialbd.ttf
-Arial Bold Italic,arialbi.ttf
-Arial Italic,ariali.ttf
-Courier New,cour.ttf
-Courier New Bold,courbd.ttf
-Courier New Bold Italic,courbi.ttf
-Courier New Italic,couri.ttf
-Garamond,gara.ttf
-Garamond Bold,garabd.ttf
-Garamond Italic,garait.ttf
-Gothic,gothic.ttf
-Gothic Bold,gothicb.ttf
-Gothic Bold Italic,gothicbi.ttf
-Gothic Italic,gothici.ttf
-Sans Serif,micross.ttf
-Reference Sans Serif,refsan.ttf
-Times New Roman,times.ttf
-Times New Roman Bold,timesbd.ttf
-Times New Roman Bold Italic,timesbi.ttf
-Times New Roman Italic,timesi.ttf
-Verdana,verdana.ttf
-Verdana Bold,verdanab.ttf
-Verdana Bold Italic,verdanaz.ttf
-Verdana Italic,verdanai.ttf \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Canvas/GD.php b/config/archive/dspam/pear/Image/Canvas/GD.php
deleted file mode 100644
index 40132899..00000000
--- a/config/archive/dspam/pear/Image/Canvas/GD.php
+++ /dev/null
@@ -1,1693 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Canvas
- *
- * Class for handling output in GD compatible format.
- *
- * Supported formats are PNG, JPEG, GIF and WBMP.
- *
- * Requires PHP extension GD
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-
-/**
- * Include file Image/Canvas.php
- */
-require_once 'Image/Canvas/WithMap.php';
-
-/**
- * Include file Image/Canvas/Color.php
- */
-require_once 'Image/Canvas/Color.php';
-
-/**
- * Canvas class to output using PHP GD support.
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- * @abstract
- */
-class Image_Canvas_GD extends Image_Canvas_WithMap
-{
-
- /**
- * The canvas of the graph
- * @var resource
- * @access private
- */
- var $_canvas;
-
- /**
- * The canvas to use for tiled filling
- * @var resource
- * @access private
- */
- var $_tileImage = null;
-
- /**
- * Is version GD2 installed?
- * @var bool
- * @access private
- */
- var $_gd2 = true;
-
- /**
- * Antialiasing?
- *
- * Possible values 'off', 'driver' and 'native'
- *
- * @var string
- * @access private
- */
- var $_antialias = 'off';
-
- var $_alpha = false;
-
- var $_clipping = array();
-
- /**
- * Create the GD canvas.
- *
- * Parameters available:
- *
- * 'width' The width of the graph on the canvas
- *
- * 'height' The height of the graph on the canvas
- *
- * 'left' The left offset of the graph on the canvas
- *
- * 'top' The top offset of the graph on the canvas
- *
- * 'antialias' = 'native' enables native GD antialiasing - this
- * method has no severe impact on performance (approx +5%). Requires PHP
- * 4.3.2 (with bundled GD2)
- *
- * 'antialias' = {true|'driver'} Image_Graph implemented method. This method
- * has a severe impact on performance, drawing an antialiased line this
- * way is about XX times slower, with an overall performance impact of
- * about +40%. The justification for this method is that if native support
- * is not available this can be used, it is also a future feature that this
- * method for antialiasing will support line styles.
- *
- * Use antialiased for best results with a line/area chart having just a few
- * datapoints. Native antialiasing does not provide a good appearance with
- * short lines, as for example with smoothed charts. Antialiasing does not
- * (currently) work with linestyles, neither native nor driver method!
- *
- * 'noalpha' = true If alpha blending is to be disabled
- *
- * 'filename' An image to open, on which the graph is created on
- *
- * 'gd' A GD resource to add the image to, use this option to continue
- * working on an already existing GD resource. Make sure this is passed 'by-
- * reference' (using &amp;)
- *
- * 'usemap' Initialize an image map
- *
- * 'gd' and 'filename' are mutually exclusive with 'gd' as preference
- *
- * 'width' and 'height' are required unless 'filename' or 'gd' are
- * specified, in which case the width and height are taken as the actual
- * image width/height. If the latter is the case and 'left' and/or 'top' was
- * also specified, the actual 'width'/'height' are altered so that the graph
- * fits inside the canvas (i.e 'height' = actual height - top, etc.)
- *
- * @param array $param Parameter array
- */
- function Image_Canvas_GD($param)
- {
- include_once 'Image/Canvas/Color.php';
-
- parent::Image_Canvas_WithMap($param);
-
- $this->_gd2 = ($this->_version() == 2);
- $this->_font = array('font' => 1, 'color' => 'black');
-
- if ((isset($param['gd'])) && (is_resource($param['gd']))) {
- $this->_canvas =& $param['gd'];
- } elseif (isset($param['filename'])) {
- $this->_canvas =& $this->_getGD($param['filename']);
- } else {
- if ($this->_gd2) {
- $this->_canvas = ImageCreateTrueColor(
- $this->_width,
- $this->_height
- );
- if ((!isset($param['noalpha'])) || ($param['noalpha'] !== true)) {
- ImageAlphaBlending($this->_canvas, true);
- $this->_alpha = true;
- }
- } else {
- $this->_canvas = ImageCreate($this->_width, $this->_height);
- }
- }
-
- if (isset($param['antialias'])) {
- $this->_antialias = $param['antialias'];
- }
-
- if ($this->_antialias === true) {
- $this->_antialias = 'driver';
- }
-
- if (($this->_gd2) && ($this->_antialias === 'native')) {
- ImageAntialias($this->_canvas, true);
- }
- }
-
- /**
- * Get an GD image resource from a file
- *
- * @param string $filename
- * @return mixed The GD image resource
- * @access private
- */
- function &_getGD($filename)
- {
- $info = getimagesize($filename);
-
- $result = null;
- switch($info[2]) {
- case IMG_PNG:
- $result =& ImageCreateFromPNG($filename);
- break;
-
- case IMG_JPG:
- $result =& ImageCreateFromJPEG($filename);
- break;
-
- case IMG_GIF:
- $result =& ImageCreateFromGIF($filename);
- break;
- }
- return $result;
- }
-
- /**
- * Get the color index for the RGB color
- *
- * @param int $color The color
- * @return int The GD image index of the color
- * @access private
- */
- function _color($color = false)
- {
- if (($color === false) || ($color === 'opague') || ($color === 'transparent')) {
- return ImageColorTransparent($this->_canvas);
- } else {
- return Image_Canvas_Color::allocateColor($this->_canvas, $color);
- }
- }
-
- /**
- * Get the GD applicable linestyle
- *
- * @param mixed $lineStyle The line style to return, false if the one
- * explicitly set
- * @return mixed A GD compatible linestyle
- * @access private
- */
- function _getLineStyle($lineStyle = false)
- {
- if ($this->_gd2) {
- ImageSetThickness($this->_canvas, $this->_thickness);
- }
-
- if ($lineStyle == 'transparent') {
- return false;
- } elseif ($lineStyle === false) {
- if (is_array($this->_lineStyle)) {
- $colors = array();
- foreach ($this->_lineStyle as $color) {
- if ($color === 'transparent') {
- $color = false;
- }
- $colors[] = $this->_color($color);
- }
- ImageSetStyle($this->_canvas, $colors);
- return IMG_COLOR_STYLED;
- } else {
- return $this->_color($this->_lineStyle);
- }
- } else {
- return $this->_color($lineStyle);
- }
- }
-
- /**
- * Get the GD applicable fillstyle
- *
- * @param mixed $fillStyle The fillstyle to return, false if the one
- * explicitly set
- * @return mixed A GD compatible fillstyle
- * @access private
- */
- function _getFillStyle($fillStyle = false, $x0 = 0, $y0 = 0, $x1 = 0, $y1 = 0)
- {
- if ($this->_tileImage != null) {
- ImageDestroy($this->_tileImage);
- $this->_tileImage = null;
- }
- if ($fillStyle == 'transparent') {
- return false;
- } elseif ($fillStyle === false) {
- if (is_resource($this->_fillStyle)) {
- $x = min($x0, $x1);
- $y = min($y0, $y1);
- $w = abs($x1 - $x0) + 1;
- $h = abs($y1 - $y0) + 1;
- if ($this->_gd2) {
- $this->_tileImage = ImageCreateTrueColor(
- $this->getWidth(),
- $this->getHeight()
- );
-
- ImageCopyResampled(
- $this->_tileImage,
- $this->_fillStyle,
- $x,
- $y,
- 0,
- 0,
- $w,
- $h,
- ImageSX($this->_fillStyle),
- ImageSY($this->_fillStyle)
- );
- } else {
- $this->_tileImage = ImageCreate(
- $this->getWidth(),
- $this->getHeight()
- );
-
- ImageCopyResized(
- $this->_tileImage,
- $this->_fillStyle,
- $x,
- $y,
- 0,
- 0,
- $w,
- $h,
- ImageSX($this->_fillStyle),
- ImageSY($this->_fillStyle)
- );
- }
- ImageSetTile($this->_canvas, $this->_tileImage);
- return IMG_COLOR_TILED;
- } elseif ((is_array($this->_fillStyle)) && (isset($this->_fillStyle['direction']))) {
- $width = abs($x1 - $x0) + 1;
- $height = abs($y1 - $y0) + 1;
-
- switch ($this->_fillStyle['direction']) {
- case 'horizontal':
- $count = $width;
- break;
-
- case 'vertical':
- $count = $height;
- break;
-
- case 'horizontal_mirror':
- $count = $width / 2;
- break;
-
- case 'vertical_mirror':
- $count = $height / 2;
- break;
-
- case 'diagonal_tl_br':
- case 'diagonal_bl_tr':
- $count = sqrt($width * $width + $height * $height);
- break;
-
- case 'radial':
- $count = max($width, $height, sqrt($width * $width + $height * $height)) + 1;
- break;
-
- }
-
- $count = round($count);
-
- if ($this->_gd2) {
- $this->_tileImage = ImageCreateTrueColor(
- $this->getWidth(),
- $this->getHeight()
- );
- } else {
- $this->_tileImage = ImageCreate(
- $this->getWidth(),
- $this->getHeight()
- );
- }
-
-
- $startColor = Image_Canvas_Color::color2RGB(
- ($this->_fillStyle['direction'] == 'radial' ?
- $this->_fillStyle['end'] :
- $this->_fillStyle['start']
- )
- );
- $endColor = Image_Canvas_Color::color2RGB(
- ($this->_fillStyle['direction'] == 'radial' ?
- $this->_fillStyle['start'] :
- $this->_fillStyle['end']
- )
- );
-
- $redIncrement = ($endColor[0] - $startColor[0]) / $count;
- $greenIncrement = ($endColor[1] - $startColor[1]) / $count;
- $blueIncrement = ($endColor[2] - $startColor[2]) / $count;
-
- $color = false;
- for ($i = 0; $i < $count; $i ++) {
- unset($color);
- if ($i == 0) {
- $color = $startColor;
- unset($color[3]);
- } else {
- $color[0] = round(($redIncrement * $i) +
- $redIncrement + $startColor[0]);
- $color[1] = round(($greenIncrement * $i) +
- $greenIncrement + $startColor[1]);
- $color[2] = round(($blueIncrement * $i) +
- $blueIncrement + $startColor[2]);
- }
- $color = Image_Canvas_Color::allocateColor(
- $this->_tileImage,
- $color
- );
-
- switch ($this->_fillStyle['direction']) {
- case 'horizontal':
- ImageLine($this->_tileImage,
- $x0 + $i,
- $y0,
- $x0 + $i,
- $y1, $color);
- break;
-
- case 'vertical':
- ImageLine($this->_tileImage,
- $x0,
- $y1 - $i,
- $x1,
- $y1 - $i, $color);
- break;
-
- case 'horizontal_mirror':
- if (($x0 + $i) <= ($x1 - $i)) {
- ImageLine($this->_tileImage,
- $x0 + $i,
- $y0,
- $x0 + $i,
- $y1, $color);
-
- ImageLine($this->_tileImage,
- $x1 - $i,
- $y0,
- $x1 - $i,
- $y1, $color);
- }
- break;
-
- case 'vertical_mirror':
- if (($y0 + $i) <= ($y1 - $i)) {
- ImageLine($this->_tileImage,
- $x0,
- $y0 + $i,
- $x1,
- $y0 + $i, $color);
- ImageLine($this->_tileImage,
- $x0,
- $y1 - $i,
- $x1,
- $y1 - $i, $color);
- }
- break;
-
- case 'diagonal_tl_br':
- if (($i > $width) && ($i > $height)) {
- $polygon = array (
- $x1, $y0 + $i - $width - 1,
- $x1, $y1,
- $x0 + $i - $height - 1, $y1);
- } elseif ($i > $width) {
- $polygon = array (
- $x0, $y0 + $i,
- $x0, $y1,
- $x1, $y1,
- $x1, $y0 + $i - $width - 1);
- } elseif ($i > $height) {
- $polygon = array (
- $x0 + $i - $height - 1, $y1,
- $x1, $y1,
- $x1, $y0,
- $x0 + $i, $y0);
- } else {
- $polygon = array (
- $x0, $y0 + $i,
- $x0, $y1,
- $x1, $y1,
- $x1, $y0,
- $x0 + $i, $y0);
- }
- ImageFilledPolygon(
- $this->_tileImage,
- $polygon,
- count($polygon) / 2,
- $color
- );
- break;
-
- case 'diagonal_bl_tr':
- if (($i > $width) && ($i > $height)) {
- $polygon = array (
- $x1, $y1 - $i + $width - 1,
- $x1, $y0,
- $x0 + $i - $height - 1, $y0);
- } elseif ($i > $width) {
- $polygon = array (
- $x0, $y1 - $i,
- $x0, $y0,
- $x1, $y0,
- $x1, $y1 - $i + $width - 1);
- } elseif ($i > $height) {
- $polygon = array (
- $x0 + $i - $height - 1, $y0,
- $x1, $y0,
- $x1, $y1,
- $x0 + $i, $y1);
- } else {
- $polygon = array (
- $x0, $y1 - $i,
- $x0, $y0,
- $x1, $y0,
- $x1, $y1,
- $x0 + $i, $y1);
- }
- ImageFilledPolygon(
- $this->_tileImage,
- $polygon,
- count($polygon) / 2,
- $color
- );
- break;
-
- case 'radial':
- if (($this->_gd2) && ($i < $count)) {
- ImageFilledEllipse(
- $this->_tileImage,
- $x0 + $width / 2,
- $y0 + $height / 2,
- $count - $i,
- $count - $i,
- $color
- );
- }
- break;
- }
- }
- ImageSetTile($this->_canvas, $this->_tileImage);
- return IMG_COLOR_TILED;
- } else {
- return $this->_color($this->_fillStyle);
- }
- } else {
- return $this->_color($fillStyle);
- }
- }
-
- /**
- * Sets an image that should be used for filling
- *
- * @param string $filename The filename of the image to fill with
- */
- function setFillImage($filename)
- {
- $this->_fillStyle =& $this->_getGD($filename);
- }
-
- /**
- * Sets the font options.
- *
- * The $font array may have the following entries:
- *
- * 'ttf' = the .ttf file (either the basename, filename or full path)
- * If 'ttf' is specified, then the following can be specified
- *
- * 'size' = size in pixels
- *
- * 'angle' = the angle with which to write the text
- *
- * @param array $font The font options.
- */
- function setFont($fontOptions)
- {
- parent::setFont($fontOptions);
-
- if (isset($this->_font['ttf'])) {
- $this->_font['file'] = str_replace('\\', '/', Image_Canvas_Tool::fontMap($this->_font['ttf']));
- } elseif (!isset($this->_font['font'])) {
- $this->_font['font'] = 1;
- }
-
- if (!isset($this->_font['color'])) {
- $this->_font['color'] = 'black';
- }
-
- if ((isset($this->_font['angle'])) && ($this->_font['angle'] === false)) {
- $this->_font['angle'] = 0;
- }
- }
-
- /**
- * Calculate pixels on a line
- *
- * @param int $x0 X start point
- * @param int $y0 X start point
- * @param int $x1 X end point
- * @param int $y1 Y end point
- * @return array An associated array of x,y points with all pixels on the
- * line
- * @access private
- */
- function &_linePixels($x0, $y0, $x1, $y1)
- {
- $pixels = array();
- if (abs($x0 - $x1) > abs($y0 - $y1)) {
- if ($x1 != $x0) {
- $m = ($y1 - $y0) / ($x1 - $x0);
- } else {
- $m = 0;
- }
- $b = $y0 - $m * $x0;
- $strx = min($x0, $x1);
- $endx = max($x0, $x1);
- for ($x = $strx; $x <= $endx; $x++) {
- $pixels[] = array('X' => $x, 'Y' => ($m * $x + $b));
- }
- } else {
- if ($y1 != $y0) {
- $m = ($x1 - $x0) / ($y1 - $y0);
- } else {
- $m = 0;
- }
- $b = $x0 - $m * $y0;
- $stry = min($y0, $y1);
- $endy = max($y0, $y1);
- for ($y = $stry; $y <= $endy; $y++) {
- $pixels[] = array('X' => ($m * $y + $b), 'Y' => $y);
- }
- }
- return $pixels;
- }
-
- /**
- * Draws an antialiased line
- *
- * @param int $x0 X start point
- * @param int $y0 X start point
- * @param int $x1 X end point
- * @param int $y1 Y end point
- * @param mixed $color The line color, can be omitted
- * @access private
- */
- function _antialiasedLine($x0, $y0, $x1, $y1, $color = false)
- {
- if (($line = $this->_getLineStyle($color)) !== false) {
- if ($line >= 0) {
- $line = ImageColorsForIndex($this->_canvas, $line);
- $pixels = &$this->_linePixels($x0, $y0, $x1, $y1);
- foreach ($pixels as $point) {
- $this->_antialiasedPixel($point['X'], $point['Y'], $line);
- }
- unset($pixels);
- }
- }
- }
-
-
- /**
- * Draws an antialiased pixel
- *
- * @param int $x X point
- * @param int $y Y point
- * @param mixed $color The pixel color
- * @access private
- */
- function _antialiasedPixel($x, $y, $color)
- {
- $fx = floor($x);
- $fy = floor($y);
- $cx = ceil($x);
- $cy = ceil($y);
- $xa = $x - $fx;
- $xb = $cx - $x;
- $ya = $y - $fy;
- $yb = $cy - $y;
- if (($cx == $fx) && ($cy == $fy)) {
- $this->_antialisedSubPixel($fx, $fy, 0.0, 1.0, $color);
- } else {
- $this->_antialisedSubPixel($fx, $fy, $xa + $ya, $xb + $yb, $color);
- if ($cy != $fy) {
- $this->_antialisedSubPixel($fx, $cy, $xa + $yb, $xb + $ya, $color);
- }
- if ($cx != $fx) {
- $this->_antialisedSubPixel($cx, $fy, $xb + $ya, $xa + $yb, $color);
- if ($cy != $fy) {
- $this->_antialisedSubPixel($cx, $cy, $xb + $yb, $xa + $ya, $color);
- }
- }
- }
- }
-
- /**
- * Antialias'es the pixel around x,y with weights a,b
- *
- * @param int $x X point
- * @param int $y Y point
- * @param int $a The weight of the current color
- * @param int $b The weight of the applied/wanted color
- * @param mixed $color The pixel color
- * @access private
- */
- function _antialisedSubPixel($x, $y, $a, $b, $color)
- {
- $x = $this->_getX($x);
- $y = $this->_getX($y);
- if (($x >=0 ) && ($y >= 0) && ($x < $this->getWidth()) && ($y < $this->getHeight())) {
- $tempColor = ImageColorsForIndex($this->_canvas, ImageColorAt($this->_canvas, $x, $y));
-
- $newColor[0] = min(255, round($tempColor['red'] * $a + $color['red'] * $b));
- $newColor[1] = min(255, round($tempColor['green'] * $a + $color['green'] * $b));
- $newColor[2] = min(255, round($tempColor['blue'] * $a + $color['blue'] * $b));
- //$newColor[3] = 0;
- $color = '#';
- foreach ($newColor as $acolor) {
- $color .= sprintf('%02s', dechex($acolor));
- }
- $newColor = $this->_color($color);//,'rgb(' . $newColor[0] . ',' . $newColor[1] . ',' . $newColor[2] .')';
-
- ImageSetPixel($this->_canvas, $x, $y, $newColor);
- }
- }
-
-
- /**
- * Draw a line end
- *
- * Parameter array:
- *
- * 'x': int X point
- *
- * 'y': int Y point
- *
- * 'end': string The end type of the end
- *
- * 'size': int The size of the end
- *
- * 'color': string The color of the end
- *
- * 'angle': int [optional] The angle with which to draw the end
- *
- * @param array $params Parameter array
- */
- function drawEnd($params)
- {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $size = $params['size'];
- //var_dump($params);
- $angle = deg2rad((isset($params['angle']) ? $params['angle'] : 0));
- $pi2 = pi() / 2;
- switch ($params['end']) {
- case 'lollipop':
- case 'circle':
- $this->ellipse(
- array(
- 'x' => $x,
- 'y' => $y,
- 'rx' => $size / 2,
- 'ry' => $size / 2,
- 'fill' => $params['color'],
- 'line' => $params['color']
- )
- );
- break;
- case 'diamond':
- $x0 = round($params['x'] + cos($angle) * $size * 0.65);
- $y0 = round($params['y'] - sin($angle) * $size * 0.65);
- $shape = array(
- $x0 + round(cos($angle) * $size * 0.65),
- $y0 - round(sin($angle) * $size * 0.65),
- $x0 + round(cos($angle + $pi2) * $size * 0.65),
- $y0 - round(sin($angle + $pi2) * $size * 0.65),
- $x0 + round(cos($angle + pi()) * $size * 0.65),
- $y0 - round(sin($angle + pi()) * $size * 0.65),
- $x0 + round(cos($angle + 3 * $pi2) * $size * 0.65),
- $y0 - round(sin($angle + 3 * $pi2) * $size * 0.65)
- );
- break;
- case 'line':
- $this->line(
- array(
- 'x0' => $x + round(cos($angle + $pi2) * $size / 2),
- 'y0' => $y - round(sin($angle + $pi2) * $size / 2),
- 'x1' => $x + round(cos($angle + 3 * $pi2) * $size / 2),
- 'y1' => $y - round(sin($angle + 3 * $pi2) * $size / 2),
- 'color' => $params['color']
- )
- );
- break;
- case 'box':
- case 'rectangle':
- $x0 = round($params['x'] + cos($angle) * $size / 2);
- $y0 = round($params['y'] - sin($angle) * $size / 2);
- $pi4 = pi() / 4;
- $shape = array(
- $x0 + round(cos($angle + $pi4) * $size / 2),
- $y0 - round(sin($angle + $pi4) * $size / 2),
- $x0 + round(cos($angle + $pi2 + $pi4) * $size / 2),
- $y0 - round(sin($angle + $pi2 + $pi4) * $size / 2),
- $x0 + round(cos($angle + pi() + $pi4) * $size / 2),
- $y0 - round(sin($angle + pi() + $pi4) * $size / 2),
- $x0 + round(cos($angle + 3 * $pi2 + $pi4) * $size / 2),
- $y0 - round(sin($angle + 3 * $pi2 + $pi4) * $size / 2)
- );
- break;
- case 'arrow':
- $shape = array(
- $x + cos($angle) * $size,
- $y - sin($angle) * $size,
- $x + cos($angle + $pi2) * $size * 0.4,
- $y - sin($angle + $pi2) * $size * 0.4,
- $x + cos($angle + 3 * $pi2) * $size * 0.4,
- $y - sin($angle + 3 * $pi2) * $size * 0.4,
- );
- break;
- case 'arrow2':
- $shape = array(
- $x + round(cos($angle) * $size),
- $y - round(sin($angle) * $size),
- $x + round(cos($angle + $pi2 + deg2rad(45)) * $size),
- $y - round(sin($angle + $pi2 + deg2rad(45)) * $size),
- $x,
- $y,
- $x + round(cos($angle + 3 * $pi2 - deg2rad(45)) * $size),
- $y - round(sin($angle + 3 * $pi2 - deg2rad(45)) * $size),
- );
- break;
- }
-
- if (isset($shape)) {
- // output the shape
- if (($fill = $this->_getFillStyle($params['color'])) !== false) {
- ImageFilledPolygon($this->_canvas, $shape, count($shape)/2, $fill);
- }
- }
- parent::drawEnd($params);
- }
-
- /**
- * Draw a line
- *
- * Parameter array:
- *
- * 'x0': int X start point
- *
- * 'y0': int Y start point
- *
- * 'x1': int X end point
- *
- * 'y1': int Y end point
- *
- * 'color': mixed [optional] The line color
- *
- * @param array $params Parameter array
- */
- function line($params)
- {
- $x0 = $this->_getX($params['x0']);
- $y0 = $this->_getY($params['y0']);
- $x1 = $this->_getX($params['x1']);
- $y1 = $this->_getY($params['y1']);
- $color = (isset($params['color']) ? $params['color'] : false);
-
- $x0 = $this->_getX($x0);
- $y0 = $this->_getY($y0);
- $x1 = $this->_getX($x1);
- $y1 = $this->_getY($y1);
- if (($this->_antialias === 'driver') && ($x0 != $x1) && ($y0 != $y1)) {
- $this->_antialiasedLine($x0, $y0, $x1, $y1, $color);
- } elseif (($line = $this->_getLineStyle($color)) !== false) {
- ImageLine($this->_canvas, $x0, $y0, $x1, $y1, $line);
- }
- parent::line($params);
- }
-
- /**
- * Parameter array:
- *
- * 'connect': bool [optional] Specifies whether the start point should be
- * connected to the endpoint (closed polygon) or not (connected line)
- *
- * 'fill': mixed [optional] The fill color
- *
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function polygon($params)
- {
- include_once 'Image/Canvas/Tool.php';
-
- $connectEnds = (isset($params['connect']) ? $params['connect'] : false);
- $fillColor = (isset($params['fill']) ? $params['fill'] : false);
- $lineColor = (isset($params['line']) ? $params['line'] : false);
-
- if (!$connectEnds) {
- $fillColor = 'transparent';
- }
- $style = $this->_getLineStyle($lineColor) . $this->_getFillStyle($fillColor);
-
- $lastPoint = false;
- foreach ($this->_polygon as $point) {
- if (($lastPoint) && (isset($lastPoint['P1X'])) &&
- (isset($lastPoint['P1Y'])) && (isset($lastPoint['P2X'])) &&
- (isset($lastPoint['P2Y'])))
- {
- $dx = abs($point['X'] - $lastPoint['X']);
- $dy = abs($point['Y'] - $lastPoint['Y']);
- $d = sqrt($dx * $dx + $dy * $dy);
- if ($d > 0) {
- $interval = 1 / $d;
- for ($t = 0; $t <= 1; $t = $t + $interval) {
- $x = Image_Canvas_Tool::bezier(
- $t,
- $lastPoint['X'],
- $lastPoint['P1X'],
- $lastPoint['P2X'],
- $point['X']
- );
-
- $y = Image_Canvas_Tool::bezier(
- $t,
- $lastPoint['Y'],
- $lastPoint['P1Y'],
- $lastPoint['P2Y'],
- $point['Y']
- );
-
- if (!isset($low['X'])) {
- $low['X'] = $x;
- } else {
- $low['X'] = min($x, $low['X']);
- }
- if (!isset($high['X'])) {
- $high['X'] = $x;
- } else {
- $high['X'] = max($x, $high['X']);
- }
- if (!isset($low['Y'])) {
- $low['Y'] = $y;
- } else {
- $low['Y'] = min($y, $low['Y']);
- }
- if (!isset($high['Y'])) {
- $high['Y'] = $y;
- } else {
- $high['Y'] = max($y, $high['Y']);
- }
- $polygon[] = $x;
- $polygon[] = $y;
- }
- if (($t - $interval) < 1) {
- $x = Image_Canvas_Tool::bezier(
- 1,
- $lastPoint['X'],
- $lastPoint['P1X'],
- $lastPoint['P2X'],
- $point['X']
- );
-
- $y = Image_Canvas_Tool::bezier(
- 1,
- $lastPoint['Y'],
- $lastPoint['P1Y'],
- $lastPoint['P2Y'],
- $point['Y']
- );
-
- $polygon[] = $x;
- $polygon[] = $y;
- }
- }
- } else {
- if (!isset($low['X'])) {
- $low['X'] = $point['X'];
- } else {
- $low['X'] = min($point['X'], $low['X']);
- }
- if (!isset($high['X'])) {
- $high['X'] = $point['X'];
- } else {
- $high['X'] = max($point['X'], $high['X']);
- }
- if (!isset($low['Y'])) {
- $low['Y'] = $point['Y'];
- } else {
- $low['Y'] = min($point['Y'], $low['Y']);
- }
- if (!isset($high['Y'])) {
- $high['Y'] = $point['Y'];
- } else {
- $high['Y'] = max($point['Y'], $high['Y']);
- }
-
- $polygon[] = $point['X'];
- $polygon[] = $point['Y'];
- }
- $lastPoint = $point;
- }
-
- if ((isset($polygon)) && (is_array($polygon))) {
- if ($connectEnds) {
- if (($fill = $this->_getFillStyle($fillColor, $low['X'], $low['Y'], $high['X'], $high['Y'])) !== false) {
- ImageFilledPolygon($this->_canvas, $polygon, count($polygon)/2, $fill);
- }
- if ($this->_antialias === 'driver') {
- $pfirst = $p0 = false;
- reset($polygon);
-
- while (list(, $x) = each($polygon)) {
- list(, $y) = each($polygon);
- if ($p0 !== false) {
- $this->_antialiasedLine($p0['X'], $p0['Y'], $x, $y, $lineColor);
- }
- if ($pfirst === false) {
- $pfirst = array('X' => $x, 'Y' => $y);
- }
- $p0 = array('X' => $x, 'Y' => $y);;
- }
-
- $this->_antialiasedLine($p0['X'], $p0['Y'], $pfirst['X'], $pfirst['Y'], $lineColor);
- } elseif (($line = $this->_getLineStyle($lineColor)) !== false) {
- ImagePolygon($this->_canvas, $polygon, count($polygon)/2, $line);
- }
- } else {
- $prev_point = false;
- if ($this->_antialias === 'driver') {
- reset($polygon);
- while (list(, $x) = each($polygon)) {
- list(, $y) = each($polygon);
- if ($prev_point) {
- $this->_antialiasedLine(
- $prev_point['X'],
- $prev_point['Y'],
- $x,
- $y,
- $lineColor
- );
- }
- $prev_point = array('X' => $x, 'Y' => $y);;
- }
- } elseif (($line = $this->_getLineStyle($lineColor)) !== false) {
- reset($polygon);
- while (list(, $x) = each($polygon)) {
- list(, $y) = each($polygon);
- if ($prev_point) {
- ImageLine(
- $this->_canvas,
- $prev_point['X'],
- $prev_point['Y'],
- $x,
- $y,
- $line
- );
- }
- $prev_point = array('X' => $x, 'Y' => $y);;
- }
- }
- }
- }
-
- parent::polygon($params);
- }
-
- /**
- * Draw a rectangle
- *
- * Parameter array:
- *
- * 'x0': int X start point
- *
- * 'y0': int Y start point
- *
- * 'x1': int X end point
- *
- * 'y1': int Y end point
- *
- * 'fill': mixed [optional] The fill color
- *
- * 'line': mixed [optional] The line color
- *
- * @param array $params Parameter array
- */
- function rectangle($params)
- {
- $x0 = $this->_getX($params['x0']);
- $y0 = $this->_getY($params['y0']);
- $x1 = $this->_getX($params['x1']);
- $y1 = $this->_getY($params['y1']);
- $fillColor = (isset($params['fill']) ? $params['fill'] : false);
- $lineColor = (isset($params['line']) ? $params['line'] : false);
-
- if (($fill = $this->_getFillStyle($fillColor, $x0, $y0, $x1, $y1)) !== false) {
- ImageFilledRectangle($this->_canvas, $x0, $y0, $x1, $y1, $fill);
- }
-
- if (($line = $this->_getLineStyle($lineColor)) !== false) {
- ImageRectangle($this->_canvas, $x0, $y0, $x1, $y1, $line);
- }
-
- parent::rectangle($params);
- }
-
- /**
- * Draw an ellipse
- *
- * Parameter array:
- *
- * 'x': int X center point
- *
- * 'y': int Y center point
- *
- * 'rx': int X radius
- *
- * 'ry': int Y radius
- *
- * 'fill': mixed [optional] The fill color
- *
- * 'line': mixed [optional] The line color
- *
- * @param array $params Parameter array
- */
- function ellipse($params)
- {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $rx = $this->_getX($params['rx']);
- $ry = $this->_getY($params['ry']);
- $fillColor = (isset($params['fill']) ? $params['fill'] : false);
- $lineColor = (isset($params['line']) ? $params['line'] : false);
-
- if (($fill = $this->_getFillStyle($fillColor, $x - $rx, $y - $ry, $x + $rx, $y + $ry)) !== false) {
- ImageFilledEllipse($this->_canvas, $x, $y, $rx * 2, $ry * 2, $fill);
- }
-
- if (($line = $this->_getLineStyle($lineColor)) !== false) {
- ImageEllipse($this->_canvas, $x, $y, $rx * 2, $ry * 2, $line);
- }
- parent::ellipse($params);
- }
-
- /**
- * Draw a pie slice
- *
- * Parameter array:
- *
- * 'x': int X center point
- *
- * 'y': int Y center point
- *
- * 'rx': int X radius
- *
- * 'ry': int Y radius
- *
- * 'v1': int The starting angle (in degrees)
- *
- * 'v2': int The end angle (in degrees)
- *
- * 'srx': int [optional] Starting X-radius of the pie slice (i.e. for a doughnut)
- *
- * 'sry': int [optional] Starting Y-radius of the pie slice (i.e. for a doughnut)
- *
- * 'fill': mixed [optional] The fill color
- *
- * 'line': mixed [optional] The line color
- *
- * @param array $params Parameter array
- */
- function pieslice($params)
- {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $rx = $params['rx'];
- $ry = $params['ry'];
- $v1 = $params['v1'];
- $v2 = $params['v2'];
- $srx = (isset($params['srx']) ? $params['srx'] : 0);
- $sry = (isset($params['sry']) ? $params['sry'] : 0);
- $fillColor = (isset($params['fill']) ? $params['fill'] : false);
- $lineColor = (isset($params['line']) ? $params['line'] : false);
-
- $dA = 0.1;
-
- if (($srx !== false) && ($sry !== false)) {
- $angle = max($v1, $v2);
- while ($angle >= min($v1, $v2)) {
- $polygon[] = ($x + $srx * cos(deg2rad($angle % 360)));
- $polygon[] = ($y + $sry * sin(deg2rad($angle % 360)));
- $angle -= $dA;
- }
- if (($angle + $dA) > min($v1, $v2)) {
- $polygon[] = ($x + $srx * cos(deg2rad(min($v1, $v2) % 360)));
- $polygon[] = ($y + $sry * sin(deg2rad(min($v1, $v2) % 360)));
- }
- } else {
- $polygon[] = $x;
- $polygon[] = $y;
- }
-
- $angle = min($v1, $v2);
- while ($angle <= max($v1, $v2)) {
- $polygon[] = ($x + $rx * cos(deg2rad($angle % 360)));
- $polygon[] = ($y + $ry * sin(deg2rad($angle % 360)));
- $angle += $dA;
- }
-
- if (($angle - $dA) < max($v1, $v2)) {
- $polygon[] = ($x + $rx * cos(deg2rad(max($v1, $v2) % 360)));
- $polygon[] = ($y + $ry * sin(deg2rad(max($v1, $v2) % 360)));
- }
-
- if (($fill = $this->_getFillStyle($fillColor, $x - $rx - 1, $y - $ry - 1, $x + $rx + 1, $y + $ry + 1)) !== false) {
- ImageFilledPolygon($this->_canvas, $polygon, count($polygon) / 2, $fill);
- }
-
- if (($line = $this->_getLineStyle($lineColor)) !== false) {
- ImagePolygon($this->_canvas, $polygon, count($polygon) / 2, $line);
- }
-
- parent::pieSlice($params);
- }
-
- /**
- * Get the width of a text,
- *
- * @param string $text The text to get the width of
- * @return int The width of the text
- */
- function textWidth($text)
- {
- if (isset($this->_font['file'])) {
- $angle = 0;
- if (isset($this->_font['angle'])) {
- $angle = $this->_font['angle'];
- }
-
- $width = 0;
- $lines = explode("\n", $text);
- foreach ($lines as $line) {
- $bounds = ImageTTFBBox(
- $this->_font['size'],
- $angle,
- $this->_font['file'],
- $text
- );
-
- $x0 = min($bounds[0], $bounds[2], $bounds[4], $bounds[6]);
- $x1 = max($bounds[0], $bounds[2], $bounds[4], $bounds[6]);
- $width = max(abs($x0 - $x1), $width);
- }
- return $width;
- } else {
- if ((isset($this->_font['vertical'])) && ($this->_font['vertical'])) {
- return ImageFontHeight($this->_font['font']) * (substr_count($text, "\n") + 1);
- } else {
- $width = 0;
- $lines = explode("\n", $text);
- foreach ($lines as $line) {
- $width = max($width, ImageFontWidth($this->_font['font']) * strlen($line));
- }
- return $width;
- }
- }
- }
-
- /**
- * Get the height of a text.
- *
- * Note! This method can give some peculiar results, since ImageTTFBBox() returns the total
- * bounding box of a text, where ImageTTF() writes the text on the baseline of the text, that
- * is 'g', 'p', 'q' and other letters that dig under the baseline will appear to have a larger
- * height than they actually do. Have a look at the tests/text.php test case - the first two
- * columns, 'left and 'center', both look alright, whereas the last column, 'right', appear
- * with a larger space between the first text and the second. This is because the total height
- * is actually smaller by exactly the number of pixels that the 'g' digs under the baseline.
- * Remove the 'g' from the text and they appear correct.
- *
- * @param string $text The text to get the height of
- * @param bool $force Force the method to calculate the size
- * @return int The height of the text
- */
- function textHeight($text, $force = false)
- {
- if (isset($this->_font['file'])) {
- $angle = 0;
- if (isset($this->_font['angle'])) {
- $angle = $this->_font['angle'];
- }
-
- $linebreaks = substr_count($text, "\n");
- if (($angle == 0) && ($linebreaks == 0) && ($force === false)) {
- /*
- * if the angle is 0 simply return the size, due to different
- * heights for example for x-axis labels, making the labels
- * _not_ appear as written on the same baseline
- */
- return $this->_font['size'] + 2;
- }
-
- $height = 0;
- $lines = explode("\n", $text);
- foreach ($lines as $line) {
- $bounds = ImageTTFBBox(
- $this->_font['size'],
- $angle,
- $this->_font['file'],
- $line
- );
-
- $y0 = min($bounds[1], $bounds[3], $bounds[5], $bounds[7]);
- $y1 = max($bounds[1], $bounds[3], $bounds[5], $bounds[7]);
- $height += abs($y0 - $y1);
- }
- return $height + $linebreaks * 2;
- } else {
- if ((isset($this->_font['vertical'])) && ($this->_font['vertical'])) {
- $width = 0;
- $lines = explode("\n", $text);
- foreach ($lines as $line) {
- $width = max($width, ImageFontWidth($this->_font['font']) * strlen($line));
- }
- return $width;
- } else {
- return ImageFontHeight($this->_font['font']) * (substr_count($text, "\n") + 1);
- }
- }
- }
-
- /**
- * Writes text
- *
- * Parameter array:
- *
- * 'x': int X-point of text
- *
- * 'y': int Y-point of text
- *
- * 'text': string The text to add
- *
- * 'alignment': array [optional] Alignment
- *
- * 'color': mixed [optional] The color of the text
- */
- function addText($params)
- {
- $x0 = $this->_getX($params['x']);
- $y0 = $this->_getY($params['y']);
- $text = $params['text'];
- $color = (isset($params['color']) ? $params['color'] : false);
- $alignment = (isset($params['alignment']) ? $params['alignment'] : false);
-
- $text = str_replace("\r", '', $text);
-
- if (!is_array($alignment)) {
- $alignment = array('vertical' => 'top', 'horizontal' => 'left');
- }
-
- if (!isset($alignment['vertical'])) {
- $alignment['vertical'] = 'top';
- }
-
- if (!isset($alignment['horizontal'])) {
- $alignment['horizontal'] = 'left';
- }
-
- if ($alignment['vertical'] == 'bottom') {
- $y0 = $y0 - $this->textHeight($text, true);
- } elseif ($alignment['vertical'] == 'center') {
- $y0 = $y0 - ($this->textHeight($text, true) / 2);
- }
-
- $lines = explode("\n", $text);
- foreach ($lines as $line) {
- $textWidth = $this->textWidth($line);
- $textHeight = $this->textHeight($line, true);
-
- $x = $x0;
- $y = $y0;
-
- $y0 += $textHeight + 2;
-
- if ($alignment['horizontal'] == 'right') {
- $x = $x - $textWidth;
- } elseif ($alignment['horizontal'] == 'center') {
- $x = $x - ($textWidth / 2);
- }
-
- if (($color === false) && (isset($this->_font['color']))) {
- $color = $this->_font['color'];
- }
-
- if ($color != 'transparent') {
- if (isset($this->_font['file'])) {
- if (($this->_font['angle'] < 180) && ($this->_font['angle'] >= 0)) {
- $y += $textHeight;
- }
- if (($this->_font['angle'] >= 90) && ($this->_font['angle'] < 270)) {
- $x += $textWidth;
- }
-
- ImageTTFText(
- $this->_canvas,
- $this->_font['size'],
- $this->_font['angle'],
- $x,
- $y,
- $this->_color($color),
- $this->_font['file'],
- $line
- );
-
- } else {
- if ((isset($this->_font['vertical'])) && ($this->_font['vertical'])) {
- ImageStringUp(
- $this->_canvas,
- $this->_font['font'],
- $x,
- $y + $this->textHeight($text),
- $line,
- $this->_color($color)
- );
- } else {
- ImageString(
- $this->_canvas,
- $this->_font['font'],
- $x,
- $y,
- $line,
- $this->_color($color)
- );
- }
- }
- }
- }
- parent::addText($params);
- }
-
- /**
- * Overlay image
- *
- * Parameter array:
- *
- * 'x': int X-point of overlayed image
- *
- * 'y': int Y-point of overlayed image
- *
- * 'filename': string The filename of the image to overlay
- *
- * 'width': int [optional] The width of the overlayed image (resizing if possible)
- *
- * 'height': int [optional] The height of the overlayed image (resizing if possible)
- *
- * 'alignment': array [optional] Alignment
- */
- function image($params)
- {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $filename = $params['filename'];
- $width = (isset($params['width']) ? $params['width'] : false);
- $height = (isset($params['height']) ? $params['height'] : false);
- $alignment = (isset($params['alignment']) ? $params['alignment'] : false);
-
- if (!is_array($alignment)) {
- $alignment = array('vertical' => 'top', 'horizontal' => 'left');
- }
-
- if (!isset($alignment['vertical'])) {
- $alignment['vertical'] = 'top';
- }
-
- if (!isset($alignment['horizontal'])) {
- $alignment['horizontal'] = 'left';
- }
-
- if (file_exists($filename)) {
- if (strtolower(substr($filename, -4)) == '.png') {
- $image = ImageCreateFromPNG($filename);
- } elseif (strtolower(substr($filename, -4)) == '.gif') {
- $image = ImageCreateFromGIF($filename);
- } else {
- $image = ImageCreateFromJPEG($filename);
- }
-
- $imgWidth = ImageSX($image);
- $imgHeight = ImageSY($image);
-
- $outputWidth = ($width !== false ? $width : $imgWidth);
- $outputHeight = ($height !== false ? $height : $imgHeight);
-
- if ($alignment['horizontal'] == 'right') {
- $x -= $outputWidth;
- } elseif ($alignment['horizontal'] == 'center') {
- $x -= $outputWidth / 2;
- }
-
- if ($alignment['vertical'] == 'bottom') {
- $y -= $outputHeight;
- } elseif ($alignment['vertical'] == 'center') {
- $y -= $outputHeight / 2;
- }
-
- if ((($width !== false) && ($width != $imgWidth)) ||
- (($height !== false) && ($height != $imgHeight)))
- {
- if ($this->_gd2) {
- ImageCopyResampled(
- $this->_canvas,
- $image,
- $x,
- $y,
- 0,
- 0,
- $width,
- $height,
- $imgWidth,
- $imgHeight
- );
- } else {
- ImageCopyResized(
- $this->_canvas,
- $image,
- $x,
- $y,
- 0,
- 0,
- $width,
- $height,
- $imgWidth,
- $imgHeight
- );
- }
- } else {
- ImageCopy(
- $this->_canvas,
- $image,
- $x,
- $y,
- 0,
- 0,
- $imgWidth,
- $imgHeight
- );
- }
- ImageDestroy($image);
- }
- parent::image($params);
- }
-
- /**
- * Set clipping to occur
- *
- * Parameter array:
- *
- * 'x0': int X point of Upper-left corner
- * 'y0': int X point of Upper-left corner
- * 'x1': int X point of lower-right corner
- * 'y1': int Y point of lower-right corner
- */
- function setClipping($params = false)
- {
- if ($params === false) {
- $index = count($this->_clipping) - 1;
- if (isset($this->_clipping[$index])) {
- $params = $this->_clipping[$index];
- $canvas = $params['canvas'];
- ImageCopy(
- $canvas,
- $this->_canvas,
- min($params['x0'], $params['x1']),
- min($params['y0'], $params['y1']),
- min($params['x0'], $params['x1']),
- min($params['y0'], $params['y1']),
- abs($params['x1'] - $params['x0'] + 1),
- abs($params['y1'] - $params['y0'] + 1)
- );
- $this->_canvas = $canvas;
- unset($this->_clipping[$index]);
- }
- }
- else {
- $params['canvas'] = $this->_canvas;
-
- if ($this->_gd2) {
- $this->_canvas = ImageCreateTrueColor(
- $this->_width,
- $this->_height
- );
- if ($this->_alpha) {
- ImageAlphaBlending($this->_canvas, true);
- }
- } else {
- $this->_canvas = ImageCreate($this->_width, $this->_height);
- }
-
- if (($this->_gd2) && ($this->_antialias === 'native')) {
- ImageAntialias($this->_canvas, true);
- }
-
- ImageCopy($this->_canvas, $params['canvas'], 0, 0, 0, 0, $this->_width, $this->_height);
-
- $this->_clipping[count($this->_clipping)] = $params;
- }
- }
-
- /**
- * Get a canvas specific HTML tag.
- *
- * This method implicitly saves the canvas to the filename in the
- * filesystem path specified and parses it as URL specified by URL path
- *
- * Parameter array:
- *
- * 'filename' string
- *
- * 'filepath': string Path to the file on the file system. Remember the final slash
- *
- * 'urlpath': string Path to the file available through an URL. Remember the final slash
- *
- * 'alt': string [optional] Alternative text on image
- *
- * 'cssclass': string [optional] The CSS Stylesheet class
- *
- * 'border': int [optional] The border width on the image
- */
- function toHtml($params)
- {
- parent::toHtml($params);
- return '<img src="' . $params['urlpath'] . $params['filename'] . '"' .
- (isset($params['alt']) ? ' alt="' . $params['alt'] . '"' : '') .
- (isset($params['cssclass']) ? ' class="' . $params['cssclass'] . '"' : '') .
- (isset($params['border']) ? ' border="' . $params['border'] . '"' : '') .
- (isset($this->_imageMap) ? ' usemap="#' . $params['filename'] . '"' : '') . '>' .
- (isset($this->_imageMap) ? "\n" . $this->_imageMap->toHtml(array('name' => $params['filename'])) : '');
- }
-
- /**
- * Resets the canvas.
- *
- * Include fillstyle, linestyle, thickness and polygon
- * @access private
- */
- function _reset()
- {
- if ($this->_gd2) {
- ImageSetThickness($this->_canvas, 1);
- }
- if ($this->_tileImage != null) {
- ImageDestroy($this->_tileImage);
- $this->_tileImage = null;
- }
- parent::_reset();
- $this->_font = array('font' => 1, 'color' => 'black');
- }
-
- /**
- * Check which version of GD is installed
- *
- * @return int 0 if GD isn't installed, 1 if GD 1.x is installed and 2 if GD
- * 2.x is installed
- * @access private
- */
- function _version()
- {
- $result = false;
- if (function_exists('gd_info')) {
- $info = gd_info();
- $version = $info['GD Version'];
- } else {
- ob_start();
- phpinfo(8);
- $php_info = ob_get_contents();
- ob_end_clean();
-
- if (ereg("<td[^>]*>GD Version *<\/td><td[^>]*>([^<]*)<\/td>",
- $php_info, $result))
- {
- $version = $result[1];
- }
- }
-
- if (ereg('1\.[0-9]{1,2}', $version)) {
- return 1;
- } elseif (ereg('2\.[0-9]{1,2}', $version)) {
- return 2;
- } else {
- return 0;
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Canvas/GD/JPG.php b/config/archive/dspam/pear/Image/Canvas/GD/JPG.php
deleted file mode 100644
index ef78aeca..00000000
--- a/config/archive/dspam/pear/Image/Canvas/GD/JPG.php
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Canvas
- *
- * Canvas class to handle JPEG format.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-
-/**
- * Include file Image/Canvas/GD.php
- */
-require_once 'Image/Canvas/GD.php';
-
-/**
- * JPEG Canvas class.
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-class Image_Canvas_GD_JPG extends Image_Canvas_GD
-{
-
- /**
- * The JPEG quality
- * @var int
- * @access private
- */
- var $_quality = 75;
-
- /**
- * Create the JPEG canvas
- *
- * Additional parameters other than those available for common {@link
- * Image_Graph_Canvas_GD} class are:
- *
- * 'quality' The JPEG quality in as a percentage value from 0 (lowest
- * quality, smallest file) to 100 (highest quality, biggest file)
- *
- * @param array $param Parameter array
- */
- function Image_Canvas_GD_JPG($param)
- {
- parent::Image_Canvas_GD($param);
-
- if (isset($param['quality'])) {
- $this->_quality = max(0, min(100, $param['quality']));
- }
-
- $this->rectangle(
- array(
- 'x0' => $this->_left,
- 'y0' => $this->_top,
- 'x1' => $this->_left + $this->_width - 1,
- 'y1' => $this->_top + $this->_height - 1,
- 'fill' => 'white',
- 'line' => 'transparent'
- )
- );
- }
-
- /**
- * Output the result of the canvas
- *
- * @param array $param Parameter array
- * @abstract
- */
- function show($param = false)
- {
- parent::show($param);
- header('Content-type: image/jpg');
- header('Content-Disposition: inline; filename = \"'. basename($_SERVER['PHP_SELF'], '.php') . '.jpg\"');
- ImageJPEG($this->_canvas, '', $this->_quality);
- ImageDestroy($this->_canvas);
- }
-
- /**
- * Output the result of the canvas
- *
- * @param array $param Parameter array
- * @abstract
- */
- function save($param = false)
- {
- parent::save($param);
- ImageJPEG($this->_canvas, $param['filename'], $this->_quality);
- ImageDestroy($this->_canvas);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Canvas/GD/PNG.php b/config/archive/dspam/pear/Image/Canvas/GD/PNG.php
deleted file mode 100644
index 75184d8c..00000000
--- a/config/archive/dspam/pear/Image/Canvas/GD/PNG.php
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Canvas
- *
- * Canvas class to handle PNG format.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-
-/**
- * Include file Image/Canvas/GD.php
- */
-require_once 'Image/Canvas/GD.php';
-
-/**
- * PNG Canvas class.
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-class Image_Canvas_GD_PNG extends Image_Canvas_GD
-{
-
- /**
- * Create the PNG canvas
- *
- * @param array $param Parameter array
- */
- function Image_Canvas_GD_PNG($param)
- {
- parent::Image_Canvas_GD($param);
-
- if ((isset($param['transparent'])) && ($param['transparent']) &&
- ($this->_gd2)
- ) {
- if ($param['transparent'] === true) {
- $transparent = '#123ABD';
- } else {
- $transparent = $param['transparent'];
- }
- $color = $this->_color($transparent);
- $trans = ImageColorTransparent($this->_canvas, $color);
-
- $this->rectangle(
- array(
- 'x0' => $this->_left,
- 'y0' => $this->_top,
- 'x1' => $this->_left + $this->_width - 1,
- 'y1' => $this->_top + $this->_height - 1,
- 'fill' => 'opague',
- 'line' => 'transparent'
- )
- );
- } else {
- $this->rectangle(
- array(
- 'x0' => $this->_left,
- 'y0' => $this->_top,
- 'x1' => $this->_left + $this->_width - 1,
- 'y1' => $this->_top + $this->_height - 1,
- 'fill' => 'white',
- 'line' => 'transparent'
- )
- );
- }
- }
-
- /**
- * Output the result of the canvas
- *
- * @param array $param Parameter array
- * @abstract
- */
- function show($param = false)
- {
- parent::show($param);
- header('Content-type: image/png');
- header('Content-Disposition: inline; filename = \"'. basename($_SERVER['PHP_SELF'], '.php') . '.png\"');
- ImagePNG($this->_canvas);
- ImageDestroy($this->_canvas);
- }
-
- /**
- * Output the result of the canvas
- *
- * @param array $param Parameter array
- * @abstract
- */
- function save($param = false)
- {
- parent::save($param);
- ImagePNG($this->_canvas, $param['filename']);
- ImageDestroy($this->_canvas);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Canvas/ImageMap.php b/config/archive/dspam/pear/Image/Canvas/ImageMap.php
deleted file mode 100644
index e69f3de2..00000000
--- a/config/archive/dspam/pear/Image/Canvas/ImageMap.php
+++ /dev/null
@@ -1,354 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Canvas
- *
- * Class for handling output as a HTML imagemap
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-
-/**
- * Class for handling output as a HTML imagemap
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- * @since version 0.2.0
- */
-class Image_Canvas_ImageMap extends Image_Canvas
-{
-
- /**
- * The image map (if any)
- * @var array
- * @access private
- */
- var $_map = array();
-
- /**
- * Add a map tag
- * @param string $shape The shape, either rect, circle or polygon
- * @param string $coords The list of coordinates for the shape
- * @param array $params Parameter array
- */
- function _addMapTag($shape, $coords, $params)
- {
- if (isset($params['url'])) {
- $url = $params['url'];
- $target = (isset($params['target']) ? $params['target'] : false);
- $alt = (isset($params['alt']) ? $params['alt'] : false);
-
- $tags = '';
- if (isset($params['htmltags'])) {
- foreach ($params['htmltags'] as $key => $value) {
- $tags .= ' ';
- if (strpos($value, '"') !== false) {
- $tags .= $key . '=\'' . $value . '\'';
- } else {
- $tags .= $key . '="' . $value . '"';
- }
- }
- }
-
- $this->_map[] =
- '<area shape="' . $shape . '" coords="' . $coords . '" href="' . $url . '"' .
- ($target ? ' target="' . $target . '"' : '') .
- ($alt ? ' alt="' . $alt . '"' : '') .
- (isset($params['id']) ? ' id="' . $params['id'] . '"' : '') .
- $tags .
- '>';
- }
- }
-
- /**
- * Draw a line
- *
- * Parameter array:
- * 'x0': int X start point
- * 'y0': int Y start point
- * 'x1': int X end point
- * 'y1': int Y end point
- * 'color': mixed [optional] The line color
- * 'mapsize': int [optional] The size of the image map (surrounding the line)
- * @param array $params Parameter array
- */
- function line($params)
- {
- if (isset($params['url'])) {
- $mapsize = (isset($params['mapsize']) ? $params['mapsize'] : 2);
- $this->_addMapTag(
- 'polygon',
- $this->_getX($params['x0'] - $mapsize) . ',' .
- $this->_getY($params['y0'] - $mapsize) . ',' .
- $this->_getX($params['x1'] + $mapsize) . ',' .
- $this->_getY($params['y1'] - $mapsize) . ',' .
-
- $this->_getX($params['x1'] + $mapsize) . ',' .
- $this->_getY($params['y1'] + $mapsize) . ',' .
- $this->_getX($params['x0'] - $mapsize) . ',' .
- $this->_getY($params['y0'] + $mapsize),
- $params
- );
- }
- parent::line($params);
- }
-
- /**
- * Draws a polygon
- *
- * Parameter array:
- * 'connect': bool [optional] Specifies whether the start point should be
- * connected to the endpoint (closed polygon) or not (connected line)
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * 'map_vertices': bool [optional] Specifies whether the image map should map the vertices instead of the polygon as a whole
- * 'url': string [optional] URL to link the polygon as a whole to (also used for default in case 'map_vertices' is used)
- * 'alt': string [optional] Alternative text to show in the image map (also used for default in case 'map_vertices' is used)
- * 'target': string [optional] The link target on the image map (also used for default in case 'map_vertices' is used)
- * @param array $params Parameter array
- */
- function polygon($params)
- {
- if ((isset($params['map_vertices'])) && ($params['map_vertices'] === true)) {
- $mapsize = (isset($params['mapsize']) ? $params['mapsize'] : 2);
- foreach ($this->_polygon as $point) {
- $vertex_param = $params;
- if (isset($point['url'])) {
- $vertex_param['url'] = $point['url'];
- }
- if (isset($point['target'])) {
- $vertex_param['target'] = $point['target'];
- }
- if (isset($point['alt'])) {
- $vertex_param['alt'] = $point['alt'];
- }
- $vertex_mapsize = $mapsize;
- if (isset($point['mapsize'])) {
- $vertex_mapsize = $point['mapsize'];
- }
- if (isset($point['htmltags'])) {
- $vertex_param['htmltags'] = $point['htmltags'];
- }
- $this->_addMapTag(
- 'circle',
- $this->_getX($point['X']) . ',' .
- $this->_getY($point['Y']) . ',' .
- $mapsize,
- $vertex_param
- );
- }
- }
- else if (isset($params['url'])) {
- $points = '';
- foreach ($this->_polygon as $point) {
- if ($points != '') {
- $points .= ',';
- }
- $points .= $this->_getX($point['X']) . ',' . $this->_getY($point['Y']);
- }
- $this->_addMapTag('polygon', $points, $params);
- }
- parent::polygon($params);
- }
-
- /**
- * Draw a rectangle
- *
- * Parameter array:
- * 'x0': int X start point
- * 'y0': int Y start point
- * 'x1': int X end point
- * 'y1': int Y end point
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function rectangle($params)
- {
- if (isset($params['url'])) {
- $this->_addMapTag(
- 'rect',
- $this->_getX($params['x0']) . ',' .
- $this->_getY($params['y0']) . ',' .
- $this->_getX($params['x1']) . ',' .
- $this->_getY($params['y1']),
- $params
- );
- }
- parent::rectangle($params);
- }
-
- /**
- * Draw an ellipse
- *
- * Parameter array:
- * 'x': int X center point
- * 'y': int Y center point
- * 'rx': int X radius
- * 'ry': int Y radius
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function ellipse($params)
- {
- if (isset($params['url'])) {
- if ($params['rx'] == $params['ry']) {
- $this->_addMapTag(
- 'circle',
- $this->_getX($params['x']) . ',' .
- $this->_getY($params['y']) . ',' .
- $this->_getX($params['rx']),
- $params
- );
- } else {
- $points = '';
- for ($v = 0; $v <= 360; $v += 30) {
- if ($points != '') {
- $points .= ',';
- }
- $points .=
- round($this->_getX($params['x']) + $this->_getX($params['rx']) * cos(deg2rad($v % 360))) . ',' .
- round($this->_getY($params['y']) + $this->_getX($params['ry']) * sin(deg2rad($v % 360)));
- }
- $this->_addMapTag(
- 'polygon',
- $points,
- $params
- );
- }
- }
- parent::ellipse($params);
- }
-
- /**
- * Draw a pie slice
- *
- * Parameter array:
- * 'x': int X center point
- * 'y': int Y center point
- * 'rx': int X radius
- * 'ry': int Y radius
- * 'v1': int The starting angle (in degrees)
- * 'v2': int The end angle (in degrees)
- * 'srx': int [optional] Starting X-radius of the pie slice (i.e. for a doughnut)
- * 'sry': int [optional] Starting Y-radius of the pie slice (i.e. for a doughnut)
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function pieslice($params)
- {
- if (isset($params['url'])) {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $rx = $params['rx'];
- $ry = $params['ry'];
- $v1a = $params['v1'];
- $v2a = $params['v2'];
- $v1 = min($v1a, $v2a);
- $v2 = max($v1a, $v2a);
- $srx = (isset($params['srx']) ? $params['srx'] : 0);
- $sry = (isset($params['sry']) ? $params['sry'] : 0);
-
- $points =
- round(($x + $srx * cos(deg2rad($v1 % 360)))) . ',' .
- round(($y + $sry * sin(deg2rad($v1 % 360)))) . ',';
-
- for ($v = $v1; $v < $v2; $v += 30) {
- $points .=
- round(($x + $rx * cos(deg2rad($v % 360)))) . ',' .
- round(($y + $ry * sin(deg2rad($v % 360)))) . ',';
- }
-
- $points .=
- round(($x + $rx * cos(deg2rad($v2 % 360)))) . ',' .
- round(($y + $ry * sin(deg2rad($v2 % 360))));
-
- if (($srx != 0) || ($sry != 0)) {
- $points .= ',';
- for ($v = $v2; $v > $v1; $v -= 30) {
- $points .=
- round(($x + $srx * cos(deg2rad($v % 360)))) . ',' .
- round(($y + $sry * sin(deg2rad($v % 360)))) . ',';
- }
-
- }
-
- $this->_addMapTag('polygon', $points, $params);
- }
- parent::pieslice($params);
- }
-
- /**
- * Output the result of the canvas to the browser
- *
- * @param array $params Parameter array, the contents and meaning depends on the actual Canvas
- * @abstract
- */
- function show($params = false)
- {
- parent::show($params);
- if (count($this->_map) > 0) {
- print $this->toHtml($params);
- }
- }
-
- /**
- * Save the result of the canvas to a file
- *
- * Parameter array:
- * 'filename': string The file to output to
- * @param array $params Parameter array, the contents and meaning depends on the actual Canvas
- * @abstract
- */
- function save($params = false)
- {
- parent::save($params);
- $file = fopen($param['filename'], 'w+');
- fwrite($file, $this->toHtml($params));
- fclose($file);
- }
-
- /**
- * Get a canvas specific HTML tag.
- *
- * Parameter array:
- * 'name': string The name of the image map
- */
- function toHtml($params)
- {
- if (count($this->_map) > 0) {
- return '<map name="' . $params['name'] . '">' . "\n\t" . implode($this->_map, "\n\t") . "\n</map>";
- }
- return '';
- }
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Canvas/PDF.php b/config/archive/dspam/pear/Image/Canvas/PDF.php
deleted file mode 100644
index 180263cb..00000000
--- a/config/archive/dspam/pear/Image/Canvas/PDF.php
+++ /dev/null
@@ -1,1007 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Class for handling output in PDF format.
- *
- * Requires PHP extension PDFlib
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-
-/**
- * Include file Image/Canvas.php
- */
-require_once 'Image/Canvas.php';
-
-/**
- * Include file Image/Canvas/Color.php
- */
-require_once 'Image/Canvas/Color.php';
-
-/**
- * PDF Canvas class.
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-class Image_Canvas_PDF extends Image_Canvas
-{
-
- /**
- * The PDF document
- * @var resource
- * @access private
- */
- var $_pdf;
-
- /**
- * The major version of PDFlib
- * @var int
- * @access private
- */
- var $_pdflib;
-
- /**
- * The font
- * @var mixed
- * @access private
- */
- var $_pdfFont = false;
-
- /**
- * The width of the page
- * @var int
- * @access private
- */
- var $_pageWidth;
-
- /**
- * The height of the page
- * @var int
- * @access private
- */
- var $_pageHeight;
-
- /**
- * Create the PDF canvas.
- *
- * Parameters available:
- *
- * 'page' Specify the page/paper format for the graph's page, available
- * formats are: A0, A1, A2, A3, A4, A5, A6, B5, letter, legal, ledger,
- * 11x17, cd_front, inlay, inlay_nosides
- *
- * 'align' Alignment of the graph on the page, available options are:
- * topleft, topcenter, topright, leftcenter, center, rightcenter,
- * leftbottom, centerbottom, rightbottom
- *
- * 'orientation' Specifies the paper orientation, default is 'portrait' and
- * 'landscape' is also supported.
- *
- * 'creator' The creator tag of the PDF/graph
- *
- * 'author' The author tag of the PDF/graph
- *
- * 'title' The title tag of the PDF/graph
- *
- * 'width' The width of the graph on the page
- *
- * 'height' The height of the graph on the page
- *
- * 'left' The left offset of the graph on the page
- *
- * 'top' The top offset of the graph on the page
- *
- * 'filename' The PDF file to open/add page to, using 'filename' requires
- * the commercial version of PDFlib (http://www.pdflib.com/), this has for
- * obvious ($ 450) reasons not been tested
- *
- * 'pdf' An existing PDFlib PDF document to add the page to
- *
- * 'add_page' (true/false) Used together with 'pdf', to specify whether the
- * canvas should add a new graph page (true) or create the graph on the
- * current page (false), default is 'true'
- *
- * The 'page' and 'width' & 'height' can be mutually omitted, if 'page' is
- * omitted the page is created using dimensions of width x height, and if
- * width and height are omitted the page dimensions are used for the graph.
- *
- * If 'pdf' is specified, 'filename', 'creator', 'author' and 'title' has no
- * effect.
- *
- * 'left' and 'top' are overridden by 'align'
- *
- * It is required either to specify 'width' & 'height' or 'page'.
- *
- * The PDF format/PDFlib has some limitations on the capabilities, which
- * means some functionality available using other canvass (fx. alpha
- * blending and gradient fills) are not supported with PDF (see Canvas.txt
- * in the docs/ folder for further details)
- *
- * @param array $param Parameter array
- */
- function Image_Canvas_PDF($param)
- {
- if (isset($param['page'])) {
- switch (strtoupper($param['page'])) {
- case 'A0':
- $this->_pageWidth = 2380;
- $this->_pageHeight = 3368;
- break;
-
- case 'A1':
- $this->_pageWidth = 1684;
- $this->_pageHeight = 2380;
- break;
-
- case 'A2':
- $this->_pageWidth = 1190;
- $this->_pageHeight = 1684;
- break;
-
- case 'A3':
- $this->_pageWidth = 842;
- $this->_pageHeight = 1190;
- break;
-
- case 'A4':
- $this->_pageWidth = 595;
- $this->_pageHeight = 842;
- break;
-
- case 'A5':
- $this->_pageWidth = 421;
- $this->_pageHeight = 595;
- break;
-
- case 'A6':
- $this->_pageWidth = 297;
- $this->_pageHeight = 421;
- break;
-
- case 'B5':
- $this->_pageWidth = 501;
- $this->_pageHeight = 709;
- break;
-
- case 'LETTER':
- $this->_pageWidth = 612;
- $this->_pageHeight = 792;
- break;
-
- case 'LEGAL':
- $this->_pageWidth = 612;
- $this->_pageHeight = 1008;
- break;
-
- case 'LEDGER':
- $this->_pageWidth = 1224;
- $this->_pageHeight = 792;
- break;
-
- case '11X17':
- $this->_pageWidth = 792;
- $this->_pageHeight = 1224;
- break;
-
- case 'CD_FRONT':
- $this->_pageWidth = 337;
- $this->_pageHeight = 337;
- break;
-
- case 'INLAY':
- $this->_pageWidth = 425;
- $this->_pageHeight = 332;
- break;
-
- case 'INLAY_NOSIDES':
- $this->_pageWidth = 390;
- $this->_pageHeight = 332;
- break;
- }
- }
-
- if ((isset($param['orientation'])) && (strtoupper($param['orientation']) == 'LANDSCAPE')) {
- $w = $this->_pageWidth;
- $this->_pageWidth = $this->_pageHeight;
- $this->_pageHeight = $w;
- }
-
- parent::Image_Canvas($param);
-
- if (!$this->_pageWidth) {
- $this->_pageWidth = $this->_width;
- } elseif (!$this->_width) {
- $this->_width = $this->_pageWidth;
- }
-
- if (!$this->_pageHeight) {
- $this->_pageHeight = $this->_height;
- } elseif (!$this->_height) {
- $this->_height = $this->_pageHeight;
- }
-
- $this->_width = min($this->_width, $this->_pageWidth);
- $this->_height = min($this->_height, $this->_pageHeight);
-
- if ((isset($param['align'])) &&
- (($this->_width != $this->_pageWidth) || ($this->_height != $this->_pageHeight))
- ) {
- switch (strtoupper($param['align'])) {
- case 'TOPLEFT':
- $this->_top = 0;
- $this->_left = 0;
- break;
-
- case 'TOPCENTER':
- $this->_top = 0;
- $this->_left = ($this->_pageWidth - $this->_width) / 2;
- break;
-
- case 'TOPRIGHT':
- $this->_top = 0;
- $this->_left = $this->_pageWidth - $this->_width;
- break;
-
- case 'LEFTCENTER':
- $this->_top = ($this->_pageHeight - $this->_height) / 2;
- $this->_left = 0;
- break;
-
- case 'CENTER':
- $this->_top = ($this->_pageHeight - $this->_height) / 2;
- $this->_left = ($this->_pageWidth - $this->_width) / 2;
- break;
-
- case 'RIGHTCENTER':
- $this->_top = ($this->_pageHeight - $this->_height) / 2;
- $this->_left = $this->_pageWidth - $this->_width;
- break;
-
- case 'LEFTBOTTOM':
- $this->_top = $this->_pageHeight - $this->_height;
- $this->_left = 0;
- break;
-
- case 'CENTERBOTTOM':
- $this->_top = $this->_pageHeight - $this->_height;
- $this->_left = ($this->_pageWidth - $this->_width) / 2;
- break;
-
- case 'RIGHTBOTTOM':
- $this->_top = $this->_pageHeight - $this->_height;
- $this->_left = $this->_pageWidth - $this->_width;
- break;
- }
- }
-
- $this->_pdflib = $this->_version();
-
- $addPage = true;
- if ((isset($param['pdf'])) && (is_resource($param['pdf']))) {
- $this->_pdf =& $param['pdf'];
- if ((isset($param['add_page'])) && ($param['add_page'] === false)) {
- $addPage = false;
- }
- } else {
- $this->_pdf = pdf_new();
-
- if (isset($param['filename'])) {
- pdf_open_file($this->_pdf, $param['filename']);
- } else {
- pdf_open_file($this->_pdf, '');
- }
-
- pdf_set_parameter($this->_pdf, 'warning', 'true');
-
- pdf_set_info($this->_pdf, 'Creator', (isset($param['creator']) ? $param['creator'] : 'PEAR::Image_Canvas'));
- pdf_set_info($this->_pdf, 'Author', (isset($param['author']) ? $param['author'] : 'Jesper Veggerby'));
- pdf_set_info($this->_pdf, 'Title', (isset($param['title']) ? $param['title'] : 'Image_Canvas'));
- }
-
- if ($addPage) {
- pdf_begin_page($this->_pdf, $this->_pageWidth, $this->_pageHeight);
- }
- $this->_reset();
- }
-
- /**
- * Get the x-point from the relative to absolute coordinates
- *
- * @param float $x The relative x-coordinate (in percentage of total width)
- * @return float The x-coordinate as applied to the canvas
- * @access private
- */
- function _getX($x)
- {
- return $this->_left + $x;
- }
-
- /**
- * Get the y-point from the relative to absolute coordinates
- *
- * @param float $y The relative y-coordinate (in percentage of total width)
- * @return float The y-coordinate as applied to the canvas
- * @access private
- */
- function _getY($y)
- {
- return $this->_pageHeight - ($this->_top + $y);
- }
-
- /**
- * Get the color index for the RGB color
- *
- * @param int $color The color
- * @return int The GD image index of the color
- * @access private
- */
- function _color($color = false)
- {
- if (($color === false) || ($color === 'opague') || ($color === 'transparent')) {
- return false;
- } else {
- $color = Image_Canvas_Color::color2RGB($color);
- $color[0] = $color[0]/255;
- $color[1] = $color[1]/255;
- $color[2] = $color[2]/255;
- return $color;
- }
- }
-
- /**
- * Get the PDF linestyle
- *
- * @param mixed $lineStyle The line style to return, false if the one
- * explicitly set
- * @return bool True if set (so that a line should be drawn)
- * @access private
- */
- function _setLineStyle($lineStyle = false)
- {
- if ($lineStyle === false) {
- $lineStyle = $this->_lineStyle;
- }
-
- if (($lineStyle == 'transparent') || ($lineStyle === false)) {
- return false;
- }
-
- if (is_array($lineStyle)) {
- // TODO Implement linestyles in PDFlib (using pdf_setcolor(.., 'pattern'...); ?
- reset($lineStyle);
- $lineStyle = current($lineStyle);
- }
-
- $color = $this->_color($lineStyle);
-
- pdf_setlinewidth($this->_pdf, $this->_thickness);
- if ($this->_pdflib < 4) {
- pdf_setrgbcolor_stroke($this->_pdf, $color[0]/255, $color[1]/255, $color[2]/255);
- } else {
- pdf_setcolor($this->_pdf, 'stroke', 'rgb', $color[0], $color[1], $color[2], 0);
- }
- return true;
- }
-
- /**
- * Set the PDF fill style
- *
- * @param mixed $fillStyle The fillstyle to return, false if the one
- * explicitly set
- * @return bool True if set (so that a line should be drawn)
- * @access private
- */
- function _setFillStyle($fillStyle = false)
- {
- if ($fillStyle === false) {
- $fillStyle = $this->_fillStyle;
- }
-
- if (($fillStyle == 'transparent') || ($fillStyle === false)) {
- return false;
- }
-
- $color = $this->_color($fillStyle);
-
- if ($this->_pdflib < 4) {
- pdf_setrgbcolor_fill($this->_pdf, $color[0]/255, $color[1]/255, $color[2]/255);
- } else {
- pdf_setcolor($this->_pdf, 'fill', 'rgb', $color[0], $color[1], $color[2], 0);
- }
- return true;
- }
-
- /**
- * Set the PDF font
- *
- * @access private
- */
- function _setFont()
- {
- $this->_pdfFont = false;
- if (isset($this->_font['name'])) {
- pdf_set_parameter($this->_pdf, 'FontOutline', $this->_font['name'] . '=' . $this->_font['file']);
- $this->_pdfFont = pdf_findfont($this->_pdf, $this->_font['name'], $this->_font['encoding'], 1);
-
- if ($this->_pdfFont) {
- pdf_setfont($this->_pdf, $this->_pdfFont, $this->_font['size']);
- $this->_setFillStyle($this->_font['color']);
- }
- } else {
- $this->_setFillStyle('black');
- }
- }
-
- /**
- * Sets an image that should be used for filling.
- *
- * Image filling is not supported with PDF, filling 'transparent'
- *
- * @param string $filename The filename of the image to fill with
- */
- function setFillImage($filename)
- {
- $this->_fillStyle = 'transparent';
- }
-
- /**
- * Sets a gradient fill
- *
- * Gradient filling is not supported with PDF, end color used as solid fill.
- *
- * @param array $gradient Gradient fill options
- */
- function setGradientFill($gradient)
- {
- $this->_fillStyle = $gradient['end'];
- }
-
- /**
- * Sets the font options.
- *
- * The $font array may have the following entries:
- *
- * 'ttf' = the .ttf file (either the basename, filename or full path)
- * If 'ttf' is specified, then the following can be specified
- *
- * 'size' = size in pixels
- *
- * 'angle' = the angle with which to write the text
- *
- * @param array $font The font options.
- */
- function setFont($fontOptions)
- {
- parent::setFont($fontOptions);
-
- if (!isset($this->_font['size'])) {
- $this->_font['size'] = 12;
- }
-
- if (!isset($this->_font['encoding'])) {
- $this->_font['encoding'] = 'winansi';
- }
-
- if (!isset($this->_font['color'])) {
- $this->_font['color'] = 'black';
- }
- }
-
- /**
- * Resets the canvas.
- *
- * Includes fillstyle, linestyle, thickness and polygon
- *
- * @access private
- */
- function _reset()
- {
- pdf_initgraphics($this->_pdf);
- parent::_reset();
- }
-
- /**
- * Draw a line
- *
- * Parameter array:
- * 'x0': int X start point
- * 'y0': int Y start point
- * 'x1': int X end point
- * 'y1': int Y end point
- * 'color': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function line($params)
- {
- $color = (isset($params['color']) ? $params['color'] : false);
- if ($this->_setLineStyle($color)) {
- pdf_moveto($this->_pdf, $this->_getX($params['x0']), $this->_getY($params['y0']));
- pdf_lineto($this->_pdf, $this->_getX($params['x1']), $this->_getY($params['x1']));
- pdf_stroke($this->_pdf);
- }
- parent::line($params);
- }
-
- /**
- * Parameter array:
- * 'connect': bool [optional] Specifies whether the start point should be
- * connected to the endpoint (closed polygon) or not (connected line)
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function polygon($params = array())
- {
- $connectEnds = (isset($params['connect']) ? $params['connect'] : false);
- $fillColor = (isset($params['fill']) ? $params['line'] : false);
- $lineColor = (isset($params['line']) ? $params['line'] : false);
-
- $line = $this->_setLineStyle($lineColor);
- $fill = false;
- if ($connectEnds) {
- $fill = $this->_setFillStyle($fillColor);
- }
-
- $first = true;
- foreach ($this->_polygon as $point) {
- if ($first === true) {
- pdf_moveto($this->_pdf, $point['X'], $point['Y']);
- $first = $point;
- } else {
- if (isset($last['P1X'])) {
- pdf_curveto($this->_pdf,
- $last['P1X'],
- $last['P1Y'],
- $last['P2X'],
- $last['P2Y'],
- $point['X'],
- $point['Y']
- );
- } else {
- pdf_lineto($this->_pdf,
- $point['X'],
- $point['Y']
- );
- }
- }
- $last = $point;
- }
-
- if ($connectEnds) {
- if (isset($last['P1X'])) {
- pdf_curveto($this->_pdf,
- $last['P1X'],
- $last['P1Y'],
- $last['P2X'],
- $last['P2Y'],
- $first['X'],
- $first['Y']
- );
- } else {
- pdf_lineto($this->_pdf,
- $first['X'],
- $first['Y']
- );
- }
- }
-
- if (($line) && ($fill)) {
- pdf_fill_stroke($this->_pdf);
- } elseif ($line) {
- pdf_stroke($this->_pdf);
- } elseif ($fill) {
- pdf_fill($this->_pdf);
- }
- parent::polygon($params);
- }
-
- /**
- * Draw a rectangle
- *
- * Parameter array:
- * 'x0': int X start point
- * 'y0': int Y start point
- * 'x1': int X end point
- * 'y1': int Y end point
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function rectangle($params)
- {
- $x0 = $this->_getX($params['x0']);
- $y0 = $this->_getY($params['y0']);
- $x1 = $this->_getX($params['x1']);
- $y1 = $this->_getY($params['y1']);
- $fillColor = (isset($params['fill']) ? $params['line'] : false);
- $lineColor = (isset($params['line']) ? $params['line'] : false);
-
- $line = $this->_setLineStyle($lineColor);
- $fill = $this->_setFillStyle($fillColor);
- if (($line) || ($fill)) {
- pdf_rect($this->_pdf, $this->_getX(min($x0, $x1)), $this->_getY(max($y0, $y1)), abs($x1 - $x0), abs($y1 - $y0));
- if (($line) && ($fill)) {
- pdf_fill_stroke($this->_pdf);
- } elseif ($line) {
- pdf_stroke($this->_pdf);
- } elseif ($fill) {
- pdf_fill($this->_pdf);
- }
- }
- parent::rectangle($params);
- }
-
- /**
- * Draw an ellipse
- *
- * Parameter array:
- * 'x': int X center point
- * 'y': int Y center point
- * 'rx': int X radius
- * 'ry': int Y radius
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function ellipse($params)
- {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $rx = $this->_getX($params['rx']);
- $ry = $this->_getY($params['ry']);
- $fillColor = (isset($params['fill']) ? $params['line'] : false);
- $lineColor = (isset($params['line']) ? $params['line'] : false);
-
- $line = $this->_setLineStyle($lineColor);
- $fill = $this->_setFillStyle($fillColor);
- if (($line) || ($fill)) {
- if ($rx == $ry) {
- pdf_circle($this->_pdf, $this->_getX($x), $this->_getY($y), $rx);
- } else {
- pdf_moveto($this->_pdf, $this->_getX($x - $rx), $this->_getY($y));
- pdf_curveto($this->_pdf,
- $this->_getX($x - $rx), $this->_getY($y),
- $this->_getX($x - $rx), $this->_getY($y - $ry),
- $this->_getX($x), $this->_getY($y - $ry)
- );
- pdf_curveto($this->_pdf,
- $this->_getX($x), $this->_getY($y - $ry),
- $this->_getX($x + $rx), $this->_getY($y - $ry),
- $this->_getX($x + $rx), $this->_getY($y)
- );
- pdf_curveto($this->_pdf,
- $this->_getX($x + $rx), $this->_getY($y),
- $this->_getX($x + $rx), $this->_getY($y + $ry),
- $this->_getX($x), $this->_getY($y + $ry)
- );
- pdf_curveto($this->_pdf,
- $this->_getX($x), $this->_getY($y + $ry),
- $this->_getX($x - $rx), $this->_getY($y + $ry),
- $this->_getX($x - $rx), $this->_getY($y)
- );
- }
-
- if (($line) && ($fill)) {
- pdf_fill_stroke($this->_pdf);
- } elseif ($line) {
- pdf_stroke($this->_pdf);
- } elseif ($fill) {
- pdf_fill($this->_pdf);
- }
- }
- parent::ellipse($params);
- }
-
- /**
- * Draw a pie slice
- *
- * Parameter array:
- * 'x': int X center point
- * 'y': int Y center point
- * 'rx': int X radius
- * 'ry': int Y radius
- * 'v1': int The starting angle (in degrees)
- * 'v2': int The end angle (in degrees)
- * 'srx': int [optional] Starting X-radius of the pie slice (i.e. for a doughnut)
- * 'sry': int [optional] Starting Y-radius of the pie slice (i.e. for a doughnut)
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function pieslice($params)
- {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $rx = $this->_getX($params['rx']);
- $ry = $this->_getY($params['ry']);
- $v1 = $this->_getX($params['v1']);
- $v2 = $this->_getY($params['v2']);
- $srx = $this->_getX($params['srx']);
- $sry = $this->_getY($params['sry']);
- $fillColor = (isset($params['fill']) ? $params['line'] : false);
- $lineColor = (isset($params['line']) ? $params['line'] : false);
-
- // TODO Implement PDFLIB::pieSlice()
- parent::pieslice($params);
- }
-
- /**
- * Get the width of a text,
- *
- * @param string $text The text to get the width of
- * @return int The width of the text
- */
- function textWidth($text)
- {
- if ($this->_pdfFont === false) {
- return $this->_font['size'] * 0.7 * strlen($text);
- } else {
- return pdf_stringwidth($this->_pdf, $text, $this->_pdfFont, $this->_font['size']);
- }
- }
-
- /**
- * Get the height of a text,
- *
- * @param string $text The text to get the height of
- * @return int The height of the text
- */
- function textHeight($text)
- {
- if (isset($this->_font['size'])) {
- return $this->_font['size'];
- } else {
- return 12;
- }
- }
-
- /**
- * Writes text
- *
- * Parameter array:
- * 'x': int X-point of text
- * 'y': int Y-point of text
- * 'text': string The text to add
- * 'alignment': array [optional] Alignment
- * 'color': mixed [optional] The color of the text
- */
- function addText($params)
- {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $text = $params['text'];
- $color = (isset($params['color']) ? $params['color'] : false);
- $alignment = (isset($params['alignment']) ? $params['alignment'] : false);
-
- $this->_setFont();
-
- $textWidth = $this->textWidth($text);
- $textHeight = $this->textHeight($text);
-
- if (!is_array($alignment)) {
- $alignment = array('vertical' => 'top', 'horizontal' => 'left');
- }
-
- if (!isset($alignment['vertical'])) {
- $alignment['vertical'] = 'top';
- }
-
- if (!isset($alignment['horizontal'])) {
- $alignment['horizontal'] = 'left';
- }
-
- if ($alignment['horizontal'] == 'right') {
- $x = $x - $textWidth;
- } elseif ($alignment['horizontal'] == 'center') {
- $x = $x - ($textWidth / 2);
- }
-
- if ($alignment['vertical'] == 'top') {
- $y = $y + $textHeight;
- } elseif ($alignment['vertical'] == 'center') {
- $y = $y + ($textHeight / 2);
- }
-
- if (($color === false) && (isset($this->_font['color']))) {
- $color = $this->_font['color'];
- }
-
- pdf_show_xy($this->_pdf, $text, $this->_getX($x), $this->_getY($y));
-
- parent::addText($params);
- }
-
- /**
- * Overlay image
- *
- * Parameter array:
- * 'x': int X-point of overlayed image
- * 'y': int Y-point of overlayed image
- * 'filename': string The filename of the image to overlay
- * 'width': int [optional] The width of the overlayed image (resizing if possible)
- * 'height': int [optional] The height of the overlayed image (resizing if possible)
- * 'alignment': array [optional] Alignment
- */
- function image($params)
- {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $filename = $params['filename'];
- $width = (isset($params['width']) ? $params['width'] : false);
- $height = (isset($params['height']) ? $params['height'] : false);
- $alignment = (isset($params['alignment']) ? $params['alignment'] : false);
-
- if (substr($filename, -4) == '.png') {
- $type = 'png';
- } elseif (substr($filename, -4) == '.jpg') {
- $type = 'jpeg';
- }
-
- $image = pdf_load_image($this->_pdf, $type, realpath($filename), '');
- $width_ = pdf_get_value($this->_pdf, 'imagewidth', $image);
- $height_ = pdf_get_value($this->_pdf, 'imageheight', $image);
-
- $outputWidth = ($width !== false ? $width : $width_);
- $outputHeight = ($height !== false ? $height : $height_);
-
- if (!is_array($alignment)) {
- $alignment = array('vertical' => 'top', 'horizontal' => 'left');
- }
-
- if (!isset($alignment['vertical'])) {
- $alignment['vertical'] = 'top';
- }
-
- if (!isset($alignment['horizontal'])) {
- $alignment['horizontal'] = 'left';
- }
-
- if ($alignment['horizontal'] == 'right') {
- $x -= $outputWidth;
- } elseif ($alignment['horizontal'] == 'center') {
- $x -= $outputWidth / 2;
- }
-
- if ($alignment['vertical'] == 'top') {
- $y += $outputHeight;
- } elseif ($alignment['vertical'] == 'center') {
- $y += $outputHeight / 2;
- }
-
- if (($width === false) && ($height === false)) {
- $scale = 1;
- } else {
- $scale = max(($height/$height_), ($width/$width_));
- }
-
- pdf_place_image($this->_pdf, $image, $this->_getX($x), $this->_getY($y), $scale);
- pdf_close_image($this->_pdf, $image);
-
- parent::image($params);
- }
-
- /**
- * Output the result of the canvas
- *
- * @param array $param Parameter array
- * @abstract
- */
- function show($param = false)
- {
- parent::show($param);
- pdf_end_page($this->_pdf);
- pdf_close($this->_pdf);
-
- $buf = pdf_get_buffer($this->_pdf);
- $len = strlen($buf);
-
- header('Content-type: application/pdf');
- header('Content-Length: ' . $len);
- header('Content-Disposition: inline; filename=image_graph.pdf');
- print $buf;
-
- pdf_delete($this->_pdf);
- }
-
- /**
- * Output the result of the canvas
- *
- * @param array $param Parameter array
- * @abstract
- */
- function save($param = false)
- {
- parent::save($param);
- pdf_end_page($this->_pdf);
- pdf_close($this->_pdf);
-
- $buf = pdf_get_buffer($this->_pdf);
- $len = strlen($buf);
-
- $fp = @fopen($param['filename'], 'wb');
- if ($fp) {
- fwrite($fp, $buf, strlen($buf));
- fclose($fp);
- }
- pdf_delete($this->_pdf);
- }
-
- /**
- * Get a canvas specific HTML tag.
- *
- * This method implicitly saves the canvas to the filename in the
- * filesystem path specified and parses it as URL specified by URL path
- *
- * Parameter array:
- * 'filename': string
- * 'filepath': string Path to the file on the file system. Remember the final slash
- * 'urlpath': string Path to the file available through an URL. Remember the final slash
- * 'title': string The url title
- */
- function toHtml($params)
- {
- parent::toHtml($params);
- return '<a href="' . $params['urlpath'] . $params['filename'] . '">' . $params['title'] . '</a>';
- }
-
- /**
- * Check which major version of PDFlib is installed
- *
- * @return int The mahor version number of PDFlib
- * @access private
- */
- function _version()
- {
- $result = false;
- if (function_exists('pdf_get_majorversion')) {
- $version = pdf_get_majorversion();
- } else {
- ob_start();
- phpinfo(8);
- $php_info = ob_get_contents();
- ob_end_clean();
-
- if (ereg("<td[^>]*>PDFlib GmbH Version *<\/td><td[^>]*>([^<]*)<\/td>",
- $php_info, $result))
- {
- $version = $result[1];
- }
- }
-
- if (ereg('([0-9]{1,2})\.[0-9]{1,2}(\.[0-9]{1,2})?', trim($version), $result)) {
- return $result[1];
- } else {
- return 0;
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Canvas/SVG.php b/config/archive/dspam/pear/Image/Canvas/SVG.php
deleted file mode 100644
index 3fed62ba..00000000
--- a/config/archive/dspam/pear/Image/Canvas/SVG.php
+++ /dev/null
@@ -1,918 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Class for handling output in SVG format.
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-
-/**
- * Include file Image/Canvas.php
- */
-require_once 'Image/Canvas.php';
-
-/**
- * Include file Image/Canvas/Color.php
- */
-require_once 'Image/Canvas/Color.php';
-
-/**
- * SVG Canvas class.
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-class Image_Canvas_SVG extends Image_Canvas
-{
-
- /**
- * The SVG elements
- * @var string
- * @access private
- */
- var $_elements = '';
-
- /**
- * The SVG defines
- * @var string
- * @access private
- */
- var $_defs = '';
-
- /**
- * The current indention level
- * @var string
- * @access private
- */
- var $_indent = ' ';
-
- /**
- * A unieuq id counter
- * @var int
- * @access private
- */
- var $_id = 1;
-
- /**
- * The current group ids
- * @var array
- * @access private
- */
- var $_groupIDs = array();
-
- /**
- * Create the SVG canvas.
- *
- * Parameters available:
- *
- * 'width' The width of the graph
- *
- * 'height' The height of the graph
- *
- * @param array $param Parameter array
- */
- function Image_Canvas_SVG($param)
- {
- parent::Image_Canvas($param);
- $this->_reset();
- }
-
- /**
- * Add a SVG "element" to the output
- *
- * @param string $element The element
- * @access private
- */
- function _addElement($element, $params = array()) {
- $elementdata = $this->_indent . $element . "\n";
-
- if (isset($params['url'])) {
- $url = $params['url'];
- $target = (isset($params['target']) ? $params['target'] : false);
- $alt = (isset($params['alt']) ? $params['alt'] : false);
-
- $tags = '';
- if (isset($params['htmltags'])) {
- foreach ($params['htmltags'] as $key => $value) {
- $tags .= ' ';
- if (strpos($value, '"') >= 0) {
- $tags .= $key . '=\'' . $value . '\'';
- } else {
- $tags .= $key . '="' . $value . '"';
- }
- }
- }
-
- $elementdata =
- $this->_indent . '<a xlink:href="' . $url . '"' . ($target ? ' target="' . $target . '"' : '') . '>' . "\n" .
- ' ' . $elementdata .
- $this->_indent . '</a>' . "\n";
- }
-
-
- $this->_elements .= $elementdata;
- }
-
- /**
- * Add a SVG "define" to the output
- *
- * @param string $def The define
- * @access private
- */
- function _addDefine($def) {
- $this->_defs .= ' ' . $def . "\n";
- }
-
- /**
- * Get the color index for the RGB color
- *
- * @param int $color The color
- * @return int A SVG compatible color
- * @access private
- */
- function _color($color = false)
- {
- if ($color === false) {
- return 'transparent';
- } else {
- $color = Image_Canvas_Color::color2RGB($color);
- return 'rgb(' . $color[0] . ',' . $color[1] . ',' . $color[2] . ')';
- }
- }
-
- /**
- * Get the opacity for the RGB color
- *
- * @param int $color The color
- * @return int A SVG compatible opacity value
- * @access private
- */
- function _opacity($color = false)
- {
- if ($color === false) {
- return false;
- } else {
- $color = Image_Canvas_Color::color2RGB($color);
- if ($color[3] != 255) {
- return sprintf('%0.1f', $color[3]/255);
- } else {
- return false;
- }
- }
- }
-
- /**
- * Get the SVG applicable linestyle
- *
- * @param mixed $lineStyle The line style to return, false if the one
- * explicitly set
- * @return mixed A SVG compatible linestyle
- * @access private
- */
- function _getLineStyle($lineStyle = false)
- {
- $result = '';
- if ($lineStyle === false) {
- $lineStyle = $this->_lineStyle;
- }
-
- // TODO Linestyles (i.e. fx. dotted) does not work
-
- if (($lineStyle != 'transparent') && ($lineStyle !== false)) {
- $result = 'stroke-width:' . $this->_thickness . ';';
- $result .= 'stroke:' .$this->_color($lineStyle) . ';';
- if ($opacity = $this->_opacity($lineStyle)) {
- $result .= 'stroke-opacity:' . $opacity . ';';
- }
- }
- return $result;
- }
-
- /**
- * Get the SVG applicable fillstyle
- *
- * @param mixed $fillStyle The fillstyle to return, false if the one
- * explicitly set
- * @return mixed A SVG compatible fillstyle
- * @access private
- */
- function _getFillStyle($fillStyle = false)
- {
- $result = '';
- if ($fillStyle === false) {
- $fillStyle = $this->_fillStyle;
- }
-
- if (is_array($fillStyle)) {
- if ($fillStyle['type'] == 'gradient') {
- $id = 'gradient_' . ($this->_id++);
- $startColor = $this->_color($fillStyle['start']);
- $endColor = $this->_color($fillStyle['end']);
- $startOpacity = $this->_opacity($fillStyle['start']);
- $endOpacity = $this->_opacity($fillStyle['end']);
-
- switch ($fillStyle['direction']) {
- case 'horizontal':
- case 'horizontal_mirror':
- $x1 = '0%';
- $y1 = '0%';
- $x2 = '100%';
- $y2 = '0%';
- break;
-
- case 'vertical':
- case 'vertical_mirror':
- $x1 = '0%';
- $y1 = '100%';
- $x2 = '0%';
- $y2 = '0%';
- break;
-
- case 'diagonal_tl_br':
- $x1 = '0%';
- $y1 = '0%';
- $x2 = '100%';
- $y2 = '100%';
- break;
-
- case 'diagonal_bl_tr':
- $x1 = '0%';
- $y1 = '100%';
- $x2 = '100%';
- $y2 = '0%';
- break;
-
- case 'radial':
- $cx = '50%';
- $cy = '50%';
- $r = '100%';
- $fx = '50%';
- $fy = '50%';
- break;
-
- }
-
- if ($fillStyle['direction'] == 'radial') {
- $this->_addDefine(
- '<radialGradient id="' . $id . '" cx="' .
- $cx .'" cy="' . $cy .'" r="' . $r .'" fx="' .
- $fx .'" fy="' . $fy .'">'
- );
- $this->_addDefine(
- ' <stop offset="0%" style="stop-color:' .
- $startColor. ';' . ($startOpacity ? 'stop-opacity:' .
- $startOpacity . ';' : ''). '"/>'
- );
- $this->_addDefine(
- ' <stop offset="100%" style="stop-color:' .
- $endColor. ';' . ($endOpacity ? 'stop-opacity:' .
- $endOpacity . ';' : ''). '"/>'
- );
- $this->_addDefine(
- '</radialGradient>'
- );
- } elseif (($fillStyle['direction'] == 'vertical_mirror') ||
- ($fillStyle['direction'] == 'horizontal_mirror'))
- {
- $this->_addDefine(
- '<linearGradient id="' . $id . '" x1="' .
- $x1 .'" y1="' . $y1 .'" x2="' . $x2 .'" y2="' .
- $y2 .'">'
- );
- $this->_addDefine(
- ' <stop offset="0%" style="stop-color:' .
- $startColor. ';' . ($startOpacity ? 'stop-opacity:' .
- $startOpacity . ';' : ''). '"/>'
- );
- $this->_addDefine(
- ' <stop offset="50%" style="stop-color:' .
- $endColor. ';' . ($endOpacity ? 'stop-opacity:' .
- $endOpacity . ';' : ''). '"/>'
- );
- $this->_addDefine(
- ' <stop offset="100%" style="stop-color:' .
- $startColor. ';' . ($startOpacity ? 'stop-opacity:' .
- $startOpacity . ';' : ''). '"/>'
- );
- $this->_addDefine(
- '</linearGradient>'
- );
- } else {
- $this->_addDefine(
- '<linearGradient id="' . $id . '" x1="' .
- $x1 .'" y1="' . $y1 .'" x2="' . $x2 .'" y2="' .
- $y2 .'">'
- );
- $this->_addDefine(
- ' <stop offset="0%" style="stop-color:' .
- $startColor. ';' . ($startOpacity ? 'stop-opacity:' .
- $startOpacity . ';' : ''). '"/>'
- );
- $this->_addDefine(
- ' <stop offset="100%" style="stop-color:' .
- $endColor. ';' . ($endOpacity ? 'stop-opacity:' .
- $endOpacity . ';' : ''). '"/>'
- );
- $this->_addDefine(
- '</linearGradient>'
- );
- }
-
- return 'fill:url(#' . $id . ');';
- }
- } elseif (($fillStyle != 'transparent') && ($fillStyle !== false)) {
- $result = 'fill:' . $this->_color($fillStyle) . ';';
- if ($opacity = $this->_opacity($fillStyle)) {
- $result .= 'fill-opacity:' . $opacity . ';';
- }
- return $result;
- } else {
- return 'fill:none;';
- }
- }
-
- /**
- * Sets an image that should be used for filling
- *
- * @param string $filename The filename of the image to fill with
- */
- function setFillImage($filename)
- {
- }
-
- /**
- * Sets a gradient fill
- *
- * @param array $gradient Gradient fill options
- */
- function setGradientFill($gradient)
- {
- $this->_fillStyle = $gradient;
- $this->_fillStyle['type'] = 'gradient';
- }
-
- /**
- * Sets the font options.
- *
- * The $font array may have the following entries:
- * 'type' = 'ttf' (TrueType) or omitted for default<br>
- * If 'type' = 'ttf' then the following can be specified<br>
- * 'size' = size in pixels<br>
- * 'angle' = the angle with which to write the text
- * 'file' = the .ttf file (either the basename, filename or full path)
- *
- * @param array $font The font options.
- */
- function setFont($fontOptions)
- {
- parent::setFont($fontOptions);
- if (!isset($this->_font['size'])) {
- $this->_font['size'] = 10;
- }
- }
-
- /**
- * Parameter array:
- * 'x0': int X start point
- * 'y0': int Y start point
- * 'x1': int X end point
- * 'y1': int Y end point
- * 'color': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function line($params)
- {
- $x0 = $this->_getX($params['x0']);
- $y0 = $this->_getY($params['y0']);
- $x1 = $this->_getX($params['x1']);
- $y1 = $this->_getY($params['y1']);
- $color = (isset($params['color']) ? $params['color'] : false);
-
- $style = $this->_getLineStyle($color) . $this->_getFillStyle('transparent');
- if ($style != '') {
- $this->_addElement(
- '<line ' .
- 'x1="' . round($x0) . '" ' .
- 'y1="' . round($y0) . '" ' .
- 'x2="' . round($x1) . '" ' .
- 'y2="' . round($y1) . '" ' .
- 'style="' . $style . '"' .
- '/>',
- $params
- );
- }
- parent::line($params);
- }
-
- /**
- * Parameter array:
- * 'connect': bool [optional] Specifies whether the start point should be
- * connected to the endpoint (closed polygon) or not (connected line)
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function polygon($params = array())
- {
- $connectEnds = (isset($params['connect']) ? $params['connect'] : false);
- $fillColor = (isset($params['fill']) ? $params['line'] : false);
- $lineColor = (isset($params['line']) ? $params['line'] : false);
-
- if (!$connectEnds) {
- $fillColor = 'transparent';
- }
- $style = $this->_getLineStyle($lineColor) . $this->_getFillStyle($fillColor);
-
- $first = true;
- $spline = false;
- $lastpoint = false;
- foreach($this->_polygon as $point) {
- if ($first) {
- $points = 'M';
- } elseif (!$spline) {
- $points .= ' L';
- }
-
- if (($spline) && ($lastpoint !== false)) {
- $points .= ' ' .round($lastpoint['P1X']) . ',' . round($lastpoint['P1Y']) . ' ' .
- round($lastpoint['P2X']) . ',' . round($lastpoint['P2Y']);
- }
-
- $points .= ' ' . round($point['X']) . ',' . round($point['Y']);
-
- if ((isset($point['P1X'])) && (isset($point['P1Y'])) &&
- (isset($point['P2X'])) && (isset($point['P2Y'])))
- {
- if (($first) || (!$spline)) {
- $points .= ' C';
- }
- $lastpoint = $point;
- $spline = true;
- } else {
- $spline = false;
- }
- $first = false;
- }
- if ($connectEnds) {
- $point .= ' Z';
- }
- $this->_addElement(
- '<path ' .
- 'd="' . $points . '" ' .
- 'style="' . $style . '"' .
- '/>',
- $params
- );
-
- parent::polygon($params);
- }
-
- /**
- * Draw a rectangle
- *
- * Parameter array:
- * 'x0': int X start point
- * 'y0': int Y start point
- * 'x1': int X end point
- * 'y1': int Y end point
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function rectangle($params)
- {
- $x0 = min($this->_getX($params['x0']), $this->_getX($params['x1']));
- $y0 = min($this->_getY($params['y0']), $this->_getY($params['y1']));
- $x1 = max($this->_getX($params['x0']), $this->_getX($params['x1']));
- $y1 = max($this->_getY($params['y0']), $this->_getY($params['y1']));
- $fillColor = (isset($params['fill']) ? $params['line'] : false);
- $lineColor = (isset($params['line']) ? $params['line'] : false);
-
- $style = $this->_getLineStyle($lineColor) . $this->_getFillStyle($fillColor);
- if ($style != '') {
- $this->_addElement(
- '<rect ' .
- 'x="' . round($x0) . '" ' .
- 'y="' . round($y0) . '" ' .
- 'width="' . round(abs($x1 - $x0)) . '" ' .
- 'height="' . round(abs($y1 - $y0)) . '" ' .
- 'style="' . $style . '"' .
- '/>',
- $params
- );
- }
- parent::rectangle($params);
- }
-
- /**
- * Draw an ellipse
- *
- * Parameter array:
- * 'x': int X center point
- * 'y': int Y center point
- * 'rx': int X radius
- * 'ry': int Y radius
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function ellipse($params)
- {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $rx = $this->_getX($params['rx']);
- $ry = $this->_getY($params['ry']);
- $fillColor = (isset($params['fill']) ? $params['line'] : false);
- $lineColor = (isset($params['line']) ? $params['line'] : false);
-
- $style = $this->_getLineStyle($lineColor) . $this->_getFillStyle($fillColor);
- if ($style != '') {
- $this->_addElement(
- '<ellipse ' .
- 'cx="' . round($x) . '" ' .
- 'cy="' . round($y) . '" ' .
- 'rx="' . round($rx) . '" ' .
- 'ry="' . round($ry) . '" ' .
- 'style="' . $style . '"' .
- '/>',
- $params
- );
- }
- parent::ellipse($params);
- }
-
- /**
- * Draw a pie slice
- *
- * Parameter array:
- * 'x': int X center point
- * 'y': int Y center point
- * 'rx': int X radius
- * 'ry': int Y radius
- * 'v1': int The starting angle (in degrees)
- * 'v2': int The end angle (in degrees)
- * 'srx': int [optional] Starting X-radius of the pie slice (i.e. for a doughnut)
- * 'sry': int [optional] Starting Y-radius of the pie slice (i.e. for a doughnut)
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function pieslice($params)
- {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $rx = $this->_getX($params['rx']);
- $ry = $this->_getY($params['ry']);
- $v1 = $this->_getX($params['v1']);
- $v2 = $this->_getY($params['v2']);
- $srx = (isset($params['srx']) ? $this->_getX($params['srx']) : false);
- $sry = (isset($params['sry']) ? $this->_getX($params['sry']) : false);
- $fillColor = (isset($params['fill']) ? $params['line'] : false);
- $lineColor = (isset($params['line']) ? $params['line'] : false);
-
- $dv = max($v2, $v1) - min($v2, $v1);
- if ($dv >= 360) {
- $this->ellipse($params);
- }
- else {
- $style = $this->_getLineStyle($lineColor) . $this->_getFillStyle($fillColor);
- if ($style != '') {
- $x1 = ($x + $rx * cos(deg2rad(min($v1, $v2) % 360)));
- $y1 = ($y + $ry * sin(deg2rad(min($v1, $v2) % 360)));
- $x2 = ($x + $rx * cos(deg2rad(max($v1, $v2) % 360)));
- $y2 = ($y + $ry * sin(deg2rad(max($v1, $v2) % 360)));
- $this->_addElement(
- '<path d="' .
- 'M' . round($x) . ',' . round($y) . ' ' .
- 'L' . round($x1) . ',' . round($y1) . ' ' .
- 'A' . round($rx) . ',' . round($ry) . ($dv > 180 ? ' 0 1,1 ' : ' 0 0,1 ') .
- round($x2) . ',' . round($y2) . ' ' .
- 'Z" ' .
- 'style="' . $style . '"' .
- '/>',
- $params
- );
- }
-
- parent::pieslice($params);
- }
- }
-
- /**
- * Get the width of a text,
- *
- * @param string $text The text to get the width of
- * @return int The width of the text
- */
- function textWidth($text)
- {
- if ((isset($this->_font['vertical'])) && ($this->_font['vertical'])) {
- return $this->_font['size'];
- } else {
- return round($this->_font['size'] * 0.7 * strlen($text));
- }
- }
-
- /**
- * Get the height of a text,
- *
- * @param string $text The text to get the height of
- * @return int The height of the text
- */
- function textHeight($text)
- {
- if ((isset($this->_font['vertical'])) && ($this->_font['vertical'])) {
- return round($this->_font['size'] * 0.7 * strlen($text));
- } else {
- return $this->_font['size'];
- }
- }
-
- /**
- * Writes text
- *
- * Parameter array:
- * 'x': int X-point of text
- * 'y': int Y-point of text
- * 'text': string The text to add
- * 'alignment': array [optional] Alignment
- * 'color': mixed [optional] The color of the text
- */
- function addText($params)
- {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $text = $params['text'];
- $color = (isset($params['color']) ? $params['color'] : false);
- $alignment = (isset($params['alignment']) ? $params['alignment'] : false);
-
- $textHeight = $this->textHeight($text);
-
- if (!is_array($alignment)) {
- $alignment = array('vertical' => 'top', 'horizontal' => 'left');
- }
-
- if (!isset($alignment['vertical'])) {
- $alignment['vertical'] = 'top';
- }
-
- if (!isset($alignment['horizontal'])) {
- $alignment['horizontal'] = 'left';
- }
-
- $align = '';
-
- if ((isset($this->_font['vertical'])) && ($this->_font['vertical'])) {
-// $align .= 'writing-mode: tb-rl;';
-
- if ($alignment['vertical'] == 'bottom') {
- $align .= 'text-anchor:end;';
- //$y = $y + $textHeight;
- } elseif ($alignment['vertical'] == 'center') {
- //$y = $y + ($textHeight / 2);
- $align .= 'text-anchor:middle;';
- }
- } else {
- if ($alignment['horizontal'] == 'right') {
- $align .= 'text-anchor:end;';
- } elseif ($alignment['horizontal'] == 'center') {
- $align .= 'text-anchor:middle;';
- }
-
- if ($alignment['vertical'] == 'top') {
- $y = $y + $textHeight;
- } elseif ($alignment['vertical'] == 'center') {
- $y = $y + ($textHeight / 2);
- }
- }
-
- if (($color === false) && (isset($this->_font['color']))) {
- $color = $this->_font['color'];
- }
-
- $textColor = $this->_color($color);
- $textOpacity = $this->_opacity($color);
-
- $this->_addElement(
- '<g transform="translate(' . round($x) . ', ' . round($y) . ')">' . "\n" .
- $this->_indent . ' <text ' .
- 'x="0" ' .
- 'y="0" ' .
- (isset($this->_font['angle']) && ($this->_font['angle'] > 0) ?
- 'transform="rotate(' . $this->_font['angle'] . ')" ' :
- ''
- ) .
- 'style="' .
- (isset($this->_font['name']) ?
- 'font-family:' . $this->_font['name'] . ';' : '') .
- 'font-size:' . $this->_font['size'] . 'px;fill:' .
- $textColor . ($textOpacity ? ';fill-opacity:' .
- $textOpacity :
- ''
- ) . ';' . $align . '">' .
- htmlspecialchars($text) .
- '</text>' . "\n" .
- $this->_indent . '</g>',
- $params
- );
- parent::addText($params);
- }
-
- /**
- * Overlay image
- *
- * Parameter array:
- * 'x': int X-point of overlayed image
- * 'y': int Y-point of overlayed image
- * 'filename': string The filename of the image to overlay
- * 'width': int [optional] The width of the overlayed image (resizing if possible)
- * 'height': int [optional] The height of the overlayed image (resizing if possible)
- * 'alignment': array [optional] Alignment
- */
- function image($params)
- {
- $x = $this->_getX($params['x']);
- $y = $this->_getY($params['y']);
- $filename = $params['filename'];
-
- list($width, $height, $type, $attr) = getimagesize($filename);
- $width = (isset($params['width']) ? $params['width'] : $width);
- $height = (isset($params['height']) ? $params['height'] : $height);
- $alignment = (isset($params['alignment']) ? $params['alignment'] : false);
-
- $file = fopen($filename, 'rb');
- $filedata = fread($file, filesize($filename));
- fclose($file);
-
- $data = 'data:' . image_type_to_mime_type($type) . ';base64,' . base64_encode($filedata);
- $this->_addElement(
- '<image xlink:href="' . $data . '" x="' . $x . '" y="' . $y . '"' .
- ($width ? ' width="' . $width . '"' : '') .
- ($height ? ' height="' . $height . '"' : '') .
- ' preserveAspectRatio="none"/>',
- $params
- );
- parent::image($params);
- }
-
- /**
- * Start a group.
- *
- * What this does, depends on the canvas/format.
- *
- * @param string $name The name of the group
- */
- function startGroup($name = false)
- {
- $name = strtolower(str_replace(' ', '_', $name));
- if (in_array($name, $this->_groupIDs)) {
- $name .= $this->_id;
- $this->_id++;
- }
- $this->_groupIDs[] = $name;
- $this->_addElement('<g id="' . htmlspecialchars($name) . '">');
- $this->_indent .= ' ';
- }
-
- /**
- * End the "current" group.
- *
- * What this does, depends on the canvas/format.
- */
- function endGroup()
- {
- $this->_indent = substr($this->_indent, 0, -4);
- $this->_addElement('</g>');
- }
-
- /**
- * Output the result of the canvas
- *
- * @param array $param Parameter array
- */
- function show($param = false)
- {
- parent::show($param);
- $output = '<?xml version="1.0" encoding="iso-8859-1"?>' . "\n" .
- '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"' . "\n\t" .
- ' "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">' . "\n" .
- '<svg width="' . $this->_width . '" height="' . $this->_height .
- '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' . "\n" .
- ($this->_defs ?
- ' <defs>' . "\n" .
- $this->_defs .
- ' </defs>' . "\n" :
- ''
- ) .
- $this->_elements .
- '</svg>';
-
- header('Content-Type: image/svg+xml');
- header('Content-Disposition: inline; filename = "' . basename($_SERVER['PHP_SELF'], '.php') . '.svg"');
- print $output;
- }
-
- /**
- * Output the result of the canvas
- *
- * @param array $param Parameter array
- */
- function save($param = false)
- {
- parent::save($param);
- $output = '<?xml version="1.0" encoding="iso-8859-1"?>' . "\n" .
- '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"' . "\n\t" .
- ' "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">' . "\n" .
- '<svg width="' . $this->_width . '" height="' . $this->_height .
- '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' . "\n" .
- ($this->_defs ?
- ' <defs>' . "\n" .
- $this->_defs .
- ' </defs>' . "\n" :
- ''
- ) .
- $this->_elements .
- '</svg>';
-
- $file = fopen($param['filename'], 'w+');
- fwrite($file, $output);
- fclose($file);
- }
-
- /**
- * Set clipping to occur
- *
- * Parameter array:
- *
- * 'x0': int X point of Upper-left corner
- * 'y0': int X point of Upper-left corner
- * 'x1': int X point of lower-right corner
- * 'y1': int Y point of lower-right corner
- */
- function setClipping($params = false)
- {
- if ($params === false) {
- $this->_addElement('</g>');
- }
- else {
- $group = "clipping_" . $this->_id;
- $this->_id++;
- $this->_addElement('<g clip-path="url(#' . $group . ')">');
-
- $this->_addDefine('<clipPath id="' . $group . '">');
- $this->_addDefine(' <path d="' .
- 'M' . $this->_getX($params['x0']) . ' ' . $this->_getY($params['y0']) .
- ' H' . $this->_getX($params['x1']) .
- ' V' . $this->_getY($params['y1']) .
- ' H' . $this->_getX($params['x0']) .
- ' Z"/>');
- $this->_addDefine('</clipPath>');
- }
- }
-
- /**
- * Get a canvas specific HTML tag.
- *
- * This method implicitly saves the canvas to the filename in the
- * filesystem path specified and parses it as URL specified by URL path
- *
- * Parameter array:
- * 'filename': string
- * 'filepath': string Path to the file on the file system. Remember the final slash
- * 'urlpath': string Path to the file available through an URL. Remember the final slash
- * 'width': int The width in pixels
- * 'height': int The height in pixels
- */
- function toHtml($params)
- {
- parent::toHtml($params);
- return '<embed src="' . $params['urlpath'] . $params['filename'] . '" width=' . $params['width'] . ' height=' . $params['height'] . ' type="image/svg+xml">';
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Canvas/Tool.php b/config/archive/dspam/pear/Image/Canvas/Tool.php
deleted file mode 100644
index 3b87122c..00000000
--- a/config/archive/dspam/pear/Image/Canvas/Tool.php
+++ /dev/null
@@ -1,217 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Canvas
- *
- * Canvas based creation of images to facilitate different output formats
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-
-/**
- * This class contains a set of tool-functions.
- *
- * These functions are all to be called statically
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- * @abstract
- */
-class Image_Canvas_Tool
-{
-
- /**
- * Maps a font name to an actual font file (fx. a .ttf file)
- *
- * Used to translate names (i.e. 'Courier New' to 'cour.ttf' or
- * '/Windows/Fonts/Cour.ttf')
- *
- * Font names are translated using the tab-separated file
- * Image/Canvas/Tool/fontmap.txt.
- *
- * The translated font-name (or the original if no translation) exists is
- * then returned if it is an existing file, otherwise the file is searched
- * first in the path specified by IMAGE_CANVAS_SYSTEM_FONT_PATH defined in
- * Image/Canvas.php, then in the Image/Canvas/Fonts folder. If a font is
- * still not found and the name is not beginning with a '/' the search is
- * left to the library, otherwise the font is deemed non-existing.
- *
- * @param string $name The name of the font
- * @param string $type The needed file type of the font
- * @return string The filename of the font
- * @static
- */
- function fontMap($name, $type = '.ttf')
- {
- static $_fontMap;
-
- if (!is_array($_fontMap)) {
- if (file_exists($fontmap = (dirname(__FILE__) . '/Fonts/fontmap.txt'))) {
- $file = file($fontmap);
- foreach($file as $fontmapping) {
- list($fontname, $filenames) = explode(',', $fontmapping, 2);
- $fontname = trim($fontname);
- $filenames = trim($filenames);
- $filenames = explode(',', $filenames);
- foreach ($filenames as $filename) {
- $type_pos = strrpos($filename, '.');
- $type = substr($filename, $type_pos);
- $_fontMap[$fontname][$type] = $filename;
- }
- }
- }
- }
-
- $type = strtolower($type);
-
- if ((isset($_fontMap[$name])) && (isset($_fontMap[$name][$type]))) {
- $filename = $_fontMap[$name][$type];
- } else {
- $filename = $name;
- }
-
- if (substr($filename, -strlen($type)) !== $type) {
- $filename .= $type;
- }
-
- $result = false;
- if (file_exists($filename)) {
- $result = $filename;
- } elseif (file_exists($file = (IMAGE_CANVAS_SYSTEM_FONT_PATH . $filename))) {
- $result = $file;
- } elseif (file_exists($file = (dirname(__FILE__) . '/Fonts/' . $filename))) {
- $result = $file;
- } elseif (substr($name, 0, 1) !== '/') {
- // leave it to the library to find the font
- $result = $name;
- }
-
- return str_replace('\\', '/', $result);
- }
-
- /**
- * Return the average of 2 points
- *
- * @param double P1 1st point
- * @param double P2 2nd point
- * @return double The average of P1 and P2
- * @static
- */
- function mid($p1, $p2)
- {
- return ($p1 + $p2) / 2;
- }
-
- /**
- * Mirrors P1 in P2 by a amount of Factor
- *
- * @param double $p1 1st point, point to mirror
- * @param double $o2 2nd point, mirror point
- * @param double $factor Mirror factor, 0 returns $p2, 1 returns a pure
- * mirror, ie $p1 on the exact other side of $p2
- * @return double $p1 mirrored in $p2 by Factor
- * @static
- */
- function mirror($p1, $p2, $factor = 1)
- {
- return $p2 + $factor * ($p2 - $p1);
- }
-
- /**
- * Calculates a Bezier control point, this function must be called for BOTH
- * X and Y coordinates (will it work for 3D coordinates!?)
- *
- * @param double $p1 1st point
- * @param double $p2 Point to
- * @param double $factor Mirror factor, 0 returns P2, 1 returns a pure
- * mirror, i.e. P1 on the exact other side of P2
- * @return double P1 mirrored in P2 by Factor
- * @static
- */
- function controlPoint($p1, $p2, $factor, $smoothFactor = 0.75)
- {
- $sa = Image_Canvas_Tool::mirror($p1, $p2, $smoothFactor);
- $sb = Image_Canvas_Tool::mid($p2, $sa);
-
- $m = Image_Canvas_Tool::mid($p2, $factor);
-
- $pC = Image_Canvas_Tool::mid($sb, $m);
-
- return $pC;
- }
-
- /**
- * Calculates a Bezier point, this function must be called for BOTH X and Y
- * coordinates (will it work for 3D coordinates!?)
- *
- * @param double $t A position between $p2 and $p3, value between 0 and 1
- * @param double $p1 Point to use for calculating control points
- * @param double $p2 Point 1 to calculate bezier curve between
- * @param double $p3 Point 2 to calculate bezier curve between
- * @param double $p4 Point to use for calculating control points
- * @return double The bezier value of the point t between $p2 and $p3 using
- * $p1 and $p4 to calculate control points
- * @static
- */
- function bezier($t, $p1, $p2, $p3, $p4)
- {
- // (1-t)^3*p1 + 3*(1-t)^2*t*p2 + 3*(1-t)*t^2*p3 + t^3*p4
- return pow(1 - $t, 3) * $p1 +
- 3 * pow(1 - $t, 2) * $t * $p2 +
- 3 * (1 - $t) * pow($t, 2) * $p3 +
- pow($t, 3) * $p4;
- }
-
- /**
- * Gets the angle / slope of a line relative to horizontal (left -> right)
- *
- * @param double $x0 The starting x point
- * @param double $y0 The starting y point
- * @param double $x1 The ending x point
- * @param double $y1 The ending y point
- * @param double The angle in degrees of the line
- * @static
- */
- function getAngle($x0, $y0, $x1, $y1)
- {
-
- $dx = ($x1 - $x0);
- $dy = ($y1 - $y0);
- $l = sqrt($dx * $dx + $dy * $dy);
- $v = rad2deg(asin(($y0 - $y1) / $l));
- if ($dx < 0) {
- $v = 180 - $v;
- }
- return $v;
-
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Canvas/WithMap.php b/config/archive/dspam/pear/Image/Canvas/WithMap.php
deleted file mode 100644
index dc43ec4d..00000000
--- a/config/archive/dspam/pear/Image/Canvas/WithMap.php
+++ /dev/null
@@ -1,278 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Canvas
- *
- * Canvas based creation of images to facilitate different output formats
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- */
-
-/**
- * Class for handling different output formats including a HTML image map
- *
- * @category Images
- * @package Image_Canvas
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=212
- * @since version 0.2.0
- * @abstract
- */
-class Image_Canvas_WithMap extends Image_Canvas
-{
-
- /**
- * The image map
- * @var Image_Canvas_ImageMap
- * @access private
- */
- var $_imageMap = null;
-
- /**
- * Create the canvas.
- *
- * Parameters available:
- *
- * 'width' The width of the graph on the canvas
- *
- * 'height' The height of the graph on the canvas
- *
- * 'left' The left offset of the graph on the canvas
- *
- * 'top' The top offset of the graph on the canvas
- *
- * 'usemap' Initialize an image map
- *
- * @param array $params Parameter array
- * @abstract
- */
- function Image_Canvas_WithMap($params)
- {
- parent::Image_Canvas($params);
-
- if ((isset($params['usemap'])) && ($params['usemap'] === true)) {
- $this->_imageMap =& Image_Canvas::factory(
- 'ImageMap',
- array(
- 'left' => $this->_left,
- 'top' => $this->_top,
- 'width' => $this->_width,
- 'height' => $this->_height
- )
- );
- }
- }
- /**
- * Draw a line
- *
- * Parameter array:
- * 'x0': int X start point
- * 'y0': int Y start point
- * 'x1': int X end point
- * 'y1': int Y end point
- * 'color': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function line($params)
- {
- if (isset($this->_imageMap)) {
- $this->_imageMap->line($params);
- }
- parent::line($params);
- }
-
- /**
- * Adds vertex to a polygon
- *
- * Parameter array:
- * 'x': int X point
- * 'y': int Y point
- * @param array $params Parameter array
- */
- function addVertex($params)
- {
- if (isset($this->_imageMap)) {
- $this->_imageMap->addVertex($params);
- }
- parent::addVertex($params);
- }
-
- /**
- * Adds "splined" vertex to a polygon
- *
- * Parameter array:
- * 'x': int X point
- * 'y': int Y point
- * 'p1x': X Control point 1
- * 'p1y': Y Control point 1
- * 'p2x': X Control point 2
- * 'p2y': Y Control point 2
- * @param array $params Parameter array
- */
- function addSpline($params)
- {
- if (isset($this->_imageMap)) {
- $this->_imageMap->addSpline($params);
- }
- parent::addSpline($params);
- }
-
- /**
- * Draws a polygon
- *
- * Parameter array:
- * 'connect': bool [optional] Specifies whether the start point should be
- * connected to the endpoint (closed polygon) or not (connected line)
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function polygon($params)
- {
- if (isset($this->_imageMap)) {
- $this->_imageMap->polygon($params);
- }
- parent::polygon($params);
- }
-
- /**
- * Draw a rectangle
- *
- * Parameter array:
- * 'x0': int X start point
- * 'y0': int Y start point
- * 'x1': int X end point
- * 'y1': int Y end point
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function rectangle($params)
- {
- if (isset($this->_imageMap)) {
- $this->_imageMap->rectangle($params);
- }
- parent::rectangle($params);
- }
-
- /**
- * Draw an ellipse
- *
- * Parameter array:
- * 'x': int X center point
- * 'y': int Y center point
- * 'rx': int X radius
- * 'ry': int Y radius
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function ellipse($params)
- {
- if (isset($this->_imageMap)) {
- $this->_imageMap->ellipse($params);
- }
- parent::ellipse($params);
- }
-
- /**
- * Draw a pie slice
- *
- * Parameter array:
- * 'x': int X center point
- * 'y': int Y center point
- * 'rx': int X radius
- * 'ry': int Y radius
- * 'v1': int The starting angle (in degrees)
- * 'v2': int The end angle (in degrees)
- * 'srx': int [optional] Starting X-radius of the pie slice (i.e. for a doughnut)
- * 'sry': int [optional] Starting Y-radius of the pie slice (i.e. for a doughnut)
- * 'fill': mixed [optional] The fill color
- * 'line': mixed [optional] The line color
- * @param array $params Parameter array
- */
- function pieslice($params)
- {
- if (isset($this->_imageMap)) {
- $this->_imageMap->pieslice($params);
- }
- parent::pieslice($params);
- }
-
- /**
- * Writes text
- *
- * Parameter array:
- * 'x': int X-point of text
- * 'y': int Y-point of text
- * 'text': string The text to add
- * 'alignment': array [optional] Alignment
- * 'color': mixed [optional] The color of the text
- */
- function addText($params)
- {
- if (isset($this->_imageMap)) {
- $this->_imageMap->addText($params);
- }
- parent::addText($params);
- }
-
- /**
- * Overlay image
- *
- * Parameter array:
- * 'x': int X-point of overlayed image
- * 'y': int Y-point of overlayed image
- * 'filename': string The filename of the image to overlay
- * 'width': int [optional] The width of the overlayed image (resizing if possible)
- * 'height': int [optional] The height of the overlayed image (resizing if possible)
- * 'alignment': array [optional] Alignment
- */
- function image($params)
- {
- if (isset($this->_imageMap)) {
- $this->_imageMap->image($params);
- }
- parent::image($params);
- }
-
- /**
- * Get the imagemap
- * @return Image_Graph_ImageMap The image map (or false if none)
- */
- function &getImageMap()
- {
- $result = null;
- if (isset($this->_imageMap)) {
- $result =& $this->_imageMap;
- }
- return $result;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Color.php b/config/archive/dspam/pear/Image/Color.php
deleted file mode 100644
index 1b20125d..00000000
--- a/config/archive/dspam/pear/Image/Color.php
+++ /dev/null
@@ -1,719 +0,0 @@
-<?php
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Color.php is the implementation of Image_Color.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This source file is subject to version 3.0 of the PHP license
- * that is available through the world-wide-web at the following URI:
- * http://www.php.net/license/3_0.txt. If you did not receive a copy of
- * the PHP License and are unable to obtain it through the web, please
- * send a note to license@php.net so we can mail you a copy immediately.
- *
- * @category Image
- * @package Image_Color
- * @author Jason Lotito <jason@lehighweb.com>
- * @author Andrew Morton <drewish@katherinehouse.com>
- * @copyright 2003-2005 The PHP Group
- * @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Color
- */
-
-/**
- * Image_Color handles color conversion and mixing.
- *
- * The class is quick, simple to use, and does its job fairly well but it's got
- * some code smells:
- * - Call setColors() for some functions but not others.
- * - Different functions expect different color formats. setColors() only
- * accepts hex while allocateColor() will accept named or hex (provided the
- * hex ones start with the # character).
- * - Some conversions go in only one direction, ie HSV->RGB but no RGB->HSV.
- * I'm going to try to straighten out some of this but I'll be hard to do so
- * without breaking backwards compatibility.
- *
- * @category Image
- * @package Image_Color
- * @author Jason Lotito <jason@lehighweb.com>
- * @author Andrew Morton <drewish@katherinehouse.com>
- * @copyright 2003-2005 The PHP Group
- * @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 0.1.2
- * @link http://pear.php.net/package/Image_Color
- */
-class Image_Color
-{
- /**
- * First color that the class handles for ranges and mixes.
- * @var array
- * @access public
- * @see setColors()
- */
- var $color1 = array();
-
- /**
- * Second color that the class handles for ranges and mixes.
- * @var array
- * @access public
- * @see setColors()
- */
- var $color2 = array();
-
- /**
- * Boolean value for determining whether colors outputted should be limited
- * to the web safe pallet or not.
- *
- * @var boolean
- * @access private
- * @see setWebSafe()
- */
- var $_websafeb = false;
-
- /**
- * Mix two colors together by finding their average. If the colors are not
- * passed as parameters, the class's colors will be mixed instead.
- *
- * @param string $col1 The first color you want to mix
- * @param string $col2 The second color you want to mix
- * @return string The mixed color.
- * @access public
- * @author Jason Lotito <jason@lehighweb.com>
- * @uses _setColors() to assign the colors if any are passed to the
- * class.
- */
- function mixColors($col1 = false, $col2 = false)
- {
- if ($col1) {
- $this->_setColors($col1, $col2);
- }
-
- // after finding the average, it will be a float. add 0.5 and then
- // cast to an integer to properly round it to an integer.
- $color3[0] = (int) ((($this->color1[0] + $this->color2[0]) / 2) + 0.5);
- $color3[1] = (int) ((($this->color1[1] + $this->color2[1]) / 2) + 0.5);
- $color3[2] = (int) ((($this->color1[2] + $this->color2[2]) / 2) + 0.5);
-
- if ($this->_websafeb) {
- array_walk($color3, '_makeWebSafe');
- }
-
- return Image_Color::rgb2hex($color3);
- }
-
- /**
- * Determines whether colors the returned by this class will be rounded to
- * the nearest web safe value.
- *
- * @param boolean $bool Indicates if colors should be limited to the
- * websafe pallet.
- * @return void
- * @access public
- * @author Jason Lotito <jason@lehighweb.com>
- */
- function setWebSafe($bool = true)
- {
- $this->_websafeb = (boolean) $bool;
- }
-
- /**
- * Set the two colors this class uses for mixing and ranges.
- *
- * @param string $col1 The first color in hex format
- * @param string $col2 The second color in hex format
- * @return void
- * @access public
- * @author Jason Lotito <jason@lehighweb.com>
- */
- function setColors($col1, $col2)
- {
- $this->_setColors($col1, $col2);
- }
-
- /**
- * Get the range of colors between the class's two colors, given a degree.
- *
- * @param integer $degrees How large a 'step' we should take between the
- * colors.
- * @return array Returns an array of hex strings, one element for each
- * color.
- * @access public
- * @author Jason Lotito <jason@lehighweb.com>
- * @todo Allow for degrees for individual parts of the colors.
- */
- function getRange($degrees = 2)
- {
- if ($degrees == 0) {
- $degrees = 1;
- }
-
- // The degrees give us how much we should advance each color at each
- // phase of the loop. This way, the advance is equal throughout all
- // the colors.
-
- $red_steps = ($this->color2[0] - $this->color1[0]) / $degrees;
- $green_steps = ($this->color2[1] - $this->color1[1]) / $degrees;
- $blue_steps = ($this->color2[2] - $this->color1[2]) / $degrees;
-
- $allcolors = array();
-
- /**
- * The loop stops once any color has gone beyond the end color.
- */
-
- // Loop through all the degrees between the colors
- for ($x = 0; $x < $degrees; $x++) {
- $col[0] = $red_steps * $x;
- $col[1] = $green_steps * $x;
- $col[2] = $blue_steps * $x;
-
- // Loop through each R, G, and B
- for ($i = 0; $i < 3; $i++) {
- $partcolor = $this->color1[$i] + $col[$i];
- // If the color is less than 256
- if ($partcolor < 256) {
- // Makes sure the colors is not less than 0
- if ($partcolor > -1) {
- $newcolor[$i] = $partcolor;
- } else {
- $newcolor[$i] = 0;
- }
- // Color was greater than 255
- } else {
- $newcolor[$i] = 255;
- }
- }
-
- if ($this->_websafeb) {
- array_walk($newcolor, '_makeWebSafe');
- }
-
- $allcolors[] = Image_Color::rgb2hex($newcolor);
- }
-
- return $allcolors;
- }
-
- /**
- * Change the lightness of the class's two colors.
- *
- * @param integer $degree The degree of the change. Positive values
- * lighten the color while negative values will darken it.
- * @return void
- * @access public
- * @author Jason Lotito <jason@lehighweb.com>
- * @uses Image_Color::$color1 as an input and return value.
- * @uses Image_Color::$color2 as an input and return value.
- */
- function changeLightness($degree = 10)
- {
- $color1 =& $this->color1;
- $color2 =& $this->color2;
-
- for ($x = 0; $x < 3; $x++) {
- if (($color1[$x] + $degree) < 256) {
- if (($color1[$x] + $degree) > -1) {
- $color1[$x] += $degree;
- } else {
- $color1[$x] = 0;
- }
- } else {
- $color1[$x] = 255;
- }
-
- if (($color2[$x] + $degree) < 256) {
- if (($color2[$x] + $degree) > -1) {
- $color2[$x] += $degree;
- } else {
- $color2[$x] = 0;
- }
- } else {
- $color2[$x] = 255;
- }
- }
- }
-
- /**
- * Determine if a light or dark text color would be more readable on a
- * background of a given color. This is determined by the G(reen) value of
- * RGB. You can change the dark and the light colors from their default
- * black and white.
- *
- * @param string $color The hex color to analyze
- * @param string $light The light color value to return if we should
- * have light text.
- * @param string $dark The dark color value to return if we should have
- * dark text.
- * @return string The light or dark value which would make the text most
- * readable.
- * @access public
- * @static
- * @author Jason Lotito <jason@lehighweb.com>
- */
- function getTextColor($color, $light = '#FFFFFF', $dark = '#000000')
- {
- $color = Image_Color::_splitColor($color);
- if ($color[1] > hexdec('66')) {
- return $dark;
- } else {
- return $light;
- }
- }
-
-
- /**
- * Internal method to set the colors.
- *
- * @param string $col1 First color, either a name or hex value
- * @param string $col2 Second color, either a name or hex value
- * @return void
- * @access private
- * @author Jason Lotito <jason@lehighweb.com>
- */
- function _setColors($col1, $col2)
- {
- if ($col1) {
- $this->color1 = Image_Color::_splitColor($col1);
- }
- if ($col2) {
- $this->color2 = Image_Color::_splitColor($col2);
- }
- }
-
- /**
- * Given a color, properly split it up into a 3 element RGB array.
- *
- * @param string $color The color.
- * @return array A three element RGB array.
- * @access private
- * @static
- * @author Jason Lotito <jason@lehighweb.com>
- */
- function _splitColor($color)
- {
- $color = str_replace('#', '', $color);
- $c[] = hexdec(substr($color, 0, 2));
- $c[] = hexdec(substr($color, 2, 2));
- $c[] = hexdec(substr($color, 4, 2));
- return $c;
- }
-
- /**
- * This is deprecated. Use rgb2hex() instead.
- * @access private
- * @deprecated Function deprecated after 1.0.1
- * @see rgb2hex().
- */
- function _returnColor ( $color )
- {
- return Image_Color::rgb2hex($color);
- }
-
- /**
- * Convert an RGB array to a hex string.
- *
- * @param array $color 3 element RGB array.
- * @return string Hex color string.
- * @access public
- * @static
- * @author Jason Lotito <jason@lehighweb.com>
- * @see hex2rgb()
- */
- function rgb2hex($color)
- {
- return sprintf('%02X%02X%02X',$color[0],$color[1],$color[2]);
- }
-
- /**
- * Convert a hex color string into an RGB array. An extra fourth element
- * will be returned with the original hex value.
- *
- * @param string $hex Hex color string.
- * @return array RGB color array with an extra 'hex' element containing
- * the original hex string.
- * @access public
- * @static
- * @author Jason Lotito <jason@lehighweb.com>
- * @see rgb2hex()
- */
- function hex2rgb($hex)
- {
- $return = Image_Color::_splitColor($hex);
- $return['hex'] = $hex;
- return $return;
- }
-
- /**
- * Convert an HSV (Hue, Saturation, Brightness) value to RGB.
- *
- * @param integer $h Hue
- * @param integer $s Saturation
- * @param integer $v Brightness
- * @return array RGB array.
- * @access public
- * @static
- * @author Jason Lotito <jason@lehighweb.com>
- * @uses hsv2hex() to convert the HSV value to Hex.
- * @uses hex2rgb() to convert the Hex value to RGB.
- */
- function hsv2rgb($h, $s, $v)
- {
- return Image_Color::hex2rgb(Image_Color::hsv2hex($h, $s, $v));
- }
-
- /**
- * Convert HSV (Hue, Saturation, Brightness) to a hex color string.
- *
- * Originally written by Jurgen Schwietering. Integrated into the class by
- * Jason Lotito.
- *
- * @param integer $h Hue
- * @param integer $s Saturation
- * @param integer $v Brightness
- * @return string The hex string.
- * @access public
- * @static
- * @author Jurgen Schwietering <jurgen@schwietering.com>
- * @uses rgb2hex() to convert the return value to a hex string.
- */
- function hsv2hex($h, $s, $v)
- {
- $s /= 256.0;
- $v /= 256.0;
- if ($s == 0.0) {
- $r = $g = $b = $v;
- return '';
- } else {
- $h = $h / 256.0 * 6.0;
- $i = floor($h);
- $f = $h - $i;
-
- $v *= 256.0;
- $p = (integer)($v * (1.0 - $s));
- $q = (integer)($v * (1.0 - $s * $f));
- $t = (integer)($v * (1.0 - $s * (1.0 - $f)));
- switch($i) {
- case 0:
- $r = $v;
- $g = $t;
- $b = $p;
- break;
-
- case 1:
- $r = $q;
- $g = $v;
- $b = $p;
- break;
-
- case 2:
- $r = $p;
- $g = $v;
- $b = $t;
- break;
-
- case 3:
- $r = $p;
- $g = $q;
- $b = $v;
- break;
-
- case 4:
- $r = $t;
- $g = $p;
- $b = $v;
- break;
-
- default:
- $r = $v;
- $g = $p;
- $b = $q;
- break;
- }
- }
- return $this->rgb2hex(array($r, $g, $b));
- }
-
- /**
- * Allocates a color in the given image.
- *
- * User defined color specifications get translated into an array of RGB
- * values.
- *
- * @param resource $img Image handle
- * @param string|array $color Name or hex string or an RGB array.
- * @return resource Image color handle.
- * @access public
- * @static
- * @uses ImageColorAllocate() to allocate the color.
- * @uses color2RGB() to parse the color into RGB values.
- */
- function allocateColor(&$img, $color) {
- $color = Image_Color::color2RGB($color);
-
- return ImageColorAllocate($img, $color[0], $color[1], $color[2]);
- }
-
- /**
- * Convert a named or hex color string to an RGB array. If the color begins
- * with the # character it will be treated as a hex value. Everything else
- * will be treated as a named color. If the named color is not known, black
- * will be returned.
- *
- * @param string $color
- * @return array RGB color
- * @access public
- * @static
- * @author Laurent Laville <pear@laurent-laville.org>
- * @uses hex2rgb() to convert colors begining with the # character.
- * @uses namedColor2RGB() to convert everything not starting with a #.
- */
- function color2RGB($color)
- {
- $c = array();
-
- if ($color{0} == '#') {
- $c = Image_Color::hex2rgb($color);
- } else {
- $c = Image_Color::namedColor2RGB($color);
- }
-
- return $c;
- }
-
- /**
- * Convert a named color to an RGB array. If the color is unknown black
- * is returned.
- *
- * @param string $color Case insensitive color name.
- * @return array RGB color array. If the color was unknown, the result
- * will be black.
- * @access public
- * @static
- * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
- */
- function namedColor2RGB($color)
- {
- static $colornames;
-
- if (!isset($colornames)) {
- $colornames = array(
- 'aliceblue' => array(240, 248, 255),
- 'antiquewhite' => array(250, 235, 215),
- 'aqua' => array( 0, 255, 255),
- 'aquamarine' => array(127, 255, 212),
- 'azure' => array(240, 255, 255),
- 'beige' => array(245, 245, 220),
- 'bisque' => array(255, 228, 196),
- 'black' => array( 0, 0, 0),
- 'blanchedalmond' => array(255, 235, 205),
- 'blue' => array( 0, 0, 255),
- 'blueviolet' => array(138, 43, 226),
- 'brown' => array(165, 42, 42),
- 'burlywood' => array(222, 184, 135),
- 'cadetblue' => array( 95, 158, 160),
- 'chartreuse' => array(127, 255, 0),
- 'chocolate' => array(210, 105, 30),
- 'coral' => array(255, 127, 80),
- 'cornflowerblue' => array(100, 149, 237),
- 'cornsilk' => array(255, 248, 220),
- 'crimson' => array(220, 20, 60),
- 'cyan' => array( 0, 255, 255),
- 'darkblue' => array( 0, 0, 13),
- 'darkcyan' => array( 0, 139, 139),
- 'darkgoldenrod' => array(184, 134, 11),
- 'darkgray' => array(169, 169, 169),
- 'darkgreen' => array( 0, 100, 0),
- 'darkkhaki' => array(189, 183, 107),
- 'darkmagenta' => array(139, 0, 139),
- 'darkolivegreen' => array( 85, 107, 47),
- 'darkorange' => array(255, 140, 0),
- 'darkorchid' => array(153, 50, 204),
- 'darkred' => array(139, 0, 0),
- 'darksalmon' => array(233, 150, 122),
- 'darkseagreen' => array(143, 188, 143),
- 'darkslateblue' => array( 72, 61, 139),
- 'darkslategray' => array( 47, 79, 79),
- 'darkturquoise' => array( 0, 206, 209),
- 'darkviolet' => array(148, 0, 211),
- 'deeppink' => array(255, 20, 147),
- 'deepskyblue' => array( 0, 191, 255),
- 'dimgray' => array(105, 105, 105),
- 'dodgerblue' => array( 30, 144, 255),
- 'firebrick' => array(178, 34, 34),
- 'floralwhite' => array(255, 250, 240),
- 'forestgreen' => array( 34, 139, 34),
- 'fuchsia' => array(255, 0, 255),
- 'gainsboro' => array(220, 220, 220),
- 'ghostwhite' => array(248, 248, 255),
- 'gold' => array(255, 215, 0),
- 'goldenrod' => array(218, 165, 32),
- 'gray' => array(128, 128, 128),
- 'green' => array( 0, 128, 0),
- 'greenyellow' => array(173, 255, 47),
- 'honeydew' => array(240, 255, 240),
- 'hotpink' => array(255, 105, 180),
- 'indianred' => array(205, 92, 92),
- 'indigo' => array(75, 0, 130),
- 'ivory' => array(255, 255, 240),
- 'khaki' => array(240, 230, 140),
- 'lavender' => array(230, 230, 250),
- 'lavenderblush' => array(255, 240, 245),
- 'lawngreen' => array(124, 252, 0),
- 'lemonchiffon' => array(255, 250, 205),
- 'lightblue' => array(173, 216, 230),
- 'lightcoral' => array(240, 128, 128),
- 'lightcyan' => array(224, 255, 255),
- 'lightgoldenrodyellow' => array(250, 250, 210),
- 'lightgreen' => array(144, 238, 144),
- 'lightgrey' => array(211, 211, 211),
- 'lightpink' => array(255, 182, 193),
- 'lightsalmon' => array(255, 160, 122),
- 'lightseagreen' => array( 32, 178, 170),
- 'lightskyblue' => array(135, 206, 250),
- 'lightslategray' => array(119, 136, 153),
- 'lightsteelblue' => array(176, 196, 222),
- 'lightyellow' => array(255, 255, 224),
- 'lime' => array( 0, 255, 0),
- 'limegreen' => array( 50, 205, 50),
- 'linen' => array(250, 240, 230),
- 'magenta' => array(255, 0, 255),
- 'maroon' => array(128, 0, 0),
- 'mediumaquamarine' => array(102, 205, 170),
- 'mediumblue' => array( 0, 0, 205),
- 'mediumorchid' => array(186, 85, 211),
- 'mediumpurple' => array(147, 112, 219),
- 'mediumseagreen' => array( 60, 179, 113),
- 'mediumslateblue' => array(123, 104, 238),
- 'mediumspringgreen' => array( 0, 250, 154),
- 'mediumturquoise' => array(72, 209, 204),
- 'mediumvioletred' => array(199, 21, 133),
- 'midnightblue' => array( 25, 25, 112),
- 'mintcream' => array(245, 255, 250),
- 'mistyrose' => array(255, 228, 225),
- 'moccasin' => array(255, 228, 181),
- 'navajowhite' => array(255, 222, 173),
- 'navy' => array( 0, 0, 128),
- 'oldlace' => array(253, 245, 230),
- 'olive' => array(128, 128, 0),
- 'olivedrab' => array(107, 142, 35),
- 'orange' => array(255, 165, 0),
- 'orangered' => array(255, 69, 0),
- 'orchid' => array(218, 112, 214),
- 'palegoldenrod' => array(238, 232, 170),
- 'palegreen' => array(152, 251, 152),
- 'paleturquoise' => array(175, 238, 238),
- 'palevioletred' => array(219, 112, 147),
- 'papayawhip' => array(255, 239, 213),
- 'peachpuff' => array(255, 218, 185),
- 'peru' => array(205, 133, 63),
- 'pink' => array(255, 192, 203),
- 'plum' => array(221, 160, 221),
- 'powderblue' => array(176, 224, 230),
- 'purple' => array(128, 0, 128),
- 'red' => array(255, 0, 0),
- 'rosybrown' => array(188, 143, 143),
- 'royalblue' => array( 65, 105, 225),
- 'saddlebrown' => array(139, 69, 19),
- 'salmon' => array(250, 128, 114),
- 'sandybrown' => array(244, 164, 96),
- 'seagreen' => array( 46, 139, 87),
- 'seashell' => array(255, 245, 238),
- 'sienna' => array(160, 82, 45),
- 'silver' => array(192, 192, 192),
- 'skyblue' => array(135, 206, 235),
- 'slateblue' => array(106, 90, 205),
- 'slategray' => array(112, 128, 144),
- 'snow' => array(255, 250, 250),
- 'springgreen' => array( 0, 255, 127),
- 'steelblue' => array( 70, 130, 180),
- 'tan' => array(210, 180, 140),
- 'teal' => array( 0, 128, 128),
- 'thistle' => array(216, 191, 216),
- 'tomato' => array(255, 99, 71),
- 'turquoise' => array( 64, 224, 208),
- 'violet' => array(238, 130, 238),
- 'wheat' => array(245, 222, 179),
- 'white' => array(255, 255, 255),
- 'whitesmoke' => array(245, 245, 245),
- 'yellow' => array(255, 255, 0),
- 'yellowgreen' => array(154, 205, 50)
- );
- }
-
- $color = strtolower($color);
-
- if (isset($colornames[$color])) {
- return $colornames[$color];
- } else {
- return array(0, 0, 0);
- }
- }
-
- /**
- * Convert an RGB percentage string into an RGB array.
- *
- * @param string $color Percentage color string like "50%,20%,100%".
- * @return array RGB color array.
- * @access public
- * @static
- */
- function percentageColor2RGB($color)
- {
- // remove spaces
- $color = str_replace(' ', '', $color);
- // remove the percent signs
- $color = str_replace('%', '', $color);
- // split the string by commas
- $color = explode(',', $color);
-
- $ret = array();
- foreach ($color as $k => $v) {
- // range checks
- if ($v <= 0) {
- $ret[$k] = 0;
- } else if ($v <= 100) {
- // add 0.5 then cast to an integer to round the value.
- $ret[$k] = (integer) ((2.55 * $v) + 0.5);
- } else {
- $ret[$k] = 255;
- }
- }
-
- return $ret;
- }
-}
-
-// For Array Walk
-// {{{
-/**
- * Function for array_walk() to round colors to the closest web safe value.
- *
- * @param integer $color One channel of an RGB color.
- * @return integer The websafe equivalent of the color channel.
- * @author Jason Lotito <jason@lehighweb.com>
- * @author Andrew Morton <drewish@katherinehouse.com>
- * @access private
- * @static
- */
-function _makeWebSafe(&$color)
-{
- if ($color < 0x1a) {
- $color = 0x00;
- } else if ($color < 0x4d) {
- $color = 0x33;
- } else if ($color < 0x80) {
- $color = 0x66;
- } else if ($color < 0xB3) {
- $color = 0x99;
- } else if ($color < 0xE6) {
- $color = 0xCC;
- } else {
- $color = 0xFF;
- }
- return $color;
-}
-// }}}
-
-?>
diff --git a/config/archive/dspam/pear/Image/Graph.php b/config/archive/dspam/pear/Image/Graph.php
deleted file mode 100644
index d2e2492b..00000000
--- a/config/archive/dspam/pear/Image/Graph.php
+++ /dev/null
@@ -1,851 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - Main class for the graph creation.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-
-/**
- * Include PEAR.php
- */
-require_once 'PEAR.inc';
-
-/**
- * Include file Image/Graph/Element.php
- */
-require_once 'Image/Graph/Element.php';
-
-/**
- * Include file Image/Graph/Constants.php
- */
-require_once 'Image/Graph/Constants.php';
-
-/**
- * Main class for the graph creation.
- *
- * This is the main class, it manages the canvas and performs the final output
- * by sequentialy making the elements output their results. The final output is
- * handled using the {@link Image_Canvas} classes which makes it possible
- * to use different engines (fx GD, PDFlib, libswf, etc) for output to several
- * formats with a non-intersecting API.
- *
- * This class also handles coordinates and the correct managment of setting the
- * correct coordinates on child elements.
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph extends Image_Graph_Element
-{
-
- /**
- * Show generation time on graph
- * @var bool
- * @access private
- */
- var $_showTime = false;
-
- /**
- * Display errors on the canvas
- * @var boolean
- * @access private
- */
- var $_displayErrors = false;
-
- /**
- * Image_Graph [Constructor].
- *
- * If passing the 3 parameters they are defined as follows:'
- *
- * Fx.:
- *
- * $Graph =& new Image_Graph(400, 300);
- *
- * or using the factory method:
- *
- * $Graph =& Image_Graph::factory('graph', array(400, 300));
- *
- * This causes a 'png' canvas to be created by default.
- *
- * Otherwise use a single parameter either as an associated array or passing
- * the canvas along to the constructor:
- *
- * 1) Create a new canvas with the following parameters:
- *
- * 'canvas' - The canvas type, can be any of 'gd', 'jpg', 'png' or 'svg'
- * (more to come) - if omitted the default is 'gd'
- *
- * 'width' - The width of the graph
- *
- * 'height' - The height of the graph
- *
- * An example of this usage:
- *
- * $Graph =& Image_Graph::factory('graph', array(array('width' => 400,
- * 'height' => 300, 'canvas' => 'jpg')));
- *
- * NB! In thïs case remember the "double" array (see {@link Image_Graph::
- * factory()})
- *
- * 2) Use the canvas specified, pass a valid Image_Canvas as
- * parameter. Remember to pass by reference, i. e. &amp;$canvas, fx.:
- *
- * $Graph =& new Image_Graph($Canvas);
- *
- * or using the factory method:
- *
- * $Graph =& Image_Graph::factory('graph', $Canvas));
- *
- * @param mixed $params The width of the graph, an indexed array
- * describing a new canvas or a valid {@link Image_Canvas} object
- * @param int $height The height of the graph in pixels
- * @param bool $createTransparent Specifies whether the graph should be
- * created with a transparent background (fx for PNG's - note: transparent
- * PNG's is not supported by Internet Explorer!)
- */
- function Image_Graph($params, $height = false, $createTransparent = false)
- {
- parent::Image_Graph_Element();
-
- $this->setFont(Image_Graph::factory('Image_Graph_Font'));
-
- if (defined('IMAGE_GRAPH_DEFAULT_CANVAS_TYPE')) {
- $canvasType = IMAGE_GRAPH_DEFAULT_CANVAS_TYPE;
- } else {
- $canvasType = 'png'; // use GD as default, if nothing else is specified
- }
-
- if (is_array($params)) {
- if (isset($params['canvas'])) {
- $canvasType = $params['canvas'];
- }
-
- $width = 0;
- $height = 0;
-
- if (isset($params['width'])) {
- $width = $params['width'];
- }
-
- if (isset($params['height'])) {
- $height = $params['height'];
- }
- } elseif (is_a($params, 'Image_Canvas')) {
- $this->_canvas =& $params;
- $width = $this->_canvas->getWidth();
- $height = $this->_canvas->getHeight();
- } elseif (is_numeric($params)) {
- $width = $params;
- }
-
- if ($this->_canvas == null) {
- include_once 'Image/Canvas.php';
- $this->_canvas =&
- Image_Canvas::factory(
- $canvasType,
- array('width' => $width, 'height' => $height)
- );
- }
-
- $this->_setCoords(0, 0, $width - 1, $height - 1);
- }
-
- /**
- * Gets the canvas for this graph.
- *
- * The canvas is set by either passing it to the constructor {@link
- * Image_Graph::ImageGraph()} or using the {@link Image_Graph::setCanvas()}
- * method.
- *
- * @return Image_Canvas The canvas used by this graph
- * @access private
- * @since 0.3.0dev2
- */
- function &_getCanvas()
- {
- return $this->_canvas;
- }
-
- /**
- * Sets the canvas for this graph.
- *
- * Calling this method makes this graph use the newly specified canvas for
- * handling output. This method should be called whenever multiple
- * 'outputs' are required. Invoke this method after calls to {@link
- * Image_Graph:: done()} has been performed, to switch canvass.
- *
- * @param Image_Canvas $canvas The new canvas
- * @return Image_Canvas The new canvas
- * @since 0.3.0dev2
- */
- function &setCanvas(&$canvas)
- {
- if (!is_a($this->_canvas, 'Image_Canvas')) {
- return $this->_error('The canvas introduced is not an Image_Canvas object');
- }
-
- $this->_canvas =& $canvas;
- $this->_setCoords(
- 0,
- 0,
- $this->_canvas->getWidth() - 1,
- $this->_canvas->getHeight() - 1
- );
- return $this->_canvas;
- }
-
- /**
- * Gets a very precise timestamp
- *
- * @return The number of seconds to a lot of decimals
- * @access private
- */
- function _getMicroTime()
- {
- list($usec, $sec) = explode(' ', microtime());
- return ((float)$usec + (float)$sec);
- }
-
- /**
- * Gets the width of this graph.
- *
- * The width is returned as 'defined' by the canvas.
- *
- * @return int the width of this graph
- */
- function width()
- {
- return $this->_canvas->getWidth();
- }
-
- /**
- * Gets the height of this graph.
- *
- * The height is returned as 'defined' by the canvas.
- *
- * @return int the height of this graph
- */
- function height()
- {
- return $this->_canvas->getHeight();
- }
-
- /**
- * Enables displaying of errors on the output.
- *
- * Use this method to enforce errors to be displayed on the output. Calling
- * this method makes PHP uses this graphs error handler as default {@link
- * Image_Graph::_default_error_handler()}.
- */
- function displayErrors()
- {
- $this->_displayErrors = true;
- set_error_handler(array(&$this, '_default_error_handler'));
- }
-
- /**
- * Sets the log method for this graph.
- *
- * Use this method to enable logging. This causes any errors caught
- * by either the error handler {@see Image_Graph::displayErrors()}
- * or explicitly by calling {@link Image_Graph_Common::_error()} be
- * logged using the specified logging method.
- *
- * If a filename is specified as log method, a Log object is created (using
- * the 'file' handler), with a handle of 'Image_Graph Error Log'.
- *
- * Logging requires {@link Log}.
- *
- * @param mixed $log The log method, either a Log object or filename to log
- * to
- * @since 0.3.0dev2
- */
- function setLog($log)
- {
- }
-
- /**
- * Factory method to create Image_Graph objects.
- *
- * Used for 'lazy including', i.e. loading only what is necessary, when it
- * is necessary. If only one parameter is required for the constructor of
- * the class simply pass this parameter as the $params parameter, unless the
- * parameter is an array or a reference to a value, in that case you must
- * 'enclose' the parameter in an array. Similar if the constructor takes
- * more than one parameter specify the parameters in an array, i.e
- *
- * Image_Graph::factory('MyClass', array($param1, $param2, &$param3));
- *
- * Variables that need to be passed by reference *must* have the &amp;
- * before the variable, i.e:
- *
- * Image_Graph::factory('line', &$Dataset);
- *
- * or
- *
- * Image_graph::factory('bar', array(array(&$Dataset1, &$Dataset2),
- * 'stacked'));
- *
- * Class name can be either of the following:
- *
- * 1 The 'real' Image_Graph class name, i.e. Image_Graph_Plotarea or
- * Image_Graph_Plot_Line
- *
- * 2 Short class name (leave out Image_Graph) and retain case, i.e.
- * Plotarea, Plot_Line *not* plot_line
- *
- * 3 Class name 'alias', the following are supported:
- *
- * 'graph' = Image_Graph
- *
- * 'plotarea' = Image_Graph_Plotarea
- *
- * 'line' = Image_Graph_Plot_Line
- *
- * 'area' = Image_Graph_Plot_Area
- *
- * 'bar' = Image_Graph_Plot_Bar
- *
- * 'pie' = Image_Graph_Plot_Pie
- *
- * 'radar' = Image_Graph_Plot_Radar
- *
- * 'step' = Image_Graph_Plot_Step
- *
- * 'impulse' = Image_Graph_Plot_Impulse
- *
- * 'dot' or 'scatter' = Image_Graph_Plot_Dot
- *
- * 'smooth_line' = Image_Graph_Plot_Smoothed_Line
- *
- * 'smooth_area' = Image_Graph_Plot_Smoothed_Area
-
- * 'dataset' = Image_Graph_Dataset_Trivial
- *
- * 'random' = Image_Graph_Dataset_Random
- *
- * 'function' = Image_Graph_Dataset_Function
- *
- * 'vector' = Image_Graph_Dataset_VectorFunction
- *
- * 'category' = Image_Graph_Axis_Category
- *
- * 'axis' = Image_Graph_Axis
- *
- * 'axis_log' = Image_Graph_Axis_Logarithmic
- *
- * 'title' = Image_Graph_Title
- *
- * 'line_grid' = Image_Graph_Grid_Lines
- *
- * 'bar_grid' = Image_Graph_Grid_Bars
- *
- * 'polar_grid' = Image_Graph_Grid_Polar
- *
- * 'legend' = Image_Graph_Legend
- *
- * 'font' = Image_Graph_Font
- *
- * 'ttf_font' = Image_Graph_Font
- *
- * 'Image_Graph_Font_TTF' = Image_Graph_Font (to maintain BC with Image_Graph_Font_TTF)
- *
- * 'gradient' = Image_Graph_Fill_Gradient
- *
- * 'icon_marker' = Image_Graph_Marker_Icon
- *
- * 'value_marker' = Image_Graph_Marker_Value
- *
- * @param string $class The class for the new object
- * @param mixed $params The paramaters to pass to the constructor
- * @return object A new object for the class
- * @static
- */
- function &factory($class, $params = null)
- {
- static $Image_Graph_classAliases = array(
- 'graph' => 'Image_Graph',
- 'plotarea' => 'Image_Graph_Plotarea',
-
- 'line' => 'Image_Graph_Plot_Line',
- 'area' => 'Image_Graph_Plot_Area',
- 'bar' => 'Image_Graph_Plot_Bar',
- 'smooth_line' => 'Image_Graph_Plot_Smoothed_Line',
- 'smooth_area' => 'Image_Graph_Plot_Smoothed_Area',
- 'pie' => 'Image_Graph_Plot_Pie',
- 'radar' => 'Image_Graph_Plot_Radar',
- 'step' => 'Image_Graph_Plot_Step',
- 'impulse' => 'Image_Graph_Plot_Impulse',
- 'dot' => 'Image_Graph_Plot_Dot',
- 'scatter' => 'Image_Graph_Plot_Dot',
-
- 'dataset' => 'Image_Graph_Dataset_Trivial',
- 'random' => 'Image_Graph_Dataset_Random',
- 'function' => 'Image_Graph_Dataset_Function',
- 'vector' => 'Image_Graph_Dataset_VectorFunction',
-
- 'category' => 'Image_Graph_Axis_Category',
- 'axis' => 'Image_Graph_Axis',
- 'axis_log' => 'Image_Graph_Axis_Logarithmic',
-
- 'title' => 'Image_Graph_Title',
-
- 'line_grid' => 'Image_Graph_Grid_Lines',
- 'bar_grid' => 'Image_Graph_Grid_Bars',
- 'polar_grid' => 'Image_Graph_Grid_Polar',
-
- 'legend' => 'Image_Graph_Legend',
- 'font' => 'Image_Graph_Font',
- 'ttf_font' => 'Image_Graph_Font',
- 'Image_Graph_Font_TTF' => 'Image_Graph_Font', // BC with Image_Graph_Font_TTF
- 'gradient' => 'Image_Graph_Fill_Gradient',
-
- 'icon_marker' => 'Image_Graph_Marker_Icon',
- 'value_marker' => 'Image_Graph_Marker_Value'
- );
-
- if (substr($class, 0, 11) != 'Image_Graph') {
- if (isset($Image_Graph_classAliases[$class])) {
- $class = $Image_Graph_classAliases[$class];
- } else {
- $class = 'Image_Graph_' . $class;
- }
- }
-
- include_once str_replace('_', '/', $class) . '.php';
-
- $obj = null;
-
- if (is_array($params)) {
- switch (count($params)) {
- case 1:
- $obj =& new $class(
- $params[0]
- );
- break;
-
- case 2:
- $obj =& new $class(
- $params[0],
- $params[1]
- );
- break;
-
- case 3:
- $obj =& new $class(
- $params[0],
- $params[1],
- $params[2]
- );
- break;
-
- case 4:
- $obj =& new $class(
- $params[0],
- $params[1],
- $params[2],
- $params[3]
- );
- break;
-
- case 5:
- $obj =& new $class(
- $params[0],
- $params[1],
- $params[2],
- $params[3],
- $params[4]
- );
- break;
-
- case 6:
- $obj =& new $class(
- $params[0],
- $params[1],
- $params[2],
- $params[3],
- $params[4],
- $params[5]
- );
- break;
-
- case 7:
- $obj =& new $class(
- $params[0],
- $params[1],
- $params[2],
- $params[3],
- $params[4],
- $params[5],
- $params[6]
- );
- break;
-
- case 8:
- $obj =& new $class(
- $params[0],
- $params[1],
- $params[2],
- $params[3],
- $params[4],
- $params[5],
- $params[6],
- $params[7]
- );
- break;
-
- case 9:
- $obj =& new $class(
- $params[0],
- $params[1],
- $params[2],
- $params[3],
- $params[4],
- $params[5],
- $params[6],
- $params[7],
- $params[8]
- );
- break;
-
- case 10:
- $obj =& new $class(
- $params[0],
- $params[1],
- $params[2],
- $params[3],
- $params[4],
- $params[5],
- $params[6],
- $params[7],
- $params[8],
- $params[9]
- );
- break;
-
- default:
- $obj =& new $class();
- break;
-
- }
- } else {
- if ($params == null) {
- $obj =& new $class();
- } else {
- $obj =& new $class($params);
- }
- }
- return $obj;
- }
-
- /**
- * Factory method to create layouts.
- *
- * This method is used for easy creation, since using {@link Image_Graph::
- * factory()} does not work with passing newly created objects from
- * Image_Graph::factory() as reference, this is something that is
- * fortunately fixed in PHP5. Also used for 'lazy including', i.e. loading
- * only what is necessary, when it is necessary.
- *
- * Use {@link Image_Graph::horizontal()} or {@link Image_Graph::vertical()}
- * instead for easier access.
- *
- * @param mixed $layout The type of layout, can be either 'Vertical'
- * or 'Horizontal' (case sensitive)
- * @param Image_Graph_Element $part1 The 1st part of the layout
- * @param Image_Graph_Element $part2 The 2nd part of the layout
- * @param int $percentage The percentage of the layout to split at
- * @return Image_Graph_Layout The newly created layout object
- * @static
- */
- function &layoutFactory($layout, &$part1, &$part2, $percentage = 50)
- {
- if (($layout != 'Vertical') && ($layout != 'Horizontal')) {
- return $this->_error('Layouts must be either \'Horizontal\' or \'Vertical\'');
- }
-
- if (!(is_a($part1, 'Image_Graph_Element'))) {
- return $this->_error('Part 1 is not a valid Image_Graph element');
- }
-
- if (!(is_a($part2, 'Image_Graph_Element'))) {
- return $this->_error('Part 2 is not a valid Image_Graph element');
- }
-
- if ((!is_numeric($percentage)) || ($percentage < 0) || ($percentage > 100)) {
- return $this->_error('Percentage has to be a number between 0 and 100');
- }
-
- include_once "Image/Graph/Layout/$layout.php";
- $class = "Image_Graph_Layout_$layout";
- $obj =& new $class($part1, $part2, $percentage);
- return $obj;
- }
-
- /**
- * Factory method to create horizontal layout.
- *
- * See {@link Image_Graph::layoutFactory()}
- *
- * @param Image_Graph_Element $part1 The 1st (left) part of the layout
- * @param Image_Graph_Element $part2 The 2nd (right) part of the layout
- * @param int $percentage The percentage of the layout to split at
- * (percentage of total height from the left side)
- * @return Image_Graph_Layout The newly created layout object
- * @static
- */
- function &horizontal(&$part1, &$part2, $percentage = 50)
- {
- $obj =& Image_Graph::layoutFactory('Horizontal', $part1, $part2, $percentage);
- return $obj;
- }
-
- /**
- * Factory method to create vertical layout.
- *
- * See {@link Image_Graph::layoutFactory()}
- *
- * @param Image_Graph_Element $part1 The 1st (top) part of the layout
- * @param Image_Graph_Element $part2 The 2nd (bottom) part of the layout
- * @param int $percentage The percentage of the layout to split at
- * (percentage of total width from the top edge)
- * @return Image_Graph_Layout The newly created layout object
- * @static
- */
- function &vertical(&$part1, &$part2, $percentage = 50)
- {
- $obj =& Image_Graph::layoutFactory('Vertical', $part1, $part2, $percentage);
- return $obj;
- }
-
- /**
- * The error handling routine set by set_error_handler().
- *
- * This method is used internaly by Image_Graph and PHP as a proxy for {@link
- * Image_Graph::_error()}.
- *
- * @param string $error_type The type of error being handled.
- * @param string $error_msg The error message being handled.
- * @param string $error_file The file in which the error occurred.
- * @param integer $error_line The line in which the error occurred.
- * @param string $error_context The context in which the error occurred.
- * @access private
- */
- function _default_error_handler($error_type, $error_msg, $error_file, $error_line, $error_context)
- {
- switch( $error_type ) {
- case E_ERROR:
- $level = 'error';
- break;
-
- case E_USER_ERROR:
- $level = 'user error';
- break;
-
- case E_WARNING:
- $level = 'warning';
- break;
-
- case E_USER_WARNING:
- $level = 'user warning';
- break;
-
- case E_NOTICE:
- $level = 'notice';
- break;
-
- case E_USER_NOTICE:
- $level = 'user notice';
- break;
-
- default:
- $level = '(unknown)';
- break;
-
- }
-
- $this->_error("PHP $level: $error_msg",
- array(
- 'type' => $error_type,
- 'file' => $error_file,
- 'line' => $error_line,
- 'context' => $error_context
- )
- );
- }
-
- /**
- * Displays the errors on the error stack.
- *
- * Invoking this method cause all errors on the error stack to be displayed
- * on the graph-output, by calling the {@link Image_Graph::_displayError()}
- * method.
- *
- * @access private
- */
- function _displayErrors()
- {
- return true;
- }
-
- /**
- * Display an error from the error stack.
- *
- * This method writes error messages caught from the {@link Image_Graph::
- * _default_error_handler()} if {@Image_Graph::displayErrors()} was invoked,
- * and the error explicitly set by the system using {@link
- * Image_Graph_Common::_error()}.
- *
- * @param int $x The horizontal position of the error message
- * @param int $y The vertical position of the error message
- * @param array $error The error context
- *
- * @access private
- */
- function _displayError($x, $y, $error)
- {
- }
-
- /**
- * Outputs this graph using the canvas.
- *
- * This causes the graph to make all elements perform their output. Their
- * result is 'written' to the output using the canvas, which also performs
- * the actual output, fx. it being to a file or directly to the browser
- * (in the latter case, the canvas will also make sure the correct HTTP
- * headers are sent, making the browser handle the output correctly, if
- * supported by it).
- *
- * Parameters are the ones supported by the canvas, common ones are:
- *
- * 'filename' To output to a file instead of browser
- *
- * 'tohtml' Return a HTML string that encompasses the current graph/canvas - this
- * implies an implicit save using the following parameters: 'filename' The "temporary"
- * filename of the graph, 'filepath' A path in the file system where Image_Graph can
- * store the output (this file must be in DOCUMENT_ROOT scope), 'urlpath' The URL that the
- * 'filepath' corresponds to (i.e. filepath + filename must be reachable from a browser using
- * urlpath + filename)
- *
- * @param mixed $param The output parameters to pass to the canvas
- * @return bool Was the output 'good' (true) or 'bad' (false).
- */
- function done($param = false)
- {
- $result = $this->_reset();
- if (PEAR::isError($result)) {
- return $result;
- }
- return $this->_done($param);
- }
-
- /**
- * Outputs this graph using the canvas.
- *
- * This causes the graph to make all elements perform their output. Their
- * result is 'written' to the output using the canvas, which also performs
- * the actual output, fx. it being to a file or directly to the browser
- * (in the latter case, the canvas will also make sure the correct HTTP
- * headers are sent, making the browser handle the output correctly, if
- * supported by it).
- *
- * @param mixed $param The output parameters to pass to the canvas
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done($param = false)
- {
- $timeStart = $this->_getMicroTime();
-
- if ($this->_shadow) {
- $this->setPadding(20);
- $this->_setCoords(
- $this->_left,
- $this->_top,
- $this->_right - 10,
- $this->_bottom - 10);
- }
-
- $result = $this->_updateCoords();
- if (PEAR::isError($result)) {
- return $result;
- }
-
- if ($this->_getBackground()) {
- $this->_canvas->rectangle(
- array(
- 'x0' => $this->_left,
- 'y0' => $this->_top,
- 'x1' => $this->_right,
- 'y1' => $this->_bottom
- )
- );
- }
-
- $result = parent::_done();
- if (PEAR::isError($result)) {
- return $result;
- }
-
- if ($this->_displayErrors) {
- $this->_displayErrors();
- }
-
- $timeEnd = $this->_getMicroTime();
-
- if (($this->_showTime) ||
- ((isset($param['showtime'])) && ($param['showtime'] === true))
- ) {
- $text = 'Generated in ' .
- sprintf('%0.3f', $timeEnd - $timeStart) . ' sec';
- $this->write(
- $this->_right,
- $this->_bottom,
- $text,
- IMAGE_GRAPH_ALIGN_RIGHT + IMAGE_GRAPH_ALIGN_BOTTOM,
- array('color' => 'red')
- );
- }
-
- if (isset($param['filename'])) {
- if ((isset($param['tohtml'])) && ($param['tohtml'])) {
- return $this->_canvas->toHtml($param);
- }
- else {
- return $this->_canvas->save($param);
- }
- } else {
- return $this->_canvas->show($param);
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Axis.php b/config/archive/dspam/pear/Image/Graph/Axis.php
deleted file mode 100644
index 99da305f..00000000
--- a/config/archive/dspam/pear/Image/Graph/Axis.php
+++ /dev/null
@@ -1,1690 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Class for axis handling.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Axis
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plotarea/Element.php
- */
-require_once 'Image/Graph/Plotarea/Element.php';
-
-/**
- * Diplays a normal linear axis (either X- or Y-axis).
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Axis
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
- class Image_Graph_Axis extends Image_Graph_Plotarea_Element
-{
-
- /**
- * The type of the axis, possible values are:
- * <ul>
- * <li>IMAGE_GRAPH_AXIS_X / IMAGE_GRAPH_AXIS_HORIZONTAL
- * <li>IMAGE_GRAPH_AXIS_Y / IMAGE_GRAPH_AXIS_VERTICAL /
- * IMAGE_GRAPH_AXIS_Y_SECONDARY
- * </ul>
- * @var int
- * @access private
- */
- var $_type;
-
- /**
- * The minimum value the axis displays
- * @var int
- * @access private
- */
- var $_minimum = false;
-
- /**
- * The minimum value the axis has been explicitly set by the user
- * @var bool
- * @access private
- */
- var $_minimumSet = false;
-
- /**
- * The maximum value the axis displays
- * @var int
- * @access private
- */
- var $_maximum = false;
-
- /**
- * The maximum value the axis has been explicitly set by the user
- * @var bool
- * @access private
- */
- var $_maximumSet = false;
-
- /**
- * The value span of the axis.
- * This is primarily included for performance reasons
- * @var double
- * @access private
- */
- var $_axisSpan = false;
-
- /**
- * The value span of the axis.
- * This is primarily included for performance reasons
- * @var double
- * @access private
- */
- var $_axisValueSpan = false;
-
- /**
- * The axis padding.
- * The index 'low' specifies the padding for the low axis values (when not
- * inverted), i.e. to the left on an x-axis and on the bottom of an y-axis,
- * vice versa for 'high'.
- *
- * Axis padding does not make sense on a normal linear y-axis with a 'y-min'
- * of 0 since this corresponds to displaying a small part of the y-axis
- * below 0!
- *
- * @var array
- * @access private
- */
- var $_axisPadding = array('low' => 0, 'high' => 0);
-
- /**
- * The number of "pixels" representing 1 unit on the axis
- *
- * This is primarily included for performance reasons
- * @var double
- * @access private
- */
- var $_delta = false;
-
- /**
- * Specify if the axis should label the minimum value
- * @var bool
- * @access private
- */
- var $_showLabelMinimum = true;
-
- /**
- * Specify if the axis should label 0 (zero)
- * @var bool
- * @access private
- */
- var $_showLabelZero = false;
-
- /**
- * Specify if the axis should label the maximum value
- * @var bool
- * @access private
- */
- var $_showLabelMaximum = true;
-
- /**
- * Show arrow heads at the 'end' of the axis, default: false
- * @var bool
- * @access private
- */
- var $_showArrow = false;
-
- /**
- * Intersection data of axis
- * @var array
- * @access private
- */
- var $_intersect = array('value' => 'default', 'axis' => 'default');
-
- /**
- * The fixed size of the axis (i.e. width for y-axis, height for x-axis)
- * @var mixed
- * @access private
- */
- var $_fixedSize = false;
-
- /**
- * The label options
- *
- * Should text be shows, preferences for ticks. The indexes start at level
- * 1, which is chosen for readability
- * @var array
- * @access private
- */
- var $_labelOptions = array(
- 1 => array(
- 'interval' => 1,
- 'type' => 'auto',
- 'tick' => array(
- 'start' => -2,
- 'end' => 2,
- 'color' => false // default color
- ),
- 'showtext' => true,
- 'showoffset' => false,
- 'font' => array(),
- 'offset' => 0,
- 'position' => 'outside',
- )
- );
-
- /**
- * The labels that are shown.
- *
- * This is used to make values show only once...
- * @access private
- */
- var $_labelText = array();
-
- /**
- * A data preprocessor for formatting labels, fx showing dates as a standard
- * date instead of Unix time stamp
- * @var Image_Graph_DatePreProcessor
- * @access private
- * @see Image_Graph_DataPreProcessor
- */
- var $_dataPreProcessor = null;
-
- /**
- * Point marked in the axis
- * @var array
- * @access private
- */
- var $_marks = array();
-
- /**
- * Specifies whether the values should be 'pushed' by 0.5
- * @var bool
- * @access private
- */
- var $_pushValues = false;
-
- /**
- * The title of this axis
- * @var string
- * @access private
- */
- var $_title = '';
-
- /**
- * The font used for the title of this axis
- * @var Image_Graph_Font
- * @access private
- */
- var $_titleFont = false;
-
- /**
- * Invert the axis (i.e. if an y-axis normally displays minimum values at
- * the bottom, they are not displayed at the top
- * @var bool
- * @access private
- * @since 0.3.0dev3
- */
- var $_invert = false;
-
- /**
- * Transpose the axis (i.e. is a normal y-axis transposed, so thats it's not show
- * vertically as normally expected, but instead horizontally)
- * @var bool
- * @access private
- */
- var $_transpose = false;
-
- /**
- * Image_Graph_Axis [Constructor].
- * Normally a manual creation should not be necessary, axis are created
- * automatically by the {@link Image_Graph_Plotarea} constructor unless
- * explicitly defined otherwise
- *
- * @param int $type The type (direction) of the Axis, use IMAGE_GRAPH_AXIS_X
- * for an X-axis (default, may be omitted) and IMAGE_GRAPH_AXIS_Y for Y-
- * axis)
- */
- function Image_Graph_Axis($type = IMAGE_GRAPH_AXIS_X)
- {
- parent::Image_Graph_Element();
- $this->_type = $type;
- $this->_fillStyle = 'black';
- }
-
- /**
- * Push the values by 0.5 (for bar and step chart)
- *
- * @access private
- */
- function _pushValues()
- {
- $this->_pushValues = true;
- }
-
- /**
- * Sets the axis padding for a given position ('low' or 'high')
- * @param string $where The position
- * @param int $value The number of pixels to "pad"
- * @access private
- */
- function _setAxisPadding($where, $value)
- {
- $this->_axisPadding[$where] = $value;
- }
-
- /**
- * Gets the font of the title.
- *
- * If not font has been set, the parent font is propagated through it's
- * children.
- *
- * @return array An associated array used for canvas
- * @access private
- */
- function _getTitleFont()
- {
- if ($this->_titleFont === false) {
- if ($this->_defaultFontOptions !== false) {
- return $this->_defaultFontOptions;
- } else {
- return $this->_getFont();
- }
- } else {
- if (is_object($this->_titleFont)) {
- return $this->_titleFont->_getFont();
- } elseif (is_array($this->_titleFont)) {
- return $this->_getFont($this->_titleFont);
- } elseif (is_int($this->_titleFont)) {
- return $this->_getFont(array('size' => $this->_titleFont));
- }
- }
- return array();
- }
-
- /**
- * Shows a label for the the specified values.
- *
- * Allowed values are combinations of:
- * <ul>
- * <li>IMAGE_GRAPH_LABEL_MINIMUM
- * <li>IMAGE_GRAPH_LABEL_ZERO
- * <li>IMAGE_GRAPH_LABEL_MAXIMUM
- * </ul>
- * By default none of these are shows on the axis
- *
- * @param int $value The values to show labels for
- */
- function showLabel($value)
- {
- $this->_showLabelMinimum = ($value & IMAGE_GRAPH_LABEL_MINIMUM);
- $this->_showLabelZero = ($value & IMAGE_GRAPH_LABEL_ZERO);
- $this->_showLabelMaximum = ($value & IMAGE_GRAPH_LABEL_MAXIMUM);
- }
-
- /**
- * Sets a data preprocessor for formatting the axis labels
- *
- * @param Image_Graph_DataPreprocessor $dataPreProcessor The data preprocessor
- * @see Image_Graph_DataPreprocessor
- */
- function setDataPreProcessor(& $dataPreProcessor)
- {
- $this->_dataPreProcessor =& $dataPreProcessor;
- }
-
- /**
- * Gets the minimum value the axis will show
- *
- * @return double The minumum value
- * @access private
- */
- function _getMinimum()
- {
- return $this->_minimum;
- }
-
- /**
- * Gets the maximum value the axis will show
- *
- * @return double The maximum value
- * @access private
- */
- function _getMaximum()
- {
- return $this->_maximum;
- }
-
- /**
- * Sets the minimum value the axis will show
- *
- * @param double $minimum The minumum value to use on the axis
- * @access private
- */
- function _setMinimum($minimum)
- {
- if ($this->_minimum === false) {
- $this->forceMinimum($minimum, false);
- } else {
- $this->forceMinimum(min($this->_minimum, $minimum), false);
- }
- }
-
- /**
- * Sets the maximum value the axis will show
- *
- * @param double $maximum The maximum value to use on the axis
- * @access private
- */
- function _setMaximum($maximum)
- {
- if ($this->_maximum === false) {
- $this->forceMaximum($maximum, false);
- } else {
- $this->forceMaximum(max($this->_maximum, $maximum), false);
- }
- }
-
- /**
- * Forces the minimum value of the axis
- *
- * @param double $minimum The minumum value to use on the axis
- * @param bool $userEnforce This value should not be set, used internally
- */
- function forceMinimum($minimum, $userEnforce = true)
- {
- if (($userEnforce) || (!$this->_minimumSet)) {
- $this->_minimum = $minimum;
- $this->_minimumSet = $userEnforce;
- }
- $this->_calcLabelInterval();
- }
-
- /**
- * Forces the maximum value of the axis
- *
- * @param double $maximum The maximum value to use on the axis
- * @param bool $userEnforce This value should not be set, used internally
- */
- function forceMaximum($maximum, $userEnforce = true)
- {
- if (($userEnforce) || (!$this->_maximumSet)) {
- $this->_maximum = $maximum;
- $this->_maximumSet = $userEnforce;
- }
- $this->_calcLabelInterval();
- }
-
- /**
- * Show an arrow head on the 'end' of the axis
- */
- function showArrow()
- {
- $this->_showArrow = true;
- }
-
- /**
- * Do not show an arrow head on the 'end' of the axis (default)
- */
- function hideArrow()
- {
- $this->_showArrow = false;
- }
-
- /**
- * Return the label distance.
- *
- * @param int $level The label level to return the distance of
- * @return int The distance between 2 adjacent labels
- * @access private
- */
- function _labelDistance($level = 1)
- {
- $l1 = $this->_getNextLabel(false, $level);
- $l2 = $this->_getNextLabel($l1, $level);;
- return abs($this->_point($l2) - $this->_point($l1));
- }
-
- /**
- * Sets an interval for when labels are shown on the axis.
- *
- * By default 'auto' is used, forcing the axis to calculate a approximate
- * best label interval to be used. Specify an array to use user-defined
- * values for labels.
- *
- * @param mixed $labelInterval The interval with which labels are shown
- * @param int $level The label level to set the interval on
- */
- function setLabelInterval($labelInterval = 'auto', $level = 1)
- {
- if (!isset($this->_labelOptions[$level])) {
- $this->_labelOptions[$level] = array();
- }
-
- if ($labelInterval === 'auto') {
- $this->_labelOptions[$level]['type'] = 'auto';
- $this->_calcLabelInterval();
- } else {
- $this->_labelOptions[$level]['type'] = 'manual';
- $this->_labelOptions[$level]['interval'] = $labelInterval;
- }
- }
-
- /**
- * Sets options for the label at a specific level.
- *
- * Possible options are:
- *
- * 'showtext' true or false whether label text should be shown or not
- *
- * 'showoffset' should the label be shown at an offset, i.e. should the
- * label be shown at a position so that it does not overlap with prior
- * levels. Only applies to multilevel labels with text
- *
- * 'font' The font options as an associated array
- *
- * 'position' The position at which the labels are written ('inside' or
- * 'outside' the axis). NB! This relative position only applies to the
- * default location of the axis, i.e. if an x-axis is inverted then
- * 'outside' still refers to the "left" side of a normal y-axis (since this
- * is normally 'outside') but the actual output will be labels on the
- * "inside"!
- *
- * 'format' To format the label text according to a sprintf statement
- *
- * 'dateformat' To format the label as a date, fx. j. M Y = 29. Jun 2005
- *
- * @param string $option The label option name (see detailed description
- * for possible values)
- * @param mixed $value The value for the option
- * @param int $level The label level to set the interval on
- */
- function setLabelOption($option, $value, $level = 1)
- {
- if (!isset($this->_labelOptions[$level])) {
- $this->_labelOptions[$level] = array('type' => 'auto');
- }
-
- $this->_labelOptions[$level][$option] = $value;
- }
-
- /**
- * Sets options for the label at a specific level.
- *
- * The possible options are specified in {@link Image_Graph_Axis::
- * setLabelOption()}.
- *
- * @param array $options An assciated array with label options
- * @param int $level The label level to set the interval on
- */
- function setLabelOptions($options, $level = 1)
- {
- if (is_array($options)) {
- if (isset($this->_labelOptions[$level])) {
- $this->_labelOptions[$level] = array_merge($this->_labelOptions[$level], $options);
- } else {
- $this->_labelOptions[$level] = $options;
- }
-
- }
- }
-
- /**
- * Sets the title of this axis.
- *
- * This is used as an alternative (maybe better) method, than using layout's
- * for axis-title generation.
- *
- * To use the current propagated font, but just set it vertically, simply
- * pass 'vertical' as second parameter for vertical alignment down-to-up or
- * 'vertical2' for up-to-down alignment.
- *
- * @param string $title The title of this axis
- * @param Image_Graph_Font $font The font used for the title
- * @since 0.3.0dev2
- */
- function setTitle($title, $font = false)
- {
- $this->_title = $title;
- if ($font === 'vertical') {
- $this->_titleFont = array('vertical' => true, 'angle' => 90);
- } elseif ($font === 'vertical2') {
- $this->_titleFont = array('vertical' => true, 'angle' => 270);
- } else {
- $this->_titleFont =& $font;
- }
- }
-
- /**
- * Sets a fixed "size" for the axis.
- *
- * If the axis is any type of y-axis the size relates to the width of the
- * axis, if an x-axis is concerned the size is the height.
- *
- * @param int $size The fixed size of the axis
- * @since 0.3.0dev5
- */
- function setFixedSize($size)
- {
- $this->_fixedSize = $size;
- }
-
- /**
- * Preprocessor for values, ie for using logarithmic axis
- *
- * @param double $value The value to preprocess
- * @return double The preprocessed value
- * @access private
- */
- function _value($value)
- {
- return $value - $this->_getMinimum() + ($this->_pushValues ? 0.5 : 0);
- }
-
- /**
- * Apply the dataset to the axis
- *
- * @param Image_Graph_Dataset $dataset The dataset
- * @access private
- */
- function _applyDataset(&$dataset)
- {
- if ($this->_type == IMAGE_GRAPH_AXIS_X) {
- $this->_setMinimum($dataset->minimumX());
- $this->_setMaximum($dataset->maximumX());
- } else {
- $this->_setMinimum($dataset->minimumY());
- $this->_setMaximum($dataset->maximumY());
- }
- }
-
- /**
- * Get the pixel position represented by a value on the canvas
- *
- * @param double $value the value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _point($value)
- {
- if ((($this->_type == IMAGE_GRAPH_AXIS_X) && (!$this->_transpose)) ||
- (($this->_type != IMAGE_GRAPH_AXIS_X) && ($this->_transpose)))
- {
- if ($this->_invert) {
- return max($this->_left, $this->_right - $this->_axisPadding['high'] - $this->_delta * $this->_value($value));
- } else {
- return min($this->_right, $this->_left + $this->_axisPadding['low'] + $this->_delta * $this->_value($value));
- }
- } else {
- if ($this->_invert) {
- return min($this->_bottom, $this->_top + $this->_axisPadding['high'] + $this->_delta * $this->_value($value));
- } else {
- return max($this->_top, $this->_bottom - $this->_axisPadding['low'] - $this->_delta * $this->_value($value));
- }
- }
- }
-
-
- /**
- * Get the axis intersection pixel position
- *
- * This is only to be called prior to output! I.e. between the user
- * invokation of Image_Graph::done() and any actual output is performed.
- * This is because it can change the axis range.
- *
- * @param double $value the intersection value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _intersectPoint($value)
- {
-
- if (($value === 'min') || ($value < $this->_getMinimum())) {
- if ($this->_type == IMAGE_GRAPH_AXIS_X) {
- if ($this->_invert) {
- return ($this->_transpose ? $this->_top : $this->_right);
- } else {
- return ($this->_transpose ? $this->_bottom : $this->_left);
- }
- } else {
- if ($this->_invert) {
- return ($this->_transpose ? $this->_right : $this->_top);
- } else {
- return ($this->_transpose ? $this->_left : $this->_bottom);
- }
- }
- } elseif (($value === 'max') || ($value > $this->_getMaximum())) {
- if ($this->_type == IMAGE_GRAPH_AXIS_X) {
- if ($this->_invert) {
- return ($this->_transpose ? $this->_bottom : $this->_left);
- } else {
- return ($this->_transpose ? $this->_top : $this->_right);
- }
- } else {
- if ($this->_invert) {
- return ($this->_transpose ? $this->_left : $this->_bottom);
- } else {
- return ($this->_transpose ? $this->_right : $this->_top);
- }
- }
- }
-
- return $this->_point($value);
- }
-
- /**
- * Calculate the delta value (the number of pixels representing one unit
- * on the axis)
- *
- * @return double The label interval
- * @access private
- */
- function _calcDelta()
- {
- if ($this->_axisValueSpan == 0) {
- $this->_delta = false;
- } elseif ($this->_type == IMAGE_GRAPH_AXIS_X) {
- $this->_delta = (($this->_transpose ? $this->height() : $this->width()) - ($this->_axisPadding['low'] + $this->_axisPadding['high'])) / ($this->_axisValueSpan + ($this->_pushValues ? 1 : 0));
- } else {
- $this->_delta = (($this->_transpose ? $this->width() : $this->height()) - ($this->_axisPadding['low'] + $this->_axisPadding['high'])) / ($this->_axisValueSpan + ($this->_pushValues ? 1 : 0));
- }
- }
-
- /**
- * Calculate the label interval
- *
- * If explicitly defined this will be calucated to an approximate best.
- *
- * @return double The label interval
- * @access private
- */
- function _calcLabelInterval()
- {
- $min = $this->_getMinimum();
- $max = $this->_getMaximum();
-
- $this->_axisValueSpan = $this->_axisSpan = abs($max - $min);
-
- if ((!empty($min)) && (!empty($max)) && ($min > $max)) {
- $this->_labelOptions[1]['interval'] = 1;
- return true;
- }
-
- $span = 0;
- foreach($this->_labelOptions as $level => $labelOptions) {
- if ((!isset($labelOptions['type'])) || ($labelOptions['type'] !== 'auto')) {
- $span = false;
- } elseif ($level == 1) {
- $span = $this->_axisValueSpan;
- } else {
- $l1 = $this->_getNextLabel(false, $level - 1);
- $l2 = $this->_getNextLabel($l1, $level - 1);
- if ((!is_numeric($l1)) || (!is_numeric($l2))) {
- $span == false;
- } else {
- $span = $l2 - $l1;
- }
- }
-
- if ($span !== false) {
- $interval = pow(10, floor(log10($span)));
-
- if ($interval == 0) {
- $interval = 1;
- }
-
- if ((($span) / $interval) < 3) {
- $interval = $interval / 4;
- } elseif ((($span) / $interval) < 5) {
- $interval = $interval / 2;
- } elseif ((($span) / $interval) > 10) {
- $interval = $interval * 2;
- }
-
- if (($interval -floor($interval) == 0.5) && ($interval != 0.5)) {
- $interval = floor($interval);
- }
-
- // just to be 100% sure that an interval of 0 is not returned some
- // additional checks are performed
- if ($interval == 0) {
- $interval = ($span) / 5;
- }
-
- if ($interval == 0) {
- $interval = 1;
- }
-
- $this->_labelOptions[$level]['interval'] = $interval;
- }
- }
- }
-
- /**
- * Get next label point
- *
- * @param doubt $currentLabel The current label, if omitted or false, the
- * first is returned
- * @param int $level The label level to get the next label from
- * @return double The next label point
- * @access private
- */
- function _getNextLabel($currentLabel = false, $level = 1)
- {
- if (!isset($this->_labelOptions[$level])) {
- return false;
- }
-
- if (is_array($this->_labelOptions[$level]['interval'])) {
- if ($currentLabel === false) {
- reset($this->_labelOptions[$level]['interval']);
- }
-
- if (list(, $label) = each($this->_labelOptions[$level]['interval'])) {
- return $label;
- } else {
- return false;
- }
- } else {
- $li = $this->_labelInterval($level);
- if (($this->_axisSpan == 0) || ($this->_axisValueSpan == 0) ||
- ($li == 0)
- ) {
- return false;
- }
-
- $labelInterval = $this->_axisSpan / ($this->_axisValueSpan / $li);
-
- if ($labelInterval == 0) {
- return false;
- }
-
- if ($currentLabel === false) {
- $label = ((int) ($this->_getMinimum() / $labelInterval)) *
- $labelInterval - $labelInterval;
- while ($label < $this->_getMinimum()) {
- $label += $labelInterval;
- }
- return $label;
- } else {
- if ($currentLabel + $labelInterval > $this->_getMaximum()) {
- return false;
- } else {
- return $currentLabel + $labelInterval;
- }
- }
- }
- }
-
- /**
- * Get the interval with which labels are shown on the axis.
- *
- * If explicitly defined this will be calucated to an approximate best.
- *
- * @param int $level The label level to get the label interval for
- * @return double The label interval
- * @access private
- */
- function _labelInterval($level = 1)
- {
- if ((!isset($this->_labelOptions[$level])) ||
- (!isset($this->_labelOptions[$level]['interval']))
- ) {
- return 1;
- }
-
- return (is_array($this->_labelOptions[$level]['interval'])
- ? 1
- : $this->_labelOptions[$level]['interval']
- );
- }
-
- /**
- * Get the size in pixels of the axis.
- *
- * For an x-axis this is the width of the axis including labels, and for an
- * y-axis it is the corrresponding height
- *
- * @return int The size of the axis
- * @access private
- */
- function _size()
- {
- if (!$this->_visible) {
- return 0;
- }
-
- if ($this->_fixedSize !== false) {
- return $this->_fixedSize;
- }
-
- krsort($this->_labelOptions);
-
- $totalMaxSize = 0;
-
- foreach ($this->_labelOptions as $level => $labelOptions) {
- if ((isset($labelOptions['showoffset'])) && ($labelOptions['showoffset'] === true)) {
- $this->_labelOptions[$level]['offset'] += $totalMaxSize;
- } elseif (!isset($this->_labelOptions[$level]['offset'])) {
- $this->_labelOptions[$level]['offset'] = 0;
- }
- if (
- (isset($labelOptions['showtext'])) &&
- ($labelOptions['showtext'] === true) &&
- (
- (!isset($labelOptions['position'])) ||
- ($labelOptions['position'] == 'outside')
- )
- ) {
- if (isset($labelOptions['font'])) {
- $font = $this->_getFont($labelOptions['font']);
- } else {
- if ($this->_defaultFontOptions !== false) {
- $font = $this->_defaultFontOptions;
- } else {
- $font = $this->_getFont();
- }
- }
- $this->_canvas->setFont($font);
-
- $value = false;
- $maxSize = 0;
- while (($value = $this->_getNextLabel($value, $level)) !== false) {
- if ((abs($value) > 0.0001) && ($value > $this->_getMinimum()) &&
- ($value < $this->_getMaximum()))
- {
- if (is_object($this->_dataPreProcessor)) {
- $labelText = $this->_dataPreProcessor->_process($value);
- } elseif (isset($labelOptions['format'])) {
- $labelText = sprintf($labelOptions['format'], $value);
- } elseif (isset($labelOptions['dateformat'])) {
- $labelText = date($labelOptions['dateformat'], $value);
- } else {
- $labelText = $value;
- }
-
- if ((($this->_type == IMAGE_GRAPH_AXIS_X) && (!$this->_transpose)) ||
- (($this->_type != IMAGE_GRAPH_AXIS_X) && ($this->_transpose)))
- {
- $maxSize = max($maxSize, $this->_canvas->textHeight($labelText));
- } else {
- $maxSize = max($maxSize, $this->_canvas->textWidth($labelText));
- }
- }
- }
- if ((isset($labelOptions['showoffset'])) && ($labelOptions['showoffset'] === true)) {
- $totalMaxSize += $maxSize;
- } else {
- $totalMaxSize = max($totalMaxSize, $maxSize);
- }
- }
- }
-
- if ($this->_title) {
- $this->_canvas->setFont($this->_getTitleFont());
-
- if ((($this->_type == IMAGE_GRAPH_AXIS_X) && (!$this->_transpose)) ||
- (($this->_type != IMAGE_GRAPH_AXIS_X) && ($this->_transpose)))
- {
- $totalMaxSize += $this->_canvas->textHeight($this->_title);
- } else {
- $totalMaxSize += $this->_canvas->textWidth($this->_title);
- }
- $totalMaxSize += 10;
- }
-
- return $totalMaxSize + 3;
- }
-
- /**
- * Adds a mark to the axis at the specified value
- *
- * @param double $value The value
- * @param double $value2 The second value (for a ranged mark)
- */
- function addMark($value, $value2 = false, $text = false)
- {
- if ($value2 === false) {
- $this->_marks[] = $value;
- } else {
- $this->_marks[] = array($value, $value2);
- }
- }
-
- /**
- * Is the axis numeric or not?
- *
- * @return bool True if numeric, false if not
- * @access private
- */
- function _isNumeric()
- {
- return true;
- }
-
- /**
- * Set the major tick appearance.
- *
- * The positions are specified in pixels relative to the axis, meaning that
- * a value of -1 for start will draw the major tick 'line' starting at 1
- * pixel outside (negative) value the axis (i.e. below an x-axis and to the
- * left of a normal y-axis).
- *
- * @param int $start The start position relative to the axis
- * @param int $end The end position relative to the axis
- * @param int $level The label level to set the tick options for
- * @since 0.3.0dev2
- */
- function setTickOptions($start, $end, $level = 1)
- {
- if (!isset($this->_labelOptions[$level])) {
- $this->_labelOptions[$level] = array();
- }
-
- $this->_labelOptions[$level]['tick'] = array(
- 'start' => $start,
- 'end' => $end
- );
- }
-
- /**
- * Invert the axis direction
- *
- * If the minimum values are normally displayed fx. at the bottom setting
- * axis inversion to true, will cause the minimum values to be displayed at
- * the top and maximum at the bottom.
- *
- * @param bool $invert True if the axis is to be inverted, false if not
- * @since 0.3.0dev3
- */
- function setInverted($invert)
- {
- $this->_invert = $invert;
- }
-
- /**
- * Set axis intersection.
- *
- * Sets the value at which the axis intersects other axis, fx. at which Y-
- * value the x-axis intersects the y-axis (normally at 0).
- *
- * Possible values are 'default', 'min', 'max' or a number between axis min
- * and max (the value will automatically be limited to this range).
- *
- * For a coordinate system with 2 y-axis, the x-axis can either intersect
- * the primary or the secondary y-axis. To make the x-axis intersect the
- * secondary y-axis at a given value pass IMAGE_GRAPH_AXIS_Y_SECONDARY as
- * second parameter.
- *
- * @param mixed $intersection The value at which the axis intersect the
- * 'other' axis
- * @param mixed $axis The axis to intersect. Only applies to x-axis with
- * both a primary and secondary y-axis available.
- * @since 0.3.0dev2
- */
- function setAxisIntersection($intersection, $axis = 'default')
- {
- if ($axis == 'x') {
- $axis = IMAGE_GRAPH_AXIS_X;
- } elseif ($axis == 'y') {
- $axis = IMAGE_GRAPH_AXIS_Y;
- } elseif ($axis == 'ysec') {
- $axis = IMAGE_GRAPH_AXIS_Y_SECONDARY;
- }
- $this->_intersect = array(
- 'value' => $intersection,
- 'axis' => $axis
- );
- }
-
- /**
- * Get axis intersection data.
- *
- * @return array An array with the axis intersection data.
- * @since 0.3.0dev2
- * @access private
- */
- function _getAxisIntersection()
- {
- $value = $this->_intersect['value'];
- $axis = $this->_intersect['axis'];
- if (($this->_type == IMAGE_GRAPH_AXIS_Y)
- || ($this->_type == IMAGE_GRAPH_AXIS_Y_SECONDARY)
- ) {
- $axis = IMAGE_GRAPH_AXIS_X;
- } elseif ($axis == 'default') {
- $axis = IMAGE_GRAPH_AXIS_Y;
- }
-
- if ($value === 'default') {
- switch ($this->_type) {
- case IMAGE_GRAPH_AXIS_Y:
- $value = 'min';
- break;
- case IMAGE_GRAPH_AXIS_Y_SECONDARY:
- $value = 'max';
- break;
- case IMAGE_GRAPH_AXIS_X:
- $value = 0;
- break;
- }
- }
-
- return array('value' => $value, 'axis' => $axis);
- }
-
- /**
- * Resets the elements
- *
- * @access private
- */
- function _reset()
- {
- parent::_reset();
- $this->_labelText = array();
- }
-
- /**
- * Output an axis tick mark.
- *
- * @param int $value The value to output
- * @param int $level The label level to draw the tick for
- * @access private
- */
- function _drawTick($value, $level = 1)
- {
- if (isset($this->_labelOptions[$level])) {
- $labelOptions = $this->_labelOptions[$level];
- $labelPosition = $this->_point($value);
-
- if (isset($labelOptions['offset'])) {
- $offset = $labelOptions['offset'];
- } else {
- $offset = 0;
- }
-
- if ((isset($labelOptions['showtext'])) && ($labelOptions['showtext'] === true)) {
- if (is_object($this->_dataPreProcessor)) {
- $labelText = $this->_dataPreProcessor->_process($value);
- } elseif (isset($labelOptions['format'])) {
- $labelText = sprintf($labelOptions['format'], $value);
- } elseif (isset($labelOptions['dateformat'])) {
- $labelText = date($labelOptions['dateformat'], $value);
- } else {
- $labelText = $value;
- }
-
- if (!in_array($labelText, $this->_labelText)) {
- $this->_labelText[] = $labelText;
-
- if (isset($labelOptions['font'])) {
- $font = $this->_getFont($labelOptions['font']);
- } else {
- if ($this->_defaultFontOptions !== false) {
- $font = $this->_defaultFontOptions;
- } else {
- $font = $this->_getFont();
- }
- }
- $this->_canvas->setFont($font);
-
- if (
- (isset($labelOptions['position'])) &&
- ($labelOptions['position'] == 'inside')
- ) {
- $labelInside = true;
- } else {
- $labelInside = false;
- }
-
- if ($this->_type == IMAGE_GRAPH_AXIS_Y) {
- if ($this->_transpose) {
- if ($labelInside) {
- $this->write(
- $labelPosition,
- $this->_top - 3 - $offset,
- $labelText,
- IMAGE_GRAPH_ALIGN_BOTTOM | IMAGE_GRAPH_ALIGN_CENTER_X,
- $font
- );
- } else {
- $this->write(
- $labelPosition,
- $this->_top + 6 + $offset + $font['size'] * (substr_count($labelText, "\n") + 1),
- $labelText,
- IMAGE_GRAPH_ALIGN_BOTTOM | IMAGE_GRAPH_ALIGN_CENTER_X,
- $font
- );
- }
- }
- else {
- if ($labelInside) {
- $this->write(
- $this->_right + 3 + $offset,
- $labelPosition,
- $labelText,
- IMAGE_GRAPH_ALIGN_CENTER_Y | IMAGE_GRAPH_ALIGN_LEFT,
- $font
- );
- } else {
- $this->write(
- $this->_right - 3 - $offset,
- $labelPosition,
- $labelText,
- IMAGE_GRAPH_ALIGN_CENTER_Y | IMAGE_GRAPH_ALIGN_RIGHT,
- $font
- );
- }
- }
- } elseif ($this->_type == IMAGE_GRAPH_AXIS_Y_SECONDARY) {
- if ($this->_transpose) {
- if ($labelInside) {
- $this->write(
- $labelPosition,
- $this->_bottom + 6 + $offset + $font['size'] * (substr_count($labelText, "\n") + 1),
- $labelText,
- IMAGE_GRAPH_ALIGN_BOTTOM | IMAGE_GRAPH_ALIGN_CENTER_X,
- $font
- );
- } else {
- $this->write(
- $labelPosition,
- $this->_bottom - 3 - $offset,
- $labelText,
- IMAGE_GRAPH_ALIGN_BOTTOM | IMAGE_GRAPH_ALIGN_CENTER_X,
- $font
- );
- }
- }
- else {
- if ($labelInside) {
- $this->write(
- $this->_left - 3 - $offset,
- $labelPosition,
- $labelText,
- IMAGE_GRAPH_ALIGN_CENTER_Y | IMAGE_GRAPH_ALIGN_RIGHT,
- $font
- );
- } else {
- $this->write(
- $this->_left + 3 + $offset,
- $labelPosition,
- $labelText,
- IMAGE_GRAPH_ALIGN_CENTER_Y | IMAGE_GRAPH_ALIGN_LEFT,
- $font
- );
- }
- }
- } else {
- if ($this->_transpose) {
- if ($labelInside) {
- $this->write(
- $this->_right + 3 + $offset,
- $labelPosition,
- $labelText,
- IMAGE_GRAPH_ALIGN_CENTER_Y | IMAGE_GRAPH_ALIGN_LEFT,
- $font
- );
- } else {
- $this->write(
- $this->_right - 3 - $offset,
- $labelPosition,
- $labelText,
- IMAGE_GRAPH_ALIGN_CENTER_Y | IMAGE_GRAPH_ALIGN_RIGHT,
- $font
- );
- }
- }
- else {
- if ($labelInside === true) {
- $this->write(
- $labelPosition,
- $this->_top - 3 - $offset,
- $labelText,
- IMAGE_GRAPH_ALIGN_CENTER_X | IMAGE_GRAPH_ALIGN_BOTTOM,
- $font
- );
- } else {
- $this->write(
- $labelPosition,
- $this->_top + 6 + $offset + $font['size'] * (substr_count($labelText, "\n") + 1),
- $labelText,
- IMAGE_GRAPH_ALIGN_CENTER_X | IMAGE_GRAPH_ALIGN_BOTTOM,
- $font
- );
- }
- }
- }
- }
- }
-
- $tickColor = false;
- if (isset($this->_labelOptions[$level]['tick'])) {
- if (isset($this->_labelOptions[$level]['tick']['start'])) {
- $tickStart = $this->_labelOptions[$level]['tick']['start'];
- } else {
- $tickStart = false;
- }
-
- if (isset($this->_labelOptions[$level]['tick']['end'])) {
- $tickEnd = $this->_labelOptions[$level]['tick']['end'];
- } else {
- $tickEnd = false;
- }
-
- if ((isset($this->_labelOptions[$level]['tick']['color'])) && ($this->_labelOptions[$level]['tick']['color'] !== false)) {
- $tickColor = $this->_labelOptions[$level]['tick']['color'];
- }
- }
-
- if ($tickStart === false) {
- $tickStart = -2;
- }
-
- if ($tickEnd === false) {
- $tickEnd = 2;
- }
-
- if ($tickColor !== false) {
- $this->_canvas->setLineColor($tickColor);
- }
- else {
- $this->_getLineStyle();
- }
-
- if ($this->_type == IMAGE_GRAPH_AXIS_Y) {
- if ($tickStart === 'auto') {
- $tickStart = -$offset;
- }
- if ($this->_transpose) {
- $this->_canvas->line(
- array(
- 'x0' => $labelPosition,
- 'y0' => $this->_top + $tickStart,
- 'x1' => $labelPosition,
- 'y1' => $this->_top + $tickEnd
- )
- );
- }
- else {
- $this->_canvas->line(
- array(
- 'x0' => $this->_right + $tickStart,
- 'y0' => $labelPosition,
- 'x1' => $this->_right + $tickEnd,
- 'y1' => $labelPosition
- )
- );
- }
- } elseif ($this->_type == IMAGE_GRAPH_AXIS_Y_SECONDARY) {
- if ($tickStart === 'auto') {
- $tickStart = $offset;
- }
- if ($this->_transpose) {
- $this->_canvas->line(
- array(
- 'x0' => $labelPosition,
- 'y0' => $this->_bottom - $tickStart,
- 'x1' => $labelPosition,
- 'y1' => $this->_bottom - $tickEnd
- )
- );
- }
- else {
- $this->_canvas->line(
- array(
- 'x0' => $this->_left - $tickStart,
- 'y0' => $labelPosition,
- 'x1' => $this->_left - $tickEnd,
- 'y1' => $labelPosition
- )
- );
- }
- } else {
- if ($tickStart === 'auto') {
- $tickStart = $offset;
- }
- if ($this->_transpose) {
- $this->_canvas->line(
- array(
- 'x0' => $this->_right + $tickStart,
- 'y0' => $labelPosition,
- 'x1' => $this->_right + $tickEnd,
- 'y1' => $labelPosition
- )
- );
- }
- else {
- $this->_canvas->line(
- array(
- 'x0' => $labelPosition,
- 'y0' => $this->_top - $tickStart,
- 'x1' => $labelPosition,
- 'y1' => $this->_top - $tickEnd
- )
- );
- }
- }
- }
- }
-
- /**
- * Draws axis lines.
- *
- * @access private
- */
- function _drawAxisLines()
- {
- if ($this->_type == IMAGE_GRAPH_AXIS_X) {
- $this->_getLineStyle();
- $this->_getFillStyle();
-
- if ($this->_transpose) {
- $data = array(
- 'x0' => $this->_right,
- 'y0' => $this->_top,
- 'x1' => $this->_right,
- 'y1' => $this->_bottom
- );
- } else {
- $data = array(
- 'x0' => $this->_left,
- 'y0' => $this->_top,
- 'x1' => $this->_right,
- 'y1' => $this->_top
- );
- }
-
- if ($this->_showArrow) {
- if ($this->_getMaximum() <= 0) {
- $data['end0'] = 'arrow2';
- $data['size0'] = 7;
- }
- else {
- $data['end1'] = 'arrow2';
- $data['size1'] = 7;
- }
- }
-
- $this->_canvas->line($data);
-
- if ($this->_title) {
- if (!$this->_transpose) {
- $y = $this->_bottom;
- $x = $this->_left + $this->width() / 2;
- $this->write($x, $y, $this->_title, IMAGE_GRAPH_ALIGN_CENTER_X + IMAGE_GRAPH_ALIGN_BOTTOM, $this->_getTitleFont());
- }
- else {
- $y = $this->_top + $this->height() / 2;
- $x = $this->_left;
- $this->write($x, $y, $this->_title, IMAGE_GRAPH_ALIGN_LEFT + IMAGE_GRAPH_ALIGN_CENTER_Y, $this->_getTitleFont());
- }
- }
- } elseif ($this->_type == IMAGE_GRAPH_AXIS_Y_SECONDARY) {
- $this->_getLineStyle();
- $this->_getFillStyle();
-
- if ($this->_transpose) {
- $data = array(
- 'x0' => $this->_left,
- 'y0' => $this->_bottom,
- 'x1' => $this->_right,
- 'y1' => $this->_bottom
- );
- } else {
- $data = array(
- 'x0' => $this->_left,
- 'y0' => $this->_bottom,
- 'x1' => $this->_left,
- 'y1' => $this->_top
- );
- }
- if ($this->_showArrow) {
- if ($this->_getMaximum() <= 0) {
- $data['end0'] = 'arrow2';
- $data['size0'] = 7;
- }
- else {
- $data['end1'] = 'arrow2';
- $data['size1'] = 7;
- }
- }
- $this->_canvas->line($data);
-
- if ($this->_title) {
- if ($this->_transpose) {
- $y = $this->_top;
- $x = $this->_left + $this->width() / 2;
- $this->write($x, $y, $this->_title, IMAGE_GRAPH_ALIGN_CENTER_X + IMAGE_GRAPH_ALIGN_TOP, $this->_getTitleFont());
- }
- else {
- $y = $this->_top + $this->height() / 2;
- $x = $this->_right;
- $this->write($x, $y, $this->_title, IMAGE_GRAPH_ALIGN_RIGHT + IMAGE_GRAPH_ALIGN_CENTER_Y, $this->_getTitleFont());
- }
- }
- } else {
- $this->_getLineStyle();
- $this->_getFillStyle();
-
- if ($this->_transpose) {
- $data = array(
- 'x0' => $this->_left,
- 'y0' => $this->_top,
- 'x1' => $this->_right,
- 'y1' => $this->_top
- );
- } else {
- $data = array(
- 'x0' => $this->_right,
- 'y0' => $this->_bottom,
- 'x1' => $this->_right,
- 'y1' => $this->_top
- );
- }
- if ($this->_showArrow) {
- if ($this->_getMaximum() <= 0) {
- $data['end0'] = 'arrow2';
- $data['size0'] = 7;
- }
- else {
- $data['end1'] = 'arrow2';
- $data['size1'] = 7;
- }
- }
- $this->_canvas->line($data);
-
- if ($this->_title) {
- if ($this->_transpose) {
- $y = $this->_bottom;
- $x = $this->_left + $this->width() / 2;
- $this->write($x, $y, $this->_title, IMAGE_GRAPH_ALIGN_CENTER_X + IMAGE_GRAPH_ALIGN_BOTTOM, $this->_getTitleFont());
- }
- else {
- $y = $this->_top + $this->height() / 2;
- $x = $this->_left;
- $this->write($x, $y, $this->_title, IMAGE_GRAPH_ALIGN_LEFT + IMAGE_GRAPH_ALIGN_CENTER_Y, $this->_getTitleFont());
- }
- }
- }
- }
-
- /**
- * Causes the object to update all sub elements coordinates
- *
- * (Image_Graph_Common, does not itself have coordinates, this is basically
- * an abstract method)
- *
- * @access private
- */
- function _updateCoords()
- {
- parent::_updateCoords();
- $this->_calcDelta();
- }
-
- /**
- * Output the axis
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- $this->_canvas->startGroup(get_class($this));
-
- if (parent::_done() === false) {
- return false;
- }
-
- $this->_drawAxisLines();
-
- $this->_canvas->startGroup(get_class($this) . '_ticks');
- ksort($this->_labelOptions);
- foreach ($this->_labelOptions as $level => $labelOption) {
- $value = false;
- while (($value = $this->_getNextLabel($value, $level)) !== false) {
- if ((((abs($value) > 0.0001) || ($this->_showLabelZero)) &&
- (($value > $this->_getMinimum()) || ($this->_showLabelMinimum)) &&
- (($value < $this->_getMaximum()) || ($this->_showLabelMaximum))) &&
- ($value >= $this->_getMinimum()) && ($value <= $this->_getMaximum())
- ) {
- $this->_drawTick($value, $level);
- }
- }
- }
- $this->_canvas->endGroup();
-
- $tickStart = -3;
- $tickEnd = 2;
-
- foreach ($this->_marks as $mark) {
- if (is_array($mark)) {
- if ($this->_type == IMAGE_GRAPH_AXIS_X) {
- if ($this->_transpose) {
- $x0 = $this->_right + $tickStart;
- $y0 = $this->_point($mark[1]);
- $x1 = $this->_right + $tickEnd;
- $y1 = $this->_point($mark[0]);
- }
- else {
- $x0 = $this->_point($mark[0]);
- $y0 = $this->_top + $tickStart;
- $x1 = $this->_point($mark[1]);
- $y1 = $this->_top + $tickEnd;
- }
- } elseif ($this->_type == IMAGE_GRAPH_AXIS_Y) {
- if ($this->_transpose) {
- $x0 = $this->_point($mark[0]);
- $y0 = $this->_top + $tickStart;
- $x1 = $this->_point($mark[1]);
- $y1 = $this->_top + $tickEnd;
- }
- else {
- $x0 = $this->_right + $tickStart;
- $y0 = $this->_point($mark[1]);
- $x1 = $this->_right + $tickEnd;
- $y1 = $this->_point($mark[0]);
- }
- } elseif ($this->_type == IMAGE_GRAPH_AXIS_Y_SECONDARY) {
- if ($this->_transpose) {
- $x0 = $this->_point($mark[0]);
- $y0 = $this->_bottom + $tickStart;
- $x1 = $this->_point($mark[1]);
- $y1 = $this->_bottom + $tickEnd;
- }
- else {
- $x0 = $this->_left + $tickStart;
- $y0 = $this->_point($mark[1]);
- $x1 = $this->_left + $tickEnd;
- $y1 = $this->_point($mark[0]);
- }
- }
- $this->_getFillStyle();
- $this->_getLineStyle();
- $this->_canvas->rectangle(array('x0' => $x0, 'y0' => $y0, 'x1' => $x1, 'y1' => $y1));
- } else {
- if ($this->_type == IMAGE_GRAPH_AXIS_X) {
- if ($this->_transpose) {
- $x0 = $this->_right + 5;
- $y0 = $this->_point($mark);
- $x1 = $this->_right + 15;
- $y1 = $y0;
- }
- else {
- $x0 = $this->_point($mark);
- $y0 = $this->_top - 5;
- $x1 = $x0;
- $y1 = $this->_top - 15;
- }
- } elseif ($this->_type == IMAGE_GRAPH_AXIS_Y) {
- if ($this->_transpose) {
- $x0 = $this->_point($mark);
- $y0 = $this->_top - 5;
- $x1 = $x0;
- $y1 = $this->_top - 15;
- }
- else {
- $x0 = $this->_right + 5;
- $y0 = $this->_point($mark);
- $x1 = $this->_right + 15;
- $y1 = $y0;
- }
- } elseif ($this->_type == IMAGE_GRAPH_AXIS_Y_SECONDARY) {
- if ($this->_transpose) {
- $x0 = $this->_point($mark);
- $y0 = $this->_bottom + 5;
- $x1 = $x0;
- $y1 = $this->_bottom + 15;
- }
- else {
- $x0 = $this->_left - 5;
- $y0 = $this->_point($mark);
- $x1 = $this->_left - 15;
- $y1 = $y0;
- }
- }
- $this->_getFillStyle();
- $this->_getLineStyle();
- $this->_canvas->line(
- array(
- 'x0' => $x0,
- 'y0' => $y0,
- 'x1' => $x1,
- 'y1' => $y1,
- 'end0' => 'arrow2',
- 'size0' => 5
- )
- );
- }
- }
- $this->_canvas->endGroup();
-
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Axis/Category.php b/config/archive/dspam/pear/Image/Graph/Axis/Category.php
deleted file mode 100644
index b6451496..00000000
--- a/config/archive/dspam/pear/Image/Graph/Axis/Category.php
+++ /dev/null
@@ -1,437 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Class for axis handling.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Axis
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Axis.php
- */
-require_once 'Image/Graph/Axis.php';
-
-/**
- * A normal axis thats displays labels with a 'interval' of 1.
- * This is basically a normal axis where the range is
- * the number of labels defined, that is the range is explicitly defined
- * when constructing the axis.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Axis
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Axis_Category extends Image_Graph_Axis
-{
-
- /**
- * The labels shown on the axis
- * @var array
- * @access private
- */
- var $_labels = false;
-
- /**
- * Image_Graph_Axis_Category [Constructor].
- *
- * @param int $type The type (direction) of the Axis
- */
- function Image_Graph_Axis_Category($type = IMAGE_GRAPH_AXIS_X)
- {
- parent::Image_Graph_Axis($type);
- $this->_labels = array();
- $this->setlabelInterval(1);
- }
-
- /**
- * Gets the minimum value the axis will show.
- *
- * This is always 0
- *
- * @return double The minumum value
- * @access private
- */
- function _getMinimum()
- {
- return 0;
- }
-
- /**
- * Gets the maximum value the axis will show.
- *
- * This is always the number of labels passed to the constructor.
- *
- * @return double The maximum value
- * @access private
- */
- function _getMaximum()
- {
- return count($this->_labels) - 1;
- }
-
- /**
- * Sets the minimum value the axis will show.
- *
- * A minimum cannot be set on a SequentialAxis, it is always 0.
- *
- * @param double Minimum The minumum value to use on the axis
- * @access private
- */
- function _setMinimum($minimum)
- {
- }
-
- /**
- * Sets the maximum value the axis will show
- *
- * A maximum cannot be set on a SequentialAxis, it is always the number
- * of labels passed to the constructor.
- *
- * @param double Maximum The maximum value to use on the axis
- * @access private
- */
- function _setMaximum($maximum)
- {
- }
-
- /**
- * Forces the minimum value of the axis
- *
- * <b>A minimum cannot be set on this type of axis</b>
- *
- * To modify the labels which are displayed on the axis, instead use
- * setLabelInterval($labels) where $labels is an array containing the
- * values/labels the axis should display. <b>Note!</b> Only values in
- * this array will then be displayed on the graph!
- *
- * @param double $minimum A minimum cannot be set on this type of axis
- */
- function forceMinimum($minimum, $userEnforce = true)
- {
- }
-
- /**
- * Forces the maximum value of the axis
- *
- * <b>A maximum cannot be set on this type of axis</b>
- *
- * To modify the labels which are displayed on the axis, instead use
- * setLabelInterval($labels) where $labels is an array containing the
- * values/labels the axis should display. <b>Note!</b> Only values in
- * this array will then be displayed on the graph!
- *
- * @param double $maximum A maximum cannot be set on this type of axis
- */
- function forceMaximum($maximum, $userEnforce = true)
- {
- }
-
- /**
- * Sets an interval for where labels are shown on the axis.
- *
- * The label interval is rounded to nearest integer value.
- *
- * @param double $labelInterval The interval with which labels are shown
- */
- function setLabelInterval($labelInterval = 'auto', $level = 1)
- {
- if (is_array($labelInterval)) {
- parent::setLabelInterval($labelInterval);
- } elseif ($labelInterval == 'auto') {
- parent::setLabelInterval(1);
- } else {
- parent::setLabelInterval(round($labelInterval));
- }
- }
-
- /**
- * Preprocessor for values, ie for using logarithmic axis
- *
- * @param double $value The value to preprocess
- * @return double The preprocessed value
- * @access private
- */
- function _value($value)
- {
-// $the_value = array_search($value, $this->_labels);
- if (isset($this->_labels[$value])) {
- $the_value = $this->_labels[$value];
- if ($the_value !== false) {
- return $the_value + ($this->_pushValues ? 0.5 : 0);
- } else {
- return 0;
- }
- }
- }
-
-
- /**
- * Get the minor label interval with which axis label ticks are drawn.
- *
- * For a sequential axis this is always disabled (i.e false)
- *
- * @return double The minor label interval, always false
- * @access private
- */
- function _minorLabelInterval()
- {
- return false;
- }
-
- /**
- * Get the size in pixels of the axis.
- *
- * For an x-axis this is the width of the axis including labels, and for an
- * y-axis it is the corrresponding height
- *
- * @return int The size of the axis
- * @access private
- */
- function _size()
- {
- if (!$this->_visible) {
- return 0;
- }
-
- $this->_canvas->setFont($this->_getFont());
-
- $maxSize = 0;
- foreach($this->_labels as $label => $id) {
- $labelPosition = $this->_point($label);
-
- if (is_object($this->_dataPreProcessor)) {
- $labelText = $this->_dataPreProcessor->_process($label);
- } else {
- $labelText = $label;
- }
-
- if ((($this->_type == IMAGE_GRAPH_AXIS_X) && (!$this->_transpose)) ||
- (($this->_type != IMAGE_GRAPH_AXIS_X) && ($this->_transpose)))
- {
- $maxSize = max($maxSize, $this->_canvas->textHeight($labelText));
- } else {
- $maxSize = max($maxSize, $this->_canvas->textWidth($labelText));
- }
- }
-
- if ($this->_title) {
- $this->_canvas->setFont($this->_getTitleFont());
-
- if ((($this->_type == IMAGE_GRAPH_AXIS_X) && (!$this->_transpose)) ||
- (($this->_type != IMAGE_GRAPH_AXIS_X) && ($this->_transpose)))
- {
- $maxSize += $this->_canvas->textHeight($this->_title);
- } else {
- $maxSize += $this->_canvas->textWidth($this->_title);
- }
- $maxSize += 10;
- }
- return $maxSize +3;
- }
-
- /**
- * Apply the dataset to the axis.
- *
- * This calculates the order of the categories, which is very important
- * for fx. line plots, so that the line does not "go backwards", consider
- * these X-sets:<p>
- * 1: (1, 2, 3, 4, 5, 6)<br>
- * 2: (0, 1, 2, 3, 4, 5, 6, 7)<p>
- * If they are not ordered, but simply appended, the categories on the axis
- * would be:<p>
- * X: (1, 2, 3, 4, 5, 6, 0, 7)<p>
- * Which would render the a line for the second plot to show incorrectly.
- * Instead this algorithm, uses and 'value- is- before' method to see that
- * the 0 is before a 1 in the second set, and that it should also be before
- * a 1 in the X set. Hence:<p>
- * X: (0, 1, 2, 3, 4, 5, 6, 7)
- *
- * @param Image_Graph_Dataset $dataset The dataset
- * @access private
- */
- function _applyDataset(&$dataset)
- {
- $newLabels = array();
- $allLabels = array();
-
- $dataset->_reset();
- $count = 0;
- $count_new = 0;
- while ($point = $dataset->_next()) {
- if ($this->_type == IMAGE_GRAPH_AXIS_X) {
- $data = $point['X'];
- } else {
- $data = $point['Y'];
- }
- if (!isset($this->_labels[$data])) {
- $newLabels[$data] = $count_new++;
- //$this->_labels[] = $data;
- }
- $allLabels[$data] = $count++;
- }
-
- if (count($this->_labels) == 0) {
- $this->_labels = $newLabels;
- } elseif ((is_array($newLabels)) && (count($newLabels) > 0)) {
- // get all intersecting labels
- $intersect = array_intersect(array_keys($allLabels), array_keys($this->_labels));
- // traverse all new and find their relative position withing the
- // intersec, fx value X0 is before X1 in the intersection, which
- // means that X0 should be placed before X1 in the label array
- foreach($newLabels as $newLabel => $id) {
- $key = $allLabels[$newLabel];
- reset($intersect);
- $this_value = false;
- // intersect indexes are the same as in allLabels!
- $first = true;
- while ((list($id, $value) = each($intersect)) &&
- ($this_value === false))
- {
- if (($first) && ($id > $key)) {
- $this_value = $value;
- } elseif ($id >= $key) {
- $this_value = $value;
- }
- $first = false;
- }
-
- if ($this_value === false) {
- // the new label was not found before anything in the
- // intersection -> append it
- $this->_labels[$newLabel] = count($this->_labels);
- } else {
- // the new label was found before $this_value in the
- // intersection, insert the label before this position in
- // the label array
-// $key = $this->_labels[$this_value];
- $keys = array_keys($this->_labels);
- $key = array_search($this_value, $keys);
- $pre = array_slice($keys, 0, $key);
- $pre[] = $newLabel;
- $post = array_slice($keys, $key);
- $this->_labels = array_flip(array_merge($pre, $post));
- }
- }
- unset($keys);
- }
-
- $labels = array_keys($this->_labels);
- $i = 0;
- foreach ($labels as $label) {
- $this->_labels[$label] = $i++;
- }
-
-// $this->_labels = array_values(array_unique($this->_labels));
- $this->_calcLabelInterval();
- }
-
- /**
- * Return the label distance.
- *
- * @return int The distance between 2 adjacent labels
- * @access private
- */
- function _labelDistance($level = 1)
- {
- reset($this->_labels);
- list($l1) = each($this->_labels);
- list($l2) = each($this->_labels);
- return abs($this->_point($l2) - $this->_point($l1));
- }
-
- /**
- * Get next label point
- *
- * @param doubt $point The current point, if omitted or false, the first is
- * returned
- * @return double The next label point
- * @access private
- */
- function _getNextLabel($currentLabel = false, $level = 1)
- {
- if ($currentLabel === false) {
- reset($this->_labels);
- }
- $result = false;
- $count = ($currentLabel === false ? $this->_labelInterval() - 1 : 0);
- while ($count < $this->_labelInterval()) {
- $result = (list($label) = each($this->_labels));
- $count++;
- }
- if ($result) {
- return $label;
- } else {
- return false;
- }
- }
-
- /**
- * Is the axis numeric or not?
- *
- * @return bool True if numeric, false if not
- * @access private
- */
- function _isNumeric()
- {
- return false;
- }
-
- /**
- * Output the axis
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- $result = true;
- if (Image_Graph_Element::_done() === false) {
- $result = false;
- }
-
- $this->_canvas->startGroup(get_class($this));
-
- $this->_drawAxisLines();
-
- $this->_canvas->startGroup(get_class($this) . '_ticks');
- $label = false;
- while (($label = $this->_getNextLabel($label)) !== false) {
- $this->_drawTick($label);
- }
- $this->_canvas->endGroup();
-
- $this->_canvas->endGroup();
-
- return $result;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Axis/Logarithmic.php b/config/archive/dspam/pear/Image/Graph/Axis/Logarithmic.php
deleted file mode 100644
index 2675ee4c..00000000
--- a/config/archive/dspam/pear/Image/Graph/Axis/Logarithmic.php
+++ /dev/null
@@ -1,152 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Class for axis handling.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Axis
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Axis.php
- */
-require_once 'Image/Graph/Axis.php';
-
-/**
- * Diplays a logarithmic axis (either X- or Y-axis).
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Axis
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Axis_Logarithmic extends Image_Graph_Axis
-{
-
- /**
- * Image_Graph_AxisLogarithmic [Constructor].
- *
- * Normally a manual creation should not be necessary, axis are
- * created automatically by the {@link Image_Graph_Plotarea} constructor
- * unless explicitly defined otherwise
- *
- * @param int $type The type (direction) of the Axis, use IMAGE_GRAPH_AXIS_X
- * for an X-axis (default, may be omitted) and IMAGE_GRAPH_AXIS_Y for Y-
- * axis)
- */
- function Image_Graph_Axis_Logarithmic($type = IMAGE_GRAPH_AXIS_X)
- {
- parent::Image_Graph_Axis($type);
- $this->showLabel(IMAGE_GRAPH_LABEL_MINIMUM + IMAGE_GRAPH_LABEL_MAXIMUM);
- $this->_minimum = 1;
- $this->_minimumSet = true;
- }
-
- /**
- * Calculate the label interval
- *
- * If explicitly defined this will be calucated to an approximate best.
- *
- * @return double The label interval
- * @access private
- */
- function _calcLabelInterval()
- {
- $result = parent::_calcLabelInterval();
- $this->_axisValueSpan = $this->_value($this->_axisSpan);
- return $result;
- }
-
- /**
- * Preprocessor for values, ie for using logarithmic axis
- *
- * @param double $value The value to preprocess
- * @return double The preprocessed value
- * @access private
- */
- function _value($value)
- {
- return log10($value) - log10($this->_minimum);
- }
-
- /**
- * Get next label point
- *
- * @param doubt $point The current point, if omitted or false, the first is
- * returned
- * @return double The next label point
- * @access private
- */
- function _getNextLabel($currentLabel = false, $level = 1)
- {
- if (is_array($this->_labelOptions[$level]['interval'])) {
- return parent::_getNextLabel($currentLabel, $level);
- }
-
- if ($currentLabel !== false) {
- $value = log10($currentLabel);
- $base = floor($value);
- $frac = $value - $base;
- for ($i = 2; $i < 10; $i++) {
- if ($frac <= (log10($i)-0.01)) {
- $label = pow(10, $base)*$i;
- if ($label > $this->_getMaximum()) {
- return false;
- } else {
- return $label;
- }
- }
- }
- return pow(10, $base+1);
- }
-
- return max(1, $this->_minimum);
- }
-
- /**
- * Get the axis intersection pixel position
- *
- * This is only to be called prior to output! I.e. between the user
- * invokation of Image_Graph::done() and any actual output is performed.
- * This is because it can change the axis range.
- *
- * @param double $value the intersection value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _intersectPoint($value)
- {
- if (($value <= 0) && ($value !== 'max') && ($value !== 'min')) {
- $value = 1;
- }
- return parent::_intersectPoint($value);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Axis/Marker/Area.php b/config/archive/dspam/pear/Image/Graph/Axis/Marker/Area.php
deleted file mode 100644
index 1931ab48..00000000
--- a/config/archive/dspam/pear/Image/Graph/Axis/Marker/Area.php
+++ /dev/null
@@ -1,156 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Class file containing a axis marker used for explicitly highlighting a area
- * on the graph, based on an interval specified on an axis.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Grid
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Grid.php
- */
-require_once 'Image/Graph/Grid.php';
-
-/**
- * Display a grid
- *
- * {@link Image_Graph_Grid}
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Grid
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Axis_Marker_Area extends Image_Graph_Grid
-{
-
- /**
- * The lower bound
- * @var double
- * @access private
- */
- var $_lower = false;
-
- /**
- * The upper bound
- * @var double
- * @access private
- */
- var $_upper = false;
-
- /**
- * [Constructor]
- */
- function Image_Graph_Axis_Marker_Area()
- {
- parent::Image_Graph_Grid();
- $this->_lineStyle = false;
- }
-
- /**
- * Sets the lower bound of the area (value on the axis)
- *
- * @param double $lower the lower bound
- */
- function setLowerBound($lower)
- {
- $this->_lower = $lower;
- }
-
- /**
- * Sets the upper bound of the area (value on the axis)
- *
- * @param double $upper the upper bound
- */
- function setUpperBound($upper)
- {
- $this->_upper = $upper;
- }
-
- /**
- * Output the grid
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- if (!$this->_primaryAxis) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this));
-
- $i = 0;
-
- $this->_lower = max($this->_primaryAxis->_getMinimum(), $this->_lower);
- $this->_upper = min($this->_primaryAxis->_getMaximum(), $this->_upper);
-
- $secondaryPoints = $this->_getSecondaryAxisPoints();
-
- reset($secondaryPoints);
- list ($id, $previousSecondaryValue) = each($secondaryPoints);
- while (list ($id, $secondaryValue) = each($secondaryPoints)) {
- if ($this->_primaryAxis->_type == IMAGE_GRAPH_AXIS_X) {
- $p1 = array ('Y' => $secondaryValue, 'X' => $this->_lower);
- $p2 = array ('Y' => $previousSecondaryValue, 'X' => $this->_lower);
- $p3 = array ('Y' => $previousSecondaryValue, 'X' => $this->_upper);
- $p4 = array ('Y' => $secondaryValue, 'X' => $this->_upper);
- } else {
- $p1 = array ('X' => $secondaryValue, 'Y' => $this->_lower);
- $p2 = array ('X' => $previousSecondaryValue, 'Y' => $this->_lower);
- $p3 = array ('X' => $previousSecondaryValue, 'Y' => $this->_upper);
- $p4 = array ('X' => $secondaryValue, 'Y' => $this->_upper);
- }
-
- $this->_canvas->addVertex(array('x' => $this->_pointX($p1), 'y' => $this->_pointY($p1)));
- $this->_canvas->addVertex(array('x' => $this->_pointX($p2), 'y' => $this->_pointY($p2)));
- $this->_canvas->addVertex(array('x' => $this->_pointX($p3), 'y' => $this->_pointY($p3)));
- $this->_canvas->addVertex(array('x' => $this->_pointX($p4), 'y' => $this->_pointY($p4)));
-
- $previousSecondaryValue = $secondaryValue;
-
- $this->_getLineStyle();
- $this->_getFillStyle();
- $this->_canvas->polygon(array('connect' => true));
- }
-
- $this->_canvas->endGroup();
-
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Axis/Marker/Line.php b/config/archive/dspam/pear/Image/Graph/Axis/Marker/Line.php
deleted file mode 100644
index 0c46c144..00000000
--- a/config/archive/dspam/pear/Image/Graph/Axis/Marker/Line.php
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Class file containing a axis marker used for explicitly highlighting a point
- * (line) on the graph, based on an value specified on an axis.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Grid
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Grid.php
- */
-require_once 'Image/Graph/Grid.php';
-
-/**
- * Display a grid
- *
- * {@link Image_Graph_Grid}
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Grid
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Axis_Marker_Line extends Image_Graph_Grid
-{
-
- /**
- * The value
- * @var double
- * @access private
- */
- var $_value = false;
-
- /**
- * Sets the value of the line marker (value on the axis)
- *
- * @param double $value the value
- */
- function setValue($value)
- {
- $this->_value = $value;
- }
-
- /**
- * Output the grid
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- if (!$this->_primaryAxis) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this));
-
- $i = 0;
-
- $this->_value = min($this->_primaryAxis->_getMaximum(), max($this->_primaryAxis->_getMinimum(), $this->_value));
-
- $secondaryPoints = $this->_getSecondaryAxisPoints();
-
- reset($secondaryPoints);
- list ($id, $previousSecondaryValue) = each($secondaryPoints);
- while (list ($id, $secondaryValue) = each($secondaryPoints)) {
- if ($this->_primaryAxis->_type == IMAGE_GRAPH_AXIS_X) {
- $p1 = array ('X' => $this->_value, 'Y' => $secondaryValue);
- $p2 = array ('X' => $this->_value, 'Y' => $previousSecondaryValue);
- } else {
- $p1 = array ('X' => $secondaryValue, 'Y' => $this->_value);
- $p2 = array ('X' => $previousSecondaryValue, 'Y' => $this->_value);
- }
-
- $x1 = $this->_pointX($p1);
- $y1 = $this->_pointY($p1);
- $x2 = $this->_pointX($p2);
- $y2 = $this->_pointY($p2);
-
- $previousSecondaryValue = $secondaryValue;
-
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $x1, 'y0' => $y1, 'x1' => $x2, 'y1' => $y2));
- }
-
- $this->_canvas->endGroup();
-
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Axis/Radar.php b/config/archive/dspam/pear/Image/Graph/Axis/Radar.php
deleted file mode 100644
index 7348254c..00000000
--- a/config/archive/dspam/pear/Image/Graph/Axis/Radar.php
+++ /dev/null
@@ -1,204 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Class for axis handling.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Axis
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Axis/Category.php
- */
-require_once 'Image/Graph/Axis/Category.php';
-
-/**
- * Displays an 'X'-axis in a radar plot chart.
- *
- * This axis maps the number of elements in the dataset to a angle (from 0-
- * 360 degrees). Displaying the axis consist of drawing a number of lines from
- * center to the edge of the 'circle' than encloses the radar plot. The labels
- * are drawn on the 'ends' of these radial lines.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Axis
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Axis_Radar extends Image_Graph_Axis_Category
-{
-
- /**
- * Specifies the number of pixels, the labels is offsetted from the end of
- * the axis
- *
- * @var int
- * @access private
- */
- var $_distanceFromEnd = 5;
-
- /**
- * Gets the minimum value the axis will show.
- *
- * This is always 0
- *
- * @return double The minumum value
- * @access private
- */
- function _getMinimum()
- {
- return 0;
- }
-
- /**
- * Gets the maximum value the axis will show.
- *
- * This is always the number of labels passed to the constructor.
- *
- * @return double The maximum value
- * @access private
- */
- function _getMaximum()
- {
- return count($this->_labels);
- }
-
- /**
- * Calculate the delta value (the number of pixels representing one unit
- * on the axis)
- *
- * @return double The label interval
- * @access private
- */
- function _calcDelta()
- {
- if (abs($this->_getMaximum() - $this->_getMinimum()) == 0) {
- $this->_delta = false;
- } else {
- $this->_delta = 360 / ($this->_getMaximum() - $this->_getMinimum());
- }
- }
-
- /**
- * Get the pixel position represented by a value on the canvas
- *
- * @param double $value the value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _point($value)
- {
- return (90 + (int) ($this->_value($value) * $this->_delta)) % 360;
- }
-
- /**
- * Get the size in pixels of the axis.
- *
- * For a radar plot this is always 0
- *
- * @return int The size of the axis
- * @access private
- */
- function _size()
- {
- return 0;
- }
-
- /**
- * Sets the distance from the end of the category lines to the label.
- *
- * @param int $distance The distance in pixels
- */
- function setDistanceFromEnd($distance = 5)
- {
- $this->_distanceFromEnd = $distance;
- }
-
- /**
- * Draws axis lines.
- *
- * @access private
- */
- function _drawAxisLines()
- {
- }
-
- /**
- * Output an axis tick mark.
- *
- * @param int $value The value to output
- * @access private
- */
- function _drawTick($value, $level = 1)
- {
- $centerX = (int) (($this->_left + $this->_right) / 2);
- $centerY = (int) (($this->_top + $this->_bottom) / 2);
-
- $radius = min($this->height(), $this->width()) / 2;
-
- $endPoint = array ('X' => $value, 'Y' => '#max#');
- $dX = $this->_pointX($endPoint);
- $dY = $this->_pointY($endPoint);
-
- $offX = ($dX - $centerX);
- $offY = ($dY - $centerY);
-
- $hyp = sqrt($offX*$offX + $offY*$offY);
- if ($hyp != 0) {
- $scale = $this->_distanceFromEnd / $hyp;
- } else {
- $scale = 1;
- }
-
- $adX = $dX + $offX * $scale;
- $adY = $dY + $offY * $scale;
-
- if (is_object($this->_dataPreProcessor)) {
- $labelText = $this->_dataPreProcessor->_process($value);
- } else {
- $labelText = $value;
- }
-
- if ((abs($dX - $centerX) < 1.5) && ($dY < $centerY)) {
- $align = IMAGE_GRAPH_ALIGN_BOTTOM + IMAGE_GRAPH_ALIGN_CENTER_X;
- } elseif ((abs($dX - $centerX) < 1.5) && ($dY > $centerY)) {
- $align = IMAGE_GRAPH_ALIGN_TOP + IMAGE_GRAPH_ALIGN_CENTER_X;
- } elseif ($dX < $centerX) {
- $align = IMAGE_GRAPH_ALIGN_RIGHT + IMAGE_GRAPH_ALIGN_CENTER_Y;
- } else {
- $align = IMAGE_GRAPH_ALIGN_LEFT + IMAGE_GRAPH_ALIGN_CENTER_Y;
- }
- $this->write($adX, $adY, $labelText, $align);
-
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $centerX, 'y0' => $centerY, 'x1' => $dX, 'y1' => $dY));
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Common.php b/config/archive/dspam/pear/Image/Graph/Common.php
deleted file mode 100644
index f695cb58..00000000
--- a/config/archive/dspam/pear/Image/Graph/Common.php
+++ /dev/null
@@ -1,313 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - Main class for the graph creation.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-if (!function_exists('is_a')) {
-
- /**
- * Check if an object is of a given class, this function is available as of PHP 4.2.0, so if it exist it will not be declared
- *
- * @link http://www.php.net/manual/en/function.is-a.php PHP.net Online Manual for function is_a()
- * @param object $object The object to check class for
- * @param string $class_name The name of the class to check the object for
- * @return bool Returns TRUE if the object is of this class or has this class as one of its parents
- */
- function is_a($object, $class_name)
- {
- if (empty ($object)) {
- return false;
- }
- $object = is_object($object) ? get_class($object) : $object;
- if (strtolower($object) == strtolower($class_name)) {
- return true;
- }
- return is_a(get_parent_class($object), $class_name);
- }
-}
-
-/**
- * Include file Image/Canvas.php
- */
-require_once 'Image/Canvas.php';
-
-/**
- * The ultimate ancestor of all Image_Graph classes.
- *
- * This class contains common functionality needed by all Image_Graph classes.
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @abstract
- */
-class Image_Graph_Common
-{
-
- /**
- * The parent container of the current Image_Graph object
- *
- * @var Image_Graph_Common
- * @access private
- */
- var $_parent = null;
-
- /**
- * The sub-elements of the current Image_Graph container object
- *
- * @var array
- * @access private
- */
- var $_elements;
-
- /**
- * The canvas for output.
- *
- * Enables support for multiple output formats.
- *
- * @var Image_Canvas
- * @access private
- */
- var $_canvas = null;
-
- /**
- * Is the object visible?
- *
- * @var bool
- * @access private
- */
- var $_visible = true;
-
- /**
- * Constructor [Image_Graph_Common]
- */
- function Image_Graph_Common()
- {
- }
-
- /**
- * Resets the elements
- *
- * @access private
- */
- function _reset()
- {
- if (is_array($this->_elements)) {
- $keys = array_keys($this->_elements);
- foreach ($keys as $key) {
- if (is_object($this->_elements[$key])) {
- $this->_elements[$key]->_setParent($this);
- $result =& $this->_elements[$key]->_reset();
- if (PEAR::isError($result)) {
- return $result;
- }
- }
- }
- unset($keys);
- }
- return true;
- }
-
- /**
- * Sets the parent. The parent chain should ultimately be a GraPHP object
- *
- * @see Image_Graph_Common
- * @param Image_Graph_Common $parent The parent
- * @access private
- */
- function _setParent(& $parent)
- {
- $this->_parent =& $parent;
- $this->_canvas =& $this->_parent->_getCanvas();
-
- if (is_array($this->_elements)) {
- $keys = array_keys($this->_elements);
- foreach ($keys as $key) {
- if (is_object($this->_elements[$key])) {
- $this->_elements[$key]->_setParent($this);
- }
- }
- unset($keys);
- }
- }
-
- /**
- * Hide the element
- */
- function hide()
- {
- $this->_visible = false;
- }
-
- /**
- * Get the canvas
- *
- * @return Image_Canvas The canvas
- * @access private
- */
- function &_getCanvas()
- {
- if (($this->_canvas !== null) || ($this->_canvas !== false)) {
- return $this->_canvas;
- } elseif (is_a($this->_parent, 'Image_Graph_Common')) {
- $this->_canvas =& $this->_parent->_getCanvas();
- return $this->_canvas;
- } else {
- $this->_error('Invalid canvas');
- $result = null;
- return $result;
- }
- }
-
- /**
- * Adds an element to the objects element list.
- *
- * The new Image_Graph_elements parent is automatically set.
- *
- * @param Image_Graph_Common $element The new Image_Graph_element
- * @return Image_Graph_Common The new Image_Graph_element
- */
- function &add(& $element)
- {
- if (!is_a($element, 'Image_Graph_Font')) {
- $this->_elements[] = &$element;
- }
- $element->_setParent($this);
- return $element;
- }
-
- /**
- * Creates an object from the class and adds it to the objects element list.
- *
- * Creates an object from the class specified and adds it to the objects
- * element list. If only one parameter is required for the constructor of
- * the class simply pass this parameter as the $params parameter, unless the
- * parameter is an array or a reference to a value, in that case you must
- * 'enclose' the parameter in an array. Similar if the constructor takes
- * more than one parameter specify the parameters in an array.
- *
- * @see Image_Graph::factory()
- * @param string $class The class for the object
- * @param mixed $params The paramaters to pass to the constructor
- * @return Image_Graph_Common The new Image_Graph_element
- */
- function &addNew($class, $params = null, $additional = false)
- {
- include_once 'Image/Graph.php';
- $element =& Image_Graph::factory($class, $params);
- if ($additional === false) {
- $obj =& $this->add($element);
- } else {
- $obj =& $this->add($element, $additional);
- }
- return $obj;
- }
-
- /**
- * Shows an error message box on the canvas
- *
- * @param string $text The error text
- * @param array $params An array containing error specific details
- * @param int $error_code Error code
- * @access private
- */
- function _error($text, $params = false, $error_code = IMAGE_GRAPH_ERROR_GENERIC)
- {
- if ((is_array($params)) && (count($params) > 0)) {
- foreach ($params as $name => $key) {
- if (isset($parameters)) {
- $parameters .= ' ';
- }
- else {
- $parameters = '';
- }
- $parameters .= $name . '=' . $key;
- }
- }
- $error =& PEAR::raiseError(
- $text .
- ($error_code != IMAGE_GRAPH_ERROR_GENERIC ? ' error:' . IMAGE_GRAPH_ERROR_GENERIC : '') .
- (isset($parameters) ? ' parameters:[' . $parameters . ']' : '')
- );
- }
-
- /**
- * Causes the object to update all sub elements coordinates
- *
- * (Image_Graph_Common, does not itself have coordinates, this is basically
- * an abstract method)
- *
- * @access private
- */
- function _updateCoords()
- {
- if (is_array($this->_elements)) {
- $keys = array_keys($this->_elements);
- foreach ($keys as $key) {
- if (is_object($this->_elements[$key])) {
- $this->_elements[$key]->_updateCoords();
- }
- }
- unset($keys);
- }
- return true;
- }
-
- /**
- * Causes output to canvas
- *
- * The last method to call. Calling Done causes output to the canvas. All
- * sub elements done() method will be invoked
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (($this->_canvas == null) || (!is_a($this->_canvas, 'Image_Canvas'))) {
- return false;
- }
-
- if (is_array($this->_elements)) {
- $keys = array_keys($this->_elements);
- foreach ($keys as $key) {
- if (($this->_elements[$key]->_visible) && ($this->_elements[$key]->_done() === false)) {
- return false;
- }
- }
- unset($keys);
- }
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Config.php b/config/archive/dspam/pear/Image/Graph/Config.php
deleted file mode 100644
index ece8a91b..00000000
--- a/config/archive/dspam/pear/Image/Graph/Config.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - Main class for the graph creation.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Constants.php b/config/archive/dspam/pear/Image/Graph/Constants.php
deleted file mode 100644
index f03674ba..00000000
--- a/config/archive/dspam/pear/Image/Graph/Constants.php
+++ /dev/null
@@ -1,225 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - Main class for the graph creation.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Font.php
- */
-require_once 'Image/Graph/Font.php';
-
-// Constant declarations
-
-/**
- * Defines an X (horizontal) axis
- */
-define('IMAGE_GRAPH_AXIS_X', 1);
-
-/**
- * Defines an Y (vertical) axis
- */
-define('IMAGE_GRAPH_AXIS_Y', 2);
-
-/**
- * Defines an Y (vertical) axis
- */
-define('IMAGE_GRAPH_AXIS_Y_SECONDARY', 3);
-
-/**
- * Defines an horizontal (X) axis
- */
-define('IMAGE_GRAPH_AXIS_HORIZONTAL', 1);
-
-/**
- * Defines an vertical (Y) axis
- */
-define('IMAGE_GRAPH_AXIS_VERTICAL', 2);
-
-/**
- * Define if label should be shown for axis minimum value
- */
-define('IMAGE_GRAPH_LABEL_MINIMUM', 1);
-
-/**
- * Define if label should be shown for axis 0 (zero) value
- */
-define('IMAGE_GRAPH_LABEL_ZERO', 2);
-
-/**
- * Define if label should be shown for axis maximum value
- */
-define('IMAGE_GRAPH_LABEL_MAXIMUM', 4);
-
-/**
- * Defines a horizontal gradient fill
- */
-define('IMAGE_GRAPH_GRAD_HORIZONTAL', 1);
-
-/**
- * Defines a vertical gradient fill
- */
-define('IMAGE_GRAPH_GRAD_VERTICAL', 2);
-
-/**
- * Defines a horizontally mirrored gradient fill
- */
-define('IMAGE_GRAPH_GRAD_HORIZONTAL_MIRRORED', 3);
-
-/**
- * Defines a vertically mirrored gradient fill
- */
-define('IMAGE_GRAPH_GRAD_VERTICAL_MIRRORED', 4);
-
-/**
- * Defines a diagonal gradient fill from top-left to bottom-right
- */
-define('IMAGE_GRAPH_GRAD_DIAGONALLY_TL_BR', 5);
-
-/**
- * Defines a diagonal gradient fill from bottom-left to top-right
- */
-define('IMAGE_GRAPH_GRAD_DIAGONALLY_BL_TR', 6);
-
-/**
- * Defines a radial gradient fill
- */
-define('IMAGE_GRAPH_GRAD_RADIAL', 7);
-
-/**
- * Defines the default builtin font
- */
-define('IMAGE_GRAPH_FONT', 1);
-
-/**
- * Defines a X value should be used
- */
-define('IMAGE_GRAPH_VALUE_X', 0);
-
-/**
- * Defines a Y value should be used
- */
-define('IMAGE_GRAPH_VALUE_Y', 1);
-
-/**
- * Defines a min X% value should be used
- */
-define('IMAGE_GRAPH_PCT_X_MIN', 2);
-
-/**
- * Defines a max X% value should be used
- */
-define('IMAGE_GRAPH_PCT_X_MAX', 3);
-
-/**
- * Defines a min Y% value should be used
- */
-define('IMAGE_GRAPH_PCT_Y_MIN', 4);
-
-/**
- * Defines a max Y% value should be used
- */
-define('IMAGE_GRAPH_PCT_Y_MAX', 5);
-
-/**
- * Defines a total Y% value should be used
- */
-define('IMAGE_GRAPH_PCT_Y_TOTAL', 6);
-
-/**
- * Defines a ID value should be used
- */
-define('IMAGE_GRAPH_POINT_ID', 7);
-
-/**
- * Align text left
- */
-define('IMAGE_GRAPH_ALIGN_LEFT', 0x1);
-
-/**
- * Align text right
- */
-define('IMAGE_GRAPH_ALIGN_RIGHT', 0x2);
-
-/**
- * Align text center x (horizontal)
- */
-define('IMAGE_GRAPH_ALIGN_CENTER_X', 0x4);
-
-/**
- * Align text top
- */
-define('IMAGE_GRAPH_ALIGN_TOP', 0x8);
-
-/**
- * Align text bottom
- */
-define('IMAGE_GRAPH_ALIGN_BOTTOM', 0x10);
-
-/**
- * Align text center y (vertical)
- */
-define('IMAGE_GRAPH_ALIGN_CENTER_Y', 0x20);
-
-/**
- * Align text center (both x and y)
- */
-define('IMAGE_GRAPH_ALIGN_CENTER', IMAGE_GRAPH_ALIGN_CENTER_X + IMAGE_GRAPH_ALIGN_CENTER_Y);
-
-/**
- * Align text top left
- */
-define('IMAGE_GRAPH_ALIGN_TOP_LEFT', IMAGE_GRAPH_ALIGN_TOP + IMAGE_GRAPH_ALIGN_LEFT);
-
-/**
- * Align text top right
- */
-define('IMAGE_GRAPH_ALIGN_TOP_RIGHT', IMAGE_GRAPH_ALIGN_TOP + IMAGE_GRAPH_ALIGN_RIGHT);
-
-/**
- * Align text bottom left
- */
-define('IMAGE_GRAPH_ALIGN_BOTTOM_LEFT', IMAGE_GRAPH_ALIGN_BOTTOM + IMAGE_GRAPH_ALIGN_LEFT);
-
-/**
- * Align text bottom right
- */
-define('IMAGE_GRAPH_ALIGN_BOTTOM_RIGHT', IMAGE_GRAPH_ALIGN_BOTTOM + IMAGE_GRAPH_ALIGN_RIGHT);
-
-/**
- * Align vertical
- */
-define('IMAGE_GRAPH_ALIGN_VERTICAL', IMAGE_GRAPH_ALIGN_TOP);
-
-/**
- * Align horizontal
- */
-define('IMAGE_GRAPH_ALIGN_HORIZONTAL', IMAGE_GRAPH_ALIGN_LEFT);
-
-// Error codes
-define('IMAGE_GRAPH_ERROR_GENERIC', 0);
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataPreprocessor.php b/config/archive/dspam/pear/Image/Graph/DataPreprocessor.php
deleted file mode 100644
index f135d539..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataPreprocessor.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Data preprocessor used for preformatting a data.
- *
- * A data preprocessor is used in cases where a value from a dataset or label must be
- * displayed in another format or way than entered. This could for example be the need
- * to display X-values as a date instead of 1, 2, 3, .. or even worse unix-timestamps.
- * It could also be when a {@link Image_Graph_Marker_Value} needs to display values as percentages
- * with 1 decimal digit instead of the default formatting (fx. 12.01271 -> 12.0%).
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @abstract
- */
-class Image_Graph_DataPreprocessor
-{
-
- /**
- * Image_Graph_DataPreprocessor [Constructor].
- */
- function Image_Graph_DataPreprocessor()
- {
- }
-
- /**
- * Process the value
- *
- * @param var $value The value to process/format
- * @return string The processed value
- * @access private
- */
- function _process($value)
- {
- return $value;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Array.php b/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Array.php
deleted file mode 100644
index 08e62378..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Array.php
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/DataPreprocessor.php
- */
-require_once 'Image/Graph/DataPreprocessor.php';
-
-/**
- * Format data as looked up in an array.
- *
- * ArrayData is useful when a numercal value is to be translated to
- * something thats cannot directly be calculated from this value, this could for
- * example be a dataset meant to plot population of various countries. Since x-
- * values are numerical and they should really be country names, but there is no
- * linear correlation between the number and the name, we use an array to 'map'
- * the numbers to the name, i.e. $array[0] = 'Denmark'; $array[1] = 'Sweden';
- * ..., where the indexes are the numerical values from the dataset. This is NOT
- * usefull when the x-values are a large domain, i.e. to map unix timestamps to
- * date-strings for an x-axis. This is because the x-axis will selecte arbitrary
- * values for labels, which would in principle require the ArrayData to hold
- * values for every unix timestamp. However ArrayData can still be used to solve
- * such a situation, since one can use another value for X-data in the dataset
- * and then map this (smaller domain) value to a date. That is we for example
- * instead of using the unix-timestamp we use value 0 to represent the 1st date,
- * 1 to represent the next date, etc.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_DataPreprocessor_Array extends Image_Graph_DataPreprocessor
-{
-
- /**
- * The data label array
- * @var array
- * @access private
- */
- var $_dataArray;
-
- /**
- * Image_Graph_ArrayData [Constructor].
- *
- * @param array $array The array to use as a lookup table
- */
- function Image_Graph_DataPreprocessor_Array($array)
- {
- parent::Image_Graph_DataPreprocessor();
- $this->_dataArray = $array;
- }
-
- /**
- * Process the value
- *
- * @param var $value The value to process/format
- * @return string The processed value
- * @access private
- */
- function _process($value)
- {
- if ((is_array($this->_dataArray)) && (isset ($this->_dataArray[$value]))) {
- return $this->_dataArray[$value];
- } else {
- return $value;
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Currency.php b/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Currency.php
deleted file mode 100644
index 2d3b5e2f..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Currency.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/DataPreprocessor/Formatted.php
- */
-require_once 'Image/Graph/DataPreprocessor/Formatted.php';
-
-/**
- * Format data as a currency.
- *
- * Uses the {@link Image_Graph_DataPreprocessor_Formatted} to represent the
- * values as a currency, i.e. 10 => € 10.00
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_DataPreprocessor_Currency extends Image_Graph_DataPreprocessor_Formatted
-{
-
- /**
- * Image_Graph_CurrencyData [Constructor].
- *
- * @param string $currencySymbol The symbol representing the currency
- */
- function Image_Graph_DataPreprocessor_Currency($currencySymbol)
- {
- parent::Image_Graph_DataPreprocessor_Formatted("$currencySymbol %0.2f");
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Date.php b/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Date.php
deleted file mode 100644
index 74695264..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Date.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/DataPreprocessor.php
- */
-require_once 'Image/Graph/DataPreprocessor.php';
-
-/**
- * Formats Unix timestamp as a date using specified format.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_DataPreprocessor_Date extends Image_Graph_DataPreprocessor
-{
-
- /**
- * The format of the Unix time stamp.
- * See <a href = 'http://www.php.net/manual/en/function.date.php'>PHP
- * Manual</a> for a description
- * @var string
- * @access private
- */
- var $_format;
-
- /**
- * Create a DateData preprocessor [Constructor]
- *
- * @param string $format See {@link http://www.php.net/manual/en/function.date.php
- * PHP Manual} for a description
- */
- function Image_Graph_DataPreprocessor_Date($format)
- {
- parent::Image_Graph_DataPreprocessor();
- $this->_format = $format;
- }
-
- /**
- * Process the value
- *
- * @param var $value The value to process/format
- * @return string The processed value
- * @access private
- */
- function _process($value)
- {
- if (!$value) {
- return false;
- } else {
- return date($this->_format, $value);
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Formatted.php b/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Formatted.php
deleted file mode 100644
index ff7335a0..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Formatted.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/DataPreprocessor.php
- */
-require_once 'Image/Graph/DataPreprocessor.php';
-
-/**
- * Format data using a (s)printf pattern.
- *
- * This method is useful when data must displayed using a simple (s) printf
- * pattern as described in the {@link http://www.php. net/manual/en/function.
- * sprintf.php PHP manual}
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_DataPreprocessor_Formatted extends Image_Graph_DataPreprocessor
-{
-
- /**
- * A (s)printf format string.
- * See {@link http://www.php.net/manual/en/function.sprintf.php PHP Manual}
- * for a description
- * @var string
- * @access private
- */
- var $_format;
-
- /**
- * Create a (s)printf format data preprocessor
- *
- * @param string $format See {@link http://www.php.net/manual/en/function.sprintf.php
- * PHP Manual} for a description
- */
- function Image_Graph_DataPreprocessor_Formatted($format)
- {
- parent::Image_Graph_DataPreprocessor();
- $this->_format = $format;
- }
-
- /**
- * Process the value
- *
- * @param var $value The value to process/format
- * @return string The processed value
- * @access private
- */
- function _process($value)
- {
- return sprintf($this->_format, $value);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Function.php b/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Function.php
deleted file mode 100644
index b23a718d..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Function.php
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/DataPreprocessor.php
- */
-require_once 'Image/Graph/DataPreprocessor.php';
-
-/**
- * Formatting a value using a userdefined function.
- *
- * Use this method to convert/format a value to a 'displayable' lable using a (perhaps)
- * more complex function. An example could be (not very applicable though) if one would
- * need for values to be displayed on the reverse order, i.e. 1234 would be displayed as
- * 4321, then this method can solve this by creating the function that converts the value
- * and use the FunctionData datapreprocessor to make Image_Graph use this function.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_DataPreprocessor_Function extends Image_Graph_DataPreprocessor
-{
-
- /**
- * The name of the PHP function
- * @var string
- * @access private
- */
- var $_dataFunction;
-
- /**
- * Create a FunctionData preprocessor
- *
- * @param string $function The name of the PHP function to use as
- * a preprocessor, this function must take a single parameter and return a
- * formatted version of this parameter
- */
- function Image_Graph_DataPreprocessor_Function($function)
- {
- parent::Image_Graph_DataPreprocessor();
- $this->_dataFunction = $function;
- }
-
- /**
- * Process the value
- *
- * @param var $value The value to process/format
- * @return string The processed value
- * @access private
- */
- function _process($value)
- {
- $function = $this->_dataFunction;
- return call_user_func($function, $value);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/NumberText.php b/config/archive/dspam/pear/Image/Graph/DataPreprocessor/NumberText.php
deleted file mode 100644
index a7d6874e..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/NumberText.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/DataPreprocessor.php
- */
-require_once 'Image/Graph/DataPreprocessor.php';
-
-/**
- * Formatting a number as its written in languages supported by Numbers_Words.
- *
- * Used to display values as text, i.e. 123 is displayed as one hundred and twenty three.
- * Requires Numbers_Words
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_DataPreprocessor_NumberText extends Image_Graph_DataPreprocessor
-{
-
- /**
- * The language identifier
- * @var string
- * @access private
- */
- var $_language;
-
- /**
- * Image_Graph_NumberText [Constructor].
- *
- * Supported languages see {@link http://pear.php.net/package/Numbers_Words Numbers_Words}
- *
- * @param string $langugage The language identifier for the language.
- */
- function Image_Graph_DataPreprocessor_NumberText($language = 'en_US')
- {
- parent::Image_Graph_DataPreprocessor();
- $this->_language = $language;
- require_once 'Numbers/Words.php';
- }
-
- /**
- * Process the value
- *
- * @param var $value The value to process/format
- * @return string The processed value
- * @access private
- */
- function _process($value)
- {
- return Numbers_Words::toWords($value, $this->_language);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/RomanNumerals.php b/config/archive/dspam/pear/Image/Graph/DataPreprocessor/RomanNumerals.php
deleted file mode 100644
index 0bfcdb62..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/RomanNumerals.php
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/DataPreprocessor.php
- */
-require_once 'Image/Graph/DataPreprocessor.php';
-
-/**
- * Formatting a value as a roman numerals.
- *
- * Values are formatted as roman numeral, i.e. 1 = I, 2 = II, 9 = IX, 2004 = MMIV.
- * Requires Numbers_Roman
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_DataPreprocessor_RomanNumerals extends Image_Graph_DataPreprocessor
-{
-
- /**
- * Create a RomanNumerals preprocessor
- *
- * See {@link http://pear.php.net/package/Numbers_Roman Numbers_Roman}
- */
- function Image_Graph_DataPreprocessor_RomanNumerals()
- {
- parent::Image_Graph_DataPreprocessor();
- include_once 'Numbers/Roman.php';
- }
-
- /**
- * Process the value
- *
- * @param var $value The value to process/format
- * @return string The processed value
- * @access private
- */
- function _process($value)
- {
- return Numbers_Roman::toNumeral($value);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Sequential.php b/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Sequential.php
deleted file mode 100644
index 248f0be9..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataPreprocessor/Sequential.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/DataPreprocessor/Array.php
- */
-require_once 'Image/Graph/DataPreprocessor/Array.php';
-
-/**
- * Formatting values using a sequential data label array, ie. returning the
- * 'next label' when asked for any label.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataPreprocessor
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_DataPreprocessor_Sequential extends Image_Graph_DataPreprocessor_Array
-{
-
- /**
- * Process the value
- *
- * @param var $value The value to process/format
- * @return string The processed value
- * @access private
- */
- function _process($value)
- {
- list ($id, $value) = each($this->_dataArray);
- return $value;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataSelector.php b/config/archive/dspam/pear/Image/Graph/DataSelector.php
deleted file mode 100644
index 0a81716c..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataSelector.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataSelector
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Filter used for selecting which data to show as markers
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataSelector
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_DataSelector
-{
-
- /**
- * Image_Graph_DataSelector [Constructor]
- */
- function Image_Graph_DataSelector()
- {
- }
-
- /**
- * Check if a specified value should be 'selected', ie shown as a marker
- *
- * @param array $values The values to check
- * @return bool True if the Values should cause a marker to be shown, false if not
- * @access private
- */
- function _select($values)
- {
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataSelector/EveryNthPoint.php b/config/archive/dspam/pear/Image/Graph/DataSelector/EveryNthPoint.php
deleted file mode 100644
index 62581222..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataSelector/EveryNthPoint.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataSelector
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/DataSelector.php
- */
-require_once 'Image/Graph/DataSelector.php';
-
-/**
- * Filter out all points except every Nth point.
- *
- * Use this dataselector if you have a large number of datapoints, but only want to
- * show markers for a small number of them, say every 10th.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataSelector
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_DataSelector_EveryNthPoint extends Image_Graph_DataSelector
-{
-
- /**
- * The number of points checked
- * @var int
- * @access private
- */
- var $_pointNum = 0;
-
- /**
- * The number of points between every 'show', default: 10
- * @var int
- * @access private
- */
- var $_pointInterval = 10;
-
- /**
- * EvertNthPoint [Constructor]
- *
- * @param int $pointInterval The number of points between every 'show',
- * default: 10
- */
- function Image_Graph_DataSelector_EveryNthpoint($pointInterval = 10)
- {
- parent::Image_Graph_DataSelector();
- $this->_pointInterval = $pointInterval;
- }
-
- /**
- * Check if a specified value should be 'selected', ie shown as a marker
- *
- * @param array $values The values to check
- * @return bool True if the Values should cause a marker to be shown,
- * false if not
- * @access private
- */
- function _select($values)
- {
- $oldPointNum = $this->_pointNum;
- $this->_pointNum++;
- return (($oldPointNum % $this->_pointInterval) == 0);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataSelector/NoZeros.php b/config/archive/dspam/pear/Image/Graph/DataSelector/NoZeros.php
deleted file mode 100644
index f32b918e..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataSelector/NoZeros.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataSelector
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/DataSelector.php
- */
-require_once 'Image/Graph/DataSelector.php';
-
-/**
- * Filter out all zero's.
- *
- * Display all Y-values as markers, except those with Y = 0
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataSelector
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_DataSelector_NoZeros extends Image_Graph_DataSelector
-{
-
- /**
- * Check if a specified value should be 'selected', ie shown as a marker
- *
- * @param array $values The values to check
- * @return bool True if the Values should cause a marker to be shown, false
- * if not
- * @access private
- */
- function _select($values)
- {
- return ($values['Y'] != 0);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/DataSelector/Values.php b/config/archive/dspam/pear/Image/Graph/DataSelector/Values.php
deleted file mode 100644
index 412e6ea9..00000000
--- a/config/archive/dspam/pear/Image/Graph/DataSelector/Values.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataSelector
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/DataSelector.php
- */
-require_once 'Image/Graph/DataSelector.php';
-
-/**
- * Filter out all but the specified values.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage DataSelector
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_DataSelector_Values extends Image_Graph_DataSelector {
-
- /**
- * The array with values that should be included
- * @var array
- * @access private
- */
- var $_values;
-
- /**
- * ValueArray [Constructor]
- *
- * @param array $valueArray The array to use as filter (default empty)
- */
- function &Image_Graph_DataSelector_Values($values)
- {
- parent::Image_Graph_DataSelector();
- $this->_values = $values;
- }
-
- /**
- * Sets the array to use
- */
- function setValueArray($values)
- {
- $this->_values = $values;
- }
-
- /**
- * Check if a specified value should be 'selected', ie shown as a marker
- *
- * @param array $values The values to check
- * @return bool True if the Values should cause a marker to be shown, false
- * if not
- * @access private
- */
- function _select($values)
- {
- return ( in_array($values['Y'], $this->_values) );
- }
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Dataset.php b/config/archive/dspam/pear/Image/Graph/Dataset.php
deleted file mode 100644
index 4c349980..00000000
--- a/config/archive/dspam/pear/Image/Graph/Dataset.php
+++ /dev/null
@@ -1,483 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Dataset
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-
-/**
- * Data set used to represent a data collection to plot in a chart
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Dataset
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @abstract
- */
-class Image_Graph_Dataset
-{
-
- /**
- * The pointer of the data set
- * @var int
- * @access private
- */
- var $_posX = 0;
-
- /**
- * The minimum X value of the dataset
- * @var int
- * @access private
- */
- var $_minimumX = 0;
-
- /**
- * The maximum X value of the dataset
- * @var int
- * @access private
- */
- var $_maximumX = 0;
-
- /**
- * The minimum Y value of the dataset
- * @var int
- * @access private
- */
- var $_minimumY = 0;
-
- /**
- * The maximum Y value of the dataset
- * @var int
- * @access private
- */
- var $_maximumY = 0;
-
- /**
- * The number of points in the dataset
- * @var int
- * @access private
- */
- var $_count = 0;
-
- /**
- * The name of the dataset, used for legending
- * @var string
- * @access private
- */
- var $_name = '';
-
- /**
- * Image_Graph_Dataset [Constructor]
- */
- function Image_Graph_Dataset()
- {
- }
-
- /**
- * Sets the name of the data set, used for legending
- *
- * @param string $name The name of the dataset
- */
- function setName($name)
- {
- $this->_name = $name;
- }
-
- /**
- * Add a point to the dataset
- *
- * $ID can contain either the ID of the point, i.e. 'DK', 123, 'George', etc. or it can contain
- * values used for creation of the HTML image map. This is achieved using is an an associated array
- * with the following values:
- *
- * 'url' The URL to create the link to
- *
- * 'alt' [optional] The alt text on the link
- *
- * 'target' [optional] The target of the link
- *
- * 'htmltags' [optional] An associated array with html tags (tag as key), fx. 'onMouseOver' => 'history.go(-1);', 'id' => 'thelink'
- *
- * @param int $x The X value to add
- * @param int $y The Y value to add, can be omited
- * @param var $ID The ID of the point
- */
- function addPoint($x, $y = false, $ID = false)
- {
- if ($y !== null) {
- if (is_array($y)) {
- $maxY = max($y);
- $minY = min($y);
- } else {
- $maxY = $y;
- $minY = $y;
- }
- }
-
- if ($this->_count) {
- $this->_minimumX = min($x, $this->_minimumX);
- $this->_maximumX = max($x, $this->_maximumX);
- if ($y !== null) {
- $this->_minimumY = min($minY, $this->_minimumY);
- $this->_maximumY = max($maxY, $this->_maximumY);
- }
- } else {
- $this->_minimumX = $x;
- $this->_maximumX = $x;
- if ($y !== null) {
- $this->_minimumY = $minY;
- $this->_maximumY = $maxY;
- }
- }
-
- $this->_count++;
- }
-
- /**
- * The number of values in the dataset
- *
- * @return int The number of values in the dataset
- */
- function count()
- {
- return $this->_count;
- }
-
- /**
- * Gets a X point from the dataset
- *
- * @param var $x The variable to return an X value from, fx in a vector
- * function data set
- * @return var The X value of the variable
- * @access private
- */
- function _getPointX($x)
- {
- return $x;
- }
-
- /**
- * Gets a Y point from the dataset
- *
- * @param var $x The variable to return an Y value from, fx in a vector
- * function data set
- * @return var The Y value of the variable
- * @access private
- */
- function _getPointY($x)
- {
- return $x;
- }
-
- /**
- * Gets a ID from the dataset
- *
- * @param var $x The variable to return an Y value from, fx in a vector
- * function data set
- * @return var The ID value of the variable
- * @access private
- */
- function _getPointID($x)
- {
- return false;
- }
-
- /**
- * Gets point data from the dataset
- *
- * @param var $x The variable to return an Y value from, fx in a vector
- * function data set
- * @return array The data for the point
- * @access private
- */
- function _getPointData($x)
- {
- return false;
- }
-
- /**
- * The minimum X value
- *
- * @return var The minimum X value
- */
- function minimumX()
- {
- return $this->_minimumX;
- }
-
- /**
- * The maximum X value
- *
- * @return var The maximum X value
- */
- function maximumX()
- {
- return $this->_maximumX;
- }
-
- /**
- * The minimum Y value
- *
- * @return var The minimum Y value
- */
- function minimumY()
- {
- return $this->_minimumY;
- }
-
- /**
- * The maximum Y value
- *
- * @return var The maximum Y value
- */
- function maximumY()
- {
- return $this->_maximumY;
- }
-
- /**
- * The first point
- *
- * @return array The last point
- */
- function first()
- {
- return array('X' => $this->minimumX(), 'Y' => $this->minimumY());
- }
-
- /**
- * The last point
- *
- * @return array The first point
- */
- function last()
- {
- return array('X' => $this->maximumX(), 'Y' => $this->maximumY());
- }
-
- /**
- * The minimum X value
- *
- * @param var $value The minimum X value
- * @access private
- */
- function _setMinimumX($value)
- {
- $this->_minimumX = $value;
- }
-
- /**
- * The maximum X value
- *
- * @param var $value The maximum X value
- * @access private
- */
- function _setMaximumX($value)
- {
- $this->_maximumX = $value;
- }
-
- /**
- * The minimum Y value
- *
- * @param var $value The minimum X value
- * @access private
- */
- function _setMinimumY($value)
- {
- $this->_minimumY = $value;
- }
-
- /**
- * The maximum Y value
- *
- * @param var $value The maximum X value
- * @access private
- */
- function _setMaximumY($value)
- {
- $this->_maximumY = $value;
- }
-
- /**
- * The interval between 2 adjacent X values
- *
- * @return var The interval
- * @access private
- */
- function _stepX()
- {
- return 1;
- }
-
- /**
- * The interval between 2 adjacent Y values
- *
- * @return var The interval
- * @access private
- */
- function _stepY()
- {
- return 1;
- }
-
- /**
- * Reset the intertal dataset pointer
- *
- * @return var The first X value
- * @access private
- */
- function _reset()
- {
- $this->_posX = $this->_minimumX;
- return $this->_posX;
- }
-
- /**
- * Get a point close to the internal pointer
- *
- * @param int Step Number of points next to the internal pointer, negative
- * Step is towards lower X values, positive towards higher X values
- * @return array The point
- * @access private
- */
- function _nearby($step = 0)
- {
- $x = $this->_getPointX($this->_posX + $this->_stepX() * $step);
- $y = $this->_getPointY($this->_posX + $this->_stepX() * $step);
- $ID = $this->_getPointID($this->_posX + $this->_stepX() * $step);
- $data = $this->_getPointData($this->_posX + $this->_stepX() * $step);
- if (($x === false) || ($y === false)) {
- return false;
- } else {
- return array ('X' => $x, 'Y' => $y, 'ID' => $ID, 'data' => $data);
- }
- }
-
- /**
- * Get the next point the internal pointer refers to and advance the pointer
- *
- * @return array The next point
- * @access private
- */
- function _next()
- {
- if ($this->_posX > $this->_maximumX) {
- return false;
- }
-
- $x = $this->_getPointX($this->_posX);
- $y = $this->_getPointY($this->_posX);
- $ID = $this->_getPointID($this->_posX);
- $data = $this->_getPointData($this->_posX);
- $this->_posX += $this->_stepX();
-
- return array ('X' => $x, 'Y' => $y, 'ID' => $ID, 'data' => $data);
- }
-
- /**
- * Get the average of the dataset's Y points
- *
- * @return var The Y-average across the dataset
- * @access private
- */
- function _averageY()
- {
- $posX = $this->_minimumX;
- $count = 0;
- $total = 0;
- while ($posX < $this->_maximumX) {
- $count ++;
- $total += $this->_getPointY($posX);
- $posX += $this->_stepX();
- }
-
- if ($count != 0) {
- return $total / $count;
- } else {
- return false;
- }
- }
-
- /**
- * Get the median of the array passed Y points
- *
- * @param array $data The data-array to get the median from
- * @param int $quartile The quartile to return the median from
- * @return var The Y-median across the dataset from the specified quartile
- * @access private
- */
- function _median($data, $quartile = 'second')
- {
- sort($data);
- $point = (count($data) - 1) / 2;
-
- if ($quartile == 'first') {
- $lowPoint = 0;
- $highPoint = floor($point);
- } elseif ($quartile == 'third') {
- $lowPoint = round($point);
- $highPoint = count($data) - 1;
- } else {
- $lowPoint = 0;
- $highPoint = count($data) - 1;
- }
-
- $point = ($lowPoint + $highPoint) / 2;
-
- if (floor($point) != $point) {
- $point = floor($point);
- return ($data[$point] + $data[($point + 1)]) / 2;
- } else {
- return $data[$point];
- }
- }
-
- /**
- * Get the median of the datasets Y points
- *
- * @param int $quartile The quartile to return the median from
- * @return var The Y-median across the dataset from the specified quartile
- * @access private
- */
- function _medianY($quartile = 'second')
- {
- $pointsY = array();
- $posX = $this->_minimumX;
- while ($posX <= $this->_maximumX) {
- $pointsY[] = $this->_getPointY($posX);
- $posX += $this->_stepX();
- }
- return $this->_median($pointsY, $quartile);
- }
-
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Dataset/Function.php b/config/archive/dspam/pear/Image/Graph/Dataset/Function.php
deleted file mode 100644
index 08174b1d..00000000
--- a/config/archive/dspam/pear/Image/Graph/Dataset/Function.php
+++ /dev/null
@@ -1,147 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Dataset
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Dataset.php
- */
-require_once 'Image/Graph/Dataset.php';
-
-/**
- * Function data set, points are generated by calling an external function.
- *
- * The function must be a single variable function and return a the result,
- * builtin functions that are fx sin() or cos(). User defined function can be
- * used if they are such, i.e: function myFunction($variable)
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Dataset
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Dataset_Function extends Image_Graph_Dataset
-{
-
- /**
- * The name of the function
- * @var string
- * @access private
- */
- var $_dataFunction;
-
- /**
- * Image_Graph_FunctionDataset [Constructor]
- *
- * @param double $minimumX The minimum X value
- * @param double $maximumX The maximum X value
- * @param string $function The name of the function, if must be a single
- * parameter function like fx sin(x) or cos(x)
- * @param int $points The number of points to create
- */
- function Image_Graph_Dataset_Function($minimumX, $maximumX, $function, $points)
- {
- parent::Image_Graph_Dataset();
- $this->_minimumX = $minimumX;
- $this->_maximumX = $maximumX;
- $this->_dataFunction = $function;
- $this->_count = $points;
- $this->_calculateMaxima();
- }
-
- /**
- * Add a point to the dataset.
- *
- * You can't add points to a function dataset
- *
- * @param int $x The X value to add
- * @param int $y The Y value to add, can be omited
- * @param var $ID The ID of the point
- */
- function addPoint($x, $y = false, $ID = false)
- {
- }
-
- /**
- * Gets a Y point from the dataset
- *
- * @param var $x The variable to apply the function to
- * @return var The function applied to the X value
- * @access private
- */
- function _getPointY($x)
- {
- $function = $this->_dataFunction;
- return $function ($x);
- }
-
- /**
- * The number of values in the dataset
- *
- * @return int The number of values in the dataset
- * @access private
- */
- function _count()
- {
- return $this->_count;
- }
-
- /**
- * The interval between 2 adjacent Y values
- *
- * @return var The interval
- * @access private
- */
- function _stepX()
- {
- return ($this->_maximumX - $this->_minimumX) / $this->_count();
- }
-
- /**
- * Calculates the Y extrema of the function
- *
- * @access private
- */
- function _calculateMaxima()
- {
- $x = $this->_minimumX;
- while ($x <= $this->_maximumX) {
- $y = $this->_getPointY($x);
- $this->_minimumY = min($y, $this->_minimumY);
- $this->_maximumY = max($y, $this->_maximumY);
- $x += $this->_stepX();
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Dataset/Random.php b/config/archive/dspam/pear/Image/Graph/Dataset/Random.php
deleted file mode 100644
index 0b2d7c68..00000000
--- a/config/archive/dspam/pear/Image/Graph/Dataset/Random.php
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Dataset
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Dataset/Trivial.php
- */
-require_once 'Image/Graph/Dataset/Trivial.php';
-
-/**
- * Random data set, points are generated by random.
- *
- * This dataset is mostly (if not solely) used for demo-purposes.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Dataset
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Dataset_Random extends Image_Graph_Dataset_Trivial
-{
-
- /**
- * RandomDataset [Constructor]
- *
- * @param int $count The number of points to create
- * @param double $minimum The minimum value the random set can be
- * @param double $maximum The maximum value the random set can be
- * @param bool $includeZero Whether 0 should be included or not as an X
- * value, may be omitted, default: false</false>
- */
- function Image_Graph_Dataset_Random($count, $minimum, $maximum, $includeZero = false)
- {
- parent::Image_Graph_Dataset_Trivial();
- $i = 0;
- while ($i < $count) {
- $this->addPoint(
- $ixc = ($includeZero ? $i : $i +1),
- rand($minimum, $maximum)
- );
- $i ++;
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Dataset/Sequential.php b/config/archive/dspam/pear/Image/Graph/Dataset/Sequential.php
deleted file mode 100644
index 2605c409..00000000
--- a/config/archive/dspam/pear/Image/Graph/Dataset/Sequential.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Dataset
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Dataset/Trivial.php
- */
-require_once 'Image/Graph/Dataset/Trivial.php';
-
-/**
- * Sequential data set, simply add points (y) 1 by 1.
- *
- * This is a single point (1D) dataset, all points are of the type (0, y1), (1,
- * y2), (2, y3)... Where the X-value is implicitly incremented. This is useful
- * for example for barcharts, where you could fx. use an {@link
- * Image_Graph_Dataset_Array} datapreprocessor to make sence of the x-values.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Dataset
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Dataset_Sequential extends Image_Graph_Dataset_Trivial
-{
-
- /**
- * Image_Graph_SequentialDataset [Constructor]
- */
- function Image_Graph_Dataset_Sequential($dataArray = false)
- {
- parent::Image_Graph_Dataset_Trivial();
- if (is_array($dataArray)) {
- reset($dataArray);
- foreach ($dataArray as $value) {
- $this->addPoint($value);
- }
- }
- }
-
- /**
- * Add a point to the dataset
- *
- * @param int $y The Y value to add, can be omited
- * @param var $ID The ID of the point
- */
- function addPoint($y, $ID = false)
- {
- parent::addPoint($this->count(), $y);
- }
-
- /**
- * Gets a X point from the dataset
- *
- * @param var $x The variable to return an X value from, fx in a
- * vector function data set
- * @return var The X value of the variable
- * @access private
- */
- function _getPointX($x)
- {
- return ((int) $x);
- }
-
- /**
- * The minimum X value
- * @return var The minimum X value
- */
- function minimumX()
- {
- return 0;
- }
-
- /**
- * The maximum X value
- * @return var The maximum X value
- */
- function maximumX()
- {
- return $this->count();
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Dataset/Trivial.php b/config/archive/dspam/pear/Image/Graph/Dataset/Trivial.php
deleted file mode 100644
index 84af1c4b..00000000
--- a/config/archive/dspam/pear/Image/Graph/Dataset/Trivial.php
+++ /dev/null
@@ -1,260 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Dataset
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Dataset.php
- */
-require_once 'Image/Graph/Dataset.php';
-
-/**
- * Trivial data set, simply add points (x, y) 1 by 1
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Dataset
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Dataset_Trivial extends Image_Graph_Dataset
-{
-
- /**
- * Data storage
- * @var array
- * @access private
- */
- var $_data;
-
- /**
- * Image_Graph_Dataset_Trivial [Constructor]
- *
- * Pass an associated array ($data[$x] = $y) to the constructor for easy
- * data addition. Alternatively (if multiple entries with same x value is
- * required) pass an array with (x, y) values: $data[$id] = array('x' => $x,
- * 'y' => $y);
- *
- * NB! If passing the 1st type array at this point, the x-values will also
- * be used for ID tags, i.e. when using {@link Image_Graph_Fill_Array}. In
- * the 2nd type the key/index of the "outermost" array will be the id tag
- * (i.e. $id in the example)
- *
- * @param array $dataArray An associated array with values to the dataset
- */
- function Image_Graph_Dataset_Trivial($dataArray = false)
- {
- parent::Image_Graph_Dataset();
- $this->_data = array ();
- if (is_array($dataArray)) {
- reset($dataArray);
- $keys = array_keys($dataArray);
- foreach ($keys as $x) {
- $y =& $dataArray[$x];
- if ((is_array($y)) && (isset($y['x'])) && (isset($y['y']))) {
- $this->addPoint($y['x'], $y['y'], (isset($y['id']) ? $y['id'] : $x));
- } else {
- $this->addPoint($x, $y, $x);
- }
- }
- }
- }
-
- /**
- * Add a point to the dataset
- *
- * $ID can contain either the ID of the point, i.e. 'DK', 123, 'George', etc. or it can contain
- * values used for creation of the HTML image map. This is achieved using is an an associated array
- * with the following values:
- *
- * 'url' The URL to create the link to
- *
- * 'alt' [optional] The alt text on the link
- *
- * 'target' [optional] The target of the link
- *
- * 'htmltags' [optional] An associated array with html tags (tag as key), fx. 'onMouseOver' => 'history.go(-1);', 'id' => 'thelink'
- *
- * @param int $x The X value to add
- * @param int $y The Y value to add, can be omited
- * @param var $ID The ID of the point
- */
- function addPoint($x, $y = false, $ID = false)
- {
- parent::addPoint($x, $y, $ID);
-
- if (is_array($ID)) {
- $data = $ID;
- $ID = (isset($data['id']) ? $data['id'] : false);
- } else {
- $data = false;
- }
-
- $this->_data[] = array ('X' => $x, 'Y' => $y, 'ID' => $ID, 'data' => $data);
- if (!is_numeric($x)) {
- $this->_maximumX = count($this->_data);
- }
- }
-
- /**
- * The first point
- *
- * @return array The last point
- */
- function first()
- {
- reset($this->_data);
- return current($this->_data);
- }
-
- /**
- * The last point
- *
- * @return array The first point
- */
- function last()
- {
- return end($this->_data);
- }
-
- /**
- * Gets a X point from the dataset
- *
- * @param var $x The variable to return an X value from, fx in a
- * vector function data set
- * @return var The X value of the variable
- * @access private
- */
- function _getPointX($x)
- {
- if (isset($this->_data[$x])) {
- return $this->_data[$x]['X'];
- } else {
- return false;
- }
- }
-
- /**
- * Gets a Y point from the dataset
- *
- * @param var $x The variable to return an Y value from, fx in a
- * vector function data set
- * @return var The Y value of the variable
- * @access private
- */
- function _getPointY($x)
- {
- if (isset($this->_data[$x])) {
- return $this->_data[$x]['Y'];
- } else {
- return false;
- }
- }
-
- /**
- * Gets a ID from the dataset
- *
- * @param var $x The variable to return an Y value from, fx in a
- * vector function data set
- * @return var The ID value of the variable
- * @access private
- */
- function _getPointID($x)
- {
- if (isset($this->_data[$x])) {
- return $this->_data[$x]['ID'];
- } else {
- return false;
- }
- }
-
- /**
- * Gets point data from the dataset
- *
- * @param var $x The variable to return an Y value from, fx in a vector
- * function data set
- * @return array The data for the point
- * @access private
- */
- function _getPointData($x)
- {
- if (isset($this->_data[$x])) {
- return $this->_data[$x]['data'];
- } else {
- return false;
- }
- }
-
- /**
- * The number of values in the dataset
- *
- * @return int The number of values in the dataset
- */
- function count()
- {
- return count($this->_data);
- }
-
- /**
- * Reset the intertal dataset pointer
- *
- * @return var The first X value
- * @access private
- */
- function _reset()
- {
- $this->_posX = 0;
- return $this->_posX;
- }
-
- /**
- * Get the next point the internal pointer refers to and advance the pointer
- *
- * @return array The next point
- * @access private
- */
- function _next()
- {
- if ($this->_posX >= $this->count()) {
- return false;
- }
- $x = $this->_getPointX($this->_posX);
- $y = $this->_getPointY($this->_posX);
- $ID = $this->_getPointID($this->_posX);
- $data = $this->_getPointData($this->_posX);
- $this->_posX += $this->_stepX();
-
- return array('X' => $x, 'Y' => $y, 'ID' => $ID, 'data' => $data);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Dataset/VectorFunction.php b/config/archive/dspam/pear/Image/Graph/Dataset/VectorFunction.php
deleted file mode 100644
index 4250bbc0..00000000
--- a/config/archive/dspam/pear/Image/Graph/Dataset/VectorFunction.php
+++ /dev/null
@@ -1,185 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Dataset
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Dataset.php
- */
-require_once 'Image/Graph/Dataset.php';
-
-/**
- * Vector Function data set.
- *
- * Points are generated by calling 2 external functions, fx. x = sin(t) and y =
- * cos(t)
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Dataset
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Dataset_VectorFunction extends Image_Graph_Dataset
-{
-
- /**
- * The name of the X function
- * @var string
- * @access private
- */
- var $_functionX;
-
- /**
- * The name of the Y function
- * @var string
- * @access private
- */
- var $_functionY;
-
- /**
- * The minimum of the vector function variable
- * @var double
- * @access private
- */
- var $_minimumT;
-
- /**
- * The maximum of the vector function variable
- * @var double
- * @access private
- */
- var $_maximumT;
-
- /**
- * Image_Graph_VectorFunctionDataset [Constructor]
- *
- * @param double $minimumT The minimum value of the vector function variable
- * @param double $maximumT The maximum value of the vector function variable
- * @param string $functionX The name of the X function, if must be a single
- * parameter function like fx sin(x) or cos(x)
- * @param string $functionY The name of the Y function, if must be a single
- * parameter function like fx sin(x) or cos(x)
- * @param int $points The number of points to create
- */
- function Image_Graph_Dataset_VectorFunction($minimumT, $maximumT, $functionX, $functionY, $points)
- {
- parent::Image_Graph_Dataset();
- $this->_minimumT = $minimumT;
- $this->_maximumT = $maximumT;
- $this->_functionX = $functionX;
- $this->_functionY = $functionY;
- $this->_count = $points;
- $this->_calculateMaxima();
- }
-
- /**
- * Add a point to the dataset
- *
- * @param int $x The X value to add
- * @param int $y The Y value to add, can be omited
- * @param var $ID The ID of the point
- */
- function addPoint($x, $y = false, $ID = false)
- {
- }
-
- /**
- * Gets a X point from the dataset
- *
- * @param var $x The variable to apply the X function to
- * @return var The X function applied to the X value
- * @access private
- */
- function _getPointX($x)
- {
- $functionX = $this->_functionX;
- return $functionX ($x);
- }
-
- /**
- * Gets a Y point from the dataset
- *
- * @param var $x The variable to apply the Y function to
- * @return var The Y function applied to the X value
- * @access private
- */
- function _getPointY($x)
- {
- $functionY = $this->_functionY;
- return $functionY ($x);
- }
-
- /**
- * Reset the intertal dataset pointer
- *
- * @return var The first T value
- * @access private
- */
- function _reset()
- {
- $this->_posX = $this->_minimumT;
- return $this->_posX;
- }
-
- /**
- * The interval between 2 adjacent T values
- *
- * @return var The interval
- * @access private
- */
- function _stepX()
- {
- return ($this->_maximumT - $this->_minimumT) / $this->count();
- }
-
- /**
- * Calculates the X and Y extrema of the functions
- *
- * @access private
- */
- function _calculateMaxima()
- {
- $t = $this->_minimumT;
- while ($t <= $this->_maximumT) {
- $x = $this->_getPointX($t);
- $y = $this->_getPointY($t);
- $this->_minimumX = min($x, $this->_minimumX);
- $this->_maximumX = max($x, $this->_maximumX);
- $this->_minimumY = min($y, $this->_minimumY);
- $this->_maximumY = max($y, $this->_maximumY);
- $t += $this->_stepX();
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Element.php b/config/archive/dspam/pear/Image/Graph/Element.php
deleted file mode 100644
index 7c352ee5..00000000
--- a/config/archive/dspam/pear/Image/Graph/Element.php
+++ /dev/null
@@ -1,763 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - Main class for the graph creation.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Common.php
- */
-require_once 'Image/Graph/Common.php';
-
-/**
- * Representation of a element.
- *
- * The Image_Graph_Element can be drawn on the canvas, ie it has coordinates,
- * {@link Image_Graph_Line}, {@link Image_Graph_Fill}, border and background -
- * although not all of these may apply to all children.
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @abstract
- */
-class Image_Graph_Element extends Image_Graph_Common
-{
-
- /**
- * The leftmost pixel of the element on the canvas
- * @var int
- * @access private
- */
- var $_left = 0;
-
- /**
- * The topmost pixel of the element on the canvas
- * @var int
- * @access private
- */
- var $_top = 0;
-
- /**
- * The rightmost pixel of the element on the canvas
- * @var int
- * @access private
- */
- var $_right = 0;
-
- /**
- * The bottommost pixel of the element on the canvas
- * @var int
- * @access private
- */
- var $_bottom = 0;
-
- /**
- * Background of the element. Default: None
- * @var FillStyle
- * @access private
- */
- var $_background = null;
-
- /**
- * Borderstyle of the element. Default: None
- * @var LineStyle
- * @access private
- */
- var $_borderStyle = null;
-
- /**
- * Line style of the element. Default: None
- * @var LineStyle
- * @access private
- */
- var $_lineStyle = 'black';
-
- /**
- * Fill style of the element. Default: None
- * @var FillStyle
- * @access private
- */
- var $_fillStyle = 'white';
-
- /**
- * Font of the element. Default: Standard font - FONT
- * @var Font
- * @access private
- * @see $IMAGE_GRAPH_FONT
- */
- var $_font = null;
-
- /**
- * Font options
- * @var array
- * @access private
- */
- var $_fontOptions = array();
-
- /**
- * Default font options
- *
- * This option is included for performance reasons. The value is calculated
- * before output and reused in default cases to avoid unnecessary recursive
- * calls.
- *
- * @var array
- * @access private
- */
- var $_defaultFontOptions = false;
-
- /**
- * Shadows options of the element
- * @var mixed
- * @access private
- */
- var $_shadow = false;
-
- /**
- * The padding displayed on the element
- * @var int
- * @access private
- */
- var $_padding = array('left' => 0, 'top' => 0, 'right' => 0, 'bottom' => 0);
-
- /**
- * Sets the background fill style of the element
- *
- * @param Image_Graph_Fill $background The background
- * @see Image_Graph_Fill
- */
- function setBackground(& $background)
- {
- if (!is_a($background, 'Image_Graph_Fill')) {
- $this->_error(
- 'Could not set background for ' . get_class($this) . ': ' .
- get_class($background), array('background' => &$background)
- );
- } else {
- $this->_background =& $background;
- $this->add($background);
- }
- }
-
- /**
- * Shows shadow on the element
- */
- function showShadow($color = 'black@0.2', $size = 5)
- {
- $this->_shadow = array(
- 'color' => $color,
- 'size' => $size
- );
- }
-
- /**
- * Sets the background color of the element.
- *
- * See colors.txt in the docs/ folder for a list of available named colors.
- *
- * @param mixed $color The color
- */
- function setBackgroundColor($color)
- {
- $this->_background = $color;
- }
-
- /**
- * Gets the background fill style of the element
- *
- * @return int A GD fillstyle representing the background style
- * @see Image_Graph_Fill
- * @access private
- */
- function _getBackground()
- {
- if (is_object($this->_background)) {
- $this->_canvas->setFill($this->_background->_getFillStyle());
- } elseif ($this->_background != null) {
- $this->_canvas->setFill($this->_background);
- } else {
- return false;
- }
- return true;
- }
-
- /**
- * Sets the border line style of the element
- *
- * @param Image_Graph_Line $borderStyle The line style of the border
- * @see Image_Graph_Line
- */
- function setBorderStyle(& $borderStyle)
- {
- if (!is_a($borderStyle, 'Image_Graph_Line')) {
- $this->_error(
- 'Could not set border style for ' . get_class($this) . ': ' .
- get_class($borderStyle), array('borderstyle' => &$borderStyle)
- );
- } else {
- $this->_borderStyle =& $borderStyle;
- $this->add($borderStyle);
- }
- }
-
- /**
- * Sets the border color of the element.
- *
- * See colors.txt in the docs/ folder for a list of available named colors.
- * @param mixed $color The color
- */
- function setBorderColor($color)
- {
- $this->_borderStyle = $color;
- }
-
- /**
- * Gets the border line style of the element
- *
- * @return int A GD linestyle representing the borders line style
- * @see Image_Graph_Line
- * @access private
- */
- function _getBorderStyle()
- {
- if (is_object($this->_borderStyle)) {
- $result = $this->_borderStyle->_getLineStyle();
- $this->_canvas->setLineThickness($result['thickness']);
- $this->_canvas->setLineColor($result['color']);
- } elseif ($this->_borderStyle != null) {
- $this->_canvas->setLineThickness(1);
- $this->_canvas->setLineColor($this->_borderStyle);
- } else {
- return false;
- }
- return true;
- }
-
- /**
- * Sets the line style of the element
- *
- * @param Image_Graph_Line $lineStyle The line style of the element
- * @see Image_Graph_Line
- */
- function setLineStyle(& $lineStyle)
- {
- if (!is_object($lineStyle)) {
- $this->_error(
- 'Could not set line style for ' . get_class($this) . ': ' .
- get_class($lineStyle), array('linestyle' => &$lineStyle)
- );
- } else {
- $this->_lineStyle =& $lineStyle;
- $this->add($lineStyle);
- }
- }
-
- /**
- * Sets the line color of the element.
- *
- * See colors.txt in the docs/ folder for a list of available named colors.
- *
- * @param mixed $color The color
- */
- function setLineColor($color)
- {
- $this->_lineStyle = $color;
- }
-
- /**
- * Gets the line style of the element
- *
- * @return int A GD linestyle representing the line style
- * @see Image_Graph_Line
- * @access private
- */
- function _getLineStyle($ID = false)
- {
- if (is_object($this->_lineStyle)) {
- $result = $this->_lineStyle->_getLineStyle($ID);
- if (is_array($result)) {
- $this->_canvas->setLineThickness($result['thickness']);
- $this->_canvas->setLineColor($result['color']);
- } else {
- $this->_canvas->setLineThickness(1);
- $this->_canvas->setLineColor($result);
- }
- } elseif ($this->_lineStyle != null) {
- $this->_canvas->setLineThickness(1);
- $this->_canvas->setLineColor($this->_lineStyle);
- } else {
- return false;
- }
- return true;
- }
-
- /**
- * Sets the fill style of the element
- *
- * @param Image_Graph_Fill $fillStyle The fill style of the element
- * @see Image_Graph_Fill
- */
- function setFillStyle(& $fillStyle)
- {
- if (!is_a($fillStyle, 'Image_Graph_Fill')) {
- $this->_error(
- 'Could not set fill style for ' . get_class($this) . ': ' .
- get_class($fillStyle), array('fillstyle' => &$fillStyle)
- );
- } else {
- $this->_fillStyle =& $fillStyle;
- $this->add($fillStyle);
- }
- }
-
- /**
- * Sets the fill color of the element.
- *
- * See colors.txt in the docs/ folder for a list of available named colors.
- *
- * @param mixed $color The color
- */
- function setFillColor($color)
- {
- $this->_fillStyle = $color;
- }
-
-
- /**
- * Gets the fill style of the element
- *
- * @return int A GD filestyle representing the fill style
- * @see Image_Graph_Fill
- * @access private
- */
- function _getFillStyle($ID = false)
- {
- if (is_object($this->_fillStyle)) {
- $this->_canvas->setFill($this->_fillStyle->_getFillStyle($ID));
- } elseif ($this->_fillStyle != null) {
- $this->_canvas->setFill($this->_fillStyle);
- } else {
- return false;
- }
- return true;
- }
-
- /**
- * Gets the font of the element.
- *
- * If not font has been set, the parent font is propagated through it's
- * children.
- *
- * @return array An associated array used for canvas
- * @access private
- */
- function _getFont($options = false)
- {
- if (($options === false) && ($this->_defaultFontOptions !== false)) {
- return $this->_defaultFontOptions;
- }
-
- if ($options === false) {
- $saveDefault = true;
- } else {
- $saveDefault = false;
- }
-
- if ($options === false) {
- $options = $this->_fontOptions;
- } else {
- $options = array_merge($this->_fontOptions, $options);
- }
-
- if ($this->_font == null) {
- $result = $this->_parent->_getFont($options);
- } else {
- $result = $this->_font->_getFont($options);
- }
-
- if ((isset($result['size'])) && (isset($result['size_rel']))) {
- $result['size'] += $result['size_rel'];
- unset($result['size_rel']);
- }
-
- if ($saveDefault) {
- $this->_defaultFontOptions = $result;
- }
-
- return $result;
- }
-
- /**
- * Sets the font of the element
- *
- * @param Image_Graph_Font $font The font of the element
- * @see Image_Graph_Font
- */
- function setFont(& $font)
- {
- if (!is_a($font, 'Image_Graph_Font')) {
- $this->_error('Invalid font set on ' . get_class($this));
- } else {
- $this->_font =& $font;
- $this->add($font);
- }
- }
-
- /**
- * Sets the font size
- *
- * @param int $size The size of the font
- */
- function setFontSize($size)
- {
- $this->_fontOptions['size'] = $size;
- }
-
- /**
- * Sets the font angle
- *
- * @param int $angle The angle of the font
- */
- function setFontAngle($angle)
- {
- if ($angle == 'vertical') {
- $this->_fontOptions['vertical'] = true;
- $this->_fontOptions['angle'] = 90;
- } else {
- $this->_fontOptions['angle'] = $angle;
- }
- }
-
- /**
- * Sets the font color
- *
- * @param mixed $color The color of the font
- */
- function setFontColor($color)
- {
- $this->_fontOptions['color'] = $color;
- }
-
- /**
- * Clip the canvas to the coordinates of the element
- *
- * @param $enable bool Whether clipping should be enabled or disabled
- * @access protected
- */
- function _clip($enable)
- {
- $this->_canvas->setClipping(
- ($enable ?
- array(
- 'x0' => min($this->_left, $this->_right),
- 'y0' => min($this->_top, $this->_bottom),
- 'x1' => max($this->_left, $this->_right),
- 'y1' => max($this->_top, $this->_bottom)
- )
- : false
- )
- );
- }
-
- /**
- * Sets the coordinates of the element
- *
- * @param int $left The leftmost pixel of the element on the canvas
- * @param int $top The topmost pixel of the element on the canvas
- * @param int $right The rightmost pixel of the element on the canvas
- * @param int $bottom The bottommost pixel of the element on the canvas
- * @access private
- */
- function _setCoords($left, $top, $right, $bottom)
- {
- if ($left === false) {
- $left = $this->_left;
- }
-
- if ($top === false) {
- $top = $this->_top;
- }
-
- if ($right === false) {
- $right = $this->_right;
- }
-
- if ($bottom === false) {
- $bottom = $this->_bottom;
- }
-
- $this->_left = min($left, $right);
- $this->_top = min($top, $bottom);
- $this->_right = max($left, $right);
- $this->_bottom = max($top, $bottom);
- }
-
- /**
- * Moves the element
- *
- * @param int $deltaX Number of pixels to move the element to the right
- * (negative values move to the left)
- * @param int $deltaY Number of pixels to move the element downwards
- * (negative values move upwards)
- * @access private
- */
- function _move($deltaX, $deltaY)
- {
- $this->_left += $deltaX;
- $this->_right += $deltaX;
- $this->_top += $deltaY;
- $this->_bottom += $deltaY;
- }
-
- /**
- * Sets the width of the element relative to the left side
- *
- * @param int $width Number of pixels the element should be in width
- * @access private
- */
- function _setWidth($width)
- {
- $this->_right = $this->_left + $width;
- }
-
- /**
- * Sets the height of the element relative to the top
- *
- * @param int $width Number of pixels the element should be in height
- * @access private
- */
- function _setHeight($height)
- {
- $this->_bottom = $this->_top + $height;
- }
-
- /**
- * Sets padding of the element
- *
- * @param mixed $padding Number of pixels the element should be padded with
- * or an array of paddings (left, top, right and bottom as index)
- */
- function setPadding($padding)
- {
- if (is_array($padding)) {
- $this->_padding = array();
- $this->_padding['left'] = (isset($padding['left']) ? $padding['left'] : 0);
- $this->_padding['top'] = (isset($padding['top']) ? $padding['top'] : 0);
- $this->_padding['right'] = (isset($padding['right']) ? $padding['right'] : 0);
- $this->_padding['bottom'] = (isset($padding['bottom']) ? $padding['bottom'] : 0);
- }
- else {
- $this->_padding = array(
- 'left' => $padding,
- 'top' => $padding,
- 'right' => $padding,
- 'bottom' => $padding
- );
- }
- }
-
- /**
- * The width of the element on the canvas
- *
- * @return int Number of pixels representing the width of the element
- */
- function width()
- {
- return abs($this->_right - $this->_left) + 1;
- }
-
- /**
- * The height of the element on the canvas
- *
- * @return int Number of pixels representing the height of the element
- */
- function height()
- {
- return abs($this->_bottom - $this->_top) + 1;
- }
-
- /**
- * Left boundary of the background fill area
- *
- * @return int Leftmost position on the canvas
- * @access private
- */
- function _fillLeft()
- {
- return $this->_left + $this->_padding['left'];
- }
-
- /**
- * Top boundary of the background fill area
- *
- * @return int Topmost position on the canvas
- * @access private
- */
- function _fillTop()
- {
- return $this->_top + $this->_padding['top'];
- }
-
- /**
- * Right boundary of the background fill area
- *
- * @return int Rightmost position on the canvas
- * @access private
- */
- function _fillRight()
- {
- return $this->_right - $this->_padding['right'];
- }
-
- /**
- * Bottom boundary of the background fill area
- *
- * @return int Bottommost position on the canvas
- * @access private
- */
- function _fillBottom()
- {
- return $this->_bottom - $this->_padding['bottom'];
- }
-
- /**
- * Returns the filling width of the element on the canvas
- *
- * @return int Filling width
- * @access private
- */
- function _fillWidth()
- {
- return $this->_fillRight() - $this->_fillLeft() + 1;
- }
-
- /**
- * Returns the filling height of the element on the canvas
- *
- * @return int Filling height
- * @access private
- */
- function _fillHeight()
- {
- return $this->_fillBottom() - $this->_fillTop() + 1;
- }
-
- /**
- * Draws a shadow 'around' the element
- *
- * Not implemented yet.
- *
- * @access private
- */
- function _displayShadow()
- {
- if (is_array($this->_shadow)) {
- $this->_canvas->startGroup(get_class($this) . '_shadow');
- $this->_canvas->setFillColor($this->_shadow['color']);
- $this->_canvas->addVertex(array('x' => $this->_right + 1, 'y' => $this->_top + $this->_shadow['size']));
- $this->_canvas->addVertex(array('x' => $this->_right + $this->_shadow['size'], 'y' => $this->_top + $this->_shadow['size']));
- $this->_canvas->addVertex(array('x' => $this->_right + $this->_shadow['size'], 'y' => $this->_bottom + $this->_shadow['size']));
- $this->_canvas->addVertex(array('x' => $this->_left + $this->_shadow['size'], 'y' => $this->_bottom + $this->_shadow['size']));
- $this->_canvas->addVertex(array('x' => $this->_left + $this->_shadow['size'], 'y' => $this->_bottom + 1));
- $this->_canvas->addVertex(array('x' => $this->_right + 1, 'y' => $this->_bottom + 1));
- $this->_canvas->polygon(array('connect' => true));
- $this->_canvas->endGroup();
- }
- }
-
- /**
- * Writes text to the canvas.
- *
- * @param int $x The x position relative to alignment
- * @param int $y The y position relative to alignment
- * @param string $text The text
- * @param int $alignmen The text alignment (both vertically and horizontally)
- */
- function write($x, $y, $text, $alignment = false, $font = false)
- {
- if (($font === false) && ($this->_defaultFontOptions !== false)) {
- $font = $this->_defaultFontOptions;
- } else {
- $font = $this->_getFont($font);
- }
-
- if ($alignment === false) {
- $alignment = IMAGE_GRAPH_ALIGN_LEFT + IMAGE_GRAPH_ALIGN_TOP;
- }
-
- $align = array();
-
- if (($alignment & IMAGE_GRAPH_ALIGN_TOP) != 0) {
- $align['vertical'] = 'top';
- } else if (($alignment & IMAGE_GRAPH_ALIGN_BOTTOM) != 0) {
- $align['vertical'] = 'bottom';
- } else {
- $align['vertical'] = 'center';
- }
-
- if (($alignment & IMAGE_GRAPH_ALIGN_LEFT) != 0) {
- $align['horizontal'] = 'left';
- } else if (($alignment & IMAGE_GRAPH_ALIGN_RIGHT) != 0) {
- $align['horizontal'] = 'right';
- } else {
- $align['horizontal'] = 'center';
- }
-
- $this->_canvas->setFont($font);
- $this->_canvas->addText(array('x' => $x, 'y' => $y, 'text' => $text, 'alignment' => $align));
- }
-
- /**
- * Output the element to the canvas
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @see Image_Graph_Common
- * @access private
- */
- function _done()
- {
- $background = $this->_getBackground();
- $border = $this->_getBorderStyle();
- if (($background) || ($border)) {
- $this->_canvas->rectangle(array('x0' => $this->_left, 'y0' => $this->_top, 'x1' => $this->_right, 'y1' => $this->_bottom));
- }
-
- $result = parent::_done();
-
- if ($this->_shadow !== false) {
- $this->_displayShadow();
- }
-
- return $result;
- }
-
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Figure/Circle.php b/config/archive/dspam/pear/Image/Graph/Figure/Circle.php
deleted file mode 100644
index a3f1652e..00000000
--- a/config/archive/dspam/pear/Image/Graph/Figure/Circle.php
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Figure
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Figure/Ellipse.php
- */
-require_once 'Image/Graph/Figure/Ellipse.php';
-
-/**
- * Circle to draw on the canvas
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Figure
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Figure_Circle extends Image_Graph_Figure_Ellipse
-{
-
- /**
- * Image_Graph_Circle [Constructor]
- *
- * @param int $x The center pixel of the circle on the canvas
- * @param int $y The center pixel of the circle on the canvas
- * @param int $radius The radius in pixels of the circle
- */
- function Image_Graph_Figure_Circle($x, $y, $radius)
- {
- parent::Image_Graph_Ellipse($x, $y, $radius, $radius);
- }
-
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Figure/Ellipse.php b/config/archive/dspam/pear/Image/Graph/Figure/Ellipse.php
deleted file mode 100644
index 8e42f2b1..00000000
--- a/config/archive/dspam/pear/Image/Graph/Figure/Ellipse.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Figure
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Element.php
- */
-require_once 'Image/Graph/Element.php';
-
-/**
- * Ellipse to draw on the canvas
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Figure
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Figure_Ellipse extends Image_Graph_Element
-{
-
- /**
- * Ellipse [Constructor]
- *
- * @param int $x The center pixel of the ellipse on the canvas
- * @param int $y The center pixel of the ellipse on the canvas
- * @param int $radiusX The width in pixels of the box on the canvas
- * @param int $radiusY The height in pixels of the box on the canvas
- */
- function Image_Graph_Figure_Ellipse($x, $y, $radiusX, $radiusY)
- {
- parent::Image_Graph_Element();
- $this->_setCoords($x - $radiusX, $y - $radiusY, $x + $radiusX, $y + $radiusY);
- }
-
- /**
- * Output the ellipse
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this));
-
- $this->_getFillStyle();
- $this->_getLineStyle();
- $this->_canvas->ellipse(
- array(
- 'x' => ($this->_left + $this->_right) / 2,
- 'y' => ($this->_top + $this->_bottom) / 2,
- 'rx' => $this->width(),
- 'ry' => $this->height()
- )
- );
-
- $this->_canvas->endGroup();
-
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Figure/Polygon.php b/config/archive/dspam/pear/Image/Graph/Figure/Polygon.php
deleted file mode 100644
index 5b78f635..00000000
--- a/config/archive/dspam/pear/Image/Graph/Figure/Polygon.php
+++ /dev/null
@@ -1,94 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Figure
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Element.php
- */
-require_once 'Image/Graph/Element.php';
-
-/**
- * Polygon to draw on the canvas
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Figure
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Figure_Polygon extends Image_Graph_Element
-{
-
- /**
- * Polygon vertices
- *
- * @var array
- * @access private
- */
- var $_polygon = array ();
-
- /**
- * Add a vertex to the polygon
- *
- * @param int $x X-coordinate
- * @param int $y Y-coordinate
- */
- function addVertex($x, $y)
- {
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y));
- }
-
- /**
- * Output the polygon
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this));
-
- $this->_getFillStyle();
- $this->_getLineStyle();
- $this->_canvas->polygon(array('connect' => true));
-
- $this->_canvas->endGroup();
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Figure/Rectangle.php b/config/archive/dspam/pear/Image/Graph/Figure/Rectangle.php
deleted file mode 100644
index dbca58e0..00000000
--- a/config/archive/dspam/pear/Image/Graph/Figure/Rectangle.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Figure
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Element.php
- */
-require_once 'Image/Graph/Element.php';
-
-/**
- * Rectangle to draw on the canvas
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Figure
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Figure_Rectangle extends Image_Graph_Element
-{
-
- /**
- * Rectangle [Construcor]
- *
- * @param int $x The leftmost pixel of the box on the canvas
- * @param int $y The topmost pixel of the box on the canvas
- * @param int $width The width in pixels of the box on the canvas
- * @param int $height The height in pixels of the box on the canvas
- */
- function Image_Graph_Figure_Rectangle($x, $y, $width, $height)
- {
- parent::Image_Graph_Element();
- $this->_setCoords($x, $y, $x + $width, $y + $height);
- }
-
- /**
- * Output the box
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this));
-
- $this->_getFillStyle();
- $this->_getLineStyle();
- $this->_canvas->rectangle(
- array(
- 'x0' => $this->_left,
- 'y0' => $this->_top,
- 'x1' => $this->_right,
- 'y1' => $this->_bottom
- )
- );
-
- $this->_canvas->endGroup();
-
- return true;
- }
-
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Fill.php b/config/archive/dspam/pear/Image/Graph/Fill.php
deleted file mode 100644
index f1cd36d7..00000000
--- a/config/archive/dspam/pear/Image/Graph/Fill.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Fill
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Element.php
- */
-require_once 'Image/Graph/Element.php';
-
-/**
- * Style used for filling elements.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Fill
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @abstract
- */
-class Image_Graph_Fill extends Image_Graph_Common
-{
-
- /**
- * Resets the fillstyle
- *
- * @access private
- */
- function _reset()
- {
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Fill/Array.php b/config/archive/dspam/pear/Image/Graph/Fill/Array.php
deleted file mode 100644
index 8d0b2dfa..00000000
--- a/config/archive/dspam/pear/Image/Graph/Fill/Array.php
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Fill
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Fill.php
- */
-require_once 'Image/Graph/Fill.php';
-
-/**
- * A sequential array of fillstyles.
- *
- * This is used for filling multiple objects within the same element with
- * different styles. This is done by adding multiple fillstyles to a FillArrray
- * structure. The fillarray will then when requested return the 'next' fillstyle
- * in sequential order. It is possible to specify ID tags to each fillstyle,
- * which is used to make sure some data uses a specific fillstyle (i.e. in a
- * multiple-/stackedbarchart you name the {@link Image_Graph_Dataset}s and uses
- * this name as ID tag when adding the dataset's associated fillstyle to the
- * fillarray.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Fill
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Fill_Array extends Image_Graph_Fill
-{
-
- /**
- * The fill array
- * @var array
- * @access private
- */
- var $_fillStyles = array ();
-
- /**
- * Resets the fillstyle
- *
- * @access private
- */
- function _reset()
- {
- reset($this->_fillStyles);
- }
-
- /**
- * Add a fill style to the array
- *
- * @param Image_Graph_Fill $style The style to add
- * @param string $id The id or name of the style
- */
- function &add(& $style, $id = '')
- {
- if ($id == '') {
- $this->_fillStyles[] =& $style;
- } else {
- $this->_fillStyles[$id] =& $style;
- }
- reset($this->_fillStyles);
- return $style;
- }
-
- /**
- * Add a color to the array
- *
- * @param int $color The color
- * @param string $id The id or name of the color
- */
- function addColor($color, $id = false)
- {
- if ($id !== false) {
- $this->_fillStyles[$id] = $color;
- } else {
- $this->_fillStyles[] = $color;
- }
- reset($this->_fillStyles);
- }
-
- /**
- * Return the fillstyle
- *
- * @return int A GD fillstyle
- * @access private
- */
- function _getFillStyle($ID = false)
- {
- if (($ID === false) || (!isset($this->_fillStyles[$ID]))) {
- $ID = key($this->_fillStyles);
- if (!next($this->_fillStyles)) {
- reset($this->_fillStyles);
- }
- }
- $fillStyle =& $this->_fillStyles[$ID];
-
- if (is_object($fillStyle)) {
- return $fillStyle->_getFillStyle($ID);
- } elseif ($fillStyle !== null) {
- return $fillStyle;
- } else {
- return parent::_getFillStyle($ID);
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Fill/Gradient.php b/config/archive/dspam/pear/Image/Graph/Fill/Gradient.php
deleted file mode 100644
index 9cf23a6b..00000000
--- a/config/archive/dspam/pear/Image/Graph/Fill/Gradient.php
+++ /dev/null
@@ -1,149 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Fill
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Fill/Image.php
- */
-require_once 'Image/Graph/Fill/Image.php';
-
-/**
- * Fill using a gradient color.
- * This creates a scaled fillstyle with colors flowing gradiently between 2
- * specified RGB values. Several directions are supported:
- *
- * 1 Vertically (IMAGE_GRAPH_GRAD_VERTICAL)
- *
- * 2 Horizontally (IMAGE_GRAPH_GRAD_HORIZONTAL)
- *
- * 3 Mirrored vertically (the color grades from a- b-a vertically)
- * (IMAGE_GRAPH_GRAD_VERTICAL_MIRRORED)
- *
- * 4 Mirrored horizontally (the color grades from a-b-a horizontally)
- * IMAGE_GRAPH_GRAD_HORIZONTAL_MIRRORED
- *
- * 5 Diagonally from top-left to right-bottom
- * (IMAGE_GRAPH_GRAD_DIAGONALLY_TL_BR)
- *
- * 6 Diagonally from bottom-left to top-right
- * (IMAGE_GRAPH_GRAD_DIAGONALLY_BL_TR)
- *
- * 7 Radially (concentric circles in the center) (IMAGE_GRAPH_GRAD_RADIAL)
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Fill
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Fill_Gradient extends Image_Graph_Fill //Image_Graph_Fill_Image
-{
-
- /**
- * The direction of the gradient
- * @var int
- * @access private
- */
- var $_direction;
-
- /**
- * The first color to gradient
- * @var mixed
- * @access private
- */
- var $_startColor;
-
- /**
- * The last color to gradient
- * @var mixed
- * @access private
- */
- var $_endColor;
-
- /**
- * Image_Graph_GradientFill [Constructor]
- *
- * @param int $direction The direction of the gradient
- * @param mixed $startColor The value of the starting color
- * @param mixed $endColor The value of the ending color
- */
- function Image_Graph_Fill_Gradient($direction, $startColor, $endColor)
- {
- parent::Image_Graph_Fill();
- $this->_direction = $direction;
- $this->_startColor = $startColor;
- $this->_endColor = $endColor;
- }
-
- /**
- * Return the fillstyle
- *
- * @return int A GD fillstyle
- * @access private
- */
- function _getFillStyle($ID = false)
- {
- switch ($this->_direction) {
- case IMAGE_GRAPH_GRAD_HORIZONTAL:
- $direction = 'horizontal';
- break;
- case IMAGE_GRAPH_GRAD_VERTICAL:
- $direction = 'vertical';
- break;
- case IMAGE_GRAPH_GRAD_HORIZONTAL_MIRRORED:
- $direction = 'horizontal_mirror';
- break;
- case IMAGE_GRAPH_GRAD_VERTICAL_MIRRORED:
- $direction = 'vertical_mirror';
- break;
- case IMAGE_GRAPH_GRAD_DIAGONALLY_TL_BR:
- $direction = 'diagonal_tl_br';
- break;
- case IMAGE_GRAPH_GRAD_DIAGONALLY_BL_TR:
- $direction = 'diagonal_bl_tr';
- break;
- case IMAGE_GRAPH_GRAD_RADIAL:
- $direction = 'radial';
- break;
- }
-
- return array(
- 'type' => 'gradient',
- 'start' => $this->_startColor,
- 'end' => $this->_endColor,
- 'direction' => $direction
- );
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Fill/Image.php b/config/archive/dspam/pear/Image/Graph/Fill/Image.php
deleted file mode 100644
index 9b1fb142..00000000
--- a/config/archive/dspam/pear/Image/Graph/Fill/Image.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Fill
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Fill.php
- */
-require_once 'Image/Graph/Fill.php';
-
-/**
- * Fill using an image.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Fill
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Fill_Image extends Image_Graph_Fill
-{
-
- /**
- * The file name
- * @var stirng
- * @access private
- */
- var $_filename;
-
- /**
- * The GD Image resource
- * @var resource
- * @access private
- */
- var $_image;
-
- /**
- * Resize the image to the bounding box of the area to fill
- * @var bool
- * @access private
- */
- var $_resize = true;
-
- /**
- * Image_Graph_ImageFill [Constructor]
- *
- * @param string $filename The filename and path of the image to use for filling
- */
- function Image_Graph_Fill_Image($filename)
- {
- parent::Image_Graph_Fill();
- $this->_filename = $filename;
- }
-
- /**
- * Return the fillstyle
- *
- * @param (something) $ID (Add description)
- * @return int A GD fillstyle
- * @access private
- */
- function _getFillStyle($ID = false)
- {
- return $this->_filename;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Font.php b/config/archive/dspam/pear/Image/Graph/Font.php
deleted file mode 100644
index ad018a27..00000000
--- a/config/archive/dspam/pear/Image/Graph/Font.php
+++ /dev/null
@@ -1,158 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Text
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Common.php
- */
-require_once 'Image/Graph/Common.php';
-
-/**
- * A font.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Text
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @abstract
- */
-class Image_Graph_Font extends Image_Graph_Common
-{
-
- /**
- * The name of the font
- * @var string
- * @access private
- */
- var $_name = false;
-
- /**
- * The angle of the output
- * @var int
- * @access private
- */
- var $_angle = false;
-
- /**
- * The size of the font
- * @var int
- * @access private
- */
- var $_size = 11;
-
- /**
- * The color of the font
- * @var Color
- * @access private
- */
- var $_color = 'black';
-
- /**
- * Image_Graph_Font [Constructor]
- */
- function Image_Graph_Font($name = false, $size = false)
- {
- parent::Image_Graph_Common();
- if ($name !== false) {
- $this->_name = $name;
- }
- if ($size !== false) {
- $this->_size = $size;
- }
- }
-
- /**
- * Set the color of the font
- *
- * @param mixed $color The color object of the Font
- */
- function setColor($color)
- {
- $this->_color = $color;
- }
-
- /**
- * Set the angle slope of the output font.
- *
- * 0 = normal, 90 = bottom and up, 180 = upside down, 270 = top and down
- *
- * @param int $angle The angle in degrees to slope the text
- */
- function setAngle($angle)
- {
- $this->_angle = $angle;
- }
-
- /**
- * Set the size of the font
- *
- * @param int $size The size in pixels of the font
- */
- function setSize($size)
- {
- $this->_size = $size;
- }
-
- /**
- * Get the font 'array'
- *
- * @return array The font 'summary' to pass to the canvas
- * @access private
- */
- function _getFont($options = false)
- {
- if ($options === false) {
- $options = array();
- }
-
- if ($this->_name !== false) {
- $options['name'] = $this->_name;
- }
-
- if (!isset($options['color'])) {
- $options['color'] = $this->_color;
- }
-
- if (!isset($options['size'])) {
- $options['size'] = $this->_size;
- }
-
- if ((!isset($options['angle'])) && ($this->_angle !== false)) {
- $options['angle'] = $this->_angle;
- }
- return $options;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Grid.php b/config/archive/dspam/pear/Image/Graph/Grid.php
deleted file mode 100644
index 4406dbdd..00000000
--- a/config/archive/dspam/pear/Image/Graph/Grid.php
+++ /dev/null
@@ -1,175 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Grid
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Element.php
- */
-require_once 'Image/Graph/Element.php';
-
-/**
- * A grid displayed on the plotarea.
- *
- * A grid is associated with a primary and a secondary axis. The grid is
- * displayed in context of the primary axis' label interval - meaning that a
- * grid for an Y-axis displays a grid for every label on the y-axis (fx. a {@link
- * Image_Graph_Grid_Lines}, which displays horizontal lines for every label on
- * the y-axis from the x-axis minimum to the x-axis maximum). You should always
- * add the grid as one of the first elements to the plotarea. This is due to the
- * fact that elements are 'outputted' in the order they are added, i.e. if an
- * grid is added *after* a chart, the grid will be displayed on top of the chart
- * which is (probably) not desired.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Grid
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @abstract
- */
-class Image_Graph_Grid extends Image_Graph_Plotarea_Element
-{
-
- /**
- * The primary axis: the grid 'refers' to
- * @var Axis
- * @access private
- */
- var $_primaryAxis = null;
-
- /**
- * The secondary axis
- * @var Axis
- * @access private
- */
- var $_secondaryAxis = null;
-
- /**
- * Set the primary axis: the grid should 'refer' to
- *
- * @param Image_Graph_Axis $axis The axis
- * @access private
- */
- function _setPrimaryAxis(& $axis)
- {
- $this->_primaryAxis =& $axis;
- }
-
- /**
- * Set the secondary axis
- *
- * @param Image_Graph_Axis $axis The axis
- * @access private
- */
- function _setSecondaryAxis(& $axis)
- {
- $this->_secondaryAxis =& $axis;
- }
-
- /**
- * Get the points on the secondary axis that the grid should 'connect'
- *
- * @return array The secondary data values that should mark the grid 'end points'
- * @access private
- */
- function _getSecondaryAxisPoints()
- {
- if (is_a($this->_secondaryAxis, 'Image_Graph_Axis_Radar')) {
- $secondaryValue = false;
- $firstValue = $secondaryValue;
- while (($secondaryValue = $this->_secondaryAxis->_getNextLabel($secondaryValue)) !== false) {
- $secondaryAxisPoints[] = $secondaryValue;
- }
- $secondaryAxisPoints[] = $firstValue;
- } else {
- $secondaryAxisPoints = array ('#min#', '#max#');
- }
- return $secondaryAxisPoints;
- }
-
- /**
- * Get the X pixel position represented by a value
- *
- * @param double $point the value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _pointX($point)
- {
- if (($this->_primaryAxis->_type == IMAGE_GRAPH_AXIS_Y) ||
- ($this->_primaryAxis->_type == IMAGE_GRAPH_AXIS_Y_SECONDARY))
- {
- $point['AXIS_Y'] = $this->_primaryAxis->_type;
- } else {
- $point['AXIS_Y'] = $this->_secondaryAxis->_type;
- }
- return parent::_pointX($point);
- }
-
- /**
- * Get the Y pixel position represented by a value
- *
- * @param double $point the value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _pointY($point)
- {
- if (($this->_primaryAxis->_type == IMAGE_GRAPH_AXIS_Y) ||
- ($this->_primaryAxis->_type == IMAGE_GRAPH_AXIS_Y_SECONDARY))
- {
- $point['AXIS_Y'] = $this->_primaryAxis->_type;
- } else {
- $point['AXIS_Y'] = $this->_secondaryAxis->_type;
- }
- return parent::_pointY($point);
- }
-
- /**
- * Causes the object to update all sub elements coordinates.
- *
- * @access private
- */
- function _updateCoords()
- {
- $this->_setCoords(
- $this->_parent->_plotLeft,
- $this->_parent->_plotTop,
- $this->_parent->_plotRight,
- $this->_parent->_plotBottom
- );
- parent::_updateCoords();
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Grid/Bars.php b/config/archive/dspam/pear/Image/Graph/Grid/Bars.php
deleted file mode 100644
index a75782f2..00000000
--- a/config/archive/dspam/pear/Image/Graph/Grid/Bars.php
+++ /dev/null
@@ -1,117 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Grid
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Grid.php
- */
-require_once 'Image/Graph/Grid.php';
-
-/**
- * Display alternating bars on the plotarea.
- *
- * {@link Image_Graph_Grid}
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Grid
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Grid_Bars extends Image_Graph_Grid
-{
-
- /**
- * Output the grid
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- if (!$this->_primaryAxis) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this));
-
- $i = 0;
- $value = false;
-
- $previousValue = 0;
-
- $secondaryPoints = $this->_getSecondaryAxisPoints();
-
- while (($value = $this->_primaryAxis->_getNextLabel($value)) !== false) {
- if ($i == 1) {
- reset($secondaryPoints);
- list ($id, $previousSecondaryValue) = each($secondaryPoints);
- while (list ($id, $secondaryValue) = each($secondaryPoints)) {
- if ($this->_primaryAxis->_type == IMAGE_GRAPH_AXIS_X) {
- $p1 = array ('Y' => $secondaryValue, 'X' => $value);
- $p2 = array ('Y' => $previousSecondaryValue, 'X' => $value);
- $p3 = array ('Y' => $previousSecondaryValue, 'X' => $previousValue);
- $p4 = array ('Y' => $secondaryValue, 'X' => $previousValue);
- } else {
- $p1 = array ('X' => $secondaryValue, 'Y' => $value);
- $p2 = array ('X' => $previousSecondaryValue, 'Y' => $value);
- $p3 = array ('X' => $previousSecondaryValue, 'Y' => $previousValue);
- $p4 = array ('X' => $secondaryValue, 'Y' => $previousValue);
- }
-
- $this->_canvas->addVertex(array('x' => $this->_pointX($p1), 'y' => $this->_pointY($p1)));
- $this->_canvas->addVertex(array('x' => $this->_pointX($p2), 'y' => $this->_pointY($p2)));
- $this->_canvas->addVertex(array('x' => $this->_pointX($p3), 'y' => $this->_pointY($p3)));
- $this->_canvas->addVertex(array('x' => $this->_pointX($p4), 'y' => $this->_pointY($p4)));
-
- $this->_getFillStyle();
- $this->_canvas->polygon(array('connect' => true));
-
- $previousSecondaryValue = $secondaryValue;
- }
- }
- $i = 1 - $i;
- $previousValue = $value;
- }
-
- $this->_canvas->endGroup();
-
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Grid/Lines.php b/config/archive/dspam/pear/Image/Graph/Grid/Lines.php
deleted file mode 100644
index 805778ee..00000000
--- a/config/archive/dspam/pear/Image/Graph/Grid/Lines.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Grid
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Grid.php
- */
-require_once 'Image/Graph/Grid.php';
-
-/**
- * Display a line grid on the plotarea.
- *
- * {@link Image_Graph_Grid}
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Grid
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Grid_Lines extends Image_Graph_Grid
-{
-
- /**
- * GridLines [Constructor]
- */
- function Image_Graph_Grid_Lines()
- {
- parent::Image_Graph_Grid();
- $this->_lineStyle = 'lightgrey';
- }
-
- /**
- * Output the grid
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- if (!$this->_primaryAxis) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this));
-
- $value = false;
-
- $secondaryPoints = $this->_getSecondaryAxisPoints();
-
- while (($value = $this->_primaryAxis->_getNextLabel($value)) !== false) {
- reset($secondaryPoints);
- list ($id, $previousSecondaryValue) = each($secondaryPoints);
- while (list ($id, $secondaryValue) = each($secondaryPoints)) {
- if ($this->_primaryAxis->_type == IMAGE_GRAPH_AXIS_Y) {
- $p1 = array ('X' => $secondaryValue, 'Y' => $value);
- $p2 = array ('X' => $previousSecondaryValue, 'Y' => $value);
- } else {
- $p1 = array ('X' => $value, 'Y' => $secondaryValue);
- $p2 = array ('X' => $value, 'Y' => $previousSecondaryValue);
- }
-
- $x1 = $this->_pointX($p1);
- $y1 = $this->_pointY($p1);
- $x2 = $this->_pointX($p2);
- $y2 = $this->_pointY($p2);
-
- $previousSecondaryValue = $secondaryValue;
-
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $x1, 'y0' => $y1, 'x1' => $x2, 'y1' => $y2));
- }
- }
-
- $this->_canvas->endGroup();
-
- return true;
- }
-
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Grid/Polar.php b/config/archive/dspam/pear/Image/Graph/Grid/Polar.php
deleted file mode 100644
index 03b1b916..00000000
--- a/config/archive/dspam/pear/Image/Graph/Grid/Polar.php
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Grid
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- * @since File available since Release 0.3.0dev2
- */
-
-/**
- * Include file Image/Graph/Grid.php
- */
-require_once 'Image/Graph/Grid.php';
-
-/**
- * Display a line grid on the plotarea.
- *
- * {@link Image_Graph_Grid}
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Grid
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @since Class available since Release 0.3.0dev2
- */
-class Image_Graph_Grid_Polar extends Image_Graph_Grid
-{
-
- /**
- * GridLines [Constructor]
- */
- function Image_Graph_Grid_Polar()
- {
- parent::Image_Graph_Grid();
- $this->_lineStyle = 'lightgrey';
- }
-
- /**
- * Output the grid
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- if (!$this->_primaryAxis) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this));
-
- $value = false;
-
- $p0 = array ('X' => '#min#', 'Y' => '#min#');
- if ($this->_primaryAxis->_type == IMAGE_GRAPH_AXIS_Y) {
- $p1 = array ('X' => '#min#', 'Y' => '#max#');
- $r0 = abs($this->_pointY($p1) - $this->_pointY($p0));
- } else {
- $p1 = array ('X' => '#max#', 'Y' => '#min#');
- $r0 = abs($this->_pointX($p1) - $this->_pointX($p0));
- }
-
- $cx = $this->_pointX($p0);
- $cy = $this->_pointY($p0);
-
- $span = $this->_primaryAxis->_axisSpan;
-
- while (($value = $this->_primaryAxis->_getNextLabel($value)) !== false) {
- $r = $r0 * ($value - $this->_primaryAxis->_getMinimum()) / $span;
-
- $this->_getLineStyle();
- $this->_canvas->ellipse(array('x' => $cx, 'y' => $cy, 'rx' => $r, 'ry' => $r));
- }
-
- $this->_canvas->endGroup();
-
- return true;
- }
-
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Images/Icons/pinpoint.png b/config/archive/dspam/pear/Image/Graph/Images/Icons/pinpoint.png
deleted file mode 100644
index d23f0b7d..00000000
--- a/config/archive/dspam/pear/Image/Graph/Images/Icons/pinpoint.png
+++ /dev/null
Binary files differ
diff --git a/config/archive/dspam/pear/Image/Graph/Images/Icons/pinpointr.png b/config/archive/dspam/pear/Image/Graph/Images/Icons/pinpointr.png
deleted file mode 100644
index 2455e09b..00000000
--- a/config/archive/dspam/pear/Image/Graph/Images/Icons/pinpointr.png
+++ /dev/null
Binary files differ
diff --git a/config/archive/dspam/pear/Image/Graph/Images/Maps/README b/config/archive/dspam/pear/Image/Graph/Images/Maps/README
deleted file mode 100644
index 1b984bbb..00000000
--- a/config/archive/dspam/pear/Image/Graph/Images/Maps/README
+++ /dev/null
@@ -1,17 +0,0 @@
-In this folder the files for the Image_Graph_Plot_Map are located. They should be the
-following format:
-
-[map name].png
-[map name].txt
-
-The [map name].png (fx. europe.png) is the actual image presenting the map. The
-[map name].txt file is the location -> (x,y) conversion table. In this file the
-named locations is written on every line with the x and y coordinates after the
-name (with a TAB), i.e.:
-
-Denmark 10 30
-England 4 30
-
-Where Denmark will be 'located' on (10, 30) on the map, and England at (4, 30).
-
-No maps are released by default due to we want to avoid possible copyright issues. \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Layout.php b/config/archive/dspam/pear/Image/Graph/Layout.php
deleted file mode 100644
index 1561aafa..00000000
--- a/config/archive/dspam/pear/Image/Graph/Layout.php
+++ /dev/null
@@ -1,219 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Layout
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plotarea/Element.php
- */
-require_once 'Image/Graph/Plotarea/Element.php';
-
-/**
- * Defines an area of the graph that can be layout'ed.
- *
- * Any class that extends this abstract class can be used within a layout on the canvas.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Layout
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @abstract
- */
-class Image_Graph_Layout extends Image_Graph_Plotarea_Element
-{
-
- /**
- * Has the coordinates already been updated?
- * @var bool
- * @access private
- */
- var $_updated = false;
-
- /**
- * Alignment of the area for each vertice (left, top, right, bottom)
- * @var array
- * @access private
- */
- var $_alignSize = array ('left' => 0, 'top' => 0, 'right' => 0, 'bottom' => 0);
-
- /**
- * Image_Graph_Layout [Constructor]
- */
- function Image_Graph_Layout()
- {
- parent::Image_Graph_Element();
- $this->_padding = array('left' => 2, 'top' => 2, 'right' => 2, 'bottom' => 2);
- }
-
- /**
- * Resets the elements
- *
- * @access private
- */
- function _reset()
- {
- parent::_reset();
- $this->_updated = false;
- }
-
- /**
- * Calculate the edge offset for a specific edge
- * @param array $alignSize The alignment of the edge
- * @param int $offset The offset/posision of the at 0% edge
- * @param int $total The total size (width or height) of the element
- * @param int $multiplier +/- 1 if the edge should pushed either toward more
- * negative or positive values
- * @since 0.3.0dev2
- * @access private
- */
- function _calcEdgeOffset($alignSize, $offset, $total, $multiplier)
- {
- if ($alignSize['unit'] == 'percentage') {
- return $offset + $multiplier * ($total * $alignSize['value'] / 100);
- } elseif ($alignSize['unit'] == 'pixels') {
- if (($alignSize['value'] == 'auto_part1') || ($alignSize['value'] == 'auto_part2')) {
- $alignSize['value'] = $multiplier * $this->_parent->_getAbsolute($alignSize['value']);
- }
- if ($alignSize['value'] < 0) {
- return $offset + $multiplier * ($total + $alignSize['value']);
- } else {
- return $offset + $multiplier * $alignSize['value'];
- }
- }
- return $offset;
- }
-
- /**
- * Calculate the edges
- *
- * @access private
- */
- function _calcEdges()
- {
- if ((is_array($this->_alignSize)) && (!$this->_updated)) {
- $left = $this->_calcEdgeOffset(
- $this->_alignSize['left'],
- $this->_parent->_fillLeft(),
- $this->_parent->_fillWidth(),
- +1
- );
- $top = $this->_calcEdgeOffset(
- $this->_alignSize['top'],
- $this->_parent->_fillTop(),
- $this->_parent->_fillHeight(),
- +1
- );
- $right = $this->_calcEdgeOffset(
- $this->_alignSize['right'],
- $this->_parent->_fillRight(),
- $this->_parent->_fillWidth(),
- -1
- );
- $bottom = $this->_calcEdgeOffset(
- $this->_alignSize['bottom'],
- $this->_parent->_fillBottom(),
- $this->_parent->_fillHeight(),
- -1
- );
-
- $this->_setCoords(
- $left + $this->_padding['left'],
- $top + $this->_padding['top'],
- $right - $this->_padding['right'],
- $bottom - $this->_padding['bottom']
- );
- }
- }
-
- /**
- * Update coordinates
- *
- * @access private
- */
- function _updateCoords()
- {
- $this->_calcEdges();
- parent::_updateCoords();
- }
-
- /**
- * Pushes an edge of area a specific distance 'into' the canvas
- *
- * @param int $edge The edge of the canvas to align relative to
- * @param int $size The number of pixels or the percentage of the canvas total size to occupy relative to the selected alignment edge
- * @access private
- */
- function _push($edge, $size = '100%')
- {
- $result = array();
- if (ereg("([0-9]*)\%", $size, $result)) {
- $this->_alignSize[$edge] = array(
- 'value' => min(100, max(0, $result[1])),
- 'unit' => 'percentage'
- );
- } else {
- $this->_alignSize[$edge] = array(
- 'value' => $size,
- 'unit' => 'pixels'
- );
- }
- }
-
- /**
- * Sets the coordinates of the element
- *
- * @param int $left The leftmost pixel of the element on the canvas
- * @param int $top The topmost pixel of the element on the canvas
- * @param int $right The rightmost pixel of the element on the canvas
- * @param int $bottom The bottommost pixel of the element on the canvas
- * @access private
- */
- function _setCoords($left, $top, $right, $bottom)
- {
- parent::_setCoords($left, $top, $right, $bottom);
- $this->_updated = true;
- }
-
- /**
- * Returns the calculated "auto" size
- *
- * @return int The calculated auto size
- * @access private
- */
- function _getAutoSize()
- {
- return false;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Layout/Horizontal.php b/config/archive/dspam/pear/Image/Graph/Layout/Horizontal.php
deleted file mode 100644
index 414a168c..00000000
--- a/config/archive/dspam/pear/Image/Graph/Layout/Horizontal.php
+++ /dev/null
@@ -1,186 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Layout
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Layout.php
- */
-require_once 'Image/Graph/Layout.php';
-
-/**
- * Layout for displaying two elements side by side.
- *
- * This splits the area contained by this element in two, side by side by
- * a specified percentage (relative to the left side). A layout can be nested.
- * Fx. a HorizontalLayout can layout two {@link Image_Graph_Layout_Vertical}s to
- * make a 2 by 2 matrix of 'element-areas'.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Layout
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Layout_Horizontal extends Image_Graph_Layout
-{
-
- /**
- * Part1 of the layout
- * @var GraPHPElemnt
- * @access private
- */
- var $_part1 = false;
-
- /**
- * Part2 of the layout
- * @var GraPHPElemnt
- * @access private
- */
- var $_part2 = false;
-
- /**
- * The percentage of the graph where the split occurs
- * @var int
- * @access private
- */
- var $_percentage;
-
- /**
- * An absolute position where the split occurs
- * @var int
- * @access private
- */
- var $_absolute;
-
- /**
- * HorizontalLayout [Constructor]
- *
- * @param Image_Graph_Element $part1 The 1st part of the layout
- * @param Image_Graph_Element $part2 The 2nd part of the layout
- * @param int $percentage The percentage of the layout to split at
- */
- function Image_Graph_Layout_Horizontal(& $part1, & $part2, $percentage = 50)
- {
- parent::Image_Graph_Layout();
- if (!is_a($part1, 'Image_Graph_Layout')) {
- $this->_error(
- 'Cannot create layout on non-layouable parts: ' . get_class($part1),
- array('part1' => &$part1, 'part2' => &$part2)
- );
- } elseif (!is_a($part2, 'Image_Graph_Layout')) {
- $this->_error(
- 'Cannot create layout on non-layouable parts: ' . get_class($part2),
- array('part1' => &$part1, 'part2' => &$part2)
- );
- } else {
- $this->_part1 =& $part1;
- $this->_part2 =& $part2;
- $this->add($this->_part1);
- $this->add($this->_part2);
- };
- if ($percentage === 'auto') {
- $this->_percentage = false;
- $this->_absolute = 'runtime';
- } else {
- $this->_absolute = false;
- $this->_percentage = max(0, min(100, $percentage));
- }
- $this->_split();
- $this->_padding = array('left' => 0, 'top' => 0, 'right' => 0, 'bottom' => 0);
- }
-
- /**
- * Gets the absolute size of one of the parts.
- *
- * @param string $part The name of the part - auto_part(1|2)
- * @return int The number of pixels the edge should be pushed
- * @since 0.3.0dev2
- * @access private
- */
- function _getAbsolute(&$part)
- {
- $part1Size = $this->_part1->_getAutoSize();
- $part2Size = $this->_part2->_getAutoSize();
- $this->_percentage = false;
- if (($part1Size !== false) and ($part2Size !== false)) {
- $width = $this->_fillWidth() * $part1Size / ($part1Size + $part2Size);
- } elseif ($part1Size !== false) {
- $width = $part1Size;
- } elseif ($part2Size !== false) {
- $width = -$part2Size;
- } else {
- $width = $this->_fillWidth() / 2;
- }
- if ($part == 'auto_part2') {
- $width = -$width;
- }
-
- return $width;
- }
-
- /**
- * Splits the layout between the parts, by the specified percentage
- *
- * @access private
- */
- function _split()
- {
- if (($this->_part1) && ($this->_part2)) {
- if ($this->_percentage !== false) {
- $split1 = 100 - $this->_percentage;
- $split2 = $this->_percentage;
- $this->_part1->_push('right', "$split1%");
- $this->_part2->_push('left', "$split2%");
- } else {
- $this->_part1->_push('right', 'auto_part1');
- $this->_part2->_push('left', 'auto_part2');
- }
- }
- }
-
- /**
- * Output the layout to the canvas
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (($this->_part1) && ($this->_part2)) {
- return (($this->_part1->_done()) && ($this->_part2->_done()));
- }
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Layout/Matrix.php b/config/archive/dspam/pear/Image/Graph/Layout/Matrix.php
deleted file mode 100644
index 8acec871..00000000
--- a/config/archive/dspam/pear/Image/Graph/Layout/Matrix.php
+++ /dev/null
@@ -1,201 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Layout
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Layout.php
- */
-require_once 'Image/Graph/Layout.php';
-
-/**
- * Layout for displaying elements in a matix.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Layout
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Layout_Matrix extends Image_Graph_Layout
-{
-
- /**
- * Layout matrix
- * @var array
- * @access private
- */
- var $_matrix = false;
-
- /**
- * The number of rows
- * @var int
- * @access private
- */
- var $_rows = false;
-
- /**
- * The number of columns
- * @var int
- * @access private
- */
- var $_cols = false;
-
- /**
- * Image_Graph_Layout_Matrix [Constructor]
- *
- * @param int $rows The number of rows
- * @param int $cols The number of cols
- * @param bool $autoCreate Specifies whether the matrix should automatically
- * be filled with newly created Image_Graph_Plotares objects, or they will
- * be added manually
- */
- function Image_Graph_Layout_Matrix($rows, $cols, $autoCreate = true)
- {
- parent::Image_Graph_Layout();
-
- $this->_rows = $rows;
- $this->_cols = $cols;
- if (($this->_rows > 0) && ($this->_cols > 0)) {
- $this->_matrix = array(array());
- for ($i = 0; $i < $this->_rows; $i++) {
- for ($j = 0; $j < $this->_cols; $j++) {
- if ($autoCreate) {
- $this->_matrix[$i][$j] =& $this->addNew('plotarea');
- $this->_pushEdges($i, $j);
- } else {
- $this->_matrix[$i][$j] = false;
- }
- }
- }
- }
- }
-
- /**
- * Pushes the edges on the specified position in the matrix
- *
- * @param int $row The row
- * @param int $col The column
- * @access private
- */
- function _pushEdges($row, $col)
- {
- if ((isset($this->_matrix[$row])) && (isset($this->_matrix[$row][$col]))) {
- $height = 100/$this->_rows;
- $width = 100/$this->_cols;
- if ($col > 0) {
- $this->_matrix[$row][$col]->_push('left', round($col*$width) . '%');
- }
- if ($col+1 < $this->_cols) {
- $this->_matrix[$row][$col]->_push('right', round(100-($col+1)*$width) . '%');
- }
- if ($row > 0) {
- $this->_matrix[$row][$col]->_push('top', round($row*$height) . '%');
- }
- if ($row+1 < $this->_rows) {
- $this->_matrix[$row][$col]->_push('bottom', round(100-($row+1)*$height) . '%');
- }
- }
- }
-
- /**
- * Get the area on the specified position in the matrix
- *
- * @param int $row The row
- * @param int $col The column
- * @return Image_Graph_Layout The element of position ($row, $col) in the
- * matrix
- */
- function &getEntry($row, $col)
- {
- if ((isset($this->_matrix[$row])) && (isset($this->_matrix[$row][$col]))) {
- return $this->_matrix[$row][$col];
- } else {
- $result = null;
- return $result;
- }
- }
-
- /**
- * Get the area on the specified position in the matrix
- *
- * @param int $row The row
- * @param int $col The column
- * @param Image_Graph_Layout $element The element to set in the position
- * ($row, $col) in the matrix
- */
- function setEntry($row, $col, &$element)
- {
- $this->_matrix[$row][$col] =& $element;
- $this->_pushEdges($row, $col);
- }
-
- /**
- * Update coordinates
- *
- * @access private
- */
- function _updateCoords()
- {
- for ($i = 0; $i < $this->_rows; $i++) {
- for ($j = 0; $j < $this->_cols; $j++) {
- $element =& $this->getEntry($i, $j);
- $this->add($element);
- }
- }
- parent::_updateCoords();
- }
-
- /**
- * Output the layout to the canvas
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- $result = true;
- for ($i = 0; $i < $this->_rows; $i++) {
- for ($j = 0; $j < $this->_cols; $j++) {
- $element =& $this->getEntry($i, $j);
- if ($element) {
- if (!$element->_done()) {
- $result = false;
- }
- }
- }
- }
- return $result;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Layout/Vertical.php b/config/archive/dspam/pear/Image/Graph/Layout/Vertical.php
deleted file mode 100644
index 2dc6f945..00000000
--- a/config/archive/dspam/pear/Image/Graph/Layout/Vertical.php
+++ /dev/null
@@ -1,108 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Layout
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Layout/Horizontal.php
- */
-require_once 'Image/Graph/Layout/Horizontal.php';
-
-/**
- * Layout for displaying two elements on top of each other.
- *
- * This splits the area contained by this element in two on top of each other
- * by a specified percentage (relative to the top). A layout can be nested.
- * Fx. a {@link Image_Graph_Layout_Horizontal} can layout two VerticalLayout's to
- * make a 2 by 2 matrix of 'element-areas'.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Layout
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Layout_Vertical extends Image_Graph_Layout_Horizontal
-{
-
- /**
- * Gets the absolute size of one of the parts.
- *
- * @param string $part The name of the part - auto_part(1|2)
- * @return int The number of pixels the edge should be pushed
- * @since 0.3.0dev2
- * @access private
- */
- function _getAbsolute(&$part)
- {
- $part1Size = $this->_part1->_getAutoSize();
- $part2Size = $this->_part2->_getAutoSize();
- $this->_percentage = false;
- if (($part1Size !== false) and ($part2Size !== false)) {
- $height = $this->_fillHeight() * $part1Size / ($part1Size + $part2Size);
- } elseif ($part1Size !== false) {
- $height = $part1Size;
- } elseif ($part2Size !== false) {
- $height = -$part2Size;
- } else {
- $height = $this->_fillHeight() / 2;
- }
-
- if ($part == 'auto_part2') {
-// $height = $this->_fillHeight() - $height;
- }
-
- return $height;
- }
-
- /**
- * Splits the layout between the parts, by the specified percentage
- *
- * @access private
- */
- function _split()
- {
- if (($this->_part1) && ($this->_part2)) {
- if ($this->_percentage !== false) {
- $split1 = 100 - $this->_percentage;
- $split2 = $this->_percentage;
- $this->_part1->_push('bottom', "$split1%");
- $this->_part2->_push('top', "$split2%");
- } else {
- $this->_part1->_push('bottom', 'auto_part1');
- $this->_part2->_push('top', 'auto_part2');
- }
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Legend.php b/config/archive/dspam/pear/Image/Graph/Legend.php
deleted file mode 100644
index d853dad5..00000000
--- a/config/archive/dspam/pear/Image/Graph/Legend.php
+++ /dev/null
@@ -1,385 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - Main class for the graph creation.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Legend
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Layout.php
- */
-require_once 'Image/Graph/Layout.php';
-
-/**
- * Displays a legend for a plotarea.
- *
- * A legend can be displayed in two ways:
- *
- * 1 As an overlayed box within the plotarea
- *
- * 2 Layout'ed on the canvas smewhere next to the plotarea.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Legend
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Legend extends Image_Graph_Layout
-{
-
- /**
- * Alignment of the text
- * @var int
- * @access private
- */
- var $_alignment = false;
-
- /**
- * The plotarea(s) to show the legend for
- * @var array
- * @access private
- */
- var $_plotareas = array();
-
- /**
- * Should markers be shown or not on this legend
- * @var bool
- * @access private
- */
- var $_showMarker = false;
-
- /**
- * Image_Graph_Legend [Constructor]
- */
- function Image_Graph_Legend()
- {
- parent::Image_Graph_Layout();
- $this->_padding = array('left' => 5, 'top' => 5, 'right' => 5, 'bottom' => 5);
- }
-
- /**
- * The number of actual plots in the plot area
- *
- * @return int The number of plotes
- * @access private
- */
- function _plotCount()
- {
- $count = 0;
- $keys = array_keys($this->_plotareas);
- foreach($keys as $key) {
- $plotarea =& $this->_plotareas[$key];
- if (is_a($plotarea, 'Image_Graph_Plotarea')) {
- $keys2 = array_keys($plotarea->_elements);
- foreach ($keys2 as $key) {
- $element =& $plotarea->_elements[$key];
- if (is_a($element, 'Image_Graph_Plot')) {
- $count ++;
- }
- }
- unset($keys2);
- }
- }
- unset($keys);
- return $count;
- }
-
- /**
- * Get a default parameter array for legendSamples
- * @param bool $simulate Whether the array should be used for simulation or
- * not
- * @return array Default parameter array
- * @access private
- */
- function _parameterArray($simulate = false)
- {
- $param['left'] = $this->_left + $this->_padding['left'];
- $param['top'] = $this->_top + $this->_padding['top'];
- $param['right'] = $this->_right - $this->_padding['right'];
- $param['bottom'] = $this->_bottom - $this->_padding['bottom'];
- $param['align'] = $this->_alignment;
- $param['x'] = $this->_left + $this->_padding['left'];
- $param['y'] = $this->_top + $this->_padding['top'];
- $param['width'] = 16;
- $param['height'] = 16;
- $param['show_marker'] = $this->_showMarker;
- $param['maxwidth'] = 0;
- $param['font'] = $this->_getFont();
- if ($simulate) {
- $param['simulate'] = true;
- }
-
- return $param;
- }
-
- /**
- * The height of the element on the canvas
- *
- * @return int Number of pixels representing the height of the element
- * @access private
- */
- function _height()
- {
- $parent = (is_object($this->_parent) ? get_class($this->_parent) : $this->_parent);
-
- if (strtolower($parent) == 'image_graph_plotarea') {
- $param = $this->_parameterArray(true);
- $param['align'] = IMAGE_GRAPH_ALIGN_VERTICAL;
- $param0 = $param;
- $keys = array_keys($this->_plotareas);
- foreach($keys as $key) {
- $plotarea =& $this->_plotareas[$key];
- $keys2 = array_keys($plotarea->_elements);
- foreach($keys2 as $key) {
- $element =& $plotarea->_elements[$key];
- if (is_a($element, 'Image_Graph_Plot')) {
- $element->_legendSample($param);
- }
- }
- unset($keys2);
- }
- unset($keys);
- return abs($param['y'] - $param0['y']) + $this->_padding['top'] + $this->_padding['bottom'];
- } else {
- return parent::height();
- }
- }
-
- /**
- * The width of the element on the canvas
- *
- * @return int Number of pixels representing the width of the element
- * @access private
- */
- function _width()
- {
- $parent = (is_object($this->_parent) ? get_class($this->_parent) : $this->_parent);
-
- if (strtolower($parent) == 'image_graph_plotarea') {
- $param = $this->_parameterArray(true);
- $param['align'] = IMAGE_GRAPH_ALIGN_VERTICAL;
- $keys = array_keys($this->_plotareas);
- foreach($keys as $key) {
- $plotarea =& $this->_plotareas[$key];
- $keys2 = array_keys($plotarea->_elements);
- foreach($keys2 as $key) {
- $element =& $plotarea->_elements[$key];
- if (is_a($element, 'Image_Graph_Plot')) {
- $element->_legendSample($param);
- }
- }
- unset($keys2);
- }
- unset($keys);
- return $param['maxwidth'];
- } else {
- return parent::width();
- }
- }
-
- /**
- * Set the alignment of the legend
- *
- * @param int $alignment The alignment
- */
- function setAlignment($alignment)
- {
- $this->_alignment = $alignment;
- }
-
- /**
- * Update coordinates
- *
- * @access private
- */
- function _updateCoords()
- {
- parent::_updateCoords();
-
- $parent = (is_object($this->_parent) ? get_class($this->_parent) : $this->_parent);
-
- if (strtolower($parent) == 'image_graph_plotarea') {
- $w = $this->_width();
- $h = $this->_height();
-
- if ($this->_alignment === false) {
- $this->_alignment = IMAGE_GRAPH_ALIGN_TOP + IMAGE_GRAPH_ALIGN_RIGHT;
- }
-
- if (($this->_alignment & IMAGE_GRAPH_ALIGN_BOTTOM) != 0) {
- $y = $this->_parent->_fillBottom() - $h - $this->_padding['bottom'];
- } else {
- $y = $this->_parent->_fillTop() + $this->_padding['top'];
- }
-
- if (($this->_alignment & IMAGE_GRAPH_ALIGN_LEFT) != 0) {
- $x = $this->_parent->_fillLeft() + $this->_padding['left'];
- } else {
- $x = $this->_parent->_fillRight() - $w - $this->_padding['right'];
- }
-
- $this->_setCoords($x, $y, $x + $w, $y + $h);
- }
- }
-
- /**
- * Sets Plotarea
- *
- * @param Image_Graph_Plotarea $plotarea The plotarea
- */
- function setPlotarea(& $plotarea)
- {
- if (is_a($plotarea, 'Image_Graph_Plotarea')) {
- $this->_plotareas[] =& $plotarea;
- }
- }
-
- /**
- * Sets the parent. The parent chain should ultimately be a GraPHP object
- *
- * @see Image_Graph
- * @param Image_Graph_Common $parent The parent
- * @access private
- */
- function _setParent(& $parent)
- {
- parent::_setParent($parent);
- if (count($this->_plotareas) == 0) {
- $this->setPlotarea($parent);
- }
- }
-
- /**
- * Set if this legends should show markers
- *
- * @param bool $showMarker True if markers are to be shown, false is not
- */
- function setShowMarker($showMarker)
- {
- $this->_showMarker = $showMarker;
- }
-
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
-
- if (Image_Graph_Element::_done() === false) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this));
-
- $param = $this->_parameterArray();
-
- $parent = (is_object($this->_parent) ?
- get_class($this->_parent) :
- $this->_parent
- );
-
- if (strtolower($parent) == 'image_graph_plotarea') {
- $this->_getFillStyle();
- $this->_getLineStyle();
- $this->_canvas->rectangle(
- array(
- 'x0' => $this->_left,
- 'y0' => $this->_top,
- 'x1' => $this->_right,
- 'y1' => $this->_bottom
- )
- );
-
- $param = $this->_parameterArray();
-
- $keys = array_keys($this->_plotareas);
- foreach($keys as $key) {
- $plotarea =& $this->_plotareas[$key];
- $keys2 = array_keys($plotarea->_elements);
- foreach($keys2 as $key) {
- $element =& $plotarea->_elements[$key];
- if (is_a($element, 'Image_Graph_Plot')) {
- $element->_legendSample($param);
- }
- }
- unset($keys2);
- }
- unset($keys);
- } else {
- $param0 = $param;
- $param0['simulate'] = true;
- $keys = array_keys($this->_plotareas);
- foreach($keys as $key) {
- $plotarea =& $this->_plotareas[$key];
- $keys2 = array_keys($plotarea->_elements);
- foreach($keys2 as $key) {
- $element =& $plotarea->_elements[$key];
- if (is_a($element, 'Image_Graph_Plot')) {
- $element->_legendSample($param0);
- }
- }
- unset($keys2);
- }
- unset($keys);
- if (($this->_alignment & IMAGE_GRAPH_ALIGN_VERTICAL) != 0) {
- if ($param0['x'] == $param['x']) {
- $param['y'] = $param['y'] + ($this->_height() - ($param0['y'] - $param['y']))/2;
- }
- } else {
- if ($param0['y'] == $param['y']) {
- $param['x'] = $param['x'] + ($this->_width() - ($param0['x'] - $param['x']))/2;
- }
- }
-
- $keys = array_keys($this->_plotareas);
- foreach($keys as $key) {
- $plotarea =& $this->_plotareas[$key];
- $keys2 = array_keys($plotarea->_elements);
- foreach($keys2 as $key) {
- $element =& $plotarea->_elements[$key];
- if (is_a($element, 'Image_Graph_Plot')) {
- $element->_legendSample($param);
- }
- }
- unset($keys2);
- }
- unset($keys);
- }
-
- $this->_canvas->endGroup();
-
- return true;
- }
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Line/Array.php b/config/archive/dspam/pear/Image/Graph/Line/Array.php
deleted file mode 100644
index 5d542141..00000000
--- a/config/archive/dspam/pear/Image/Graph/Line/Array.php
+++ /dev/null
@@ -1,129 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Line
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Common.php
- */
-require_once 'Image/Graph/Common.php';
-
-/**
- * A sequential array of linestyles.
- *
- * This is used for multiple objects within the same element with different line
- * styles. This is done by adding multiple line styles to a LineArrray
- * structure. The linearray will then when requested return the 'next' linestyle
- * in sequential order. It is possible to specify ID tags to each linestyle,
- * which is used to make sure some data uses a specific linestyle (i.e. in a
- * multiple-/stackedbarchart you name the {@link Image_Graph_Dataset}s and uses
- * this name as ID tag when adding the dataset's associated linestyle to the
- * linearray.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Line
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Line_Array extends Image_Graph_Common
-{
-
- /**
- * The fill array
- * @var array
- * @access private
- */
- var $_lineStyles = array ();
-
- /**
- * Add a line style to the array
- *
- * @param Image_Graph_Line $style The style to add
- */
- function add(& $style, $id = false)
- {
- if (is_a($style, 'Image_Graph_Element')) {
- parent::add($style);
- }
- if ($id === false) {
- $this->_lineStyles[] =& $style;
- } else {
- $this->_lineStyles[$id] =& $style;
- }
- reset($this->_lineStyles);
-
- }
-
- /**
- * Add a color to the array
- *
- * @param int $color The color
- * @param string $id The id or name of the color
- */
- function addColor($color, $id = false)
- {
- if ($id !== false) {
- $this->_lineStyles[$id] = $color;
- } else {
- $this->_lineStyles[] = $color;
- }
- reset($this->_lineStyles);
- }
-
- /**
- * Return the linestyle
- *
- * @return int A GD Linestyle
- * @access private
- */
- function _getLineStyle($ID = false)
- {
- if (($ID === false) || (!isset($this->_lineStyles[$ID]))) {
- $ID = key($this->_lineStyles);
- if (!next($this->_lineStyles)) {
- reset($this->_lineStyles);
- }
- }
- $lineStyle =& $this->_lineStyles[$ID];
-
- if (is_object($lineStyle)) {
- return $lineStyle->_getLineStyle($ID);
- } elseif ($lineStyle !== null) {
- return $lineStyle;
- } else {
- return parent::_getLineStyle($ID);
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Line/Dashed.php b/config/archive/dspam/pear/Image/Graph/Line/Dashed.php
deleted file mode 100644
index 448fb218..00000000
--- a/config/archive/dspam/pear/Image/Graph/Line/Dashed.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Line
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Line/Formatted.php
- */
-require_once 'Image/Graph/Line/Formatted.php';
-
-/**
- * Dashed line style.
- *
- * This style displays as a short line with a shorter space afterwards, i.e
- * 4px color1, 2px color2, 4px color1, etc.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Line
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Line_Dashed extends Image_Graph_Line_Formatted
-{
-
- /**
- * Image_Graph_DashedLine [Constructor]
- *
- * @param mixed $color1 The color for the 'dashes'
- * @param mixed $color2 The color for the 'spaces'
- */
- function Image_Graph_Line_Dashed($color1, $color2)
- {
- parent::Image_Graph_Line_Formatted(
- array(
- $color1,
- $color1,
- $color1,
- $color1,
- $color2,
- $color2
- )
- );
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Line/Dotted.php b/config/archive/dspam/pear/Image/Graph/Line/Dotted.php
deleted file mode 100644
index 8574f8da..00000000
--- a/config/archive/dspam/pear/Image/Graph/Line/Dotted.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Line
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Line/Formatted.php
- */
-require_once 'Image/Graph/Line/Formatted.php';
-
-/**
- * Dotted line style.
- *
- * This style displays as a short line with a shorter space afterwards, i.e
- * 1px color1, 1px color2, 1px color1, etc.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Line
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Line_Dotted extends Image_Graph_Line_Formatted
-{
-
- /**
- * DottedLine [Constructor]
- *
- * @param mixed $color1 The color representing the dots
- * @param mixed $color2 The color representing the spaces
- */
- function Image_Graph_Line_Dotted($color1, $color2)
- {
- parent::Image_Graph_Line_Formatted(array ($color1, $color2));
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Line/Formatted.php b/config/archive/dspam/pear/Image/Graph/Line/Formatted.php
deleted file mode 100644
index e6d0181b..00000000
--- a/config/archive/dspam/pear/Image/Graph/Line/Formatted.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Line
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Line/Solid.php
- */
-require_once 'Image/Graph/Line/Solid.php';
-
-/**
- * Formatted user defined line style.
- *
- * Use this to create a user defined line style. Specify an array of colors that are to
- * be used for displaying the line.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Line
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Line_Formatted extends Image_Graph_Line_Solid
-{
-
- /**
- * The style of the line
- *
- * @var array
- * @access private
- */
- var $_style;
-
- /**
- * Image_Graph_FormattedLine [Constructor]
- *
- * @param array $style The style of the line
- */
- function Image_Graph_Line_Formatted($style)
- {
- parent::Image_Graph_Line_Solid(reset($style));
- $this->_style = $style;
- }
-
- /**
- * Gets the line style of the element
- *
- * @return int A GD linestyle representing the line style
- * @see Image_Graph_Line
- * @access private
- */
- function _getLineStyle()
- {
- return array(
- 'color' => $this->_style,
- 'thickness' => $this->_thickness
- );
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Line/Solid.php b/config/archive/dspam/pear/Image/Graph/Line/Solid.php
deleted file mode 100644
index e77e62f1..00000000
--- a/config/archive/dspam/pear/Image/Graph/Line/Solid.php
+++ /dev/null
@@ -1,105 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Line
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Common.php
- */
-require_once 'Image/Graph/Common.php';
-
-/**
- * Simple colored line style.
- *
- * Use a color for line style.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Line
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Line_Solid extends Image_Graph_Common
-{
-
- /**
- * The thickness of the line (requires GD 2)
- * @var int
- * @access private
- */
- var $_thickness = 1;
-
- /**
- * The color of the line
- * @var mixed
- * @access private
- */
- var $_color;
-
- /**
- * Image_Graph_SolidLine [Constructor]
- *
- * @param mixed $color The color of the line
- */
- function Image_Graph_Line_Solid($color)
- {
- parent::Image_Graph_Common();
- $this->_color = $color;
- }
-
- /**
- * Set the thickness of the linestyle
- *
- * @param int $thickness The line width in pixels
- */
- function setThickness($thickness)
- {
- $this->_thickness = $thickness;
- }
-
- /**
- * Gets the line style of the element
- *
- * @return int A GD linestyle representing the line style
- * @see Image_Graph_Line
- * @access private
- */
- function _getLineStyle()
- {
- return array(
- 'color' => $this->_color,
- 'thickness' => $this->_thickness
- );
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Logo.php b/config/archive/dspam/pear/Image/Graph/Logo.php
deleted file mode 100644
index df5fe7e4..00000000
--- a/config/archive/dspam/pear/Image/Graph/Logo.php
+++ /dev/null
@@ -1,153 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - Main class for the graph creation.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Logo
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Element.php
- */
-require_once 'Image/Graph/Element.php';
-
-/**
- * Displays a logo on the canvas.
- *
- * By default the logo is displayed in the top-right corner of the canvas.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Logo
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Logo extends Image_Graph_Element
-{
-
- /**
- * The file name
- * @var stirng
- * @access private
- */
- var $_filename;
-
- /**
- * The GD Image resource
- * @var resource
- * @access private
- */
- var $_image;
-
- /**
- * Alignment of the logo
- * @var int
- * @access private
- */
- var $_alignment;
-
- /**
- * Logo [Constructor]
- *
- * @param string $filename The filename and path of the image to use for logo
- */
- function Image_Graph_Logo($filename, $alignment = IMAGE_GRAPH_ALIGN_TOP_RIGHT)
- {
- parent::Image_Graph_Element();
- $this->_filename = $filename;
- $this->_alignment = $alignment;
- }
-
- /**
- * Sets the parent. The parent chain should ultimately be a GraPHP object
- *
- * @see Image_Graph
- * @param Image_Graph_Common $parent The parent
- * @access private
- */
- function _setParent(& $parent)
- {
- parent::_setParent($parent);
- $this->_setCoords(
- $this->_parent->_left,
- $this->_parent->_top,
- $this->_parent->_right,
- $this->_parent->_bottom
- );
- }
-
- /**
- * Output the logo
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- $align = array();
-
- if ($this->_alignment & IMAGE_GRAPH_ALIGN_LEFT) {
- $x = $this->_parent->_left + 2;
- $align['horizontal'] = 'left';
- } elseif ($this->_alignment & IMAGE_GRAPH_ALIGN_RIGHT) {
- $x = $this->_parent->_right - 2;
- $align['horizontal'] = 'right';
- } else {
- $x = ($this->_parent->_left + $this->_parent->_right) / 2;
- $align['horizontal'] = 'center';
- }
-
- if ($this->_alignment & IMAGE_GRAPH_ALIGN_TOP) {
- $y = $this->_parent->_top + 2;
- $align['vertical'] = 'top';
- } elseif ($this->_alignment & IMAGE_GRAPH_ALIGN_BOTTOM) {
- $y = $this->_parent->_bottom - 2;
- $align['vertical'] = 'bottom';
- } else {
- $y = ($this->_parent->_top + $this->_parent->_bottom) / 2;
- $align['vertical'] = 'center';
- }
-
- $this->_canvas->image(
- array(
- 'x' => $x,
- 'y' => $y,
- 'filename' => $this->_filename,
- 'alignment' => $align
- )
- );
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker.php b/config/archive/dspam/pear/Image/Graph/Marker.php
deleted file mode 100644
index 1c1926fe..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker.php
+++ /dev/null
@@ -1,123 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plotarea/Element.php
- */
-require_once 'Image/Graph/Plotarea/Element.php';
-
-/**
- * Data point marker.
- *
- * The data point marker is used for marking the datapoints on a graph with some
- * visual label, fx. a cross, a text box with the value or an icon.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @abstract
- */
-class Image_Graph_Marker extends Image_Graph_Plotarea_Element
-{
-
- /**
- * Secondary marker
- * @var Marker
- * @access private
- */
- var $_secondaryMarker = false;
-
- /**
- * The 'size' of the marker, the meaning depends on the specific Marker
- * implementation
- * @var int
- * @access private
- */
- var $_size = 6;
-
- /**
- * Set the 'size' of the marker
- *
- * @param int $size The 'size' of the marker, the meaning depends on the
- * specific Marker implementation
- */
- function setSize($size)
- {
- $this->_size = $size;
- }
-
- /**
- * Set the secondary marker
- *
- * @param Marker $secondaryMarker The secondary marker
- */
- function setSecondaryMarker(& $secondaryMarker)
- {
- $this->_secondaryMarker =& $secondaryMarker;
- $this->_secondaryMarker->_setParent($this);
- }
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- if (is_a($this->_secondaryMarker, 'Image_Graph_Marker')) {
- $this->_secondaryMarker->_drawMarker($x, $y, $values);
- }
- }
-
- /**
- * Output to the canvas
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Array.php b/config/archive/dspam/pear/Image/Graph/Marker/Array.php
deleted file mode 100644
index 12fed66c..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Array.php
+++ /dev/null
@@ -1,105 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * A sequential array of markers.
- *
- * This is used for displaying different markers for datapoints on a chart.
- * This is done by adding multiple markers to a MarkerArrray structure.
- * The marker array will then when requested return the 'next' marker in
- * sequential order. It is possible to specify ID tags to each marker, which is
- * used to make sure some data uses a specific marker.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Array extends Image_Graph_Marker
-{
-
- /**
- * The marker array
- * @var array
- * @access private
- */
- var $_markers = array ();
-
- /**
- * Add a marker style to the array
- *
- * @param Marker $marker The marker to add
- */
- function add(& $marker)
- {
- if (is_a($marker, 'Image_Graph_Element')) {
- parent::add($marker);
- }
- $this->_markers[] =& $marker;
- reset($this->_markers);
- }
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- $ID = key($this->_markers);
- if (!next($this->_markers)) {
- reset($this->_markers);
- }
- $marker =& $this->_markers[$ID];
-
- if ($marker != null) {
- $marker->_drawMarker($x, $y, $values);
- }
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Asterisk.php b/config/archive/dspam/pear/Image/Graph/Marker/Asterisk.php
deleted file mode 100644
index effde5a5..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Asterisk.php
+++ /dev/null
@@ -1,109 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * Data marker as an asterisk (*)
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Asterisk extends Image_Graph_Marker
-{
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- $this->_getLineStyle();
- $this->_canvas->line(
- array(
- 'x0' => $x - $this->_size,
- 'y0' => $y - $this->_size,
- 'x1' => $x + $this->_size,
- 'y1' => $y + $this->_size
- )
- );
-
- $this->_getLineStyle();
- $this->_canvas->line(
- array(
- 'x0' => $x + $this->_size,
- 'y0' => $y - $this->_size,
- 'x1' => $x - $this->_size,
- 'y1' => $y + $this->_size
- )
- );
-
- $this->_getLineStyle();
- $this->_canvas->line(
- array(
- 'x0' => $x - $this->_size,
- 'y0' => $y,
- 'x1' => $x + $this->_size,
- 'y1' => $y
- )
- );
-
- $this->_getLineStyle();
- $this->_canvas->line(
- array(
- 'x0' => $x,
- 'y0' => $y - $this->_size,
- 'x1' => $x,
- 'y1' => $y + $this->_size
- )
- );
-
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Average.php b/config/archive/dspam/pear/Image/Graph/Marker/Average.php
deleted file mode 100644
index c4e3e7a4..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Average.php
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * A marker displaying the 'distance' to the datasets average value.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Average extends Image_Graph_Marker
-{
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- if ((isset($values['AVERAGE_Y'])) &&
- (is_a($this->_parent, 'Image_Graph_Plot')))
- {
- $point = $this->_pointXY(
- array(
- 'X' => $values['APX'],
- 'Y' => $values['AVERAGE_Y']
- )
- );
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $x, 'y0' => $y, 'x1' => $point['X'], 'y1' => $point['Y']));
-
- $this->_getLineStyle();
- $this->_canvas->line(
- array(
- 'x0' => $point['X'] - 2,
- 'y0' => $point['Y'],
- 'x1' => $point['X'] + 2,
- 'y1' => $point['Y']
- )
- );
- }
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Box.php b/config/archive/dspam/pear/Image/Graph/Marker/Box.php
deleted file mode 100644
index 5602c33d..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Box.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * Data marker as a box
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Box extends Image_Graph_Marker
-{
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the canvas
- * @param array $values The values representing the data the marker 'points' to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- $this->_getFillStyle();
- $this->_getLineStyle();
- $this->_canvas->rectangle(
- array(
- 'x0' => $x - $this->_size,
- 'y0' => $y - $this->_size,
- 'x1' => $x + $this->_size,
- 'y1' => $y + $this->_size
- )
- );
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Bubble.php b/config/archive/dspam/pear/Image/Graph/Marker/Bubble.php
deleted file mode 100644
index 180ab4e3..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Bubble.php
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker/Circle.php
- */
-require_once 'Image/Graph/Marker/Circle.php';
-
-/**
- * Display a circle with y-value percentage as radius (require GD2).
- *
- * This will display a circle centered on the datapoint with a radius calculated
- * as a percentage of the maximum value. I.e. the radius depends on the y-value
- * of the datapoint
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Bubble extends Image_Graph_Marker_Circle
-{
-
- /**
- * The radius of the marker when 100%
- * @var int
- * @access private
- */
- var $_size100Pct = 40;
-
- /**
- * Sets the maximum radius the marker can occupy
- *
- * @param int $radius The new Image_Graph_max radius
- */
- function setMaxRadius($radius)
- {
- $this->_size100Pct = $radius;
- }
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- $this->_size = $this->_size100Pct*$values['PCT_MAX_Y']/100;
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Circle.php b/config/archive/dspam/pear/Image/Graph/Marker/Circle.php
deleted file mode 100644
index 7eeb5cb6..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Circle.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * Data marker as circle (require GD2)
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Circle extends Image_Graph_Marker
-{
-
- /**
- * The 'size' of the marker, the meaning depends on the specific Marker
- * implementation
- * @var int
- * @access private
- */
- var $_size = 10;
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points' to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- $this->_getFillStyle();
- $this->_getLineStyle();
-
- $dA = 2*pi()/($this->_size*2);
- $angle = 0;
- while ($angle < 2*pi()) {
- $this->_canvas->addVertex(array('x' =>
- $x + $this->_size*cos($angle), 'y' =>
- $y - $this->_size*sin($angle)
- ));
- $angle += $dA;
- }
-
- $this->_canvas->addVertex(array('x' =>
- $x + $this->_size*cos(0), 'y' =>
- $y - $this->_size*sin(0)
- ));
-
- $this->_canvas->polygon(array('connect' => true));
-
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Cross.php b/config/archive/dspam/pear/Image/Graph/Marker/Cross.php
deleted file mode 100644
index 720f3bb4..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Cross.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * Data marker as a cross.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Cross extends Image_Graph_Marker
-{
-
- /**
- * The thickness of the plus in pixels (thickness is actually double this)
- * @var int
- * @access private
- */
- var $_thickness = 2;
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the canvas
- * @param array $values The values representing the data the marker 'points' to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- if ($this->_thickness > 0) {
- $this->_getLineStyle();
- $this->_getFillStyle();
-
- $d1 = round(0.7071067 * $this->_size); // cos/sin(45 de>)
- $d2 = round(0.7071067 * $this->_thickness); // cos/sin(45 deg)
-
- $this->_canvas->addVertex(array('x' => $x - $d1 - $d2, 'y' => $y - $d1 + $d2));
- $this->_canvas->addVertex(array('x' => $x - $d1 + $d2, 'y' => $y - $d1 - $d2));
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y - 2 * $d2));
- $this->_canvas->addVertex(array('x' => $x + $d1 - $d2, 'y' => $y - $d1 - $d2));
- $this->_canvas->addVertex(array('x' => $x + $d1 + $d2, 'y' => $y - $d1 + $d2));
- $this->_canvas->addVertex(array('x' => $x + 2 * $d2, 'y' => $y));
- $this->_canvas->addVertex(array('x' => $x + $d1 + $d2, 'y' => $y + $d1 - $d2));
- $this->_canvas->addVertex(array('x' => $x + $d1 - $d2, 'y' => $y + $d1 + $d2));
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y + 2 * $d2));
- $this->_canvas->addVertex(array('x' => $x - $d1 + $d2, 'y' => $y + $d1 + $d2));
- $this->_canvas->addVertex(array('x' => $x - $d1 - $d2, 'y' => $y + $d1 - $d2));
- $this->_canvas->addVertex(array('x' => $x - 2 * $d2, 'y' => $y));
- $this->_canvas->polygon(array('connect' => true));
- } else {
- $this->_getLineStyle();
- $this->_canvas->line(
- array(
- 'x0' => $x - $this->_size,
- 'y0' => $y - $this->_size,
- 'x1' => $x + $this->_size,
- 'y1' => $y + $this->_size
- )
- );
-
- $this->_getLineStyle();
- $this->_canvas->line(
- array(
- 'x0' => $x + $this->_size,
- 'y0' => $y - $this->_size,
- 'x1' => $x - $this->_size,
- 'y1' => $y + $this->_size
- )
- );
- }
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Diamond.php b/config/archive/dspam/pear/Image/Graph/Marker/Diamond.php
deleted file mode 100644
index 2a3d68c8..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Diamond.php
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * Data marker as a diamond.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Diamond extends Image_Graph_Marker
-{
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the canvas
- * @param array $values The values representing the data the marker 'points' to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- $this->_getFillStyle();
- $this->_getLineStyle();
- $this->_canvas->addVertex(array('x' => $x - $this->_size, 'y' => $y));
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y - $this->_size));
- $this->_canvas->addVertex(array('x' => $x + $this->_size, 'y' => $y));
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y + $this->_size));
- $this->_canvas->polygon(array('connect' => true));
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Icon.php b/config/archive/dspam/pear/Image/Graph/Marker/Icon.php
deleted file mode 100644
index d9b9456f..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Icon.php
+++ /dev/null
@@ -1,133 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * Data marker using an image as icon.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Icon extends Image_Graph_Marker
-{
-
- /**
- * Filename of the image icon
- * @var string
- * @access private
- */
- var $_filename;
-
- /**
- * X Point of the icon to use as data 'center'
- * @var int
- * @access private
- */
- var $_pointX = 0;
-
- /**
- * Y Point of the icon to use as data 'center'
- * @var int
- * @access private
- */
- var $_pointY = 0;
-
- /**
- * Create an icon marker
- *
- * @param string $filename The filename of the icon
- * @param int $width The 'new' width of the icon if it is to be resized
- * @param int $height The 'new' height of the icon if it is to be resized
- */
- function Image_Graph_Marker_Icon($filename, $width = 0, $height = 0)
- {
- parent::Image_Graph_Marker();
- $this->_filename = $filename;
- }
-
- /**
- * Set the X 'center' point of the marker
- *
- * @param int $x The X 'center' point of the marker
- */
- function setPointX($x)
- {
- $this->_pointX = $x;
- }
-
- /**
- * Set the Y 'center' point of the marker
- *
- * @param int $y The Y 'center' point of the marker
- */
- function setPointY($y)
- {
- $this->_pointY = $y;
- }
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- parent::_drawMarker($x, $y, $values);
- if ($this->_filename) {
- $this->_canvas->image(
- array(
- 'x' => $x,
- 'y' => $y,
- 'filename' => $this->_filename,
- 'alignment' => array('horizontal' => 'center', 'vertical' => 'center')
- )
- );
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Pinpoint.php b/config/archive/dspam/pear/Image/Graph/Marker/Pinpoint.php
deleted file mode 100644
index 7b87f153..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Pinpoint.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker/Icon.php
- */
-require_once 'Image/Graph/Marker/Icon.php';
-
-/**
- * Data marker using a pinpoint as marker.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Pinpoint extends Image_Graph_Marker_Icon
-{
-
- /**
- * Create the marker as a pin point
- */
- function Image_Graph_Marker_Pinpoint()
- {
- parent::Image_Graph_Marker_Icon(
- dirname(__FILE__).'/../Images/Icons/pinpoint.png'
- );
- $this->setPointX(0);
- $this->setPointY(13);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Plus.php b/config/archive/dspam/pear/Image/Graph/Marker/Plus.php
deleted file mode 100644
index 0a817cfc..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Plus.php
+++ /dev/null
@@ -1,98 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * Data marker as a plus.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Plus extends Image_Graph_Marker
-{
-
- /**
- * The thickness of the plus in pixels (thickness is actually double this)
- * @var int
- * @access private
- */
- var $_thickness = 2;
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- if ($this->_thickness > 0) {
- $this->_getLineStyle();
- $this->_getFillStyle();
- $this->_canvas->addVertex(array('x' => $x - $this->_size, 'y' => $y - $this->_thickness));
- $this->_canvas->addVertex(array('x' => $x - $this->_thickness, 'y' => $y - $this->_thickness));
- $this->_canvas->addVertex(array('x' => $x - $this->_thickness, 'y' => $y - $this->_size));
- $this->_canvas->addVertex(array('x' => $x + $this->_thickness, 'y' => $y - $this->_size));
- $this->_canvas->addVertex(array('x' => $x + $this->_thickness, 'y' => $y - $this->_thickness));
- $this->_canvas->addVertex(array('x' => $x + $this->_size, 'y' => $y - $this->_thickness));
- $this->_canvas->addVertex(array('x' => $x + $this->_size, 'y' => $y + $this->_thickness));
- $this->_canvas->addVertex(array('x' => $x + $this->_thickness, 'y' => $y + $this->_thickness));
- $this->_canvas->addVertex(array('x' => $x + $this->_thickness, 'y' => $y + $this->_size));
- $this->_canvas->addVertex(array('x' => $x - $this->_thickness, 'y' => $y + $this->_size));
- $this->_canvas->addVertex(array('x' => $x - $this->_thickness, 'y' => $y + $this->_thickness));
- $this->_canvas->addVertex(array('x' => $x - $this->_size, 'y' => $y + $this->_thickness));
- $this->_canvas->polygon(array('connect' => true));
- } else {
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $x - $this->_size, 'y0' => $y, 'x1' => $x + $this->_size, 'y1' => $y));
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $x, 'y0' => $y - $this->_size, 'x1' => $x, 'y1' => $y + $this->_size));
- }
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Pointing.php b/config/archive/dspam/pear/Image/Graph/Marker/Pointing.php
deleted file mode 100644
index 05ab94e4..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Pointing.php
+++ /dev/null
@@ -1,140 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * Data marker as a 'pointing marker'.
- *
- * Points to the data using another marker (as start and/or end)
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Pointing extends Image_Graph_Marker
-{
-
- /**
- * The starting marker
- * @var Marker
- * @access private
- */
- var $_markerStart;
-
- /**
- * The ending marker
- * @var Marker
- * @access private
- */
- var $_markerEnd;
-
- /**
- * The X offset from the 'data'
- * @var int
- * @access private
- */
- var $_deltaX = -1;
-
- /**
- * The Y offset from the 'data'
- * @var int
- * @access private
- */
- var $_deltaY = -1;
-
- /**
- * Create an pointing marker, ie a pin on a board
- *
- * @param int $deltaX The the X offset from the real 'data' point
- * @param int $deltaY The the Y offset from the real 'data' point
- * @param Marker $markerEnd The ending marker that represents 'the head of
- * the pin'
- */
- function Image_Graph_Marker_Pointing($deltaX, $deltaY, & $markerEnd)
- {
- parent::Image_Graph_Marker();
- $this->_deltaX = $deltaX;
- $this->_deltaY = $deltaY;
- $this->_markerStart = null;
- $this->_markerEnd =& $markerEnd;
- }
-
- /**
- * Sets the starting marker, ie the tip of the pin on a board
- *
- * @param Marker $markerStart The starting marker that represents 'the tip
- * of the pin'
- */
- function setMarkerStart(& $markerStart)
- {
- $this->_markerStart =& $markerStart;
- $this->_markerStart->_setParent($this);
- }
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- parent::_drawMarker($x, $y, $values);
- if ($this->_markerStart) {
- $this->_markerStart->_setParent($this);
- $this->_markerStart->_drawMarker($x, $y, $values);
- }
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $x, 'y0' => $y, 'x1' => $x + $this->_deltaX, 'y1' => $y + $this->_deltaY));
- $this->_markerEnd->_setParent($this);
- $this->_markerEnd->_drawMarker(
- $x + $this->_deltaX,
- $y + $this->_deltaY,
- $values
- );
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Pointing/Angular.php b/config/archive/dspam/pear/Image/Graph/Marker/Pointing/Angular.php
deleted file mode 100644
index 93b8b7cf..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Pointing/Angular.php
+++ /dev/null
@@ -1,105 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker/Pointing.php
- */
-require_once 'Image/Graph/Marker/Pointing.php';
-
-/**
- * Marker that points 'away' from the graph.
- *
- * Use this as a marker for displaying another marker pointing to the original
- * point on the graph - where the 'pointer' is calculated as line orthogonal to
- * a line drawn between the points neighbours to both sides (an approximate
- * tangent). This should make an the pointer appear to point 'straight' out from
- * the graph. The 'head' of the pointer is then another marker of any choice.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Pointing_Angular extends Image_Graph_Marker_Pointing
-{
-
- /**
- * The length of the angular marker
- * @var int
- * @access private
- */
- var $_radius;
-
- /**
- * Image_Graph_AngularPointingMarker [Constructor]
- * @param int $radius The 'length' of the pointer
- * @param Marker $markerEnd The ending marker that represents 'the head of
- * the pin'
- */
- function Image_Graph_Marker_Pointing_Angular($radius, & $markerEnd)
- {
- parent::Image_Graph_Marker_Pointing(0, 0, $markerEnd);
- $this->_radius = $radius;
- }
-
- /**
- * Draw the marker on the canvas
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- if ((isset($values['LENGTH'])) && ($values['LENGTH'] != 0)) {
- $this->_deltaX = - $values['AX'] * $this->_radius / $values['LENGTH'];
- $this->_deltaY = - $values['AY'] * $this->_radius / $values['LENGTH'];
- }
-
- if ((isset($values['NPY'])) && (isset($values['APY'])) &&
- (isset($values['PPY'])) && ($values['NPY'] > $values['APY']) &&
- ($values['PPY'] > $values['APY']))
- {
- $this->_deltaX = - $this->_deltaX;
- $this->_deltaY = - $this->_deltaY;
- }
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Pointing/Radial.php b/config/archive/dspam/pear/Image/Graph/Marker/Pointing/Radial.php
deleted file mode 100644
index ce1a0aac..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Pointing/Radial.php
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker/Pointing.php
- */
-require_once 'Image/Graph/Marker/Pointing.php';
-
-/**
- * A pointing marker in a random angle from the data
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Pointing_Radial extends Image_Graph_Marker_Pointing
-{
-
- /**
- * The radius of the radial marker
- * @var int
- * @access private
- */
- var $_radius;
-
- /**
- * Create an radial pointing marker, ie a marker on a defined distance from
- * the data
- * @param int $radius The 'length' of the pointer
- * @param Marker $markerEnd The ending marker that represents 'the head of
- * the pin'
- */
- function Image_Graph_Marker_Pointing_Radial($radius, & $markerEnd)
- {
- parent::Image_Graph_Marker_Pointing(0, 0, $markerEnd);
- $this->_radius = $radius;
- }
-
- /**
- * Draw the marker on the canvas
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- $angle = pi() * rand(0, 360) / 180;
- $this->_deltaX = $this->_radius * cos($angle);
- $this->_deltaY = $this->_radius * sin($angle);
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/ReversePinpoint.php b/config/archive/dspam/pear/Image/Graph/Marker/ReversePinpoint.php
deleted file mode 100644
index 57e945ab..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/ReversePinpoint.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker/Icon.php
- */
-require_once 'Image/Graph/Marker/Icon.php';
-
-/**
- * Data marker using a (reverse) pinpoint as marker.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_ReversePinpoint extends Image_Graph_Marker_Icon
-{
-
- /**
- * Create the marker as a reverse pin point
- */
- function Image_Graph_Marker_ReversePinpoint()
- {
- parent::Image_Graph_Marker_Icon(
- dirname(__FILE__).'/../Images/Icons/pinpointr.png'
- );
- $this->setPointX(10);
- $this->setPointY(13);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Star.php b/config/archive/dspam/pear/Image/Graph/Marker/Star.php
deleted file mode 100644
index 67b2b9b3..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Star.php
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * Data marker as a triangle.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Star extends Image_Graph_Marker
-{
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- $this->_getFillStyle();
- $this->_getLineStyle();
-
- $d = $this->_size / 5;
- $x = round($x);
- $y = round($y);
-
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y - $this->_size));
- $this->_canvas->addVertex(array('x' => $x + round($d), 'y' => $y - round($d)));
- $this->_canvas->addVertex(array('x' => $x + $this->_size, 'y' => $y - round($d)));
- $this->_canvas->addVertex(array('x' => $x + round(2 * $d), 'y' => $y + round($d)));
- $this->_canvas->addVertex(array('x' => $x + round(3 * $d), 'y' => $y + $this->_size));
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y + round(3 * $d)));
- $this->_canvas->addVertex(array('x' => $x - round(3 * $d), 'y' => $y + $this->_size));
- $this->_canvas->addVertex(array('x' => $x - round(2 * $d), 'y' => $y + round($d)));
- $this->_canvas->addVertex(array('x' => $x - $this->_size, 'y' => $y - round($d)));
- $this->_canvas->addVertex(array('x' => $x - round($d), 'y' => $y - round($d)));
- $this->_canvas->polygon(array('connect' => true));
-
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Triangle.php b/config/archive/dspam/pear/Image/Graph/Marker/Triangle.php
deleted file mode 100644
index 626f2589..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Triangle.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * Data marker as a triangle.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Triangle extends Image_Graph_Marker
-{
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- $this->_getFillStyle();
- $this->_getLineStyle();
- $this->_canvas->addVertex(array('x' => $x - $this->_size, 'y' => $y + $this->_size));
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y - $this->_size));
- $this->_canvas->addVertex(array('x' => $x + $this->_size, 'y' => $y + $this->_size));
- $this->_canvas->polygon(array('connect' => true));
- parent::_drawMarker($x, $y, $values);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Marker/Value.php b/config/archive/dspam/pear/Image/Graph/Marker/Value.php
deleted file mode 100644
index 24f142f3..00000000
--- a/config/archive/dspam/pear/Image/Graph/Marker/Value.php
+++ /dev/null
@@ -1,214 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Marker.php
- */
-require_once 'Image/Graph/Marker.php';
-
-/**
- * A marker showing the data value.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Marker
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Marker_Value extends Image_Graph_Marker
-{
-
- /**
- * Datapreproccesor to format the value
- * @var DataPreprocessor
- * @access private
- */
- var $_dataPreprocessor = null;
-
- /**
- * Which value to use from the data set, ie the X or Y value
- * @var int
- * @access private
- */
- var $_useValue;
-
- /**
- * Create a value marker, ie a box containing the value of the 'pointing
- * data'
- *
- * @param int $useValue Defines which value to use from the dataset, i.e. the
- * X or Y value
- */
- function Image_Graph_Marker_Value($useValue = IMAGE_GRAPH_VALUE_X)
- {
- parent::Image_Graph_Marker();
- $this->_padding = array('left' => 2, 'top' => 2, 'right' => 2, 'bottom' => 2);
- $this->_useValue = $useValue;
- $this->_fillStyle = 'white';
- $this->_borderStyle = 'black';
- }
-
- /**
- * Sets the background fill style of the element
- *
- * @param Image_Graph_Fill $background The background
- * @see Image_Graph_Fill
- */
- function setBackground(& $background)
- {
- $this->setFillStyle($background);
- }
-
- /**
- * Sets the background color of the element
- *
- * @param mixed $color The color
- */
- function setBackgroundColor($color)
- {
- $this->setFillColor($color);
- }
-
- /**
- * Sets a data preprocessor for formatting the values
- *
- * @param DataPreprocessor $dataPreprocessor The data preprocessor
- * @return Image_Graph_DataPreprocessor The data preprocessor
- */
- function &setDataPreprocessor(& $dataPreprocessor)
- {
- $this->_dataPreprocessor =& $dataPreprocessor;
- return $dataPreprocessor;
- }
-
- /**
- * Get the value to display
- *
- * @param array $values The values representing the data the marker 'points'
- * to
- * @return string The display value, this is the pre-preprocessor value, to
- * support for customized with multiple values. i.e show 'x = y' or '(x, y)'
- * @access private
- */
- function _getDisplayValue($values)
- {
- switch ($this->_useValue) {
- case IMAGE_GRAPH_VALUE_X:
- $value = $values['X'];
- break;
-
- case IMAGE_GRAPH_PCT_X_MIN:
- $value = $values['PCT_MIN_X'];
- break;
-
- case IMAGE_GRAPH_PCT_X_MAX:
- $value = $values['PCT_MAX_X'];
- break;
-
- case IMAGE_GRAPH_PCT_Y_MIN:
- $value = $values['PCT_MIN_Y'];
- break;
-
- case IMAGE_GRAPH_PCT_Y_MAX:
- $value = $values['PCT_MAX_Y'];
- break;
-
- case IMAGE_GRAPH_PCT_Y_TOTAL:
- if (isset($values['SUM_Y'])) {
- $value = 100 * $values['Y'] / $values['SUM_Y'];
- }
- else {
- $value = 0;
- }
- break;
-
- case IMAGE_GRAPH_POINT_ID:
- $value = $values['ID'];
- break;
-
- default:
- $value = $values['Y'];
- break;
- }
- return $value;
- }
-
- /**
- * Draw the marker on the canvas
- *
- * @param int $x The X (horizontal) position (in pixels) of the marker on
- * the canvas
- * @param int $y The Y (vertical) position (in pixels) of the marker on the
- * canvas
- * @param array $values The values representing the data the marker 'points'
- * to
- * @access private
- */
- function _drawMarker($x, $y, $values = false)
- {
- parent::_drawMarker($x, $y, $values);
-
- $value = $this->_getDisplayValue($values);
-
- if ($this->_dataPreprocessor) {
- $value = $this->_dataPreprocessor->_process($value);
- }
-
- if ($this->_defaultFontOptions !== false) {
- $this->_canvas->setFont($this->_defaultFontOptions);
- } else {
- $this->_canvas->setFont($this->_getFont());
- }
-
- $width = $this->_canvas->textWidth($value);
- $height = $this->_canvas->textHeight($value);
- $offsetX = $width/2 + $this->_padding['left'];
- $offsetY = $height/2 + $this->_padding['top'];
-
- $this->_getFillStyle();
- $this->_getBorderStyle();
- $this->_canvas->rectangle(
- array(
- 'x0' => $x - $offsetX,
- 'y0' => $y - $offsetY,
- 'x1' => $x + $offsetX,
- 'y1' => $y + $offsetY
- )
- );
-
- $this->write($x, $y, $value, IMAGE_GRAPH_ALIGN_CENTER);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot.php b/config/archive/dspam/pear/Image/Graph/Plot.php
deleted file mode 100644
index 4a6c16d3..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot.php
+++ /dev/null
@@ -1,824 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plotarea/Element.php
- */
-require_once 'Image/Graph/Plotarea/Element.php';
-
-/**
- * Framework for a chart
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @abstract
- */
-class Image_Graph_Plot extends Image_Graph_Plotarea_Element
-{
-
- /**
- * The dataset to plot
- * @var Dataset
- * @access private
- */
- var $_dataset;
-
- /**
- * The marker to plot the data set as
- * @var Marker
- * @access private
- */
- var $_marker = null;
-
- /**
- * The dataselector to use for data marking
- * @var DataSelector
- * @access private
- */
- var $_dataSelector = null;
-
- /**
- * The Y axis to associate the plot with
- * @var int
- * @access private
- */
- var $_axisY = IMAGE_GRAPH_AXIS_Y;
-
- /**
- * The type of the plot if multiple datasets are used
- * @var string
- * @access private
- */
- var $_multiType = 'normal';
-
- /**
- * The title of the plot, used for legending in case of simple plots
- * @var string
- * @access private
- */
- var $_title = 'plot';
-
- /**
- * PlotType [Constructor]
- *
- * Valid values for multiType are:
- *
- * 'normal' Plot is normal, multiple datasets are displayes next to one
- * another
- *
- * 'stacked' Datasets are stacked on top of each other
- *
- * 'stacked100pct' Datasets are stacked and displayed as percentages of the
- * total sum
- *
- * I no title is specified a default is used, which is basically the plot
- * type (fx. for a 'Image_Graph_Plot_Smoothed_Area' default title is
- * 'Smoothed Area')
- *
- * @param Image_Graph_Dataset $dataset The data set (value containter) to
- * plot or an array of datasets
- * @param string $multiType The type of the plot
- * @param string $title The title of the plot (used for legends,
- * {@link Image_Graph_Legend})
- */
- function Image_Graph_Plot(& $dataset, $multiType = 'normal', $title = '')
- {
- if (!is_a($dataset, 'Image_Graph_Dataset')) {
- if (is_array($dataset)) {
- $keys = array_keys($dataset);
- foreach ($keys as $key) {
- if (!is_a($dataset[$key], 'Image_Graph_Dataset')) {
- $this->_error('Invalid dataset passed to ' . get_class($this));
- }
- }
- unset($keys);
- } else {
- $this->_error('Invalid dataset passed to ' . get_class($this));
- }
- }
-
- parent::Image_Graph_Common();
- if ($dataset) {
- if (is_array($dataset)) {
- $this->_dataset =& $dataset;
- } else {
- $this->_dataset = array(&$dataset);
- }
- }
- if ($title) {
- $this->_title = $title;
- } else {
- $this->_title = str_replace('_', ' ', substr(get_class($this), 17));
- }
-
- $multiType = strtolower($multiType);
- if (($multiType == 'normal') ||
- ($multiType == 'stacked') ||
- ($multiType == 'stacked100pct'))
- {
- $this->_multiType = $multiType;
- } else {
- $this->_error(
- 'Invalid multitype: ' . $multiType .
- ' expected (normal|stacked|stacked100pct)'
- );
- $this->_multiType = 'normal';
- }
- }
-
- /**
- * Sets the title of the plot, used for legend
- *
- * @param string $title The title of the plot
- */
- function setTitle($title)
- {
- $this->_title = $title;
- }
-
- /**
- * Parses the URL mapping data in the point and adds it to the parameter array used by
- * Image_Canvas
- *
- * @param array $point The data point (from the dataset)
- * @param array $canvasData The The for the canvas method
- * @return array The union of the canvas data points and the appropriate points for the dataset
- * @access private
- */
- function _mergeData($point, $canvasData)
- {
- if (isset($point['data'])) {
- if (isset($point['data']['url'])) {
- $canvasData['url'] = $point['data']['url'];
- }
- if (isset($point['data']['target'])) {
- $canvasData['target'] = $point['data']['target'];
- }
- if (isset($point['data']['alt'])) {
- $canvasData['alt'] = $point['data']['alt'];
- }
- if (isset($point['data']['htmltags'])) {
- $canvasData['htmltags'] = $point['data']['htmltags'];
- }
- }
-
- return $canvasData;
- }
-
- /**
- * Sets the Y axis to plot the data
- *
- * @param int $axisY The Y axis (either IMAGE_GRAPH_AXIS_Y / 'y' or
- * IMAGE_GRAPH_AXIS_Y_SECONDARY / 'ysec' (defaults to IMAGE_GRAPH_AXIS_Y))
- * @access private
- */
- function _setAxisY($axisY)
- {
- if ($axisY == 'y') {
- $this->_axisY = IMAGE_GRAPH_AXIS_Y;
- } elseif ($axisY == 'ysec') {
- $this->_axisY = IMAGE_GRAPH_AXIS_Y_SECONDARY;
- } else {
- $this->_axisY = $axisY;
- }
- }
-
- /**
- * Sets the marker to 'display' data points on the graph
- *
- * @param Marker $marker The marker
- */
- function &setMarker(& $marker)
- {
- $this->add($marker);
- $this->_marker =& $marker;
- return $marker;
- }
-
- /**
- * Sets the dataselector to specify which data should be displayed on the
- * plot as markers and which are not
- *
- * @param DataSelector $dataSelector The dataselector
- */
- function setDataSelector(& $dataSelector)
- {
- $this->_dataSelector =& $dataSelector;
- }
-
- /**
- * Calculate marker point data
- *
- * @param array Point The point to calculate data for
- * @param array NextPoint The next point
- * @param array PrevPoint The previous point
- * @param array Totals The pre-calculated totals, if needed
- * @return array An array containing marker point data
- * @access private
- */
- function _getMarkerData($point, $nextPoint, $prevPoint, & $totals)
- {
- if (is_array($this->_dataset)) {
- if ($this->_multiType == 'stacked') {
- if (!isset($totals['SUM_Y'])) {
- $totals['SUM_Y'] = array();
- }
- $x = $point['X'];
- if (!isset($totals['SUM_Y'][$x])) {
- $totals['SUM_Y'][$x] = 0;
- }
- } elseif ($this->_multiType == 'stacked100pct') {
- $x = $point['X'];
- if ($totals['TOTAL_Y'][$x] != 0) {
- if (!isset($totals['SUM_Y'])) {
- $totals['SUM_Y'] = array();
- }
- if (!isset($totals['SUM_Y'][$x])) {
- $totals['SUM_Y'][$x] = 0;
- }
- }
- }
-
- if (isset($totals['ALL_SUM_Y'])) {
- $point['SUM_Y'] = $totals['ALL_SUM_Y'];
- }
-
- if (!$prevPoint) {
- $point['AX'] = -5;
- $point['AY'] = 5;
- $point['PPX'] = 0;
- $point['PPY'] = 0;
- $point['NPX'] = $nextPoint['X'];
- $point['NPY'] = $nextPoint['Y'];
- } elseif (!$nextPoint) {
- $point['AX'] = 5;
- $point['AY'] = 5;
- $point['PPX'] = $prevPoint['X'];
- $point['PPY'] = $prevPoint['Y'];
- $point['NPX'] = 0;
- $point['NPY'] = 0;
- } else {
- $point['AX'] = $this->_pointY($prevPoint) - $this->_pointY($nextPoint);
- $point['AY'] = $this->_pointX($nextPoint) - $this->_pointX($prevPoint);
- $point['PPX'] = $prevPoint['X'];
- $point['PPY'] = $prevPoint['Y'];
- $point['NPX'] = $nextPoint['X'];
- $point['NPY'] = $nextPoint['Y'];
- }
-
- $point['APX'] = $point['X'];
- $point['APY'] = $point['Y'];
-
- if ((isset($totals['MINIMUM_X'])) && ($totals['MINIMUM_X'] != 0)) {
- $point['PCT_MIN_X'] = 100 * $point['X'] / $totals['MINIMUM_X'];
- }
- if ((isset($totals['MAXIMUM_X'])) && ($totals['MAXIMUM_X'] != 0)) {
- $point['PCT_MAX_X'] = 100 * $point['X'] / $totals['MAXIMUM_X'];
- }
-
- if ((isset($totals['MINIMUM_Y'])) && ($totals['MINIMUM_Y'] != 0)) {
- $point['PCT_MIN_Y'] = 100 * $point['Y'] / $totals['MINIMUM_Y'];
- }
- if ((isset($totals['MAXIMUM_Y'])) && ($totals['MAXIMUM_Y'] != 0)) {
- $point['PCT_MAX_Y'] = 100 * $point['Y'] / $totals['MAXIMUM_Y'];
- }
-
- $point['LENGTH'] = sqrt($point['AX'] * $point['AX'] +
- $point['AY'] * $point['AY']);
-
- if ((isset($point['LENGTH'])) && ($point['LENGTH'] != 0)) {
- $point['ANGLE'] = asin($point['AY'] / $point['LENGTH']);
- }
-
- if ((isset($point['AX'])) && ($point['AX'] > 0)) {
- $point['ANGLE'] = pi() - $point['ANGLE'];
- }
-
- if ($this->_parent->_horizontal) {
- $point['MARKER_Y1'] = $this->_pointY($point) -
- (isset($totals['WIDTH']) ? $totals['WIDTH'] : 0);
-
- $point['MARKER_Y2'] = $this->_pointY($point) +
- (isset($totals['WIDTH']) ? $totals['WIDTH'] : 0);
-
- $point['COLUMN_WIDTH'] = abs($point['MARKER_Y2'] -
- $point['MARKER_Y1']) / count($this->_dataset);
-
- $point['MARKER_Y'] = $point['MARKER_Y1'] +
- ((isset($totals['NUMBER']) ? $totals['NUMBER'] : 0) + 0.5) *
- $point['COLUMN_WIDTH'];
-
- $point['MARKER_X'] = $this->_pointX($point);
-
- if ($this->_multiType == 'stacked') {
- $point['MARKER_Y'] =
- ($point['MARKER_Y1'] + $point['MARKER_Y2']) / 2;
-
- $P1 = array('Y' => $totals['SUM_Y'][$x]);
- $P2 = array('Y' => $totals['SUM_Y'][$x] + $point['Y']);
-
- $point['MARKER_X'] =
- ($this->_pointX($P1) + $this->_pointX($P2)) / 2;
- } elseif ($this->_multiType == 'stacked100pct') {
- $x = $point['X'];
- if ($totals['TOTAL_Y'][$x] != 0) {
- $point['MARKER_Y'] =
- ($point['MARKER_Y1'] + $point['MARKER_Y2']) / 2;
-
- $P1 = array(
- 'Y' => 100 * $totals['SUM_Y'][$x] / $totals['TOTAL_Y'][$x]
- );
-
- $P2 = array(
- 'Y' => 100 * ($totals['SUM_Y'][$x] + $point['Y']) / $totals['TOTAL_Y'][$x]
- );
-
- $point['MARKER_X'] =
- ($this->_pointX($P1) + $this->_pointX($P2)) / 2;
- } else {
- $point = false;
- }
- }
- }
- else {
- $point['MARKER_X1'] = $this->_pointX($point) -
- (isset($totals['WIDTH']) ? $totals['WIDTH'] : 0);
-
- $point['MARKER_X2'] = $this->_pointX($point) +
- (isset($totals['WIDTH']) ? $totals['WIDTH'] : 0);
-
- $point['COLUMN_WIDTH'] = abs($point['MARKER_X2'] -
- $point['MARKER_X1']) / count($this->_dataset);
-
- $point['MARKER_X'] = $point['MARKER_X1'] +
- ((isset($totals['NUMBER']) ? $totals['NUMBER'] : 0) + 0.5) *
- $point['COLUMN_WIDTH'];
-
- $point['MARKER_Y'] = $this->_pointY($point);
-
- if ($this->_multiType == 'stacked') {
- $point['MARKER_X'] =
- ($point['MARKER_X1'] + $point['MARKER_X2']) / 2;
-
- $P1 = array('Y' => $totals['SUM_Y'][$x]);
- $P2 = array('Y' => $totals['SUM_Y'][$x] + $point['Y']);
-
- $point['MARKER_Y'] =
- ($this->_pointY($P1) + $this->_pointY($P2)) / 2;
- } elseif ($this->_multiType == 'stacked100pct') {
- $x = $point['X'];
- if ($totals['TOTAL_Y'][$x] != 0) {
- $point['MARKER_X'] =
- ($point['MARKER_X1'] + $point['MARKER_X2']) / 2;
-
- $P1 = array(
- 'Y' => 100 * $totals['SUM_Y'][$x] / $totals['TOTAL_Y'][$x]
- );
-
- $P2 = array(
- 'Y' => 100 * ($totals['SUM_Y'][$x] + $point['Y']) / $totals['TOTAL_Y'][$x]
- );
-
- $point['MARKER_Y'] =
- ($this->_pointY($P1) + $this->_pointY($P2)) / 2;
- } else {
- $point = false;
- }
- }
- }
- return $point;
- }
- }
-
- /**
- * Draws markers on the canvas
- *
- * @access private
- */
- function _drawMarker()
- {
- if (($this->_marker) && (is_array($this->_dataset))) {
- $this->_canvas->startGroup(get_class($this) . '_marker');
-
- $totals = $this->_getTotals();
- $totals['WIDTH'] = $this->width() / ($this->_maximumX() + 2) / 2;
-
- $number = 0;
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $totals['MINIMUM_X'] = $dataset->minimumX();
- $totals['MAXIMUM_X'] = $dataset->maximumX();
- $totals['MINIMUM_Y'] = $dataset->minimumY();
- $totals['MAXIMUM_Y'] = $dataset->maximumY();
- $totals['NUMBER'] = $number ++;
- $dataset->_reset();
- while ($point = $dataset->_next()) {
- $prevPoint = $dataset->_nearby(-2);
- $nextPoint = $dataset->_nearby();
-
- $x = $point['X'];
- $y = $point['Y'];
- if (((!is_object($this->_dataSelector)) ||
- ($this->_dataSelector->_select($point))) && ($point['Y'] !== null))
- {
-
- $point = $this->_getMarkerData(
- $point,
- $nextPoint,
- $prevPoint,
- $totals
- );
-
- if (is_array($point)) {
- $this->_marker->_drawMarker(
- $point['MARKER_X'],
- $point['MARKER_Y'],
- $point
- );
- }
- }
- if (!isset($totals['SUM_Y'])) {
- $totals['SUM_Y'] = array();
- }
- if (isset($totals['SUM_Y'][$x])) {
- $totals['SUM_Y'][$x] += $y;
- } else {
- $totals['SUM_Y'][$x] = $y;
- }
- }
- }
- unset($keys);
- $this->_canvas->endGroup();
- }
- }
-
- /**
- * Get the minimum X value from the dataset
- *
- * @return double The minimum X value
- * @access private
- */
- function _minimumX()
- {
- if (!is_array($this->_dataset)) {
- return 0;
- }
-
- $min = false;
- if (is_array($this->_dataset)) {
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- if ($min === false) {
- $min = $this->_dataset[$key]->minimumX();
- } else {
- $min = min($min, $this->_dataset[$key]->minimumX());
- }
- }
- unset($keys);
- }
- return $min;
- }
-
- /**
- * Get the maximum X value from the dataset
- *
- * @return double The maximum X value
- * @access private
- */
- function _maximumX()
- {
- if (!is_array($this->_dataset)) {
- return 0;
- }
-
- $max = 0;
- if (is_array($this->_dataset)) {
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $max = max($max, $this->_dataset[$key]->maximumX());
- }
- unset($keys);
- }
- return $max;
- }
-
- /**
- * Get the minimum Y value from the dataset
- *
- * @return double The minimum Y value
- * @access private
- */
- function _minimumY()
- {
- if (!is_array($this->_dataset)) {
- return 0;
- }
-
- $min = false;
- if (is_array($this->_dataset)) {
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- if ($this->_multiType == 'normal') {
- if ($min === false) {
- $min = $this->_dataset[$key]->minimumY();
- } else {
- $min = min($min, $this->_dataset[$key]->minimumY());
- }
- } else {
- if ($min === false) {
- $min = 0;
- }
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- while ($point = $dataset->_next()) {
- if ($point['Y'] < 0) {
- $x = $point['X'];
- if ((!isset($total)) || (!isset($total[$x]))) {
- $total[$x] = $point['Y'];
- } else {
- $total[$x] += $point['Y'];
- }
- if (isset($min)) {
- $min = min($min, $total[$x]);
- } else {
- $min = $total[$x];
- }
- }
- }
- }
- }
- unset($keys);
- }
- return $min;
- }
-
- /**
- * Get the maximum Y value from the dataset
- *
- * @return double The maximum Y value
- * @access private
- */
- function _maximumY()
- {
- if ($this->_multiType == 'stacked100pct') {
- return 100;
- }
-
- $maxY = 0;
- if (is_array($this->_dataset)) {
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
-
- if ($this->_multiType == 'normal') {
- if (isset($maxY)) {
- $maxY = max($maxY, $dataset->maximumY());
- } else {
- $maxY = $dataset->maximumY();
- }
- } else {
- $dataset->_reset();
- while ($point = $dataset->_next()) {
- if ($point['Y'] > 0) {
- $x = $point['X'];
- if ((!isset($total)) || (!isset($total[$x]))) {
- $total[$x] = $point['Y'];
- } else {
- $total[$x] += $point['Y'];
- }
- if (isset($maxY)) {
- $maxY = max($maxY, $total[$x]);
- } else {
- $maxY = $total[$x];
- }
- }
- }
- }
- }
- unset($keys);
- }
- return $maxY;
- }
-
- /**
- * Get the X pixel position represented by a value
- *
- * @param double $point The value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _pointX($point)
- {
- $point['AXIS_Y'] = $this->_axisY;
- return parent::_pointX($point);
- }
-
- /**
- * Get the Y pixel position represented by a value
- *
- * @param double $point the value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _pointY($point)
- {
- $point['AXIS_Y'] = $this->_axisY;
- return parent::_pointY($point);
- }
-
- /**
- * Update coordinates
- *
- * @access private
- */
- function _updateCoords()
- {
- $this->_setCoords($this->_parent->_plotLeft, $this->_parent->_plotTop, $this->_parent->_plotRight, $this->_parent->_plotBottom);
- parent::_updateCoords();
- }
-
- /**
- * Get the dataset
- *
- * @return Image_Graph_Dataset The dataset(s)
- */
- function &dataset()
- {
- return $this->_dataset;
- }
-
- /**
- * Calulate totals
- *
- * @return array An associated array with the totals
- * @access private
- */
- function _getTotals()
- {
- $total = array(
- 'MINIMUM_X' => $this->_minimumX(),
- 'MAXIMUM_X' => $this->_maximumX(),
- 'MINIMUM_Y' => $this->_minimumY(),
- 'MAXIMUM_Y' => $this->_maximumY()
- );
- $total['ALL_SUM_Y'] = 0;
-
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
-
- $dataset->_reset();
- while ($point = $dataset->_next()) {
- $x = $point['X'];
-
- if (is_numeric($point['Y'])) {
- $total['ALL_SUM_Y'] += $point['Y'];
- if (isset($total['TOTAL_Y'][$x])) {
- $total['TOTAL_Y'][$x] += $point['Y'];
- } else {
- $total['TOTAL_Y'][$x] = $point['Y'];
- }
- }
-
- if (is_numeric($point['X'])) {
- if (isset($total['TOTAL_X'][$x])) {
- $total['TOTAL_X'][$x] += $point['X'];
- } else {
- $total['TOTAL_X'][$x] = $point['X'];
- }
- }
- }
- }
- unset($keys);
- return $total;
- }
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $this->_canvas->rectangle(array('x0' => $x0, 'y0' => $y0, 'x1' => $x1, 'y1' => $y1));
- }
-
- /**
- * Draw a sample for use with legend
- *
- * @param array $param The parameters for the legend
- * @access private
- */
- function _legendSample(&$param)
- {
- if (!is_array($this->_dataset)) {
- return false;
- }
-
- if (is_a($this->_fillStyle, 'Image_Graph_Fill')) {
- $this->_fillStyle->_reset();
- }
-
- $count = 0;
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $count++;
-
- $caption = ($dataset->_name ? $dataset->_name : $this->_title);
-
- $this->_canvas->setFont($param['font']);
- $width = 20 + $param['width'] + $this->_canvas->textWidth($caption);
- $param['maxwidth'] = max($param['maxwidth'], $width);
- $x2 = $param['x'] + $width;
- $y2 = $param['y'] + $param['height'] + 5;
-
- if ((($param['align'] & IMAGE_GRAPH_ALIGN_VERTICAL) != 0) && ($y2 > $param['bottom'])) {
- $param['y'] = $param['top'];
- $param['x'] = $x2;
- $y2 = $param['y'] + $param['height'];
- } elseif ((($param['align'] & IMAGE_GRAPH_ALIGN_VERTICAL) == 0) && ($x2 > $param['right'])) {
- $param['x'] = $param['left'];
- $param['y'] = $y2;
- $x2 = $param['x'] + 20 + $param['width'] + $this->_canvas->textWidth($caption);
- }
-
- $x = $x0 = $param['x'];
- $y = $param['y'];
- $y0 = $param['y'];
- $x1 = $param['x'] + $param['width'];
- $y1 = $param['y'] + $param['height'];
-
- if (!isset($param['simulate'])) {
- $this->_getFillStyle($key);
- $this->_getLineStyle();
- $this->_drawLegendSample($x0, $y0, $x1, $y1);
-
- if (($this->_marker) && ($dataset) && ($param['show_marker'])) {
- $dataset->_reset();
- $point = $dataset->_next();
- $prevPoint = $dataset->_nearby(-2);
- $nextPoint = $dataset->_nearby();
-
- $tmp = array();
- $point = $this->_getMarkerData($point, $nextPoint, $prevPoint, $tmp);
- if (is_array($point)) {
- $point['MARKER_X'] = $x+$param['width']/2;
- $point['MARKER_Y'] = $y;
- unset ($point['AVERAGE_Y']);
- $this->_marker->_drawMarker($point['MARKER_X'], $point['MARKER_Y'], $point);
- }
- }
- $this->write($x + $param['width'] + 10, $y + $param['height'] / 2, $caption, IMAGE_GRAPH_ALIGN_CENTER_Y | IMAGE_GRAPH_ALIGN_LEFT, $param['font']);
- }
-
- if (($param['align'] & IMAGE_GRAPH_ALIGN_VERTICAL) != 0) {
- $param['y'] = $y2;
- } else {
- $param['x'] = $x2;
- }
- }
- unset($keys);
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Area.php b/config/archive/dspam/pear/Image/Graph/Plot/Area.php
deleted file mode 100644
index a5288e1a..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Area.php
+++ /dev/null
@@ -1,194 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * Area Chart plot.
- *
- * An area chart plots all data points similar to a {@link
- * Image_Graph_Plot_Line}, but the area beneath the line is filled and the whole
- * area 'the-line', 'the right edge', 'the x-axis' and 'the left edge' is
- * bounded. Smoothed charts are only supported with non-stacked types
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plot_Area extends Image_Graph_Plot
-{
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $dx = abs($x1 - $x0) / 3;
- $dy = abs($y1 - $y0) / 3;
- $this->_canvas->addVertex(array('x' => $x0, 'y' => $y1));
- $this->_canvas->addVertex(array('x' => $x0, 'y' => $y0 + $dy));
- $this->_canvas->addVertex(array('x' => $x0 + $dx, 'y' => $y0));
- $this->_canvas->addVertex(array('x' => $x0 + 2*$dx, 'y' => $y0 + 2*$dy));
- $this->_canvas->addVertex(array('x' => $x1, 'y' => $y0 + $dy));
- $this->_canvas->addVertex(array('x' => $x1, 'y' => $y1));
- $this->_canvas->polygon(array('connect' => true));
- }
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
-
- $this->_clip(true);
-
- $base = array();
- if ($this->_multiType == 'stacked') {
- reset($this->_dataset);
- $key = key($this->_dataset);
- $dataset =& $this->_dataset[$key];
-
- $first = $dataset->first();
- $point = array ('X' => $first['X'], 'Y' => '#min_pos#');
- $base[] = array();
- $base[] = $this->_pointY($point);
- $first = $this->_pointX($point);
- $base[] = $first;
-
- $last = $dataset->last();
- $point = array ('X' => $last['X'], 'Y' => '#min_pos#');
- $base[] = array();
- $base[] = $this->_pointY($point);
- $base[] = $this->_pointX($point);
-
- $current = array();
- }
-
- $minYaxis = $this->_parent->_getMinimum($this->_axisY);
- $maxYaxis = $this->_parent->_getMaximum($this->_axisY);
-
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- if ($this->_multiType == 'stacked') {
- $plotarea = array_reverse($base);
- $base = array();
- while ($point = $dataset->_next()) {
- $x = $point['X'];
- $p = $point;
- if (isset($current[$x])) {
- $p['Y'] += $current[$x];
- } else {
- $current[$x] = 0;
- }
- $x1 = $this->_pointX($p);
- $y1 = $this->_pointY($p);
- $plotarea[] = $x1;
- $plotarea[] = $y1;
- $plotarea[] = $point;
- $base[] = array();
- $base[] = $y1;
- $base[] = $x1;
- $current[$x] += $point['Y'];
- }
- } else {
- $first = true;
- $plotarea = array();
- while ($point = $dataset->_next()) {
- if ($first) {
- $firstPoint = array ('X' => $point['X'], 'Y' => '#min_pos#');
- $plotarea[] = $this->_pointX($firstPoint);
- $plotarea[] = $this->_pointY($firstPoint);
- $plotarea[] = array();
- }
- $plotarea[] = $this->_pointX($point);
- $plotarea[] = $this->_pointY($point);
- $plotarea[] = $point;
- $lastPoint = $point;
- $first = false;
- }
- $endPoint['X'] = $lastPoint['X'];
- $endPoint['Y'] = '#min_pos#';
- $plotarea[] = $this->_pointX($endPoint);
- $plotarea[] = $this->_pointY($endPoint);
- $plotarea[] = array();
- }
-
- reset($plotarea);
- while (list(, $x) = each($plotarea)) {
- list(, $y) = each($plotarea);
- list(, $data) = each($plotarea);
- $this->_canvas->addVertex(
- $this->_mergeData(
- $data,
- array('x' => $x, 'y' => $y)
- )
- );
- }
-
- $this->_getFillStyle($key);
- $this->_getLineStyle($key);
- $this->_canvas->polygon(array('connect' => true, 'map_vertices' => true));
- }
- unset($keys);
- $this->_drawMarker();
- $this->_clip(false);
-
- $this->_canvas->endGroup();
-
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Band.php b/config/archive/dspam/pear/Image/Graph/Plot/Band.php
deleted file mode 100644
index 3d5b629a..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Band.php
+++ /dev/null
@@ -1,205 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- * @since File available since Release 0.3.0dev2
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * "Band" (area chart with min AND max) chart.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @since Class available since Release 0.3.0dev2
- */
-class Image_Graph_Plot_Band extends Image_Graph_Plot
-{
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $h = abs($y1 - $y0) / 6;
- $w = round(abs($x1 - $x0) / 5);
- $y = ($y0 + $y1) / 2;
-
- $this->_canvas->addVertex(array('x' => $x0, 'y' => $y - $h * 3));
- $this->_canvas->addVertex(array('x' => $x0 + $w, 'y' => $y - 4 * $h));
- $this->_canvas->addVertex(array('x' => $x0 + 2 * $w, 'y' => $y - $h * 2));
- $this->_canvas->addVertex(array('x' => $x0 + 3 * $w, 'y' => $y - $h * 4));
- $this->_canvas->addVertex(array('x' => $x0 + 4 * $w, 'y' => $y - $h * 3));
- $this->_canvas->addVertex(array('x' => $x1, 'y' => $y - $h * 2));
- $this->_canvas->addVertex(array('x' => $x1, 'y' => $y + $h * 3));
- $this->_canvas->addVertex(array('x' => $x0 + 4 * $w, 'y' => $y + $h));
- $this->_canvas->addVertex(array('x' => $x0 + 3 * $w, 'y' => $y + 2 * $h));
- $this->_canvas->addVertex(array('x' => $x0 + 2 * $w, 'y' => $y + 1 * $h));
- $this->_canvas->addVertex(array('x' => $x0 + 1 * $w, 'y' => $y));
- $this->_canvas->addVertex(array('x' => $x0, 'y' => $y + $h));
-
- $this->_getLineStyle();
- $this->_getFillStyle();
- $this->_canvas->polygon(array('connect' => true));
- }
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- if (!is_array($this->_dataset)) {
- return false;
- }
-
- $current = array();
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
-
- $this->_clip(true);
-
-
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- $upperBand = array();
- $lowerBand = array();
- while ($data = $dataset->_next()) {
- if ($this->_parent->_horizontal) {
- $point['X'] = $data['X'];
-
- $point['Y'] = $data['Y']['high'];
- $y = $this->_pointY($point);
- $x_high = $this->_pointX($point);
-
- $point['Y'] = $data['Y']['low'];
- $x_low = $this->_pointX($point);
-
- $data = array('X' => $x_high, 'Y' => $y);
- if (isset($point['data'])) {
- $data['data'] = $point['data'];
- } else {
- $data['data'] = array();
- }
- $upperBand[] = $data;
-
- $data = array('X' => $x_low, 'Y' => $y);
- if (isset($point['data'])) {
- $data['data'] = $point['data'];
- } else {
- $data['data'] = array();
- }
- $lowerBand[] = $data;
- }
- else {
- $point['X'] = $data['X'];
- $y = $data['Y'];
-
- $point['Y'] = $data['Y']['high'];
- $x = $this->_pointX($point);
- $y_high = $this->_pointY($point);
-
- $point['Y'] = $data['Y']['low'];
- $y_low = $this->_pointY($point);
-
- $data = array('X' => $x, 'Y' => $y_high);
- if (isset($point['data'])) {
- $data['data'] = $point['data'];
- } else {
- $data['data'] = array();
- }
- $upperBand[] = $data;
-
- $data = array('X' => $x, 'Y' => $y_low);
- if (isset($point['data'])) {
- $data['data'] = $point['data'];
- } else {
- $data['data'] = array();
- }
- $lowerBand[] = $data;
- }
- }
- $lowerBand = array_reverse($lowerBand);
- foreach ($lowerBand as $point) {
- $this->_canvas->addVertex(
- $this->_mergeData(
- $point['data'],
- array('x' => $point['X'], 'y' => $point['Y'])
- )
- );
- }
- foreach ($upperBand as $point) {
- $this->_canvas->addVertex(
- $this->_mergeData(
- $point['data'],
- array('x' => $point['X'], 'y' => $point['Y'])
- )
- );
- }
- unset($upperBand);
- unset($lowerBand);
-
- $this->_getLineStyle($key);
- $this->_getFillStyle($key);
- $this->_canvas->polygon(array('connect' => true, 'map_vertices' => true));
- }
- unset($keys);
- $this->_drawMarker();
- $this->_clip(false);
-
- $this->_canvas->endGroup();
-
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Bar.php b/config/archive/dspam/pear/Image/Graph/Plot/Bar.php
deleted file mode 100644
index 3e35f92c..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Bar.php
+++ /dev/null
@@ -1,307 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * A bar chart.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plot_Bar extends Image_Graph_Plot
-{
-
- /**
- * The space between 2 bars (should be a multipla of 2)
- * @var int
- * @access private
- */
- var $_space = 4;
-
- /**
- * The width of the bars
- * @var array
- * @access private
- */
- var $_width = 'auto';
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $dx = abs($x1 - $x0) / 7;
- $this->_canvas->rectangle(array('x0' => $x0 + $dx, 'y0' => $y0, 'x1' => $x1 - $dx, 'y1' => $y1));
- }
-
- /**
- * Set the spacing between 2 neighbouring bars
- *
- * @param int $space The number of pixels between 2 bars, should be a
- * multipla of 2 (ie an even number)
- */
- function setSpacing($space)
- {
- $this->_space = (int) ($space / 2);
- }
-
- /**
- * Set the width of a bars.
- *
- * Specify 'auto' to auto calculate the width based on the positions on the
- * x-axis.
- *
- * Supported units are:
- *
- * '%' The width is specified in percentage of the total plot width
- *
- * 'px' The width specified in pixels
- *
- * @param string $width The width of any bar
- * @param string $unit The unit of the width
- */
- function setBarWidth($width, $unit = false)
- {
- if ($width == 'auto') {
- $this->_width = $width;
- } else {
- $this->_width = array(
- 'width' => $width,
- 'unit' => $unit
- );
- }
- }
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- if (!is_array($this->_dataset)) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
-
- $this->_clip(true);
-
- if ($this->_width == 'auto') {
- $width = $this->_parent->_labelDistance(IMAGE_GRAPH_AXIS_X) / 2;
- } elseif ($this->_width['unit'] == '%') {
- $width = $this->_width['width'] * $this->width() / 200;
- } elseif ($this->_width['unit'] == 'px') {
- $width = $this->_width['width'] / 2;
- }
-
- if ($this->_multiType == 'stacked100pct') {
- $total = $this->_getTotals();
- }
-
- $minYaxis = $this->_parent->_getMinimum($this->_axisY);
- $maxYaxis = $this->_parent->_getMaximum($this->_axisY);
-
- $number = 0;
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- while ($point = $dataset->_next()) {
-
- if ($this->_parent->_horizontal) {
- $y1 = $this->_pointY($point) - $width;
- $y2 = $this->_pointY($point) + $width;
-
- if ($y2 - $this->_space > $y1 + $this->_space) {
- /*
- * Take bar spacing into account _only_ if the space doesn't
- * turn the bar "inside-out", i.e. if the actual bar width
- * is smaller than the space between the bars
- */
- $y2 -= $this->_space;
- $y1 += $this->_space;
- }
- }
- else {
- $x1 = $this->_pointX($point) - $width;
- $x2 = $this->_pointX($point) + $width;
-
- if ($x2 - $this->_space > $x1 + $this->_space) {
- /*
- * Take bar spacing into account _only_ if the space doesn't
- * turn the bar "inside-out", i.e. if the actual bar width
- * is smaller than the space between the bars
- */
- $x2 -= $this->_space;
- $x1 += $this->_space;
- }
- }
-
-
- if (($this->_multiType == 'stacked') ||
- ($this->_multiType == 'stacked100pct'))
- {
- $x = $point['X'];
-
- if ($point['Y'] >= 0) {
- if (!isset($current[$x])) {
- $current[$x] = 0;
- }
-
- if ($this->_multiType == 'stacked') {
- $p0 = array(
- 'X' => $point['X'],
- 'Y' => $current[$x]
- );
- $p1 = array(
- 'X' => $point['X'],
- 'Y' => $current[$x] + $point['Y']
- );
- } else {
- $p0 = array(
- 'X' => $point['X'],
- 'Y' => 100 * $current[$x] / $total['TOTAL_Y'][$x]
- );
- $p1 = array(
- 'X' => $point['X'],
- 'Y' => 100 * ($current[$x] + $point['Y']) / $total['TOTAL_Y'][$x]
- );
- }
- $current[$x] += $point['Y'];
- } else {
- if (!isset($currentNegative[$x])) {
- $currentNegative[$x] = 0;
- }
-
- $p0 = array(
- 'X' => $point['X'],
- 'Y' => $currentNegative[$x]
- );
- $p1 = array(
- 'X' => $point['X'],
- 'Y' => $currentNegative[$x] + $point['Y']
- );
- $currentNegative[$x] += $point['Y'];
- }
- } else {
- if (count($this->_dataset) > 1) {
- $w = 2 * ($width - $this->_space) / count($this->_dataset);
- if ($this->_parent->_horizontal) {
- $y2 = ($y1 = ($y1 + $y2) / 2 - ($width - $this->_space) + $number * $w) + $w;
- }
- else {
- $x2 = ($x1 = ($x1 + $x2) / 2 - ($width - $this->_space) + $number * $w) + $w;
- }
- }
- $p0 = array('X' => $point['X'], 'Y' => 0);
- $p1 = $point;
- }
-
- if ((($minY = min($p0['Y'], $p1['Y'])) < $maxYaxis) &&
- (($maxY = max($p0['Y'], $p1['Y'])) > $minYaxis)
- ) {
- $p0['Y'] = $minY;
- $p1['Y'] = $maxY;
-
- if ($p0['Y'] < $minYaxis) {
- $p0['Y'] = '#min_pos#';
- }
- if ($p1['Y'] > $maxYaxis) {
- $p1['Y'] = '#max_neg#';
- }
-
- if ($this->_parent->_horizontal) {
- $x1 = $this->_pointX($p0);
- $x2 = $this->_pointX($p1);
- }
- else {
- $y1 = $this->_pointY($p0);
- $y2 = $this->_pointY($p1);
- }
-
- $ID = $point['ID'];
- if (($ID === false) && (count($this->_dataset) > 1)) {
- $ID = $key;
- }
- $this->_getFillStyle($ID);
- $this->_getLineStyle($ID);
-
- if (($y1 != $y2) && ($x1 != $x2)) {
- $this->_canvas->rectangle(
- $this->_mergeData(
- $point,
- array(
- 'x0' => min($x1, $x2),
- 'y0' => min($y1, $y2),
- 'x1' => max($x1, $x2),
- 'y1' => max($y1, $y2)
- )
- )
- );
- }
- }
- }
- $number ++;
- }
- unset($keys);
-
- $this->_drawMarker();
-
- $this->_clip(false);
-
- $this->_canvas->endGroup();
-
- return true;
- }
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/BoxWhisker.php b/config/archive/dspam/pear/Image/Graph/Plot/BoxWhisker.php
deleted file mode 100644
index 59c1ee44..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/BoxWhisker.php
+++ /dev/null
@@ -1,298 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- * @since File available since Release 0.3.0dev2
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * Box & Whisker chart.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @since Class available since Release 0.3.0dev2
- */
-class Image_Graph_Plot_BoxWhisker extends Image_Graph_Plot
-{
- /**
- * Whisker circle size
- * @var int
- * @access private
- */
- var $_whiskerSize = false;
-
- /**
- * Draws a box & whisker
- *
- * @param int $x The x position
- * @param int $w The width of the box
- * @param int $r The radius of the circle markers
- * @param int $y_min The Y position of the minimum value
- * @param int $y_q1 The Y position of the median of the first quartile
- * @param int $y_med The Y position of the median
- * @param int $y_q3 The Y position of the median of the third quartile
- * @param int $y_max The Y position of the maximum value
- * @param int $key The ID tag
- * @access private
- */
- function _drawBoxWhiskerV($x, $w, $r, $y_min, $y_q1, $y_med, $y_q3, $y_max, $key = false)
- {
- // draw circles
- $this->_getLineStyle();
- $this->_getFillStyle('min');
- $this->_canvas->ellipse(array('x' => $x, 'y' => $y_min, 'rx' => $r, 'ry' => $r));
-
- $this->_getLineStyle();
- $this->_getFillStyle('quartile1');
- $this->_canvas->ellipse(array('x' => $x, 'y' => $y_q1, 'rx' => $r, 'ry' => $r));
-
- $this->_getLineStyle();
- $this->_getFillStyle('median');
- $this->_canvas->ellipse(array('x' => $x, 'y' => $y_med, 'rx' => $r, 'ry' => $r));
-
- $this->_getLineStyle();
- $this->_getFillStyle('quartile3');
- $this->_canvas->ellipse(array('x' => $x, 'y' => $y_q3, $r, 'rx' => $r, 'ry' => $r));
-
- $this->_getLineStyle();
- $this->_getFillStyle('max');
- $this->_canvas->ellipse(array('x' => $x, 'y' => $y_max, $r, 'rx' => $r, 'ry' => $r));
-
- // draw box and lines
-
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $x, 'y0' => $y_min, 'x1' => $x, 'y1' => $y_q1));
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $x, 'y0' => $y_q3, 'x1' => $x, 'y1' => $y_max));
-
- $this->_getLineStyle();
- $this->_getFillStyle('box');
- $this->_canvas->rectangle(array('x0' => $x - $w, 'y0' => $y_q1, 'x1' => $x + $w, 'y1' => $y_q3));
-
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $x - $w, 'y0' => $y_med, 'x1' => $x + $w, 'y1' => $y_med));
- }
-
- /**
- * Draws a box & whisker
- *
- * @param int $y The x position
- * @param int $h The width of the box
- * @param int $r The radius of the circle markers
- * @param int $x_min The Y position of the minimum value
- * @param int $x_q1 The Y position of the median of the first quartile
- * @param int $x_med The Y position of the median
- * @param int $x_q3 The Y position of the median of the third quartile
- * @param int $x_max The Y position of the maximum value
- * @param int $key The ID tag
- * @access private
- */
- function _drawBoxWhiskerH($y, $h, $r, $x_min, $x_q1, $x_med, $x_q3, $x_max, $key = false)
- {
- // draw circles
- $this->_getLineStyle();
- $this->_getFillStyle('min');
- $this->_canvas->ellipse(array('x' => $x_min, 'y' => $y, 'rx' => $r, 'ry' => $r));
-
- $this->_getLineStyle();
- $this->_getFillStyle('quartile1');
- $this->_canvas->ellipse(array('x' => $x_q1, 'y' => $y, 'rx' => $r, 'ry' => $r));
-
- $this->_getLineStyle();
- $this->_getFillStyle('median');
- $this->_canvas->ellipse(array('x' => $x_med, 'y' => $y, 'rx' => $r, 'ry' => $r));
-
- $this->_getLineStyle();
- $this->_getFillStyle('quartile3');
- $this->_canvas->ellipse(array('x' => $x_q3, 'y' => $y, $r, 'rx' => $r, 'ry' => $r));
-
- $this->_getLineStyle();
- $this->_getFillStyle('max');
- $this->_canvas->ellipse(array('x' => $x_max, 'y' => $y, $r, 'rx' => $r, 'ry' => $r));
-
- // draw box and lines
-
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $x_min, 'y0' => $y, 'x1' => $x_q1, 'y1' => $y));
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $x_q3, 'y0' => $y, 'x1' => $x_max, 'y1' => $y));
-
- $this->_getLineStyle();
- $this->_getFillStyle('box');
- $this->_canvas->rectangle(array('x0' => $x_q1, 'y0' => $y - $h, 'x1' => $x_q3, 'y1' => $y + $h));
-
- $this->_getLineStyle();
- $this->_canvas->line(array('x0' => $x_med, 'y0' => $y - $h, 'x1' => $x_med, 'y1' => $y + $h));
- }
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $x = round(($x0 + $x1) / 2);
- $h = abs($y1 - $y0) / 9;
- $w = round(abs($x1 - $x0) / 5);
- $r = 2;//round(abs($x1 - $x0) / 13);
- $this->_drawBoxWhiskerV($x, $w, $r, $y1, $y1 - 2 * $h, $y1 - 4 * $h, $y0 + 3 * $h, $y0);
- }
-
- /**
- * Sets the whisker circle size
- *
- * @param int $size Size (radius) of the whisker circle/dot
- */
- function setWhiskerSize($size = false)
- {
- $this->_whiskerSize = $size;
- }
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- if (!is_array($this->_dataset)) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
-
- $this->_clip(true);
-
- if ($this->_multiType == 'stacked100pct') {
- $total = $this->_getTotals();
- }
- $current = array();
- $number = 0;
- $width = floor(0.5 * $this->_parent->_labelDistance(IMAGE_GRAPH_AXIS_X) / 2);
-
- if ($this->_whiskerSize !== false) {
- $r = $this->_whiskerSize;
- } else {
- $r = min(5, $width / 10);
- }
-
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- while ($data = $dataset->_next()) {
- if ($this->_parent->_horizontal) {
- $point['X'] = $data['X'];
- $y = $data['Y'];
-
- $min = min($y);
- $max = max($y);
- $q1 = $dataset->_median($y, 'first');
- $med = $dataset->_median($y, 'second');
- $q3 = $dataset->_median($y, 'third');
-
- $point['Y'] = $min;
- $y = $this->_pointY($point);
- $x_min = $this->_pointX($point);
-
- $point['Y'] = $max;
- $x_max = $this->_pointX($point);
-
- $point['Y'] = $q1;
- $x_q1 = $this->_pointX($point);
-
- $point['Y'] = $med;
- $x_med = $this->_pointX($point);
-
- $point['Y'] = $q3;
- $x_q3 = $this->_pointX($point);
-
- $this->_drawBoxWhiskerH($y, $width, $r, $x_min, $x_q1, $x_med, $x_q3, $x_max, $key);
- }
- else {
- $point['X'] = $data['X'];
- $y = $data['Y'];
-
- $min = min($y);
- $max = max($y);
- $q1 = $dataset->_median($y, 'first');
- $med = $dataset->_median($y, 'second');
- $q3 = $dataset->_median($y, 'third');
-
- $point['Y'] = $min;
- $x = $this->_pointX($point);
- $y_min = $this->_pointY($point);
-
- $point['Y'] = $max;
- $y_max = $this->_pointY($point);
-
- $point['Y'] = $q1;
- $y_q1 = $this->_pointY($point);
-
- $point['Y'] = $med;
- $y_med = $this->_pointY($point);
-
- $point['Y'] = $q3;
- $y_q3 = $this->_pointY($point);
-
- $this->_drawBoxWhiskerV($x, $width, $r, $y_min, $y_q1, $y_med, $y_q3, $y_max, $key);
- }
- }
- }
- unset($keys);
- $this->_drawMarker();
-
- $this->_clip(false);
-
- $this->_canvas->endGroup();
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/CandleStick.php b/config/archive/dspam/pear/Image/Graph/Plot/CandleStick.php
deleted file mode 100644
index b050aea1..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/CandleStick.php
+++ /dev/null
@@ -1,251 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- * @since File available since Release 0.3.0dev2
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * Candlestick chart.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @since Class available since Release 0.3.0dev2
- */
-class Image_Graph_Plot_CandleStick extends Image_Graph_Plot
-{
-
- /**
- * (Add basic description here)
- *
- * @access private
- */
- function _drawCandleStickH($y, $h, $x_min, $x_open, $x_close, $x_max, $ID)
- {
- $this->_getLineStyle($ID);
- $this->_canvas->line(
- array(
- 'x0' => min($x_open, $x_close),
- 'y0' => $y,
- 'x1' => $x_min,
- 'y1' => $y
- )
- );
- $this->_getLineStyle($ID);
- $this->_canvas->line(
- array(
- 'x0' => max($x_open, $x_close),
- 'y0' => $y,
- 'x1' => $x_max,
- 'y1' => $y
- )
- );
-
- $this->_getLineStyle($ID);
- $this->_getFillStyle($ID);
- $this->_canvas->rectangle(
- array(
- 'x0' => min($x_open, $x_close),
- 'y0' => $y - $h,
- 'x1' => max($x_open, $x_close),
- 'y1' => $y + $h
- )
- );
- }
-
- /**
- * (Add basic description here)
- *
- * @access private
- */
- function _drawCandleStickV($x, $w, $y_min, $y_open, $y_close, $y_max, $ID)
- {
- $this->_getLineStyle($ID);
- $this->_canvas->line(
- array(
- 'x0' => $x,
- 'y0' => min($y_open, $y_close),
- 'x1' => $x,
- 'y1' => $y_max
- )
- );
- $this->_getLineStyle($ID);
- $this->_canvas->line(
- array(
- 'x0' => $x,
- 'y0' => max($y_open, $y_close),
- 'x1' => $x,
- 'y1' => $y_min
- )
- );
-
- $this->_getLineStyle($ID);
- $this->_getFillStyle($ID);
- $this->_canvas->rectangle(
- array(
- 'x0' => $x - $w,
- 'y0' => min($y_open, $y_close),
- 'x1' => $x + $w,
- 'y1' => max($y_open, $y_close)
- )
- );
- }
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $x = round(($x0 + $x1) / 2);
- $h = abs($y1 - $y0) / 4;
- $w = round(abs($x1 - $x0) / 5);
- $this->_drawCandleStickV($x, $w, $y1, $y1 - $h, $y0 + $h, $y0, 'green');
- }
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- if (!is_array($this->_dataset)) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
-
- $this->_clip(true);
-
- if ($this->_multiType == 'stacked100pct') {
- $total = $this->_getTotals();
- }
- $current = array();
- $number = 0;
- $width = floor(0.8 * $this->_parent->_labelDistance(IMAGE_GRAPH_AXIS_X) / 2);
-
- $lastClosed = false;
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- while ($data = $dataset->_next()) {
- if ($this->_parent->_horizontal) {
- $point['X'] = $data['X'];
- //$y = $data['Y'];
-
- if (isset($data['Y']['open'])) {
- $point['Y'] = $data['Y']['open'];
- } else {
- $point['Y'] = $lastClosed;
- }
- $y = $this->_pointY($point);
- $x_open = $this->_pointX($point);
-
- $lastClosed = $point['Y'] = $data['Y']['close'];
- $x_close = $this->_pointX($point);
-
- $point['Y'] = $data['Y']['min'];
- $x_min = $this->_pointX($point);
-
- $point['Y'] = $data['Y']['max'];
- $x_max = $this->_pointX($point);
-
- if ($data['Y']['close'] < $data['Y']['open']) {
- $ID = 'red';
- } else {
- $ID = 'green';
- }
-
- $this->_drawCandleStickH($y, $width, $x_min, $x_open, $x_close, $x_max, $ID);
- }
- else {
- $point['X'] = $data['X'];
- //$y = $data['Y'];
-
- if (isset($data['Y']['open'])) {
- $point['Y'] = $data['Y']['open'];
- } else {
- $point['Y'] = $lastClosed;
- }
- $x = $this->_pointX($point);
- $y_open = $this->_pointY($point);
-
- $lastClosed = $point['Y'] = $data['Y']['close'];
- $y_close = $this->_pointY($point);
-
- $point['Y'] = $data['Y']['min'];
- $y_min = $this->_pointY($point);
-
- $point['Y'] = $data['Y']['max'];
- $y_max = $this->_pointY($point);
-
- if ($data['Y']['close'] < $data['Y']['open']) {
- $ID = 'red';
- } else {
- $ID = 'green';
- }
-
- $this->_drawCandleStickV($x, $width, $y_min, $y_open, $y_close, $y_max, $ID);
- }
- }
- }
- unset($keys);
- $this->_drawMarker();
-
- $this->_clip(false);
-
- $this->_canvas->endGroup($this->_title);
-
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Dot.php b/config/archive/dspam/pear/Image/Graph/Plot/Dot.php
deleted file mode 100644
index 19352567..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Dot.php
+++ /dev/null
@@ -1,99 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * Dot / scatter chart (only marker).
- *
- * This plot type only displays a {@link Image_Graph_Marker} for the datapoints.
- * The marker must explicitly be defined using {@link Image_Graph_Plot::
- * setMarker()}.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plot_Dot extends Image_Graph_Plot
-{
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- if (isset($this->_marker)) {
- $key = key($this->_dataset);
- $samplePoint = $this->_dataset[$key]->_nearby();
- $this->_marker->_drawMarker(($x0 + $x1) / 2, ($y0 + $y1) / 2, $samplePoint);
- }
- }
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (Image_Graph_Plot::_done() === false) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
-
- $this->_clip(true);
-
- $this->_drawMarker();
-
- $this->_clip(false);
-
- $this->_canvas->endGroup();
-
- return true;
- }
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Fit/Line.php b/config/archive/dspam/pear/Image/Graph/Plot/Fit/Line.php
deleted file mode 100644
index 07f3b9cc..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Fit/Line.php
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * Include file Image/Graph/Tool.php
- */
-require_once 'Image/Graph/Tool.php';
-
-/**
- * Fit the graph (to a line using linear regression).
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plot_Fit_Line extends Image_Graph_Plot
-{
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $y = ($y0 + $y1) / 2;
- $dy = abs($y1 - $y0) / 6;
- $this->_canvas->addVertex(array('x' => $x0, 'y' => $y + $dy));
- $this->_canvas->addVertex(array('x' => $x1, 'y' => $y - $dy));
- $this->_canvas->polygon(array('connect' => false));
- }
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (Image_Graph_Plot::_done() === false) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
- $this->_clip(true);
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- $data = array();
- while ($point = $dataset->_next()) {
- $data[] = array(
- 'X' => $this->_pointX($point),
- 'Y' => $this->_pointY($point)
- );
- }
-
- $regression = Image_Graph_Tool::calculateLinearRegression($data);
- $this->_getLineStyle($key);
- $this->_canvas->line(
- array(
- 'x0' => $this->_left,
- 'y0' => $this->_left * $regression['slope'] + $regression['intersection'],
- 'x1' => $this->_right,
- 'y1' => $this->_right * $regression['slope'] + $regression['intersection']
- )
- );
- }
- $this->_clip(false);
- $this->_canvas->endGroup();
-
- return true;
- }
-}
-
-?>
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Impulse.php b/config/archive/dspam/pear/Image/Graph/Plot/Impulse.php
deleted file mode 100644
index 91372cd1..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Impulse.php
+++ /dev/null
@@ -1,204 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * Impulse chart.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plot_Impulse extends Image_Graph_Plot
-{
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $x = ($x0 + $x1) / 2;
- $this->_canvas->line(array('x0' => $x, 'y0' => $y0, 'x1' => $x, 'y1' => $y1));
- }
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- if (!is_array($this->_dataset)) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
- $this->_clip(true);
-
- if ($this->_multiType == 'stacked100pct') {
- $total = $this->_getTotals();
- }
- $current = array();
- $number = 0;
-
- $minYaxis = $this->_parent->_getMinimum($this->_axisY);
- $maxYaxis = $this->_parent->_getMaximum($this->_axisY);
-
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- while ($point = $dataset->_next()) {
- $x0 = $this->_pointX($point);
- if (($this->_multiType == 'stacked') ||
- ($this->_multiType == 'stacked100pct'))
- {
- $x = $point['X'];
-
- if ($point['Y'] >= 0) {
- if (!isset($current[$x])) {
- $current[$x] = 0;
- }
-
- if ($this->_multiType == 'stacked') {
- $p0 = array(
- 'X' => $point['X'],
- 'Y' => $current[$x]
- );
- $p1 = array(
- 'X' => $point['X'],
- 'Y' => $current[$x] + $point['Y']
- );
- } else {
- $p0 = array(
- 'X' => $point['X'],
- 'Y' => 100 * $current[$x] / $total['TOTAL_Y'][$x]
- );
- $p1 = array(
- 'X' => $point['X'],
- 'Y' => 100 * ($current[$x] + $point['Y']) / $total['TOTAL_Y'][$x]
- );
- }
- $current[$x] += $point['Y'];
- } else {
- if (!isset($currentNegative[$x])) {
- $currentNegative[$x] = 0;
- }
-
- $p0 = array(
- 'X' => $point['X'],
- 'Y' => $currentNegative[$x]
- );
- $p1 = array(
- 'X' => $point['X'],
- 'Y' => $currentNegative[$x] + $point['Y']
- );
- $currentNegative[$x] += $point['Y'];
- }
- } else {
- $p0 = array('X' => $point['X'], 'Y' => 0);
- $p1 = $point;
- }
-
- if ((($minY = min($p0['Y'], $p1['Y'])) < $maxYaxis) &&
- (($maxY = max($p0['Y'], $p1['Y'])) > $minYaxis)
- ) {
- $p0['Y'] = $minY;
- $p1['Y'] = $maxY;
-
- if ($p0['Y'] < $minYaxis) {
- $p0['Y'] = '#min_pos#';
- }
- if ($p1['Y'] > $maxYaxis) {
- $p1['Y'] = '#max_neg#';
- }
-
- $x1 = $this->_pointX($p0);
- $y1 = $this->_pointY($p0);
-
- $x2 = $this->_pointX($p1);
- $y2 = $this->_pointY($p1);
-
- if ($this->_multiType == 'normal') {
- $offset = 5*$number;
- $x1 += $offset;
- $x2 += $offset;
- }
-
- $ID = $point['ID'];
- if (($ID === false) && (count($this->_dataset) > 1)) {
- $ID = $key;
- }
- $this->_getLineStyle($key);
- $this->_canvas->line(
- $this->_mergeData(
- $point,
- array(
- 'x0' => $x1,
- 'y0' => $y1,
- 'x1' => $x2,
- 'y1' => $y2
- )
- )
- );
- }
- }
- $number++;
- }
- unset($keys);
- $this->_drawMarker();
- $this->_clip(false);
- $this->_canvas->endGroup();
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Line.php b/config/archive/dspam/pear/Image/Graph/Plot/Line.php
deleted file mode 100644
index 009b4e1f..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Line.php
+++ /dev/null
@@ -1,171 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * Linechart.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plot_Line extends Image_Graph_Plot
-{
-
- /**
- * Gets the fill style of the element
- *
- * @return int A GD filestyle representing the fill style
- * @see Image_Graph_Fill
- * @access private
- */
- function _getFillStyle($ID = false)
- {
- return IMG_COLOR_TRANSPARENT;
- }
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $y = ($y0 + $y1) / 2;
- $dx = abs($x1 - $x0) / 3;
- $dy = abs($y1 - $y0) / 5;
- $this->_canvas->addVertex(array('x' => $x0, 'y' => $y));
- $this->_canvas->addVertex(array('x' => $x0 + $dx, 'y' => $y - $dy * 2));
- $this->_canvas->addVertex(array('x' => $x1 - $dx, 'y' => $y + $dy));
- $this->_canvas->addVertex(array('x' => $x1, 'y' => $y - $dy));
- $this->_canvas->polygon(array('connect' => false));
- }
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- if (!is_array($this->_dataset)) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
- $this->_clip(true);
- reset($this->_dataset);
-
- if ($this->_multiType == 'stacked100pct') {
- $total = $this->_getTotals();
- }
-
- $p1 = false;
-
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- $numPoints = 0;
- while ($point = $dataset->_next()) {
- if (($this->_multiType == 'stacked') ||
- ($this->_multiType == 'stacked100pct'))
- {
- $x = $point['X'];
- if (!isset($current[$x])) {
- $current[$x] = 0;
- }
- if ($this->_multiType == 'stacked') {
- $py = $current[$x] + $point['Y'];
- } else {
- $py = 100 * ($current[$x] + $point['Y']) / $total['TOTAL_Y'][$x];
- }
- $current[$x] += $point['Y'];
- $point['Y'] = $py;
- }
-
- if ($point['Y'] === null) {
- if ($numPoints > 1) {
- $this->_getLineStyle($key);
- $this->_canvas->polygon(array('connect' => false, 'map_vertices' => true));
- }
- else {
- $this->_canvas->reset();
- }
- $numPoints = 0;
- } else {
- $p2['X'] = $this->_pointX($point);
- $p2['Y'] = $this->_pointY($point);
-
- $this->_canvas->addVertex(
- $this->_mergeData(
- $point,
- array('x' => $p2['X'], 'y' => $p2['Y'])
- )
- );
- $numPoints++;
- }
- }
- if ($numPoints > 1) {
- $this->_getLineStyle($key);
- $this->_canvas->polygon(array('connect' => false, 'map_vertices' => true));
- }
- else {
- $this->_canvas->reset();
- }
- }
- unset($keys);
- $this->_drawMarker();
- $this->_clip(false);
- $this->_canvas->endGroup();
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Odo.php b/config/archive/dspam/pear/Image/Graph/Plot/Odo.php
deleted file mode 100644
index d6bf7969..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Odo.php
+++ /dev/null
@@ -1,719 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * Include file Image/Graph/Tool.php
- */
-require_once 'Image/Graph/Tool.php';
-
-/**
- * 2D Odochart.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Maxime Delorme <mdelorme@tennaxia.com>
- * @copyright Copyright (C) 2005 Maxime Delorme
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plot_Odo extends Image_Graph_Plot
-{
- /**
- * the percent of the radius of the chart that will be use as the width of the range
- * @access private
- * @var int
- */
- var $_radiusPercent = 50;
-
- /**
- * the minimun value of the chart or the start value
- * @access private
- * @var int
- */
- var $_value_min = 0;
-
- /**
- * the maximum value of the chart or the end value
- * @access private
- * @var int
- */
- var $_value_max = 100;
-
- /**
- * the start angle
- * @access private
- * @var int
- */
- var $_deg_offset = 135;
-
- /**
- * the angle of the chart , the length of the chart
- * 180 min a half circle
- * @access private
- * @var int
- */
- var $_deg_width = 270;
-
- /**
- * the length of the big ticks
- * the small ones will be half ot it, the values 160% of it
- * 180 min a half circle
- * @access private
- * @var int
- */
- var $_tickLength = 14;
-
- /**
- * how many small ticks a big tick appears
- * the small ticks appear every 6°
- * so with the default value of 5, every 30° there is a value and a big tick
- * 180 min a half circle
- * @access private
- * @var int
- */
- var $_axisTicks = 5;
-
- /**
- * Arrow marker
- * @access private
- * @var Image_Graph_Marker
- */
- var $_arrowMarker;
-
- /**
- * Range marker fill style
- * @access private
- * @var Image_Graph_Fill
- */
- var $_rangeFillStyle = null;
-
- /**
- * The width of the arrow
- * @access private
- * @var int
- */
- var $_arrowWidth = 5;
-
- /**
- * The length of the arrow
- * @access private
- * @var int
- */
- var $_arrowLength = 80;
-
- /**
- * The radius of the plot
- * @access private
- * @var int
- */
- var $_radius = false;
-
- /**
- * The total Y
- * @access private
- * @var int
- */
- var $_totalY = false;
-
- /**
- * Center X of odometer "circle"
- * @access private
- * @var int
- */
- var $_centerX = false;
-
- /**
- * Center y of odometer "circle"
- * @access private
- * @var int
- */
- var $_centerY = false;
-
- /**
- * Plot_Odo [Constructor]
- *
- * dataset with one data per arrow
- * @param Image_Graph_Dataset $dataset The data set (value containter) to
- * plot or an array of datasets
- * {@link Image_Graph_Legend}
- */
- function Image_Graph_Plot_Odo(&$dataset)
- {
- parent::Image_Graph_Plot($dataset);
-
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- if (isset($min)) {
- $min = min($dataset->minimumY(), $min);
- }
- else {
- $min = $dataset->minimumY();
- }
- if (isset($max)) {
- $max = max($dataset->maximumY(), $max);
- }
- else {
- $max = $dataset->maximumY();
- }
- }
- $this->_value_min = $min;
- $this->_value_max = $max;
- }
-
- /**
- * Set the center of the odometer
- *
- * @param int $centerX The center x point
- * @param int $centerY The center y point
- */
- function setCenter($centerX, $centerY)
- {
- $this->_centerX = $centerX;
- $this->_centerY = $centerY;
- }
-
- /**
- * Convert a value to the angle position onto the odometer
- *
- * @access private
- * @param int $value the value to convert
- * @return int the angle'position onto the odometer
- */
- function _value2angle($value)
- {
- return $this->_deg_width * (($value - $this->_value_min) / $this->_totalY) + $this->_deg_offset;
- }
-
- /**
- * set some internal var
- *
- * @access private
- */
- function _initialize()
- {
- $v1 = $this->_deg_offset;
- $v2 = $this->_deg_offset + $this->_deg_width;
-
- $dimensions = Image_Graph_Tool::calculateArcDimensionAndCenter($v1, $v2);
-
- $radiusX = ($this->width() / 2) / $dimensions['rx'];
- $radiusY = ($this->height() / 2) / $dimensions['ry'];
-
- $this->_radius = min($radiusX, $radiusY);
-
- if ($this->_marker) {
- $this->_radius = $this->_radius * 0.85;
- }
-
- //the center of the plot
- if ($this->_centerX === false) {
- $this->_centerX = (int) (($this->_left + $this->_right) / 2) +
- $this->_radius * ($dimensions['cx'] - 0.5);
- }
-
- if ($this->_centerY === false) {
- $this->_centerY = (int) (($this->_top + $this->_bottom) / 2) +
- $this->_radius * ($dimensions['cy'] - 0.5);
- }
-
- //the max range
- $this->_totalY = abs($this->_value_max - $this->_value_min);
- }
-
- /**
- * set min and max value of the range
- *
- * @access public
- * @param integer $value_min the minimun value of the chart or the start value
- * @param integer $value_max the maximum value of the chart or the end value
- */
- function setRange($value_min, $value_max)
- {
- $this->_value_min = $value_min;
- $this->_value_max = $value_max;
- }
-
- /**
- * Set start's angle and amplitude of the chart
- *
- * @access public
- * @param integer $deg_offset the start angle
- * @param integer $deg_width the angle of the chart (the length)
- */
- function setAngles($deg_offset, $deg_width)
- {
- $this->_deg_offset = min(360, abs($deg_offset));
- $this->_deg_width = min(360, abs($deg_width));
- }
-
- /**
- * set the width of the chart
- *
- * @access public
- * @param string $radius_percent a value between 0 and 100
- */
- function setRadiusWidth($radius_percent)
- {
- $this->_radiusPercent = $radius_percent;
- }
-
- /**
- * set the width and length of the arrow (in percent of the total plot "radius")
- *
- * @param int length The length in percent
- * @param int width The width in percent
- */
- function setArrowSize($length, $width)
- {
- $this->_arrowWidth = max(0, min(100, $width));
- $this->_arrowLength = max(0, min(100, $length));
- }
-
- /**
- * Set the arrow marker
- * @param Image_Graph_Marker $marker The marker to set for arrow marker
- */
- function setArrowMarker(&$marker)
- {
- $this->_arrowMarker =& $marker;
- }
-
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
- $this->_initialize();
- $this->_drawRange();
- $this->_drawAxis();
- $this->_drawArrow();
- $this->_drawMarker();
- return true;
- }
-
- /**
- * set the length of the ticks
- *
- * @access public
- * @param string $radius_percent a value between 0 and 100
- */
- function setTickLength($radius)
- {
- $this->_tickLength = $radius;
- }
-
- /**
- * set the length of the ticks
- *
- * @access public
- * @param string $radius_percent a value between 0 and 100
- */
- function setAxisTicks($int)
- {
- $this->_axisTicks = $int;
- }
-
- /**
- * Draw the outline and the axis
- *
- * @access private
- */
- function _drawAxis()
- {
- //draw outline
- $this->_getLineStyle();
- $this->_canvas->pieslice(
- array(
- 'x' => $this->_centerX,
- 'y' => $this->_centerY,
- 'rx' => $this->_radius,
- 'ry' => $this->_radius,
- 'v1' => $this->_deg_offset,
- 'v2' => $this->_deg_offset+$this->_deg_width,
- 'srx' => $this->_radius * (1 - $this->_radiusPercent / 100),
- 'sry' => $this->_radius * (1 - $this->_radiusPercent / 100)
- )
- );
-
- //step for every 6°
- $step = (int) ($this->_totalY / $this->_deg_width * 6);
- $value = $this->_value_min;
- $i = 0;
- while ($value <= $this->_value_max) {
- $angle = $this->_value2angle($value);
-
- $cos = cos(deg2rad($angle));
- $sin = sin(deg2rad($angle));
- $point = array('Y' => $value);
- $point['AX'] = $cos;
- $point['AY'] = $sin;
- $point['LENGTH'] = 1;
- $x = $this->_centerX + $this->_radius * $cos;
- $y = $this->_centerY + $this->_radius * $sin;
- $deltaX = - $cos * $this->_tickLength ;
- $deltaY = - $sin * $this->_tickLength ;
- $this->_getLineStyle();
- if(($i % $this->_axisTicks) == 0){
- $this->_canvas->line(array('x0' => $x, 'y0' => $y, 'x1' => $x + $deltaX, 'y1' => $y + $deltaY));
- if ($this->_arrowMarker) {
- $this->_arrowMarker->_drawMarker($x + $deltaX * 1.6, $y + $deltaY *1.6, $point);
- }
- } else {
- $this->_canvas->line(array('x0' => $x, 'y0' => $y, 'x1' => $x + $deltaX * 0.5, 'y1' => $y + $deltaY * 0.5));
- }
- $i++;
- $value += $step;
- }
-
- }
-
- /**
- * Set the line style of the arrows
- *
- * @param Image_Graph_Line $lineStyle The line style of the Arrow
- * @see Image_Graph_Line
- * @access public
- */
- function setArrowLineStyle($lineStyle)
- {
- $this->_arrowLineStyle = &$lineStyle;
- }
-
- /**
- * Set the fillstyle of the arrows
- *
- * @param Image_Graph_Fill $fillStyle The fill style of the arrows
- * @see Image_Graph_Fill
- * @access public
- */
- function setArrowFillStyle($fillStyle)
- {
- $this->_arrowFillStyle = &$fillStyle;
- }
-
- /**
- * Draw the arrows
- *
- * @access private
- */
- function _drawArrow()
- {
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- $this->setLineStyle($this->_arrowLineStyle);
- $this->setFillStyle($this->_arrowFillStyle);
- while ($point = $dataset->_next()) {
- $ID = $point['ID'];
- $this->_getFillStyle($ID);
- $this->_getLineStyle($ID);
- $deg = $this->_value2angle($point['Y']);
- list($xr,$yr) = Image_Graph_Tool::rotate($this->_centerX + $this->_arrowLength * $this->_radius / 100, $this->_centerY, $this->_centerX, $this->_centerY, $deg);
- $this->_canvas->addVertex(array('x' => $xr, 'y' => $yr));
- list($xr,$yr) = Image_Graph_Tool::rotate($this->_centerX, $this->_centerY - $this->_arrowWidth * $this->_radius/100, $this->_centerX, $this->_centerY, $deg);
- $this->_canvas->addVertex(array('x' => $xr, 'y' => $yr));
- list($xr,$yr) = Image_Graph_Tool::rotate($this->_centerX - $this->_arrowWidth * $this->_radius / 100, $this->_centerY, $this->_centerX, $this->_centerY, $deg);
- $this->_canvas->addVertex(array('x' => $xr, 'y' => $yr));
- list($xr,$yr) = Image_Graph_Tool::rotate($this->_centerX,$this->_centerY + $this->_arrowWidth * $this->_radius / 100, $this->_centerX, $this->_centerY, $deg);
- $this->_canvas->addVertex(array('x' => $xr, 'y' => $yr));
- $this->_canvas->polygon(array('connect' => true));
- }
- }
- }
-
- /**
- * Calculate marker point data
- *
- * @param array $point The point to calculate data for
- * @param array $nextPoint The next point
- * @param array $prevPoint The previous point
- * @param array $totals The pre-calculated totals, if needed
- * @return array An array containing marker point data
- * @access private
- */
- function _getMarkerData($point, $nextPoint, $prevPoint, &$totals)
- {
- $point = parent::_getMarkerData($point, $nextPoint, $prevPoint, $totals);
-
- $point['ANGLE'] = $this->_value2angle($point['Y']);
-
- $point['ANG_X'] = cos(deg2rad($point['ANGLE']));
- $point['ANG_Y'] = sin(deg2rad($point['ANGLE']));
-
- $point['AX'] = -$point['ANG_X'];
- $point['AY'] = -$point['ANG_Y'];
-
- $point['LENGTH'] = 2.5; //$radius;
-
- $point['MARKER_X'] = $totals['CENTER_X'] +
- $totals['ODO_RADIUS'] * $point['ANG_X'];
- $point['MARKER_Y'] = $totals['CENTER_Y'] +
- $totals['ODO_RADIUS'] * $point['ANG_Y'];
-
- return $point;
- }
-
- /**
- * Draws markers of the arrows on the canvas
- *
- * @access private
- */
- function _drawMarker()
- {
-
- if ($this->_marker) {
- $this->_marker->_radius += $this->_radius / 2;
- $totals = $this->_getTotals();
-
- $totals['CENTER_X'] = $this->_centerX;
- $totals['CENTER_Y'] = $this->_centerY;
-
-
- /* $keys = array_keys($this->_dataset);
- foreach ($keys as $key) { */
- $dataset =& $this->_dataset[0];
-
- $totals['RADIUS0'] = false;
- $totals['ODO_RADIUS'] = 1.1 * $this->_radius * $this->_arrowLength / 100;
- $totals['ALL_SUM_Y'] = $this->_totalY;
-
- $dataset->_reset();
- while ($point = $dataset->_next()) {
- if ((!is_object($this->_dataSelector)) ||
- ($this->_dataSelector->select($point))
- ) {
- $point = $this->_getMarkerData(
- $point,
- false,
- false,
- $totals
- );
- if (is_array($point)) {
- $this->_marker->_drawMarker(
- $point['MARKER_X'],
- $point['MARKER_Y'],
- $point
- );
- }
- }
- }
- /* }
- unset($keys); */
- }
- }
-
- /**
- * Set range
- *
- * dataset with two data start and end value of the range
- * @param Image_Graph_Dataset $dataset The data set (value containter) to
- * plot or an array of datasets
- *
- */
- function addRangeMarker($min, $max, $id = false)
- {
- $this->_range[] =
- array(
- 'min' => max($this->_value_min, min($min, $max)),
- 'max' => min($this->_value_max, max($min, $max)),
- 'id' => $id
- );
- }
-
- /**
- * Set the fillstyle of the ranges
- *
- * @param Image_Graph_Fill $fillStyle The fill style of the range
- * @see Image_Graph_Fill
- * @access public
- */
- function &setRangeMarkerFillStyle(&$rangeMarkerFillStyle)
- {
- $this->_rangeFillStyle = $rangeMarkerFillStyle;
- }
-
- /**
- * Draw the ranges
- *
- * @access private
- */
- function _drawRange()
- {
- if($this->_range){
- $radius0 = $this->_radius * (1 - $this->_radiusPercent/100);
- foreach ($this->_range as $range) {
- $angle1 = $this->_value2angle($range['min']);
- $angle2 = $this->_value2angle($range['max']);
-
- if (is_object($this->_rangeFillStyle)) {
- $this->_canvas->setFill($this->_rangeFillStyle->_getFillStyle($range['id']));
- } elseif ($this->_rangeFillStyle != null) {
- $this->_canvas->setFill($this->_rangeFillStyle);
- }
- $this->_getLineStyle();
- $this->_canvas->Pieslice(
- array(
- 'x' => $this->_centerX,
- 'y' => $this->_centerY,
- 'rx' => $this->_radius,
- 'ry' => $this->_radius,
- 'v1' => $angle1,
- 'v2' => $angle2,
- 'srx' => $radius0,
- 'sry' => $radius0
- )
- );
- }
- }
- }
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $dx = abs($x1 - $x0) / 4;
- $this->_canvas->addVertex(array('x' => $x0 + $dx , 'y' => $y1));
- $this->_canvas->addVertex(array('x' => ($x0 + $x1) / 2, 'y' => $y0 ));
- $this->_canvas->addVertex(array('x' => $x1 - $dx , 'y' => $y1));
- $this->_canvas->polygon(array('connect' => true));
- }
-
- /**
- * Draw a sample for use with legend
- *
- * @param array $param The parameters for the legend
- * @access private
- */
- function _legendSample(&$param)
- {
- if (is_array($this->_dataset)) {
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
- $this->_clip(true);
-
- $totals = $this->_getTotals();
- $totals['CENTER_X'] = (int) (($this->_left + $this->_right) / 2);
- $totals['CENTER_Y'] = (int) (($this->_top + $this->_bottom) / 2);
- $totals['RADIUS'] = min($this->height(), $this->width()) * 0.75 * 0.5;
- $totals['CURRENT_Y'] = 0;
-
- if (is_a($this->_fillStyle, "Image_Graph_Fill")) {
- $this->_fillStyle->_reset();
- }
-
- $count = 0;
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $count++;
-
- $dataset->_reset();
- while ($point = $dataset->_next()) {
- $caption = $point['X'];
-
- $this->_canvas->setFont($param['font']);
- $width = 20 + $param['width'] + $this->_canvas->textWidth($caption);
- $param['maxwidth'] = max($param['maxwidth'], $width);
- $x2 = $param['x'] + $width;
- $y2 = $param['y'] + $param['height'] + 5;
-
- if ((($param['align'] & IMAGE_GRAPH_ALIGN_VERTICAL) != 0) && ($y2 > $param['bottom'])) {
- $param['y'] = $param['top'];
- $param['x'] = $x2;
- $y2 = $param['y'] + $param['height'];
- } elseif ((($param['align'] & IMAGE_GRAPH_ALIGN_VERTICAL) == 0) && ($x2 > $param['right'])) {
- $param['x'] = $param['left'];
- $param['y'] = $y2;
- $x2 = $param['x'] + 20 + $param['width'] + $this->_canvas->textWidth($caption);
- }
-
- $x = $x0 = $param['x'];
- $y = $param['y'];
- $y0 = $param['y'] - $param['height'] / 2;
- $x1 = $param['x'] + $param['width'];
- $y1 = $param['y'] + $param['height'] / 2;
-
- if (!isset($param['simulate'])) {
- $this->_getFillStyle($point['ID']);
- $this->_getLineStyle($point['ID']);
- $this->_drawLegendSample($x0, $y0, $x1, $y1);
-
- if (($this->_marker) && ($dataset) && ($param['show_marker'])) {
- $prevPoint = $dataset->_nearby(-2);
- $nextPoint = $dataset->_nearby();
-
- $p = $this->_getMarkerData($point, $nextPoint, $prevPoint, $totals);
- if (is_array($point)) {
- $p['MARKER_X'] = $x+$param['width'] / 2;
- $p['MARKER_Y'] = $y;
- unset ($p['AVERAGE_Y']);
- $this->_marker->_drawMarker($p['MARKER_X'], $p['MARKER_Y'], $p);
- }
- }
- $this->write($x + $param['width'] + 10, $y, $caption, IMAGE_GRAPH_ALIGN_CENTER_Y | IMAGE_GRAPH_ALIGN_LEFT, $param['font']);
- }
-
- if (($param['align'] & IMAGE_GRAPH_ALIGN_VERTICAL) != 0) {
- $param['y'] = $y2;
- } else {
- $param['x'] = $x2;
- }
- }
- }
- unset($keys);
- $this->_clip(false);
- $this->_canvas->endGroup();
- }
- }
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Pie.php b/config/archive/dspam/pear/Image/Graph/Plot/Pie.php
deleted file mode 100644
index f0e872c3..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Pie.php
+++ /dev/null
@@ -1,623 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * 2D Piechart.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plot_Pie extends Image_Graph_Plot
-{
-
- /**
- * The radius of the 'pie' spacing
- * @access private
- * @var int
- */
- var $_radius = 3;
-
- /**
- * Explode pie slices.
- * @access private
- * @var mixed
- */
- var $_explode = false;
-
- /**
- * The starting angle of the plot
- * @access private
- * @var int
- */
- var $_startingAngle = 0;
-
- /**
- * The angle direction (1 = CCW, -1 = CW)
- * @access private
- * @var int
- */
- var $_angleDirection = 1;
-
- /**
- * The diameter of the pie plot
- * @access private
- * @var int
- */
- var $_diameter = false;
-
- /**
- * Group items below this limit together as "the rest"
- * @access private
- * @var double
- */
- var $_restGroupLimit = false;
-
- /**
- * Rest group title
- * @access private
- * @var string
- */
- var $_restGroupTitle = 'The rest';
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $y = ($y0 + $y1) / 2;
- $this->_canvas->pieslice(
- array(
- 'x' => $x1,
- 'y' => $y,
- 'rx' => abs($x1 - $x0) / 2,
- 'ry' => abs($y1 - $y0) / 2,
- 'v1' => 45,
- 'v2' => 315
- )
- );
- }
-
- /**
- * Calculate marker point data
- *
- * @param array $point The point to calculate data for
- * @param array $nextPoint The next point
- * @param array $prevPoint The previous point
- * @param array $totals The pre-calculated totals, if needed
- * @return array An array containing marker point data
- * @access private
- */
- function _getMarkerData($point, $nextPoint, $prevPoint, &$totals)
- {
- $point = parent::_getMarkerData($point, $nextPoint, $prevPoint, $totals);
-
- $y = $totals['CURRENT_Y'];
-
- if ($this->_angleDirection < 0) {
- $y = $totals['ALL_SUM_Y'] - $y;
- }
-
- $point['ANGLE'] = 360 * (($y + ($point['Y'] / 2)) / $totals['ALL_SUM_Y']) + $this->_startingAngle;
- $totals['CURRENT_Y'] += $point['Y'];
-
- $point['ANG_X'] = cos(deg2rad($point['ANGLE']));
- $point['ANG_Y'] = sin(deg2rad($point['ANGLE']));
-
- $point['AX'] = -10 * $point['ANG_X'];
- $point['AY'] = -10 * $point['ANG_Y'];
-
- if ((isset($totals['ALL_SUM_Y'])) && ($totals['ALL_SUM_Y'] != 0)) {
- $point['PCT_MIN_Y'] = $point['PCT_MAX_Y'] = (100 * $point['Y'] / $totals['ALL_SUM_Y']);
- }
-
- $point['LENGTH'] = 10; //$radius;
-
- $x = $point['X'];
- $explodeRadius = 0;
- if ((is_array($this->_explode)) && (isset($this->_explode[$x]))) {
- $explodeRadius = $this->_explode[$x];
- } elseif (is_numeric($this->_explode)) {
- $explodeRadius = $this->_explode;
- }
-
- $point['MARKER_X'] = $totals['CENTER_X'] +
- ($totals['RADIUS'] + $explodeRadius) * $point['ANG_X'];
- $point['MARKER_Y'] = $totals['CENTER_Y'] +
- ($totals['RADIUS'] + $explodeRadius) * $point['ANG_Y'];
-
- return $point;
- }
-
- /**
- * Draws markers on the canvas
- *
- * @access private
- */
- function _drawMarker()
- {
-
- if ($this->_marker) {
- $totals = $this->_getTotals();
-
- $totals['CENTER_X'] = (int) (($this->_left + $this->_right) / 2);
- $totals['CENTER_Y'] = (int) (($this->_top + $this->_bottom) / 2);
-
- $totals['CURRENT_Y'] = 0;
- $number = 0;
-
- $diameter = $this->_getDiameter();
-
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
-
- if (count($this->_dataset) == 1) {
- $totals['RADIUS0'] = false;
- $totals['RADIUS'] = $diameter / 2;
- } else {
- $dr = $diameter / (2 * count($this->_dataset));
-
- $totals['RADIUS0'] = $number * $dr + ($number > 0 ? $this->_radius : 0);
- $totals['RADIUS'] = ($number + 1) * $dr;
- }
-
- $totals['ALL_SUM_Y'] = 0;
- $totals['CURRENT_Y'] = 0;
- $dataset->_reset();
- while ($point = $dataset->_next()) {
- $totals['ALL_SUM_Y'] += $point['Y'];
- }
-
- $dataset->_reset();
- $currentY = 0;
- $the_rest = 0;
- while ($point = $dataset->_next()) {
- if (($this->_restGroupLimit !== false) && ($point['Y'] <= $this->_restGroupLimit)) {
- $the_rest += $point['Y'];
- }
- else {
- if ((!is_object($this->_dataSelector)) ||
- ($this->_dataSelector->select($point))
- ) {
- $point = $this->_getMarkerData(
- $point,
- false,
- false,
- $totals
- );
- if (is_array($point)) {
- $this->_marker->_drawMarker(
- $point['MARKER_X'],
- $point['MARKER_Y'],
- $point
- );
- }
- }
- }
- }
- if ($the_rest > 0) {
- $point = array('X' => $this->_restGroupTitle, 'Y' => $the_rest);
- $point = $this->_getMarkerData(
- $point,
- false,
- false,
- $totals
- );
- if (is_array($point)) {
- $this->_marker->_drawMarker(
- $point['MARKER_X'],
- $point['MARKER_Y'],
- $point
- );
- }
- }
- $number++;
- }
- unset($keys);
- }
- }
-
- /**
- * Explodes a piece of this pie chart
- *
- * @param int $explode Radius to explode with (or an array)
- * @param string $x The 'x' value to explode or omitted
- */
- function explode($explode, $x = false)
- {
- if ($x === false) {
- $this->_explode = $explode;
- } else {
- $this->_explode[$x] = $explode;
- }
- }
-
- /**
- * Set the starting angle of the plot
- *
- * East is 0 degrees
- * South is 90 degrees
- * West is 180 degrees
- * North is 270 degrees
- *
- * It is also possible to specify the direction of the plot angles (i.e. clockwise 'cw' or
- * counterclockwise 'ccw')
- */
- function setStartingAngle($angle = 0, $direction = 'ccw')
- {
- $this->_startingAngle = ($angle % 360);
- $this->_angleDirection = ($direction == 'ccw' ? 1 : -1);
- }
-
- /**
- * Set the diameter of the pie plot (i.e. the number of pixels the
- * pie plot should be across)
- *
- * Use 'max' for the maximum possible diameter
- *
- * Use negative values for the maximum possible - minus this value (fx -2
- * to leave 1 pixel at each side)
- *
- * @param mixed @diameter The number of pixels
- */
- function setDiameter($diameter)
- {
- $this->_diameter = $diameter;
- }
-
- /**
- * Set the limit for the y-value, where values below are grouped together
- * as "the rest"
- *
- * @param double $limit The limit
- * @param string $title The title to display in the legends (default 'The
- * rest')
- */
- function setRestGroup($limit, $title = 'The rest')
- {
- $this->_restGroupLimit = $limit;
- $this->_restGroupTitle = $title;
- }
-
- /**
- * Get the diameter of the plot
- * @return int The number of pixels the diameter is
- * @access private
- */
- function _getDiameter()
- {
- $diameter = 0;
- if ($this->_diameter === false) {
- $diameter = min($this->height(), $this->width()) * 0.75;
- }
- else {
- if ($this->_diameter === 'max') {
- $diameter = min($this->height(), $this->width());
- }
- elseif ($this->_diameter < 0) {
- $diameter = min($this->height(), $this->width()) + $this->_diameter;
- } else {
- $diameter = $this->_diameter;
- }
- }
- return $diameter;
- }
-
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- $number = 0;
-
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
-
- $totalY = 0;
- $dataset->_reset();
- while ($point = $dataset->_next()) {
- $totalY += $point['Y'];
- }
-
- $centerX = (int) (($this->_left + $this->_right) / 2);
- $centerY = (int) (($this->_top + $this->_bottom) / 2);
- $diameter = $this->_getDiameter();
- if ($this->_angleDirection < 0) {
- $currentY = $totalY;
- } else {
- $currentY = 0; //rand(0, 100)*$totalY/100;
- }
- $dataset->_reset();
-
- if (count($this->_dataset) == 1) {
- $radius0 = false;
- $radius1 = $diameter / 2;
- } else {
- $dr = $diameter / (2 * count($this->_dataset));
-
- $radius0 = $number * $dr + ($number > 0 ? $this->_radius : 0);
- $radius1 = ($number + 1) * $dr;
- }
-
- $the_rest = 0;
- while ($point = $dataset->_next()) {
- if (($this->_restGroupLimit !== false) && ($point['Y'] <= $this->_restGroupLimit)) {
- $the_rest += $point['Y'];
- }
- else {
- $angle1 = 360 * ($currentY / $totalY) + $this->_startingAngle;
- $currentY += $this->_angleDirection * $point['Y'];
- $angle2 = 360 * ($currentY / $totalY) + $this->_startingAngle;
-
- $x = $point['X'];
- $id = $point['ID'];
-
- $dX = 0;
- $dY = 0;
- $explodeRadius = 0;
- if ((is_array($this->_explode)) && (isset($this->_explode[$x]))) {
- $explodeRadius = $this->_explode[$x];
- } elseif (is_numeric($this->_explode)) {
- $explodeRadius = $this->_explode;
- }
-
- if ($explodeRadius > 0) {
- $dX = $explodeRadius * cos(deg2rad(($angle1 + $angle2) / 2));
- $dY = $explodeRadius * sin(deg2rad(($angle1 + $angle2) / 2));
- }
-
- $ID = $point['ID'];
- $this->_getFillStyle($ID);
- $this->_getLineStyle($ID);
- $this->_canvas->pieslice(
- $this->_mergeData(
- $point,
- array(
- 'x' => $centerX + $dX,
- 'y' => $centerY + $dY,
- 'rx' => $radius1,
- 'ry' => $radius1,
- 'v1' => $angle1,
- 'v2' => $angle2,
- 'srx' => $radius0,
- 'sry' => $radius0
- )
- )
- );
- }
- }
-
- if ($the_rest > 0) {
- $angle1 = 360 * ($currentY / $totalY) + $this->_startingAngle;
- $currentY += $this->_angleDirection * $the_rest;
- $angle2 = 360 * ($currentY / $totalY) + $this->_startingAngle;
-
- $x = 'rest';
- $id = 'rest';
-
- $dX = 0;
- $dY = 0;
- $explodeRadius = 0;
- if ((is_array($this->_explode)) && (isset($this->_explode[$x]))) {
- $explodeRadius = $this->_explode[$x];
- } elseif (is_numeric($this->_explode)) {
- $explodeRadius = $this->_explode;
- }
-
- if ($explodeRadius > 0) {
- $dX = $explodeRadius * cos(deg2rad(($angle1 + $angle2) / 2));
- $dY = $explodeRadius * sin(deg2rad(($angle1 + $angle2) / 2));
- }
-
- $ID = $id;
- $this->_getFillStyle($ID);
- $this->_getLineStyle($ID);
- $this->_canvas->pieslice(
- $this->_mergeData(
- $point,
- array(
- 'x' => $centerX + $dX,
- 'y' => $centerY + $dY,
- 'rx' => $radius1,
- 'ry' => $radius1,
- 'v1' => $angle1,
- 'v2' => $angle2,
- 'srx' => $radius0,
- 'sry' => $radius0
- )
- )
- );
- }
- $number++;
- }
- unset($keys);
- $this->_drawMarker();
- return true;
- }
-
- /**
- * Draw a sample for use with legend
- *
- * @param array $param The parameters for the legend
- * @access private
- */
- function _legendSample(&$param)
- {
- if (is_array($this->_dataset)) {
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
- $this->_clip(true);
-
- $totals = $this->_getTotals();
- $totals['CENTER_X'] = (int) (($this->_left + $this->_right) / 2);
- $totals['CENTER_Y'] = (int) (($this->_top + $this->_bottom) / 2);
- $totals['RADIUS'] = min($this->height(), $this->width()) * 0.75 * 0.5;
- $totals['CURRENT_Y'] = 0;
-
- if (is_a($this->_fillStyle, "Image_Graph_Fill")) {
- $this->_fillStyle->_reset();
- }
-
- $count = 0;
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $count++;
-
- $dataset->_reset();
- $the_rest = 0;
- while ($point = $dataset->_next()) {
- $caption = $point['X'];
- if (($this->_restGroupLimit !== false) && ($point['Y'] <= $this->_restGroupLimit)) {
- $the_rest += $point['Y'];
- }
- else {
- $this->_canvas->setFont($param['font']);
- $width = 20 + $param['width'] + $this->_canvas->textWidth($caption);
- $param['maxwidth'] = max($param['maxwidth'], $width);
- $x2 = $param['x'] + $width;
- $y2 = $param['y'] + $param['height']+5;
-
- if ((($param['align'] & IMAGE_GRAPH_ALIGN_VERTICAL) != 0) && ($y2 > $param['bottom'])) {
- $param['y'] = $param['top'];
- $param['x'] = $x2;
- $y2 = $param['y'] + $param['height'];
- } elseif ((($param['align'] & IMAGE_GRAPH_ALIGN_VERTICAL) == 0) && ($x2 > $param['right'])) {
- $param['x'] = $param['left'];
- $param['y'] = $y2;
- $x2 = $param['x'] + 20 + $param['width'] + $this->_canvas->textWidth($caption);
- }
-
- $x = $x0 = $param['x'];
- $y = $param['y'];
- $y0 = $param['y'] - $param['height']/2;
- $x1 = $param['x'] + $param['width'];
- $y1 = $param['y'] + $param['height']/2;
-
- if (!isset($param['simulate'])) {
- $this->_getFillStyle($point['ID']);
- $this->_getLineStyle($point['ID']);
- $this->_drawLegendSample($x0, $y0, $x1, $y1);
-
- if (($this->_marker) && ($dataset) && ($param['show_marker'])) {
- $prevPoint = $dataset->_nearby(-2);
- $nextPoint = $dataset->_nearby();
-
- $p = $this->_getMarkerData($point, $nextPoint, $prevPoint, $totals);
- if (is_array($point)) {
- $p['MARKER_X'] = $x+$param['width']/2;
- $p['MARKER_Y'] = $y;
- unset ($p['AVERAGE_Y']);
- $this->_marker->_drawMarker($p['MARKER_X'], $p['MARKER_Y'], $p);
- }
- }
- $this->write($x + $param['width'] +10, $y, $caption, IMAGE_GRAPH_ALIGN_CENTER_Y | IMAGE_GRAPH_ALIGN_LEFT, $param['font']);
- }
-
- if (($param['align'] & IMAGE_GRAPH_ALIGN_VERTICAL) != 0) {
- $param['y'] = $y2;
- } else {
- $param['x'] = $x2;
- }
- }
- }
- if ($the_rest > 0) {
- $this->_canvas->setFont($param['font']);
- $width = 20 + $param['width'] + $this->_canvas->textWidth($this->_restGroupTitle);
- $param['maxwidth'] = max($param['maxwidth'], $width);
- $x2 = $param['x'] + $width;
- $y2 = $param['y'] + $param['height']+5;
-
- if ((($param['align'] & IMAGE_GRAPH_ALIGN_VERTICAL) != 0) && ($y2 > $param['bottom'])) {
- $param['y'] = $param['top'];
- $param['x'] = $x2;
- $y2 = $param['y'] + $param['height'];
- } elseif ((($param['align'] & IMAGE_GRAPH_ALIGN_VERTICAL) == 0) && ($x2 > $param['right'])) {
- $param['x'] = $param['left'];
- $param['y'] = $y2;
- $x2 = $param['x'] + 20 + $param['width'] + $this->_canvas->textWidth($this->_restGroupTitle);
- }
-
- $x = $x0 = $param['x'];
- $y = $param['y'];
- $y0 = $param['y'] - $param['height']/2;
- $x1 = $param['x'] + $param['width'];
- $y1 = $param['y'] + $param['height']/2;
-
- if (!isset($param['simulate'])) {
- $this->_getFillStyle('rest');
- $this->_getLineStyle('rest');
- $this->_drawLegendSample($x0, $y0, $x1, $y1);
-
- $this->write($x + $param['width'] + 10, $y, $this->_restGroupTitle, IMAGE_GRAPH_ALIGN_CENTER_Y | IMAGE_GRAPH_ALIGN_LEFT, $param['font']);
- }
-
- if (($param['align'] & IMAGE_GRAPH_ALIGN_VERTICAL) != 0) {
- $param['y'] = $y2;
- } else {
- $param['x'] = $x2;
- }
- }
- }
- unset($keys);
- $this->_clip(false);
- $this->_canvas->endGroup();
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Radar.php b/config/archive/dspam/pear/Image/Graph/Plot/Radar.php
deleted file mode 100644
index 1bfd9da7..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Radar.php
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * Radar chart.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plot_Radar extends Image_Graph_Plot
-{
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $p = 10;
- $rx = abs($x1 - $x0) / 2;
- $ry = abs($x1 - $x0) / 2;
- $r = min($rx, $ry);
- $cx = ($x0 + $x1) / 2;
- $cy = ($y0 + $y1) / 2;
- $max = 5;
- for ($i = 0; $i < $p; $i++) {
- $v = 2 * pi() * $i / $p;
- $t = $r * rand(3, $max) / $max;
- $x = $cx + $t * cos($v);
- $y = $cy + $t * sin($v);
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y));
- }
- $this->_canvas->polygon(array('connect' => true));
- }
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
- $this->_clip(true);
- if (is_a($this->_parent, 'Image_Graph_Plotarea_Radar')) {
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $maxY = $dataset->maximumY();
- $count = $dataset->count();
-
- $dataset->_reset();
- while ($point = $dataset->_next()) {
- $this->_canvas->addVertex(array('x' =>
- $this->_pointX($point), 'y' =>
- $this->_pointY($point)
- ));
- }
- $this->_getFillStyle($key);
- $this->_getLineStyle($key);
- $this->_canvas->polygon(array('connect' => true));
- }
- unset($keys);
- }
- $this->_drawMarker();
-
- $this->_clip(false);
- $this->_canvas->endGroup();
- return parent::_done();
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Area.php b/config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Area.php
deleted file mode 100644
index 8ea469dd..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Area.php
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot/Smoothed/Bezier.php
- */
-require_once 'Image/Graph/Plot/Smoothed/Bezier.php';
-
-/**
- * Bezier smoothed area chart
- *
- * Similar to an {@link Image_Graph_Plot_Area}, but the interconnecting lines
- * between two datapoints are smoothed using a Bezier curve, which enables the
- * chart to appear as a nice curved plot instead of the sharp edges of a
- * conventional {@link Image_Graph_Plot_Area}. Smoothed charts are only supported
- * with non-stacked types
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plot_Smoothed_Area extends Image_Graph_Plot_Smoothed_Bezier
-{
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
-
- $this->_canvas->addVertex(array('x' => $x0, 'y' => $y1));
- $this->_addSamplePoints($x0, $y0, $x1, $y1);
- $this->_canvas->addVertex(array('x' => $x1, 'y' => $y1));
- $this->_canvas->polygon(array('connect' => true));
- }
-
- /**
- * Output the Bezier smoothed plot as an Area Chart
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
- $this->_clip(true);
-
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- $first = true;
- while ($p1 = $dataset->_next()) {
- $p0 = $dataset->_nearby(-2);
- $p2 = $dataset->_nearby(0);
- $p3 = $dataset->_nearby(1);
- if ($first) {
- $p = $p1;
- $p['Y'] = '#min_pos#';
- $x = $this->_pointX($p);
- $y = $this->_pointY($p);
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y));
- }
-
- if ($p2) {
- $cp = $this->_getControlPoints($p1, $p0, $p2, $p3);
- $this->_canvas->addSpline(
- array(
- 'x' => $cp['X'],
- 'y' => $cp['Y'],
- 'p1x' => $cp['P1X'],
- 'p1y' => $cp['P1Y'],
- 'p2x' => $cp['P2X'],
- 'p2y' => $cp['P2Y']
- )
- );
- } else {
- $x = $this->_pointX($p1);
- $y = $this->_pointY($p1);
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y));
- }
- $lastPoint = $p1;
- $first = false;
- }
- $lastPoint['Y'] = '#min_pos#';
- $x = $this->_pointX($lastPoint);
- $y = $this->_pointY($lastPoint);
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y));
-
- $this->_getFillStyle($key);
- $this->_getLineStyle($key);
- $this->_canvas->polygon(array('connect' => true));
- }
- unset($keys);
- $this->_drawMarker();
- $this->_clip(false);
- $this->_canvas->endGroup();
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Bezier.php b/config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Bezier.php
deleted file mode 100644
index bc21b4c8..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Bezier.php
+++ /dev/null
@@ -1,173 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot.php
- */
-require_once 'Image/Graph/Plot.php';
-
-/**
- * Include file Image/Graph/Tool.php
- */
-require_once 'Image/Graph/Tool.php';
-
-/**
- * Bezier smoothed plottype.
- *
- * The framework for calculating the Bezier smoothed curve from the dataset.
- * Used in {@link Image_Graph_Plot_Smoothed_Line} and {@link
- * Image_Graph_Plot_Smoothed_Area}. Smoothed charts are only supported with non-
- * stacked types
- * @link http://homepages.borland.com/efg2lab/Graphics/Jean-
- * YvesQueinecBezierCurves.htm efg computer lab - description of bezier curves
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @abstract
- */
-class Image_Graph_Plot_Smoothed_Bezier extends Image_Graph_Plot
-{
-
- /**
- * Image_Graph_Plot_Smoothed_Bezier [Constructor]
- *
- * Only 'normal' multitype supported
- *
- * @param Dataset $dataset The data set (value containter) to plot
- * @param string $title The title of the plot (used for legends, {@link
- * Image_Graph_Legend})
- */
- function Image_Graph_Plot_Smoothed_Bezier(& $dataset, $title = '')
- {
- parent::Image_Graph_Plot($dataset, 'normal', $title);
- }
-
- /**
- * Return the minimum Y point
- *
- * @return double The minumum Y point
- * @access private
- */
- function _minimumY()
- {
- return 1.05 * parent::_minimumY();
- }
-
- /**
- * Return the maximum Y point
- *
- * @return double The maximum Y point
- * @access private
- */
- function _maximumY()
- {
- return 1.05 * parent::_maximumY();
- }
-
- /**
- * Calculates all Bezier points, for the curve
- *
- * @param array $p1 The actual point to calculate control points for
- * @param array $p0 The point "just before" $p1
- * @param array $p2 The point "just after" $p1
- * @param array $p3 The point "just after" $p2
- * @return array Array of Bezier points
- * @access private
- */
- function _getControlPoints($p1, $p0, $p2, $p3)
- {
- $p1 = $this->_pointXY($p1);
- if ($p2) {
- $p2 = $this->_pointXY($p2);
- }
- if (!$p0) {
- $p0['X'] = $p1['X'] - abs($p2['X'] - $p1['X']);
- $p0['Y'] = $p1['Y']; //-($p2['Y']-$p1['Y']);
- } else {
- $p0 = $this->_pointXY($p0);
- }
- if (!$p3) {
- $p3['X'] = $p1['X'] + 2*abs($p1['X'] - $p0['X']);
- $p3['Y'] = $p1['Y'];
- } else {
- $p3 = $this->_pointXY($p3);
- }
-
- if (!$p2) {
- $p2['X'] = $p1['X'] + abs($p1['X'] - $p0['X']);
- $p2['Y'] = $p1['Y'];
- }
-
- $pC1['X'] = Image_Graph_Tool::controlPoint($p0['X'], $p1['X'], $p2['X']);
- $pC1['Y'] = Image_Graph_Tool::controlPoint($p0['Y'], $p1['Y'], $p2['Y']);
- $pC2['X'] = Image_Graph_Tool::controlPoint($p3['X'], $p2['X'], $p1['X']);
- $pC2['Y'] = Image_Graph_Tool::controlPoint($p3['Y'], $p2['Y'], $p1['Y']);
-
- return array(
- 'X' => $p1['X'],
- 'Y' => $p1['Y'],
- 'P1X' => $pC1['X'],
- 'P1Y' => $pC1['Y'],
- 'P2X' => $pC2['X'],
- 'P2Y' => $pC2['Y']
- );
- }
-
- /**
- * Create legend sample data for the canvas.
- *
- * Common for all smoothed plots
- *
- * @access private
- */
- function _addSamplePoints($x0, $y0, $x1, $y1)
- {
- $p = abs($x1 - $x0);
- $cy = ($y0 + $y1) / 2;
- $h = abs($y1 - $y0);
- $dy = $h / 4;
- $dw = abs($x1 - $x0) / $p;
- for ($i = 0; $i < $p; $i++) {
- $v = 2 * pi() * $i / $p;
- $x = $x0 + $i * $dw;
- $y = $cy + 2 * $v * sin($v);
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y));
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Line.php b/config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Line.php
deleted file mode 100644
index 00692839..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Line.php
+++ /dev/null
@@ -1,172 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot/Smoothed/Bezier.php
- */
-require_once 'Image/Graph/Plot/Smoothed/Bezier.php';
-
-/**
- * Bezier smoothed line chart.
- *
- * Similar to a {@link Image_Graph_Plot_Line}, but the interconnecting lines
- * between two datapoints are smoothed using a Bezier curve, which enables the
- * chart to appear as a nice curved plot instead of the sharp edges of a
- * conventional {@link Image_Graph_Plot_Line}. Smoothed charts are only supported
- * with non-stacked types
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plot_Smoothed_Line extends Image_Graph_Plot_Smoothed_Bezier
-{
-
- /**
- * Gets the fill style of the element
- *
- * @return int A GD filestyle representing the fill style
- * @see Image_Graph_Fill
- * @access private
- */
- function _getFillStyle($ID = false)
- {
- return IMG_COLOR_TRANSPARENT;
- }
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $this->_addSamplePoints($x0, $y0, $x1, $y1);
- $this->_canvas->polygon(array('connect' => false));
- }
-
- /**
- * Output the Bezier smoothed plot as an Line Chart
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (parent::_done() === false) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
- $this->_clip(true);
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- $numPoints = 0;
- while ($p1 = $dataset->_next()) {
- if ($p1['Y'] === null) {
- if ($numPoints > 1) {
- $this->_getLineStyle($key);
- $this->_canvas->polygon(array('connect' => false, 'map_vertices' => true));
- }
- else {
- $this->_canvas->reset();
- }
- $numPoints = 0;
- } else {
- $p0 = $dataset->_nearby(-2);
- $p2 = $dataset->_nearby(0);
- $p3 = $dataset->_nearby(1);
-
- if (($p0) && ($p0['Y'] === null)) {
- $p0 = false;
- }
- if (($p2) && ($p2['Y'] === null)) {
- $p2 = false;
- }
- if (($p3) && ($p3['Y'] === null)) {
- $p3 = false;
- }
-
- if ($p2) {
- $cp = $this->_getControlPoints($p1, $p0, $p2, $p3);
- $this->_canvas->addSpline(
- $this->_mergeData(
- $p1,
- array(
- 'x' => $cp['X'],
- 'y' => $cp['Y'],
- 'p1x' => $cp['P1X'],
- 'p1y' => $cp['P1Y'],
- 'p2x' => $cp['P2X'],
- 'p2y' => $cp['P2Y']
- )
- )
- );
- } else {
- $x = $this->_pointX($p1);
- $y = $this->_pointY($p1);
- $this->_canvas->addVertex(
- $this->_mergeData(
- $p1,
- array('x' => $x, 'y' => $y)
- )
- );
- }
- $numPoints++;
- }
- }
- if ($numPoints > 1) {
- $this->_getLineStyle();
- $this->_canvas->polygon(array('connect' => false, 'map_vertices' => true));
- }
- else {
- $this->_canvas->reset();
- }
- }
- unset($keys);
- $this->_drawMarker();
- $this->_clip(false);
- $this->_canvas->endGroup();
- return true;
- }
-
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Radar.php b/config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Radar.php
deleted file mode 100644
index d505a11f..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Smoothed/Radar.php
+++ /dev/null
@@ -1,142 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- * @since File available since Release 0.3.0dev2
- */
-
-/**
- * Include file Image/Graph/Plot/Smoothed/Bezier.php
- */
-require_once 'Image/Graph/Plot/Smoothed/Bezier.php';
-
-/**
- * Smoothed radar chart.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @since Class available since Release 0.3.0dev2
- */
-class Image_Graph_Plot_Smoothed_Radar extends Image_Graph_Plot_Smoothed_Bezier
-{
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
- $this->_clip(true);
- if (is_a($this->_parent, 'Image_Graph_Plotarea_Radar')) {
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- if ($dataset->count() >= 3) {
- $dataset->_reset();
- $p1_ = $dataset->_next();
- $p2_ = $dataset->_next();
- $p3_ = $dataset->_next();
- $plast_ = false;
- if ($p3_) {
- while ($p = $dataset->_next()) {
- $plast_ = $p;
- }
- }
-
- if ($plast_ === false) {
- $plast_ = $p3_;
- }
- $dataset->_reset();
- while ($p1 = $dataset->_next()) {
- $p0 = $dataset->_nearby(-2);
- $p2 = $dataset->_nearby(0);
- $p3 = $dataset->_nearby(1);
-
- if ($p0 === false) {
- $p0 = $plast_;
- }
-
- if ($p2 === false) {
- $p2 = $p1_;
- $p3 = $p2_;
- } elseif ($p3 === false) {
- $p3 = $p1_;
- }
-
-
- $cp = $this->_getControlPoints($p1, $p0, $p2, $p3);
- $this->_canvas->addSpline(
- array(
- 'x' => $cp['X'],
- 'y' => $cp['Y'],
- 'p1x' => $cp['P1X'],
- 'p1y' => $cp['P1Y'],
- 'p2x' => $cp['P2X'],
- 'p2y' => $cp['P2Y']
- )
- );
-
- $next2last = $p0;
- $last = $p1;
- }
-
- $cp = $this->_getControlPoints($p1_, $plast_, $p2_, $p3_);
- $this->_canvas->addSpline(
- array(
- 'x' => $cp['X'],
- 'y' => $cp['Y'],
- 'p1x' => $cp['P1X'],
- 'p1y' => $cp['P1Y'],
- 'p2x' => $cp['P2X'],
- 'p2y' => $cp['P2Y']
- )
- );
- $this->_getFillStyle($key);
- $this->_getLineStyle($key);
- $this->_canvas->polygon(array('connect' => true));
- }
- }
- unset($keys);
- }
- $this->_drawMarker();
- $this->_clip(false);
- $this->_canvas->endGroup($this->_title);
- return parent::_done();
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plot/Step.php b/config/archive/dspam/pear/Image/Graph/Plot/Step.php
deleted file mode 100644
index bc9267fe..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plot/Step.php
+++ /dev/null
@@ -1,200 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plot/Bar.php
- */
-require_once 'Image/Graph/Plot/Bar.php';
-
-/**
- * Step chart.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plot
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plot_Step extends Image_Graph_Plot
-{
-
- /**
- * Perform the actual drawing on the legend.
- *
- * @param int $x0 The top-left x-coordinate
- * @param int $y0 The top-left y-coordinate
- * @param int $x1 The bottom-right x-coordinate
- * @param int $y1 The bottom-right y-coordinate
- * @access private
- */
- function _drawLegendSample($x0, $y0, $x1, $y1)
- {
- $dx = abs($x1 - $x0) / 3;
- $dy = abs($y1 - $y0) / 3;
- $this->_canvas->addVertex(array('x' => $x0, 'y' => $y1));
- $this->_canvas->addVertex(array('x' => $x0, 'y' => $y0 + $dy));
-
- $this->_canvas->addVertex(array('x' => $x0 + $dx, 'y' => $y0 + $dy));
- $this->_canvas->addVertex(array('x' => $x0 + $dx, 'y' => $y0));
-
- $this->_canvas->addVertex(array('x' => $x0 + 2*$dx, 'y' => $y0));
- $this->_canvas->addVertex(array('x' => $x0 + 2*$dx, 'y' => $y0 + 2*$dy));
-
- $this->_canvas->addVertex(array('x' => $x1, 'y' => $y0 + 2*$dy));
- $this->_canvas->addVertex(array('x' => $x1, 'y' => $y1));
- $this->_canvas->polygon(array('connect' => true));
- }
-
- /**
- * PlotType [Constructor]
- *
- * A 'normal' step chart is 'stacked'
- *
- * @param Dataset $dataset The data set (value containter) to plot
- * @param string $multiType The type of the plot
- * @param string $title The title of the plot (used for legends,
- * {@link Image_Graph_Legend})
- */
- function Image_Graph_Plot_Step(& $dataset, $multiType = 'stacked', $title = '')
- {
- $multiType = strtolower($multiType);
- if (($multiType != 'stacked') && ($multiType != 'stacked100pct')) {
- $multiType = 'stacked';
- }
- parent::Image_Graph_Plot($dataset, $multiType, $title);
- }
-
- /**
- * Output the plot
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if (Image_Graph_Plot::_done() === false) {
- return false;
- }
-
- $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
- $this->_clip(true);
-
- if ($this->_multiType == 'stacked100pct') {
- $total = $this->_getTotals();
- }
-
- if ($this->_parent->_horizontal) {
- $width = $this->height() / ($this->_maximumX() + 2) / 2;
- }
- else {
- $width = $this->width() / ($this->_maximumX() + 2) / 2;
- }
-
- reset($this->_dataset);
- $key = key($this->_dataset);
- $dataset =& $this->_dataset[$key];
-
- $first = $dataset->first();
- $last = $dataset->last();
-
- $point = array ('X' => $first['X'], 'Y' => '#min_pos#');
- $firstY = $this->_pointY($point) + ($this->_parent->_horizontal ? $width : 0);
- $base[] = $firstY;
- $firstX = $this->_pointX($point) - ($this->_parent->_horizontal ? 0 : $width);
- $base[] = $firstX;
-
- $point = array ('X' => $last['X'], 'Y' => '#min_pos#');
- $base[] = $this->_pointY($point) - ($this->_parent->_horizontal ? $width : 0);
- $base[] = $this->_pointX($point) + ($this->_parent->_horizontal ? 0 : $width);
-
- $first = ($this->_parent->_horizontal ? $firstY : $firstX);
-
- $keys = array_keys($this->_dataset);
- foreach ($keys as $key) {
- $dataset =& $this->_dataset[$key];
- $dataset->_reset();
- $polygon = array_reverse($base);
- unset ($base);
- $last = $first;
- while ($point = $dataset->_next()) {
- $x = $point['X'];
- $p = $point;
-
- if (!isset($current[$x])) {
- $current[$x] = 0;
- }
-
- if ($this->_multiType == 'stacked100pct') {
- $p['Y'] = 100 * ($current[$x] + $point['Y']) / $total['TOTAL_Y'][$x];
- } else {
- $p['Y'] += $current[$x];
- }
- $current[$x] += $point['Y'];
- $point = $p;
-
- if ($this->_parent->_horizontal) {
- $x0 = $this->_pointX($point);
- $y0 = $last;
- $x1 = $this->_pointX($point);
- $last = $y1 = $this->_pointY($point) - $width;
- }
- else {
- $x0 = $last;
- $y0 = $this->_pointY($point);
- $last = $x1 = $this->_pointX($point) + $width;
- $y1 = $this->_pointY($point);
- }
- $polygon[] = $x0; $base[] = $y0;
- $polygon[] = $y0; $base[] = $x0;
- $polygon[] = $x1; $base[] = $y1;
- $polygon[] = $y1; $base[] = $x1;
- }
-
- while (list(, $x) = each($polygon)) {
- list(, $y) = each($polygon);
- $this->_canvas->addVertex(array('x' => $x, 'y' => $y));
- }
-
- $this->_getFillStyle($key);
- $this->_getLineStyle($key);
- $this->_canvas->polygon(array('connect' => true));
- }
- unset($keys);
- $this->_drawMarker();
- $this->_clip(false);
- $this->_canvas->endGroup();
- return true;
- }
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plotarea.php b/config/archive/dspam/pear/Image/Graph/Plotarea.php
deleted file mode 100644
index 42aeb26a..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plotarea.php
+++ /dev/null
@@ -1,1145 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plotarea
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Layout.php
- */
-require_once 'Image/Graph/Layout.php';
-
-/**
- * Plot area used for drawing plots.
- *
- * The plotarea consists of an x-axis and an y-axis, the plotarea can plot multiple
- * charts within one plotares, by simply adding them (the axis' will scale to the
- * plots automatically). A graph can consist of more plotareas
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plotarea
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plotarea extends Image_Graph_Layout
-{
-
- /**
- * The left most pixel of the 'real' plot area on the canvas
- * @var int
- * @access private
- */
- var $_plotLeft = 0;
-
- /**
- * The top most pixel of the 'real' plot area on the canvas
- * @var int
- * @access private
- */
- var $_plotTop = 0;
-
- /**
- * The right most pixel of the 'real' plot area on the canvas
- * @var int
- * @access private
- */
- var $_plotRight = 0;
-
- /**
- * The bottom most pixel of the 'real' plot area on the canvas
- * @var int
- * @access private
- */
- var $_plotBottom = 0;
-
- /**
- * The X axis
- * @var Axis
- * @access private
- */
- var $_axisX = null;
-
- /**
- * The Y axis
- * @var Axis
- * @access private
- */
- var $_axisY = null;
-
- /**
- * The secondary Y axis
- * @var Axis
- * @access private
- */
- var $_axisYSecondary = null;
-
- /**
- * The border style of the 'real' plot area
- * @var LineStyle
- * @access private
- */
- var $_plotBorderStyle = null;
-
- /**
- * Does any plot have any data?
- * @var bool
- * @access private
- */
- var $_hasData = false;
-
- /**
- * Is the plotarea horizontal?
- * @var bool
- * @access private
- */
- var $_horizontal = false;
-
- /**
- * Image_Graph_Plotarea [Constructor]
- *
- * @param string $axisX The class of the X axis (if omitted a std. axis is created)
- * @param string $axisY The class of the Y axis (if omitted a std. axis is created)
- * @param string $direction The direction of the plotarea - 'horizontal' or 'vertical' (default)
- */
- function Image_Graph_Plotarea($axisX = 'Image_Graph_Axis_Category', $axisY = 'Image_Graph_Axis', $direction = 'vertical')
- {
- parent::Image_Graph_Layout();
-
- $this->_padding = array('left' => 5, 'top' => 5, 'right' => 5, 'bottom' => 5);;
-
- include_once 'Image/Graph.php';
-
- $this->_axisX =& Image_Graph::factory($axisX, IMAGE_GRAPH_AXIS_X);
- $this->_axisX->_setParent($this);
-
- $this->_axisY =& Image_Graph::factory($axisY, IMAGE_GRAPH_AXIS_Y);
- $this->_axisY->_setParent($this);
- $this->_axisY->_setMinimum(0);
-
- $this->_fillStyle = false;
-
- if ($direction == 'horizontal') {
- $this->_horizontal = true;
- $this->_axisX->_transpose = true;
- $this->_axisY->_transpose = true;
- }
- }
-
- /**
- * Sets the parent. The parent chain should ultimately be a GraPHP object
- *
- * @see Image_Graph_Common
- * @param Image_Graph_Common $parent The parent
- * @access private
- */
- function _setParent(& $parent)
- {
- parent::_setParent($parent);
- if ($this->_axisX !== null) {
- $this->_axisX->_setParent($this);
- }
- if ($this->_axisY !== null) {
- $this->_axisY->_setParent($this);
- }
- if ($this->_axisYSecondary !== null) {
- $this->_axisYSecondary->_setParent($this);
- }
- }
-
- /**
- * Sets the plot border line style of the element.
- *
- * @param Image_Graph_Line $lineStyle The line style of the border
- * @deprecated 0.3.0dev2 - 2004-12-16
- */
- function setPlotBorderStyle(& $plotBorderStyle)
- {
- }
-
- /**
- * Adds an element to the plotarea
- *
- * @param Image_Graph_Element $element The element to add
- * @param int $axis The axis to associate the element with, either
- * IMAGE_GRAPH_AXIS_X, IMAGE_GRAPH_AXIS_Y, IMAGE_GRAPH_AXIS_Y_SECONDARY
- * or the shorter string notations 'x', 'y' or 'ysec' (defaults to
- * IMAGE_GRAPH_AXIS_Y)
- * @return Image_Graph_Element The added element
- * @see Image_Graph_Common::add()
- */
- function &add(& $element, $axis = IMAGE_GRAPH_AXIS_Y)
- {
- if ($axis == 'x') {
- $axis = IMAGE_GRAPH_AXIS_X;
- }
- if ($axis == 'y') {
- $axis = IMAGE_GRAPH_AXIS_Y;
- }
- if ($axis == 'ysec') {
- $axis = IMAGE_GRAPH_AXIS_Y_SECONDARY;
- }
- if (($axis == IMAGE_GRAPH_AXIS_Y_SECONDARY) &&
- ($this->_axisYSecondary == null))
- {
- $this->_axisYSecondary =& Image_Graph::factory('axis', IMAGE_GRAPH_AXIS_Y_SECONDARY);
- $this->_axisYSecondary->_setMinimum(0);
- if ($this->_horizontal) {
- $this->_axisYSecondary->_transpose = true;
- }
- }
-
- parent::add($element);
-
- if (is_a($element, 'Image_Graph_Plot')) {
- $element->_setAxisY($axis);
- // postpone extrema calculation until we calculate coordinates
- //$this->_setExtrema($element);
- } elseif (is_a($element, 'Image_Graph_Grid')) {
- switch ($axis) {
- case IMAGE_GRAPH_AXIS_X:
- if ($this->_axisX != null) {
- $element->_setPrimaryAxis($this->_axisX);
- if ($this->_axisY != null) {
- $element->_setSecondaryAxis($this->_axisY);
- }
- }
- break;
- case IMAGE_GRAPH_AXIS_Y:
- if ($this->_axisY != null) {
- $element->_setPrimaryAxis($this->_axisY);
- if ($this->_axisX != null) {
- $element->_setSecondaryAxis($this->_axisX);
- }
- }
- break;
- case IMAGE_GRAPH_AXIS_Y_SECONDARY:
- if ($this->_axisYSecondary != null) {
- $element->_setPrimaryAxis($this->_axisYSecondary);
- if ($this->_axisX != null) {
- $element->_setSecondaryAxis($this->_axisX);
- }
- }
- break;
- }
- } elseif (is_a($element, 'Image_Graph_Axis')) {
- switch ($element->_type) {
- case IMAGE_GRAPH_AXIS_X:
- $this->_axisX =& $element;
- break;
-
- case IMAGE_GRAPH_AXIS_Y:
- $this->_axisY =& $element;
- break;
-
- case IMAGE_GRAPH_AXIS_Y_SECONDARY:
- $this->_axisYSecondary =& $element;
- break;
-
- }
- if ($element->_getMinimum() == $element->_getMaximum()) {
- $element->_setMinimum(0);
- $element->_setMaximum(1);
- }
- }
- return $element;
- }
-
- /**
- * Get the width of the 'real' plotarea
- *
- * @return int The width of the 'real' plotarea, ie not including space occupied by padding and axis
- * @access private
- */
- function _plotWidth()
- {
- return abs($this->_plotRight - $this->_plotLeft);
- }
-
- /**
- * Get the height of the 'real' plotarea
- *
- * @return int The height of the 'real' plotarea, ie not including space
- * occupied by padding and axis
- * @access private
- */
- function _plotHeight()
- {
- return abs($this->_plotBottom - $this->_plotTop);
- }
-
- /**
- * Set the extrema of the axis
- *
- * @param Image_Graph_Plot $plot The plot that 'hold' the values
- * @access private
- */
- function _setExtrema(& $plot)
- {
- if (($this->_axisX != null) && ($this->_axisX->_isNumeric())) {
- $this->_axisX->_setMinimum($plot->_minimumX());
- $this->_axisX->_setMaximum($plot->_maximumX());
- }
-
- if (($plot->_axisY == IMAGE_GRAPH_AXIS_Y_SECONDARY) &&
- ($this->_axisYSecondary !== null) &&
- ($this->_axisYSecondary->_isNumeric()))
- {
- $this->_axisYSecondary->_setMinimum($plot->_minimumY());
- $this->_axisYSecondary->_setMaximum($plot->_maximumY());
- } elseif (($this->_axisY != null) && ($this->_axisY->_isNumeric())) {
- $this->_axisY->_setMinimum($plot->_minimumY());
- $this->_axisY->_setMaximum($plot->_maximumY());
- }
-
- $datasets =& $plot->dataset();
- if (!is_array($datasets)) {
- $datasets = array($datasets);
- }
-
- $keys = array_keys($datasets);
- foreach ($keys as $key) {
- $dataset =& $datasets[$key];
- if ($dataset->count() > 0) {
- $this->_hasData = true;
- }
-
- if (is_a($dataset, 'Image_Graph_Dataset')) {
- if (($this->_axisX != null) && (!$this->_axisX->_isNumeric())) {
- $this->_axisX->_applyDataset($dataset);
- }
-
- if (($plot->_axisY == IMAGE_GRAPH_AXIS_Y_SECONDARY) &&
- ($this->_axisYSecondary !== null) &&
- (!$this->_axisYSecondary->_isNumeric()))
- {
- $this->_axisYSecondary->_applyDataset($dataset);
- } elseif (($this->_axisY != null) && (!$this->_axisY->_isNumeric())) {
- $this->_axisY->_applyDataset($dataset);
- }
- }
- }
- unset($keys);
- }
-
- /**
- * Left boundary of the background fill area
- *
- * @return int Leftmost position on the canvas
- * @access private
- */
- function _fillLeft()
- {
- return $this->_plotLeft;
- }
-
- /**
- * Top boundary of the background fill area
- *
- * @return int Topmost position on the canvas
- * @access private
- */
- function _fillTop()
- {
- return $this->_plotTop;
- }
-
- /**
- * Right boundary of the background fill area
- *
- * @return int Rightmost position on the canvas
- * @access private
- */
- function _fillRight()
- {
- return $this->_plotRight;
- }
-
- /**
- * Bottom boundary of the background fill area
- *
- * @return int Bottommost position on the canvas
- * @access private
- */
- function _fillBottom()
- {
- return $this->_plotBottom;
- }
-
- /**
- * Get the point from the x-axis
- * @param array $value The value array
- * @param int $min The minimum pixel position possible
- * @param int $max The maximum pixel position possible
- * @return int The pixel position from the axis
- * @access private
- */
- function _axisPointX($value, $min, $max)
- {
- if (($this->_axisX == null) || (!isset($value['X']))) {
- return false;
- }
-
- if ($value['X'] === '#min#') {
- return $min;
- }
- if ($value['X'] === '#max#') {
- return $max;
- }
-
- return $this->_axisX->_point($value['X']);
- }
-
- /**
- * Get the point from the x-axis
- * @param array $value The value array
- * @param int $min The minimum pixel position possible
- * @param int $max The maximum pixel position possible
- * @return int The pixel position from the axis
- * @access private
- */
- function _axisPointY($value, $min, $max)
- {
- if (!isset($value['Y'])) {
- return false;
- }
-
- if (($value['Y'] === '#min_pos#') || ($value['Y'] === '#max_nex#')) {
- // return the minimum (bottom) position or if negative then zero
- // or the maxmum (top) position or if positive then zero
- if ((isset($value['AXIS_Y'])) &&
- ($value['AXIS_Y'] == IMAGE_GRAPH_AXIS_Y_SECONDARY) &&
- ($this->_axisYSecondary !== null)
- ) {
- $axisY =& $this->_axisYSecondary;
- } else {
- $axisY =& $this->_axisY;
- }
- if ($value['Y'] === '#min_pos#') {
- return $axisY->_point(max(0, $axisY->_getMinimum()));
- } else {
- return $axisY->_point(min(0, $axisY->_getMaximum()));
- }
- }
-
- if ($value['Y'] === '#min#') {
- return $min;
- }
- if ($value['Y'] === '#max#') {
- return $max;
- }
-
- if ((isset($value['AXIS_Y'])) &&
- ($value['AXIS_Y'] == IMAGE_GRAPH_AXIS_Y_SECONDARY)
- ) {
- if ($this->_axisYSecondary !== null) {
- return $this->_axisYSecondary->_point($value['Y']);
- }
- } else {
- if ($this->_axisY !== null) {
- return $this->_axisY->_point($value['Y']);
- }
- }
- return false;
- }
-
- /**
- * Get the X pixel position represented by a value
- *
- * @param double Value the value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _pointX($value)
- {
- if ($this->_horizontal) {
- return $this->_axisPointY($value, $this->_plotLeft, $this->_plotRight);
- }
- else {
- return $this->_axisPointX($value, $this->_plotLeft, $this->_plotRight);
- }
- }
-
- /**
- * Get the Y pixel position represented by a value
- *
- * @param double Value the value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _pointY($value)
- {
- if ($this->_horizontal) {
- return $this->_axisPointX($value, $this->_plotBottom, $this->_plotTop);
- }
- else {
- return $this->_axisPointY($value, $this->_plotBottom, $this->_plotTop);
- }
- }
-
- /**
- * Return the minimum value of the specified axis
- *
- * @param int $axis The axis to return the minimum value of (see {$link
- * Image_Graph_Plotarea::getAxis()})
- * @return double The minimum value of the axis
- * @access private
- */
- function _getMinimum($axis = IMAGE_GRAPH_AXIS_Y)
- {
- $axis =& $this->getAxis($axis);
- if ($axis !== null) {
- return $axis->_getMinimum();
- } else {
- return 0;
- }
- }
-
- /**
- * Return the maximum value of the specified axis
- *
- * @param int $axis The axis to return the maximum value of(see {$link
- * Image_Graph_Plotarea::getAxis()})
- * @return double The maximum value of the axis
- * @access private
- */
- function _getMaximum($axis = IMAGE_GRAPH_AXIS_Y)
- {
- $axis =& $this->getAxis($axis);
- if ($axis !== null) {
- return $axis->_getMaximum();
- } else {
- return 0;
- }
- }
-
- /**
- * Return the label distance for the specified axis.
- *
- * @param int $axis The axis to return the label distance for
- * @return int The distance between 2 adjacent labels
- * @access private
- */
- function _labelDistance($axis)
- {
- $axis =& $this->getAxis($axis);
- if ($axis !== null) {
- return $axis->_labelDistance();
- }
-
- return false;
- }
-
- /**
- * Hides the axis
- */
- function hideAxis($axis = false)
- {
- if (((!$axis) || ($axis === $this->_axisX) || ($axis === 'x')) && ($this->_axisX != null)) {
- $this->_axisX->hide();
- }
- if (((!$axis) || ($axis === $this->_axisY) || ($axis === 'y')) && ($this->_axisY != null)) {
- $this->_axisY->hide();
- }
- if (((!$axis) || ($axis === $this->_axisYSecondary) || ($axis === 'y_sec')) && ($this->_axisYSecondary != null)) {
- $this->_axisYSecondary->hide();
- }
- }
-
- /**
- * Clears/removes the axis
- */
- function clearAxis()
- {
- $this->_axisX = $this->_axisY = $this->_axisYSecondary = null;
- }
-
- /**
- * Get axis.
- *
- * Possible values are IMAGE_GRAPH_AXIS_X, IMAGE_GRAPH_AXIS_Y,
- * IMAGE_GRAPH_AXIS_Y_SECONDARY or a short hand notation using
- * string identifiers: 'x', 'y', 'ysec'
- *
- * @param int $axis The axis to return
- * @return Image_Graph_Axis The axis
- */
- function &getAxis($axis = IMAGE_GRAPH_AXIS_X)
- {
- switch ($axis) {
- case IMAGE_GRAPH_AXIS_X:
- case 'x':
- return $this->_axisX;
-
- case IMAGE_GRAPH_AXIS_Y:
- case 'y':
- return $this->_axisY;
-
- case IMAGE_GRAPH_AXIS_Y_SECONDARY:
- case 'ysec':
- return $this->_axisYSecondary;
-
- }
- return null;
- }
-
- /**
- * Update coordinates
- *
- * @access private
- */
- function _updateCoords()
- {
- if (is_array($this->_elements)) {
- $keys = array_keys($this->_elements);
- foreach ($keys as $key) {
- $element =& $this->_elements[$key];
- if (is_a($element, 'Image_Graph_Plot')) {
- if (((is_a($element, 'Image_Graph_Plot_Bar')) ||
- (is_a($element, 'Image_Graph_Plot_Step')) ||
- (is_a($element, 'Image_Graph_Plot_Dot')) ||
- (is_a($element, 'Image_Graph_Plot_CandleStick')) ||
- (is_a($element, 'Image_Graph_Plot_BoxWhisker')) ||
- (is_a($element, 'Image_Graph_Plot_Impulse'))) &&
- ($this->_axisX != null) &&
- (strtolower(get_class($this->_axisX)) != 'image_graph_axis') // do not push plot if x-axis is linear
- )
- {
- $this->_axisX->_pushValues();
- }
- $this->_setExtrema($element);
- }
- }
- unset($keys);
- }
-
- $this->_calcEdges();
-
- $pctWidth = (int) ($this->width() * 0.05);
- $pctHeight = (int) ($this->height() * 0.05);
-
- $left = $this->_left + $this->_padding['left'];
- $top = $this->_top + $this->_padding['top'];
- $right = $this->_right - $this->_padding['right'];
- $bottom = $this->_bottom - $this->_padding['bottom'];
-
- // temporary place holder for axis point calculations
- $axisPoints['x'] = array($left, $top, $right, $bottom);
- $axisPoints['y'] = $axisPoints['x'];
- $axisPoints['y2'] = $axisPoints['x'];
-
- if ($this->_axisX !== null) {
- $intersectX = $this->_axisX->_getAxisIntersection();
- $sizeX = $this->_axisX->_size();
- $this->_axisX->_setCoords($left, $top, $right, $bottom);
- $this->_axisX->_updateCoords();
- }
-
- if ($this->_axisY !== null) {
- $intersectY = $this->_axisY->_getAxisIntersection();
- $sizeY = $this->_axisY->_size();
- $this->_axisY->_setCoords($left, $top, $right, $bottom);
- $this->_axisY->_updateCoords();
- }
-
- if ($this->_axisYSecondary !== null) {
- $intersectYsec = $this->_axisYSecondary->_getAxisIntersection();
- $sizeYsec = $this->_axisYSecondary->_size();
- $this->_axisYSecondary->_setCoords($left, $top, $right, $bottom);
- $this->_axisYSecondary->_updateCoords();
- }
-
- $axisCoordAdd = array('left' => 0, 'right' => 0, 'top' => 0, 'bottom' => 0);
-
- if ($this->_axisY != null) {
- if ($this->_axisX != null) {
- $pos = $this->_axisX->_intersectPoint($intersectY['value']);
- } else {
- $pos = ($this->_horizontal ? $bottom : $left);
- }
-
- if ($this->_horizontal) {
- if (($pos + $sizeY) > $bottom) {
- $axisCoordAdd['bottom'] = ($pos + $sizeY) - $bottom;
- // the y-axis position needs to be recalculated!
- } else {
- // top & bottom may need to be adjusted when the x-axis has been
- // calculated!
- $this->_axisY->_setCoords(
- $left,
- $pos,
- $right,
- $pos + $sizeY
- );
- $this->_axisY->_updateCoords();
- }
- }
- else {
- if (($pos - $sizeY) < $left) {
- $axisCoordAdd['left'] = $left - ($pos - $sizeY);
- // the y-axis position needs to be recalculated!
- } else {
- // top & bottom may need to be adjusted when the x-axis has been
- // calculated!
- $this->_axisY->_setCoords(
- $pos - $sizeY,
- $top,
- $pos,
- $bottom
- );
- $this->_axisY->_updateCoords();
- }
- }
- }
-
- if ($this->_axisYSecondary != null) {
- if ($this->_axisX != null) {
- $pos = $this->_axisX->_intersectPoint($intersectYsec['value']);
- } else {
- $pos = ($this->_horizontal ? $top : $right);
- }
-
- if ($this->_horizontal) {
- if (($pos - $sizeYsec) < $top) {
- $axisCoordAdd['top'] = $top - ($pos - $sizeYsec);
- // the secondary y-axis position need to be recalculated
- } else {
- // top & bottom may need to be adjusted when the x-axis has been
- // calculated!
- $this->_axisYSecondary->_setCoords(
- $left,
- $pos - $sizeY,
- $right,
- $pos
- );
- $this->_axisYSecondary->_updateCoords();
- }
- }
- else {
- if (($pos + $sizeYsec) > $right) {
- $axisCoordAdd['right'] = ($pos + $sizeYsec) - $right;
- // the secondary y-axis position need to be recalculated
- } else {
- // top & bottom may need to be adjusted when the x-axis has been
- // calculated!
- $this->_axisYSecondary->_setCoords(
- $pos,
- $top,
- $pos + $sizeY,
- $bottom
- );
- $this->_axisYSecondary->_updateCoords();
- }
- }
- }
-
- if ($this->_axisX != null) {
- if (($intersectX['axis'] == IMAGE_GRAPH_AXIS_Y_SECONDARY) &&
- ($this->_axisYSecondary !== null)
- ) {
- $axis =& $this->_axisYSecondary;
- } elseif ($this->_axisY !== null) {
- $axis =& $this->_axisY;
- } else {
- $axis = false;
- }
-
- if ($axis !== false) {
- $pos = $axis->_intersectPoint($intersectX['value']);
- } else {
- $pos = ($this->_horizontal ? $left : $bottom);
- }
-
- if ($this->_horizontal) {
- if (($pos - $sizeX) < $left) {
- $axisCoordAdd['left'] = $left - ($pos - $sizeX);
- $pos = $left + $sizeX;
- }
-
- $this->_axisX->_setCoords(
- $pos - $sizeX,
- $top + $axisCoordAdd['top'],
- $pos,
- $bottom - $axisCoordAdd['bottom']
- );
- $this->_axisX->_updateCoords();
- }
- else {
- if (($pos + $sizeX) > $bottom) {
- $axisCoordAdd['bottom'] = ($pos + $sizeX) - $bottom;
- $pos = $bottom - $sizeX;
- }
-
- $this->_axisX->_setCoords(
- $left + $axisCoordAdd['left'],
- $pos,
- $right - $axisCoordAdd['right'],
- $pos + $sizeX
- );
- $this->_axisX->_updateCoords();
- }
- }
-
- if ($this->_horizontal) {
- if (($this->_axisX !== null) &&
- (($axisCoordAdd['top'] != 0) ||
- ($axisCoordAdd['bottom'] != 0))
- ) {
- // readjust y-axis for better estimate of position
- if ($this->_axisY !== null) {
- $pos = $this->_axisX->_intersectPoint($intersectY['value']);
- $this->_axisY->_setCoords(
- false,
- $pos,
- false,
- $pos + $sizeY
- );
- $this->_axisY->_updateCoords();
- }
-
- if ($this->_axisYSecondary !== null) {
- $pos = $this->_axisX->_intersectPoint($intersectYsec['value']);
- $this->_axisYSecondary->_setCoords(
- false,
- $pos - $sizeYsec,
- false,
- $pos
- );
- $this->_axisYSecondary->_updateCoords();
- }
- }
-
- // adjust top and bottom of y-axis
- if ($this->_axisY !== null) {
- $this->_axisY->_setCoords(
- $left + $axisCoordAdd['left'],
- false,
- $right - $axisCoordAdd['right'],
- false
- );
- $this->_axisY->_updateCoords();
- }
-
- // adjust top and bottom of y-axis
- if ($this->_axisYSecondary !== null) {
- $this->_axisYSecondary->_setCoords(
- $left + $axisCoordAdd['left'],
- false,
- $right - $axisCoordAdd['right'],
- false
- );
- $this->_axisYSecondary->_updateCoords();
- }
-
- if ($this->_axisX !== null) {
- $this->_plotTop = $this->_axisX->_top;
- $this->_plotBottom = $this->_axisX->_bottom;
- } else {
- $this->_plotTop = $top;
- $this->_plotBottom = $bottom;
- }
-
- if ($this->_axisY !== null) {
- $this->_plotLeft = $this->_axisY->_left;
- $this->_plotRight = $this->_axisY->_right;
- } elseif ($this->_axisYSecondary !== null) {
- $this->_plotLeft = $this->_axisYSecondary->_left;
- $this->_plotRight = $this->_axisYSecondary->_right;
- } else {
- $this->_plotLeft = $this->_left;
- $this->_plotRight = $this->_right;
- }
- }
- else {
- if (($this->_axisX !== null) &&
- (($axisCoordAdd['left'] != 0) ||
- ($axisCoordAdd['right'] != 0))
- ) {
- // readjust y-axis for better estimate of position
- if ($this->_axisY !== null) {
- $pos = $this->_axisX->_intersectPoint($intersectY['value']);
- $this->_axisY->_setCoords(
- $pos - $sizeY,
- false,
- $pos,
- false
- );
- $this->_axisY->_updateCoords();
- }
-
- if ($this->_axisYSecondary !== null) {
- $pos = $this->_axisX->_intersectPoint($intersectYsec['value']);
- $this->_axisYSecondary->_setCoords(
- $pos,
- false,
- $pos + $sizeYsec,
- false
- );
- $this->_axisYSecondary->_updateCoords();
- }
- }
-
- // adjust top and bottom of y-axis
- if ($this->_axisY !== null) {
- $this->_axisY->_setCoords(
- false,
- $top + $axisCoordAdd['top'],
- false,
- $bottom - $axisCoordAdd['bottom']
- );
- $this->_axisY->_updateCoords();
- }
-
- // adjust top and bottom of y-axis
- if ($this->_axisYSecondary !== null) {
- $this->_axisYSecondary->_setCoords(
- false,
- $top + $axisCoordAdd['top'],
- false,
- $bottom - $axisCoordAdd['bottom']
- );
- $this->_axisYSecondary->_updateCoords();
- }
-
- if ($this->_axisX !== null) {
- $this->_plotLeft = $this->_axisX->_left;
- $this->_plotRight = $this->_axisX->_right;
- } else {
- $this->_plotLeft = $left;
- $this->_plotRight = $right;
- }
-
- if ($this->_axisY !== null) {
- $this->_plotTop = $this->_axisY->_top;
- $this->_plotBottom = $this->_axisY->_bottom;
- } elseif ($this->_axisYSecondary !== null) {
- $this->_plotTop = $this->_axisYSecondary->_top;
- $this->_plotBottom = $this->_axisYSecondary->_bottom;
- } else {
- $this->_plotTop = $this->_top;
- $this->_plotBottom = $this->_bottom;
- }
- }
-
- Image_Graph_Element::_updateCoords();
-/*
- if ($this->_axisX != null) {
- $this->_axisX->_updateCoords();
- }
- if ($this->_axisY != null) {
- $this->_axisY->_updateCoords();
- }
- if ($this->_axisYSecondary != null) {
- $this->_axisYSecondary->_updateCoords();
- }*/
- }
-
- /**
- * Set the axis padding for a specified position.
- *
- * The axis padding is padding "inside" the plotarea (i.e. to put some space
- * between the axis line and the actual plot).
- *
- * This can be specified in a number of ways:
- *
- * 1) Specify an associated array with 'left', 'top', 'right' and 'bottom'
- * indices with values for the paddings. Leave out 2nd parameter.
- *
- * 2) Specify an overall padding as the first parameter
- *
- * 3) Specify the padding and position with position values as mentioned
- * above
- *
- * Normally you'd only consider applying axis padding to a category x-axis.
- *
- * @param mixed $value The value/padding
- * @param mixed $position The "position" of the padding
- */
- function setAxisPadding($value, $position = false)
- {
- if ($position === false) {
- if (is_array($value)) {
- if ($this->_horizontal) {
- if ((isset($value['top'])) && ($this->_axisX !== null)) {
- $this->_axisX->_setAxisPadding('low', $value['top']);
- }
- if ((isset($value['bottom'])) && ($this->_axisX !== null)) {
- $this->_axisX->_setAxisPadding('high', $value['bottom']);
- }
- if ((isset($value['left'])) && ($this->_axisY !== null)) {
- $this->_axisY->_setAxisPadding('low', $value['left']);
- }
- if ((isset($value['right'])) && ($this->_axisY !== null)) {
- $this->_axisY->_setAxisPadding('high', $value['right']);
- }
- if ((isset($value['left'])) && ($this->_axisYSecondary !== null)) {
- $this->_axisYSecondary->_setAxisPadding('low', $value['left']);
- }
- if ((isset($value['right'])) && ($this->_axisYSecondary !== null)) {
- $this->_axisYSecondary->_setAxisPadding('high', $value['right']);
- }
- }
- else {
- if ((isset($value['left'])) && ($this->_axisX !== null)) {
- $this->_axisX->_setAxisPadding('low', $value['left']);
- }
- if ((isset($value['right'])) && ($this->_axisX !== null)) {
- $this->_axisX->_setAxisPadding('high', $value['right']);
- }
- if ((isset($value['bottom'])) && ($this->_axisY !== null)) {
- $this->_axisY->_setAxisPadding('low', $value['bottom']);
- }
- if ((isset($value['top'])) && ($this->_axisY !== null)) {
- $this->_axisY->_setAxisPadding('high', $value['top']);
- }
- if ((isset($value['bottom'])) && ($this->_axisYSecondary !== null)) {
- $this->_axisYSecondary->_setAxisPadding('low', $value['bottom']);
- }
- if ((isset($value['top'])) && ($this->_axisYSecondary !== null)) {
- $this->_axisYSecondary->_setAxisPadding('high', $value['top']);
- }
- }
- } else {
- if ($this->_axisX !== null) {
- $this->_axisX->_setAxisPadding('low', $value);
- $this->_axisX->_setAxisPadding('high', $value);
- }
- if ($this->_axisY !== null) {
- $this->_axisY->_setAxisPadding('low', $value);
- $this->_axisY->_setAxisPadding('high', $value);
- }
- if ($this->_axisYSecondary !== null) {
- $this->_axisYSecondary->_setAxisPadding('low', $value);
- $this->_axisYSecondary->_setAxisPadding('high', $value);
- }
- }
- } else {
- switch ($position) {
- case 'left':
- if ($this->_horizontal) {
- if ($this->_axisY !== null) {
- $this->_axisY->_setAxisPadding('low', $value);
- }
- if ($this->_axisYSecondary !== null) {
- $this->_axisYSecondary->_setAxisPadding('low', $value);
- }
- }
- else if ($this->_axisX !== null) {
- $this->_axisX->_setAxisPadding('low', $value);
- }
- break;
-
- case 'right':
- if ($this->_horizontal) {
- if ($this->_axisY !== null) {
- $this->_axisY->_setAxisPadding('high', $value);
- }
- if ($this->_axisYSecondary !== null) {
- $this->_axisYSecondary->_setAxisPadding('high', $value);
- }
- }
- else if ($this->_axisX !== null) {
- $this->_axisX->_setAxisPadding('high', $value);
- }
- break;
-
- case 'top':
- if (!$this->_horizontal) {
- if ($this->_axisY !== null) {
- $this->_axisY->_setAxisPadding('high', $value);
- }
- if ($this->_axisYSecondary !== null) {
- $this->_axisYSecondary->_setAxisPadding('high', $value);
- }
- }
- else if ($this->_axisX !== null) {
- $this->_axisX->_setAxisPadding('high', $value);
- }
- break;
-
- case 'bottom':
- if (!$this->_horizontal) {
- if ($this->_axisY !== null) {
- $this->_axisY->_setAxisPadding('low', $value);
- }
- if ($this->_axisYSecondary !== null) {
- $this->_axisYSecondary->_setAxisPadding('low', $value);
- }
- }
- else if ($this->_axisX !== null) {
- $this->_axisX->_setAxisPadding('low', $value);
- }
- break;
- }
- }
- }
-
- /**
- * Output the plotarea to the canvas
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if ($this->_hasData) {
- $this->_canvas->startGroup(get_class($this));
-
- if ($this->_axisX != null) {
- $this->add($this->_axisX);
- }
- if ($this->_axisY != null) {
- $this->add($this->_axisY);
- }
- if ($this->_axisYSecondary != null) {
- $this->add($this->_axisYSecondary);
- }
-
- $this->_getFillStyle();
- $this->_canvas->rectangle(
- array(
- 'x0' => $this->_plotLeft,
- 'y0' => $this->_plotTop,
- 'x1' => $this->_plotRight,
- 'y1' => $this->_plotBottom
- )
- );
- $result = parent::_done();
- $this->_canvas->endGroup();
- return $result;
- } else {
- // no data -> do nothing at all!
- return true;
- }
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plotarea/Element.php b/config/archive/dspam/pear/Image/Graph/Plotarea/Element.php
deleted file mode 100644
index a7d1b8d2..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plotarea/Element.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Element.php
- */
-require_once 'Image/Graph/Element.php';
-
-/**
- * Representation of a element on a plotarea.
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- * @abstract
- */
-class Image_Graph_Plotarea_Element extends Image_Graph_Element
-{
-
- /**
- * Get the X pixel position represented by a value
- *
- * @param double $point the value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _pointX($point)
- {
- return $this->_parent->_pointX($point);
- }
-
- /**
- * Get the Y pixel position represented by a value
- *
- * @param double $point the value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _pointY($point)
- {
- return $this->_parent->_pointY($point);
- }
-
- /**
- * Get the X and Y pixel position represented by a value
- *
- * @param array $point the values to get the pixel-point for
- * @return array The (x, y) pixel position along the axis
- * @access private
- */
- function _pointXY($point)
- {
- return array ('X' => $this->_pointX($point), 'Y' => $this->_pointY($point));
- }
-
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plotarea/Map.php b/config/archive/dspam/pear/Image/Graph/Plotarea/Map.php
deleted file mode 100644
index 888d3384..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plotarea/Map.php
+++ /dev/null
@@ -1,304 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plotarea
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plotarea.php
- */
-require_once 'Image/Graph/Plotarea.php';
-
-/**
- * Plot area used for map plots.
- *
- * A map plot is a chart that displays a map (fx. a world map) in the form of .
- * png file. The maps must be located in the /Images/Maps folder and a
- * corresponding .txt files mush also exist in this location where named
- * locations are mapped to an (x, y) coordinate of the map picture (this text
- * file is tab separated with 'Name' 'X' 'Y' values, fx 'Denmark 378 223'). The
- * x-values in the dataset are then the named locations (fx 'Denmark') and the
- * y-values are then the data to plot. Currently the best (if not only) use is
- * to combine a map plot area with a {@link Image_Graph_Plot_Dot} using {@link
- * Image_Graph_Marker_PercentageCircle} as marker.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plotarea
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plotarea_Map extends Image_Graph_Plotarea
-{
-
- /**
- * The GD image for the map
- * @var string
- * @access private
- */
- var $_imageMap;
-
- /**
- * The value for scaling the width and height to fit into the layout boundaries
- * @var int
- * @access private
- */
- var $_scale;
-
- /**
- * The (x,y)-points for the named point
- * @var array
- * @access private
- */
- var $_mapPoints;
-
- /**
- * The original size of the image map
- * @var array
- * @access private
- */
- var $_mapSize;
-
- /**
- * PlotareaMap [Constructor]
- *
- * @param string $map The name of the map, i.e. the [name].png and [name].
- * txt files located in the Images/maps folder
- */
- function Image_Graph_Plotarea_Map($map)
- {
- parent::Image_Graph_Plotarea();
-
- $this->_imageMap = dirname(__FILE__)."/../Images/Maps/$map.png";
- $points = file(dirname(__FILE__)."/../Images/Maps/$map.txt");
- list($width, $height) = getimagesize($this->_imageMap);
- $this->_mapSize['X'] = $width;
- $this->_mapSize['Y'] = $height;
-
- if (is_array($points)) {
- unset($this->_mapPoints);
- foreach ($points as $line) {
- list($country, $x, $y) = explode("\t", $line);
- $this->_mapPoints[$country] = array('X' => $x, 'Y' => $y);
- }
- }
- }
-
- /**
- * Left boundary of the background fill area
- *
- * @return int Leftmost position on the canvas
- * @access private
- */
- function _fillLeft()
- {
- return $this->_left + $this->_padding['left'];
- }
-
- /**
- * Top boundary of the background fill area
- *
- * @return int Topmost position on the canvas
- * @access private
- */
- function _fillTop()
- {
- return $this->_top + $this->_padding['top'];
- }
-
- /**
- * Right boundary of the background fill area
- *
- * @return int Rightmost position on the canvas
- * @access private
- */
- function _fillRight()
- {
- return $this->_right - $this->_padding['right'];
- }
-
- /**
- * Bottom boundary of the background fill area
- *
- * @return int Bottommost position on the canvas
- * @access private
- */
- function _fillBottom()
- {
- return $this->_bottom - $this->_padding['bottom'];
- }
-
- /**
- * Set the extrema of the axis
- *
- * @param Image_Graph_Plot $plot The plot that 'hold' the values
- * @access private
- */
- function _setExtrema(& $plot)
- {
- }
-
- /**
- * Get the X pixel position represented by a value
- *
- * @param double $value The value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _pointX($value)
- {
- $country = $value['X'];
- return $this->_plotLeft+$this->_mapPoints[$country]['X']*$this->_scale;
- }
-
- /**
- * Get the Y pixel position represented by a value
- *
- * @param double $value The value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _pointY($value)
- {
- $country = $value['X'];
- return $this->_plotTop+$this->_mapPoints[$country]['Y']*$this->_scale;
- }
-
- /**
- * Hides the axis
- */
- function hideAxis()
- {
- }
-
- /**
- * Add a point to the maps
- *
- * @param int $latitude The latitude of the point
- * @param int $longiude The longitude of the point
- * @param string $name The name of the plot
- */
- function addMappoint($latitude, $longitude, $name)
- {
- $x = (($longitude + 180) * ($this->_mapSize['X'] / 360));
- $y = ((($latitude * -1) + 90) * ($this->_mapSize['Y'] / 180));
- $this->_mapPoints[$name] = array('X' => $x, 'Y' => $y);
- }
-
- /**
- * Add a point to the maps
- *
- * @param int $x The latitude of the point
- * @param int $y The longitude of the point
- * @param string $name The name of the plot
- */
- function addPoint($x, $y, $name)
- {
- $this->_mapPoints[$name] = array('X' => $x, 'Y' => $y);
- }
-
- /**
- * Update coordinates
- *
- * @access private
- */
- function _updateCoords()
- {
- parent::_updateCoords();
-
- $mapAspectRatio = $this->_mapSize['X']/$this->_mapSize['Y'];
- $plotAspectRatio = ($width = $this->_fillWidth())/($height = $this->_fillHeight());
-
- $scaleFactorX = ($mapAspectRatio > $plotAspectRatio);
-
- if ((($this->_mapSize['X'] <= $width) && ($this->_mapSize['Y'] <= $height)) ||
- (($this->_mapSize['X'] >= $width) && ($this->_mapSize['Y'] >= $height)))
- {
- if ($scaleFactorX) {
- $this->_scale = $width / $this->_mapSize['X'];
- } else {
- $this->_scale = $height / $this->_mapSize['Y'];
- }
- } elseif ($this->_mapSize['X'] < $width) {
- $this->_scale = $height / $this->_mapSize['Y'];
- } elseif ($this->_mapSize['Y'] < $height) {
- $this->_scale = $width / $this->_mapSize['X'];
- }
-
- $this->_plotLeft = ($this->_fillLeft() + $this->_fillRight() -
- $this->_mapSize['X']*$this->_scale)/2;
-
- $this->_plotTop = ($this->_fillTop() + $this->_fillBottom() -
- $this->_mapSize['Y']*$this->_scale)/2;
-
- $this->_plotRight = ($this->_fillLeft() + $this->_fillRight() +
- $this->_mapSize['X']*$this->_scale)/2;
-
- $this->_plotBottom = ($this->_fillTop() + $this->_fillBottom() +
- $this->_mapSize['Y']*$this->_scale)/2;
- }
-
- /**
- * Output the plotarea to the canvas
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- $this->_getFillStyle();
- $this->_canvas->rectangle(
- array(
- 'x0' => $this->_fillLeft(),
- 'y0' => $this->_fillTop(),
- 'x1' => $this->_fillRight(),
- 'y1' => $this->_fillBottom()
- )
- );
-
- $scaledWidth = $this->_mapSize['X']*$this->_scale;
- $scaledHeight = $this->_mapSize['Y']*$this->_scale;
-
- $this->_canvas->image(
- array(
- 'x' => $this->_plotLeft,
- 'y' => $this->_plotTop,
- 'filename' => $this->_imageMap,
- 'width' => $scaledWidth,
- 'height' => $scaledHeight
- )
- );
-
- return Image_Graph_Layout::_done();
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Plotarea/Radar.php b/config/archive/dspam/pear/Image/Graph/Plotarea/Radar.php
deleted file mode 100644
index cfb200ea..00000000
--- a/config/archive/dspam/pear/Image/Graph/Plotarea/Radar.php
+++ /dev/null
@@ -1,243 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - PEAR PHP OO Graph Rendering Utility.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plotarea
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Plotarea.php
- */
-require_once 'Image/Graph/Plotarea.php';
-
-/**
- * Plot area used for radar plots.
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Plotarea
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Plotarea_Radar extends Image_Graph_Plotarea
-{
-
- /**
- * Create the plotarea, implicitely creates 2 normal axis
- */
- function Image_Graph_Plotarea_Radar()
- {
- parent::Image_Graph_Element();
- $this->_padding = array('left' => 10, 'top' => 10, 'right' => 10, 'bottom' => 10);
- $this->_axisX =& Image_Graph::factory('Image_Graph_Axis_Radar');
- $this->_axisX->_setParent($this);
- $this->_axisY =& Image_Graph::factory('Image_Graph_Axis', IMAGE_GRAPH_AXIS_Y);
- $this->_axisY->_setParent($this);
- $this->_axisY->_setMinimum(0);
- }
-
- /**
- * Get the width of the 'real' plotarea
- *
- * @return int The width of the 'real' plotarea, ie not including space occupied by padding and axis
- * @access private
- */
- function _plotWidth()
- {
- return (min($this->height(), $this->width())) * 0.80;
- }
-
- /**
- * Get the height of the 'real' plotarea
- *
- * @return int The height of the 'real' plotarea, ie not including space occupied by padding and axis
- * @access private
- */
- function _plotHeight()
- {
- return (min($this->height(), $this->width())) * 0.80;
- }
-
- /**
- * Left boundary of the background fill area
- *
- * @return int Leftmost position on the canvas
- * @access private
- */
- function _fillLeft()
- {
- return (int) (($this->_left + $this->_right - $this->_plotWidth()) / 2);
- }
-
- /**
- * Top boundary of the background fill area
- *
- * @return int Topmost position on the canvas
- * @access private
- */
- function _fillTop()
- {
- return (int) (($this->_top + $this->_bottom - $this->_plotHeight()) / 2);
- }
-
- /**
- * Right boundary of the background fill area
- *
- * @return int Rightmost position on the canvas
- * @access private
- */
- function _fillRight()
- {
- return (int) (($this->_left + $this->_right + $this->_plotWidth()) / 2);
- }
-
- /**
- * Bottom boundary of the background fill area
- *
- * @return int Bottommost position on the canvas
- * @access private
- */
- function _fillBottom()
- {
- return (int) (($this->_top + $this->_bottom + $this->_plotHeight()) / 2);
- }
-
- /**
- * Get the X pixel position represented by a value
- *
- * @param double $value The value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _pointX($value)
- {
- if (is_array($value)) {
- if ($value['Y'] == '#min#') {
- $radius = 0;
- } elseif (($value['Y'] == '#max#') || ($value['Y'] === false)) {
- $radius = 1;
- } else {
- $radius = ($value['Y'] - $this->_axisY->_getMinimum()) /
- ($this->_axisY->_getMaximum() - $this->_axisY->_getMinimum());
- }
- $x = ($this->_left + $this->_right) / 2 -
- $radius * ($this->_plotWidth() / 2) *
- cos(deg2rad($this->_axisX->_point($value['X'])));
- }
- return max($this->_plotLeft, min($this->_plotRight, $x));
- }
-
- /**
- * Get the Y pixel position represented by a value
- *
- * @param double $value The value to get the pixel-point for
- * @return double The pixel position along the axis
- * @access private
- */
- function _pointY($value)
- {
- if (is_array($value)) {
- if ($value['Y'] == '#min#') {
- $radius = 0;
- } elseif (($value['Y'] == '#max#') || ($value['Y'] === false)) {
- $radius = 1;
- } else {
- $radius = ($value['Y'] - $this->_axisY->_getMinimum()) /
- ($this->_axisY->_getMaximum() - $this->_axisY->_getMinimum());
- }
-
- $y = ($this->_top + $this->_bottom) / 2 -
- $radius * ($this->_plotHeight() / 2) *
- sin(deg2rad($this->_axisX->_point($value['X'])));
- }
- return max($this->_plotTop, min($this->_plotBottom, $y));
- }
-
- /**
- * Update coordinates
- *
- * @access private
- */
- function _updateCoords()
- {
- if (is_array($this->_elements)) {
- $keys = array_keys($this->_elements);
- foreach ($keys as $key) {
- $element =& $this->_elements[$key];
- if (is_a($element, 'Image_Graph_Plot')) {
- $this->_setExtrema($element);
- }
- }
- unset($keys);
- }
-
- $this->_calcEdges();
-
- $centerX = (int) (($this->_left + $this->_right) / 2);
- $centerY = (int) (($this->_top + $this->_bottom) / 2);
- $radius = min($this->_plotHeight(), $this->_plotWidth()) / 2;
-
- if (is_object($this->_axisX)) {
- $this->_axisX->_setCoords(
- $centerX - $radius,
- $centerY - $radius,
- $centerX + $radius,
- $centerY + $radius
- );
- }
-
- if (is_object($this->_axisY)) {
- $this->_axisY->_setCoords(
- $centerX,
- $centerY,
- $centerX - $radius,
- $centerY - $radius
- );
- }
-
- $this->_plotLeft = $this->_fillLeft();
- $this->_plotTop = $this->_fillTop();
- $this->_plotRight = $this->_fillRight();
- $this->_plotBottom = $this->_fillBottom();
-
- Image_Graph_Element::_updateCoords();
-
- if (is_object($this->_axisX)) {
- $this->_axisX->_updateCoords();
- }
-
- if (is_object($this->_axisY)) {
- $this->_axisY->_updateCoords();
- }
-
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Simple.php b/config/archive/dspam/pear/Image/Graph/Simple.php
deleted file mode 100644
index 9d14c4da..00000000
--- a/config/archive/dspam/pear/Image/Graph/Simple.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - Main class for the graph creation.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph.php
- */
-require_once 'Image/Graph.php';
-
-/**
- * Class for simple creation of graphs
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Simple extends Image_Graph
-{
-
- /**
- * Image_Graph_Simple [Constructor]
- *
- * @param int $width The width of the graph in pixels
- * @param int $height The height of the graph in pixels
- */
- function Image_Graph_Simple($width, $height, $plotType, $data, $title, $lineColor = 'black', $fillColor = 'white', $font = false)
- {
- parent::Image_Graph($width, $height);
-
- $plotarea =& Image_Graph::factory('plotarea');
-
- $dataset =& Image_Graph::factory('dataset', array($data));
-
- if ($font === false) {
- $font =& Image_Graph::factory('Image_Graph_Font');
- } elseif (is_string($font)) {
- $font =& Image_Graph::factory('ttf_font', $font);
- $font->setSize(8);
- }
-
- $this->setFont($font);
-
- $this->add(
- Image_Graph::vertical(
- Image_Graph::factory('title',
- array(
- $title,
- array('size_rel' => 2)
- )
- ),
- $plotarea,
- 10
- )
- );
-
- $plotarea->addNew('line_grid', array(), IMAGE_GRAPH_AXIS_Y);
-
- $plot =& $plotarea->addNew($plotType, array(&$dataset));
- $plot->setLineColor($lineColor);
- $plot->setFillColor($fillColor);
-
- $axisX =& $plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
- $axisX->showLabel(
- IMAGE_GRAPH_LABEL_MINIMUM +
- IMAGE_GRAPH_LABEL_ZERO +
- IMAGE_GRAPH_LABEL_MAXIMUM
- );
-
- }
-
- /**
- * Factory method to create the Image_Simple_Graph object.
- */
- function &factory($width, $height, $plotType, $data, $title, $lineColor = 'black', $fillColor = 'white', $font = false)
- {
- $obj =& Image_Graph::factory('Image_Graph_Simple',
- array(
- $width,
- $height,
- $plotType,
- $data,
- $title,
- $lineColor,
- $fillColor,
- $font
- )
- );
- return $obj;
- }
-
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Title.php b/config/archive/dspam/pear/Image/Graph/Title.php
deleted file mode 100644
index 2cffe5f3..00000000
--- a/config/archive/dspam/pear/Image/Graph/Title.php
+++ /dev/null
@@ -1,194 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - Main class for the graph creation.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Text
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * Include file Image/Graph/Layout.php
- */
-require_once 'Image/Graph/Layout.php';
-
-/**
- * Title
- *
- * @category Images
- * @package Image_Graph
- * @subpackage Text
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Title extends Image_Graph_Layout
-{
-
- /**
- * The text to print
- * @var string
- * @access private
- */
- var $_text;
-
- /**
- * The font to use
- * @var Font
- * @access private
- */
- var $_font;
-
- /**
- * The alignment of the title
- * @var int
- * @access private
- */
- var $_alignment = IMAGE_GRAPH_ALIGN_CENTER_X;
-
- /**
- * Create the title.
- *
- * Pass a Image_Graph_Font object - preferably by-ref (&amp;) as second
- * parameter, the font size in pixels or an associated array with some or
- * all of the followin keys:
- *
- * 'size' The size of the title
- *
- * 'angle' The angle at which to write the title (in degrees or 'vertical')
- *
- * 'color' The font-face color
- *
- * @param sting $text The text to represent the title
- * @param mixed $fontOptions The font to use in the title
- */
- function Image_Graph_Title($text, $fontOptions = false)
- {
- parent::Image_Graph_Layout();
- if (is_object($fontOptions)) {
- $this->_font =& $fontOptions;
- } else {
- if (is_array($fontOptions)) {
- $this->_fontOptions = $fontOptions;
- } else {
- $this->_fontOptions['size'] = $fontOptions;
- }
- }
- $this->setText($text);
- }
-
- /**
- * Set the text
- *
- * @param string $text The text to display
- */
- function setText($text)
- {
- $this->_text = $text;
- }
-
- /**
- * Returns the calculated "auto" size
- *
- * @return int The calculated auto size
- * @access private
- */
- function _getAutoSize()
- {
- if ($this->_defaultFontOptions !== false) {
- $this->_canvas->setFont($this->_defaultFontOptions);
- } else {
- $this->_canvas->setFont($this->_getFont());
- }
-
- return $this->_canvas->textHeight($this->_text);
- }
-
- /**
- * Set the alignment of the legend
- *
- * @param int $alignment The alignment
- */
- function setAlignment($alignment)
- {
- $this->_alignment = $alignment & 0x7;
- }
-
- /**
- * Output the text
- *
- * @return bool Was the output 'good' (true) or 'bad' (false).
- * @access private
- */
- function _done()
- {
- if ($this->_defaultFontOptions !== false) {
- $this->_canvas->setFont($this->_defaultFontOptions);
- } else {
- $this->_canvas->setFont($this->_getFont());
- }
-
- if (is_a($this->_parent, 'Image_Graph_Plotarea')) {
- $this->_setCoords(
- $this->_parent->_left,
- $this->_parent->_top,
- $this->_parent->_right,
- $this->_parent->_top + $this->_canvas->textHeight($this->_text)
- );
- } elseif (!is_a($this->_parent, 'Image_Graph_Layout')) {
- $this->_setCoords(
- $this->_parent->_fillLeft(),
- $this->_parent->_fillTop(),
- $this->_parent->_fillRight(),
- $this->_parent->_fillTop() + $this->_canvas->textHeight($this->_text)
- );
- }
-
- if (parent::_done() === false) {
- return false;
- }
-
- if ($this->_alignment == IMAGE_GRAPH_ALIGN_CENTER_X) {
- $x = ($this->_left + $this->_right) / 2;
- } elseif ($this->_alignment == IMAGE_GRAPH_ALIGN_LEFT) {
- $x = $this->_left;
- } else {
- $x = $this->_right;
- }
- $y = ($this->_top + $this->_bottom) / 2;
-
- $this->write(
- $x,
- $y,
- $this->_text,
- $this->_alignment + IMAGE_GRAPH_ALIGN_CENTER_Y
- );
- return true;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pear/Image/Graph/Tool.php b/config/archive/dspam/pear/Image/Graph/Tool.php
deleted file mode 100644
index cf245685..00000000
--- a/config/archive/dspam/pear/Image/Graph/Tool.php
+++ /dev/null
@@ -1,291 +0,0 @@
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Image_Graph - Main class for the graph creation.
- *
- * PHP versions 4 and 5
- *
- * LICENSE: This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at your
- * option) any later version. This library is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details. You should have received a copy of
- * the GNU Lesser General Public License along with this library; if not, write
- * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version CVS: $Id$
- * @link http://pear.php.net/package/Image_Graph
- */
-
-/**
- * This class contains a set of tool-functions.
- *
- * These functions are all to be called statically
- *
- * @category Images
- * @package Image_Graph
- * @author Jesper Veggerby <pear.nosey@veggerby.dk>
- * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
- * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Image_Graph
- */
-class Image_Graph_Tool
-{
-
- /**
- * Return the average of 2 points
- *
- * @param double P1 1st point
- * @param double P2 2nd point
- * @return double The average of P1 and P2
- * @static
- */
- function mid($p1, $p2)
- {
- return ($p1 + $p2) / 2;
- }
-
- /**
- * Mirrors P1 in P2 by a amount of Factor
- *
- * @param double $p1 1st point, point to mirror
- * @param double $o2 2nd point, mirror point
- * @param double $factor Mirror factor, 0 returns $p2, 1 returns a pure
- * mirror, ie $p1 on the exact other side of $p2
- * @return double $p1 mirrored in $p2 by Factor
- * @static
- */
- function mirror($p1, $p2, $factor = 1)
- {
- return $p2 + $factor * ($p2 - $p1);
- }
-
- /**
- * Calculates a Bezier control point, this function must be called for BOTH
- * X and Y coordinates (will it work for 3D coordinates!?)
- *
- * @param double $p1 1st point
- * @param double $p2 Point to
- * @param double $factor Mirror factor, 0 returns P2, 1 returns a pure
- * mirror, i.e. P1 on the exact other side of P2
- * @return double P1 mirrored in P2 by Factor
- * @static
- */
- function controlPoint($p1, $p2, $factor, $smoothFactor = 0.75)
- {
- $sa = Image_Graph_Tool::mirror($p1, $p2, $smoothFactor);
- $sb = Image_Graph_Tool::mid($p2, $sa);
-
- $m = Image_Graph_Tool::mid($p2, $factor);
-
- $pC = Image_Graph_Tool::mid($sb, $m);
-
- return $pC;
- }
-
- /**
- * Calculates a Bezier point, this function must be called for BOTH X and Y
- * coordinates (will it work for 3D coordinates!?)
- *
- * @param double $t A position between $p2 and $p3, value between 0 and 1
- * @param double $p1 Point to use for calculating control points
- * @param double $p2 Point 1 to calculate bezier curve between
- * @param double $p3 Point 2 to calculate bezier curve between
- * @param double $p4 Point to use for calculating control points
- * @return double The bezier value of the point t between $p2 and $p3 using
- * $p1 and $p4 to calculate control points
- * @static
- */
- function bezier($t, $p1, $p2, $p3, $p4)
- {
- // (1-t)^3*p1 + 3*(1-t)^2*t*p2 + 3*(1-t)*t^2*p3 + t^3*p4
- return pow(1 - $t, 3) * $p1 +
- 3 * pow(1 - $t, 2) * $t * $p2 +
- 3 * (1 - $t) * pow($t, 2) * $p3 +
- pow($t, 3) * $p4;
- }
-
- /**
- * For a given point (x,y) return a point rotated by a given angle aroung the center (xy,yc)
- *
- * @param int $x x coordinate of the point to rotate
- * @param int $y y coordinate of the point to rotate
- * @param int $xc x coordinate of the center of the rotation
- * @param int $yc y coordinate of the center of the rotation
- * @param int $angle angle of the rotation
- * @return array the coordinate of the new point
- * @static
- */
- function rotate($x, $y, $xc, $yc, $angle)
- {
- $cos = cos(deg2rad($angle));
- $sin = sin(deg2rad($angle));
- $xr= $x - $xc;
- $yr= $y - $yc;
- $x1= $xc + $cos * $xr - $sin * $yr;
- $y1= $yc + $sin * $xr + $cos * $yr;
- return array((int) $x1,(int) $y1);
- }
-
- /**
- * If a number is close 0 zero (i.e. 0 within $decimal decimals) it is rounded down to zero
- *
- * @param double $value The value to round
- * @param int $decimal The number of decimals
- * @return double The value or zero if "close enough" to zero
- * @static
- */
- function close2zero($value, $decimal)
- {
- if (abs($value) < pow(10, -$decimal)) {
- return 0;
- }
- else {
- return $value;
- }
- }
-
- /**
- * Calculate the dimensions and center point (of gravity) for an arc
- *
- * @param int $v1 The angle at which the arc starts
- * @param int $v2 The angle at which the arc ends
- * @return array An array with the dimensions in a fraction of a circle width radius 1 'rx', 'ry' and the
- * center point of gravity ('cx', 'cy')
- * @static
- */
- function calculateArcDimensionAndCenter($v1, $v2)
- {
- // $v2 always larger than $v1
- $r1x = Image_Graph_Tool::close2zero(cos(deg2rad($v1)), 3);
- $r2x = Image_Graph_Tool::close2zero(cos(deg2rad($v2)), 3);
-
- $r1y = Image_Graph_Tool::close2zero(sin(deg2rad($v1)), 3);
- $r2y = Image_Graph_Tool::close2zero(sin(deg2rad($v2)), 3);
-
- // $rx = how many percent of the x-diameter of the entire ellipse does the arc x-diameter occupy: 1 entire width, 0 no width
- // $cx = at what percentage of the diameter does the center lie
-
- // if the arc passes through 0/360 degrees the "highest" of r1x and r2x is replaced by 1!
- if ((($v1 <= 0) && ($v2 >= 0)) || (($v1 <= 360) && ($v2 >= 360))) {
- $r1x = min($r1x, $r2x);
- $r2x = 1;
- }
-
- // if the arc passes through 180 degrees the "lowest" of r1x and r2x is replaced by -1!
- if ((($v1 <= 180) && ($v2 >= 180)) || (($v1 <= 540) && ($v2 >= 540))) {
- $r1x = max($r1x, $r2x);
- $r2x = -1;
- }
-
- if ($r1x >= 0) { // start between [270; 360] or [0; 90]
- if ($r2x >= 0) {
- $rx = max($r1x, $r2x) / 2;
- $cx = 0; // center lies 0 percent along this "vector"
- }
- else {
- $rx = abs($r1x - $r2x) / 2;
- $cx = abs($r2x / 2) / $rx;
- }
- }
- else { // start between ]90; 270[
- if ($r2x < 0) {
- $rx = max(abs($r1x), abs($r2x)) / 2;
- $cx = $rx;
- }
- else {
- $rx = abs($r1x - $r2x) / 2;
- $cx = abs($r1x / 2) / $rx;
- }
- }
-
- // $ry = how many percent of the y-diameter of the entire ellipse does the arc y-diameter occupy: 1 entire, 0 none
- // $cy = at what percentage of the y-diameter does the center lie
-
- // if the arc passes through 90 degrees the "lowest" of r1x and r2x is replaced by -1!
- if ((($v1 <= 90) && ($v2 >= 90)) || (($v1 <= 450) && ($v2 >= 450))) {
- $r1y = min($r1y, $r2y);
- $r2y = 1;
- }
-
- // if the arc passes through 270 degrees the "highest" of r1y and r2y is replaced by -1!
- if ((($v1 <= 270) && ($v2 >= 270)) || (($v1 <= 630) && ($v2 >= 630))) {
- $r1y = max($r1y, $r2y);
- $r2y = -1;
- }
-
- if ($r1y >= 0) { // start between [0; 180]
- if ($r2y >= 0) {
- $ry = max($r1y, $r2y) / 2;
- $cy = 0; // center lies 0 percent along this "vector"
- }
- else {
- $ry = abs($r1y - $r2y) / 2;
- $cy = abs($r2y / 2) / $ry;
- }
- }
- else { // start between ]180; 360[
- if ($r2y < 0) {
- $ry = max(abs($r1y), abs($r2y)) / 2;
- $cy = $ry;
- }
- else {
- $ry = abs($r1y - $r2y) / 2;
- $cy = abs($r1y / 2) / $ry;
- }
- }
-
- return array(
- 'rx' => $rx,
- 'cx' => $cx,
- 'ry' => $ry,
- 'cy' => $cy
- );
- }
-
- /**
- * Calculate linear regression on a dataset
- * @param array $data The data to calculate regression upon
- * @return array The slope and intersection of the "best-fit" line
- * @static
- */
- function calculateLinearRegression(&$data)
- {
- $sumX = 0;
- $sumY = 0;
- foreach ($data as $point) {
- $sumX += $point['X'];
- $sumY += $point['Y'];
- }
- $meanX = $sumX / count($data);
- $meanY = $sumY / count($data);
-
- $sumXX = 0;
- $sumYY = 0;
- $sumXY = 0;
- foreach ($data as $point) {
- $sumXX += ($point['X'] - $meanX) * ($point['X'] - $meanX);
- $sumYY += ($point['Y'] - $meanY) * ($point['Y'] - $meanY);
- $sumXY += ($point['X'] - $meanX) * ($point['Y'] - $meanY);
- }
-
- $result = array();
- $result['slope'] = ($sumXY / $sumXX);
- $result['intersection'] = $meanY - ($result['slope'] * $meanX);
- return $result;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pkg/000.mysql.sh b/config/archive/dspam/pkg/000.mysql.sh
deleted file mode 100644
index 9c25c370..00000000
--- a/config/archive/dspam/pkg/000.mysql.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/sh
-# This file was automatically generated
-# by the pfSense service handler
-
-rc_start() {
-test_mysql_user=`cat /etc/passwd | grep mysql`
-test_mysql_group=`cat /etc/group | grep mysql`
-mysql_user="mysql"
-mysql_limits_args="-e -U ${mysql_user}"
-pidfile="/var/db/mysql/`/bin/hostname`.pid"
-command="/usr/local/bin/mysqld_safe"
-command_args="--user=${mysql_user} --datadir=/var/db/mysql --pid-file=${pidfile} --bind-address=127.0.0.1 --set-variable=max_connections=500"
-procname="/usr/local/libexec/mysqld"
-mysql_install_db="/usr/local/bin/mysql_install_db"
-mysql_install_db_args="--ldata=/var/db/mysql"
-
-/sbin/mount_fdescfs fdescfs /dev/fd
-
-if [ -z "${test_mysql_group}" ]; then
- pw groupadd mysql -g 88
-fi
-
-if [ -z "${test_mysql_user}" ]; then
- pw useradd mysql -u 88 -g 88 -d /nonexistent -s /sbin/nologin -c 'MySQL Daemon'
-fi
-
-if [ ! -d "/var/db/mysql" ]; then
- mkdir /var/db/mysql && chown mysql:mysql /var/db/mysql
-fi
-
-if [ ! -d "/var/db/mysql/mysql/." ]; then
- eval $mysql_install_db $mysql_install_db_args >/dev/null
- [ $? -eq 0 ] && chown -R ${mysql_user}:${mysql_user} /var/db/mysql
-fi
-
-#if checkyesno mysql_limits; then
-# eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null
-#else
-# return 0
-#fi
-
-${command} ${command_args} > /dev/null &
-}
-
-rc_stop() {
-/usr/bin/killall mysqld
-sleep 2
-}
-
-rc_restart() {
- rc_stop
- rc_start
-}
-
-case $1 in
- start)
- rc_start
- ;;
- stop)
- rc_stop
- ;;
- restart)
- rc_restart
- ;;
- *)
- echo "Usage: $0 <start|stop|restart>"
- ;;
-esac
diff --git a/config/archive/dspam/pkg/010.clamav-clamd.sh b/config/archive/dspam/pkg/010.clamav-clamd.sh
deleted file mode 100644
index aeb23b04..00000000
--- a/config/archive/dspam/pkg/010.clamav-clamd.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-# This file was automatically generated
-# by the pfSense service handler
-
-rc_start() {
-test_clamav_group=`cat /etc/group | grep clam`
-test_clamav_user=`cat /etc/passwd | grep clam`
-
-if [ -z "${test_clamav_group}" ]; then
- pw groupadd clamav -g 106
-fi
-
-if [ -z "${test_clamav_user}" ]; then
- pw useradd clamav -u 106 -g 106 -d /nonexistent -s /sbin/nologin -c 'Clam Antivirus'
-fi
-
-if [ ! -d "/usr/local/share/clamav" ]; then
- mkdir /usr/local/share/clamav && chown clamav:clamav /usr/local/share/clamav
-fi
-
-if [ ! -d "/var/log/clamav" ]; then
- mkdir /var/log/clamav && chown clamav:clamav /var/log/clamav
-fi
-
-if [ ! -d "/var/run/clamav" ]; then
- mkdir /var/run/clamav && chown clamav:clamav /var/run/clamav
-fi
-
- /sbin/mount_fdescfs fdescfs /dev/fd
- /usr/local/sbin/clamd
-}
-
-rc_stop() {
- /usr/bin/killall clamd
- sleep 2
-}
-
-rc_restart() {
- rc_stop
- rc_start
-}
-
-case $1 in
- start)
- rc_start
- ;;
- stop)
- rc_stop
- ;;
- restart)
- rc_restart
- ;;
- *)
- echo "Usage: $0 <start|stop|restart>"
- ;;
-esac
diff --git a/config/archive/dspam/pkg/020.clamav-freshclam.sh b/config/archive/dspam/pkg/020.clamav-freshclam.sh
deleted file mode 100644
index 4332d757..00000000
--- a/config/archive/dspam/pkg/020.clamav-freshclam.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-# This file was automatically generated
-# by the pfSense service handler
-
-rc_start() {
- /sbin/mount_fdescfs fdescfs /dev/fd
- /usr/local/bin/freshclam --daemon
-}
-
-rc_stop() {
- /usr/bin/killall freshclam
- sleep 2
-}
-
-rc_restart() {
- rc_stop
- rc_start
-}
-
-case $1 in
- start)
- rc_start
- ;;
- stop)
- rc_stop
- ;;
- restart)
- rc_restart
- ;;
- *)
- echo "Usage: $0 <start|stop|restart>"
- ;;
-esac
diff --git a/config/archive/dspam/pkg/030.p3scan.sh b/config/archive/dspam/pkg/030.p3scan.sh
deleted file mode 100644
index ffd08abf..00000000
--- a/config/archive/dspam/pkg/030.p3scan.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-# This file was automatically generated
-# by the pfSense service handler
-
-rc_start() {
-test_p3scan_user=`cat /etc/passwd | grep p3scan`
-test_p3scan_group=`cat /etc/passwd | grep p3scan`
-
-if [ -z "${test_p3scan_group}" ]; then
- pw groupadd p3scan -g 108
-fi
-
-if [ -z "${test_p3scan_user}" ]; then
- pw useradd p3scan -u 108 -g p3scan -d /var/spool/p3scan -s /sbin/nologin -c 'P3Scan Daemon'
-fi
-
-if [ ! -d "/var/spool/p3scan" ]; then
- mkdir /var/spool/p3scan && chown p3scan:p3scan /var/spool/p3scan
-fi
-
-if [ ! -d "/var/spool/p3scan/children" ]; then
- mkdir /var/spool/p3scan/children && chown p3scan:p3scan /var/spool/p3scan/children
-fi
-
-if [ ! -d "/var/spool/p3scannotify" ]; then
- mkdir /var/spool/p3scannotify && chown p3scan:p3scan /var/spool/p3scannotify
-fi
-
-if [ ! -d "/var/run/p3scan" ]; then
- mkdir /var/run/p3scan && chown p3scan:p3scan /var/run/p3scan
-fi
-
- /sbin/mount_fdescfs fdescfs /dev/fd
- /usr/local/sbin/p3scan --configfile=/usr/local/etc/p3scan/p3scan.conf &
-}
-
-rc_stop() {
- /usr/bin/killall p3scan
- sleep 2
-}
-
-rc_restart() {
- rc_stop
- rc_start
-}
-
-case $1 in
- start)
- rc_start
- ;;
- stop)
- rc_stop
- ;;
- restart)
- rc_restart
- ;;
- *)
- echo "Usage: $0 <start|stop|restart>"
- ;;
-esac
diff --git a/config/archive/dspam/pkg/clamd.conf b/config/archive/dspam/pkg/clamd.conf
deleted file mode 100644
index 3ce0402f..00000000
--- a/config/archive/dspam/pkg/clamd.conf
+++ /dev/null
@@ -1,299 +0,0 @@
-##
-## Example config file for the Clam AV daemon
-## Please read the clamd.conf(5) manual before editing this file.
-##
-
-
-# Comment or remove the line below.
-#Example
-
-# Uncomment this option to enable logging.
-# LogFile must be writable for the user running daemon.
-# A full path is required.
-# Default: disabled
-#LogFile /tmp/clamd.log
-LogFile /var/log/clamav/clamd.log
-
-# By default the log file is locked for writing - the lock protects against
-# running clamd multiple times (if want to run another clamd, please
-# copy the configuration file, change the LogFile variable, and run
-# the daemon with --config-file option).
-# This option disables log file locking.
-# Default: no
-#LogFileUnlock yes
-
-# Maximal size of the log file.
-# Value of 0 disables the limit.
-# You may use 'M' or 'm' for megabytes (1M = 1m = 1048576 bytes)
-# and 'K' or 'k' for kilobytes (1K = 1k = 1024 bytes). To specify the size
-# in bytes just don't use modifiers.
-# Default: 1M
-#LogFileMaxSize 2M
-
-# Log time with each message.
-# Default: no
-#LogTime yes
-
-# Also log clean files. Useful in debugging but drastically increases the
-# log size.
-# Default: no
-#LogClean yes
-
-# Use system logger (can work together with LogFile).
-# Default: no
-#LogSyslog yes
-LogSyslog yes
-
-# Specify the type of syslog messages - please refer to 'man syslog'
-# for facility names.
-# Default: LOG_LOCAL6
-#LogFacility LOG_MAIL
-
-# Enable verbose logging.
-# Default: no
-#LogVerbose yes
-
-# This option allows you to save a process identifier of the listening
-# daemon (main thread).
-# Default: disabled
-#PidFile /var/run/clamd.pid
-PidFile /var/run/clamav/clamd.pid
-
-# Optional path to the global temporary directory.
-# Default: system specific (usually /tmp or /var/tmp).
-#TemporaryDirectory /var/tmp
-
-# Path to the database directory.
-# Default: hardcoded (depends on installation options)
-#DatabaseDirectory /var/lib/clamav
-DatabaseDirectory /usr/local/share/clamav
-
-# The daemon works in a local OR a network mode. Due to security reasons we
-# recommend the local mode.
-
-# Path to a local socket file the daemon will listen on.
-# Default: disabled (must be specified by a user)
-#LocalSocket /tmp/clamd
-
-# Remove stale socket after unclean shutdown.
-# Default: no
-FixStaleSocket yes
-
-# TCP port address.
-# Default: no
-TCPSocket 3310
-
-# TCP address.
-# By default we bind to INADDR_ANY, probably not wise.
-# Enable the following to provide some degree of protectiyes
-# from the outside world.
-# Default: no
-TCPAddr 127.0.0.1
-
-# Maximum length the queue of pending connections may grow to.
-# Default: 15
-#MaxConnectionQueueLength 30
-
-# Clamd uses FTP-like protocol to receive data from remote clients.
-# If you are using clamav-milter to balance load between remote clamd daemons
-# on firewall servers you may need to tune the options below.
-
-# Close the connection when the data size limit is exceeded.
-# The value should match your MTA's limit for a maximal attachment size.
-# Default: 10M
-#StreamMaxLength 20M
-
-# Limit port range.
-# Default: 1024
-#StreamMinPort 30000
-# Default: 2048
-#StreamMaxPort 32000
-
-# Maximal number of threads running at the same time.
-# Default: 10
-#MaxThreads 20
-
-# Waiting for data from a client socket will timeout after this time (seconds).
-# Value of 0 disables the timeout.
-# Default: 120
-#ReadTimeout 300
-
-# Waiting for a new job will timeout after this time (seconds).
-# Default: 30
-#IdleTimeout 60
-
-# Maximal depth directories are scanned at.
-# Default: 15
-#MaxDirectoryRecursion 20
-
-# Follow directory symlinks.
-# Default: no
-#FollowDirectorySymlinks yes
-
-# Follow regular file symlinks.
-# Default: no
-#FollowFileSymlinks yes
-
-# Perform internal sanity check (database integrity and freshness).
-# Default: 1800 (30 min)
-#SelfCheck 600
-
-# Execute a command when virus is found. In the command string %v will
-# be replaced by a virus name.
-# Default: no
-#VirusEvent /usr/local/bin/send_sms 123456789 "VIRUS ALERT: %v"
-
-# Run as a selected user (clamd must be started by root).
-# Default: don't drop privileges
-User clamav
-
-# Initialize supplementary group access (clamd must be started by root).
-# Default: no
-AllowSupplementaryGroups yes
-
-# Stop daemon when libclamav reports out of memory condition.
-#ExitOnOOM yes
-
-# Don't fork into background.
-# Default: no
-#Foreground yes
-
-# Enable debug messages in libclamav.
-# Default: no
-#Debug yes
-
-# Do not remove temporary files (for debug purposes).
-# Default: no
-#LeaveTemporaryFiles yes
-
-##
-## Executable files
-##
-
-# PE stands for Portable Executable - it's an executable file format used
-# in all 32-bit versions of Windows operating systems. This option allows
-# ClamAV to perform a deeper analysis of executable files and it's also
-# required for decompression of popular executable packers such as UPX, FSG,
-# and Petite.
-# Default: yes
-#ScanPE yes
-
-# With this option clamav will try to detect broken executables and mark
-# them as Broken.Executable
-# Default: no
-#DetectBrokenExecutables yes
-
-
-##
-## Documents
-##
-
-# This option enables scanning of Microsoft Office document macros.
-# Default: yes
-#ScanOLE2 yes
-
-##
-## Mail files
-##
-
-# Enable internal e-mail scanner.
-# Default: yes
-#ScanMail yes
-
-# If an email contains URLs ClamAV can download and scan them.
-# WARNING: This option may open your system to a DoS attack.
-# Never use it on loaded servers.
-# Default: no
-#MailFollowURLs no
-
-
-##
-## HTML
-##
-
-# Perform HTML normalisation and decryption of MS Script Encoder code.
-# Default: yes
-#ScanHTML yes
-
-
-##
-## Archives
-##
-
-# ClamAV can scan within archives and compressed files.
-# Default: yes
-#ScanArchive yes
-
-# The options below protect your system against Denial of Service attacks
-# using archive bombs.
-
-# Files in archives larger than this limit won't be scanned.
-# Value of 0 disables the limit.
-# Default: 10M
-#ArchiveMaxFileSize 15M
-
-# Nested archives are scanned recursively, e.g. if a Zip archive contains a RAR
-# file, all files within it will also be scanned. This options specifies how
-# deep the process should be continued.
-# Value of 0 disables the limit.
-# Default: 8
-#ArchiveMaxRecursion 10
-
-# Number of files to be scanned within an archive.
-# Value of 0 disables the limit.
-# Default: 1000
-#ArchiveMaxFiles 1500
-
-# If a file in an archive is compressed more than ArchiveMaxCompressionRatio
-# times it will be marked as a virus (Oversized.ArchiveType, e.g. Oversized.Zip)
-# Value of 0 disables the limit.
-# Default: 250
-#ArchiveMaxCompressionRatio 300
-
-# Use slower but memory efficient decompression algorithm.
-# only affects the bzip2 decompressor.
-# Default: no
-#ArchiveLimitMemoryUsage yes
-
-# Mark encrypted archives as viruses (Encrypted.Zip, Encrypted.RAR).
-# Default: no
-#ArchiveBlockEncrypted no
-
-# Mark archives as viruses (e.g. RAR.ExceededFileSize, Zip.ExceededFilesLimit)
-# if ArchiveMaxFiles, ArchiveMaxFileSize, or ArchiveMaxRecursion limit is
-# reached.
-# Default: no
-#ArchiveBlockMax no
-
-
-##
-## Clamuko settings
-## WARNING: This is experimental software. It is very likely it will hang
-## up your system!!!
-##
-
-# Enable Clamuko. Dazuko (/dev/dazuko) must be configured and running.
-# Default: no
-#ClamukoScanOnAccess yes
-
-# Set access mask for Clamuko.
-# Default: no
-#ClamukoScanOnOpen yes
-#ClamukoScanOnClose yes
-#ClamukoScanOnExec yes
-
-# Set the include paths (all files in them will be scanned). You can have
-# multiple ClamukoIncludePath directives but each directory must be added
-# in a seperate line.
-# Default: disabled
-#ClamukoIncludePath /home
-#ClamukoIncludePath /students
-
-# Set the exclude paths. All subdirectories are also excluded.
-# Default: disabled
-#ClamukoExcludePath /home/bofh
-
-# Don't scan files larger than ClamukoMaxFileSize
-# Value of 0 disables the limit.
-# Default: 5M
-#ClamukoMaxFileSize 10M
diff --git a/config/archive/dspam/pkg/default.prefs.sample b/config/archive/dspam/pkg/default.prefs.sample
deleted file mode 100644
index d9be27ed..00000000
--- a/config/archive/dspam/pkg/default.prefs.sample
+++ /dev/null
@@ -1,43 +0,0 @@
-# $Id$
-# default.prefs v3.2
-# Default preferences for DSPAM
-
-# This file serves two purposes. First, it sets the default preferences each
-# user will see when using the preferences section of the DSPAM Control
-# Center. Second, it may be symbolically linked (or copied) into DSPAM_HOME to
-# set the system-wide default preferences, overriding any commandline or
-# dspam.conf parameters. If symlinked, an administrator can edit these options
-# in the DSPAM Administrative Suite.
-
-# Training Mode: TEFT, TOE, TUM, NOTRAIN
-trainingMode=TEFT
-
-# Spam Action: quarantine, tag
-spamAction=quarantine
-
-# Spam Subject: the text to be prepended onto the subject line of tagged spams
-spamSubject=[SPAM]
-
-# Bayesian Noise Reduction: on/off
-enableBNR=on
-
-# Automatic Whitelisting: on/off
-enableWhitelist=on
-
-# Statistical Sedation: 0-10
-statisticalSedation=5
-
-# Signature Location: message, headers, attachment
-signatureLocation=message
-
-# Whitelist Threshold: the minimum number of innocent hits from a recipient to
-# be automatically whitelisted. Do not set this value too low!
-whitelistThreshold=10
-
-# showFactors: when set to on, the determining factors for each message will
-# be added to a X-DSPAM-Factors message header.
-showFactors=off
-
-# optIn/optOut: Depending on the opt mode set, you can also use one of these.
-#optIn=on
-#optOut=off
diff --git a/config/archive/dspam/pkg/dspam-config.inc b/config/archive/dspam/pkg/dspam-config.inc
deleted file mode 100644
index bffae808..00000000
--- a/config/archive/dspam/pkg/dspam-config.inc
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/* $Id$ */
-/* Copyright (C) 2006 Daniel S. Haischt */
-
-$CONFIG = array('DSPAM_HOME' => '/var/db/dspam',
- 'DSPAM_BIN' => '/usr/local/bin',
- 'DSPAM' => '/usr/local/bin/dspam',
- 'DSPAM_STATS' => '/usr/local/bin/dspam_stats',
- 'DSPAM_WWW' => '/usr/local/pkg',
- 'DSPAM_ARGS' => '--deliver=innocent --class=innocent ' .
- '--source=error --user %CURRENT_USER% -d %u',
- 'DSPAM_ADMIN_GROUP' => 'dspam_admins',
- 'ALL_PROCS' => 'ps auxw',
- 'MAIL_QUEUE' => 'mailq | grep \'^[0-9,A-F]\' | wc -l',
- 'HISTORY_SIZE' => 799,
- 'HISTORY_PER_PAGE' => 100,
- 'QUARANTINE_PER_PAGE' => 100,
- 'HISTORY_DUPLICATES' => 'yes',
- 'MAX_COL_LEN' => 26,
- 'QNAV_BUTTONS' => 20,
- 'HNAV_BUTTONS' => 22,
- 'SORT_DEFAULT' => 'Rating',
- '3D_GRAPHS' => 1,
- 'USE_MAILPARSE' => 1,
- 'OPTMODE' => 'NONE',
- 'LOCAL_DOMAIN' => 'localhost',
- 'AUTODETECT' => 1,
- 'OPENSOURCE' => 0,
- /* Is there a website which provides dedicated infos? */
- 'PACKAGE_WEBSITE' => 'https://www.pfsense.org/',
- /* Is there a forum which provides dedicated infos? */
- 'PACKAGE_FORUM' => 'https://www.pfsense.org/',
- /*
- * Is there a issue tracker which allows to fill a
- * support request or a bug report?
- */
- 'PACKAGE_TRACKER' => 'https://www.pfsense.org/',
- /* 'DATE_FORMAT' => '%d.%m.%Y %H:%M' */
- 'DATE_FORMAT' => '%b %d %H:%M'
- );
-
-?>
diff --git a/config/archive/dspam/pkg/dspam-guifunc.inc b/config/archive/dspam/pkg/dspam-guifunc.inc
deleted file mode 100644
index 121bc8b5..00000000
--- a/config/archive/dspam/pkg/dspam-guifunc.inc
+++ /dev/null
@@ -1,2606 +0,0 @@
-<?php
-/* $Id$ */
-/* Copyright (C) 2006 Daniel S. Haischt */
-require_once("functions.inc");
-require_once("dspam.inc");
-
-/* ========================================================================== */
-/* = A D M I N S T A T U S F U N C T I O N S = */
-/* ========================================================================== */
-
-function DisplayAdminPreferences(&$statusmsg) {
- return DisplayPreferences("admin", $statusmsg);
-}
-
-function DisplayUserStatistics() {
- global $CONFIG, $DATA;
- $b = "rowEven";
-
- $sl_total = 0;
- $il_total = 0;
- $sm_total = 0;
- $fp_total = 0;
- $sc_total = 0;
- $ic_total = 0;
- $mailbox_total = 0;
-
- $pd = popen("{$CONFIG['DSPAM_STATS']} 2>&1", "r");
-
- while (!feof($pd)) {
- $line = chop( fgets($pd, 4096) );
-
- if ($b == "qrowEven") {
- $b = "qrowOdd";
- } else {
- $b = "qrowEven";
- }
-
- $line = preg_replace('/:/', ' ', $line);
-
- list($username, , $sl, , $il, , $fp, , $sm, , $sc, , $ic)
- = (preg_split('/\s+/', $line));
- if ($username == "" && $sl == "") {
- /* we do not want to display data that
- * does not bleong to any user
- */
- continue;
- } else if ($sl == "") {
- $line = fgets($pd, 4096);
- $line = preg_replace('/:/', ' ', $line);
- list(, , $sl, , $il, , $fp, , $sm, , $sc, , $ic)
- = (preg_split('/\s+/', $line));
- }
-
- $PREFS =& GetPrefs($username, GetPath($username).".prefs");
- if ($PREFS['enableBNR'] == "on") { $PREFS['enableBNR'] = "OFF"; }
- if ($PREFS['enableWhitelist'] == "on") { $PREFS['enableWhitelist'] = "OFF"; }
- $PREFS['spamAction'] = ucfirst($PREFS['spamAction']);
- $PREFS['enableBNR'] = strtoupper($PREFS['enableBNR']);
- $PREFS['enableWhitelist'] = strtoupper($PREFS['enableWhitelist']);
-
- $mailbox = GetPath($username).".mbox";
- if ( file_exists($mailbox) ) {
- $mailbox_size = filesize($mailbox);
- $mailbox_display = sprintf("%2.1f KB", ($mailbox_size / 1024));
- $mailbox_total += $mailbox_size;
- }
- else {
- $mailbox_display = "--";
- }
-
- $sl_total += $sl;
- $il_total += $il;
- $sm_total += $sm;
- $fp_total += $fp;
- $sc_total += $sc;
- $ic_total += $ic;
-
- $DATA['TABLE'] .= "<tr><td class=\"{$b}\"><a href=\"{$CONFIG['DSPAM_CGI']}?user={$username}\">{$username}</A></td>" .
- " <td class=\"{$b} rowDivider\" align=\"right\" nowrap=\"nowrap\">{$mailbox_display}</td>" .
- " <td class=\"{$b} rowDivider\">{$sl}</td>" .
- " <td class=\"{$b}\">{$il}</td>" .
- " <td class=\"{$b}\">{$fp}</td>" .
- " <td class=\"{$b}\">{$sm}</td>" .
- " <td class=\"{$b}\">{$sc}</td>" .
- " <td class=\"{$b}\">{$ic}</td>" .
- " <td class=\"{$b} rowDivider\">{$PREFS['trainingMode']}</td>" .
- " <td class=\"{$b}\">{$PREFS['spamAction']}</td>" .
- " <td class=\"{$b}\">{$PREFS['enableBNR']}</td>" .
- " <td class=\"{$b}\">{$PREFS['enableWhitelist']}</td>" .
- " <td class=\"{$b}\">{$PREFS['statisticalSedation']}</td>" .
- " <td class=\"{$b}\">{$PREFS['signatureLocation']}</td>" .
- "</tr>\n";
- }
- pclose($pd);
-
- $mailbox_total_display = sprintf("%2.1f KB", ($mailbox_total / 1024));
-
- $b = "listhdrr";
- $DATA['TABLE'] .= "<tr><td class=\"{$b}\">Total</td>".
- " <td class=\"{$b} rowDivider\" align=\"right\" nowrap=\"nowrap\">{$mailbox_total_display}</td>".
- " <td class=\"{$b} rowDivider\">{$sl_total}</td>".
- " <td class=\"{$b}\">{$il_total}</td>".
- " <td class=\"{$b}\">{$sm_total}</td>".
- " <td class=\"{$b}\">{$fp_total}</td>".
- " <td class=\"{$b}\">{$sc_total}</td>".
- " <td class=\"{$b}\">{$ic_total}</td>".
- " <td class=\"{$b} rowDivider\">&nbsp;</td>".
- " <td class=\"{$b}\">&nbsp;</td>".
- " <td class=\"{$b}\">&nbsp;</td>".
- " <td class=\"{$b}\">&nbsp;</td>".
- " <td class=\"{$b}\">&nbsp;</td>".
- " <td class=\"{$b}\">&nbsp;</td>".
- "</tr>\n";
-}
-
-function &DisplayStatus() {
- global $CONFIG, $DATA;
-
- $LOG = "{$CONFIG['DSPAM_HOME']}/system.log";
- $spam_daily = array();
- $nonspam_daily = array();
- $period_daily = array();
- $fp_daily = array();
- $sm_daily = array();
- $inoc_daily = array();
- $whitelist_daily = array();
- $spam_weekly = array();
- $nonspam_weekly = array();
- $period_weekly = array();
- $fp_weekly = array();
- $sm_weekly = array();
- $inoc_weekly = array();
- $$whitelist_weekly = array();
- $msgpersecond = array();
- $classes = array();
-
- list (, $min, $hour, $mday, $mon, $year, , ,) = (localtime(time()));
- $hmstart = time() - 60;
- $daystart = mktime(0, 0, 0, $mon, $mday, $year);
- $periodstart = $daystart - (3600*24*24); /* 2 Weeks ago */
- $dailystart = time() - (3600*23);
- $c_weekly = 0; /* Cursor to most recent time slot */
- $c_daily = 0;
-
- if (! file_exists($LOG)) {
- return $input_errors[] = "No historical data is available (log file »{$LOG}« does not exist).";
- }
-
- /* Initialize each individual time period */
-
- for ($i = 0; $i <= 23; $i++) {
- $h = To12Hour($hour - (23-$i));
- $period_daily[$i] = $h;
- $spam_daily[$i] = 0;
- $nonspam_daily[$i] = 0;
- $sm_daily[$i] = 0;
- $fp_daily[$i] = 0;
- $inoc_daily[$i] = 0;
- }
-
- for ($i = 0; $i <= 23; $i++) {
- $d = $daystart - (3600 * 24 * (24 - $i));
- list (, , , $lday, $lmon, $lyear, , ,) = (localtime($d));
- $lmon++;
- $lyear += 1900;
- $period_weekly[$i] = "{$lmon}/{$lday}/{$lyear}";
- $spam_weekly[$i] = 0;
- $nonspam_weekly[$i] = 0;
- $sm_weekly[$i] = 0;
- $fp_weekly[$i] = 0;
- $inoc_weekly[$i] = 0;
- }
-
- if($fd = @fopen("{$LOG}", "r")) {
- while (!feof($fd)) {
- $line = fgets($fd, 4096);
- list ($t_log, $c_log, , $signature, , $e_log) = preg_split('/\t/', $line);
- if ($t_log > time()) { continue; }
-
- $last_message = $t_log;
-
- /* Only Parse Log Data in our Time Period */
- if ($t_log >= $periodstart) {
- list (, $tmin, $thour, $tday, $tmon, $tyear) = (localtime($t_log));
- $tmon++;
- $tyear += 1900;
-
- /* Weekly Graph */
- $c_weekly = 0;
- while($period_weekly[$c_weekly] <> "{$tmon}/{$tday}/{$tyear}" && $c_weekly < 24) {
- $c_weekly++;
- }
-
- if ($c_log == "E") {
- if ($classes[$signature] == "S") {
- $spam_weekly[$c_weekly]--;
- if ($spam_weekly[$c_weekly] < 0) { $spam_weekly[$c_weekly] = 0; }
- } else if ($classes[$signature] == "I") {
- $nonspam_weekly[$c_weekly]--;
- if ($nonspam_weekly[$c_weekly] < 0) { $nonspam_weekly[$c_weekly] = 0; }
- } else if ($classes[$signature] == "W") {
- $whitelist_weekly[$c_weekly]--;
- if ($whitelist_weekly[$c_weekly] < 0) { $whitelist_weekly[$c_weekly] = 0; }
- } else if ($classes[$signature] == "F") {
- $spam_weekly[$c_weekly]++; $fp_weekly[$c_weekly]--;
- if ($fp_weekly[$c_weekly] < 0) { $fp_weekly[$c_weekly] = 0; }
- } else if ($classes[$signature] == "M") {
- $sm_weekly[$c_weekly]--; $nonspam_weekly[$c_weekly]++;
- if ($sm_weekly[$c_weekly] < 0) { $sm_weekly[$c_weekly] = 0; }
- } else if ($classes[$signature] == "N") {
- $inoc_weekly[$c_weekly]--;
- if ($inoc_weekly[$c_weekly] < 0) { $inoc_weekly[$c_weekly] = 0; }
- }
- } else {
- $classes[$signature] = $c_log;
- }
-
- if ($c_log == "S") { $spam_weekly[$c_weekly]++; }
- if ($c_log == "I") { $nonspam_weekly[$c_weekly]++; }
- if ($c_log == "W") { $whitelist_weekly[$c_weekly]++; }
- if ($c_log == "F")
- { $spam_weekly[$c_weekly]--; $fp_weekly[$c_weekly]++;
- if ($spam_weekly[$c_weekly] < 0) { $spam_weekly[$c_weekly] = 0; }
- }
- if ($c_log == "M")
- { $sm_weekly[$c_weekly]++; $nonspam_weekly[$c_weekly]--;
- if ($nonspam_weekly[$c_weekly] < 0) { $nonspam_weekly[$c_weekly] = 0; }
- }
- if ($c_log == "N") { $inoc_weekly[$c_weekly]++; }
-
-
- /* Daily Graph */
- if ($t_log >= $dailystart) {
- while($period_daily[$c_daily] <> To12Hour($thour) && $c_daily < 24) {
- $c_daily++;
- }
-
- if ($c_log == "E") {
- if ($classes[$signature] == "S") {
- $spam_daily[$c_daily]--;
- if ($spam_daily[$c_daily] < 0) { $spam_daily[$c_daily] = 0; }
- } else if ($classes[$signature] == "I") {
- $nonspam_daily[$c_daily]--;
- if ($nonspam_daily[$c_daily] < 0) { $nonspam_daily[$c_daily] = 0; }
- } else if ($classes[$signature] == "W") {
- $whitelist_daily[$c_daily]--;
- if ($whitelist_daily[$c_daily] < 0) { $whitelist_daily[$c_daily] = 0; }
- } else if ($classes[$signature] == "F") {
- $spam_daily[$c_daily]++; $fp_daily[$c_daily]--;
- if ($fp_daily[$c_daily] < 0) { $fp_daily[$c_daily] = 0; }
- } else if ($classes[$signature] == "M") {
- $sm_daily[$c_daily]--; $nonspam_daily[$c_daily]++;
- if ($sm_daily[$c_daily] < 0) { $sm_daily[$c_daily] = 0; }
- } else if ($classes[$signature] == "N") {
- $inoc_daily[$c_daily]--;
- if ($inoc_daily[$c_daily] < 0) { $inoc_daily[$c_daily] = 0; }
- }
- }
-
- if ($c_log == "S") { $spam_daily[$c_daily]++; }
- if ($c_log == "I") { $nonspam_daily[$c_daily]++; }
- if ($c_log == "W") { $whitelist_daily[$c_daily]++; }
- if ($c_log == "F")
- { $spam_daily[$c_daily]--; $fp_daily[$c_daily]++;
- if ($spam_daily[$c_daily] < 0) { $spam_daily[$c_daily] = 0; }
- }
- if ($c_log == "M")
- { $sm_daily[$c_daily]++; $nonspam_daily[$c_daily]--;
- if ($nonspam_daily[$c_daily] < 0) { $nonspam_daily[$c_daily] = 0; }
- }
- if ($c_log == "N") { $inoc_daily[$c_daily]++; }
- }
-
- /* Last Half-Minute */
- if ($t_log >= $hmstart) {
- $msgpersecond[$t_log]++;
- $DATA['AVG_PROCESSING_TIME'] += $e_log;
- $keycount_exectime++;
- }
- }
- } // end while
-
- fclose($fd);
- } else {
- return $input_errors[] = "Unable to open logfile: {$LOG}.";
- } // end if
-
- /* Calculate Avg. Messages Per Second */
- foreach(array_values($msgpersecond) as $el) {
- $DATA['AVG_MSG_PER_SECOND'] += $el;
- }
- $DATA['AVG_MSG_PER_SECOND'] /= 60;
- $DATA['AVG_MSG_PER_SECOND'] = sprintf("%2.2f", $DATA['AVG_MSG_PER_SECOND']);
-
- /* Calculate Avg. Processing Time */
- if ($keycount_exectime == 0) {
- $DATA['AVG_PROCESSING_TIME'] = 0;
- } else {
- $DATA['AVG_PROCESSING_TIME'] /= $keycount_exectime;
- }
- $DATA['AVG_PROCESSING_TIME'] = sprintf("%01.6f", $DATA['AVG_PROCESSING_TIME']);
-
- /* Calculate Number of processes, Uptime and Mail Queue length */
- $pd = popen("{$CONFIG['ALL_PROCS']} | grep dspam | grep -v grep | grep -v cgi | grep -v sock | wc -l", "r");
- $DATA['DSPAM_PROCESSES'] = fgets($pd, 4096);
- pclose($pd);
-
- $pd = popen("uptime", "r");
- $DATA['UPTIME'] = fgets($pd, 4096);
- pclose($pd);
-
- $pd = popen("{$CONFIG['MAIL_QUEUE']}", "r");
- $DATA['MAIL_QUEUE'] = fgets($pd, 4096);
- pclose($pd);
-
- /* Calculate Graphs */
- $DATA['SPAM_TODAY'] = $spam_weekly[24];
- $DATA['NONSPAM_TODAY'] = $nonspam_weekly[24];
- $DATA['SM_TODAY'] = $sm_weekly[24];
- $DATA['FP_TODAY'] = $fp_weekly[24];
- $DATA['INOC_TODAY'] = $inoc_weekly[24];
- $DATA['TOTAL_TODAY'] = $DATA['SPAM_TODAY'] + $DATA['NONSPAM_TODAY'] + $DATA['SM_TODAY']
- + $DATA['FP_TODAY'] + $DATA['INOC_TODAY'];
-
- $DATA['SPAM_THIS_HOUR'] = $spam_daily[23];
- $DATA['NONSPAM_THIS_HOUR'] = $nonspam_daily[23];
- $DATA['SM_THIS_HOUR'] = $sm_daily[23];
- $DATA['FP_THIS_HOUR'] = $fp_daily[23];
- $DATA['INOC_THIS_HOUR'] = $inoc_daily[23];
- $DATA['TOTAL_THIS_HOUR'] = $DATA['SPAM_THIS_HOUR'] +
- + $DATA['NONSPAM_THIS_HOUR']
- + $DATA['SM_THIS_HOUR']
- + $DATA['FP_THIS_HOUR']
- + $DATA['INOC_THIS_HOUR'];
-
- if (is_array($spam_daily) &&
- is_array($nonspam_daily) &&
- is_array($sm_daily) &&
- is_array($fp_daily) &&
- is_array($inoc_daily) &&
- is_array($whitelist_daily) &&
- is_array($period_daily)) {
- $DATA['DATA_DAILY'] = join(",", $spam_daily)
- . "_"
- . join(",", $nonspam_daily)
- . "_"
- . join(",", $sm_daily)
- . "_"
- . join(",", $fp_daily)
- . "_"
- . join(",", $inoc_daily)
- . "_"
- . join(",", $whitelist_daily)
- . "_"
- . join(",", $period_daily);
-
- foreach($spam_daily as $el){ $DATA['TS_DAILY'] += $el; };
- foreach($nonspam_daily as $el){ $DATA['TI_DAILY'] += $el; }
- foreach($sm_daily as $el){ $DATA['SM_DAILY'] += $el; }
- foreach($fp_daily as $el){ $DATA['FP_DAILY'] += $el; }
- foreach($inoc_daily as $el){ $DATA['INOC_DAILY'] += $el; }
- foreach($whitelist_daily as $el){ $DATA['TI_DAILY'] += $el; }
- }
-
- if (is_array($spam_weekly) &&
- is_array($nonspam_weekly) &&
- is_array($sm_weekly) &&
- is_array($fp_weekly) &&
- is_array($inoc_weekly) &&
- is_array($whitelist_weekly) &&
- is_array($period_weekly)) {
- $DATA['DATA_WEEKLY'] = join(",", $spam_weekly)
- . "_"
- . join(",", $nonspam_weekly)
- . "_"
- . join(",", $sm_weekly)
- . "_"
- . join(",", $fp_weekly)
- . "_"
- . join(",", $inoc_weekly)
- . "_"
- . join(",", $whitelist_weekly)
- . "_"
- . join(",", $period_weekly);
-
- foreach($spam_weekly as $el){ $DATA['TS_WEEKLY'] += $el; }
- foreach($nonspam_weekly as $el){ $DATA['TI_WEEKLY'] += $el; }
- foreach($sm_weekly as $el){ $DATA['SM_WEEKLY'] += $el; }
- foreach($fp_weekly as $el){ $DATA['FP_WEEKLY'] += $el; }
- foreach($inoc_weekly as $el){ $DATA['INOC_WEEKLY'] += $el; }
- foreach($whitelist_weekly as $el){ $DATA['TI_WEEKLY'] += $el; }
- }
-}
-
-function &DisplayInfos() {
- global $CONFIG, $DATA, $g;
- $validity = "valide";
-
- $pd = @popen("{$CONFIG['DSPAM']} --version", "r");
- fgets($pd, 4096); // ignore 1st line
- $DATA['DSPAM_VERSION'] = fgets($pd, 4096);
- fgets($pd, 4096); // ignore next line
- $DATA['DSPAM_COPYRIGHT'] = fgets($pd, 4096);
- $DATA['DSPAM_WEBSITE'] = fgets($pd, 4096);
- fgets($pd, 4096); // ignore next line
- $DATA['DSPAM_COPYRIGHT_TEXT'] = fgets($pd, 4096);
- $DATA['DSPAM_COPYRIGHT_TEXT'] .= " " . fgets($pd, 4096);
- fgets($pd, 4096); // ignore next line
- $DATA['DSPAM_CONFIGURE_ARGS'] = str_replace("Configuration parameters: ", "", fgets($pd, 4096));
-
- pclose($pd);
-
- if (file_exists("{$g['conf_path']}/nione.lic") &&
- file_exists("{$g['conf_path']}/nione.lic.sha1")) {
- if ($fd = @fopen("{$g['conf_path']}/nione.lic", "r")) {
- $owneru = str_replace("Licensed User: ", "", fgets($fd, 4096));
- if ($owneru == "") { $validity = "invalide (owner data not found)"; }
- $ownerc = str_replace("Company: ", "", fgets($fd, 4096));
- if ($ownerc == "") { $validity = "invalide (company not found)"; }
- $lkey = str_replace("License Key: ", "", fgets($fd, 4096));
- if ($lkey == "") { $validity = "invalide (license key not found)"; }
- $pdate = strtotime( str_replace("Purchase Date: ", "", fgets($fd, 4096)) );
- if ($pdate == "") { $validity = "invalide (purchase date not found)"; }
-
- fclose($fd);
- } else {
- $validity = "invalide (license files not found)";
- }
-
- if(! extension_loaded( 'bcompiler' )) {
- if(@dl( 'bcompiler.so' )) {
- require_once ("knione");
- $gen_lkey = getNIONEKey(trim($owneru), trim($ownerc));
- if (trim($lkey) <> $gen_lkey) { $validity = "invalide (wrong license key)"; }
-
- $cdate = mktime(0, 0, 0, date("m"),
- date("d"),
- date("Y"));
-
- $edate = mktime(0, 0, 0, date("m", $pdate),
- date("d", $pdate),
- date("Y", $pdate)+1);
-
- if ($edate < $cdate ||
- $pdate > $cdate) {
- $validity = "invalide (license expired)";
- }
-
- if ($fd = @fopen("{$g['conf_path']}/nione.lic.sha1", "r")) {
- $chksum = str_replace("SHA1 (nione.lic) = ", "", fgets($fd, 4096));
- $chksum_new = sha1_file("{$g['conf_path']}/nione.lic");
-
- if (trim($chksum) !== trim($chksum_new)) {
- $validity = "invalide (wrong license file checksum)";
- }
-
- fclose($fd);
- } else {
- $validity = "invalide (license files not found)";
- }
- } else {
- $validity = "invalide (extension missing, which is necessary to validate license data.)";
- }
- }
- } else {
- $validity = "invalide (license files not found)";
- }
-
- $DATA['OWNER'] = $owneru;
- $DATA['COMPANY'] = $ownerc;
- $DATA['LICENSE_KEY'] = $lkey;
- $DATA['LICENSE_VALIDITY'] = $validity;
- $DATA['PURCHASE_DATE'] = date("F j, Y", $pdate);
- $DATA['EXPIRY_DATE'] = date("F j, Y", $edate);
-}
-
-/* ========================================================================== */
-/* = H I S T O R Y F U N C T I O N S = */
-/* ========================================================================== */
-
-function &DisplayFragment($sigID = "",
- $from = "",
- $subject = "",
- $info = "",
- $time = "") {
- global $DATA, $USER;
-
- $sigID = preg_replace('/\/', '///', $sigID);
-
- $DATA['FROM'] = $from;
- $DATA['SUBJECT'] = $subject;
- $DATA['INFO'] = $info;
- $DATA['TIME'] = $time;
-
- if($fd = @fopen("{$USER}.frag/{$sigID}.frag", "r")) {
- while (!feof($fd)) {
- /* sanitize HTML markup */
- $line = preg_replace("/</e", "'&lt;'", fgets($fd, 4096));
- $line = preg_replace("/>/e", "'&gt;'", $line);
- $DATA['MESSAGE'] .= $line;
- }
- fclose($fd);
- } else {
- return $input_errors[] = "Unable to open file {$USER}.frag/{$sigID}.frag.";
- }
-}
-
-function &DisplayHistory($command = "",
- $sigID= "",
- $retrainChecked = array(),
- $username = "",
- $retrainParam = "",
- $currentPage = 1,
- $hPerPage = 0) {
- global $CONFIG, $USER, $CURRENT_USER, $DATA;
-
- $buffer = array();
- $history = array();
- $rec = array();
- $rowclass = "rowEven";
-
- if ($command == "retrainChecked" && count ($retrainChecked) > 0) {
- foreach($retrainChecked as $el) {
- list ($retrain, $signature) = split(":", $el);
- if ($retrain == "innocent") {
- ProcessFalsePositive(quotemeta($signature));
- } else if ($retrain == "innocent" || $retrain == "spam") {
- system("{$CONFIG['DSPAM']} --source=error --class=" . quotemeta($retrain) .
- " --signature=" . quotemeta($signature) .
- " --user " . quotemeta($CURRENT_USER));
- }
- }
- // TODO: Do we need the other params which were submited during the current
- // POS/GET request?
- pfSenseHeader("/dspam-history.php?user={$username}&page={$currentPage}&hperpage={$hPerPage}");
- } else {
- if ($retrainParam <> "") {
- if ($retrainParam == "innocent") {
- ProcessFalsePositive();
- } else {
- system("{$CONFIG['DSPAM']} --source=error --class=" . quotemeta($retrainParam) .
- " --signature=" . quotemeta($sigID) .
- " --user " . quotemeta($CURRENT_USER));
- }
- // TODO: Do we need the other params which were submited during the current
- // POS/GET request?
- pfSenseHeader("/dspam-history.php?user={$username}&page={$currentPage}&hperpage={$hPerPage}");
- }
- }
-
- $LOG = "{$USER}.log";
- if (! file_exists($LOG)) {
- return $input_errors[] = "No historical data is available (log file »{$USER}.log« does not exist).";
- }
-
- /* Preseed retraining information and delivery errors */
-
- $fd = fopen($LOG, "r");
- while (!feof($fd)) {
- /* TODO: If the subject line contains a <TAB>, the below array would
- * contain more then seven elements and thus would be invalide.
- *
- * The below code is some kind of a bug fix.
- */
- $cline = fgets($fd, 4096);
- $log_columns = preg_split("/\t/", $cline);
- list($time, $class, $from, $signature, $subject, $info, $messageid) = $log_columns;
- if (count ($log_columns) > 7) {
- /* get values from the array beginning */
- $time = array_shift($log_columns);
- $class = array_shift($log_columns);
- $from = array_shift($log_columns);
- $signature = array_shift($log_columns);
- /* get msgid and info from the array end */
- $messageid = array_pop($log_columns);
- $info = array_pop($log_columns);
- /* the remaining parts are belonging to the subject */
- $subject = implode(" ", $log_columns);
- }
-
- if ($signature == "") { continue; }
- if ($class == "M" || $class == "F" || $class == "E") {
- if ($class == "E") {
- $rec[$signature]['info'] = $info;
- } else if ($class == "F" || $class == "M") {
- $rec[$signature]['class'] = $class;
- $rec[$signature]['count']++;
- if ($rec[$signature]['info'] == "")
- { $rec[$signature]['info'] = $info; }
- }
- /* filter out resents if there are any. Since it's the same
- * message we only allow retraining on the 1st occurence of it.
- */
- } else if ($messageid == "" ||
- $rec[$signature]['messageid'] != $messageid ||
- $CONFIG['HISTORY_DUPLICATES'] <> "no") {
- $rec[$signature]['time'] = $time;
- $rec[$signature]['class'] = $class;
- $rec[$signature]['from'] = $from;
- $rec[$signature]['signature'] = $signature;
- $rec[$signature]['subject'] = $subject;
- $rec[$signature]['info'] = $info;
- $rec[$signature]['messageid'] = $messageid;
-
- array_unshift($buffer, $rec[$signature]);
- }
- } // end while
- fclose($fd);
-
- /* if the page size wasn't specified, set a default one */
- if ($CONFIG['HISTORY_PER_PAGE'] == 0) {
- $CONFIG['HISTORY_PER_PAGE'] = 50;
- }
-
- if (isset($hPerPage) && $hPerPage > 0) {
- $CONFIG['HISTORY_PER_PAGE'] = $hPerPage;
- }
-
- if (isset($currentPage) && isset($CONFIG['HISTORY_PER_PAGE'])) {
- $pages = ceil( (count ($buffer) / $CONFIG['HISTORY_PER_PAGE']) );
- $begin = (($currentPage - 1) * $CONFIG['HISTORY_PER_PAGE']);
- $ranges = ceil ($pages / $CONFIG['HNAV_BUTTONS']);
-
- /* Now lets just keep the information that we really need. */
- $buffer = array_splice($buffer, $begin, $CONFIG['HISTORY_PER_PAGE']);
- }
-
- $retrain_checked_msg_no = 0;
- while ($rec = array_pop($buffer)) {
- $time = $rec['time'];
- $class = $rec['class'];
- $from = $rec['from'];
- $signature = $rec['signature'];
- $subject = $rec['subject'];
- $info = $rec['info'];
- $messageid = $rec['messageid'];
-
- if ($signature == "") { continue; }
- if ($rec[$signature]['displayed'] <> "") { continue; }
- if ($class == "E") { continue; }
- $rec[$signature]['displayed'] = 1;
-
- /* Resends of retrained messages will need the original from/subject line */
- if ($messageid <> "") {
- if ($from == "<None Specified>") { $from = $rec[$messageid]['from']; }
- if ($subject == "<None Specified>") { $subject = $rec[$messageid]['subject']; }
-
-
- if ($rec[$messageid]['from'] == "") { $rec[$messageid]['from'] = $from; }
- if ($rec[$messageid]['subject'] == "") { $rec[$messageid]['subject'] = $subject; }
- }
-
- if ($from == "") { $from = "<None Specified>"; }
- if ($subject == "") { $subject = "<None Specified>"; }
-
- $ctime = "";
- if(isset($CONFIG["DATE_FORMAT"])) {
- $ctime = strftime($CONFIG["DATE_FORMAT"], localtime($time));
- } else {
- /* date format was taken from ctime.pl */
- $ctime = date ("D M d H:i:s TY",$time);
- $ttmp = preg_split("/\s+/", $ctime);
- $t = preg_split("/\:/", $ttmp[3]);
- $xtmp = preg_split("/\s+/", $ctime);
- $x = $xtmp[0];
- $m = "a";
- if ($t[0] > 12) { $t[0] -= 12; $m = "p"; }
- if ($t[0] == 0) { $t[0] = 12; }
- $ctime = "{$x} {$t[0]}:{$t[1]}{$m}";
- }
-
- /* Set the appropriate type and label for this message */
-
- $cl = "";
- $cllabel = "";
- if ($rec[$signature]['class'] <> "") { $class = $rec[$signature]['class']; }
- if ($class == "S") { $cl = "spam"; $cllabel="SPAM"; }
- else if ($class == "I") { $cl = "innocent"; $cllabel="Good"; }
- else if ($class == "F") {
- if (fmod($rec[$signature]['count'], 2) != 0) {
- $cl = "false"; $cllabel="Miss";
- } else {
- $cl = "innocent"; $cllabel="Good";
- }
- }
- else if ($class == "M") {
- if (fmod($rec[$signature]['count'], 2) != 0) {
- $cl = "missed"; $cllabel="Miss";
- } else {
- $cl = "spam"; $cllabel="SPAM";
- }
- }
- else if ($class == "N") { $cl = "inoculation"; $cllabel="Spam"; }
- else if ($class == "C") { $cl = "blacklisted"; $cllabel="RBL"; }
- else if ($class == "W") { $cl = "whitelisted"; $cllabel="Whitelist"; }
- if ($messageid <> "") {
- if ($rec[$messageid]['resend'] <> "") {
- $cl = "relay";
- $cllabel = "Resend";
- }
- $rec[$messageid]['resend'] = $signature;
- }
-
- if ($rec[$signature]['info'] <> "") { $info = $rec[$signature]['info']; }
-
- /* sanitize HTML markup */
- $from = preg_replace("/</e", "'&lt;'", $from);
- $from = preg_replace("/>/e", "'&gt;'", $from);
- $subject = preg_replace('/</e', "'&lt;'", $subject);
- $subject = preg_replace('/>/e', "'&gt;'", $subject);
-
- if (strlen($from) > $CONFIG['MAX_COL_LEN']) { $from = substr($from, 0, $CONFIG['MAX_COL_LEN']) . "..."; }
- if (strlen($subject) > $CONFIG['MAX_COL_LEN']) { $subject = substr($subject, 0, $CONFIG['MAX_COL_LEN']) . "..."; }
-
- $rclass = "";
- if ($class == "I" || $class == "W" || $class == "F") { $rclass = "spam"; }
- if ($class == "S" || $class == "M") { $rclass = "innocent"; }
-
- $retrain = "";
- if (preg_match('/^(M|F)$/', $rec[$signature]['class']) > 0 &&
- fmod($rec[$signature]['count'], 2) != 0) {
- $retrain = "<b>Retrained</b>";
- }
-
- if ($retrain == "") {
- $retrain = "<A HREF=\"/dspam-history.php?page={$currentPage}&hperpage={$hPerPage}&user={$username}&retrain={$rclass}&signatureID={$signature}\">As " . ucfirst($rclass) . "</A>";
- } else {
- $retrain .= "(<A HREF=\"/dspam-history.php?page={$currentPage}&hperpage={$hPerPage}&user={$username}&retrain={$rclass}&signatureID={$signature}\">Undo</A>)";
- }
-
- $path = "{$USER}.frag/{$signature}.frag";
- if (file_exists($path)) {
- $pairs = array();
- $pairs['template'] = "fragment";
- $pairs['signatureID'] = $signature;
- $sub = $subject;
- $sub = preg_replace('/#/e', '//', $sub);
- $sub = preg_replace("/(['])/e", '/\\$1/', $sub);
- $pairs['subject'] = $sub;
- $pairs['from'] = $from;
- $pairs['info'] = $info;
- $pairs['time'] = $ctime;
- $pairs['user'] = $username;
- $pairs['page'] = $currentPage;
- $pairs['hperpage'] = $hPerPage;
- $url = SafeVars($pairs);
- $from = "<a href=\"javascript:openwin(580,400,1,'/dspam-hfragment.php?{$url}')\">{$from}</a>";
- }
-
- $entry = <<<EOD
- <tr>
- <td align="left" valign="top" class="{$rowclass} {$cl}" nowrap="true"><small>{$cllabel}</small></td>
- <td align="left" valign="top" class="{$rowclass}" nowrap="true">
- <small>
- <input class="formfld" name="msgid{$retrain_checked_msg_no}" id="msgid{$retrain_checked_msg_no}" title="Check/Uncheck" type="checkbox" value="{$rclass}:{$signature}">
- <label for="msgid{$retrain_checked_msg_no}">{$retrain}</label>
- </small>
- </td>
- <td align="left" valign="top" class="{$rowclass}" nowrap="true"><small>{$ctime}</small></td>
- <td align="left" valign="top" class="{$rowclass}" nowrap="true"><small>{$from}</small></td>
- <td align="left" valign="top" class="{$rowclass}" nowrap="true"><small>{$subject}</small></td>
- <td align="left" valign="top" class="{$rowclass}" nowrap="true"><small>{$info}</small></td>
- </tr>
-
-EOD;
-
- $retrain_checked_msg_no++;
- array_push($history, $entry);
-
- if ($rowclass == "qrowEven") {
- $rowclass = "qrowOdd";
- } else {
- $rowclass = "qrowEven";
- }
- $hurtz++;
- } // end while
-
- $entry = <<<EOD
- <input name="history_page" type="hidden" value="{$history_page}">
-
-EOD;
- array_push($history, $entry);
-
- while($line = array_pop($history)) { $DATA['HISTORY'] .= $line; }
-
- if ($CONFIG['HISTORY_PER_PAGE'] > 0) {
- /* prepare quarantine navbar */
- if (($currentPage - 1) >= 1) { $previousPage = $currentPage - 1; }
- else { $previousPage = 1; }
-
- if (($currentPage + 1) <= $pages) { $nextPage = $currentPage + 1; }
- else { $nextPage = $pages; }
-
- $historyFooterBegin = <<<EOD
- <tr>
- <td align="right" valign="middle" class="listtopic" colspan="6">
- <span class="qnavbtn" onmouseover="this.style.backgroundColor='#A5B9E1;'" onmouseout="this.style.backgroundColor='#507DCD;'" title="First Page (1)"><a href="/dspam-history.php?page=1&qperpage={$CONFIG['HISTORY_PER_PAGE']}" title="First Page (1)">|&lt;</a></span>&nbsp;
- <span class="qnavbtn" onmouseover="this.style.backgroundColor='#A5B9E1;'" onmouseout="this.style.backgroundColor='#507DCD;'" title="Page {$previousPage}"><a href="/dspam-history.php?page={$previousPage}&qperpage={$CONFIG['HISTORY_PER_PAGE']}" title="Page {$previousPage}">&lt;</a></span>&nbsp;
-
-EOD;
-
- $historyFooterEnd = <<<EOD
- <span class="qnavbtn" onmouseover="this.style.backgroundColor='#A5B9E1;'" onmouseout="this.style.backgroundColor='#507DCD;'" title="Page {$nextPage}"><a href="/dspam-history.php?page={$nextPage}&qperpage={$CONFIG['HISTORY_PER_PAGE']}" title="Page {$nextPage}">&gt;</a></span>&nbsp;
- <span class="qnavbtn" onmouseover="this.style.backgroundColor='#A5B9E1;'" onmouseout="this.style.backgroundColor='#507DCD;'" title="Last Page ({$pages})"><a href="/dspam-history.php?page={$pages}&qperpage={$CONFIG['HISTORY_PER_PAGE']}" title="Last Page ({$pages})">&gt;|</a></span>
- </td>
- </tr>
-
-EOD;
-
- $ranges_array = array();
- $rpages = $pages;
- for ($i = 0; $i < $ranges; $i++) {
- $range = array();
- $range['start'] = (($i + 1)* $CONFIG['HNAV_BUTTONS']) - ($CONFIG['HNAV_BUTTONS'] - 1);
-
- if (($i + 1) == $ranges) {
- $range['end'] = ($range['start'] + $rpages) - 1;
- } else {
- $range['end'] = (($i + 1)* $CONFIG['HNAV_BUTTONS']);
- $rpages -= $CONFIG['HNAV_BUTTONS'];
- }
-
- $ranges_array[$i] = $range;
- }
-
- /* generate nav buttons */
- foreach($ranges_array as $range){
- if ($currentPage >= $range['start'] && $currentPage <= $range['end']) {
- for ($i = $range['start']; ; $i++) {
- if ($i > $range['end']) {
- break;
- } else {
- if ($i == $currentPage) {
- $historyFooter .= "<span class=\"qnavbtnhl\">{$i}</span>&nbsp\n";
- } else {
- $historyFooter .= "<span class=\"qnavbtn\" onmouseover=\"this.style.backgroundColor='#A5B9E1;'\" onmouseout=\"this.style.backgroundColor='#507DCD;'\" title=\"Page {$i}\"><a href=\"/dspam-history.php?page={$i}&hperpage={$CONFIG['HISTORY_PER_PAGE']}\" title=\"Page {$i}\">{$i}</a></span>&nbsp\n";
- }
- }
- }
- }
- }
-
- $DATA['HISTORY_FOOTER'] = $historyFooterBegin . $historyFooter .$historyFooterEnd;
- $DATA['HPAGES'] = $pages;
- $DATA['HPAGE'] = $currentPage;
-
-/*
- $DATA['HISTORY'] .= "<tr><td align=\"left\" valign=\"top\" colspan=\"6\"><center>[";
- if (($history_pages > 1) && ($history_page > 1)) {
- $i = $history_page - 1;
- $DATA['HISTORY'] .= "<a href=\"/dspam-history.php?user={$username}&history_page={$i}\">&nbsp;&lt;&nbsp;</a>";
- }
- for($i = 1; $i <= $history_pages; $i++) {
- if ($i == $history_page) {
- $DATA['HISTORY'] .= "<a href=\"/dspam-history.php?user={$username}&history_page={$i}\"><big><strong>&nbsp;$i&nbsp;</strong></big></a>";
- } else {
- $DATA['HISTORY'] .= "<a href=\"/dspam-history.php?user={$username}&history_page={$i}\">&nbsp;{$i}&nbsp;</a>";
- }
- }
- if (($history_pages > 1) && ($history_page < $history_pages)) {
- $i = $history_page + 1;
- $DATA['HISTORY'] .= "<a href=\"/dspam-history.php?user={$username}&history_page={$i}\">&nbsp;&gt;&nbsp;</a>";
- }
- $DATA['HISTORY'] .= "]</center></td></tr>";
-*/
- } // end if
-}
-
-/* ========================================================================== */
-/* = A N A L Y S I S F U N C T I O N S = */
-/* ========================================================================== */
-
-function &DisplayAnalysis() {
- global $USER, $CURRENT_USER, $CONFIG, $DATA;
- $LOG = "{$USER}.log";
-
- $Stats = array(
- "daily" => array(),
- "weekly" => array()
- );
-
- list(, $min, $hour, $mday, $mon, $year, , ,) = (localtime(time()));
- $daystart = mktime(0, 0, 0, $mon, $mday, $year);
- $periodstart = $daystart - (3600 * 24 * 13); /* 2 Weeks ago */
- $dailystart = time() - (3600 * 23);
-
- /* TODO: There's an issue that the Perl timelocal returns
- * different values compared to PHP's mktime. There's a
- * difference of 2678400, which will be added manually below.
- */
- $daystart += 2678400;
- $periodstart += 2678400;
-
- if (file_exists($LOG)) {
- if ($fd = @fopen($LOG, "r")) {
- $scount = 0;
- $icount = 0;
- $wcount = 0;
- $fcount = 0;
- $mcount = 0;
-
- while(!feof($fd)) {
- $buffer = fgets($fd, 4096);
- /* drop blank lines */
- if (strlen($buffer) == 0) { continue; }
- list($t_log, $c_log) = preg_split("/\t/", $buffer);
-
- /* Only Parse Log Data in our Time Period */
- /* TODO: The below if should evaluate to true at least for some data */
- if ($t_log >= $periodstart) {
- list(, $tmin, $thour, $tday, $tmon, , , ,) = (localtime($t_log));
- $tmon++;
-
- foreach (array('weekly', 'daily') as $period) {
- $idx = 0;
- if ($period == "weekly") {
- $idx= "{$tmon}/{$tday}";
- } else {
- if ($t_log <= $dailystart) { continue; }
- $idx = To12Hour($thour);
- }
- if (is_array($Stats[$period]) && ! array_key_exists ($idx, $Stats[$period])) {
- $Stats[$period][$idx] = array(
- 'nonspam' => 0,
- 'spam' => 0,
- 'title' => $idx,
- 'idx' => $t_log);
- }
- /* TODO: Is passing by reference here correct? */
- $hr =& $Stats[$period][$idx];
- /* S => spam */
- if ($c_log== "S") {
- $hr['spam']++;
- $scount++;
- }
- /* I => innocent W => whitelisted */
- if ($c_log == "I" || $c_log == "W") {
- $hr['nonspam']++;
- if ($c_log == "I") { $icount++; }
- else { $wcount++; }
- }
- /* F => false positive */
- if ($c_log == "F") {
- $hr['spam']--;
- if ($hr['spam'] < 0) { $hr['spam'] = 0; }
- $hr['nonspam']++;
- $fcount++;
- }
- /* M => spam miss */
- if ($c_log == "M") {
- $hr['nonspam']--;
- if ($hr['nonspam'] < 0) { $hr['nonspam'] = 0; }
- $hr['spam']++;
- $mcount++;
- }
- }
- }
- }
-
- fclose($fd);
- } else {
- return $input_errors[] = "Unable to open log file: {$LOG}.";
- }
-
- usort ((array_values ($Stats[$period])), "cmpArrayValues");
-
- foreach (array('weekly', 'daily') as $period) {
- $uc_period = strtoupper($period);
- $hk = "DATA_{$uc_period}";
- $lst = array();
-
- foreach (array_values($Stats[$period]) as $hr) {
- foreach (array('spam', 'nonspam', 'title') as $type ) {
-
- if (empty($lst[$type])) {
- $lst[$type] = array();
- }
-
- /* populate (newly) created array */
- $lst[$type][] = $hr[$type];
-
- $totk="";
-
- if ($type == "spam") { $totk="S"; }
- else if ($type == "nonspam") { $totk="I"; }
-
- if ($totk == "") { continue; }
-
- $sk="T{$totk}_{$uc_period}";
- if (empty($DATA[$sk])) { $DATA[$sk] = 0; }
-
- $DATA[$sk] += $hr[$type];
- }
- } // end foreach
- $DATA[$hk] =
- @join(",",$lst['spam']) . "_" .
- @join(",",$lst['nonspam']) . "_" .
- @join(",",$lst['title']);
- } // end foreach
- } else {
- return $input_errors[] = "No historical data is available (log file »{$LOG}« does not exist).";
- } // end if
-}
-
-function cmpArrayValues($a, $b) {
- if ($a['idx'] == $b['idx'])
- return 0;
-
- return ($a['idx'] < $b['idx']) ? -1 : 1;
-}
-
-/* ========================================================================== */
-/* = P E R E F E R E N C E S F U N C T I O N S = */
-/* ========================================================================== */
-
-function &DisplayPreferences($mode = "", &$statusmsg){
- global $USER, $CURRENT_USER, $CONFIG, $DATA;
- $FILE = "{$USER}.prefs";
- $username = $CURRENT_USER;
-
- if ($_POST) {
- $pconfig = $_POST;
-
- if ($pconfig['chk_feature_nr'] <> "on") {
- $pconfig['chk_feature_nr'] = "off";
- }
-
- if ($pconfig['chk_feature_optin'] <> "on") {
- $pconfig['chk_feature_optin'] = "off";
- }
-
- if ($pconfig['chk_feature_optout'] <> "on") {
- $pconfig['chk_feature_optout'] = "off";
- }
-
- if ($pconfig['chk_feature_at'] <> "on") {
- $pconfig['chk_feature_at'] = "off";
- }
-
- if ($pconfig['chk_feature_aw'] <> "on") {
- $pconfig['chk_feature_aw'] = "off";
- }
-
- if ($CONFIG['PREFERENCES_EXTENSION'] == 1) {
- if ($pconfig['msgtag'] == "") {
- $pconfig['msgtag'] = "''";
- } else {
- $pconfig['msgtag'] = quotemeta($pconfig['msgtag']);
- }
-
- exec("{$CONFIG['DSPAM_BIN']}/dspam_admin ch pref " . quotemeta($username) .
- " trainingMode " . quotemeta($pconfig['rad_train']) . " > /dev/null");
- exec("{$CONFIG['DSPAM_BIN']}/dspam_admin ch pref " . quotemeta($username) .
- " spamAction " . quotemeta($pconfig['rad_train_action']) . " > /dev/null");
- exec("{$CONFIG['DSPAM_BIN']}/dspam_admin ch pref " . quotemeta($username) .
- " signatureLocation " . quotemeta($pconfig['signatureLocation']) . " > /dev/null");
- exec("{$CONFIG['DSPAM_BIN']}/dspam_admin ch pref " . quotemeta($username) .
- " spamSubject " . quotemeta($pconfig['msgtag']) . " > /dev/null");
- exec("{$CONFIG['DSPAM_BIN']}/dspam_admin ch pref " . quotemeta($username) .
- " statisticalSedation " . quotemeta($pconfig['rad_filter_sens']) . " > /dev/null");
- exec("{$CONFIG['DSPAM_BIN']}/dspam_admin ch pref " . quotemeta($username) .
- " enableBNR " . quotemeta($pconfig['chk_feature_nr']) . " > /dev/null");
- exec("{$CONFIG['DSPAM_BIN']}/dspam_admin ch pref " . quotemeta($username) .
- " optOut " . quotemeta($pconfig['chk_feature_optout']) . " >/dev/null");
- exec("{$CONFIG['DSPAM_BIN']}/dspam_admin ch pref " . quotemeta($username) .
- " optIn " . quotemeta($pconfig['chk_feature_optin']) . " >/dev/null");
- exec("{$CONFIG['DSPAM_BIN']}/dspam_admin ch pref " . quotemeta($username) .
- " showFactors " . quotemeta($pconfig['chk_feature_at']) . " > /dev/null");
- exec("{$CONFIG['DSPAM_BIN']}/dspam_admin ch pref " . quotemeta($username) .
- " enableWhitelist " . quotemeta($pconfig['chk_feature_aw']) . " > /dev/null");
- } else {
- $prefsstr = <<<EOD
-trainingMode={$pconfig['rad_train']}
-spamAction={$pconfig['rad_ident_action']}
-spamSubject={$pconfig['msgtag']}
-statisticalSedation={$pconfig['rad_filter_sens']}
-enableBNR={$pconfig['chk_feature_nr']}
-optIn={$pconfig['chk_feature_optin']}
-optOut={$pconfig['chk_feature_optout']}
-showFactors={$pconfig['chk_feature_at']}
-enableWhitelist={$pconfig['chk_feature_aw']}
-signatureLocation={$pconfig['rad_train_action']}
-
-EOD;
-
- if ($fd = @fopen("{$FILE}","w")) {
- fwrite($fd, $prefsstr);
- fclose($fd);
- } else {
- return $input_errors[] = "Unable to write preferences to file: {$FILE}";
- }
- }
-
- $statusmsg = "DSPAM preferences have been written to: {$FILE}.";
- }
-
- $PREFS =& GetPrefs($username);
-
- $DATA["SEDATION_{$PREFS['statisticalSedation']}"] = 'checked="checked"';
- $DATA["S_{$PREFS['trainingMode']}"] = 'checked="checked"';
- $DATA["S_ACTION_" . strtoupper($PREFS['spamAction'])] = 'checked="checked"';
- $DATA["S_LOC_" . strtoupper($PREFS['signatureLocation'])] = 'checked="checked"';
- $DATA["SPAM_SUBJECT"] = $PREFS['spamSubject'];
- if ($PREFS['optIn'] == "on") {
- $DATA['C_OPTIN'] = 'checked="checked"';
- }
- if ($PREFS['optOut'] == "on") {
- $DATA['C_OPTOUT'] = 'checked="checked"';
- }
- if ($PREFS['enableBNR'] == "on") {
- $DATA['C_BNR'] = 'checked="checked"';
- }
- if ($PREFS['showFactors'] == "on") {
- $DATA['C_FACTORS'] = 'checked="checked"';
- }
- if ($PREFS['enableWhitelist'] == "on") {
- $DATA['C_WHITELIST'] = 'checked="checked"';
- }
-}
-
-function sortByRating($a, $b){
- if ($a['rating'] == $b['rating']) {
- return 0;
- }
-
- return ($a['rating'] < $b['rating']) ? -1 : 1;
-}
-
-/* ========================================================================== */
-/* = Q U A R A N T I N E F U N C T I O N S = */
-/* ========================================================================== */
-
-function &ProcessQuarantine($signatures = array(),
- $action = "None",
- $sortBy = "Rating",
- $currentPage = 1,
- $qPerPage = 0){
- switch($action){
- case "None":
- $input_errors =& DisplayQuarantine($sortBy, $currentPage, $qPerPage);
- break;
- case "manyNotSpam":
- $input_errors =& QuarantineManyNotSpam($signatures, $sortBy, $currentPage, $qPerPage);
- break;
- case "deleteAll":
- QuarantineDeleteSpam($action, $signatures, $sortBy, $currentPage, $qPerPage);
- break;
- default:
- QuarantineDeleteSpam();
- } // switch
-
- CheckQuarantine();
-
- return $input_errors;
-}
-
-function &ProcessFalsePositive($sigID = "",
- $sortBy = "Rating",
- $currentPage = 1,
- $qPerPage = 0) {
- global $MAILBOX, $CONFIG, $TMPFILE, $CURRENT_USER;
- $buffer = array();
- $head = array();
- $singatures = array();
- $found = 0;
- $error = false;
-
- if ($sigID == "") {
- return $input_errors[] = "No Message ID Specified.";
- }
-
- /* read the user's mailbox line by line into a buffer */
- $fd = fopen("{$MAILBOX}", "r");
- while (!feof($fd)) {
- $line = chop(fgets($fd, 4096));
- array_push($buffer, $line);
- }
- fclose ($fd);
-
- /* iterate over the mailbox buffer */
- reset($buffer);
- $i = 0;
- while ($i < count($buffer)) {
- $temp = array();
- $head = array();
- $mode = 0;
- $buff = "";
-
- /* this while tries to iterate over one single mesage including
- * the message header and the message body.
- */
- while((preg_match('/^From /', $buff) == 0) && ($i < count($buffer))) {
- $buff = $buffer[0];
-
- /* switch mode if we are hitting DSPAMs
- * pseudo From QUARANTINE line (without a
- * colon after the From).
- */
- if (preg_match('/^From /', $buff) > 0) {
- if ($mode == 0) { $mode = 1; }
- else { continue; }
- }
-
- $buff = array_shift($buffer);
- if (preg_match('/^From /', $buff) == 0) {
- array_push($temp, $buff);
- }
-
- continue;
- }
-
- foreach($temp as $tempel) {
- if ($tempel == "") { break; }
- list($key, $val) = preg_split('/\: ?/', $tempel, 2);
- $head[$key] = $val;
- }
- if ($head['X-DSPAM-Signature'] == $sigID) {
- $found = 1;
- $old_erep = error_reporting(E_ALL);
- if ($pd = @popen("|{$CONFIG['DSPAM']} {$CONFIG['DSPAM_ARGS']} >{$TMPFILE} 2>&1", "w")) {
- $pdresult = fread($handle, 2096);
-
- foreach($temp as $tempel) {
- fwrite($pd, "{$tempel}\n");
- }
-
- pclose($pd);
- error_reporting($old_erep);
- } else {
- $error = true;
- $input_errors[] = "Unable to ope process pipe in function <code>ProcessFalsePositive</code>.";
- }
- }
- }
-
- /* Couldn't find the message, so just retrain on signature */
- if (!$found) {
- system("$CONFIG{'DSPAM'} --source=error --class=innocent --signature=" . quotemeta($sigID) .
- " --user " . quotemeta($CURRENT_USER));
- }
-
- if ($error) {
- $log = array();
- $fd = fopen("{$TMPFILE}", "r");
- while (!feof($handle)) {
- $log .= fgets($fd, 4096);
- }
- fclose($fd);
- unlink("{$TMPFILE}");
- return $input_errors[] = $log;
- }
-
- unlink("{$TMPFILE}");
- $signatures[$sigID] = "on";
- return QuarantineDeleteSpam("", $signatures, $sortBy, $currentPage, $qPerPage);
-}
-
-function &QuarantineManyNotSpam($signatures = array(), $sortBy = "Rating", $currentPage = 1, $qPerPage = 0){
- global $MAILBOX, $USER;
- $buffer = array();
- $errors = array();
-
- /* read the user's mailbox line by line into a buffer */
- $fd = fopen("{$MAILBOX}", "r");
- while (!feof($fd)) {
- $line = chop(fgets($fd, 4096));
- array_push($buffer, $line);
- }
- fclose ($fd);
-
- if ($fd_FILE = @fopen("{$MAILBOX}", "w")) {
- $fd_RETRAIN = fopen("{$USER}.retrain.log", "a");
-
- /* iterate over the mailbox buffer */
- reset($buffer);
- $i = 0;
- while ($i < count($buffer)) {
- $temp = array();
- $head = array();
- $mode = 0;
- $buff = "";
-
- /* this while tries to iterate over one single mesage including
- * the message header and the message body.
- */
- while((preg_match('/^From /', $buff) == 0) && ($i < count($buffer))) {
- $buff = $buffer[0];
-
- /* switch mode if we are hitting DSPAMs
- * pseudo From QUARANTINE line (without a
- * colon after the From).
- */
- if (preg_match('/^From /', $buff) > 0) {
- if ($mode == 0) {
- $mode = 1;
- $buff = array_shift($buffer);
- array_push($temp, $buff);
- $buff = "";
- continue;
- } else {
- continue;
- }
- }
-
- $buff = array_shift($buffer);
- array_push($temp, $buff);
-
- continue;
- }
-
- /* populate the header array with header fields */
- foreach($temp as $tempel) {
- if ($tempel == "") { break; }
- list($key, $val) = preg_split('/\: ?/', $tempel, 2);
- $head[$key] = $val;
- }
-
- $delivered = 0;
- if ($signatures["chkmsg-{$head['X-DSPAM-Signature']}"] <> "") {
- $err = Deliver($temp);
- if ($err == "") {
- $delivered = 1;
- } else {
- array_push($errors, $err);
- }
- }
- if (!$delivered) {
- foreach($temp as $tempel) {
- fwrite($fd_FILE, "{$tempel}\n");
- }
- } else {
- fwrite($fd_RETRAIN, strval(time()) . "\t{$head['X-DSPAM-Signature']}\tinnocent\n");
- }
-
- $i++;
- } // end while
-
- fclose($fd_FILE);
- fclose($fd_RETRAIN);
- } else {
- return $input_errors[] = "Unable to open mailbox file: {$MAILBOX}.";
- }
-
- if (count($errors) > 0) {
- return $errors;
- }
-
- return DisplayQuarantine($sortBy, $currentPage, $qPerPage);
-}
-
-function Deliver($temp = array()) {
- global $CONFIG;
-
- if (! file_exists("/tmp/dspam-error-output.txt")) {
- touch("/tmp/dspam-error-output.txt");
- }
- $descriptorspec = array(
- 0 => array("pipe", "r"), // stdin is a pipe that the child will read from
- 1 => array("pipe", "w"), // stdout is a pipe that the child will write to
- 2 => array("file", "/tmp/dspam-error-output.txt", "a") // stderr is a file to write to
- );
-
- list($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$sizeb,
- $atime,$mtimeb,$ctime,$blksize,$blocks)
- = stat("/tmp/dspam-error-output.txt");
- clearstatcache();
-
- $cwd = '/tmp';
- $process = @proc_open("{$CONFIG['DSPAM']} {$CONFIG['DSPAM_ARGS']}",
- $descriptorspec,
- $pipes);
-
- if (is_resource($process)) {
- foreach($temp as $tempel) {
- if (! @fwrite($pipes[0], "{$tempel}\n")) {
- return "error while writting to pipe.";
- }
- }
-
- fclose($pipes[0]);
- fclose($pipes[1]);
- $return_value = proc_close($process);
-
- /* this isn't an elegant solution to determine whether
- * DSPAM did report some errors, but it works for now
- */
- list($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$sizea,
- $atime,$mtimea,$ctime,$blksize,$blocks)
- = stat("/tmp/dspam-error-output.txt");
-
- if ($mtimeb <> $mtimea) { return "DSPAM did report some errors to /tmp/dspam-error-output.txt.\n" .
- "Please check this particular file."; }
- } else {
- return "process is not a resource type.";
- }
-
- return "";
-}
-
-function getLayoutedMessage($msgbuffer = "", $sigID = "", $showpart = 0, $ctype = 0){
-
- if ($msgbuffer == "") {
- return '<span class="errmsg">An error occured while parsing the message (no message).</span>';
- }
- if ($sigID == "") {
- return '<span class="errmsg">An error occured while parsing the message (no signature).</span>';
- }
-
- if( extension_loaded( 'mailparse' ) ) {
- $msgdate = "N/A";
- $msgfrom = "N/A";
- $msgsub = "N/A";
- $msgto = "N/A";
-
- $mime = mailparse_msg_create();
- mailparse_msg_parse($mime, $msgbuffer);
- /* return an array of message parts - this contsists of the
- * names of the parts only.
- */
- $struct = mailparse_msg_get_structure($mime);
- $htmlstr = <<<EOD
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="3">Message Infos</td>
- </tr>
- <tr>
- <td valign="baseline" class="vncell" colspan="1">Date:</td>
- <td class="vtable" colspan="2">%MSGDATE%</td>
- </tr>
- <tr>
- <td valign="baseline" class="vncell" colspan="1">From:</td>
- <td class="vtable" colspan="2">%MSGFROM%</td>
- </tr>
- <tr>
- <td valign="baseline" class="vncell" colspan="1">Subject:</td>
- <td class="vtable" colspan="2">%MSGSUB%</td>
- </tr>
- <tr>
- <td valign="baseline" class="vncell" colspan="1">To:</td>
- <td class="vtable" colspan="2">%MSGTO%</td>
- </tr>
- <tr>
- <td class="list" height="12" colspan="3">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic">Message Part</td>
- <td align="left" valign="top" class="listtopic">Part Type</td>
- <td align="left" valign="top" class="listtopic">Part Encoding</td>
- </tr>
- <tr>
-
-EOD;
-
- /* print a choice of sections */
- foreach($struct as $st) {
-
- /* get a handle on the message resource for a subsection */
- $section = mailparse_msg_get_part($mime, $st);
- /* get content-type, encoding and header information for that section */
- $info = mailparse_msg_get_part_data($section);
-
- /* replace placeholder with real data */
- if ($info['headers']['date'] <> "") {
- $htmlstr = str_replace("%MSGDATE%", $info['headers']['date'], $htmlstr);
- }
- if ($info['headers']['from'] <> "") {
- $htmlstr = str_replace("%MSGFROM%", $info['headers']['from'], $htmlstr);
- }
- if ($info['headers']['subject'] <> "") {
- $htmlstr = str_replace("%MSGSUB%", $info['headers']['subject'], $htmlstr);
- }
- if ($info['headers']['to'] <> "") {
- $htmlstr = str_replace("%MSGTO%", $info['headers']['to'], $htmlstr);
- }
-
- $fontStyle = "";
- if ($showpart && $showpart == $st) { $fontStyle = " style=\"font-weight: bolder;\""; }
-
- if ($info["content-type"] == "text/html") {
- $htmlstr .= "<td align=\"left\" valign=\"top\" class=\"vncell\"{$fontStyle}>" .
- "<a href=\"/dspam-viewmsg.php?ctype=1&showpart={$st}&signatureID={$sigID}&command=viewMessage\">{$st}</a>" .
- "</td>\n";
- } else {
- $htmlstr .= "<td align=\"left\" valign=\"top\" class=\"vncell\"{$fontStyle}>" .
- "<a href=\"/dspam-viewmsg.php?showpart={$st}&signatureID={$sigID}&command=viewMessage\">{$st}</a>" .
- "</td>\n";
- }
-
- $htmlstr .= <<<EOD
- <td align="left" valign="top" class="vtable"{$fontStyle}>{$info["content-type"]}</td>
- <td align="left" valign="top" class="vtable"{$fontStyle}>{$info["charset"]}</td>
- </tr>
-
-EOD;
- } // end foreach
-
- /* if we were called to display a part, do so now */
- if ($showpart) {
- /* get a handle on the message resource for the desired part */
- $sec = mailparse_msg_get_part($mime, $showpart);
-
- $htmlstr .= <<<EOD
- <tr>
- <td class="list" height="12" colspan="3">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="3">Section {$showpart}</td>
- </tr>
- <tr>
- <td align="top" valign="left" colspan="3" class="vncell">
-EOD;
-
- ob_start();
- mailparse_msg_extract_part($sec, $msgbuffer);
- $contents = ob_get_contents();
- ob_end_clean();
- $contents = wordwrap( str_replace("&gt;", "&gt;\n", $contents), 100, "\n" );
- /* quote the message for safe display in a browser */
- if ($ctype = 1) {
- /* a html email message */
- $htmlstr .= "<pre style=\"font-size: 1.4em;\">" . $contents . "</pre></td>\n</tr>\n";
- } else {
- /* an ASCII (text) email message */
- $htmlstr .= htmlentities($contents) . "</td>\n</tr>\n";
- }
- }
-
- return $htmlstr;
- } else {
- return '<span class="errmsg">Could not load mailparse extension.</span>';
- }
-}
-
-function &QuarantineViewMessage($sigID = "",
- $showpart = 0,
- $ctype = 0,
- $sortBy = "Rating",
- $currentPage = 1,
- $qPerPage = 0) {
- global $MAILBOX, $DATA;
- $buffer = array(); // mailbox buffer
-
- if ($sigID == "") {
- return $input_errors[] = "No Message ID Specified.";
- }
-
- /* save data to be displayed as HTML form data */
- $DATA['MESSAGE_ID'] = $sigID;
- $DATA['SHOWPART'] = $showpart;
- $DATA['CONTENT_TYPE'] = $ctype;
- $DATA['QPAGE'] = $currentPage;
- $DATA['SORTBY'] = $sortBy;
-
- if ($qPerPage > 0) { $CONFIG['QUARANTINE_PER_PAGE'] = $qPerPage; }
-
- /* read the user's mailbox line by line into a buffer */
- $fd = fopen("{$MAILBOX}", "r");
- while (!feof($fd)) {
- $line = chop(fgets($fd, 4096));
- array_push($buffer, $line);
- }
- fclose ($fd);
-
- /* iterate over the mailbox buffer */
- reset($buffer);
- $i = 0;
- while ($i < count($buffer)) {
- $temp = array();
- $head = array();
- $mode = 0;
- $buff = "";
-
- /* this while tries to iterate over one single mesage including
- * the message header and the message body.
- */
- while((preg_match('/^From /', $buff) == 0) && ($i < count($buffer))) {
- $buff = $buffer[0];
-
- /* switch mode if we are hitting DSPAMs
- * pseudo From QUARANTINE line (without a
- * colon after the From).
- */
- if (preg_match('/^From /', $buff) > 0) {
- if ($mode == 0) { $mode = 1; }
- else { continue; }
- }
-
- $buff = array_shift($buffer);
- if (preg_match('/^From /', $buff) == 0) {
- array_push($temp, $buff);
- }
-
- continue;
- }
-
- /* populate the header array with header fields */
- foreach($temp as $tempel) {
- if ($tempel == "") { break; }
- list($key, $val) = preg_split('/\: ?/', $tempel, 2);
- $head[$key] = $val;
- }
- if ($head['X-DSPAM-Signature'] == $sigID) {
- foreach($temp as $tempel) {
- $tempel = preg_replace("/</e", "'&lt;'", $tempel);
- $tempel = preg_replace("/>/e", "'&gt;'", $tempel);
- $DATA['MESSAGE'] .= "{$tempel}\n";
- }
- }
-
- $i ++;
- } // end while
-}
-
-function QuarantineDeleteSpam($deleteAll = "", $signatures = array(), $sortBy = "Rating", $currentPage = 1, $qPerPage = 0){
- global $USER, $MAILBOX;
- $buffer = array();
-
- /* this is the most easiest operation: If the user wants
- * to completly delete any quarantined message, simply
- * open his mailbox in write mode, which empties the
- * user's mailbox file.
- */
- if ($deleteAll <> "") {
-
- list($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
- $atime,$mtime,$ctime,$blksize,$blocks) = stat("{$USER}.mbox");
-
- $fd = fopen("{$USER}.mbox.size", "r");
- $sz = chop(fgets($fd, 4096));
- fclose($fd);
-
- if ($sz == $size) {
- $fd = fopen("{$MAILBOX}", "w");
- fclose($fd);
- unlink("{$USER}.mbox.size");
- unlink("{$USER}.mboxwarn");
- } else {
- return DisplayQuarantine($sortBy, $currentPage, $qPerPage);
- }
-
- //$FORM{'template'} = "performance";
- CheckQuarantine();
- return DisplayIndex();
- }
-
- /* iterate over the user's mailbox and store its contents in a buffer */
- $fd = fopen("{$MAILBOX}", "r");
- while (!feof($fd)) {
- $line = chop(fgets($fd, 4096));
- array_push($buffer, $line);
- }
- fclose($fd);
-
- /* open the user's mailbox in write mode. This empties the mailbox! */
- fopen("{$MAILBOX}", "w");
-
- /* iterate over the mailbox buffer */
- reset($buffer);
- $i = 0;
- while ($i < count($buffer)) {
- $temp = array();
- $head = array();
- $mode = 0;
-
- /* this while tries to iterate over one single mesage including
- * the message header and the message body.
- */
- while((preg_match('/^From /', $buff) == 0) && ($i < count($buffer))) {
- $buff = $buffer[0];
-
- /* switch mode if we are hitting DSPAMs
- * pseude From QUARANTINE line (without a
- * colon after the From).
- */
- if (preg_match('/^From /', $buff) > 0) {
- if ($mode == 0) {
- $mode = 1;
- $buff = array_shift($buffer);
- array_push($temp, $buff);
- $buff = "";
- continue;
- } else {
- continue;
- }
- }
- $buff = array_shift($buffer);
- array_push($temp, $buff);
-
- continue;
- }
-
- /* populate the header array with header fields */
- foreach($temp as $tempel) {
- if ($tempel == "") { break; }
- list($key, $val) = preg_split('/\: ?/', $tempel, 2);
- $head[$key] = $val;
- }
-
- /* if the current DSPAM signature wasn't selected by the
- * user to be deleted, write it back to the user's mailbox.
- */
- if ($signatures["chkmsg-{$head['X-DSPAM-Signature']}"] == "") {
- foreach($temp as $tempel) {
- fwrite($fd, "{$tempel}\n");
- }
- }
-
- $i++;
- } // end while
- fclose($fd);
-
- return;
-}
-
-function sortBySubject($a, $b){
- $lca = strtolower ($a['Subject']);
- $lcb = strtolower ($b['Subject']);
-
- return strcmp($lca, $lcb);
-}
-
-function sortByFrom($a, $b){
- $lca = strtolower ($a['From']);
- $lcb = strtolower ($b['From']);
-
- return strcmp($lca, $lcb);
-}
-
-function &DisplayQuarantine($sortBy = "Rating", $currentPage = 1, $qPerPage = 0) {
- global $USER, $CURRENT_USER, $CONFIG, $DATA, $MAILBOX;
- $alertcfg = &$config['installedpackages']['dspamalerts']['config'];
- $alerts = array();
-
- if (file_exists("{$USER}.mbox")) {
- list($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
- $atime,$mtime,$ctime,$blksize,$blocks) = stat("{$USER}.mbox");
-
- $fd = fopen("{$USER}.mbox.size", "w");
- fwrite($fd, "{$size}");
- fclose($fd);
-
- $fd = fopen("{$MAILBOX}.stamp", "a+");
- fclose($fd);
- chmod("{$MAILBOX}.stamp", 0660);
-
- /* process alert names */
- if (is_array($alertcfg)) {
- $alert_counter = 0;
-
- foreach ($alertcfg as $alert) {
- $alerts[$alert_counter] = $alert['alertname'];
- $alert_counter++;
- }
- }
-
- $mode = "";
- $buffer = array();
- $headings = array();
- $rowclass = "qrowEven";
- $fd = fopen("{$MAILBOX}", "r");
-
- while (!feof($fd)) {
- $mbxline = chop(fgets($fd, 4096));
-
- if ($mbxline <> "") {
- if (($mode == "")) {
- if (preg_match('/^From /', $mbxline) > 0) {
- $mode = 1;
- } else {
- continue;
- }
- }
-
- array_push($buffer, $mbxline);
- continue;
- }
-
- if ($mode == "") { continue; }
-
- $alert = 0;
- $new = array();
-
- foreach($buffer as $buf_element){
- foreach($alerts as $al){
- if (preg_match("/{$al}/i", $buf_element) > 0) {
- $alert = 1;
- }
- }
-
- if (preg_match('/^From /', $buf_element) > 0) {
- $a = split(' ', $buf_element);
- $x = 2;
-
- for ($i = 0; $i < count ($a); $i++) {
- if ((preg_match('/\@|>/', $a[$i]) > 0) && $i > $x) {
- $x = $i + 1;
- }
- }
-
- for ($i = 1; $i < $x; $i++) { array_shift($a); }
- $start = join(" ", $a);
- } else {
- list($key, $val) = preg_split('/\: ?/', $buf_element, 2);
- $new[$key] = $val;
- }
- }
-
- if ($rowclass == "qrowEven") {
- $rowclass = "qrowOdd";
- } else {
- $rowclass = "qrowEven";
- }
-
- $new['alert'] = $alert;
-
- if ($alert) { $rowclass="qrowAlert"; }
-
- $new['Sub2'] = $new['X-DSPAM-Signature'];
- if (strlen($new['Subject']) > $CONFIG['MAX_COL_LEN']) {
- $new['Subject'] = substr($new['Subject'], 0, $CONFIG['MAX_COL_LEN']) . "...";
- }
-
- if (strlen($new['From']) > $CONFIG['MAX_COL_LEN']) {
- $new['From'] = substr($new['From'], 0, $CONFIG['MAX_COL_LEN']) . "...";
- }
-
- if ($new['Subject'] == "") {
- $new['Subject'] = "<None Specified>";
- }
-
- //$new->{'rating'} = $new->{'X-DSPAM-Probability'} * $new->{'X-DSPAM-Confidence'};
- $new['rating'] = $new['X-DSPAM-Confidence'];
-
- foreach(array_keys($new) as $key) {
- if ($key == "X-DSPAM-Signature") { continue; }
- preg_replace('/</', '/\&lt\;/', $new[$key]);
- preg_replace('/>/', '/\&gt\;/', $new[$key]);
- }
-
- array_push($headings, $new);
-
- $buffer = array();
- $mode = "";
- continue;
- } // end while (!feof($fd))
-
- if (! isset($sortBy) || $sortBy == "") {
- $sortBy = $CONFIG['SORT_DEFAULT'];
- }
- if ($sortBy == "Rating") {
- usort($headings, "sortByRating");
- }
- if ($sortBy == "Subject") {
- usort($headings, "sortBySubject");
- }
- if ($sortBy == "From") {
- usort($headings, "sortByFrom");
- }
- if ($sortBy == "Date") {
- array_reverse ($headings);
- }
-
- /*
-
- <tr>
- <td align="left" valign="top" class="listtopic" width="8%">&nbsp;</td>
- <td align="left" valign="top" class="listtopic" width="5%" onclick="sortmsg('Rating');" style="cursor: pointer;">Rating</td>
- <td align="left" valign="top" class="listtopic" width="20%" onclick="sortmsg('Date');" style="cursor: pointer;">Date</td>
- <td align="left" valign="top" class="listtopic" width="25%" onclick="sortmsg('From');" style="cursor: pointer;">From</td>
- <td align="left" valign="top" class="listtopic" width="42%" onclick="sortmsg('Subject');" style="cursor: pointer;">Subject</td>
- </tr>
-
- */
-
- $DATA['SORTBY'] = $sortBy;
- $DATA['SORT_SELECTOR'] .= <<<EOD
- <tr>
- <td align="left" valign="top" class="listtopic" width="10%">&nbsp;</td>
-
-EOD;
-
- if ($sortBy == "Rating") {
- $DATA{'SORT_SELECTOR'} .= "<td align=\"left\" valign=\"top\" class=\"listtopic\" width=\"5%\" onclick=\"sortmsg('Rating');\" style=\"cursor: pointer;\">Rating&nbsp;&nbsp;&loz;</td>";
- } else {
- $DATA{'SORT_SELECTOR'} .= "<td align=\"left\" valign=\"top\" class=\"listtopic\" width=\"5%\" onclick=\"sortmsg('Rating');\" style=\"cursor: pointer;\">Rating</td>";
- }
- if ($sortBy == "Date") {
- $DATA{'SORT_SELECTOR'} .= "<td align=\"left\" valign=\"top\" class=\"listtopic\" width=\"20%\" onclick=\"sortmsg('Date');\" style=\"cursor: pointer;\">Date&nbsp;&nbsp;&loz;</td>";
- } else {
- $DATA{'SORT_SELECTOR'} .= "<td align=\"left\" valign=\"top\" class=\"listtopic\" width=\"20%\" onclick=\"sortmsg('Date');\" style=\"cursor: pointer;\">Date</td>";
- }
- if ($sortBy == "Subject") {
- $DATA{'SORT_SELECTOR'} .= "<td align=\"left\" valign=\"top\" class=\"listtopic\" width=\"40%\" onclick=\"sortmsg('Subject');\" style=\"cursor: pointer;\">Subject&nbsp;&nbsp;&loz;</td>";
- } else {
- $DATA{'SORT_SELECTOR'} .= "<td align=\"left\" valign=\"top\" class=\"listtopic\" width=\"40%\" onclick=\"sortmsg('Subject');\" style=\"cursor: pointer;\">Subject</td>";
- }
- if ($sortBy == "From") {
- $DATA{'SORT_SELECTOR'} .= "<td align=\"left\" valign=\"top\" class=\"listtopic\" width=\"25%\" onclick=\"sortmsg('From');\" style=\"cursor: pointer;\">From&nbsp;&nbsp;&loz;</td>";
- } else {
- $DATA{'SORT_SELECTOR'} .= "<td align=\"left\" valign=\"top\" class=\"listtopic\" width=\"25%\" onclick=\"sortmsg('From');\" style=\"cursor: pointer;\">From</td>";
- }
-
- $DATA{'SORT_SELECTOR'} .= "\n </tr>";
-
- if (isset($qPerPage) && $qPerPage > 0) {
- $CONFIG['QUARANTINE_PER_PAGE'] = $qPerPage;
- }
-
- if (isset($currentPage) && isset($CONFIG['QUARANTINE_PER_PAGE'])) {
- $pages = ceil( (count ($headings) / $CONFIG['QUARANTINE_PER_PAGE']) );
- $begin = (($currentPage - 1) * $CONFIG['QUARANTINE_PER_PAGE']);
- $ranges = ceil ($pages / $CONFIG['QNAV_BUTTONS']);
-
- /* Now lets just keep the information that we really need. */
- $headings = array_splice ($headings, $begin, $CONFIG['QUARANTINE_PER_PAGE']);
- }
-
- $rowclass = "qrowEven";
- foreach ($headings as $row) {
- $rating = sprintf("%3.0f%%", $row['rating'] * 100.0);
- if ($row['rating'] > 0.8) {
- $markclass = "high";
- } else {
- if ($row['rating'] < 0.7) {
- $markclass = "low";
- } else {
- $markclass = "medium";
- }
- }
-
- $PAIRS = array();
-
- $PAIRS['signatureID'] = $row['X-DSPAM-Signature'];
- $PAIRS['command'] = "viewMessage";
- $PAIRS['user'] = $CURRENT_USER;
- $PAIRS['page'] = $currentPage;
- $PAIRS['sortby'] = $sortBy;
- $PAIRS['qperpage'] = $CONFIG['QUARANTINE_PER_PAGE'];
- // $PAIRS['template'] = "quarantine";
-
- $url = SafeVars($PAIRS);
- $sender = htmlentities ($row['From']);
- $rsubject = htmlentities ($row['Subject']);
-
- if ($row['alert']) {
- $outclass = "qrowAlert";
- } else {
- $outclass = $rowclass;
- }
-
- $ptfields = preg_split('/\s+/', $row['X-DSPAM-Processed']);
- $times = preg_split('/\:/', $ptfields[3]);
- $ptime = "";
- if($CONFIG["DATE_FORMAT"]) {
- $month = array();
- $month['Jan'] = 0;
- $month['Feb'] = 1;
- $month['Mar'] = 2;
- $month['Apr'] = 3;
- $month['May'] = 4;
- $month['Jun'] = 5;
- $month['Jul'] = 6;
- $month['Aug'] = 7;
- $month['Sep'] = 8;
- $month['Oct'] = 9;
- $month['Nov'] = 10;
- $month['Dec'] = 11;
- $ptime = strftime($CONFIG["DATE_FORMAT"],
- mktime($times[2],
- $times[1],
- $times[0],
- $ptfields[2],
- $month[$ptfields[1]],
- $ptfields[4] - 1900));
- } else {
- $mer = "a";
- if ($times[0] > 12) { $times[0] -= 12; $mer = "p"; }
- if ($times[0] == 0) { $times[0] = "12"; }
- $ptime = "{$ptfields[1]} {$ptfields[2]} {$times[0]}:{$times[1]}{$mer}";
- }
-
- /*
-
- <tr>
- <td align="left" valign="top" class="vncell">
- <input type="checkbox" class="formfld" title="check" alt="check" name="chkmsg" id="" />
- </td>
- <td align="left" valign="top" class="vncell">
- <span style="color: darkblue; font-weight: bold;">50%</span>
- </td>
- <td align="left" valign="top" class="vncell">Apr 1 05:59a</td>
- <td align="left" valign="top" class="vncell">Mar 30 11:08a</td>
- <td align="left" valign="top" class="vncell">
- <u>Last chance to register for Frankfurt, 4 April BEA...</u>
- </td>
- </tr>
-
- <tr>
- <td align="left" valign="top" class="{$outclass}" nowrap="true">
- <input type="checkbox" class="formfld" title="check" alt="check" name="{$row['X-DSPAM-Signature']}" id="{$row['X-DSPAM-Signature']}" />
- </td>
- <td align="left" valign="top" class="{$outclass} {$markclass}" nowrap="true">
- {$rating}
- </td>
- <td align="left" valign="top" class="{$outclass}" nowrap="true">{$ptime}</td>
- <td align="left" valign="top" class="{$outclass}" nowrap="true">{$row['From']}</td>
- <td align="left" valign="top" class="{$outclass}" nowrap="true">
- <a href="{$CONFIG['ME']}?{$url}">{$row['Subject']}</a>
- </td>
- </tr>
- */
-
- $DATA['QUARANTINE'] .= <<<EOD
- <tr>
- <td align="left" valign="top" class="{$outclass}" nowrap="true">
- <input type="checkbox" class="formfld" title="check" alt="check" name="chkmsg-{$row['X-DSPAM-Signature']}" id="{$row['X-DSPAM-Signature']}" />
- </td>
- <td align="left" valign="top" class="{$outclass} {$markclass}" nowrap="true">
- {$rating}
- </td>
- <td align="left" valign="top" class="{$outclass}" nowrap="true">{$ptime}</td>
- <td align="left" valign="top" class="{$outclass}" nowrap="true">{$sender}</td>
- <td align="left" valign="top" class="{$outclass}" nowrap="true">
- <a href="/dspam-viewmsg.php?{$url}">{$rsubject}</a>
- </td>
- </tr>
-
-EOD;
-
- if ($rowclass == "qrowEven") {
- $rowclass = "qrowOdd";
- } else {
- $rowclass = "qrowEven";
- }
- } // end foreach ($headings as $row)
-
- /* prepare quarantine navbar */
- if (($currentPage - 1) >= 1) { $previousPage = $currentPage - 1; }
- else { $previousPage = 1; }
-
- if (($currentPage + 1) <= $pages) { $nextPage = $currentPage + 1; }
- else { $nextPage = $pages; }
-
- $quarantineFooterBegin = <<<EOD
- <tr>
- <td align="left" valign="top" class="listtopic">
- <input type="checkbox" class="formfld" title="check all" alt="check all" name="checkall" id="checkall" onClick="checkallmsgs();" />
- <label for="checkall">All</label>
- </td>
- <td align="right" valign="middle" class="listtopic" colspan="4">
- <span class="qnavbtn" onmouseover="this.style.backgroundColor='#A5B9E1;'" onmouseout="this.style.backgroundColor='#507DCD;'" title="First Page (1)"><a href="/dspam-quarantine.php?page=1&qperpage={$CONFIG['QUARANTINE_PER_PAGE']}" title="First Page (1)">|&lt;</a></span>&nbsp;
- <span class="qnavbtn" onmouseover="this.style.backgroundColor='#A5B9E1;'" onmouseout="this.style.backgroundColor='#507DCD;'" title="Page {$previousPage}"><a href="/dspam-quarantine.php?page={$previousPage}&qperpage={$CONFIG['QUARANTINE_PER_PAGE']}" title="Page {$previousPage}">&lt;</a></span>&nbsp;
-
-EOD;
-
- $quarantineFooterEnd = <<<EOD
- <span class="qnavbtn" onmouseover="this.style.backgroundColor='#A5B9E1;'" onmouseout="this.style.backgroundColor='#507DCD;'" title="Page {$nextPage}"><a href="/dspam-quarantine.php?page={$nextPage}&qperpage={$CONFIG['QUARANTINE_PER_PAGE']}" title="Page {$nextPage}">&gt;</a></span>&nbsp;
- <span class="qnavbtn" onmouseover="this.style.backgroundColor='#A5B9E1;'" onmouseout="this.style.backgroundColor='#507DCD;'" title="Last Page ({$pages})"><a href="/dspam-quarantine.php?page={$pages}&qperpage={$CONFIG['QUARANTINE_PER_PAGE']}" title="Last Page ({$pages})">&gt;|</a></span>
- </td>
- </tr>
-
-EOD;
-
- $ranges_array = array();
- $rpages = $pages;
- for ($i = 0; $i < $ranges; $i++) {
- $range = array();
- $range['start'] = (($i + 1)* $CONFIG['QNAV_BUTTONS']) - ($CONFIG['QNAV_BUTTONS'] - 1);
-
- if (($i + 1) == $ranges) {
- $range['end'] = ($range['start'] + $rpages) - 1;
- } else {
- $range['end'] = (($i + 1)* $CONFIG['QNAV_BUTTONS']);
- $rpages -= $CONFIG['QNAV_BUTTONS'];
- }
-
- $ranges_array[$i] = $range;
- }
-
- /* generate nav buttons */
- foreach($ranges_array as $range){
- if ($currentPage >= $range['start'] && $currentPage <= $range['end']) {
- for ($i = $range['start']; ; $i++) {
- if ($i > $range['end']) {
- break;
- } else {
- if ($i == $currentPage) {
- $quarantineFooter .= "<span class=\"qnavbtnhl\">{$i}</span>&nbsp\n";
- } else {
- $quarantineFooter .= "<span class=\"qnavbtn\" onmouseover=\"this.style.backgroundColor='#A5B9E1;'\" onmouseout=\"this.style.backgroundColor='#507DCD;'\" title=\"Page {$i}\"><a href=\"/dspam-quarantine.php?page={$i}&qperpage={$CONFIG['QUARANTINE_PER_PAGE']}\" title=\"Page {$i}\">{$i}</a></span>&nbsp\n";
- }
- }
- }
- }
- }
-
- $DATA['QUARANTINE_FOOTER'] = $quarantineFooterBegin . $quarantineFooter .$quarantineFooterEnd;
- $DATA['QPAGES'] = $pages;
- $DATA['QPAGE'] = $currentPage;
- } else {
- $input_errors[] = "Unable to open DSPAM quarantine mailbox at »{$USER}.mbox«. " .
- "If you are a DSPAM admin user you can savely " .
- "ignore this error because such users usually do not " .
- "have a DSPAM mailbox/quarantine.";
- }
-
- return $input_errors;
-}
-
-/* ========================================================================== */
-/* = P E R F O R M A N C E F U N C T I O N S = */
-/* ========================================================================== */
-
-function ResetStats() {
- global $USER;
-
- $fd = fopen("{$USER}.stats", "r");
- $ts = chop(fgets($fd, 4096));
- $group = chop(fgets($fd, 4096));
- fclose($fd);
- list($ts, $ti, $tm, $fp, $sc, $ic) = split(",", $ts);
-
- if ($group <> "") {
- $GROUP = GetPath($group) . ".stats";
- $fd = fopen("{$GROUP}", "r");
- $gts = chop(fgets($fd, 4096));
- fclose($fd);
- list ($gts, $gti, $gtm, $gfp, $gsc, $gic) = split(",", $gts);
- $ts -= $gts;
- $ti -= $gti;
- $tm -= $gtm;
- $fp -= $gfp;
- $sc -= $gsc;
- $ic -= $gic;
- }
-
- $fd = fopen("{$USER}.rstats", "w");
- fputs($fd, "{$ts}" . "," . "{$ti}" . "," . "{$tm}" . "," .
- "{$fp}" . "," . "{$sc}" . "," . "{$ic}\n");
- fclose($fd);
-}
-
-function Tweak() {
- global $USER;
-
- $fd = fopen("{$USER}.rstats", "r");
- $ts = chop(fgets($fd, 4096));
- $group = chop($fgets($fd, 4096));
- fclose($fd);
- list($ts, $ti, $tm, $fp, $sc, $ic) = split(",", $ts);
- $tm++;
-
- $fd = fopen("{$USER}.rstats", "w");
- fputs($fd, "{$ts},{$ti},{$tm},{$fp},{$sc},{$ic}\n");
- fclose($fd);
-}
-
-function &DisplayIndex() {
- global $USER, $CONFIG, $DATA, $CURRENT_STORE, $CURRENT_USER;
-
- if (strpos ($CURRENT_USER, "@") === false) {
- if (GetDomain($CURRENT_STORE) <> "")
- $domain = GetDomain($CURRENT_STORE);
- else
- $domain = $config['system']['domain'];
-
- $spamalias = "spam-{$CURRENT_USER}@{$domain}";
- } else {
- $spamalias = "spam-{$CURRENT_USER}";
- }
-
- if ($handle = @fopen ("{$USER}.stats", "r")) {
- $spam .= chop(fgets($handle, 4096));
- $group .= chop(fgets($handle, 4096));
- fclose($handle);
- list($spam, $innocent, $misses, $fp, $sc, $ic) = split(",", $spam);
-
- if ($group <> "") {
- $GROUP = GetPath($group) . ".stats";
- $fd = fopen("{$GROUP}", "r");
- $gspam = chop(fgets($fd, 4096));
- fclose($fd);
-
- list($gspam, $ginnocent, $gfp, $gmisses, $gsc, $gic) = preg_split('/\,/', $gspam);
- $spam -= $gspam;
- $innocent -= $ginnocent;
- $misses -= $gmisses;
- $fp -= $gfp;
- $sc -= $gsc;
- $ic -= $gic;
- }
-
- if ($spam + $innocent > 0) {
- $ratio = sprintf("%2.3f",
- (($spam+$misses)/($spam+$misses+$fp+$innocent)*100));
- } else {
- $ratio = 0;
- }
-
- if (file_exists("{$USER}.rstats")) {
- $handle = fopen ("{$USER}.rstats", "r");
- $buffer = chop(fgets($handle, 4096));
-
- fclose ($handle);
-
- list($rts, $rti, $rtm, $rfp) = split(",", $buffer);
-
- $real_missed = $misses - $rtm;
- $real_caught = $spam - $rts;
- $real_fp = $fp - $rfp;
-
- if ($real_fp < 0) { $real_fp = 0; }
-
- $real_innocent = $innocent - $rti;
-
- if (($spam - $rts > 0) && ($spam - $rts + $misses - $rtm != 0) &&
- ($real_caught + $real_missed > 0) && ($real_fp + $real_innocent > 0)) {
- $monthly = sprintf("%2.3f",
- (100.0-(($real_missed)/($real_caught+$real_missed))*100.0));
- $overall = sprintf("%2.3f",
- (100-((($real_missed+$real_fp) /
- ($real_fp+$real_innocent+$real_caught+$real_missed))*100)));
- } else {
- if ($real_caught == 0 && $real_missed > 0) {
- $monthly = 0;
- $overall = 0;
- } else {
- $monthly = 100;
- $overall = 100;
- }
- }
-
- if ($real_fp + $real_innocent > 0) {
- $fpratio = sprintf("%2.3f", ($real_fp/($real_fp+$real_innocent)*100));
- } else {
- $fpratio = 0;
- }
-
- } else {
- $rts = $spam + $misses;
- $rti = $innocent;
- $rtm = $misses;
- $rfp = $fp;
-
- $handle = fopen ("{$USER}.rstats", "w");
- fwrite("{$rts},{$rti},{$rtm},{$rfp}\n");
- fclose($handle);
-
- $monthly = "N/A";
- $fpratio = "N/A";
- $overall = "N/A";
- }
-
- $DATA['TIME'] = $time;
- $DATA['TOTAL_SPAM_SCANNED'] = $spam;
- $DATA['TOTAL_SPAM_LEARNED'] = $misses;
- $DATA['TOTAL_NONSPAM_SCANNED'] = $innocent;
- $DATA['TOTAL_NONSPAM_LEARNED'] = $fp;
- $DATA['SPAM_RATIO'] = $ratio;
- $DATA['SPAM_ACCURACY'] = $monthly;
- $DATA['NONSPAM_ERROR_RATE'] = $fpratio;
- $DATA['OVERALL_ACCURACY'] = $overall;
- $DATA['TOTAL_SPAM_CORPUSFED'] = $sc;
- $DATA['TOTAL_NONSPAM_CORPUSFED'] = $ic;
- $DATA['TOTAL_SPAM_MISSED'] = $real_missed;
- $DATA['TOTAL_SPAM_CAUGHT'] = $real_caught;
- $DATA['TOTAL_NONSPAM_MISSED'] = $real_fp;
- $DATA['TOTAL_NONSPAM_CAUGHT'] = $real_innocent;
- $DATA['SPAM_ALIAS'] = $spamalias;
-
- $DATA['LOCAL_DOMAIN'] = $CONFIG['LOCAL_DOMAIN'];
- } else {
- $DATA['SPAM_ACCURACY'] = "N/A";
- $DATA['NONSPAM_ERROR_RATE'] = "N/A";
- $DATA['OVERALL_ACCURACY'] = "N/A";
- $DATA['SPAM_RATIO'] = "N/A";
- $DATA['TOTAL_SPAM_MISSED'] = 0;
- $DATA['TOTAL_SPAM_CAUGHT'] = 0;
- $DATA['SPAM_RATIO'] = "N/A";
- $DATA['TOTAL_NONSPAM_MISSED'] = 0;
- $DATA['TOTAL_NONSPAM_CAUGHT'] = 0;
- $DATA['NONSPAM_ERROR_RATE'] = "N/A";
- $DATA['TOTAL_SPAM_LEARNED'] = 0;
- $DATA['TOTAL_SPAM_SCANNED'] = 0;
- $DATA['TOTAL_NONSPAM_LEARNED'] = 0;
- $DATA['TOTAL_NONSPAM_SCANNED'] = 0;
- $DATA['TOTAL_SPAM_CORPUSFED'] = 0;
- $DATA['TOTAL_NONSPAM_CORPUSFED'] = 0;
- $DATA['SPAM_ALIAS'] = $spamalias;
-
- $input_errors[] = "Unable to open DSPAM stats at »{$USER}.stats«. " .
- "If you are a DSPAM admin user you can savely " .
- "ignore this error because such users usually do not " .
- "have a DSPAM mailbox/quarantine.";
- }
-
- return $input_errors;
-}
-
-function getJScriptFunction($whichOne = 0) {
- $changeuser_msg = gettext("Do you realy want to change the current user?") . "\\n" .
- gettext("This requires a logout followed by a login.");
-
- switch ($whichOne) {
- case 0:
- $scriptstr = '
-
- /* applicable for almost any dspam related page */
- function changeuser() {
- check = confirm("' . $changeuser_msg . '");
-
- if (check == true)
- window.location.href = "/index.php?logout=true";
- }
- ';
-
- break;
- case 1:
- $scriptstr = '
-
- /* applicable for dspam-quarantine.php */
- function checkallmsgs(enable) {
- var endis = (document.iform.checkall.checked || enable);
- var elem = document.iform.elements.length;
-
- for (i = 0; i < elem; i++) {
- if (document.iform.elements[i].name.indexOf("chkmsg") >= 0) {
- document.iform.elements[i].checked = endis;
- }
- }
- }
- ';
-
- break;
- case 2:
- $scriptstr = '
-
- /* applicable for dspam-quarantine.php */
- function sortmsg(criterion) {
- var baseURL = "/dspam-quarantine.php?page=" + document.iform.qpage.value;
- var qperpage = document.getElementsByName("qperpage")[0].value;
-
- window.location.href = baseURL + "&qperpage=" + qperpage + "&sortby=" + criterion;
- }
- ';
-
- break;
- case 3:
- $scriptstr = '
-
- /* applicable for dspam-quarantine.php */
- function processmsg(what) {
- var elem = document.iform.elements.length;
- var checked = false;
-
- switch (what) {
- case 0:
- for (i = 0; i < elem; i++) {
- if (document.iform.elements[i].name.indexOf("chkmsg") >= 0 &&
- document.iform.elements[i].checked == true) {
- checked = true;
- break;
- }
- }
-
- if (checked) {
- document.iform.processAction.value = "manyNotSpam";
- } else {
- alert("You did not select any message that should be processed as not beeing Spam.");
- return false;
- }
- break;
- case 1:
- for (i = 0; i < elem; i++) {
- if (document.iform.elements[i].name.indexOf("chkmsg") >= 0 &&
- document.iform.elements[i].checked == true) {
- checked = true;
- break;
- }
- }
-
- if (checked) {
- if (confirm("Are you sure you want to delete SELECTED messages in quarantine?") == false) {
- return false;
- } else {
- document.iform.processAction.value = "manySpam";
- }
- } else {
- alert("You did not select any message that should be processed as beeing Spam.");
- return false;
- }
- break;
- case 2:
- if (confirm("Are you sure you want to delete ALL messages in quarantine?") == false) {
- return false;
- } else {
- document.iform.processAction.value = "deleteAll";
- }
- break;
- }
-
- document.iform.submit();
- }
- ';
-
- break;
- case 4:
- $scriptstr = '
-
- /* applicable for dspam-quarantine.php nad dspam-history.php */
- function changeQPerPage(originator) {
- var elementName = "";
- var baseURL = "";
-
- if (originator.name == "qperpage") {
- baseURL = "/dspam-quarantine.php?page=" + document.iform.qpage.value;
- elementName = "qperpage";
- } else {
- baseURL = "/dspam-history.php?page=" + document.iform.hpage.value;
- elementName = "hperpage";
- }
-
- for (var i = 0; i < 2; i++) {
- document.getElementsByName(elementName)[i].value = originator.value;
- }
-
- if (originator.name == "qperpage")
- window.location.href = baseURL + "&qperpage=" + originator.value;
- else
- window.location.href = baseURL + "&hperpage=" + originator.value;
- }
- ';
-
- break;
- case 5:
- $scriptstr = '
-
- /* applicable for dspam-settings.php */
-
- function fadeTableRow(rowid, fadeType, opts){
- if(!opts){
- opts = {};
- }
-
- var row = $(rowid);
- var cells= row.childNodes;
- for(i=0;i<cells.length;i++){
- if(cells[i].tagName == "TD"){
- if (fadeType == 0)
- new Effect.Fade(cells[i],opts);
- else
- new Effect.Appear(cells[i],opts);
- }
- }
- if (fadeType == 0)
- new Effect.Fade(row,opts);
- else
- new Effect.Appear(row,opts);
- }
-
- function toggleDSPAMDomain(enable_over, originator) {
- var endis = !(originator.checked || enable_over);
-
- if (endis) {
- fadeTableRow("emailnotitb", 1);
- } else {
- fadeTableRow("emailnotitb", 0);
- }
- }
-
- function toggleDBSettings(idx) {
- if (idx)
- idx = idx;
- else
- idx = document.iform.sdriver.selectedIndex;
-
- switch (idx) {
- case 0:
- fadeTableRow("DBmysql", 1);
- fadeTableRow("DBsqlite", 0);
- fadeTableRow("DBbdb", 0);
- fadeTableRow("DBpgsql", 0);
- fadeTableRow("DBoracle", 0);
- fadeTableRow("DBhash", 0);
- break;
- case 1:
- fadeTableRow("DBmysql", 0);
- fadeTableRow("DBsqlite", 1);
- fadeTableRow("DBbdb", 0);
- fadeTableRow("DBpgsql", 0);
- fadeTableRow("DBoracle", 0);
- fadeTableRow("DBhash", 0);
- break;
- case 2:
- fadeTableRow("DBmysql", 0);
- fadeTableRow("DBsqlite", 0);
- fadeTableRow("DBbdb", 1);
- fadeTableRow("DBpgsql", 0);
- fadeTableRow("DBoracle", 0);
- fadeTableRow("DBhash", 0);
- break;
- case 3:
- fadeTableRow("DBmysql", 0);
- fadeTableRow("DBsqlite", 0);
- fadeTableRow("DBbdb", 0);
- fadeTableRow("DBpgsql", 1);
- fadeTableRow("DBoracle", 0);
- fadeTableRow("DBhash", 0);
- break;
- case 4:
- fadeTableRow("DBmysql", 0);
- fadeTableRow("DBsqlite", 0);
- fadeTableRow("DBbdb", 0);
- fadeTableRow("DBpgsql", 0);
- fadeTableRow("DBoracle", 1);
- fadeTableRow("DBhash", 0);
- break;
- case 5:
- fadeTableRow("DBmysql", 0);
- fadeTableRow("DBsqlite", 0);
- fadeTableRow("DBbdb", 0);
- fadeTableRow("DBpgsql", 0);
- fadeTableRow("DBoracle", 0);
- fadeTableRow("DBhash", 1);
- break;
- }
- }
-
- function enable_change(enable_over, originator) {
- var endis;
-
- switch (originator) {
- case 0:
- endis = !(document.iform.enabledbg.checked || enable_over);
- endis ? document.iform.debug.style.backgroundColor = "#D4D0C8" : document.iform.debug.style.backgroundColor = "#FFFFFF";
- document.iform.debug.disabled = endis;
- endis ? document.iform.dopt.style.backgroundColor = "#D4D0C8" : document.iform.dopt.style.backgroundColor = "#FFFFFF";
- document.iform.dopt.disabled = endis;
- case 1:
- endis = !(document.iform.enableldap.checked || enable_over);
- document.iform.ldapmode.disabled = endis;
- endis ? document.iform.ldaphost.style.backgroundColor = "#D4D0C8" : document.iform.ldaphost.style.backgroundColor = "#FFFFFF";
- document.iform.ldaphost.disabled = endis;
- endis ? document.iform.ldapfilter.style.backgroundColor = "#D4D0C8" : document.iform.ldapfilter.style.backgroundColor = "#FFFFFF";
- document.iform.ldapfilter.disabled = endis;
- endis ? document.iform.ldapbase.style.backgroundColor = "#D4D0C8" : document.iform.ldapbase.style.backgroundColor = "#FFFFFF";
- document.iform.ldapbase.disabled = endis;
- case 2:
- endis = !(document.iform.enablesbl.checked || enable_over);
- endis ? document.iform.sblhost.style.backgroundColor = "#D4D0C8" : document.iform.sblhost.style.backgroundColor = "#FFFFFF";
- document.iform.sblhost.disabled = endis;
- case 3:
- endis = !(document.iform.enableclam.checked || enable_over);
- endis ? document.iform.clamport.style.backgroundColor = "#D4D0C8" : document.iform.clamport.style.backgroundColor = "#FFFFFF";
- document.iform.clamport.disabled = endis;
- endis ? document.iform.clamhost.style.backgroundColor = "#D4D0C8" : document.iform.clamhost.style.backgroundColor = "#FFFFFF";
- document.iform.clamhost.disabled = endis;
- document.iform.clamresp.disabled = endis;
- case 4:
- endis = !(document.iform.enabledsclient.checked || enable_over);
- endis ? document.iform.dsclhost.style.backgroundColor = "#D4D0C8" : document.iform.dsclhost.style.backgroundColor = "#FFFFFF";
- document.iform.dsclhost.disabled = endis;
- endis ? document.iform.dsclport.style.backgroundColor = "#D4D0C8" : document.iform.dsclport.style.backgroundColor = "#FFFFFF";
- document.iform.dsclport.disabled = endis;
- endis ? document.iform.dsclident.style.backgroundColor = "#D4D0C8" : document.iform.dsclident.style.backgroundColor = "#FFFFFF";
- document.iform.dsclident.disabled = endis;
- case 5:
- endis = !(document.iform.tcpipdel.checked || enable_over);
- endis ? document.iform.dhost.style.backgroundColor = "#D4D0C8" : document.iform.dhost.style.backgroundColor = "#FFFFFF";
- document.iform.dhost.disabled = endis;
- endis ? document.iform.dport.style.backgroundColor = "#D4D0C8" : document.iform.dport.style.backgroundColor = "#FFFFFF";
- document.iform.dport.disabled = endis;
- endis ? document.iform.dident.style.backgroundColor = "#D4D0C8" : document.iform.dident.style.backgroundColor = "#FFFFFF";
- document.iform.dident.disabled = endis;
- document.iform.delproto.disabled = endis;
- case 6:
- endis = !(document.iform.enablenoti.checked || enable_over);
- document.iform.whichdomain.disabled = endis;
- endis ? document.iform.dspamdomain.style.backgroundColor = "#D4D0C8" : document.iform.dspamdomain.style.backgroundColor = "#FFFFFF";
- document.iform.dspamdomain.disabled = endis;
- endis ? document.iform.dspamcontact.style.backgroundColor = "#D4D0C8" : document.iform.dspamcontact.style.backgroundColor = "#FFFFFF";
- document.iform.dspamcontact.disabled = endis;
- }
- }
- ';
-
- break;
- case 6:
- $scriptstr = '
-
- function checkDisabledState(form) {
- for (i = 0; i < form.elements.length; i++) {
- if (form.elements[i].disabled && form.elements[i].type == "text")
- form.elements[i].style.backgroundColor = "#D4D0C8";
- else if (form.elements[i].type == "text")
- form.elements[i].style.backgroundColor = "#FFFFFF";
- }
- }
- ';
-
- break;
- }
-
- return $scriptstr;
-}
-
-?>
diff --git a/config/archive/dspam/pkg/dspam-pkgfunc.inc b/config/archive/dspam/pkg/dspam-pkgfunc.inc
deleted file mode 100644
index 31a7fa06..00000000
--- a/config/archive/dspam/pkg/dspam-pkgfunc.inc
+++ /dev/null
@@ -1,548 +0,0 @@
-<?php
-/* $Id$ */
-/* Copyright (C) 2006 Daniel S. Haischt */
-require_once("functions.inc");
-require_once("dspam.inc");
-
-function sync_package_dspam() {
- global $config, $g;
- conf_mount_rw();
- config_lock();
- $fd = fopen("/etc/dspam.conf","w");
-
- $dspamcfg = <<<EOD
-## dspam.conf -- DSPAM configuration file
-## Generated by pfSense
-Home /var/db/dspam
-## Database Settings
-StorageDriver /usr/local/lib/libmysql_drv.so
-MySQLServer /tmp/mysql.sock
-MySQLPort
-MySQLUser dspam
-MySQLPass dspam
-MySQLDb dspam
-MySQLCompress true
-MySQLSupressQuote off
-MySQLConnectionCache 10
-MySQLUIDInSignature on
-## Delivery Settings
-TrustedDeliveryAgent "/usr/bin/mail"
-DeliveryHost 192.168.1.6
-DeliveryPort 24
-DeliveryIdent localhost
-DeliveryProto smtp
-OnFail error
-## DSPAM Privileges
-Trust root
-Trust mail
-Trust mailnull
-Trust smmsp
-Trust daemon
-## DSPAM Engine Settings
-TrainingMode teft
-TestConditionalTraining on
-Feature chained
-Feature whitelist
-Algorithm graham burton
-PValue graham
-ImprobabilityDrive on
-Preference "spamAction=quarantine"
-Preference "signatureLocation=message"
-Preference "showFactors=on"
-AllowOverride trainingMode
-AllowOverride spamAction spamSubject
-AllowOverride statisticalSedation
-AllowOverride enableBNR
-AllowOverride enableWhitelist
-AllowOverride signatureLocation
-AllowOverride showFactors
-AllowOverride optIn optOut
-AllowOverride whitelistThreshold
-## Miscellaneous Settings
-FailoverAttempts 1
-IgnoreHeader X-Spam-Scanned
-IgnoreHeader X-Spam-Status
-IgnoreHeader X-Virus-Scanner-Result
-RBLInoculate on
-Notifications on
-## Maintainance Settings
-PurgeSignatures 14
-PurgeNeutral 90
-PurgeUnused 90
-PurgeHapaxes 30
-PurgeHits1S 15
-PurgeHits1I 15
-## System Settings
-LocalMX 127.0.0.1
-SystemLog on
-UserLog on
-Opt out
-ParseToHeaders on
-ChangeModeOnParse on
-ChangeUserOnParse on
-Broken returnCodes
-Broken case
-Broken lineStripping
-MaxMessageSize 307200
-ProcessorBias on
-## ClamAV Engine Settings
-ClamAVPort 3310
-ClamAVHost 127.0.0.1
-ClamAVResponse accept
-## DSPAM Daemon Settings (Server)
-ServerPort 24
-ServerQueueSize 32
-ServerPID /var/run/dspam/dspam.pid
-ServerMode standard
-ServerParameters "--deliver=innocent -d %u"
-ServerIdent "abysseleven.abyssworld.de"
-ServerDomainSocketPath "/var/run/dspam/dspam.sock"
-## EOF
-
-EOD;
-
- /* flush the default config to the file */
- fwrite($fd, $dspamcfg);
- fclose($fd);
-
- $fd = fopen("/usr/local/bin/dspam_spamfeed","w");
-
- $spamfeed = <<<EOD
-#!/bin/sh
-#
-# automatically generated by pfSense
-
-cat \${2} | dspam --mode=teft --source=corpus --class=spam --feature=chained,noise --user \${1}
-
-EOD;
-
- fwrite($fd, $spamfeed);
- fclose($fd);
- mwexec("chmod a+x /usr/local/bin/dspam_spamfeed");
-
- $fd = fopen("/usr/local/bin/dspam_innocentfeed","w");
-
- $innocentfeed = <<<EOD
-#!/bin/sh
-#
-# automatically generated by pfSense
-
-cat \${2} | dspam --mode=teft --source=corpus --class=innocent --feature=chained,noise --user \${1}
-
-EOD;
-
- fwrite($fd, $innocentfeed);
- fclose($fd);
- mwexec("chmod a+x /usr/local/bin/dspam_innocentfeed");
-
- $start = <<<EOD
-test_dspam_user=`cat /etc/passwd | grep dspam`
-test_dspam_db=`mysql information_schema -e "select schema_name from schemata" | grep dspam`
-test_dspam_db_user=`mysql mysql -e "select User from user" | grep dspam`
-
-if [ -z "\${test_dspam_user}" ]; then
- pw useradd dspam -u 107 -g mail -d /var/db/dspam -s /bin/csh -c 'DSPAM Daemon User'
-fi
-
-if [ ! -d "/var/run/dspam" ]; then
- mkdir /var/run/dspam && chown dspam:mail /var/run/dspam
-fi
-
-if [ -z "\${test_dspam_db}" ]; then
- mysql -D mysql -e "create database dspam"
- if [ -z "\${test_dspam_db_user}" ]; then
- mysql -D mysql -e "GRANT ALL PRIVILEGES ON dspam.* TO dspam@localhost IDENTIFIED BY 'dspam'"
- fi
- mysql -udspam -pdspam dspam < /usr/local/share/examples/dspam/mysql/mysql_objects-space.sql && \
- mysql -udspam -pdspam dspam < /usr/local/share/examples/dspam/mysql/virtual_users.sql
-fi
-
-/sbin/mount_fdescfs fdescfs /dev/fd
-/usr/local/bin/dspam --daemon &
-
-EOD;
-
- $stop = "/usr/bin/killall dspam\n" .
- "sleep 2";
- write_rcfile(array(
- "file" => "dspam.sh",
- "start" => $start,
- "stop" => $stop
- )
- );
- conf_mount_ro();
- config_unlock();
-
- if (! file_exists("/usr/local/etc/dspam.conf")) {
- mwexec("ln -s /etc/dspam.conf /usr/local/etc/dspam.conf");
- }
-
- mwexec("/usr/local/etc/rc.d/dspam.sh stop");
- mwexec("/usr/local/etc/rc.d/dspam.sh start");
-
- return 0;
-}
-
-function dspam_configure() {
- global $config, $g;
-
- $dspamcfg = $config['installedpackages']['dspam']['config'][0];
-
- if ($g['booting'])
- echo "Starting DSPAM service... ";
- else
- sleep(1);
-
- /* write dhcpd.conf */
- $fd = fopen("/usr/local/etc/dspam.conf", "w");
- if (!$fd) {
- printf("Error: cannot open dhcpd.conf in services_dhcpd_configure().\n");
- return 1;
- }
-
- $dspamconf = <<<EOD
-## dspam.conf -- DSPAM configuration file
-## Generated by pfSense
-Home /var/db/dspam
-## Database Settings
-
-EOD;
-
- if ($dspamcfg['storage-driver'] == "mysql") {
- $dspamconf .= "StorageDriver\t\t/usr/local/lib/libmysql_drv.so\n";
- $dspamconf .= <<<EOD
-MySQLServer {$dspamcfg['dbsettings'][0]['mysql-server']}
-MySQLPort {$dspamcfg['dbsettings'][0]['mysql-port']}
-MySQLUser {$dspamcfg['dbsettings'][0]['mysql-user']}
-MySQLPass {$dspamcfg['dbsettings'][0]['mysql-password']}
-MySQLDb {$dspamcfg['dbsettings'][0]['mysql-database']}
-
-EOD;
- isset($dspamcfg['dbsettings'][0]['mysql-compress']) ? $dspamconf .= "MySQLCompress\t\ttrue\n" : $dspamconf .= "MySQLCompress\tfalse\n";
- isset($dspamcfg['dbsettings'][0]['mysql-squote']) ? $dspamconf .= "MySQLSupressQuote\ton\n" : $dspamconf .= "MySQLSupressQuote\toff\n";
- isset($dspamcfg['dbsettings'][0]['mysql-ccache']) ? $dspamconf .= "MySQLConnectionCache\t{$dspamcfg['dbsettings'][0]['mysql-ccache']}\n" : $dspamconf .= "MySQLConnectionCache\t10\n";
- isset($dspamcfg['dbsettings'][0]['mysql-uid']) ? $dspamconf .= "MySQLUIDInSignature\ton\n" : $dspamconf .= "MySQLUIDInSignature\toff\n";
- } else if ($dspamcfg['storage-driver'] == "sqlite") {
- $dspamconf .= "StorageDriver\t\t/usr/local/lib/libsqlite3_drv.so\n";
- if (isset($dspamcfg['dbsettings'][0]['sqlite-pragma'])) $dspamconf .= "SQLitePragma\t\t{$dspamcfg['dbsettings'][0]['sqlite-pragma']}\n";
- } else if ($dspamcfg['storage-driver'] == "pgsql") {
- $dspamconf .= "StorageDriver\t\t/usr/local/lib/libpgsql_drv.so\n";
- $dspamconf .= <<<EOD
-PgSQLServer {$dspamcfg['dbsettings'][0]['pgsql-server']}
-PgSQLPort {$dspamcfg['dbsettings'][0]['pgsql-port']}
-PgSQLUser {$dspamcfg['dbsettings'][0]['pgsql-user']}
-PgSQLPass {$dspamcfg['dbsettings'][0]['pgsql-password']}
-PgSQLDb {$dspamcfg['dbsettings'][0]['pgsql-database']}
-
-EOD;
- isset($dspamcfg['dbsettings'][0]['pgsql-ccache']) ? $dspamconf .= "PgSQLConnectionCache\t{$dspamcfg['dbsettings'][0]['pgsql-ccache']}\n" : $dspamconf .= "PgSQLConnectionCache\t3\n";
- isset($dspamcfg['dbsettings'][0]['pgsql-uid']) ? $dspamconf .= "PgSQLUIDInSignature\ton\n" : $dspamconf .= "PgSQLUIDInSignature\toff\n";
- } else if ($dspamcfg['storage-driver'] == "oracle") {
- $dspamconf .= "StorageDriver\t/usr/local/lib/libora_drv.so\n";
- $dspamconf .= <<<EOD
-OraServer {$dspamcfg['dbsettings'][0]['ora-server']}
-OraUser {$dspamcfg['dbsettings'][0]['ora-user']}
-OraPass {$dspamcfg['dbsettings'][0]['ora-password']}
-OraSchema {$dspamcfg['dbsettings'][0]['ora-schema']}
-
-EOD;
- } else if ($dspamcfg['storage-driver'] == "hash") {
- $dspamconf .= "StorageDriver\t\t/usr/local/lib/libhash_drv.so\n";
- $dspamconf .= <<<EOD
-HashRecMax {$dspamcfg['dbsettings'][0]['hash-rec-max']}
-HashMaxExtents {$dspamcfg['dbsettings'][0]['hash-max-ext']}
-HashExtentSize {$dspamcfg['dbsettings'][0]['hash-ext-size']}
-HashMaxSeek {$dspamcfg['dbsettings'][0]['hash-max-seek']}
-HashConnectionCache {$dspamcfg['dbsettings'][0]['hash-co-cache']}
-
-EOD;
- isset($dspamcfg['dbsettings'][0]['hash-auto-ex']) ? $dspamconf .= "HashAutoExtend\t\ton\n" : $dspamconf .= "HashAutoExtend\toff\n";
- if (isset($dspamcfg['dbsettings'][0]['hash-co-user'])) $dspamconf .= "HashConcurrentUser\t{$dspamcfg['dbsettings'][0]['hash-co-user']}\n";
- }
-
- $dspamconf .= "## Delivery Settings\n";
-
- if ($dspamcfg['tdelivery-agent'] == "procmail") {
- $dspamconf .= "TrustedDeliveryAgent\t\"/usr/local/bin/procmail\"\n";
- } else if ($dspamcfg['tdelivery-agent'] == "mail") {
- $dspamconf .= "TrustedDeliveryAgent\t\"/usr/bin/mail\"\n";
- } else if ($dspamcfg['tdelivery-agent'] == "mail.local") {
- $dspamconf .= "TrustedDeliveryAgent\t\"/usr/libexec/mail.local\"\n";
- } else if ($dspamcfg['tdelivery-agent'] == "deliver") {
- $dspamconf .= "TrustedDeliveryAgent\t\"/usr/local/cyrus/bin/deliver\"\n";
- } else if ($dspamcfg['tdelivery-agent'] == "maildrop") {
- $dspamconf .= "TrustedDeliveryAgent\t\"/usr/local/bin/maildrop\"\n";
- } else if ($dspamcfg['tdelivery-agent'] == "exim") {
- $dspamconf .= "TrustedDeliveryAgent\t\"/usr/local/sbin/exim -oMr spam-scanned\"\n";
- }
-
- if (isset($dspamcfg['tcpip-delivery'])) {
- $dspamconf .= <<<EOD
-DeliveryHost {$dspamcfg['tcpip-delivery-host']}
-DeliveryPort {$dspamcfg['tcpip-delivery-port']}
-DeliveryIdent {$dspamcfg['tcpip-delivery-ident']}
-DeliveryProto {$dspamcfg['tcpip-delivery-proto']}
-
-EOD;
- }
-
- /* TODO: If required add the following, currently
- missing options:
-
- - QuarantineAgent
- - EnablePlusedDetail
- - QuarantineMailbox
- */
-
- $dspamconf .= "OnFail\t\t\t{$dspamcfg['delivery-onfail']}\n";
- $dspamconf .= "## DSPAM Privileges\n";
-
- $t_users = &$dspamcfg['tuser'];
-
- foreach ($t_users as $user) {
- $dspamconf .= "Trust\t\t\t{$user['name']}\n";
- }
-
- if (isset($dspamcfg['debug-enable'])) {
- $dspamconf .= "## DSPAM Debugging Options\n";
- $dspamconf .= "Debug\t\t\t{$dspamcfg['debug-whom']}\n";
- $dspamconf .= "DebugOpt\t\t{$dspamcfg['debug-options']}\n";
- }
-
- $dspamconf .= "## DSPAM Engine Settings\n";
- $dspamconf .= "TrainingMode\t\t{$dspamcfg['training-mode']}\n";
- isset($dspamcfg['test-cond-training']) ? $dspamconf .= "TestConditionalTraining\ton\n" : $dspamconf .= "TestConditionalTraining\toff\n";
-
- $t_features = &$dspamcfg['feature'];
-
- foreach ($t_features as $feature) {
- $dspamconf .= "Feature\t\t\t{$feature['name']}\n";
- }
-
- $t_algos = &$dspamcfg['algorithm'];
-
- if (count($t_algos) > 0) {
- $dspamconf .= "Algorithm\t\t";
-
- foreach ($t_algos as $algo) {
- $dspamconf .= "{$algo['name']} ";
- }
-
- $dspamconf .= "\n";
- }
-
- $dspamconf .= "PValue\t\t\t{$dspamcfg['pvalue']}\n";
- isset($dspamcfg['improbability-drive']) ? $dspamconf .= "ImprobabilityDrive\ton\n" : $dspamconf .= "ImprobabilityDrive\toff\n";
-
- $t_prefs = &$dspamcfg['preference'];
-
- foreach ($t_prefs as $pref) {
- $dspamconf .= "Preference\t\t{$pref['value']}\n";
- }
-
- $t_overr = &$dspamcfg['override'];
-
- foreach ($t_overr as $over) {
- $dspamconf .= "AllowOverride\t\t{$over['value']}\n";
- }
-
- if (isset($dspamcfg['ldap-enable'])) {
- $dspamconf .= <<<EOD
-## LDAP Settings
-LDAPMode {$dspamcfg['ldap-mode']}
-LDAPHost {$dspamcfg['ldap-host']}
-LDAPFilter {$dspamcfg['ldap-filter']}
-LDAPBase {$dspamcfg['ldap-base']}
-
-EOD;
- }
-
- $dspamconf .= "## Miscellaneous Settings\n";
- if (isset($dspamcfg['failover-attempts'])) $dspamconf .= "FailoverAttempts\t{$dspamcfg['failover-attempts']}\n";
-
- $t_headers = &$dspamcfg['header'];
-
- if (is_array($t_headers)) {
- foreach ($t_headers as $header) {
- $dspamconf .= "IgnoreHeader\t\t{$header['name']}\n";
- }
- }
-
- if (isset($dspamcfg['sbl-enable'])) {
- $dspamconf .= "Lookup\t\t\t\"{$dspamcfg['sbl-host']}\"\n";
- }
-
- isset($dspamcfg['rbl-inoculate']) ? $dspamconf .= "RBLInoculate\t\ton\n" : $dspamconf .= "RBLInoculate\toff\n";
- isset($dspamcfg['notification-email']) ? $dspamconf .= "Notifications\t\ton\n" : $dspamconf .= "Notifications\toff\n";
-
- $dspamconf .= <<<EOD
-## Maintainance Settings
-PurgeSignatures {$dspamcfg['purge-signatures']}
-PurgeNeutral {$dspamcfg['purge-neutral']}
-PurgeUnused {$dspamcfg['purge-unused']}
-PurgeHapaxes {$dspamcfg['purge-hapaxes']}
-PurgeHits1S {$dspamcfg['purge-hits-1s']}
-PurgeHits1I {$dspamcfg['purge-hits-1s']}
-
-EOD;
-
- $dspamconf .= "## System Settings\n";
- $dspamconf .= "LocalMX\t\t\t{$dspamcfg['local-mx']}\n";
- isset($dspamcfg['system-log']) ? $dspamconf .= "SystemLog\t\ton\n" : $dspamconf .= "SystemLog\toff\n";
- isset($dspamcfg['user-log']) ? $dspamconf .= "UserLog\t\t\ton\n" : $dspamconf .= "UserLog\toff\n";
- $dspamconf .= "Opt\t\t\t{$dspamcfg['filter-opt']}\n";
- isset($dspamcfg['parse-to-headers']) ? $dspamconf .= "ParseToHeaders\t\ton\n" : $dspamconf .= "ParseToHeaders\toff\n";
- isset($dspamcfg['change-mode-on-parse']) ? $dspamconf .= "ChangeModeOnParse\ton\n" : $dspamconf .= "ChangeModeOnParse\toff\n";
- isset($dspamcfg['change-user-on-parse']) ? $dspamconf .= "ChangeUserOnParse\ton\n" : $dspamconf .= "ChangeUserOnParse\toff\n";
-
- if (isset($dspamcfg['broken-mta-settings'])) {
- $t_bmtas = &$dspamcfg['bmta'];
-
- foreach ($t_bmtas as $bmta) {
- $dspamconf .= "Broken\t\t\t{$bmta['name']}\n";
- }
- }
-
- $dspamconf .= "MaxMessageSize\t\t{$dspamcfg['max-message-size']}\n";
- isset($dspamcfg['processor-bias']) ? $dspamconf .= "ProcessorBias\t\ton\n" : $dspamconf .= "ProcessorBias\toff\n";
-
- if (isset($dspamcfg['clamav-enable'])) {
- $dspamconf .= <<<EOD
-## ClamAV Engine Settings
-ClamAVPort {$dspamcfg['clamav-port']}
-ClamAVHost {$dspamcfg['clamav-host']}
-ClamAVResponse {$dspamcfg['clamav-response']}
-
-EOD;
- }
-
- $dspamconf .= <<<EOD
-## DSPAM Daemon Settings (Server)
-ServerPort {$dspamcfg['dspam-server-port']}
-ServerQueueSize {$dspamcfg['dspam-server-queue-size']}
-ServerPID {$dspamcfg['dspam-server-pid']}
-ServerMode {$dspamcfg['dspam-server-mode']}
-
-EOD;
-
- if ($dspamcfg['dspam-server-mode'] == "dspam") {
- $t_spwds = &$dspamcfg['server-pwd'];
- $i = 1;
-
- if (is_array($t_spwds)) {
- foreach ($t_spwds as $spwd) {
- $dspamconf .= "ServerPass.Relay{$i}\t\"{$spwd['value']}\"\n";
- $i++;
- }
- }
- } else if ($dspamcfg['dspam-server-mode'] == "standard") {
- $dspamconf .= <<<EOD
-ServerParameters "{$dspamcfg['dspam-server-params']}"
-ServerIdent "{$dspamcfg['dspam-server-id']}"
-
-EOD;
- }
-
- if (isset($dspamcfg['dspam-server-socket'])) {
- $dspamconf .= "ServerDomainSocketPath\t\"{$dspamcfg['dspam-server-socket']}\"\n";
- }
-
- if (isset($dspamcfg['dspam-client-enable']) && $dspamcfg['dspam-client-enable'] <> "") {
- $dspamconf .= <<<EOD
-## DSPAM Daemon Settings (Client)
-ClientHost {$dspamcfg['dspam-client-host']}
-ClientIdent {$dspamcfg['dspam-client-id']}
-
-EOD;
-
- if (isset($dspamcfg['dspam-client-port']) && $dspamcfg['dspam-client-port'] <> "") {
- $dspamconf .= "ClientPort\t\t{$dspamcfg['dspam-client-port']}\n";
- }
- }
-
- $dspamconf .= "## EOF\n";
-
- fwrite($fd, $dspamconf);
- fclose($fd);
-
- /* fire up dspam --daemon */
- mwexec("/usr/local/etc/rc.d/dspam.sh stop");
- mwexec("/usr/local/etc/rc.d/dspam.sh start");
-
- if ($g['booting']) {
- print "done.\n";
- }
-
- return 0;
-}
-
-function custom_php_install_command() {
- global $config, $g;
- /* create a default config */
- sync_package_dspam();
-}
-
-function custom_php_deinstall_command() {
- global $config, $g;
- conf_mount_rw();
- unlink_if_exists("/usr/local/etc/rc.d/dspam.sh");
- unlink_if_exists("/usr/local/etc/dspam.conf");
- unlink_if_exists("/usr/local/bin/dspam_spamfeed");
- unlink_if_exists("/usr/local/bin/dspam_innocentfeed");
- conf_mount_ro();
-}
-
-function checkForLDAPSupport() {
- $pd = popen("ldd /usr/local/bin/dspam", "r");
- while (!feof($pd)) {
- $dspamstr .= fgets($pd, 4096);
- }
- pclose($pd);
-
- if (strpos($dspamstr, "libldap") !== false &&
- file_exists("/usr/local/lib/libldap.so") &&
- file_exists("/usr/local/lib/liblber.so")) {
- return true;
- }
-
- return false;
-}
-
-function checkForPgSQLSupport() {
- if (file_exists("/usr/local/lib/libpgsql_drv.so") &&
- file_exists("/usr/local/lib/libpq.so")) {
- return true;
- }
-
- return false;
-}
-
-function checkForMySQLSupport() {
- if (file_exists("/usr/local/lib/libmysql_drv.so") &&
- file_exists("/usr/local/lib/mysql/libmysqlclient.so")) {
- return true;
- }
-
- return false;
-}
-
-function checkForSQLiteSupport() {
- if (file_exists("/usr/local/lib/libsqlite3_drv.so") &&
- file_exists("/usr/local/lib/mysql/libsqlite3.so")) {
- return true;
- }
-
- return false;
-}
-
-function checkForClamAVSupport() {
- if (file_exists("/usr/local/bin/clamdscan") &&
- file_exists("/usr/local/bin/clamscan") &&
- file_exists("/usr/local/sbin/clamd")) {
- return true;
- }
-
- return false;
-}
-
-?>
diff --git a/config/archive/dspam/pkg/dspam-utilfunc.inc b/config/archive/dspam/pkg/dspam-utilfunc.inc
deleted file mode 100644
index 903790b8..00000000
--- a/config/archive/dspam/pkg/dspam-utilfunc.inc
+++ /dev/null
@@ -1,458 +0,0 @@
-<?php
-/* $Id$ */
-/* Copyright (C) 2006 Daniel S. Haischt */
-require_once("functions.inc");
-require_once("dspam.inc");
-
-function &GetPrefs($user) {
- global $CONFIG, $USER;
- $prefs = array();
- $FILE = "{$USER}.prefs";
-
- if ($CONFIG['PREFERENCES_EXTENSION'] == 1) {
- $handle = popen ("{$CONFIG['DSPAM_BIN']}/dspam_admin agg pref " . quotemeta($user));
-
- while (!feof($handle)) {
- $buffer = chop(fgets($handle, 4096));
- list($key, $value) = split("=", $buffer);
- $prefs[$key] = $value;
- }
-
- pclose($handle);
-
- }
-
- if (count(array_keys($prefs)) == 0 || $CONFIG['PREFERENCES_EXTENSION'] != 1) {
-
- /* This step is only required if the user
- * wants to use the legacy DSPAm CGI app.
- */
- if (! file_exists("{$CONFIG['DSPAM_WWW']}/default.prefs")) {
- /* try to copy the sample file */
- if (file_exists("{$CONFIG['DSPAM_WWW']}/default.prefs.sample")) {
- copy("{$CONFIG['DSPAM_WWW']}/default.prefs.sample",
- "{$CONFIG['DSPAM_WWW']}/default.prefs");
- }
- }
- $handle = fopen ("{$CONFIG['DSPAM_WWW']}/default.prefs", "r");
-
- while (!feof($handle)) {
- $buffer = chop(fgets($handle, 4096));
- list($key, $value) = split("=", $buffer);
- $prefs[$key] = $value;
- }
-
- fclose($handle);
-
- if(file_exists($FILE)) {
- $handle = fopen ($FILE, "r");
-
- while (!feof($handle)) {
- $buffer = chop(fgets($handle, 4096));
- list($key, $value) = split("=", $buffer);
- $prefs[$key] = $value;
- }
- }
- }
- return $prefs;
-}
-
-function CheckQuarantine() {
- global $MAILBOX, $DATA;
- $f = 0;
-
- if (file_exists($MAILBOX)) {
- $handle = fopen($MAILBOX, "r");
-
- while (!feof($handle)) {
- $buffer = fgets($handle, 4096);
- if (preg_match('/^From /', $buffer) <= 0) {continue;}
- $f++;
- }
-
- fclose ($handle);
- }
-
- if ($f == 0) {
- $f = "Empty";
- }
-
- $DATA['TOTAL_QUARANTINED_MESSAGES'] = $f;
-}
-
-function http_parse_query( $array = NULL, $convention = '%s' ) {
- if( count( $array ) == 0 ) {
- return '';
- } else {
- if( function_exists( 'http_build_query' ) ){
- $query = http_build_query( $array );
- } else {
- $query = '';
-
- foreach( $array as $key => $value ) {
- if( is_array( $value ) ){
- $new_convention = sprintf( $convention, $key ) . '[%s]';
- $query .= http_parse_query( $value, $new_convention );
- } else {
- $key = urlencode( $key );
- $value = urlencode( $value );
- $query .= sprintf( $convention, $key ) . "=$value&";
- }
- }
- }
-
- return $query;
- }
-}
-
-/* just a wrapper function */
-function SafeVars($PAIRS) {
- $url = http_parse_query($PAIRS);
- return $url;
-}
-
-function To12Hour($h) {
- if ($h < 0) { $h += 24; }
- if ($h > 11) { if ($h > 12) { $h -= 12; } $h .= "p"; }
- else { if ($h == 0) { $h = "12"; } $h .= "a"; }
- return $h;
-}
-
-function GetPath($store) {
- global $CONFIG, $USER;
- $PATH = "";
-
- /* Domain-scalen */
- if ($CONFIG['DOMAIN_SCALE'] == 1) {
- $splittmp = (split('@', $store));
- $VPOPUSERNAME = $splittmp[0];
- $VPOPDOMAIN = $splittmp[1];
- if ($VPOPDOMAIN == "") {$VPOPDOMAIN = "local";}
-
- $PATH = "{$CONFIG['DSPAM_HOME']}/data/{$VPOPDOMAIN}/{$VPOPUSERNAME}/" .
- "{$VPOPUSERNAME}";
- return $PATH;
-
- /* Normal scale */
- } else if ($CONFIG['LARGE_SCALE'] == 0) {
- $PATH = "{$CONFIG['DSPAM_HOME']}/data/{$USER}/{$USER}";
- return $PATH;
-
- /* Large-scale */
- } else {
- if (strlen($USER) > 1) {
- $PATH = "{$CONFIG['DSPAM_HOME']}/data/" . substr($USER, 0, 1) .
- "/". substr($USER, 1, 1) . "/{$USER}/{$USER}";
- } else {
- $PATH = "{$CONFIG['DSPAM_HOME']}/data/{$USER}/{$USER}";
- }
- return $PATH;
- }
-}
-
-function GetUserDir($store) {
- global $CONFIG, $USER;
- $PATH = "";
-
- /* Domain-scalen */
- if ($CONFIG['DOMAIN_SCALE'] == 1) {
- $splittmp = (split('@', $store));
- $VPOPUSERNAME = $splittmp[0];
- $VPOPDOMAIN = $splittmp[1];
- if ($VPOPDOMAIN == "") {$VPOPDOMAIN = "local";}
-
- $PATH = "{$CONFIG['DSPAM_HOME']}/data/{$VPOPDOMAIN}/{$VPOPUSERNAME}";
- return $PATH;
-
- /* Normal scale */
- } else if ($CONFIG['LARGE_SCALE'] == 0) {
- $PATH = "{$CONFIG['DSPAM_HOME']}/data/{$USER}/";
- return $PATH;
-
- /* Large-scale */
- } else {
- if (strlen($USER) > 1) {
- $PATH = "{$CONFIG['DSPAM_HOME']}/data/" . substr($USER, 0, 1) .
- "/". substr($USER, 1, 1) . "/{$USER}/{$USER}";
- } else {
- $PATH = "{$CONFIG['DSPAM_HOME']}/data/{$USER}";
- }
- return $PATH;
- }
-}
-
-function GetDomain($store) {
- global $CONFIG, $USER;
- $PATH = "";
-
- /* Domain-scalen */
- if ($CONFIG['DOMAIN_SCALE'] == 1) {
- $splittmp = (split('@', $store));
- $VPOPUSERNAME = $splittmp[0];
- $VPOPDOMAIN = $splittmp[1];
- if ($VPOPDOMAIN == "") {$VPOPDOMAIN = "local";}
-
- return $VPOPDOMAIN;
- }
-}
-
-function isDSPAMAdmin($username = "") {
- global $config, $CONFIG;
-
- $groupindex = index_groups();
- $userindex = index_users();
-
- if ($username == "") { return 0; }
-
- $gname = $config['system']['group'][$groupindex[$config['system']['user'][$userindex[$username]]['groupname']]]['name'];
-
- if (isset($gname)) {
- return ($gname === $CONFIG['DSPAM_ADMIN_GROUP']);
- }
-
- return 0;
-}
-
-function createUserNotificationMessages() {
- global $config, $CONFIG, $USER, $CURRENT_USER, $CURRENT_STORE;
-
- $firstrun = "{$USER}.firstrun";
- $firstspam = "{$USER}.firstspam";
- $quarantinefull = "{$USER}.quarantinefull";
- $savemsg = "";
-
- if (isset($config['installedpackages']['dspam']['config'][0]['dspam-domain']))
- $domain = $config['installedpackages']['dspam']['config'][0]['dspam-domain'];
- else
- $domain = $config['system']['domain'];
-
- if (GetDomain($CURRENT_STORE) <> "")
- $user_domain = GetDomain($CURRENT_STORE);
- else
- $user_domain = $config['system']['domain'];
-
- $userdir = GetUserDir($CURRENT_STORE);
- $hostname = $config['system']['hostname'];
- $support_user = $config['installedpackages']['dspam']['config'][0]['dspam-contact'];
-
- /* return if there are no sample files */
- if (! file_exists("{$CONFIG['DSPAM_HOME']}/firstrun.txt.sample") ||
- ! file_exists("{$CONFIG['DSPAM_HOME']}/firstspam.txt.sample") ||
- ! file_exists("{$CONFIG['DSPAM_HOME']}/quarantinefull.txt.sample") ||
- ! file_exists($userdir)) {
- return;
- }
-
- /* create firstrun.txt */
- if (! file_exists("{$firstrun}")) {
- $sample_msg = file_get_contents("{$CONFIG['DSPAM_HOME']}/firstrun.txt.sample");
-
- $sample_msg = str_replace("support", $support_user, $sample_msg);
- $sample_msg = str_replace("configureme.com", $user_domain, $sample_msg);
- $sample_msg = str_replace("http://www.yourdomain.com/dspam/",
- "http://{$hostname}.{$domain}/dspam.php",
- $sample_msg);
-
- @file_put_contents("{$firstrun}", $sample_msg);
- $savemsg .= " »{$firstrun}«, ";
- }
-
- /* create firstspam.txt */
- if (! file_exists("{$firstspam}")) {
- $sample_msg = file_get_contents("{$CONFIG['DSPAM_HOME']}/firstspam.txt.sample");
-
- $sample_msg = str_replace("support", $support_user, $sample_msg);
- $sample_msg = str_replace("configureme.com", $user_domain, $sample_msg);
- $sample_msg = str_replace("http://www.yourdomain.com/dspam/",
- "http://{$hostname}.{$domain}/dspam.php",
- $sample_msg);
-
- @file_put_contents("{$firstspam}", $sample_msg);
- $savemsg .= " »{$firstspam}«, ";
- }
-
- /* create quarantinefull.txt */
- if (! file_exists("{$quarantinefull}")) {
- $sample_msg = file_get_contents("{$CONFIG['DSPAM_HOME']}/quarantinefull.txt.sample");
-
- $sample_msg = str_replace("support", $support_user, $sample_msg);
- $sample_msg = str_replace("configureme.com", $user_domain, $sample_msg);
- $sample_msg = str_replace("http://www.yourdomain.com/dspam/",
- "http://{$hostname}.{$domain}/dspam.php",
- $sample_msg);
-
- @file_put_contents("{$quarantinefull}", $sample_msg);
- $savemsg .= " »{$quarantinefull}«.";
- }
-
- if ($savemsg <> "") {
- $savemsg = gettext("The following files were created: ") . $savemsg;
- return $savemsg;
- }
-
- return;
-}
-
-function createNotificationMessages() {
- global $config, $CONFIG, $USER, $CURRENT_USER;
-
- $firstrun = "{$CONFIG['DSPAM_HOME']}/firstrun.txt";
- $firstspam = "{$CONFIG['DSPAM_HOME']}/firstspam.txt";
- $quarantinefull = "{$CONFIG['DSPAM_HOME']}/quarantinefull.txt";
- $savemsg = "";
-
- if (isset($config['installedpackages']['dspam']['config'][0]['dspam-domain']))
- $domain = $config['installedpackages']['dspam']['config'][0]['dspam-domain'];
- else
- $domain = $config['system']['domain'];
-
- $hostname = $config['system']['hostname'];
- $support_user = $config['installedpackages']['dspam']['config'][0]['dspam-contact'];
-
- /* return if there are no sample files */
- if (! file_exists("{$CONFIG['DSPAM_HOME']}/firstrun.txt.sample") ||
- ! file_exists("{$CONFIG['DSPAM_HOME']}/firstspam.txt.sample") ||
- ! file_exists("{$CONFIG['DSPAM_HOME']}/quarantinefull.txt.sample")) {
- return;
- }
-
- /* create firstrun.txt */
- if (! file_exists("{$CONFIG['DSPAM_HOME']}/firstrun.txt")) {
- $sample_msg = file_get_contents("{$CONFIG['DSPAM_HOME']}/firstrun.txt.sample");
-
- $sample_msg = str_replace("support", $support_user, $sample_msg);
- $sample_msg = str_replace("configureme.com", $domain, $sample_msg);
- $sample_msg = str_replace("http://www.yourdomain.com/dspam/",
- "http://{$hostname}.{$domain}/dspam.php",
- $sample_msg);
-
- @file_put_contents("{$firstrun}", $sample_msg);
- $savemsg .= " »{$firstrun}«, ";
- }
-
- /* create firstspam.txt */
- if (! file_exists("{$CONFIG['DSPAM_HOME']}/firstspam.txt")) {
- $sample_msg = file_get_contents("{$CONFIG['DSPAM_HOME']}/firstspam.txt.sample");
-
- $sample_msg = str_replace("support", $support_user, $sample_msg);
- $sample_msg = str_replace("configureme.com", $domain, $sample_msg);
- $sample_msg = str_replace("http://www.yourdomain.com/dspam/",
- "http://{$hostname}.{$domain}/dspam.php",
- $sample_msg);
-
- @file_put_contents("{$firstspam}", $sample_msg);
- $savemsg .= " »{$firstspam}«, ";
- }
-
- /* create quarantinefull.txt */
- if (! file_exists("{$CONFIG['DSPAM_HOME']}/quarantinefull.txt")) {
- $sample_msg = file_get_contents("{$CONFIG['DSPAM_HOME']}/quarantinefull.txt.sample");
-
- $sample_msg = str_replace("support", $support_user, $sample_msg);
- $sample_msg = str_replace("configureme.com", $domain, $sample_msg);
- $sample_msg = str_replace("http://www.yourdomain.com/dspam/",
- "http://{$hostname}.{$domain}/dspam.php",
- $sample_msg);
-
- @file_put_contents("{$quarantinefull}", $sample_msg);
- $savemsg .= " »{$quarantinefull}«.";
- }
-
- if ($savemsg <> "") {
- $savemsg = gettext("The following files were created: ") . $savemsg;
- return $savemsg;
- }
-
- return;
-}
-
-function &check_dspam_installation() {
- global $config;
-
- /* create RC files if necessary */
- if (! file_exists("/usr/local/etc/rc.d")) {
- @mkdir("/usr/local/etc/rc.d");
- }
- if (! file_exists("/usr/local/etc/rc.d/000.mysql.sh")) {
- @copy("/usr/local/pkg/000.mysql.sh", "/usr/local/etc/rc.d/000.mysql.sh");
- @chmod("/usr/local/etc/rc.d/000.mysql.sh", 0755);
- }
- if (! file_exists("/usr/local/etc/rc.d/010.clamav-clamd.sh")) {
- @copy("/usr/local/pkg/010.clamav-clamd.sh",
- "/usr/local/etc/rc.d/010.clamav-clamd.sh");
- @chmod("/usr/local/etc/rc.d/010.clamav-clamd.sh", 0755);
- }
- if (! file_exists("/usr/local/etc/rc.d/020.clamav-freshclam.sh")) {
- @copy("/usr/local/pkg/020.clamav-freshclam.sh",
- "/usr/local/etc/rc.d/020.clamav-freshclam.sh");
- @chmod("/usr/local/etc/rc.d/020.clamav-freshclam.sh", 0755);
- }
- if (! file_exists("/usr/local/etc/rc.d/030.p3scan.sh")) {
- @copy("/usr/local/pkg/030.p3scan.sh",
- "/usr/local/etc/rc.d/030.p3scan.sh");
- @chmod("/usr/local/etc/rc.d/030.p3scan.sh", 0755);
- }
-
- /* create conf files for those packages DSPAM depends on */
- if (! file_exists("/usr/local/etc/clamd.conf")) {
- @copy("/usr/local/pkg/clamd.conf",
- "/usr/local/etc/clamd.conf");
- }
- if (! file_exists("/usr/local/etc/freshclam.conf")) {
- @copy("/usr/local/pkg/freshclam.conf",
- "/usr/local/etc/freshclam.conf");
- }
-
- if (! is_service_running("dspam")) {
- $input_errors[] = "The DSPAM daemon process is not running. " .
- "If you are certain that you did configure DSPAM " .
- "appropriatly, you can start the corresponding process " .
- "using the service control panel which is part of the " .
- "»Status« menu item.";
- }
- if (! is_service_running("p3scan")) {
- $input_errors[] = "The POP3 proxy process is not running. " .
- "If you are certain that you did configure the POP3 proxy " .
- "appropriatly, you can start the corresponding process " .
- "using the service control panel which is part of the " .
- "»Status« menu item.";
- }
- if (! is_service_running("clamd")) {
- $input_errors[] = "The ClamAV daemon process is not running. " .
- "If you are certain that you did configure DSPAM " .
- "appropriatly, you can start the corresponding process " .
- "using the service control panel which is part of the " .
- "»Status« menu item (ClamAV does not need any configuration).";
- }
- if (! is_service_running("freshclam")) {
- $input_errors[] = "The freshclam daemon process is not running. " .
- "If you are certain that you did configure DSPAM " .
- "appropriatly, you can start the corresponding process " .
- "using the service control panel which is part of the " .
- "»Status« menu item (freshclam does not need any configuration).";
- }
- if (! is_service_running("mysql")) {
- $input_errors[] = "The MySQL daemon process is not running. " .
- "If you are certain that you did configure DSPAM " .
- "appropriatly, you can start the corresponding process " .
- "using the service control panel which is part of the " .
- "»Status« menu item (MySQL does not need any configuration).";
- }
-
- if (empty($config['installedpackages']['dspam']['config']) ||
- empty($config['installedpackages']['dspam']['config'][0]['storage-driver']) ||
- (file_exists('/usr/local/etc/dspam.conf') == false)) {
- /* create default config files etc. */
- sync_package_dspam();
-
- $input_errors[] = "It seems that you are using DSPAM for the very first time. " .
- "Please run the DSPAM wizard from the »Services« menu " .
- "if you would like to configure DSPAM right now. " .
- "If you are not eligible to administer DSPAM you may contact " .
- "your local DSPAM admin personal to solve this issue.";
- }
-
- return $input_errors;
-}
-
-?>
diff --git a/config/archive/dspam/pkg/dspam.inc b/config/archive/dspam/pkg/dspam.inc
deleted file mode 100644
index 9a821e6a..00000000
--- a/config/archive/dspam/pkg/dspam.inc
+++ /dev/null
@@ -1,360 +0,0 @@
-<?php
-/* $Id$ */
-/* Copyright (C) 2006 Daniel S. Haischt */
-
-/* include all configuration functions */
-require_once ("functions.inc");
-require_once ("dspam-config.inc");
-require_once ("dspam-guifunc.inc");
-require_once ("dspam-pkgfunc.inc");
-require_once ("dspam-utilfunc.inc");
-
-/* General TODO(s):
- *
- * - Use quotemeta where applicable
- * - Issue a change message after a successful GET/POST
- * - Issue an error message if something went wrong during a GET/POST
- * - Revise user management (CURENT_USER, SESSION_USER etc.)
- */
-
-$DATA = array();
-
-/*
- * Determine which extensions are available
- */
-if ($CONFIG['AUTODETECT'] == 1 || $CONFIG['AUTODETECT'] == "") {
- $CONFIG['PREFERENCES_EXTENSION'] = 0;
- $CONFIG['LARGE_SCALE'] = 0;
- $CONFIG['DOMAIN_SCALE'] = 0;
-
- $buffer = "";
- $handle = popen ("/usr/local/bin/dspam --version", "r");
-
- while (!feof($handle)) {
- $buffer .= fgets($handle, 4096);
- }
-
- pclose($handle);
-
- if (strpos($buffer, '--enable-preferences-extension') !== false) {
- $CONFIG['PREFERENCES_EXTENSION'] = 1;
- }
- if (strpos($buffer, '--enable-large-scale') !== false) {
- $CONFIG['LARGE_SCALE'] = 1;
- }
- if (strpos($buffer, '--enable-domain-scale') !== false) {
- $CONFIG['DOMAIN_SCALE'] = 1;
- }
-}
-
-/*
- * Determine admin status
- */
-
-$CONFIG['ADMIN'] = isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER']);
-
-/*
- * Determine which user should be used to display DSPAm related data
- */
-$CURRENT_USER = $HTTP_SERVER_VARS['AUTH_USER'];
-
-if (empty($CONFIG['ADMIN']) &&
- strpos($_SERVER['SCRIPT_NAME'], "wizard.php") !== false) {
-
- $group = $config['system']['user'][$userindex[$HTTP_SERVER_VARS['AUTH_USER']]]['groupname'];
- $home = "/" . getGroupHomePage($group);
- if ($home == "/") { $home = "/index.php"; }
-
- if (! headers_sent()) {
- pfSenseHeader($home);
- exit;
- } else {
- $htmlstr = <<< EOD
-<html>
- <head>
- <title>Unauthorized Access</title>
- <meta http-equiv="refresh" content="2; URL={$home}">
- </head>
- <body>
- <h3>Unauthorized Access - You will be redirected shortly!</h3>
- </body>
-</html>
-EOD;
- print $htmlstr;
- exit;
- }
-}
-
-/*
- * only DSPAM admins can change the current user without logging out
- * and logging in as another user again.
- */
-if ($_POST) {
- if (! empty($_POST['username']) && $CONFIG['ADMIN'] == 1) {
- $CURRENT_USER = $_POST['username'];
- }
-}
-if ($_GET) {
- if (! empty($_GET['user']) && $CONFIG['ADMIN'] == 1) {
- $CURRENT_USER = $_GET['user'];
- }
-}
-
-if ($CURRENT_USER == "") {
- $input_errors[] = "System Error. I was unable to determine your identity.";
-}
-
-preg_replace('/%CURRENT_USER%/', $CURRENT_USER, $CONFIG['DSPAM_ARGS']);
-
-/* current store */
-$PREF =& GetPrefs($CURRENT_USER);
-$CURRENT_STORE = $PREF['localStore'];
-if ($CURRENT_STORE == "") {$CURRENT_STORE = $CURRENT_USER; }
-
-$USER = GetPath($CURRENT_STORE);
-$MAILBOX = $USER . ".mbox";
-$TMPFILE = $USER . ".tmp";
-
-/*
- * Set up initial display variables
- */
-CheckQuarantine();
-$DATA['REMOTE_USER'] = $CURRENT_USER;
-
-/*
- * Check whether DSPAM is already configured.
- */
-$install_errors =& check_dspam_installation();
-$input_errors = array_merge($input_errors, $install_errors);
-
-/*
- * Check whether we should generate notification messages
- */
-if (isset($config['installedpackages']['dspam']['config'][0]['notification-email'])) {
- $tmpmsg = createNotificationMessages();
- if (! empty($tmpmsg))
- $tmpmsg .= "\n" . createUserNotificationMessages();
- else
- $tmpmsg = createUserNotificationMessages();
-
- $savemsg =& $tmpmsg;
-}
-
-/*
- * Process Commands
- */
-if (isset($pgtitle) && is_array($pgtitle)) {
- /* Performance */
- if (basename($_SERVER['SCRIPT_NAME']) == "dspam-perf.php") {
- if ($_GET) {
- if ($GET['command'] == "resetStats") {
- ResetStats();
- } else if ($GET['command'] == "tweak") {
- Tweak();
- }
- }
-
- $display_errors =& DisplayIndex();
- $input_errors = array_merge($input_errors, $display_errors);
- }
-
- /* Preferences */
- else if (basename($_SERVER['SCRIPT_NAME']) == "dspam-prefs.php") {
- $savemsg = "";
- $prefs_errors =& DisplayPreferences(NULL, $savemsg);
- $input_errors = array_merge($input_errors, $prefs_errors);
- }
-
- /* Quarantine */
- else if (basename($_SERVER['SCRIPT_NAME']) == "dspam-quarantine.php") {
- if ($_GET) {
- if ($_GET['command'] == "viewMessage") {
- $showpart = 0;
- $ctype = 0;
- $sortby = "Rating";
- $currentPage = 1;
- $qPerPage = 0;
-
- if (isset($_GET['showpart'])) { $showpart = $_GET['showpart']; }
- if (isset($_GET['ctype'])) { $ctype = intval($_GET['ctype']); }
- if (isset($_GET['sortby'])) { $sortby = $_GET['sortby']; }
- if (isset($_GET['page'])) { $currentPage = $_GET['page']; }
- if (isset($_GET['qperpage'])) { $qPerPage = $_GET['qperpage']; }
-
- $quarantine_errors =& QuarantineViewMessage($_GET['signatureID'],
- $showpart,
- $ctype,
- $sortby,
- $currentPage,
- $qPerPage);
- $input_errors = array_merge($input_errors, $quarantine_errors);
- } else if (isset($_GET['sortby'])) {
- $qperpage = $CONFIG['QUARANTINE_PER_PAGE'];
- if (isset($_GET['qperpage'])) { $qperpage = $_GET['qperpage']; }
- $page = 1;
- if (isset($_GET['page'])) { $page = $_GET['page']; }
-
- $quarantine_errors =& DisplayQuarantine($_GET['sortby'],
- intval($page),
- intval($qperpage));
- $input_errors = array_merge($input_errors, $quarantine_errors);
- } else if (isset($_GET['qperpage'])) {
- if (isset($_GET['page'])) {
- $quarantine_errors =& DisplayQuarantine($CONFIG['SORT_DEFAULT'],
- intval($_GET['page']),
- intval($_GET['qperpage']));
- $input_errors = array_merge($input_errors, $quarantine_errors);
- } else {
- $quarantine_errors =& DisplayQuarantine($CONFIG['SORT_DEFAULT'],
- 1,
- intval($_GET['qperpage']));
- $input_errors = array_merge($input_errors, $quarantine_errors);
- }
- } else {
- $displayq_errors =& DisplayQuarantine($CONFIG['SORT_DEFAULT'], 1);
- $input_errors = array_merge($input_errors, $displayq_errors);
- }
- } else if ($_POST) {
- if ($_POST['command'] == "processQuarantine") {
- $signatures = array();
-
- while (list($key, $val) = each($_POST)) {
- if (strpos($key, "chkmsg") !== false) {
- $signatures[$key] = $val;
- }
- }
- if ($_POST['processAction']) {
- $processq_errors =& ProcessQuarantine($signatures,
- $_POST['processAction'],
- $_POST['sortby'],
- intval($_POST['qpage']),
- intval($_POST['qperpage']));
- $input_errors = array_merge($input_errors, $processq_errors);
- } else {
- $processq_errors =& ProcessQuarantine($signatures,
- "None",
- $_POST['sortby'],
- intval($_POST['qpage']),
- intval($_POST['qperpage']));
- $input_errors = array_merge($input_errors, $processq_errors);
- }
- } else if ($_POST['command'] == "processFalsePositive") {
- $processfp_errors =& ProcessFalsePositive($_POST['signatureID'],
- $_POST['sortby'],
- intval($_POST['qpage']),
- intval($_POST['qperpage']));
- $input_errors = array_merge($input_errors, $processfp_errors);
- $displayq_errors =& DisplayQuarantine($_POST['sortby'],
- intval($_POST['qpage']),
- intval($_POST['qperpage']));
- $input_errors = array_merge($input_errors, $displayq_errors);
- }
- } else {
- /* usually this particular line of code should not be hit because
- * the user always triggers a GET or POST action. Unfortunatly at
- * the time, the alerts page is implemented in a way that neither
- * triggers a GET nor a POST action if initially accessed via the
- * tab. Hence this final catch all else.
- */
- $displayq_errors =& DisplayQuarantine($CONFIG['SORT_DEFAULT'], 1);
- $input_errors = array_merge($input_errors, $displayq_errors);
- }
- }
-
- /* Analysis */
- else if (basename($_SERVER['SCRIPT_NAME']) == "dspam-analysis.php") {
- $displaya_errors =& DisplayAnalysis();
- $input_errors = array_merge($input_errors, $displaya_errors);
- }
-
- /* History */
- else if (in_array(gettext("History"), $pgtitle)) {
- if ($_POST) {
- /* Form fields that may be submited via POST:
- * - command
- * - username
- * - msgid$retrain_checked_msg_no (checkbox, multible times)
- */
- $checked = array();
-
- while (list($key, $val) = each($_POST)) {
- if (strpos($key, "msgid") !== false) {
- $checked[] = $val;
- }
- }
-
- $displayh_errors =& DisplayHistory($_POST['command'],
- "",
- $checked,
- $_POST['username'],
- "",
- $_POST['hpage'],
- $_POST['hperpage']);
- $input_errors = array_merge($input_errors, $displayh_errors);
- } else if ($_GET) {
- /* Form fields that may be submited via GET:
- * - history_page
- * - command
- * - signatureID
- * - retrain
- * - user
- */
- $displayh_errors =& DisplayHistory($_GET['command'],
- $_GET['signatureID'],
- NULL,
- $_GET['user'],
- $_GET['retrain'],
- isset($_GET['page']) ? intval($_GET['page']) : 1,
- isset($_GET['hperpage']) ? $_GET['hperpage'] : $CONFIG['QUARANTINE_PER_PAGE']);
- $input_errors = array_merge($input_errors, $displayh_errors);
- } else {
- $displayh_errors =& DisplayHistory("", // command
- "", // signature ID
- NULL, // signatures to be retrained
- $CURRENT_USER);
- $input_errors = array_merge($input_errors, $displayh_errors);
- }
- } else if (in_array(gettext("Fragment"), $pgtitle)) {
- if ($_GET) {
- $displayf_errors =& DisplayFragment($_GET['signatureID'],
- $_GET['from'],
- $_GET['subject'],
- $_GET['info'],
- $_GET['time']);
- $input_errors = array_merge($input_errors, $displayf_errors);
- }
- }
-
- /* Info Page */
- else if (basename($_SERVER['SCRIPT_NAME']) == "dspam.php") {
- $info_errors =& DisplayInfos();
- $input_errors = array_merge($input_errors, $info_errors);
- }
-
-/* ========================================================================== */
-/* = A D M I N R E L A T E D F U N C T I O N C A L L S = */
-/* ========================================================================== */
-
- /* Status */
- else if (basename($_SERVER['SCRIPT_NAME']) == "dspam-admin.php" && $CONFIG['ADMIN']) {
- $displays_errors =& DisplayStatus();
- $input_errors = array_merge($input_errors, $displays_errors);
- }
-
- /* User Statistics */
- else if (basename($_SERVER['SCRIPT_NAME']) == "dspam-admin-stats.php" && $CONFIG['ADMIN']) {
- $displayus_errors =& DisplayUserStatistics();
- $input_errors = array_merge($input_errors, $displayus_errors);
- }
-
- /* Preferences */
- else if (basename($_SERVER['SCRIPT_NAME']) == "dspam-admin-prefs.php" && $CONFIG['ADMIN']) {
- $savemsg = "";
- $displayap_errors =& DisplayAdminPreferences($savemsg);
- $input_errors = array_merge($input_errors, $displayap_errors);
- }
-} else {
- $input_errors[] = "The page you did request can't be processed by <code>dspam.inc</code>.";
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pkg/dspam.xml b/config/archive/dspam/pkg/dspam.xml
deleted file mode 100644
index 54373ffa..00000000
--- a/config/archive/dspam/pkg/dspam.xml
+++ /dev/null
@@ -1,342 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE packagegui SYSTEM "../../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../../xsl/package.xsl"?>
-<packagegui>
- <copyright><![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]></copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>dspam</name>
- <version>1.0</version>
- <title>Services: DSPAM: Main</title>
- <include_file>/usr/local/pkg/dspam.inc</include_file>
- <!-- Menu is where this packages menu will appear -->
- <menu>
- <name>dspam</name>
- <section>Services</section>
- <configfile>dspam.xml</configfile>
- <url>/dspam-perf.php</url>
- </menu>
- <menu>
- <name>DSPAM Legacy WebGUI</name>
- <tooltiptext>Original Perl-based GUI</tooltiptext>
- <section>Services</section>
- <url>/vhosts/dspam/dspam.cgi</url>
- </menu>
- <service>
- <name>dspam</name>
- <rcfile>/usr/local/etc/rc.d/dspam.sh</rcfile>
- </service>
- <tabs>
- <tab>
- <text>Overview</text>
- <url>/dspam.php</url>
- <active/>
- </tab>
- <tab>
- <text>Performance</text>
- <url>/dspam-perf.php</url>
- </tab>
- <tab>
- <text>Preferences</text>
- <url>/dspam-prefs.php</url>
- </tab>
- <tab>
- <text>Alerts</text>
- <url>/pkg.php?xml=dspam_alerts.xml</url>
- </tab>
- <tab>
- <text>Quarantine</text>
- <url>/dspam-quarantine.php</url>
- </tab>
- <tab>
- <text>Analysis</text>
- <url>/dspam-analysis.php</url>
- </tab>
- <tab>
- <text>History</text>
- <url>/dspam-history.php</url>
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['dspam']['config']</configpath>
- <!-- PHP files -->
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/dspam.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/dspam-perf.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/dspam-admin.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/dspam-admin-graph.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/dspam-admin-prefs.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/dspam-admin-stats.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam_settings.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam-settings.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam-settings-algo.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam-settings-bmta.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam-settings-feat.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam-header.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam-overr.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam-settings-prefs.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam-spwd.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam-tuser.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam-train.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam-viewmsg.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/verdana.ttf</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/dspam-prefs.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/dspam-quarantine.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/dspam-analysis.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/dspam-analysis-graph.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/dspam-hfragment.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/dspam-history.php</item>
- </additional_files_needed>
- <!-- package files -->
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>http://www.abyssworld.de/packages/config/dspam_alerts.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/dspam.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/dspam-config.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/dspam-guifunc.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/dspam-pkgfunc.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/dspam-utilfunc.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/000.mysql.sh</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/010.clamav-clamd.sh</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/020.clamav-freshclam.sh</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/030.p3scan.sh</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/clamd.conf</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/default.prefs.sample</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/freshclam.conf</item>
- </additional_files_needed>
- <!-- misc files -->
- <additional_files_needed>
- <prefix>/usr/local/www/wizards/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/wizards/dspam_wizard.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/wizards/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/wizards/dspam-lda-proxy.png</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/wizards/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/wizards/dspam-pop-proxy.png</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/wizards/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/wizards/dspam-smtp-relay.png</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/pkg/verdana.ttf</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/themes/metallic/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dspam/www/themes/metallic/dspam.css</item>
- </additional_files_needed>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_php_resync_config_command>
- sync_package_dspam();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- custom_php_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- custom_php_deinstall_command();
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/archive/dspam/pkg/dspam_alerts.xml b/config/archive/dspam/pkg/dspam_alerts.xml
deleted file mode 100644
index ea59cfd2..00000000
--- a/config/archive/dspam/pkg/dspam_alerts.xml
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../../xsl/package.xsl"?>
-<!--
- Tags which can be used to exec arbitrary PHP code:
-
- <custom_php_global_functions />
- <custom_php_command_before_form />
- <custom_delete_php_command /> if $_POST && act == del
- <custom_add_php_command /> if $_POST && act == add
- <custom_php_resync_config_command />
- <custom_php_validation_command />
- <custom_add_php_command_late />
- <start_command /> shell exec
- <restart_command /> shell exec
- <custom_php_after_form_command />
--->
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>dspamalerts</name>
- <version>1.0</version>
- <title>Services: DSPAM: Alerts</title>
- <include_file>/usr/local/pkg/dspam.inc</include_file>
- <!-- Menu is where this packages menu will appear -->
- <tabs>
- <tab>
- <text>Performance</text>
- <url>/dspam-perf.php</url>
- </tab>
- <tab>
- <text>Preferences</text>
- <url>/dspam-prefs.php</url>
- </tab>
- <tab>
- <text>Alerts</text>
- <url>/pkg.php?xml=dspam_alerts.xml</url>
- <active />
- </tab>
- <tab>
- <text>Quarantine</text>
- <url>/dspam-quarantine.php</url>
- </tab>
- <tab>
- <text>Analysis</text>
- <url>/dspam-analysis.php</url>
- </tab>
- <tab>
- <text>History</text>
- <url>/dspam-history.php</url>
- </tab>
- <tab>
- <text>Train Filter</text>
- <url>/dspam-train.php</url>
- </tab>
- <tab>
- <text>Admin Suite</text>
- <url>/dspam-admin.php</url>
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['dspam']['config']['alerts']</configpath>
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Alert Name</fielddescr>
- <fieldname>alertname</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <fields>
- <field>
- <fielddescr>Alert Name</fielddescr>
- <fieldname>alertname</fieldname>
- <description>Name of an alert that should be raised</description>
- <type>input</type>
- <size>30</size>
- <required />
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>You may enter a description here for your reference (not parsed).</description>
- <type>input</type>
- <size>30</size>
- </field>
- </fields>
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_delete_php_command>
- dspam_configure();
- </custom_delete_php_command>
- <custom_php_resync_config_command>
- dspam_configure();
- </custom_php_resync_config_command>
-</packagegui> \ No newline at end of file
diff --git a/config/archive/dspam/pkg/freshclam.conf b/config/archive/dspam/pkg/freshclam.conf
deleted file mode 100644
index 173d97bf..00000000
--- a/config/archive/dspam/pkg/freshclam.conf
+++ /dev/null
@@ -1,110 +0,0 @@
-##
-## Example config file for freshclam
-## Please read the freshclam.conf(5) manual before editing this file.
-## This file may be optionally merged with clamd.conf.
-##
-
-
-# Comment or remove the line below.
-#Example
-
-# Path to the database directory.
-# WARNING: It must match clamd.conf's directive!
-# Default: hardcoded (depends on installation options)
-#DatabaseDirectory /var/lib/clamav
-DatabaseDirectory /var/db/clamav
-
-# Path to the log file (make sure it has proper permissions)
-# Default: disabled
-#UpdateLogFile /var/log/freshclam.log
-UpdateLogFile /var/log/clamav/freshclam.log
-
-# Enable verbose logging.
-# Default: no
-#LogVerbose yes
-
-# Use system logger (can work together with UpdateLogFile).
-# Default: no
-#LogSyslog yes
-
-# Specify the type of syslog messages - please refer to 'man syslog'
-# for facility names.
-# Default: LOG_LOCAL6
-#LogFacility LOG_MAIL
-
-# This option allows you to save the process identifier of the daemyes
-# Default: disabled
-#PidFile /var/run/freshclam.pid
-PidFile /var/run/clamav/freshclam.pid
-
-# By default when started freshclam drops privileges and switches to the
-# "clamav" user. This directive allows you to change the database owner.
-# Default: clamav (may depend on installation options)
-DatabaseOwner clamav
-
-# Initialize supplementary group access (freshclam must be started by root).
-# Default: no
-AllowSupplementaryGroups yes
-
-# Use DNS to verify virus database version. Freshclam uses DNS TXT records
-# to verify database and software versions. With this directive you can change
-# the database verification domain.
-# WARNING: Do not touch it unless you're configuring freshclam to use your
-# own database verification domain.
-# Default: current.cvd.clamav.net
-#DNSDatabaseInfo current.cvd.clamav.net
-
-# Uncomment the following line and replace XY with your country
-# code. See http://www.iana.org/cctld/cctld-whois.htm for the full list.
-#DatabaseMirror db.XY.clamav.net
-
-# database.clamav.net is a round-robin record which points to our most
-# reliable mirrors. It's used as a fall back in case db.XY.clamav.net is
-# not working. DO NOT TOUCH the following line unless you know what you
-# are doing.
-DatabaseMirror database.clamav.net
-
-# How many attempts to make before giving up.
-# Default: 3 (per mirror)
-#MaxAttempts 5
-
-# Number of database checks per day.
-# Default: 12 (every two hours)
-#Checks 24
-
-# Proxy settings
-# Default: disabled
-#HTTPProxyServer myproxy.com
-#HTTPProxyPort 1234
-#HTTPProxyUsername myusername
-#HTTPProxyPassword mypass
-
-# Use aaa.bbb.ccc.ddd as client address for downloading databases. Useful for
-# multi-homed systems.
-# Default: Use OS'es default outgoing IP address.
-#LocalIPAddress aaa.bbb.ccc.ddd
-
-# Send the RELOAD command to clamd.
-# Default: no
-NotifyClamd /usr/local/etc/clamd.conf
-
-# Run command after successful database update.
-# Default: disabled
-#OnUpdateExecute command
-
-# Run command when database update process fails.
-# Default: disabled
-#OnErrorExecute command
-
-# Run command when freshclam reports outdated version.
-# In the command string %v will be replaced by the new version number.
-# Default: disabled
-#OnOutdatedExecute command
-
-# Don't fork into background.
-# Default: no
-#Foreground yes
-
-# Enable debug messages in libclamav.
-# Default: no
-#Debug yes
diff --git a/config/archive/dspam/pkg/p3scan-pf-emer.xml b/config/archive/dspam/pkg/p3scan-pf-emer.xml
deleted file mode 100644
index 7475e23c..00000000
--- a/config/archive/dspam/pkg/p3scan-pf-emer.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <!-- change this if configpath works -->
- <name>p3scanpfemer</name>
- <version>1.0</version>
- <title>Services: POP3 Proxy: Emergency Contact</title>
- <include_file>/usr/local/pkg/p3scan.inc</include_file>
- <tabs>
- <tab>
- <text>Daemon Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Message Processing</text>
- <url>/pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Emergency Contact</text>
- <url>/pkg.php?xml=p3scan-pf-emer.xml</url>
- <active />
- </tab>
- <tab>
- <text>Virus Scanner Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>SPAM Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</url>
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['p3scanpf']['config']['contacts']</configpath>
- <!--
- adddeleteeditpagefields items will appear on the first page where you can
- add / delete or edit items. An example of this would be the nat page where
- you add new nat redirects
- -->
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Email Address</fielddescr>
- <fieldname>emailaddress</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <fields>
- <field>
- <fielddescr>Email Address</fielddescr>
- <fieldname>emailaddress</fieldname>
- <description>
- In the event p3scan encounters a catastrophic problem and has to terminate,
- it will send an email to these email addresses just before setting up to
- close down on the next iteration of a child process.
- </description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>Description.</description>
- <type>input</type>
- </field>
- </fields>
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_delete_php_command>
- sync_package_p3scan();
- </custom_delete_php_command>
- <custom_php_resync_config_command>
- sync_package_p3scan();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/archive/dspam/pkg/p3scan-pf-msg.xml b/config/archive/dspam/pkg/p3scan-pf-msg.xml
deleted file mode 100644
index b2144fe6..00000000
--- a/config/archive/dspam/pkg/p3scan-pf-msg.xml
+++ /dev/null
@@ -1,198 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <!-- change this if configpath works -->
- <name>p3scanpfmsg</name>
- <version>1.0</version>
- <title>Services: POP3 Proxy: Message Processing</title>
- <note>
- This &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt; page uses default values, hence even if each field is
- set, you are still required to save this page if you are editing this page
- for the very first time!
- </note>
- <aftersaveredirect>pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</aftersaveredirect>
- <include_file>/usr/local/pkg/p3scan.inc</include_file>
- <tabs>
- <tab>
- <text>Daemon Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Message Processing</text>
- <url>/pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</url>
- <active />
- </tab>
- <tab>
- <text>Emergency Contact</text>
- <url>/pkg.php?xml=p3scan-pf-emer.xml</url>
- </tab>
- <tab>
- <text>Virus Scanner Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>SPAM Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</url>
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['p3scanpf']['config']['messaging']</configpath>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <fields>
- <field>
- <fielddescr>Just Delete</fielddescr>
- <fieldname>justdelete</fieldname>
- <description>
- Instead of keeping an infected message in the Virus Directory, delete it
- after reporting it to the user.
- </description>
- <type>checkbox</type>
- <donotdisable>true</donotdisable>
- </field>
- <field>
- <fielddescr>Bytes Free</fielddescr>
- <fieldname>bytesfree</fieldname>
- <description>The number of KB's there must be free before processing any mail.</description>
- <type>input</type>
- <required />
- <default_value>10000</default_value>
- </field>
- <field>
- <fielddescr>Broken Email Clients</fielddescr>
- <fieldname>brokenec</fieldname>
- <description>
- Some email clients may require special processing.
- </description>
- <type>checkbox</type>
- <donotdisable>true</donotdisable>
- </field>
- <field>
- <fielddescr>ISP Spam</fielddescr>
- <fieldname>ispspam</fieldname>
- <description>
- This option allows you to set the string your &lt;acronym title=&quot;Internet Service Provider&quot;&gt;ISP&lt;/acronym&gt; uses if it processes
- your email for SPAM. Leave this field blank if you are not going to use
- this option.
- </description>
- <type>input</type>
- <default_value>-- Spam --</default_value>
- </field>
- <field>
- <fielddescr>Subject</fielddescr>
- <fieldname>subject</fieldname>
- <description>
- This option can be used to change the default subject line when
- reporting a virus infected message.
- </description>
- <type>input</type>
- <size>60</size>
- <required />
- <default_value>Subject: "[Virus] found in a mail to you:" &lt;virus name&gt;</default_value>
- </field>
- <field>
- <fielddescr>Notify</fielddescr>
- <fieldname>notify</fieldname>
- <description>
- This option can be used to change the default file deleted notification
- that is displayed in the virus notification message when the
- &quot;justdelete&quot; option is used.
- </description>
- <type>input</type>
- <size>60</size>
- <required />
- <default_value>Per instruction, the message has been deleted.</default_value>
- </field>
- <field>
- <fielddescr>SMTP Reject</fielddescr>
- <fieldname>smtpreject</fieldname>
- <description>
- This option can be used to change the default lt;acronym title=&quot;Simple Mail Transfer Protocol&quot;&gt;SMTP&lt;/acronym&gt; Reject message that
- is sent to the client in the event a message is rejected due to a virus.
- The error message will have a prefix of &quot;554&quot;.
- </description>
- <type>input</type>
- <size>60</size>
- <required />
- <default_value>Virus detected! P3scan rejected message!</default_value>
- </field>
- <field>
- <fielddescr>Check SMTP size</fielddescr>
- <fieldname>checksize</fieldname>
- <description>
- This option can be used to set the maximum message size (in KBytes)
- that p3scan will use to determine if it should scan an smtp submission.
- Leave this field blank if you are not going to use this option.
- </description>
- <type>input</type>
- <default_value>1024</default_value>
- </field>
- <field>
- <fielddescr>Footer</fielddescr>
- <fieldname>footer</fieldname>
- <description>
- This option is used to add the virus definition info from your scanner
- to an SMTP message. Leave this field blank if you are not going to use
- this option.
- </description>
- <type>input</type>
- <size>40</size>
- <default_value>/usr/local/bin/clamdscan -V</default_value>
- </field>
- </fields>
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_php_resync_config_command>
- sync_package_p3scan();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/archive/dspam/pkg/p3scan-pf-spam.xml b/config/archive/dspam/pkg/p3scan-pf-spam.xml
deleted file mode 100644
index eae78a0f..00000000
--- a/config/archive/dspam/pkg/p3scan-pf-spam.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <!-- change this if configpath works -->
- <name>p3scanpfspam</name>
- <version>1.0</version>
- <title>Services: POP3 Proxy: SPAM Settings</title>
- <note>
- This &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt; page uses default values, hence even if each field is
- set, you are still required to save this page if you are editing this page
- for the very first time!
- </note>
- <aftersaveredirect>pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</aftersaveredirect>
- <include_file>/usr/local/pkg/p3scan.inc</include_file>
- <tabs>
- <tab>
- <text>Daemon Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Message Processing</text>
- <url>pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Emergency Contact</text>
- <url>/pkg.php?xml=p3scan-pf-emer.xml</url>
- </tab>
- <tab>
- <text>Virus Scanner Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>SPAM Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</url>
- <active />
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['p3scanpf']['config']['spam']</configpath>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <fields>
- <field>
- <fielddescr>Enable Spam Checking</fielddescr>
- <fieldname>checkspam</fieldname>
- <description>
- If set, will scan for Spam before scanning for a virus.
- </description>
- <type>checkbox</type>
- <donotdisable>true</donotdisable>
- <enablefields>spamcheck</enablefields>
- </field>
- <field>
- <fielddescr>SPAM Executable Command</fielddescr>
- <fieldname>spamcheck</fieldname>
- <description>The command (plus arguments) that should be invoked to check for SPAM messages.</description>
- <type>input</type>
- <size>70</size>
- <default_value>
- /usr/local/bin/dspam --user dspamuser --mode=teft --stdout --deliver=innocent,spam --feature=ch,no,wh
- </default_value>
- </field>
- </fields>
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_php_resync_config_command>
- sync_package_p3scan();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/archive/dspam/pkg/p3scan-pf-vir.xml b/config/archive/dspam/pkg/p3scan-pf-vir.xml
deleted file mode 100644
index ed68b8cf..00000000
--- a/config/archive/dspam/pkg/p3scan-pf-vir.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <!-- change this if configpath works -->
- <name>p3scanpfvir</name>
- <version>1.0</version>
- <title>Services: POP3 Proxy: Virus Scanner Settings</title>
- <note>
- This &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt; page uses default values, hence even if each field is
- set, you are still required to save this page if you are editing this page
- for the very first time!
- </note>
- <aftersaveredirect>pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</aftersaveredirect>
- <include_file>/usr/local/pkg/p3scan.inc</include_file>
- <tabs>
- <tab>
- <text>Daemon Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Message Processing</text>
- <url>/pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Emergency Contact</text>
- <url>/pkg.php?xml=p3scan-pf-emer.xml</url>
- </tab>
- <tab>
- <text>Virus Scanner Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</url>
- <active />
- </tab>
- <tab>
- <text>SPAM Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</url>
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['p3scanpf']['config']['virus']</configpath>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <fields>
- <field>
- <fielddescr>Scanner Type</fielddescr>
- <fieldname>scannertype</fieldname>
- <description>Select here which type of scanner you want to use.</description>
- <type>select</type>
- <size>1</size>
- <default_value>clamd</default_value>
- <options>
- <option><name>Kaspersky Anti-Virus for Linux</name><value>avpd</value></option>
- <option><name>Kaspersky Anti-Virus for Linux (New)</name><value>avpd_new</value></option>
- <option><name>Shell Script</name><value>bash</value></option>
- <option><name>Default Scanner Type</name><value>basic</value></option>
- <option><name>Clam Anti-Virus</name><value>clamd</value></option>
- <option><name>Trophie Daemon</name><value>trophie</value></option>
- </options>
- </field>
- <field>
- <fielddescr>Virusscanner</fielddescr>
- <fieldname>scanner</fieldname>
- <description>Depends on scannertype.</description>
- <type>input</type>
- <required />
- <default_value>127.0.0.1:3310</default_value>
- </field>
- <field>
- <fielddescr>Scanner Returncode</fielddescr>
- <fieldname>viruscode</fieldname>
- <description>
- Specify the returncode(s) which the scanner returns when
- the mail is infected.
- </description>
- <type>input</type>
- <default_value>1</default_value>
- </field>
- <field>
- <fielddescr>Good Scanner return codes</fielddescr>
- <fieldname>goodcode</fieldname>
- <description>
- Some scanners can report more than good or infected. Place valid return
- codes here that will enable the message to be delivered without a warning.
- </description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Regular Expression for Virusname</fielddescr>
- <fieldname>virusregexp</fieldname>
- <description>
- Specify here a regular expression which describes where the name of
- the virus can be found.
- </description>
- <type>input</type>
- <default_value>.*: (.*) FOUND</default_value>
- </field>
- <field>
- <fielddescr>deMIME Setting</fielddescr>
- <fieldname>demime</fieldname>
- <description>
- Tick this if we should parse all lt;acronym title=&quot;Multipurpose Internet Mail Extensions&quot;&gt;MIME&lt;/acronym&gt;-sections instead of passing the
- message as-is to the scanner.
- </description>
- <type>checkbox</type>
- <donotdisable>true</donotdisable>
- </field>
- </fields>
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_php_resync_config_command>
- sync_package_p3scan();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/archive/dspam/pkg/p3scan-pf.xml b/config/archive/dspam/pkg/p3scan-pf.xml
deleted file mode 100644
index b26dc32c..00000000
--- a/config/archive/dspam/pkg/p3scan-pf.xml
+++ /dev/null
@@ -1,211 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>p3scanpf</name>
- <version>1.0</version>
- <title>Services: POP3 Proxy: Main</title>
- <note>
- This &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt; page uses default values, hence even if each field is
- set, you are still required to save this page if you are editing this page
- for the very first time!
- </note>
- <aftersaveredirect>pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</aftersaveredirect>
- <include_file>/usr/local/pkg/p3scan.inc</include_file>
- <!-- Menu is where this packages menu will appear -->
- <menu>
- <name>p3scan</name>
- <tooltiptext>A transparent POP3-Proxy with virus-scanning capabilities</tooltiptext>
- <section>Services</section>
- <configfile>p3scan.xml</configfile>
- </menu>
- <service>
- <name>p3scan-pf</name>
- <rcfile>/usr/local/etc/rc.d/030.p3scan.sh</rcfile>
- </service>
- <tabs>
- <tab>
- <text>Daemon Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- <active />
- </tab>
- <tab>
- <text>Message Processing</text>
- <url>/pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Emergency Contact</text>
- <url>/pkg.php?xml=p3scan-pf-emer.xml</url>
- </tab>
- <tab>
- <text>Virus Scanner Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>SPAM Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</url>
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['p3scanpf']['config']</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/p3scan-pf-msg.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/p3scan-pf-emer.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/p3scan-pf-vir.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/p3scan-pf-spam.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/p3scan_rules.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/p3scan.inc</item>
- </additional_files_needed>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <fields>
- <field>
- <fielddescr>Max Child's</fielddescr>
- <fieldname>maxchilds</fieldname>
- <description>The maximum number of connections we will handle at once.</description>
- <type>input</type>
- <default_value>10</default_value>
- </field>
- <field>
- <fielddescr>IP Address</fielddescr>
- <fieldname>ipaddr</fieldname>
- <description>The &lt;acronym title=&quot;Internet Protocol&quot;&gt;IP&lt;/acronym&gt; Address we listen on.</description>
- <type>input</type>
- <required />
- <default_value>0.0.0.0</default_value>
- </field>
- <field>
- <fielddescr>Port</fielddescr>
- <fieldname>port</fieldname>
- <description>The &lt;acronym title=&quot;Transmission Control Protocol&quot;&gt;TCP&lt;/acronym&gt; port on we should listen.</description>
- <type>input</type>
- <required />
- <default_value>8110</default_value>
- </field>
- <field>
- <fielddescr>SSL Port</fielddescr>
- <fieldname>sslport</fieldname>
- <description>The TCP &lt;acronym title=&quot;Secure Sockets Layer&quot;&gt;SSL&lt;/acronym&gt; port on we should listen.</description>
- <type>input</type>
- <required />
- <default_value>995</default_value>
- </field>
- <field>
- <fielddescr>Target IP</fielddescr>
- <fieldname>targetip</fieldname>
- <description>Target IP is the IP to connect (0.0.0.0 enables transparent mode).</description>
- <type>input</type>
- <required />
- <default_value>0.0.0.0</default_value>
- </field>
- <field>
- <fielddescr>Target Port</fielddescr>
- <fieldname>targetport</fieldname>
- <description>Target Port is the port to connect.</description>
- <type>input</type>
- <required />
- <default_value>8110</default_value>
- </field>
- <field>
- <fielddescr>Email Port</fielddescr>
- <fieldname>emailport</fieldname>
- <description>The port we should listen on to scan outgoing email messages.</description>
- <type>input</type>
- <required />
- <default_value>25</default_value>
- </field>
- <field>
- <fielddescr>Daemon User</fielddescr>
- <fieldname>daemonuser</fieldname>
- <description>The username the daemon should run as.</description>
- <type>input</type>
- <required />
- <default_value>root</default_value>
- </field>
- </fields>
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_delete_php_command>
- sync_package_p3scan();
- </custom_delete_php_command>
- <custom_php_resync_config_command>
- sync_package_p3scan();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- custom_php_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- custom_php_deinstall_command();
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/archive/dspam/pkg/p3scan.inc b/config/archive/dspam/pkg/p3scan.inc
deleted file mode 100644
index 7d675050..00000000
--- a/config/archive/dspam/pkg/p3scan.inc
+++ /dev/null
@@ -1,277 +0,0 @@
-<?php
-/* $Id$ */
-/* Copyright (C) 2006 Daniel S. Haischt */
-
-/* include all configuration functions */
-require_once("functions.inc");
-
-function sync_package_p3scan() {
- global $config, $g;
- conf_mount_rw();
- config_lock();
- $fd = fopen("/etc/p3scan.conf","w");
-
- /* shorten the config path */
- $cfg = $config['installedpackages']['p3scanpf']['config'][0];
- $cfgmsg = $config['installedpackages']['p3scanpfmsg']['config'][0];
- $cfgemer = $config['installedpackages']['p3scanpfemer']['config'];
- $cfgvir = $config['installedpackages']['p3scanpfvir']['config'][0];
- $cfgspam = $config['installedpackages']['p3scanpfspam']['config'][0];
-
- fwrite($fd, "## p3scan-pf config file - generated by pfSense.\n##\n");
- fwrite($fd, "## at: " . date("l dS of F Y h:i:s A") . "\n##\n");
- /* ================================================================ */
- /* == Tab: Daemon Settings == */
- /* ================================================================ */
- fwrite($fd, "## Daemon Settings.\n");
- fwrite($fd, "pidfile = /var/run/p3scan/p3scan.pid\n");
- if (isset($cfg['maxchilds']) && $cfg['maxchilds'] <> "")
- fwrite($fd, "maxchilds = {$cfg['maxchilds']}\n");
- else
- fwrite($fd, "maxchilds = 10\n");
- if (isset($cfg['ipaddr']) && $cfg['ipaddr'] <> "")
- fwrite($fd, "ip = {$cfg['ipaddr']}\n");
- else
- fwrite($fd, "ip = 0.0.0.0\n");
- /* TODO: Even if the port is configurable, it is
- hardcoded in p3scan.c. This needs to be
- changed for the sake of flexebility.
- */
- if (isset($cfg['port']) && $cfg['port'] <> "")
- fwrite($fd, "port = {$cfg['port']}\n");
- else
- fwrite($fd, "port = 8110\n");
- if (isset($cfg['sslport']) && $cfg['sslport'] <> "")
- fwrite($fd, "sslport = {$cfg['sslport']}\n");
- else
- fwrite($fd, "sslport = 995\n");
- if (isset($cfg['targetip']) && $cfg['targetip'] <> "")
- fwrite($fd, "targetip = {$cfg['targetip']}\n");
- else
- fwrite($fd, "targetip = 0.0.0.0\n");
- if (isset($cfg['targetport']) && $cfg['targetport'] <> "")
- fwrite($fd, "targetport = {$cfg['targetport']}\n");
- else
- fwrite($fd, "targetport = 8110\n");
- if (isset($cfg['emailport']) && $cfg['emailport'] <> "")
- fwrite($fd, "emailport = {$cfg['emailport']}\n");
- else
- fwrite($fd, "emailport = 25\n");
- if (isset($cfg['daemonuser']) && $cfg['daemonuser'] <> "")
- fwrite($fd, "user = {$cfg['daemonuser']}\n");
- else
- fwrite($fd, "user = root\n");
- fwrite($fd, "notifydir = /var/spool/p3scan/notify\n");
- fwrite($fd, "virusdir = /var/spool/p3scan\n");
- fwrite($fd, "template = /usr/local/etc/p3scan/p3scan.mail\n");
-
- /* ================================================================ */
- /* == Tab: Message Processing == */
- /* ================================================================ */
- fwrite($fd, "## Message Processing Settings.\n");
- if (isset($cfgmsg['justdelete']) && $cfgmsg['justdelete'] <> "")
- fwrite($fd, "justdelete\n");
- if (isset($cfgmsg['bytesfree']) && $cfgmsg['bytesfree'] <> "")
- fwrite($fd, "bytesfree = {$cfgmsg['bytesfree']}\n");
- else
- fwrite($fd, "bytesfree = 10000\n");
- if (isset($cfgmsg['broken']) && $cfgmsg['broken'] <> "")
- fwrite($fd, "broken\n");
- if (isset($cfgmsg['timeout']) && $cfgmsg['timeout'] <> "")
- fwrite($fd, "timeout = {$cfgmsg['timeout']}\n");
- else
- fwrite($fd, "timeout = 30\n");
- if (isset($cfgmsg['ispspam']) && $cfgmsg['ispspam'] <> "")
- fwrite($fd, "ispspam = {$cfg['ispspam']}\n");
- if (file_exists("/usr/local/bin/renattach"))
- fwrite($fd, "renattach = /usr/local/bin/renattach\n");
- if (isset($cfgmsg['subject']) && $cfgmsg['subject'] <> "")
- fwrite($fd, "subject = {$cfgmsg['subject']}\n");
- else
- fwrite($fd, "subject = Subject: \"[Virus] found in a mail to you:\" <virus name>\n");
- if (isset($cfgmsg['notify']) && $cfgmsg['notify'] <> "")
- fwrite($fd, "notify = {$cfgmsg['notify']}\n");
- else
- fwrite($fd, "notify = Per instruction, the message has been deleted.\n");
- if (isset($cfgmsg['smtpreject']) && $cfgmsg['smtpreject'] <> "")
- fwrite($fd, "smtprset = {$cfgmsg['smtpreject']}\n");
- else
- fwrite($fd, "smtprset = Virus detected! P3scan rejected message!\n");
- if (isset($cfgmsg['checksize']) && $cfgmsg['checksize'] <> "")
- fwrite($fd, "checksize = {$cfgmsg['checksize']}\n");
- if (isset($cfgmsg['footer']) && $cfgmsg['footer'] <> "")
- fwrite($fd, "footer = {$cfgmsg['footer']}\n");
-
- /* ================================================================ */
- /* == Tab: Emergency Contact == */
- /* ================================================================ */
- fwrite($fd, "## Emergency Contacts.\n");
- if (is_array($cfgemer)) {
- foreach ($cfgemer as $addr) {
- $contact .= "{$addr['emailaddress']} ";
- }
- if (isset($contact) && $contact <> "")
- fwrite($fd, "emergcon = {$contact}\n");
- }
-
- /* ================================================================ */
- /* == Tab: Virus Scanner Settings == */
- /* ================================================================ */
- fwrite($fd, "## Virus Scanner Settings.\n");
- if (isset($cfgvir['scannertype']) && $cfgvir['scannertype'] <> "")
- fwrite($fd, "scannertype = {$cfgvir['scannertype']}\n");
- else
- fwrite($fd, "scannertype = clamd\n");
- if (isset($cfgvir['scanner']) && $cfgvir['scanner'] <> "")
- fwrite($fd, "scanner = {$cfgvir['scanner']}\n");
- else
- fwrite($fd, "scanner = 127.0.0.1:3310\n");
- if (isset($cfgvir['viruscode']) && $cfgvir['viruscode'] <> "")
- fwrite($fd, "viruscode = {$cfgvir['viruscode']}\n");
- else
- fwrite($fd, "viruscode = 1\n");
- if (isset($cfgvir['goodcode']) && $cfgvir['goodcode'] <> "")
- fwrite($fd, "goodcode = {$cfgvir['goodcode']}\n");
- if (isset($cfgvir['virusregexp']) && $cfgvir['virusregexp'] <> "")
- fwrite($fd, "virusregexp = {$cfgvir['virusregexp']}\n");
- if (isset($cfgvir['demime']) && $cfgvir['demime'] <> "")
- fwrite($fd, "demime\n");
-
- /* ================================================================ */
- /* == Tab: SPAM Settings == */
- /* ================================================================ */
- if (isset($cfgspam['checkspam']) && $cfgpam['checkspam'] <> "") {
- fwrite($fd, "## SPAM Settings.\n");
- fwrite($fd, "checkspam\n");
- if (isset($cfgvir['spamcheck']) && $cfgvir['spamcheck'] <> "")
- fwrite($fd, "spamcheck = {$cfgspam['spamcheck']}\n");
- else
- fwrite($fd, "spamcheck = /usr/local/bin/dspam --user dspamuser --mode=teft --stdout --deliver=innocent,spam --feature=ch,no,wh\n");
- }
-
- fclose($fd);
-
- /* NOTE: The following code requires the p3scan.inc file to be saved with
- UNIX Linefeeds. LF that is and NOT CR LF.
- */
- $start = <<<EOD
-test_p3scan_user=`cat /etc/passwd | grep p3scan`
-test_p3scan_group=`cat /etc/passwd | grep p3scan`
-
-if [ -z "\${test_p3scan_group}" ]; then
- pw groupadd p3scan -g 108
-fi
-
-if [ -z "\${test_p3scan_user}" ]; then
- pw useradd p3scan -u 108 -g p3scan -d /var/spool/p3scan -s /sbin/nologin -c 'P3Scan Daemon'
-fi
-
-if [ ! -d "/var/spool/p3scan" ]; then
- mkdir /var/spool/p3scan && chown p3scan:p3scan /var/spool/p3scan
-fi
-
-if [ ! -d "/var/spool/p3scan/children" ]; then
- mkdir /var/spool/p3scan/children && chown p3scan:p3scan /var/spool/p3scan/children
-fi
-
-if [ ! -d "/var/spool/p3scannotify" ]; then
- mkdir /var/spool/p3scannotify && chown p3scan:p3scan /var/spool/p3scannotify
-fi
-
-if [ ! -d "/var/run/p3scan" ]; then
- mkdir /var/run/p3scan && chown p3scan:p3scan /var/run/p3scan
-fi
-
-/sbin/mount_fdescfs fdescfs /dev/fd
-/usr/local/sbin/p3scan --configfile=/usr/local/etc/p3scan/p3scan.conf &
-
-EOD;
-
- $stop = "/usr/bin/killall p3scan\n" .
- "sleep 2";
-
- write_rcfile(array(
- "file" => "030.p3scan.sh",
- "start" => $start,
- "stop" => $stop
- )
- );
-
- conf_mount_ro();
- config_unlock();
-
- if (! file_exists("/usr/local/etc/p3scan")) {
- mkdir("/usr/local/etc/p3scan");
- }
- if (! file_exists("/usr/local/etc/p3scan/p3scan.conf")) {
- mwexec("ln -s /etc/p3scan.conf /usr/local/etc/p3scan/p3scan.conf");
- }
- if (! file_exists("/usr/local/etc/p3scan/p3scan.mail")) {
- $fd = fopen("/usr/local/etc/p3scan/p3scan.mail","w");
-
- $p3scanmail = <<<EOD
-MIME-Version: 1.0
-Content-Transfer-Encoding: 8bit
-Content-Type: text/plain;
- charset="iso-8859-1"
-
-Hello %USERNAME%.
-This message body was generated automatically from P3Scan, which runs on
-%HOSTNAME%.%DOMAINNAME% for scanning all incoming email.
-
-It replaces the body of a message sent to you that contained a VIRUS!
-
-Instead of the infected email this message has been sent to you.
-
-You may look at the message header of this message for the complete
-email header information of the infected message.
-
-Virus name:
- %VIRUSNAME%
-(Supposed) Sender of the email:
- %MAILFROM%
-Sent To:
- %MAILTO%
-On Date:
- %MAILDATE%
-Subject:
- %SUBJECT%
-Connection data:
- %PROTOCOL% from %CLIENTIP%:%CLIENTPORT% to %SERVERIP%:%SERVERPORT%
-Message File:
- %P3SCANID%
-Virus Definition Info:
- %VDINFO%
---
-%PROGNAME% %VERSION%
-by Jack S. Lai <laitcg@cox.net>
-
-EOD;
-
- fwrite($fd, $p3scanmail);
- fclose($fd);
- }
-
- mwexec("/usr/local/etc/rc.d/030.p3scan.sh stop");
- mwexec("/usr/local/etc/rc.d/030.p3scan.sh start");
-
- return 0;
-}
-
-function custom_php_install_command() {
- global $config, $g;
- sync_package_p3scan();
-}
-
-function custom_php_deinstall_command() {
- global $config, $g;
- conf_mount_rw();
- unlink_if_exists("/usr/local/pkg/pf/p3scan_rules.php");
- unlink_if_exists("/usr/local/www/p3scan_rules.php");
- unlink_if_exists("/usr/local/etc/p3scan/p3scan.conf");
- unlink_if_exists("/usr/local/etc/p3scan/p3scan.mail");
- unlink_if_exists("/usr/local/etc/rc.d/030.p3scan.sh");
- rmdir("/usr/local/etc/p3scan");
- conf_mount_ro();
-}
-?> \ No newline at end of file
diff --git a/config/archive/dspam/pkg/verdana.ttf b/config/archive/dspam/pkg/verdana.ttf
deleted file mode 100644
index 754a9b7b..00000000
--- a/config/archive/dspam/pkg/verdana.ttf
+++ /dev/null
Binary files differ
diff --git a/config/archive/dspam/www/dspam-admin-graph.php b/config/archive/dspam/www/dspam-admin-graph.php
deleted file mode 100644
index 508824e2..00000000
--- a/config/archive/dspam/www/dspam-admin-graph.php
+++ /dev/null
@@ -1,201 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-admin-graph.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-/* required because of system_groupmanager.php */
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("System Status"),
- gettext("Graph"));
-
-require_once 'Image/Graph.php';
-require_once 'Image/Canvas.php';
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (! $_GET ||
- strlen($_SERVER['QUERY_STRING']) == 0 ||
- ! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
- return;
-}
-
-$FORM =& ReadParse($_SERVER['QUERY_STRING']);
-
-list($spam, $nonspam, $sm, $fp, $inoc, $wh, $period) = split('_', $FORM['data']);
-$spam = split(',', $spam);
-$nonspam = split(',', $nonspam);
-$sm = split(',', $sm);
-$fp = split(',', $fp);
-$inoc = split(',', $inoc);
-$wh = split(',', $wh);
-$period = split(',', $period);
-
-// create a PNG canvas and enable antialiasing (canvas implementation)
-$Canvas =& Image_Canvas::factory('png', array('width' => 725,
- 'height' => 450,
- 'antialias' => 'native'));
-
-// create the graph
-$Graph =& Image_Graph::factory('graph', $Canvas);
-// add a TrueType font
-$Font =& $Graph->addNew('font', 'Verdana');
-// set the font size to 8 pixels
-$Font->setSize(8);
-
-$Graph->setFont($Font);
-
-// setup the plotarea, legend and their layout
-$Graph->add(
- Image_Graph::vertical(
- Image_Graph::factory('title', array('', 12)),
- Image_Graph::horizontal(
- $Plotarea = Image_Graph::factory('plotarea'),
- $Legend = Image_Graph::factory('legend'),
- 80
- ),
- 0
- )
-);
-
-// add grids
-$Grid =& $Plotarea->addNew('line_grid', IMAGE_GRAPH_AXIS_Y);
-$Grid->setLineColor('silver');
-
-// link the legend with the plotares
-$Legend->setPlotarea($Plotarea);
-
-// create the two datasets
-$i = 0;
-$spamds =& Image_Graph::factory('dataset');
-foreach($spam as $el){
- $spamds->addPoint(strval($period[$i]), intval($el));
- $i++;
-}
-
-$i = 0;
-$hamds =& Image_Graph::factory('dataset');
-foreach($nonspam as $el){
- $hamds->addPoint(strval($period[$i]), intval($el));
- $i++;
-}
-
-$i = 0;
-$smds =& Image_Graph::factory('dataset');
-foreach($sm as $el){
- $smds->addPoint(strval($period[$i]), intval($el));
- $i++;
-}
-
-$i = 0;
-$fpds =& Image_Graph::factory('dataset');
-foreach($fp as $el){
- $fpds->addPoint(strval($period[$i]), intval($el));
- $i++;
-}
-
-$i = 0;
-$inocds =& Image_Graph::factory('dataset');
-foreach($inoc as $el){
- $inocds->addPoint(strval($period[$i]), intval($el));
- $i++;
-}
-
-$i = 0;
-$whds =& Image_Graph::factory('dataset');
-foreach($wh as $el){
- $whds->addPoint(strval($period[$i]), intval($el));
- $i++;
-}
-
-// set the name/title of each dataset
-$spamds->setName('SPAM');
-$hamds->setName('Nonspam');
-$smds->setName('Spam Misses');
-$fpds->setName('False Positives');
-$inocds->setName('Inoculations');
-$whds->setName('Auto-Whitelisted');
-
-// put each dataset in a singel ds array
-$Datasets = array($inocds, $whds, $spamds, $hamds, $smds, $fpds);
-
-// create the plot as line chart using the dataset
-$Plot =& $Plotarea->addNew('Image_Graph_Plot_Bar', array($Datasets,'stacked'));
-
-// set a fill color
-$FillArray =& Image_Graph::factory('Image_Graph_Fill_Array');
-$FillArray->addColor('#000000');
-$FillArray->addColor('#BF00BF');
-$FillArray->addColor('#BF0000');
-$FillArray->addColor('#00BF00');
-$FillArray->addColor('#BFBF00');
-$FillArray->addColor('#FF7F00');
-
-// set a standard fill style
-$Plot->setFillStyle($FillArray);
-
-/* set axis labels */
-$XAxis =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
-$XAxis->setTitle("{$FORM['x_label']}", array('size' => 8, 'angle' => 0));
-$XAxis->setFontAngle(60);
-$XAxis->setLabelOptions(array('offset' => intval($FORM['offset']),
- 'showtext' => true,
- 'position' => 'outside'), 1);
-
-
-$YAxis =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_Y);
-$YAxis->setTitle('Number of Messages', array('size' => 8, 'angle' => 90));
-
-// create a Y data value marker
-$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_VALUE_Y);
-$Marker->setFontSize(6);
-
-// and use the marker on the 1st plot
-$Plot->setMarker($Marker);
-$Plot->setDataSelector(Image_Graph::factory('Image_Graph_DataSelector_NoZeros'));
-
-// output the Graph
-$Graph->done();
-
-function &ReadParse($URI = "") {
- if ($URI == "") {
- return NULL;
- }
-
- $pairs = preg_split('/&/', $URI);
- $FORM = array();
-
- foreach($pairs as $pair){
- list($name, $value) = preg_split('/\=/', $pair);
- $pattern = '/%([a-fA-F0-9][a-fA-F0-9])/';
-
- $name = preg_replace('/\+/', ' ', $name);
- $name = preg_replace_callback(
- $pattern,
- create_function(
- '$matches',
- 'return pack("C", hexdec($matches[1]));'
- ),
- $name
- );
-
- $value = preg_replace('/\+/', ' ', $value);
- $value = preg_replace_callback(
- $pattern,
- create_function(
- '$matches',
- 'return pack("C", hexdec($matches[1]));'
- ),
- $value
- );
-
- $FORM[$name] = $value;
- } // end foreach
-
- return $FORM;
-}
-?>
diff --git a/config/archive/dspam/www/dspam-admin-prefs.php b/config/archive/dspam/www/dspam-admin-prefs.php
deleted file mode 100644
index 324d961f..00000000
--- a/config/archive/dspam/www/dspam-admin-prefs.php
+++ /dev/null
@@ -1,249 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-train.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Admin Preferences"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- /* if ajax is calling, give them an update message */
- if(isAjax())
- print_info_box_np($savemsg);
-
- include("head.inc");
- /* put your custom HTML head content here */
- /* using some of the $pfSenseHead function calls */
- $jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-
-EOD;
-
- $jscriptstr .= getJScriptFunction(0);
- $jscriptstr .= <<<EOD
-//-->
-</script>
-EOD;
-
- $pfSenseHead->addScript($jscriptstr);
- echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<form action="dspam-admin-prefs.php" method="post" name="iform" id="iform">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<p>
- <span class="vexpl">
- This page lets you configure how the filter will handle your messages.
- </span>
-</p>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[] = array("System Status", false, "/dspam-admin.php?user={$CURRENT_USER}");
- $tab_array[] = array("User Statistics", false, "/dspam-admin-stats.php?user={$CURRENT_USER}");
- $tab_array[] = array("Administration", true, "/dspam-admin-prefs.php?user={$CURRENT_USER}");
- $tab_array[] = array("Settings", false, "/dspam-settings.php?user={$CURRENT_USER}");
- $tab_array[] = array("Control Center", false, "/dspam.php?user={$CURRENT_USER}");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listhdrr" colspan="2">Statistical SPAM Protection for...</td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Username</td>
- <td width="78%" class="vtable">
- <?php if(isset($HTTP_SERVER_VARS['AUTH_USER'])): ?>
- <input type="text" name="username" id="username" value="<?= $CURRENT_USER ?>" class="formfld user"<?php if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) { echo " readonly=\"readonly\""; } ?> />
- <?php else: ?>
- <input type="text" name="username" id="username" value="Please provide a username" class="formfld user" onFocus="this.value='';" />
- <?php endif; ?>
- &nbsp;
- <?php
- if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER']))
- $action = "onClick=\"changeuser();\"";
- else
- $action = "onClick=\"document.iform.submit();\"";
- ?>
- <input type="button" name="change_user" id="change_user" class="formbtn" value="Change" <?= $action ?> />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="2">
- <strong>Training</strong> &ndash; Configure how the filter learns as it processes messages
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" class="vncell" width="40%">
- <p>DSPAM should train:</p>
- <input <?= $DATA["S_TEFT"]; ?> value="TEFT" type="radio" class="formfld" title="On every new message scanned by the filter" alt="On every new message scanned by the filter" name="rad_train" id="rad_train_one" />
- <label for="rad_train_one">&nbsp;On every new message scanned by the filter (TEFT)</label>
- <br />
- <input <?= $DATA["S_TOE"]; ?> value="TOE" type="radio" class="formfld" title="Only when the filter makes a mistake" alt="Only when the filter makes a mistake" name="rad_train" id="rad_train_two" />
- <label for="rad_train_two">&nbsp;Only when the filter makes a mistake (TOE)</label>
- <br />
- <input <?= $DATA["S_TUM"]; ?> value="TUM" type="radio" class="formfld" title=";Only with new data or if the filter makes a mistake" alt=";Only with new data or if the filter makes a mistake" name="rad_train" id="rad_train_three" />
- <label for="rad_train_three">&nbsp;Only with new data or if the filter makes a mistake (TUM)</label>
- </td>
- <td align="left" valign="top" class="vncell" width="60%">
- <p>When I train DSPAM, I prefer:</p>
- <input value="message" <?= $DATA["S_LOC_MESSAGE"]; ?> value="message" type="radio" class="formfld" title="To forward my spams (signature appears in message body)" alt="To forward my spams (signature appears in message body)" name="rad_train_action" id="rad_train_action_one" />
- <label for="rad_train_action_one">&nbsp;To <u>forward</u> my spams (signature appears in message body)</label>
- <br />
- <input <?= $DATA["S_LOC_HEADERS"]; ?> value="headers" type="radio" class="formfld" title="To bounce my spams (signature appears in message headers)" alt="To bounce my spams (signature appears in message headers)" name="rad_train_action" id="rad_train_action_two" />
- <label value="headers" for="rad_train_action_two">&nbsp;To <u>bounce</u> my spams (signature appears in message headers)</label>
- </td>
- </tr>
- <tr>
- <td align="left" valign="middle" class="vncell" colspan="2">
- <p>
- Filter sensitivity <strong>during</strong> the training period:
- </p>
- <p align="center">
- <nobr>
- <span>
- Catch SPAM (More in Quarantine)&nbsp;
- <input value="0" type="radio" class="formfld" title="-5" alt="-5" name="rad_filter_sens" <?= $DATA["SEDATION_0"]; ?> />
- <input value="1" type="radio" class="formfld" title="-4" alt="-4" name="rad_filter_sens" <?= $DATA["SEDATION_1"]; ?> />
- <input value="2" type="radio" class="formfld" title="-3" alt="-3" name="rad_filter_sens" <?= $DATA["SEDATION_2"]; ?> />
- <input value="3" type="radio" class="formfld" title="-2" alt="-2" name="rad_filter_sens" <?= $DATA["SEDATION_3"]; ?> />
- <input value="4" type="radio" class="formfld" title="-1" alt="-1" name="rad_filter_sens" <?= $DATA["SEDATION_4"]; ?> />
- <strong style="font-size: larger;">&raquo;</strong>
- <input value="5" type="radio" class="formfld" title="0" alt="0" name="rad_filter_sens" <?= $DATA["SEDATION_5"]; ?> />
- <strong style="font-size: larger;">&laquo;</strong>
- <input value="6" type="radio" class="formfld" title="1" alt="1" name="rad_filter_sens" <?= $DATA["SEDATION_6"]; ?> />
- <input value="7" type="radio" class="formfld" title="2" alt="2" name="rad_filter_sens" <?= $DATA["SEDATION_7"]; ?> />
- <input value="8" type="radio" class="formfld" title="3" alt="3" name="rad_filter_sens" <?= $DATA["SEDATION_8"]; ?> />
- <input value="9" type="radio" class="formfld" title="4" alt="4" name="rad_filter_sens" <?= $DATA["SEDATION_9"]; ?> />
- <input value="10" type="radio" class="formfld" title="5" alt="5" name="rad_filter_sens" <?= $DATA["SEDATION_10"]; ?> />
- &nbsp;Assume Good (Fewer in Quarantine)
- </span>
- </nobr>
- </p>
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="2">
- <strong>Message Handling</strong> &ndash; Configure how SPAM is handled
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" class="vncell" colspan="2">
- <p>When a SPAM message is identified:</p>
- <p>
- <input value="quarantine" <?= $DATA["S_ACTION_QUARANTINE"]; ?> type="radio" class="formfld" title="Quarantine the message" alt="Quarantine the message" name="rad_ident_action" id="rad_ident_action_one" />
- <label for="rad_ident_action_one">&nbsp;Quarantine the message</label>
- <br />
- <input value="tag" <?= $DATA["S_ACTION_TAG"]; ?> type="radio" class="formfld" title="Tag the Subject header with" alt="Tag the Subject header with" name="rad_ident_action" id="rad_ident_action_two" />
- <label for="rad_ident_action_two">Tag the Subject header with&nbsp;</label>
- <input size="35" type="text" class="formfld mail" title="message tag" alt="message tag" value="<?= $DATA["SPAM_SUBJECT"]; ?>" name="msgtag" />
- <br />
- <input value="deliver" <?= $DATA["S_ACTION_DELIVER"]; ?> type="radio" class="formfld" title="Deliver the message normally with a X-DSPAM-Result header" alt="Deliver the message normally with a X-DSPAM-Result header" name="rad_ident_action" id="rad_ident_action_three" />
- <label for="rad_ident_action_three">&nbsp;Deliver the message normally with a X-DSPAM-Result header</label>
- </p>
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="2">
- <strong>Features</strong> &ndash; Tuning SPAM filtering
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" class="vncell" colspan="2">
- <p>
- <input <?= $DATA["C_BNR"]; ?> type="checkbox" class="formbtn" title="Enable noise reduction, which usually improves filtering accuracy" alt="Enable noise reduction, which usually improves filtering accuracy" name="chk_feature_nr" id="chk_feature_nr" />
- <label for="chk_feature_nr">&nbsp;Enable noise reduction, which usually improves filtering accuracy</label>
- <br />
- <input <?= $DATA["C_WHITELIST"]; ?> type="checkbox" class="formbtn" title="Enable automatic whitelisting to record frequent correspondence" alt="Enable automatic whitelisting to record frequent correspondence" name="chk_feature_aw" id="chk_feature_aw" />
- <label for="chk_feature_aw">&nbsp;Enable automatic whitelisting to record frequent correspondence</label>
- <br />
- <input <?= $DATA["C_FACTORS"]; ?> type="checkbox" class="formbtn" title="Add the factoring tokens in each email into the message's full headers" alt="Add the factoring tokens in each email into the message's full headers" name="chk_feature_at" id="chk_feature_at" />
- <label for="chk_feature_at">&nbsp;Add the factoring tokens in each email into the message's full headers</label>
- <!--
- <input type="checkbox" class="formbtn" title="Add the factoring tokens in each email into the message's full headers" alt="Add the factoring tokens in each email into the message's full headers" name="chk_feature_at" id="chk_feature_at" />
- <label for="chk_feature_at">&nbsp;Add the factoring tokens in each email into the message's full headers</label>
- <br />
- <input type="checkbox" class="formbtn" title="opt in of DSPAM filtering" alt="opt in of DSPAM filtering" name="chk_feature_optin" id="chk_feature_optin" />
- <label for="chk_feature_optin">&nbsp;opt in of DSPAM filtering</label>
- <br />
- <input type="checkbox" class="formbtn" title="opt out of DSPAM filtering" alt="opt out of DSPAM filtering" name="chk_feature_optout" id="chk_feature_optout" />
- <label for="chk_feature_optout">&nbsp;opt out of DSPAM filtering</label>
- -->
- </p>
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td class="list">&nbsp;</td>
- <td class="list">
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?
-} else {
-?>
-<?php
- $input_errors[] = "Access to this particular site was denied. You need DSPAM admin access rights to be able to view it.";
-
- include("head.inc");
- echo $pfSenseHead->getHTML();
-?>
-<?php include("fbegin.inc");?>
-<?php if ($input_errors) print_input_errors($input_errors);?>
-<?php if ($savemsg) print_info_box($savemsg);?>
- <body link="#000000" vlink="#000000" alink="#000000">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="listtopic">Access denied for: <?=$HTTP_SERVER_VARS['AUTH_USER']?></td>
- </tr>
- </table>
-<?php
-} // end of access denied code
-?>
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/dspam-admin-stats.php b/config/archive/dspam/www/dspam-admin-stats.php
deleted file mode 100644
index 82b91831..00000000
--- a/config/archive/dspam/www/dspam-admin-stats.php
+++ /dev/null
@@ -1,123 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-train.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("User Statistics"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- /* if ajax is calling, give them an update message */
- if(isAjax())
- print_info_box_np($savemsg);
-
- include("head.inc");
- /* put your custom HTML head content here */
- /* using some of the $pfSenseHead function calls */
- echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<form action="dspam-admin-stats.php" method="post" name="iform" id="iform">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<p>
- <span class="vexpl">
- The following table shows the number of messages processed for each user
- along with their current preference settings.
- </span>
-</p>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[] = array("System Status", false, "/dspam-admin.php?user={$CURRENT_USER}");
- $tab_array[] = array("User Statistics", true, "/dspam-admin-stats.php?user={$CURRENT_USER}");
- $tab_array[] = array("Administration", false, "/dspam-admin-prefs.php?user={$CURRENT_USER}");
- $tab_array[] = array("Settings", false, "/dspam-settings.php?user={$CURRENT_USER}");
- $tab_array[] = array("Control Center", false, "/dspam.php?user={$CURRENT_USER}");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listhdrr" colspan="14">Statistical SPAM Protection for...</td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Username</td>
- <td width="78%" class="vtable" colspan="13">
- <strong><?= $CURRENT_USER ?></strong>
- </td>
- </tr>
- <tr>
- <td colspan="14" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic">Name</td>
- <td align="left" valign="top" class="listtopic">Q.Size</td>
- <td align="left" valign="top" class="listtopic">TP</td>
- <td align="left" valign="top" class="listtopic">TN</td>
- <td align="left" valign="top" class="listtopic">FP</td>
- <td align="left" valign="top" class="listtopic">FN</td>
- <td align="left" valign="top" class="listtopic">SC</td>
- <td align="left" valign="top" class="listtopic">IC</td>
- <td align="left" valign="top" class="listtopic">Mode</td>
- <td align="left" valign="top" class="listtopic">On Spam</td>
- <td align="left" valign="top" class="listtopic">BNR</td>
- <td align="left" valign="top" class="listtopic">Whitelist</td>
- <td align="left" valign="top" class="listtopic">Sed</td>
- <td align="left" valign="top" class="listtopic">Sig Loc</td>
- </tr>
- <?= $DATA['TABLE']; ?>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?
-} else {
-?>
-<?php
- $input_errors[] = "Access to this particular site was denied. You need DSPAM admin access rights to be able to view it.";
-
- include("head.inc");
- echo $pfSenseHead->getHTML();
-?>
-<?php include("fbegin.inc");?>
-<?php if ($input_errors) print_input_errors($input_errors);?>
-<?php if ($savemsg) print_info_box($savemsg);?>
- <body link="#000000" vlink="#000000" alink="#000000">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="listtopic">Access denied for: <?=$HTTP_SERVER_VARS['AUTH_USER']?></td>
- </tr>
- </table>
-<?php
-} // end of access denied code
-?>
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/dspam-admin.php b/config/archive/dspam/www/dspam-admin.php
deleted file mode 100644
index 45b33b55..00000000
--- a/config/archive/dspam/www/dspam-admin.php
+++ /dev/null
@@ -1,207 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-train.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("System Status"),
- gettext("Overview"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- /* if ajax is calling, give them an update message */
- if(isAjax())
- print_info_box_np($savemsg);
-
- include("head.inc");
- /* put your custom HTML head content here */
- /* using some of the $pfSenseHead function calls */
- echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<form action="dspam-admin.php" method="post" name="iform" id="iform">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<p>
- <span class="vexpl">
- The following graphs and tables summarize the processing done by the filter.
- </span>
-</p>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[] = array("System Status", true, "/dspam-admin.php?user={$CURRENT_USER}");
- $tab_array[] = array("User Statistics", false, "/dspam-admin-stats.php?user={$CURRENT_USER}");
- $tab_array[] = array("Administration", false, "/dspam-admin-prefs.php?user={$CURRENT_USER}");
- $tab_array[] = array("Settings", false, "/dspam-settings.php?user={$CURRENT_USER}");
- $tab_array[] = array("Control Center", false, "/dspam.php?user={$CURRENT_USER}");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listhdrr" colspan="2">Statistical SPAM Protection for...</td>
- </tr>
- <tr>
- <td width="10%" valign="baseline" class="vncell">Username</td>
- <td width="90%" class="vtable">
- <strong><?= $CURRENT_USER ?></strong>
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" align="left" valign="top" class="listtopic">
- <strong>Overview</strong>
- </td>
- </tr>
- <tr>
- <td colspan="2" align="center" valign="top" class="vncell">
- <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listhdrr">Messages</td>
- <td align="left" valign="top" class="listhdrr">Today</td>
- <td align="left" valign="top" class="listhdrr">This Hour</td>
- <td align="left" valign="top" class="list">&nbsp;</td>
- <td align="left" valign="top" class="listhdrr">Status</td>
- <td align="left" valign="top" class="listhdrr">Current Value</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listr">Spam</td>
- <td align="left" valign="top" class="listr"><?= $DATA['SPAM_TODAY']; ?></td>
- <td align="left" valign="top" class="listr"><?= $DATA['SPAM_THIS_HOUR']; ?></td>
- <td align="left" valign="top" class="list">&nbsp;</td>
- <td align="left" valign="top" class="listr">Average message processing time</td>
- <td align="left" valign="top" class="listr"><?= $DATA['AVG_PROCESSING_TIME']; ?> sec.</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listr">Good</td>
- <td align="left" valign="top" class="listr"><?= $DATA['NONSPAM_TODAY']; ?></td>
- <td align="left" valign="top" class="listr"><?= $DATA['NONSPAM_THIS_HOUR']; ?></td>
- <td align="left" valign="top" class="list">&nbsp;</td>
- <td align="left" valign="top" class="listr">Average throughput</td>
- <td align="left" valign="top" class="listr"><?= $DATA['AVG_MSG_PER_SECOND']; ?> messages/sec.</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listr">Spam Misses</td>
- <td align="left" valign="top" class="listr"><?= $DATA['SM_TODAY']; ?></td>
- <td align="left" valign="top" class="listr"><?= $DATA['SM_THIS_HOUR']; ?></td>
- <td align="left" valign="top" class="list">&nbsp;</td>
- <td align="left" valign="top" class="listr">DSPAM instances</td>
- <td align="left" valign="top" class="listr"><?= $DATA['DSPAM_PROCESSES']; ?> process(es)</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listr">False Positives</td>
- <td align="left" valign="top" class="listr"><?= $DATA['FP_TODAY']; ?></td>
- <td align="left" valign="top" class="listr"><?= $DATA['FP_THIS_HOUR']; ?></td>
- <td align="left" valign="top" class="list">&nbsp;</td>
- <td align="left" valign="top" class="listr">System uptime</td>
- <td align="left" valign="top" class="listr"><?= $DATA['UPTIME']; ?></td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listr">Inoculations</td>
- <td align="left" valign="top" class="listr"><?= $DATA['INOC_TODAY']; ?></td>
- <td align="left" valign="top" class="listr"><?= $DATA['INOC_THIS_HOUR']; ?></td>
- <td align="left" valign="top" class="list">&nbsp;</td>
- <td align="left" valign="top" class="listr">Mail queue length</td>
- <td align="left" valign="top" class="listr"><?= $DATA['MAIL_QUEUE']; ?> messages</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listbgns"><strong>Total</strong></td>
- <td align="left" valign="top" class="listbgns"><strong><?= $DATA['TOTAL_TODAY']; ?></strong></td>
- <td align="left" valign="top" class="listbgns"><strong><?= $DATA['TOTAL_THIS_HOUR']; ?></strong></td>
- <td align="left" valign="top" class="list">&nbsp;</td>
- <td align="left" valign="top" class="list">&nbsp;</td>
- <td align="left" valign="top" class="list">&nbsp;</td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" align="left" valign="top" class="listtopic">
- <strong>24 Hour Activity</strong> &ndash; 125 SPAM, 601 Good, 2 Spam Misses, 0 False Positives, 2 Inoculations
- </td>
- </tr>
- <tr>
- <td colspan="2" align="center" valign="top" class="vncell">
- <?php if(isset($_GET['test'])): ?>
- <img src="/dspam-admin-graph.php?data=1,2,5,6,2,6,3,1,3,9,5,2,4,8,9,6,9,2,6,8,3,3,5,2_4,22,12,9,11,10,10,8,2,9,9,27,18,26,20,20,11,14,27,69,51,108,86,43_0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0_0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0_0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0_2,8,3,9,7,4,3,2,2,,4,7,6,3,4,6,2,7,4,17,5,3,10,1_10:00pm,11:00pm,12:00am,1:00am,2:00am,3:00am,4:00am,5:00am,6:00am,7:00am,8:00am,9:00am,10:00am,11:00am,12:00pm,1:00pm,2:00pm,3:00pm,4:00pm,5:00pm,6:00pm,7:00pm,8:00pm,9:00pm&x_label=Hour+of+the+day&offset=35" alt="24 Hour Activity" border="0" />
- <?php else: ?>
- <img src="/dspam-admin-graph.php?data=<?= $DATA['DATA_DAILY']; ?>&x_label=<?= urlencode("Hour of the day"); ?>&offset=20" alt="24 Hour Activity" border="0" />
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" align="left" valign="top" class="listtopic">
- <strong>Daily Activity</strong> &ndash; 2457 SPAM, 10772 Good, 35 Spam Misses, 0 False Positives, 33 Inoculations
- </td>
- </tr>
- <tr>
- <td colspan="2" align="center" valign="top" class="vncell">
- <?php if(isset($_GET['test'])): ?>
- <img src="/dspam-admin-graph.php?data=105,98,54,104,85,94,93,103,115,122,109,94,77,103,116,105,112,103,97,83,87,99,97,126,107_368,339,326,395,367,166,176,325,376,382,458,305,149,134,335,396,388,368,403,220,142,534,312,595,600_0,2,0,2,1,3,0,1,4,1,0,0,0,1,2,1,2,1,2,3,4,1,1,2,0_0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0_1,1,2,1,4,1,0,3,1,0,2,0,2,1,2,1,1,5,0,1,0,0,0,2,4_129,142,76,184,139,55,51,94,107,139,168,130,70,63,123,140,118,96,108,88,46,110,133,143,109_5/29/2006,5/30/2006,5/31/2006,6/1/2006,6/2/2006,6/3/2006,6/4/2006,6/5/2006,6/6/2006,6/7/2006,6/8/2006,6/9/2006,6/10/2006,6/11/2006,6/12/2006,6/13/2006,6/14/2006,6/15/2006,6/16/2006,6/17/2006,6/18/2006,6/19/2006,6/20/2006,6/21/2006,6/22/2006&graph=period&x_label=Date&offset=45" border="0" />
- <?php else: ?>
- <img src="/dspam-admin-graph.php?data=<?= $DATA['DATA_WEEKLY']; ?>&graph=period&x_label=Date&offset=45" border="0" />
- <?php endif; ?>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?
-} else {
-?>
-<?php
- $input_errors[] = "Access to this particular site was denied. You need DSPAM admin access rights to be able to view it.";
-
- include("head.inc");
- echo $pfSenseHead->getHTML();
-?>
-<?php include("fbegin.inc");?>
-<?php if ($input_errors) print_input_errors($input_errors);?>
-<?php if ($savemsg) print_info_box($savemsg);?>
- <body link="#000000" vlink="#000000" alink="#000000">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="listtopic">Access denied for: <?=$HTTP_SERVER_VARS['AUTH_USER']?></td>
- </tr>
- </table>
-<?php
-} // end of access denied code
-?>
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/dspam-analysis-graph.php b/config/archive/dspam/www/dspam-analysis-graph.php
deleted file mode 100644
index 67262564..00000000
--- a/config/archive/dspam/www/dspam-analysis-graph.php
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-analysis-graph.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-/* required because of system_groupmanager.php */
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Analysis"),
- gettext("Graph"));
-
-require_once 'Image/Graph.php';
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (! $_GET ||
- strlen($_SERVER['QUERY_STRING']) == 0) {
- return;
-}
-
-$FORM =& ReadParse($_SERVER['QUERY_STRING']);
-
-list($spam, $nonspam, $period) = split('_', $FORM['data']);
-$spam_day = split(',', $spam);
-$nonspam_day = split(',', $nonspam);
-$period = split(',', $period);
-
-// create the graph
-$Graph =& Image_Graph::factory('graph', array(725, 300));
-
-// add a TrueType font
-$Font =& $Graph->addNew('font', 'Verdana');
-// set the font size to 11 pixels
-$Font->setSize(8);
-
-$Graph->setFont($Font);
-
-// setup the plotarea, legend and their layout
-$Graph->add(
- Image_Graph::vertical(
- Image_Graph::factory('title', array('', 12)),
- Image_Graph::vertical(
- $Plotarea = Image_Graph::factory('plotarea'),
- $Legend = Image_Graph::factory('legend'),
- 88
- ),
- 5
- )
-);
-
-// link the legend with the plotares
-$Legend->setPlotarea($Plotarea);
-
-// create the two datasets
-$i = 0;
-$spamds =& Image_Graph::factory('dataset');
-foreach($spam_day as $el){
- $spamds->addPoint(strval($period[$i]), intval($el));
- $i++;
-}
-
-$i = 0;
-$hamds =& Image_Graph::factory('dataset');
-foreach($nonspam_day as $el){
- $hamds->addPoint(strval($period[$i]), intval($el));
- $i++;
-}
-
-// set the name/title of each dataset
-$spamds->setName('SPAM');
-$hamds->setName('Good');
-
-// put each dataset in a singel ds array
-$Datasets = array($spamds, $hamds);
-
-// create the plot as line chart using the dataset
-$Plot =& $Plotarea->addNew('Image_Graph_Plot_Line', array($Datasets,'normal'));
-
-// set a line color
-$LineArray =& Image_Graph::factory('Image_Graph_Line_Array');
-$LineArray->addColor('red');
-$LineArray->addColor('green');
-
-// set a standard line style
-$Plot->setLineStyle($LineArray);
-
-/* set axis labels */
-$XAxis =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
-$XAxis->setTitle("{$FORM['x_label']}");
-$YAxis =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_Y);
-$YAxis->setTitle('Number of Messages', 'vertical');
-
-// output the Graph
-$Graph->done();
-
-function &ReadParse($URI = "") {
- if ($URI == "") {
- return NULL;
- }
-
- $pairs = preg_split('/&/', $URI);
- $FORM = array();
-
- foreach($pairs as $pair){
- list($name, $value) = preg_split('/\=/', $pair);
- $pattern = '/%([a-fA-F0-9][a-fA-F0-9])/';
-
- $name = preg_replace('/\+/', ' ', $name);
- $name = preg_replace_callback(
- $pattern,
- create_function(
- '$matches',
- 'return pack("C", hexdec($matches[1]));'
- ),
- $name
- );
-
- $value = preg_replace('/\+/', ' ', $value);
- $value = preg_replace_callback(
- $pattern,
- create_function(
- '$matches',
- 'return pack("C", hexdec($matches[1]));'
- ),
- $value
- );
-
- $FORM[$name] = $value;
- } // end foreach
-
- return $FORM;
-}
-?>
diff --git a/config/archive/dspam/www/dspam-analysis.php b/config/archive/dspam/www/dspam-analysis.php
deleted file mode 100644
index f80bd54b..00000000
--- a/config/archive/dspam/www/dspam-analysis.php
+++ /dev/null
@@ -1,147 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-analysis.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Analysis"),
- gettext("Overview"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-/* if this is an AJAX caller then handle via JSON */
-if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
- $jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-
-EOD;
-
- $jscriptstr .= getJScriptFunction(0);
- $jscriptstr .= <<<EOD
-//-->
-</script>
-EOD;
-
- $pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<form action="dspam-analysis.php" method="post" name="iform" id="iform">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<p>
- <span class="vexpl">
- Graphs showing the number of messages that have been processed are shown below.
- </span>
-</p>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[] = array("Info", false, "/dspam.php?user={$CURRENT_USER}");
- $tab_array[] = array("Performance", false, "/dspam-perf.php?user={$CURRENT_USER}");
- $tab_array[] = array("Preferences", false, "/dspam-prefs.php?user={$CURRENT_USER}");
- $tab_array[] = array("Alerts", false, "/pkg.php?xml=dspam_alerts.xml&user={$CURRENT_USER}");
- $tab_array[] = array("Quarantine ({$DATA['TOTAL_QUARANTINED_MESSAGES']})", false, "/dspam-quarantine.php?user={$CURRENT_USER}");
- $tab_array[] = array("Analysis", true, "/dspam-analysis.php?user={$CURRENT_USER}");
- $tab_array[] = array("History", false, "/dspam-history.php?user={$CURRENT_USER}");
- $tab_array[] = array("Train Filter", false, "/dspam-train.php?user={$CURRENT_USER}");
- if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
- $tab_array[] = array("Admin Suite", false, "/dspam-admin.php");
- }
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listhdrr" colspan="2">Statistical SPAM Protection for...</td>
- </tr>
- <tr>
- <td width="10%" valign="baseline" class="vncell">Username</td>
- <td width="90%" class="vtable">
- <?php if(isset($HTTP_SERVER_VARS['AUTH_USER'])): ?>
- <input type="text" name="username" id="username" value="<?= $CURRENT_USER ?>" class="formfld user"<?php if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) { echo " readonly=\"readonly\""; } ?> />
- <?php else: ?>
- <input type="text" name="username" id="username" value="Please provide a username" class="formfld user" onFocus="this.value='';" />
- <?php endif; ?>
- &nbsp;
- <?php
- if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER']))
- $action = "onClick=\"changeuser();\"";
- else
- $action = "onClick=\"document.iform.submit();\"";
- ?>
- <input type="button" name="change_user" id="change_user" class="formbtn" value="Change" <?= $action ?> />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="2">
- <strong>24 Hour Activity</strong> &ndash; <?= $DATA['TS_DAILY']; ?> SPAM, <?= $DATA['TI_DAILY']; ?> Good
- </td>
- </tr>
- <tr>
- <td align="center" valign="top" class="vncell" colspan="2">
- <?php if(isset($_GET['test'])): ?>
- <img src="/dspam-analysis-graph.php?data=0,0,1,0,1_1,4,0,1,0_4p,6p,7a,11a,2p&x_label=Hour+of+the+day" alt="24 Hour Activity" border="0" />
- <?php else: ?>
- <img src="/dspam-analysis-graph.php?data=<?= $DATA['DATA_DAILY']; ?>&x_label=<?= urlencode("Hour of the day"); ?>" alt="24 Hour Activity" border="0" />
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="2">
- <strong>14 Day Activity</strong> &ndash; <?= $DATA['TS_WEEKLY']; ?> SPAM, <?= $DATA['TI_WEEKLY']; ?> Good
- </td>
- </tr>
- <tr>
- <td align="center" valign="top" class="vncell" colspan="2">
- <?php if(isset($_GET['test'])): ?>
- <img src="/dspam-analysis-graph.php?data=1,2,0,2,1,2,2,1,4,0,0,2,0,2_5,2,3,5,12,20,7,9,9,8,7,12,6,1_6/9,6/10,6/11,6/12,6/13,6/14,6/15,6/16,6/17,6/18,6/19,6/20,6/21,6/22&graph=period&x_label=Date" alt="24 Hour Activity" border="0" />
- <?php else: ?>
- <img src="/dspam-analysis-graph.php?data=<?= $DATA['DATA_WEEKLY']; ?>&graph=period&x_label=Date" alt="24 Hour Activity" border="0" />
- <?php endif; ?>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/dspam-hfragment.php b/config/archive/dspam/www/dspam-hfragment.php
deleted file mode 100644
index 36152a00..00000000
--- a/config/archive/dspam/www/dspam-hfragment.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-train.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("History"),
- gettext("Fragement"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-/* if this is an AJAX caller then handle via JSON */
-if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[] = array("Info", false, "/dspam.php?{$CURRENT_USER}");
- $tab_array[] = array("Performance", false, "/dspam-perf.php?user={$CURRENT_USER}");
- $tab_array[] = array("Preferences", false, "/dspam-prefs.php?user={$CURRENT_USER}");
- $tab_array[] = array("Alerts", false, "/pkg.php?xml=dspam_alerts.xml&user={$CURRENT_USER}");
- $tab_array[] = array("Quarantine ({$DATA['TOTAL_QUARANTINED_MESSAGES']})", false, "/dspam-quarantine.php?user={$CURRENT_USER}");
- $tab_array[] = array("Analysis", false, "/dspam-analysis.php?user={$CURRENT_USER}");
- $tab_array[] = array("History", true, "/dspam-history.php?user={$CURRENT_USER}");
- $tab_array[] = array("Train Filter", false, "/dspam-train.php?user={$CURRENT_USER}");
- if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
- $tab_array[] = array("Admin Suite", false, "/dspam-admin.php?user={$CURRENT_USER}");
- }
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="list" width="10%">
- <br />
- <font color=white><big><?= $DATA['SUBJECT']; ?></big><br />
- <?= $DATA['FROM']; ?><br />
- <small><?= $DATA['TIME']; ?> (<?= $DATA['INFO']; ?>)</small></font><br />
- <br />
- </td>
- </tr>
- <tr>
- <td class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="middle" class="list">
- <pre>
- <?= $DATA['MESSSAGE']; ?>
- </pre>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/dspam-history.php b/config/archive/dspam/www/dspam-history.php
deleted file mode 100644
index cb5e4f2c..00000000
--- a/config/archive/dspam/www/dspam-history.php
+++ /dev/null
@@ -1,172 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-train.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("History"),
- gettext("Overview"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-/* if this is an AJAX caller then handle via JSON */
-if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
- $jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-
-EOD;
-
- $jscriptstr .= getJScriptFunction(0);
- $jscriptstr .= getJScriptFunction(4);
- $jscriptstr .= <<<EOD
-//-->
-</script>
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-$pfSenseHead->addLink("<link rel=\"stylesheet\" type=\"text/css\" href=\"/themes/" . $g['theme'] . "/dspam.css\" media=\"all\" />\n");
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<form action="dspam-history.php" method="post" name="iform" id="iform">
-<input type="hidden" name="command" value="retrainChecked" />
-<input type="hidden" name="hpage" value="<?= $DATA['HPAGE']; ?>" />
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<p>
- <span class="vexpl">
- The messages that have been processed by the filter are shown below. The
- most recent messages are shown first. Use the retrain options to correct
- errors and deliver any false positives that are still in your quarantine.
- </span>
-</p>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[] = array("Info", false, "/dspam.php?user={$CURRENT_USER}");
- $tab_array[] = array("Performance", false, "/dspam-perf.php?user={$CURRENT_USER}");
- $tab_array[] = array("Preferences", false, "/dspam-prefs.php?user={$CURRENT_USER}");
- $tab_array[] = array("Alerts", false, "/pkg.php?xml=dspam_alerts.xml&user={$CURRENT_USER}");
- $tab_array[] = array("Quarantine ({$DATA['TOTAL_QUARANTINED_MESSAGES']})", false, "/dspam-quarantine.php?user={$CURRENT_USER}");
- $tab_array[] = array("Analysis", false, "/dspam-analysis.php?user={$CURRENT_USER}");
- $tab_array[] = array("History", true, "/dspam-history.php?user={$CURRENT_USER}");
- $tab_array[] = array("Train Filter", false, "/dspam-train.php?user={$CURRENT_USER}");
- if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
- $tab_array[] = array("Admin Suite", false, "/dspam-admin.php");
- }
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listhdrr" colspan="6">Statistical SPAM Protection for...</td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell" colspan="2">Username</td>
- <td width="78%" class="vtable" colspan="4">
- <?php if(isset($HTTP_SERVER_VARS['AUTH_USER'])): ?>
- <input type="text" name="username" id="username" value="<?= $CURRENT_USER ?>" class="formfld user"<?php if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) { echo " readonly=\"readonly\""; } ?> />
- <?php else: ?>
- <input type="text" name="username" id="username" value="Please provide a username" class="formfld user" onFocus="this.value='';" />
- <?php endif; ?>
- &nbsp;
- <?php
- if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER']))
- $action = "onClick=\"changeuser();\"";
- else
- $action = "onClick=\"document.iform.submit();\"";
- ?>
- <input type="button" name="change_user" id="change_user" class="formbtn" value="Change" <?= $action ?> />
- </td>
- </tr>
- <tr>
- <td colspan="6" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="middle" class="qnavtdl" colspan="4">
- <input type="submit" class="formbtn" title="Retrain Checked" value="Retrain Checked" name="retrain_checked" id="retrain_checked_top" />
- <label for="retrain_checked_top">&nbsp;because those messages have<strong>n't</strong> been correctly classified.</label>
- </td>
- <td align="right" valign="middle" class="qnavtdr" colspan="2">
- <label for="hperpage-top">Records per page:&nbsp;</label>
- <select class="formselect" id="hperpage-top" name="hperpage" onchange="changeQPerPage(this);">
- <option value="25"<?php if ($CONFIG['HISTORY_PER_PAGE'] == 25) echo ' selected="selected"'; ?>>25</option>
- <option value="50"<?php if ($CONFIG['HISTORY_PER_PAGE'] == 50) echo ' selected="selected"'; ?>>50</option>
- <option value="75"<?php if ($CONFIG['HISTORY_PER_PAGE'] == 75) echo ' selected="selected"'; ?>>75</option>
- <option value="100"<?php if ($CONFIG['HISTORY_PER_PAGE'] == 100) echo ' selected="selected"'; ?>>100</option>
- <option value="125"<?php if ($CONFIG['HISTORY_PER_PAGE'] == 125) echo ' selected="selected"'; ?>>125</option>
- <option value="150"<?php if ($CONFIG['HISTORY_PER_PAGE'] == 150) echo ' selected="selected"'; ?>>150</option>
- </select>
- </td>
- </tr>
- <tr>
- <td class="list" height="12" colspan="6">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic" width="10%">Type</td>
- <td align="left" valign="top" class="listtopic" width="10%">Action</td>
- <td align="left" valign="top" class="listtopic" width="10%">Day/Time</td>
- <td align="left" valign="top" class="listtopic" width="25%">From</td>
- <td align="left" valign="top" class="listtopic" width="25%">Subject</td>
- <td align="left" valign="top" class="listtopic" width="20%">Additional Info</td>
- </tr>
- <?= $DATA['HISTORY']; ?>
- <?= $DATA['HISTORY_FOOTER']; ?>
- <tr>
- <td colspan="6" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="middle" class="qnavtdl" colspan="4">
- <input type="submit" class="formbtn" title="Retrain Checked" value="Retrain Checked" name="retrain_checked" id="retrain_checked_bottom" />
- <label for="retrain_checked_bottom">&nbsp;because those messages have<strong>n't</strong> correctly been classified.</label>
- </td>
- <td align="right" valign="middle" class="qnavtdr" colspan="2">
- <label for="hperpage-bottom">Records per page:&nbsp;</label>
- <select class="formselect" id="hperpage-bottom" name="hperpage" onchange="changeQPerPage(this);">
- <option value="25"<?php if ($CONFIG['HISTORY_PER_PAGE'] == 25) echo ' selected="selected"'; ?>>25</option>
- <option value="50"<?php if ($CONFIG['HISTORY_PER_PAGE'] == 50) echo ' selected="selected"'; ?>>50</option>
- <option value="75"<?php if ($CONFIG['HISTORY_PER_PAGE'] == 75) echo ' selected="selected"'; ?>>75</option>
- <option value="100"<?php if ($CONFIG['HISTORY_PER_PAGE'] == 100) echo ' selected="selected"'; ?>>100</option>
- <option value="125"<?php if ($CONFIG['HISTORY_PER_PAGE'] == 125) echo ' selected="selected"'; ?>>125</option>
- <option value="150"<?php if ($CONFIG['HISTORY_PER_PAGE'] == 150) echo ' selected="selected"'; ?>>150</option>
- </select>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/dspam-perf.php b/config/archive/dspam/www/dspam-perf.php
deleted file mode 100644
index 8b69319f..00000000
--- a/config/archive/dspam/www/dspam-perf.php
+++ /dev/null
@@ -1,222 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-train.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Performance"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-/* if this is an AJAX caller then handle via JSON */
-if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
- $jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-
-EOD;
-
- $jscriptstr .= getJScriptFunction(0);
- $jscriptstr .= <<<EOD
-//-->
-</script>
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<form action="dspam-perf.php" method="post" name="iform" id="iform">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<p>
- <span class="vexpl">
- If you receive a message in your e-mail application that was not caught by
- the filter, please forward it to <strong><?= $DATA['SPAM_ALIAS']; ?></strong>
- so that it can be analyzed and learned as <acronym title="">SPAM</acronym>.
- This will improve the filter's accuracy in the future.
- </span>
-</p>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[] = array("Info", false, "/dspam.php?user={$CURRENT_USER}");
- $tab_array[] = array("Performance", true, "/dspam-perf.php?user={$CURRENT_USER}");
- $tab_array[] = array("Preferences", false, "/dspam-prefs.php?user={$CURRENT_USER}");
- $tab_array[] = array("Alerts", false, "/pkg.php?xml=dspam_alerts.xml&user={$CURRENT_USER}");
- $tab_array[] = array("Quarantine ({$DATA['TOTAL_QUARANTINED_MESSAGES']})", false, "/dspam-quarantine.php?user={$CURRENT_USER}");
- $tab_array[] = array("Analysis", false, "/dspam-analysis.php?user={$CURRENT_USER}");
- $tab_array[] = array("History", false, "/dspam-history.php?user={$CURRENT_USER}");
- $tab_array[] = array("Train Filter", false, "/dspam-train.php?user={$CURRENT_USER}");
- if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
- $tab_array[] = array("Admin Suite", false, "/dspam-admin.php");
- }
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listhdrr" colspan="2">Statistical SPAM Protection for...</td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Username</td>
- <td width="78%" class="vtable">
- <?php if(isset($HTTP_SERVER_VARS['AUTH_USER'])): ?>
- <input type="text" name="username" id="username" value="<?= $CURRENT_USER ?>" class="formfld user"<?php if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) { echo " readonly=\"readonly\""; } ?> />
- <?php else: ?>
- <input type="text" name="username" id="username" value="Please provide a username" class="formfld user" onFocus="this.value='';" />
- <?php endif; ?>
- &nbsp;
- <?php
- if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER']))
- $action = "onClick=\"changeuser();\"";
- else
- $action = "onClick=\"document.iform.submit();\"";
- ?>
- <input type="button" name="change_user" id="change_user" class="formbtn" value="Change" <?= $action ?> />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="2">
- <strong>Performance Statistics</strong> &ndash; <?= date("l dS of F Y h:i:s A"); ?>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="2" class="vncell">
- <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <!- beginn left info pane -->
- <td align="left" valign="top">
- <table border="0" cellpadding="0" cellspacing="0" summary="left info pane">
- <tr>
- <td align="left" valign="top" class="listhdrr" colspan="2">Metric</td>
- <td align="left" valign="top" class="listhdrr">Calculated as</td>
- <td align="left" valign="top" class="list"></td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listr">
- <nobr>Overall accuracy (since last reset)</nobr>
- </td>
- <td align="left" valign="top" class="listr">
- <strong><?= $DATA['OVERALL_ACCURACY']; ?>%</strong>
- </td>
- <td align="left" valign="top" class="listr">(SPAM messages caught + Good messages delivered) / Total number of messages</td>
- <td align="left" valign="top" class="none">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listr">
- <nobr>Spam identification (since last reset)</nobr>
- </td>
- <td align="left" valign="top" class="listr">
- <strong><?= $DATA['SPAM_ACCURACY']; ?>%</strong>
- </td>
- <td align="left" valign="top" class="listr">(Spam catch rate only)</td>
- <td align="left" valign="top" class="none">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listr">
- <nobr>Spam ratio (of total processed)</nobr>
- </td>
- <td align="left" valign="top" class="listr">
- <strong><?= $DATA['SPAM_RATIO']; ?>%</strong>
- </td>
- <td align="left" valign="top" class="listr">Total SPAM messages (both caught & missed) / Total number of messages</td>
- <td align="left" valign="top" class="none">&nbsp;</td>
- </tr>
- </table>
- </td>
- <!-- spacer td -->
- <td align="left" valign="top" class="none">&nbsp;</td>
- <!-- begin right info pane -->
- <td align="left" valign="top">
- <table border="0" cellpadding="0" cellspacing="0" summary="right info pane">
- <tr id="frheader">
- <td class="list">&nbsp;</td>
- <td class="listhdrr">SPAM messages</td>
- <td class="listhdrr">Good messages</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listhdrr">Since last reset</td>
- <td align="left" valign="top" class="listr">
- <nobr><?= $DATA['TOTAL_SPAM_MISSED']; ?> missed</nobr><br />
- <nobr><?= $DATA['TOTAL_SPAM_CAUGHT']; ?> caught</nobr><br />
- <nobr><?= $DATA['SPAM_ACCURACY']; ?>% caught</nobr><br />
- </td>
- <td align="left" valign="top" class="listr">
- <nobr><?= $DATA['TOTAL_NONSPAM_MISSED']; ?> missed</nobr><br />
- <nobr><?= $DATA['TOTAL_NONSPAM_CAUGHT']; ?> delivered</nobr><br />
- <nobr><?= $DATA['NONSPAM_ERROR_RATE']; ?>% missed</nobr><br />
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listhdrr">Total processed by filter</td>
- <td align="left" valign="top" class="listr">
- <nobr><?= $DATA['TOTAL_SPAM_LEARNED']; ?> missed</nobr><br />
- <nobr><?= $DATA['TOTAL_SPAM_SCANNED']; ?> caught</nobr><br />
- </td>
- <td align="left" valign="top" class="listr">
- <nobr><?= $DATA['TOTAL_NONSPAM_LEARNED']; ?> missed</nobr><br />
- <nobr><?= $DATA['TOTAL_NONSPAM_SCANNED']; ?> delivered</nobr><br />
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listhdrr">From corpus</td>
- <td align="left" valign="top" class="listr">
- <nobr><?= $DATA['TOTAL_SPAM_CORPUSFED']; ?> feed</nobr><br />
- </td>
- <td align="left" valign="top" class="listr">
- <nobr><?= $DATA['TOTAL_NONSPAM_CORPUSFED']; ?> feed</nobr><br />
- </td>
- </tr>
- </table>
- </td>
- </table>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="2">
- <p>
- <a href="/dspam-perf.php?user=<?= $CURRENT_USER ?>&command=resetStats">Reset</a>&nbsp;|&nbsp;<a href="/dspam-perf.php?user=<?= $CURRENT_USER ?>&command=tweak">Tweak -1</a>
- </p>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/dspam-prefs.php b/config/archive/dspam/www/dspam-prefs.php
deleted file mode 100644
index 4e6b0f90..00000000
--- a/config/archive/dspam/www/dspam-prefs.php
+++ /dev/null
@@ -1,234 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-train.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Preferences"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-/* if this is an AJAX caller then handle via JSON */
-if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
- $jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-
-EOD;
-
- $jscriptstr .= getJScriptFunction(0);
- $jscriptstr .= <<<EOD
-//-->
-</script>
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<form action="dspam-prefs.php" method="post" name="iform" id="iform">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<p>
- <span class="vexpl">
- This page lets you configure how the filter will handle your messages.
- </span>
-</p>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[] = array("Info", false, "/dspam.php?user={$CURRENT_USER}");
- $tab_array[] = array("Performance", false, "/dspam-perf.php?user={$CURRENT_USER}");
- $tab_array[] = array("Preferences", true, "/dspam-prefs.php?user={$CURRENT_USER}");
- $tab_array[] = array("Alerts", false, "/pkg.php?xml=dspam_alerts.xml");
- $tab_array[] = array("Quarantine ({$DATA['TOTAL_QUARANTINED_MESSAGES']})", false, "/dspam-quarantine.php?user={$CURRENT_USER}");
- $tab_array[] = array("Analysis", false, "/dspam-analysis.php?user={$CURRENT_USER}");
- $tab_array[] = array("History", false, "/dspam-history.php?user={$CURRENT_USER}");
- $tab_array[] = array("Train Filter", false, "/dspam-train.php?user={$CURRENT_USER}");
- if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
- $tab_array[] = array("Admin Suite", false, "/dspam-admin.php");
- }
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listhdrr" colspan="2">Statistical SPAM Protection for...</td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Username</td>
- <td width="78%" class="vtable">
- <?php if(isset($HTTP_SERVER_VARS['AUTH_USER'])): ?>
- <input type="text" name="username" id="username" value="<?= $CURRENT_USER; ?>" class="formfld user"<?php if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) { echo " readonly=\"readonly\""; } ?> />
- <?php else: ?>
- <input type="text" name="username" id="username" value="Please provide a username" class="formfld user" onFocus="this.value='';" />
- <?php endif; ?>
- &nbsp;
- <?php
- if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER']))
- $action = "onClick=\"changeuser();\"";
- else
- $action = "onClick=\"document.iform.submit();\"";
- ?>
- <input type="button" name="change_user" id="change_user" class="formbtn" value="Change" <?= $action ?> />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="2">
- <strong>Training</strong> &ndash; Configure how the filter learns as it processes messages
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" class="vncell" width="40%">
- <p>DSPAM should train:</p>
- <input <?= $DATA["S_TEFT"]; ?> value="TEFT" type="radio" class="formfld" title="On every new message scanned by the filter" alt="On every new message scanned by the filter" name="rad_train" id="rad_train_one" />
- <label for="rad_train_one">&nbsp;On every new message scanned by the filter (TEFT)</label>
- <br />
- <input <?= $DATA["S_TOE"]; ?> value="TOE" type="radio" class="formfld" title="Only when the filter makes a mistake" alt="Only when the filter makes a mistake" name="rad_train" id="rad_train_two" />
- <label for="rad_train_two">&nbsp;Only when the filter makes a mistake (TOE)</label>
- <br />
- <input <?= $DATA["S_TUM"]; ?> value="TUM" type="radio" class="formfld" title=";Only with new data or if the filter makes a mistake" alt=";Only with new data or if the filter makes a mistake" name="rad_train" id="rad_train_three" />
- <label for="rad_train_three">&nbsp;Only with new data or if the filter makes a mistake (TUM)</label>
- </td>
- <td align="left" valign="top" class="vncell" width="60%">
- <p>When I train DSPAM, I prefer:</p>
- <input value="message" <?= $DATA["S_LOC_MESSAGE"]; ?> value="message" type="radio" class="formfld" title="To forward my spams (signature appears in message body)" alt="To forward my spams (signature appears in message body)" name="rad_train_action" id="rad_train_action_one" />
- <label for="rad_train_action_one">&nbsp;To <u>forward</u> my spams (signature appears in message body)</label>
- <br />
- <input <?= $DATA["S_LOC_HEADERS"]; ?> value="headers" type="radio" class="formfld" title="To bounce my spams (signature appears in message headers)" alt="To bounce my spams (signature appears in message headers)" name="rad_train_action" id="rad_train_action_two" />
- <label value="headers" for="rad_train_action_two">&nbsp;To <u>bounce</u> my spams (signature appears in message headers)</label>
- </td>
- </tr>
- <tr>
- <td align="left" valign="middle" class="vncell" colspan="2">
- <p>
- Filter sensitivity <strong>during</strong> the training period:
- </p>
- <p align="center">
- <nobr>
- <span>
- Catch SPAM (More in Quarantine)&nbsp;
- <input value="0" type="radio" class="formfld" title="-5" alt="-5" name="rad_filter_sens" <?= $DATA["SEDATION_0"]; ?> />
- <input value="1" type="radio" class="formfld" title="-4" alt="-4" name="rad_filter_sens" <?= $DATA["SEDATION_1"]; ?> />
- <input value="2" type="radio" class="formfld" title="-3" alt="-3" name="rad_filter_sens" <?= $DATA["SEDATION_2"]; ?> />
- <input value="3" type="radio" class="formfld" title="-2" alt="-2" name="rad_filter_sens" <?= $DATA["SEDATION_3"]; ?> />
- <input value="4" type="radio" class="formfld" title="-1" alt="-1" name="rad_filter_sens" <?= $DATA["SEDATION_4"]; ?> />
- <strong style="font-size: larger;">&raquo;</strong>
- <input value="5" type="radio" class="formfld" title="0" alt="0" name="rad_filter_sens" <?= $DATA["SEDATION_5"]; ?> />
- <strong style="font-size: larger;">&laquo;</strong>
- <input value="6" type="radio" class="formfld" title="1" alt="1" name="rad_filter_sens" <?= $DATA["SEDATION_6"]; ?> />
- <input value="7" type="radio" class="formfld" title="2" alt="2" name="rad_filter_sens" <?= $DATA["SEDATION_7"]; ?> />
- <input value="8" type="radio" class="formfld" title="3" alt="3" name="rad_filter_sens" <?= $DATA["SEDATION_8"]; ?> />
- <input value="9" type="radio" class="formfld" title="4" alt="4" name="rad_filter_sens" <?= $DATA["SEDATION_9"]; ?> />
- <input value="10" type="radio" class="formfld" title="5" alt="5" name="rad_filter_sens" <?= $DATA["SEDATION_10"]; ?> />
- &nbsp;Assume Good (Fewer in Quarantine)
- </span>
- </nobr>
- </p>
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="2">
- <strong>Message Handling</strong> &ndash; Configure how SPAM is handled
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" class="vncell" colspan="2">
- <p>When a SPAM message is identified:</p>
- <p>
- <input value="quarantine" <?= $DATA["S_ACTION_QUARANTINE"]; ?> type="radio" class="formfld" title="Quarantine the message" alt="Quarantine the message" name="rad_ident_action" id="rad_ident_action_one" />
- <label for="rad_ident_action_one">&nbsp;Quarantine the message</label>
- <br />
- <input value="tag" <?= $DATA["S_ACTION_TAG"]; ?> type="radio" class="formfld" title="Tag the Subject header with" alt="Tag the Subject header with" name="rad_ident_action" id="rad_ident_action_two" />
- <label for="rad_ident_action_two">Tag the Subject header with&nbsp;</label>
- <input size="35" type="text" class="formfld mail" title="message tag" alt="message tag" value="<?= $DATA["SPAM_SUBJECT"]; ?>" name="msgtag" />
- <br />
- <input value="deliver" <?= $DATA["S_ACTION_DELIVER"]; ?> type="radio" class="formfld" title="Deliver the message normally with a X-DSPAM-Result header" alt="Deliver the message normally with a X-DSPAM-Result header" name="rad_ident_action" id="rad_ident_action_three" />
- <label for="rad_ident_action_three">&nbsp;Deliver the message normally with a X-DSPAM-Result header</label>
- </p>
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="2">
- <strong>Features</strong> &ndash; Tuning SPAM filtering
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" class="vncell" colspan="2">
- <p>
- <input <?= $DATA["C_BNR"]; ?> type="checkbox" class="formbtn" title="Enable noise reduction, which usually improves filtering accuracy" alt="Enable noise reduction, which usually improves filtering accuracy" name="chk_feature_nr" id="chk_feature_nr" />
- <label for="chk_feature_nr">&nbsp;Enable noise reduction, which usually improves filtering accuracy</label>
- <br />
- <input <?= $DATA["C_WHITELIST"]; ?> type="checkbox" class="formbtn" title="Enable automatic whitelisting to record frequent correspondence" alt="Enable automatic whitelisting to record frequent correspondence" name="chk_feature_aw" id="chk_feature_aw" />
- <label for="chk_feature_aw">&nbsp;Enable automatic whitelisting to record frequent correspondence</label>
- <br />
- <input <?= $DATA["C_FACTORS"]; ?> type="checkbox" class="formbtn" title="Add the factoring tokens in each email into the message's full headers" alt="Add the factoring tokens in each email into the message's full headers" name="chk_feature_at" id="chk_feature_at" />
- <label for="chk_feature_at">&nbsp;Add the factoring tokens in each email into the message's full headers</label>
- <!--
- <input type="checkbox" class="formbtn" title="Add the factoring tokens in each email into the message's full headers" alt="Add the factoring tokens in each email into the message's full headers" name="chk_feature_at" id="chk_feature_at" />
- <label for="chk_feature_at">&nbsp;Add the factoring tokens in each email into the message's full headers</label>
- <br />
- <input type="checkbox" class="formbtn" title="opt in of DSPAM filtering" alt="opt in of DSPAM filtering" name="chk_feature_optin" id="chk_feature_optin" />
- <label for="chk_feature_optin">&nbsp;opt in of DSPAM filtering</label>
- <br />
- <input type="checkbox" class="formbtn" title="opt out of DSPAM filtering" alt="opt out of DSPAM filtering" name="chk_feature_optout" id="chk_feature_optout" />
- <label for="chk_feature_optout">&nbsp;opt out of DSPAM filtering</label>
- -->
- </p>
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td class="list">&nbsp;</td>
- <td class="list">
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/dspam-quarantine.php b/config/archive/dspam/www/dspam-quarantine.php
deleted file mode 100644
index bc205a50..00000000
--- a/config/archive/dspam/www/dspam-quarantine.php
+++ /dev/null
@@ -1,178 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-train.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Quarantine"),
- gettext("Overview"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-/* if this is an AJAX caller then handle via JSON */
-if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
- $jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-
-EOD;
-
- $jscriptstr .= getJScriptFunction(0);
- $jscriptstr .= getJScriptFunction(1);
- $jscriptstr .= getJScriptFunction(2);
- $jscriptstr .= getJScriptFunction(3);
- $jscriptstr .= getJScriptFunction(4);
- $jscriptstr .= <<<EOD
-//-->
-</script>
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-$pfSenseHead->addLink("<link rel=\"stylesheet\" type=\"text/css\" href=\"/themes/" . $g['theme'] . "/dspam.css\" media=\"all\" />\n");
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<form action="dspam-quarantine.php" method="post" name="iform" id="iform">
-<input type="hidden" name="command" value="processQuarantine" />
-<input type="hidden" name="processAction" value="None" />
-<input type="hidden" name="qpage" value="<?= $DATA['QPAGE']; ?>" />
-<input type="hidden" name="sortby" value="<?= $DATA['SORTBY']; ?>" >
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<p>
- <span class="vexpl">
- The messages below have not been delivered to your normal e-mail application
- because they are believed to be spam. Click on the Subject line to view the
- message or choose a sort option to change how messages are sorted. Use the
- checkboxes and <strong>Deliver Checked</strong> to deliver messages you want
- to read, or use <strong>Delete All</strong> to empty the quarantine.
- </span>
-</p>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[] = array("Info", false, "/dspam.php?user={$CURRENT_USER}");
- $tab_array[] = array("Performance", false, "/dspam-perf.php?user={$CURRENT_USER}");
- $tab_array[] = array("Preferences", false, "/dspam-prefs.php?user={$CURRENT_USER}");
- $tab_array[] = array("Alerts", false, "/pkg.php?xml=dspam_alerts.xml&user={$CURRENT_USER}");
- $tab_array[] = array("Quarantine ({$DATA['TOTAL_QUARANTINED_MESSAGES']})", true, "/dspam-quarantine.php?user={$CURRENT_USER}");
- $tab_array[] = array("Analysis", false, "/dspam-analysis.php?user={$CURRENT_USER}");
- $tab_array[] = array("History", false, "/dspam-history.php?user={$CURRENT_USER}");
- $tab_array[] = array("Train Filter", false, "/dspam-train.php?user={$CURRENT_USER}");
- if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
- $tab_array[] = array("Admin Suite", false, "/dspam-admin.php");
- }
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listhdrr" colspan="5">Statistical SPAM Protection for...</td>
- </tr>
- <tr>
- <td width="10%" valign="baseline" class="vncell" colspan="2">Username</td>
- <td width="90%" class="vtable" colspan="3">
- <?php if(isset($HTTP_SERVER_VARS['AUTH_USER'])): ?>
- <input type="text" name="username" id="username" value="<?= $CURRENT_USER ?>" class="formfld user"<?php if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) { echo " readonly=\"readonly\""; } ?> />
- <?php else: ?>
- <input type="text" name="username" id="username" value="Please provide a username" class="formfld user" onFocus="this.value='';" />
- <?php endif; ?>
- &nbsp;
- <?php
- if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER']))
- $action = "onClick=\"changeuser();\"";
- else
- $action = "onClick=\"document.iform.submit();\"";
- ?>
- <input type="button" name="change_user" id="change_user" class="formbtn" value="Change" <?= $action ?> />
- </td>
- </tr>
- <tr>
- <td colspan="5" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="middle" colspan="4" class="qnavtdl">
- <nobr>
- <input type="button" class="formbtn" title="Deliver Checked" value="Deliver Checked" name="delichk" id="delichk" onclick="processmsg(0);" />&nbsp;
- <input type="button" class="formbtn" title="Delete Checked" value="Delete Checked" name="delchk" id="delchk" onclick="processmsg(1);" />&nbsp;
- <input type="button" class="formbtn" title="Delete All" value="Delete All" name="delall" id="delall" onclick="processmsg(2);" />
- </nobr>
- </td>
- <td align="right" valign="middle" class="qnavtdr">
- <label for="qperpage-top">Records per page:&nbsp;</label>
- <select class="formselect" id="qperpage-top" name="qperpage" onchange="changeQPerPage(this);">
- <option value="25"<?php if ($CONFIG['QUARANTINE_PER_PAGE'] == 25) echo ' selected="selected"'; ?>>25</option>
- <option value="50"<?php if ($CONFIG['QUARANTINE_PER_PAGE'] == 50) echo ' selected="selected"'; ?>>50</option>
- <option value="75"<?php if ($CONFIG['QUARANTINE_PER_PAGE'] == 75) echo ' selected="selected"'; ?>>75</option>
- <option value="100"<?php if ($CONFIG['QUARANTINE_PER_PAGE'] == 100) echo ' selected="selected"'; ?>>100</option>
- <option value="125"<?php if ($CONFIG['QUARANTINE_PER_PAGE'] == 125) echo ' selected="selected"'; ?>>125</option>
- <option value="150"<?php if ($CONFIG['QUARANTINE_PER_PAGE'] == 150) echo ' selected="selected"'; ?>>150</option>
- </select>
- </td>
- </tr>
- <tr>
- <td colspan="5" class="list" height="12">&nbsp;</td>
- </tr>
- <?= $DATA['SORT_SELECTOR']; ?>
- <?= $DATA['QUARANTINE']; ?>
- <?= $DATA['QUARANTINE_FOOTER']; ?>
- <tr>
- <td colspan="5" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="middle" colspan="4" class="qnavtdl">
- <nobr>
- <input type="button" class="formbtn" title="Deliver Checked" value="Deliver Checked" name="delichk" id="delichk" onclick="processmsg(0);" />&nbsp;
- <input type="button" class="formbtn" title="Delete Checked" value="Delete Checked" name="delchk" id="delchk" onclick="processmsg(1);" />&nbsp;
- <input type="button" class="formbtn" title="Delete All" value="Delete All" name="delall" id="delall" onclick="processmsg(2);" />
- </nobr>
- </td>
- <td align="right" valign="middle" class="qnavtdr">
- <label for="qperpage-bottom">Records per page:&nbsp;</label>
- <select class="formselect" id="qperpage-bottom" name="qperpage" onchange="changeQPerPage(this);">
- <option value="25"<?php if ($CONFIG['QUARANTINE_PER_PAGE'] == 25) echo ' selected="selected"'; ?>>25</option>
- <option value="50"<?php if ($CONFIG['QUARANTINE_PER_PAGE'] == 50) echo ' selected="selected"'; ?>>50</option>
- <option value="75"<?php if ($CONFIG['QUARANTINE_PER_PAGE'] == 75) echo ' selected="selected"'; ?>>75</option>
- <option value="100"<?php if ($CONFIG['QUARANTINE_PER_PAGE'] == 100) echo ' selected="selected"'; ?>>100</option>
- <option value="125"<?php if ($CONFIG['QUARANTINE_PER_PAGE'] == 125) echo ' selected="selected"'; ?>>125</option>
- <option value="150"<?php if ($CONFIG['QUARANTINE_PER_PAGE'] == 150) echo ' selected="selected"'; ?>>150</option>
- </select>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/dspam-settings-algo.php b/config/archive/dspam/www/dspam-settings-algo.php
deleted file mode 100644
index 58ffb247..00000000
--- a/config/archive/dspam/www/dspam-settings-algo.php
+++ /dev/null
@@ -1,204 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-settings-algo.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Advanced Settings"),
- gettext("Edit Algorithm"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
-
-/*
- The following code presumes, that the following XML structure exists or
- if it does not exist, it will be created.
-
- <algorithm>
- <name>foo</name>
- <descr>foo desc</descr>
- </algorithm>
- <algorithm>
- <name>bar</name>
- <descr>bar desc</descr>
- </algorithm>
-*/
-
-if (!is_array($config['installedpackages']['dspam']['config'][0]['algorithm'])) {
- $config['installedpackages']['dspam']['config'][0]['algorithm'] = array();
-}
-
-$t_algos = &$config['installedpackages']['dspam']['config'][0]['algorithm'];
-
-/* ID is only set if the user wants to edit an existing entry */
-$id = $_GET['id'];
-$sectionid = $_GET['sectionid'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-if (isset($_POST['sectionid']))
- $sectionid = $_POST['sectionid'];
-
-if (isset($id) && $t_algos[$id]) {
- $pconfig['name'] = $t_algos[$id]['name'];
- $pconfig['descr'] = $t_algos[$id]['descr'];
-} else {
- $pconfig['name'] = $_GET['aname'];
- $pconfig['descr'] = $_GET['descr'];
-}
-
-if ($_POST) {
-
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = explode(" ", "aname");
- $reqdfieldsn = explode(",", "DSPAM Algorithm Name");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- /* check for overlaps */
- foreach ($t_algos as $algo) {
- if (isset($id) && ($t_algos[$id]) && ($t_algos[$id] === $algo)) {
- continue;
- }
- if ($algo['name'] == $_POST['aname']) {
- $input_errors[] = gettext("This algorithm name already exists.");
- break;
- }
- }
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- if (!$input_errors) {
- $algo = array();
- $algo['name'] = $_POST['aname'];
- $algo['descr'] = $_POST['descr'];
-
- if (isset($id) && $t_algos[$id])
- $t_algos[$id] = $algo;
- else
- $t_algos[] = $algo;
-
- write_config();
-
- $retval = 0;
- config_lock();
- $retval = dspam_configure();
- config_unlock();
-
- $savemsg = get_std_save_message($retval);
-
- isset($sectionid) ? $header = "dspam-settings.php?sectionid={$sectionid}" : $header = "dspam-settings.php";
- pfSenseHeader($header);
- exit;
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="dspam-settings-algo.php" method="post" name="iform" id="iform">
- <div name="inputerrors" id="inputerrors"></div>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("DSPAM Algorithm Name");?></td>
- <td width="78%" class="vtable">
- <!-- <input name="aname" type="text" class="formfld" id="aname" size="30" value="<?=htmlspecialchars($pconfig['name']);?>"> -->
- <select name="aname" id="aname" class="formselect">
- <option value="naive" <?php if($pconfig['name'] == "naive") echo('selected=\"selected\"');?>>naive</option>
- <option value="graham" <?php if($pconfig['name'] == "graham") echo('selected=\"selected\"');?>>graham</option>
- <option value="burton" <?php if($pconfig['name'] == "burton") echo('selected=\"selected\"');?>>burton</option>
- <option value="robinson" <?php if($pconfig['name'] == "robinson") echo('selected=\"selected\"');?>>robinson</option>
- <option value="chi-square" <?php if($pconfig['name'] == "chi-square") echo('selected=\"selected\"');?>>chi-square</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
- <td width="78%" class="vtable">
- <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
- <br> <span class="vexpl"><?=gettext("You may enter a description here
- for your reference (not parsed).");?></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>"> <input id="cancelbutton" class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()">
- <?php if (isset($id) && $t_algos[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- <?php if (isset($sectionid)): ?>
- <input name="sectionid" type="hidden" value="<?=$sectionid;?>">
- <?php endif; ?>
- </td>
- </tr>
- </table>
- </form>
-<?
- } else {
-?>
-<?php
- $input_errors[] = "Access to this particular site was denied. You need DSPAM admin access rights to be able to view it.";
-
- include("head.inc");
- echo $pfSenseHead->getHTML();
-?>
-<?php include("fbegin.inc");?>
-<?php if ($input_errors) print_input_errors($input_errors);?>
-<?php if ($savemsg) print_info_box($savemsg);?>
- <body link="#000000" vlink="#000000" alink="#000000">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="listtopic">Access denied for: <?=$HTTP_SERVER_VARS['AUTH_USER']?></td>
- </tr>
- </table>
-<?php
- } // end of access denied code
-?>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/dspam/www/dspam-settings-bmta.php b/config/archive/dspam/www/dspam-settings-bmta.php
deleted file mode 100644
index c670085d..00000000
--- a/config/archive/dspam/www/dspam-settings-bmta.php
+++ /dev/null
@@ -1,202 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-settings-feat.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Advanced Settings"),
- gettext("Edit Broken MTA Settings"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
-
-/*
- The following code presumes, that the following XML structure exists or
- if it does not exist, it will be created.
-
- <bmta>
- <name>foo</name>
- <descr>foo desc</descr>
- </bmta>
- <bmta>
- <name>bar</name>
- <descr>bar desc</descr>
- </bmta>
-*/
-
-if (!is_array($config['installedpackages']['dspam']['config'][0]['bmta'])) {
- $config['installedpackages']['dspam']['config'][0]['bmta'] = array();
-}
-
-$t_bmtas = &$config['installedpackages']['dspam']['config'][0]['bmta'];
-
-/* ID is only set if the user wants to edit an existing entry */
-$id = $_GET['id'];
-$sectionid = $_GET['sectionid'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-if (isset($_POST['sectionid']))
- $sectionid = $_POST['sectionid'];
-
-if (isset($id) && $t_bmtas[$id]) {
- $pconfig['name'] = $t_bmtas[$id]['name'];
- $pconfig['descr'] = $t_bmtas[$id]['descr'];
-} else {
- $pconfig['name'] = $_GET['oname'];
- $pconfig['descr'] = $_GET['descr'];
-}
-
-if ($_POST) {
-
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = explode(" ", "oname");
- $reqdfieldsn = explode(",", "Broken MTA Option Name");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- /* check for overlaps */
- foreach ($t_bmtas as $bmta) {
- if (isset($id) && ($t_bmtas[$id]) && ($t_bmtas[$id] === $bmta)) {
- continue;
- }
- if ($bmta['name'] == $_POST['oname']) {
- $input_errors[] = gettext("This option name already exists.");
- break;
- }
- }
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- if (!$input_errors) {
- $bmta = array();
- $bmta['name'] = $_POST['oname'];
- $bmta['descr'] = $_POST['descr'];
-
- if (isset($id) && $t_bmtas[$id])
- $t_bmtas[$id] = $bmta;
- else
- $t_bmtas[] = $bmta;
-
- write_config();
-
- $retval = 0;
- config_lock();
- $retval = dspam_configure();
- config_unlock();
-
- $savemsg = get_std_save_message($retval);
-
- isset($sectionid) ? $header = "dspam-settings.php?sectionid={$sectionid}" : $header = "dspam-settings.php";
- pfSenseHeader($header);
- exit;
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="dspam-settings-bmta.php" method="post" name="iform" id="iform">
- <div name="inputerrors" id="inputerrors"></div>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("DSPAM Feature Name");?></td>
- <td width="78%" class="vtable">
- <!-- <input name="oname" type="text" class="formfld" id="oname" size="30" value="<?=htmlspecialchars($pconfig['name']);?>"> -->
- <select name="oname" id="oname" class="formselect">
- <option value="returnCodes" <?php if($pconfig['name'] == "returnCodes") echo('selected=\"selected\"');?>>returnCodes</option>
- <option value="case" <?php if($pconfig['name'] == "case") echo('selected=\"selected\"');?>>case</option>
- <option value="lineStripping" <?php if($pconfig['name'] == "lineStripping") echo('selected=\"selected\"');?>>lineStripping</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
- <td width="78%" class="vtable">
- <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
- <br> <span class="vexpl"><?=gettext("You may enter a description here
- for your reference (not parsed).");?></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>"> <input id="cancelbutton" class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()">
- <?php if (isset($id) && $t_bmtas[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- <?php if (isset($sectionid)): ?>
- <input name="sectionid" type="hidden" value="<?=$sectionid;?>">
- <?php endif; ?>
- </td>
- </tr>
- </table>
-</form>
-<?
- } else {
-?>
-<?php
- $input_errors[] = "Access to this particular site was denied. You need DSPAM admin access rights to be able to view it.";
-
- include("head.inc");
- echo $pfSenseHead->getHTML();
-?>
-<?php include("fbegin.inc");?>
-<?php if ($input_errors) print_input_errors($input_errors);?>
-<?php if ($savemsg) print_info_box($savemsg);?>
- <body link="#000000" vlink="#000000" alink="#000000">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="listtopic">Access denied for: <?=$HTTP_SERVER_VARS['AUTH_USER']?></td>
- </tr>
- </table>
-<?php
- } // end of access denied code
-?>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/dspam/www/dspam-settings-feat.php b/config/archive/dspam/www/dspam-settings-feat.php
deleted file mode 100644
index 7805fa43..00000000
--- a/config/archive/dspam/www/dspam-settings-feat.php
+++ /dev/null
@@ -1,203 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-settings-feat.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Advanced Settings"),
- gettext("Edit DSPAM Feature"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
-
-/*
- The following code presumes, that the following XML structure exists or
- if it does not exist, it will be created.
-
- <feature>
- <name>foo</name>
- <descr>foo desc</descr>
- </feature>
- <feature>
- <name>bar</name>
- <descr>bar desc</descr>
- </feature>
-*/
-
-if (!is_array($config['installedpackages']['dspam']['config'][0]['feature'])) {
- $config['installedpackages']['dspam']['config'][0]['feature'] = array();
-}
-
-$t_features = &$config['installedpackages']['dspam']['config'][0]['feature'];
-
-/* ID is only set if the user wants to edit an existing entry */
-$id = $_GET['id'];
-$sectionid = $_GET['sectionid'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-if (isset($_POST['sectionid']))
- $sectionid = $_POST['sectionid'];
-
-if (isset($id) && $t_features[$id]) {
- $pconfig['name'] = $t_features[$id]['name'];
- $pconfig['descr'] = $t_features[$id]['descr'];
-} else {
- $pconfig['name'] = $_GET['fname'];
- $pconfig['descr'] = $_GET['descr'];
-}
-
-if ($_POST) {
-
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = explode(" ", "fname");
- $reqdfieldsn = explode(",", "DSPAM Feature Name");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- /* check for overlaps */
- foreach ($t_features as $feature) {
- if (isset($id) && ($t_features[$id]) && ($t_features[$id] === $feature)) {
- continue;
- }
- if ($feature['name'] == $_POST['fname']) {
- $input_errors[] = gettext("This feature name already exists.");
- break;
- }
- }
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- if (!$input_errors) {
- $feature = array();
- $feature['name'] = $_POST['fname'];
- $feature['descr'] = $_POST['descr'];
-
- if (isset($id) && $t_features[$id])
- $t_features[$id] = $feature;
- else
- $t_features[] = $feature;
-
- write_config();
-
- $retval = 0;
- config_lock();
- $retval = dspam_configure();
- config_unlock();
-
- $savemsg = get_std_save_message($retval);
-
- isset($sectionid) ? $header = "dspam-settings.php?sectionid={$sectionid}" : $header = "dspam-settings.php";
- pfSenseHeader($header);
- exit;
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="dspam-settings-feat.php" method="post" name="iform" id="iform">
- <div name="inputerrors" id="inputerrors"></div>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("DSPAM Feature Name");?></td>
- <td width="78%" class="vtable">
- <!-- <input name="fname" type="text" class="formfld" id="fname" size="30" value="<?=htmlspecialchars($pconfig['name']);?>"> -->
- <select name="fname" id="fname" class="formselect">
- <option value="sbph" <?php if($pconfig['name'] == "sbph") echo('selected=\"selected\"');?>>sbph</option>
- <option value="noise" <?php if($pconfig['name'] == "noise") echo('selected=\"selected\"');?>>noise</option>
- <option value="chained" <?php if($pconfig['name'] == "chained") echo('selected=\"selected\"');?>>chained</option>
- <option value="whitelist" <?php if($pconfig['name'] == "whitelist") echo('selected=\"selected\"');?>>whitelist</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
- <td width="78%" class="vtable">
- <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
- <br> <span class="vexpl"><?=gettext("You may enter a description here
- for your reference (not parsed).");?></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>"> <input id="cancelbutton" class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()">
- <?php if (isset($id) && $t_features[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- <?php if (isset($sectionid)): ?>
- <input name="sectionid" type="hidden" value="<?=$sectionid;?>">
- <?php endif; ?>
- </td>
- </tr>
- </table>
-</form>
-<?
- } else {
-?>
-<?php
- $input_errors[] = "Access to this particular site was denied. You need DSPAM admin access rights to be able to view it.";
-
- include("head.inc");
- echo $pfSenseHead->getHTML();
-?>
-<?php include("fbegin.inc");?>
-<?php if ($input_errors) print_input_errors($input_errors);?>
-<?php if ($savemsg) print_info_box($savemsg);?>
- <body link="#000000" vlink="#000000" alink="#000000">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="listtopic">Access denied for: <?=$HTTP_SERVER_VARS['AUTH_USER']?></td>
- </tr>
- </table>
-<?php
- } // end of access denied code
-?>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/dspam/www/dspam-settings-header.php b/config/archive/dspam/www/dspam-settings-header.php
deleted file mode 100644
index d0a5dd9c..00000000
--- a/config/archive/dspam/www/dspam-settings-header.php
+++ /dev/null
@@ -1,197 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-settings-tuser.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Advanced Settings"),
- gettext("Edit Mail Header"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
-
-/*
- The following code presumes, that the following XML structure exists or
- if it does not exist, it will be created.
-
- <header>
- <name>foo</name>
- <descr>foo desc</descr>
- </header>
- <header>
- <name>bar</name>
- <descr>foo desc</descr>
- </header>
-*/
-
-if (!is_array($config['installedpackages']['dspam']['config'][0]['header'])) {
- $config['installedpackages']['dspam']['config'][0]['header'] = array();
-}
-
-$t_headers = &$config['installedpackages']['dspam']['config'][0]['header'];
-
-/* ID is only set if the user wants to edit an existing entry */
-$id = $_GET['id'];
-$sectionid = $_GET['sectionid'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-if (isset($_POST['sectionid']))
- $sectionid = $_POST['sectionid'];
-
-if (isset($id) && $t_headers[$id]) {
- $pconfig['name'] = $t_headers[$id]['name'];
- $pconfig['descr'] = $t_headers[$id]['descr'];
-} else {
- $pconfig['name'] = $_GET['hname'];
- $pconfig['descr'] = $_GET['descr'];
-}
-
-if ($_POST) {
-
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = explode(" ", "hname");
- $reqdfieldsn = explode(",", "Header Name");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- /* check for overlaps */
- foreach ($t_headers as $header) {
- if (isset($id) && ($t_headers[$id]) && ($t_headers[$id] === $header)) {
- continue;
- }
- if ($header['name'] == $_POST['hname']) {
- $input_errors[] = gettext("This header name already exists.");
- break;
- }
- }
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- if (!$input_errors) {
- $header = array();
- $header['name'] = $_POST['hname'];
- $header['descr'] = $_POST['descr'];
-
- if (isset($id) && $t_headers[$id])
- $t_headers[$id] = $header;
- else
- $t_headers[] = $header;
-
- write_config();
-
- $retval = 0;
- config_lock();
- $retval = dspam_configure();
- config_unlock();
-
- $savemsg = get_std_save_message($retval);
-
- isset($sectionid) ? $header = "dspam-settings.php?sectionid={$sectionid}" : $header = "dspam-settings.php";
- pfSenseHeader($header);
- exit;
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="dspam-settings-header.php" method="post" name="iform" id="iform">
- <div name="inputerrors" id="inputerrors"></div>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Header Name");?></td>
- <td width="78%" class="vtable">
- <input name="hname" type="text" class="formfld unknown" id="hname" size="30" value="<?=htmlspecialchars($pconfig['name']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
- <td width="78%" class="vtable">
- <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
- <br> <span class="vexpl"><?=gettext("You may enter a description here
- for your reference (not parsed).");?></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>"> <input id="cancelbutton" class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()">
- <?php if (isset($id) && $t_headers[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- <?php if (isset($sectionid)): ?>
- <input name="sectionid" type="hidden" value="<?=$sectionid;?>">
- <?php endif; ?>
- </td>
- </tr>
- </table>
-</form>
-<?
- } else {
-?>
-<?php
- $input_errors[] = "Access to this particular site was denied. You need DSPAM admin access rights to be able to view it.";
-
- include("head.inc");
- echo $pfSenseHead->getHTML();
-?>
-<?php include("fbegin.inc");?>
-<?php if ($input_errors) print_input_errors($input_errors);?>
-<?php if ($savemsg) print_info_box($savemsg);?>
- <body link="#000000" vlink="#000000" alink="#000000">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="listtopic">Access denied for: <?=$HTTP_SERVER_VARS['AUTH_USER']?></td>
- </tr>
- </table>
-<?php
- } // end of access denied code
-?>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/dspam/www/dspam-settings-overr.php b/config/archive/dspam/www/dspam-settings-overr.php
deleted file mode 100644
index d938b313..00000000
--- a/config/archive/dspam/www/dspam-settings-overr.php
+++ /dev/null
@@ -1,197 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-settings-overr.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Advanced Settings"),
- gettext("Edit Override Value"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
-
-/*
- The following code presumes, that the following XML structure exists or
- if it does not exist, it will be created.
-
- <override>
- <value>foo</value>
- <descr>foo desc</descr>
- </override>
- <override>
- <value>bar</value>
- <descr>bar desc</descr>
- </override>
-*/
-
-if (!is_array($config['installedpackages']['dspam']['config'][0]['override'])) {
- $config['installedpackages']['dspam']['config'][0]['override'] = array();
-}
-
-$t_overr = &$config['installedpackages']['dspam']['config'][0]['override'];
-
-/* ID is only set if the user wants to edit an existing entry */
-$id = $_GET['id'];
-$sectionid = $_GET['sectionid'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-if (isset($_POST['sectionid']))
- $sectionid = $_POST['sectionid'];
-
-if (isset($id) && $t_overr[$id]) {
- $pconfig['value'] = $t_overr[$id]['value'];
- $pconfig['descr'] = $t_overr[$id]['descr'];
-} else {
- $pconfig['value'] = $_GET['ovalue'];
- $pconfig['descr'] = $_GET['descr'];
-}
-
-if ($_POST) {
-
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = explode(" ", "ovalue");
- $reqdfieldsn = explode(",", "DSPAM Override Value");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- /* check for overlaps */
- foreach ($t_overr as $over) {
- if (isset($id) && ($t_overr[$id]) && ($t_overr[$id] === $over)) {
- continue;
- }
- if ($over['value'] == $_POST['ovalue']) {
- $input_errors[] = gettext("This override value exists.");
- break;
- }
- }
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- if (!$input_errors) {
- $over = array();
- $over['value'] = $_POST['ovalue'];
- $over['descr'] = $_POST['descr'];
-
- if (isset($id) && $t_overr[$id])
- $t_overr[$id] = $over;
- else
- $t_overr[] = $over;
-
- write_config();
-
- $retval = 0;
- config_lock();
- $retval = dspam_configure();
- config_unlock();
-
- $savemsg = get_std_save_message($retval);
-
- isset($sectionid) ? $header = "dspam-settings.php?sectionid={$sectionid}" : $header = "dspam-settings.php";
- pfSenseHeader($header);
- exit;
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="dspam-settings-overr.php" method="post" name="iform" id="iform">
- <div name="inputerrors" id="inputerrors"></div>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("DSPAM Override Value");?></td>
- <td width="78%" class="vtable">
- <input name="ovalue" type="text" class="formfld unknown" id="ovalue" size="30" value="<?=htmlspecialchars($pconfig['value']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
- <td width="78%" class="vtable">
- <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
- <br> <span class="vexpl"><?=gettext("You may enter a description here
- for your reference (not parsed).");?></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>"> <input id="cancelbutton" class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()">
- <?php if (isset($id) && $t_overr[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- <?php if (isset($sectionid)): ?>
- <input name="sectionid" type="hidden" value="<?=$sectionid;?>">
- <?php endif; ?>
- </td>
- </tr>
- </table>
-</form>
-<?
- } else {
-?>
-<?php
- $input_errors[] = "Access to this particular site was denied. You need DSPAM admin access rights to be able to view it.";
-
- include("head.inc");
- echo $pfSenseHead->getHTML();
-?>
-<?php include("fbegin.inc");?>
-<?php if ($input_errors) print_input_errors($input_errors);?>
-<?php if ($savemsg) print_info_box($savemsg);?>
- <body link="#000000" vlink="#000000" alink="#000000">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="listtopic">Access denied for: <?=$HTTP_SERVER_VARS['AUTH_USER']?></td>
- </tr>
- </table>
-<?php
- } // end of access denied code
-?>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/dspam/www/dspam-settings-prefs.php b/config/archive/dspam/www/dspam-settings-prefs.php
deleted file mode 100644
index c30cb7bd..00000000
--- a/config/archive/dspam/www/dspam-settings-prefs.php
+++ /dev/null
@@ -1,197 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-settings-prefs.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Advanced Settings"),
- gettext("Edit DSPAM Preferences"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
-
-/*
- The following code presumes, that the following XML structure exists or
- if it does not exist, it will be created.
-
- <preference>
- <name>foo</name>
- <descr>foo desc</descr>
- </preference>
- <preference>
- <name>bar</name>
- <descr>bar desc</descr>
- </preference>
-*/
-
-if (!is_array($config['installedpackages']['dspam']['config'][0]['preference'])) {
- $config['installedpackages']['dspam']['config'][0]['preference'] = array();
-}
-
-$t_prefs = &$config['installedpackages']['dspam']['config'][0]['preference'];
-
-/* ID is only set if the user wants to edit an existing entry */
-$id = $_GET['id'];
-$sectionid = $_GET['sectionid'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-if (isset($_POST['sectionid']))
- $sectionid = $_POST['sectionid'];
-
-if (isset($id) && $t_prefs[$id]) {
- $pconfig['value'] = $t_prefs[$id]['value'];
- $pconfig['descr'] = $t_prefs[$id]['descr'];
-} else {
- $pconfig['value'] = $_GET['pvalue'];
- $pconfig['descr'] = $_GET['descr'];
-}
-
-if ($_POST) {
-
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = explode(" ", "pvalue");
- $reqdfieldsn = explode(",", "DSPAM Algorithm Name");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- /* check for overlaps */
- foreach ($t_prefs as $pref) {
- if (isset($id) && ($t_prefs[$id]) && ($t_prefs[$id] === $pref)) {
- continue;
- }
- if ($pref['value'] == $_POST['pvalue']) {
- $input_errors[] = gettext("This preference value already exists.");
- break;
- }
- }
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- if (!$input_errors) {
- $pref = array();
- $pref['value'] = $_POST['pvalue'];
- $pref['descr'] = $_POST['descr'];
-
- if (isset($id) && $t_prefs[$id])
- $t_prefs[$id] = $pref;
- else
- $t_prefs[] = $pref;
-
- write_config();
-
- $retval = 0;
- config_lock();
- $retval = dspam_configure();
- config_unlock();
-
- $savemsg = get_std_save_message($retval);
-
- isset($sectionid) ? $header = "dspam-settings.php?sectionid={$sectionid}" : $header = "dspam-settings.php";
- pfSenseHeader($header);
- exit;
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="dspam-settings-prefs.php" method="post" name="iform" id="iform">
- <div name="inputerrors" id="inputerrors"></div>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("DSPAM Algorithm Name");?></td>
- <td width="78%" class="vtable">
- <input name="pvalue" type="text" class="formfld unknown" id="pvalue" size="30" value="<?=htmlspecialchars($pconfig['value']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
- <td width="78%" class="vtable">
- <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
- <br> <span class="vexpl"><?=gettext("You may enter a description here
- for your reference (not parsed).");?></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>"> <input id="cancelbutton" class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()">
- <?php if (isset($id) && $t_prefs[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- <?php if (isset($sectionid)): ?>
- <input name="sectionid" type="hidden" value="<?=$sectionid;?>">
- <?php endif; ?>
- </td>
- </tr>
- </table>
-</form>
-<?
- } else {
-?>
-<?php
- $input_errors[] = "Access to this particular site was denied. You need DSPAM admin access rights to be able to view it.";
-
- include("head.inc");
- echo $pfSenseHead->getHTML();
-?>
-<?php include("fbegin.inc");?>
-<?php if ($input_errors) print_input_errors($input_errors);?>
-<?php if ($savemsg) print_info_box($savemsg);?>
- <body link="#000000" vlink="#000000" alink="#000000">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="listtopic">Access denied for: <?=$HTTP_SERVER_VARS['AUTH_USER']?></td>
- </tr>
- </table>
-<?php
- } // end of access denied code
-?>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/dspam/www/dspam-settings-spwd.php b/config/archive/dspam/www/dspam-settings-spwd.php
deleted file mode 100644
index 7912b0f6..00000000
--- a/config/archive/dspam/www/dspam-settings-spwd.php
+++ /dev/null
@@ -1,197 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-settings-overr.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Advanced Settings"),
- gettext("Edit Server Password"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
-
-/*
- The following code presumes, that the following XML structure exists or
- if it does not exist, it will be created.
-
- <server-pwd>
- <value>foo</value>
- <descr>foo desc</descr>
- </server-pwd>
- <server-pwd>
- <value>bar</value>
- <descr>bar desc</descr>
- </server-pwd>
-*/
-
-if (!is_array($config['installedpackages']['dspam']['config'][0]['server-pwd'])) {
- $config['installedpackages']['dspam']['config'][0]['server-pwd'] = array();
-}
-
-$t_spwds = &$config['installedpackages']['dspam']['config'][0]['server-pwd'];
-
-/* ID is only set if the user wants to edit an existing entry */
-$id = $_GET['id'];
-$sectionid = $_GET['sectionid'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-if (isset($_POST['sectionid']))
- $sectionid = $_POST['sectionid'];
-
-if (isset($id) && $t_spwds[$id]) {
- $pconfig['value'] = $t_spwds[$id]['value'];
- $pconfig['descr'] = $t_spwds[$id]['descr'];
-} else {
- $pconfig['value'] = $_GET['pwdvalue'];
- $pconfig['descr'] = $_GET['descr'];
-}
-
-if ($_POST) {
-
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = explode(" ", "pwdvalue");
- $reqdfieldsn = explode(",", "Server Password Value");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- /* check for overlaps */
- foreach ($t_spwds as $spwd) {
- if (isset($id) && ($t_spwds[$id]) && ($t_spwds[$id] === $spwd)) {
- continue;
- }
- if ($spwd['value'] == $_POST['pwdvalue']) {
- $input_errors[] = gettext("This password value already exists.");
- break;
- }
- }
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- if (!$input_errors) {
- $pwd = array();
- $pwd['value'] = $_POST['pwdvalue'];
- $pwd['descr'] = $_POST['descr'];
-
- if (isset($id) && $t_spwds[$id])
- $t_spwds[$id] = $pwd;
- else
- $t_spwds[] = $pwd;
-
- write_config();
-
- $retval = 0;
- config_lock();
- $retval = dspam_configure();
- config_unlock();
-
- $savemsg = get_std_save_message($retval);
-
- isset($sectionid) ? $header = "dspam-settings.php?sectionid={$sectionid}" : $header = "dspam-settings.php";
- pfSenseHeader($header);
- exit;
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="dspam-settings-spwd.php" method="post" name="iform" id="iform">
- <div name="inputerrors" id="inputerrors"></div>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Server Password Value");?></td>
- <td width="78%" class="vtable">
- <input name="pwdvalue" type="text" class="formfld unknown" id="pwdvalue" size="30" value="<?=htmlspecialchars($pconfig['value']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
- <td width="78%" class="vtable">
- <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
- <br> <span class="vexpl"><?=gettext("You may enter a description here
- for your reference (not parsed).");?></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>"> <input id="cancelbutton" class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()">
- <?php if (isset($id) && $t_spwds[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- <?php if (isset($sectionid)): ?>
- <input name="sectionid" type="hidden" value="<?=$sectionid;?>">
- <?php endif; ?>
- </td>
- </tr>
- </table>
-</form>
-<?
- } else {
-?>
-<?php
- $input_errors[] = "Access to this particular site was denied. You need DSPAM admin access rights to be able to view it.";
-
- include("head.inc");
- echo $pfSenseHead->getHTML();
-?>
-<?php include("fbegin.inc");?>
-<?php if ($input_errors) print_input_errors($input_errors);?>
-<?php if ($savemsg) print_info_box($savemsg);?>
- <body link="#000000" vlink="#000000" alink="#000000">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="listtopic">Access denied for: <?=$HTTP_SERVER_VARS['AUTH_USER']?></td>
- </tr>
- </table>
-<?php
- } // end of access denied code
-?>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/dspam/www/dspam-settings-tuser.php b/config/archive/dspam/www/dspam-settings-tuser.php
deleted file mode 100644
index 57e9ec71..00000000
--- a/config/archive/dspam/www/dspam-settings-tuser.php
+++ /dev/null
@@ -1,195 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-settings-tuser.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Advanced Settings"),
- gettext("Edit UNIX user"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
-
-/*
- The following code presumes, that the following XML structure exists or
- if it does not exist, it will be created.
-
- <tuser>
- <name>foo</name>
- </tuser>
- <tuser>
- <name>bar</name>
- </tuser>
-*/
-
-if (!is_array($config['installedpackages']['dspam']['config'][0]['tuser'])) {
- $config['installedpackages']['dspam']['config'][0]['tuser'] = array();
-}
-
-$t_users = &$config['installedpackages']['dspam']['config'][0]['tuser'];
-
-/* ID is only set if the user wants to edit an existing entry */
-$id = $_GET['id'];
-$sectionid = $_GET['sectionid'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-if (isset($_POST['sectionid']))
- $sectionid = $_POST['sectionid'];
-
-if (isset($id) && $t_users[$id]) {
- $pconfig['name'] = $t_users[$id]['name'];
- $pconfig['descr'] = $t_users[$id]['descr'];
-} else {
- $pconfig['name'] = $_GET['uuname'];
- $pconfig['descr'] = $_GET['descr'];
-}
-
-if ($_POST) {
-
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = explode(" ", "uuname");
- $reqdfieldsn = explode(",", "Unix username");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- /* check for overlaps */
- foreach ($t_users as $user) {
- if (isset($id) && ($t_users[$id]) && ($t_users[$id] === $user)) {
- continue;
- }
- if ($user['name'] == $_POST['uuname']) {
- $input_errors[] = gettext("This username already exists.");
- break;
- }
- }
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- if (!$input_errors) {
- $user = array();
- $user['name'] = $_POST['uuname'];
- $user['descr'] = $_POST['descr'];
-
- if (isset($id) && $t_users[$id])
- $t_users[$id] = $user;
- else
- $t_users[] = $user;
-
- write_config();
-
- $retval = 0;
- config_lock();
- $retval = dspam_configure();
- config_unlock();
-
- $savemsg = get_std_save_message($retval);
-
- isset($sectionid) ? $header = "dspam-settings.php?sectionid={$sectionid}" : $header = "dspam-settings.php";
- pfSenseHeader($header);
- exit;
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="dspam-settings-tuser.php" method="post" name="iform" id="iform">
- <div name="inputerrors" id="inputerrors"></div>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("UNIX username");?></td>
- <td width="78%" class="vtable">
- <input name="uuname" type="text" class="formfld unknown" id="uuname" size="30" value="<?=htmlspecialchars($pconfig['name']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
- <td width="78%" class="vtable">
- <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
- <br> <span class="vexpl"><?=gettext("You may enter a description here
- for your reference (not parsed).");?></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>"> <input id="cancelbutton" class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()">
- <?php if (isset($id) && $t_users[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- <?php if (isset($sectionid)): ?>
- <input name="sectionid" type="hidden" value="<?=$sectionid;?>">
- <?php endif; ?>
- </td>
- </tr>
- </table>
-</form>
-<?
- } else {
-?>
-<?php
- $input_errors[] = "Access to this particular site was denied. You need DSPAM admin access rights to be able to view it.";
-
- include("head.inc");
- echo $pfSenseHead->getHTML();
-?>
-<?php include("fbegin.inc");?>
-<?php if ($input_errors) print_input_errors($input_errors);?>
-<?php if ($savemsg) print_info_box($savemsg);?>
- <body link="#000000" vlink="#000000" alink="#000000">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="listtopic">Access denied for: <?=$HTTP_SERVER_VARS['AUTH_USER']?></td>
- </tr>
- </table>
-<?php
- } // end of access denied code
-?>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/dspam/www/dspam-settings.php b/config/archive/dspam/www/dspam-settings.php
deleted file mode 100644
index 05662a6e..00000000
--- a/config/archive/dspam/www/dspam-settings.php
+++ /dev/null
@@ -1,2955 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-settings.php
- Copyright (C) 2006 Daniel S. Haischt
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
- $pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Advanced Settings"),
- gettext("Overview"));
-
- require("guiconfig.inc");
- include("/usr/local/pkg/dspam.inc");
-
- if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
-
- $pconfig['sectionid'] = $_GET['sectionid'];
-
- $pconfig['sdriver'] = $config['installedpackages']['dspam']['config'][0]['storage-driver'];
- /* ============================================================================================= */
- /* == MySQL == */
- /* ============================================================================================= */
- $pconfig['msqlserver'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-server'];
- $pconfig['msqlport'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-port'];
- $pconfig['msqluser'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-user'];
- $pconfig['msqlpwd'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-password'];
- $pconfig['msqldb'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-database'];
- $pconfig['msqlcomp'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-compress'];
- $pconfig['msqlsuqt'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-squote'];
- $pconfig['msqlccache'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-ccache'];
- $pconfig['msqluid'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-uid'];
- /* ============================================================================================= */
- /* == SQLite == */
- /* ============================================================================================= */
- $pconfig['slitepr'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['sqlite-pragma'];
- /* ============================================================================================= */
- /* == PostgreSQL == */
- /* ============================================================================================= */
- $pconfig['pgserver'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-server'];
- $pconfig['pgport'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-port'];
- $pconfig['pguser'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-user'];
- $pconfig['pgpwd'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-password'];
- $pconfig['pgdb'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-database'];
- $pconfig['pgccache'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-ccache'];
- $pconfig['pguid'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-uid'];
- /* ============================================================================================= */
- /* == Oracle == */
- /* ============================================================================================= */
- $pconfig['oraserver'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-server'];
- $pconfig['orauser'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-user'];
- $pconfig['orapwd'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-password'];
- $pconfig['orasch'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-schema'];
- /* ============================================================================================= */
- /* == Hash == */
- /* ============================================================================================= */
- $pconfig['hsrmax'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-rec-max'];
- $pconfig['hsatex'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-auto-ex'];
- $pconfig['hsmxex'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-max-ext'];
- $pconfig['hsexsz'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-ext-size'];
- $pconfig['hsmxse'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-max-seek'];
- $pconfig['hsccus'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-co-user'];
- $pconfig['hscoca'] = $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-co-cache'];
- /* ============================================================================================= */
- /* == Delivery Settings == */
- /* ============================================================================================= */
- $pconfig['dagent'] = $config['installedpackages']['dspam']['config'][0]['tdelivery-agent'];
- $pconfig['dsthinc'] = $config['installedpackages']['dspam']['config'][0]['thin-client'];
- $pconfig['tcpipdel'] = $config['installedpackages']['dspam']['config'][0]['tcpip-delivery'];
- $pconfig['dhost'] = $config['installedpackages']['dspam']['config'][0]['tcpip-delivery-host'];
- $pconfig['dport'] = $config['installedpackages']['dspam']['config'][0]['tcpip-delivery-port'];
- $pconfig['dident'] = $config['installedpackages']['dspam']['config'][0]['tcpip-delivery-ident'];
- $pconfig['delproto'] = $config['installedpackages']['dspam']['config'][0]['tcpip-delivery-proto'];
- $pconfig['onfail'] = $config['installedpackages']['dspam']['config'][0]['delivery-onfail'];
- /* ============================================================================================= */
- /* == DSPAM Debugging Options == */
- /* ============================================================================================= */
- $pconfig['enabledbg'] = $config['installedpackages']['dspam']['config'][0]['debug-enable'];
- $pconfig['debug'] = $config['installedpackages']['dspam']['config'][0]['debug-whom'];
- $pconfig['dopt'] = $config['installedpackages']['dspam']['config'][0]['debug-options'];
- /* ============================================================================================= */
- /* == DSPAM Engine Settings == */
- /* ============================================================================================= */
- $pconfig['tmode'] = $config['installedpackages']['dspam']['config'][0]['training-mode'];
- $pconfig['testct'] = $config['installedpackages']['dspam']['config'][0]['test-cond-training'];
- $pconfig['pvalue'] = $config['installedpackages']['dspam']['config'][0]['pvalue'];
- $pconfig['ipdrive'] = $config['installedpackages']['dspam']['config'][0]['improbability-drive'];
- /* ============================================================================================= */
- /* == LDAP Settings == */
- /* ============================================================================================= */
- $pconfig['enableldap'] = $config['installedpackages']['dspam']['config'][0]['ldap-enable'];
- $pconfig['ldapmode'] = $config['installedpackages']['dspam']['config'][0]['ldap-mode'];
- $pconfig['ldaphost'] = $config['installedpackages']['dspam']['config'][0]['ldap-host'];
- $pconfig['ldapfilter'] = $config['installedpackages']['dspam']['config'][0]['ldap-filter'];
- $pconfig['ldapbase'] = $config['installedpackages']['dspam']['config'][0]['ldap-base'];
- /* ============================================================================================= */
- /* == Miscellaneous Settings == */
- /* ============================================================================================= */
- $pconfig['foatt'] = $config['installedpackages']['dspam']['config'][0]['failover-attempts'];
- $pconfig['enablesbl'] = $config['installedpackages']['dspam']['config'][0]['sbl-enable'];
- $pconfig['sblhost'] = $config['installedpackages']['dspam']['config'][0]['sbl-host'];
- $pconfig['enablerbl'] = $config['installedpackages']['dspam']['config'][0]['rbl-inoculate'];
- $pconfig['enablenoti'] = $config['installedpackages']['dspam']['config'][0]['notification-email'];
- $pconfig['dspamdomain'] = $config['installedpackages']['dspam']['config'][0]['dspam-domain'];
- $pconfig['dspamcontact'] = $config['installedpackages']['dspam']['config'][0]['dspam-contact'];
- /* ============================================================================================= */
- /* == Maintainance Settings == */
- /* ============================================================================================= */
- $pconfig['psig'] = $config['installedpackages']['dspam']['config'][0]['purge-signatures'];
- $pconfig['pneut'] = $config['installedpackages']['dspam']['config'][0]['purge-neutral'];
- $pconfig['punu'] = $config['installedpackages']['dspam']['config'][0]['purge-unused'];
- $pconfig['phapa'] = $config['installedpackages']['dspam']['config'][0]['purge-hapaxes'];
- $pconfig['pones'] = $config['installedpackages']['dspam']['config'][0]['purge-hits-1s'];
- $pconfig['ponei'] = $config['installedpackages']['dspam']['config'][0]['purge-hits-1i'];
- /* ============================================================================================= */
- /* == System Settings == */
- /* ============================================================================================= */
- $pconfig['locmx'] = $config['installedpackages']['dspam']['config'][0]['local-mx'];
- $pconfig['enablesysl'] = $config['installedpackages']['dspam']['config'][0]['system-log'];
- $pconfig['enableusel'] = $config['installedpackages']['dspam']['config'][0]['user-log'];
- $pconfig['optinout'] = $config['installedpackages']['dspam']['config'][0]['filter-opt'];
- $pconfig['enableptoh'] = $config['installedpackages']['dspam']['config'][0]['parse-to-headers'];
- $pconfig['enablecmop'] = $config['installedpackages']['dspam']['config'][0]['change-mode-on-parse'];
- $pconfig['enablecuop'] = $config['installedpackages']['dspam']['config'][0]['change-user-on-parse'];
- $pconfig['enablebmta'] = $config['installedpackages']['dspam']['config'][0]['broken-mta-settings'];
- $pconfig['maxmsgs'] = $config['installedpackages']['dspam']['config'][0]['max-message-size'];
- $pconfig['procbias'] = $config['installedpackages']['dspam']['config'][0]['processor-bias'];
- /* ============================================================================================= */
- /* == ClamAV Engine Settings == */
- /* ============================================================================================= */
- $pconfig['enableclam'] = $config['installedpackages']['dspam']['config'][0]['clamav-enable'];
- $pconfig['clamport'] = $config['installedpackages']['dspam']['config'][0]['clamav-port'];
- $pconfig['clamhost'] = $config['installedpackages']['dspam']['config'][0]['clamav-host'];
- $pconfig['clamresp'] = $config['installedpackages']['dspam']['config'][0]['clamav-response'];
- /* ============================================================================================= */
- /* == DSPAM Daemon Settings (Server) == */
- /* ============================================================================================= */
- $pconfig['dsport'] = $config['installedpackages']['dspam']['config'][0]['dspam-server-port'];
- $pconfig['dsqsize'] = $config['installedpackages']['dspam']['config'][0]['dspam-server-queue-size'];
- $pconfig['dspid'] = $config['installedpackages']['dspam']['config'][0]['dspam-server-pid'];
- $pconfig['dssmode'] = $config['installedpackages']['dspam']['config'][0]['dspam-server-mode'];
- $pconfig['serverparam'] = $config['installedpackages']['dspam']['config'][0]['dspam-server-params'];
- $pconfig['serverid'] = $config['installedpackages']['dspam']['config'][0]['dspam-server-id'];
- $pconfig['serversock'] = $config['installedpackages']['dspam']['config'][0]['dspam-server-socket'];
- /* ============================================================================================= */
- /* == DSPAM Daemon Settings (Client) == */
- /* ============================================================================================= */
- $pconfig['enabledsclient'] = $config['installedpackages']['dspam']['config'][0]['dspam-client-enable'];
- $pconfig['dsclhost'] = $config['installedpackages']['dspam']['config'][0]['dspam-client-host'];
- $pconfig['dsclport'] = $config['installedpackages']['dspam']['config'][0]['dspam-client-port'];
- $pconfig['dsclident'] = $config['installedpackages']['dspam']['config'][0]['dspam-client-id'];
-
- if (!is_array($config['installedpackages']['dspam']['config'][0]['tuser'])) {
- $config['installedpackages']['dspam']['config'][0]['tuser'] = array();
- }
- if (!is_array($config['installedpackages']['dspam']['config'][0]['algorithm'])) {
- $config['installedpackages']['dspam']['config'][0]['algorithm'] = array();
- }
- if (!is_array($config['installedpackages']['dspam']['config'][0]['feature'])) {
- $config['installedpackages']['dspam']['config'][0]['feature'] = array();
- }
- if (!is_array($config['installedpackages']['dspam']['config'][0]['preference'])) {
- $config['installedpackages']['dspam']['config'][0]['preference'] = array();
- }
- if (!is_array($config['installedpackages']['dspam']['config'][0]['override'])) {
- $config['installedpackages']['dspam']['config'][0]['override'] = array();
- }
- if (!is_array($config['installedpackages']['dspam']['config'][0]['header'])) {
- $config['installedpackages']['dspam']['config'][0]['header'] = array();
- }
- if (!is_array($config['installedpackages']['dspam']['config'][0]['bmta'])) {
- $config['installedpackages']['dspam']['config'][0]['bmta'] = array();
- }
-
- $t_users = &$config['installedpackages']['dspam']['config'][0]['tuser'];
- $t_features = &$config['installedpackages']['dspam']['config'][0]['feature'];
- $t_algos = &$config['installedpackages']['dspam']['config'][0]['algorithm'];
- $t_prefs = &$config['installedpackages']['dspam']['config'][0]['preference'];
- $t_overr = &$config['installedpackages']['dspam']['config'][0]['override'];
- $t_headers = &$config['installedpackages']['dspam']['config'][0]['header'];
- $t_bmtas = &$config['installedpackages']['dspam']['config'][0]['bmta'];
- $t_spwds = &$config['installedpackages']['dspam']['config'][0]['server-pwd'];
-
-if ($_POST) {
-
- /* hash */
- $error_bucket = array();
- /* simple error list */
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- if($_POST['sdriver'] == "mysql") {
- if (! $_POST['msqlserver'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid MySQL server name value.",
- "field" => "msqlserver");
- } else {
- if (strpos($_POST['msqlserver'], '/') === false) {
- foreach (explode(' ', $_POST['msqlserver']) as $ts) {
- if (!is_domain($ts)) {
- $error_bucket[] = array("error" => "A MySQL server name may only contain the characters a-z, 0-9, '-' and '.'.",
- "field" => "msqlserver");
- break;
- }
- }
- }
- }
- /* if we are going to use a TCP/IP base MySQL connection, a port value is required */
- if (! is_port($_POST['msqlport']) && strpos($_POST['msqlserver'], '/') === false) {
- $error_bucket[] = array("error" => "You must specify a valid MySQL port value.",
- "field" => "msqlport");
- }
- if (! $_POST['msqluser'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid MySQL username value.",
- "field" => "msqluser");
- }
- if (! $_POST['msqlpwd'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid MySQL password value.",
- "field" => "msqlpwd");
- }
- if (! $_POST['msqldb'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid MySQL database value.",
- "field" => "msqldb");
- }
- if ($_POST['msqlccache'] && !is_numericint($_POST['msqlccache'])) {
- $error_bucket[] = array("error" => "You must specify a valid integer value as a connection cache value.",
- "field" => "msqlccache");
- }
- } else if($_POST['sdriver'] == "sqlite") {
- /* NOP */
- } else if($_POST['sdriver'] == "bdb") {
- /* NOP */
- } else if($_POST['sdriver'] == "pgsql") {
- if (! $_POST['pgserver'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid PostgreSQL server name value.",
- "field" => "pgserver");
- } else {
- foreach (explode(' ', $_POST['pgserver']) as $ts) {
- if (!is_domain($ts)) {
- $error_bucket[] = array("error" => "A PostgreSQL server name may only contain the characters a-z, 0-9, '-' and '.'.",
- "field" => "pgserver");
- break;
- }
- }
- }
- if (! is_port($_POST['pgport'])) {
- $error_bucket[] = array("error" => "You must specify a valid PostgreSQL port value.",
- "field" => "pgport");
- }
- if (! $_POST['pguser'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid PostgreSQL username value.",
- "field" => "pguser");
- }
- if (! $_POST['pgpwd'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid PostgreSQL password value.",
- "field" => "pgpwd");
- }
- if (! $_POST['pgdb'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid PostgreSQL database value.",
- "field" => "pgdb");
- }
- if ($_POST['pgccache'] && !is_numericint($_POST['pgccache'])) {
- $error_bucket[] = array("error" => "You must specify a valid integer value as a connection cache value.",
- "field" => "pgccache");
- }
- } else if($_POST['sdriver'] == "oracle") {
- if (! $_POST['oraserver'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid Oracle server connection string.",
- "field" => "oraserver");
- }
- if (! $_POST['orauser'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid Oracle username value.",
- "field" => "orauser");
- }
- if (! $_POST['orapwd'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid Oracle password value.",
- "field" => "orapwd");
- }
- if (! $_POST['orasch'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid Oracle schema value.",
- "field" => "orasch");
- }
- } else if($_POST['sdriver'] == "hash") {
- if ($_POST['hsrmax'] && !is_numericint($_POST['hsrmax'])) {
- $error_bucket[] = array("error" => "You must specify a valid integer value as a number for the initial records to be created.",
- "field" => "hsrmax");
- }
- if ($_POST['hsmxex'] && !is_numericint($_POST['hsmxex'])) {
- $error_bucket[] = array("error" => "You must specify a valid integer value as a number for the maximum extends.",
- "field" => "hsmxex");
- }
- if ($_POST['hsexsz'] && !is_numericint($_POST['hsexsz'])) {
- $error_bucket[] = array("error" => "You must specify a valid integer value as a number for the record size.",
- "field" => "hsexsz");
- }
- if ($_POST['hsmxse'] && !is_numericint($_POST['hsmxse'])) {
- $error_bucket[] = array("error" => "You must specify a valid integer value as a number for the maximum number of records to seek.",
- "field" => "hsmxse");
- }
- if ($_POST['hscoca'] && !is_numericint($_POST['hscoca'])) {
- $error_bucket[] = array("error" => "You must specify a valid integer value as a number for hash connection cache.",
- "field" => "hscoca");
- }
- }
-
- if ($_POST['tcpipdel'] == "yes") {
- if (! $_POST['dhost'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid server name value for the DSPAM deliver host.",
- "field" => "dhost");
- } else {
- foreach (explode(' ', $_POST['dhost']) as $ts) {
- if (!is_domain($ts)) {
- $error_bucket[] = array("error" => "A DSPAM delivery host name may only contain the characters a-z, 0-9, '-' and '.'.",
- "field" => "dhost");
- break;
- }
- }
- }
- if (! is_port($_POST['dport'])) {
- $error_bucket[] = array("error" => "You must specify a valid port value for the DSPAM delivery host.",
- "field" => "dport");
- }
- if (! $_POST['dident'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid identification string for the DSPAM delivery host.",
- "field" => "dident");
- }
- }
-
- if ($_POST['enabledbg'] == "yes") {
- if (! $_POST['debug'] <> "") {
- $error_bucket[] = array("error" => "You must specify a non-zero value for the debug parameter.",
- "field" => "debug");
- }
- if (! $_POST['dopt'] <> "") {
- $error_bucket[] = array("error" => "You must specify a non-zero value for the debug options.",
- "field" => "dopt");
- }
- }
-
- if ($_POST['enableldap'] == "yes") {
- if (! $_POST['ldaphost'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid server name value for the LDAP host.",
- "field" => "ldaphost");
- } else {
- foreach (explode(' ', $_POST['ldaphost']) as $ts) {
- if (!is_domain($ts)) {
- $error_bucket[] = array("error" => "A LDAP host name may only contain the characters a-z, 0-9, '-' and '.'.",
- "field" => "ldaphost");
- break;
- }
- }
- }
- if (! $_POST['ldapfilter'] <> "") {
- $error_bucket[] = array("error" => "You must specify a non-zero value for the LDAP filter option or you may not be able to get any query result.",
- "field" => "ldapfilter");
- }
- if (! $_POST['ldapbase'] <> "") {
- $error_bucket[] = array("error" => "You must specify a non-zero value for the LDAP base option or you may not be able to get any query result.",
- "field" => "ldapbase");
- }
- }
-
- /* misc settings */
- if ($_POST['foatt'] && !is_numericint($_POST['foatt'])) {
- $error_bucket[] = array("error" => "You must specify a integer based value for the number of failover attempts.",
- "field" => "foatt");
- }
- if ($_POST['enablesbl'] == "yes") {
- if (! $_POST['sblhost'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid server name value for the SBL host.",
- "field" => "sblhost");
- } else {
- foreach (explode(' ', $_POST['sblhost']) as $ts) {
- if (!is_domain($ts)) {
- $error_bucket[] = array("error" => "A SBL host name may only contain the characters a-z, 0-9, '-' and '.'.",
- "field" => "sblhost");
- break;
- }
- }
- }
- }
- if(isset($_POST['enablenoti'])) {
- if($_POST['dspamcontact'] == "") {
- $error_bucket[] = array("error" => "It is necessary to provide a support contact, if you want DSPAM to send notification messages.",
- "field" => "dspamcontact");
- }
- if(empty($_POST['whichdomain'])) {
- if ($_POST['dspamdomain'] == "") {
- $error_bucket[] = array("error" => "You must specify a valid domain name that should be used while sending DSPAM related mail messages.",
- "field" => "dspamdomain");
- } else {
- if (!is_domain($_POST['dspamdomain'])) {
- $error_bucket[] = array("error" => "You must specify a valid domain name that should be used while sending DSPAM related mail messages.",
- "field" => "dspamdomain");
- }
- }
- }
- }
-
- /* Maintanance Settings */
- if (! $_POST['psig'] || $_POST['psig'] == "") {
- $error_bucket[] = array("error" => "You must specify a value for the number of signatures to be purged.",
- "field" => "psig");
- } else if (! $_POST['psig'] == "off") {
- if (!is_numericint($_POST['psig'])) {
- $error_bucket[] = array("error" => "You must specify a valide integer value for the number of signatures to be purged.",
- "field" => "psig");
- }
- }
- if (! $_POST['pneut'] || $_POST['pneut'] == "") {
- $error_bucket[] = array("error" => "You must specify a value for the number of neutrals to be purged.",
- "field" => "pneut");
- } else if (! $_POST['pneut'] == "off") {
- if (!is_numericint($_POST['pneut'])) {
- $error_bucket[] = array("error" => "You must specify a valide integer value for the number of neutrals to be purged.",
- "field" => "pneut");
- }
- }
- if (! $_POST['punu'] || $_POST['punu'] == "") {
- $error_bucket[] = array("error" => "You must specify a value for the number of unused tokens to be purged.",
- "field" => "punu");
- } else if (! $_POST['punu'] == "off") {
- if (!is_numericint($_POST['punu'])) {
- $error_bucket[] = array("error" => "You must specify a valide integer value for the number of unused tokens to be purged.",
- "field" => "punu");
- }
- }
- if (! $_POST['phapa'] || $_POST['phapa'] == "") {
- $input_errors[] = "You must specify a value for the number of hapaxes to be purged.";
- $input_error_fields[] = "phapa";
- } else if (! $_POST['phapa'] == "off") {
- if (!is_numericint($_POST['phapa'])) {
- $error_bucket[] = array("error" => "You must specify a valide integer value for the number of hapaxes to be purged.",
- "field" => "phapa");
- }
- }
- if (! $_POST['pones'] || $_POST['pones'] == "") {
- $error_bucket[] = array("error" => "You must specify a value for the number of tokens with only 1 spam hit to be purged.",
- "field" => "pones");
- } else if (! $_POST['pones'] == "off") {
- if (!is_numericint($_POST['pones'])) {
- $error_bucket[] = array("error" => "You must specify a valide integer value for the number of tokens with only 1 spam hit to be purged.",
- "field" => "pones");
- }
- }
- if (! $_POST['ponei'] || $_POST['ponei'] == "") {
- $error_bucket[] = array("error" => "You must specify a value for the number of tokens with only 1 innocent hit to be purged.",
- "field" => "ponei");
- } else if (! $_POST['ponei'] == "off") {
- if (!is_numericint($_POST['ponei'])) {
- $error_bucket[] = array("error" => "You must specify a valide integer value for the number of tokens with only 1 innocent hit to be purged.",
- "field" => "ponei");
- }
- }
-
- /* System Settings */
- if (! is_ipaddr($_POST['locmx'])) {
- $error_bucket[] = array("error" => "You must specify a valid IP address for the local MX parameter.",
- "field" => "locmx");
- }
- if ($_POST['maxmsgs'] && !is_numericint($_POST['maxmsgs'])) {
- $error_bucket[] = array("error" => "You must specify a integer based value for the maximum message size.",
- "field" => "maxmsgs");
- }
-
- /* ClamAV Settings */
- if ($_POST['enableclam'] == "yes") {
- if (! is_port($_POST['clamport'])) {
- $error_bucket[] = array("error" => "You must specify a valid port value for the ClamAV host.",
- "field" => "clamport");
- }
- if (! $_POST['clamhost'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid server name value for the ClamAV host.",
- "field" => "clamhost");
- } else {
- foreach (explode(' ', $_POST['clamhost']) as $ts) {
- if (!is_domain($ts)) {
- $error_bucket[] = array("error" => "A ClamAV host name may only contain the characters a-z, 0-9, '-' and '.'.",
- "field" => "clamhost");
- break;
- }
- }
- }
- }
-
- /* */
- /* DSPAM Daemon Settings (Server) */
- /* */
-
- /* at least the DSPAM thin client (dspamc)
- * should force the user to configure the
- * DSPAM daemon.
- */
- if (isset($_POST['dsthinc'])) {
- if (! is_port($_POST['dsport'])) {
- $error_bucket[] = array("error" => "You must specify a valid port value for the DSPAM host.",
- "field" => "dsport");
- }
- if ($_POST['dsqsize'] && !is_numericint($_POST['dsqsize'])) {
- $error_bucket[] = array("error" => "You must specify a valid integer value as a number for the server queue size.",
- "field" => "dsqsize");
- }
- if (! $_POST['dspid'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid value as PID file for the DSPAM server.",
- "field" => "dspid");
- }
- if ($_POST['dssmode'] == "standard") {
- if (! $_POST['serverparam'] <> "") {
- $error_bucket[] = array("error" => "You must specify some valid parameters to be passed to the LMTP server.",
- "field" => "serverparam");
- }
- if (! $_POST['serverid'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid identification string to be passed to the LMTP server.",
- "field" => "serverid");
- }
- if ($_POST['serversock'] && $_POST['serversock'] <> "") {
- if (strpos($_POST['serversock'], '/') === false) {
- $error_bucket[] = array("error" => "You must specify a valid value for the location of a Unix domain socket.",
- "field" => "serversock");
- }
- }
- }
- }
-
- /* DSPAM Daemon Settings (Client) */
- if ($_POST['enabledsclient'] == "yes") {
- if (! $_POST['dsclhost'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid server name value for the DSPAM client host.",
- "field" => "dsclhost");
- } else {
- foreach (explode(' ', $_POST['dsclhost']) as $ts) {
- if (!is_domain($ts)) {
- $error_bucket[] = array("error" => "A DSPAM client host name may only contain the characters a-z, 0-9, '-' and '.'.",
- "field" => "dsclhost");
- break;
- }
- }
- }
- if (! is_port($_POST['dsclport'])) {
- $error_bucket[] = array("error" => "You must specify a valid port value for the DSPAM client host.",
- "field" => "dsclport");
- }
- if (! $_POST['dsclident'] <> "") {
- $error_bucket[] = array("error" => "You must specify a valid value as identification string for the DSPAM client.",
- "field" => "dsclident");
- }
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- if (!$input_errors) {
- $config['installedpackages']['dspam']['config'][0]['storage-driver'] = $_POST['sdriver'];
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings']);
-
- if($_POST['sdriver'] == "mysql") {
- /* ====================================================================== */
- /* == String and integer values == */
- /* ====================================================================== */
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-server'] = $_POST['msqlserver'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-port'] = $_POST['msqlport'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-user'] = $_POST['msqluser'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-password'] = $_POST['msqlpwd'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-database'] = $_POST['msqldb'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-ccache'] = $_POST['msqlccache'];
- /* ====================================================================== */
- /* == Boolean values == */
- /* ====================================================================== */
- if($_POST['msqlcomp'] == "yes")
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-compress'] = $_POST['msqlcomp'];
- else
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-compress']);
- if($_POST['msqlsuqt'] == "yes")
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-squote'] = $_POST['msqlsuqt'];
- else
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-squote']);
- if($_POST['msqluid'] == "yes")
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-uid'] = $_POST['msqluid'];
- else
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-uid']);
- } else if($_POST['sdriver'] == "sqlite") {
- /* ====================================================================== */
- /* == String and integer values == */
- /* ====================================================================== */
- if ($_POST['slitepr'])
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['sqlite-pragma'] = $_POST['slitepr'];
- } else if($_POST['sdriver'] == "bdb") {
- /* NOP */
- } else if($_POST['sdriver'] == "pgsql") {
- /* ====================================================================== */
- /* == String and integer values == */
- /* ====================================================================== */
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-server'] = $_POST['pgserver'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-port'] = $_POST['pgport'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-user'] = $_POST['pguser'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-password'] = $_POST['pgpwd'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-database'] = $_POST['pgdb'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-ccache'] = $_POST['pgccache'];
- /* ====================================================================== */
- /* == Boolean values == */
- /* ====================================================================== */
- if($_POST['pguid'] == "yes")
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-uid'] = $_POST['pguid'];
- else
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-uid']);
- } else if($_POST['sdriver'] == "oracle") {
- /* ====================================================================== */
- /* == String and integer values == */
- /* ====================================================================== */
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-server'] = $_POST['oraserver'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-user'] = $_POST['orauser'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-password'] = $_POST['orapwd'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-schema'] = $_POST['orasch'];
- } else if($_POST['sdriver'] == "hash") {
- /* ====================================================================== */
- /* == String and integer values == */
- /* ====================================================================== */
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-rec-max'] = $_POST['hsrmax'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-max-ext'] = $_POST['hsmxex'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-ext-size'] = $_POST['hsexsz'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-max-seek'] = $_POST['hsmxse'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-co-user'] = $_POST['hsccus'];
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-co-cache'] = $_POST['hscoca'];
- /* ====================================================================== */
- /* == Boolean values == */
- /* ====================================================================== */
- if($_POST['hsatex'] == "yes")
- $config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-auto-ex'] = $_POST['hsatex'];
- else
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-auto-ex']);
- }
-
- $config['installedpackages']['dspam']['config'][0]['tdelivery-agent'] = $_POST['dagent'];
- $config['installedpackages']['dspam']['config'][0]['thin-client'] = $_POST['dsthinc'];
-
- if($_POST['tcpipdel'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['tcpip-delivery'] = $_POST['tcpipdel'];
- $config['installedpackages']['dspam']['config'][0]['tcpip-delivery-host'] = $_POST['dhost'];
- $config['installedpackages']['dspam']['config'][0]['tcpip-delivery-port'] = $_POST['dport'];
- $config['installedpackages']['dspam']['config'][0]['tcpip-delivery-ident'] = $_POST['dident'];
- $config['installedpackages']['dspam']['config'][0]['tcpip-delivery-proto'] = $_POST['delproto'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['tcpip-delivery']);
- unset($config['installedpackages']['dspam']['config'][0]['tcpip-delivery-host']);
- unset($config['installedpackages']['dspam']['config'][0]['tcpip-delivery-port']);
- unset($config['installedpackages']['dspam']['config'][0]['tcpip-delivery-ident']);
- unset($config['installedpackages']['dspam']['config'][0]['tcpip-delivery-proto']);
- }
-
- $config['installedpackages']['dspam']['config'][0]['delivery-onfail'] = $_POST['onfail'];
-
- if($_POST['enabledbg'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['debug-enable'] = $_POST['enabledbg'];
- $config['installedpackages']['dspam']['config'][0]['debug-whom'] = $_POST['debug'];
- $config['installedpackages']['dspam']['config'][0]['debug-options'] = $_POST['dopt'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['debug-enable']);
- unset($config['installedpackages']['dspam']['config'][0]['debug-whom']);
- unset($config['installedpackages']['dspam']['config'][0]['debug-options']);
- }
-
- /* DSPAM engine settings */
- $config['installedpackages']['dspam']['config'][0]['training-mode'] = $_POST['tmode'];
- if($_POST['testct'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['test-cond-training'] = $_POST['testct'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['test-cond-training']);
- }
- $config['installedpackages']['dspam']['config'][0]['pvalue'] = $_POST['pvalue'];
- if($_POST['ipdrive'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['improbability-drive'] = $_POST['ipdrive'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['improbability-drive']);
- }
-
- /* LDAP related settings */
- if($_POST['enableldap'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['ldap-enable'] = $_POST['enableldap'];
- $config['installedpackages']['dspam']['config'][0]['ldap-mode'] = $_POST['ldapmode'];
- $config['installedpackages']['dspam']['config'][0]['ldap-host'] = $_POST['ldaphost'];
- $config['installedpackages']['dspam']['config'][0]['ldap-filter'] = $_POST['ldapfilter'];
- $config['installedpackages']['dspam']['config'][0]['ldap-base'] = $_POST['ldapbase'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['ldap-enable']);
- unset($config['installedpackages']['dspam']['config'][0]['ldap-mode']);
- unset($config['installedpackages']['dspam']['config'][0]['ldap-host']);
- unset($config['installedpackages']['dspam']['config'][0]['ldap-filter']);
- unset($config['installedpackages']['dspam']['config'][0]['ldap-base']);
- }
-
- /* misc settings */
- $config['installedpackages']['dspam']['config'][0]['failover-attempts'] = $_POST['foatt'];
- if($_POST['enablesbl'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['sbl-enable'] = $_POST['enablesbl'];
- $config['installedpackages']['dspam']['config'][0]['sbl-host'] = $_POST['sblhost'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['sbl-enable']);
- unset($config['installedpackages']['dspam']['config'][0]['sbl-host']);
- }
- if($_POST['enablerbl'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['rbl-inoculate'] = $_POST['enablerbl'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['rbl-inoculate']);
- }
- if($_POST['enablenoti'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['notification-email'] = $_POST['enablenoti'];
- $config['installedpackages']['dspam']['config'][0]['dspam-contact'] = $_POST['dspamcontact'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['notification-email']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-domain']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-contact']);
- }
- if($_POST['whichdomain'] == "yes") {
- unset($config['installedpackages']['dspam']['config'][0]['dspam-domain']);
- } else {
- $config['installedpackages']['dspam']['config'][0]['dspam-domain'] = $_POST['dspamdomain'];
- }
-
- /* Maintainance Settings */
- $config['installedpackages']['dspam']['config'][0]['purge-signatures'] = $_POST['psig'];
- $config['installedpackages']['dspam']['config'][0]['purge-neutral'] = $_POST['pneut'];
- $config['installedpackages']['dspam']['config'][0]['purge-unused'] = $_POST['punu'];
- $config['installedpackages']['dspam']['config'][0]['purge-hapaxes'] = $_POST['phapa'];
- $config['installedpackages']['dspam']['config'][0]['purge-hits-1s'] = $_POST['pones'];
- $config['installedpackages']['dspam']['config'][0]['purge-hits-1i'] = $_POST['ponei'];
-
- /* System Settings */
- $config['installedpackages']['dspam']['config'][0]['local-mx'] = $_POST['locmx'];
- $config['installedpackages']['dspam']['config'][0]['local-mx'] = $_POST['locmx'];
- if($_POST['enablesysl'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['system-log'] = $_POST['enablesysl'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['system-log']);
- }
- if($_POST['enableusel'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['user-log'] = $_POST['enableusel'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['user-log']);
- }
- $config['installedpackages']['dspam']['config'][0]['filter-opt'] = $_POST['optinout'];
- if($_POST['enableptoh'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['parse-to-headers'] = $_POST['enableptoh'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['parse-to-headers']);
- }
- if($_POST['enablecmop'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['change-mode-on-parse'] = $_POST['enablecmop'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['change-mode-on-parse']);
- }
- if($_POST['enablecuop'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['change-user-on-parse'] = $_POST['enablecuop'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['change-user-on-parse']);
- }
- if($_POST['enablecuop'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['change-user-on-parse'] = $_POST['enablecuop'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['change-user-on-parse']);
- }
- if($_POST['enablebmta'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['broken-mta-settings'] = $_POST['enablebmta'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['broken-mta-settings']);
- }
- $config['installedpackages']['dspam']['config'][0]['max-message-size'] = $_POST['maxmsgs'];
- if($_POST['procbias'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['processor-bias'] = $_POST['procbias'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['processor-bias']);
- }
-
- /* ClamAV related settings */
- if($_POST['enableclam'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['clamav-enable'] = $_POST['enableclam'];
- $config['installedpackages']['dspam']['config'][0]['clamav-port'] = $_POST['clamport'];
- $config['installedpackages']['dspam']['config'][0]['clamav-host'] = $_POST['clamhost'];
- $config['installedpackages']['dspam']['config'][0]['clamav-response'] = $_POST['clamresp'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['clamav-enable']);
- unset($config['installedpackages']['dspam']['config'][0]['clamav-port']);
- unset($config['installedpackages']['dspam']['config'][0]['clamav-host']);
- unset($config['installedpackages']['dspam']['config'][0]['clamav-response']);
- }
-
- /* DSPAM daemon settings */
- $config['installedpackages']['dspam']['config'][0]['dspam-server-port'] = $_POST['dsport'];
- $config['installedpackages']['dspam']['config'][0]['dspam-server-queue-size'] = $_POST['dsqsize'];
- $config['installedpackages']['dspam']['config'][0]['dspam-server-pid'] = $_POST['dspid'];
- $config['installedpackages']['dspam']['config'][0]['dspam-server-mode'] = $_POST['dssmode'];
- $config['installedpackages']['dspam']['config'][0]['dspam-server-params'] = $_POST['serverparam'];
- $config['installedpackages']['dspam']['config'][0]['dspam-server-id'] = $_POST['serverid'];
- $config['installedpackages']['dspam']['config'][0]['dspam-server-socket'] = $_POST['serversock'];
-
- /* DSPAM client settings */
- if($_POST['enabledsclient'] == "yes") {
- $config['installedpackages']['dspam']['config'][0]['dspam-client-enable'] = $_POST['enabledsclient'];
- $config['installedpackages']['dspam']['config'][0]['dspam-client-host'] = $_POST['dsclhost'];
- $config['installedpackages']['dspam']['config'][0]['dspam-client-port'] = $_POST['dsclport'];
- $config['installedpackages']['dspam']['config'][0]['dspam-client-id'] = $_POST['dsclident'];
- } else {
- unset($config['installedpackages']['dspam']['config'][0]['dspam-client-enable']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-client-host']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-client-port']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-client-id']);
- }
-
- write_config();
-
- $retval = 0;
- conf_mount_rw();
- config_lock();
- $retval = dspam_configure();
- config_unlock();
- $savemsg = get_std_save_message($retval);
- conf_mount_ro();
- }
-}
-
-/* did the user send a request to delete an item? */
-if ($_GET['act'] == "del") {
- if ($_GET['what'] == "tuser" && $t_users[$_GET['id']]) {
- unset($t_users[$_GET['id']]);
- write_config();
- pfSenseHeader("dspam-settings.php");
- exit;
- } else if ($_GET['what'] == "feat" && $t_features[$_GET['id']]) {
- unset($t_features[$_GET['id']]);
- write_config();
- pfSenseHeader("dspam-settings.php");
- exit;
- } else if ($_GET['what'] == "algo" && $t_algos[$_GET['id']]) {
- unset($t_algos[$_GET['id']]);
- write_config();
- pfSenseHeader("dspam-settings.php");
- exit;
- } else if ($_GET['what'] == "pref" && $t_prefs[$_GET['id']]) {
- unset($t_prefs[$_GET['id']]);
- write_config();
- pfSenseHeader("dspam-settings.php");
- exit;
- } else if ($_GET['what'] == "overr" && $t_overr[$_GET['id']]) {
- unset($t_overr[$_GET['id']]);
- write_config();
- pfSenseHeader("dspam-settings.php");
- exit;
- } else if ($_GET['what'] == "header" && $t_headers[$_GET['id']]) {
- unset($t_headers[$_GET['id']]);
- write_config();
- pfSenseHeader("dspam-settings.php");
- exit;
- } else if ($_GET['what'] == "bmta" && $t_bmtas[$_GET['id']]) {
- unset($t_bmtas[$_GET['id']]);
- write_config();
- pfSenseHeader("dspam-settings.php");
- exit;
- } else if ($_GET['what'] == "spwd" && $t_spwds[$_GET['id']]) {
- unset($t_spwds[$_GET['id']]);
- write_config();
- pfSenseHeader("dspam-settings.php");
- exit;
- }
-}
-
- /* if ajax is calling, give them an update message */
- if(isAjax())
- print_info_box_np($savemsg);
-
- include("head.inc");
- /* put your custom HTML head content here */
- /* using some of the $pfSenseHead function calls */
- $jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-
-EOD;
-
- $jscriptstr .= getJScriptFunction(5);
- if (empty($_POST))
- $jscriptstr .= getJScriptFunction(6);
- $jscriptstr .= <<<EOD
-//-->
-</script>
-EOD;
-
- $pfSenseHead->addScript($jscriptstr);
- echo $pfSenseHead->getHTML();?>
-
-<body link="#000000" vlink="#000000" alink="#000000" <?php if (empty($_POST)) { echo "onLoad='checkDisabledState(document.iform);'"; } ?>>
- <?php include("fbegin.inc"); ?>
- <form action="dspam-settings.php" method="post" name="iform" id="iform">
- <input type="hidden" name="sectionid" id="sectionid" value="<?=$pconfig['sectionid'];?>" />
- <?php if ($input_errors) print_input_errors($input_errors); ?>
- <?php if ($savemsg) print_info_box($savemsg); ?>
- <p>
- <span class="vexpl">
- <span class="red">
- <strong>Note: </strong>
- </span>
- the options on this page are intended for use by advanced users only.
- Any setting found on this page is directly going into <code>dspam.conf</code>.
- Make sure you do not mess with settings, you do not understand.
- </span>
- </p>
- <p>
- <span class="vexpl">If you submit this page, the DSPAM daemon process will be restarted.</span>
- </p>
- <br />
- <table width="99%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <?php
- $tab_array = array();
- $tab_array[] = array("System Status", false, "/dspam-admin.php");
- $tab_array[] = array("User Statistics", false, "/dspam-admin-stats.php");
- $tab_array[] = array("Administration", false, "/dspam-admin-prefs.php");
- $tab_array[] = array("Settings", true, "/dspam-settings.php");
- $tab_array[] = array("Control Center", false, "/dspam-perf.php");
- display_top_tabs($tab_array);
- ?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table id="maintable" name="maintable" class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <p><strong>Settings</strong></p>
- <ul style="font-size:0.95em; font-family:Verdana,Arial,sans-serif">
- <li><a href="#db" class="redlnk">Database Settings<?php if ($pconfig['sectionid'] == "db") echo '<span class="red">&nbsp;&raquo;last modified&laquo;</span>'; ?></a></li>
- <li><a href="#del" class="redlnk">Delivery Settings<?php if ($pconfig['sectionid'] == "del") echo '<span class="red">&nbsp;&raquo;last modified&laquo;</span>'; ?></a></li>
- <li><a href="#priv" class="redlnk">DSPAM Privileges<?php if ($pconfig['sectionid'] == "priv") echo '<span class="red">&nbsp;&raquo;last modified&laquo;</span>'; ?></a></li>
- <li><a href="#dbg" class="redlnk">DSPAM Debugging Options<?php if ($pconfig['sectionid'] == "dbg") echo '<span class="red">&nbsp;&raquo;last modified&laquo;</span>'; ?></a></li>
- <li><a href="#eng" class="redlnk">DSPAM Engine Settings<?php if ($pconfig['sectionid'] == "eng") echo '<span class="red">&nbsp;&raquo;last modified&laquo;</span>'; ?></a></li>
- <?php if (checkForLDAPSupport()): ?>
- <li><a href="#ldap" class="redlnk">LDAP Settings<?php if ($pconfig['sectionid'] == "ldap") echo '<span class="red">&nbsp;&raquo;last modified&laquo;</span>'; ?></a></li>
- <?php endif; ?>
- <li><a href="#misc" class="redlnk">Miscellaneous Settings<?php if ($pconfig['sectionid'] == "misc") echo '<span class="red">&nbsp;&raquo;last modified&laquo;</span>'; ?></a></li>
- <li><a href="#main" class="redlnk">Maintainance Settings<?php if ($pconfig['sectionid'] == "main") echo '<span class="red">&nbsp;&raquo;last modified&laquo;</span>'; ?></a></li>
- <li><a href="#sys" class="redlnk">System Settings<?php if ($pconfig['sectionid'] == "sys") echo '<span class="red">&nbsp;&raquo;last modified&laquo;</span>'; ?></a></li>
- <?php if (checkForClamAVSupport()): ?>
- <li><a href="#clam" class="redlnk">ClamAV Engine Settings<?php if ($pconfig['sectionid'] == "clam") echo '<span class="red">&nbsp;&raquo;last modified&laquo;</span>'; ?></a></li>
- <?php endif; ?>
- <li><a href="#srv" class="redlnk">DSPAM Daemon Settings (Server)<?php if ($pconfig['sectionid'] == "srv") echo '<span class="red">&nbsp;&raquo;last modified&laquo;</span>'; ?></a></li>
- <li><a href="#cli" class="redlnk">DSPAM Daemon Settings (Client)<?php if ($pconfig['sectionid'] == "cli") echo '<span class="red">&nbsp;&raquo;last modified&laquo;</span>'; ?></a></li>
- </ul>
- <br />
- </td>
- </tr>
- <tr>
- <td>
- <table id="sortabletable0" name="sortabletable0" width="100%" border="0" cellpadding="10" cellspacing="0">
- <tr>
- <td colspan="2" valign="top" class="listtopic"><a name="db" style="visibility: hidden;">&nbsp;</a>Database Settings</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Storage Driver</td>
- <td width="78%" class="vtable">
- <select name="sdriver" onChange="toggleDBSettings();" class="formselect">
- <?php if (checkForMySQLSupport()): ?>
- <option value="mysql" <?php if($pconfig['sdriver'] == "mysql") echo('selected="selected"');?>>mysql</option>
- <?php endif; ?>
- <?php if (checkForSQLiteSupport()): ?>
- <option value="sqlite" <?php if($pconfig['sdriver'] == "sqlite") echo('selected="selected"');?>>sqlite</option>
- <?php endif; ?>
- <option value="bdb" <?php if($pconfig['sdriver'] == "bdb") echo('selected="selected"');?>>bdb</option>
- <?php if (checkForPgSQLSupport()): ?>
- <option value="pgsql" <?php if($pconfig['sdriver'] == "pgsql") echo('selected="selected"');?>>pgsql</option>
- <?php endif; ?>
- <option value="oracle" <?php if($pconfig['sdriver'] == "oracle") echo('selected="selected"');?>>oracle</option>
- <option value="hash" <?php if($pconfig['sdriver'] == "hash") echo('selected="selected"');?>>hash</option>
- </select>
- <strong>Specifies the storage driver backend (library) to use.</strong>
- <p>
- <span class="vexpl">
- IMPORTANT: Switching storage drivers requires more than merely changing this option.
- If you do not wish to lose all of your data, you will need to migrate it to the new
- backend before making this change.
- </span>
- </p>
- </td>
- </tr>
- <?php if ($pconfig['sdriver'] == "mysql" && checkForMySQLSupport()): ?>
- <tbody id="DBmysql" style="display: table-row-group;">
- <?php else: ?>
- <tbody id="DBmysql" style="display: none;">
- <?php endif; ?>
- <tr>
- <td width="22%" valign="top" class="vncell">MySQL Server</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("msqlserver", "formfld host"); ?> name="msqlserver" id="msqlserver" value="<?=htmlspecialchars($pconfig['msqlserver']);?>" />
- <strong>
- Either a reference to a Unix domain socket or a reference to a specific host.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">MySQL Port</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("msqlport", "formfld unknown"); ?> name="msqlport" id="msqlport" value="<?=htmlspecialchars($pconfig['msqlport']);?>" />
- <strong>
- Use this variable if you are going to a MySQL server instance using TCP/IP instead of a socket connection.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">MySQL User</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("msqluser", "formfld user"); ?> name="msqluser" id="msqluser" value="<?=htmlspecialchars($pconfig['msqluser']);?>" <?php if ($_POST && $input_error_fields && in_array("msqluser", $input_error_fields)) echo 'style="background-color: red;" onFocus="this.style.backgroundColor = \'white\';" onBlur="this.style.backgroundColor = \'red\';"'; ?>/>
- <strong>
- Username, that will be used to connect to a MySQL server instance.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">MySQL Password</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("msqlpwd", "formfld pwd"); ?> name="msqlpwd" id="msqlpwd" value="<?=htmlspecialchars($pconfig['msqlpwd']);?>" <?php if ($_POST && $input_error_fields && in_array("msqlpwd", $input_error_fields)) echo 'style="background-color: red;" onFocus="this.style.backgroundColor = \'white\';" onBlur="this.style.backgroundColor = \'red\';"'; ?>/>
- <strong>
- Password, that will be used to connect to a MySQL server instance.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">MySQL Database</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("msqldb", "formfld unknown"); ?> name="msqldb" id="msqldb" value="<?=htmlspecialchars($pconfig['msqldb']);?>" <?php if ($_POST && $input_error_fields && in_array("msqldb", $input_error_fields)) echo 'style="background-color: red;" onFocus="this.style.backgroundColor = \'white\';" onBlur="this.style.backgroundColor = \'red\';"'; ?>/>
- <strong>
- Database name, that contains DSPAM data.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">MySQL Compress</td>
- <td width="78%" class="vtable">
- <input type="checkbox" class="formfld" name="msqlcomp" id="msqlcomp" value="yes" <?php if (isset($pconfig['msqlcomp'])) echo 'checked="checked"'; ?> />
- <strong>
- Indicates whether communication data between DSPAM and MySQL should be compressed.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">MySQL Supress Quote</td>
- <td width="78%" class="vtable">
- <input type="checkbox" class="formfld" name="msqlsuqt" id="msqlsuqt" value="yes" <?php if (isset($pconfig['msqlsuqt'])) echo 'checked="checked"'; ?> />
- <strong>
- Use this if you have the 4.1 quote bug (see doc/mysql.txt).
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <p>
- <span class="vexpl">
- If you're running DSPAM in client/server (daemon) mode, uncomment the
- setting below to override the default connection cache size (the number
- of connections the server pools between all clients). The connection cache
- represents the maximum number of database connections *available* and should
- be set based on the maximum number of concurrent connections you're likely
- to have. Each connection may be used by only one thread at a time, so all
- other threads _will block_ until another connection becomes available.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">MySQL Connection Cache</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("msqlccache", "formfld unknown"); ?> name="msqlccache" id="msqlccache" value="<?=htmlspecialchars($pconfig['msqlccache']);?>" <?php if ($_POST && $input_error_fields && in_array("msqlccache", $input_error_fields)) echo 'style="background-color: red;" onFocus="this.style.backgroundColor = \'white\';" onBlur="this.style.backgroundColor = \'red\';"'; ?>/>
- <strong>
- Conection cache default set to 10.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <p>
- <span class="vexpl">
- MySQL supports the insertion of the user id into the DSPAM
- signature. This allows you to create one single spam or fp alias
- (pointing to some arbitrary user), and the uid in the signature will
- switch to the correct user. Result: you need only one spam alias
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">MySQL UID In Signature</td>
- <td width="78%" class="vtable">
- <input type="checkbox" class="formfld" name="msqluid" id="msqluid" value="yes" <?php if (isset($pconfig['msqluid'])) echo 'checked="checked"'; ?> />
- <strong>
- Insert user id into the DSPAM signature.
- </strong>
- </td>
- </tr>
- </tbody>
- <?php if ($pconfig['sdriver'] == "sqlite" && checkForSQLiteSupport()): ?>
- <tbody id="DBsqlite" style="display: table-row-group;">
- <?php else: ?>
- <tbody id="DBsqlite" style="display: none;">
- <?php endif; ?>
- <tr>
- <td width="22%" valign="top" class="vncell">SQLite Pragma</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("slitepr", "formfld unknown"); ?> name="slitepr" id="slitepr" value="<?=htmlspecialchars($pconfig['slitepr']);?>" />
- <strong>
- A particular SQLite pragma command to be used.
- </strong>
- <p>
- <span class="vexpl">
- See: <a href="http://sqlite.org/pragma.html" target="_blank">http://sqlite.org/pragma.html</a>
- </span>
- </p>
- </td>
- </tr>
- </tbody>
- <?php if ($pconfig['sdriver'] == "bdb"): ?>
- <tbody id="DBbdb" style="display: table-row-group;">
- <?php else: ?>
- <tbody id="DBbdb" style="display: none;">
- <?php endif; ?>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <strong>
- Nothing to be configured here !
- </strong>
- </td>
- </tr>
- </tbody>
- <?php if ($pconfig['sdriver'] == "pgsql" && checkForPgSQLSupport()): ?>
- <tbody id="DBpgsql" style="display: table-row-group;">
- <?php else: ?>
- <tbody id="DBpgsql" style="display: none;">
- <?php endif; ?>
- <tr>
- <td width="22%" valign="top" class="vncell">PostgreSQL Server</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("pgserver", "formfld host"); ?> name="pgserver" id="pgserver" value="<?=htmlspecialchars($pconfig['pgserver']);?>" />
- <strong>
- A reference to a specific host that is running a PostgreSQL instance.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">PostgreSQL Port</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("pgport", "formfld unknown"); ?> name="pgport" id="pgport" value="<?=htmlspecialchars($pconfig['pgport']);?>" />
- <strong>
- A number that represents the port a specific PostgreSQL instance is listening to.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">PostgreSQL User</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("pguser", "formfld user"); ?> name="pguser" id="pguser" value="<?=htmlspecialchars($pconfig['pguser']);?>" />
- <strong>
- Username, that will be used to connect to a PostgreSQL server instance.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">PostgreSQL Password</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("pgpwd", "formfld pwd"); ?> name="pgpwd" id="pgpwd" value="<?=htmlspecialchars($pconfig['pgpwd']);?>"/>
- <strong>
- Password, that will be used to connect to a PostgreSQL server instance.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">PostgreSQL Database</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("pgdb", "formfld unknown"); ?> name="pgdb" id="pgdb" value="<?=htmlspecialchars($pconfig['pgdb']);?>" />
- <strong>
- Database name, that contains DSPAM data.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <p>
- <span class="vexpl">
- If you're running DSPAM in client/server (daemon) mode, uncomment the
- setting below to override the default connection cache size (the number
- of connections the server pools between all clients). The connection cache
- represents the maximum number of database connections *available* and should
- be set based on the maximum number of concurrent connections you're likely
- to have. Each connection may be used by only one thread at a time, so all
- other threads _will block_ until another connection becomes available.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">PostgreSQL Connection Cache</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("pgccache", "formfld unknown"); ?> name="pgccache" id="pgccache" value="<?=htmlspecialchars($pconfig['pgccache']);?>" />
- <strong>
- Conection cache default set to 3.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <p>
- <span class="vexpl">
- PostgreSQL supports the insertion of the user id into the DSPAM
- signature. This allows you to create one single spam or fp alias
- (pointing to some arbitrary user), and the uid in the signature will
- switch to the correct user. Result: you need only one spam alias
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">PostgreSQL UID In Signature</td>
- <td width="78%" class="vtable">
- <input type="checkbox" class="formfld" name="pguid" id="pguid" value="yes" <?php if (isset($pconfig['pguid'])) echo 'checked="checked"'; ?> />
- <strong>
- Insert user id into the DSPAM signature.
- </strong>
- </td>
- </tr>
- </tbody>
- <?php if ($pconfig['sdriver'] == "oracle"): ?>
- <tbody id="DBoracle" style="display: table-row-group;">
- <?php else: ?>
- <tbody id="DBoracle" style="display: none;">
- <?php endif; ?>
- <tr>
- <td width="22%" valign="top" class="vncell">Attention !</td>
- <td width="78%" class="vtable">
- <strong style="color: red;">
- This feature is currently unsupported !
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Oracle Server</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("oraserver", "formfld host"); ?> name="oraserver" id="oraserver" value="<?=htmlspecialchars($pconfig['oraserver']);?>" />
- <strong>
- A reference to a specific host that is running an Oracle database instance.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Oracle User</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("orauser", "formfld user"); ?> name="orauser" id="orauser" value="<?=htmlspecialchars($pconfig['orauser']);?>" />
- <strong>
- Username, that will be used to connect to a Oracle database server instance.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Oracle Password</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("orapwd", "formfld pwd"); ?> name="orapwd" id="orapwd" value="<?=htmlspecialchars($pconfig['orapwd']);?>" />
- <strong>
- Password, that will be used to connect to a Oracle database server instance.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Oracle Schema</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("orasch", "formfld unknown"); ?> name="orasch" id="orasch" value="<?=htmlspecialchars($pconfig['orasch']);?>" />
- <strong>
- Schema name, that contains DSPAM data.
- </strong>
- </td>
- </tr>
- </tbody>
- <?php if ($pconfig['sdriver'] == "hash"): ?>
- <tbody id="DBhash" style="display: table-row-group;">
- <?php else: ?>
- <tbody id="DBhash" style="display: none;">
- <?php endif; ?>
- <tr>
- <td width="22%" valign="top" class="vncell">Hash Rec Max</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("hsrmax", "formfld unknown"); ?> name="hsrmax" id="hsrmax" value="<?=htmlspecialchars($pconfig['hsrmax']);?>" />
- <strong>
- Default number of records to create in the initial segment when building hash files.
- </strong>
- <p>
- <span class="vexpl">
- 100,000 yields files 1.6MB in size, but can fill up fast, so be sure to increase this
- (to a million or more) if you're not using autoextend.
- </span>
- </p>
- <p>
- <span class="vexpl">
- Primes List:
- <pre>
-53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157, 98317, 196613,
-393241, 786433, 1572869, 3145739, 6291469, 12582917, 25165843, 50331653,
-100663319, 201326611, 402653189, 805306457, 1610612741, 3221225473,
-4294967291
- </pre>
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Hash Auto Extend</td>
- <td width="78%" class="vtable">
- <input type="checkbox" class="formfld" name="hsatex" id="hsatex" value="yes" <?php if (isset($pconfig['hsatex'])) echo 'checked="checked"'; ?> />
- <strong>
- Autoextend hash databases when they fill up. This allows them to continue
- to train by adding extents (extensions) to the file.
- </strong>
- <p>
- <span class="vexpl">
- Note: There will be a small delay during the growth process,
- as everything needs to be closed and remapped.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Hash Max Extents</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("hsmxex", "formfld unknown"); ?> name="hsmxex" id="hsmxex" value="<?=htmlspecialchars($pconfig['hsmxex']);?>" />
- <strong>
- The maximum number of extents that may be created in a single hash file.
- </strong>
- <p>
- <span class="vexpl">
- Note: Set this to zero for unlimited.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Hash Extent Size</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("hsexsz", "formfld unknown"); ?> name="hsexsz" id="hsexsz" value="<?=htmlspecialchars($pconfig['hsexsz']);?>" />
- <strong>
- The record size for newly created extents.
- </strong>
- <p>
- <span class="vexpl">
- Note: Creating this too small could result in many extents
- being created. Creating this too large could result in
- excessive disk space usage.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Hash Max Seek</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("hsmxse", "formfld unknown"); ?> name="hsmxse" id="hsmxse" value="<?=htmlspecialchars($pconfig['hsmxse']);?>" />
- <strong>
- The maximum number of records to seek to insert a new record
- before failing or adding a new extent.
- </strong>
- <p>
- <span class="vexpl">
- Note: Setting this too high will exhaustively scan each segment
- and kill performance. Typically, a low value is acceptable as
- even older extents will continue to fill over time.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Hash Concurrent User</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("hsccus", "formfld unknown"); ?> name="hsccus" id="hsccus" value="<?=htmlspecialchars($pconfig['hsccus']);?>" />
- <strong>
- If you are using a single, stateful hash database in daemon mode,
- specifying a concurrent user will cause the user to be permanently
- mapped into memory and shared via rwlocks.
- </strong>
- <p>
- <span class="vexpl">
- Note: Leave this field blank, if you do not want to use this option.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Hash Connection Cache</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("hscoca", "formfld unknown"); ?> name="hscoca" id="hscoca" value="<?=htmlspecialchars($pconfig['hscoca']);?>" />
- <strong>
- If running in daemon mode, this is the max # of concurrent
- connections that will be supported.
- </strong>
- <p>
- <span class="vexpl">
- Note: If you are using HashConcurrentUser, this option is ignored,
- as all connections are read write locked instead of mutex locked.
- </span>
- </p>
- </td>
- </tr>
- </tbody>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <!-- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> -->
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="document.iform.sectionid.value = 'db';" />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic"><a name="del" style="visibility: hidden;">&nbsp;</a>Delivery Settings</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Trusted Delivery Agent</td>
- <td width="78%" class="vtable">
- <select name="dagent" class="formselect">
- <option value="procmail" <?php if($pconfig['dagent'] == "procmail") echo('selected="selected"');?>>procmail</option>
- <option value="mail" <?php if($pconfig['dagent'] == "mail") echo('selected="selected"');?>>mail</option>
- <option value="mail.local" <?php if($pconfig['dagent'] == "mail.local") echo('selected="selected"');?>>mail.local</option>
- <option value="deliver" <?php if($pconfig['dagent'] == "deliver") echo('selected="selected"');?>>deliver</option>
- <option value="maildrop" <?php if($pconfig['dagent'] == "maildrop") echo('selected="selected"');?>>maildrop</option>
- <option value="exim" <?php if($pconfig['dagent'] == "exim") echo('selected="selected"');?>>exim</option>
- </select>
- <strong>Specifies the local delivery agent DSPAM should call when delivering mail as a trusted user.</strong>
- <p>
- <span class="vexpl">
- Note: Use %u to specify the user DSPAM is processing mail for. It is generally a good idea to
- allow the MTA to specify the pass-through arguments at run-time, but they may also be specified
- here.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">DSPAM Thin Client</td>
- <td width="78%" class="vtable">
- <input type="checkbox" name="dsthinc" id="dsthinc" value="yes" <?php if (isset($pconfig['dsthinc'])) echo 'checked="checked"'; ?> />
- <strong>Use <code>dspamc</code> instead of the <code>dspam</code> binary.</strong>
- <p>
- <span class="vexpl">
- Note: This requires to enable the dspam daemon as well (section: <i>DSPAM Daemon Settings (Server)</i>).
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">TCP/IP Based Delivery</td>
- <td width="78%" class="vtable">
- <input type="checkbox" name="tcpipdel" id="tcpipdel" value="yes" <?php if (isset($pconfig['tcpipdel'])) echo 'checked="checked"'; ?> onClick="enable_change(false, 5);" />
- <strong>Use TCP/IP based delivery.</strong>
- <p>
- <span class="vexpl">
- Note: This option needs to be ticked if you are going to deliver via LMTP or SMTP.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Deliver Host</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("dhost", "formfld host"); ?> name="dhost" id="dhost" value="<?=htmlspecialchars($pconfig['dhost']);?>" <?php if (! isset($pconfig['tcpipdel'])) echo 'disabled="disabled"'; ?> />
- <strong>Alternatively, you may wish to use SMTP or LMTP delivery to deliver your message to the mail server.</strong>
- <p>
- <span class="vexpl">
- Note: You will need to configure with <code>--enable-daemon</code> to use host delivery,
- however you do not need to operate in daemon mode. Specify an IP address or UNIX path to a
- domain socket below as a host.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Deliver Port</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("dport", "formfld unknown"); ?> name="dport" id="dport" value="<?=htmlspecialchars($pconfig['dport']);?>" <?php if (! isset($pconfig['tcpipdel'])) echo 'disabled="disabled"'; ?> />
- <strong>Port number of a particular host.</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Deliver Ident</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("dident", "formfld unknown"); ?> name="dident" id="dident" value="<?=htmlspecialchars($pconfig['dident']);?>" <?php if (! isset($pconfig['tcpipdel'])) echo 'disabled="disabled"'; ?> />
- <strong>A particular identification string</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">TCP/IP Delivery Protocol</td>
- <td width="78%" class="vtable">
- <select name="delproto" class="formselect" <?php if (! isset($pconfig['tcpipdel'])) echo 'disabled="disabled"'; ?>>
- <option value="smtp" <?php if($pconfig['delproto'] == "smtp") echo('selected="selected"');?>>smtp</option>
- <option value="lmtp" <?php if($pconfig['delproto'] == "lmtp") echo('selected="selected"');?>>lmtp</option>
- </select>
- <strong>A particular protocol typ. Either <acronym title="Simple Mail Transfer Protocol">SMTP</acronym>
- or <acronym title="Local Mail Transfer Protocol">LMTP</acronym>.</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">On Fail</td>
- <td width="78%" class="vtable">
- <select name="onfail" class="formselect">
- <option value="error" <?php if($pconfig['onfail'] == "error") echo('selected="selected"');?>>error</option>
- <option value="unlearn" <?php if($pconfig['onfail'] == "unlearn") echo('selected="selected"');?>>unlearn</option>
- </select>
- <strong>What to do if local delivery or quarantine should fail.</strong>
- <p>
- <span class="vexpl">
- Note: If set to &quot;unlearn&quot;, DSPAM will unlearn the message prior to exiting with an un
- successful return code. The default option, &quot;error&quot; will not unlearn the message but
- return the appropriate error code. The unlearn option is use-ful on some systems where local
- delivery failures will cause the message to be requeued for delivery, and could result in the
- message being processed multiple times. During a very large failure, however, this could cause
- a significant load increase.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <!-- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> -->
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="document.iform.sectionid.value = 'del';" />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic"><a name="priv" style="visibility: hidden;">&nbsp;</a>DSPAM Privileges</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Trusted Users</td>
- <td width="78%" class="vtable">
- <strong>Unix users which are allowed to perform certain actions.</strong>
- <p>
- <span class="vexpl">
- Note: Only the users specified below will be allowed to perform
- administrative functions in DSPAM such as setting the active user and
- accessing tools. All other users attempting to run DSPAM will be restricted;
- their uids will be forced to match the active username and they will not be
- able to specify delivery agent privileges or use tools.
- </span>
- </p>
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="55%" class="listhdrr"><?=gettext("UNIX username");?></td>
- <td width="35%" class="listhdr"><?=gettext("Description");?></td>
- <td width="10%" class="list"></td>
- </tr>
- <?php if(is_array($t_users)): ?>
- <?php $i = 0; foreach ($t_users as $user): ?>
- <?php if($user['name'] <> ""): ?>
-
- <tr>
- <td class="listlr" ondblclick="document.location='dspam-settings-tuser.php?id=<?=$i;?>&sectionid=priv';">
- <?=htmlspecialchars($user['name']);?>
- </td>
- <td class="listbg" ondblclick="document.location='dspam-settings-tuser.php?id=<?=$i;?>&sectionid=priv';">
- <font color="#FFFFFF"><?=htmlspecialchars($user['descr']);?>&nbsp;</font>
- </td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-tuser.php?id=<?=$i;?>&sectionid=priv"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="dspam-settings.php?act=del&what=tuser&id=<?=$i;?>&sectionid=priv" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <?php endif; ?>
- <?php $i++; endforeach; ?>
- <?php endif; ?>
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-tuser.php?sectionid=priv"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <!-- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> -->
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="document.iform.sectionid.value = 'priv';" />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td valign="top" class="listtopic"><a name="dbg" style="visibility: hidden;">&nbsp;</a>DSPAM Debugging Options</td>
- <td align="right" valign="top" class="listtopic">
- <input type="checkbox" name="enabledbg" id="enabledbg" value="yes" <?php if (isset($pconfig['enabledbg'])) echo 'checked="checked"'; ?> onClick="enable_change(false, 0);" />
- <strong>Enable</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Debug</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("debug", "formfld unknown"); ?> name="debug" id="debug" value="<?=htmlspecialchars($pconfig['debug']);?>" <?php if (! isset($pconfig['enabledbg'])) echo 'disabled="disabled"'; ?> />
- <strong>Enables debugging for some or all users.</strong>
- <p>
- <span class="vexpl">
- IMPORTANT: DSPAM must be compiled with debug support in order to use this option.
- DSPAM should never be running in production with debug active unless you are
- troubleshooting problems.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Debug Options</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("dopt", "formfld unknown"); ?> name="dopt" id="dopt" value="<?=htmlspecialchars($pconfig['dopt']);?>" <?php if (! isset($pconfig['enabledbg'])) echo 'disabled="disabled"'; ?> />
- <strong>One or more of: process, classify, spam, fp, inoculation, corpus</strong>
- <p>
- <span class="vexpl">
- <pre>
-process standard message processing
-classify message classification using --classify
-spam error correction of missed spam
-fp error correction of false positives
-inoculation message inoculations (source=inoculation)
-corpus corpusfed messages (source=corpus)
- </pre>
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <!-- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> -->
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="document.iform.sectionid.value = 'dbg';" />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic"><a name="eng" style="visibility: hidden;">&nbsp;</a>DSPAM Engine Settings</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Training Mode</td>
- <td width="78%" class="vtable">
- <select name="tmode" class="formselect">
- <option value="toe" <?php if($pconfig['tmode'] == "toe") echo('selected="selected"');?>>toe</option>
- <option value="tum" <?php if($pconfig['tmode'] == "tum") echo('selected="selected"');?>>tum</option>
- <option value="teft" <?php if($pconfig['tmode'] == "teft") echo('selected="selected"');?>>teft</option>
- <option value="notrain" <?php if($pconfig['tmode'] == "notrain") echo('selected="selected"');?>>notrain</option>
- </select>
- <strong>
- The default training mode to use for all operations, when one has not been
- specified on the commandline or in the user's preferences.
- </strong>
- <p>
- <span class="vexpl">
- Acceptable values are: toe, tum, teft, notrain
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Test Conditional Training</td>
- <td width="78%" class="vtable">
- <input name="testct" type="checkbox" id="testct" value="yes" <?php if (isset($pconfig['testct'])) echo 'checked="checked"'; ?> />
- <strong>
- By default, dspam will retrain certain errors
- until the condition is no longer met.
- </strong>
- <p>
- <span class="vexpl">
- Note: This usually accelerates learning. Some people argue that this can increase
- the risk of errors, however.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Features</td>
- <td width="78%" class="vtable">
- <strong>
- Specify features to activate by default; can also be specified
- on the commandline. See the documentation for a list of available features.
- If _any_ features are specified on the commandline, these are ignored.
- </strong>
- <p>
- <span class="vexpl">
- Note: For standard "CRM114" Markovian weighting, use sbph
- </span>
- </p>
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="55%" class="listhdrr"><?=gettext("DSPAM Feature");?></td>
- <td width="35%" class="listhdr"><?=gettext("Description");?></td>
- <td width="10%" class="list"></td>
- </tr>
- <?php if(is_array($t_features)): ?>
- <?php $i = 0; foreach ($t_features as $feature): ?>
- <?php if($feature['name'] <> ""): ?>
-
- <tr>
- <td class="listlr" ondblclick="document.location='dspam-settings-feat.php?id=<?=$i;?>&sectionid=eng';">
- <?=htmlspecialchars($feature['name']);?>
- </td>
- <td class="listbg" ondblclick="document.location='dspam-settings-feat.php?id=<?=$i;?>&sectionid=eng';">
- <font color="#FFFFFF"><?=htmlspecialchars($feature['descr']);?>&nbsp;</font>
- </td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-feat.php?id=<?=$i;?>&sectionid=eng"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="dspam-settings.php?act=del&what=feat&id=<?=$i;?>&sectionid=eng" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <?php endif; ?>
- <?php $i++; endforeach; ?>
- <?php endif; ?>
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-feat.php?sectionid=eng"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Algorithms</td>
- <td width="78%" class="vtable">
- <strong>
- Specify the statistical algorithms to use, overriding any
- defaults configured in the build.
- </strong>
- <p>
- <span class="vexpl">
- The options are:
- <pre>
-naive Naive-Bayesian (All Tokens)
-graham Graham-Bayesian ("A Plan for Spam")
-burton Burton-Bayesian (SpamProbe)
-robinson Robinson's Geometric Mean Test (Obsolete)
-chi-square Fisher-Robinson's Chi-Square Algorithm
- </pre>
- </span>
- </p>
- <p>
- <span class="vexpl">
- You may have multiple algorithms active simultaneously, but it is strongly
- recommended that you group Bayesian algorithms with other Bayesian
- algorithms, and any use of Chi-Square remain exclusive.
- </p>
- <p>
- <span class="vexpl">
- NOTE: For standard &quot;CRM114&quot; Markovian weighting, use &lsquo;naive&rsquo;, or consider
- using &lsquo;burton&rsquo; for slightly better accuracy.
- </span>
- </p>
- <p>
- <span class="vexpl">
- Don't mess with this unless you know what you're doing
- </span>
- </p>
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="55%" class="listhdrr"><?=gettext("DSPAM Algorithm");?></td>
- <td width="35%" class="listhdr"><?=gettext("Description");?></td>
- <td width="10%" class="list"></td>
- </tr>
- <?php if(is_array($t_algos)): ?>
- <?php $i = 0; foreach ($t_algos as $algo): ?>
- <?php if($algo['name'] <> ""): ?>
-
- <tr>
- <td class="listlr" ondblclick="document.location='dspam-settings-algo.php?id=<?=$i;?>&sectionid=eng';">
- <?=htmlspecialchars($algo['name']);?>
- </td>
- <td class="listbg" ondblclick="document.location='dspam-settings-algo.php?id=<?=$i;?>&sectionid=eng';">
- <font color="#FFFFFF"><?=htmlspecialchars($algo['descr']);?>&nbsp;</font>
- </td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-algo.php?id=<?=$i;?>&sectionid=eng"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="dspam-settings.php?act=del&what=algo&id=<?=$i;?>&sectionid=eng" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <?php endif; ?>
- <?php $i++; endforeach; ?>
- <?php endif; ?>
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-algo.php?sectionid=eng"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">PValue</td>
- <td width="78%" class="vtable">
- <select name="pvalue" class="formselect">
- <option value="graham" <?php if($pconfig['pvalue'] == "toe") echo('selected="selected"');?>>graham</option>
- <option value="robinson" <?php if($pconfig['pvalue'] == "toe") echo('selected="selected"');?>>robinson</option>
- <option value="markov" <?php if($pconfig['pvalue'] == "toe") echo('selected="selected"');?>>markov</option>
- </select>
- <strong>
- Specify the technique used for calculating PValues, overriding any defaults
- configured in the build.
- </strong>
- <p>
- <span class="vexpl">
- These options are:
- <pre>
-graham Graham's Technique (&quot;A Plan for Spam&quot;)
-robinson Robinson's Technique
-markov Markovian Weighted Technique
- </pre>
- </span>
- </p>
- <p>
- <span class="vexpl">
- Unlike algorithms, you may only have one of these defined. Use of the
- chi-square algorithm automatically changes this to robinson.
- </span>
- </p>
- <p>
- <span class="vexpl">
- Don't mess with this unless you know what you're doing.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Improbability Drive</td>
- <td width="78%" class="vtable">
- <input name="ipdrive" type="checkbox" id="ipdrive" value="yes" <?php if (isset($pconfig['ipdrive'])) echo 'checked="checked"'; ?> />
- <strong>
- Calculate odds-ratios for ham/spam, and add to X-DSPAM-Improbability headers
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Preferences</td>
- <td width="78%" class="vtable">
- <strong>
- Specify any preferences to set by default, unless otherwise
- overridden by the user (see next section) or a default.prefs file.
- </strong>
- <p>
- <span class="vexpl">
- Note: If user or default.prefs are found, the user's
- preferences will override any defaults.
- </span>
- </p>
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="55%" class="listhdrr"><?=gettext("DSPAM Preference Value");?></td>
- <td width="35%" class="listhdr"><?=gettext("Description");?></td>
- <td width="10%" class="list"></td>
- </tr>
- <?php if(is_array($t_prefs)): ?>
- <?php $i = 0; foreach ($t_prefs as $pref): ?>
- <?php if($pref['value'] <> ""): ?>
-
- <tr>
- <td class="listlr" ondblclick="document.location='dspam-settings-prefs.php?id=<?=$i;?>&sectionid=eng';">
- <?=htmlspecialchars($pref['value']);?>
- </td>
- <td class="listbg" ondblclick="document.location='dspam-settings-prefs.php?id=<?=$i;?>&sectionid=eng';">
- <font color="#FFFFFF"><?=htmlspecialchars($pref['descr']);?>&nbsp;</font>
- </td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-prefs.php?id=<?=$i;?>&sectionid=eng"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="dspam-settings.php?act=del&what=pref&id=<?=$i;?>&sectionid=eng" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <?php endif; ?>
- <?php $i++; endforeach; ?>
- <?php endif; ?>
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-prefs.php?sectionid=eng"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Overrides</td>
- <td width="78%" class="vtable">
- <strong>
- Specifies the user preferences which may override
- configuration and commandline defaults.
- </strong>
- <p>
- <span class="vexpl">
- Note: Any other preferences supplied by an untrusted user will be ignored.
- </span>
- </p>
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="55%" class="listhdrr"><?=gettext("DSPAM Override Value");?></td>
- <td width="35%" class="listhdr"><?=gettext("Description");?></td>
- <td width="10%" class="list"></td>
- </tr>
- <?php if(is_array($t_overr)): ?>
- <?php $i = 0; foreach ($t_overr as $over): ?>
- <?php if($over['value'] <> ""): ?>
-
- <tr>
- <td class="listlr" ondblclick="document.location='dspam-settings-overr.php?id=<?=$i;?>&sectionid=eng';">
- <?=htmlspecialchars($over['value']);?>
- </td>
- <td class="listbg" ondblclick="document.location='dspam-settings-overr.php?id=<?=$i;?>&sectionid=eng';">
- <font color="#FFFFFF"><?=htmlspecialchars($over['descr']);?>&nbsp;</font>
- </td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-overr.php?id=<?=$i;?>&sectionid=eng"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="dspam-settings.php?act=del&what=overr&id=<?=$i;?>&sectionid=eng" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <?php endif; ?>
- <?php $i++; endforeach; ?>
- <?php endif; ?>
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-overr.php?sectionid=eng"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <!-- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> -->
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="document.iform.sectionid.value = 'eng';" />
- </td>
- </tr>
- <?php if (checkForLDAPSupport()): ?>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td valign="top" class="listtopic"><a name="ldap" style="visibility: hidden;">&nbsp;</a>LDAP Settings</td>
- <td align="right" valign="top" class="listtopic">
- <input name="enableldap" type="checkbox" id="enableldap" value="yes" <?php if (isset($pconfig['enableldap'])) echo 'checked="checked"'; ?> onClick="enable_change(false, 1);" />
- <strong>Enable</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">LDAP Mode</td>
- <td width="78%" class="vtable">
- <select name="ldapmode" class="formselect" <?php if (! isset($pconfig['enableldap'])) echo 'disabled="disabled"'; ?>>
- <option value="verify" selected="selected">verify</option>
- </select>
- <strong>
- Perform various LDAP functions depending on LDAPMode variable.
- </strong>
- <p>
- <span class="vexpl">
- Note: Presently, the only mode supported is 'verify', which will verify the
- existence of an unknown user in LDAP prior to creating them as a new user in
- the system. This is useful on some systems acting as gateway machines.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">LDAP Host</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("hldaphost", "formfld host"); ?> name="ldaphost" id="ldaphost" value="<?=htmlspecialchars($pconfig['ldaphost']);?>" <?php if (! isset($pconfig['enableldap'])) echo 'disabled="disabled"'; ?> />
- <strong>
- Hostname of the LDAP directory server.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">LDAP Filter</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("ldapfilter", "formfld unknown"); ?> name="ldapfilter" id="ldapfilter" value="<?=htmlspecialchars($pconfig['ldapfilter']);?>" <?php if (! isset($pconfig['enableldap'])) echo 'disabled="disabled"'; ?> />
- <strong>
- A specific query filter, that should be used while querying the LDAP server.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">LDAP Base</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("ldapbase", "formfld unknown"); ?> name="ldapbase" id="ldapbase" value="<?=htmlspecialchars($pconfig['ldapbase']);?>" <?php if (! isset($pconfig['enableldap'])) echo 'disabled="disabled"'; ?> />
- <strong>
- A particular distinguish name from where to start LDAP queries.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <!-- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> -->
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="document.iform.sectionid.value = 'ldap';" />
- </td>
- </tr>
- <?php endif; ?>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic"><a name="misc" style="visibility: hidden;">&nbsp;</a>Miscellaneous Settings</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Failover Attempts</td>
- <td width="78%" class="vtable">
- <input type="text" size="30"<?= checkForErrorClass("foatt", "formfld unknown"); ?> name="foatt" id="foatt" value="<?=htmlspecialchars($pconfig['foatt']);?>" />
- <strong>
- A particular number of attempts.
- </strong>
- <p>
- <span class="vexpl">
- If the storage fails, the agent will follow each profile's failover up to
- a maximum number of failover attempts. This should be set to a maximum of
- the number of profiles you have, otherwise the agent could loop and try
- the same profile multiple times (unless this is your desired behavior).
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Ignore Headers</td>
- <td width="78%" class="vtable">
- <p>
- <span class="vexpl">
- If DSPAM is behind other tools which may add a header to
- incoming emails, it may be beneficial to ignore these headers - especially
- if they are coming from another spam filter. If you are _not_ using one of
- these tools, however, leaving the appropriate headers commented out will
- allow DSPAM to use them as telltale signs of forged email.
- </span>
- </p>
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="55%" class="listhdrr"><?=gettext("Header Name");?></td>
- <td width="35%" class="listhdr"><?=gettext("Description");?></td>
- <td width="10%" class="list"></td>
- </tr>
- <?php if(is_array($t_headers)): ?>
- <?php $i = 0; foreach ($t_headers as $header): ?>
- <?php if($header['name'] <> ""): ?>
-
- <tr>
- <td class="listlr" ondblclick="document.location='dspam-settings-header.php?id=<?=$i;?>&sectionid=misc';">
- <?=htmlspecialchars($header['name']);?>
- </td>
- <td class="listbg" ondblclick="document.location='dspam-settings-header.php?id=<?=$i;?>&sectionid=misc';">
- <font color="#FFFFFF"><?=htmlspecialchars($header['descr']);?>&nbsp;</font>
- </td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-header.php?id=<?=$i;?>&sectionid=misc"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="dspam-settings.php?act=del&what=header&id=<?=$i;?>&sectionid=misc" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <?php endif; ?>
- <?php $i++; endforeach; ?>
- <?php endif; ?>
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-header.php?sectionid=misc"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">SBL Lookup</td>
- <td width="78%" class="vtable">
- <p>
- <input type="checkbox" name="enablesbl" id="enablesbl" value="yes" <?php if (isset($pconfig['enablesbl'])) echo 'checked="checked"'; ?> onClick="enable_change(false, 2);" />
- <strong>
- Enable checks against a particular <acronym title="Streamlined Blackhole List">SBL</acronym> host.
- </strong>
- </p>
- <p>
- <input type="text" size="30" c<?= checkForErrorClass("sblhost", "formfld host"); ?> name="sblhost" id="sblhost" value="<?=htmlspecialchars($pconfig['sblhost']);?>" <?php if (! isset($pconfig['enablesbl'])) echo 'disabled="disabled"'; ?> />
- <strong>
- A particular SBL hostname.
- </strong>
- </p>
- <p>
- <span class="vexpl">
- Perform lookups on streamlined blackhole list servers (see
- <a href="http://www.nuclearelephant.com/projects/sbl/" target="_blank">http://www.nuclearelephant.com/projects/sbl/</a>).
- The streamlined blacklist
- server is machine-automated, unsupervised blacklisting system designed to
- provide real-time and highly accurate blacklisting based on network spread.
- When performing a lookup, DSPAM will automatically learn the inbound message
- as spam if the source IP is listed. Until an official public RABL server is
- available, this feature is only useful if you are running your own
- streamlined blackhole list server for internal reporting among multiple mail
- servers. Provide the name of the lookup zone below to use.
- </span>
- </p>
- <p>
- <span class="vexpl">
- This function performs standard reverse-octet.domain lookups, and while it
- will function with many RBLs, it's strongly discouraged to use those
- maintained by humans as they're often inaccurate and could hurt filter
- learning and accuracy.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">RBL Inoculate</td>
- <td width="78%" class="vtable">
- <input name="enablerbl" type="checkbox" id="enablerbl" value="yes" <?php if (isset($pconfig['enablerbl'])) echo 'checked="checked"'; ?> />
- <strong>
- Enable <acronym title="Realtime Blackhole List">RBL</acronym> inoculation support.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Enable Notification</td>
- <td width="78%" class="vtable">
- <input name="enablenoti" type="checkbox" id="enablenoti" value="yes" <?php if (isset($pconfig['enablenoti'])) echo 'checked="checked"'; ?> onClick="enable_change(false, 2);" />
- <strong>
- Enable the sending of notification emails to users (first message, quarantine full, etc.)
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">DSPAM Support Contact</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("dspamcontact", "formfld mail"); ?> name="dspamcontact" id="dspamcontact" value="<?=htmlspecialchars($pconfig['dspamcontact']);?>" <?php if (empty($pconfig['enablenoti'])) echo 'disabled="disabled"'; ?> />
- <strong>
- The username of the person who provides DSPAM support for this DSPAM installation
- </strong>
- &nbsp;(This is the left most part of an email address before the @ sign).
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Email Domain Name</td>
- <td width="78%" class="vtable">
- <input name="whichdomain" type="checkbox" id="whichdomain" value="yes" <?php if (empty($pconfig['dspamdomain'])) echo 'checked="checked"'; if (empty($pconfig['enablenoti'])) echo 'disabled="disabled"'; ?> onClick="toggleDSPAMDomain(false, this);" />
- <strong>
- Use global domain settings while trying to send an email message.
- </strong>
- </td>
- </tr>
- <?php if (isset($pconfig['dspamdomain'])): ?>
- <tbody id="emailnotitb" style="display: table-row-group;">
- <?php else: ?>
- <tbody id="emailnotitb" style="display: none;">
- <?php endif; ?>
- <tr>
- <td width="22%" valign="top" class="vncell">DSPAM Domain Name</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("dspamdomain", "formfld url"); ?> name="dspamdomain" id="dspamdomain" value="<?=htmlspecialchars($pconfig['dspamdomain']);?>" />
- <strong>
- Use this domain name while trying to send an email message.
- </strong>
- </td>
- </tr>
- </tbody>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <!-- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> -->
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="document.iform.sectionid.value = 'misc';" />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic"><a name="main" style="visibility: hidden;">&nbsp;</a>Maintainance Settings</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <p>
- <span class="vexpl">
- Set dspam_clean purge default options, if not
- otherwise specified on the commandline. You may set some of
- the below values to <code>off</code>, for instance if you are
- using a SQL-based database backend for DSPAM. Please consult your
- DSPAM manual for any details.
- </span>
- </p>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Purge Signatures</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("psig", "formfld unknown"); ?> name="psig" id="psig" value="<?=htmlspecialchars($pconfig['psig']);?>" />
- <strong>
- Purge stale signatures
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Purge Neutral</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("pneut", "formfld unknown"); ?> name="pneut" id="pneut" value="<?=htmlspecialchars($pconfig['pneut']);?>" />
- <strong>
- Purge tokens with neutralish probabilities
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Purge Unused</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("punu", "formfld unknown"); ?> name="punu" id="punu" value="<?=htmlspecialchars($pconfig['punu']);?>" />
- <strong>
- Purge unused tokens
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Purge Hapaxes</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("phapa", "formfld unknown"); ?> name="phapa" id="phapa" value="<?=htmlspecialchars($pconfig['phapa']);?>" />
- <strong>
- Purge tokens with less than 5 hits (hapaxes)
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Purge Hits 1S</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("pones", "formfld unknown"); ?> name="pones" id="pones" value="<?=htmlspecialchars($pconfig['pones']);?>" />
- <strong>
- Purge tokens with only 1 spam hit
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Purge Hits 1I</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("ponei", "formfld unknown"); ?> name="ponei" id="ponei" value="<?=htmlspecialchars($pconfig['ponei']);?>" />
- <strong>
- Purge tokens with only 1 innocent hit
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <!-- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> -->
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="document.iform.sectionid.value = 'main';" />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic"><a name="sys" style="visibility: hidden;">&nbsp;</a>System Settings</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Local MX</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("locmx", "formfld host"); ?> name="locmx" id="locmx" value="<?=htmlspecialchars($pconfig['locmx']);?>" />
- <strong>
- Local Mail Exchangers: Used for source address tracking, tells DSPAM which
- mail exchangers are local and therefore should be ignored in the Received:
- header when tracking the source of an email. Note: you should use the address
- of the host as appears between brackets [ ] in the Received header.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <span class="vexpl">
- Disabling logging for users will make usage graphs unavailable to
- them. Disabling system logging will make admin graphs unavailable.
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Enable System Log</td>
- <td width="78%" class="vtable">
- <input name="enablesysl" type="checkbox" id="enablesysl" value="yes" <?php if (isset($pconfig['enablesysl'])) echo 'checked="checked"'; ?> />
- <strong>
- Enable system logging.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Enable User Log</td>
- <td width="78%" class="vtable">
- <input name="enableusel" type="checkbox" id="enableusel" value="yes" <?php if (isset($pconfig['enableusel'])) echo 'checked="checked"'; ?> />
- <strong>
- Enable user logging.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Opt Settings</td>
- <td width="78%" class="vtable">
- <select name="optinout" class="formselect">
- <option value="out" <?php if($pconfig['optinout'] == "out") echo('selected="selected"');?>>out</option>
- <option value="in" <?php if($pconfig['optinout'] == "in") echo('selected="selected"');?>>in</option>
- </select>
- <p>
- <span class="vexpl">
- Opt: in or out; determines DSPAM's default filtering behavior. If this value
- is set to in, users must opt-in to filtering by dropping a .dspam file in
- <code>/var/dspam/opt-in/user.dspam</code> (or if you have homedirs configured, a .dspam
- folder in their home directory). The default is opt-out, which means all
- users will be filtered unless a <code>.nodspam</code> file is dropped in
- <code>/var/dspam/opt-out/user.nodspam</code>
- <span class="vexpl">
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <span class="vexpl">
- In lieu of setting up individual aliases for each user,
- DSPAM can be configured to automatically parse the To: address for spam and
- false positive forwards. From there, it can be configured to either set the
- DSPAM user based on the username specified in the header and/or change the
- training class and source accordingly. The options below can be used to
- customize most common types of header parsing behavior to avoid the need for
- multiple aliases, or if using LMTP, aliases entirely..
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Parse To Headers</td>
- <td width="78%" class="vtable">
- <input name="enableptoh" type="checkbox" id="enableptoh" value="yes" <?php if (isset($pconfig['enableptoh'])) echo 'checked="checked"'; ?> />
- <strong>
- Parse the <i>To:</i> headers of an incoming message.
- </strong>
- <p>
- <span class="vexpl">
- This must be set to &lsquo;on&rsquo; to use either of the following features.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Change Mode On Parse</td>
- <td width="78%" class="vtable">
- <input name="enablecmop" type="checkbox" id="enablecmop" value="yes" <?php if (isset($pconfig['enablecmop'])) echo 'checked="checked"'; ?> />
- <strong>
- Automatically change the class (to spam or innocent).
- </strong>
- <p>
- <span class="vexpl">
- This depends on whether spam- or notspam- was specified, and change
- the source to &lsquo;error&rsquo;. This is convenient if you're not
- using aliases at all, but are delivering via LMTP.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Change User On Parse</td>
- <td width="78%" class="vtable">
- <input name="enablecuop" type="checkbox" id="enablecuop" value="yes" <?php if (isset($pconfig['enablecuop'])) echo 'checked="checked"'; ?> />
- <strong>
- Automatically change the username to match that specified in the <i>To:</i> header.
- </strong>
- <p>
- <span class="vexpl">
- For example, <code>spam-bob@domain.tld</code> will set the username
- to bob, ignoring any --user passed in. This may not always be desirable if
- you are using virtual email addresses as usernames. Options:
- on or user take the portion before the @ sign only
- full take everything after the initial {spam,notspam}-.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Broken MTA Settings</td>
- <td width="78%" class="vtable">
- <input name="enablebmta" type="checkbox" id="enablebmta" value="yes" <?php if (isset($pconfig['enablebmta'])) echo 'checked="checked"'; ?> />
- <strong>
- Enable broken MTA settings.
- </strong>
- <p>
- <span class="vexpl">
- Broken MTA Options: Some MTAs don't support the proper functionality
- necessary. In these cases you can activate certain features in DSPAM to
- compensate. &lsquo;returnCodes&rsquo; causes DSPAM to return an exit code of 99 if
- the message is spam, 0 if not, or a negative code if an error has occured.
- Specifying &lsquo;case&rsquo; causes DSPAM to force the input usernames to lowercase.
- Spceifying &lsquo;lineStripping&rsquo; causes DSPAM to strip &circ;M's from messages passed
- </span>
- </p>
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="55%" class="listhdrr"><?=gettext("Broken MTA Option");?></td>
- <td width="35%" class="listhdr"><?=gettext("Description");?></td>
- <td width="10%" class="list"></td>
- </tr>
- <?php if(is_array($t_bmtas)): ?>
- <?php $i = 0; foreach ($t_bmtas as $bmta): ?>
- <?php if($bmta['name'] <> ""): ?>
-
- <tr>
- <td class="listlr" ondblclick="document.location='dspam-settings-bmta.php?id=<?=$i;?>&sectionid=sys';">
- <?=htmlspecialchars($bmta['name']);?>
- </td>
- <td class="listbg" ondblclick="document.location='dspam-settings-bmta.php?id=<?=$i;?>&sectionid=sys';">
- <font color="#FFFFFF"><?=htmlspecialchars($bmta['descr']);?>&nbsp;</font>
- </td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-bmta.php?id=<?=$i;?>&sectionid=sys"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="dspam-settings.php?act=del&what=bmta&id=<?=$i;?>&sectionid=sys" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <?php endif; ?>
- <?php $i++; endforeach; ?>
- <?php endif; ?>
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-bmta.php?sectionid=sys"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Max Message Size</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("maxmsgs", "formfld unknown"); ?> name="maxmsgs" id="maxmsgs" value="<?=htmlspecialchars($pconfig['maxmsgs']);?>" />
- <strong>
- You may specify a maximum message size for DSPAM to process.
- </strong>
- <p>
- <span class="vexpl">
- If the message is larger than the maximum size, it will be delivered
- without processing. Value is in bytes.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Processor Bias</td>
- <td width="78%" class="vtable">
- <input type="checkbox" name="procbias" id="procbias" value="yes" <?php if (isset($pconfig['procbias'])) echo 'checked="checked"'; ?> />
- <strong>
- Bias causes the filter to lean more toward &lsquo;innocent&rsquo;, and
- usually greatly reduces false positives. It is the default behavior of
- most Bayesian filters (including dspam).
- </strong>
- <p>
- <span class="vexpl">
- Note: You probably DONT want this if you're using Markovian Weighting,
- unless you are paranoid about false positives.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <!-- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> -->
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="document.iform.sectionid.value = 'sys';" />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <?php if (checkForClamAVSupport()): ?>
- <tr>
- <td valign="top" class="listtopic"><a name="clam" style="visibility: hidden;">&nbsp;</a>ClamAV Engine Settings</td>
- <td align="right" valign="top" class="listtopic">
- <input name="enableclam" type="checkbox" id="enableclam" value="yes" <?php if (isset($pconfig['enableclam'])) echo 'checked="checked"'; ?> onClick="enable_change(false, 3);" />
- <strong>Enable</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <p>
- <span class="vexpl">
- If you are running clamd, DSPAM can perform stream-based
- virus checking using TCP. Uncomment the values below to enable virus
- checking.
- </span>
- </p>
- <p>
- <span class="vexpl">
- ClamAVResponse:
- <dl>
- <dt>reject</dt>
- <dd>(reject or drop the message with a permanent failure)</dd>
- <dt>accept</dt>
- <dd>(accept the message and quietly drop the message)</dd>
- <dt>spam</dt>
- <dd>(treat as spam and quarantine/tag/whatever)</dd>
- </dl>
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">ClamAV Port</td>
- <td width="78%" class="vtable">
- <p>
- <input type="text" size="30" <?= checkForErrorClass("clamport", "formfld unknown"); ?> name="clamport" id="clamport" value="<?=htmlspecialchars($pconfig['clamport']);?>" <?php if (! isset($pconfig['enableclam'])) echo 'disabled="disabled"'; ?> />
- <strong>
- A number that specifies the port the ClamAV daemon is listening to.
- </strong>
- </p>
- <p>
- <span class="vexpl">
- If the message is larger than the maximum size, it will be delivered
- without processing. Value is in bytes.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">ClamAV Host</td>
- <td width="78%" class="vtable">
- <input type="text" size="30" <?= checkForErrorClass("clamhost", "formfld host"); ?> name="clamhost" id="clamhost" value="<?=htmlspecialchars($pconfig['clamhost']);?>" <?php if (! isset($pconfig['enableclam'])) echo 'disabled="disabled"'; ?> />
- <strong>
- An IP address that points to the host the ClamAV daemon is running on.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">ClamAV Response</td>
- <td width="78%" class="vtable">
- <select name="clamresp" class="formselect" <?php if (! isset($pconfig['enableclam'])) echo 'disabled="disabled"'; ?>>
- <option value="reject" <?php if($pconfig['clamresp'] == "reject") echo('selected="selected"');?>>reject</option>
- <option value="accept" <?php if($pconfig['clamresp'] == "accept") echo('selected="selected"');?>>accept</option>
- <option value="spam" <?php if($pconfig['clamresp'] == "spam") echo('selected="selected"');?>>spam</option>
- </select>
- <strong>
- The action that should take place, if ClamAV reports a positive.
- </strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <!-- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> -->
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="document.iform.sectionid.value = 'clam';" />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <?php endif; ?>
- <tr>
- <td colspan="2" valign="top" class="listtopic"><a name="srv" style="visibility: hidden;">&nbsp;</a>DSPAM Daemon Settings (Server)</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <span class="vexpl">
- If you are running DSPAM as a daemonized server using
- <code>--daemon</code>, the following parameters will override the default. Use the
- ServerPass option to set up accounts for each client machine. The DSPAM
- server will process and deliver the message based on the parameters
- specified. If you want the client machine to perform delivery, use
- the <code>--stdout</code> option in conjunction with a local setup.
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Server Port</td>
- <td width="78%" class="vtable">
- <p>
- <input type="text" size="30" <?= checkForErrorClass("dsport", "formfld unknown"); ?> name="dsport" id="dsport" value="<?=htmlspecialchars($pconfig['dsport']);?>" />
- <strong>
- A number that specifies the port the DSPAM daemon is listening to.
- </strong>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Server Queue Size</td>
- <td width="78%" class="vtable">
- <p>
- <input type="text" size="30" <?= checkForErrorClass("dsqsize", "formfld unknown"); ?> name="dsqsize" id="dsqsize" value="<?=htmlspecialchars($pconfig['dsqsize']);?>" />
- <strong>
- A number that specifies the server's queue size.
- </strong>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Server PID</td>
- <td width="78%" class="vtable">
- <p>
- <input type="text" size="30" <?= checkForErrorClass("dspid", "formfld file"); ?> name="dspid" id="dspid" value="<?=htmlspecialchars($pconfig['dspid']);?>" />
- <strong>
- Keep this is sync with <code>/usr/local/etc/rc.d/dspam.rc</code> script.
- </strong>
- </p>
- <p>
- <span class="vexpl">
- Note: Don't change this value unless you know what you are doing.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Server Mode</td>
- <td width="78%" class="vtable">
- <p>
- <select name="dssmode" class="formselect">
- <option value="dspam" <?php if($pconfig['dssmode'] == "dspam") echo('selected="selected"');?>>dspam</option>
- <option value="standard" <?php if($pconfig['dssmode'] == "standard") echo('selected="selected"');?>>standard</option>
- <option value="auto" <?php if($pconfig['dssmode'] == "auto") echo('selected="selected"');?>>auto</option>
- </select>
- <strong>
- Specifies the type of LMTP server to start.
- </strong>
- <p>
- <span class="vexpl">
- This can be one of:
- <dl>
- <dt>dspam</dt>
- <dd>DSPAM-proprietary DLMTP server, for communicating with dspamc</dd>
- <dt>standard</dt>
- <dd>Standard LMTP server, for communicating with Postfix or other MTA</dd>
- <dt>auto</dt>
- <dd>Speak both DLMTP and LMTP; auto-detect by ServerPass.IDENT</dd>
- </dl>
- </span>
- </p>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" rowspan="2" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <p>
- <span class="vexpl">
- If supporting DLMTP (dspam) mode, dspam clients will require authentication
- as they will be passing in parameters. The idents below will be used to
- determine which clients will be speaking DLMTP, so if you will be using
- both LMTP and DLMTP from the same host, be sure to use something other
- than the server's hostname below (which will be sent by the MTA during a
- standard LMTP LHLO).
- </span>
- </p>
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="55%" class="listhdrr"><?=gettext("DLMTP Password Value");?></td>
- <td width="35%" class="listhdr"><?=gettext("Description");?></td>
- <td width="10%" class="list"></td>
- </tr>
- <?php if(is_array($t_spwds)): ?>
- <?php $i = 0; foreach ($t_spwds as $spwd): ?>
- <?php if($spwd['value'] <> ""): ?>
-
- <tr>
- <td class="listlr" ondblclick="document.location='dspam-settings-spwd.php?id=<?=$i;?>&sectionid=srv';">
- <?=htmlspecialchars($spwd['value']);?>
- </td>
- <td class="listbg" ondblclick="document.location='dspam-settings-spwd.php?id=<?=$i;?>&sectionid=srv';">
- <font color="#FFFFFF"><?=htmlspecialchars($spwd['descr']);?>&nbsp;</font>
- </td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-spwd.php?id=<?=$i;?>&sectionid=srv"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="dspam-settings.php?act=del&what=spwd&id=<?=$i;?>&sectionid=srv" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <?php endif; ?>
- <?php $i++; endforeach; ?>
- <?php endif; ?>
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="dspam-settings-spwd.php?sectionid=srv"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="78%" class="vtable">
- <p>
- <span class="vexpl">
- If supporting standard LMTP mode, server parameters will need to be specified
- here, as they will not be passed in by the mail server. The ServerIdent
- specifies the 250 response code ident sent back to connecting clients and
- should be set to the hostname of your server, or an alias.
- </span>
- </p>
- <p>
- <span class="vexpl">
- Note: If you specify <code>--user</code> in ServerParameters, the RCPT TO will be used
- only for delivery, and not set as the active user for processing.
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Server Parameters</td>
- <td width="78%" class="vtable">
- <p>
- <input type="text" size="30" class="formfld unknown" name="serverparam" id="serverparam" value="<?=htmlspecialchars($pconfig['serverparam']);?>" />
- <strong>
- Parameters which will be passed to the LMTP server.
- </strong>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Server Ident</td>
- <td width="78%" class="vtable">
- <p>
- <input type="text" size="30" <?= checkForErrorClass("serverid", "formfld host"); ?> name="serverid" id="serverid" value="<?=htmlspecialchars($pconfig['serverid']);?>" />
- <strong>
- An identification string which will be used to be passed to the LMTP server.
- </strong>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Server Domain Socket Path</td>
- <td width="78%" class="vtable">
- <p>
- <input type="text" size="30" <?= checkForErrorClass("serversock", "formfld file"); ?> name="serversock" id="serversock" value="<?=htmlspecialchars($pconfig['serversock']);?>" />
- <strong>
- A local Unix domain socket.
- </strong>
- </p>
- <p>
- <span class="vexpl">
- If you wish to use a local domain socket instead of a TCP socket, uncomment
- the following. It is strongly recommended you use local domain sockets if
- you are running the client and server on the same machine, as it eliminates
- much of the bandwidth overhead.
- </span>
- </p>
- <p>
- <span class="vexpl">
- Keep this is sync with <code>/usr/local/etc/rd.d/dspam.rc</code> script
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <!-- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> -->
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="document.iform.sectionid.value = 'srv';" />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td valign="top" class="listtopic"><a name="cli" style="visibility: hidden;">&nbsp;</a>DSPAM Daemon Settings (Client)</td>
- <td align="right" valign="top" class="listtopic">
- <input name="enabledsclient" type="checkbox" id="enabledsclient" value="yes" <?php if (isset($pconfig['enabledsclient'])) echo 'checked="checked"'; ?> onClick="enable_change(false, 4);" />
- <strong>Enable</strong>
- </td>
- </tr>
-
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <p>
- <span class="vexpl">
- If you are running DSPAM in client/server mode, uncomment and
- set these variables. A ClientHost beginning with a <code>/</code>
- will be treated as a domain socket.
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Client Host</td>
- <td width="78%" class="vtable">
- <p>
- <input type="text" size="30" <?= checkForErrorClass("dsclhost", "formfld host"); ?> name="dsclhost" id="dsclhost" value="<?=htmlspecialchars($pconfig['dsclhost']);?>" <?php if (! isset($pconfig['enabledsclient'])) echo 'disabled="disabled"'; ?> />
- <strong>
- A IP address or a Unix domain socket.
- </strong>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Client Port</td>
- <td width="78%" class="vtable">
- <p>
- <input type="text" size="30" <?= checkForErrorClass("dsclhost", "formfld host"); ?> name="dsclport" id="dsclport" value="<?=htmlspecialchars($pconfig['dsclport']);?>" <?php if (! isset($pconfig['enabledsclient'])) echo 'disabled="disabled"'; ?> />
- <strong>
- Will be only used if this client uses TCP/IP communication.
- </strong>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Client Ident</td>
- <td width="78%" class="vtable">
- <p>
- <input type="text" size="30" <?= checkForErrorClass("dsclident", "formfld unknown"); ?> name="dsclident" id="dsclident" value="<?=htmlspecialchars($pconfig['dsclident']);?>" <?php if (! isset($pconfig['enabledsclient'])) echo 'disabled="disabled"'; ?> />
- <strong>
- A string that will be used to identify the client against a server.
- </strong>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <!-- <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /> -->
- <input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="document.iform.sectionid.value = 'cli';" />
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
- </table>
- </form>
- <br>
- <?= checkForInputErrors(); ?>
-<?
- } else {
-?>
-<?php
- $input_errors[] = "Access to this particular site was denied. You need DSPAM admin access rights to be able to view it.";
-
- include("head.inc");
- echo $pfSenseHead->getHTML();
-?>
-<?php include("fbegin.inc");?>
-<?php if ($input_errors) print_input_errors($input_errors);?>
-<?php if ($savemsg) print_info_box($savemsg);?>
- <body link="#000000" vlink="#000000" alink="#000000">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="listtopic">Access denied for: <?=$HTTP_SERVER_VARS['AUTH_USER']?></td>
- </tr>
- </table>
-<?php
- } // end of access denied code
-?>
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/dspam-train.php b/config/archive/dspam/www/dspam-train.php
deleted file mode 100644
index bc0bc087..00000000
--- a/config/archive/dspam/www/dspam-train.php
+++ /dev/null
@@ -1,284 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-train.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Train Filter"));
-
-/* omit no-cache headers because it confuses IE with file downloads */
-$omit_nocacheheaders = true;
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-function prepare_compressed_mbox_data($type) {
- global $CURRENT_USER;
- /* prepare directories */
- mwexec("mkdir -m 0755 -p /tmp/dspam-data/{$CURRENT_USER}/mbox");
- mwexec("mkdir -m 0755 -p /tmp/dspam-data/{$CURRENT_USER}/mdir");
-
- switch ($type) {
- case 0:
- move_uploaded_file($_FILES['archfile']['tmp_name'], "/tmp/" . $_FILES['archfile']['name']);
- mwexec("/usr/local/bin/unzip /tmp/{$_FILES['archfile']['name']} -d /tmp/dspam-data/{$CURRENT_USER}/mbox");
- unlink("/tmp/{$_FILES['archfile']['name']}");
- mwexec("/usr/local/bin/mb2md -s /tmp/dspam-data/{$CURRENT_USER}/mbox -R -d /tmp/dspam-data/{$CURRENT_USER}/mdir");
- break;
- case 1:
- move_uploaded_file($_FILES['archfile']['tmp_name'], "/tmp/dspam-data/" . $_SESSION['Username'] . "/mbox/" . $_FILES['archfile']['name']);
- mwexec("/usr/bin/gunzip /tmp/dspam-data/{$CURRENT_USER}/mbox/{$_FILES['archfile']['name']}");
- mwexec("/usr/local/bin/mb2md -s /tmp/dspam-data/{$CURRENT_USER}/mbox -R -d /tmp/dspam-data/{$CURRENT_USER}/mdir");
- break;
- case 2:
- move_uploaded_file($_FILES['archfile']['tmp_name'], "/tmp/dspam-data/" . $_SESSION['Username'] . "/mbox/" . $_FILES['archfile']['name']);
- mwexec("/usr/bin/bunzip2 /tmp/dspam-data/{$CURRENT_USER}/mbox/{$_FILES['archfile']['name']}");
- mwexec("/usr/local/bin/mb2md -s /tmp/dspam-data/{$CURRENT_USER}/mbox -R -d /tmp/dspam-data/{$CURRENT_USER}/mdir");
- break;
- }
-}
-
-function prepare_compressed_mdir_data($type) {
- global $CURRENT_USER;
- /* prepare directories */
- mwexec("mkdir -m 0755 -p /tmp/dspam-data/{$CURRENT_USER}/mdir");
-
- switch ($type) {
- case 0:
- move_uploaded_file($_FILES['archfile']['tmp_name'], "/tmp/" . $_FILES['archfile']['name']);
- mwexec("/usr/local/bin/unzip /tmp/{$_FILES['archfile']['name']} -d /tmp/dspam-data/{$CURRENT_USER}/mdir");
- unlink("/tmp/{$_FILES['archfile']['name']}");
- break;
- case 1:
- move_uploaded_file($_FILES['archfile']['tmp_name'], "/tmp/dspam-data/" . $_SESSION['Username'] . "/mdir/" . $_FILES['archfile']['name']);
- mwexec("/usr/bin/gunzip /tmp/dspam-data/{$CURRENT_USER}/mdir/{$_FILES['archfile']['name']}");
- break;
- case 2:
- move_uploaded_file($_FILES['archfile']['tmp_name'], "/tmp/dspam-data/" . $_SESSION['Username'] . "/mdir/" . $_FILES['archfile']['name']);
- mwexec("/usr/bin/bunzip2 /tmp/dspam-data/{$CURRENT_USER}/mdir/{$_FILES['archfile']['name']}");
- break;
- }
-}
-
-function prepare_compressed_data($type) {
- if ($_POST['archformat'] == "mbox") {
- prepare_compressed_mbox_data($type);
- } else {
- prepare_compressed_mdir_data($type);
- }
-}
-
-if ($_POST) {
- unset($input_errors);
-
- if(! extension_loaded( 'fileinfo' )) {
- /* fileinfo pecl extension unavailable? */
- if(! @dl( 'fileinfo.so' )) {
- if ($_POST['cotype'] == "zip") {
- prepare_compressed_data(0);
- } else if ($_POST['cotype'] == "gzip") {
- prepare_compressed_data(1);
- } else if ($_POST['cotype'] == "bzip") {
- prepare_compressed_data(2);
- } else {
- $input_errors[] = "unable to determine compression type.";
- }
- } else {
- if (is_uploaded_file($_FILES['archfile']['tmp_name'])) {
- $info = finfo_open( FILEINFO_MIME, '/usr/share/misc/magic' );
- $type = finfo_file( $info, $_FILES['archfile']['tmp_name'] );
-
- if ($type == "application/x-zip") {
- prepare_compressed_data(0);
- } else if ($type == "application/x-gzip") {
- prepare_compressed_data(1);
- } else if ($type == "application/x-bzip2") {
- prepare_compressed_data(2);
- } else {
- $input_errors[] = "unable to determine compression type.";
- }
- }
- }
- }
-
- /* tell DSPAM to train the messages contained within the maildir */
- if ($_POST['msgtype'] == "spam") {
- mwexec("find /tmp/dspam-data/{$CURRENT_USER}/mdir -name '*' -exec /usr/local/bin/dspam_spamfeed {$CURRENT_USER} {} \\;");
- } else if ($_POST['msgtype'] == "ham") {
- mwexec("find /tmp/dspam-data/{$CURRENT_USER}/mdir -name '*' -exec /usr/local/bin/dspam_innocentfeed {$CURRENT_USER} {} \\;");
- mwexec("rm -rf /tmp/dspam-data");
- }
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
- $jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-
-EOD;
-
- $jscriptstr .= getJScriptFunction(0);
- $jscriptstr .= <<<EOD
-//-->
-</script>
-EOD;
-
- $pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<form action="dspam-train.php" method="post" name="iform" id="iform" enctype="multipart/form-data">
-<input type="hidden" name="MAX_FILE_SIZE" value="<?= (diskfreespace('/') - (10 * pow(10, 6))); ?>">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[] = array("Info", false, "/dspam.php?user={$CURRENT_USER}");
- $tab_array[] = array("Performance", false, "/dspam-perf.php?user={$CURRENT_USER}");
- $tab_array[] = array("Preferences", false, "/dspam-prefs.php?user={$CURRENT_USER}");
- $tab_array[] = array("Alerts", false, "/pkg.php?xml=dspam_alerts.xml&user={$CURRENT_USER}");
- $tab_array[] = array("Quarantine ({$DATA['TOTAL_QUARANTINED_MESSAGES']})", false, "/dspam-quarantine.php?user={$CURRENT_USER}");
- $tab_array[] = array("Analysis", false, "/dspam-analysis.php?user={$CURRENT_USER}");
- $tab_array[] = array("History", false, "/dspam-history.php?user={$CURRENT_USER}");
- $tab_array[] = array("Train Filter", true, "/dspam-train.php?user={$CURRENT_USER}");
- if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
- $tab_array[] = array("Admin Suite", false, "/dspam-admin.php");
- }
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listhdrr" colspan="2">Statistical SPAM Protection for...</td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Username</td>
- <td width="78%" class="vtable">
- <?php if(isset($HTTP_SERVER_VARS['AUTH_USER'])): ?>
- <input type="text" name="username" id="username" value="<?= $CURRENT_USER ?>" class="formfld user"<?php if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) { echo " readonly=\"readonly\""; } ?> />
- <?php else: ?>
- <input type="text" name="username" id="username" value="Please provide a username" class="formfld user" onFocus="this.value='';" />
- <?php endif; ?>
- &nbsp;
- <?php
- if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER']))
- $action = "onClick=\"changeuser();\"";
- else
- $action = "onClick=\"document.iform.submit();\"";
- ?>
- <input type="button" name="change_user" id="change_user" class="formbtn" value="Change" <?= $action ?> />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" class="listtopic"><?=gettext("Upload Message Archive");?></td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Archive Type</td>
- <td width="78%" class="vtable">
- <?php if($config['installedpackages']['mb2md'] || file_exists('/usr/local/bin/mb2md')): ?>
- <input type="radio" name="archformat" id="mbxformat" value="mbox" class="formfld" />
- &nbsp;<a href="http://en.wikipedia.org/wiki/Mbox" target="_blank">Mailbox</a> format (like it is used for example by Mozilla Thunderbird)
- <br />
- <?php endif; ?>
- <input type="radio" name="archformat" id="mdirformat" value="mdir" class="formfld" checked="checked"/>
- &nbsp;<a href="http://en.wikipedia.org/wiki/Maildir" target="_blank">Maildir</a> format (like it was initially introduced by qmail)
- <p>
- <strong>
- <span class="red"><?=gettext("Note");?>:</span>
- </strong>
- <br />
- <?=gettext("DSPAM is only able to handle Maildir message archives natively. Mailbox message archives need to be converted (the conversion from mbx to maildir will be done on the fly while you are uploading a message archive).");?>
- <br />
- </p>
- </td>
- </tr>
- <?php if(! extension_loaded( 'fileinfo' )): ?>
- <?php if(! @dl( 'fileinfo.so' )): ?>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Compression Type</td>
- <td width="78%" class="vtable">
- <input type="radio" name="cotype" id="ziptype" value="zip" class="formfld" />
- &nbsp;Archive was compressed using a ZIP algorithm.
- <br />
- <input type="radio" name="cotype" id="gziptype" value="gzip" class="formfld" />
- &nbsp;Archive was compressed using a GNU ZIP algorithm.
- <br />
- <input type="radio" name="cotype" id="bziptype" value="bzip" class="formfld" checked="checked" />
- &nbsp;Archive was compressed using a bzip2 algorithm
- <br />
- </td>
- </tr>
- <?php endif; ?>
- <?php endif; ?>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Message Type</td>
- <td width="78%" class="vtable">
- <input type="radio" name="msgtype" id="spamtype" value="spam" class="formfld" checked="checked" />
- &nbsp;Archive to be uploaded contains Spam messages.
- <br />
- <input type="radio" name="msgtype" id="hamtype" value="ham" class="formfld" />
- &nbsp;Archive to be uploaded contains Ham messages.
- <br />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <p>
- <?=gettext("Open a Ham or Spam message archive (please either zip, gzip or bzip your files).");?>
- </p>
- <p>
- <input name="archfile" type="file" class="formfld file" id="archfile" size="40" maxlength="<?= (diskfreespace('/') - (10 * pow(10, 6))); ?>" />
- </p>
- <p>
- <input name="Submit" type="submit" class="formbtn" id="restore" value="<?=gettext("Upload Message Archive");?>" />
- </p>
- <p>
- <strong>
- <span class="red"><?=gettext("Note");?>:</span>
- </strong>
- <br />
- <?=gettext("It may take a long time until the filter stops training, if you are going to upload a huge archive. Therefore the the allowed filesize to be uploaded has been set to " . ((diskfreespace('/') - (10 * pow(10, 6))) / pow(10, 6)) . " MByte (available space minus 10 MByte).");?>
- <br />
- </p>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/dspam-viewmsg.php b/config/archive/dspam/www/dspam-viewmsg.php
deleted file mode 100644
index e56b081f..00000000
--- a/config/archive/dspam/www/dspam-viewmsg.php
+++ /dev/null
@@ -1,158 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam-train.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Quarantine"),
- gettext("View Message"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-/* if this is an AJAX caller then handle via JSON */
-if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
- $jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-
-EOD;
-
- $jscriptstr .= getJScriptFunction(0);
- $jscriptstr .= <<<EOD
-//-->
-</script>
-EOD;
-
- $pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<form action="dspam-quarantine.php" method="post" name="iform" id="iform">
-<input type="hidden" name="command" value="processFalsePositive" />
-<input type="hidden" name="signatureID" value="<?= $DATA['MESSAGE_ID']; ?>" />
-<input type="hidden" name="qpage" value="<?= $DATA['QPAGE']; ?>" />
-<input type="hidden" name="sortby" value="<?= $DATA['SORTBY']; ?>" >
-<input type="hidden" name="qperpage" value="<?= $CONFIG['QUARANTINE_PER_PAGE']; ?>" >
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<p>
- <span class="vexpl">
- The contents of the message in the quarantine is shown below.
- </span>
-</p>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $querystr = "?user=?{$CURRENT_USER}&page={$DATA['QPAGE']}&sortby={$DATA['SORTBY']}&qperpage={$CONFIG['QUARANTINE_PER_PAGE']}";
-
- $tab_array = array();
- $tab_array[] = array("Info", false, "/dspam.php?user={$CURRENT_USER}");
- $tab_array[] = array("Performance", false, "/dspam-perf.php?user={$CURRENT_USER}");
- $tab_array[] = array("Preferences", false, "/dspam-prefs.php?user={$CURRENT_USER}");
- $tab_array[] = array("Alerts", false, "/pkg.php?xml=dspam_alerts.xml&user={$CURRENT_USER}");
- $tab_array[] = array("Quarantine (View)", true, "/dspam-quarantine.php{$querystr}");
- $tab_array[] = array("Analysis", false, "/dspam-analysis.php?user={$CURRENT_USER}");
- $tab_array[] = array("History", false, "/dspam-history.php?user={$CURRENT_USER}");
- $tab_array[] = array("Train Filter", false, "/dspam-train.php?user={$CURRENT_USER}");
- if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
- $tab_array[] = array("Admin Suite", false, "/dspam-admin.php");
- }
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listhdrr" colspan="3">Statistical SPAM Protection for...</td>
- </tr>
- <tr>
- <td width="15%" valign="baseline" class="vncell">Username</td>
- <td width="85%" class="vtable" colspan="2">
- <?php if(isset($HTTP_SERVER_VARS['AUTH_USER'])): ?>
- <input type="text" name="username" id="username" value="<?= $CURRENT_USER ?>" class="formfld user"<?php if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) { echo " readonly=\"readonly\""; } ?> />
- <?php else: ?>
- <input type="text" name="username" id="username" value="Please provide a username" class="formfld user" onFocus="this.value='';" />
- <?php endif; ?>
- &nbsp;
- <?php
- if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER']))
- $action = "onClick=\"changeuser();\"";
- else
- $action = "onClick=\"document.iform.submit();\"";
- ?>
- <input type="button" name="change_user" id="change_user" class="formbtn" value="Change" <?= $action ?> />
- </td>
- </tr>
- <tr>
- <td class="list" height="12" colspan="3">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="middle" class="qnavtd" colspan="3">
- <input type="submit" class="formbtn" title="Deliver Message" value="Deliver Message" name="delmsg" id="delmsg" />
- <label for="delmsg">&nbsp;because it is <strong>not</strong> SPAM</label>
- </td>
- </tr>
- <tr>
- <td class="list" height="12" colspan="3">&nbsp;</td>
- </tr>
- <?php if(! extension_loaded( 'mailparse' ) && $CONFIG['USE_MAILPARSE']): ?>
- <?php if(! @dl( 'mailparse.so' )): ?>
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="3">Mail Message</td>
- </tr>
- <tr>
- <td align="center" valign="top" colspan="3" class="vncell">
- <textarea rows="36" cols="87" readonly="readonly">
- <?= $DATA['MESSAGE']; ?>
- </textarea>
- </td>
- </tr>
- <?php else: ?>
- <?= getLayoutedMessage($DATA['MESSAGE'], $DATA['MESSAGE_ID'], $DATA['SHOWPART'], $DATA['CONTENT_TYPE']); ?>
- <?php endif; ?>
- <?php else: ?>
- <tr>
- <td align="left" valign="top" class="listtopic" colspan="3">Mail Message</td>
- </tr>
- <tr>
- <td align="center" valign="top" colspan="3" class="vncell">
- <textarea rows="36" cols="87" readonly="readonly">
- <?= $DATA['MESSAGE']; ?>
- </textarea>
- </td>
- </tr>
- <?php endif; ?>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/dspam.php b/config/archive/dspam/www/dspam.php
deleted file mode 100644
index 1f2d7df7..00000000
--- a/config/archive/dspam/www/dspam.php
+++ /dev/null
@@ -1,264 +0,0 @@
-<?php
-/* $Id$ */
-/*
- dspam.php
-
- Copyright (C) 2006 Daniel S. Haischt.
- All rights reserved.
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("DSPAM"),
- gettext("Overview"));
-
-require("guiconfig.inc");
-include("/usr/local/pkg/dspam.inc");
-
-if ($_POST) {
- unset($input_errors);
-
- if (is_uploaded_file($_FILES['nionelic']['tmp_name'])) {
- conf_mount_rw();
- config_lock();
- move_uploaded_file($_FILES['nionelic']['tmp_name'], "{$g['conf_path']}/{$_FILES['nionelic']['name']}");
- chmod("{$g['conf_path']}/{$_FILES['nionelic']['name']}", 0400);
- config_unlock();
- conf_mount_ro();
- }
- if (is_uploaded_file($_FILES['nionelicchk']['tmp_name'])) {
- conf_mount_rw();
- config_lock();
- move_uploaded_file($_FILES['nionelicchk']['tmp_name'], "{$g['conf_path']}/{$_FILES['nionelicchk']['name']}");
- chmod("{$g['conf_path']}/{$_FILES['nionelicchk']['name']}", 0400);
- config_unlock();
- conf_mount_ro();
- }
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
- $jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-
-EOD;
-
- $jscriptstr .= getJScriptFunction(0);
- $jscriptstr .= <<<EOD
-//-->
-</script>
-EOD;
-
- $pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<form action="dspam.php" method="post" name="iform" id="iform" enctype="multipart/form-data">
-<input type="hidden" name="MAX_FILE_SIZE" value="<?= (diskfreespace('/') - (10 * pow(10, 6))); ?>">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[] = array("Info", true, "/dspam.php?user={$CURRENT_USER}");
- $tab_array[] = array("Performance", false, "/dspam-perf.php?user={$CURRENT_USER}");
- $tab_array[] = array("Preferences", false, "/dspam-prefs.php?user={$CURRENT_USER}");
- $tab_array[] = array("Alerts", false, "/pkg.php?xml=dspam_alerts.xml&user={$CURRENT_USER}");
- $tab_array[] = array("Quarantine ({$DATA['TOTAL_QUARANTINED_MESSAGES']})", false, "/dspam-quarantine.php?user={$CURRENT_USER}");
- $tab_array[] = array("Analysis", false, "/dspam-analysis.php?user={$CURRENT_USER}");
- $tab_array[] = array("History", false, "/dspam-history.php?user={$CURRENT_USER}");
- $tab_array[] = array("Train Filter", false, "/dspam-train.php?user={$CURRENT_USER}");
- if (isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
- $tab_array[] = array("Admin Suite", false, "/dspam-admin.php");
- }
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listhdrr" colspan="2">Statistical SPAM Protection for...</td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Username</td>
- <td width="78%" class="vtable">
- <?php if(isset($HTTP_SERVER_VARS['AUTH_USER'])): ?>
- <input type="text" name="username" id="username" value="<?= $CURRENT_USER ?>" class="formfld user"<?php if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])) { echo " readonly=\"readonly\""; } ?> />
- <?php else: ?>
- <input type="text" name="username" id="username" value="Please provide a username" class="formfld user" onFocus="this.value='';" />
- <?php endif; ?>
- &nbsp;
- <?php
- if (! isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER']))
- $action = "onClick=\"changeuser();\"";
- else
- $action = "onClick=\"document.iform.submit();\"";
- ?>
- <input type="button" name="change_user" id="change_user" class="formbtn" value="Change" <?= $action ?> />
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" class="listtopic"><?=gettext("DSPAM Software Details");?></td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">DSPAM Version</td>
- <td width="78%" class="vtable"><?= $DATA['DSPAM_VERSION']; ?></td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">DSPAM Copyright</td>
- <td width="78%" class="vtable"><?= $DATA['DSPAM_COPYRIGHT']; ?></td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">DSPAM Copyright Text</td>
- <td width="78%" class="vtable"><?= $DATA['DSPAM_COPYRIGHT_TEXT']; ?></td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">DSPAM Website</td>
- <td width="78%" class="vtable">
- <a href="<?= $DATA['DSPAM_WEBSITE']; ?>" target="_blank"><?= $DATA['DSPAM_WEBSITE']; ?></a>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">DSPAM Configure Args</td>
- <td width="78%" class="vtable">
- <code style="font-size: small;"><?= $DATA['DSPAM_CONFIGURE_ARGS']; ?></code>
- </td>
- </tr>
- <?php if($CONFIG['OPENSOURCE'] == false): ?>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="2" class="listtopic"><?=gettext("Ni-ONE License Information");?></td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">License User</td>
- <td width="78%" class="vtable"><?= $DATA['OWNER']; ?></td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Company</td>
- <td width="78%" class="vtable"><?= $DATA['COMPANY']; ?></td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">License Key</td>
- <td width="78%" class="vtable"><?= $DATA['LICENSE_KEY']; ?></td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">License Validity</td>
- <td width="78%" class="vtable">
- <?= $DATA['LICENSE_VALIDITY']; ?>
- <?php if(strpos($DATA['LICENSE_VALIDITY'], "expired") !== false && isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])): ?>
- &nbsp;<a href="http://www.niefert.net/nione.php?customer<?= $DATA['LICENSE_KEY']; ?>" target="_blank">Renew License</a>
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Purchase Date</td>
- <td width="78%" class="vtable"><?= $DATA['PURCHASE_DATE']; ?></td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Expiry Date</td>
- <td width="78%" class="vtable"><?= $DATA['EXPIRY_DATE']; ?></td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Ni-ONE Website</td>
- <td width="78%" class="vtable">
- <a href="http://www.niefert.net/nione.php" target="_blank">http://www.niefert.net/nione.php</a>
- </td>
- </tr>
- <?php if($DATA['LICENSE_VALIDITY'] == "valide"): ?>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Support Request</td>
- <td width="78%" class="vtable">
- <a href="http://www.niefert.net/nione.php?supportreq=true&amp;customer=<?= $DATA['LICENSE_KEY']; ?>" target="_blank">Issue a support request</a>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">Ni-ONE Customer Forum</td>
- <td width="78%" class="vtable">
- <a href="http://www.niefert.net/nione-forum.php?customer=<?= $DATA['LICENSE_KEY']; ?>" target="_blank">Visit Ni-ONE Customer Forum</a>
- </td>
- </tr>
- <?php endif; ?>
- <?php if(strpos($DATA['LICENSE_VALIDITY'], "found") !== false && isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])): ?>
- <tr>
- <td width="22%" valign="baseline" class="vncell">License File (nione.lic)</td>
- <td width="78%" class="vtable">
- <input type="file" name="nionelic" id="nionelic" class="formfld file" size="50" maxlength="100" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="baseline" class="vncell">License Checksum (nione.lic.sha1)</td>
- <td width="78%" class="vtable">
- <input type="file" name="nionelicchk" id="nionelicchk" class="formfld file" size="50" maxlength="100" />
- </td>
- </tr>
- <?php endif; ?>
- <?php if($DATA['LICENSE_VALIDITY'] == "valide"): ?>
- <tr>
- <td width="22%" valign="baseline" class="vncell">License Disclaimer</td>
- <td width="78%" class="vtable">
- <p>
- The Ni-ONE appliance solution is based on open source software. Hence you
- are allowed to use the corresponding software components (i.e. DSPAM and
- its dependencies) under the terms of the accompanying open source license.
- </p>
- <p>
- The Ni-ONE license provides 1<sup>st</sup> class priority support for a period
- of one year starting from the day you did purchase a valide license option. If the
- license is marked as <i>expired</i>, you may consider to purchase a renewal license
- option using the <i>renew license</i> button that will be provided by the web
- interface in such circumstances.
- </p>
- </td>
- </tr>
- <?php endif; ?>
- <?php if(strpos($DATA['LICENSE_VALIDITY'], "found") !== false && isDSPAMAdmin($HTTP_SERVER_VARS['AUTH_USER'])): ?>
- <tr>
- <td width="22%" valign="baseline">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" id="restore" value="<?=gettext("Upload License");?>" />
- <p>
- <strong>
- <span class="red"><?=gettext("Note");?>:</span>
- </strong>
- <br />
- <?=gettext("You may have to hit the reload button of your browser after uploading your license files to be able to see the license data.");?>
- <br />
- </p>
- </td>
- </tr>
- <?php endif; ?>
- <?php endif; ?>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/archive/dspam/www/themes/metallic/dspam.css b/config/archive/dspam/www/themes/metallic/dspam.css
deleted file mode 100644
index 5b39ba32..00000000
--- a/config/archive/dspam/www/themes/metallic/dspam.css
+++ /dev/null
@@ -1,115 +0,0 @@
-.qrowEven {
- background-color: #DDDDDD;
- padding-right: 20px;
- padding-left: 8px;
- border-bottom: 1px solid #999999;
-}
-.qrowOdd {
- background-color: #FFFFFF;
- padding-right: 20px;
- padding-left: 8px;
- border-bottom: 1px solid #999999;
-}
-.qrowAlert {
- background-color: yellow;
- padding-right: 20px;
- padding-left: 8px;
- border-bottom: 1px solid #999999;
-}
-.qrowHighlight {
- background-color: white;
- font-weight: bold;
- padding-right: 20px;
- padding-left: 8px;
- border-bottom: 1px solid #999999;
-}
-.qrowDivider {
- padding-right: 20px;
- padding-left: 8px;
- border-left: 1px solid black;
- border-bottom: 1px solid #999999;
-}
-
-.innocent {color: limegreen; background-color: green;}
-.whitelisted {color: magenta; background-color: purple;}
-.spam {color: red; background-color: darkred;}
-.false {color: white; font-weight: bold; background-color: green;}
-.missed {color: white; font-weight: bold; background-color: darkred;}
-.inoculation {color: dodgerblue; background-color: darkblue;}
-.corpus {color: black; background-color: white;}
-.relay {color: white; background-color: #994400;}
-.low {color: darkblue; font-weight: bold;}
-.medium {color: steelblue; font-weight: bold;}
-.high {color: darkorange; font-weight: bold;}
-
-.small { font-size: 9px;}
-.hollow { border: 0px; }
-
-.qnavtd {
- border: 1px solid #CCCCCC;
-}
-.qnavtdl {
- border-top: 1px solid #CCCCCC;
- border-bottom: 1px solid #CCCCCC;
- border-left: 1px solid #CCCCCC;
-}
-.qnavtdr {
- border-top: 1px solid #CCCCCC;
- border-bottom: 1px solid #CCCCCC;
- border-right: 1px solid #CCCCCC;
-}
-.qnavbtnhl {
- font-size: 9px !important;
- border-right: 1px solid #FF7F7F;
- border-bottom: 1px solid #FF7F7F;
- border-left: 1px solid #5F0000;
- border-top: 1px solid #5F0000;
- padding-left: 3px;
- padding-right: 3px;
- padding-bottom: 2px;
- padding-top: 2px;
- background-color: #FF7F7F;
-}
-.qnavbtn {
- font-size: 9px !important;
- border-right: 1px solid #FF7F7F;
- border-bottom: 1px solid #FF7F7F;
- border-left: 1px solid #5F0000;
- border-top: 1px solid #5F0000;
- padding-left: 3px;
- padding-right: 3px;
- padding-bottom: 2px;
- padding-top: 2px;
- background-color: #507DCD;
- cursor: pointer;
-}
-.qnavbtn a:link {
- font-size: 9px !important;
- font-weight: bold;
- color: #FFFFFF;
- text-decoration:none;
-}
-.qnavbtn a:visited {
- font-size: 9px !important;
- font-weight: bold;
- color: #FFFFFF;
- text-decoration:none;
-}
-.qnavbtn a:focus {
- font-size: 9px !important;
- font-weight: bold;
- color: #FFFFFF;
- text-decoration:underline;
-}
-.qnavbtn a:hover {
- font-size: 9px !important;
- font-weight: bold;
- color: #FFFFFF;
- text-decoration:none;
-}
-.qnavbtn a:active {
- font-size: 9px !important;
- font-weight: bold;
- color: #FFFFFF;
- text-decoration:underline;
-} \ No newline at end of file
diff --git a/config/archive/dspam/www/wizards/dspam-lda-proxy.png b/config/archive/dspam/www/wizards/dspam-lda-proxy.png
deleted file mode 100644
index 7a4565ec..00000000
--- a/config/archive/dspam/www/wizards/dspam-lda-proxy.png
+++ /dev/null
Binary files differ
diff --git a/config/archive/dspam/www/wizards/dspam-pop-proxy.png b/config/archive/dspam/www/wizards/dspam-pop-proxy.png
deleted file mode 100644
index fa373385..00000000
--- a/config/archive/dspam/www/wizards/dspam-pop-proxy.png
+++ /dev/null
Binary files differ
diff --git a/config/archive/dspam/www/wizards/dspam-smtp-relay.png b/config/archive/dspam/www/wizards/dspam-smtp-relay.png
deleted file mode 100644
index 07f554c8..00000000
--- a/config/archive/dspam/www/wizards/dspam-smtp-relay.png
+++ /dev/null
Binary files differ
diff --git a/config/archive/dspam/www/wizards/dspam_wizard.xml b/config/archive/dspam/www/wizards/dspam_wizard.xml
deleted file mode 100644
index 6590f149..00000000
--- a/config/archive/dspam/www/wizards/dspam_wizard.xml
+++ /dev/null
@@ -1,1848 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<pfsensewizard>
-<!--
- Tags which can be used to exec arbitrary PHP code:
-
- <stepsubmitbeforesave />
- <stepsubmitphpaction />
- <stepbeforeformdisplay />
- <formvalidate />
- <disableallfieldsbydefault />
- <stepafterformdisplay />
- <javascriptafterformdisplay />
--->
-<copyright>
-<![CDATA[
-/*
- dspam_wizard.xml
- part of pfSense (https://www.pfsense.org/)
-
- Copyright (C) 2006 Daniel S. Haischt
- All rights reserved.
-*/
-]]>
-</copyright>
-<totalsteps>15</totalsteps>
-<title>Services: DSPAM: DSPAM Wizard</title>
-<step>
- <id>1</id>
- <includefile>dspam.inc</includefile>
- <title>DSPAM Setup Wizard</title>
- <disableheader>true</disableheader>
- <description>This wizard will guide you through the initial configuration of the DSPAM filter.</description>
- <fields>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>2</id>
- <includefile>dspam.inc</includefile>
- <title>DSPAM Profile Selection</title>
- <disableheader>true</disableheader>
- <description>DSPAM can be used in different network environment. Hence we are providing three distinct profiles to suit different DSPAM use cases. Please select a particular profile from the below profile selection.</description>
- <fields>
- <field>
- <name>dspamprofile</name>
- <type>radio</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-profile</bindstofield>
- <description>
- &lt;center&gt;
- &lt;p&gt;
-When your mail server gets ready to deliver mail to a user's mailbox it calls
-a delivery agent of some sort. On most UNIX systems, this is procmail, maildrop,
-mail.local, or a similar tool. When used as a delivery proxy, the DSPAM agent
-is called in place of your existing agent - or better put, it can masquerade
-as the local delivery agent. DSPAM then processes the message and will call
-the /real/ delivery agent to pass the good mail into the user's mailbox,
-quarantining the bad mail. DSPAM can optionally tag and deliver both spam
-and legitimate mail.
- &lt;/p&gt;
- &lt;p&gt;
-In the diagram below, MTA refers to Mail Transfer Agent, or your mail server
-software: Postfix, Sendmail, Exim, etc. LDA refers to the Local Delivery
-Agent: Procmail, Maildrop, etc..
- &lt;/p&gt;
- &lt;/center&gt;
- </description>
- <value>lda</value>
- <dontdisplayname />
- <typehint>&lt;center&gt;&lt;img src=&quot;/wizards/dspam-lda-proxy.png&quot; alt=&quot;DSPAM acts as a LDA proxy&quot; border=&quot;0&quot; /&gt;&lt;/center&gt;</typehint>
- </field>
- <field>
- <name>dspamprofile</name>
- <type>radio</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-profile</bindstofield>
- <description>
- &lt;center&gt;
-If you don't want to tinker with your existing mail server setup, DSPAM can
-be combined with one of a few open source programs designed to act as a POP3
-proxy. This means spam is filtered whenever the user checks their mail,
-rather than when it is delivered. The benefit to this is that you can set up
-a small machine on your network that will connect to your existing mail server,
-so no integration is needed. It also allows your users to arbitarily point their
-mail client at it if they desire filtering. The drawback to this approach is
-that the POP3 protocol has no way to tell the mail client that a message is
-spam, and so the user will have to download the spam (tagged, of course).
- &lt;/center&gt;
- </description>
- <value>pop</value>
- <dontdisplayname />
- <typehint>&lt;center&gt;&lt;img src=&quot;/wizards/dspam-pop-proxy.png&quot; alt=&quot;DSPAM will be invoked by a POP3 proxy&quot; border=&quot;0&quot; /&gt;&lt;/center&gt;</typehint>
- </field>
- <field>
- <name>dspamprofile</name>
- <type>radio</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-profile</bindstofield>
- <description>
- &lt;center&gt;
-Newer versions of DSPAM have seen features that allow it to function more
-easily as an SMTP relay. An SMTP relay sits in front of your existing mail
-server (requiring no integration). To use an SMTP relay, the MX records for
-your domains are repointed to the relay machine running DSPAM. DSPAM then
-relays the good (and optionally bad) mail to the existing SMTP server. This
-allows you to use DSPAM with even a Windows-based destination mail server
-as no integration is necessary. See doc/relay.txt for one example of how to
-do this with Postfix.
- &lt;/center&gt;
- </description>
- <value>smtp</value>
- <dontdisplayname />
- <typehint>&lt;center&gt;&lt;img src=&quot;/wizards/dspam-smtp-relay.png&quot; alt=&quot;DSPAM acts as a SMTP realy&quot; border=&quot;0&quot; /&gt;&lt;/center&gt;</typehint>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepsubmitphpaction>
- <![CDATA[
- if($_POST['dspamprofile'] != "") {
-
- /* set default trusted users */
- $config['installedpackages']['dspam']['config'][0]['tuser'][0]['name'] = "root";
- $config['installedpackages']['dspam']['config'][0]['tuser'][0]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['tuser'][1]['name'] = "mail";
- $config['installedpackages']['dspam']['config'][0]['tuser'][1]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['tuser'][2]['name'] = "mailnull";
- $config['installedpackages']['dspam']['config'][0]['tuser'][2]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['tuser'][3]['name'] = "smmsp";
- $config['installedpackages']['dspam']['config'][0]['tuser'][3]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['tuser'][4]['name'] = "daemon";
- $config['installedpackages']['dspam']['config'][0]['tuser'][4]['descr'] = "desc";
- /* set default features */
- $config['installedpackages']['dspam']['config'][0]['feature'][0]['name'] = "chained";
- $config['installedpackages']['dspam']['config'][0]['feature'][0]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['feature'][1]['name'] = "whitelist";
- $config['installedpackages']['dspam']['config'][0]['feature'][1]['descr'] = "desc";
- /* set default algorithms */
- $config['installedpackages']['dspam']['config'][0]['algorithm'][0]['name'] = "graham";
- $config['installedpackages']['dspam']['config'][0]['algorithm'][0]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['algorithm'][1]['name'] = "burton";
- $config['installedpackages']['dspam']['config'][0]['algorithm'][1]['descr'] = "desc";
- /* set default prefs */
- $config['installedpackages']['dspam']['config'][0]['preference'][0]['value'] = "\"spamAction=quarantine\"";
- $config['installedpackages']['dspam']['config'][0]['preference'][0]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['preference'][1]['value'] = "\"signatureLocation=message\"";
- $config['installedpackages']['dspam']['config'][0]['preference'][1]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['preference'][2]['value'] = "\"showFactors=on\"";
- $config['installedpackages']['dspam']['config'][0]['preference'][2]['descr'] = "desc";
- /* set default overrides */
- $config['installedpackages']['dspam']['config'][0]['override'][0]['value'] = "trainingMode";
- $config['installedpackages']['dspam']['config'][0]['override'][0]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['override'][1]['value'] = "spamAction spamSubject";
- $config['installedpackages']['dspam']['config'][0]['override'][1]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['override'][2]['value'] = "statisticalSedation";
- $config['installedpackages']['dspam']['config'][0]['override'][2]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['override'][3]['value'] = "enableBNR";
- $config['installedpackages']['dspam']['config'][0]['override'][3]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['override'][4]['value'] = "enableWhitelist";
- $config['installedpackages']['dspam']['config'][0]['override'][4]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['override'][5]['value'] = "signatureLocation";
- $config['installedpackages']['dspam']['config'][0]['override'][5]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['override'][6]['value'] = "showFactors";
- $config['installedpackages']['dspam']['config'][0]['override'][6]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['override'][7]['value'] = "optIn optOut";
- $config['installedpackages']['dspam']['config'][0]['override'][7]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['override'][8]['value'] = "whitelistThreshold";
- $config['installedpackages']['dspam']['config'][0]['override'][8]['descr'] = "desc";
-
- if($_POST['dspamprofile'] == "lda" || $_POST['dspamprofile'] == "pop") {
- $config['installedpackages']['dspam']['config'][0]['tdelivery-agent'] = "mail";
- /* TCP/IP based deliver is not needed */
- unset($config['installedpackages']['dspam']['config'][0]['tcpip-delivery']);
- unset($config['installedpackages']['dspam']['config'][0]['tcpip-delivery-host']);
- unset($config['installedpackages']['dspam']['config'][0]['tcpip-delivery-port']);
- unset($config['installedpackages']['dspam']['config'][0]['tcpip-delivery-ident']);
- unset($config['installedpackages']['dspam']['config'][0]['tcpip-delivery-proto']);
- $config['installedpackages']['dspam']['config'][0]['delivery-onfail'] = "error";
-
- /* We will asume that the user is going to use the dspam and not the dspamc
- * binary. Hence we are unsetting server/client settings.
- */
- unset($config['installedpackages']['dspam']['config'][0]['dspam-server-port']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-server-queue-size']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-server-pid']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-server-mode']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-server-params']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-server-id']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-server-socket']);
- /* Client */
- unset($config['installedpackages']['dspam']['config'][0]['dspam-client-enable']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-client-host']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-client-port']);
- unset($config['installedpackages']['dspam']['config'][0]['dspam-client-id']);
- } else if($_POST['dspamprofile'] == "smtp") {
- /* TCP/IP based deliver is not needed */
- $config['installedpackages']['dspam']['config'][0]['tcpip-delivery'] = "on";
- $config['installedpackages']['dspam']['config'][0]['tcpip-delivery-host'] = "127.0.0.1";
- $config['installedpackages']['dspam']['config'][0]['tcpip-delivery-port'] = "25";
- $config['installedpackages']['dspam']['config'][0]['tcpip-delivery-ident'] = "localhost";
- $config['installedpackages']['dspam']['config'][0]['tcpip-delivery-proto'] = "smtp";
- $config['installedpackages']['dspam']['config'][0]['delivery-onfail'] = "error";
-
- /* We will asume that the user is going to use the dspam and not the dspamc
- * binary. Hence we are unsetting server/client settings.
- */
- $config['installedpackages']['dspam']['config'][0]['dspam-server-port'] = "24";
- $config['installedpackages']['dspam']['config'][0]['dspam-server-queue-size'] = "32";
- $config['installedpackages']['dspam']['config'][0]['dspam-server-pid'] = "/var/run/dspam/dspam.pid";
- $config['installedpackages']['dspam']['config'][0]['dspam-server-mode'] = "standard";
- $config['installedpackages']['dspam']['config'][0]['dspam-server-params'] = "--deliver=innocent -d %u";
- $config['installedpackages']['dspam']['config'][0]['dspam-server-id'] = "localhost";
- $config['installedpackages']['dspam']['config'][0]['dspam-server-socket'] = "/var/run/dspam/dspam.sock";
- /* server passwords */
- $config['installedpackages']['dspam']['config'][0]['server-pwd'][0]['value'] = "secret";
- $config['installedpackages']['dspam']['config'][0]['server-pwd'][0]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['server-pwd'][1]['value'] = "password";
- $config['installedpackages']['dspam']['config'][0]['server-pwd'][1]['descr'] = "desc";
- /* Client */
- $config['installedpackages']['dspam']['config'][0]['dspam-client-enable'] = "on";
- $config['installedpackages']['dspam']['config'][0]['dspam-client-host'] = "/tmp/dspam.sock";
- $config['installedpackages']['dspam']['config'][0]['dspam-client-port'] = "24";
- $config['installedpackages']['dspam']['config'][0]['dspam-client-id'] = "secret@Relay1";
- }
-
- write_config();
- }
- ]]>
- </stepsubmitphpaction>
-</step>
-<step>
- <id>3</id>
- <includefile>dspam.inc</includefile>
- <title>Database Settings</title>
- <description>
- On this screen you will set the storage driver type that will be used to store
- DSPAM tokens. After having completed this wizard you have to configure the
- database that you did select herein.
- </description>
- <fields>
- <field>
- <name>storagedriver</name>
- <type>select</type>
- <bindstofield>installedpackages->dspam->config->0->storage-driver</bindstofield>
- <description>Specifies the storage driver backend (library) to use.</description>
- <default_value>mysql</default_value>
- <onchange>toggleDBSettings();</onchange>
- <size>1</size>
- <options>
- <option>
- <name>mysql</name>
- <value>mysql</value>
- </option>
- <option>
- <name>sqlite</name>
- <value>sqlite</value>
- </option>
- <option>
- <name>bdb</name>
- <value>bdb</value>
- </option>
- <option>
- <name>pgsql</name>
- <value>pgsql</value>
- </option>
- <option>
- <name>oracle</name>
- <value>oracle</value>
- </option>
- <option>
- <name>hash</name>
- <value>hash</value>
- </option>
- </options>
- </field>
- <field>
- <name>msqlserver</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->mysql-server</bindstofield>
- <description>Either a reference to a Unix domain socket or a reference to a specific host.</description>
- <default_value>/tmp/mysql.sock</default_value>
- <validate>^[a-z0-9.|/]+$</validate>
- <message>Server name field is invalid</message>
- <required />
- </field>
- <field>
- <name>msqlport</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->mysql-port</bindstofield>
- <description>Use this variable if you are going to a MySQL server instance using TCP/IP instead of a socket connection.</description>
- <default_value>3306</default_value>
- <validate>^[0-9]+$</validate>
- <message>Port field is invalid</message>
- <required />
- </field>
- <field>
- <name>msqluser</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->mysql-user</bindstofield>
- <description>Username, that will be used to connect to a MySQL server instance.</description>
- <default_value>dspam</default_value>
- <required />
- </field>
- <field>
- <name>msqlpwd</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->mysql-password</bindstofield>
- <description>Password, that will be used to connect to a MySQL server instance.</description>
- <default_value>dspam</default_value>
- <required />
- </field>
- <field>
- <name>msqldb</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->mysql-database</bindstofield>
- <description>Database name, that contains DSPAM data.</description>
- <default_value>dspam</default_value>
- <required />
- </field>
- <field>
- <name>msqlcomp</name>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->mysql-compress</bindstofield>
- <description>Indicates whether communication data between DSPAM and MySQL should be compressed.</description>
- <default_value>on</default_value>
- </field>
- <field>
- <name>msqlsuqt</name>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->mysql-squote</bindstofield>
- <description>Use this if you have the 4.1 quote bug (see doc/mysql.txt).</description>
- </field>
- <field>
- <name>msqlccache</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->mysql-ccache</bindstofield>
- <description>Conection cache default set to 10.</description>
- <default_value>10</default_value>
- <validate>^[0-9]+$</validate>
- <message>Connection cache field is invalid</message>
- <required />
- </field>
- <field>
- <name>msqluid</name>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->mysql-uid</bindstofield>
- <description>Insert user id into the DSPAM signature.</description>
- <default_value>on</default_value>
- </field>
- <field>
- <name>slitepr</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->sqlite-pragma</bindstofield>
- <description>A particular SQLite pragma command to be used.</description>
- </field>
- <field>
- <name>pgserver</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->pgsql-server</bindstofield>
- <description>A reference to a specific host that is running a PostgreSQL instance.</description>
- <default_value>127.0.0.1</default_value>
- <validate>^[a-z0-9.|-]+$</validate>
- <message>Server name field is invalid</message>
- <required />
- </field>
- <field>
- <name>pgport</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->pgsql-port</bindstofield>
- <description>A number that represents the port a specific PostgreSQL instance is listening to.</description>
- <default_value>5432</default_value>
- <validate>^[0-9]+$</validate>
- <message>Port field is invalid</message>
- <required />
- </field>
- <field>
- <name>pguser</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->pgsql-user</bindstofield>
- <description>Username, that will be used to connect to a PostgreSQL server instance.</description>
- <default_value>dspam</default_value>
- <required />
- </field>
- <field>
- <name>pgpwd</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->pgsql-password</bindstofield>
- <description>Password, that will be used to connect to a PostgreSQL server instance.</description>
- <default_value>dspam</default_value>
- <required />
- </field>
- <field>
- <name>pgdb</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->pgsql-database</bindstofield>
- <description>Database name, that contains DSPAM data.</description>
- <default_value>dspam</default_value>
- <required />
- </field>
- <field>
- <name>pgccache</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->pgsql-ccache</bindstofield>
- <description>Conection cache default set to 3.</description>
- <default_value>3</default_value>
- <validate>^[0-9]+$</validate>
- <message>Connection cache field is invalid</message>
- <required />
- </field>
- <field>
- <name>pguid</name>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->pgsql-uid</bindstofield>
- <description>Insert user id into the DSPAM signature.</description>
- <default_value>on</default_value>
- </field>
- <field>
- <name>oraserver</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->ora-server</bindstofield>
- <description>A reference to a specific host that is running an Oracle database instance.</description>
- <size>50</size>
- <default_value>&quot;(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=PROD)))&quot;</default_value>
- <required />
- </field>
- <field>
- <name>orauser</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->ora-user</bindstofield>
- <description>Username, that will be used to connect to a Oracle database server instance.</description>
- <default_value>dspam</default_value>
- <required />
- </field>
- <field>
- <name>orapwd</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->ora-password</bindstofield>
- <description>Password, that will be used to connect to a Oracle database server instance.</description>
- <default_value>dspam</default_value>
- <required />
- </field>
- <field>
- <name>orasch</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->ora-schema</bindstofield>
- <description>Schema name, that contains DSPAM data.</description>
- <default_value>dspam</default_value>
- <required />
- </field>
- <field>
- <name>hsrmax</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->hash-rec-max</bindstofield>
- <description>Default number of records to create in the initial segment when building hash files.</description>
- <default_value>98317</default_value>
- <validate>^[0-9]+$</validate>
- <message>Default number of record field is invalid</message>
- <required />
- </field>
- <field>
- <name>hsatex</name>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->hash-auto-ex</bindstofield>
- <description>Autoextend hash databases when they fill up. This allows them to continue to train by adding extents (extensions) to the file.</description>
- <default_value>on</default_value>
- <required />
- </field>
- <field>
- <name>hsmxex</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->hash-max-ext</bindstofield>
- <description>The maximum number of extents that may be created in a single hash file.</description>
- <default_value>0</default_value>
- <validate>^[0-9]+$</validate>
- <message>Default number of record field is invalid</message>
- <required />
- </field>
- <field>
- <name>hsexsz</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->hash-ext-size</bindstofield>
- <description>The record size for newly created extents.</description>
- <default_value>49157</default_value>
- <validate>^[0-9]+$</validate>
- <message>Default number of record field is invalid</message>
- <required />
- </field>
- <field>
- <name>hsmxse</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->hash-max-seek</bindstofield>
- <description>The maximum number of records to seek to insert a new record before failing or adding a new extent.</description>
- <default_value>100</default_value>
- <validate>^[0-9]+$</validate>
- <message>Default number of record field is invalid</message>
- <required />
- </field>
- <field>
- <name>hsccus</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->hash-co-user</bindstofield>
- <description>If you are using a single, stateful hash database in daemon mode, specifying a concurrent user will cause the user to be permanently mapped into memory and shared via rwlocks.</description>
- <default_value>user</default_value>
- <required />
- </field>
- <field>
- <name>hscoca</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dbsettings->0->hash-co-cache</bindstofield>
- <description>If running in daemon mode, this is the max # of concurrent connections that will be supported.</description>
- <default_value>10</default_value>
- <validate>^[0-9]+$</validate>
- <message>Default number of record field is invalid</message>
- <required />
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepsubmitphpaction>
- <![CDATA[
- if ($_POST['storagedriver'] == "mysql") {
- /* ============================================================================================= */
- /* == SQLite == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['sqlite-pragma']);
- /* ============================================================================================= */
- /* == PostgreSQL == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-server']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-port']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-password']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-database']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-ccache']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-uid']);
- /* ============================================================================================= */
- /* == Oracle == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-server']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-password']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-schema']);
- /* ============================================================================================= */
- /* == Hash == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-rec-max']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-auto-ex']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-max-ext']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-ext-size']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-max-seek']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-co-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-co-cache']);
- } else if ($_POST['storagedriver'] == "sqlite") {
- /* ============================================================================================= */
- /* == MySQL == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-server']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-port']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-password']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-database']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-compress']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-squote']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-ccache']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-uid']);
- /* ============================================================================================= */
- /* == PostgreSQL == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-server']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-port']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-password']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-database']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-ccache']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-uid']);
- /* ============================================================================================= */
- /* == Oracle == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-server']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-password']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-schema']);
- /* ============================================================================================= */
- /* == Hash == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-rec-max']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-auto-ex']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-max-ext']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-ext-size']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-max-seek']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-co-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-co-cache']);
- } else if ($_POST['storagedriver'] == "bdb") {
- /* NOP */
- } else if ($_POST['storagedriver'] == "pgsql") {
- /* ============================================================================================= */
- /* == MySQL == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-server']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-port']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-password']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-database']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-compress']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-squote']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-ccache']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-uid']);
- /* ============================================================================================= */
- /* == SQLite == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['sqlite-pragma']);
- /* ============================================================================================= */
- /* == Oracle == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-server']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-password']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-schema']);
- /* ============================================================================================= */
- /* == Hash == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-rec-max']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-auto-ex']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-max-ext']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-ext-size']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-max-seek']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-co-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-co-cache']);
- } else if ($_POST['storagedriver'] == "oracle") {
- /* ============================================================================================= */
- /* == MySQL == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-server']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-port']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-password']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-database']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-compress']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-squote']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-ccache']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-uid']);
- /* ============================================================================================= */
- /* == SQLite == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['sqlite-pragma']);
- /* ============================================================================================= */
- /* == PostgreSQL == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-server']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-port']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-password']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-database']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-ccache']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-uid']);
- /* ============================================================================================= */
- /* == Hash == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-rec-max']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-auto-ex']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-max-ext']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-ext-size']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-max-seek']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-co-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['hash-co-cache']);
- } else if ($_POST['storagedriver'] == "hash") {
- /* ============================================================================================= */
- /* == MySQL == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-server']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-port']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-password']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-database']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-compress']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-squote']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-ccache']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['mysql-uid']);
- /* ============================================================================================= */
- /* == SQLite == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['sqlite-pragma']);
- /* ============================================================================================= */
- /* == PostgreSQL == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-server']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-port']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-password']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-database']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-ccache']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['pgsql-uid']);
- /* ============================================================================================= */
- /* == Oracle == */
- /* ============================================================================================= */
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-server']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-user']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-password']);
- unset($config['installedpackages']['dspam']['config'][0]['dbsettings'][0]['ora-schema']);
- }
- ]]>
- </stepsubmitphpaction>
- <javascriptafterformdisplay>
- <![CDATA[
- function toggleDBSettings(idx) {
- if (idx)
- idx = idx;
- else
- idx = document.iform.storagedriver.selectedIndex;
-
- switch (idx) {
- case 0: /* mysql */
- /* mysql specifics */
- trNode = document.iform.msqlserver.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.msqlport.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.msqluser.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.msqlpwd.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.msqldb.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.msqlcomp.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.msqlsuqt.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.msqlccache.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.msqluid.parentNode.parentNode;
- trNode.style.display = "table-row";
- /* sqlite specifics */
- trNode = document.iform.slitepr.parentNode.parentNode;
- trNode.style.display = "none";
- /* pgsql specifics */
- trNode = document.iform.pgserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgport.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pguser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgpwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgdb.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgccache.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pguid.parentNode.parentNode;
- trNode.style.display = "none";
- /* oracle specifics */
- trNode = document.iform.oraserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orauser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orapwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orasch.parentNode.parentNode;
- trNode.style.display = "none";
- /* hash specifics */
- trNode = document.iform.hsrmax.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsatex.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsmxex.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsexsz.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsmxse.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsccus.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hscoca.parentNode.parentNode;
- trNode.style.display = "none";
- break;
- case 1: /* sqlite */
- /* mysql specifics */
- trNode = document.iform.msqlserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlport.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqluser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlpwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqldb.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlcomp.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlsuqt.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlccache.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqluid.parentNode.parentNode;
- trNode.style.display = "none";
- /* sqlite specifics */
- trNode = document.iform.slitepr.parentNode.parentNode;
- trNode.style.display = "table-row";
- /* pgsql specifics */
- trNode = document.iform.pgserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgport.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pguser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgpwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgdb.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgccache.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pguid.parentNode.parentNode;
- trNode.style.display = "none";
- /* oracle specifics */
- trNode = document.iform.oraserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orauser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orapwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orasch.parentNode.parentNode;
- trNode.style.display = "none";
- /* hash specifics */
- trNode = document.iform.hsrmax.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsatex.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsmxex.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsexsz.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsmxse.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsccus.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hscoca.parentNode.parentNode;
- trNode.style.display = "none";
- break;
- case 2: /* bdb */
- /* mysql specifics */
- trNode = document.iform.msqlserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlport.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqluser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlpwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqldb.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlcomp.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlsuqt.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlccache.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqluid.parentNode.parentNode;
- trNode.style.display = "none";
- /* sqlite specifics */
- trNode = document.iform.slitepr.parentNode.parentNode;
- trNode.style.display = "none";
- /* pgsql specifics */
- trNode = document.iform.pgserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgport.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pguser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgpwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgdb.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgccache.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pguid.parentNode.parentNode;
- trNode.style.display = "none";
- /* oracle specifics */
- trNode = document.iform.oraserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orauser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orapwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orasch.parentNode.parentNode;
- trNode.style.display = "none";
- /* hash specifics */
- trNode = document.iform.hsrmax.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsatex.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsmxex.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsexsz.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsmxse.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsccus.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hscoca.parentNode.parentNode;
- trNode.style.display = "none";
- break;
- case 3: /* pgsql */
- /* mysql specifics */
- trNode = document.iform.msqlserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlport.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqluser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlpwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqldb.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlcomp.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlsuqt.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlccache.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqluid.parentNode.parentNode;
- trNode.style.display = "none";
- /* sqlite specifics */
- trNode = document.iform.slitepr.parentNode.parentNode;
- trNode.style.display = "none";
- /* pgsql specifics */
- trNode = document.iform.pgserver.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.pgport.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.pguser.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.pgpwd.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.pgdb.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.pgccache.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.pguid.parentNode.parentNode;
- trNode.style.display = "table-row";
- /* oracle specifics */
- trNode = document.iform.oraserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orauser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orapwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orasch.parentNode.parentNode;
- trNode.style.display = "none";
- /* hash specifics */
- trNode = document.iform.hsrmax.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsatex.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsmxex.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsexsz.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsmxse.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsccus.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hscoca.parentNode.parentNode;
- trNode.style.display = "none";
- break;
- case 4: /* oracle */
- /* mysql specifics */
- trNode = document.iform.msqlserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlport.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqluser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlpwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqldb.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlcomp.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlsuqt.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlccache.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqluid.parentNode.parentNode;
- trNode.style.display = "none";
- /* sqlite specifics */
- trNode = document.iform.slitepr.parentNode.parentNode;
- trNode.style.display = "none";
- /* pgsql specifics */
- trNode = document.iform.pgserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgport.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pguser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgpwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgdb.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgccache.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pguid.parentNode.parentNode;
- trNode.style.display = "none";
- /* oracle specifics */
- trNode = document.iform.oraserver.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.orauser.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.orapwd.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.orasch.parentNode.parentNode;
- trNode.style.display = "table-row";
- /* hash specifics */
- trNode = document.iform.hsrmax.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsatex.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsmxex.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsexsz.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsmxse.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hsccus.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.hscoca.parentNode.parentNode;
- trNode.style.display = "none";
- break;
- case 5: /* hash */
- /* mysql specifics */
- trNode = document.iform.msqlserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlport.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqluser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlpwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqldb.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlcomp.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlsuqt.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqlccache.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.msqluid.parentNode.parentNode;
- trNode.style.display = "none";
- /* sqlite specifics */
- trNode = document.iform.slitepr.parentNode.parentNode;
- trNode.style.display = "none";
- /* pgsql specifics */
- trNode = document.iform.pgserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgport.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pguser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgpwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgdb.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pgccache.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.pguid.parentNode.parentNode;
- trNode.style.display = "none";
- /* oracle specifics */
- trNode = document.iform.oraserver.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orauser.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orapwd.parentNode.parentNode;
- trNode.style.display = "none";
- trNode = document.iform.orasch.parentNode.parentNode;
- trNode.style.display = "none";
- /* hash specifics */
- trNode = document.iform.hsrmax.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.hsatex.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.hsmxex.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.hsexsz.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.hsmxse.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.hsccus.parentNode.parentNode;
- trNode.style.display = "table-row";
- trNode = document.iform.hscoca.parentNode.parentNode;
- trNode.style.display = "table-row";
- break;
- }
- }
-
- toggleDBSettings(0);
- ]]>
- </javascriptafterformdisplay>
-</step>
-<step>
- <id>4</id>
- <includefile>dspam.inc</includefile>
- <title>Delivery Settings</title>
- <description>
- On this page you will specify how DSPAM should deliver email messages to
- their final destination. This could be either a local delivery method or
- a TCP/IP based delivery method.
- </description>
- <fields>
- <field>
- <name>dagent</name>
- <description>Specifies the local delivery agent DSPAM should call when delivering mail as a trusted user.</description>
- <type>select</type>
- <options>
- <option>
- <name>procmail</name>
- <value>procmail</value>
- </option>
- <option>
- <name>mail</name>
- <value>mail</value>
- </option>
- <option>
- <name>mail.local</name>
- <value>mail.local</value>
- </option>
- <option>
- <name>deliver</name>
- <value>deliver</value>
- </option>
- <option>
- <name>maildrop</name>
- <value>maildrop</value>
- </option>
- <option>
- <name>exim</name>
- <value>exim</value>
- </option>
- </options>
- <bindstofield>installedpackages->dspam->config->0->tdelivery-agent</bindstofield>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>dspamc</name>
- <description>Use &lt;code&gt;dspamc&lt;/code&gt; instead of &lt;code&gt;dspam&lt;/code&gt; to locally deliver mails from the MTA to the user's mailbox (this pulls in DSPAM client/server settings).</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->thin-client</bindstofield>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>tcpipdel</name>
- <description>Use TCP/IP based delivery. This option needs to be ticked if you are going to deliver via LMTP or SMTP.</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->tcpip-delivery</bindstofield>
- <enablefields>dhost,dport,dident,delproto</enablefields>
- </field>
- <field>
- <name>dhost</name>
- <type>input</type>
- <donotdisable>false</donotdisable>
- <bindstofield>installedpackages->dspam->config->0->tcpip-delivery-host</bindstofield>
- <description>Alternatively, you may wish to use SMTP or LMTP delivery to deliver your message to the mail server.</description>
- <validate>^[a-z0-9.|-]+$</validate>
- <message>Host name field is invalid</message>
- </field>
- <field>
- <name>dport</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->tcpip-delivery-port</bindstofield>
- <description>Port number of a particular host.</description>
- <validate>^[0-9]+$</validate>
- <message>Port field is invalid</message>
- </field>
- <field>
- <name>dident</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->tcpip-delivery-ident</bindstofield>
- <description>A particular identification string.</description>
- </field>
- <field>
- <name>delproto</name>
- <description>A particular protocol typ. Either SMTP or LMTP.</description>
- <type>select</type>
- <options>
- <option>
- <name>ltmp</name>
- <value>lmtp</value>
- </option>
- <option>
- <name>smtp</name>
- <value>smtp</value>
- </option>
- </options>
- <bindstofield>installedpackages->dspam->config->0->tcpip-delivery-proto</bindstofield>
- </field>
- <field>
- <name>onfail</name>
- <description>What to do if local delivery or quarantine should fail.</description>
- <type>select</type>
- <options>
- <option>
- <name>error</name>
- <value>error</value>
- </option>
- <option>
- <name>unlearn</name>
- <value>unlearn</value>
- </option>
- </options>
- <bindstofield>installedpackages->dspam->config->0->delivery-onfail</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
- <stepsubmitphpaction>
- <![CDATA[
- if($_POST['dspamc'] != "") {
- /* DSPAM server settings */
- $config['installedpackages']['dspam']['config'][0]['dspam-server-port'] = "24";
- $config['installedpackages']['dspam']['config'][0]['dspam-server-queue-size'] = "32";
- $config['installedpackages']['dspam']['config'][0]['dspam-server-pid'] = "/var/run/dspam/dspam.pid";
- $config['installedpackages']['dspam']['config'][0]['dspam-server-mode'] = "auto";
- $config['installedpackages']['dspam']['config'][0]['dspam-server-params'] = "--deliver=innocent -d %u";
- $config['installedpackages']['dspam']['config'][0]['dspam-server-id'] = "abysseleven.abyssworld.de";
- $config['installedpackages']['dspam']['config'][0]['dspam-server-socket'] = "/var/run/dspam/dspam.sock";
-
- /* server passwords */
- $config['installedpackages']['dspam']['config'][0]['server-pwd'][0]['value'] = "secret";
- $config['installedpackages']['dspam']['config'][0]['server-pwd'][0]['descr'] = "desc";
- $config['installedpackages']['dspam']['config'][0]['server-pwd'][1]['value'] = "password";
- $config['installedpackages']['dspam']['config'][0]['server-pwd'][1]['descr'] = "desc";
-
- /* DSPAM client settings */
- $config['installedpackages']['dspam']['config'][0]['dspam-client-enable'] = "on";
- $config['installedpackages']['dspam']['config'][0]['dspam-client-host'] = "/tmp/dspam.sock";
- $config['installedpackages']['dspam']['config'][0]['dspam-client-port'] = "24";
- $config['installedpackages']['dspam']['config'][0]['dspam-client-id'] = "secret@Relay1";
- write_config();
- }
- ]]>
- </stepsubmitphpaction>
-</step>
-<step>
- <id>5</id>
- <includefile>dspam.inc</includefile>
- <title> DSPAM Debugging Options</title>
- <description>
- Usually the DSPAM binary that ships with pfSense does not contain debugging symbols.
- Hence it makes little sense to enable debugging options. If you are quite certain that
- your DSPAM distribution comes with debugging enabled you may tweak the below debugging
- options.
- </description>
- <fields>
- <field>
- <donotdisable>true</donotdisable>
- <name>enabledbg</name>
- <description>Enable debugging.</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->debug-enable</bindstofield>
- <enablefields>debug,dopt</enablefields>
- </field>
- <field>
- <name>debug</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->debug-whom</bindstofield>
- <description>Enables debugging for some or all users.</description>
- </field>
- <field>
- <name>dopt</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->debug-options</bindstofield>
- <description>One or more of: process, classify, spam, fp, inoculation, corpus</description>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>6</id>
- <includefile>dspam.inc</includefile>
- <title>DSPAM Engine Settings</title>
- <description>
- On this page you will find some specific options required to operate the DSPAM engine. Please
- consult your &lt;code&gt;dspam.conf&lt;/code&gt; for a detailed explanation of each option.
- If you are unsure about the meaning of a particular option, please use the default values.
- </description>
- <fields>
- <field>
- <name>tmode</name>
- <description>
- The default training mode to use for all operations, when one has not
- been specified on the commandline or in the user's preferences (default: teft).
- </description>
- <type>select</type>
- <default_value>teft</default_value>
- <options>
- <option>
- <name>toe</name>
- <value>toe</value>
- </option>
- <option>
- <name>tum</name>
- <value>tum</value>
- </option>
- <option>
- <name>teft</name>
- <value>teft</value>
- </option>
- <option>
- <name>notrain</name>
- <value>notrain</value>
- </option>
- </options>
- <bindstofield>installedpackages->dspam->config->0->training-mode</bindstofield>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>testct</name>
- <default_value>on</default_value>
- <description>
- By default, dspam will retrain certain errors until the condition is
- no longer met (default: enabled).
- </description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->test-cond-training</bindstofield>
- </field>
- <field>
- <name>pvalue</name>
- <description>
- Specify the technique used for calculating PValues, overriding any
- defaults configured in the build (default: graham).
- </description>
- <type>select</type>
- <default_value>teft</default_value>
- <options>
- <option>
- <name>graham</name>
- <value>graham</value>
- </option>
- <option>
- <name>robinson</name>
- <value>robinso</value>
- </option>
- <option>
- <name>markov</name>
- <value>markov</value>
- </option>
- </options>
- <bindstofield>installedpackages->dspam->config->0->pvalue</bindstofield>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>ipdrive</name>
- <default_value>on</default_value>
- <description>
- Calculate odds-ratios for ham/spam, and add to X-DSPAM-Improbability
- headers (default: disabled).
- </description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->improbability-drive</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>7</id>
- <includefile>dspam.inc</includefile>
- <title>LDAP Settings</title>
- <description>
- DSPAM comes with the ability to verify users agains user records stored within a LDAP directory.
- If using this option, it would be for example possible to verify mail users against Windows
- user entries stored within an Active Directory. Please consider this feature as somewhat experimental.
- </description>
- <fields>
- <field>
- <donotdisable>true</donotdisable>
- <name>enableldap</name>
- <description>Enable checks against a LDAP directory.</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->ldap-enable</bindstofield>
- <enablefields>ldapmode,ldaphost,ldapfilter,ldapbase</enablefields>
- </field>
- <field>
- <name>ldapmode</name>
- <description>
- Perform various LDAP functions depending on LDAPMode variable.
- </description>
- <type>select</type>
- <default_value>verify</default_value>
- <options>
- <option>
- <name>verify</name>
- <value>verify</value>
- </option>
- </options>
- <bindstofield>installedpackages->dspam->config->0->ldap-mode</bindstofield>
- </field>
- <field>
- <name>ldaphost</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->ldap-host</bindstofield>
- <description>Hostname of the LDAP directory server.</description>
- </field>
- <field>
- <name>ldapfilter</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->ldap-filter</bindstofield>
- <description>A specific query filter, that should be used while querying the LDAP server.</description>
- </field>
- <field>
- <name>ldapbase</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->ldap-base</bindstofield>
- <description>A particular distinguish name from where to start LDAP queries.</description>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>8</id>
- <includefile>dspam.inc</includefile>
- <title>Miscellaneous Settings</title>
- <description>
- On this page we will give you an opertunity to fine-tune the DSPAM engine. As mentioned earlier,
- if you are unsure about the meaning of a particular option, use its default value.
- </description>
- <fields>
- <field>
- <name>foatt</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->failover-attempts</bindstofield>
- <description>A particular number of attempts (default: 1).</description>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>enablesbl</name>
- <description>Enable checks against a particular SBL host (default: disabled).</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->sbl-enable</bindstofield>
- <enablefields>sblhost</enablefields>
- </field>
- <field>
- <name>sblhost</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->sbl-host</bindstofield>
- <description>A particular SBL hostname (default: none).</description>
- <size>30</size>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>enablerbl</name>
- <description>Enable RBL inoculation support (default: disabled).</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->rbl-inoculate</bindstofield>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>enablenoti</name>
- <description>Enable the sending of notification emails to users (first message, quarantine full, etc. default: disabled).</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->notification-email</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>9</id>
- <includefile>dspam.inc</includefile>
- <title>Maintainance Settings</title>
- <description>
- DSPAM stores token data etc. in some kind of a database (e.g. a RDBMS or flat files).
- Over time, this token data may consume lots of space. Hence it makes sense to run
- certain routines to clean up unused data.
- </description>
- <fields>
- <field>
- <name>psig</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->purge-signatures</bindstofield>
- <description>Purge stale signatures (default: 14).</description>
- </field>
- <field>
- <name>pneut</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->purge-neutral</bindstofield>
- <description>Purge tokens with neutralish probabilities (default: 90).</description>
- </field>
- <field>
- <name>punu</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->purge-unused</bindstofield>
- <description>Purge unused tokens (default: 90).</description>
- </field>
- <field>
- <name>phapa</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->purge-hapaxes</bindstofield>
- <description> Purge tokens with less than 5 hits (hapaxes - default: 30).</description>
- </field>
- <field>
- <name>pones</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->purge-hits-1s</bindstofield>
- <description>Purge tokens with only 1 spam hit (default: 15).</description>
- </field>
- <field>
- <name>ponei</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->purge-hits-1i</bindstofield>
- <description> Purge tokens with only 1 innocent hit (default: 15).</description>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>10</id>
- <includefile>dspam.inc</includefile>
- <title>System Settings</title>
- <description>
- This page contains additional settings related to the DSPAM system such as logging,
- message processing behaviour et cetera.
- </description>
- <fields>
- <field>
- <name>locmx</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->local-mx</bindstofield>
- <description>
- Local Mail Exchangers: Used for source address tracking, tells DSPAM
- which mail exchangers are local and therefore should be ignored in the
- Received: header when tracking the source of an email. Note: you should
- use the address of the host as appears between brackets [ ] in the
- Received header (default: 127.0.0.1).
- </description>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>enablesysl</name>
- <description>Enable system logging (default: enabled).</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->system-log</bindstofield>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>enableusel</name>
- <description>Enable per user logging (default: enabled).</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->user-log</bindstofield>
- </field>
- <field>
- <name>optinout</name>
- <description>
- Opt: in or out; determines DSPAM's default filtering behavior (default: out).
- </description>
- <type>select</type>
- <default_value>out</default_value>
- <options>
- <option>
- <name>out</name>
- <value>out</value>
- </option>
- <option>
- <name>in</name>
- <value>in</value>
- </option>
- </options>
- <bindstofield>installedpackages->dspam->config->0->filter-opt</bindstofield>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>enableptoh</name>
- <description>Parse the To: headers of an incoming message. (default: disabled).</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->parse-to-headers</bindstofield>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>enablecmop</name>
- <description>Automatically change the class (to spam or innocent - default: disabled).</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->change-mode-on-parse</bindstofield>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>enablecuop</name>
- <description>Automatically change the username to match that specified in the To: header (default: enabled).</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->change-user-on-parse</bindstofield>
- </field>
- <field>
- <name>maxmsgs</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->max-message-size</bindstofield>
- <description>
- You may specify a maximum message size in bytes for DSPAM to process. (default: 307200).
- </description>
- </field>
- <field>
- <donotdisable>true</donotdisable>
- <name>procbias</name>
- <description>
- Bias causes the filter to lean more toward &quot;innocent&quot;, and usually
- greatly reduces false positives. It is the default behavior of most
- Bayesian filters, including dspam (default: enabled).
- </description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->processor-bias</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>11</id>
- <includefile>dspam.inc</includefile>
- <title>ClamAV Engine Settings</title>
- <description>
- DSPAM comes with an additional feature which allows to scan mail messages
- for malicious code (i.e. virii). If you require messages not only to be
- classified as Spam/Ham but additionally to be scanned for virii, enable
- to appropriate option below.
- </description>
- <fields>
- <field>
- <donotdisable>true</donotdisable>
- <name>enableclam</name>
- <description>Enable ClamAV Engine (default: disabled).</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->clamav-enable</bindstofield>
- <enablefields>clamport,clamhost,clamresp</enablefields>
- </field>
- <field>
- <name>clamport</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->clamav-port</bindstofield>
- <description>A number that specifies the port the ClamAV daemon is listening to (default: none).</description>
- </field>
- <field>
- <name>clamhost</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->clamav-host</bindstofield>
- <description>An IP address that points to the host the ClamAV daemon is running on (default: none).</description>
- </field>
- <field>
- <name>clamresp</name>
- <description>The action that should take place, if ClamAV reports a positive (default: none).</description>
- <type>select</type>
- <default_value>accept</default_value>
- <options>
- <option>
- <name>reject</name>
- <value>reject</value>
- </option>
- <option>
- <name>accept</name>
- <value>accept</value>
- </option>
- <option>
- <name>spam</name>
- <value>spam</value>
- </option>
- </options>
- <bindstofield>installedpackages->dspam->config->0->clamav-response</bindstofield>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>12</id>
- <includefile>dspam.inc</includefile>
- <title>DSPAM Daemon Settings (Server)</title>
- <description>
- DSPAM can be either invoked per message (i.e. a thread per message) or it
- can be run as a daemon in the background. The latter option enables DSPAM
- to maintain database connection pools which may increase overall performance.
- Based on the profile, that you did choose initially, some of the below options
- may be already set.
- </description>
- <fields>
- <field>
- <name>dsport</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-server-port</bindstofield>
- <description>A number that specifies the port the DSPAM daemon is listening to (default: none).</description>
- </field>
- <field>
- <name>dsqsize</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-server-queue-size</bindstofield>
- <description>A number that specifies the server's queue size (default: none).</description>
- </field>
- <field>
- <name>dspid</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-server-pid</bindstofield>
- <description> Keep this is sync with &lt;code&gt;/usr/local/etc/rc.d/dspam.rc&lt;/code&gt; script (default: none).</description>
- <size>40</size>
- </field>
- <field>
- <name>dssmode</name>
- <description>Specifies the type of LMTP server to start. (default: none).</description>
- <type>select</type>
- <default_value>auto</default_value>
- <options>
- <option>
- <name>dspam</name>
- <value>dspam</value>
- </option>
- <option>
- <name>standard</name>
- <value>standard</value>
- </option>
- <option>
- <name>auto</name>
- <value>auto</value>
- </option>
- </options>
- <bindstofield>installedpackages->dspam->config->0->dspam-server-mode</bindstofield>
- </field>
- <field>
- <name>serverparam</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-server-params</bindstofield>
- <description>Parameters which will be passed to the LMTP server (default: none).</description>
- </field>
- <field>
- <name>serverid</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-server-id</bindstofield>
- <description>An identification string which will be used to be passed to the LMTP server (default: none).</description>
- </field>
- <field>
- <name>serversock</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-server-socket</bindstofield>
- <description>A local Unix domain socket (default: none).</description>
- <size>40</size>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>13</id>
- <includefile>dspam.inc</includefile>
- <title>DSPAM Daemon Settings (Client)</title>
- <description>
- If you did configure DSPAM to run in dspam mode, it is required to configure
- client settings because DSPAM needs for example to authenticate against its
- server counterpart.
- </description>
- <fields>
- <field>
- <donotdisable>true</donotdisable>
- <name>enabledsclient</name>
- <description>Run DSPAM in client mode (default: disabled).</description>
- <type>checkbox</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-client-enable</bindstofield>
- <enablefields>dsclhost,dsclport,dsclident</enablefields>
- </field>
- <field>
- <name>dsclhost</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-client-host</bindstofield>
- <description>An IP address or a Unix domain socket (default: none).</description>
- </field>
- <field>
- <name>dsclport</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-client-port</bindstofield>
- <description>Will be only used if this client uses TCP/IP communication (default: none).</description>
- </field>
- <field>
- <name>dsclident</name>
- <type>input</type>
- <bindstofield>installedpackages->dspam->config->0->dspam-client-id</bindstofield>
- <description>A string that will be used to identify the client against a server. (default: none).</description>
- <size>40</size>
- </field>
- <field>
- <name>Next</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>14</id>
- <includefile>dspam.inc</includefile>
- <title>Reload configuration</title>
- <disableheader>true</disableheader>
- <description>Click 'Reload' to reload the DSPAM daemon with new changes.</description>
- <fields>
- <field>
- <name>Reload</name>
- <type>submit</type>
- </field>
- </fields>
-</step>
-<step>
- <id>15</id>
- <includefile>dspam.inc</includefile>
- <title>Reload in progress</title>
- <description>
- A reload is now in progress. Please wait.
- &lt;br /&gt;&#160;&lt;br /&gt;
- The system will automatically try to access DSPAM settings in 120 page seconds.
- &lt;br /&gt;&#160;&lt;br /&gt;
- You can click on the icon above to access the site more quickly.
- </description>
- <javascriptafterformdisplay>
- <![CDATA[
- Effect.Pulsate('wzd_step_title', { duration: 10});
- window.setTimeout('window.location.href = "/dspam-settings.php"', 120000);
- ]]>
- </javascriptafterformdisplay>
- <stepafterformdisplay>
- <![CDATA[
- dspam_configure();
- mwexec("/usr/local/etc/rc.d/spamd.sh stop");
- mwexec("/usr/local/etc/rc.d/spamd.sh start");
- ]]>
- </stepafterformdisplay>
-</step>
-</pfsensewizard>
diff --git a/config/archive/freenas/bin/ext2fs.ko b/config/archive/freenas/bin/ext2fs.ko
deleted file mode 100644
index 042b4bb8..00000000
--- a/config/archive/freenas/bin/ext2fs.ko
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/geom_concat.ko b/config/archive/freenas/bin/geom_concat.ko
deleted file mode 100644
index f1c40215..00000000
--- a/config/archive/freenas/bin/geom_concat.ko
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/geom_gpt.ko b/config/archive/freenas/bin/geom_gpt.ko
deleted file mode 100644
index 308b017b..00000000
--- a/config/archive/freenas/bin/geom_gpt.ko
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/geom_mirror.ko b/config/archive/freenas/bin/geom_mirror.ko
deleted file mode 100644
index 50a5f5ac..00000000
--- a/config/archive/freenas/bin/geom_mirror.ko
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/geom_stripe.ko b/config/archive/freenas/bin/geom_stripe.ko
deleted file mode 100644
index dd8e6a4d..00000000
--- a/config/archive/freenas/bin/geom_stripe.ko
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/geom_vinum.ko b/config/archive/freenas/bin/geom_vinum.ko
deleted file mode 100644
index c550fc83..00000000
--- a/config/archive/freenas/bin/geom_vinum.ko
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/iscontrol b/config/archive/freenas/bin/iscontrol
deleted file mode 100644
index f2e3f409..00000000
--- a/config/archive/freenas/bin/iscontrol
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/iscsi_initiator.ko b/config/archive/freenas/bin/iscsi_initiator.ko
deleted file mode 100644
index 94a07423..00000000
--- a/config/archive/freenas/bin/iscsi_initiator.ko
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/kernel.gz b/config/archive/freenas/bin/kernel.gz
deleted file mode 100644
index 9d9eb3f2..00000000
--- a/config/archive/freenas/bin/kernel.gz
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/mountd b/config/archive/freenas/bin/mountd
deleted file mode 100644
index 55682c7b..00000000
--- a/config/archive/freenas/bin/mountd
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/nfsd b/config/archive/freenas/bin/nfsd
deleted file mode 100644
index 311f1fca..00000000
--- a/config/archive/freenas/bin/nfsd
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/ntfs.ko b/config/archive/freenas/bin/ntfs.ko
deleted file mode 100644
index 1e923dac..00000000
--- a/config/archive/freenas/bin/ntfs.ko
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/rpc.lockd b/config/archive/freenas/bin/rpc.lockd
deleted file mode 100644
index 906a8641..00000000
--- a/config/archive/freenas/bin/rpc.lockd
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/rpc.statd b/config/archive/freenas/bin/rpc.statd
deleted file mode 100644
index c630a05a..00000000
--- a/config/archive/freenas/bin/rpc.statd
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/bin/rpcbind b/config/archive/freenas/bin/rpcbind
deleted file mode 100644
index 882d9c4d..00000000
--- a/config/archive/freenas/bin/rpcbind
+++ /dev/null
Binary files differ
diff --git a/config/archive/freenas/conf.default/config.xml b/config/archive/freenas/conf.default/config.xml
deleted file mode 100644
index 74ed6186..00000000
--- a/config/archive/freenas/conf.default/config.xml
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0"?>
-<!-- FreeNAS default system configuration -->
-<freenas>
- <version>1.1</version>
- <lastchange/>
- <system>
- <hostname>freenas</hostname>
- <domain>local</domain>
- <dnsserver/>
- <dnsallowoverride/>
- <username>admin</username>
- <password>$1$KLfrklGE$9mMLCl/tNeqZJzdCJw6Gb0</password>
- <timezone>Etc/UTC</timezone>
- <time-update-interval>300</time-update-interval>
- <timeservers>pool.ntp.org</timeservers>
- <webgui>
- <protocol>http</protocol>
- <!--
- <port></port>
- <certificate></certificate>
- <private-key></private-key>
- <noassigninterfaces/>
- <expanddiags/>
- <noantilockout></noantilockout>
- -->
- </webgui>
- <!-- <disableconsolemenu/> -->
- <!-- <disablefirmwarecheck/> -->
- <!-- <shellcmd></shellcmd> -->
- <!-- <earlyshellcmd></earlyshellcmd> -->
- <!-- <harddiskstandby></harddiskstandby> -->
- <!-- <polling/> -->
- </system>
- <interfaces>
- <lan>
- <if>sis0</if>
- <ipaddr>192.168.1.250</ipaddr>
- <subnet>24</subnet>
- <media/>
- <mediaopt/>
- <!--
- <wireless>
- *see below (opt[n])*
- </wireless>
- -->
- </lan>
- <!--
- <opt[n]>
- <enable/>
- <descr></descr>
- <if></if>
- <ipaddr></ipaddr>
- <subnet></subnet>
- <media></media>
- <mediaopt></mediaopt>
- <bridge>lan|wan|opt[n]</bridge>
- <wireless>
- <standard>11a|11b|11g</standard>
- <mode>hostap *or* bss *or* ibss</mode>
- <ssid></ssid>
- <channel></channel>
- <wep>
- <enable/>
- <key>
- <txkey/>
- <value></value>
- </key>
- </wep>
- </wireless>
- </opt[n]>
- -->
- </interfaces>
- <!--
- <vlans>
- <vlan>
- <tag></tag>
- <if></if>
- <descr></descr>
- </vlan>
- </vlans>
- -->
- <staticroutes>
- <!--
- <route>
- <interface>lan|opt[n]|pptp</interface>
- <network>xxx.xxx.xxx.xxx/xx</network>
- <gateway>xxx.xxx.xxx.xxx</gateway>
- <descr></descr>
- </route>
- -->
- </staticroutes>
- <disks>
- <!--
- <disk>
- <device>xxx</device>
- <type>IDE|SCSI</type>
- <position>master|slave|number</position>
- <desc>xxx</desc>
- <status>ok|new|missing</status>
- </disk>
- -->
-
- </disks>
- <mounts>
- <!--
- <mount>
- <device>xxx</device>
- <fstype>msdosfs|ufs|ntfs|etc...</fstype>
- <options>xxx</options>
- </mount>
- -->
- </mounts>
- <samba>
- <!-- <enable/> -->
- <netbiosname>freenas</netbiosname>
- <workgroup>WORKGROUP</workgroup>
- <serverdesc>FreeNAS Server</serverdesc>
- <security>share</security>
- <localmaster>yes</localmaster>
- </samba>
- <ftp>
- <!-- <enable/> -->
- <numberclients>5</numberclients>
- <maxconperip>2</maxconperip>
- <timeout>300</timeout>
- <port>21</port>
- <anonymous>yes</anonymous>
- <localuser>yes</localuser>
- <pasv_max_port>0</pasv_max_port>
- <pasv_min_port>0</pasv_min_port>
- </ftp>
- <afp>
- <!-- <enable/> -->
- </afp>
- <rsyncd>
- <!-- <enable/> -->
- <readonly>no</readonly>
- <port>873</port>
- </rsyncd>
- <sshd>
- <!-- <enable/> -->
- <port>22</port>
- </sshd>
-
- <nfs>
- <!-- <enable/> -->
- </nfs>
- <snmpd>
- <!-- <enable/> -->
- <syslocation/>
- <syscontact/>
- <rocommunity>public</rocommunity>
- </snmpd>
- <diag>
- <ipv6nat>
- <!-- <enable/> -->
- <ipaddr/>
- </ipv6nat>
- <!-- <ipfstatentries></ipfstatentries> -->
- </diag>
- <bridge>
- <!-- <filteringbridge/> -->
- </bridge>
- <syslog>
- <!--
- <reverse/>
- <enable/>
- <remoteserver>xxx.xxx.xxx.xxx</remoteserver>
- <system/>
- <nologdefaultblock/>
- <resolve/>
- -->
- </syslog>
- <access>
- <userid>1002</userid>
- <groupid>1002</groupid>
- </access>
-
-</freenas> \ No newline at end of file
diff --git a/config/archive/freenas/conf.kernel/pfSense.6.freenas b/config/archive/freenas/conf.kernel/pfSense.6.freenas
deleted file mode 100644
index aee11302..00000000
--- a/config/archive/freenas/conf.kernel/pfSense.6.freenas
+++ /dev/null
@@ -1,433 +0,0 @@
-#
-# GENERIC -- Generic kernel configuration file for FreeBSD/i386
-#
-# For more information on this file, please read the handbook section on
-# Kernel Configuration Files:
-#
-# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
-#
-# The handbook is also available locally in /usr/share/doc/handbook
-# if you've installed the doc distribution, otherwise always see the
-# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
-# latest information.
-#
-# An exhaustive list of options and more detailed explanations of the
-# device lines is also present in the ../../conf/NOTES and NOTES files.
-# If you are in doubt as to the purpose or necessity of a line, check first
-# in NOTES.
-#
-# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.429.2.7.2.2 2006/05/01 00:15:12 scottl Exp $
-
-machine i386
-cpu I486_CPU
-cpu I586_CPU
-cpu I686_CPU
-ident pfSense
-
-# To statically compile in device wiring instead of /boot/device.hints
-#hints "GENERIC.hints" # Default places to look for devices.
-
-makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-
-#FREENAS ADD lines:
-options NO_SWAPPING
-options HZ=1000
-
-#options SCHED_ULE # ULE scheduler
-options SCHED_4BSD # 4BSD scheduler
-options PREEMPTION # Enable kernel thread preemption
-options INET # InterNETworking
-options INET6 # IPv6 communications protocols
-options FFS # Berkeley Fast Filesystem
-options SOFTUPDATES # Enable FFS soft updates support
-options UFS_ACL # Support for access control lists
-options UFS_DIRHASH # Improve performance on big directories
-options MD_ROOT # MD is a potential root device
-options NFSCLIENT # Network Filesystem Client
-options NFSSERVER # Network Filesystem Server
-options NFS_ROOT # NFS usable as /, requires NFSCLIENT
-options MSDOSFS # MSDOS Filesystem
-options MSDOSFS_LARGE # MSDOS Filesystem for FAT32 > 128GB
-options CD9660 # ISO 9660 Filesystem
-options PROCFS # Process filesystem (requires PSEUDOFS)
-options PSEUDOFS # Pseudo-filesystem framework
-options GEOM_GPT # GUID Partition Tables.
-options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!]
-options COMPAT_FREEBSD4 # Compatible with FreeBSD4
-options COMPAT_FREEBSD5 # Compatible with FreeBSD5
-options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI
-options KTRACE # ktrace(1) support
-options SYSVSHM # SYSV-style shared memory
-options SYSVMSG # SYSV-style message queues
-options SYSVSEM # SYSV-style semaphores
-options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
-options KBD_INSTALL_CDEV # install a CDEV entry in /dev
-options AHC_REG_PRETTY_PRINT # Print register bitfields in debug
- # output. Adds ~128k to driver.
-options AHD_REG_PRETTY_PRINT # Print register bitfields in debug
- # output. Adds ~215k to driver.
-options ADAPTIVE_GIANT # Giant mutex is adaptive.
-
-#FreeNAS include ACPI in the kernel:
-device acpi # acpi -- Advanced Configuration and Power Management support
-
-device apic # I/O APIC
-
-# Bus support.
-device eisa
-device pci
-
-# Floppy drives
-device fdc
-
-# ATA and ATAPI devices
-device ata
-device atadisk # ATA disk drives
-device ataraid # ATA RAID drives
-device atapicd # ATAPI CDROM drives
-device atapifd # ATAPI floppy drives
-#device atapifd # ATAPI floppy drives
-device atapist # ATAPI tape drives
-options ATA_STATIC_ID # Static device numbering
-
-# SCSI Controllers
-device ahb # EISA AHA1742 family
-device ahc # AHA2940 and onboard AIC7xxx devices
-device ahd # AHA39320/29320 and onboard AIC79xx devices
-device amd # AMD 53C974 (Tekram DC-390(T))
-device isp # Qlogic family
-device ispfw # Firmware for QLogic HBAs- normally a module
-device mpt # LSI-Logic MPT-Fusion
-#device ncr # NCR/Symbios Logic
-device sym # NCR/Symbios Logic (newer chipsets + those of `ncr')
-device trm # Tekram DC395U/UW/F DC315U adapters
-
-device adv # Advansys SCSI adapters
-device adw # Advansys wide SCSI adapters
-device aha # Adaptec 154x SCSI adapters
-device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60.
-device bt # Buslogic/Mylex MultiMaster SCSI adapters
-
-device ncv # NCR 53C500
-device nsp # Workbit Ninja SCSI-3
-device stg # TMC 18C30/18C50
-
-#FREENAS ADD SPECIAL DRIVERSAdding special IOI-A100U2W drivers:
-device ihb # IOI-A100U2W drivers
-
-# SCSI peripherals
-device scbus # SCSI bus (required for SCSI)
-device ch # SCSI media changers
-device da # Direct Access (disks)
-device sa # Sequential Access (tape etc)
-device cd # CD
-device pass # Passthrough device (direct SCSI access)
-device ses # SCSI Environmental Services (and SAF-TE)
-
-# RAID controllers interfaced to the SCSI subsystem
-device amr # AMI MegaRAID
-device arcmsr # Areca SATA II RAID
-device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID
-device ciss # Compaq Smart RAID 5*
-device dpt # DPT Smartcache III, IV - See NOTES for options
-device hptmv # Highpoint RocketRAID 182x
-device rr232x # Highpoint RocketRAID 232x
-device iir # Intel Integrated RAID
-device ips # IBM (Adaptec) ServeRAID
-device mly # Mylex AcceleRAID/eXtremeRAID
-device twa # 3ware 9000 series PATA/SATA RAID
-
-# RAID controllers
-device aac # Adaptec FSA RAID
-device aacp # SCSI passthrough for aac (requires CAM)
-device ida # Compaq Smart RAID
-device mfi # LSI MegaRAID SAS
-device mlx # Mylex DAC960 family
-device pst # Promise Supertrak SX6000
-device twe # 3ware ATA RAID
-
-# atkbdc0 controls both the keyboard and the PS/2 mouse
-device atkbdc # AT keyboard controller
-device atkbd # AT keyboard
-device psm # PS/2 mouse
-
-device kbdmux # keyboard multiplexer
-
-device vga # VGA video card driver
-
-device splash # Splash screen and screen saver support
-
-# syscons is the default console driver, resembling an SCO console
-device sc
-
-# Enable this for the pcvt (VT220 compatible) console driver
-#device vt
-#options XSERVER # support for X server on a vt console
-#options FAT_CURSOR # start with block cursor
-
-device agp # support several AGP chipsets
-
-# Power management support (see NOTES for more options)
-#device apm
-# Add suspend/resume support for the i8254.
-device pmtimer
-
-# PCCARD (PCMCIA) support
-# PCMCIA and cardbus bridge support
-device cbb # cardbus (yenta) bridge
-device pccard # PC Card (16-bit) bus
-device cardbus # CardBus (32-bit) bus
-
-# Serial (COM) ports
-device sio # 8250, 16[45]50 based serial ports
-
-# Parallel port
-device ppc
-device ppbus # Parallel port bus (required)
-device lpt # Printer
-device ppi # Parallel port interface device
-#device vpo # Requires scbus and da
-
-# If you've got a "dumb" serial or parallel PCI card that is
-# supported by the puc(4) glue driver, uncomment the following
-# line to enable it (connects to the sio and/or ppc drivers):
-#device puc
-
-# PCI Ethernet NICs.
-device de # DEC/Intel DC21x4x (``Tulip'')
-device em # Intel PRO/1000 adapter Gigabit Ethernet Card
-device ixgb # Intel PRO/10GbE Ethernet Card
-device txp # 3Com 3cR990 (``Typhoon'')
-device vx # 3Com 3c590, 3c595 (``Vortex'')
-
-# PCI Ethernet NICs that use the common MII bus controller code.
-# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
-device miibus # MII bus support
-device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet
-device bfe # Broadcom BCM440x 10/100 Ethernet
-device bge # Broadcom BCM570xx Gigabit Ethernet
-device dc # DEC/Intel 21143 and various workalikes
-device fxp # Intel EtherExpress PRO/100B (82557, 82558)
-device lge # Level 1 LXT1001 gigabit Ethernet
-device nge # NatSemi DP83820 gigabit Ethernet
-device nve # nVidia nForce MCP on-board Ethernet Networking
-device pcn # AMD Am79C97x PCI 10/100(precedence over 'lnc')
-device re # RealTek 8139C+/8169/8169S/8110S
-device rl # RealTek 8129/8139
-device sf # Adaptec AIC-6915 (``Starfire'')
-device sis # Silicon Integrated Systems SiS 900/SiS 7016
-device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet
-device ste # Sundance ST201 (D-Link DFE-550TX)
-device ti # Alteon Networks Tigon I/II gigabit Ethernet
-device tl # Texas Instruments ThunderLAN
-device tx # SMC EtherPower II (83c170 ``EPIC'')
-device vge # VIA VT612x gigabit Ethernet
-device vr # VIA Rhine, Rhine II
-device wb # Winbond W89C840F
-device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
-
-# ISA Ethernet NICs. pccard NICs included.
-device cs # Crystal Semiconductor CS89x0 NIC
-# 'device ed' requires 'device miibus'
-device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards
-device ex # Intel EtherExpress Pro/10 and Pro/10+
-device ep # Etherlink III based cards
-device fe # Fujitsu MB8696x based cards
-device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc.
-device le # NE2100, NE32-VL Lance Ethernet cards
-device sn # SMC's 9000 series of Ethernet chips
-device xe # Xircom pccard Ethernet
-
-# Wireless NIC cards
-device wlan # 802.11 support
-device an # Aironet 4500/4800 802.11 wireless NICs.
-device awi # BayStack 660 and others
-device ral # Ralink Technology RT2500 wireless NICs.
-device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs.
-#device wl # Older non 802.11 Wavelan wireless NIC.
-
-# Pseudo devices.
-device loop # Network loopback
-device random # Entropy device
-device ether # Ethernet support
-device sl # Kernel SLIP
-device ppp # Kernel PPP
-device tun # Packet tunnel.
-device pty # Pseudo-ttys (telnet etc)
-device md # Memory "disks"
-device gif # IPv6 and IPv4 tunneling
-device faith # IPv6-to-IPv4 relaying (translation)
-
-# The `bpf' device enables the Berkeley Packet Filter.
-# Be aware of the administrative consequences of enabling this!
-# Note that 'bpf' is required for DHCP.
-device bpf # Berkeley packet filter
-
-# USB support
-device uhci # UHCI PCI->USB interface
-device ohci # OHCI PCI->USB interface
-device ehci # EHCI PCI->USB interface (USB 2.0)
-device usb # USB Bus (required)
-#device udbp # USB Double Bulk Pipe devices
-device ugen # Generic
-device uhid # "Human Interface Devices"
-device ukbd # Keyboard
-device ulpt # Printer
-device umass # Disks/Mass storage - Requires scbus and da
-device ums # Mouse
-device ural # Ralink Technology RT2500USB wireless NICs
-device urio # Diamond Rio 500 MP3 player
-device uscanner # Scanners
-# USB Ethernet, requires miibus
-device aue # ADMtek USB Ethernet
-device axe # ASIX Electronics USB Ethernet
-device cdce # Generic USB over Ethernet
-device cue # CATC USB Ethernet
-device kue # Kawasaki LSI USB Ethernet
-device rue # RealTek RTL8150 USB Ethernet
-
-# FireWire support
-device firewire # FireWire bus code
-device sbp # SCSI over FireWire (Requires scbus and da)
-device fwe # Ethernet over FireWire (non-standard!)
-device fwip
-
-# pfSense addons
-
-# Wireless NIC cards
-device wlan # 802.11 support
-device wlan_wep
-device wlan_ccmp
-device wlan_tkip
-device wlan_xauth
-device wlan_acl
-device ath
-device ath_rate_sample
-device ath_hal
-device an # Aironet 4500/4800 802.11 wireless NICs.
-device awi # BayStack 660 and others
-device iwi # Intel PRO/Wireless 2200BG
-device ipw
-device ral # Ralink Technology RT2500 wireless NICs.
-device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs.
-device wl # Older non 802.11 Wavelan wireless NIC.
-
-options COMPAT_FREEBSD5
-
-options UNIONFS # Union filesystem
-
-device bktr
-
-#options IPFIREWALL
-#options DUMMYNET
-#options IPDIVERT
-options IPFIREWALL_DEFAULT_TO_ACCEPT
-options IPFIREWALL_FORWARD
-options IPFIREWALL_VERBOSE
-options IPFIREWALL_VERBOSE_LIMIT
-
-device carp
-device pf
-device pflog
-device pfsync
-device vlan
-device gre
-
-options IPSTEALTH
-options TCP_DROP_SYNFIN #drop TCP packets with SYN+FIN
-options GEOM_UZIP
-options GEOM_LABEL
-
-options INCLUDE_CONFIG_FILE
-
-#options BRIDGE
-options NETGRAPH #netgraph(4) system
-options NETGRAPH_ASYNC
-options NETGRAPH_BPF
-options NETGRAPH_BRIDGE
-options NETGRAPH_CISCO
-options NETGRAPH_ECHO
-options NETGRAPH_ETHER
-options NETGRAPH_FRAME_RELAY
-options NETGRAPH_HOLE
-options NETGRAPH_IFACE
-options NETGRAPH_KSOCKET
-
-options NETGRAPH_LMI
-options NETGRAPH_MPPC_ENCRYPTION
-options NETGRAPH_ONE2MANY
-options NETGRAPH_PPP
-options NETGRAPH_PPPOE
-options NETGRAPH_PPTPGRE
-options NETGRAPH_RFC1490
-options NETGRAPH_SOCKET
-options NETGRAPH_TEE
-options NETGRAPH_TTY
-options NETGRAPH_UI
-options NETGRAPH_VJC
-
-device ubsa
-device ucom
-
-options FAST_IPSEC
-#options IPSEC_NAT_T
-device enc
-
-device crypto # core crypto support
-device cryptodev # /dev/crypto for access to h/w
-device rndtest # FIPS 140-2 entropy tester
-device hifn # Hifn 7951, 7781, etc.
-options HIFN_DEBUG # enable debugging support: hw.hifn.debug
-options HIFN_RNDTEST # enable rndtest support
-device ubsec # Broadcom 5501, 5601, 58xx
-
-options ALTQ
-options ALTQ_CBQ
-options ALTQ_RED
-options ALTQ_RIO
-options ALTQ_HFSC
-options ALTQ_PRIQ
-options ALTQ_NOPCC # Required for SMP builds !!
-
-
-# Bridging
-device if_bridge
-
-options MSGMNB=8192 # max # of bytes in a queue
-options MSGMNI=40 # number of message queue identifiers
-options MSGSEG=512 # number of message segments per queue
-options MSGSSZ=32 # size of a message segment
-options MSGTQL=2048 # max messages in system
-
-device tap
-device hme
-
-# Needed for FreeSBIE 2
-options NULLFS
-
-# Kbdmux
-device kbdmux
-
-device speaker
-
-options DEVICE_POLLING
-
-options ZERO_COPY_SOCKETS
-
-#device natpt
-
-device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet
-
-options TCP_SIGNATURE
-
-# To make an SMP kernel, the next two lines are needed
-options SMP # Symmetric MultiProcessor Kernel
-device apic # I/O APIC
-
-# Allow gmirror to function
-options GEOM_MIRROR
-options GEOM_MBR
-
-options PREEMPTION
-
-
diff --git a/config/archive/freenas/diffs/netatalk-2.0.3-afpd-zeroconf.patch b/config/archive/freenas/diffs/netatalk-2.0.3-afpd-zeroconf.patch
deleted file mode 100644
index 74ee8795..00000000
--- a/config/archive/freenas/diffs/netatalk-2.0.3-afpd-zeroconf.patch
+++ /dev/null
@@ -1,1386 +0,0 @@
-? etc/afpd/afp_avahi.c
-? etc/afpd/afp_avahi.c.org
-? etc/afpd/afp_avahi.h
-? etc/afpd/afp_avahi.h.org
-? etc/afpd/afp_bonjour.c
-? etc/afpd/afp_bonjour.c.org
-? etc/afpd/afp_bonjour.h
-? etc/afpd/afp_bonjour.h.org
-? etc/afpd/afp_howl.c
-? etc/afpd/afp_howl.c.org
-? etc/afpd/afp_howl.h
-? etc/afpd/afp_howl.h.org
-? etc/afpd/afp_zeroconf.c
-? etc/afpd/afp_zeroconf.c.org
-? etc/afpd/afp_zeroconf.h
-? etc/afpd/afp_zeroconf.h.org
-? macros/zeroconf.m4
-? macros/zeroconf.m4.org
-Index: configure.in
-===================================================================
-RCS file: /cvsroot/netatalk/netatalk/configure.in,v
-retrieving revision 1.203
-diff -u -r1.203 configure.in
---- configure.in 28 Apr 2005 20:49:17 -0000 1.203
-+++ configure.in 5 May 2006 10:46:30 -0000
-@@ -398,6 +398,9 @@
- dnl Check for optional server location protocol support (used by MacOS X)
- NETATALK_SRVLOC
-
-+dnl Check for optional Zeroconf support
-+NETATALK_ZEROCONF
-+
- dnl Check for PAM libs
- netatalk_cv_use_pam=no
- AC_PATH_PAM([
-Index: config/afpd.conf.tmpl
-===================================================================
-RCS file: /cvsroot/netatalk/netatalk/config/afpd.conf.tmpl,v
-retrieving revision 1.16
-diff -u -r1.16 afpd.conf.tmpl
---- config/afpd.conf.tmpl 28 Apr 2005 20:49:20 -0000 1.16
-+++ config/afpd.conf.tmpl 5 May 2006 10:46:31 -0000
-@@ -51,6 +51,8 @@
- # empty string.
- # -noslp Don't register this server with the Service
- # Location Protocol.
-+# -nozeroconf Don't register this server with the Multicats
-+# DNS Protocol.
- #
- #
- # Authentication Methods:
-Index: contrib/a2boot/Makefile.am
-===================================================================
-RCS file: /cvsroot/netatalk/netatalk/contrib/a2boot/Makefile.am,v
-retrieving revision 1.5
-diff -u -r1.5 Makefile.am
---- contrib/a2boot/Makefile.am 28 Apr 2005 20:49:21 -0000 1.5
-+++ contrib/a2boot/Makefile.am 5 May 2006 10:46:32 -0000
-@@ -10,7 +10,7 @@
- EXTRA_DIST = COPYRIGHT VERSION
-
- CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sys \
-- @CFLAGS@ @SLP_CFLAGS@ \
-+ @CFLAGS@ @SLP_CFLAGS@ @ZEROCONF_CFLAGS@ \
- -D_PATH_A_GS_BLOCKS=\"$(PKGCONFDIR)/a2boot/ProDOS16\ Boot\ Blocks\" \
- -D_PATH_A_2E_BLOCKS=\"$(PKGCONFDIR)/a2boot/Apple\ :2f:2fe\ Boot\ Blocks\" \
- -D_PATH_P16_IMAGE=\"$(PKGCONFDIR)/a2boot/ProDOS16\ Image\"
-Index: etc/afpd/Makefile.am
-===================================================================
-RCS file: /cvsroot/netatalk/netatalk/etc/afpd/Makefile.am,v
-retrieving revision 1.38
-diff -u -r1.38 Makefile.am
---- etc/afpd/Makefile.am 30 Apr 2005 21:33:41 -0000 1.38
-+++ etc/afpd/Makefile.am 5 May 2006 10:46:33 -0000
-@@ -8,19 +8,21 @@
- file.c enumerate.c desktop.c filedir.c fork.c appl.c gettok.c \
- mangle.c status.c afp_options.c afp_asp.c afp_dsi.c messages.c \
- afp_config.c nfsquota.c quota.c uam.c afs.c uid.c afp_util.c \
-- catsearch.c afprun.c
-+ catsearch.c afprun.c \
-+ afp_zeroconf.c afp_avahi.c afp_bonjour.c afp_howl.c
-
- afpd_LDADD = $(top_builddir)/libatalk/cnid/libcnid.la $(top_builddir)/libatalk/libatalk.la
- afpd_LDFLAGS = -export-dynamic
-
- noinst_HEADERS = auth.h afp_config.h desktop.h directory.h file.h \
- filedir.h fork.h globals.h icon.h mangle.h misc.h status.h switch.h \
-- uam_auth.h uid.h unix.h volume.h
-+ uam_auth.h uid.h unix.h volume.h \
-+ afp_zeroconf.h afp_avahi.h afp_bonjour.h afp_howl.h
-
--LIBS = @LIBS@ @PAM_LIBS@ @QUOTA_LIBS@ @SLP_LIBS@ @WRAP_LIBS@
-+LIBS = @LIBS@ @PAM_LIBS@ @QUOTA_LIBS@ @SLP_LIBS@ @ZEROCONF_LIBS@ @WRAP_LIBS@
-
- CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sys \
-- @CFLAGS@ @SLP_CFLAGS@ \
-+ @CFLAGS@ @SLP_CFLAGS@ @ZEROCONF_CFLAGS@ \
- -D_PATH_AFPDDEFVOL=\"$(pkgconfdir)/AppleVolumes.default\" \
- -D_PATH_AFPDSYSVOL=\"$(pkgconfdir)/AppleVolumes.system\" \
- -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" \
-Index: etc/afpd/afp_config.c
-===================================================================
-RCS file: /cvsroot/netatalk/netatalk/etc/afpd/afp_config.c,v
-retrieving revision 1.23
-diff -u -r1.23 afp_config.c
---- etc/afpd/afp_config.c 28 Apr 2005 20:49:39 -0000 1.23
-+++ etc/afpd/afp_config.c 5 May 2006 10:46:35 -0000
-@@ -50,6 +50,9 @@
- #ifdef USE_SRVLOC
- #include <slp.h>
- #endif /* USE_SRVLOC */
-+#ifdef USE_ZEROCONF
-+#include "afp_zeroconf.h"
-+#endif /* USE_ZEROCONF */
-
- #include "globals.h"
- #include "afp_config.h"
-@@ -154,9 +157,9 @@
- }
- #endif /* USE_SRVLOC */
-
--#ifdef USE_SRVLOC
- static void dsi_cleanup(const AFPConfig *config)
- {
-+#ifdef USE_SRVLOC
- SLPError err;
- SLPError callbackerr;
- SLPHandle hslp;
-@@ -189,8 +192,16 @@
- srvloc_dereg_err:
- dsi->srvloc_url[0] = '\0';
- SLPClose(hslp);
--}
-+#elif defined (USE_ZEROCONF)
-+ DSI *dsi = (DSI *)config->obj.handle;
-+
-+ /* Do nothing if we didn't register. */
-+ if (!dsi || dsi->zeroconf_registered == 0)
-+ return;
-+
-+ zeroconf_deregister();
- #endif /* USE_SRVLOC */
-+}
-
- #ifndef NO_DDP
- static void asp_cleanup(const AFPConfig *config)
-@@ -355,6 +366,10 @@
- struct servent *afpovertcp;
- int afp_port = 548;
- char *srvloc_hostname, *hostname;
-+#elif defined (USE_ZEROCONF)
-+ struct servent *afpovertcp;
-+ int afp_port = 548;
-+ char *hostname = NULL;
- #endif /* USE_SRVLOC */
-
- if ((config = (AFPConfig *) calloc(1, sizeof(AFPConfig))) == NULL) {
-@@ -449,6 +464,36 @@
- }
- #endif /* USE_SRVLOC */
-
-+#ifdef USE_ZEROCONF
-+ dsi->zeroconf_registered = 0; /* Mark that we haven't registered. */
-+
-+ if (!(options->flags & OPTION_NOZEROCONF)) {
-+ /* XXX We don't want to tack on the port number if we don't have to.
-+ * Why?
-+ * Well, this seems to break MacOS < 10. If the user _really_ wants to
-+ * use a non-default port, they can, but be aware, this server might
-+ * not show up int the Network Browser.
-+ */
-+ afpovertcp = getservbyname("afpovertcp", "tcp");
-+ if (afpovertcp != NULL) {
-+ afp_port = ntohs(afpovertcp->s_port);
-+ }
-+
-+ /* If specified use the FQDN to register with srvloc, otherwise use IP. */
-+ p = NULL;
-+ if (options->fqdn) {
-+ hostname = options->fqdn;
-+ p = strchr(hostname, ':');
-+ }
-+ else
-+ hostname = inet_ntoa(dsi->server.sin_addr);
-+
-+ if (!(options->flags & OPTION_NOSLP)) {
-+ zeroconf_register(afp_port, hostname);
-+ dsi->zeroconf_registered = 1; /* Mark that we have registered. */
-+ }
-+ }
-+#endif /* USE_ZEROCONF */
-
- config->fd = dsi->serversock;
- config->obj.handle = dsi;
-@@ -469,6 +514,9 @@
- #ifdef USE_SRVLOC
- config->server_cleanup = dsi_cleanup;
- #endif
-+#ifdef USE_ZEROCONF
-+ config->server_cleanup = dsi_cleanup;
-+#endif
- return config;
- }
-
-Index: etc/afpd/afp_options.c
-===================================================================
-RCS file: /cvsroot/netatalk/netatalk/etc/afpd/afp_options.c,v
-retrieving revision 1.35
-diff -u -r1.35 afp_options.c
---- etc/afpd/afp_options.c 28 Apr 2005 20:49:39 -0000 1.35
-+++ etc/afpd/afp_options.c 5 May 2006 10:46:39 -0000
-@@ -202,10 +202,15 @@
- /* parse toggles */
- if (strstr(buf, " -nodebug"))
- options->flags &= ~OPTION_DEBUG;
-+
- #ifdef USE_SRVLOC
- if (strstr(buf, " -noslp"))
- options->flags |= OPTION_NOSLP;
- #endif /* USE_SRVLOC */
-+#ifdef USE_ZEROCONF
-+ if (strstr(buf, " -nozeroconf"))
-+ options->flags |= OPTION_NOZEROCONF;
-+#endif
-
- if (strstr(buf, " -nouservolfirst"))
- options->flags &= ~OPTION_USERVOLFIRST;
-@@ -578,6 +583,12 @@
- puts( "No" );
- #endif
-
-+#ifdef USE_ZEROCONF
-+ puts( "Yes" );
-+#else
-+ puts( "No" );
-+#endif
-+
- printf( " TCP wrappers support:\t" );
- #ifdef TCPWRAP
- puts( "Yes" );
-Index: etc/afpd/globals.h
-===================================================================
-RCS file: /cvsroot/netatalk/netatalk/etc/afpd/globals.h,v
-retrieving revision 1.21
-diff -u -r1.21 globals.h
---- etc/afpd/globals.h 28 Apr 2005 20:49:43 -0000 1.21
-+++ etc/afpd/globals.h 5 May 2006 10:46:39 -0000
-@@ -40,6 +40,7 @@
- #define OPTION_CUSTOMICON (1 << 4)
- #define OPTION_NOSLP (1 << 5)
- #define OPTION_ANNOUNCESSH (1 << 6)
-+#define OPTION_NOZEROCONF (1 << 7)
-
- #ifdef FORCE_UIDGID
- /* set up a structure for this */
-Index: include/atalk/dsi.h
-===================================================================
-RCS file: /cvsroot/netatalk/netatalk/include/atalk/dsi.h,v
-retrieving revision 1.6
-diff -u -r1.6 dsi.h
---- include/atalk/dsi.h 3 May 2005 14:55:12 -0000 1.6
-+++ include/atalk/dsi.h 5 May 2006 10:46:41 -0000
-@@ -85,6 +85,10 @@
- char srvloc_url[512];
- #endif
-
-+#ifdef USE_ZEROCONF
-+ int zeroconf_registered;
-+#endif
-+
- /* buffer for OSX deadlock */
- int noblocking;
- char *buffer;
-Index: macros/summary.m4
-===================================================================
-RCS file: /cvsroot/netatalk/netatalk/macros/summary.m4,v
-retrieving revision 1.2
-diff -u -r1.2 summary.m4
---- macros/summary.m4 28 Apr 2005 20:50:05 -0000 1.2
-+++ macros/summary.m4 5 May 2006 10:46:46 -0000
-@@ -44,6 +44,7 @@
- AC_MSG_RESULT([ Options:])
- AC_MSG_RESULT([ CUPS support: $netatalk_cv_use_cups])
- AC_MSG_RESULT([ SLP support: $netatalk_cv_srvloc])
-+ AC_MSG_RESULT([ Zeroconf support: $netatalk_cv_zeroconf])
- AC_MSG_RESULT([ tcp wrapper support: $netatalk_cv_tcpwrap])
- dnl if test x"$netatalk_cv_linux_sendfile" != x; then
- dnl AC_MSG_RESULT([ Linux sendfile support: $netatalk_cv_linux_sendfile])
-Index: man/man5/afpd.conf.5.tmpl
-===================================================================
-RCS file: /cvsroot/netatalk/netatalk/man/man5/afpd.conf.5.tmpl,v
-retrieving revision 1.4
-diff -u -r1.4 afpd.conf.5.tmpl
---- man/man5/afpd.conf.5.tmpl 28 Apr 2005 20:50:06 -0000 1.4
-+++ man/man5/afpd.conf.5.tmpl 5 May 2006 10:46:48 -0000
-@@ -210,6 +210,9 @@
- Protocol (if SLP support was compiled in). This is useful if you are
- running multiple servers and want one to be hidden, perhaps because
- it is advertised elsewhere, ie. by a SLP Directory Agent.
-+\-noslp
-+Do not register this server using the Multicast DNS
-+Protocol (if Zeroconf support was compiled in).
- .SH "MISCELLANEOUS OPTIONS"
- .TP
- \-admingroup \fI[group]\fR
---- etc/afpd/afp_avahi.c.org 2006-04-21 10:29:22.000000000 +0200
-+++ etc/afpd/afp_avahi.c 2006-04-22 08:34:34.000000000 +0200
-@@ -0,0 +1,500 @@
-+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
-+/*
-+ * Author: Daniel S. Haischt <me@daniel.stefan.haischt.name>
-+ * Purpose: Avahi based Zeroconf support
-+ * Docs: http://avahi.org/download/doxygen/
-+ *
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#ifdef HAVE_AVAHI
-+
-+#include "afp_avahi.h"
-+
-+static void publish_reply(AvahiEntryGroup *g,
-+ AvahiEntryGroupState state,
-+ void *userdata);
-+
-+/*
-+ * This function tries to register the AFP DNS
-+ * SRV service type.
-+ */
-+static void register_stuff(struct context *ctx) {
-+ char r[128];
-+ int ret;
-+
-+ assert(ctx->client);
-+
-+ if (!ctx->group) {
-+
-+ if (!(ctx->group = avahi_entry_group_new(ctx->client,
-+ publish_reply,
-+ ctx))) {
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Failed to create entry group: %s\n",
-+ avahi_strerror(avahi_client_errno(ctx->client)));
-+ goto fail;
-+ }
-+
-+ }
-+
-+ LOG(log_info, logtype_afpd, "Adding service '%s'\n", ctx->name);
-+
-+ if (avahi_entry_group_is_empty(ctx->group)) {
-+ /* Register our service */
-+
-+ if (avahi_entry_group_add_service(ctx->group,
-+ AVAHI_IF_UNSPEC,
-+ AVAHI_PROTO_UNSPEC,
-+ 0,
-+ ctx->name,
-+ AFP_DNS_SERVICE_TYPE,
-+ NULL,
-+ NULL,
-+ ctx->port,
-+ NULL) < 0) {
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Failed to add service: %s\n",
-+ avahi_strerror(avahi_client_errno(ctx->client)));
-+ goto fail;
-+ }
-+
-+ if (avahi_entry_group_commit(ctx->group) < 0) {
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Failed to commit entry group: %s\n",
-+ avahi_strerror(avahi_client_errno(ctx->client)));
-+ goto fail;
-+ }
-+ }
-+
-+ return;
-+
-+ fail:
-+ avahi_client_free (ctx->client);
-+#ifndef HAVE_AVAHI_THREADED_POLL
-+ avahi_simple_poll_quit(ctx->simple_poll);
-+#else
-+ avahi_threaded_poll_quit(ctx->threaded_poll);
-+#endif
-+}
-+
-+/* Called when publishing of service data completes */
-+static void publish_reply(AvahiEntryGroup *g,
-+ AvahiEntryGroupState state,
-+ AVAHI_GCC_UNUSED void *userdata)
-+{
-+ struct context *ctx = userdata;
-+
-+ assert(g == ctx->group);
-+
-+ switch (state) {
-+
-+ case AVAHI_ENTRY_GROUP_ESTABLISHED :
-+ /* The entry group has been established successfully */
-+ break;
-+
-+ case AVAHI_ENTRY_GROUP_COLLISION: {
-+ char *n;
-+
-+ /* Pick a new name for our service */
-+
-+ n = avahi_alternative_service_name(ctx->name);
-+ assert(n);
-+
-+ avahi_free(ctx->name);
-+ ctx->name = n;
-+
-+ register_stuff(ctx);
-+ break;
-+ }
-+
-+ case AVAHI_ENTRY_GROUP_FAILURE: {
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Failed to register service: %s\n",
-+ avahi_strerror(avahi_client_errno(ctx->client)));
-+ avahi_client_free (avahi_entry_group_get_client(g));
-+#ifndef HAVE_AVAHI_THREADED_POLL
-+ avahi_simple_poll_quit(ctx->simple_poll);
-+#else
-+ avahi_threaded_poll_quit(ctx->threaded_poll);
-+#endif
-+ break;
-+ }
-+
-+ case AVAHI_ENTRY_GROUP_UNCOMMITED:
-+ case AVAHI_ENTRY_GROUP_REGISTERING:
-+ ;
-+ }
-+}
-+
-+static void client_callback(AvahiClient *client,
-+ AvahiClientState state,
-+ void *userdata)
-+{
-+ struct context *ctx = userdata;
-+
-+ ctx->client = client;
-+
-+ switch (state) {
-+
-+ case AVAHI_CLIENT_S_RUNNING:
-+
-+ /* The server has startup successfully and registered its host
-+ * name on the network, so it's time to create our services */
-+ if (!ctx->group)
-+ register_stuff(ctx);
-+ break;
-+
-+ case AVAHI_CLIENT_S_COLLISION:
-+
-+ if (ctx->group)
-+ avahi_entry_group_reset(ctx->group);
-+ break;
-+
-+ case AVAHI_CLIENT_FAILURE: {
-+
-+ if (avahi_client_errno(client) == AVAHI_ERR_DISCONNECTED) {
-+ int error;
-+
-+ avahi_client_free(ctx->client);
-+ ctx->client = NULL;
-+ ctx->group = NULL;
-+
-+ /* Reconnect to the server */
-+
-+#ifndef HAVE_AVAHI_THREADED_POLL
-+ if (!(ctx->client = avahi_client_new(avahi_simple_poll_get(ctx->simple_poll),
-+#else
-+ if (!(ctx->client = avahi_client_new(avahi_threaded_poll_get(ctx->threaded_poll),
-+#endif
-+ AVAHI_CLIENT_NO_FAIL,
-+ client_callback,
-+ ctx,
-+ &error))) {
-+
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Failed to contact server: %s\n",
-+ avahi_strerror(error));
-+
-+ avahi_client_free (ctx->client);
-+#ifndef HAVE_AVAHI_THREADED_POLL
-+ avahi_simple_poll_quit(ctx->simple_poll);
-+#else
-+ avahi_threaded_poll_quit(ctx->threaded_poll);
-+#endif
-+ }
-+
-+ } else {
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Client failure: %s\n",
-+ avahi_strerror(avahi_client_errno(client)));
-+
-+ avahi_client_free (ctx->client);
-+#ifndef HAVE_AVAHI_THREADED_POLL
-+ avahi_simple_poll_quit(ctx->simple_poll);
-+#else
-+ avahi_threaded_poll_quit(ctx->threaded_poll);
-+#endif
-+ }
-+
-+ break;
-+ }
-+
-+ case AVAHI_CLIENT_S_REGISTERING:
-+ case AVAHI_CLIENT_CONNECTING:
-+ ;
-+ }
-+}
-+
-+static void* thread(void *userdata) {
-+#ifndef HAVE_AVAHI_THREADED_POLL
-+ struct context *ctx = userdata;
-+ sigset_t mask;
-+ int r;
-+
-+ /* Make sure that signals are delivered to the main thread */
-+ sigfillset(&mask);
-+ pthread_sigmask(SIG_BLOCK, &mask, NULL);
-+
-+ pthread_mutex_lock(&ctx->mutex);
-+
-+ /* Run the main loop */
-+ LOG(log_info, logtype_afpd, "Starting avahi loop...");
-+ r = avahi_simple_poll_loop(ctx->simple_poll);
-+
-+ /* Cleanup some stuff */
-+ if (ctx->client)
-+ avahi_client_free(ctx->client);
-+ ctx->client = NULL;
-+ ctx->group = NULL;
-+
-+ pthread_mutex_unlock(&ctx->mutex);
-+#endif
-+ return NULL;
-+}
-+
-+static int poll_func(struct pollfd *ufds,
-+ unsigned int nfds,
-+ int timeout,
-+ void *userdata) {
-+#ifndef HAVE_AVAHI_THREADED_POLL
-+ pthread_mutex_t *mutex = userdata;
-+ int r;
-+
-+ /* Before entering poll() we unlock the mutex, so that
-+ * avahi_simple_poll_quit() can succeed from another thread. */
-+
-+ pthread_mutex_unlock(mutex);
-+ r = poll(ufds, nfds, timeout);
-+ pthread_mutex_lock(mutex);
-+
-+ return r;
-+#else
-+ return 0;
-+#endif
-+}
-+
-+/*
-+ * Tries to setup the Zeroconf thread and any
-+ * neccessary config setting.
-+ */
-+void* av_zeroconf_setup(unsigned long port, const char *name) {
-+ struct context *ctx = NULL;
-+
-+ /* default service name, if there's none in
-+ * the config file.
-+ */
-+ char service[256] = "AFP Server on ";
-+ int error, ret;
-+
-+ /* initialize the struct that holds our
-+ * config settings.
-+ */
-+ ctx = malloc(sizeof(struct context));
-+ assert(ctx);
-+ ctx->client = NULL;
-+ ctx->group = NULL;
-+#ifndef HAVE_AVAHI_THREADED_POLL
-+ ctx->simple_poll = NULL;
-+ pthread_mutex_init(&ctx->mutex, NULL);
-+#else
-+ ctx->threaded_poll = NULL;
-+#endif
-+ ctx->thread_running = 0;
-+
-+ LOG(log_info,
-+ logtype_afpd,
-+ "Setting port for Zeroconf service to: %i.\n",
-+ port);
-+ ctx->port = port;
-+
-+ /* Prepare service name */
-+ if (!name) {
-+ LOG(log_info,
-+ logtype_afpd,
-+ "Assigning default service name.\n");
-+ gethostname(service+14, sizeof(service)-15);
-+ service[sizeof(service)-1] = 0;
-+
-+ ctx->name = strdup(service);
-+ }
-+ else {
-+ ctx->name = strdup(name);
-+ }
-+
-+ assert(ctx->name);
-+
-+/* first of all we need to initialize our threading env */
-+#ifdef HAVE_AVAHI_THREADED_POLL
-+ if (!(ctx->threaded_poll = avahi_threaded_poll_new())) {
-+ goto fail;
-+ }
-+#else
-+ if (!(ctx->simple_poll = avahi_simple_poll_new())) {
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Failed to create event loop object.\n");
-+ goto fail;
-+ }
-+
-+ avahi_simple_poll_set_func(ctx->simple_poll, poll_func, &ctx->mutex);
-+#endif
-+
-+/* now we need to acquire a client */
-+#ifdef HAVE_AVAHI_THREADED_POLL
-+ if (!(ctx->client = avahi_client_new(avahi_threaded_poll_get(ctx->threaded_poll),
-+ AVAHI_CLIENT_NO_FAIL,
-+ client_callback,
-+ ctx,
-+ &error))) {
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Failed to create client object: %s\n",
-+ avahi_strerror(avahi_client_errno(ctx->client)));
-+ goto fail;
-+ }
-+#else
-+ if (!(ctx->client = avahi_client_new(avahi_simple_poll_get(ctx->simple_poll),
-+ AVAHI_CLIENT_NO_FAIL,
-+ client_callback,
-+ ctx,
-+ &error))) {
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Failed to create client object: %s\n",
-+ avahi_strerror(avahi_client_errno(ctx->client)));
-+ goto fail;
-+ }
-+#endif
-+
-+ return ctx;
-+
-+fail:
-+
-+ if (ctx)
-+ av_zeroconf_unregister(ctx);
-+
-+ return NULL;
-+}
-+
-+/*
-+ * This function finally runs the loop impl.
-+ */
-+int av_zeroconf_run(void *u) {
-+ struct context *ctx = u;
-+ int ret;
-+
-+#ifdef HAVE_AVAHI_THREADED_POLL
-+ /* Finally, start the event loop thread */
-+ if (avahi_threaded_poll_start(ctx->threaded_poll) < 0) {
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Failed to create thread: %s\n",
-+ avahi_strerror(avahi_client_errno(ctx->client)));
-+ goto fail;
-+ } else {
-+ LOG(log_info, logtype_afpd, "Successfully started avahi loop.\n");
-+ }
-+#else
-+ /* Create the mDNS event handler */
-+ if ((ret = pthread_create(&ctx->thread_id, NULL, thread, ctx)) < 0) {
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Failed to create thread: %s\n", strerror(ret));
-+ goto fail;
-+ } else {
-+ LOG(log_info, logtype_afpd, "Successfully started avahi loop.\n");
-+ }
-+#endif
-+
-+ ctx->thread_running = 1;
-+
-+ return 0;
-+
-+fail:
-+
-+ if (ctx)
-+ av_zeroconf_unregister(ctx);
-+
-+ return -1;
-+}
-+
-+/*
-+ * Used to lock access to the loop.
-+ * Currently unused.
-+ */
-+void av_zeroconf_lock(void *u) {
-+#ifdef HAVE_AVAHI_THREADED_POLL
-+ struct context *ctx = u;
-+
-+ avahi_threaded_poll_lock(ctx->threaded_poll);
-+#endif
-+}
-+
-+/*
-+ * Used to unlock access to the loop.
-+ * Currently unused.
-+ */
-+void av_zeroconf_unlock(void *u) {
-+#ifdef HAVE_AVAHI_THREADED_POLL
-+ struct context *ctx = u;
-+
-+ avahi_threaded_poll_unlock(ctx->threaded_poll);
-+#endif
-+}
-+
-+/*
-+ * Tries to shutdown this loop impl.
-+ * Call this function from outside this thread.
-+ */
-+void av_zeroconf_shutdown(void *u) {
-+ struct context *ctx = u;
-+
-+ /* Call this when the app shuts down */
-+#ifdef HAVE_AVAHI_THREADED_POLL
-+ avahi_threaded_poll_stop(ctx->threaded_poll);
-+ avahi_free(ctx->name);
-+ avahi_client_free(ctx->client);
-+ avahi_threaded_poll_free(ctx->threaded_poll);
-+#else
-+ av_zeroconf_unregister(ctx);
-+#endif
-+}
-+
-+/*
-+ * Tries to shutdown this loop impl.
-+ * Call this function from inside this thread.
-+ */
-+int av_zeroconf_unregister(void *u) {
-+ struct context *ctx = u;
-+
-+ if (ctx->thread_running) {
-+#ifndef HAVE_AVAHI_THREADED_POLL
-+ pthread_mutex_lock(&ctx->mutex);
-+ avahi_simple_poll_quit(ctx->simple_poll);
-+ pthread_mutex_unlock(&ctx->mutex);
-+
-+ pthread_join(ctx->thread_id, NULL);
-+#else
-+ /* First, block the event loop */
-+ avahi_threaded_poll_lock(ctx->threaded_poll);
-+
-+ /* Than, do your stuff */
-+ avahi_threaded_poll_quit(ctx->threaded_poll);
-+
-+ /* Finally, unblock the event loop */
-+ avahi_threaded_poll_unlock(ctx->threaded_poll);
-+#endif
-+ ctx->thread_running = 0;
-+ }
-+
-+ avahi_free(ctx->name);
-+
-+ if (ctx->client)
-+ avahi_client_free(ctx->client);
-+
-+#ifndef HAVE_AVAHI_THREADED_POLL
-+ if (ctx->simple_poll)
-+ avahi_simple_poll_free(ctx->simple_poll);
-+
-+ pthread_mutex_destroy(&ctx->mutex);
-+#else
-+ if (ctx->threaded_poll)
-+ avahi_threaded_poll_free(ctx->threaded_poll);
-+#endif
-+
-+ free(ctx);
-+
-+ return 0;
-+}
-+
-+#endif /* USE_AVAHI */
---- etc/afpd/afp_avahi.h.org 2006-04-21 10:29:23.000000000 +0200
-+++ etc/afpd/afp_avahi.h 2006-04-22 07:40:05.000000000 +0200
-@@ -0,0 +1,58 @@
-+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
-+/*
-+ * Author: Daniel S. Haischt <me@daniel.stefan.haischt.name>
-+ * Purpose: Avahi based Zeroconf support
-+ * Docs: http://avahi.org/download/doxygen/
-+ *
-+ */
-+
-+#ifndef AFPD_AVAHI_H
-+#define AFPD_AVAHI_H
-+
-+#include <stdlib.h>
-+#include <assert.h>
-+#include <string.h>
-+
-+#include <avahi-client/client.h>
-+#include <avahi-client/publish.h>
-+
-+#include <avahi-common/alternative.h>
-+
-+#ifndef HAVE_AVAHI_THREADED_POLL
-+#include <avahi-common/simple-watch.h>
-+#include <signal.h> /* SIG_BLOCK */
-+#else
-+#include <avahi-common/thread-watch.h>
-+#endif
-+
-+#include <avahi-common/malloc.h>
-+#include <avahi-common/error.h>
-+
-+#include <atalk/logger.h>
-+
-+#define AFP_DNS_SERVICE_TYPE "_afpovertcp._tcp"
-+
-+struct context {
-+ int thread_running;
-+ pthread_t thread_id;
-+ pthread_mutex_t mutex;
-+ char *name;
-+#ifndef HAVE_AVAHI_THREADED_POLL
-+ AvahiSimplePoll *simple_poll;
-+#else
-+ AvahiThreadedPoll *threaded_poll;
-+#endif
-+ AvahiClient *client;
-+ AvahiEntryGroup *group;
-+ unsigned long port;
-+};
-+
-+/* prototype definitions */
-+void* av_zeroconf_setup(unsigned long, const char *);
-+int av_zeroconf_run(void*);
-+int av_zeroconf_unregister(void*);
-+void av_zeroconf_shutdown(void*);
-+void av_zeroconf_lock(void *);
-+void av_zeroconf_unlock(void *);
-+
-+#endif /* AFPD_AVAHI_H */
---- etc/afpd/afp_bonjour.h.org 2006-04-21 10:29:30.000000000 +0200
-+++ etc/afpd/afp_bonjour.h 2006-04-21 07:37:05.000000000 +0200
-@@ -0,0 +1,27 @@
-+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
-+/*
-+ * Author: Daniel S. Haischt <me@daniel.stefan.haischt.name>
-+ * Purpose: Bonjour based Zeroconf support
-+ * Docs: http://developer.apple.com/documentation/Networking/Reference/DNSServiceDiscovery_CRef/dns_sd/
-+ *
-+ */
-+
-+#ifndef AFPD_BONJOUR_H
-+#define AFPD_BONJOUR_H
-+
-+#include <stdlib.h>
-+#include <assert.h>
-+#include <string.h>
-+
-+#include <dns_sd.h> /* DNSServiceRegister(), DNSServiceDiscoveryDeallocate() */
-+
-+#include <atalk/logger.h>
-+
-+#define AFP_DNS_SERVICE_TYPE "_afpovertcp._tcp"
-+
-+/* prototype definitions */
-+void* bo_zeroconf_setup(unsigned long, const char *);
-+int bo_zeroconf_unregister(void);
-+int bo_zeroconf_run(void);
-+
-+#endif /* AFPD_BONJOUR_H */
---- etc/afpd/afp_bonjour.c.org 2006-04-21 10:29:28.000000000 +0200
-+++ etc/afpd/afp_bonjour.c 2006-04-21 09:45:13.000000000 +0200
-@@ -0,0 +1,112 @@
-+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
-+/*
-+ * Author: Daniel S. Haischt <me@daniel.stefan.haischt.name>
-+ * Purpose: Bonjour based Zeroconf support
-+ * Docs: http://developer.apple.com/documentation/Networking/Reference/DNSServiceDiscovery_CRef/dns_sd/
-+ *
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#ifdef HAVE_BONJOUR
-+
-+#include "afp_bonjour.h"
-+
-+DNSServiceRef publish_session = NULL;
-+
-+static void DNSSD_API
-+publish_reply(DNSServiceRef,
-+ const DNSServiceFlags,
-+ DNSServiceErrorType,
-+ const char *,
-+ const char *,
-+ const char *,
-+ void *);
-+
-+static void DNSSD_API
-+publish_reply (DNSServiceRef sdRef,
-+ const DNSServiceFlags flags,
-+ DNSServiceErrorType errorCode,
-+ const char *name,
-+ const char *regtype,
-+ const char *domain,
-+ void *context)
-+{
-+}
-+
-+void* bo_zeroconf_setup(unsigned long port, const char *name) {
-+ DNSServiceErrorType err;
-+ char service[256] = "AFP Server on ";
-+
-+ /* Prepare service name */
-+ if (!name) {
-+ LOG(log_info, logtype_afpd,, "Assigning default service name.\n");
-+ gethostname(service+14, sizeof(service)-15);
-+ service[sizeof(service)-1] = 0;
-+
-+ name = strdup(service);
-+ }
-+
-+ assert(name);
-+ assert(port);
-+
-+ err = DNSServiceRegister (&publish_session,
-+ 0, /* flags */
-+ 0, /* interface; 0 for all */
-+ name, /* name */
-+ AFP_DNS_SERVICE_TYPE, /* type */
-+ NULL, /* domain */
-+ NULL, /* hostname */
-+ htons (port), /* port in network byte order */
-+ 0, /* text record length */
-+ NULL, /* text record */
-+ publish_reply, /* callback */
-+ NULL); /* context */
-+
-+ if (err == kDNSServiceErr_NoError) {
-+ LOG(log_info, logtype_afpd, "Adding service '%s'\n", name);
-+ } else {
-+ LOG(log_error, logtype_afpd, "Adding service '%s' failed\n", name);
-+ bo_zeroconf_unregister();
-+ }
-+}
-+
-+int bo_zeroconf_run(void) {
-+ fd_set set;
-+ int fd;
-+ struct timeval timeout;
-+
-+ /* Initialize the file descriptor set. */
-+ FD_ZERO (&set);
-+ FD_SET (fd, &set);
-+
-+ /* Initialize the timeout data structure. */
-+ /* TODO: Should the value for sec be configurable? */
-+ timeout.tv_sec = 10;
-+ timeout.tv_usec = 0;
-+
-+ if (publish_session != NULL) {
-+ fd = DNSServiceRefSockFD(publish_session);
-+
-+ if (select(FD_SETSIZE,
-+ &set, NULL, NULL,
-+ &timeout) > 0) {
-+ DNSServiceProcessResult(publish_session);
-+ }
-+ }
-+
-+ return 0;
-+}
-+
-+int bo_zeroconf_unregister(void) {
-+ if (publish_session != NULL) {
-+ DNSServiceRefDeallocate(publish_session);
-+ publish_session = NULL;
-+ }
-+
-+ return 0;
-+}
-+
-+#endif /* HAVE_BONJOUR */
---- etc/afpd/afp_howl.c.org 2006-04-21 10:29:34.000000000 +0200
-+++ etc/afpd/afp_howl.c 2006-04-21 09:46:11.000000000 +0200
-@@ -0,0 +1,92 @@
-+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
-+/*
-+ * Author: Daniel S. Haischt <me@daniel.stefan.haischt.name>
-+ * Purpose: Howl based Zeroconf support
-+ * Doc: http://www.porchdogsoft.com/products/howl/docs/
-+ *
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#ifdef HAVE_HOWL
-+
-+#include "afp_howl.h"
-+
-+sw_discovery discovery = NULL;
-+
-+static sw_result HOWL_API publish_reply(sw_discovery,
-+ sw_discovery_oid,
-+ sw_discovery_publish_status,
-+ sw_opaque);
-+
-+static sw_result HOWL_API publish_reply(sw_discovery discovery,
-+ sw_discovery_oid oid,
-+ sw_discovery_publish_status status,
-+ sw_opaque extra) {
-+ static sw_string
-+ status_text[] =
-+ {
-+ "Started",
-+ "Stopped",
-+ "Name Collision",
-+ "Invalid"
-+ };
-+
-+ LOG(log_info, logtype_afpd, "publish reply: %s\n", status_text[status]);
-+ return SW_OKAY;
-+}
-+
-+void* ho_zeroconf_setup(unsigned long port, const char *name) {
-+ sw_result result;
-+ sw_discovery_publish_id id;
-+ char service[256] = "AFP Server on ";
-+
-+ if (sw_discovery_init (&discovery) != SW_OKAY) {
-+ LOG(log_error,
-+ logtype_afpd,
-+ "AFPD could not be started. \nTry running mDNSResponder.");
-+ return;
-+ }
-+
-+ /* Prepare service name */
-+ if (!name) {
-+ LOG(log_info, logtype_afpd, "Assigning default service name.\n");
-+ gethostname(service+14, sizeof(service)-15);
-+ service[sizeof(service)-1] = 0;
-+
-+ name = strdup(service);
-+ }
-+
-+ assert(name);
-+
-+ if (!(result = sw_discovery_publish (discovery,
-+ 0,
-+ name,
-+ AFP_DNS_SERVICE_TYPE,
-+ NULL,
-+ NULL,
-+ port,
-+ NULL,
-+ 0,
-+ publish_reply,
-+ NULL,
-+ &id)) != SW_OKAY) {
-+ LOG(log_info, logtype_afpd, "Adding service '%s'\n", name);
-+ } else {
-+ LOG(log_error, logtype_afpd, "Adding service '%s' failed\n", name);
-+ ho_zeroconf_unregister();
-+ }
-+}
-+
-+void* ho_zeroconf_run(void) {
-+ sw_discovery_run(discovery);
-+}
-+
-+void* ho_zeroconf_unregister(void) {
-+ sw_discovery_stop_run(discovery);
-+ sw_discovery_fina(discovery);
-+}
-+
-+#endif /* USE_HOWL */
---- etc/afpd/afp_howl.h.org 2006-04-21 10:29:33.000000000 +0200
-+++ etc/afpd/afp_howl.h 2006-04-21 07:37:11.000000000 +0200
-@@ -0,0 +1,27 @@
-+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
-+/*
-+ * Author: Daniel S. Haischt <me@daniel.stefan.haischt.name>
-+ * Purpose: Howl based Zeroconf support
-+ * Doc: http://www.porchdogsoft.com/products/howl/docs/
-+ *
-+ */
-+
-+#ifndef AFPD_HOWL_H
-+#define AFPD_HOWL_H
-+
-+#include <stdlib.h>
-+#include <assert.h>
-+#include <string.h>
-+
-+#include <howl.h>
-+
-+#include <atalk/logger.h>
-+
-+#define NTP_DNS_SERVICE_TYPE "_afpovertcp._tcp"
-+
-+/* prototype definitions */
-+void* ho_zeroconf_setup(unsigned long, const char *);
-+void* ho_zeroconf_unregister(void);
-+void* ho_zeroconf_run(void);
-+
-+#endif /* AFPD_HOWL_H */
---- etc/afpd/afp_zeroconf.h.org 2006-04-21 10:29:39.000000000 +0200
-+++ etc/afpd/afp_zeroconf.h 2006-04-21 11:39:20.000000000 +0200
-@@ -0,0 +1,40 @@
-+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
-+/*
-+ * Author: Daniel S. Haischt <me@daniel.stefan.haischt.name>
-+ * Purpose: Zeroconf facade, that abstracts access to a
-+ * particular Zeroconf implementation
-+ * Doc: http://www.dns-sd.org/
-+ *
-+ */
-+
-+#ifndef AFPD_ZEROCONF_H
-+#define AFPD_ZEROCONF_H
-+
-+#include <netinet/in.h> /* htons() */
-+#include <atalk/logger.h>
-+
-+# ifdef HAVE_BONJOUR
-+# include "afp_bonjour.h"
-+# elif defined (HAVE_HOWL)
-+# include "afp_howl.h"
-+# elif defined (HAVE_AVAHI)
-+# include "afp_avahi.h"
-+# endif
-+
-+#define AFP_PORT 548
-+
-+/*
-+ * Prototype Definitions
-+ */
-+
-+/*
-+ * registers the ntpd service with a particular Zerconf implemenation.
-+ */
-+void zeroconf_register(int port, char *hostname);
-+
-+/*
-+ * de-registers the ntpd service with a particular Zerconf implemenation.
-+ */
-+void zeroconf_deregister(void);
-+
-+#endif AFPD_ZEROCONF_H
---- etc/afpd/afp_zeroconf.c.org 2006-04-21 10:29:38.000000000 +0200
-+++ etc/afpd/afp_zeroconf.c 2006-04-21 13:12:38.000000000 +0200
-@@ -0,0 +1,97 @@
-+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
-+/*
-+ * Author: Daniel S. Haischt <me@daniel.stefan.haischt.name>
-+ * Purpose: Zeroconf facade, that abstracts access to a
-+ * particular Zeroconf implementation
-+ * Doc: http://www.dns-sd.org/
-+ *
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "afp_zeroconf.h"
-+
-+/*
-+ * Global Definitions
-+ */
-+#ifdef HAVE_AVAHI
-+struct context *ctx = NULL;
-+#endif
-+
-+/*
-+ * Functions (actually they are just facades)
-+ */
-+void zeroconf_register(int port, char *hostname)
-+{
-+#ifdef HAVE_BONJOUR
-+ LOG(log_info,
-+ logtype_afpd,
-+ "Attempting to register with mDNS using Apple's Bonjour\n");
-+ if (hostname && strlen(hostname) > 0 && port)
-+ {
-+ bo_zeroconf_setup(port, hostname);
-+ }
-+ else if (hostname && strlen(hostname) > 0)
-+ {
-+ bo_zeroconf_setup(AFP_PORT, hostname);
-+ }
-+ else
-+ {
-+ bo_zeroconf_setup(AFP_PORT, NULL);
-+ }
-+ bo_zeroconf_run();
-+#elif defined (HAVE_HOWL)
-+ LOG(log_info,
-+ logtype_afpd,
-+ "Attempting to register with mDNS using Porchdog's Howl\n");
-+ if (hostname && strlen(hostname) > 0 && port)
-+ {
-+ ho_zeroconf_setup(port, hostname);
-+ }
-+ else if (hostname && strlen(hostname) > 0)
-+ {
-+ ho_zeroconf_setup(AFP_PORT, hostname);
-+ }
-+ else
-+ {
-+ ho_zeroconf_setup(AFP_PORT, NULL);
-+ }
-+ bo_zeroconf_run();
-+#elif defined (HAVE_AVAHI)
-+ LOG(log_info, logtype_afpd, "Attempting to register with mDNS using Avahi\n");
-+ if (hostname && strlen(hostname) > 0 && port)
-+ {
-+ ctx = av_zeroconf_setup(port, hostname);
-+ }
-+ else if (hostname && strlen(hostname) > 0)
-+ {
-+ ctx = av_zeroconf_setup(AFP_PORT, hostname);
-+ }
-+ else
-+ {
-+ ctx = av_zeroconf_setup(AFP_PORT, NULL);
-+ }
-+ av_zeroconf_run(ctx);
-+#endif
-+}
-+
-+void zeroconf_deregister(void)
-+{
-+#ifdef HAVE_BONJOUR
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Attempting to de-register mDNS using Apple's Bonjour\n");
-+ bo_zeroconf_unregister();
-+#elif defined (HAVE_HOWL)
-+ LOG(log_error,
-+ logtype_afpd,
-+ "Attempting to de-register mDNS using Porchdog's Howl\n");
-+ ho_zeroconf_unregister();
-+#elif defined (HAVE_AVAHI)
-+ LOG(log_error, logtype_afpd, "Attempting to de-register mDNS using Avahi\n");
-+ if (ctx)
-+ av_zeroconf_shutdown(ctx);
-+#endif
-+}
---- macros/zeroconf.m4.org 2006-04-21 10:29:51.000000000 +0200
-+++ macros/zeroconf.m4 2006-04-22 07:26:56.000000000 +0200
-@@ -0,0 +1,101 @@
-+dnl Check for optional Zeroconf support
-+
-+dnl $Id$
-+
-+AC_DEFUN([NETATALK_ZEROCONF], [
-+
-+ ZEROCONF_LIBS=""
-+ ZEROCONF_CFLAGS=""
-+ found_zeroconf=no
-+ zeroconf_dir=""
-+
-+ AC_ARG_ENABLE(zeroconf,
-+ [ --enable-zeroconf[[=DIR]] enable Zeroconf support [[auto]]],
-+ [zeroconf=$enableval],
-+ [zeroconf=try]
-+ )
-+
-+ dnl make sure atalk_libname is defined beforehand
-+ [[ -n "$atalk_libname" ]] || AC_MSG_ERROR([internal error, atalk_libname undefined])
-+
-+ if test "x$zeroconf" != "xno"; then
-+
-+ savedcppflags="$CPPFLAGS"
-+ savedldflags="$LDFLAGS"
-+
-+ if test "x$zeroconf" = "xyes" -o "x$zeroconf" = "xtry"; then
-+ zeroconf_dir="/usr"
-+ else
-+ zeroconf_dir="$zeroconf"
-+ fi
-+
-+ # mDNS support using Apple's Bonjour
-+ AC_CHECK_HEADER(dns_sd.h,
-+ [AC_CHECK_LIB(dns_sd,
-+ DNSServiceRegister,
-+ [AC_DEFINE(USE_ZEROCONF, 1,
-+ [Use DNS-SD registration])])])
-+ case "$ac_cv_lib_dns_sd_DNSServiceRegister" in
-+ yes)
-+ ZEROCONF_LIBS="-L$zeroconf_dir/lib -ldns_sd"
-+ ZEROCONF_LIBS="-I$zeroconf_dir/include"
-+ AC_DEFINE(HAVE_BONJOUR, 1, [Use Bonjour/DNS-SD registration])
-+ found_zeroconf=yes
-+ ;;
-+ esac
-+ # mDNS support using Porchdog's Howl
-+ AC_CHECK_HEADER(howl.h,
-+ [AC_CHECK_LIB(howl,
-+ sw_discovery_publish,
-+ [AC_DEFINE(USE_ZEROCONF, 1,
-+ [Use DNS-SD registration])])])
-+ case "$ac_cv_lib_howl_sw_discovery_publish" in
-+ yes)
-+ PKG_CHECK_MODULES(HOWL, [ howl >= 1.0.0 ])
-+ ZEROCONF_LIBS="$HOWL_LIBS"
-+ ZEROCONF_CFLAGS="$HOWL_CFLAGS"
-+ AC_DEFINE(HAVE_HOWL, 1, [Use Howl/DNS-SD registration])
-+ found_zeroconf=yes
-+ ;;
-+ esac
-+ # mDNS support using Avahi
-+ AC_CHECK_HEADER(avahi-client/client.h,
-+ [AC_CHECK_LIB(avahi-client,
-+ avahi_client_new,
-+ [AC_DEFINE(USE_ZEROCONF, 1,
-+ [Use DNS-SD registration])])])
-+ case "$ac_cv_lib_avahi_client_avahi_client_new" in
-+ yes)
-+ PKG_CHECK_MODULES(AVAHI, [ avahi-client >= 0.6 ])
-+ PKG_CHECK_MODULES(AVAHI_TPOLL, [ avahi-client >= 0.6.4 ],
-+ [AC_DEFINE(HAVE_AVAHI_THREADED_POLL, 1, [Uses Avahis threaded poll implementation])],
-+ [AC_MSG_WARN(This Avahi implementation is not supporting threaded poll objects. Maybe this is not what you want.)])
-+ ZEROCONF_LIBS="$AVAHI_LIBS"
-+ ZEROCONF_CFLAGS="$AVAHI_CFLAGS"
-+ AC_DEFINE(HAVE_AVAHI, 1, [Use Avahi/DNS-SD registration])
-+ found_zeroconf=yes
-+ ;;
-+ esac
-+
-+ CPPFLAGS="$savedcppflags"
-+ LDFLAGS="$savedldflags"
-+ fi
-+
-+ netatalk_cv_zeroconf=no
-+ AC_MSG_CHECKING([whether to enable Zerconf support])
-+ if test "x$found_zeroconf" = "xyes"; then
-+ AC_MSG_RESULT([yes])
-+ AC_DEFINE(USE_ZEROCONF, 1, [Define to enable Zeroconf support])
-+ netatalk_cv_zeroconf=yes
-+ else
-+ AC_MSG_RESULT([no])
-+ if test "x$zeroconf" != "xno" -a "x$zeroconf" != "xtry"; then
-+ AC_MSG_ERROR([Zeroconf installation not found])
-+ fi
-+ fi
-+
-+ LIB_REMOVE_USR_LIB(ZEROCONF_LIBS)
-+ CFLAGS_REMOVE_USR_INCLUDE(ZEROCONF_CFLAGS)
-+ AC_SUBST(ZEROCONF_LIBS)
-+ AC_SUBST(ZEROCONF_CFLAGS)
-+])
diff --git a/config/archive/freenas/doc/README.txt b/config/archive/freenas/doc/README.txt
deleted file mode 100644
index 8183022f..00000000
--- a/config/archive/freenas/doc/README.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-FreeNAS Port for pfSense
-=~=~=~=~=~=~=~=~=~=~=~=~
-
-This is a port of the FreeNAS PHP sources to pfSense.
-It is based on FreeNAS 0.68 and was tested on pfSense
-HEAD.
-
-*** NOTES ***
-
-You should be aware that this package installes a custom
-kernel and some additional kernel modules.
-
-YOU NEED TO REBOOT YOUR pfSense SYSTEM AFTER HAVING INSTALLED
-THIS PACKAGE!!!
-
-Additionally, if you are going to enable the FTP service, you
-need to disable the FTP helper on each interface.
-
-Maintainer:
------------
-
-Daniel S. Haischt <me@daniel.stefan.haischt.name>
-
-Dependencies:
--------------
-
-* ataidle-0.9
-* avahi+libdns-0.6.12
-* pkgconfig-0.20
-* perl-5.8.8
-* libiconv-1.9.2_2
-* libxml2-2.6.26
-* libdaemon-0.10_1
-* gettext-0.14.5_2
-* glib-2.10.3
-* expat-2.0.0_1
-* dbus-0.62
-* wzdftpd-0.7.2_1
-* e2fsprogs-1.39_1
-* smartmontools-5.36
-* aaccli-1.0
-* rsync-2.6.8_2
-* scponly-4.6_1
-* unison-2.13.16_1
-* cracklib-2.7_2
-* samba-3.0.23,1
-* db44-4.4.20.2
-* popt-1.7_1
-* cyrus-sasl-2.1.22
-* openldap-sasl-client-2.3.24
-* netatalk-2.0.3_3,1
-* pam_ldap-1.8.2 \ No newline at end of file
diff --git a/config/archive/freenas/pkg/freenas.inc b/config/archive/freenas/pkg/freenas.inc
deleted file mode 100644
index b87ebfe6..00000000
--- a/config/archive/freenas/pkg/freenas.inc
+++ /dev/null
@@ -1,297 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- freenas.inc
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-require_once("freenas_config.inc");
-
-function sync_package_freenas() {
-}
-
-function oninstall_copy_kernel_binaries($action = "install") {
- $binaries = array();
- $binaries[] = array("source" => "/usr/local/pkg/iscsi_initiator.ko",
- "target" => "/boot/kernel/iscsi_initiator.ko",
- "backup" => false);
- $binaries[] = array("source" => "/usr/local/pkg/ext2fs.ko",
- "target" => "/boot/kernel/ext2fs.ko",
- "backup" => false);
- $binaries[] = array("source" => "/usr/local/pkg/geom_concat.ko",
- "target" => "/boot/kernel/geom_concat.ko",
- "backup" => false);
- $binaries[] = array("source" => "/usr/local/pkg/geom_gpt.ko",
- "target" => "/boot/kernel/geom_gpt.ko",
- "backup" => false);
- $binaries[] = array("source" => "/usr/local/pkg/geom_mirror.ko",
- "target" => "/boot/kernel/geom_mirror.ko",
- "backup" => false);
- $binaries[] = array("source" => "/usr/local/pkg/geom_stripe.ko",
- "target" => "/boot/kernel/geom_stripe.ko",
- "backup" => false);
- $binaries[] = array("source" => "/usr/local/pkg/geom_vinum.ko",
- "target" => "/boot/kernel/geom_vinum.ko",
- "backup" => false);
- $binaries[] = array("source" => "/usr/local/pkg/ntfs.ko",
- "target" => "/boot/kernel/ntfs.ko",
- "backup" => false);
- $binaries[] = array("source" => "/usr/local/pkg/kernel.gz",
- "target" => "/boot/kernel/kernel.gz",
- "backup" => true);
-
- if ($action == "install") {
- while (list(, $val) = each($binaries)) {
- $static_output .= "FreeNAS: Moving binary file... ";
- update_output_window($static_output);
- if ($val['backup'] && file_exists($val['target']))
- rename($val['target'], "{$val['target']}.org");
- rename($val['source'], $val['target']);
- $static_output .= "done.\n";
- update_output_window($static_output);
- }
- } else if ($action == "deinstall") {
- while (list($source, $target) = each($binaries)) {
- $static_output .= "FreeNAS: Removing binary file... ";
- update_output_window($static_output);
- unlink($target);
- $static_output .= "done.\n";
- update_output_window($static_output);
- }
- }
-}
-
-function remove_package_contents($pkg = "") {
- if ($pkg == "") { return; }
-
- $pd = popen("pkg_info -rf {$pkg}", "r");
-
- if (! pd) { return; }
-
- while (! feof($pd)) {
- $buffer = fgets($pd, 4096);
-
- if (strpos($buffer, "File:") !== false) {
- $file = trim(str_replace("File:", "", $buffer));
-
- if (strpos($file, "man/") !== false) {
- unlink_if_exists("/usr/local/{$file}");
- } else if (strpos($file, "share/doc/") !== false) {
- unlink_if_exists("/usr/local/{$file}");
- } else if (strpos($file, "share/aclocal/") !== false) {
- unlink_if_exists("/usr/local/{$file}");
- } else if (strpos($file, "include/") !== false) {
- unlink_if_exists("/usr/local/{$file}");
- } else if (strpos($file, "libdata/pkgconfig/") !== false) {
- unlink_if_exists("/usr/local/{$file}");
- } else if (strpos($file, "info/") !== false) {
- unlink_if_exists("/usr/local/{$file}");
- } else if (strpos($file, "etc/rc.d/") !== false) {
- unlink_if_exists("/usr/local/{$file}");
- } else if (strpos($file, "etc/") !== false) {
- if (strpos($file, ".dist") !== false ||
- strpos($file, ".sample") !== false ||
- strpos($file, ".example") !== false ||
- strpos($file, ".default") !== false ||
- strpos($file, ".sh") !== false) {
- unlink_if_exists("/usr/local/{$file}");
- }
- } else if (strpos($file, "share/examples/") !== false) {
- unlink_if_exists("/usr/local/{$file}");
- }
-
- /* What about locales? */
- /*
- } else if (strpos($file, "share/local/") !== false) {
- unlink_if_exists("/usr/local/{$file}");
- }
- */
- }
- }
-
- fclose ($pd);
-}
-
-function adjust_package_contents() {
- remove_package_contents("avahi+libdns-0.6.12");
- remove_package_contents("ataidle-0.9");
- remove_package_contents("perl-5.8.8");
- remove_package_contents("libiconv-1.9.2_2");
- remove_package_contents("libxml2-2.6.26");
- remove_package_contents("gettext-0.14.5_2");
- remove_package_contents("glib-2.10.3");
- remove_package_contents("expat-2.0.0_1");
- remove_package_contents("wzdftpd-0.7.2_1");
- remove_package_contents("e2fsprogs-1.39_1");
- remove_package_contents("smartmontools-5.36");
- remove_package_contents("aaccli-1.0");
- remove_package_contents("rsync-2.6.8_2");
- remove_package_contents("scponly-4.6_1");
- remove_package_contents("cracklib-2.7_2");
- remove_package_contents("samba-3.0.23,1");
- remove_package_contents("netatalk-2.0.3_3,1");
- remove_package_contents("pam_ldap-1.8.2");
-}
-
-function oninstall_copy_misc_binaries($action = "install") {
- $binaries = array();
- $binaries[] = array("source" => "/usr/local/pkg/iscontrol",
- "target" => "/usr/local/sbin/iscontrol");
- $binaries[] = array("source" => "/usr/local/pkg/nfsd",
- "target" => "/usr/sbin/nfsd");
- $binaries[] = array("source" => "/usr/local/pkg/nfsd",
- "target" => "/usr/sbin/mountd");
- $binaries[] = array("source" => "/usr/local/pkg/rpcbind",
- "target" => "/usr/sbin/rpcbind");
- $binaries[] = array("source" => "/usr/local/pkg/rpc.lockd",
- "target" => "/usr/sbin/rpc.lockd");
- $binaries[] = array("source" => "/usr/local/pkg/rpc.lockd",
- "target" => "/usr/sbin/rpc.lockd");
-
- if ($action == "install") {
- while (list(, $val) = each($binaries)) {
- $static_output .= "FreeNAS: Installing binary file... ";
- update_output_window($static_output);
- mwexec("install -s {$source} ${target}");
- $static_output .= "done.\n";
- update_output_window($static_output);
- }
- } else if ($action == "deinstall") {
- while (list($val['source'], $val['target']) = each($binaries)) {
- $static_output .= "FreeNAS: Removing binary file... ";
- update_output_window($static_output);
- unlink($target);
- $static_output .= "done.\n";
- update_output_window($static_output);
- }
- }
-}
-
-function oninstall_setup_config() {
- global $config;
-
- $config['system']['zeroconf_disable'] = "yes";
-
- $freenas_config =& $config['installedpackages']['freenas']['config'][0];
-
- if (!is_array($freenas_config['disks']))
- $freenas_config['disks'] = array();
- if (!is_array($freenas_config['mounts']))
- $freenas_config['mounts'] = array();
-
- if (!is_array($freenas_config['samba']))
- $freenas_config['samba'] = array();
- $freenas_config['samba']['netbiosname'] = "freenas";
- $freenas_config['samba']['workgroup'] = "WORKGROUP";
- $freenas_config['samba']['serverdesc'] = "pfSense Server";
- $freenas_config['samba']['security'] = "share";
- $freenas_config['samba']['localmaster'] = "yes";
-
- if (!is_array($freenas_config['ftp']))
- $freenas_config['ftp'] = array();
- $freenas_config['ftp']['numberclients'] = "5";
- $freenas_config['ftp']['maxconperip'] = "2";
- $freenas_config['ftp']['timeout'] = "300";
- $freenas_config['ftp']['port'] = "21";
- $freenas_config['ftp']['anonymous'] = "yes";
- $freenas_config['ftp']['pasv_max_port'] = "0";
- $freenas_config['ftp']['pasv_min_port'] = "0";
-
- if (!is_array($freenas_config['afp']))
- $freenas_config['afp'] = array();
-
- if (!is_array($freenas_config['rsyncd']))
- $freenas_config['rsyncd'] = array();
- $freenas_config['rsyncd']['readonly'] = "no";
- $freenas_config['rsyncd']['port'] = "873";
-
- if (!is_array($freenas_config['nfs']))
- $freenas_config['nfs'] = array();
-}
-
-function custom_php_install_command() {
- global $g;
-
- oninstall_copy_kernel_binaries();
- oninstall_copy_misc_binaries();
- adjust_package_contents();
- oninstall_setup_config();
-
- if (! file_exists("/usr/local/etc/rc.d"))
- mwexec("mkdir -p /usr/local/etc/rc.d");
-
- if (! file_exists("{$g['varrun_path']}/dbus"))
- mkdir("{$g['varrun_path']}/dbus");
-
- if (! file_exists("{$g['varrun_path']}/avahi-daemon"))
- mkdir("{$g['varrun_path']}/avahi-daemon");
-
- rename("/usr/local/pkg/rc.freenas", "/usr/local/etc/rc.d/freenas.sh");
- chmod ("/usr/local/etc/rc.d/freenas.sh", 0755);
-
- mwexec("ln -s /usr/local/etc/uams/uams_passwd.so /usr/local/etc/uams/uams_clrtxt.so");
- mwexec("ln -s /usr/local/etc/uams/uams_dhx_passwd.so /usr/local/etc/uams/uams_dhx.so");
- /* hack cause I linked netatalk against db44 instead of db42 */
- mwexec("ln -s /usr/local/lib/libdb-4.4.so.0 /usr/local/lib/libdb-4.2.so.2");
-}
-
-function custom_php_deinstall_command() {
- global $config, $g;
-
- oninstall_copy_kernel_binaries("deinstall");
- oninstall_copy_misc_binaries("deinstall");
-
- if (! file_exists("/usr/local/etc/rc.d"))
- mwexec("rm -rf /usr/local/etc/rc.d");
-
- if (! file_exists("{$g['varrun_path']}/dbus"))
- mwexec("rm -rf {$g['varrun_path']}/dbus");
-
- if (! file_exists("{$g['varrun_path']}/avahi-daemon"))
- mwexec("rm -rf {$g['varrun_path']}/avahi-daemon");
-
- unlink_if_exists("/usr/local/etc/uams/uams_clrtxt.so");
- unlink_if_exists("/usr/local/etc/uams/uams_dhx.so");
- unlink_if_exists("/usr/local/etc/rc.d/freenas.sh");
- unlink_if_exists("/usr/local/lib/libdb-4.2.so.2");
-
- unset($config['installedpackages']['freenas']);
- write_config();
- conf_mount_ro();
-}
-?>
diff --git a/config/archive/freenas/pkg/freenas.xml b/config/archive/freenas/pkg/freenas.xml
deleted file mode 100644
index f5b875ef..00000000
--- a/config/archive/freenas/pkg/freenas.xml
+++ /dev/null
@@ -1,570 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>freenas</name>
- <version>1.0</version>
- <title>System: Disks: Management</title>
- <include_file>/usr/local/pkg/freenas.inc</include_file>
- <!-- Menu is where this packages menu will appear -->
- <menu>
- <name>Disks</name>
- <section>System</section>
- <url>/disks_manage.php</url>
- </menu>
- <menu>
- <name>RAID</name>
- <section>System</section>
- <url>/disks_raid_gmirror.php</url>
- </menu>
- <menu>
- <name>Mounts</name>
- <section>System</section>
- <url>/disks_mount.php</url>
- </menu>
- <menu>
- <name>FreeNAS Infos</name>
- <section>Diagnostics</section>
- <url>/diag_disk_infos.php</url>
- </menu>
- <menu>
- <name>FreeNAS Logs</name>
- <section>Diagnostics</section>
- <url>/diag_fn_logs_samba.php</url>
- </menu>
- <menu>
- <name>Disk Status</name>
- <section>Status</section>
- <url>/status_disks.php</url>
- </menu>
- <menu>
- <name>AFP</name>
- <section>Services</section>
- <url>/services_afp.php</url>
- </menu>
- <menu>
- <name>FTP</name>
- <section>Services</section>
- <url>/services_ftp.php</url>
- </menu>
- <menu>
- <name>NFS</name>
- <section>Services</section>
- <url>/services_nfs.php</url>
- </menu>
- <menu>
- <name>Rsync</name>
- <section>Services</section>
- <url>/services_rsyncd.php</url>
- </menu>
- <menu>
- <name>Samba</name>
- <section>Services</section>
- <url>/services_samba.php</url>
- </menu>
- <menu>
- <name>Unison</name>
- <section>Services</section>
- <url>/services_unison.php</url>
- </menu>
- <!--
- <service>
- <name>dspam</name>
- <rcfile>/usr/local/etc/rc.d/dspam.sh</rcfile>
- </service>
- -->
- <tabs />
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['freenas']['config']</configpath>
- <!-- PHP files (disk management) -->
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_manage.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_manage_edit.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_manage_init.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_manage_iscsi.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_manage_tools.php</item>
- </additional_files_needed>
- <!-- PHP files (RAID management) -->
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gmirror.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gmirror_edit.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gmirror_infos.php</item>
- </additional_files_needed>
- <!--
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gmirror_init.php</item>
- </additional_files_needed>
- -->
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gmirror_tools.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gvinum.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gvinum_edit.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gvinum_infos.php</item>
- </additional_files_needed>
- <!--
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gvinum_init.php</item>
- </additional_files_needed>
- -->
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gvinum_tools.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gconcat.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gconcat_edit.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gconcat_infos.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gconcat_tools.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gstripe.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gstripe_edit.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gstripe_infos.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_gstripe_tools.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_graid5.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_graid5_edit.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_graid5_infos.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_raid_graid5_tools.php</item>
- </additional_files_needed>
- <!-- PHP files (mount management) -->
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_mount.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_mount_edit.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/disks_mount_tools.php</item>
- </additional_files_needed>
- <!-- PHP files (diagnostics) -->
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_ad_infos.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_ataidle_infos.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_disk_infos.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_iscsi_infos.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_mounts_infos.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_part_infos.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_raid_infos.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_smart_infos.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_space_infos.php</item>
- </additional_files_needed>
- <!-- PHP files (logs) -->
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_fn_logs_daemon.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_fn_logs_ftp.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_fn_logs_rsyncd.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_fn_logs_samba.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_fn_logs_settings.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_fn_logs_smartd.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/diag_fn_logs_sshd.php</item>
- </additional_files_needed>
- <!-- PHP files (services) -->
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/services_afp.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/services_ftp.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/services_nfs.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/services_nfs_export.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/services_nfs_export_edit.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/services_rsyncd.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/services_rsyncd_client.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/services_rsyncd_local.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/services_samba.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/services_samba_share.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/services_samba_edit.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/services_unison.php</item>
- </additional_files_needed>
- <!-- PHP files (misc) -->
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/www/status_disks.php</item>
- </additional_files_needed>
- <!-- package files -->
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/pkg/freenas.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/pkg/freenas_disks.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/pkg/freenas_config.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/pkg/freenas_functions.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/pkg/freenas_guiconfig.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/pkg/freenas_services.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/pkg/freenas_utils.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/pkg/freenas_system.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/pkg/rc.freenas</item>
- </additional_files_needed>
- <!-- kernel binaries -->
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/iscsi_initiator.ko</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/ext2fs.ko</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/geom_concat.ko</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/geom_gpt.ko</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/geom_mirror.ko</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/geom_stripe.ko</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/geom_vinum.ko</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/kernel.gz</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/ntfs.ko</item>
- </additional_files_needed>
- <!-- misc binaries -->
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/iscontrol</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/mountd</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/nfsd</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/rpcbind</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/rpc.lockd</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/freenas/bin/rpc.statd</item>
- </additional_files_needed>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_php_resync_config_command>
- sync_package_freenas();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- custom_php_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- custom_php_deinstall_command();
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/archive/freenas/pkg/freenas_config.inc b/config/archive/freenas/pkg/freenas_config.inc
deleted file mode 100644
index fc139228..00000000
--- a/config/archive/freenas/pkg/freenas_config.inc
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- freenas_config.inc
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$GLOBALS['custom_listtags'] = array("disk", "mount", "vdisk");
-
-?> \ No newline at end of file
diff --git a/config/archive/freenas/pkg/freenas_disks.inc b/config/archive/freenas/pkg/freenas_disks.inc
deleted file mode 100644
index 0946164f..00000000
--- a/config/archive/freenas/pkg/freenas_disks.inc
+++ /dev/null
@@ -1,1256 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- freenas_disks.inc
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-/* include all configuration functions */
-require_once("functions.inc");
-require_once("freenas_functions.inc");
-
-$freenas_config =& $config['installedpackages']['freenas']['config'][0];
-
-/* Mount all configured disks */
-function disks_mount_all() {
- global $freenas_config, $g;
-
- if ($g['booting'])
- echo "Mounting Partitions... ";
-
- /* For each device configured: */
- if (is_array($freenas_config['mounts']['mount'])) {
- foreach ($freenas_config['mounts']['mount'] as $mountent) {
- /* Advanced Umount filesystem if not booting mode (mount edition) */
- if (!$g['booting'])
- disks_umount_adv($mountent);
-
- /* mount filesystem */
- disks_mount($mountent);
- } // end foreach
- } // end if
-
- if ($g['booting'])
- echo "done\n";
-
- return 0;
-}
-
-/* Mount using the configured mount given in parameter
- * Return 0 if sucessful, 1 if error
- */
-function disks_mount($mount) {
- global $freenas_config, $g;
-
- /* Create one directory for each device under mnt */
-
- $mountname=escapeshellcmd($mount['sharename']);
-
- @mkdir ("/mnt/$mountname",0777);
-
- /* mount the filesystems */
- $devname=escapeshellcmd($mount['fullname']);
-
- /* check the fileystem only if there is a problem*/
- /* This part is too stupid: I must read the FreBSD
- * start script for use the same intelligent method
- * for checking hard drive
- */
- switch ($mount['fstype']) {
- case "ufs":
- if (mwexec("/sbin/mount -t ufs -o acls $devname /mnt/$mountname") == 0) {
- /* Change this directory into 777 mode */
- mwexec("/bin/chmod 777 /mnt/$mountname");
- $result = 0;
- } else {
- /* If it's NOK, Check filesystem and do a fsck, answer Yes to all question*/
- mwexec("/sbin/fsck -y -t ufs $devname");
-
- /* Re-try to mount the partition */
- if (mwexec("/sbin/mount -t ufs -o acls $devname /mnt/$mountname") == 0) {
- /* Change this directory into 777 mode */
- mwexec("/bin/chmod 777 /mnt/$mountname");
- $result = 0;
- } else {
- /* Not OK, remove the directory, prevent writing on RAM disk*/
- @rmdir ("/mnt/$mountname");
- $result = 1;
- } // end if
- } // end if
- break;
- case "msdosfs":
- if (mwexec("/sbin/mount_msdosfs -u ftp -g ftp -m 777 $devname /mnt/$mountname") == 0) {
- $result = 0;
- } else {
- exec("/sbin/fsck -y -t msdosfs {$devname}");
-
- if (mwexec("/sbin/mount_msdosfs -u ftp -g ftp -m 777 $devname /mnt/$mountname") == 0) {
- $result = 0;
- } else {
- /* Not OK, remove the directory, prevent writing on RAM disk*/
- @rmdir ("/mnt/$mountname");
- $result = 1;
- }
- }
- break;
- case "ntfs":
- if (mwexec("/sbin/mount_ntfs -u ftp -g ftp -m 777 $devname /mnt/$mountname") == 0) {
- $result = 0;
- } else {
- /* Not OK, remove the directory, prevent writing on RAM disk */
- @rmdir ("/mnt/$mountname");
- $result = 1;
- }
- break;
- case "ext2fs":
- if (mwexec("/sbin/mount_ext2fs $devname /mnt/$mountname") == 0) {
- /* Change this directory into 777 mode */
- mwexec("/bin/chmod 777 /mnt/$mountname");
- $result = 0;
- } else {
- exec("/usr/local/sbin/e2fsck -f -p {$devname}");
-
- if (mwexec("/sbin/mount_ext2fs $devname /mnt/$mountname") == 0) {
- /* Change this directory into 777 mode */
- mwexec("/bin/chmod 777 /mnt/$mountname");
- $result = 0;
- } else {
- /* Not OK, remove the directory, prevent writing on RAM */
- @rmdir ("/mnt/$mountname");
- $result= 1;
- }
- }
- break;
- } // end switch
-
- return $result;
-}
-
-/* Mount using fullname (/dev/ad0s1) given in parameter*/
-function disks_mount_fullname($fullname) {
- global $freenas_config;
-
- if (is_array($freenas_config['mounts']['mount'])) {
- /* Search the mount list for given disk and partition */
- foreach($freenas_config['mounts']['mount'] as $mountk => $mountv) {
- if($mountv['fullname'] == $fullname) {
- $mount = $mountv;
- }
- }
- }
-
- if($mount) {
- $result= disks_mount($mount);
- } else {
- $result=0;
- }
-
- return $result;
-}
-
-/* Umount the specified configured mount point
- * Return 0 is successfull, 1 if error
- */
-function disks_umount($mount) {
- global $freenas_config, $g;
-
- /* Umout the specified mount point */
- /* The $mount variable is the all config table for the mount point*/
- $mountname=escapeshellcmd($mount['sharename']);
-
- if (mwexec("/sbin/umount /mnt/$mountname") == 0) {
- if (@rmdir ("/mnt/$mountname")) {
- return 0;
- } else {
- return 1;
- }
- } else {
- return 1;
- }
-}
-
-/* Advanced unmount the specified mount point without using the sharename value
- * Used when changing the 'sharename': Need to umount the old unknow sharename
- * Return 0 if successful, 1 if error
- */
-function disks_umount_fullname($fullname) {
- global $freenas_config;
-
- /* Search the mount list for given fullname */
- foreach($freenas_config['mounts']['mount'] as $mountk => $mountv) {
- if (strcmp($mountv['fullname'],$fullname) == 0) {
- $mount = $mountv;
- }
- }
-
- if($mount) {
- $result = disks_umount($mount);
- } else {
- $result= 1;
- }
-
- return $result;
-}
-
-/* Advanced unmount the specified mount point without using the sharename value
- * Used when changing the 'sharename': Need to umount the old unknow sharename
- * Return 0 if successful, 1 if error
- */
-function disks_umount_adv($mount)
-{
- $fulname="{$mount['fullname']}";
-
- // get the mount list
- $detmount = get_mounts_list();
-
- //Look for the mount point in all mounted point
- foreach ($detmount as $detmountk => $detmountv) {
- // If we found the mount point on the device
- if (strcmp($detmountv['fullname'],$fullname) == 0) {
- $mountname="{$detmountv['mp']}";
- }
- }
-
- if ($mountname) {
- exec("/sbin/umount $mountname");
- @rmdir ("$mountname");
- return 0;
- } else {
- $result = 1;
- }
-
- return $result;
-}
-
-function disks_mount_status($mount) {
- // This option check if the mount are mounted
- global $freenas_config, $g;
- $detmount = get_mounts_list();
- $status="ERROR";
-
- // Recreate the full system name device+s+partition number
- /* mount the filesystems */
- $mountpart="{$mount['partition']}";
-
- if ((strcmp($mountpart,"gvinum") == 0) || (strcmp($mountpart,"gmirror") == 0)) {
- $complete = "{$mount['mdisk']}";
- } else {
- $complete = "{$mount['mdisk']}{$mount['partition']}";
- }
-
- //echo "debug, display complete: $complete <br>";
-
- foreach ($detmount as $detmountk => $detmountv) {
- //echo "debug, display detmountv[mdisk]: {$detmountv['mdisk']} <br>";
-
- if (strcmp($detmountv['mdisk'],$complete) == 0) {
- $status="OK";
- return $status;
- }
- }
-
- return $status;
-}
-
-/* This option check if this fullname (/dev/ad0s1) is mounted
- * Return 0 if not, 1 if yes
- */
-function disks_check_mount_fullname($fullname) {
- $detmount = get_mounts_list();
- $status=0;
- //print_r($detmount);
-
- foreach ($detmount as $detmountk => $detmountv) {
- if (strpos($detmountv['fullname'],$fullname) !== false) {
- $status=1;
- break;
- }
- }
-
- return $status;
-}
-
-/* This option check if the configured mount is mounted. */
-function disks_check_mount($mount)
-{
- return disks_check_mount_fullname($mount['fullname']);
-}
-
-/* This function check if the disk is mounted
- * Return 0 if not, 1 if yes
- */
-function disks_check_mount_disk($disk) {
- $detmount = get_mounts_list();
- $status=0;
-
- foreach ($detmount as $detmountk => $detmountv) {
- /* Must found the $disk (ad0) in result $mdisk (ad0s1) */
- // strpos will return 0 (found at position 0) if found, must check the 'false' value
- if (strpos($detmountv['mdisk'], $disk) !== false ) {
- $status=1;
- break;
- }
-}
-return $status;
-}
-
-/* This option check if the configured disk is online (detected by the system)
- * Result: "MISSING", disk don't detected by OS
- * Result: "ONLINE", disk is online
- * Result: "CHANGED", disk have changed (be replaced ?)
- */
-function disks_status($diskname) {
- // This option check if the configured disk is online
- global $freenas_config, $g;
- $detectedlist = get_physical_disks_list();
- $status="MISSING";
-
- foreach ($detectedlist as $detecteddisk => $detecteddiskv) {
- if ($detecteddisk == $diskname['name']) {
- $status="ONLINE";
- if (($detecteddiskv['size'] != $diskname['size']) || ($detecteddiskv['desc'] != $diskname['desc'])) {
- $status="CHANGED";
- }
- break;
- }
- }
-
- return $status;
-}
-
-function disks_addfstab($cfgdev,$cfgtype) {
- global $freenas_config, $g;
-
- /* Open or create fstab in RW */
- $fd = fopen("{$g['etc_path']}/fstab", "w");
-
- if ( $fd ) {
- /* check for the precence of dev */
- /* ADD (check if it's ADD line or replace) the line for the dev */
- $fstab = "/dev/$cfgdev /mnt/$cfgdev $cfgtype rw 1 1\n";
-
- /* write out an fstab */
- fwrite($fd, $fstab);
-
- /* close file */
- fclose($fd);
- } else {
- die( "fopen failed for {$g['etc_path']}/fstab" ) ;
- }
-}
-
-function disks_umount_all() {
- global $freenas_config, $g;
-
- /* Sync disks*/
- mwexec("/bin/sync");
-
- if (is_array($freenas_config['mounts']['mount'])) {
- foreach ($freenas_config['mounts']['mount'] as $mountent) {
- /* Umount filesystem */
- disks_umount($mountent);
- }
- }
-
- return 0;
-}
-
-/* Configure, create and start gvinum volume */
-function disks_raid_gvinum_configure() {
- global $freenas_config, $g;
-
- /* Generate the raid.conf file */
- if ($freenas_config['gvinum']['vdisk']) {
-
- foreach ($freenas_config['gvinum']['vdisk'] as $a_raid_conf) {
- if (file_exists($g['varrun_path'] . "/raid.conf.dirty") &&
- !in_array("{$a_raid_conf['name']}\n", file($g['varrun_path'] . "/raid.conf.dirty"))) { continue; }
-
- /* generate raid.conf */
- $fd = fopen("{$g['varetc_path']}/raid-{$a_raid_conf['name']}.conf", "w");
- if (!$fd) {
- printf("Error: cannot open raid.conf in services_raid_configure().\n");
- return 1;
- }
-
- $raidconf="";
- foreach ($a_raid_conf['diskr'] as $diskrk => $diskrv) {
- $raidconf .= <<<EOD
-drive disk_{$diskrv} device {$diskrv}
-
-EOD;
- } // end foreach
-
- $raidconf .= <<<EOD
-volume {$a_raid_conf['name']}
-
-EOD;
-
- switch ($a_raid_conf['type']) {
- case "0":
- $raidconf .= <<<EOD
-plex org striped 256k
-
-EOD;
-
- foreach ($a_raid_conf['diskr'] as $diskrk => $diskrv) {
- /* Get the disksize */
- $disksize=get_disks_size($diskrv);
- /* Remove the ending 'B' in 'MB' */
- $disksize=rtrim($disksize, 'B');
- /*
- $raidconf .= <<<EOD
-sd length {$disksize} drive disk_{$diskrv}
-
-EOD;
-*/
-
- $raidconf .= <<<EOD
-sd length 0 drive disk_{$diskrv}
-
-EOD;
-
- } // end foreach
- break;
- case "1":
- foreach ($a_raid_conf['diskr'] as $diskrk => $diskrv) {
- $raidconf .= <<<EOD
-plex org concat
-
-EOD;
-
- /* Get the disksize */
- $disksize=get_disks_size($diskrv);
- /* Remove the ending 'B' in 'MB' */
- $disksize=rtrim($disksize, 'B');
- /*
- $raidconf .= <<<EOD
-sd length {$disksize} drive disk_{$diskrv}
-
-EOD;
-*/
- $raidconf .= <<<EOD
-sd length 0 drive disk_{$diskrv}
-
-EOD;
-
- } // end foreach
- break;
- case "5":
- $raidconf .= <<<EOD
-plex org raid5 256k
-
-EOD;
-
- foreach ($a_raid_conf['diskr'] as $diskrk => $diskrv) {
- /* Get the disksize */
- $disksize=get_disks_size($diskrv);
- /* Remove the ending 'B' in 'MB' */
- $disksize=rtrim($disksize, 'B');
- /*
- $raidconf .= <<<EOD
-sd length {$disksize} drive disk_{$diskrv}
-
-EOD;
-*/
-
- $raidconf .= <<<EOD
-sd length 0 drive disk_{$diskrv}
-
-EOD;
-
- } // end foreach
- break;
- } // end switch
-
- fwrite($fd, $raidconf);
- fclose($fd);
-
- /* Create each volume */
- mwexec("/sbin/gvinum create {$g['varetc_path']}/raid-{$a_raid_conf['name']}.conf");
- } // end foreach
-
-
- /* start each volume */
-
- foreach ($freenas_config['gvinum']['vdisk'] as $a_raid_conf) {
- exec("/sbin/gvinum lv $raidname",$rawdata);
-
- if (strpos($rawdata[0],"State: up")>=0) { continue; }
-
- mwexec("/sbin/gvinum start {$a_raid_conf['name']}");
- }
- } // end if
-
- return 0;
-}
-
-function disks_raid_configure()
-{
- global $freenas_config, $g;
-
- /* Generate the raid.conf file */
- if ($freenas_config['raid']['vdisk']) {
- foreach ($freenas_config['raid']['vdisk'] as $a_raid_conf) {
- if (file_exists($g['varrun_path'] . "/raid.conf.dirty") &&
- ! in_array("{$a_raid_conf['name']}\n",file($g['varrun_path'] . "/raid.conf.dirty"))) { continue; }
-
- /* generate raid.conf */
- $fd = fopen("{$g['varetc_path']}/raid-{$a_raid_conf['name']}.conf", "w");
-
- if (!$fd) {
- printf("Error: cannot open raid.conf in services_raid_configure().\n");
- return 1;
- }
-
- $raidconf="";
- foreach ($a_raid_conf['diskr'] as $diskrk => $diskrv) {
- $raidconf .= <<<EOD
-drive disk_{$diskrv} device /dev/{$diskrv}s1a
-
-EOD;
-
- } // end foreach
-
- $raidconf .= <<<EOD
-volume {$a_raid_conf['name']}
-
-EOD;
-
- switch ($a_raid_conf['type']) {
- case "0":
- $raidconf .= <<<EOD
-plex org striped 256k
-
-EOD;
-
- foreach ($a_raid_conf['diskr'] as $diskrk => $diskrv) {
- /* Get the disksize */
- $disksize=get_disks_size($diskrv);
- /* Remove the ending 'B' in 'MB' */
- $disksize=rtrim($disksize, 'B');
- /*
- $raidconf .= <<<EOD
-sd length {$disksize} drive disk_{$diskrv}
-
-EOD;
-*/
-
-$raidconf .= <<<EOD
-sd length 0 drive disk_{$diskrv}
-
-EOD;
-
- } // end foreach
- break;
- case "1":
- foreach ($a_raid_conf['diskr'] as $diskrk => $diskrv) {
- $raidconf .= <<<EOD
-plex org concat
-
-EOD;
-
- /* Get the disksize */
- $disksize=get_disks_size($diskrv);
- /* Remove the ending 'B' in 'MB' */
- $disksize=rtrim($disksize, 'B');
- /*
- $raidconf .= <<<EOD
-sd length {$disksize} drive disk_{$diskrv}
-
-EOD;
-*/
-
- $raidconf .= <<<EOD
-sd length 0 drive disk_{$diskrv}
-
-EOD;
-
- } // end foreach
- break;
- case "5":
- $raidconf .= <<<EOD
-plex org raid5 256k
-
-EOD;
-
- foreach ($a_raid_conf['diskr'] as $diskrk => $diskrv) {
- /* Get the disksize */
- $disksize=get_disks_size($diskrv);
- /* Remove the ending 'B' in 'MB' */
- $disksize=rtrim($disksize, 'B');
- /*
- $raidconf .= <<<EOD
-sd length {$disksize} drive disk_{$diskrv}
-
-EOD;
-*/
-
- $raidconf .= <<<EOD
-sd length 0 drive disk_{$diskrv}
-
-EOD;
-
- } // end foreach
- break;
- } // end switch
-
- fwrite($fd, $raidconf);
- fclose($fd);
-
- /* Create each volume */
- mwexec("/sbin/gvinum create {$g['varetc_path']}/raid-{$a_raid_conf['name']}.conf");
- } // end foreach
-
- /* start each volume */
- foreach ($freenas_config['raid']['vdisk'] as $a_raid_conf) {
- exec("/sbin/gvinum lv $raidname",$rawdata);
- if (strpos($rawdata[0],"State: up")>=0) { continue; }
- mwexec("/sbin/gvinum start {$a_raid_conf['name']}");
- }
- } // end if
-
- return 0;
-}
-
-/* Configure, create and start gmirror volume */
-function disks_raid_gmirror_configure() {
- global $freenas_config, $g;
-
- /* Create the gmirror device */
- if ($freenas_config['gmirror']['vdisk']) {
- // Load gmirror
- mwexec("/sbin/gmirror load");
-
- foreach ($freenas_config['gmirror']['vdisk'] as $a_raid_conf) {
- /* Create each volume */
- $cmd = "/sbin/gmirror label -b {$a_raid_conf['balance']} {$a_raid_conf['name']} ";
-
- foreach ($a_raid_conf['diskr'] as $diskrk => $diskrv) {
- $cmd .= "{$diskrv} ";
- }
-
- mwexec($cmd);
- }
- }
-
- return 0;
-}
-
-/* Configure, create and start gconcat volume */
-function disks_raid_gconcat_configure() {
- global $freenas_config, $g;
-
- if ($freenas_config['gconcat']['vdisk']) {
- // Load gconcat
- mwexec("/sbin/gconcat load");
-
- foreach ($freenas_config['gconcat']['vdisk'] as $a_raid_conf) {
- /* Create each volume */
- $cmd = "/sbin/gconcat label {$a_raid_conf['name']} ";
-
- foreach ($a_raid_conf['diskr'] as $diskrk => $diskrv) {
- $cmd .= "{$diskrv} ";
- }
-
- mwexec($cmd);
-
- }
- }
-
- return 0;
-}
-
-/* Configure, create and start gstripe volume */
-function disks_raid_gstripe_configure() {
- global $freenas_config, $g;
-
- if ($freenas_config['gstripe']['vdisk']) {
- // Load gstripe
- mwexec("/sbin/gstripe load");
-
- foreach ($freenas_config['gstripe']['vdisk'] as $a_raid_conf) {
- /* Create each volume */
- $cmd = "/sbin/gstripe label {$a_raid_conf['name']} ";
-
- foreach ($a_raid_conf['diskr'] as $diskrk => $diskrv) {
- $cmd .= "{$diskrv} ";
- }
-
- mwexec($cmd);
- }
- }
-
- return 0;
-}
-
-/* Configure, create and start graid5 volume */
-
-function disks_raid_graid5_configure()
-{
- global $freenas_config, $g;
-
- if ($freenas_config['graid5']['vdisk']) {
- /* Load graid5 */
- mwexec("/sbin/graid5 load");
-
- foreach ($freenas_config['graid5']['vdisk'] as $a_raid_conf) {
- /* Create each volume */
- $cmd = "/sbin/graid5 label -s 131072 {$a_raid_conf['name']} ";
-
- foreach ($a_raid_conf['diskr'] as $diskrk => $diskrv) {
- $cmd .= "{$diskrv} ";
- }
-
- mwexec($cmd);
- }
- }
-
- return 0;
-}
-
-function disks_raid_start() {
- global $freenas_config, $g;
-
- /* WARNING: Must change this code for advanced RAID configuration ex: RAID1+0
- * Geom RAID volume must be started in 'intelligent' sort, for RAID1+0, gmirror must
- * be started before gstripe, etc...
- */
- disks_raid_gvinum_start();
- disks_raid_gmirror_start();
- disks_raid_gstripe_start();
- disks_raid_gconcat_start();
- disks_raid_graid5_start();
-
- return 0;
-}
-
-
-function disks_raid_gvinum_start() {
- global $freenas_config, $g;
-
- /* Generate the raid.conf file */
- if ($freenas_config['raid']['vdisk']) {
- if ($g['booting'])
- echo "Start gvinum raid... ";
-
- /* start each volume */
- foreach ($freenas_config['raid']['vdisk'] as $a_raid_conf) {
- mwexec("/sbin/gvinum start {$a_raid_conf['name']}");
- }
-
- if ($g['booting'])
- echo "done\n";
- }
-
- return 0;
-}
-
-function disks_raid_gmirror_start() {
- global $freenas_config, $g;
-
- /* Start Geom mirror */
- if ($freenas_config['gmirror']['vdisk']) {
- if ($g['booting'])
- echo "Start gmirror raid... ";
-
- // Load geom mirror module
- mwexec("/sbin/gmirror load");
-
- if ($g['booting'])
- echo "done\n";
- }
-
- return 0;
-}
-
-/* Start geom concat volumes */
-function disks_raid_gconcat_start() {
- global $freenas_config, $g;
-
-/* Start Geom concat */
- if ($freenas_config['gconcat']['vdisk']) {
- if ($g['booting'])
- echo "Start gconcat raid... ";
-
- // Load geom concat module
- mwexec("/sbin/gconcat load");
-
- if ($g['booting'])
- echo "done\n";
- }
-
- return 0;
-}
-
-/* Start geom stripe volumes */
-function disks_raid_gstripe_start() {
- global $freenas_config, $g;
-
- /* Start Geom stripe */
- if ($freenas_config['gstripe']['vdisk']) {
- if ($g['booting'])
- echo "Start gstripe raid... ";
-
- // Load geom stripe module
- mwexec("/sbin/gstripe load");
-
- if ($g['booting'])
- echo "done\n";
- }
-
- return 0;
-}
-
-/* Start geom raid5 volumes */
-function disks_raid_graid5_start() {
- global $freenas_config, $g;
-
- /* Start Geom RAID5 */
- if ($freenas_config['graid5']['vdisk']) {
- if ($g['booting'])
- echo "Start graid5 raid... ";
-
- // Load geom raid5 module
- mwexec("/sbin/graid5 load");
-
- if ($g['booting'])
- echo "done\n";
- }
-
- return 0;
-}
-
-function disks_raid_stop() {
- /* WARNING: Must change this code for advanced RAID configuration ex: RAID1+0
- * Geom RAID volume must be started in 'intelligent' sort, for RAID1+0, gmirror must
- * be started before gstripe, etc...
- */
- disks_raid_gvinum_stop();
- disks_raid_graid5_stop();
- disks_raid_gstripe_stop();
- disks_raid_gconcat_stop();
- disks_raid_gmirror_stop();
-
- return 0;
-}
-
-function disks_raid_gvinum_stop() {
- global $freenas_config, $g;
-
- /* Generate the raid.conf file */
- if ($freenas_config['raid']['vdisk']) {
- /* stop each volume */
- foreach ($freenas_config['raid']['vdisk'] as $a_raid_conf) {
- mwexec("/sbin/gvinum stop {$a_raid_conf['name']}");
- }
- }
-
- return 0;
-}
-
-function disks_raid_gmirror_stop() {
- global $freenas_config, $g;
-
- /* Generate the raid.conf file */
- if ($freenas_config['gmirror']['vdisk']) {
- /* start each volume */
- foreach ($freenas_config['gmirror']['vdisk'] as $a_raid_conf) {
- mwexec("/sbin/gmirror stop {$a_raid_conf['name']}");
- }
- }
-
- return 0;
-}
-
-/* Stop all geom concat volumes */
-function disks_raid_gconcat_stop() {
- global $freenas_config, $g;
-
- /* Stop geom concat */
- if ($freenas_config['gconcat']['vdisk']) {
- /* start each volume */
- foreach ($freenas_config['gconcat']['vdisk'] as $a_raid_conf) {
- mwexec("/sbin/gconcat stop {$a_raid_conf['name']}");
- }
- }
-
- return 0;
-}
-
-/* Stop all geom stripe volumes */
-function disks_raid_gstripe_stop() {
- global $freenas_config, $g;
-
- /* Stop geom stripe */
- if ($freenas_config['gstripe']['vdisk']) {
- /* start each volume */
- foreach ($freenas_config['gstripe']['vdisk'] as $a_raid_conf) {
- mwexec("/sbin/gstripe stop {$a_raid_conf['name']}");
- }
- }
-
- return 0;
-}
-
-/* Stop all geom raid5 volumes */
-function disks_raid_graid5_stop() {
- global $freenas_config, $g;
-
- /* Generate the raid.conf file */
- if ($freenas_config['graid5']['vdisk']) {
- /* start each volume */
- foreach ($freenas_config['graid5']['vdisk'] as $a_raid_conf) {
- mwexec("/sbin/graid5 stop {$a_raid_conf['name']}");
- }
- }
-
- return 0;
-}
-
-
-/* Delete geom gvinum volume given in parameter */
-function disks_raid_gvinum_delete($raidname) {
- global $freenas_config, $g;
-
- exec("/sbin/gvinum lv $raidname",$rawdata);
-
- if (strpos($rawdata[0],"State: up") === false) {
- return 0;
- }
-
- mwexec("/sbin/gvinum rm -r $raidname");
-
- foreach ($freenas_config['gvinum']['vdisk'] as $a_raid) {
- if ($a_raid['name'] == $raidname) {
- foreach ($a_raid['diskr'] as $disk) {
- mwexec("/sbin/gvinum rm -r disk_{$disk}");
- }
- }
- }
-
- return 0;
-}
-
-/* Delete geom mirror volume given in parameter */
-function disks_raid_gmirror_delete($raidname) {
- global $freenas_config, $g;
-
- // Stop the volume
- mwexec("/sbin/gmirror stop $raidname");
-
- // Clear the gmirror information on the hard drive
- foreach ($freenas_config['gmirror']['vdisk'] as $a_raid) {
- if ($a_raid['name'] == $raidname) {
- foreach ($a_raid['diskr'] as $disk) {
- mwexec("/sbin/gmirror clear {$disk}");
- }
- }
- }
-
- return 0;
-}
-
-/* Delete geom concat volume given in parameter */
-function disks_raid_gconcat_delete($raidname) {
- global $freenas_config, $g;
-
- // Stop the volume
- mwexec("/sbin/gconcat stop $raidname");
-
- // Clear the gconcat information on the hard drive
- foreach ($freenas_config['gconcat']['vdisk'] as $a_raid) {
- if ($a_raid['name'] == $raidname) {
- foreach ($a_raid['diskr'] as $disk) {
- mwexec("/sbin/gconcat clear {$disk}");
- }
-
- mwexec("/sbin/gconcat destroy $raidname");
- }
- }
-
- return 0;
-}
-
-/* Delete geom stripe volume given in parameter */
-function disks_raid_gstripe_delete($raidname) {
- global $freenas_config, $g;
-
- // Stop the volume
- mwexec("/sbin/gstripe stop $raidname");
-
- // Clear the gconcat information on the hard drive
- foreach ($freenas_config['gstripe']['vdisk'] as $a_raid) {
- if ($a_raid['name'] == $raidname) {
- foreach ($a_raid['diskr'] as $disk) {
- mwexec("/sbin/gstripe clear {$disk}");
- }
-
- mwexec("/sbin/gstripe destroy $raidname");
- }
- }
-
- return 0;
-}
-
-/* Delete geom raid5 volume given in parameter */
-function disks_raid_graid5_delete($raidname) {
- global $freenas_config, $g;
-
- // Stop the volume
- mwexec("/sbin/graid5 stop $raidname");
-
- // The volume can disapear a few second after stop
- sleep(2);
-
- // Clear the graid5 information on the hard drive
- foreach ($freenas_config['graid5']['vdisk'] as $a_raid) {
- if ($a_raid['name'] == $raidname) {
- foreach ($a_raid['diskr'] as $disk) {
- mwexec("/sbin/graid5 remove $raidname {$disk}");
- }
-
- mwexec("/sbin/graid5 destroy $raidname");
- }
- }
-
- return 0;
-}
-
-/* Initialise HARD DRIVE for installing FreeNAS (creating 2 partition) */
-function fdisk_hd_install($harddrive) {
- global $freenas_config, $g;
-
- /* Initialise HARD DRIVE for installing FreeNAS (creating 2 partition) */
-
- /* getting disk information */
- $fdisk_info=fdisk_get_info($harddrive);
-
- /* setting FreeNAS partition size to 32Mb */
-
- $part_freenas_size=32;
-
- /* convert Mb to b */
- $part_freenas_size=$part_freenas_size * 1024 * 1024;
-
- $part1_size=$part_freenas_size / $fdisk_info['sec_size'];
- $part2_size=$fdisk_info['total'] - $part1_size;
-
- /* Create fdisk config file */
-
- /* generate fdisk.conf */
- $fd = fopen("{$g['varetc_path']}/fdisk.conf", "w");
- if (!$fd) {
- printf("Error: cannot open fdisk.conf in fdisk_hd_install().\n");
- return 1;
- }
-
-$fdiskconf .= <<<EOD
-g c{$fdisk_info['cyl']} h{$fdisk_info['head']} s{$fdisk_info['sect']}
-p 1 165 1 $part1_size
-p 2 165 $part1_size $part2_size
-p 3 0 0 0
-p 4 0 0 0
-a 1
-
-EOD;
-
- fwrite($fd, $fdiskconf);
- fclose($fd);
-
- /* Fdisk the disk */
-
- /* Warning: Ask two questions to the user */
- mwexec("/sbin/fdisk -f {$g['varetc_path']}/fdisk.conf /dev/$harddrive");
-
- return 0;
-}
-
-function fdisk_get_info($harddrive) {
- /* Return information about an harddrive
-
- $result['total'] : size
- $result['cyl'] : cylinders
- $result['head'] : heads
- $result['sect'] : sectors/track
- $result['sec_size'] : Media sector size
-
- */
-
- global $freenas_config, $g;
-
- exec("/sbin/fdisk /dev/$harddrive",$rawdata);
-
- $result=array();
-
- foreach ($rawdata as $line) {
- /* separe the line by space or egal*/
- $aline= preg_split("/[\s,]+|=/", $line);
- $first_word = chop($aline[0]);
-
- if ($aline[0] == "Media") {
- $result['sec_size']=chop($aline[4]);
- continue ;
- }
-
- if ($aline[0] == "cylinders") {
- $result['cyl']=chop($aline[1]);
- $result['head']=chop($aline[3]);
- $result['sect']=chop($aline[5]);
- continue ;
- }
- }
-
- $result['total'] = $result['cyl'] * $result['head'] * $result['sect'] ;
-
- return $result;
-}
-
-/* Is this function still used ??? */
-function disks_bsdlabel($harddrive,$partition,$type) {
- global $freenas_config, $g;
-
- // Generating BSD Label table
- passthru("/sbin/bsdlabel " . escapeshellarg($harddrive) ."$partition > {$g['tmp_path']}/label.tmp");
-
- // put this file on a array
- $tableau = file("{$g['tmp_path']}/label.tmp");
-
- // Open this file in add mode
- $handle = fopen("{$g['tmp_path']}/label.tmp", 'a');
-
- while(list(,$val) = each($tableau)) {
- // If the line contain the word "unused"
- if (ereg ("unused",$val)) {
- // Replacing c: by a:
- // Why ??? Must found the web page where I see this method
- $val = ereg_replace ("c:","a:", $val);
- // Peplacing unused by $type
- $val = ereg_replace ("unused",$type, $val);
- // Adding this line add the end of the file
- fwrite($handle, $val);
- }
- }
-
- // Closing file
- fclose($handle);
-
- // Injecting this new partition table
- passthru("/sbin/bsdlabel -R -B " . escapeshellarg($harddrive) ."$partition {$g['tmp_path']}/label.tmp");
-}
-
-
-function disks_set_ataidle() {
- global $g, $freenas_config;
-
- if (is_array($freenas_config['disks']['disk'])) {
- foreach ($freenas_config['disks']['disk'] as $disk) {
- if ($disk['type']=="IDE") {
- /* If UDMA mode forced, launch atacontrol */
- if (isset($disk['udma']) && ($disk['udma'] != "auto")) {
- mwexec("/sbin/atacontrol mode {$disk['name']} {$disk['udma']}");
- }
-
- /* Don't use ataidle if all is disabled */
- if (($disk['harddiskstandby'] == 0) && ($disk['apm'] == 0) && ($disk['acoustic'] == 0)) { continue; }
-
- /* Found the channel and device number from the /dev name */
- /* Divise the number by 2, the interger is the channel number, the rest is the device */
-
- $value=trim($disk['name'],'ad');
-
- $value=intval($value);
- $channel = $value/2;
- $device=$value % 2;
- $channel=intval($channel);
- $time=$disk['harddiskstandby'];
- $apm=$disk['apm'];
- $ac=$disk['acoustic'];
-
- $cmd = "/usr/local/sbin/ataidle ";
-
- if ($disk['acoustic'] != 0) { $cmd .= "-A $ac "; }
- if ($disk['apm'] != 0) { $cmd .= "-P $apm "; }
- if ($disk['harddiskstandby'] !=0) { $cmd .= "-S $time "; }
-
- $cmd .= "$channel $device";
- mwexec($cmd);
- } // end if
- } // end foreach
-
- return 1;
- } // end if
-
- return 0;
-}
-
-/* Is this function still used ???
-Get list of partition information from disk.
-Result is in the form:
-[1] => Array
-(
- [start] => 31
- [size] => 409169
- [type] => 0xa5
- [flags] => 0x80
-)
-
-Called in disks_manage_tools.php
-*/
-function disks_get_partition_info($disk) {
- exec("/sbin/fdisk -s {$disk}", $rawdata);
- array_shift($rawdata);
- array_shift($rawdata);
-
- $result = array();
-
- foreach($rawdata as $partinfo) {
- $apartinfo = preg_split("/\s+/", $partinfo);
- $partid = chop($apartinfo[1],":");
-
- $result[$partid] = array();
- $result[$partid]['start'] = chop($apartinfo[2]);
- $result[$partid]['size'] = chop($apartinfo[3]);
- $result[$partid]['type'] = chop($apartinfo[4]);
- $result[$partid]['flags'] = chop($apartinfo[5]);
- }
-
- return $result;
-}
-
-?>
diff --git a/config/archive/freenas/pkg/freenas_functions.inc b/config/archive/freenas/pkg/freenas_functions.inc
deleted file mode 100644
index fcea4478..00000000
--- a/config/archive/freenas/pkg/freenas_functions.inc
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- freenas_functions.inc
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-/* include all configuration functions */
-require_once ("freenas_disks.inc");
-require_once ("freenas_utils.inc");
-require_once ("freenas_services.inc");
-require_once ("freenas_system.inc");
-
-?> \ No newline at end of file
diff --git a/config/archive/freenas/pkg/freenas_guiconfig.inc b/config/archive/freenas/pkg/freenas_guiconfig.inc
deleted file mode 100644
index 2dec5a42..00000000
--- a/config/archive/freenas/pkg/freenas_guiconfig.inc
+++ /dev/null
@@ -1,288 +0,0 @@
-<?php
-/*
- guiconfig.inc
- part of m0n0wall (http://m0n0.ch/wall)
-
- Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Modified for FreeNAS (http://freenas.org) by Olivier Cochard <cochard@gmail.com>
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$d_mountdirty_path = $g['varrun_path'] . "/mount.dirty";
-$d_diskdirty_path = $g['varrun_path'] . "/disk.dirty";
-$d_raidconfdirty_path = $g['varrun_path'] . "/raid.conf.dirty";
-$d_userconfdirty_path = $g['varrun_path'] . "/user.conf.dirty";
-$d_groupconfdirty_path = $g['varrun_path'] . "/group.conf.dirty";
-$d_smbshareconfdirty_path = $g['varrun_path'] . "/smbshare.conf.dirty";
-$d_nfsexportconfdirty_path = $g['varrun_path'] . "/nfsexport.conf.dirty";
-$d_upnpconfdirty_path = $g['varrun_path'] . "/upnp.conf.dirty";
-
-/* ============================================================================= */
-/* == Constants used together with executing a UNIX command line tool == */
-/* ============================================================================= */
-
-define("DONE_PARAGRAPH", "
- <p>
- <span class='red' style='font-family: Courier, monospace; font-size: small;'><strong>Done!</strong></span>
- </p>
- ");
-
-define("CMDOUT_PARA", "
- <p style='font-size: small;'>
- <strong>Command output</strong> (use the toggle icon to unveil detailed infos):
- </p>
- ");
-
-define("CMDOUT_PARA_WOHINT", "
- <p style='font-size: small;'>
- <strong>Command output:</strong>
- </p>
- ");
-
-define("CMDOUT_TOGGLE_FUNC", "
-function toggle_cmdout(image, totoggle) {
- var plusSrc = \"/themes/{$g['theme']}/images/misc/bullet_toggle_plus.png\";
- var minusSrc = \"/themes/{$g['theme']}/images/misc/bullet_toggle_minus.png\";
- var currentSrc = image.src;
- var newSrc = (currentSrc.indexOf(\"plus\") >= 0) ? minusSrc : plusSrc;
-
- image.src = newSrc;
- Effect.toggle(totoggle, 'appear', { duration: 0.75 });
-}
-");
-
-define("CMDOUT_AJAX_SCRIPT", "
- <script type='text/javascript'>
- function execCMD() {
- var to_insert = \"<div style='visibility:hidden' id='loading' name='loading'><img src='/themes/nervecenter/images/misc/loader_tab.gif' \/><\/div>\";
- new Insertion.Before('doCMDSubmit', to_insert);
-
- $('doCMDSubmit').style.visibility = 'hidden';
- $('loading').style.visibility = 'visible';
- $('cmdOutputTD').innerHTML = '';
-
- new Ajax.Request(
- \"{$_SERVER['SCRIPT_NAME']}\", {
- method : 'post',
- parameters : Form.serialize($('iform')),
- onSuccess : execCMDComplete,
- onFailure : execCMDFailure
- }
- );
- }
-
- function execCMDFailure(req) {
- if($('doCMDSubmit')) $('doCMDSubmit').style.visibility = 'visible';
- if($('loading')) $('loading').style.visibility = 'hidden';
- if($('inputerrors')) window.scrollTo(0, 0);
- if($('inputerrors')) new Effect.Shake($('inputerrors'));
- if($('inputerrors')) $('inputerrors').innerHTML = req.responseText;
- }
-
- function execCMDComplete(req) {
- $('cmdOutputTD').innerHTML = req.responseText;
- $('loading').style.visibility = 'hidden';
- $('doCMDSubmit').style.visibility = 'visible';
- $('cmdOutputTD').style.visibility = 'visible';
- }
- </script>
-");
-
-$freenas_config =& $config['installedpackages']['freenas']['config'][0];
-
-/* ============================================================================= */
-/* == Functions used together with executing a UNIX command line tool == */
-/* ============================================================================= */
-
-function assemble_cmdout($button, $out, $done = false) {
- $dopara = DONE_PARAGRAPH;
-
- $retvalue =<<<EOD
-{$button}
-{$out}
-
-EOD;
-
- if ($done) { $retvalue .= "{$dopara}\n"; }
- return $retvalue;
-}
-
-function create_cmdout_container($id = "", $cmd = "") {
- $diskinit_str = "";
-
- if (is_array($cmd)) {
- foreach ($cmd as $cmdline) {
- $a_out = exec_command_and_return_text_array($cmdline);
- $diskinit_str .= implode("\n", $a_out);
- }
- } else {
- $a_out = exec_command_and_return_text_array($cmd);
- $diskinit_str = implode("\n", $a_out);
- }
-
- $returnval =<<<EOD
- <div id="{$id}" style="display: none; font-family: Courier, monospace; font-size: small;">
- <pre style="font-family: Courier, monospace; font-size: small; font-style: italic;">{$diskinit_str}</pre>
- </div>
-
-EOD;
-
- return $returnval;
-}
-
-function create_toggle_button($title, $totoggle) {
- global $g;
-
- $returnval =<<<EOD
- <table cellpadding="0" cellspacing="0" border="0" style="padding-bottom: 8px;">
- <tr>
- <td align="left" valign="middle" style="padding-right: 5px;">
- <img src='/themes/{$g['theme']}/images/misc/bullet_toggle_plus.png' alt='' border='0' style='border: solid 1px silver; cursor: pointer;' onclick='toggle_cmdout(this, "{$totoggle}");' />
- </td>
- <td align="left" valign="middle" style='font-family: Courier, monospace; font-size: small;'>
- {$title}:
- </td>
- </tr>
- </table>
-EOD;
-
- return $returnval;
-}
-
-function print_error_box_np($msg) {
- global $g;
-
- echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\" width=\"100%\">\n";
- echo "<tr><td bgcolor=\"#A12A2A\" width=\"36\" align=\"center\" valign=\"top\"><img src=\"/themes/{$g['theme']}/images/icons/icon_error.gif\" width=\"28\" height=\"32\"></td>\n";
- echo "<td bgcolor=\"#FFD9D1\" style=\"padding-left: 8px; padding-top: 6px\">";
- echo "<span class=\"errmsg\">";
- echo $msg;
- echo "</span>";
- echo "</td></tr></table>";
-}
-
-function print_error_box($msg) {
- echo "<p>";
- print_error_box_np($msg);
- echo "</p>";
-}
-
-function mount_sort() {
- global $g, $freenas_config;
-
- function mountcmp($a, $b) {
- return strcmp($a['mdisk'], $b['mdisk']);
- }
-
- usort($freenas_config['mounts']['mount'], "mountcmp");
-}
-
-function disks_sort() {
- global $g, $freenas_config;
-
- function diskcmp($a, $b) {
- return strcmp($a['name'], $b['name']);
- }
-
- usort($freenas_config['disks']['disk'], "diskcmp");
-}
-
-function gvinum_sort() {
- global $g, $freenas_config;
-
- function gvinumcmp($a, $b) {
- return strcmp($a['name'], $b['name']);
- }
-
- usort($freenas_config['gvinum']['vdisk'], "gvinumcmp");
-
-}
-
-function gmirror_sort() {
- global $g, $freenas_config;
-
- function gmirrorcmp($a, $b) {
- return strcmp($a['name'], $b['name']);
- }
-
- usort($freenas_config['gmirror']['vdisk'], "gmirrorcmp");
-
-}
-
-function gconcat_sort() {
- global $g, $freenas_config;
-
- function gconcatcmp($a, $b) {
- return strcmp($a['name'], $b['name']);
- }
-
- usort($freenas_config['gconcat']['vdisk'], "gconcatcmp");
-
-}
-
-function gstripe_sort() {
- global $g, $freenas_config;
-
- function gstripecmp($a, $b) {
- return strcmp($a['name'], $b['name']);
- }
-
- usort($freenas_config['gstripe']['vdisk'], "gstripecmp");
-
-}
-
-function graid5_sort() {
- global $g, $freenas_config;
-
- function graid5cmp($a, $b) {
- return strcmp($a['name'], $b['name']);
- }
-
- usort($freenas_config['graid5']['vdisk'], "graid5cmp");
-
-}
-
-/* TODO: This needs to be changed */
-function users_sort() {
- global $g, $config;
-
- function userscmp($a, $b) {
- return strcmp($a['login'], $b['login']);
- }
-
- usort($config['system']['user'], "userscmp");
-}
-
-/* TODO: This needs to be changed */
-function groups_sort() {
- global $g, $config;
-
- function groupscmp($a, $b) {
- return strcmp($a['name'], $b['name']);
- }
-
- usort($config['system']['group'], "groupscmp");
-}
-?> \ No newline at end of file
diff --git a/config/archive/freenas/pkg/freenas_services.inc b/config/archive/freenas/pkg/freenas_services.inc
deleted file mode 100644
index 71401211..00000000
--- a/config/archive/freenas/pkg/freenas_services.inc
+++ /dev/null
@@ -1,2025 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- freenas_services.inc
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-define ("FTP_BACKEND_PAM", "pam");
-define ("FTP_BACKEND_PLAINTEXT", "plaintext");
-define ("NFS_SERVICE_PORTS", "111 2049 4711");
-
-$freenas_config =& $config['installedpackages']['freenas']['config'][0];
-
-/* Stop samba, Generate the samba configuration
- * file and start samba Return 0 if OK, 1 or
- * error code if error
- */
-function services_samba_configure() {
- global $freenas_config, $g;
-
- /* kill any running samba */
- killbyname("smbd");
- killbyname("winbindd");
- killbyname("nmbd");
-
- if (isset($freenas_config['samba']['enable'])) {
- if ($g['booting']) { echo "Starting Samba... "; }
-
- /* make sure any of the required dirs exist */
- if (! file_exists("{$g['varetc_path']}/private")) {
- mkdir("{$g['varetc_path']}/private");
- }
- if (! file_exists("{$g['varlog_path']}/samba")) {
- mkdir("{$g['varlog_path']}/samba");
- }
-
- /* generate smb.conf */
- $fd = fopen("{$g['varetc_path']}/smb.conf", "w");
-
- if (!$fd) {
- printf("Error: cannot open smb.conf in services_samba_configure().\n");
- return 1;
- }
-
- /* If no share configured, exit */
- if (!is_array($freenas_config['mounts']['mount'])) { return 0; }
-
- $gen_date = date("F j, Y, g:i a");
- $sambaconf = <<<EOD
-#
-# smb.conf generated by pfSense
-# Generated at: {$gen_date}
-#
-[global]
-encrypt passwords = yes
-netbios name = {$freenas_config['samba']['netbiosname']}
-workgroup = {$freenas_config['samba']['workgroup']}
-server string = {$freenas_config['samba']['serverdesc']}
-load printers = no
-security = {$freenas_config['samba']['security']}
-dns proxy = no
-socket options = IPTOS_LOWDELAY TCP_NODELAY
-EOD;
-
- if ($freenas_config['samba']['sndbuf']) {
- /* below is a continuation of socket options! */
- $sambaconf .= <<<EOD
- SO_SNDBUF={$freenas_config['samba']['sndbuf']}
-EOD;
- } else {
- /* below is a continuation of socket options! */
- $sambaconf .= <<<EOD
- SO_SNDBUF=16384
-EOD;
- } // end if
-
- if ($freenas_config['samba']['rcvbuf']) {
- /* below is a continuation of socket options! */
- $sambaconf .= <<<EOD
- SO_RCVBUF={$freenas_config['samba']['rcvbuf']}
-EOD;
- } else {
- /* below is a continuation of socket options! */
- $sambaconf .= <<<EOD
- SO_RCVBUF=16384
-EOD;
- } // end if
-
- if ($freenas_config['samba']['winssrv']) {
- $sambaconf .= <<<EOD
-
-wins server = {$freenas_config['samba']['winssrv']}
-
-EOD;
- }
-
- if (isset ($freenas_config['samba']['unixcharset'])) {
- $sambaconf .= <<<EOD
-
-unix charset = {$freenas_config['samba']['unixcharset']}
-
-EOD;
- } else {
- $sambaconf .= <<<EOD
-
-unix charset = UTF-8
-
-EOD;
-
- } // end if
-
- $sambaconf .= <<<EOD
-
-local master = {$freenas_config['samba']['localmaster']}
-time server = {$freenas_config['samba']['timesrv']}
-guest account = ftp
-display charset = UTF-8
-max log size = 10
-syslog only = yes
-syslog = {$config['samba']['loglevel']}
-load printers = no
-printing = bsd
-printcap name = /dev/null
-disable spoolss = yes
-#Test: Try to improve samba performance under FreeBSD:
-use sendfile = yes
-strict locking = no
-#End of performance section
-log level = {$freenas_config['samba']['loglevel']}
-dos charset = {$freenas_config['samba']['doscharset']}
-smb passwd file = {$g['varetc_path']}/private/smbpasswd
-private dir = {$g['varetc_path']}/private
-
-EOD;
-
- switch ($freenas_config['samba']['security']) {
- case "share":
- $sambaconf .= <<<EOD
-create mask = 0666
-directory mask = 0777
-passdb backend = smbpasswd
-
-EOD;
-
- $guestmode = <<<EOD
-guest ok = yes
-
-EOD;
-
- break; // end case "share"
- case "domain":
- $sambaconf .= <<<EOD
-passdb backend = smbpasswd
-allow trusted domains = No
-dns proxy = No
-ldap ssl = no
-idmap backend = rid:{$freenas_config['samba']['workgroup']}=10000-20000
-idmap uid = 10000-20000
-idmap gid = 10000-20000
-winbind enum groups = yes
-winbind enum users = yes
-winbind use default domain = Yes
-template homedir = /mnt
-template shell = /bin/sh
-
-EOD;
-
- $guestmode = <<<EOD
-guest ok = no
-
-EOD;
- break; // end case "domain":
- case "user":
- $sambaconf .= <<<EOD
-passdb backend = smbpasswd
-
-EOD;
-
- $guestmode = <<<EOD
-guest ok = no
-
-EOD;
-
- break; // end case "user":
- } // end switch
-
- foreach ($freenas_config['mounts']['mount'] as $mountent) {
- /* Unmount filesystem if not booting mode*/
- $sambaconf .= <<<EOD
-
-[{$mountent['sharename']}]
-comment = {$mountent['desc']}
-path = /mnt/{$mountent['sharename']}
-public = yes
-writeable = yes
-printable = no
-veto files = /Network Trash Folder/Icon?/:2e*/.AppleDesktop/.AppleDB/.AppleDouble/TheFindByContentFolder/TheVolumeSettingsFolder/Temporary Items/.snap/
-hide dot files = yes
-{$guestmode}
-
-EOD;
-
- if ( (is_array($freenas_config['samba']['hidemount']) && in_array($mountent['sharename'],$freenas_config['samba']['hidemount']))) {
- $sambaconf .= <<<EOD
-browseable = no
-
-EOD;
-
- } // end if
-
- if (isset($freenas_config['samba']['recyclebin'])) {
- $sambaconf .= <<<EOD
-vfs object = recycle
-recycle:repository = Recycle Bin
-recycle:keeptree = Yes
-recycle:versions = Yes
-
-EOD;
- } // end if
- } // end foreach
-
- fwrite($fd, $sambaconf);
- fclose($fd);
-
- /* run nmbd and nmbd */
- if (isset($freenas_config['ad']['enable'])) {
- mwexec("/usr/local/bin/net rpc join -S {$freenas_config['ad']['ad_srv_name']} -U {$freenas_config['ad']['admin_name']}%{$freenas_config['ad']['admin_pass']}");
- }
-
- $result |= mwexec("/usr/local/sbin/nmbd -D -s {$g['varetc_path']}/smb.conf");
-
- if (isset($freenas_config['ad']['enable'])) {
- mwexec("/usr/local/sbin/winbindd -s {$g['varetc_path']}/smb.conf");
- //mwexec("/usr/local/sbin/wbinfo --set-auth-user {$freenas_config['ad']['admin_name']}%{$freenas_config['ad']['admin_pass']}");
- }
-
- $result |= mwexec("/usr/local/sbin/smbd -D -s {$g['varetc_path']}/smb.conf");
-
- /* TEST: Wait for samba starting */
- sleep(2);
-
- /* Generate the samba password file */
- $result |= system_user_samba();
-
- if ($g['booting']) { echo "done\n"; }
- }// end if
-
- return $result;
-}
-
-/* Stop rsync, Generate the rsync configuration file and start
- * rsync Return 0 if OK, 1 or error code if error
- */
-function services_rsyncd_configure() {
- global $freenas_config, $g;
-
- /* kill any running rsync daemon */
- sigkillbypid("{$g['varrun_path']}/rsyncd.pid", "TERM");
-
- if (isset($freenas_config['rsyncd']['enable'])) {
- if ($g['booting']) { echo "Starting RSYNC daemon... "; }
-
- /* If no share configured, exit */
- if (!is_array($freenas_config['mounts']['mount'])) { return 1; }
-
- /* generate rsyncd.conf */
- $fd = fopen("{$g['varetc_path']}/rsyncd.conf", "w");
-
- if (!$fd) {
- printf("Error: cannot open rsyncd.conf in services_rsyncd_configure().\n");
- return 1;
- }
-
- $rsyncdconf = <<<EOD
-read only = {$freenas_config['rsyncd']['readonly']}
-syslog facility = local4
-list = yes
-port = {$freenas_config['rsyncd']['port']}
-pid file = {$g['varrun_path']}/rsyncd.pid
-
-EOD;
-
- if (!empty($freenas_config['rsyncd']['maxcon'])) {
- $rsyncdconf .= <<<EOD
-max connections = {$freenas_config['rsyncd']['maxcon']}
-
-EOD;
- }
-
- if (!empty($freenas_config['rsyncd']['motd'])) {
- $rsyncdconf .= <<<EOD
-motd file = {$g['varetc_path']}/rsyncd.motd
-
-EOD;
- }
-
- if (isset($freenas_config['rsyncd']['rsyncd_user'])) {
- $rsyncdconf .= <<<EOD
-uid = {$freenas_config['rsyncd']['rsyncd_user']}
-
-EOD;
-
- } else {
- $rsyncdconf .= <<<EOD
-uid = ftp
-gid = ftp
-
-EOD;
- } // end if
-
- foreach ($freenas_config['mounts']['mount'] as $mountent) {
- /* Unmount filesystem if not booting mode*/
- $rsyncdconf .= <<<EOD
-
-[{$mountent['sharename']}]
-comment = {$mountent['desc']}
-path = /mnt/{$mountent['sharename']}
-
-EOD;
- } // end foreach
-
- fwrite($fd, $rsyncdconf);
- fclose($fd);
-
- // Generate MOTD file if configured
- if (!empty($freenas_config['rsyncd']['motd'])) {
- $fd = fopen("{$g['varetc_path']}/rsyncd.motd", "w");
-
- if (!$fd) {
- printf("Error: cannot open rsyncd.motd in services_rsyncd_configure().\n");
- return 1;
- }
-
- $motd = <<<EOD
-{$freenas_config['rsyncd']['motd']}
-
-EOD;
-
- fwrite($fd, $motd);
- fclose($fd);
- } // end if
-
- /* run rsync Daemon */
- $result = mwexec("/usr/local/bin/rsync --daemon --config={$g['varetc_path']}/rsyncd.conf");
-
- if ($g['booting']) { echo "done\n"; }
- } // end if
-
- return $result;
-}
-
-/* Stop nfs processes, Generate the nfs configuration file and
- * start nfsd processes Return 0 if OK, 1 or error code if error
- */
-function services_nfs_configure() {
- global $freenas_config, $g;
-
- /* kill any running nfsd */
- killbyname("rpc.statd");
- killbyname("rpc.lockd");
- killbypid("{$g['varrun_path']}/mountd.pid");
- forcekillbyname("nfsd");
- killbyname("rpcbind");
-
- if (isset($freenas_config['nfs']['enable'])) {
- if ($g['booting']) { echo "Starting NFS... "; }
-
- $nfsconf = "";
- $a_nfsconf = array();
-
- /* If no share configured, exit */
- if (!is_array($freenas_config['mounts']['mount'])) { return 1; }
-
- /* generate exports */
- $fd = fopen("{$g['varetc_path']}/exports", "w");
-
- if (!$fd) {
- printf("Error: cannot open exports in services_nfs_configure().\n");
- return 1;
- }
-
- $a_mount = &$freenas_config['mounts']['mount'];
- $pfnetworks = array();
-
- foreach ($a_mount as $mount) {
- /* -mapall and -maproot mutually exclusive */
- $mapping = $mount['nfs']['mapall'] == "yes" ? "-mapall=root" : "-maproot=root";
- $networks = isset($mount['nfs']['networks']) ? $mount['nfs']['networks'] : "";
-
- $nfsconf = "/mnt/{$mount['sharename']} -alldirs {$mapping}";
-
- if ($networks <> "") {
- foreach (explode(",", $networks) as $netel) {
- list($network,$subnet) =
- explode('/', $netel);
-
- $subnet = gen_subnet_mask($subnet);
- $pfnetworks[] = $network;
-
- $tmp_nfsconf .= "{$nfsconf} -network {$network} -mask {$subnet}\n";
- }
-
- services_setup_transparency_for("nfs", implode(" ", $pfnetworks));
- $nfsconf = $tmp_nfsconf;
- } else {
- $nfsconf .= "\n";
- }
- }
-
- fwrite($fd, $nfsconf);
- fclose($fd);
-
- $nfsdbindto = $freenas_config['nfs']['bindto'] = "(ANY)" ? " -a" : " -h {$freenas_config['nfs']['bindto']}";
- $rpcbbindto = $freenas_config['nfs']['bindto'] = "(ANY)" ? "" : " -h {$freenas_config['nfs']['bindto']}";
- $servetcp = isset($freenas_config['nfs']['servetcp']) ? " -t" : "";
- $serveudp = isset($freenas_config['nfs']['serveudp']) ? " -u" : "";
-
- /* run rpcbind, nfsd and mountd */
- mwexec("/usr/sbin/rpcbind{$rpcbbindto}");
- mwexec("/usr/sbin/nfsd{$nfsdbindto}{$serveudp}{$servetcp} -n 4");
- mwexec("/usr/sbin/mountd -p 4711 -r {$g['varetc_path']}/exports");
- mwexec("/usr/sbin/rpc.lockd");
- mwexec("/usr/sbin/rpc.statd");
-
- if ($g['booting']) { echo "done\n"; }
- } else {
- services_remove_transparency_for("nfs");
- }// end if
-
- return 0;
-}
-
-function services_remove_transparency_for($whom) {
- global $g;
-
- $service_result = mwexec ("pfctl -a \"passin-package-freenas-{$whom}\" -F rules");
- if($service_result <> 0) {
- file_notice("FREENAS", "There were error(s) flushing the exclude table", "FREENAS", "");
- }
-
- unlink_if_exists("{$g['pkg_path']}/pf/freenas-{$whom}.sh");
-}
-
-function services_setup_transparency_for($whom, $networks) {
- global $g, $config, $freenas_config;
-
- if ($whom == "" || $networks == "") { return; }
-
- $generatedLANSubnet = gen_subnet($config['interfaces']['lan']['ipaddr'],
- $config['interfaces']['lan']['subnet']);
- $aliases = "";
-
- /* stolen from filter.inc */
- $real_wanif = get_real_wan_interface();
- $wanip = find_interface_ip($real_wanif);
-
- $wan_aliases = " " . link_ip_to_carp_interface($wanip);
-
- if (link_int_to_bridge_interface("wan"))
- $wan_aliases .= " " . link_int_to_bridge_interface("wan");
-
- if ($config['interfaces']['wan']['ipaddr'] == "pppoe" or $config['interfaces']['wan']['ipaddr'] == "pptp") {
- $aliases .= "ng0 = \"{ {$config['interfaces']['wan']['if']} {$real_wanif} }\" \n";
- $aliases .= "wan = \"{ {$config['interfaces']['wan']['if']} {$wan_aliases} ng0 }\"\n";
- } else {
- $aliases .= "wan = \"{ {$real_wanif} {$wan_aliases} }\"\n";
- }
-
- $trans_file = fopen("/tmp/freenas-{$whom}.rules","w");
- fwrite($trans_file, "{$aliases}\n");
-
- switch ($whom) {
- case "nfs":
- $nfs_ports = explode(" ", NFS_SERVICE_PORTS);
-
- foreach ($nfs_ports as $port) {
- fwrite($trans_file, "pass in quick on \$wan proto { tcp udp } from { {$networks} } to {$freenas_config['nfs']['bindto']} port = {$port} keep state label \"FreeNAS related rule for {$whom}-{$port}\"\n");
- }
- break;
- }
- fclose($trans_file);
- $service_result = mwexec ("pfctl -a \"passin-package-freenas-{$whom}\" -f /tmp/freenas-{$whom}.rules");
- if($service_result <> 0) {
- file_notice("FREENAS", "There were error(s) loading the transparency rules", "FREENAS", "");
- }
-
- /* create a shell script to make sure our filter rules
- * are getting loaded upon each filter realod cycle.
- */
- $scriptstr = "#!/bin/sh\n\n";
- $scriptstr .= "case $1 in\n";
- $scriptstr .= " start)\n";
- $scriptstr .= " if [ -f /tmp/freenas-nfs.rules ]; then\n";
- $scriptstr .= " /sbin/pfctl -a \"passin-package-freenas-{$whom}\" -f /tmp/freenas-{$whom}.rules\n";
- $scriptstr .= " fi\n";
- $scriptstr .= " ;;\n";
- $scriptstr .= " *)\n";
- $scriptstr .= " echo \"Usage: $0 (start|stop|restart|status|log)\"\n";
- $scriptstr .= " exit 1\n";
- $scriptstr .= "esac\n";
-
- file_put_contents("{$g['pkg_path']}/pf/freenas-{$whom}.sh", $scriptstr);
- chmod("{$g['pkg_path']}/pf/freenas-{$whom}.sh", 0700);
-}
-
-function services_ftpd_configure() {
- global $freenas_config, $g;
- // services_vsftpd_configure();
- // services_pureftpd_configure();
- services_wzdftpd_configure();
-}
-
-function services_wzdftpd_configure() {
- global $freenas_config, $config, $g;
-
- /* kill any WZDFTPD */
- killbyname("wzdftpd");
-
- if (isset($freenas_config['ftp']['enable'])) {
- if ($g['booting']) { echo "Starting FTP server... "; }
-
- /* create missing dirs if necessary */
- if (! file_exists("/var/log/wzdftpd")) { mkdir("/var/log/wzdftpd"); }
- if (! file_exists("/usr/local/etc/wzdftpd")) { mkdir("/usr/local/etc/wzdftpd"); }
-
- /* generate wzd.cfg */
- chmod("/usr/local/etc/wzdftpd/wzd.cfg", 0600);
- $fd = fopen("/usr/local/etc/wzdftpd/wzd.cfg", "w");
-
- if (!$fd) {
- printf("Error: cannot open vsftpd.conf in services_vsftpd_configure().\n");
- return 1;
- }
-
- $ftpconf = <<<EOD
-[GLOBAL]
-config version = 0.7.2
-backup config = true
-port = {$freenas_config['ftp']['port']}
-
-EOD;
-
- if ($freenas_config['ftp']['pasv_min_port'] && $freenas_config['ftp']['pasv_max_port']) {
- $ftpconf .= <<<EOD
-pasv_low_range = {$freenas_config['ftp']['pasv_min_port']}
-pasv_high_range = {$freenas_config['ftp']['pasv_max_port']}
-
-EOD;
- }
-
- $ftpconf .= <<<EOD
-
-pasv_ip = {$freenas_config['ftp']['pasv_address']}
-dir_message = .message
-logfile = /var/log/wzdftpd/wzd.log
-xferlog = /var/log/wzdftpd/xferlog
-logdir = /var/log/wzdftpd
-max_threads = {$freenas_config['ftp']['numberclients']}
-
-backend = /usr/local/share/wzdftpd/backends/libwzd{$freenas_config['ftp']['authentication_backend']}.so
-
-max_ul_speed = 0
-max_dl_speed = 0
-deny_access_files_uploaded = 1
-
-tls_certificate = /usr/local/etc/wzdftpd/wzd.pem
-sitefile_ginfo = /usr/local/etc/wzdftpd/file_ginfo.txt
-sitefile_group = /usr/local/etc/wzdftpd/file_group.txt
-sitefile_user = /usr/local/etc/wzdftpd/file_user.txt
-
-[pre_ip_check]
-localhost = allow
-
-[perms]
-site_addip = +O +G
-site_adduser = +O +G
-site_backend = +O
-site_chacl = +O
-site_change = +O +G
-site_changegrp = +O +G
-site_checkperm = +O
-site_chgrp = +O
-site_chmod = +O
-site_chown = +O
-site_chpass = *
-site_chratio = +O +G
-site_close = +O
-site_color = !=guest *
-site_delip = +O +G
-site_deluser = +O +G
-site_flags = -admin
-site_free = *
-site_ginfo = +O +G
-site_give = *
-site_group = +O
-site_groups = +O
-site_grpadd = +O
-site_grpaddip = +O
-site_grpchange = +O
-site_grpdel = +O
-site_grpdelip = +O
-site_grpkill = +O
-site_grpratio = +O
-site_grpren = +O
-site_gsinfo = +O +G
-site_help = *
-
-EOD;
-
- if (! empty($freenas_config['ftp']['timeout'])) {
- $ftpconf .= "site_idle ={$freenas_config['ftp']['timeout']}\n";
- } else {
- $ftpconf .= "site_idle = *\n";
- }
-
- $ftpconf .= <<<EOD
-site_invite = !=guest *
-site_kick = +O
-site_kill = +O
-site_link = +O
-site_msg = +O
-site_perm = +O
-site_purge = +O +G
-site_readd = +O +G
-site_reload = +O
-site_reopen = +O
-site_rules = *
-site_rusage = +O
-site_savecfg = +O
-site_sections = +O
-site_shutdown = +O
-site_su = +O
-site_swho = +O
-site_tagline = !=guest *
-site_take = +O
-site_unlock = +O
-site_uptime = *
-site_user = +O +G
-site_users = -admin
-site_utime = *
-site_vars = +O
-site_vars_group = +O
-site_vars_user = +O
-site_version = +O
-site_who = !=guest *
-site_wipe = +O
-site_vfsls = +O
-site_vfsadd = +O
-site_vfsdel = +O
-
-[modules]
-/usr/local/share/wzdftpd/modules/libwzd_debug.so = deny
-/usr/local/share/wzdftpd/modules/libwzd_test.so = deny
-/usr/local/share/wzdftpd/modules/libwzd_sfv.so = allow
-/usr/local/share/wzdftpd/modules/libwzd_tcl.so = deny
-/usr/local/share/wzdftpd/modules/libwzd_perl.so = deny
-
-EOD;
-
- if (empty($config['system']['zeroconf_disable'])) {
- $ftpconf .= <<<EOD
-/usr/local/share/wzdftpd/modules/libwzd_zeroconf.so = allow
-
-[ZEROCONF]
-zeroconf_port = {$freenas_config['ftp']['port']}
-zeroconf_username = wzdftpd
-zeroconf_password = wzdftpd
-zeroconf_path = /
-
-EOD;
-
- }
-
- $ftpconf .= <<<EOD
-
-[sfv]
-progressmeter = [WzD] - %3d%% Complete - [WzD]
-del_progressmeter = \[.*] - ...% Complete - \[WzD]
-incomplete_indicator = ../(incomplete)-%0
-other_completebar = [WzD] - ( %.0mM %fF - COMPLETE ) - [WzD]
-
-[plaintext]
-param = /usr/local/etc/wzdftpd/users
-
-[sections]
-ALL = /* ^([]\[A-Za-z0-9_.'() \\t+-])*\$
-
-[cron]
-
-[events]
-
-[custom_commands]
-site_rules = !/usr/local/etc/wzdftpd/file_rules.txt
-
-site_groups = !/usr/local/etc/wzdftpd/file_groups.txt
-site_help = !/usr/local/etc/wzdftpd/file_help.txt
-site_swho = !/usr/local/etc/wzdftpd/file_swho.txt
-site_users = !/usr/local/etc/wzdftpd/file_users.txt
-site_vfsls = !/usr/local/etc/wzdftpd/file_vfs.txt
-site_who = !/usr/local/etc/wzdftpd/file_who.txt
-
-[vfs]
-
-[messages]
-
-EOD;
-
- if (isset($freenas_config['ftp']['banner'])) {
- $ftpconf .= "200 = {$freenas_config['ftp']['banner']}";
- } else {
- $ftpconf .= "200 = Welcome to pfSense FTP service";
- }
-
- fwrite($fd, $ftpconf);
- fclose($fd);
- chmod("/usr/local/etc/wzdftpd/wzd.cfg", 0400);
-
- /* now generate the plaintext users file (if applicable) */
- if ($freenas_config['ftp']['authentication_backend'] == FTP_BACKEND_PLAINTEXT) {
- $ftpusers = "[GROUPS]\n";
- $a_group =& $config['system']['group'];
- $a_user =& $config['system']['user'];
-
- for ($i = 0; $i < count($a_group); $i++) {
- $group = $a_group[$i];
- $gid = $i + 1;
-
- $ftpusers .= <<<EOD
-
-privgroup {$group['name']}
-gid={$gid}
-default_home=/
-
-EOD;
- } // end foreach
-
- /* anonymous group */
- if (! empty($freenas_config['ftp']['anonymous'])) {
- $ftpusers .= <<<EOD
-
-privgroup anonymous
-max_idle_time=10
-gid=3
-default_home=/home
-
-EOD;
- }
-
- /* same for users */
- $ftpusers .= "[USERS]\n";
- for ($i = 0; $i < count($a_user); $i++) {
- $user = $a_user[$i];
- $ftpusers .= <<<EOD
-
-name={$user['name']}
-pass={$user['password']}
-home=/
-uid={$i}
-groups={$user['groupname']}
-rights=0xffffffff
-
-EOD;
- } // end foreach
-
- /* anonymous user */
- if (! empty($freenas_config['ftp']['anonymous'])) {
- $ftpusers .= <<<EOD
-
-name=guest
-pass=%
-home=/tmp
-uid=200
-groups=anonymous
-rights=0x10003
-ip_allowed=*
-max_dl_speed=20480
-credits=0
-bytes_ul_total=0
-bytes_dl_total=1918812
-num_logins=2
-
-EOD;
- } // end if
-
- $ftpusers .= "[HOSTS]\nall = *\n";
- chmod("/usr/local/etc/wzdftpd/users", 0600);
- file_put_contents("/usr/local/etc/wzdftpd/users", $ftpusers);
- chmod("/usr/local/etc/wzdftpd/users", 0400);
- } // end if
-
- /* run vsftpd */
- mwexec("/usr/local/sbin/wzdftpd -f /usr/local/etc/wzdftpd/wzd.cfg");
-
- if ($g['booting']) { echo "done\n"; }
- } // end if
-
- return 0;
-}
-
-/* this function is currently not used */
-function services_vsftpd_configure() {
- global $freenas_config, $g;
-
- /* kill any VSFTPD */
- killbyname("vsftpd");
-
- if (isset($freenas_config['ftp']['enable'])) {
- if ($g['booting']) { echo "Starting FTP server... "; }
-
- /* generate vfstpd.conf */
- $fd = fopen("{$g['varetc_path']}/vsftpd.conf", "w");
-
- if (!$fd) {
- printf("Error: cannot open vsftpd.conf in services_vsftpd_configure().\n");
- return 1;
- }
-
- $ftpconf = <<<EOD
-# Standalone mode
-listen=YES
-background=YES
-listen_port={$freenas_config['ftp']['port']}
-max_clients={$freenas_config['ftp']['numberclients']}
-max_per_ip={$freenas_config['ftp']['maxconperip']}
-xferlog_enable=YES
-#vsftpd_log_file=/var/log/ftp.log
-syslog_enable=YES
-# Access rights
-anonymous_enable={$freenas_config['ftp']['anonymous']}
-local_enable={$freenas_config['ftp']['localuser']}
-write_enable=YES
-hide_file=.snap
-anon_other_write_enable=YES
-anon_upload_enable=YES
-anon_mkdir_write_enable=YES
-chroot_local_user=YES
-local_umask=066
-anon_umask=066
-chmod_enable=YES
-pasv_address={$freenas_config['ftp']['pasv_address']}
-# Features
-ls_recurse_enable=YES
-# Performance
-idle_session_timeout={$freenas_config['ftp']['timeout']}
-
-EOD;
- if (isset($freenas_config['ftp']['banner'])) {
- $ftpconf .= <<<EOD
-ftpd_banner={$freenas_config['ftp']['banner']}
-
-EOD;
- } else {
- $ftpconf .= <<<EOD
-ftpd_banner=Welcome to pfSense FTP service
-
-EOD;
- }
-
- if ($freenas_config['ftp']['pasv_min_port'] && $freenas_config['ftp']['pasv_max_port']) {
- $ftpconf .= <<<EOD
-pasv_max_port={$freenas_config['ftp']['pasv_max_port']}
-pasv_min_port={$freenas_config['ftp']['pasv_min_port']}
-
-EOD;
- }
-
- if ($freenas_config['ftp']['pasv_address']) {
- $ftpconf .= <<<EOD
-pasv_address={$freenas_config['ftp']['pasv_address']}
-
-EOD;
- }
-
- fwrite($fd, $ftpconf);
- fclose($fd);
-
- /* run vsftpd */
- mwexec("/usr/local/sbin/vsftpd {$g['varetc_path']}/vsftpd.conf");
-
- if ($g['booting']) { echo "done\n"; }
- }
-
- return 0;
-}
-
-function services_pureftpd_configure() {
- global $freenas_config, $g;
-
- /* kill any Pure-FTPD */
- killbyname("pure-ftpd");
-
- if (isset($freenas_config['ftp']['enable'])) {
- if ($g['booting']) { echo "Starting FTP server... "; }
-
- /* Generate the banner file */
- $fd = fopen("/mnt/.banner", "w");
-
- if (!$fd) {
- printf("Error: cannot open .banner in services_pureftpd_configure().\n");
- return 1;
- }
-
- if (empty($freenas_config['ftp']['banner'])) {
- $banner = <<<EOD
-Welcome to pfSense FTP service
-
-EOD;
- } else {
- $banner = <<<EOD
-{$freenas_config['ftp']['banner']}
-
-EOD;
- } // end if
-
- fwrite($fd, $banner);
- fclose($fd);
-
- /* run pure-ftpd */
- $cmd = "/usr/local/sbin/pure-ftpd -S {$freenas_config['ftp']['port']} -c {$freenas_config['ftp']['numberclients']} -C {$freenas_config['ftp']['maxconperip']} -I {$freenas_config['ftp']['timeout']} -M U 077:077 -B -b ";
-
- if ( (isset($freenas_config['ftp']['anonymous'])) && (!isset($freenas_config['ftp']['localuser']))) {
- $cmd .= "-e ";
- }
-
- if ( (!isset($freenas_config['ftp']['anonymous'])) && (isset($freenas_config['ftp']['localuser']))) {
- $cmd .= "-E ";
- }
-
- if ($freenas_config['ftp']['pasv_min_port'] && $freenas_config['ftp']['pasv_max_port']) {
- $cmd .= "-p {$freenas_config['ftp']['pasv_min_port']}:{$freenas_config['ftp']['pasv_max_port']} ";
- }
-
- if ($freenas_config['ftp']['pasv_address']) {
- $cmd .= "-P {$freenas_config['ftp']['pasv_address']} ";
- }
-
- if ($freenas_config['ftp']['natmode']) {
- $cmd .= "-N ";
- }
-
- if ($freenas_config['ftp']['passiveip']) {
- $cmd .= "-P {$freenas_config['ftp']['passiveip']} ";
- }
-
- if ($freenas_config['ftp']['fxp']) {
- $cmd .= "-W ";
- }
-
- mwexec($cmd);
-
- if ($g['booting']) { echo "done\n"; }
- } // end if
-
- return 0;
-}
-
-/* Stop smartd, Generate the configuration file and start
- * smartd Return 0 if OK, 1 or error code if error
- */
-function services_smart_configure() {
- global $config, $g;
-
- /* kill any running smartd */
- killbyname("smartd");
-
- if (isset($config['system']['smart'])) {
- if ($g['booting']) { echo "Starting smartd... "; }
-
- /* run smartd */
- mwexec("/usr/local/sbin/smartd --logfacility=local5");
-
- if ($g['booting']) { echo "done\n"; }
- }
-
- return 0;
-}
-
-/* Generate the unison configuration
- * Return 0 if OK, 1 or error code if error
- */
-function services_unison_configure() {
- global $freenas_config, $g;
- $result = 0 ;
-
- if ($g['booting']) { echo "Configuring unison... \n"; }
-
- if (isset($freenas_config['unison']['enable'])) {
- /* ensure unison workdir exists */
- $workdir = "/mnt/{$freenas_config['unison']['share']}/{$config['unison']['workdir']}";
-
- if (isset($freenas_config['unison']['makedir']) && !file_exists($workdir)) {
- if (!mkdir($workdir)) {
- printf("Error: cannot mkdir $workdir in services_unison_configure().\n");
- }
-
- exec("/bin/chmod 775 $workdir");
- }
-
- if (!file_exists($workdir)) {
- printf("Error: cannot open $workdir in services_unison_configure().\n");
- $result = 1 ;
- }
-
- /* add workdir to login.conf UNISON environment variable */
- $logfile = "{$g['etc_path']}/login.conf";
-
- if (!file_exists("$logfile")) {
- printf("Error: $logfile doesn't exist, in services_unison_configure().\n");
- $result = 1 ;
- }
-
- $tmp = file_get_contents("$logfile");
- $search = "/UNISON=.*?(?=[,:])/";
-
- if (!preg_match($search, $tmp)) {
- printf("Error: cannot find UNISON in $logfile, in services_unison_configure().\n");
- $result = 1 ;
- }
-
- $tmp = preg_replace($search, "UNISON=$workdir", $tmp);
-
- if (!file_put_contents($logfile, $tmp)) {
- printf("Error: couldn't write $logfile, in services_unison_configure().\n");
- $result = 1 ;
- }
- } // end if
-
- $tmp = "";
-
- return $result;
-}
-
-/* Stop and start ushare
- * Return 0 if OK, 1 or error code if error
- */
-function services_ushare_configure() {
- global $freenas_config, $g;
-
- $result = 0 ;
-
- /* Kill any running uShare */
- killbyname("ushare");
-
- /* Delete multicast route. */
- mwexec("/sbin/route delete -net 239.0.0.0");
-
- if(isset($freenas_config['upnp']['enable'])) {
- if($g['booting']) { echo "Starting UPnP server... "; }
-
- /* Setup a multicast route for UPnP messages. */
- // TODO: where to get the upnp iface?
- $result = mwexec("/sbin/route add -net 239.0.0.0 -netmask 255.0.0.0 -interface " . escapeshellarg($freenas_config['upnp']['if']));
-
- $content = "";
- foreach($freenas_config['upnp']['content'] as $contentv) {
- $content .= " --content=$contentv";
- }
-
- /* Run uShare as daemon. */
- // TODO: where to get the upnp iface?
- $result |= mwexec("/usr/local/bin/ushare --daemon --no-web --name={$freenas_config['upnp']['name']} --interface={$freenas_config['upnp']['if']} {$content}");
- } // end if
-
- return $result;
-}
-
-function services_cron_configure() {
- global $freenas_config, $g;
-
- /* kill any running cron */
- killbyname("cron");
-
- /* ======================================================================= */
- /* = configure crontab item for rsyncclient = */
- /* ======================================================================= */
- if (isset($freenas_config['rsyncclient']['enable'])) {
- if ($g['booting']) { echo "Configuring cron for rsync client... "; }
-
- if ($freenas_config['rsyncclient']['all_mins'] == "0") {
- foreach ($freenas_config['rsyncclient']['minute'] as $minutev) {
- if (strlen($cron_min) > 0) {
- $cron_min = $cron_min . "," . $minutev;
- } else {
- $cron_min = $minutev;
- }
- } // end foreach
- } else {
- $cron_min = "*";
- } // end if
-
- if ($freenas_config['rsyncclient']['all_hours'] == "0") {
- foreach ($freenas_config['rsyncclient']['hour'] as $hourv) {
- if (strlen($cron_hour) > 0) {
- $cron_hour = $cron_hour . "," . $hourv;
- } else {
- $cron_hour = $hourv;
- }
- } // end foreach
- } else {
- $cron_hour = "*";
- } // end if
-
- if ($freenas_config['rsyncclient']['all_days'] == "0") {
- foreach ($freenas_config['rsyncclient']['day'] as $dayv) {
- if (strlen($cron_day) > 0) {
- $cron_day = $cron_day . "," . $dayv;
- } else {
- $cron_day = $dayv;
- }
- } // end foreach
- } else {
- $cron_day = "*";
- } // end if
-
- if ($freenas_config['rsyncclient']['all_months'] == "0") {
- foreach ($freenas_config['rsyncclient']['month'] as $monthv) {
- if (strlen($cron_month) > 0) {
- $cron_month = $cron_month . "," . $monthv;
- } else {
- $cron_month = $monthv;
- }
- } // end foreach
- } else {
- $cron_month = "*";
- } // end if
-
- if ($freenas_config['rsyncclient']['all_weekday'] == "0") {
- foreach ($freenas_config['rsyncclient']['weekday'] as $weekdayv) {
- if (strlen($cron_weekday) > 0) {
- $cron_weekday = $cron_weekday . "," . $weekdayv;
- } else {
- $cron_weekday = $weekdayv;
- }
- } // end foreach
- } else {
- $cron_weekday = "*";
- } // end if
-
- $cron_item = array();
- $cron_item['minute'] = "{$cron_min}";
- $cron_item['hour'] = "{$cron_hour}";
- $cron_item['mday'] = "{$cron_day}";
- $cron_item['month'] = "{$cron_month}";
- $cron_item['wday'] = "{$cron_weekday}";
- $cron_item['who'] = "root";
- $cron_item['command'] = "{$g['varrun_path']}/sync.sh";
-
- $config['cron']['item'][] = $cron_item;
-
- if ($g['booting']) { echo "done\n"; }
- } // end if
-
- /* Erase all variable used previously */
- unset ($cron_min, $cron_hour, $cron_day, $cron_month, $cron_weekday);
-
- /* ======================================================================= */
- /* = configure crontab item for rsync local part = */
- /* ======================================================================= */
- if (isset($freenas_config['rsync_local']['enable'])) {
- if ($g['booting']) { echo "Configuring cron for local rsync... "; }
-
- if ($freenas_config['rsync_local']['all_mins'] == "0") {
- foreach ($freenas_config['rsync_local']['minute'] as $minutev) {
- if (strlen($cron_min) > 0) {
- $cron_min = $cron_min . "," . $minutev;
- } else {
- $cron_min = $minutev;
- }
- } // end foreach
- } else {
- $cron_min = "*";
- } // end if
-
- if ($freenas_config['rsync_local']['all_hours'] == "0") {
- foreach ($freenas_config['rsync_local']['hour'] as $hourv) {
- if (strlen($cron_hour) > 0) {
- $cron_hour = $cron_hour . "," . $hourv;
- } else {
- $cron_hour = $hourv;
- }
- } // end foreach
- } else {
- $cron_hour = "*";
- } // end if
-
- if ($freenas_config['rsync_local']['all_days'] == "0") {
- foreach ($freenas_config['rsync_local']['day'] as $dayv) {
- if (strlen($cron_day) > 0) {
- $cron_day = $cron_day . "," . $dayv;
- } else {
- $cron_day = $dayv;
- }
- } // end foreach
- } else {
- $cron_day = "*";
- } // end if
-
- if ($freenas_config['rsync_local']['all_months'] == "0") {
- foreach ($freenas_config['rsync_local']['month'] as $monthv) {
- if (strlen($cron_month) > 0) {
- $cron_month = $cron_month . "," . $monthv;
- } else {
- $cron_month = $monthv;
- }
- } // end foreach
- } else {
- $cron_month = "*";
- } // end if
-
- if ($freenas_config['rsync_local']['all_weekday'] == "0") {
- foreach ($freenas_config['rsync_local']['weekday'] as $weekdayv) {
- if (strlen($cron_weekday) > 0) {
- $cron_weekday = $cron_weekday . "," . $weekdayv;
- } else {
- $cron_weekday = $weekdayv;
- }
- } // end foreach
- } else {
- $cron_weekday = "*";
- }
-
- $cron_item = array();
- $cron_item['minute'] = "{$cron_min}";
- $cron_item['hour'] = "{$cron_hour}";
- $cron_item['mday'] = "{$cron_day}";
- $cron_item['month'] = "{$cron_month}";
- $cron_item['wday'] = "{$cron_weekday}";
- $cron_item['who'] = "root";
- $cron_item['command'] = "{$g['varrun_path']}/sync.sh";
-
- $config['cron']['item'][] = $cron_item;
-
- if ($g['booting']) { echo "done\n"; }
- }
-
- /* Erase all variable used previously */
- unset ($cron_min, $cron_hour, $cron_day, $cron_month, $cron_weekday);
-
- /* ======================================================================= */
- /* = configure crontab item shutdown part = */
- /* ======================================================================= */
- if (isset($freenas_config['shutdown']['enable'])) {
- if ($g['booting']) { echo "Configuring cron for shutdown... "; }
-
- if ($freenas_config['shutdown']['all_mins'] == "0") {
- foreach ($freenas_config['shutdown']['minute'] as $minutev) {
- if (strlen($cron_min) > 0) {
- $cron_min = $cron_min . "," . $minutev;
- } else {
- $cron_min = $minutev;
- }
- } // end foreach
- } else {
- $cron_min = "*";
- } // end if
-
- if ($freenas_config['shutdown']['all_hours'] == "0") {
- foreach ($freenas_config['shutdown']['hour'] as $hourv) {
- if (strlen($cron_hour) > 0) {
- $cron_hour = $cron_hour . "," . $hourv;
- } else {
- $cron_hour = $hourv;
- }
- } // end foreach
- } else {
- $cron_hour = "*";
- } // end if
-
- if ($freenas_config['shutdown']['all_days'] == "0") {
- foreach ($freenas_config['shutdown']['day'] as $dayv) {
- if (strlen($cron_day) > 0) {
- $cron_day = $cron_day . "," . $dayv;
- } else {
- $cron_day = $dayv;
- }
- } // end foreach
- } else {
- $cron_day = "*";
- } // end if
-
- if ($freenas_config['shutdown']['all_months'] == "0") {
- foreach ($freenas_config['shutdown']['month'] as $monthv) {
- if (strlen($cron_month) > 0) {
- $cron_month = $cron_month . "," . $monthv;
- } else {
- $cron_month = $monthv;
- }
- } // end foreach
- } else {
- $cron_month = "*";
- } // end if
-
- if ($freenas_config['shutdown']['all_weekday'] == "0") {
- foreach ($freenas_config['shutdown']['weekday'] as $weekdayv) {
- if (strlen($cron_weekday) > 0) {
- $cron_weekday = $cron_weekday . "," . $weekdayv;
- } else {
- $cron_weekday = $weekdayv;
- }
- } // end foreach
- } else {
- $cron_weekday = "*";
- } // end if
-
- $cron_item = array();
- $cron_item['minute'] = "{$cron_min}";
- $cron_item['hour'] = "{$cron_hour}";
- $cron_item['mday'] = "{$cron_day}";
- $cron_item['month'] = "{$cron_month}";
- $cron_item['wday'] = "{$cron_weekday}";
- $cron_item['who'] = "root";
- $cron_item['command'] = "{$g['varrun_path']}/sync.sh";
-
- $config['cron']['item'][] = $cron_item;
-
- if ($g['booting']) { echo "done\n"; }
- } // end if
-
- /* call the pfSense configure_cron function */
- configure_cron();
-
- /* run cron */
- mwexec("/usr/sbin/cron -s");
-
- return 0;
-}
-
-function services_rsyncclient_configure() {
- global $freenas_config, $g;
-
- // Generate a shell script that is used by cron
- // Generate crontab works
- if (isset($freenas_config['rsyncclient']['enable'])) {
- if ($g['booting']) { echo "Generating synchronizing cron script... "; }
-
- /* generate /var/run/sync.sh script */
- $fd = fopen("{$g['varrun_path']}/sync.sh", "w");
-
- if (!$fd) {
- printf("Error: cannot open /var/run/sync.sh in services_rsyncclient_configure().\n");
- return 1;
- }
-
- $syncscript = <<<EOD
-#!/bin/sh
-
-if [ -r /var/run/rsync-running ]; then
-exit
-fi
-/usr/bin/touch /var/run/rsync-running
-
-EOD;
-
- $opt_delete="";
- if (isset($freenas_config['rsyncclient']['opt_delete'])) {
- $opt_delete = "--delete --delete-after ";
- }
-
- foreach ($freenas_config['rsyncclient']['sharetosync'] as $sharek => $sharev) {
- $syncscript .= <<<EOD
-/usr/local/bin/rsync -rtz {$opt_delete}rsync://{$freenas_config['rsyncclient']['rsyncserverip']}/{$sharev} /mnt/{$sharev}
-
-EOD;
- } // end foreach
-
- $syncscript .= <<<EOD
-/bin/rm -f /var/run/rsync-running
-
-EOD;
-
- fwrite($fd,$syncscript);
- fclose($fd);
-
- /* Add exectutive right to the script */
- exec("/bin/chmod 770 {$g['varrun_path']}/sync.sh");
-
- if ($g['booting']) { echo "done\n"; }
- } // end if
-
- return 0;
-}
-
-function services_rsync_local_configure() {
- global $freenas_config, $g;
-
- // Generate a shell script that is used by cron
- // Generate crontab works
- if (isset($freenas_config['rsync_local']['enable'])) {
- if ($g['booting']) { echo "Generating local rsync cron script... "; }
-
- /* generate /var/run/sync_local.sh script */
- $fd = fopen("{$g['varrun_path']}/sync_local.sh", "w");
-
- if (!$fd) {
- printf("Error: cannot open /var/run/sync_local.sh in services_rsync_local_configure().\n");
- return 1;
- }
-
- $syncscript = <<<EOD
-#!/bin/sh
-
-if [ -r /var/run/rsync_local-running ]; then
-exit
-fi
-/usr/bin/touch /var/run/rsync_local-running
-
-EOD;
-
- $opt_delete="";
- if (isset($freenas_config['rsync_local']['opt_delete'])) {
- $opt_delete = "--delete --delete-after ";
- }
-
- $syncscript .= <<<EOD
-/usr/local/bin/rsync -a {$opt_delete} /mnt/{$freenas_config['rsync_local']['source']} /mnt/{$freenas_config['rsync_local']['destination']}
-
-EOD;
-
- $syncscript .= <<<EOD
-/bin/rm -f /var/run/rsync_local-running
-
-EOD;
-
- fwrite($fd,$syncscript);
- fclose($fd);
-
- /* Add exectutive right to the script */
- exec("/bin/chmod 770 {$g['varrun_path']}/sync_local.sh");
-
- if ($g['booting']) { echo "done\n"; }
- } // end if
-
- return 0;
-}
-
-function services_radius_configure() {
- global $freenas_config, $g;
-
- if (isset($config['radius']['enable'])) {
- /* generate radius.conf */
- $fd = fopen("{$g['varetc_path']}/radius.conf", "w");
-
- if (!$fd) {
- printf("Error: cannot open radius.conf in services_radius_configure().\n");
- return 1;
- }
-
- $radiusconf = <<<EOD
-auth {$config['radius']['radiusip']}:{$config['radius']['port']} {$config['radius']['secret']} {$config['radius']['timeout']} {$config['radius']['maxretry']}
-
-EOD;
-
- fwrite($fd, $radiusconf);
- fclose($fd);
- } // end if
-
- return 0;
-}
-
-/* Stop, Generate the config file and start
- * AFP Return 0 if OK, 1 or error code if error
- */
-function services_afpd_configure() {
- global $freenas_config, $config, $g;
-
- /* kill any afpd */
- killbyname("afpd");
-
- if (isset($freenas_config['afp']['enable'])) {
- /* If no share configured, exit */
- if (!is_array($freenas_config['mounts']['mount'])) { return 1; }
- if ($g['booting']) { echo "Starting AFP server... "; }
-
- if (empty($freenas_config['afp']['afpname'])) {
- $afpname="-";
- } else {
- $afpname=$freenas_config['afp']['afpname'];
- }
-
- /* generate afpd.conf */
- $fd = fopen("{$g['varetc_path']}/afpd.conf", "w");
-
- if (!$fd) {
- printf("Error: cannot open afpd.conf in services_afpd_configure().\n");
- return 1;
- }
-
- $afpconf = <<<EOD
-{$afpname} -transall -uamlist
-EOD;
-
- if (empty($config['system']['zeroconf_disable'])) {
- $afpconf .= <<<EOD
- -noslp -fqdn {$config['system']['hostname']}.{$config['system']['domain']} -uamlist
-EOD;
- } else {
- $afpconf .= <<<EOD
- -noslp -nozeroconf -uamlist
-EOD;
- } // end if
-
- if (isset($freenas_config['afp']['guest']) && isset($freenas_config['afp']['local']) ) {
- $afpconf .= <<<EOD
- uams_guest.so,uams_clrtxt.so,uams_dhx.so
-EOD;
- } else if (isset($freenas_config['afp']['guest'])) {
- $afpconf .= <<<EOD
- uams_guest.so
-EOD;
- } else if (isset($freenas_config['afp']['local'])) {
- $afpconf .= <<<EOD
- uams_clrtxt.so,uams_dhx.so
-EOD;
- }
-
- $afpconf .= <<<EOD
- -nosavepassword -defaultvol {$g['varetc_path']}/AppleVolumes.default -systemvol {$g['varetc_path']}/AppleVolumes.system -uampath /etc/uams -guestname ftp
-
-EOD;
-
- fwrite($fd, $afpconf);
- fclose($fd);
-
- /* generate AppleVolumes.default */
- $fd = fopen("{$g['varetc_path']}/AppleVolumes.default", "w");
-
- if (!$fd) {
- printf("Error: cannot open AppleVolumes.default in services_afpd_configure().\n");
- return 1;
- }
-
- $a_mount = &$freenas_config['mounts']['mount'];
-
- foreach ($a_mount as $mount) {
- $AppleVolumes .= <<<EOD
-/mnt/{$mount['sharename']} "{$mount['sharename']}"
-
-EOD;
-
- } // end foreach
-
- fwrite($fd, $AppleVolumes);
- fclose($fd);
-
- /* run afpdpd */
- mwexec("/usr/local/sbin/afpd -F {$g['varetc_path']}/afpd.conf");
-
- if ($g['booting']) { echo "done\n"; }
- } // end if
-
- return 0;
-}
-
-function services_nis_configure() {
- global $freenas_config, $g;
-
- return 0;
-}
-
-/* Start iscsi initiator
- * Return 0 if Ok, 1 or error code if problem
- */
-/* TODO: NEED TO STOP IT TOO ??? */
-function services_iscsi_configure() {
- global $freenas_config, $g;
-
- if (isset($freenas_config['iscsi']['enable'])) {
- if ($g['booting']) { echo "Starting iSCSI driver... "; }
-
- $result = mwexec("/sbin/kldload kdload /boot/kernel/iscsi_initiator.ko");
- $result |= mwexec("/sbin/sysctl debug.iscsi=0");
- $result |= mwexec("/usr/local/sbin/iscontrol targetaddress={$freenas_config['iscsi']['targetaddress']} TargetName={$freenas_config['iscsi']['targetname']}");
-
- if ($g['booting']) { echo "done\n"; }
- }
-
- if (isset($result)) { return $result; }
- return 0;
-}
-
-function services_zeroconf_configure() {
- //services_mdnsresponder_configure();
- //services_howl_configure();
- return services_avahi_configure();
-}
-
-function services_avahi_configure() {
- global $freenas_config, $config, $g;
-
- $service_template = <<<EOD
-<?xml version="1.0" standalone='no'?>
-<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
-<service-group>
-
- <name replace-wildcards="yes">@SERVICE_DESC@ on %h</name>
-
- <service>
- <type>@TYPE@</type>
- <port>@PORT@</port>
- @TXT_RECORDS@
- </service>
-
-</service-group>
-
-EOD;
-
- /* kill any running dbus daemon */
- sigkillbypid("{$g['varrun_path']}/dbus/dbus.pid", "TERM");
-
- unlink_if_exists("{$g['varrun_path']}/dbus/dbus.pid");
-
- /* kill any running avahi daemons */
- mwexec("/usr/local/sbin/avahi-daemon -k");
-
- /* simply return if zeroconf isn't enabled */
- if (isset($config['system']['zeroconf_disable'])) { return 0; }
-
- /* configure Avahi and it's dependencies */
- if (! file_exists("/usr/local/etc/avahi/services")) {
- mwexec("mkdir -p /usr/local/etc/avahi/services");
- }
-
- /* add HTTP service type */
- $webproto = $config['system']['webgui']['protocol'];
-
- if (isset($config['system']['webgui']['port'])) {
- $webservice = str_replace("@PORT@",
- $config['system']['webgui']['port'],
- $service_template);
- $webservice = str_replace("@TYPE@",
- "_{$webproto}._tcp",
- $webservice);
- $webservice = str_replace("@SERVICE_DESC@",
- "pfSense webGUI",
- $webservice);
- $webservice = str_replace("@TXT_RECORDS@",
- "",
- $webservice);
-
- file_put_contents("/usr/local/etc/avahi/services/http.service", $webservice);
- } else {
- $webservice = str_replace("@PORT@",
- "80",
- $service_template);
- $webservice = str_replace("@TYPE@",
- "_{$webproto}._tcp",
- $webservice);
- $webservice = str_replace("@SERVICE_DESC@",
- "pfSense webGUI",
- $webservice);
- $webservice = str_replace("@TXT_RECORDS@",
- "",
- $webservice);
-
- file_put_contents("/usr/local/etc/avahi/services/http.service", $webservice);
- } // end if
-
- /* afp is announcing itself */
- if (isset($freenas_config['afp']['enable'])) {
- /* NOP */
- }
-
- /* add rsync service type */
- if (isset($freenas_config['rsyncd']['enable'])) {
- $rsyncservice = str_replace("@PORT@",
- $freenas_config['rsyncd']['port'],
- $service_template);
- $rsyncservice = str_replace("@TYPE@",
- "_rsync._tcp",
- $rsyncservice);
- $rsyncservice = str_replace("@SERVICE_DESC@",
- "Remote Sync Daemon",
- $rsyncservice);
- $rsyncservice = str_replace("@TXT_RECORDS@",
- "",
- $rsyncservice);
-
- file_put_contents("/usr/local/etc/avahi/services/rsync.service", $rsyncservice);
- } // end if
-
- /* add ntp service type */
- if ($config['ntpd']['mode'] == "server") {
- $ntpdservice = str_replace("@PORT@",
- "123",
- $service_template);
- $ntpdservice = str_replace("@TYPE@",
- "_ntp._udp",
- $ntpdservice);
- $ntpdservice = str_replace("@SERVICE_DESC@",
- "Network Time Daemon",
- $ntpdservice);
- $ntpdservice = str_replace("@TXT_RECORDS@",
- "",
- $ntpdservice);
-
- file_put_contents("/usr/local/etc/avahi/services/ntpd.service", $ntpdservice);
- } // end if
-
- if (isset($config['system']['ssh']['enable'])) {
- $sshservice = str_replace("@PORT@",
- "22",
- $service_template);
- $sshservice = str_replace("@TYPE@",
- "_ssh._tcp",
- $sshservice);
- $sshservice = str_replace("@SERVICE_DESC@",
- "Remote Terminal",
- $sshservice);
- $sshservice = str_replace("@TXT_RECORDS@",
- "",
- $sshservice);
-
- file_put_contents("/usr/local/etc/avahi/services/ssh.service", $sshservice);
-
- /* do the same for sftp, cause we do enable it by dfeault */
- $sftpservice = str_replace("@PORT@",
- "22",
- $service_template);
- $sftpservice = str_replace("@TYPE@",
- "_ssh._tcp",
- $sftpservice);
- $sftpservice = str_replace("@SERVICE_DESC@",
- "Remote Terminal",
- $sftpservice);
- $sftpservice = str_replace("@TXT_RECORDS@",
- "",
- $sftpservice);
-
- file_put_contents("/usr/local/etc/avahi/services/ssh-sftp.service", $sftpservice);
- } // end if
-
- /* we are using wzdftpd, which has the ability to announce itself */
- if (isset($freenas_config['ftp']['enable'])) {
- /* NOP */
- }
-
- if (isset($freenas_config['samba']['enable'])) {
- $cifsservice = str_replace("@PORT@",
- "139",
- $service_template);
- $cifsservice = str_replace("@TYPE@",
- "_smb._tcp",
- $cifsservice);
- $cifsservice = str_replace("@SERVICE_DESC@",
- "Samba Server",
- $cifsservice);
- $cifsservice = str_replace("@TXT_RECORDS@",
- "",
- $cifsservice);
-
- file_put_contents("/usr/local/etc/avahi/services/cifs.service", $cifsservice);
- }
-
- if (isset($freenas_config['nfs']['enable'])) {
- /* If no share configured, exit */
- if (!is_array($freenas_config['mounts']['mount'])) { break; }
-
- $a_mount = &$freenas_config['mounts']['mount'];
-
- foreach ($a_mount as $mount) {
- $sharename = str_replace(" ", "", $mount['sharename']);
- $sharename = strtolower($sharename);
-
- $nfsservice = str_replace("@PORT@",
- "2049",
- $service_template);
- $nfsservice = str_replace("@TYPE@",
- "_nfs._tcp",
- $nfsservice);
- $nfsservice = str_replace("@SERVICE_DESC@",
- "NFS Mount: {$mount['sharename']}",
- $nfsservice);
- $nfsservice = str_replace("@TXT_RECORDS@",
- "path=/mnt/{$mount['sharename']}",
- $nfsservice);
-
- file_put_contents("/usr/local/etc/avahi/services/{$sharename}_nfs.service", $nfsservice);
- } // end foreach
- } // end if
-
- /* run dbus */
- mwexec("/usr/local/bin/dbus-daemon --system");
- /* run avahi */
- mwexec("/usr/local/sbin/avahi-daemon -D");
-
- if ($g['booting']) { echo "done\n"; }
-
- return 0;
-}
-
-/* this function is currently not used */
-function services_howl_configure() {
- global $freenas_config, $config, $g;
-
- /* kill any mDNSResponder */
- killbyname("mDNSResponder");
-
- if (isset($config['system']['zeroconf_disable'])) { return 0; }
-
- $fd = fopen("{$g['varetc_path']}/mDNSResponder.conf", "w");
-
- if (!$fd) {
- printf("Error: cannot open mDNSResponder.conf in services_howl_configure().\n");
- return 1;
- }
-
- if ($config['system']['webgui']['port']) {
- $mDNSResponder = <<<EOD
-"{$config['system']['hostname']} Web Admin" _http._tcp local. {$config['system']['webgui']['port']}
-
-EOD;
- } else {
- $mDNSResponder = <<<EOD
-"{$config['system']['hostname']} Web Admin" _http._tcp local. 80
-
-EOD;
- } // end if
-
- if (isset($freenas_config['afp']['enable'])) {
- $mDNSResponder .= <<<EOD
-"{$config['system']['hostname']} AFP Server" _afpovertcp._tcp local. 548
-
-EOD;
- }
-
- if (isset($freenas_config['rsyncd']['enable'])) {
- $mDNSResponder .= <<<EOD
-"{$config['system']['hostname']} RSYNC Server" _rsync._tcp. local. {$freenas_config['rsyncd']['port']}
-
-EOD;
- }
-
- if (isset($config['sshd']['enable'])) {
- $mDNSResponder .= <<<EOD
-"{$config['system']['hostname']} SSH Server" _ssh._tcp local. {$config['sshd']['port']}
-
-EOD;
- }
-
- if (isset($freenas_config['ftp']['enable'])) {
- $mDNSResponder .= <<<EOD
-"{$config['system']['hostname']} FTP Server" _ftp._tcp local. {$freenas_config['ftp']['port']}
-
-EOD;
- }
-
- if (isset($freenas_config['samba']['enable'])) {
- $mDNSResponder .= <<<EOD
-"{$config['system']['hostname']} Samba Server" _smb._tcp local. 139
-
-EOD;
- }
-
- if (isset($freenas_config['nfs']['enable'])) {
- /* If no share configured, exit */
- if (!is_array($freenas_config['mounts']['mount'])) { break; }
-
- $a_mount = &$freenas_config['mounts']['mount'];
-
- foreach ($a_mount as $mount) {
- $mDNSResponder .= <<<EOD
-"{$config['system']['hostname']} NFS: {$mount['sharename']}" _nfs._tcp local. 2049 path=/mnt/{$mount['sharename']}
-
-EOD;
- } // end foreach
- } // end if
-
- fwrite($fd, $mDNSResponder);
- fclose($fd);
-
-
- /* run mDNSResponder */
- mwexec("/usr/local/sbin/mDNSResponder -f {$g['varetc_path']}/mDNSResponder.conf");
-
- if ($g['booting']) { echo "done\n"; }
-
- return 0;
-}
-
-/* this function is currently not used */
-function services_mdnsresponder_configure() {
- global $freenas_config, $config, $g;
-
- /* kill any running snmpd */
- sigkillbypid("{$g['varrun_path']}/mDNSResponder.pid", "TERM");
-
- if (isset($config['system']['zeroconf_disable'])) { return 0; }
-
- $fd = fopen("{$g['varetc_path']}/mDNSResponder.conf", "w");
-
- if (!$fd) {
- printf("Error: cannot open mDNSResponder.conf in services_bonjour_configure().\n");
- return 1;
- }
-
- if ($config['system']['webgui']['port']) {
- $mDNSResponder = <<<EOD
-"{$config['system']['hostname']} Web Admin"
-_http._tcp local.
-{$config['system']['webgui']['port']}
-
-EOD;
- } else {
- $mDNSResponder = <<<EOD
-"{$config['system']['hostname']} Web Admin"
-_http._tcp local.
-80
-
-EOD;
- } // end if
-
- if (isset($freenas_config['afp']['enable'])) {
- $mDNSResponder .= <<<EOD
-
-"{$config['system']['hostname']} AFP Server"
-_afpovertcp._tcp local.
-548
-
-EOD;
- }
-
- if (isset($freenas_config['rsyncd']['enable'])) {
- $mDNSResponder .= <<<EOD
-
-"{$config['system']['hostname']} RSYNC Server"
-_rsync._tcp. local.
-{$freenas_config['rsyncd']['port']}
-
-EOD;
- }
-
- if (isset($config['sshd']['enable'])) {
- $mDNSResponder .= <<<EOD
-
-"{$freenas_config['system']['hostname']} SSH Server"
-_ssh._tcp local.
-{$config['sshd']['port']}
-
-EOD;
- }
-
- if (isset($freenas_config['ftp']['enable'])) {
- $mDNSResponder .= <<<EOD
-
-"{$config['system']['hostname']} FTP Server"
-_ftp._tcp local.
-{$freenas_config['ftp']['port']}
-
-EOD;
- }
-
- if (isset($freenas_config['samba']['enable'])) {
- $mDNSResponder .= <<<EOD
-
-"{$config['system']['hostname']} Samba Server"
-_smb._tcp local.
-139
-
-EOD;
- }
-
- if (isset($freenas_config['nfs']['enable'])) {
- /* If no share configured, exit */
- if (!is_array($freenas_config['mounts']['mount'])) { break; }
-
- $a_mount = &$freenas_config['mounts']['mount'];
-
- foreach ($a_mount as $mount) {
- $mDNSResponder .= <<<EOD
-
-"{$config['system']['hostname']} NFS: {$mount['sharename']}"
-_nfs._tcp local.
-2049 path=/mnt/{$mount['sharename']}
-
-EOD;
- } // end foreach
- }
-
- fwrite($fd, $mDNSResponder);
- fclose($fd);
-
-
- /* run mDNSResponder */
- mwexec("/usr/local/sbin/mDNSResponderPosix -b -f {$g['varetc_path']}/mDNSResponder.conf");
-
- if ($g['booting']) { echo "done\n"; }
-
- return 0;
-}
-?> \ No newline at end of file
diff --git a/config/archive/freenas/pkg/freenas_system.inc b/config/archive/freenas/pkg/freenas_system.inc
deleted file mode 100644
index 2bd0a30a..00000000
--- a/config/archive/freenas/pkg/freenas_system.inc
+++ /dev/null
@@ -1,838 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- freenas_system.inc
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-require_once("globals.inc");
-
-$freenas_config =& $config['installedpackages']['freenas']['config'][0];
-
-function system_do_extensions($early = false) {
- global $config, $g;
-
- if (!is_dir("{$g['etc_path']}/inc/ext")) { return; }
-
- $dh = @opendir("{$g['etc_path']}/inc/ext");
-
- if ($dh) {
- while (($extd = readdir($dh)) !== false) {
- if (($extd === ".") || ($extd === "..")) { continue; }
-
- $rcfile = "{$g['etc_path']}/inc/ext/" . $extd . "/" . ($early ? "rc.early" : "rc");
-
- if (file_exists($rcfile)) { passthru($rcfile); }
- } // end while
-
- closedir($dh);
- } // end if
-}
-
-function system_set_termcap() {
- global $config;
-
- if (isset($config['diag']['ipfstatentries'])) {
- $lines = $config['diag']['ipfstatentries'] + 6;
- } else {
- $lines = 306;
- }
-
- /* do not remove the tabs below or replace them using whitespaces */
- $termcap = <<<EOD
-cons25w|ansiw|ansi80x25-raw:\
- :am:bs:NP:ms:pt:AX:eo:bw:ut:km:\
- :co#80:li#25:pa#64:Co#8:it#8:\
- :al=\E[L:cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:\
- :dc=\E[P:dl=\E[M:do=\E[B:bt=\E[Z:ho=\E[H:ic=\E[@:cb=\E[1K:\
- :nd=\E[C:rs=\Ec:so=\E[7m:se=\E[27m:up=\E[A:cr=^M:ta=^I:\
- :AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:sc=\E7:rc=\E8:\
- :k1=\E[M:k2=\E[N:k3=\E[O:k4=\E[P:k5=\E[Q:k6=\E[R:k7=\E[S:k8=\E[T:\
- :k9=\E[U:k;=\E[V:F1=\E[W:F2=\E[X:K2=\E[E:nw=\E[E:ec=\E[%dX:\
- :kb=^H:kh=\E[H:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:le=^H:sf=\E[S:sr=\E[T:\
- :kN=\E[G:kP=\E[I:@7=\E[F:kI=\E[L:kD=\\177:kB=\E[Z:\
- :IC=\E[%d@:DC=\E[%dP:SF=\E[%dS:SR=\E[%dT:AL=\E[%dL:DL=\E[%dM:\
- :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:cv=\E[%i%dd:ch=\E[%i%d`:\
- :mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:bl=^G:\
- :ve=\E[=S:vi=\E[=1S:vs=\E[=2S:
-cons25|ansis|ansi80x25:\
- :ac=l\\332m\\300k\\277j\\331u\\264t\\303v\\301w\\302q\\304x\\263n\\305`^Da\\260f\\370g\\361~\\371.^Y-^Xh\\261i^U0\\333y\\363z\\362:\
- :tc=cons25w:
-dumb|su|unknown:\
- :am:co#132:li#$lines:do=^J:
-xterm-noapp|xterm with cursor keys in normal mode:\
- :kl=\E[D:kd=\E[B:kr=\E[C:ku=\E[A:ks=\E=:ke=\E>:ti@:te@:tc=xterm:
-xterm|xterm-color|X11 terminal emulator:\
- :ti@:te@:tc=xterm-xfree86:
-xterm-xfree86|XFree86 xterm:\
- :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\
- :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\
- :k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\
- :kH=\EOF:@7=\EOF:kI=\E[2~:\
- :kh=\EOH:*6=\EOF:kP=\E[5~:kN=\E[6~:\
- :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:Km=\E[M:tc=xterm-basic:
-xterm-basic|xterm common (XFree86):\
- :li#24:co#80:am:kn#12:km:mi:ms:xn:bl=^G:\
- :is=\E[!p\E[?3;4l\E[4l\E>:rs=\E[!p\E[?3;4l\E[4l\E>:le=^H:\
- :AL=\E[%dL:DL=\E[%dM:DC=\E[%dP:al=\E[L:dc=\E[P:dl=\E[M:\
- :UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:\
- :ho=\E[H:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:\
- :im=\E[4h:ei=\E[4l:ks=\E[?1h\E=:ke=\E[?1l\E>:kD=\E[3~:kb=^H:\
- :sf=\n:sr=\EM:st=\EH:ct=\E[3g:sc=\E7:rc=\E8:\
- :eA=\E(B\E)0:as=^N:ae=^O:ml=\El:mu=\Em:up=\E[A:nd=\E[C:\
- :md=\E[1m:me=\E[m^O:mr=\E[7m:so=\E[7m:se=\E[27m:us=\E[4m:ue=\E[24m:\
- :ti=\E[?1049h:te=\E[?1049l:vi=\E[?25l:ve=\E[?25h:\
- :ut:Co#8:pa#64:op=\E[39;49m:AB=\E[4%dm:AF=\E[3%dm:\
-
-EOD;
-
- if (!file_exists("/usr/share/misc")) { mkdir("/usr/share/misc"); }
-
- $fd = @fopen("/usr/share/misc/termcap", "w");
-
- if (!$fd) {
- printf("Error: cannot open termcap in system_set_termcap().\n");
- return 1;
- }
-
- chmod("/usr/share/misc/termcap", 0644);
- fwrite($fd, $termcap);
- fclose($fd);
-
- return 0;
-}
-
-/* TODO: Figure out whether this function can be removed cause
- * implements its own user management framework.
- */
-function system_users_create() {
- /* Create All the passwd file */
- global $config, $g;
-
- if ($g['booting']) { echo "Generating user database... "; }
-
- system_user_masterpasswd();
- system_user_group();
- system_user_pwdmkdb();
-
- if ($g['booting']) { echo "done\n"; }
-
- return 0;
-}
-
-/* TODO: Figure out whether this function can be removed cause
- * implements its own user management framework.
- */
-function system_user_masterpasswd() {
- /* Create the master.passwd file*/
- global $config, $g, $userindex, $groupindex;
- $root = getUNIXRoot();
-
- $masterpasswd = <<<EOD
-root:{$root['password']}:0:0::0:0:Charlie &:/root:/bin/sh
-toor:*:0:0::0:0:Bourne-again Superuser:/root:
-daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin
-operator:*:2:5::0:0:System &:/:/usr/sbin/nologin
-bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin
-tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin
-kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin
-smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin
-mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin
-proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin
-_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin
-www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
-nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin
-dhcpd:*:1002:1002::0:0:DHCP Daemon:/nonexistent:/sbin/nologin
-_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin
-_isakmpd:*:68:68::0:0:isakmpd privsep:/var/empty:/sbin/nologin
-ftp:*:21:50::0:0:FTP user:/mnt:/sbin/nologin
-sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
-
-EOD;
-
- if (is_array($config['system']['user'])) {
- foreach ($config['system']['user'] as $user) {
- $password= $user['password'];
- $groupname = $user['groupname'];
- $group =& $config['system']['group'][$groupindex[$groupname]];
-
- if (empty($user['uid'])) {
- $newuser = assignUID($user['name']);
- $newgroup = assignGID($groupname);
- if (! empty($newuser)) { $user = $newuser; }
- if (! empty($newgroup)) { $group = $newgroup; }
- }
-
- if (hasShellAccess($user['name'])) {
- $masterpasswd .= <<<EOD
-{$user['name']}:{$password}:{$user['uid']}:{$group['gid']}::0:0:{$user['fullname']}:/mnt:/etc/rc.initial
-
-EOD;
- } else {
- $masterpasswd .= <<<EOD
-{$user['name']}:{$password}:{$user['uid']}:{$group['gid']}::0:0:{$user['fullname']}:/mnt:/usr/local/bin/scponly
-
-EOD;
- } // end if
- } // end foreach
- } // end if
-
- $fd = fopen("/etc/master.passwd", "w");
-
- if (!$fd) {
- printf("Error: cannot open master.passwd in system_user_masterpasswd().\n");
- return 1;
- }
-
- fwrite($fd, $masterpasswd);
- fclose($fd);
-
-return 0;
-}
-
-/* TODO: Figure out whether this function can be removed cause
- * implements its own user management framework.
- */
-function system_user_group() {
- /* Create the group file*/
- global $config, $g;
-
- $groupfile = <<<EOD
-wheel:*:0:root
-EOD;
-
- /* If user exist with full shell, put them on the wheel group */
- if (is_array($config['system']['user'])) {
- foreach ($config['system']['user'] as $user) {
- if (hasShellAccess($user['name']) && isSystemAdmin($user['name'])) {
- $groupfile .= <<<EOD
-,{$user['name']}
-EOD;
- } // end if
- } // end foreach
- } // end if
-
- $groupfile .= <<<EOD
-
-daemon:*:1:
-kmem:*:2:
-sys:*:3:
-tty:*:4:
-operator:*:5:root
-mail:*:6:
-bin:*:7:
-staff:*:20:
-EOD;
-
- /* If user exist without full shell, put them on the staff group */
- if (is_array($config['system']['user'])) {
- foreach ($config['system']['user'] as $user) {
- if (hasShellAccess($user['name'])) {
- $groupfile .= <<<EOD
-{$user['name']},
-EOD;
- } // end if
- } // end foreach
- } // end if
-
- $groupfile .= <<<EOD
-
-sshd:*:22:
-smmsp:*:25:
-mailnull:*:26:
-guest:*:31:
-proxy:*:62:
-_pflogd:*:64:
-_dhcp:*:65:
-ftp:*:50:
-authpf:*:63:
-network:*:69:
-www:*:80:
-nogroup:*:65533:
-nobody:*:65534:
-admin:*:0:
-
-EOD;
-
- if (is_array($config['system']['group'])) {
- foreach ($config['system']['group'] as $group) {
- if (empty($group['gid'])) {
- $newgroup = assignGID($group['name']);
- if (! empty($newgroup)) { $group = $newgroup; }
- }
-
- $groupfile .= <<<EOD
-{$group['name']}:*:{$group['gid']}:
-
-EOD;
- } // end foreach
- } // end if
-
- $fd = fopen("/etc/group", "w");
-
- if (!$fd) {
- printf("Error: cannot open group in system_user_group().\n");
- return 1;
- }
-
- fwrite($fd, $groupfile);
- fclose($fd);
-
- return 0;
-}
-
-function system_user_pwdmkdb() {
- /* Generate the db of password */
- global $config, $g;
-
- mwexec("/usr/sbin/pwd_mkdb -p -d /etc /etc/master.passwd");
-
- return 0;
-}
-
-function system_user_samba() {
- /* Generate the db of password */
-
- // TODO: MUST FIND A WAY OF USING UNIX CRYPTED PASSWORD IN THE PLACE OF CLEAR TEXT PASSWORD FOR GENERATING SAMBA DB!!!
-
- global $config, $g;
-
- if (is_array($config['system']['user'])) {
- foreach ($config['system']['user'] as $user) {
- /* TODO: the password in config.xml is already encrypted */
- $password = escapeshellcmd($user['password']);
- $login = escapeshellcmd($user['name']);
- mwexec("(/bin/echo {$password}; /bin/echo {$password}) | /usr/local/bin/smbpasswd -s -a {$login}");
- //mwexec("(/bin/echo {$password}; /bin/echo {$password}) | /usr/local/bin/pdbedit -tau {$login}");
- } // end foreach
- } // end if
-
- return 0;
-
-}
-
-function system_pam_configure() {
- /* Create the pam configuration files*/
- global $config, $g;
-
- if (!file_exists("{$g['varetc_path']}/pam.d")) {
- mkdir("{$g['varetc_path']}/pam.d", 0744);
- }
-
- $system = <<<EOD
-# System-wide defaults
-# auth
-auth sufficient pam_opie.so no_warn no_fake_prompts
-auth requisite pam_opieaccess.so no_warn allow_local
-
-EOD;
-
- if (isset($config['ad']['enable'])) {
- $system .= <<<EOD
-#auth sufficient /usr/local/lib/pam_winbind.so debug try_first_pass
-
-EOD;
- }
-
- $system .= <<<EOD
-auth required pam_unix.so no_warn try_first_pass nullok
-
-# account
-
-EOD;
-
- if (isset($config['ad']['enable'])) {
- $system .= <<<EOD
-#account sufficient /usr/local/lib/pam_winbind.so
-
-EOD;
- }
-
- $system .= <<<EOD
-account required pam_login_access.so
-account required pam_unix.so
-
-# session
-session required pam_lastlog.so no_fail
-
-# password
-
-EOD;
-
- if (isset($config['ad']['enable'])) {
- $system .= <<<EOD
-#password sufficient /usr/local/lib/pam_winbind.so debug try_first_pass
-
-EOD;
- }
-
- $system .= <<<EOD
-password required pam_unix.so no_warn try_first_pass
-
-EOD;
-
- $fd = fopen("{$g['varetc_path']}/pam.d/system", "w");
-
- if (!$fd) {
- printf("Error: cannot open /pam.d/system in system_pam_configure().\n");
- return 1;
- }
-
- fwrite($fd, $system);
- fclose($fd);
-
- $sshd .= <<<EOD
-# PAM configuration for the "sshd" service
-
-# auth
-auth required pam_nologin.so no_warn
-auth sufficient pam_opie.so no_warn no_fake_prompts
-auth requisite pam_opieaccess.so no_warn allow_local
-
-EOD;
-
- if (isset($config['ad']['enable'])) {
- $sshd .= <<<EOD
-auth sufficient /usr/local/lib/pam_winbind.so debug try_first_pass
-
-EOD;
- }
-
- $sshd .= <<<EOD
-auth required pam_unix.so no_warn try_first_pass
-
-# account
-
-EOD;
-
- if (isset($config['ad']['enable'])) {
- $sshd .= <<<EOD
-account sufficient /usr/local/lib/pam_winbind.so
-
-EOD;
- }
-
- $sshd .= <<<EOD
-account required pam_unix.so
-
-# session
-session required pam_permit.so
-
-# password
-
-EOD;
-
- if (isset($config['ad']['enable'])) {
- $sshd .= <<<EOD
-password sufficient /usr/local/lib/pam_winbind.so debug try_first_pass
-
-EOD;
- }
-
- $sshd .= <<<EOD
-password required pam_unix.so no_warn try_first_pass
-
-EOD;
-
- unset($fd);
- $fd = fopen("{$g['varetc_path']}/pam.d/sshd", "w");
-
- if (!$fd) {
- printf("Error: cannot open /pam.d/sshd in system_pam_configure().\n");
- return 1;
- }
-
- fwrite($fd, $sshd);
- fclose($fd);
-
- $ftp = <<<EOD
-# PAM configuration for the "ftpd" service
-
-# auth
-auth required pam_nologin.so no_warn
-auth sufficient pam_opie.so no_warn no_fake_prompts
-auth requisite pam_opieaccess.so no_warn allow_local
-
-EOD;
-
- if (isset($config['ad']['enable'])) {
- $ftp .= <<<EOD
-auth sufficient /usr/local/lib/pam_winbind.so debug try_first_pass
-
-EOD;
- }
-
- $ftp .= <<<EOD
-auth required pam_unix.so no_warn try_first_pass
-
-# account
-
-EOD;
-
- if (isset($config['ad']['enable'])) {
- $ftp .= <<<EOD
-account sufficient /usr/local/lib/pam_winbind.so
-
-EOD;
- }
-
- $ftp .= <<<EOD
-account required pam_login_access.so
-account required pam_unix.so
-
-# session
-session required pam_permit.so
-
-EOD;
-
- unset($fd);
- $fd = fopen("{$g['varetc_path']}/pam.d/ftp", "w");
-
- if (!$fd) {
- printf("Error: cannot open /pam.d/ftp in system_pam_configure().\n");
- return 1;
- }
-
- fwrite($fd, $ftp);
- fclose($fd);
-
- $login = <<<EOD
-# PAM configuration for the "login" service
-#
-
-# auth
-auth required pam_nologin.so no_warn
-
-EOD;
-
- if (isset($config['ad']['enable'])) {
- $login .= <<<EOD
-auth sufficient /usr/local/lib/pam_winbind.so debug try_first_pass
-
-EOD;
- }
-
- $login .= <<<EOD
-auth sufficient pam_self.so no_warn
-auth include system
-
-# account
-
-EOD;
-
- if (isset($config['ad']['enable'])) {
- $login .= <<<EOD
-account sufficient /usr/local/lib/pam_winbind.so
-
-EOD;
- }
-
- $login .= <<<EOD
-account requisite pam_securetty.so
-account include system
-
-# session
-session include system
-
-# password
-password include system
-
-EOD;
-
- unset($fd);
- $fd = fopen("{$g['varetc_path']}/pam.d/login", "w");
-
- if (!$fd) {
- printf("Error: cannot open /pam.d/login in system_pam_configure().\n");
- return 1;
- }
-
- fwrite($fd, $login);
- fclose($fd);
-
- unset($fd);
-
- /* Create the nsswitch.conf file*/
- if (isset($config['ad']['enable'])) {
- $nsswitch = <<<EOD
-group: files winbind
-group_compat: nis
-hosts: files dns wins
-networks: files
-passwd: files winbind
-passwd_compat: nis
-shells: files
-
-EOD;
- } else {
- $nsswitch = <<<EOD
-group: compat
-group_compat: nis
-hosts: files dns
-networks: files
-passwd: compat
-passwd_compat: nis
-shells: files
-
-EOD;
- } // end if
-
- $fd = fopen("{$g['varetc_path']}/nsswitch.conf", "w");
-
- if (!$fd) {
- printf("Error: cannot open /var/etc/nsswitch.conf in system_pam_configure().\n");
- return 1;
- }
-
- fwrite($fd, $nsswitch);
- fclose($fd);
-
- unset($fd);
-
- return 0;
-}
-
-function system_tuning() {
- /* fine tune kernel value */
- global $config, $g;
-
- if (isset($config['system']['tune'])) {
- if ($g['booting']) { echo 'Tuning the system... '; }
-
- mwexec('/sbin/sysctl net.inet.tcp.delayed_ack=0');
- mwexec('/sbin/sysctl net.inet.tcp.sendspace=65536');
- mwexec('/sbin/sysctl net.inet.tcp.recvspace=65536');
- mwexec('/sbin/sysctl net.inet.udp.recvspace=65536');
- mwexec('/sbin/sysctl net.inet.udp.maxdgram=57344');
- mwexec('/sbin/sysctl net.local.stream.recvspace=65535');
- mwexec('/sbin/sysctl net.local.stream.sendspace=65535');
- mwexec('/sbin/sysctl kern.ipc.maxsockbuf=2097152');
- mwexec('/sbin/sysctl kern.ipc.somaxconn=8192');
- /* This variable can be set on the boot conf file only: */
- /* mwexec('/sbin/sysctl kern.ipc.maxsockets=16424'); */
- mwexec('/sbin/sysctl kern.ipc.nmbclusters=60000');
- mwexec('/sbin/sysctl kern.maxfiles=65536');
- mwexec('/sbin/sysctl kern.maxfilesperproc=32768');
- mwexec('/sbin/sysctl net.inet.tcp.inflight.enable=0');
-
- if ($g['booting']) { echo "done\n"; }
- return 0;
- } else {
- /* Set the default value (if previously changed) if not booting mode */
- if (!$g['booting']) {
- mwexec('/sbin/sysctl net.inet.tcp.delayed_ack=1');
- mwexec('/sbin/sysctl net.inet.tcp.sendspace=32768');
- mwexec('/sbin/sysctl net.inet.tcp.recvspace=65536');
- mwexec('/sbin/sysctl net.inet.udp.recvspace=42080');
- mwexec('/sbin/sysctl net.inet.udp.maxdgram=9216');
- mwexec('/sbin/sysctl net.local.stream.recvspace=8192');
- mwexec('/sbin/sysctl net.local.stream.sendspace=8192');
- mwexec('/sbin/sysctl kern.ipc.maxsockbuf=262144');
- mwexec('/sbin/sysctl kern.ipc.somaxconn=128');
- /* mwexec('/sbin/sysctl kern.ipc.maxsockets=16424'); */
- mwexec('/sbin/sysctl kern.ipc.nmbclusters=3072');
- mwexec('/sbin/sysctl kern.maxfiles=1064');
- mwexec('/sbin/sysctl kern.maxfilesperproc=957');
- } // end if
-
- return 0;
- } // end if
-}
-
-/* TODO: Probably a function that is not needed */
-function system_install_mount_cd($cdrom) {
- /* Part of install process: Mount the CDROM */
- global $config, $g;
-
- /* Creating tempo directory for cdrom*/
- echo "Creating Mount point for the CDROM:\n";
- if (mwexec("/bin/mkdir /mnt/cdrom_fr_0507")) { return 1; }
-
- /* Mounting the CDROM */
- echo "Mount CDROM:\n";
- if (mwexec("/sbin/mount_cd9660 /dev/$cdrom /mnt/cdrom_fr_0507")) { return 1; }
-
- return 0;
-}
-
-/* TODO: Probably a function that is not needed */
-function system_install_init_fulldisk($harddrive) {
- /* Part of install process: Initialize the destination disk with one partition */
- global $config, $g;
-
- echo "Erasing partitions:\n";
- if (mwexec("/bin/dd if=/dev/zero of=/dev/$harddrive bs=1k count=20")) { return 1; }
-
- echo "Creating the primary partition and install simple MBR:\n";
- if (mwexec("/sbin/fdisk -BI -b /boot/mbr $harddrive")) { return 1; }
-
- /* Must wait that the /dev is upatded with the new information */
- /* There should be a more intelligent code here than this stupid timer... */
- echo "Waiting for system update..";
- $devtotest="/dev/$harddrive". "s1";
- $i=0;
-
- while (!file_exists($devtotest)) {
- sleep(1);
- echo ".";
- $i++;
-
- if ($i==20) { return 1; }
- }
- echo "\n";
-
- echo "Erasing primary partition:\n";
- if (mwexec("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($harddrive) . "s1 bs=32k count=16")) {
- return 1;
- }
-
- echo "Creating FreeBSD partition:\n";
- if (mwexec("/sbin/bsdlabel -B -w -b /boot/boot " . escapeshellarg($harddrive) ."s1 auto")) {
- return 1;
- }
-
- echo "Setting BSDlabel:\n";
-
- disks_bsdlabel($harddrive,"s1","4.2BSD");
-
- echo "Creating UFS filesystem:\n";
- if (mwexec("/sbin/newfs -U /dev/" . escapeshellarg($harddrive) . "s1")) { return 1; }
-
- return 0;
-}
-
-/* TODO: Probably a function that is not needed */
-function system_install_init_halfdisk($harddrive) {
- /* Part of install process: Initialize the destination disk with 2 partitions */
- global $config, $g;
-
- /* Create the partitions */
- fdisk_hd_install($harddrive);
-
- if (mwexec("(/bin/echo y; /bin/echo y) | /sbin/fdisk -B -b /boot/mbr $harddrive")) { return 0; }
-
- /* Must wait that the /dev is upatded with the new information */
- echo "Waiting for system update..";
-
- $devtotest="/dev/$harddrive". "s2";
- $i=0;
- while (!file_exists($devtotest)) {
- sleep(1);
- echo ".";
- $i++;
-
- if ($i==20) { return 1; }
- }
- echo "\n";
-
- echo "Creating BSD Label:\n";
- if (mwexec("/sbin/bsdlabel -B -w -b /boot/boot " . escapeshellarg($harddrive) ."s1 auto")) {
- return 1;
- }
- if (mwexec("/sbin/bsdlabel -w " . escapeshellarg($harddrive) ."s2 auto")) {
- return 1;
- }
-
- echo "Modify BSD Label information:\n";
-
- disks_bsdlabel($harddrive,"s1","4.2BSD");
- disks_bsdlabel($harddrive,"s2","4.2BSD");
-
- echo "Creating filesystem:\n";
- if (mwexec("/sbin/newfs -U /dev/" . escapeshellarg($harddrive) . "s1")) {
- return 1;
- }
- if (mwexec("/sbin/newfs -U /dev/" . escapeshellarg($harddrive) . "s2")) {
- return 1;
- }
-
- return 0;
-}
-
-/* TODO: Probably a function that is not needed */
-function system_install_mount_destdisk($harddrive) {
- /* Part of install process: Mount the destination disk */
- global $config, $g;
-
- echo "Creation tempory mouting point:\n";
- if (mwexec("/bin/mkdir /mnt/install_fr_0507")) { return 1; }
-
- echo "Mount destination disk:\n";
- if (mwexec("/sbin/mount /dev/" . escapeshellarg($harddrive) . "s1 /mnt/install_fr_0507")) {
- return 1;
- }
-
- return 0;
-}
-
-/* TODO: Probably a function that is not needed */
-function system_install_unmount() {
- /* Part of install process: Unmounting the disk */
- global $config, $g;
-
- /* Unmounting disk */
- if (mwexec("/sbin/umount /mnt/install_fr_0507")) { return 1; }
- if (mwexec("/sbin/umount /mnt/cdrom_fr_0507")) { return 1; }
-
- /* using 'rm -rf' for deleting the temp directory is too dangerous here... */
- /*
- if (mwexec("/bin/rm -rf /mnt/cdrom_fr_0507")) { return 1; }
- if (mwexec("/bin/rm -rf /mnt/install_fr_0507")) { return 1; }
- */
-
- /* Test: replace with PHP function rmdir */
- @rmdir ("/mnt/cdrom_fr_0507");
- @rmdir ("/mnt/install_fr_0507");
-
- return 0;
-}
-
-/* TODO: Probably a function that is not needed */
-function system_install_installation($harddrive) {
- /* Part of install process: dd image file on the destination disk */
- global $config, $g;
-
- echo "Installation:\n";
- if (mwexec("/usr/bin/gunzip -S \"\" -c /mnt/cdrom_fr_0507/FreeNAS-generic-pc.gz | dd of=/dev/" . escapeshellarg($harddrive) . " bs=16k > /dev/null 2>&1")) {
- return 1;
- }
-
- return 0;
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/freenas/pkg/freenas_utils.inc b/config/archive/freenas/pkg/freenas_utils.inc
deleted file mode 100644
index 6e5d8872..00000000
--- a/config/archive/freenas/pkg/freenas_utils.inc
+++ /dev/null
@@ -1,1049 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- freenas_utils.inc
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-/* returns true if $desc is a valid description (alphanum and space, _ , - , .)*/
-function is_validdesc($desc) {
- if (!is_string($desc)) { return false; }
-
- if (preg_match("/^[A-Za-z0-9]([A-Za-z0-9_\-\.\s]*[A-Za-z0-9])*$/", $desc)) {
- return true;
- } else {
- return false;
- }
-}
-
-/* returns true if $login is a valid login name (alphanum,dot, _ , -)*/
-function is_validlogin($login) {
- if (!is_string($login)) { return false; }
-
- if (preg_match("/^[A-Za-z0-9]([A-Za-z0-9_\-\.\s]*[A-Za-z0-9])*$/", $login)) {
- return true;
- } else {
- return false;
- }
-}
-
-/* returns true if $password is a valid password (not used of special : character)*/
-function is_validpassword($password) {
- if (!is_string($password)) { return false; }
-
- if (strstr($password, ':')) {
- return false;
- } else {
- return true;
- }
-}
-
-/* returns true if $login is a valid share name (alphanum,dot, _ , -)*/
-function is_validsharename($sharename) {
- if (!is_string($sharename)) { return false; }
-
- if (preg_match("/^[A-Za-z0-9]([A-Za-z0-9_\-\.\s]*[A-Za-z0-9])*$/", $sharename)){
- return true;
- } else {
- return false;
- }
-}
-
-/* Returns true if $workgroup is a valid workgroup name */
-/* A workgroup name can contain up to 15 characters, including letters, numbers, */
-/* and the following characters: ! @ # $ % ^ & ( ) _ - ; : ' " , . */
-/* It cannot contain any spaces, and must begin with a letter or number. */
-function is_workgroup($workgroup) {
- if (!is_string($workgroup)) { return false; }
-
- if (preg_match("/^[\w\d]+[\w\d\!\@\#\$\%\^\&\(\)\_\-\;\:\'\"\,\.]*$/", $workgroup)) {
- return true;
- } else {
- return false;
- }
-}
-
-function get_mounts_list()
-{
- // Return list of mounted disk
- //example: Array
- // [0] => Array
- // (
- // [mp] => /mnt/ad0s1
- // [mdisk] => ad0s1
- // )
- global $g;
-
- exec("/sbin/mount",$rawdata);
-
- $mountlist = array();
- $i=0;
-
- foreach ($rawdata as $line) {
- $aline = explode(" ", $line);
-
- if ((chop($aline[0]) == "/dev/md0") || (chop($aline[0]) == "devfs") || (chop($aline[0]) == "/dev/fd0")) {
- continue;
- }
-
- $mountlist[$i]['fullname'] = chop($aline[0]);
- $mountlist[$i]['mp'] = chop($aline[2]);
-
- // Get the complete name /dev/devicename
- $complete = explode("/",chop($aline[0]));
- $devname = $complete[2];
-
- // Test if it's a gvinum or gmirror device
- if ((strcmp($devname,"gvinum") == 0) || (strcmp($devname,"mirror") == 0)) {
- $devname = $complete[3];
- }
-
- $mountlist[$i]['mdisk']=$devname;
- $i++;
- } // end foreach
-
- return $mountlist;
-}
-
-function get_mount_use() {
- // Return list of mounted use
- // example: Array
- // [mount_point_name] => Array
- // (
- // [capacity] => 48%
- // [used] => 2.4G
- // [avail] => 2.6G
- // [size] => 5.4G
- // )
- global $freenas_config, $g;
-
- exec("/bin/df -h",$rawdata);
-
- $result = array();
-
- foreach ($rawdata as $line) {
- /* separe the line by space*/
- $aline = preg_split("/[\s,]+/", $line);
- $tmp = explode("/",chop($aline[5]));
- $mounted_on = $tmp[2];
- $capacity = chop($aline[4]);
- $avail = chop($aline[3]);
- $used = chop($aline[2]);
- $size = chop($aline[1]);
-
- if (is_array($freenas_config['mounts']['mount'])) {
- foreach ($freenas_config['mounts']['mount'] as $mountcfg) {
- if (strcmp($mounted_on,$mountcfg['sharename']) == 0) {
- $result[$mounted_on] = array();
- $result[$mounted_on]['capacity'] = $capacity;
- $result[$mounted_on]['avail'] = $avail;
- $result[$mounted_on]['used'] = $used;
- $result[$mounted_on]['size'] = $size;
- }
- } // end foreach
- } else {
- return 0;
- } // end if
- } // end foreach
-
- //print_r($result);
-
- return $result;
-}
-
-function get_sraid_disks_list() {
- /* Return list of ALL software volume: gvinum, gmirror */
- $disklist = array_merge((array)get_gvinum_disks_list(),(array)get_gmirror_disks_list(),(array)get_gconcat_disks_list(),(array)get_gstripe_disks_list(),(array)get_graid5_disks_list());
- return $disklist;
-}
-
-function get_gvinum_disks_list() {
- /* Get information about gvinum volume */
- global $g;
-
- /* Return list of Software RAID disk */
- //[volumename] => Array
- // (
- // [type] => Software RAID - gvinum
- // [desc] => UP
- // [size] => 6149 MB
- // )
-
- /* on envoie la commande d'affichage de la liste des volumes*/
- exec("/sbin/gvinum list",$rawdata);
-
- foreach ($rawdata as $line) {
- /* Split the line using the space as separator */
- $aline = preg_split("/\s+/", $line);
-
- /* Get the line that begin with the letter 'V' */
- if ($aline[0] != "V") { continue ; }
-
- $diskname = chop($aline[1]);
- $disklist[$diskname] = array();
-
- $disklist[$diskname]['name'] = $diskname;
- $disklist[$diskname]['fullname'] = "/dev/gvinum/" . $diskname;
- $disklist[$diskname]['type'] = "Software RAID - gvinum";
- $disklist[$diskname]['size'] = "$aline[7] $aline[8]" ;
- $disklist[$diskname]['desc'] = $aline[3];
- } // end foreach
-
- return $disklist;
-}
-
-function get_gmirror_disks_list() {
- /* Get information about gmirror volume */
- global $g;
-
- //[volumename] => Array
- // (
- // [type] => Software RAID - gmirror
- // [desc] => COMPLETE
- // [size] => 6149M
- // )
-
- /* Display all configured gmirror volume */
- exec("/sbin/gmirror list", $rawdata);
-
- $foundname = 0 ;
- $founddesc = 0 ;
- $goodname = 0 ;
-
- foreach ($rawdata as $line) {
- /* Use space for break the line */
- $aline = preg_split("/\s+/", $line);
-
- // First Step: Getting the array name
- // look for this output:
- // Geom name: pouet
- if ( (strcmp($aline[0],"Geom") == 0) && (strcmp($aline[1],"name:") == 0) ) {
- $diskname = $aline[2];
- $disklist[$diskname]=array();
- $disklist[$diskname]['name']=$diskname;
- $disklist[$diskname]['fullname']= "/dev/mirror/" . $diskname;
- $foundname = 1 ;
- continue ;
- }
-
- // Second Step: Getting the array status
- // look for this output:
- // State: COMPLETE
- if ( (strcmp($aline[0],"State:") == 0) && $foundname) {
- $desc = $aline[1];
- $disklist[$diskname]['desc'] = $desc;
- $founddesc=1;
- continue ;
- }
-
- // Third Step: Getting the array Size
- // look for this output:
- // Name: mirror/pouet
- // Mediasize: 107373568 (102M)
- if (preg_match("/Name: mirror\/(.*)$/", $line, $matches)) {
- if ($matches[1]=$diskname) {
- $goodname=1;
- continue ;
- }
- }
-
- if (($aline[0] = "Mediasize:") && $goodname) {
- // extract the size between the ( )
- preg_match("/.*\\(([^\)]*)\).*/",$aline[3],$match);
- $disklist[$diskname]['size'] = $match[1];
- $disklist[$diskname]['type'] = "Software RAID - gmirror";
-
- // init the check variable for the next RAID volume
- $foundname = 0 ;
- $founddesc = 0 ;
- $goodname = 0 ;
-
- continue ;
-
- }
- } // end foreach
-
- return $disklist;
-}
-
-function get_gconcat_disks_list() {
- /* Get information about gconcat volume */
- global $g;
-
- //[volumename] => Array
- // (
- // [type] => Software RAID - gconcat
- // [desc] => COMPLETE
- // [size] => 6149M
- // [name] => concat1
- // [fullname] => /dev/concat/concat1
- // )
-
- /* Display all configured gconcat volume*/
- exec("/sbin/gconcat list",$rawdata);
-
- $foundname = 0 ;
- $founddesc = 0 ;
- $goodname = 0 ;
-
- foreach ($rawdata as $line) {
- /* Use space for break the line */
- $aline = preg_split("/\s+/", $line);
-
- // First Step: Getting the array name
- // look for this output:
- // Geom name: pouet
- if ( (strcmp($aline[0],"Geom") == 0) && (strcmp($aline[1],"name:") == 0) ) {
- $diskname = $aline[2];
- $disklist[$diskname]=array();
- $disklist[$diskname]['name']=$diskname;
- $disklist[$diskname]['fullname']= "/dev/concat/" . $diskname;
- $foundname = 1 ;
- continue ;
- }
-
- // Second Step: Getting the array status
- // look for this output:
- // State: UP
- if ( (strcmp($aline[0],"State:") == 0) && $foundname) {
-
- $desc = $aline[1];
- $disklist[$diskname]['desc'] = $desc;
- $founddesc=1;
- continue ;
- }
-
- // Third Step: Getting the array Size
- // look for this output:
- // Name: concat/pouet
- // Mediasize: 107373568 (102M)
- if (preg_match("/Name: concat\/(.*)$/", $line, $matches)) {
- if ($matches[1]=$diskname) {
- $goodname=1;
- continue ;
- }
-
- }
-
- if (($aline[0] = "Mediasize:") && $goodname) {
- // extract the size between the ( )
- preg_match("/.*\\(([^\)]*)\).*/",$aline[3],$match);
- $disklist[$diskname]['size'] = $match[1];
- $disklist[$diskname]['type'] = "Software RAID - gconcat";
-
- // init the check variable for the next RAID volume
- $foundname = 0 ;
- $founddesc = 0 ;
- $goodname = 0 ;
-
- continue ;
- }
- }
-
- return $disklist;
-}
-
-function get_gstripe_disks_list() {
- /* Get information about gstripe volume */
- global $g;
-
- //[volumename] => Array
- // (
- // [type] => Software RAID - gstripe
- // [desc] => COMPLETE
- // [size] => 6149M
- // [name] => raid0
- // [fullname] => /dev/stripe/raid0
- // )
-
- /* Display all configured gstripe volume*/
- exec("/sbin/gstripe list",$rawdata);
-
- $foundname = 0 ;
- $founddesc = 0 ;
- $goodname = 0 ;
-
- foreach ($rawdata as $line) {
- /* Use space for break the line */
- $aline = preg_split("/\s+/", $line);
-
- // First Step: Getting the array name
- // look for this output:
- // Geom name: pouet
- if ( (strcmp($aline[0],"Geom") == 0) && (strcmp($aline[1],"name:") == 0) ) {
- $diskname = $aline[2];
- $disklist[$diskname]=array();
- $disklist[$diskname]['name']=$diskname;
- $disklist[$diskname]['fullname']= "/dev/stripe/" . $diskname;
- $foundname = 1 ;
- continue ;
- }
-
- // Second Step: Getting the array status
- // look for this output:
- // State: UP
- if ( (strcmp($aline[0],"State:") == 0) && $foundname) {
- $desc = $aline[1];
- $disklist[$diskname]['desc'] = $desc;
- $founddesc=1;
- continue ;
- }
-
- // Third Step: Getting the array Size
- // look for this output:
- // Name: stripe/pouet
- // Mediasize: 107373568 (102M)
- if (preg_match("/Name: stripe\/(.*)$/", $line, $matches)) {
- if ($matches[1]=$diskname) {
- $goodname=1;
- continue ;
- }
-
- }
-
- if (($aline[0] = "Mediasize:") && $goodname) {
- // extract the size between the ( )
- preg_match("/.*\\(([^\)]*)\).*/",$aline[3],$match);
- $disklist[$diskname]['size'] = $match[1];
- $disklist[$diskname]['type'] = "Software RAID - gstripe";
-
- // init the check variable for the next RAID volume
- $foundname = 0 ;
- $founddesc = 0 ;
- $goodname = 0 ;
-
- continue ;
-
- }
- }
-
- return $disklist;
-}
-
-function get_graid5_disks_list() {
- /* Get information about graid5 volume */
- global $g;
-
- //[volumename] => Array
- // (
- // [type] => Software RAID - graid5
- // [desc] => COMPLETE
- // [size] => 6149M
- // [name] => BIG1
- // [fullname] => /dev/raid5/BIG1
- // )
-
- /* Display all configured graid5 volume*/
- exec("/sbin/graid5 list",$rawdata);
-
- $foundname = 0 ;
- $founddesc = 0 ;
- $goodname = 0 ;
-
- foreach ($rawdata as $line) {
- /* Use space for break the line */
- $aline = preg_split("/\s+/", $line);
-
- // First Step: Getting the array name
- // look for this output:
- // Geom name: pouet
- if ( (strcmp($aline[0],"Geom") == 0) && (strcmp($aline[1],"name:") == 0) ) {
- $diskname = $aline[2];
- $disklist[$diskname]=array();
- $disklist[$diskname]['name']=$diskname;
- $disklist[$diskname]['fullname']= "/dev/raid5/" . $diskname;
- $foundname = 1 ;
- continue ;
- }
-
- // Second Step: Getting the array status
- // look for this output:
- // State: COMPLETE
- if ( (strcmp($aline[0],"State:") == 0) && $foundname) {
- $desc = $aline[1];
- $disklist[$diskname]['desc'] = $desc;
- $founddesc=1;
- continue ;
- }
-
- // Third Step: Getting the array Size
- // look for this output:
- // Name: raid5/pouet
- // Mediasize: 107373568 (102M)
- if (preg_match("/Name: raid5\/(.*)$/", $line, $matches)) {
- if ($matches[1]=$diskname) {
- $goodname=1;
- continue ;
- }
- }
-
- if (($aline[0] = "Mediasize:") && $goodname) {
- // extract the size between the ( )
- preg_match("/.*\\(([^\)]*)\).*/",$aline[3],$match);
- $disklist[$diskname]['size'] = $match[1];
- $disklist[$diskname]['type'] = "Software RAID - graid5";
-
- // init the check variable for the next RAID volume
- $foundname = 0 ;
- $founddesc = 0 ;
- $goodname = 0 ;
-
- continue ;
- }
- }
-
- return $disklist;
-}
-
-function get_ata_disks_list() {
- /* Return list of ATA disk */
-
- //[ad0] => Array
- // (
- // [type] => IDE
- // [desc] => QUANTUM FIREBALL EX6.4A/A0A.0D00
- // [size] => 6149MB
- // )
-
- global $g;
-
- /* Recupere le dmesg */
- exec("/sbin/dmesg",$rawdmesg);
-
- $disklist = array();
-
- /******* Getting IDE disk informations *******/
- exec("/sbin/atacontrol list",$rawdata);
-
- foreach ($rawdata as $line) {
- /* Separe la ligne par les espace */
- $aline = preg_split("/\s+/", $line);
-
- /* Si ATA alors NEXT */
- if ($aline[0] == "ATA") { continue ; }
-
- $diskname = chop($aline[2]);
-
- /* Exlude CDROM (acdX) and Empty (no) */
- if (!preg_match("/^(acd)/", $diskname ) & $diskname != "no") {
- $disklist[$diskname] = array();
- $disklist[$diskname]['name']=$diskname;
- $disklist[$diskname]['fullname']= "/dev/" . $diskname;
-
- $disklist[$diskname]['type'] = "IDE";
-
- /* Match the description witch is include between < and > */
- preg_match("/.*\<([^>]*)>.*/",$line,$match);
-
- $disklist[$diskname]['desc'] = $match[1];
-
- /* Looking for the disk size */
- foreach ($rawdmesg as $dmesgline) {
- /* Take only the first dmesg line */
- if (!$disklist[$diskname]['size']) {
- /* Separe la ligne par les espace */
- $dmesgtab = explode(" ", $dmesgline);
- $dmesgtab[0] = rtrim($dmesgtab[0],":");
- /* When there is a wrong DMA cable, the first line is:
- * ad0: DMA limited to UDMA33, controller found non-ATA66 cable
- */
- if ($dmesgtab[0]!="" && (strcasecmp($dmesgtab[0],$diskname) == 0) &&
- strcmp($dmesgtab[1],"DMA") !=0) {
- $disklist[$diskname]['size'] = $dmesgtab[1];
- }
- } // end if
- } // end foreach
- } // end if
- } // end foreach
-
- return $disklist;
-}
-
-function get_scsi_disks_list() {
- /* Recupere la liste des disques SCSI */
-
- //[ad0] => Array
- // (
- // [type] => IDE
- // [desc] => QUANTUM FIREBALL EX6.4A/A0A.0D00
- // [size] => 6149MB
- // )
-
- global $g;
-
- /* Recupere le dmesg */
- exec("/sbin/dmesg",$rawdmesg);
-
- /* on envoie la commande d'affichage de la liste des disques*/
- exec("/sbin/camcontrol devlist",$rawdata);
-
- foreach ($rawdata as $line) {
- /* Get information include between parenthese: (pass0,da0) or (da0,pass0)*/
- preg_match("/.*\(([^>]*)\).*/",$line,$match);
-
- /* Sépare le resultat par la virgule */
- $temp = preg_split("/,/", $match[1]);
-
- // Check if diskname is the first (da0,pass0) or the second (pass0,da0) arguement
- $diskname = $temp[1];
-
- if ($diskname[0] == "p") { $diskname = $temp[0]; }
-
- /* On exlus les lecteurs cd */
- if (!preg_match("/^(cd)/", $diskname )) {
- $disklist[$diskname] = array();
- $disklist[$diskname]['name'] = $diskname;
- $disklist[$diskname]['fullname'] = "/dev/" . $diskname;
- $disklist[$diskname]['type'] = "SCSI";
- /* Recupère la description: ce qu'il y a entre < et > */
-
- preg_match("/.*\<([^>]*)>.*/",$line,$match);
-
- $disklist[$diskname]['desc'] = $match[1];
-
- /* Looking for the disk size */
- foreach ($rawdmesg as $dmesgline) {
- /* Separe la ligne par les espace */
- $dmesgtab = explode(" ", $dmesgline);
- $dmesgtab[0] = rtrim($dmesgtab[0],":");
- if ($dmesgtab[0]!="" &&(strcasecmp($dmesgtab[0],$diskname) == 0)) {
- $disklist[$diskname]['size'] = $dmesgtab[1];
- }
- } // end foreach
- } // end if
- } // end foreach
-
- return $disklist;
-}
-
-function get_hraid_disks_list() {
- /* Recupere la liste des disques RAID */
- $kerneldisks = explode(" ", trim(preg_replace("/kern.disks: /", "", exec("/sbin/sysctl kern.disks"))));
-
- /* Recupere la liste des disques ATA et SCSI */
- $diskdetected = array_merge((array)get_ata_disks_list(),(array)get_scsi_disks_list());
-
- /* Recupere le dmesg */
- exec("/sbin/dmesg",$rawdmesg);
-
- foreach ($kerneldisks as $diskname) {
- $allready=1;
-
- // Check of this entry is IDE or SCSI (allready detected)
- foreach ($diskdetected as $diskfoundk => $diskfoundv) {
- if (strcasecmp($diskfoundk,$diskname) == 0) {
- $allready = 0;
- }
- }
-
- if ($allready) {
- /* If not an IDE and SCSI disk */
- $disklist[$diskname]=array();
- $disklist[$diskname]['name']=$diskname;
- $disklist[$diskname]['fullname']= "/dev/" . $diskname;
-
- $disklist[$diskname]['type'] = "RAID";
-
- /* Looking for the disk size in the dmesg */
- foreach ($rawdmesg as $dmesgline) {
- /* Separe la ligne par les espace */
- $dmesgtab = explode(" ", $dmesgline);
- $dmesgtab[0] = rtrim($dmesgtab[0],":");
- // si la ligne commence par le nom du disque: attention il y a 2 lignes
- if ($dmesgtab[0]!="" &&(strcasecmp($dmesgtab[0],$diskname) == 0)) {
- // the first line as this example "aacd0: <RAID 5> on aac0"
- if (strcasecmp(substr($dmesgtab[1], 0, 1),"<") == 0) {
- /* Match the description witch is include between < and > */
- preg_match("/.*\<([^>]*)>.*/",$dmesgline,$match);
- $disklist[$diskname]['desc'] = $match[1];
- } else{
- // si c'est la deuxieme ligne, elle ressemble a "aacd0: 138850MB (284365824 sectors)"
- $disklist[$diskname]['size'] = $dmesgtab[1];
- } // end if
- } // end if
- } // end foreach
- } // end if
- } // end foreach
-
- return $disklist;
-}
-
-function get_physical_disks_list() {
- /* Return list of ALL disk: physical, hardware RAID and Software RAID disk */
- $disklist = array_merge((array)get_ata_disks_list(),(array)get_scsi_disks_list(),(array)get_hraid_disks_list());
- return $disklist;
-}
-
-function get_all_disks_list() {
- /* Return list of ALL disk: physical, hardware RAID and Software RAID disk */
- $disklist = array_merge((array)get_ata_disks_list(),(array)get_scsi_disks_list(),(array)get_hraid_disks_list(), (array)get_sraid_disks_list());
- return $disklist;
-}
-
-function get_disks_size($diskname) {
- /* Return size of the disk */
- $disklist=get_physical_disks_list();
- $disksize=0;
-
- foreach ($disklist as $diskk => $diskv) {
- if (strcmp($diskk,$diskname)==0) {
- $disksize=$diskv['size'];
- }
- }
-
- return $disksize;
-}
-
-function get_cdrom_list() {
- /* Return list of IDE AND SCSI CDROM */
- // exemple: Array
- // [acd0] => Array
- // (
- // [type] => IDE
- // [desc] => TDK CDRW241040B/57S2
- // )
-
- global $g;
-
- /* Recupere la liste des disques IDE */
- exec("/sbin/atacontrol list",$rawdata);
-
- /* Recupere le dmesg */
- exec("/sbin/dmesg",$rawdmesg);
-
- $disklist = array();
-
- /* Variable $i utilisé pour l'index du tableau */
- $i=0;
- foreach ($rawdata as $line) {
- /* Separe la ligne par les espace */
- $aline = preg_split("/\s+/", $line);
-
- /* Si ATA alors NEXT */
- if ($aline[0] == "ATA") { continue ; }
-
- $diskname = chop($aline[2]);
-
- /* Exlude disk (adX) and Empty (no) */
- if (!preg_match("/^(ad)/", $diskname ) & $diskname != "no") {
- $disklist[$diskname]=array();
- $disklist[$diskname]['name']=$diskname;
- $disklist[$diskname]['fullname']= "/dev/" . $diskname;
-
- $disklist[$diskname]['type'] = "IDE";
-
- /* Match the description witch is include between < and > */
- preg_match("/.*\<([^>]*)>.*/",$line,$match);
-
- $disklist[$diskname]['desc'] = $match[1];
-
- $i++;
- } // end if
- } // end foreach
-
- /* Get the SCSI disk list */
-
- /* Cleaning used variable and initialize array */
- unset($rawdata);
- unset($dmesgtab);
- reset($rawdmesg);
-
- /* Get the result of the command camcontrol*/
- exec("/sbin/camcontrol devlist",$rawdata);
-
- foreach ($rawdata as $line) {
- /* Get information include between parenthese: (pass0,da0) or (da0,pass0)*/
- preg_match("/.*\(([^>]*)\).*/",$line,$match);
-
- /* Sépare le resultat par la virgule */
- $temp = preg_split("/,/", $match[1]);
-
- // Check if diskname is the first (da0,pass0) or the second (pass0,da0) arguement
- $diskname = $temp[1];
- if ($diskname[0] == "p") { $diskname = $temp[0]; }
-
- /* On exlus les lecteurs disque dur da */
- if (!preg_match("/^(da)/", $diskname )) {
- $disklist[$diskname]=array();
- $disklist[$diskname]['name']=$diskname;
- $disklist[$diskname]['fullname']= "/dev/" . $diskname;
- $disklist[$diskname]['type'] = "SCSI";
-
- /* Recupère la description: ce qu'il y a entre < et > */
- preg_match("/.*\<([^>]*)>.*/",$line,$match);
-
- $disklist[$diskname]['desc'] = $match[1];
-
- $i++;
- } // end if
- } // end foreach
-
- return $disklist;
-}
-
-/* Get list of disks from given type of filesystem. */
-function get_fstype_disks_list($fstype) {
- global $freenas_config;
-
- $result = array();
-
- /* Scan all physical disk */
- if (is_array($freenas_config['disks']['disk'])) {
- foreach ($freenas_config['disks']['disk'] as $disk) {
- if (strcmp($disk['fstype'],$fstype) == 0) {
- $result[] = $disk;
- }
- } // end foreach
- } // end if
-
- /* Scan all gmirror volume */
- if (is_array($freenas_config['gmirror']['vdisk'])) {
- foreach ($freenas_config['gmirror']['vdisk'] as $disk) {
- if (strcmp($disk['fstype'],$fstype) == 0) {
- $result[] = $disk;
- }
- } // end foreach
- } // end if
-
- /* Scan all gconcat volume */
- if (is_array($freenas_config['gconcat']['vdisk'])) {
- foreach ($freenas_config['gconcat']['vdisk'] as $disk) {
- if (strcmp($disk['fstype'],$fstype) == 0) {
- $result[] = $disk;
- }
- } // end foreach
- } // end if
-
- /* Scan all gstripe volume */
- if (is_array($freenas_config['gstripe']['vdisk'])) {
- foreach ($freenas_config['gstripe']['vdisk'] as $disk) {
- if (strcmp($disk['fstype'],$fstype) == 0) {
- $result[] = $disk;
- }
- } // end foreach
- } // end if
-
- /* Scan all gvinum volume */
- if (is_array($freenas_config['gvinum']['vdisk'])) {
- foreach ($freenas_config['gvinum']['vdisk'] as $disk) {
- if (strcmp($disk['fstype'],$fstype) == 0) {
- $result[] = $disk;
- }
- } // end foreach
- } // end if
-
- /* Scan all graid5 volume */
- if (is_array($freenas_config['graid5']['vdisk'])) {
- foreach ($freenas_config['graid5']['vdisk'] as $disk) {
- if (strcmp($disk['fstype'],$fstype) == 0) {
- $result[] = $disk;
- }
- } // end foreach
- } // end if
-
- return $result;
-}
-
-/* Get list of supported filesystem types */
-function get_fstype_list() {
- $fstlist = array(
- ""=>"Unformated",
- "ufs"=>"UFS with Soft Updates (use 8% space disk)",
- "ufs_no_su"=>"UFS",
- "ufsgpt"=>"UFS (EFI/GPT) with Soft Updates (use 8% space disk)",
- "ufsgpt_no_su"=>"UFS (EFI/GPT)",
- "msdos"=>"FAT32",
- "ntfs"=>"NTFS",
- "softraid"=>"Software RAID");
-/*
- "gmirror"=>"Software RAID: gmirror",
- "gconcat"=>"Software RAID: gconcat",
- "gstripe"=>"Software RAID: gstripe",
- "graid5"=>"Software RAID: graid5",
- "gvinum"=>"Software RAID: gvinum");
-*/
- return $fstlist;
-}
-
-function get_fstype_shortdesc($fstype) {
- $shortdesc = "";
-
- switch($fstype) {
- case "": $shortdesc = "Unformated";
- break;
- case "ufs":
- case "ufs_no_su":
- case "ufsgpt":
- case "ufsgpt_no_su": $shortdesc = "UFS";
- break;
- case "msdos": $shortdesc = "FAT32";
- break;
- case "ntfs": $shortdesc = "NTFS";
- break;
- case "gmirror": $shortdesc = "gmirror";
- break;
- case "gconcat": $shortdesc = "gconcat";
- break;
- case "gstripe": $shortdesc = "gstripe";
- break;
- case "graid5": $shortdesc = "graid5";
- break;
- case "gvinum": $shortdesc = "gvinum";
- break;
- case "softraid": $shortdesc = "softraid";
- break;
- } // end switch
-
- return $shortdesc;
-}
-
-/* Search in a multidimensional array */
-function array_search_ex($needle, $haystack, $key) {
- foreach($haystack as $haystackval => $value) {
- $found = false;
-
- if (is_array($needle) && is_array($key)) {
- foreach ($needle as $n => $needlev) {
- $found = ($value[$key[$n]] == $needlev);
-
- if (false == $found) { break; }
- }
- } else {
- $found = ($value[$key] == $needle);
- } // end if
-
- if (true == $found) { return $haystackval; }
- } // end foreach
-
- return false;
-}
-
-/* TODO: This function is probably not needed. */
-function freenas_install($src,$dst) {
- // Creating source directory
- passthru("/bin/mkdir /mnt/src");
-
- // Mount the source function is_cdrom must BE CREATED!!!!
-
- if (is_cdrom($src)) {
- echo "Mount CDROM:\n";
- passthru("/sbin/mount_cd9660 /dev/$src /mnt/src");
- } else {
- echo "Mount disk:\n";
- passthru("/sbin/mount -t ufs /dev/$src /mnt/src");
- } // end if
-
- echo "Erasing primary partitions:\n";
- passthru("/bin/dd if=/dev/zero of=/dev/$dst bs=1k count=20");
-
- echo "Creation 1 booting primary parition:\n";
- passthru("/sbin/fdisk -BI -b /boot/boot0 $dst");
-
- /* echo "Installing bootloader:\n";
- passthru("/usr/sbin/boot0cfg -B -b /boot/boot0 $dst"); */
-
- echo "Erasing FreeBSD partition on the primary:\n";
- passthru("/bin/dd if=/dev/zero of=/dev/" . escapeshellarg($dst) . "s1 bs=32k count=16");
-
- echo "Creating FreeBSD partition:\n";
- passthru("/sbin/bsdlabel -B -w -b /boot/boot " . escapeshellarg($dst) ."s1 auto");
-
- echo "Modify partition information:\n";
-
- /* Generation de la table des partitions dans un fichier temp */
-
- passthru("/sbin/bsdlabel " . escapeshellarg($dst) ."s1 > label.tmp");
-
- /* copie de ce fichier dans un tableau*/
- $tableau = file("label.tmp");
-
- // Ouverture du fichier en mode ajout
- $handle = fopen("label.tmp", 'a');
-
- while(list(,$val) = each($tableau)) {
- // Si la ligne contient le mot "unused"
-
- if (ereg ("unused",$val)) {
- // On remplace c: par a:
- $val = ereg_replace ("c:","a:", $val);
- // On remplace unused par 4.2BSD
- $val = ereg_replace ("unused","4.2BSD", $val);
- // On ajoute cette ligne à la fin du fichier
- fwrite($handle, $val);
- } // end if
- } // end while
-
- // Fermeture du fichier
- fclose($handle);
-
- // On injecte la nouvelle table des paritions
- passthru("/sbin/bsdlabel -R -B " . escapeshellarg($dst) ."s1 label.tmp");
-
- echo "Creating filesystem:\n";
- passthru("/sbin/newfs /dev/" . escapeshellarg($dst) . "s1");
-
- echo "Creation temp mouting point:\n";
- passthru("/bin/mkdir /mnt/src");
-
- echo "Mount disk:\n";
- passthru("/sbin/mount /dev/" . escapeshellarg($dst) . "s1 /mnt/dst");
-
- echo "Installation:\n";
-
- passthru("/bin/cp -pr /mnt/src/boot /mnt/dst");
- passthru("/bin/cp /mnt/src/cf.gz /mnt/dst/mfsroot.gz");
-
- if ($src == CDROM) {
- passthru("/bin/rm -f /mnt/dst/boot/cdloader");
- }
-
- passthru("mkdir /mnt/dst/conf");
- passthru("/bin/cp /conf/config.xml /mnt/dst/conf/");
-
- /* demontage des disques */
- passthru("/sbin/umount /mnt/dst");
- passthru("/sbin/umount /mnt/src");
- passthru("/bin/rm -rf /mnt/src");
- passthru("/bin/rm -rf /mnt/dst");
-}
-
-/* Force kill a process by name */
-function forcekillbyname($procname) {
- return mwexec("/usr/bin/killall -9 " . escapeshellarg($procname));
-}
-?> \ No newline at end of file
diff --git a/config/archive/freenas/pkg/rc.freenas b/config/archive/freenas/pkg/rc.freenas
deleted file mode 100644
index 3b5c6c0c..00000000
--- a/config/archive/freenas/pkg/rc.freenas
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/local/bin/php -f
-<?php
-/* $Id$ */
-/* ========================================================================== */
- rc.freenas
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt
- All rights reserved.
-/* ========================================================================== */
-/*
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-require_once("globals.inc");
-
-/* parse the configuration and include all functions used below */
-require_once("config.inc");
-require_once("functions.inc");
-require_once("freenas_functions.inc");
-
-/* Tune the system */
-system_tuning();
-
-/* Generate local user base */
-system_users_create();
-
-/* start iSCSI service */
-services_iscsi_configure();
-
-/* start the S.M.A.R.T daemon */
-services_smart_configure();
-
-/* ATA disk Idle configuration */
-disks_set_ataidle();
-
-/* RAID configuration */
-disks_raid_start();
-
-/* Mount the disks */
-disks_mount_all();
-
-/* Generate the pam configuration file */
-system_pam_configure();
-
-/* start NIS service */
-services_nis_configure();
-
-/* start SAMBA service */
-services_samba_configure();
-
-/* start Rsynd service */
-services_rsyncd_configure();
-
-/* start FTP service */
-services_ftpd_configure();
-
-/* start NFS service */
-services_nfs_configure();
-
-/* configure Unison service */
-services_unison_configure();
-
-/* start SSH service */
-/* services_sshd_configure(); */
-
-/* start AFP service */
-services_afpd_configure();
-
-/* start RSYNC client/slave mode service */
-services_rsyncclient_configure();
-
-/* start RSYNC local service */
-services_rsync_local_configure();
-
-/* Start cron */
-services_cron_configure();
-
-/* Start mdnsresponder (Zeroconf/Bonjour) */
-services_zeroconf_configure();
-
-?> \ No newline at end of file
diff --git a/config/archive/freenas/www/diag_ad_infos.php b/config/archive/freenas/www/diag_ad_infos.php
deleted file mode 100644
index e9882a70..00000000
--- a/config/archive/freenas/www/diag_ad_infos.php
+++ /dev/null
@@ -1,159 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_ad_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("Active Directory Infos"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="diag_ad_infos.php" method="post" name="iform" id="iform">
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Disks"), false, "diag_disks_infos.php");
- $tab_array[1] = array(gettext("Partitions"), false, "diag_part_infos.php");
- $tab_array[2] = array(gettext("SMART"), false, "diag_smart_infos.php");
- $tab_array[3] = array(gettext("ataidle"), false, "diag_ataidle_infos.php");
- $tab_array[4] = array(gettext("Space used"), false, "diag_space_infos.php");
- $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php");
- $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php");
- $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("MS Domain"), true, "diag_ad_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="left" valign="top">
- <?php
- if (! isset($freenas_config['ad']['enable'])) {
- echo "<strong>AD Authentication disable</strong><br />";
- } else {
- echo "<pre style=\"font-size: medium;\">";
- echo "<strong>Accessiblity test to MS domain:</strong><br />";
- echo htmlspecialchars("Results for net rpc testjoin:") . "<br />";
- exec("/usr/local/bin/net rpc testjoin",$rawdata);
- foreach ($rawdata as $line)
- {
- echo htmlspecialchars($line) . "<br />";
- }
- unset ($rawdata);
- echo "<br />";
- echo htmlspecialchars("Ping winbindd to see if it is alive:") . "<br />";
- exec("/usr/local/bin/wbinfo -p",$rawdata);
- foreach ($rawdata as $line)
- {
- echo htmlspecialchars($line) . "<br />";
- }
- unset ($rawdata);
- echo "<br />";
- echo htmlspecialchars("Check shared secret:") . "<br />";
- exec("/usr/local/bin/wbinfo -t",$rawdata);
- foreach ($rawdata as $line)
- {
- echo htmlspecialchars($line) . "<br />";
- }
- unset ($rawdata);
- echo "<br>";
- echo "</pre>";
- }
- ?>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_ataidle_infos.php b/config/archive/freenas/www/diag_ataidle_infos.php
deleted file mode 100644
index 7ba6c737..00000000
--- a/config/archive/freenas/www/diag_ataidle_infos.php
+++ /dev/null
@@ -1,149 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_ataidle_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("ATAidle Infos"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="diag_ataidle_infos.php" method="post" name="iform" id="iform">
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Disks"), false, "diag_disks_infos.php");
- $tab_array[1] = array(gettext("Partitions"), false, "diag_part_infos.php");
- $tab_array[2] = array(gettext("SMART"), false, "diag_smart_infos.php");
- $tab_array[3] = array(gettext("ataidle"), true, "diag_ataidle_infos.php");
- $tab_array[4] = array(gettext("Space used"), false, "diag_space_infos.php");
- $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php");
- $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php");
- $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("MS Domain"), false, "diag_ad_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="left" valign="top">
- <?php
- echo "<pre style=\"font-size: medium;\">";
- $disklist=get_ata_disks_list();
- echo "<strong>List of Advanced ATA capabilities on all ATA disk:</strong><br />";
- foreach ($disklist as $disknamek => $disknamev)
- {
- /* Found the channel and device number from the /dev name */
- /* Divise the number by 2, the interger is the channel number, the rest is the device */
- echo htmlspecialchars("Results for $disknamek:") . "<br />";
- $value=trim($disknamek,'ad');
- $value=intval($value);
- $channel = $value/2;
- $device=$value % 2;
- $channel=intval($channel);
- exec("/usr/local/sbin/ataidle $channel $device",$rawdata);
- foreach ($rawdata as $line)
- {
- echo htmlspecialchars($line) . "<br />";
- }
- unset ($rawdata);
- }
- echo "</pre>";
- ?>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_disk_infos.php b/config/archive/freenas/www/diag_disk_infos.php
deleted file mode 100644
index 31419040..00000000
--- a/config/archive/freenas/www/diag_disk_infos.php
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_ataidle_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("Disk Infos"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="diag_disk_infos.php" method="post" name="iform" id="iform">
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Disks"), true, "diag_disks_infos.php");
- $tab_array[1] = array(gettext("Partitions"), false, "diag_part_infos.php");
- $tab_array[2] = array(gettext("SMART"), false, "diag_smart_infos.php");
- $tab_array[3] = array(gettext("ataidle"), false, "diag_ataidle_infos.php");
- $tab_array[4] = array(gettext("Space used"), false, "diag_space_infos.php");
- $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php");
- $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php");
- $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("MS Domain"), false, "diag_ad_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="left" valign="top">
- <?php
- exec("/sbin/atacontrol list",$iderawdata);
- echo "<pre style=\"font-size: medium;\">";
- echo "<strong>List of detected ATA disks:</strong><br />";
- foreach ($iderawdata as $line)
- {
- echo htmlspecialchars($line) . "<br />";
- }
- unset ($line);
- exec("/sbin/camcontrol devlist",$scsirawdata);
- echo "<strong>List of detected SCSI disks:</strong><br />";
- foreach ($scsirawdata as $line)
- {
- echo htmlspecialchars($line) . "<br />";
- }
- echo "</pre>";
- ?>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_fn_logs_daemon.php b/config/archive/freenas/www/diag_fn_logs_daemon.php
deleted file mode 100644
index 1eaa1f0f..00000000
--- a/config/archive/freenas/www/diag_fn_logs_daemon.php
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_fn_logs_daemon.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("System logs"),
- gettext("Daemon"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$nentries = $config['syslog']['nentries'];
-if (!$nentries)
- $nentries = 50;
-
-if ($_POST['clear'])
-{
- exec("/usr/sbin/clog -i -s 262144 /var/log/daemon.log");
- /* redirect to avoid reposting form data on refresh */
- pfSenseHeader("diag_fn_logs_daemon.php");
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<form action="diag_fn_logs_daemon.php" method="post" name="iform" id="iform">
-<div id="inputerrors"></div>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
-<?php
- $tab_array = array();
- $tab_array[] = array(gettext("Samba"), false, "diag_fn_logs_samba.php");
- $tab_array[] = array(gettext("FTP"), false, "diag_fn_logs_ftp.php");
- $tab_array[] = array(gettext("RSYNCD"), false, "diag_fn_logs_rsyncd.php");
- $tab_array[] = array(gettext("SSHD"), false, "diag_fn_logs_sshd.php");
- $tab_array[] = array(gettext("SMARTD"), false, "diag_fn_logs_smartd.php");
- $tab_array[] = array(gettext("Daemon"), true, "diag_fn_logs_daemon.php");
- $tab_array[] = array(gettext("Settings"), false, "diag_fn_logs_settings.php");
- display_top_tabs($tab_array);?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td class="listtopic">
- Last <?=$nentries;?> Daemon log entries
- </td>
- </tr>
- <?php dump_clog("/var/log/daemon.log", $nentries); ?>
- <tr>
- <td align="left" valign="top" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <input name="clear" type="submit" class="formbtn" value="Clear log" />
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_fn_logs_ftp.php b/config/archive/freenas/www/diag_fn_logs_ftp.php
deleted file mode 100644
index 21d8cfb2..00000000
--- a/config/archive/freenas/www/diag_fn_logs_ftp.php
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_fn_logs_ftp.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("System logs"),
- gettext("FTP"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$nentries = $config['syslog']['nentries'];
-if (!$nentries) { $nentries = 50; }
-
-if ($_POST['clear'])
-{
- exec("/usr/sbin/clog -i -s 262144 /var/log/ftp.log");
- /* redirect to avoid reposting form data on refresh */
- pfSenseHeader("diag_fn_logs_ftp.php");
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<form action="diag_fn_logs_ftp.php" method="post" name="iform" id="iform">
-<div id="inputerrors"></div>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
-<?php
- $tab_array = array();
- $tab_array[] = array(gettext("Samba"), false, "diag_fn_logs_samba.php");
- $tab_array[] = array(gettext("FTP"), true, "diag_fn_logs_ftp.php");
- $tab_array[] = array(gettext("RSYNCD"), false, "diag_fn_logs_rsyncd.php");
- $tab_array[] = array(gettext("SSHD"), false, "diag_fn_logs_sshd.php");
- $tab_array[] = array(gettext("SMARTD"), false, "diag_fn_logs_smartd.php");
- $tab_array[] = array(gettext("Daemon"), false, "diag_fn_logs_daemon.php");
- $tab_array[] = array(gettext("Settings"), false, "diag_fn_logs_settings.php");
- display_top_tabs($tab_array);?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td class="listtopic">
- Last <?=$nentries;?> FTP log entries
- </td>
- </tr>
- <?php dump_clog("/var/log/ftp.log", $nentries); ?>
- <tr>
- <td align="left" valign="top" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <input name="clear" type="submit" class="formbtn" value="Clear log" />
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_fn_logs_rsyncd.php b/config/archive/freenas/www/diag_fn_logs_rsyncd.php
deleted file mode 100644
index 44ab3d85..00000000
--- a/config/archive/freenas/www/diag_fn_logs_rsyncd.php
+++ /dev/null
@@ -1,117 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_fn_logs_rsyncd.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("System logs"),
- gettext("RSYNCD"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$nentries = $config['syslog']['nentries'];
-if (!$nentries) { $nentries = 50; }
-
-if ($_POST['clear']) {
- exec("/usr/sbin/clog -i -s 262144 /var/log/rsyncd.log");
- /* redirect to avoid reposting form data on refresh */
- pfSenseHeader("diag_fn_logs_rsyncd.php");
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<form action="diag_fn_logs_rsyncd.php" method="post" name="iform" id="iform">
-<div id="inputerrors"></div>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
-<?php
- $tab_array = array();
- $tab_array[] = array(gettext("Samba"), false, "diag_fn_logs_samba.php");
- $tab_array[] = array(gettext("FTP"), false, "diag_fn_logs_ftp.php");
- $tab_array[] = array(gettext("RSYNCD"), true, "diag_fn_logs_rsyncd.php");
- $tab_array[] = array(gettext("SSHD"), false, "diag_fn_logs_sshd.php");
- $tab_array[] = array(gettext("SMARTD"), false, "diag_fn_logs_smartd.php");
- $tab_array[] = array(gettext("Daemon"), false, "diag_fn_logs_daemon.php");
- $tab_array[] = array(gettext("Settings"), false, "diag_fn_logs_settings.php");
- display_top_tabs($tab_array);?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td class="listtopic">
- Last <?=$nentries;?> RSYNCD log entries
- </td>
- </tr>
- <?php dump_clog("/var/log/rsyncd.log", $nentries); ?>
- <tr>
- <td align="left" valign="top" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <input name="clear" type="submit" class="formbtn" value="Clear log" />
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_fn_logs_samba.php b/config/archive/freenas/www/diag_fn_logs_samba.php
deleted file mode 100644
index 436de12d..00000000
--- a/config/archive/freenas/www/diag_fn_logs_samba.php
+++ /dev/null
@@ -1,174 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_fn_logs_samba.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("System logs"),
- gettext("Samba"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$nentries = $config['syslog']['nentries'];
-if (!$nentries) { $nentries = 50; }
-
-if ($_POST['clear']) {
- exec("/bin/cp /dev/null /var/log/samba/log.nmbd");
- exec("/bin/cp /dev/null /var/log/samba/log.smbd");
- exec("/bin/cp /dev/null /var/log/samba/log.winbindd");
- /* redirect to avoid reposting form data on refresh */
- pfSenseHeader("diag_fn_logs_samba.php");
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<form action="diag_fn_logs_samba.php" method="post" name="iform" id="iform">
-<div id="inputerrors"></div>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
-<?php
- $tab_array = array();
- $tab_array[] = array(gettext("Samba"), true, "diag_fn_logs_samba.php");
- $tab_array[] = array(gettext("FTP"), false, "diag_fn_logs_ftp.php");
- $tab_array[] = array(gettext("RSYNCD"), false, "diag_fn_logs_rsyncd.php");
- $tab_array[] = array(gettext("SSHD"), false, "diag_fn_logs_sshd.php");
- $tab_array[] = array(gettext("SMARTD"), false, "diag_fn_logs_smartd.php");
- $tab_array[] = array(gettext("Daemon"), false, "diag_fn_logs_daemon.php");
- $tab_array[] = array(gettext("Settings"), false, "diag_fn_logs_settings.php");
- display_top_tabs($tab_array);?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td class="listtopic">
- Last <?=$nentries;?> nmbd service log entries
- </td>
- </tr>
- <?php
- if (file_exists("/var/log/samba/log.nmbd")) {
- exec("cat /var/log/samba/log.nmbd", $rawlog);
- } else {
- $rawlog=array("No logs");
- }
- ?>
- <?php foreach ($rawlog as $log) { ?>
- <tr>
- <td class="listr" nowrap>
- <pre><?php echo htmlspecialchars($log); } ?></pre>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" height="12">&nbsp;</td>
- </tr>
- <?php unset ($rawlog); ?>
- <tr>
- <td class="listtopic">
- Last <?=$nentries;?> smbd service log entries
- </td>
- </tr>
- <?php
- if (file_exists("/var/log/samba/log.smbd")) {
- exec("cat /var/log/samba/log.smbd", $rawlog);
- } else {
- $rawlog=array("No logs");
- }
- ?>
- <?php foreach ($rawlog as $log) { ?>
- <tr>
- <td class="listr" nowrap>
- <pre><?php echo htmlspecialchars($log); } ?></pre>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td class="listtopic">
- Last <?=$nentries;?> winbindd service log entries
- </td>
- </tr>
- <?php
- if (file_exists("/var/log/samba/log.winbindd")) {
- exec("cat /var/log/samba/log.winbindd", $rawlog);
- } else {
- $rawlog=array("No logs");
- }
- ?>
- <?php foreach ($rawlog as $log) { ?>
- <tr>
- <td class="listr" nowrap>
- <pre><?php echo htmlspecialchars($log); } ?></pre>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <input name="clear" type="submit" class="formbtn" value="Clear log" />
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_fn_logs_settings.php b/config/archive/freenas/www/diag_fn_logs_settings.php
deleted file mode 100644
index 9ac2823d..00000000
--- a/config/archive/freenas/www/diag_fn_logs_settings.php
+++ /dev/null
@@ -1,313 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_fn_logs_settings.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("System logs"),
- gettext("Settings"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if(!function_exists("filter_configure"))
- require_once("filter.inc");
-
-$pconfig['reverse'] = isset($config['syslog']['reverse']);
-$pconfig['nentries'] = $config['syslog']['nentries'];
-$pconfig['remoteserver'] = $config['syslog']['remoteserver'];
-$pconfig['filter'] = isset($config['syslog']['filter']);
-$pconfig['dhcp'] = isset($config['syslog']['dhcp']);
-$pconfig['portalauth'] = isset($config['syslog']['portalauth']);
-$pconfig['vpn'] = isset($config['syslog']['vpn']);
-$pconfig['system'] = isset($config['syslog']['system']);
-$pconfig['enable'] = isset($config['syslog']['enable']);
-$pconfig['logdefaultblock'] = !isset($config['syslog']['nologdefaultblock']);
-$pconfig['rawfilter'] = isset($config['syslog']['rawfilter']);
-$pconfig['disablelocallogging'] = isset($config['syslog']['disablelocallogging']);
-$pconfig['webservlogs'] = isset($config['syslog']['webservlogs']);
-
-$pconfig['sshd'] = isset($config['syslog']['sshd']);
-$pconfig['ftp'] = isset($config['syslog']['ftp']);
-$pconfig['rsyncd'] = isset($config['syslog']['rsyncd']);
-$pconfig['smartd'] = isset($config['syslog']['smartd']);
-$pconfig['daemon'] = isset($config['syslog']['daemon']);
-
-if (!$pconfig['nentries']) { $pconfig['nentries'] = 50; }
-
-if ($_POST) {
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- if ($_POST['enable'] && !is_ipaddr($_POST['remoteserver'])) {
- $input_errors[] = gettext("A valid IP address must be specified.");
- }
- if (($_POST['nentries'] < 5) || ($_POST['nentries'] > 2000)) {
- $input_errors[] = gettext("Number of log entries to show must be between 5 and 2000.");
- }
-
- if (!$input_errors) {
- $config['syslog']['reverse'] = $_POST['reverse'] ? true : false;
- $config['syslog']['nentries'] = (int)$_POST['nentries'];
- $config['syslog']['remoteserver'] = $_POST['remoteserver'];
- $config['syslog']['filter'] = $_POST['filter'] ? true : false;
- $config['syslog']['dhcp'] = $_POST['dhcp'] ? true : false;
- $config['syslog']['portalauth'] = $_POST['portalauth'] ? true : false;
- $config['syslog']['vpn'] = $_POST['vpn'] ? true : false;
- $config['syslog']['system'] = $_POST['system'] ? true : false;
- $config['syslog']['disablelocallogging'] = $_POST['disablelocallogging'] ? true : false;
- $config['syslog']['enable'] = $_POST['enable'] ? true : false;
- $oldnologdefaultblock = isset($config['syslog']['nologdefaultblock']);
- $config['syslog']['nologdefaultblock'] = $_POST['logdefaultblock'] ? false : true;
- $config['syslog']['rawfilter'] = $_POST['rawfilter'] ? true : false;
- $config['syslog']['webservlogs'] = $_POST['webservlogs'] ? true : false;
- $config['syslog']['sshd'] = $_POST['sshd'] ? true : false;
- $config['syslog']['ftp'] = $_POST['ftp'] ? true : false;
- $config['syslog']['rsyncd'] = $_POST['rsyncd'] ? true : false;
- $config['syslog']['smartd'] = $_POST['smartd'] ? true : false;
- $config['syslog']['daemon'] = $_POST['daemon'] ? true : false;
- if($config['syslog']['enable'] == false)
- unset($config['syslog']['remoteserver']);
-
- write_config();
-
- $retval = 0;
- config_lock();
- $retval = system_syslogd_start();
- if ($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock']))
- $retval |= filter_configure();
- config_unlock();
- $savemsg = get_std_save_message($retval);
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-$jscriptstr = <<<EOD
-<script language="JavaScript" type="text/javascript">
-<!--
-function enable_change(enable_over) {
- endis = !(document.iform.enable.checked || enable_over);
- endis ? color = '#D4D0C8' : color = '#FFFFFF';
-
- if (document.iform.enable.checked || enable_over) {
- document.iform.remoteserver.disabled = 0;
- document.iform.filter.disabled = 0;
- document.iform.dhcp.disabled = 0;
- document.iform.portalauth.disabled = 0;
- document.iform.vpn.disabled = 0;
- document.iform.system.disabled = 0;
- document.iform.webservlogs.disabled = 0;
- document.iform.sshd.disabled = 0;
- document.iform.ftp.disabled = 0;
- document.iform.rsyncd.disabled = 0;
- document.iform.smartd.disabled = 0;
- document.iform.daemon.disabled = 0;
-
- } else {
- document.iform.remoteserver.disabled = 1;
- document.iform.filter.disabled = 1;
- document.iform.dhcp.disabled = 1;
- document.iform.portalauth.disabled = 1;
- document.iform.vpn.disabled = 1;
- document.iform.system.disabled = 1;
- document.iform.webservlogs.disabled = 1;
- document.iform.sshd.disabled = 1;
- document.iform.ftp.disabled = 1;
- document.iform.rsyncd.disabled = 1;
- document.iform.smartd.disabled = 1;
- document.iform.daemon.disabled = 1;
- }
-
- /* color adjustments */
- document.iform.remoteserver.style.backgrounColor = color;
- document.iform.filter.style.backgrounColor = color;
- document.iform.dhcp.style.backgrounColor = color;
- document.iform.portalauth.style.backgrounColor = color;
- document.iform.vpn.style.backgrounColor = color;
- document.iform.system.style.backgrounColor = color;
- document.iform.webservlogs.style.backgrounColor = color;
- document.iform.sshd.style.backgrounColor = color;
- document.iform.ftp.style.backgrounColor = color;
- document.iform.rsyncd.style.backgrounColor = color;
- document.iform.smartd.style.backgrounColor = color;
- document.iform.daemon.style.backgrounColor = color;
-}
-// -->
-</script>
-
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<form action="diag_fn_logs_settings.php" method="post" name="iform" id="iform">
-<div id="inputerrors"></div>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
-<?php
- $tab_array = array();
- $tab_array[] = array(gettext("Samba"), false, "diag_fn_logs_samba.php");
- $tab_array[] = array(gettext("FTP"), false, "diag_fn_logs_ftp.php");
- $tab_array[] = array(gettext("RSYNCD"), false, "diag_fn_logs_rsyncd.php");
- $tab_array[] = array(gettext("SSHD"), false, "diag_fn_logs_sshd.php");
- $tab_array[] = array(gettext("SMARTD"), false, "diag_fn_logs_smartd.php");
- $tab_array[] = array(gettext("Daemon"), false, "diag_fn_logs_daemon.php");
- $tab_array[] = array(gettext("Settings"), true, "diag_fn_logs_settings.php");
- display_top_tabs($tab_array);?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vtable">&nbsp;</td>
- <td width="78%" class="vtable"> <input name="reverse" class="formfld" type="checkbox" id="reverse" value="yes" <?php if ($pconfig['reverse']) echo "checked"; ?> />
- <strong><?=gettext("Show log entries in reverse order (newest entries on top)");?></strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vtable">&nbsp;</td>
- <td width="78%" class="vtable"><?=gettext("Number of log entries to show");?>:
- <input name="nentries" id="nentries" type="text" class="formfld unknown" size="4" value="<?=htmlspecialchars($pconfig['nentries']);?>" />
- </td>
- </tr>
- <tr>
- <td valign="top" class="vtable">&nbsp;</td>
- <td class="vtable"> <input name="logdefaultblock" class="formfld" type="checkbox" id="logdefaultblock" value="yes" <?php if ($pconfig['logdefaultblock']) echo "checked"; ?> />
- <strong><?=gettext("Log packets blocked by the default rule");?></strong><br />
- <?=gettext("Hint: packets that are blocked by the
- implicit default block rule will not be logged anymore
- if you uncheck this option. Per-rule logging options are not affected.");?>
- </td>
- </tr>
- <tr>
- <td valign="top" class="vtable">&nbsp;</td>
- <td class="vtable"> <input name="rawfilter" class="formfld" type="checkbox" id="rawfilter" value="yes" <?php if ($pconfig['rawfilter']) echo "checked"; ?> />
- <strong><?=gettext("Show raw filter logs");?></strong><br />
- <?=gettext("Hint: If this is checked, filter logs are shown as generated by the packet filter, without any formatting. This will reveal more detailed information.");?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vtable">&nbsp;</td>
- <td width="78%" class="vtable"> <input name="disablelocallogging" class="formfld" type="checkbox" id="disablelocallogging" value="yes" <?php if ($pconfig['disablelocallogging']) echo "checked"; ?> onclick="enable_change(false)" />
- <strong><?=gettext("Disable writing log files to the local disk");?></strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vtable">&nbsp;</td>
- <td width="78%" class="vtable"> <input name="enable" class="formfld" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onclick="enable_change(false)" />
- <strong><?=gettext("Enable syslog'ing to remote syslog server");?></strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Remote syslog server</td>
- <td width="78%" class="vtable">
- <input name="remoteserver" id="remoteserver" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['remoteserver']);?>" />
- <br /><?=gettext("IP address of remote syslog server");?>
- <br /><br />
- <input name="system" id="system" class="formfld" type="checkbox" value="yes" onclick="enable_change(false)" <?php if ($pconfig['system']) echo "checked=\"checked\""; ?> />
- <?=gettext("system events");?><br />
- <input name="filter" id="filter" class="formfld" type="checkbox" value="yes" <?php if ($pconfig['filter']) echo "checked=\"checked\""; ?> />
- <?=gettext("firewall events");?><br />
- <input name="dhcp" id="dhcp" class="formfld" type="checkbox" value="yes" <?php if ($pconfig['dhcp']) echo "checked=\"checked\""; ?> />
- <?=gettext("DHCP service events");?><br />
- <input name="portalauth" id="portalauth" class="formfld" type="checkbox" value="yes" <?php if ($pconfig['portalauth']) echo "checked=\"checked\""; ?> />
- <?=gettext("Portal Auth");?><br />
- <input name="vpn" id="vpn" class="formfld" type="checkbox" value="yes" <?php if ($pconfig['vpn']) echo "checked=\"checked\""; ?> />
- <?=gettext("PPTP VPN events");?><br />
- <input name="webservlogs" id="webservlogs" class="formfld" type="checkbox" value="yes" <?php if ($pconfig['webservlogs']) echo "checked=\"checked\""; ?> />
- <?=gettext("webConfigurator Logs");?><br />
- <input name="sshd" id="sshd" class="formfld" type="checkbox" value="yes" <?php if ($pconfig['sshd']) echo "checked=\"checked\""; ?> />
- <?=gettext("SSHD events");?><br />
- <input name="ftp" id="ftp" class="formfld" type="checkbox" value="yes" <?php if ($pconfig['ftp']) echo "checked=\"checked\""; ?> />
- <?=gettext("FTP events");?><br />
- <input name="rsyncd" id="rsyncd" class="formfld" type="checkbox" value="yes" <?php if ($pconfig['rsyncd']) echo "checked=\"checked\""; ?> />
- <?=gettext("RSYNCD events");?><br />
- <input name="smartd" id="smartd" class="formfld" type="checkbox" value="yes" <?php if ($pconfig['smartd']) echo "checked=\"checked\""; ?> />
- <?=gettext("SMARTD events");?><br />
- <input name="daemon" id="daemon" class="formfld" type="checkbox" value="yes" <?php if ($pconfig['daemon']) echo "checked=\"checked\""; ?> />
- <?=gettext("Daemon events");?><br />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
- </td>
- </tr>
- <tr>
- <td width="22%" height="53" valign="top">&nbsp;</td>
- <td width="78%"><strong><span class="red"><?=gettext("Note");?>:</span></strong><br />
- <?=gettext("
- syslog sends UDP datagrams to port 514 on the specified
- remote syslog server. Be sure to set syslogd on the
- remote server to accept syslog messages from {$g['product_name']}.
- ");?>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<script language="JavaScript" type="text/javascript">
-<!--
-enable_change(false);
-//-->
-</script>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_fn_logs_smartd.php b/config/archive/freenas/www/diag_fn_logs_smartd.php
deleted file mode 100644
index 7e57d543..00000000
--- a/config/archive/freenas/www/diag_fn_logs_smartd.php
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_fn_logs_smartd.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("System logs"),
- gettext("SMARTD"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$nentries = $config['syslog']['nentries'];
-if (!$nentries) { $nentries = 50; }
-
-if ($_POST['clear'])
-{
- exec("/usr/sbin/clog -i -s 262144 /var/log/smartd.log");
- /* redirect to avoid reposting form data on refresh */
- pfSenseHeader("diag_fn_logs_smartd.php");
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<form action="diag_fn_logs_smartd.php" method="post" name="iform" id="iform">
-<div id="inputerrors"></div>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
-<?php
- $tab_array = array();
- $tab_array[] = array(gettext("Samba"), false, "diag_fn_logs_samba.php");
- $tab_array[] = array(gettext("FTP"), false, "diag_fn_logs_ftp.php");
- $tab_array[] = array(gettext("RSYNCD"), false, "diag_fn_logs_rsyncd.php");
- $tab_array[] = array(gettext("SSHD"), false, "diag_fn_logs_sshd.php");
- $tab_array[] = array(gettext("SMARTD"), true, "diag_fn_logs_smartd.php");
- $tab_array[] = array(gettext("Daemon"), false, "diag_fn_logs_daemon.php");
- $tab_array[] = array(gettext("Settings"), false, "diag_fn_logs_settings.php");
- display_top_tabs($tab_array);?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td class="listtopic">
- Last <?=$nentries;?> SmartD log entries
- </td>
- </tr>
- <?php dump_clog("/var/log/smartd.log", $nentries); ?>
- <tr>
- <td align="left" valign="top" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <input name="clear" type="submit" class="formbtn" value="Clear log" />
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_fn_logs_sshd.php b/config/archive/freenas/www/diag_fn_logs_sshd.php
deleted file mode 100644
index bc61d57f..00000000
--- a/config/archive/freenas/www/diag_fn_logs_sshd.php
+++ /dev/null
@@ -1,117 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_fn_logs_sshd.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("System logs"),
- gettext("SSHD"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$nentries = $config['syslog']['nentries'];
-if (!$nentries) { $nentries = 50; }
-
-if ($_POST['clear']) {
- exec("/usr/sbin/clog -i -s 262144 /var/log/sshd.log");
- /* redirect to avoid reposting form data on refresh */
- pfSenseHeader("diag_fn_logs_sshd.php");
- exit;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<form action="diag_fn_logs_sshd.php" method="post" name="iform" id="iform">
-<div id="inputerrors"></div>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
-<?php
- $tab_array = array();
- $tab_array[] = array(gettext("Samba"), false, "diag_fn_logs_samba.php");
- $tab_array[] = array(gettext("FTP"), false, "diag_fn_logs_ftp.php");
- $tab_array[] = array(gettext("RSYNCD"), false, "diag_fn_logs_rsyncd.php");
- $tab_array[] = array(gettext("SSHD"), true, "diag_fn_logs_sshd.php");
- $tab_array[] = array(gettext("SMARTD"), false, "diag_fn_logs_smartd.php");
- $tab_array[] = array(gettext("Daemon"), false, "diag_fn_logs_daemon.php");
- $tab_array[] = array(gettext("Settings"), false, "diag_fn_logs_settings.php");
- display_top_tabs($tab_array);?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td class="listtopic">
- Last <?=$nentries;?> SSHD log entries
- </td>
- </tr>
- <?php dump_clog("/var/log/sshd.log", $nentries); ?>
- <tr>
- <td align="left" valign="top" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <input name="clear" type="submit" class="formbtn" value="Clear log" />
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_iscsi_infos.php b/config/archive/freenas/www/diag_iscsi_infos.php
deleted file mode 100644
index 05c136e8..00000000
--- a/config/archive/freenas/www/diag_iscsi_infos.php
+++ /dev/null
@@ -1,142 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_iscsi_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("iSCSI Infos"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="diag_iscsi_infos.php" method="post" name="iform" id="iform">
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Disks"), false, "diag_disks_infos.php");
- $tab_array[1] = array(gettext("Partitions"), false, "diag_part_infos.php");
- $tab_array[2] = array(gettext("SMART"), false, "diag_smart_infos.php");
- $tab_array[3] = array(gettext("ataidle"), false, "diag_ataidle_infos.php");
- $tab_array[4] = array(gettext("Space used"), false, "diag_space_infos.php");
- $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php");
- $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php");
- $tab_array[7] = array(gettext("iSCSI"), true, "diag_iscsi_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("MS Domain"), false, "diag_ad_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="left" valign="top">
- <?php
- if (! isset($freenas_config['iscsi']['enable'])) {
- echo "<strong>iSCSI initiator disabled</strong><br />";
- } else {
- echo "<pre style=\"font-size: medium;\">";
- echo "<strong>Show the list of available target Name on the iSCSI target</strong><br>";
-
- exec("/usr/local/sbin/iscontrol -d targetaddress={$freenas_config['iscsi']['targetaddress']}",$rawdata);
- foreach ($rawdata as $line)
- {
- echo htmlspecialchars($line) . "<br>";
- }
- unset ($rawdata);
- echo "</pre>";
- }
- ?>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_mounts_infos.php b/config/archive/freenas/www/diag_mounts_infos.php
deleted file mode 100644
index 29eb49f5..00000000
--- a/config/archive/freenas/www/diag_mounts_infos.php
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_mounts_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("Mount Infos"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="diag_mounts_infos.php" method="post" name="iform" id="iform">
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Disks"), false, "diag_disks_infos.php");
- $tab_array[1] = array(gettext("Partitions"), false, "diag_part_infos.php");
- $tab_array[2] = array(gettext("SMART"), false, "diag_smart_infos.php");
- $tab_array[3] = array(gettext("ataidle"), false, "diag_ataidle_infos.php");
- $tab_array[4] = array(gettext("Space used"), false, "diag_space_infos.php");
- $tab_array[5] = array(gettext("Mounts"), true, "diag_mounts_infos.php");
- $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php");
- $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "diag_ad_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="left" valign="top">
- <?php
- echo "<pre style=\"font-size: medium;\">";
- echo "<strong>List of mounted point:</strong><br />";
- exec("/sbin/mount",$mountrawdata);
- foreach ($mountrawdata as $line)
- {
- echo htmlspecialchars($line) . "<br />";
- }
- unset ($line);
- echo "</pre>";
- ?>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_part_infos.php b/config/archive/freenas/www/diag_part_infos.php
deleted file mode 100644
index 011a771c..00000000
--- a/config/archive/freenas/www/diag_part_infos.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_part_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("Partition Infos"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="diag_part_infos.php" method="post" name="iform" id="iform">
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Disks"), false, "diag_disks_infos.php");
- $tab_array[1] = array(gettext("Partitions"), true, "diag_part_infos.php");
- $tab_array[2] = array(gettext("SMART"), false, "diag_smart_infos.php");
- $tab_array[3] = array(gettext("ataidle"), false, "diag_ataidle_infos.php");
- $tab_array[4] = array(gettext("Space used"), false, "diag_space_infos.php");
- $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php");
- $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php");
- $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "diag_ad_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="left" valign="top">
- <?php
- echo "<pre style=\"font-size: medium;\">";
- $disklist = get_physical_disks_list();
- echo "<strong>List of partition on all detected disk:</strong><br />";
- foreach ($disklist as $disknamek => $disknamev)
- {
- exec("/sbin/fdisk $disknamek",$fdiskrawdata);
- foreach ($fdiskrawdata as $line)
- {
- echo htmlspecialchars($line) . "<br />";
- }
- unset ($fdiskrawdata);
- }
- echo "</pre>";
- ?>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_raid_infos.php b/config/archive/freenas/www/diag_raid_infos.php
deleted file mode 100644
index ad1621c1..00000000
--- a/config/archive/freenas/www/diag_raid_infos.php
+++ /dev/null
@@ -1,163 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_raid_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("RAID Infos"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="diag_raid_infos.php" method="post" name="iform" id="iform">
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Disks"), false, "diag_disks_infos.php");
- $tab_array[1] = array(gettext("Partitions"), false, "diag_part_infos.php");
- $tab_array[2] = array(gettext("SMART"), false, "diag_smart_infos.php");
- $tab_array[3] = array(gettext("ataidle"), false, "diag_ataidle_infos.php");
- $tab_array[4] = array(gettext("Space used"), false, "diag_space_infos.php");
- $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php");
- $tab_array[6] = array(gettext("Software RAID"), true, "diag_raid_infos.php");
- $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("MS Domain"), false, "diag_ad_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="left" valign="top">
- <?php
- echo "<pre style=\"font-size: medium;\">";
- echo "<strong>" . gettext("Software RAID") . " - " . gettext("Geom Mirror") . ":</strong><br /><br />";
- exec("/sbin/gmirror list",$rawdata);
- foreach ($rawdata as $line) {
- echo htmlspecialchars($line) . "<br />";
- }
- unset ($line);
- unset ($rawdata);
- echo "<strong>" . gettext("Software RAID") . " - " . gettext("Geom Vinum") . ":</strong><br /><br />";
- exec("/sbin/gvinum list",$rawdata);
- foreach ($rawdata as $line) {
- echo htmlspecialchars($line) . "<br />";
- }
- unset ($line);
- unset ($rawdata);
- echo "<strong>" . gettext("Software RAID") . " - " . gettext("Geom Concat") . ":</strong><br /><br />";
- exec("/sbin/gconcat list",$rawdata);
- foreach ($rawdata as $line) {
- echo htmlspecialchars($line) . "<br />";
- }
- unset ($line);
- unset ($rawdata);
- echo "<strong>" . gettext("Software RAID") . " - " . gettext("Geom Stripe") . ":</strong><br /><br />";
- exec("/sbin/gstripe list",$rawdata);
- foreach ($rawdata as $line) {
- echo htmlspecialchars($line) . "<br />";
- }
- unset ($line);
- unset ($rawdata);
- echo "<strong>" . gettext("Software RAID") . " - " . gettext("Geom Raid5") . ":</strong><br /><br />";
- exec("/sbin/graid5 list",$rawdata);
- foreach ($rawdata as $line) {
- echo htmlspecialchars($line) . "<br />";
- }
- echo "</pre>";
- ?>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_smart_infos.php b/config/archive/freenas/www/diag_smart_infos.php
deleted file mode 100644
index d265d1b7..00000000
--- a/config/archive/freenas/www/diag_smart_infos.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_smart_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("SMART Infos"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="diag_smart_infos.php" method="post" name="iform" id="iform">
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Disks"), false, "diag_disks_infos.php");
- $tab_array[1] = array(gettext("Partitions"), false, "diag_part_infos.php");
- $tab_array[2] = array(gettext("SMART"), true, "diag_smart_infos.php");
- $tab_array[3] = array(gettext("ataidle"), false, "diag_ataidle_infos.php");
- $tab_array[4] = array(gettext("Space used"), false, "diag_space_infos.php");
- $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php");
- $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php");
- $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("MS Domain"), false, "diag_ad_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="left" valign="top">
- <?php
- echo "<pre style=\"font-size: medium;\">";
- $disklist = get_physical_disks_list();
- echo "<strong>List of SMART capabilities on all detected disk:</strong><br />";
- foreach ($disklist as $disknamek => $disknamev)
- {
- exec("/usr/local/sbin/smartctl -a /dev/$disknamek",$fdiskrawdata);
- foreach ($fdiskrawdata as $line)
- {
- echo htmlspecialchars($line) . "<br />";
- }
- unset ($fdiskrawdata);
- }
- echo "</pre>";
- ?>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/diag_space_infos.php b/config/archive/freenas/www/diag_space_infos.php
deleted file mode 100644
index e0726b07..00000000
--- a/config/archive/freenas/www/diag_space_infos.php
+++ /dev/null
@@ -1,136 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- diag_space_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Diagnostics"),
- gettext("Space Infos"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="diag_space_infos.php" method="post" name="iform" id="iform">
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Disks"), false, "diag_disks_infos.php");
- $tab_array[1] = array(gettext("Partitions"), false, "diag_part_infos.php");
- $tab_array[2] = array(gettext("SMART"), false, "diag_smart_infos.php");
- $tab_array[3] = array(gettext("ataidle"), false, "diag_ataidle_infos.php");
- $tab_array[4] = array(gettext("Space used"), true, "diag_space_infos.php");
- $tab_array[5] = array(gettext("Mounts"), false, "diag_mounts_infos.php");
- $tab_array[6] = array(gettext("Software RAID"), false, "diag_raid_infos.php");
- $tab_array[7] = array(gettext("iSCSI"), false, "diag_iscsi_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("MS Domain"), false, "diag_ad_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="left" valign="top">
- <?php
- echo "<pre style=\"font-size: medium;\">";
- exec("/bin/df -h",$rawdata);
- echo "<strong>Free Space:</strong><br />";
- foreach ($rawdata as $line)
- {
- echo htmlspecialchars($line) . "<br />";
- }
- echo "</pre>";
- ?>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_manage.php b/config/archive/freenas/www/disks_manage.php
deleted file mode 100644
index b6dece05..00000000
--- a/config/archive/freenas/www/disks_manage.php
+++ /dev/null
@@ -1,208 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_manage.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("Management"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['disks']['disk']))
- $freenas_config['disks']['disk'] = array();
-
-disks_sort();
-
-$a_disk_conf = &$freenas_config['disks']['disk'];
-
-if ($_POST) {
- unset($input_errors);
-
- /* input validation */
-
- if ($_POST['apply']) {
- $retval = 0;
- if (! file_exists($d_sysrebootreqd_path)) {
- config_lock();
- /* reload all components that mount disk */
- // disks_mount_all();
- /* Is formated?: If not create FS */
- /* $retval = disk_disks_create_ufs(); */
-
- config_unlock();
- }
- $savemsg = get_std_save_message($retval);
- if ($retval == 0) {
- if (file_exists($d_diskdirty_path)) {
- unlink($d_diskdirty_path);
- }
- }
- }
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($input_errors)) {
- input_errors2Ajax($input_errors);
- exit;
- }
-
- if (!$input_errors) {
- /* No errors detected, so update the config */
- }
-}
-
-if ($_GET['act'] == "del") {
- if ($a_disk_conf[$_GET['id']]) {
- unset($a_disk_conf[$_GET['id']]);
- write_config();
- touch($d_diskdirty_path);
- pfSenseHeader("disks_manage.php");
- exit;
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="disks_manage.php" method="post" name="iform" id="iform">
-<?php if (file_exists($d_diskdirty_path)): ?>
-<?php print_info_box_np(gettext("The disk list has been changed.") . "<br />" .
- gettext("You must apply the changes in order for them to take effect."));?>
-<?php endif; ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage"), true, "disks_manage.php");
- $tab_array[1] = array(gettext("Format"), false, "disks_manage_init.php");
- $tab_array[2] = array(gettext("Tools"), false, "disks_manage_tools.php");
- $tab_array[3] = array(gettext("iSCSI Initiator"), false, "disks_manage_iscsi.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><?=gettext("Disk");?></td>
- <td class="listhdrr"><?=gettext("Size");?></td>
- <td class="listhdrr"><?=gettext("Description");?></td>
- <td class="listhdrr"><?=gettext("Standby time");?></td>
- <td class="listhdrr"><?=gettext("File system");?></td>
- <td class="listhdrr"><?=gettext("Status");?></td>
- <td class="list">&nbsp;</td>
- </tr>
- <?php $i = 0; foreach ($a_disk_conf as $disk): ?>
- <tr>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($disk['name']);?>
- </td>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($disk['size']);?>
- </td>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($disk['desc']);?>&nbsp;
- </td>
- <td valign="middle" class="listr">
- <?php
- if ($disk['harddiskstandby']) {
- $value = $disk['harddiskstandby'];
- //htmlspecialchars($value);
- echo $value;
- } else {
- echo "Always on";
- }
- ?>
- </td>
- <td valign="middle" class="listr">
- <?= ($disk['fstype']) ? $disk['fstype']: gettext("unknown or unformatted"); ?>
- </td>
- <td valign="middle" class="listr">
- <?php
- $stat = disks_status($disk);
- echo $stat;
- ?>
- </td>
- <td valign="middle" class="list">
- <a href="disks_manage_edit.php?id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit disk");?>" width="17" height="17" border="0" alt="" />
- </a>
- <a href="disks_manage.php?act=del&id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete disk");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- <tr>
- <td class="list" colspan="6"></td>
- <td class="list" nowrap>
- <a href="disks_manage_edit.php">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add disk");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_manage_edit.php b/config/archive/freenas/www/disks_manage_edit.php
deleted file mode 100644
index 80e11ef3..00000000
--- a/config/archive/freenas/www/disks_manage_edit.php
+++ /dev/null
@@ -1,275 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_manage_edit.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("Management"),
- gettext("Edit"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$id = $_GET['id'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-
-/* get disk list (without CDROM) */
-$disklist = get_physical_disks_list();
-
-if (!is_array($freenas_config['disks']['disk']))
- $freenas_config['disks']['disk'] = array();
-
-disks_sort();
-
-$a_disk = &$freenas_config['disks']['disk'];
-
-if (isset($id) && $a_disk[$id])
-{
- $pconfig['name'] = $a_disk[$id]['name'];
- $pconfig['harddiskstandby'] = $a_disk[$id]['harddiskstandby'];
- $pconfig['acoustic'] = $a_disk[$id]['acoustic'];
- $pconfig['fstype'] = $a_disk[$id]['fstype'];
- $pconfig['apm'] = $a_disk[$id]['apm'];
- $pconfig['udma'] = $a_disk[$id]['udma'];
- $pconfig['fullname'] = $a_disk[$id]['fullname'];
-}
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = split(" ", "name");
- $reqdfieldsn = split(",", "Name");
-
- do_input_validation_new($_POST, $reqdfields, $reqdfieldsn, &$error_bucket);
- $pconfig = $_POST;
-
- /* check for name conflicts */
- foreach ($a_disk as $disk)
- {
- if (isset($id) && ($a_disk[$id]) && ($a_disk[$id] === $disk)) { continue; }
-
- if ($disk['name'] == $_POST['name'])
- {
- $error_bucket[] = array("error" => gettext("This disk already exists in the disk list."),
- "field" => "name");
- break;
- }
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $disks = array();
-
- $devname = $_POST['name'];
- $devharddiskstandby = $_POST['harddiskstandby'];
- $harddiskacoustic = $_POST['acoustic'];
- $harddiskapm = $_POST['apm'];
- $harddiskudma = $_POST['udma'];
- $harddiskfstype = $_POST['fstype'];
-
- $disks['name'] = $devname;
- $disks['fullname'] = "/dev/$devname";
- $disks['harddiskstandby'] = $devharddiskstandby ;
- $disks['acoustic'] = $harddiskacoustic ;
- if ($harddiskfstype) { $disks['fstype'] = $harddiskfstype; }
- $disks['apm'] = $harddiskapm ;
- $disks['udma'] = $harddiskudma ;
- $disks['type'] = $disklist[$devname]['type'];
- $disks['desc'] = $disklist[$devname]['desc'];
- $disks['size'] = $disklist[$devname]['size'];
-
- if (isset($id) && $a_disk[$id]) {
- $a_disk[$id] = $disks;
- } else {
- $a_disk[] = $disks;
- }
-
- touch($d_diskdirty_path);
-
- disks_set_ataidle();
- write_config();
-
- pfSenseHeader("disks_manage.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
- <div id="inputerrors"></div>
- <form id="iform" name="iform" action="disks_manage_edit.php" method="post">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Disk");?></td>
- <td width="78%" class="vtable">
- <select name="name" class="formselect" id="name">
- <?php foreach ($disklist as $diski => $diskv): ?>
- <option value="<?=$diski;?>" <?php if ($diski == $pconfig['name']) echo "selected=\"selected\"";?>>
- <?php echo htmlspecialchars($diski . ": " .$diskv['size'] . " (" . $diskv['desc'] . ")");?>
- </option>
- <?php endforeach; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("UDMA mode");?></td>
- <td width="78%" class="vtable">
- <select name="udma" class="formselect" id="udma">
- <?php
- $types = explode(",", "Auto,UDMA-33,UDMA-66,UDMA-100,UDMA-133");
- $vals = explode(" ", "auto UDMA2 UDMA4 UDMA5 UDMA6");
- $j = 0;
-
- for ($j = 0; $j < count($vals); $j++):
- ?>
- <option value="<?=$vals[$j];?>" <?php if ($vals[$j] == $pconfig['udma']) echo "selected=\"selected\"";?>>
- <?=htmlspecialchars($types[$j]);?>
- </option>
- <?php endfor; ?>
- </select>
- <br />
- <?= gettext("You can force UDMA mode if you have \"UDMA_ERROR.... LBA\" message with your hard drive."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Hard disk standby time");?></td>
- <td width="78%" class="vtable">
- <select name="harddiskstandby" class="formselect">
- <?php
- $sbvals = array(0=>"Always on",5=>"5 minutes",10=>"10 minutes",20=>"20 minutes",30=>"30 minutes",60=>"60 minutes");
- ?>
- <?php foreach ($sbvals as $sbval => $sbname): ?>
- <option value="<?=$sbval;?>" <?php if($pconfig['harddiskstandby'] == $sbval) echo 'selected="selected"';?>><?=htmlspecialchars($sbname);?></option>
- <?php endforeach; ?>
- </select>
- <br />
- <?= gettext("Puts the hard disk into standby mode when the selected amount of time after the last
- access has elapsed. <em>Do not set this for CF cards.</em>"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Advanced Power Management");?></td>
- <td width="78%" class="vtable">
- <select name="apm" class="formselect">
- <?php
- $apmvals = array(0=>"Disabled",1=>"Minimum power usage with Standby",64=>"Medium power usage with Standby",128=>"Minimum power usage without Standby",192=>"Medium power usage without Standby",254=>"Maximum performance, maximum power usage");
- ?>
- <?php foreach ($apmvals as $apmval => $apmname): ?>
- <option value="<?=$apmval;?>" <?php if($pconfig['apm'] == $apmval) echo 'selected="selected"';?>><?=htmlspecialchars($apmname);?></option>
- <?php endforeach; ?>
- </select>
- <br />
- <?= gettext("This allows you to lower the power consumption of the drive, at the expense of performance.<em>Do not set this for CF cards.</em>"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("acoustic level");?></td>
- <td width="78%" class="vtable">
- <select name="acoustic" class="formselect">
- <?php
- $acvals = array(0=>"Disabled",1=>"Minimum performance, Minimum acoustic output",64=>"Medium acoustic output",127=>"Maximum performance, maximum acoustic output");
- ?>
- <?php foreach ($acvals as $acval => $acname): ?>
- <option value="<?=$acval;?>" <?php if($pconfig['acoustic'] == $acval) echo 'selected';?>><?=htmlspecialchars($acname);?></option>
- <?php endforeach; ?>
- </select>
- <br />
- <?= gettext("This allows you to set how loud the drive is while it\'s operating.<em>Do not set this for CF cards.</em>"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("preformated FS");?></td>
- <td width="78%" class="vtable">
- <select name="fstype" class="formselect">
- <?php $fstlist = get_fstype_list(); ?>
- <?php foreach ($fstlist as $fstval => $fstname): ?>
- <option value="<?=$fstval;?>" <?php if($pconfig['fstype'] == $fstval) echo 'selected';?>><?=htmlspecialchars($fstname);?></option>
- <?php endforeach; ?>
- </select>
- <br />
- <?= gettext("This allows you to set FS type for preformated disk with data.<br />
- <em>Leave \"unformated\" for unformated disk and then use Format menu.</em>"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- <?php if (isset($id) && $a_disk[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- </td>
- </tr>
- </table>
- </form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_manage_init.php b/config/archive/freenas/www/disks_manage_init.php
deleted file mode 100644
index e8d939d3..00000000
--- a/config/archive/freenas/www/disks_manage_init.php
+++ /dev/null
@@ -1,511 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_manage_init.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("Initialize"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-define("DISK_DETAILS_PARA", "
- <p style='font-size: small;'>
- <strong>Disk initialization details</strong> (use the toggle icon to unveil detailed infos):
- </p>
- ");
-
-function create_format_output($disk, $type, $notinitmbr) {
- $ddetails = DISK_DETAILS_PARA;
-
- ob_end_flush();
-
- $retvalue =<<<EOD
-{$ddetails}
-
-EOD;
-
- // Erase MBR if not checked
- if (!$notinitmbr) {
- $button = create_toggle_button("Erasing MBR and all paritions", "mbr_out");
- $cmd = "dd if=/dev/zero of=" . escapeshellarg($disk) . " bs=32k count=640";
- $out = create_cmdout_container("mbr_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
- } else {
- $diskinit_str = "Keeping the MBR and all partitions";
- $retvalue .=<<<EOD
- <div id="mbr_out" style="font-family: Courier, monospace; font-size: small;">
- <pre style="font-family: Courier, monospace; font-size: small; font-style: italic;">{$diskinit_str}</pre>
- </div>
-
-EOD;
- } // end if
-
- switch ($type) {
- case "ufs":
- $button = create_toggle_button("Creating one partition", "ufs_fdisk_out");
- /* Initialize disk */
- $cmd = "/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk);
- $out = create_cmdout_container("ufs_fdisk_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Initializing partition", "ufs_dd_out");
- /* Initialise the partition (optional) */
- $cmd = "/bin/dd if=/dev/zero of=" . escapeshellarg($disk) . "s1 bs=32k count=16";
- $out = create_cmdout_container("ufs_dd_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Creating BSD label", "ufs_label_out");
- /* Create s1 label */
- $cmd = "/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto";
- $out = create_cmdout_container("ufs_label_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Creating Filesystem", "ufs_newfs_out");
- /* Create filesystem */
- $cmd = "/sbin/newfs -U " . escapeshellarg($disk) . "s1";
- $out = create_cmdout_container("ufs_newfs_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- break; // end case "ufs":
- case "ufs_no_su":
- $button = create_toggle_button("Creating one partition", "ufsn_fdisk_out");
- /* Initialize disk */
- $cmd = "/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk);
- $out = create_cmdout_container("ufsn_fdisk_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Initializing partition", "ufsn_dd_out");
- /* Initialise the partition (optional) */
- $cmd = "/bin/dd if=/dev/zero of=" . escapeshellarg($disk) . "s1 bs=32k count=16";
- $out = create_cmdout_container("ufsn_dd_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Creating BSD label", "ufsn_label_out");
- /* Create s1 label */
- $cmd = "/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto";
- $out = create_cmdout_container("ufsn_label_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Creating Filesystem", "ufsn_newfs_out");
- /* Create filesystem */
- $cmd = "/sbin/newfs -m 0 " . escapeshellarg($disk) . "s1";
- $out = create_cmdout_container("ufsn_newfs_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- break; // end ufs_no_su
- case "ufsgpt":
- $button = create_toggle_button("Destroying old GTP information", "ufsg_gptd_out");
- /* Destroy GPT partition table */
- $cmd = "/sbin/gpt destroy " . escapeshellarg($disk);
- $out = create_cmdout_container("ufsg_gptd_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Creating GPT partition", "ufsg_gptc_out");
- /* Create GPT partition table */
- $cmd = array("/sbin/gpt create -f " . escapeshellarg($disk),
- "/sbin/gpt add -t ufs " . escapeshellarg($disk));
- $out = create_cmdout_container("ufsg_gptc_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Creating Filesystem with Soft Updates", "ufsg_newfs_out");
- /* Create filesystem */
- $cmd = "/sbin/newfs -U " . escapeshellarg($disk) . "p1";
- $out = create_cmdout_container("ufsg_newfs_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- break; // end case "ufsgpt":
- case "ufsgpt_no_su":
- $button = create_toggle_button("Destroying old GTP information", "ufsgn_gpt_out");
- /* Destroy GPT partition table */
- $cmd = "/sbin/gpt destroy " . escapeshellarg($disk);
- $out = create_cmdout_container("ufsgn_gpt_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Creating GPT partition", "ufsgn_gptc_out");
- /* Create GPT partition table */
- $cmd = array("/sbin/gpt create -f " . escapeshellarg($disk),
- "/sbin/gpt add -t ufs " . escapeshellarg($disk));
- $out = create_cmdout_container("ufsgn_gptc_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Creating Filesystem without Soft Updates", "ufsgn_newfs_out");
- /* Create filesystem */
- $cmd = "/sbin/newfs -m 0 " . escapeshellarg($disk) . "p1";
- $out = create_cmdout_container("ufsgn_newfs_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- break; // end case "ufsgpt_no_su":
- case "softraid":
- $button = create_toggle_button("Initializing disk", "softr_fdisk_out");
- /* Initialize disk */
- $cmd = "/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk);
- $out = create_cmdout_container("softr_fdisk_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Initializing partition", "softr_dd_out");
- /* Initialise the partition (optional) */
- $cmd = "/bin/dd if=/dev/zero of=" . escapeshellarg($disk) . "s1 bs=32k count=16";
- $out = create_cmdout_container("softr_dd_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Delete old gmirror information", "softr_dd_out");
- /* Delete old gmirror information */
- $cmd = "/sbin/gmirror clear " . escapeshellarg($disk);
- $out = create_cmdout_container("softr_dd_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- break; // end case "softraid":
- case "msdos":
- $button = create_toggle_button("Initialize disk", "dos_fdisk_out");
- /* Initialize disk */
- $cmd = "/sbin/fdisk -I -b /boot/mbr " . escapeshellarg($disk);
- $out = create_cmdout_container("dos_fdisk_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Initialize partion", "dos_dd_out");
- /* Initialise the partition (optional) */
- $cmd = "/bin/dd if=/dev/zero of=" . escapeshellarg($disk) . "s1 bs=32k count=16";
- $out = create_cmdout_container("dos_dd_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Creating BSD label", "dos_label_out");
- /* Initialise the partition (optional) */
- $cmd = "/sbin/bsdlabel -w " . escapeshellarg($disk) . "s1 auto";
- $out = create_cmdout_container("dos_label_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
-
- $button = create_toggle_button("Creating Filesystem", "dos_newfs_out");
- /* Initialise the partition (optional) */
- $a_out = "/sbin/newfs_msdos -F 32 " . escapeshellarg($disk) . "s1";
- $out = create_cmdout_container("dos_newfs_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out, true);
-
- break; // end case "msdos":
- } // end switch
-
- return $retvalue;
-}
-
-if (!is_array($freenas_config['disks']['disk']))
- $freenas_config['disks']['disk'] = array();
-
-disks_sort();
-
-if (!is_array($freenas_config['gconcat']['vdisk']))
- $freenas_config['gconcat']['vdisk'] = array();
-
-gconcat_sort();
-
-if (!is_array($freenas_config['gmirror']['vdisk']))
- $freenas_config['gmirror']['vdisk'] = array();
-
-gmirror_sort();
-
-if (!is_array($freenas_config['graid5']['vdisk']))
- $freenas_config['graid5']['vdisk'] = array();
-
-graid5_sort();
-
-if (!is_array($freenas_config['gstripe']['vdisk']))
- $freenas_config['gstripe']['vdisk'] = array();
-
-gstripe_sort();
-
-if (!is_array($freenas_config['gvinum']['vdisk']))
- $freenas_config['gvinum']['vdisk'] = array();
-
-gvinum_sort();
-
-// Get all fstype supported by FreeNAS
-$a_fst = get_fstype_list();
-// Remove NTFS: can't format on NTFS under FreeNAS
-unset($a_fst['ntfs']);
-// Remove the first blank line 'unknown'
-$a_fst = array_slice($a_fst, 1);
-
-$a_disk = &$freenas_config['disks']['disk'];
-$a_gconcat = &$freenas_config['gconcat']['vdisk'];
-$a_gmirror = &$freenas_config['gmirror']['vdisk'];
-$a_gstripe = &$freenas_config['gstripe']['vdisk'];
-$a_graid5 = &$freenas_config['graid5']['vdisk'];
-$a_gvinum = &$freenas_config['gvinum']['vdisk'];
- $a_alldisk = array_merge($a_disk,
- $a_gconcat,
- $a_gmirror,
- $a_gstripe,
- $a_graid5,
- $a_gvinum);
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- unset($do_format);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = explode(" ", "disk type");
- $reqdfieldsn = explode(",", "Disk,Type");
-
- do_input_validation_new($_POST, $reqdfields, $reqdfieldsn, &$error_bucket);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $do_format = true;
- $disk = $_POST['disk'];
- $type = $_POST['type'];
- $notinitmbr= $_POST['notinitmbr'];
-
- /* Check if disk is mounted. */
- if(isAjax() && disks_check_mount_fullname($disk)) {
- $statustxt = sprintf(gettext("The disk is currently mounted! <a href=%s>Unmount</a> this disk first before proceeding."), "disks_mount_tools.php?disk={$disk}&amp;action=umount");
-
- $divcontents = "<div style='background:#990000'><table>";
- $divcontents .= "<tr><td>";
- $divcontents .= "<img src='/themes/{$g['theme']}/images/icons/icon_error.gif' width='28' height='32'>";
- $divcontents .= "</td><td><font color='white'><br>&nbsp;&nbsp;The following errors have occured:<p><ul>";
- $divcontents .= "<font color='white'><li> " . $statustxt . "</li>";
- $divcontents .= "</ul></td></table></div><br />";
-
- header("HTTP/1.0 500 Internal Server Error");
- header("Status: 500 Internal Server Error. {$statustxt}");
- echo $divcontents;
- exit;
- } else if (disks_check_mount_fullname($disk)) {
- $errormsg = sprintf(gettext("The disk is currently mounted! <a href=%s>Unmount</a> this disk first before proceeding."), "disks_mount_tools.php?disk={$disk}&action=umount");
- $do_format = false;
- }
-
- if($do_format) {
- /* Get the id of the disk array entry. */
- $NotFound = 1;
- $id = array_search_ex($disk, $a_disk, "fullname");
-
- if ($id) {
- /* Set new filesystem type. */
- $a_disk[$id]['fstype'] = $type;
- $NotFound = 0;
- }
- else {
- $id = array_search_ex($disk, $a_gmirror, "fullname");
- }
- if (($id !== false) && $NotFound) {
- /* Set new filesystem type. */
- $a_gmirror[$id]['fstype'] = $type;
- $NotFound = 0;
- }
- else {
- $id = array_search_ex($disk, $a_gstripe, "fullname");
- }
- if (($id !== false) && $NotFound) {
- /* Set new filesystem type. */
- $a_gstripe[$id]['fstype'] = $type;
- $NotFound = 0;
- }
- else {
- $id = array_search_ex($disk, $a_gconcat, "fullname");
- }
- if (($id !== false) && $NotFound) {
- /* Set new filesystem type. */
- $a_gconcat[$id]['fstype'] = $type;
- $NotFound = 0;
- }
- else {
- $id = array_search_ex($disk, $a_graid5, "fullname");
- }
- if (($id !== false) && $NotFound) {
- /* Set new filesystem type. */
- $a_graid5[$id]['fstype'] = $type;
- $NotFound = 0;
- }
- else {
- $id = array_search_ex($disk, $a_gvinum, "fullname");
- }
- if (($id !== false) && $NotFound) {
- /* Set new filesystem type. */
- $a_gvinum[$id]['fstype'] = $type;
- $NotFound = 0;
- }
-
- write_config();
-
- echo create_format_output($disk, $type, $notinitmbr);
- exit; // cause of Ajax
- }
- }
-}
-
-if (!isset($do_format))
-{
- $do_format = false;
- $disk = '';
- $type = '';
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-$pfSenseHead->setCloseHead(false);
-echo $pfSenseHead->getHTML();
-
-?>
-<script type="text/javascript">
-<!--
-function disk_change() {
- switch(document.iform.disk.value)
- {
- <?php foreach ($a_alldisk as $diskv): ?>
- case "<?=$diskv['fullname'];?>":
- <?php $i = 0;?>
- <?php foreach ($a_fst as $fstval => $fstname): ?>
- document.iform.type.options[<?=$i++;?>].selected = <?php if($diskv['fstype'] == $fstval){echo "true";}else{echo "false";};?>;
- <?php endforeach; ?>
- break;
- <?php endforeach; ?>
- }
-}
-
-<?= CMDOUT_TOGGLE_FUNC ?>
-// -->
-</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<?php if($errormsg) print_error_box($errormsg);?>
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage"), false, "disks_manage.php");
- $tab_array[1] = array(gettext("Format"), true, "disks_manage_init.php");
- $tab_array[2] = array(gettext("Tools"), false, "disks_manage_tools.php");
- $tab_array[3] = array(gettext("iSCSI Initiator"), false, "disks_manage_iscsi.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form id="iform" name="iform" action="disks_manage_init.php" method="post">
- <?= CMDOUT_AJAX_SCRIPT ?>
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Disk");?></td>
- <td width="78%" class="vtable">
- <select name="disk" class="formselect" id="disk" onchange="disk_change();">
- <?php foreach ($a_alldisk as $diskv): ?>
- <option value="<?=$diskv['fullname'];?>" <?php if ($diskv['name'] == $disk) echo "selected=\selected\"";?>>
- <?php echo htmlspecialchars($diskv['name'] . ": " .$diskv['size'] . " (" . $diskv['desc'] . ")");?>
- <?php endforeach; ?>
- </option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("File system");?></td>
- <td width="78%" class="vtable">
- <select name="type" class="formselect" id="type">
- <?php foreach ($a_fst as $fstval => $fstname): ?>
- <option value="<?=$fstval;?>" <?php if($type == $fstval) echo 'selected="selected"';?>><?=htmlspecialchars($fstname);?></option>
- <?php endforeach; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Don't Erase MBR");?></td>
- <td width="78%" class="vtable">
- <input name="notinitmbr" id="notinitmbr" type="checkbox" value="yes" /><br />
- <?= gettext("don't erase the MBR (useful for some RAID controller cards)"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="doCMDSubmit" name="doCMDSubmit" type="button" class="formbtn" value="<?=gettext("Format disk!");?>" onclick="execCMD();" />
- </td>
- </tr>
- <tr>
- <!-- Format Output Container - Do Not Delete -->
- <td id="cmdOutputTD" valign="top" colspan="2" style="visibility: hidden; border: solid 1px silver; vertical-align: middle; width: 100%"></td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="2">
- <span class="red">
- <strong>WARNING:</strong>
- </span>
- <br />
- <span class="vexpl">
- <?= gettext("This step will erase all your partition, create partition number 1 and format the hard drive with the file system specified."); ?>
- </span>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_manage_iscsi.php b/config/archive/freenas/www/disks_manage_iscsi.php
deleted file mode 100644
index 5180fc1a..00000000
--- a/config/archive/freenas/www/disks_manage_iscsi.php
+++ /dev/null
@@ -1,209 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_manage_iscsi.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("iSCSI Initiator"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! is_array($freenas_config['iscsi']))
-{
- $freenas_config['iscsi'] = array();
-}
-
-$pconfig['enable'] = isset($freenas_config['iscsi']['enable']);
-$pconfig['targetaddress'] = $freenas_config['iscsi']['targetaddress'];
-$pconfig['targetname'] = $freenas_config['iscsi']['targetname'];
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $pconfig = $_POST;
-
- /* input validation */
- if ($_POST['enable'])
- {
- $reqdfields = array_merge($reqdfields, explode(" ", "targetaddress targetname"));
- $reqdfieldsn = array_merge($reqdfieldsn, explode(",", "targetaddress,targetname"));
- }
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if ($_POST['enable'] && !is_ipaddr($_POST['targetaddress'])){
- $error_bucket[] = array("error" => gettext("A valid IP address must be specified."),
- "field" => "targetaddress");
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $freenas_config['iscsi']['enable'] = $_POST['enable'] ? true : false;
- $freenas_config['iscsi']['targetaddress'] = $_POST['targetaddress'];
- $freenas_config['iscsi']['targetname'] = $_POST['targetname'];
-
- write_config();
-
- $retval = 0;
- if (! file_exists($d_sysrebootreqd_path))
- {
- /* nuke the cache file */
- config_lock();
- services_iscsi_configure();
- config_unlock();
- }
- $savemsg = get_std_save_message($retval);
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-$jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-function enable_change(enable_change) {
- var endis;
-
- endis = !(document.iform.enable.checked || enable_change);
- endis ? color = '#D4D0C8' : color = '#FFFFFF';
-
- document.iform.targetname.disabled = endis;
- document.iform.targetaddress.disabled = endis;
- /* adjust colors */
- document.iform.targetname.style.backgroundColor = color;
- document.iform.targetaddress.style.backgroundColor = color;
-}
-//-->
-</script>
-
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage"), false, "disks_manage.php");
- $tab_array[1] = array(gettext("Format"), false, "disks_manage_init.php");
- $tab_array[2] = array(gettext("Tools"), false, "disks_manage_tools.php");
- $tab_array[3] = array(gettext("iSCSI Initiator"), true, "disks_manage_iscsi.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form id="iform" name="iform" action="disks_manage_iscsi.php" method="post">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" valign="middle" class="listtopic" colspan="2">
- <span style="vertical-align: middle; position: relative; left: 0px;"><?=gettext("iSCSI Initiator");?></span>
- <span style="vertical-align: middle; position: relative; left: 81%;">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onClick="enable_change(false)" />&nbsp;<?= gettext("Enable"); ?>
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Target IP address"); ?></td>
- <td width="78%" class="vtable">
- <input name="targetaddress" type="text" class="formfld unknown" id="targetaddress" size="20" value="<?=htmlspecialchars($pconfig['targetaddress']);?>" />
- <br /><?= gettext("Target IP address"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("targetname"); ?></td>
- <td width="78%" class="vtable">
- <input name="targetname" type="text" class="formfld unknown" id="targetname" size="20" value="<?=htmlspecialchars($pconfig['targetname']);?>" />
- <br /><?= gettext("targetname"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-<script type="text/javascript">
-<!--
-enable_change(false);
-//-->
-</script>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_manage_tools.php b/config/archive/freenas/www/disks_manage_tools.php
deleted file mode 100644
index d851f65c..00000000
--- a/config/archive/freenas/www/disks_manage_tools.php
+++ /dev/null
@@ -1,331 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_manage_tools.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("Tools"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-function create_cmd_output(&$action, &$a_disk, &$disk, &$partition, &$umount) {
- $cmdout = CMDOUT_PARA;
-
- ob_end_flush();
-
- $retvalue =<<<EOD
-{$cmdout}
-
-EOD;
-
- switch($action)
- {
- case "fsck":
- /* Get the id of the disk. */
- $id = array_search_ex($disk, $a_disk, "name");
- /* Get the filesystem type of the disk. */
- $type = $a_disk[$id]['fstype'];
- /* Check if disk is mounted. */
- $ismounted = disks_check_mount_fullname($disk.$partition);
-
- /* Umount disk if necessary. */
- if($umount && $ismounted) {
- $diskinit_str = "<strong class='red'>" . gettext("Note") . ":</strong> " . gettext("The disk is currently mounted! The mount point will be removed temporary to perform selected command.") . "<br /><br />";
- $retvalue .=<<<EOD
- <div id="ismounted_out" style="font-family: Courier, monospace; font-size: small;">
- <pre style="font-family: Courier, monospace; font-size: small; font-style: italic;">{$diskinit_str}</pre>
- </div>
-
-EOD;
-
- disks_umount_fullname($disk.$partition);
- }
-
- switch($type)
- {
- case "":
- case "ufs":
- case "ufs_no_su":
- case "ufsgpt":
- case "ufsgpt_no_su":
- $button = create_toggle_button("Checking disk", "ufsgn_fsck_out");
- $cmd = "/sbin/fsck_ufs -y -f " . escapeshellarg($disk . $partition);
- $out = create_cmdout_container("ufsgn_fsck_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
- break;
- case "gmirror":
- case "gvinum":
- case "graid5":
- $diskinit_str = sprintf(gettext("Use <a href='%s'>RAID tools</a> for this disk!"), "disks_raid_{$type}_tools.php");
- $retvalue .=<<<EOD
- <div id="graid5_out" style="display: none; font-family: Courier, monospace; font-size: small;">
- <pre style="font-family: Courier, monospace; font-size: small; font-style: italic;">{$diskinit_str}</pre>
- </div>
-
-EOD;
- break;
- case "msdos":
- $button = create_toggle_button("Checking disk", "dos_fsck_out");
- $cmd = "/sbin/fsck_msdosfs -y -f " . escapeshellarg($disk . $partition);
- $out = create_cmdout_container("dos_fsck_out", $cmd);
- $retvalue .= assemble_cmdout($button, $out);
- break;
- }
-
- /* Mount disk if necessary. */
- if($umount && $ismounted) {
- disks_mount_fullname($disk.$partition);
- }
-
- break;
- }
-
- return $retvalue;
-}
-
-if (!is_array($freenas_config['disks']['disk']))
- $freenas_config['disks']['disk'] = array();
-
-disks_sort();
-
-if (!is_array($freenas_config['gvinum']['vdisk']))
- $freenas_config['gvinum']['vdisk'] = array();
-
-gvinum_sort();
-
-if (!is_array($freenas_config['gmirror']['vdisk']))
- $freenas_config['gmirror']['vdisk'] = array();
-
-gmirror_sort();
-
-if (!is_array($freenas_config['gconcat']['vdisk']))
- $freenas_config['gconcat']['vdisk'] = array();
-
-gconcat_sort();
-
-if (!is_array($freenas_config['gstripe']['vdisk']))
- $freenas_config['gstripe']['vdisk'] = array();
-
-gstripe_sort();
-
-if (!is_array($freenas_config['graid5']['vdisk']))
- $freenas_config['graid5']['vdisk'] = array();
-
-graid5_sort();
-
-$a_disk = array_merge($freenas_config['disks']['disk'],
- $freenas_config['gvinum']['vdisk'],
- $freenas_config['gmirror']['vdisk'],
- $freenas_config['gconcat']['vdisk'],
- $freenas_config['gstripe']['vdisk'],
- $freenas_config['graid5']['vdisk']);
-
-if ($_POST) {
- unset($input_errors);
- unset($do_action);
-
- /* input validation */
- $reqdfields = explode(" ", "disk action");
- $reqdfieldsn = explode(",", "Disk,Action");
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $do_action = true;
- $disk = $_POST['disk'];
- $action = $_POST['action'];
- $partition = $_POST['partitionno'];
- $umount = $_POST['umount'];
-
- echo create_cmd_output($action, $a_disk, $disk, $partition, $umount);
- exit; // cause of Ajax
- }
-}
-
-if (!isset($do_action))
-{
- $do_action = false;
- $disk = '';
- $action = '';
- $partition = '';
- $umount = false;
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-$pfSenseHead->setCloseHead(false);
-echo $pfSenseHead->getHTML();
-
-?>
-<script type="text/javascript">
-<!--
-function disk_change() {
- var next = null;
- // Remove all entries from partition combobox.
- document.iform.partitionno.length = 0;
- // Insert entries for partition combobox.
- alert(document.iform.disk.value);
- switch(document.iform.disk.value)
- {
- <?php foreach ($a_disk as $diskv): ?>
- <?php if (strcmp($diskv['fstype'],"softraid")==0): ?>
- <?php continue; ?>
- <?php endif; ?>
- case "/dev/<?=$diskv['name'];?>":
- <?php $partinfo = disks_get_partition_info($diskv['name']);?>
- <?php foreach($partinfo as $partinfon => $partinfov): ?>
- if(document.all) // MS IE workaround.
- next = document.iform.partitionno.length;
- alert(document.iform.partitionno);
- document.iform.partitionno.add(new Option("<?=$partinfon;?>","s<?=$partinfon;?>",false,<?php if("s{$partinfon}"==$partition){echo "true";}else{echo "false";};?>), next);
- <?php endforeach; ?>
- break;
- <?php endforeach; ?>
- }
-}
-
-<?= CMDOUT_TOGGLE_FUNC ?>
-// -->
-</script>
-</head>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="disks_manage_tools.php" method="post" name="iform" id="iform">
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage"), false, "disks_manage.php");
- $tab_array[1] = array(gettext("Format"), false, "disks_manage_init.php");
- $tab_array[2] = array(gettext("Tools"), true, "disks_manage_tools.php");
- $tab_array[3] = array(gettext("iSCSI Initiator"), false, "disks_manage_iscsi.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <?= CMDOUT_AJAX_SCRIPT ?>
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Disk");?></td>
- <td width="78%" class="vtable">
- <select name="disk" class="formselect" id="disk" onchange="disk_change();">
- <?php foreach ($a_disk as $diskn): ?>
- <?php if (strcmp($diskn['fstype'],"softraid")==0): ?>
- <?php continue; ?>
- <?php endif; ?>
- <option value="<?=$diskn['fullname'];?>"<?php if ($diskn['fullname'] == $disk) echo "selected=\"selected\"";?>>
- <?php echo htmlspecialchars($diskn['name'] . ": " .$diskn['size'] . " (" . $diskn['desc'] . ")");?>
- <?php endforeach; ?>
- </option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Partition");?></td>
- <td width="78%" class="vtable">
- <select name="partitionno" class="formselect" id="partitionno"></select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Command");?></td>
- <td width="78%" class="vtable">
- <select name="action" class="formselect" id="action">
- <option value="fsck" <?php if ($action == "fsck") echo "selected"; ?>>fsck</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"></td>
- <td width="78%" class="vtable">
- <input name="umount" type="checkbox" id="umount" value="yes" <?php if ($umount) echo "checked"; ?> />
- <strong>
- <?= gettext("Unmount disk/partition"); ?>
- </strong>
- <span class="vexpl">
- <br />
- <?= gettext("If the selected disk/partition is mounted it will be unmounted temporary to perform selected command, otherwise the commands work in read-only mode."); ?>
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="doCMDSubmit" name="doCMDSubmit" type="button" class="formbtn" value="<?=gettext("Send Command!");?>" onclick="execCMD();" />
- </td>
- </tr>
- <tr>
- <!-- Format Output Container - Do Not Delete -->
- <td id="cmdOutputTD" valign="top" colspan="2" style="visibility: hidden; border: solid 1px silver; vertical-align: middle; width: 100%"></td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<script type="text/javascript">
-<!--
- disk_change();
-//-->
-</script>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_mount.php b/config/archive/freenas/www/disks_mount.php
deleted file mode 100644
index c72b0d82..00000000
--- a/config/archive/freenas/www/disks_mount.php
+++ /dev/null
@@ -1,235 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_mount.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("Mount Point"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['mounts']['mount']))
- $freenas_config['mounts']['mount'] = array();
-
-mount_sort();
-
-$a_mount = &$freenas_config['mounts']['mount'];
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if ($_POST['apply']) {
- $retval = 0;
-
- if (!file_exists($d_sysrebootreqd_path)) {
- config_lock();
- /* reload all components that mount disk */
- disks_mount_all();
- /* reload all components that use mount */
- services_samba_configure();
- services_nfs_configure();
- services_rsyncd_configure();
- services_afpd_configure();
- config_unlock();
- }
- $savemsg = get_std_save_message($retval);
- if ($retval == 0) {
- if (file_exists($d_mountdirty_path))
- unlink($d_mountdirty_path);
- }
- }
-}
-
-if ($_GET['act'] == "del")
-{
- if ($a_mount[$_GET['id']]) {
- disks_umount_adv($a_mount[$_GET['id']]);
- unset($a_mount[$_GET['id']]);
- write_config();
- touch($d_mountdirty_path);
- pfSenseHeader("disks_mount.php");
- exit;
- }
-}
-
-if ($_GET['act'] == "ret")
-{
- if ($a_mount[$_GET['id']]) {
- disks_mount($a_mount[$_GET['id']]);
- pfSenseHeader("disks_mount.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form id="iform" name="iform" action="disks_mount.php" method="post">
-<?php if (file_exists($d_mountdirty_path)): ?>
-<?php print_info_box_np(gettext("The mount point list has been changed.") . "<br />" .
- gettext("You must apply the changes in order for them to take effect."));?>
-<?php endif; ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage"), true, "disks_mount.php");
- $tab_array[1] = array(gettext("Tools"), false, "disks_mount_tools.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><?=gettext("Disk");?></td>
- <td class="listhdrr"><?=gettext("Partition");?></td>
- <td class="listhdrr"><?=gettext("File system");?></td>
- <td class="listhdrr"><?=gettext("Share name");?></td>
- <td class="listhdrr"><?=gettext("Description");?></td>
- <td class="listhdrr"><?=gettext("Status");?></td>
- <td class="list">&nbsp;</td>
- </tr>
- <?php $i = 0; foreach ($a_mount as $mount): ?>
- <tr>
- <td valign="middle" class="listlr">
- <?=htmlspecialchars($mount['mdisk']);?> &nbsp;
- </td>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($mount['partition']);?>&nbsp;
- </td>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($mount['fstype']);?>&nbsp;
- </td>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($mount['sharename']);?>&nbsp;
- </td>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($mount['desc']);?>&nbsp;
- </td>
- <td valign="middle" class="listbg" style="color: #FFFFFF;">
- <?php
- if (file_exists($d_mountdirty_path)) {
- $stat = gettext("configuring");
- } else {
- $stat = disks_check_mount($mount);
- if ($stat == false) {
- $stat = "ERROR - <a href=\"disks_mount.php?act=ret&amp;id=$i\">retry</a>";
- } else {
- $stat = gettext("OK");
- }
- }
- echo $stat;
- ?>
- </td>
- <td valign="middle" class="list">
- <a href="disks_mount_edit.php?id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit mount");?>" width="17" height="17" border="0" alt="" />
- </a>
- <a href="disks_mount.php?act=del&id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" onclick="return confirm('<?= gettext("Do you really want to delete this mount point? All elements that still use it will become invalid (e.g. share)!"); ?>');" title="<?=gettext("delete mount");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- <tr>
- <td class="list" colspan="6"></td>
- <td class="list" nowrap>
- <a href="disks_mount_edit.php">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add mount");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="7">
- <span class="red">
- <strong>Note:</strong>
- </span>
- <br />
- <span class="vexpl">
- <?= gettext("Second configuration step: Declaring the filesystem used by your"); ?>
- </span>
- <br />
- <span class="vexpl">
- <a href="disks_manage.php">previously configured disk</a>
- </span>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
- </table>
-</form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_mount_edit.php b/config/archive/freenas/www/disks_mount_edit.php
deleted file mode 100644
index 6b7a2248..00000000
--- a/config/archive/freenas/www/disks_mount_edit.php
+++ /dev/null
@@ -1,307 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_mount_edit.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("Mount Point"),
- gettext("Edit"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$id = $_GET['id'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-
-if (!is_array($freenas_config['mounts']['mount']))
- $freenas_config['mounts']['mount'] = array();
-
-mount_sort();
-
-if (!is_array($freenas_config['disks']['disk']))
- $freenas_config['disks']['disk'] = array();
-
-disks_sort();
-
-if (!is_array($freenas_config['gvinum']['vdisk']))
- $freenas_config['gvinum']['vdisk'] = array();
-
-gvinum_sort();
-
-if (!is_array($freenas_config['gmirror']['vdisk']))
- $freenas_config['gmirror']['vdisk'] = array();
-
-gmirror_sort();
-
-if (!is_array($freenas_config['gconcat']['vdisk']))
- $freenas_config['gconcat']['vdisk'] = array();
-
-gconcat_sort();
-
-if (!is_array($freenas_config['gstripe']['vdisk']))
- $freenas_config['gstripe']['vdisk'] = array();
-
-gstripe_sort();
-
-if (!is_array($freenas_config['graid5']['vdisk']))
- $freenas_config['graid5']['vdisk'] = array();
-
-graid5_sort();
-
-$a_mount = &$freenas_config['mounts']['mount'];
-
-$a_disk = array_merge($freenas_config['disks']['disk'],$freenas_config['gvinum']['vdisk'],$freenas_config['gmirror']['vdisk'],$freenas_config['gconcat']['vdisk'],$freenas_config['gstripe']['vdisk'],$freenas_config['graid5']['vdisk']);
-
-/* Load the cfdevice file*/
-$filename=$g['varetc_path']."/cfdevice";
-if (file_exists($filename))
- $cfdevice = trim(file_get_contents("$filename"));
-
-if (isset($id) && $a_mount[$id]) {
- $pconfig['mdisk'] = $a_mount[$id]['mdisk'];
- $pconfig['partition'] = $a_mount[$id]['partition'];
- $pconfig['fullname'] = $a_mount[$id]['fullname'];
- $pconfig['fstype'] = $a_mount[$id]['fstype'];
- $pconfig['sharename'] = $a_mount[$id]['sharename'];
- $pconfig['desc'] = $a_mount[$id]['desc'];
-}
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = split(" ", "partitionno mdisk fstype");
- $reqdfieldsn = split(",", "Partition,Mdisk,Fstype");
-
- do_input_validation_new($_POST, $reqdfields, $reqdfieldsn, &$error_bucket);
-
- if (($_POST['sharename'] && !is_validsharename($_POST['sharename'])))
- {
- $error_bucket[] = array("error" => gettext("The share name may only consist of the characters a-z, A-Z, 0-9, _ , -."),
- "field" => "sharename");
- }
-
-
- if (($_POST['desc'] && !is_validdesc($_POST['desc'])))
- {
- $error_bucket[] = array("error" => gettext("The description name contain invalid characters."),
- "field" => "desc");
-
- }
- $device=$_POST['mdisk'].$_POST['partitionno'];
-
- if ($device == $cfdevice )
- {
- $error_bucket[] = array("error" => gettext("Can't mount the system partition 1, the DATA partition is the 2."),
- "field" => "mdisk");
-
- }
-
- /* check for name conflicts */
- foreach ($a_mount as $mount)
- {
- if (isset($id) && ($a_mount[$id]) && ($a_mount[$id] === $mount))
- continue;
-
- /* Check for duplicate mount point */
- if ($mount['mdisk'] == $_POST['mdisk'])
- {
- $error_bucket[] = array("error" => gettext("This disk/partition is allready configured."),
- "field" => "mdisk");
- break;
- }
-
- if (($_POST['sharename']) && ($mount['sharename'] == $_POST['sharename']))
- {
- $error_bucket[] = array("error" => gettext("Duplicate Share Name."),
- "field" => "sharename");
- break;
- }
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $mount = array();
- $mount['mdisk'] = $_POST['mdisk'];
- $mount['partition'] = $_POST['partitionno'];
- $mount['fstype'] = $_POST['fstype'];
- $mount['desc'] = $_POST['desc'];
- /* if not sharename given, create one */
- if (!$_POST['sharename'])
- $mount['sharename'] = "disk_{$_POST['mdisk']}_part_{$_POST['partitionno']}";
- else
- $mount['sharename'] = $_POST['sharename'];
-
- // Generate fullname
- $mount['fullname'] = "{$mount['mdisk']}{$mount['partition']}";
-
- if (isset($id) && $a_mount[$id])
- $a_mount[$id] = $mount;
- else
- $a_mount[] = $mount;
-
- touch($d_mountdirty_path);
-
- write_config();
-
- pfSenseHeader("disks_mount.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
- <div id="inputerrors"></div>
- <form id="iform" name="iform" action="disks_mount_edit.php" method="post">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Disk");?></td>
- <td width="78%" class="vtable">
- <select name="mdisk" class="formselect" id="mdisk">
- <?php foreach ($a_disk as $disk): ?>
- <?php if (strcmp($disk['fstype'],"softraid")==0): ?>
- <?php continue; ?>
- <?php endif; ?>
- <option value="<?=$disk['fullname'];?>" <?php if ($pconfig['mdisk'] == $disk['name']) echo "selected";?>>
- <?php echo htmlspecialchars($disk['name'] . ": " .$disk['size'] . " (" . $disk['desc'] . ")"); ?>
- </option>
- <?php endforeach; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Partition");?></td>
- <td width="78%" class="vtable">
- <select name="partitionno" class="formselect" id="partition_number">
- <option value="s1" <?php if ($pconfig['partition'] == "s1") echo "selected"; ?>>1 (or new software RAID method)</option>
- <option value="s2" <?php if ($pconfig['partition'] == "s2") echo "selected"; ?>>2</option>
- <option value="s3" <?php if ($pconfig['partition'] == "s3") echo "selected"; ?>>3</option>
- <option value="s4" <?php if ($pconfig['partition'] == "s4") echo "selected"; ?>>4</option>
- <option value="gmirror" <?php if ($pconfig['partition'] == "gmirror") echo "selected"; ?>>previous <?=_SOFTRAID ;?> - gmirror</option>
- <option value="graid5" <?php if ($pconfig['partition'] == "graid5") echo "selected"; ?>>previous <?=_SOFTRAID ;?> - graid5</option>
- <option value="gvinum" <?php if ($pconfig['partition'] == "gvinum") echo "selected"; ?>>previous <?=_SOFTRAID ;?> - gvinum</option>
- <option value="p1" <?php if ($pconfig['partition'] == "gpt") echo "selected"; ?>>GPT (or new software RAID method with GPT)</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("File system");?></td>
- <td width="78%" class="vtable">
- <select name="fstype" class="formselect" id="fstype">
- <option value="ufs" <?php if ($pconfig['fstype'] == "ufs") echo "selected=\"selected\""; ?>>UFS</option>
- <option value="msdosfs" <?php if ($pconfig['fstype'] == "msdosfs") echo "selected\"selected\""; ?>>FAT</option>
- <option value="ntfs" <?php if ($pconfig['fstype'] == "ntfs") echo "selected\"selected\""; ?>>NTFS (read-only)</option>
- <option value="ext2fs" <?php if ($pconfig['fstype'] == "ext2fs") echo "selected\"selected\""; ?>>EXT2 FS</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Share name");?></td>
- <td width="78%" class="vtable">
- <input name="sharename" type="text" class="formfld unknown" id="sharename" size="20" value="<?=htmlspecialchars($pconfig['sharename']);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
- <td width="78%" class="vtable">
- <input name="desc" type="text" class="formfld unknown" id="desc" size="20" value="<?=htmlspecialchars($pconfig['desc']);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- <?php if (isset($id) && $a_mount[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>" />
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <td width="100%" align="left" valign="top" colspan="2">
- <span class="red">
- <strong><?= gettext("WARNING"); ?>:</strong>
- </span>
- <ol>
- <li>
- <span class="vexpl">
- <?= gettext("You can't mount the partition '"); ?>
- <?php echo htmlspecialchars($cfdevice);?>
- <?= gettext("' where the config file is stored"); ?>
- </span>
- </li>
- <li><span class="vexpl"><?= gettext("FreeBSD NTFS has lots of bugs."); ?></span></li>
- </ol>
- </td>
- </tr>
- </table>
- </form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_mount_tools.php b/config/archive/freenas/www/disks_mount_tools.php
deleted file mode 100644
index 4f415b77..00000000
--- a/config/archive/freenas/www/disks_mount_tools.php
+++ /dev/null
@@ -1,233 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_mount_tools.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("Mount Point"),
- gettext("Tools"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-function create_cmd_output(&$action, &$a_mount, &$fullname) {
- $cmdout = CMDOUT_PARA_WOHINT;
-
- ob_end_flush();
-
- $retvalue =<<<EOD
-{$cmdout}
-
-EOD;
-
- /* Get the id of the mount array entry. */
- $id = array_search_ex($fullname, $a_mount, "fullname");
- /* Get the mount data. */
- $mount = $a_mount[$id];
-
- switch($action)
- {
- case "mount":
- $diskinit_str = gettext("Mounting '{$fullname}'...") . "<br />";
- $result = disks_mount_fullname($fullname);
- break;
- case "umount":
- $diskinit_str = gettext("Umounting '{$fullname}'...") . "<br />";
- $result = disks_umount_fullname($fullname);
- break;
- }
-
- /* Display result */
- (0 == $result) ? $diskinit_str .= gettext("Successful") : $diskinit_str .= gettext("Failed");
-
- $retvalue .=<<<EOD
- <div id="ismounted_out" style="font-family: Courier, monospace; font-size: small;">
- <pre style="font-family: Courier, monospace; font-size: small; font-style: italic;">{$diskinit_str}</pre>
- </div>
-
-EOD;
-
- return $retvalue;
-}
-
-if (!is_array($freenas_config['mounts']['mount']))
- $freenas_config['mounts']['mount'] = array();
-
-mount_sort();
-
-$a_mount = &$freenas_config['mounts']['mount'];
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- unset($do_action);
-
- /* input validation */
- $reqdfields = explode(" ", "fullname action");
- $reqdfieldsn = explode(",", "Fullname,Action");
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if(!$input_errors)
- {
- $do_action = true;
- $fullname = $_POST['fullname'];
- $action = $_POST['action'];
-
- echo create_cmd_output($action, $a_mount, $fullname);
- exit; // cause of Ajax
- }
-}
-
-if(!isset($do_action))
-{
- $do_action = false;
- $fullname = '';
- $action = '';
-}
-
-// URL GET from the disks_manage_init.php page:
-// we get the $disk value, must found the $fullname now
-if(isset($_GET['disk'])) {
- $disk = $_GET['disk'];
- $id = array_search_ex($disk, $a_mount, "mdisk");
-
- $fullname = $a_mount[$id]['fullname'];
-}
-if(isset($_GET['action'])) {
- $action = $_GET['action'];
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-$pfSenseHead->setCloseHead(false);
-echo $pfSenseHead->getHTML();
-
-?>
-<script type="text/javascript">
-<!--
-<?= CMDOUT_TOGGLE_FUNC ?>
-// -->
-</script>
-</head>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="disks_mount_tools.php" method="post" name="iform" id="iform">
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage"), false, "disks_mount.php");
- $tab_array[1] = array(gettext("Tools"), true, "disks_mount_tools.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <?= CMDOUT_AJAX_SCRIPT ?>
- <?php if ($input_errors) print_input_errors($input_errors); ?>
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td valign="top" class="vncellreq"><?= gettext("Share Name"); ?></td>
- <td class="vtable">
- <select name="fullname" class="formselect" id="fullname">
- <?php foreach ($a_mount as $mountv): ?>
- <option value="<?=$mountv['fullname'];?>"<?php if ($mountv['fullname'] == $fullname) echo "selected";?>>
- <?php echo htmlspecialchars($mountv['sharename'] . " (" . gettext("Disk") . ": " . $mountv['mdisk'] . " " . gettext("Partition") . ": " . $mountv['partition'] . ")");?>
- <?php endforeach; ?>
- </option>
- </select>
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncellreq"><?= gettext("Command"); ?></td>
- <td class="vtable">
- <select name="action" class="formselect" id="action">
- <option value="mount" <?php if ($action == "mount") echo "selected"; ?>>mount</option>
- <option value="umount" <?php if ($action == "umount") echo "selected"; ?>>umount</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="doCMDSubmit" name="doCMDSubmit" type="button" class="formbtn" value="<?=gettext("Send Command!");?>" onclick="execCMD();" />
- </td>
- </tr>
- <tr>
- <!-- Format Output Container - Do Not Delete -->
- <td id="cmdOutputTD" valign="top" colspan="2" style="visibility: hidden; border: solid 1px silver; vertical-align: middle; width: 100%"></td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
- </table>
- </form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gconcat.php b/config/archive/freenas/www/disks_raid_gconcat.php
deleted file mode 100644
index e7fc9f81..00000000
--- a/config/archive/freenas/www/disks_raid_gconcat.php
+++ /dev/null
@@ -1,236 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_gconcat.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Concat"),
- gettext("RAID"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['gconcat']['vdisk']))
- $freenas_config['gconcat']['vdisk'] = array();
-
-gconcat_sort();
-
-$raidstatus=get_sraid_disks_list();
-
-$a_raid = &$freenas_config['gconcat']['vdisk'];
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $pconfig = $_POST;
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if ($_POST['apply']) {
- $retval = 0;
- if (!file_exists($d_sysrebootreqd_path))
- {
- config_lock();
- /* reload all components that create raid device */
- disks_raid_gconcat_configure();
- config_unlock();
- write_config();
- }
- $savemsg = get_std_save_message($retval);
- if ($retval == 0) {
- if (file_exists($d_raidconfdirty_path))
- unlink($d_raidconfdirty_path);
- }
- }
-}
-
-if ($_GET['act'] == "del") {
- if ($a_raid[$_GET['id']]) {
- $raidname=$a_raid[$_GET['id']]['name'];
- disks_raid_gconcat_delete($raidname);
- unset($a_raid[$_GET['id']]);
- write_config();
- touch($d_raidconfdirty_path);
- pfSenseHeader("disks_raid_gconcat.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="disks_raid_gconcat.php" method="post" name="iform" id="iform">
-<?php if (file_exists($d_diskdirty_path)): ?>
-<?php print_info_box_np(gettext("The Raid configuration has been changed.") . "<br />" .
- gettext("You must apply the changes in order for them to take effect."));?>
-<?php endif; ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), true, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), true, "disks_raid_gconcat.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gconcat_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_gconcat_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><?=gettext("Volume name");?></td>
- <td class="listhdrr"><?=gettext("Type");?></td>
- <td class="listhdrr"><?=gettext("Size");?></td>
- <td class="listhdrr"><?=gettext("Status");?></td>
- <td class="list">&nbsp;</td>
- </tr>
- <?php $i = 0; foreach ($a_raid as $raid): ?>
- <tr>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($raid['name']);?>
- </td>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($raid['type']);?>
- </td>
- <td valign="middle" class="listr">
- <?php
- $raidconfiguring = file_exists($d_raidconfdirty_path) &&
- in_array($raid['name']."\n",file($d_raidconfdirty_path));
- if ($raidconfiguring)
- echo gettext("configuring");
- else {
- $tempo=$raid['name'];
- echo "{$raidstatus[$tempo]['size']}";
- }
- ?>&nbsp;
- </td>
- <td valign="middle" class="listr">
- <?php
- if ($raidconfiguring)
- echo gettext("configuring");
- else {
- echo "{$raidstatus[$tempo]['desc']}";
- }
- ?>&nbsp;
- </td>
- <td valign="middle" class="list">
- <a href="disks_raid_gconcat_edit.php?id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit raid");?>" width="17" height="17" border="0" alt="" />
- </a>
- <a href="disks_raid_gconcat.php?act=del&id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete raid");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- <tr>
- <td class="list" colspan="4"></td>
- <td class="list" nowrap>
- <a href="disks_raid_gconcat_edit.php">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add disk");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="5">
- <span class="red">
- <strong><?= gettext("Note:"); ?></strong>
- </span>
- <br />
- <span class="vexpl"><?= gettext("Optional configuration step: Configuring a virtual RAID disk using your"); ?></span>
- <br />
- <span class="vexpl"><a href="disks_manage.php"><?= gettext("previsously configured disk."); ?></a></span>
- <br />
- <span class="vexpl"><?= gettext("Wait for the \"up\" status before format it and mount it!."); ?></span>
- </span>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gconcat_edit.php b/config/archive/freenas/www/disks_raid_gconcat_edit.php
deleted file mode 100644
index f4bd33cc..00000000
--- a/config/archive/freenas/www/disks_raid_gconcat_edit.php
+++ /dev/null
@@ -1,256 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_gconcat_edit.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Concat"),
- gettext("RAID"),
- isset($id) ? gettext("Edit") : gettext("Add"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$id = $_GET['id'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-
-if (!is_array($freenas_config['gconcat']['vdisk']))
- $freenas_config['gconcat']['vdisk'] = array();
-
-gconcat_sort();
-disks_sort();
-
-$a_raid = &$freenas_config['gconcat']['vdisk'];
-$all_raid = array_merge((array)$freenas_config['graid5']['vdisk'],(array)$freenas_config['gconcat']['vdisk'],(array)$freenas_config['gvinum']['vdisk'],(array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['gconcat']['vdisk']);
-$a_disk = get_fstype_disks_list("softraid");
-
-if (!sizeof($a_disk)) {
- $nodisk_errors[] = gettext("You must add disks first.");
-}
-
-if (isset($id) && $a_raid[$id]) {
- $pconfig['name'] = $a_raid[$id]['name'];
- $pconfig['type'] = $a_raid[$id]['type'];
- $pconfig['diskr'] = $a_raid[$id]['diskr'];
- $pconfig['fullname'] = $a_raid[$id]['fullname'];
-}
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $reqdfields = explode(" ", "name");
- $reqdfieldsn = explode(",", "Name");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (($_POST['name'] && !is_validaliasname($_POST['name'])))
- {
- $error_bucket[] = array("error" => gettext("The device name may only consist of the characters a-z, A-Z, 0-9."),
- "field" => "name");
- }
-
- /* check for name conflicts */
- foreach ($a_raid as $raid)
- {
- if (isset($id) && ($a_raid[$id]) && ($a_raid[$id] === $raid))
- continue;
-
- if ($raid['name'] == $_POST['name'])
- {
- $error_bucket[] = array("error" => gettext("This device already exists in the raid volume list."),
- "field" => "name");
- break;
- }
- }
-
- /* check the number of RAID disk for volume */
-
- if (count($_POST['diskr']) < 2)
- $error_bucket[] = array("error" => gettext("There must be a minimum of 2 disks in a JBOD."),
- "field" => "diskr");
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- $raid = array();
- $raid['name'] = $_POST['name'];
- $raid['type'] = "JBOD";
- $raid['diskr'] = $_POST['diskr'];
- $raid['desc'] = "Software gconcat JBOD";
- $raid['fullname'] = "/dev/concat/{$raid['name']}";
-
- if (isset($id) && $a_raid[$id])
- $a_raid[$id] = $raid;
- else
- $a_raid[] = $raid;
-
- $fd = @fopen("$d_raidconfdirty_path", "a");
- if (!$fd) {
- echo "ERR Could not save RAID configuration.\n";
- exit(0);
- }
- fwrite($fd, "$raid[name]\n");
- fclose($fd);
-
- write_config();
-
- pfSenseHeader("disks_raid_gconcat.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), true, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), true, "disks_raid_gmirror.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gmirror_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_gmirror_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gconcat_edit.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Raid name");?></td>
- <td width="78%" class="vtable">
- <input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>" />
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncellreq"><?= gettext("Type"); ?></td>
- <td class="vtable">JBOD</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Members of this volume"); ?></td>
- <td width="78%" class="vtable">
- <?
- $i=0;
- $disable_script="";
-
- foreach ($a_disk as $diskv) {
- $r_name="";
-
- foreach($all_raid as $raid) {
- if (in_array($diskv['fullname'],(array)$raid['diskr'])) {
- $r_name=$raid['name'];
- if ($r_name!=$pconfig['name']) $disable_script.="document.getElementById($i).disabled=1;\n";
- break;
- }
- }
- echo "<input name='diskr[]' id='$i' type='checkbox' value='$diskv[fullname]'".
- ((is_array($pconfig['diskr']) && in_array($diskv['fullname'],$pconfig['diskr'])) ? " checked=\"checked\"" : "") .
- " />$diskv[name] ($diskv[size], $diskv[desc])".(($r_name) ? " - assigned to $r_name" : "")."<br />\n";
- $i++;
-
- $i++;
- }
-
- if ($disable_script)
- echo "<script type='text/javascript'><!--\n$disable_script--></script>\n";
- ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" />
- <?php if (isset($id) && $a_raid[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>" />
- <?php endif; ?>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gconcat_infos.php b/config/archive/freenas/www/disks_raid_gconcat_infos.php
deleted file mode 100644
index 09dfd76a..00000000
--- a/config/archive/freenas/www/disks_raid_gconcat_infos.php
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_gconcat_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Concat"),
- gettext("Information"));
-
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- }
-}
-if (!isset($do_action)) {
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), true, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gconcat.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gconcat_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gconcat_tools.php");
- $tab_array[2] = array(gettext("Information"), true, "disks_raid_gconcat_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gconcat_infos.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" class="vtable">
- <?php
- echo "<pre>";
- echo "<strong>" . gettext("Software RAID information and status") . "</strong><br />";
-
- exec("/sbin/gconcat list",$rawdata);
- foreach ($rawdata as $line){
- echo htmlspecialchars($line) . "<br>";
- }
-
- unset ($line);
- echo "</pre>";
- ?>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gconcat_tools.php b/config/archive/freenas/www/disks_raid_gconcat_tools.php
deleted file mode 100644
index 7783450d..00000000
--- a/config/archive/freenas/www/disks_raid_gconcat_tools.php
+++ /dev/null
@@ -1,187 +0,0 @@
-<?php
-/*
- disks_raid_gmirror_tools.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Concat"),
- gettext("Tools"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- unset($do_action);
-
- $reqdfields = explode(" ", "action object");
- $reqdfieldsn = explode(",", "Action,Object");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- $do_action = true;
- $action = $_POST['action'];
- $object = $_POST['object'];
- }
- }
- if (!isset($do_action)) {
- $do_action = false;
- $action = '';
- $object = '';
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), true, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gmirror.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), true, "disks_raid_gmirror_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_gmirror_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gmirror_tools.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Object name");?></td>
- <td width="78%" class="vtable">
- <input name="object" type="text" class="formfld unknown" id="object" size="20" value="<?=htmlspecialchars($disk);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Object name");?></td>
- <td width="78%" class="vtable">
- <select name="action" class="formselect" id="action">
- <option value="list" <?php if ($action == "list") echo "selected"; ?>>list</option>
- <option value="status" <?php if ($action == "status") echo "selected"; ?>>status</option>
- <option value="clear" <?php if ($action == "clear") echo "selected"; ?>>clear</option>
- <option value="stop" <?php if ($action == "stop") echo "selected"; ?>>stop</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Send Command!" />
- </td>
- </tr>
- <tr>
- <td valign="top" colspan="2">
- <?
- if ($do_action) {
- echo("<strong>" . gettext("GCONCAT command output:") . "</strong><br />");
- echo('<pre>');
- ob_end_flush();
-
- system("/sbin/gmirror $action " . escapeshellarg($object));
-
- echo('</pre>');
- }
- ?>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="2">
- <span class="red">
- <strong>WARNING:</strong><br />
- </span>
- <ol>
- <li><span class="vexpl"><?= gettext("Use these specials actions for debugging only!"); ?></span></li>
- <li><span class="vexpl"><?= gettext("There is no need of using this menu for start a RAID volume (start automaticaly)."); ?></span></li>
- </ol>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gmirror.php b/config/archive/freenas/www/disks_raid_gmirror.php
deleted file mode 100644
index 78390a64..00000000
--- a/config/archive/freenas/www/disks_raid_gmirror.php
+++ /dev/null
@@ -1,236 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_gmirror.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Mirror"),
- gettext("RAID"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['gmirror']['vdisk']))
- $freenas_config['gmirror']['vdisk'] = array();
-
-gmirror_sort();
-
-$raidstatus=get_sraid_disks_list();
-
-$a_raid = &$freenas_config['gmirror']['vdisk'];
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $pconfig = $_POST;
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if ($_POST['apply']) {
- $retval = 0;
- if (!file_exists($d_sysrebootreqd_path))
- {
- config_lock();
- /* reload all components that create raid device */
- disks_raid_gmirror_configure();
- config_unlock();
- write_config();
- }
- $savemsg = get_std_save_message($retval);
- if ($retval == 0) {
- if (file_exists($d_raidconfdirty_path))
- unlink($d_raidconfdirty_path);
- }
- }
-}
-
-if ($_GET['act'] == "del") {
- if ($a_raid[$_GET['id']]) {
- $raidname=$a_raid[$_GET['id']]['name'];
- disks_raid_gmirror_delete($raidname);
- unset($a_raid[$_GET['id']]);
- write_config();
- touch($d_raidconfdirty_path);
- pfSenseHeader("disks_raid_gmirror.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="disks_raid_gmirror.php" method="post" name="iform" id="iform">
-<?php if (file_exists($d_diskdirty_path)): ?>
-<?php print_info_box_np(gettext("The Raid configuration has been changed.") . "<br />" .
- gettext("You must apply the changes in order for them to take effect."));?>
-<?php endif; ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), true, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), true, "disks_raid_gmirror.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gmirror_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_gmirror_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><?=gettext("Volume name");?></td>
- <td class="listhdrr"><?=gettext("Type");?></td>
- <td class="listhdrr"><?=gettext("Size");?></td>
- <td class="listhdrr"><?=gettext("Status");?></td>
- <td class="list">&nbsp;</td>
- </tr>
- <?php $i = 0; foreach ($a_raid as $raid): ?>
- <tr>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($raid['name']);?>
- </td>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($raid['type']);?>
- </td>
- <td valign="middle" class="listr">
- <?php
- $raidconfiguring = file_exists($d_raidconfdirty_path) &&
- in_array($raid['name']."\n",file($d_raidconfdirty_path));
- if ($raidconfiguring)
- echo gettext("configuring");
- else {
- $tempo=$raid['name'];
- echo "{$raidstatus[$tempo]['size']}";
- }
- ?>&nbsp;
- </td>
- <td valign="middle" class="listr">
- <?php
- if ($raidconfiguring)
- echo gettext("configuring");
- else {
- echo "{$raidstatus[$tempo]['desc']}";
- }
- ?>&nbsp;
- </td>
- <td valign="middle" class="list">
- <a href="disks_raid_gmirror_edit.php?id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit raid");?>" width="17" height="17" border="0" alt="" />
- </a>
- <a href="disks_raid_gmirror.php?act=del&id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete raid");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- <tr>
- <td class="list" colspan="4"></td>
- <td class="list" nowrap>
- <a href="disks_raid_gmirror_edit.php">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add disk");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="5">
- <span class="red">
- <strong><?= gettext("Note:"); ?></strong>
- </span>
- <br />
- <span class="vexpl"><?= gettext("Optional configuration step: Configuring a virtual RAID disk using your"); ?></span>
- <br />
- <span class="vexpl"><a href="disks_manage.php"><?= gettext("previsously configured disk."); ?></a></span>
- <br />
- <span class="vexpl"><?= gettext("Wait for the \"up\" status before format it and mount it!."); ?></span>
- </span>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gmirror_edit.php b/config/archive/freenas/www/disks_raid_gmirror_edit.php
deleted file mode 100644
index ac08a442..00000000
--- a/config/archive/freenas/www/disks_raid_gmirror_edit.php
+++ /dev/null
@@ -1,277 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_gmirror_edit.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Mirror"),
- gettext("RAID"),
- isset($id) ? gettext("Edit") : gettext("Add"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$id = $_GET['id'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-
-if (!is_array($freenas_config['gmirror']['vdisk']))
- $freenas_config['gmirror']['vdisk'] = array();
-
-gmirror_sort();
-disks_sort();
-
-$a_raid = &$freenas_config['gmirror']['vdisk'];
-$all_raid = array_merge((array)$freenas_config['graid5']['vdisk'],(array)$freenas_config['gmirror']['vdisk'],(array)$freenas_config['gvinum']['vdisk'],(array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['gconcat']['vdisk']);
-$a_disk = get_fstype_disks_list("softraid");
-
-if (!sizeof($a_disk)) {
- $nodisk_errors[] = gettext("You must add disks first.");
-}
-
-if (isset($id) && $a_raid[$id]) {
- $pconfig['name'] = $a_raid[$id]['name'];
- $pconfig['fullname'] = $a_raid[$id]['fullname'];
- $pconfig['type'] = $a_raid[$id]['type'];
- $pconfig['balance'] = $a_raid[$id]['balance'];
- $pconfig['diskr'] = $a_raid[$id]['diskr'];
-}
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $reqdfields = explode(" ", "name");
- $reqdfieldsn = explode(",", "Name");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (($_POST['name'] && !is_validaliasname($_POST['name'])))
- {
- $error_bucket[] = array("error" => gettext("The device name may only consist of the characters a-z, A-Z, 0-9."),
- "field" => "name");
- }
-
-
- /* check for name conflicts */
- foreach ($a_raid as $raid)
- {
- if (isset($id) && ($a_raid[$id]) && ($a_raid[$id] === $raid))
- continue;
-
- if ($raid['name'] == $_POST['name'])
- {
- $error_bucket[] = array("error" => gettext("This device already exists in the raid volume list."),
- "field" => "name");
- break;
- }
- }
-
- /* check the number of RAID disk for volume */
-
- if (count($_POST['diskr']) != 2)
- $error_bucket[] = array("error" => gettext("There must be 2 disks in a RAID 1 volume."),
- "field" => "diskr");
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- $raid = array();
- $raid['name'] = $_POST['name'];
- $raid['balance'] = $_POST['balance'];
- $raid['type'] = 1;
- $raid['diskr'] = $_POST['diskr'];
- $raid['desc'] = "Software RAID {$_POST['type']}";
- $raid['fullname'] = "/dev/mirror/{$raid['name']}";
-
- if (isset($id) && $a_raid[$id])
- $a_raid[$id] = $raid;
- else
- $a_raid[] = $raid;
-
- $fd = @fopen("$d_raidconfdirty_path", "a");
- if (!$fd) {
- echo "ERR Could not save RAID configuration.\n";
- exit(0);
- }
- fwrite($fd, "$raid[name]\n");
- fclose($fd);
-
- write_config();
-
- pfSenseHeader("disks_raid_gmirror.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), true, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), true, "disks_raid_gmirror.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gmirror_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_gmirror_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gmirror_edit.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Raid name");?></td>
- <td width="78%" class="vtable">
- <input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>" />
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncellreq"><?= gettext("Type"); ?></td>
- <td class="vtable">
- RAID 1 (<?= gettext("mirroring"); ?>)
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Balance algorithm"); ?></td>
- <td width="78%" class="vtable">
- <select name="balance" class="formselect">
- <?php $balvals = array(
- "split"=>"Split request",
- "load"=>"Read from lowest load",
- "round-robin"=>"Round-robin read");
- ?>
- <?php foreach ($balvals as $balval => $balname): ?>
- <option value="<?=$balval;?>" <?php if($pconfig['balance'] == $balval) echo 'selected';?>><?=htmlspecialchars($balname);?></option>
- <?php endforeach; ?>
- </select>
- <br />
- <?= gettext("Select your read balance algorithm."); ?></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Members of this volume"); ?></td>
- <td width="78%" class="vtable">
- <?
- $i=0;
- $disable_script="";
-
- foreach ($a_disk as $diskv) {
- $r_name="";
-
- foreach($all_raid as $raid) {
- if (in_array($diskv['fullname'],(array)$raid['diskr'])) {
- $r_name=$raid['name'];
- if ($r_name!=$pconfig['name']) $disable_script.="document.getElementById($i).disabled=1;\n";
- break;
- }
- }
- echo "<input name='diskr[]' id='$i' type='checkbox' value='$diskv[fullname]'".
- ((is_array($pconfig['diskr']) && in_array($diskv['fullname'],$pconfig['diskr'])) ? " checked=\"checked\"" : "") .
- " />$diskv[name] ($diskv[size], $diskv[desc])".(($r_name) ? " - assigned to $r_name" : "")."<br />\n";
- $i++;
-
- $i++;
- }
-
- if ($disable_script)
- echo "<script type='text/javascript'><!--\n$disable_script--></script>\n";
- ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" />
- <?php if (isset($id) && $a_raid[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>" />
- <?php endif; ?>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gmirror_infos.php b/config/archive/freenas/www/disks_raid_gmirror_infos.php
deleted file mode 100644
index 878f571e..00000000
--- a/config/archive/freenas/www/disks_raid_gmirror_infos.php
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_gmirror_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Mirror"),
- gettext("Information"));
-
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- }
-}
-if (!isset($do_action)) {
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), true, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gmirror.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gmirror_tools.php");
- $tab_array[2] = array(gettext("Information"), true, "disks_raid_gmirror_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gmirror_infos.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" class="vtable">
- <?php
- echo "<pre>";
- echo "<strong>" . gettext("Software RAID information and status") . "</strong><br />";
-
- exec("/sbin/gmirror list",$rawdata);
- foreach ($rawdata as $line){
- echo htmlspecialchars($line) . "<br>";
- }
-
- unset ($line);
- echo "</pre>";
- ?>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gmirror_init.php b/config/archive/freenas/www/disks_raid_gmirror_init.php
deleted file mode 100644
index 2b2d59af..00000000
--- a/config/archive/freenas/www/disks_raid_gmirror_init.php
+++ /dev/null
@@ -1,179 +0,0 @@
-<?php
-/* $Id$ */
-/*
- disks_raid_gmirror_init.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-/* ========================================================================== */
-/* == T H I S F I L E I S C U R R E N T L Y N O T U S E D == */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Mirror"),
- gettext("Initialize"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $reqdfields = explode(" ", "disk");
- $reqdfieldsn = explode(",", "Disk");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (! $input_errors) {
- $do_format = true;
- $disk = $_POST['disk'];
- }
-}
-
-if (! isset($do_format)) {
- $do_format = false;
- $disk = '';
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), true, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Vinum (unstable)"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Format RAID"), true, "disks_raid_gmirror_init.php");
- $tab_array[2] = array(gettext("Tools"), false, "disks_raid_gmirror_tools.php");
- $tab_array[3] = array(gettext("Information"), false, "disks_raid_gmirror_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gmirror_init.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Volume name");?></td>
- <td width="78%" class="vtable">
- <input name="disk" type="text" class="formfld" id="disk" size="20" value="<?=htmlspecialchars($disk);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" />
- <?php if (isset($id) && $a_raid[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>" />
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <td valign="top" colspan="2">
- <?
- if ($do_format) {
- echo("<strong>" . gettext("Disk format UFS output:") . "</strong><br />");
- echo('<pre>');
- ob_end_flush();
-
- /* Create filesystem */
- system("/sbin/newfs -U /dev/mirror/" . escapeshellarg($disk));
-
- echo('</pre>');
- }
- ?>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="2">
- <span class="red">
- <strong>WARNING:</strong><br />
- </span>
- <span class="vexpl">
- <?= gettext("This step will format the RAID volume in Unix FileSystem (UFS)."); ?>
- </span>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gmirror_tools.php b/config/archive/freenas/www/disks_raid_gmirror_tools.php
deleted file mode 100644
index 0fe99576..00000000
--- a/config/archive/freenas/www/disks_raid_gmirror_tools.php
+++ /dev/null
@@ -1,191 +0,0 @@
-<?php
-/*
- disks_raid_gmirror_tools.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Mirror"),
- gettext("Tools"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $reqdfields = explode(" ", "action object");
- $reqdfieldsn = explode(",", "Action,Object");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- $do_action = true;
- $action = $_POST['action'];
- $object = $_POST['object'];
- }
- }
- if (!isset($do_action)) {
- $do_action = false;
- $action = '';
- $object = '';
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), true, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gmirror.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), true, "disks_raid_gmirror_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_gmirror_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gmirror_tools.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Object name");?></td>
- <td width="78%" class="vtable">
- <input name="object" type="text" class="formfld unknown" id="object" size="20" value="<?=htmlspecialchars($disk);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Object name");?></td>
- <td width="78%" class="vtable">
- <select name="action" class="formselect" id="action">
- <option value="rebuild" <?php if ($action == "rebuild") echo "selected=\"selected\""; ?>>rebuild</option>
- <option value="list" <?php if ($action == "list") echo "selected=\"selected\""; ?>>list</option>
- <option value="status" <?php if ($action == "status") echo "selected=\"selected\""; ?>>status</option>
- <option value="remove" <?php if ($action == "remove") echo "selected=\"selected\""; ?>>remove</option>
- <option value="activate" <?php if ($action == "activate") echo "selected=\"selected\""; ?>>activate</option>
- <option value="deactivate" <?php if ($action == "deactivate") echo "selected=\"selected\""; ?>>deactivate</option>
- <option value="forget" <?php if ($action == "forget") echo "selected=\"selected\""; ?>>forget</option>
- <option value="clear" <?php if ($action == "clear") echo "selected=\"selected\""; ?>>clear</option>
- <option value="stop" <?php if ($action == "stop") echo "selected=\"selected\""; ?>>stop</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Send Command!" />
- </td>
- </tr>
- <tr>
- <td valign="top" colspan="2">
- <?
- if ($do_action) {
- echo("<strong>" . gettext("GMIRROR command output:") . "</strong><br />");
- echo('<pre>');
- ob_end_flush();
-
- system("/sbin/gmirror $action " . escapeshellarg($object));
-
- echo('</pre>');
- }
- ?>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="2">
- <span class="red">
- <strong>WARNING:</strong><br />
- </span>
- <ol>
- <li><span class="vexpl"><?= gettext("Use these specials actions for debugging only!"); ?></span></li>
- <li><span class="vexpl"><?= gettext("There is no need of using this menu for start a RAID volume (start automaticaly)."); ?></span></li>
- </ol>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_graid5.php b/config/archive/freenas/www/disks_raid_graid5.php
deleted file mode 100644
index 6273b077..00000000
--- a/config/archive/freenas/www/disks_raid_graid5.php
+++ /dev/null
@@ -1,236 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_graid5.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM RAID5"),
- gettext("RAID"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['graid5']['vdisk']))
- $freenas_config['graid5']['vdisk'] = array();
-
-graid5_sort();
-
-$raidstatus=get_sraid_disks_list();
-
-$a_raid = &$freenas_config['graid5']['vdisk'];
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $pconfig = $_POST;
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if ($_POST['apply']) {
- $retval = 0;
- if (!file_exists($d_sysrebootreqd_path))
- {
- config_lock();
- /* reload all components that create raid device */
- disks_raid_graid5_configure();
- config_unlock();
- write_config();
- }
- $savemsg = get_std_save_message($retval);
- if ($retval == 0) {
- if (file_exists($d_raidconfdirty_path))
- unlink($d_raidconfdirty_path);
- }
- }
-}
-
-if ($_GET['act'] == "del") {
- if ($a_raid[$_GET['id']]) {
- $raidname=$a_raid[$_GET['id']]['name'];
- disks_raid_graid5_delete($raidname);
- unset($a_raid[$_GET['id']]);
- write_config();
- touch($d_raidconfdirty_path);
- pfSenseHeader("disks_raid_graid5.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="disks_raid_graid5.php" method="post" name="iform" id="iform">
-<?php if (file_exists($d_diskdirty_path)): ?>
-<?php print_info_box_np(gettext("The Raid configuration has been changed.") . "<br />" .
- gettext("You must apply the changes in order for them to take effect."));?>
-<?php endif; ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), true, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), true, "disks_raid_graid5.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_graid5_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_graid5_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><?=gettext("Volume name");?></td>
- <td class="listhdrr"><?=gettext("Type");?></td>
- <td class="listhdrr"><?=gettext("Size");?></td>
- <td class="listhdrr"><?=gettext("Status");?></td>
- <td class="list">&nbsp;</td>
- </tr>
- <?php $i = 0; foreach ($a_raid as $raid): ?>
- <tr>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($raid['name']);?>
- </td>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($raid['type']);?>
- </td>
- <td valign="middle" class="listr">
- <?php
- $raidconfiguring = file_exists($d_raidconfdirty_path) &&
- in_array($raid['name']."\n",file($d_raidconfdirty_path));
- if ($raidconfiguring)
- echo gettext("configuring");
- else {
- $tempo=$raid['name'];
- echo "{$raidstatus[$tempo]['size']}";
- }
- ?>&nbsp;
- </td>
- <td valign="middle" class="listr">
- <?php
- if ($raidconfiguring)
- echo gettext("configuring");
- else {
- echo "{$raidstatus[$tempo]['desc']}";
- }
- ?>&nbsp;
- </td>
- <td valign="middle" class="list">
- <a href="disks_raid_graid5_edit.php?id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit raid");?>" width="17" height="17" border="0" alt="" />
- </a>
- <a href="disks_raid_graid5.php?act=del&id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete raid");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- <tr>
- <td class="list" colspan="4"></td>
- <td class="list" nowrap>
- <a href="disks_raid_graid5_edit.php">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add disk");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="5">
- <span class="red">
- <strong><?= gettext("Note:"); ?></strong>
- </span>
- <br />
- <span class="vexpl"><?= gettext("Optional configuration step: Configuring a virtual RAID disk using your"); ?></span>
- <br />
- <span class="vexpl"><a href="disks_manage.php"><?= gettext("previsously configured disk."); ?></a></span>
- <br />
- <span class="vexpl"><?= gettext("Wait for the \"up\" status before format it and mount it!."); ?></span>
- </span>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_graid5_edit.php b/config/archive/freenas/www/disks_raid_graid5_edit.php
deleted file mode 100644
index 27069f6c..00000000
--- a/config/archive/freenas/www/disks_raid_graid5_edit.php
+++ /dev/null
@@ -1,258 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_graid5_edit.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM RAID5"),
- gettext("RAID"),
- isset($id) ? gettext("Edit") : gettext("Add"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$id = $_GET['id'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-
-if (!is_array($freenas_config['graid5']['vdisk']))
- $freenas_config['graid5']['vdisk'] = array();
-
-graid5_sort();
-disks_sort();
-
-$a_raid = &$freenas_config['graid5']['vdisk'];
-$all_raid = array_merge((array)$freenas_config['graid5']['vdisk'],(array)$freenas_config['graid5']['vdisk'],(array)$freenas_config['gvinum']['vdisk'],(array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['graid5']['vdisk']);
-$a_disk = get_fstype_disks_list("softraid");
-
-if (!sizeof($a_disk)) {
- $nodisk_errors[] = gettext("You must add disks first.");
-}
-
-if (isset($id) && $a_raid[$id]) {
- $pconfig['name'] = $a_raid[$id]['name'];
- $pconfig['type'] = $a_raid[$id]['type'];
- $pconfig['diskr'] = $a_raid[$id]['diskr'];
- $pconfig['fullname'] = $a_raid[$id]['fullname'];
-}
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $reqdfields = explode(" ", "name");
- $reqdfieldsn = explode(",", "Name");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (($_POST['name'] && !is_validaliasname($_POST['name'])))
- {
- $error_bucket[] = array("error" => gettext("The device name may only consist of the characters a-z, A-Z, 0-9."),
- "field" => "name");
- }
-
- /* check for name conflicts */
- foreach ($a_raid as $raid)
- {
- if (isset($id) && ($a_raid[$id]) && ($a_raid[$id] === $raid))
- continue;
-
- if ($raid['name'] == $_POST['name'])
- {
- $error_bucket[] = array("error" => gettext("This device already exists in the raid volume list."),
- "field" => "name");
- break;
- }
- }
-
- /* check the number of RAID disk for volume */
-
- if (count($_POST['diskr']) < 3)
- $error_bucket[] = array("error" => gettext("There must be a minimum of 3 disks in a RAID 5 volume."),
- "field" => "diskr");
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- $raid = array();
- $raid['name'] = $_POST['name'];
- $raid['type'] = "JBOD";
- $raid['diskr'] = $_POST['diskr'];
- $raid['desc'] = "Software graid5 RAID 5";
- $raid['fullname'] = "/dev/raid5/{$raid['name']}";
-
- if (isset($id) && $a_raid[$id])
- $a_raid[$id] = $raid;
- else
- $a_raid[] = $raid;
-
- $fd = @fopen("$d_raidconfdirty_path", "a");
- if (!$fd) {
- echo "ERR Could not save RAID configuration.\n";
- exit(0);
- }
- fwrite($fd, "$raid[name]\n");
- fclose($fd);
-
- write_config();
-
- pfSenseHeader("disks_raid_graid5.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), true, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), true, "disks_raid_graid5.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_graid5_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_graid5_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_graid5_edit.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Raid name");?></td>
- <td width="78%" class="vtable">
- <input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>" />
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncellreq"><?= gettext("Type"); ?></td>
- <td class="vtable">
- RAID 5 (<?= gettext("rotated block-interleaved parity"); ?>)
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Members of this volume"); ?></td>
- <td width="78%" class="vtable">
- <?
- $i=0;
- $disable_script="";
-
- foreach ($a_disk as $diskv) {
- $r_name="";
-
- foreach($all_raid as $raid) {
- if (in_array($diskv['fullname'],(array)$raid['diskr'])) {
- $r_name=$raid['name'];
- if ($r_name!=$pconfig['name']) $disable_script.="document.getElementById($i).disabled=1;\n";
- break;
- }
- }
- echo "<input name='diskr[]' id='$i' type='checkbox' value='$diskv[fullname]'".
- ((is_array($pconfig['diskr']) && in_array($diskv['fullname'],$pconfig['diskr'])) ? " checked=\"checked\"" : "") .
- " />$diskv[name] ($diskv[size], $diskv[desc])".(($r_name) ? " - assigned to $r_name" : "")."<br />\n";
- $i++;
-
- $i++;
- }
-
- if ($disable_script)
- echo "<script type='text/javascript'><!--\n$disable_script--></script>\n";
- ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" />
- <?php if (isset($id) && $a_raid[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>" />
- <?php endif; ?>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_graid5_infos.php b/config/archive/freenas/www/disks_raid_graid5_infos.php
deleted file mode 100644
index 31506011..00000000
--- a/config/archive/freenas/www/disks_raid_graid5_infos.php
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_graid5_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM RAID5"),
- gettext("Information"));
-
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- }
-}
-if (!isset($do_action)) {
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), true, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_graid5.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gconcat_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_graid5_tools.php");
- $tab_array[2] = array(gettext("Information"), true, "disks_raid_graid5_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_graid5_infos.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" class="vtable">
- <?php
- echo "<pre>";
- echo "<strong>" . gettext("Software RAID information and status") . "</strong><br />";
-
- exec("/sbin/graid5 list",$rawdata);
- foreach ($rawdata as $line){
- echo htmlspecialchars($line) . "<br>";
- }
-
- unset ($line);
- echo "</pre>";
- ?>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_graid5_tools.php b/config/archive/freenas/www/disks_raid_graid5_tools.php
deleted file mode 100644
index c8b3cf5b..00000000
--- a/config/archive/freenas/www/disks_raid_graid5_tools.php
+++ /dev/null
@@ -1,190 +0,0 @@
-<?php
-/*
- disks_raid_graid5_tools.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM RAID5"),
- gettext("Tools"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- unset($do_action);
-
- $reqdfields = explode(" ", "action object");
- $reqdfieldsn = explode(",", "Action,Object");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- $do_action = true;
- $action = $_POST['action'];
- $object = $_POST['object'];
- }
- }
- if (!isset($do_action)) {
- $do_action = false;
- $action = '';
- $object = '';
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), true, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_graid5.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_graid5_init.php"); */
- $tab_array[1] = array(gettext("Tools"), true, "disks_raid_graid5_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_graid5_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_graid5_tools.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Object name");?></td>
- <td width="78%" class="vtable">
- <input name="object" type="text" class="formfld unknown" id="object" size="20" value="<?=htmlspecialchars($disk);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Object name");?></td>
- <td width="78%" class="vtable">
- <select name="action" class="formselect" id="action">
- <option value="list" <?php if ($action == "list") echo "selected"; ?>>list</option>
- <option value="status" <?php if ($action == "status") echo "selected"; ?>>status</option>
- <option value="insert" <?php if ($action == "insert") echo "selected"; ?>>insert</option>
- <option value="remove" <?php if ($action == "remove") echo "selected"; ?>>remove</option>
- <option value="clear" <?php if ($action == "clear") echo "selected"; ?>>clear</option>
- <option value="stop" <?php if ($action == "stop") echo "selected"; ?>>stop</option>
- <option value="destroy" <?php if ($action == "destroy") echo "selected"; ?>>destroy</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Send Command!" />
- </td>
- </tr>
- <tr>
- <td valign="top" colspan="2">
- <?
- if ($do_action) {
- echo("<strong>" . gettext("GCONCAT command output:") . "</strong><br />");
- echo('<pre>');
- ob_end_flush();
-
- system("/sbin/graid5 $action " . escapeshellarg($object));
-
- echo('</pre>');
- }
- ?>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="2">
- <span class="red">
- <strong>WARNING:</strong><br />
- </span>
- <ol>
- <li><span class="vexpl"><?= gettext("Use these specials actions for debugging only!"); ?></span></li>
- <li><span class="vexpl"><?= gettext("There is no need of using this menu for start a RAID volume (start automaticaly)."); ?></span></li>
- </ol>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gstripe.php b/config/archive/freenas/www/disks_raid_gstripe.php
deleted file mode 100644
index 4d5f622d..00000000
--- a/config/archive/freenas/www/disks_raid_gstripe.php
+++ /dev/null
@@ -1,236 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_gstripe.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Stripe"),
- gettext("RAID"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['gstripe']['vdisk']))
- $freenas_config['gstripe']['vdisk'] = array();
-
-gstripe_sort();
-
-$raidstatus=get_sraid_disks_list();
-
-$a_raid = &$freenas_config['gstripe']['vdisk'];
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $pconfig = $_POST;
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if ($_POST['apply']) {
- $retval = 0;
- if (!file_exists($d_sysrebootreqd_path))
- {
- config_lock();
- /* reload all components that create raid device */
- disks_raid_gstripe_configure();
- config_unlock();
- write_config();
- }
- $savemsg = get_std_save_message($retval);
- if ($retval == 0) {
- if (file_exists($d_raidconfdirty_path))
- unlink($d_raidconfdirty_path);
- }
- }
-}
-
-if ($_GET['act'] == "del") {
- if ($a_raid[$_GET['id']]) {
- $raidname=$a_raid[$_GET['id']]['name'];
- disks_raid_gstripe_delete($raidname);
- unset($a_raid[$_GET['id']]);
- write_config();
- touch($d_raidconfdirty_path);
- pfSenseHeader("disks_raid_gstripe.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="disks_raid_gstripe.php" method="post" name="iform" id="iform">
-<?php if (file_exists($d_diskdirty_path)): ?>
-<?php print_info_box_np(gettext("The Raid configuration has been changed.") . "<br />" .
- gettext("You must apply the changes in order for them to take effect."));?>
-<?php endif; ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), true, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), true, "disks_raid_gstripe.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gstripe_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_gstripe_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><?=gettext("Volume name");?></td>
- <td class="listhdrr"><?=gettext("Type");?></td>
- <td class="listhdrr"><?=gettext("Size");?></td>
- <td class="listhdrr"><?=gettext("Status");?></td>
- <td class="list">&nbsp;</td>
- </tr>
- <?php $i = 0; foreach ($a_raid as $raid): ?>
- <tr>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($raid['name']);?>
- </td>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($raid['type']);?>
- </td>
- <td valign="middle" class="listr">
- <?php
- $raidconfiguring = file_exists($d_raidconfdirty_path) &&
- in_array($raid['name']."\n",file($d_raidconfdirty_path));
- if ($raidconfiguring)
- echo gettext("configuring");
- else {
- $tempo=$raid['name'];
- echo "{$raidstatus[$tempo]['size']}";
- }
- ?>&nbsp;
- </td>
- <td valign="middle" class="listr">
- <?php
- if ($raidconfiguring)
- echo gettext("configuring");
- else {
- echo "{$raidstatus[$tempo]['desc']}";
- }
- ?>&nbsp;
- </td>
- <td valign="middle" class="list">
- <a href="disks_raid_gstripe_edit.php?id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit raid");?>" width="17" height="17" border="0" alt="" />
- </a>
- <a href="disks_raid_gstripe.php?act=del&id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete raid");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- <tr>
- <td class="list" colspan="4"></td>
- <td class="list" nowrap>
- <a href="disks_raid_gstripe_edit.php">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add disk");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="5">
- <span class="red">
- <strong><?= gettext("Note:"); ?></strong>
- </span>
- <br />
- <span class="vexpl"><?= gettext("Optional configuration step: Configuring a virtual RAID disk using your"); ?></span>
- <br />
- <span class="vexpl"><a href="disks_manage.php"><?= gettext("previsously configured disk."); ?></a></span>
- <br />
- <span class="vexpl"><?= gettext("Wait for the \"up\" status before format it and mount it!."); ?></span>
- </span>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gstripe_edit.php b/config/archive/freenas/www/disks_raid_gstripe_edit.php
deleted file mode 100644
index ab18d6e7..00000000
--- a/config/archive/freenas/www/disks_raid_gstripe_edit.php
+++ /dev/null
@@ -1,258 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_gstripe_edit.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Stripe"),
- gettext("RAID"),
- gettext("Edit"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$id = $_GET['id'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-
-if (!is_array($freenas_config['gstripe']['vdisk']))
- $freenas_config['gstripe']['vdisk'] = array();
-
-gstripe_sort();
-disks_sort();
-
-$a_raid = &$freenas_config['gstripe']['vdisk'];
-$all_raid = array_merge((array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['gvinum']['vdisk'],(array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['gstripe']['vdisk']);
-$a_disk = get_fstype_disks_list("softraid");
-
-if (!sizeof($a_disk)) {
- $nodisk_errors[] = gettext("You must add disks first.");
-}
-
-if (isset($id) && $a_raid[$id]) {
- $pconfig['name'] = $a_raid[$id]['name'];
- $pconfig['type'] = $a_raid[$id]['type'];
- $pconfig['diskr'] = $a_raid[$id]['diskr'];
- $pconfig['fullname'] = $a_raid[$id]['fullname'];
-}
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $reqdfields = explode(" ", "name");
- $reqdfieldsn = explode(",", "Name");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (($_POST['name'] && !is_validaliasname($_POST['name'])))
- {
- $error_bucket[] = array("error" => gettext("The device name may only consist of the characters a-z, A-Z, 0-9."),
- "field" => "name");
- }
-
- /* check for name conflicts */
- foreach ($a_raid as $raid)
- {
- if (isset($id) && ($a_raid[$id]) && ($a_raid[$id] === $raid))
- continue;
-
- if ($raid['name'] == $_POST['name'])
- {
- $error_bucket[] = array("error" => gettext("This device already exists in the raid volume list."),
- "field" => "name");
- break;
- }
- }
-
- /* check the number of RAID disk for volume */
-
- if (count($_POST['diskr']) < 2)
- $error_bucket[] = array("error" => gettext("There must be a minimum of 2 disks in a RAID 0 volume."),
- "field" => "diskr");
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- $raid = array();
- $raid['name'] = $_POST['name'];
- $raid['type'] = "JBOD";
- $raid['diskr'] = $_POST['diskr'];
- $raid['desc'] = "Software gstripe RAID 0";
- $raid['fullname'] = "/dev/stripe/{$raid['name']}";
-
- if (isset($id) && $a_raid[$id])
- $a_raid[$id] = $raid;
- else
- $a_raid[] = $raid;
-
- $fd = @fopen("$d_raidconfdirty_path", "a");
- if (!$fd) {
- echo "ERR Could not save RAID configuration.\n";
- exit(0);
- }
- fwrite($fd, "$raid[name]\n");
- fclose($fd);
-
- write_config();
-
- pfSenseHeader("disks_raid_gstripe.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), true, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), true, "disks_raid_gstripe.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gstripe_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_gstripe_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gstripe_edit.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Raid name");?></td>
- <td width="78%" class="vtable">
- <input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>" />
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncellreq"><?= gettext("Type"); ?></td>
- <td class="vtable">
- RAID 5 (<?= gettext("rotated block-interleaved parity"); ?>)
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Members of this volume"); ?></td>
- <td width="78%" class="vtable">
- <?
- $i=0;
- $disable_script="";
-
- foreach ($a_disk as $diskv) {
- $r_name="";
-
- foreach($all_raid as $raid) {
- if (in_array($diskv['fullname'],(array)$raid['diskr'])) {
- $r_name=$raid['name'];
- if ($r_name!=$pconfig['name']) $disable_script.="document.getElementById($i).disabled=1;\n";
- break;
- }
- }
- echo "<input name='diskr[]' id='$i' type='checkbox' value='$diskv[fullname]'".
- ((is_array($pconfig['diskr']) && in_array($diskv['fullname'],$pconfig['diskr'])) ? " checked=\"checked\"" : "") .
- " />$diskv[name] ($diskv[size], $diskv[desc])".(($r_name) ? " - assigned to $r_name" : "")."<br />\n";
- $i++;
-
- $i++;
- }
-
- if ($disable_script)
- echo "<script type='text/javascript'><!--\n$disable_script--></script>\n";
- ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" />
- <?php if (isset($id) && $a_raid[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>" />
- <?php endif; ?>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gstripe_infos.php b/config/archive/freenas/www/disks_raid_gstripe_infos.php
deleted file mode 100644
index 5d8a6de0..00000000
--- a/config/archive/freenas/www/disks_raid_gstripe_infos.php
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_stripe_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Stripe"),
- gettext("Information"));
-
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- }
-}
-if (!isset($do_action)) {
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), true, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gstripe.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gconcat_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gstripe_tools.php");
- $tab_array[2] = array(gettext("Information"), true, "disks_raid_gstripe_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gstripe_infos.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" class="vtable">
- <?php
- echo "<pre>";
- echo "<strong>" . gettext("Software RAID information and status") . "</strong><br />";
-
- exec("/sbin/gstripe list",$rawdata);
- foreach ($rawdata as $line){
- echo htmlspecialchars($line) . "<br>";
- }
-
- unset ($line);
- echo "</pre>";
- ?>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gstripe_tools.php b/config/archive/freenas/www/disks_raid_gstripe_tools.php
deleted file mode 100644
index 6bc7891a..00000000
--- a/config/archive/freenas/www/disks_raid_gstripe_tools.php
+++ /dev/null
@@ -1,187 +0,0 @@
-<?php
-/*
- disks_raid_stripe_tools.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Stripe"),
- gettext("Tools"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- unset($do_action);
-
- $reqdfields = explode(" ", "action object");
- $reqdfieldsn = explode(",", "Action,Object");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- $do_action = true;
- $action = $_POST['action'];
- $object = $_POST['object'];
- }
- }
- if (!isset($do_action)) {
- $do_action = false;
- $action = '';
- $object = '';
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), true, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), false, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gstripe.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gstripe_init.php"); */
- $tab_array[1] = array(gettext("Tools"), true, "disks_raid_gstripe_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_gstripe_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gstripe_tools.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Object name");?></td>
- <td width="78%" class="vtable">
- <input name="object" type="text" class="formfld unknown" id="object" size="20" value="<?=htmlspecialchars($disk);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Object name");?></td>
- <td width="78%" class="vtable">
- <select name="action" class="formselect" id="action">
- <option value="list" <?php if ($action == "list") echo "selected"; ?>>list</option>
- <option value="status" <?php if ($action == "status") echo "selected"; ?>>status</option>
- <option value="clear" <?php if ($action == "clear") echo "selected"; ?>>clear</option>
- <option value="stop" <?php if ($action == "stop") echo "selected"; ?>>stop</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Send Command!" />
- </td>
- </tr>
- <tr>
- <td valign="top" colspan="2">
- <?
- if ($do_action) {
- echo("<strong>" . gettext("GSTRIPE command output:") . "</strong><br />");
- echo('<pre>');
- ob_end_flush();
-
- system("/sbin/gstripe $action " . escapeshellarg($object));
-
- echo('</pre>');
- }
- ?>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="2">
- <span class="red">
- <strong>WARNING:</strong><br />
- </span>
- <ol>
- <li><span class="vexpl"><?= gettext("Use these specials actions for debugging only!"); ?></span></li>
- <li><span class="vexpl"><?= gettext("There is no need of using this menu for start a RAID volume (start automaticaly)."); ?></span></li>
- </ol>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gvinum.php b/config/archive/freenas/www/disks_raid_gvinum.php
deleted file mode 100644
index 134b2fb5..00000000
--- a/config/archive/freenas/www/disks_raid_gvinum.php
+++ /dev/null
@@ -1,235 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_gvinum.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Vinum"),
- gettext("RAID"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['gvinum']['vdisk']))
- $freenas_config['gvinum']['vdisk'] = array();
-
-gvinum_sort();
-
-$raidstatus=get_sraid_disks_list();
-
-$a_raid = &$freenas_config['gvinum']['vdisk'];
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $pconfig = $_POST;
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if ($_POST['apply']) {
- $retval = 0;
- if (!file_exists($d_sysrebootreqd_path))
- {
- config_lock();
- /* reload all components that create raid device */
- disks_raid_gvinum_configure();
- config_unlock();
- write_config();
- }
- $savemsg = get_std_save_message($retval);
- if ($retval == 0) {
- if (file_exists($d_raidconfdirty_path))
- unlink($d_raidconfdirty_path);
- }
- }
- }
-
- if ($_GET['act'] == "del") {
- if ($a_raid[$_GET['id']]) {
- $raidname=$a_raid[$_GET['id']]['name'];
- disks_raid_gvinum_delete($raidname);
- unset($a_raid[$_GET['id']]);
- write_config();
- touch($d_raidconfdirty_path);
- pfSenseHeader("disks_raid_gvinum.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="disks_raid_gvinum.php" method="post" name="iform" id="iform">
-<?php if (file_exists($d_diskdirty_path)): ?>
-<?php print_info_box_np(gettext("The Raid configuration has been changed.") . "<br />" .
- gettext("You must apply the changes in order for them to take effect."));?>
-<?php endif; ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), true, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), true, "disks_raid_gvinum.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gvinum_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_gvinum_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><?=gettext("Volume name");?></td>
- <td class="listhdrr"><?=gettext("Type");?></td>
- <td class="listhdrr"><?=gettext("Size");?></td>
- <td class="listhdrr"><?=gettext("Status");?></td>
- <td class="list">&nbsp;</td>
- </tr>
- <?php $i = 0; foreach ($a_raid as $raid): ?>
- <tr>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($raid['name']);?>
- </td>
- <td valign="middle" class="listr">
- <?=htmlspecialchars($raid['type']);?>
- </td>
- <td valign="middle" class="listr">
- <?php
- $raidconfiguring = file_exists($d_raidconfdirty_path) &&
- in_array($raid['name']."\n",file($d_raidconfdirty_path));
- if ($raidconfiguring)
- echo gettext("configuring");
- else {
- $tempo=$raid['name'];
- echo "{$raidstatus[$tempo]['size']}";
- }
- ?>&nbsp;
- </td>
- <td valign="middle" class="listr">
- <?php
- if ($raidconfiguring)
- echo "_CONFIGURING";
- else {
- echo "{$raidstatus[$tempo]['desc']}";
- }
- ?>&nbsp;
- </td>
- <td valign="middle" class="list">
- <a href="disks_raid_gvinum_edit.php?id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit raid");?>" width="17" height="17" border="0" alt="" />
- </a>
- <a href="disks_raid_gvinum.php?act=del&id=<?=$i;?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete raid");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- <tr>
- <td class="list" colspan="4"></td>
- <td class="list" nowrap>
- <a href="disks_raid_gvinum_edit.php">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add disk");?>" width="17" height="17" border="0" alt="" />
- </a>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="5">
- <span class="red">
- <strong><?= gettext("Note:"); ?></strong>
- </span>
- <br />
- <span class="vexpl"><?= gettext("Optional configuration step: Configuring a virtual RAID disk using your"); ?></span>
- <br />
- <span class="vexpl"><a href="disks_manage.php"><?= gettext("previsously configured disk."); ?></a></span>
- <br />
- <span class="vexpl"><?= gettext("Wait for the \"up\" status before format it and mount it!."); ?></span>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gvinum_edit.php b/config/archive/freenas/www/disks_raid_gvinum_edit.php
deleted file mode 100644
index e0245419..00000000
--- a/config/archive/freenas/www/disks_raid_gvinum_edit.php
+++ /dev/null
@@ -1,277 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_gvinum_edit.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Vinum"),
- gettext("RAID"),
- isset($id) ? gettext("Edit") : gettext("Add"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['raid']['vdisk']))
- $freenas_config['raid']['vdisk'] = array();
-
-gvinum_sort();
-disks_sort();
-
-$a_raid = &$freenas_config['gvinum']['vdisk'];
-$a_disk = get_fstype_disks_list("softraid");
-$all_raid = array_merge((array)$freenas_config['graid5']['vdisk'],(array)$freenas_config['gmirror']['vdisk'],(array)$freenas_config['gvinum']['vdisk'],(array)$freenas_config['gstripe']['vdisk'],(array)$freenas_config['gconcat']['vdisk']);
-
-$id = $_GET['id'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-
-if (!sizeof($a_disk)) {
- $nodisk_errors[] = gettext("You must add disks first.");
-}
-
-if (isset($id) && $a_raid[$id]) {
- $pconfig['name'] = $a_raid[$id]['name'];
- $pconfig['fullname'] = $a_raid[$id]['fullname'];
- $pconfig['type'] = $a_raid[$id]['type'];
- $pconfig['diskr'] = $a_raid[$id]['diskr'];
-}
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $reqdfields = explode(" ", "name type");
- $reqdfieldsn = explode(",", "Name,Type");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (($_POST['name'] && !is_validaliasname($_POST['name'])))
- {
- $error_bucket[] = array("error" => gettext("The device name may only consist of the characters a-z, A-Z, 0-9."),
- "field" => "name");
- }
-
- /* check for name conflicts */
- foreach ($a_raid as $raid)
- {
- if (isset($id) && ($a_raid[$id]) && ($a_raid[$id] === $raid))
- continue;
-
- if ($raid['name'] == $_POST['name'])
- {
- $error_bucket[] = array("error" => gettext("This device already exists in the raid volume list."),
- "field" => "name");
- break;
- }
- }
-
- /* check the number of RAID disk for volume */
-
- switch ($_POST['type'])
- {
- case 0:
- if (count($_POST['diskr']) < 2)
- $error_bucket[] = array("error" => gettext("There must be a minimum of 2 disks in a RAID 0 volume."),
- "field" => "diskr");
- break;
- case 1:
- if (count($_POST['diskr']) != 2)
- $error_bucket[] = array("error" => gettext("There must be 2 disks in a RAID 1 volume."),
- "field" => "diskr");
- break;
- case 5:
- if (count($_POST['diskr']) < 3)
- $error_bucket[] = array("error" => gettext("There must be a minimum of 3 disks in a RAID 5 volume."),
- "field" => "diskr");
- break;
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- $raid = array();
- $raid['name'] = $_POST['name'];
- $raid['type'] = $_POST['type'];
- $raid['diskr'] = $_POST['diskr'];
- $raid['desc'] = "Software gvinum RAID {$_POST['type']}";
- $raid['fullname'] = "/dev/gvinum/{$raid['name']}";
-
- if (isset($id) && $a_raid[$id])
- $a_raid[$id] = $raid;
- else
- $a_raid[] = $raid;
-
- $fd = @fopen("$d_raidconfdirty_path", "a");
- if (!$fd) {
- echo gettext("ERR Could not save RAID configuration.\n");
- exit(0);
- }
- fwrite($fd, "$raid[name]\n");
- fclose($fd);
-
- write_config();
-
- pfSenseHeader("disks_raid_gvinum.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), true, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), true, "disks_raid_gvinum.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gvinum_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_gvinum_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gvinum_edit.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Raid name");?></td>
- <td width="78%" class="vtable">
- <input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>" />
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncellreq"><?= gettext("Type"); ?></td>
- <td class="vtable">
- <select name="type" class="formselect" id="type">
- <option value="0" <?php if ($pconfig['type'] == 0) echo "selected=\"selected\""; ?>>RAID 0 (<?= gettext("striping"); ?>)</option>
- <option value="1" <?php if ($pconfig['type'] == 1) echo "selected=\"selected\""; ?>>RAID 1 (<?= gettext("mirroring"); ?>)</option>
- <option value="5" <?php if ($pconfig['type'] == 5) echo "selected=\"selected\""; ?>>RAID 5 (<?= gettext("rotated block-interleaved parity"); ?>)</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Members of this volume"); ?></td>
- <td width="78%" class="vtable">
- <?
- $i=0;
- $disable_script="";
-
- foreach ($a_disk as $diskv) {
- $r_name="";
-
- if (strcmp($diskv['fstype'],"raid")==0) {
- foreach($all_raid as $raid) {
- if (in_array($diskv['name'],$raid['diskr'])) {
- $r_name=$raid['name'];
-
- if ($r_name!=$pconfig['name'])
- $disable_script.="document.getElementById($i).disabled=1;\n";
- break;
- }
- }
- echo "<input name='diskr[]' id='$i' type='checkbox' value='$diskv[name]'".
- ((is_array($pconfig['diskr']) && in_array($diskv['name'], $pconfig['diskr'])) ? " checked=\"checked\"" : "").
- " />$diskv[name] ($diskv[size], $diskv[desc])" . (($r_name) ? " - assigned to $r_name" : "") . "<br>\n";
- }
- $i++;
- }
- if ($disable_script) echo "<script type='text/javascript'><!--\n$disable_script--></script>\n";
- ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" />
- <?php if (isset($id) && $a_raid[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>" />
- <?php endif; ?>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gvinum_infos.php b/config/archive/freenas/www/disks_raid_gvinum_infos.php
deleted file mode 100644
index 71a424fa..00000000
--- a/config/archive/freenas/www/disks_raid_gvinum_infos.php
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_gvinum_infos.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Vinum"),
- gettext("Information"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- }
-}
-if (!isset($do_action)) {
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), true, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gvinum.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), false, "disks_raid_gvinum_tools.php");
- $tab_array[2] = array(gettext("Information"), true, "disks_raid_gvinum_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gvinum_infos.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" class="vtable">
- <?php
- echo "<pre>";
- echo "<strong>" . gettext("Software RAID information and status") . "</strong><br />";
-
- exec("/sbin/gvinum list",$rawdata);
- foreach ($rawdata as $line)
- {
- echo htmlspecialchars($line) . "<br>";
- }
- unset ($line);
- echo "</pre>";
- ?>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gvinum_init.php b/config/archive/freenas/www/disks_raid_gvinum_init.php
deleted file mode 100644
index 787c416e..00000000
--- a/config/archive/freenas/www/disks_raid_gvinum_init.php
+++ /dev/null
@@ -1,181 +0,0 @@
-<?php
-/* $Id$ */
-/*
- disks_raid_gmirror_init.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-/* ========================================================================== */
-/* == T H I S F I L E I S C U R R E N T L Y N O T U S E D == */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Vinum"),
- gettext("Initialize"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $reqdfields = explode(" ", "disk");
- $reqdfieldsn = explode(",", "Disk");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (! $input_errors) {
- $do_format = true;
- $disk = $_POST['disk'];
- }
-}
-
-if (! isset($do_format)) {
- $do_format = false;
- $disk = '';
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Vinum (unstable)"), true, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gvinum.php");
- $tab_array[1] = array(gettext("Format RAID"), true, "disks_raid_gvinum_init.php");
- $tab_array[2] = array(gettext("Tools"), false, "disks_raid_gvinum_tools.php");
- $tab_array[3] = array(gettext("Information"), false, "disks_raid_gvinum_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gvinum_init.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Volume name");?></td>
- <td width="78%" class="vtable">
- <input name="disk" type="text" class="formfld" id="disk" size="20" value="<?=htmlspecialchars($disk);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" />
- <?php if (isset($id) && $a_raid[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>" />
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <td valign="top" colspan="2">
- <?
- if ($do_format) {
- echo("<strong>_DISKSRAIDINITPHP_INFO</strong><br />");
- echo('<pre>');
- ob_end_flush();
-
- /* Create filesystem */
- system("/sbin/newfs -U /dev/gvinum/" . escapeshellarg($disk));
- /* Do it twice for test the RAID5 bug at reboot*/
- system("/sbin/newfs -U /dev/gvinum/" . escapeshellarg($disk));
-
- echo('</pre>');
- }
- ?>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="2">
- <span class="red">
- <strong>WARNING:</strong><br />
- </span>
- <span class="vexpl">
- <?= gettext("This step will format the RAID volume in Unix FileSystem (UFS)."); ?>
- </span>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/disks_raid_gvinum_tools.php b/config/archive/freenas/www/disks_raid_gvinum_tools.php
deleted file mode 100644
index 343fc221..00000000
--- a/config/archive/freenas/www/disks_raid_gvinum_tools.php
+++ /dev/null
@@ -1,220 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- disks_raid_gvinum_tools.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("System"),
- gettext("Disks"),
- gettext("GEOM Vinum"),
- gettext("Tools"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- unset($do_action);
-
- $reqdfields = explode(" ", "action object");
- $reqdfieldsn = explode(",", "Action,Object");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors) {
- $do_action = true;
- $action = $_POST['action'];
- $object = $_POST['object'];
- }
- }
- if (!isset($do_action)) {
- $do_action = false;
- $action = '';
- $object = '';
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Geom Mirror"), false, "disks_raid_gmirror.php");
- $tab_array[1] = array(gettext("Geom Concat"), false, "disks_raid_gconcat.php");
- $tab_array[2] = array(gettext("Geom Stripe"), false, "disks_raid_gstripe.php");
- $tab_array[3] = array(gettext("Geom RAID5"), false, "disks_raid_graid5.php");
- $tab_array[4] = array(gettext("Geom Vinum"), true, "disks_raid_gvinum.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Manage RAID"), false, "disks_raid_gvinum.php");
- /* $tab_array[1] = array(gettext("Format RAID"), false, "disks_raid_gmirror_init.php"); */
- $tab_array[1] = array(gettext("Tools"), true, "disks_raid_gvinum_tools.php");
- $tab_array[2] = array(gettext("Information"), false, "disks_raid_gvinum_infos.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form action="disks_raid_gvinum_tools.php" method="post" name="iform" id="iform">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Object name");?></td>
- <td width="78%" class="vtable">
- <input name="object" type="text" class="formfld unknown" id="object" size="20" value="<?=htmlspecialchars($disk);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Object name");?></td>
- <td width="78%" class="vtable">
- <select name="action" class="formselect" id="action">
- <option value="start" <?php if ($action == "start") echo "selected=\"selected\""; ?>>start</option>
- <option value="rebuild" <?php if ($action == "rebuild") echo "selected=\"selected\""; ?>>rebuild parity</option>
- <option value="list" <?php if ($action == "list") echo "selected=\"selected\""; ?>>list</option>
- <option value="remove" <?php if ($action == "remove") echo "selected=\"selected\""; ?>>remove</option>
- <option value="forceup" <?php if ($action == "forceup") echo "selected=\"selected\""; ?>>Force State to UP</option>
- <option value="saveconfig" <?php if ($action == "saveconfig") echo "selected=\"selected\""; ?>>saveconfig</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Send Command!" />
- <?php if (isset($id) && $a_raid[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>" />
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <td valign="top" colspan="2">
- <?
- if ($do_action) {
- echo("<strong>" . gettext("GVINUM command output:") . "</strong><br />");
- echo('<pre>');
- ob_end_flush();
-
- switch ($action)
- {
- case "remove":
- /* Remove recursivly object */
- system("/sbin/gvinum rm -r " . escapeshellarg($object));
- break;
- case "start":
- /* Start object */
- system("/sbin/gvinum start " . escapeshellarg($object));
- break;
- case "rebuild":
- /* Rebuild RAID 5 parity */
- system("/sbin/gvinum rebuildparity " . escapeshellarg($object));
- break;
- case "list":
- /* Disaply a detailed list of object */
- system("/sbin/gvinum list " . escapeshellarg($object));
- break;
- case "forceup":
- /* Force object state up */
- system("/sbin/gvinum setstate -f up " . escapeshellarg($object));
- break;
- case "saveconfig":
- /* Save config */
- system("/sbin/gvinum saveconfig");
- break;
- }
-
- echo('</pre>');
- }
- ?>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" colspan="2">
- <span class="red">
- <strong>WARNING:</strong><br />
- </span>
- <ol>
- <li><span class="vexpl"><?= gettext("Use these specials actions for debugging only!"); ?></span></li>
- <li><span class="vexpl"><?= gettext("There is no need of using this menu for start a RAID volume (start automaticaly)."); ?></span></li>
- </ol>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/services_afp.php b/config/archive/freenas/www/services_afp.php
deleted file mode 100644
index 2487c6f7..00000000
--- a/config/archive/freenas/www/services_afp.php
+++ /dev/null
@@ -1,199 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- services_afp.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Services"),
- gettext("AFP"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['afp'])) {
- $freenas_config['afp'] = array();
-}
-
-
-$pconfig['enable'] = isset($freenas_config['afp']['enable']);
-$pconfig['afpname'] = $freenas_config['afp']['afpname'];
-$pconfig['guest'] = isset($freenas_config['afp']['guest']);
-$pconfig['local'] = isset($freenas_config['afp']['local']);
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = split(" ", "afpname");
- $reqdfieldsn = split(",", "Afpname");
-
- do_input_validation_new($_POST, $reqdfields, $reqdfieldsn, &$error_bucket);
-
- if ($_POST['enable'] && !$_POST['guest'])
- {
- if (!$_POST['local'])
- $error_bucket[] = array("error" => gettext("You must select at least one authentication method."),
- "field" => "local");
- }
- if ($_POST['enable'] && !$_POST['local'])
- {
- if (!$_POST['guest'])
- $error_bucket[] = array("error" => gettext("You must select at least one authentication method."),
- "field" => "name");
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $freenas_config['afp']['enable'] = $_POST['enable'] ? true : false;
- $freenas_config['afp']['guest'] = $_POST['guest'] ? true : false;
- $freenas_config['afp']['local'] = $_POST['local'] ? true : false;
- $freenas_config['afp']['afpname'] = $_POST['afpname'];
-
- write_config();
-
- $retval = 0;
- if (!file_exists($d_sysrebootreqd_path))
- {
- /* nuke the cache file */
- config_lock();
- services_afpd_configure();
- services_zeroconf_configure();
- config_unlock();
- }
-
- $savemsg = get_std_save_message($retval);
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-$jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-function enable_change(enable_change) {
- var endis;
-
- endis = !(document.iform.enable.checked || enable_change);
- endis ? color = '#D4D0C8' : color = '#FFFFFF';
-
- document.iform.guest.disabled = endis;
- document.iform.local.disabled = endis;
- document.iform.afpname.disabled = endis;
- /* color adjustments */
- document.iform.guest.style.backgroundColor = color;
- document.iform.local.style.backgroundColor = color;
- document.iform.afpname.style.backgroundColor = color;
-}
-//-->
-</script>
-
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
- <div id="inputerrors"></div>
- <form id="iform" name="iform" action="services_afp.php" method="post">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" valign="middle" class="listtopic" colspan="2">
- <span style="vertical-align: middle; position: relative; left: 0px;"><?=gettext("AFP Server");?></span>
- <span style="vertical-align: middle; position: relative; left: 84%;">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onClick="enable_change(false)" />&nbsp;<?= gettext("Enable"); ?>
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Server Name");?></td>
- <td width="78%" class="vtable">
- <input name="afpname" type="text" class="formfld unknown" id="afpname" size="20" value="<?=htmlspecialchars($pconfig['afpname']);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Authentication");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="guest" id="guest" type="checkbox" value="yes" <?php if ($pconfig['guest']) echo "checked=\"checked\""; ?> />
- <?= gettext("Enable guest access."); ?><br />
- <input name="local" id="local" type="checkbox" value="yes" <?php if ($pconfig['local']) echo "checked=\"checked\""; ?> />
- <?= gettext("Enable local user authentication."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- </td>
- </tr>
- </table>
- </form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-<script type="text/javascript">
-<!--
-enable_change(false);
-//-->
-</script>
-</body>
-</html>
diff --git a/config/archive/freenas/www/services_ftp.php b/config/archive/freenas/www/services_ftp.php
deleted file mode 100644
index 050361e5..00000000
--- a/config/archive/freenas/www/services_ftp.php
+++ /dev/null
@@ -1,392 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- services_ftp.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Services"),
- gettext("FTP"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['ftp']))
-{
- $freenas_config['ftp'] = array();
-}
-
-$pconfig['enable'] = isset($freenas_config['ftp']['enable']);
-$pconfig['port'] = $freenas_config['ftp']['port'];
-$pconfig['authbackend'] = $freenas_config['ftp']['authentication_backend'];
-$pconfig['numberclients'] = $freenas_config['ftp']['numberclients'];
-$pconfig['maxconperip'] = $freenas_config['ftp']['maxconperip'];
-$pconfig['timeout'] = $freenas_config['ftp']['timeout'];
-$pconfig['anonymous'] = isset($freenas_config['ftp']['anonymous']);
-$pconfig['localuser'] = isset($freenas_config['ftp']['localuser']);
-$pconfig['pasv_max_port'] = $freenas_config['ftp']['pasv_max_port'];
-$pconfig['pasv_min_port'] = $freenas_config['ftp']['pasv_min_port'];
-$pconfig['pasv_address'] = $freenas_config['ftp']['pasv_address'];
-$pconfig['banner'] = $freenas_config['ftp']['banner'];
-$pconfig['natmode'] = isset($freenas_config['ftp']['natmode']);
-$pconfig['passiveip'] = $freenas_config['ftp']['passiveip'];
-$pconfig['fxp'] = isset($freenas_config['ftp']['fxp']);
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- if ($_POST['enable']) {
- $reqdfields = array_merge($reqdfields, explode(" ", "numberclients maxconperip timeout port"));
- $reqdfieldsn = array_merge($reqdfieldsn, explode(",", "Numberclients,Maxconperip,Timeout,Port"));
- }
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if ($_POST['enable'] && !is_port($_POST['port']))
- {
- $error_bucket[] = array("error" => gettext("The TCP port must be a valid port number."),
- "field" => "port");
- }
- if ($_POST['enable'] && !is_numericint($_POST['numberclients'])) {
- $error_bucket[] = array("error" => gettext("The maximum Number of client must be a number."),
- "field" => "numberclients");
- }
-
- if ($_POST['enable'] && !is_numericint($_POST['maxconperip'])) {
- $error_bucket[] = array("error" => gettext("The max con per ip must be a number."),
- "field" => "maxconperip");
- }
- if ($_POST['enable'] && !is_numericint($_POST['timeout'])) {
- $error_bucket[] = array("error" => gettext("The maximum idle time be a number."),
- "field" => "timeout");
- }
-
- if ($_POST['enable'] && ($_POST['pasv_address']))
- {
- if (!is_ipaddr($_POST['pasv_address']))
- $error_bucket[] = array("error" => gettext("The pasv address must be a public IP address."),
- "field" => "pasv_address");
-
- }
-
- if ($_POST['enable'] && ($_POST['pasv_max_port']))
- {
- if (!is_port($_POST['pasv_max_port']))
- $error_bucket[] = array("error" => gettext("The pasv_max_port port must be a valid port number."),
- "field" => "pasv_max_port");
- }
-
- if ($_POST['enable'] && ($_POST['pasv_min_port']))
- {
- if (!is_port($_POST['pasv_min_port']))
- $error_bucket[] = array("error" => gettext("The pasv_min_port port must be a valid port number."),
- "field" => "pasv_min_port");
-
- }
-
- if (($_POST['passiveip'] && !is_ipaddr($_POST['passiveip']))) {
- $error_bucket[] = array("error" => gettext("A valid IP address must be specified."),
- "field" => "passiveip");
-
- }
-
- if (!($_POST['anonymous']) && !($_POST['localuser'])) {
- $input_errors[] = _SRVFTP_MSGVALIDAUTH;
- $error_bucket[] = array("error" => gettext("You must select at minium anonymous or/and local user authentication."),
- "field" => "localuser");
-
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $freenas_config['ftp']['numberclients'] = $_POST['numberclients'];
- $freenas_config['ftp']['maxconperip'] = $_POST['maxconperip'];
- $freenas_config['ftp']['timeout'] = $_POST['timeout'];
- $freenas_config['ftp']['port'] = $_POST['port'];
- $freenas_config['ftp']['authentication_backend'] = $_POST['authbackend'];
- $freenas_config['ftp']['anonymous'] = $_POST['anonymous'] ? true : false;
- $freenas_config['ftp']['localuser'] = $_POST['localuser'] ? true : false;
- $freenas_config['ftp']['pasv_max_port'] = $_POST['pasv_max_port'];
- $freenas_config['ftp']['pasv_min_port'] = $_POST['pasv_min_port'];
- $freenas_config['ftp']['pasv_address'] = $_POST['pasv_address'];
- $freenas_config['ftp']['banner'] = $_POST['banner'];
- $freenas_config['ftp']['passiveip'] = $_POST['passiveip'];
- $freenas_config['ftp']['fxp'] = $_POST['fxp'] ? true : false;
- $freenas_config['ftp']['natmode'] = $_POST['natmode'] ? true : false;
- $freenas_config['ftp']['enable'] = $_POST['enable'] ? true : false;
-
- write_config();
-
- $retval = 0;
- if (!file_exists($d_sysrebootreqd_path)) {
- /* nuke the cache file */
- config_lock();
- services_wzdftpd_configure();
- services_zeroconf_configure();
- config_unlock();
- }
- $savemsg = get_std_save_message($retval);
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-$jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-function enable_change(enable_change) {
- var endis;
-
- endis = !(document.iform.enable.checked || enable_change);
- endis ? color = '#D4D0C8' : color = '#FFFFFF';
-
- document.iform.port.disabled = endis;
- document.iform.authbackend.disabled = endis;
- document.iform.timeout.disabled = endis;
- document.iform.numberclients.disabled = endis;
- document.iform.maxconperip.disabled = endis;
- document.iform.anonymous.disabled = endis;
- document.iform.localuser.disabled = endis;
- document.iform.banner.disabled = endis;
- document.iform.fxp.disabled = endis;
- document.iform.natmode.disabled = endis;
- document.iform.passiveip.disabled = endis;
- document.iform.pasv_max_port.disabled = endis;
- document.iform.pasv_min_port.disabled = endis;
- /* color adjustments */
- document.iform.port.style.backgroundColor = color;
- document.iform.authbackend.backgroundColor = color;
- document.iform.timeout.style.backgroundColor = color;
- document.iform.numberclients.style.backgroundColor = color;
- document.iform.maxconperip.style.backgroundColor = color;
- document.iform.anonymous.style.backgroundColor = color;
- document.iform.localuser.style.backgroundColor = color;
- document.iform.banner.style.backgroundColor = color;
- document.iform.fxp.style.backgroundColor = color;
- document.iform.natmode.style.backgroundColor = color;
- document.iform.passiveip.style.backgroundColor = color;
- document.iform.pasv_max_port.style.backgroundColor = color;
- document.iform.pasv_min_port.style.backgroundColor = color;
-}
-//-->
-</script>
-
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
- <div id="inputerrors"></div>
- <form id="iform" name="iform" action="services_ftp.php" method="post">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" valign="middle" class="listtopic" colspan="2">
- <span style="vertical-align: middle; position: relative; left: 0px;"><?=gettext("FTP Server");?></span>
- <span style="vertical-align: middle; position: relative; left: 84%;">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onClick="enable_change(false)" />&nbsp;<?= gettext("Enable"); ?>
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("TCP port");?></td>
- <td width="78%" class="vtable">
- <input name="port" type="text" class="formfld unknown" id="port" size="20" value="<?=htmlspecialchars($pconfig['port']);?>" />
- </td>
- </tr>
- <?php
- if (file_exists("/usr/local/sbin/wzdftpd")) {
- $a_backends = array();
-
- $dh = opendir("/usr/local/share/wzdftpd/backends");
- while (false !== ($filename = readdir($dh))) {
- if (preg_match("/\.so$/", $filename)) {
- $lastslash = strrpos($filename, "/");
- $dot = strrpos($filename, ".");
-
- $backend_name = str_replace("libwzd",
- "",
- substr($filename,
- $lastslash,
- $dot - $lastslash));
- $a_backends[] = $backend_name;
- }
- }
- }
- ?>
- <?php if (is_array($a_backends)) : ?>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Authentication Backend");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <select name="authbackend" id="authbackend" class="formselect">
- <?php foreach ($a_backends as $backend) : ?>
- <option value="<?= $backend ?>"><?= $backend ?></option>
- <?php endforeach; ?>
- </select><br />
- <?= gettext("Choose a particular backend, that will be used to authenticate FTP users."); ?>
- </td>
- </tr>
- <?php endif; ?>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Number of clients");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="numberclients" type="text" class="formfld unknown" id="numberclients" size="20" value="<?=htmlspecialchars($pconfig['numberclients']);?>" />
- <br />
- <?= gettext("Maximum number of simultaneous clients."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Max conn per ip");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="maxconperip" type="text" class="formfld unknown" id="maxconperip" size="20" value="<?=htmlspecialchars($pconfig['maxconperip']);?>" />
- <br />
- <?= gettext("Maximum connection per IP address."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Timeout");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="timeout" type="text" class="formfld unknown" id="timeout" size="20" value="<?=htmlspecialchars($pconfig['timeout']);?>" />
- <br />
- <?= gettext("Maximum idle time in seconds."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Anonymous login");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="anonymous" type="checkbox" id="anonymous" value="yes" <?php if ($pconfig['anonymous']) echo "checked=\"checked\""; ?> />
- <?= gettext("Enable Anonymous login"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Local User");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="localuser" type="checkbox" id="localuser" value="yes" <?php if ($pconfig['localuser']) echo "checked=\"checked\""; ?> />
- <?= gettext("Enable local User login"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Banner");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <textarea name="banner" cols="65" rows="7" id="banner" class="formpre"><?=htmlspecialchars($pconfig['banner']);?></textarea>
- <br />
- <?= gettext("Greeting banner displayed by FTP when a connection first comes in."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("FXP");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="fxp" type="checkbox" id="fxp" value="yes" <?php if ($pconfig['fxp']) echo "checked=\"checked\""; ?> />
- <?= gettext("Enable FXP protocol."); ?>
- <br />
- <?= gettext("FXP allows transfers between two remote servers without any file data going to the client asking for the transfer (insecure!)."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("NAT mode");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="natmode" type="checkbox" id="natmode" value="yes" <?php if ($pconfig['natmode']) echo "checked=\"checked\""; ?> />
- <?= gettext("Force NAT mode"); ?>
- <br />
- <?= gettext("Enable it if your FTP server is behind a NAT box that doesn't support applicative FTP proxying"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Passive IP address");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="passiveip" type="text" class="formfld unknown" id="passiveip" size="30" value="<?=htmlspecialchars($pconfig['passiveip']);?>" />
- <?= gettext("Use this option to override the IP address that FTP daemon will advertise in response to the PASV command."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("pasv_min_port");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="pasv_min_port" type="text" class="formfld unknown" id="pasv_min_port" size="20" value="<?=htmlspecialchars($pconfig['pasv_min_port']);?>" />
- <?= gettext("The minimum port to allocate for PASV style data connections."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("pasv_max_port");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="pasv_max_port" type="text" class="formfld unknown" id="pasv_max_port" size="20" value="<?=htmlspecialchars($pconfig['pasv_max_port']);?>" />
- <?= gettext("The maximum port to allocate for PASV style data connections."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submitt" name="Submitt" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- </td>
- </tr>
- </table>
- </form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-<script type="text/javascript">
-<!--
-enable_change(false);
-//-->
-</script>
-</body>
-</html>
diff --git a/config/archive/freenas/www/services_nfs.php b/config/archive/freenas/www/services_nfs.php
deleted file mode 100644
index 7b4b9a18..00000000
--- a/config/archive/freenas/www/services_nfs.php
+++ /dev/null
@@ -1,243 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- services_nfs.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Services"),
- gettext("NFS"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['nfs']))
-{
- $freenas_config['nfs'] = array();
-}
-
-$pconfig['enable'] = isset($freenas_config['nfs']['enable']);
-$pconfig['bindto'] = $freenas_config['nfs']['bindto'];
-$pconfig['serveudp'] = isset($freenas_config['nfs']['serveudp']);
-$pconfig['servetcp'] = isset($freenas_config['nfs']['servetcp']);
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = explode(" ", "bindto");
- $reqdfieldsn = explode(",", "IP address to bind to");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $freenas_config['nfs']['enable'] = $_POST['enable'] ? true : false;
- $freenas_config['nfs']['bindto'] = $_POST['bindto'];
- if (isset($_POST['servetcp'])) {
- $freenas_config['nfs']['servetcp'] = $_POST['servetcp'];
- } else {
- unset($freenas_config['nfs']['servetcp']);
- }
- if (isset($_POST['serveudp'])) {
- $freenas_config['nfs']['serveudp'] = $_POST['serveudp'];
- } else {
- unset($freenas_config['nfs']['serveudp']);
- }
-
- write_config();
-
- $retval = 0;
- if (!file_exists($d_sysrebootreqd_path))
- {
- /* nuke the cache file */
- config_lock();
- services_nfs_configure();
- config_unlock();
- }
- $savemsg = get_std_save_message($retval);
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-$jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-function enable_change(enable_change) {
- var endis;
-
- endis = !(document.iform.enable.checked || enable_change);
- endis ? color = '#D4D0C8' : color = '#FFFFFF';
-
- document.iform.servetcp.disabled = endis;
- document.iform.serveudp.disabled = endis;
- document.iform.bindto.disabled = endis;
- /* color adjustments */
- document.iform.servetcp.style.backgroundColor = color;
- document.iform.serveudp.style.backgroundColor = color;
- document.iform.bindto.style.backgroundColor = color;
-}
-//-->
-</script>
-
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<form id="iform" name="iform" action="services_nfs.php" method="post">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Settings"), true, "services_nfs.php");
- $tab_array[1] = array(gettext("Exports"), false, "services_nfs_export.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" valign="middle" class="listtopic" colspan="2">
- <span style="vertical-align: middle; position: relative; left: 0px;"><?=gettext("NFS Server");?></span>
- <span style="vertical-align: middle; position: relative; left: 84%;">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onClick="enable_change(false)" />&nbsp;<?= gettext("Enable"); ?>
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Bind to IP address");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <select name="bindto" id="bindto" class="formselect">
- <option value="(ANY)"<?php if ($pconfig['bindto'] == "(ANY)") { echo " selected=\"selected\""; } ?>>
- (ANY)
- </option>
- <option value="<?= $config['interfaces']['wan'][ipaddr] ?>"<?php if ($pconfig['bindto'] == $config['interfaces']['wan'][ipaddr]) { echo " selected=\"selected\""; } ?>>
- <?= $config['interfaces']['wan'][ipaddr] ?>
- </option>
- <option value="<?= $config['interfaces']['lan'][ipaddr] ?>"<?php if ($pconfig['bindto'] == $config['interfaces']['lan'][ipaddr]) { echo " selected=\"selected\""; } ?>>
- <?= $config['interfaces']['lan'][ipaddr] ?>
- </option>
- <?php
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++):
- ?>
- <option value="<?= $config['interfaces']['opt' . $i][ipaddr] ?>"<?php if ($pconfig['bindto'] == $config['interfaces']['opt' . $i][ipaddr]) { echo " selected=\"selected\""; } ?>>
- <?= $config['interfaces']['opt' . $i][ipaddr] ?>
- </option>
- <?php endfor; ?>
- </select>
- <br />
- <?= gettext("Use an address from the list to make nfsd and rpcbind bind to a specific address."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Client Types");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <p>
- <input type="checkbox" name="servetcp" id="servetcp" value="on"<?php if ($pconfig['servetcp']) { echo " checked=\"checked\""; } ?>/>
- <label for="servetcp"><?= gettext("Serve TCP NFS clients"); ?></label>
- </p>
- <p>
- <input type="checkbox" name="serveudp" id="serveudp" value="on"<?php if ($pconfig['serveudp']) { echo " checked=\"checked\""; } ?>/>
- <label for="serveudp"><?= gettext("Serve UDP NFS clients"); ?></label>
- </p>
- <p>
- <span class="red"><strong><?= gettext("Note"); ?>: </strong></span>
- <span class="vexpl">
- <?= gettext("Usually it's save to enable support for both, UDP and TCP client types."); ?>
- </span>
- </p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-<script type="text/javascript">
-<!--
-enable_change(false);
-//-->
-</script>
-</body>
-</html>
diff --git a/config/archive/freenas/www/services_nfs_export.php b/config/archive/freenas/www/services_nfs_export.php
deleted file mode 100644
index c1712762..00000000
--- a/config/archive/freenas/www/services_nfs_export.php
+++ /dev/null
@@ -1,165 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- services_nfs_export.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Services"),
- gettext("NFS"),
- gettext("Exports"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['mounts']['mount']))
- $freenas_config['mounts']['mount'] = array();
-
-mount_sort();
-
-$a_mount = &$freenas_config['mounts']['mount'];
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- $pconfig = $_POST;
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- if($_POST['apply']) {
- $retval = 0;
- if(!file_exists($d_sysrebootreqd_path)) {
- config_lock();
- services_nfs_configure();
- services_zeroconf_configure();
- config_unlock();
- }
-
- $savemsg = get_std_save_message($retval);
-
- if(0 == $retval) {
- if(file_exists($d_nfsexportconfdirty_path))
- unlink($d_nfsexportconfdirty_path);
- }
- }
- }
-}
-
-if($_GET['act'] == "ret") {
- pfSenseHeader("services_nfs_export.php");
- exit;
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<form id="iform" name="iform" action="services_nfs_export.php" method="post">
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<?php if (file_exists($d_nfsexportconfdirty_path)): ?>
-<?php print_info_box_np(gettext("The exports have been modified.") . "<br />" .
- gettext("You must apply the changes in order for them to take effect."));?>
-<?php endif; ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<div id="inputerrors"></div>
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Settings"), false, "services_nfs.php");
- $tab_array[1] = array(gettext("Exports"), true, "services_nfs_export.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="20%" class="listhdrr"><?= gettext("Export"); ?></td>
- <td width="25%" class="listhdrr"><?= gettext("Description"); ?></td>
- <td width="20%" class="listhdrr"><?= gettext("Export To"); ?></td>
- <td width="10%" class="list"></td>
- </tr>
- <?php $i = 0; foreach($a_mount as $mountv): ?>
- <tr>
- <td class="listr">/mnt/<?=htmlspecialchars($mountv['sharename']);?></td>
- <td class="listr"><?=htmlspecialchars($mountv['desc']);?></td>
- <td class="listbg" style="color: #FFFFFF;"><?= isset($mountv['nfs']['networks']) ? str_replace(",", "<br />", htmlspecialchars($mountv['nfs']['networks'])) : gettext("None"); ?></td>
- <td valign="middle" nowrap class="list">
- <?php if(isset($freenas_config['nfs']['enable']))
- echo("<a href='services_nfs_export_edit.php?id={$i}'><img src='./themes/" . $g['theme'] . "/images/icons/icon_e.gif' alt='" . gettext("Edit Export") . "' title='" . gettext("Edit Export") . "' width='17' height='17' border='0' /></a>");
- ?>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/services_nfs_export_edit.php b/config/archive/freenas/www/services_nfs_export_edit.php
deleted file mode 100644
index f9fd53ea..00000000
--- a/config/archive/freenas/www/services_nfs_export_edit.php
+++ /dev/null
@@ -1,783 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- services_samba_share_edit.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Services"),
- gettext("NFS"),
- gettext("Exports"),
- gettext("Edit"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$id = $_GET['id'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-
-if (!is_array($freenas_config['mounts']['mount']))
- $freenas_config['mounts']['mount'] = array();
-
-mount_sort();
-
-$pconfig['mapall'] = $freenas_config['mounts']['mount'][$id]['nfs']['mapall'];
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = explode(" ", "authnetworks");
- $reqdfieldsn = explode(",", "Destination network");
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (isset($_POST['authnetworks']) && is_array($_POST['authnetworks'])) {
- foreach ($_POST['authnetworks'] as $netel) {
- list($_POST['network'], $_POST['network_subnet']) = explode('/', $netel);
-
- if (($_POST['network'] && !is_ipaddr($_POST['network']))) {
- $error_bucket[] = array("error" => gettext("A valid network must be specified."),
- "field" => "network");
- }
-
- if (($_POST['network_subnet'] && !is_numeric($_POST['network_subnet']))) {
- $error_bucket[] = array("error" => gettext("A valid network bit count must be specified."),
- "field" => "network_subnet");
- }
-
- $osn[] = gen_subnet($_POST['network'], $_POST['network_subnet']) . "/" . $_POST['network_subnet'];
- }
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $freenas_config['mounts']['mount'][$id]['nfs']['networks'] = implode(",", $osn);
- $freenas_config['mounts']['mount'][$id]['nfs']['mapall'] = $_POST['mapall'];
-
- touch($d_nfsexportconfdirty_path);
- write_config();
- pfSenseHeader("services_nfs_export.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-$addressTransString = gettext("Address");
-$plusimgDescTransString = gettext("add to network list");
-$minusimgDescTransString = gettext("remove from network list");
-$currentnetTransString = gettext("Current networks");
-$networksTypehintTransString = gettext("Network that is authorised to access NFS shares");
-
-$networkCount = count($freenas_config['nfs']['nfsnetwork']);
-$generatedWANSubnet = gen_subnet($config['interfaces']['wan']['ipaddr'],
- $config['interfaces']['wan']['subnet']);
-$generatedLANSubnet = gen_subnet($config['interfaces']['lan']['ipaddr'],
- $config['interfaces']['lan']['subnet']);
-
-$jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-function network_exists(myValue) {
- for (i = 0; i < $('authnetworks').options.length; i++) {
- if ($('authnetworks').options[i].value == myValue) {
- return true;
- }
- }
-
- return false;
-}
-function selectnetel() {
- for (i = 0; i < $('authnetworks').options.length; i++) {
- $('authnetworks').options[i].selected = true;
- }
-}
-function get_selected_listitems() {
- var selected = new Array();
-
- if (!$('authnetworks')) { return; }
-
- for (i = 0; i < $('authnetworks').options.length; i++) {
- if ($('authnetworks').childNodes[i].selected == true) {
- selected.push($('authnetworks').options[i]);
- }
- }
-
- return selected;
-}
-
-function add_selnetwork(net, mask) {
- var newOption = document.createElement("option");
- var newOptionText = document.createTextNode(net + '/' + mask);
- var selectSize = $('authnetworks').size;
-
- if (!net || !mask) { return; }
-
- if (network_exists(net + '/' + mask)) {
- alert('Element already exist in the network list');
- return;
- }
-
- newOption.setAttribute('value', net + '/' + mask);
- newOption.appendChild(newOptionText);
-
- /* add the option to the select element */
- $('authnetworks').appendChild(newOption);
- $('authnetworks').setAttribute('size', '3');
-
- /* clear values from HTML fields */
- if ($('network')) { $('network').value = ''; }
- if ($('network_subnet')) { $('network_subnet').selectedIndex = 0; }
-}
-
-function remove_selnetwork() {
- var selectedItems = get_selected_listitems();
-
- if (selectedItems.length <= 0) {
- alert('No element selected!');
- return;
- }
-
- for (i = 0; i < selectedItems.length; i++) {
- $('authnetworks').removeChild(selectedItems[i]);
- }
-}
-
-function create_authnetworks_tr(selectElement) {
- var newTR = document.createElement("tr");
- newTR.setAttribute('id', 'authNetworksTR');
-
- var newImageTR = document.createElement("tr");
- newImageTR.setAttribute('id', 'authNetworksImageTR');
-
- var descTD = document.createElement("td");
- descTD.setAttribute('align', 'left');
- descTD.setAttribute('valign', 'top');
- descTD.setAttribute('style', 'padding-top: 10px; border-top: solid 1px grey;');
-
- var selectTD = document.createElement("td");
- selectTD.setAttribute('align', 'left');
- selectTD.setAttribute('valign', 'middle');
- selectTD.setAttribute('style', 'padding-top: 10px; border-top: solid 1px grey;');
-
- var typehintTD = document.createElement("td");
- typehintTD.setAttribute('align', 'left');
- typehintTD.setAttribute('valign', 'middle');
- typehintTD.setAttribute('colspan', '2');
- typehintTD.setAttribute('style', 'padding-top: 10px; border-top: solid 1px grey;');
-
- var blankTD = document.createElement("td");
- blankTD.setAttribute('align', 'left');
- blankTD.setAttribute('valign', 'top');
-
- var imageTD = document.createElement("td");
- imageTD.setAttribute('align', 'left');
- imageTD.setAttribute('valign', 'middle');
- imageTD.setAttribute('style', 'vertical-align: middle;');
- imageTD.setAttribute('colspan', '3');
-
- var newSpan = document.createElement("span");
- newSpan.setAttribute('style', 'padding-left: 5px; vertical-align: middle;');
-
- var newTypehintSpan = document.createElement("span");
- newTypehintSpan.setAttribute('style', 'padding-left: 5px; vertical-align: middle;');
-
- var newDescription = document.createTextNode('{$currentnetTransString}:');
- var newImgDescription = document.createTextNode('{$minusimgDescTransString}');
- var typehint = document.createTextNode('{$networksTypehintTransString}');
-
- var newSelect = document.createElement("select");
- newSelect.setAttribute('name', 'authnetworks[]');
- newSelect.setAttribute('class', 'formselect');
- newSelect.setAttribute('id', 'authnetworks');
- newSelect.setAttribute('multiple', 'multiple');
- newSelect.setAttribute('size', '{$networkCount}');
-
- /* divs are used to achieve proper alignement */
- newImageDiv = document.createElement("div");
- newImageDiv.setAttribute('style', 'float: left;');
-
- newImageDescDiv = document.createElement("div");
- newImageDescDiv.setAttribute('style', 'padding-top: 1px;');
-
- /* try to add each network to the select element */
-
-EOD;
-
-if (isset($freenas_config['mounts']['mount'][$id]['nfs']['networks'])) {
- foreach (explode(",", $freenas_config['mounts']['mount'][$id]['nfs']['networks']) as $networkel) {
- list($netaddress, $netmask) = explode('/', $networkel);
- $networkSanitized = htmlspecialchars($netaddress);
-
- $jscriptstr .= <<<EOD
- var newOption = document.createElement("option");
- var newOptionText = document.createTextNode('{$networkSanitized}/{$netmask}');
-
- newOption.setAttribute('value', '{$networkSanitized}/{$netmask}');
- newOption.appendChild(newOptionText);
-
- /* add the option to the select element */
- newSelect.appendChild(newOption);
-
-EOD;
- } // end if
-} // end foreach
-
-$jscriptstr .= <<<EOD
- var newImage = document.createElement("img");
- newImage.setAttribute('src', '/themes/{$g['theme']}/images/misc/bullet_toggle_minus.png');
- newImage.setAttribute('alt', 'remove network');
- newImage.setAttribute('border', '0');
- newImage.setAttribute('style', 'margin-right: 5px; border: solid 1px silver; cursor: pointer;');
- newImage.setAttribute('onclick', 'remove_selnetwork();');
-
- /* assemble everything */
- newTypehintSpan.appendChild(typehint);
-
- descTD.appendChild(newDescription);
- selectElement != null ? selectTD.appendChild(selectElement) : selectTD.appendChild(newSelect);
- typehintTD.appendChild(newTypehintSpan);
-
- newImageDiv.appendChild(newImage);
- newImageDescDiv.appendChild(newImgDescription);
-
- imageTD.appendChild(newImageDiv);
- imageTD.appendChild(newImageDescDiv);
-
- newTR.appendChild(descTD);
- newTR.appendChild(selectTD);
- newTR.appendChild(typehintTD);
-
- newImageTR.appendChild(blankTD);
- newImageTR.appendChild(imageTD);
-
- $('networkopttab').appendChild(newTR);
- $('networkopttab').appendChild(newImageTR);
-}
-
-function create_network_tr() {
- var newTR = document.createElement("tr");
- newTR.setAttribute('id', 'typeDetailsTR');
-
- var descTD = document.createElement("td");
- descTD.setAttribute('align', 'left');
- descTD.setAttribute('valign', 'top');
-
- var inputTD = document.createElement("td");
- inputTD.setAttribute('align', 'left');
- inputTD.setAttribute('valign', 'top');
-
- var selectTD = document.createElement("td");
- selectTD.setAttribute('align', 'left');
- selectTD.setAttribute('valign', 'middle');
-
- var imageTD = document.createElement("td");
- imageTD.setAttribute('align', 'left');
- imageTD.setAttribute('valign', 'middle');
-
- var newDescription = document.createTextNode('{$addressTransString}:');
- var newImgDescription = document.createTextNode('{$plusimgDescTransString}');
-
- var newInput = document.createElement("input");
- newInput.setAttribute('name', 'network');
- newInput.setAttribute('type', 'text');
- newInput.setAttribute('class', 'formfld host');
- newInput.setAttribute('id', 'network');
- newInput.setAttribute('size', '20');
- newInput.setAttribute('value', '');
-
- var newSelect = document.createElement("select");
- newSelect.setAttribute('name', 'network_subnet');
- newSelect.setAttribute('class', 'formselect');
- newSelect.setAttribute('id', 'network_subnet');
-
- var newImage = document.createElement("img");
- newImage.setAttribute('src', '/themes/{$g['theme']}/images/misc/bullet_toggle_plus.png');
- newImage.setAttribute('alt', 'add network');
- newImage.setAttribute('border', '0');
- newImage.setAttribute('style', 'margin-right: 5px; border: solid 1px silver; cursor: pointer;');
- newImage.setAttribute('onclick', 'add_selnetwork($("network").value, $("network_subnet").value);');
-
- /* divs are used to achieve proper alignement */
- newImageDiv = document.createElement("div");
- newImageDiv.setAttribute('style', 'float: left;');
-
- newImageDescDiv = document.createElement("div");
- newImageDescDiv.setAttribute('style', 'padding-top: 1px;');
-
- /* add options to select */
- for (i = 31; i > 0; i--) {
- var newOption = document.createElement("option");
- var newOptionText = document.createTextNode(i.toString());
-
- newOption.setAttribute('value', i);
- newOption.appendChild(newOptionText);
-
- /* add the option to the select element */
- newSelect.appendChild(newOption);
- }
-
- /* assemble everything */
- descTD.appendChild(newDescription);
- inputTD.appendChild(newInput);
- selectTD.appendChild(newSelect);
-
- newImageDiv.appendChild(newImage);
- newImageDescDiv.appendChild(newImgDescription);
-
- imageTD.appendChild(newImageDiv);
- imageTD.appendChild(newImageDescDiv);
-
- newTR.appendChild(descTD);
- newTR.appendChild(inputTD);
- newTR.appendChild(selectTD);
- newTR.appendChild(imageTD);
-
- $('networkopttab').appendChild(newTR);
-}
-
-function create_wan_tr() {
- var wanSubnet = '{$config['interfaces']['wan']['subnet']}';
-
- var newTR = document.createElement("tr");
- newTR.setAttribute('id', 'typeDetailsTR');
-
- var descTD = document.createElement("td");
- descTD.setAttribute('align', 'left');
- descTD.setAttribute('valign', 'top');
-
- var nettextTD = document.createElement("td");
- nettextTD.setAttribute('align', 'left');
- nettextTD.setAttribute('valign', 'top');
-
- var imageTD = document.createElement("td");
- imageTD.setAttribute('align', 'left');
- imageTD.setAttribute('valign', 'middle');
- imageTD.setAttribute('colspan', '2');
-
- var newDescription = document.createTextNode('{$addressTransString}:');
- var newWanDescription = document.createTextNode('{$generatedWANSubnet}/' + wanSubnet);
-
- var newNetTextSpan = document.createElement("span");
- newNetTextSpan.setAttribute('style', 'font-weight: bold; font-style: italic; vertical-align: middle;');
-
- var newImage = document.createElement("img");
- newImage.setAttribute('src', '/themes/{$g['theme']}/images/misc/bullet_toggle_plus.png');
- newImage.setAttribute('alt', 'add network');
- newImage.setAttribute('border', '0');
- newImage.setAttribute('style', 'margin-right: 5px; border: solid 1px silver; cursor: pointer;');
- newImage.setAttribute('onclick', 'add_selnetwork("{$generatedWANSubnet}", ' + wanSubnet + ');');
-
- /* divs are used to achieve proper alignement */
- newImageDiv = document.createElement("div");
- newImageDiv.setAttribute('style', 'float: left;');
-
- newImageDescDiv = document.createElement("div");
- newImageDescDiv.setAttribute('style', 'padding-top: 1px;');
-
- var newImgDescription = document.createTextNode('{$plusimgDescTransString}');
-
- /* assemble everything */
- newNetTextSpan.appendChild(newWanDescription);
-
- descTD.appendChild(newDescription);
- nettextTD.appendChild(newNetTextSpan);
-
- newImageDiv.appendChild(newImage);
- newImageDescDiv.appendChild(newImgDescription);
-
- imageTD.appendChild(newImageDiv);
- imageTD.appendChild(newImageDescDiv);
-
- newTR.appendChild(descTD);
- newTR.appendChild(nettextTD);
- newTR.appendChild(imageTD);
-
- $('networkopttab').appendChild(newTR);
-}
-
-function create_lan_tr() {
- var lanSubnet = '{$config['interfaces']['lan']['subnet']}';
-
- var newTR = document.createElement("tr");
- newTR.setAttribute('id', 'typeDetailsTR');
-
- var descTD = document.createElement("td");
- descTD.setAttribute('align', 'left');
- descTD.setAttribute('valign', 'top');
-
- var nettextTD = document.createElement("td");
- nettextTD.setAttribute('align', 'left');
- nettextTD.setAttribute('valign', 'top');
-
- var imageTD = document.createElement("td");
- imageTD.setAttribute('align', 'left');
- imageTD.setAttribute('valign', 'middle');
- imageTD.setAttribute('colspan', '2');
-
- var newDescription = document.createTextNode('{$addressTransString}:');
- var newLanDescription = document.createTextNode('{$generatedLANSubnet}/' + lanSubnet);
-
- var newNetTextSpan = document.createElement("span");
- newNetTextSpan.setAttribute('style', 'font-weight: bold; font-style: italic; vertical-align: middle;');
-
- var newImage = document.createElement("img");
- newImage.setAttribute('src', '/themes/{$g['theme']}/images/misc/bullet_toggle_plus.png');
- newImage.setAttribute('alt', 'add network');
- newImage.setAttribute('border', '0');
- newImage.setAttribute('style', 'margin-right: 5px; border: solid 1px silver; cursor: pointer;');
- newImage.setAttribute('onclick', 'add_selnetwork("{$generatedLANSubnet}", ' + lanSubnet + ');');
-
- /* divs are used to achieve proper alignement */
- newImageDiv = document.createElement("div");
- newImageDiv.setAttribute('style', 'float: left;');
-
- newImageDescDiv = document.createElement("div");
- newImageDescDiv.setAttribute('style', 'padding-top: 1px;');
-
- var newImgDescription = document.createTextNode('{$plusimgDescTransString}');
-
- /* assemble everything */
- newNetTextSpan.appendChild(newLanDescription);
-
- descTD.appendChild(newDescription);
- nettextTD.appendChild(newNetTextSpan);
-
- newImageDiv.appendChild(newImage);
- newImageDescDiv.appendChild(newImgDescription);
-
- imageTD.appendChild(newImageDiv);
- imageTD.appendChild(newImageDescDiv);
-
- newTR.appendChild(descTD);
- newTR.appendChild(nettextTD);
- newTR.appendChild(imageTD);
-
- $('networkopttab').appendChild(newTR);
-}
-
-function get_optnetwork() {
- var slashIndex= $('opt_iface_desc').firstChild.nodeValue.indexOf('/');
- var myNetwork = $('opt_iface_desc').firstChild.nodeValue.substring(0, slashIndex);
-
- return myNetwork;
-}
-
-function get_optsubnet() {
- var slashIndex= $('opt_iface_desc').firstChild.nodeValue.indexOf('/');
- var mySubnet = $('opt_iface_desc').firstChild.nodeValue.substring(slashIndex + 1, $('opt_iface_desc').firstChild.nodeValue.length);
-
- return mySubnet;
-}
-
-function create_opt_tr() {
- var newTR = document.createElement("tr");
- newTR.setAttribute('id', 'typeDetailsTR');
-
- var descTD = document.createElement("td");
- descTD.setAttribute('align', 'left');
- descTD.setAttribute('valign', 'top');
-
- var nettextTD = document.createElement("td");
- nettextTD.setAttribute('align', 'left');
- nettextTD.setAttribute('valign', 'top');
-
- var imageTD = document.createElement("td");
- imageTD.setAttribute('align', 'left');
- imageTD.setAttribute('valign', 'middle');
- imageTD.setAttribute('colspan', '2');
-
- var newDescription = document.createTextNode('{$addressTransString}:');
- var newImgDescription = document.createTextNode('{$plusimgDescTransString}');
-
- var newImage = document.createElement("img");
- newImage.setAttribute('src', '/themes/{$g['theme']}/images/misc/bullet_toggle_plus.png');
- newImage.setAttribute('alt', 'add network');
- newImage.setAttribute('border', '0');
- newImage.setAttribute('style', 'margin-right: 5px; border: solid 1px silver; cursor: pointer;');
- newImage.setAttribute('onclick', 'add_selnetwork(get_optnetwork(), get_optsubnet());');
-
- /* divs are used to achieve proper alignement */
- newImageDiv = document.createElement("div");
- newImageDiv.setAttribute('style', 'float: left;');
-
- newImageDescDiv = document.createElement("div");
- newImageDescDiv.setAttribute('style', 'padding-top: 1px;');
-
- /* add options to select */
-
-EOD;
-
-for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $optSubnet = $config['interfaces']['opt' . $i]['subnet'];
- $generatedOPTSubnet = gen_subnet($config['interfaces']['opt' . $i]['ipaddr'],
- $config['interfaces']['opt' . $i]['subnet']);
-
- if (empty($optSubnet) || empty($generatedOPTSubnet)) { continue; }
-
- $jscriptstr .= <<<EOD
- var selOptIndex = $('authnettype').selectedIndex;
- var optNumber = $('authnettype').options[selOptIndex].value.substr(3, $('authnettype').options[selOptIndex].value.length);
- var newOptDescription = null;
- var newNetTextSpan = null;
-
- if (optNumber == {$i}) {
- newOptDescription = document.createTextNode('{$generatedOPTSubnet}/{$optSubnet}');
-
- newNetTextSpan = document.createElement("span");
- newNetTextSpan.setAttribute('id', 'opt_iface_desc');
- newNetTextSpan.setAttribute('style', 'font-weight: bold; font-style: italic; vertical-align: middle;');
- }
-
-EOD;
-}
-
-$jscriptstr .= <<<EOD
- /* assemble everything */
- if (newNetTextSpan)
- newNetTextSpan.appendChild(newOptDescription);
-
- descTD.appendChild(newDescription);
- if (newNetTextSpan)
- nettextTD.appendChild(newNetTextSpan);
-
- newImageDiv.appendChild(newImage);
- newImageDescDiv.appendChild(newImgDescription);
-
- imageTD.appendChild(newImageDiv);
- imageTD.appendChild(newImageDescDiv);
-
- newTR.appendChild(descTD);
- newTR.appendChild(nettextTD);
- newTR.appendChild(imageTD);
-
- $('networkopttab').appendChild(newTR);
-}
-
-function authnet_change() {
- var tmpElement = $('authnetworks');
-
- if ($('typeDetailsTR')) { $('networkopttab').removeChild($('typeDetailsTR')); }
- if ($('authNetworksTR')) { $('networkopttab').removeChild($('authNetworksTR')); }
- if ($('authNetworksImageTR')) { $('networkopttab').removeChild($('authNetworksImageTR')); }
-
- switch ($('authnettype').selectedIndex) {
- case 0:
- /* Network */
- create_network_tr();
- break;
- case 1:
- /* WAN subnet */
- create_wan_tr();
- break;
- case 2:
- /* LAN subnet */
- create_lan_tr();
- break;
-
-EOD;
-
-for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $case_count = 2 + $i;
-
- $jscriptstr .= <<<EOD
- case {$case_count}:
- /* OPT subnet */
- create_opt_tr();
- break;
-
-EOD;
-
-} // end for
-
-$jscriptstr .= <<<EOD
- } // end switch
-
- create_authnetworks_tr(tmpElement);
-} // end function authnet_change
-//-->
-</script>
-
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
- <div id="inputerrors"></div>
- <form id="iform" name="iform" action="disks_mount_edit.php" method="post">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" align="left" valign="middle" class="listtopic" colspan="2"><?=gettext("Export Options");?></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Export Name"); ?></td>
- <td width="78%" class="vtable">
- <input type="text" class="formfld file" size="30" value="/mnt/<?=htmlspecialchars($freenas_config['mounts']['mount'][$id]['sharename']);?>" readonly="readonly" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Description"); ?></td>
- <td width="78%" class="vtable">
- <input type="text" class="formfld unknown" size="30" value="<?=htmlspecialchars($freenas_config['mounts']['mount'][$id]['desc']);?>" readonly="readonly" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("map all user to root");?></td>
- <td width="78%" class="vtable">
- <select name="mapall" class="formselect" id="mapall">
- <?php
- $types = explode(",", "Yes,No");
- $vals = explode(" ", "yes no");
- $j = 0;
-
- for ($j = 0; $j < count($vals); $j++):
- ?>
- <option value="<?=$vals[$j];?>" <?php if ($vals[$j] == $pconfig['mapall']) echo "selected=\"selected\"";?>>
- <?=htmlspecialchars($types[$j]);?>
- </option>
- <?php endfor; ?>
- </select>
- <br />
- <?= gettext("All users will have the root privilege."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Authorised network");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <table border="0" cellspacing="0" cellpadding="4" id="networkopttab">
- <tr>
- <td align="left" valign="middle"><?=gettext("Type");?>:</td>
- <td align="left" valign="middle" colspan="4">
- <select name="authnettype" id="authnettype" class="formselect" onchange="authnet_change();">
- <option value="network">
- <?=gettext("Network")?>
- </option>
- <option value="wan">
- <?=gettext("WAN subnet");?>
- </option>
- <option value="lan">
- <?=gettext("LAN subnet");?>
- </option>
- <?php
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++):
- ?>
- <option value="opt<?=$i;?>">
- <?=htmlspecialchars($config['interfaces']['opt' . $i]['descr']);?>
- <?=gettext("subnet");?>
- </option>
- <?php endfor; ?>
- </select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onmousedown="selectnetel();" onkeydown="selectnetel();" />
- <?php if(isset($id)): ?>
- <input id="id" name="id" type="hidden" value="<?=$id;?>" />
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <span class="red">
- <strong><?= gettext("NOTE"); ?>:</strong>
- </span>
- <br />
- <ul>
- <li>
- <span class="vexpl">
- <?= gettext("The name of each exported directory is: /mnt/sharename"); ?>
- </span>
- </li>
- <li>
- <span class="vexpl">
- <?= gettext("Try adding networks to the 'current networks' list to authorize each particular network."); ?>
- </span>
- </li>
- <li>
- <span class="vexpl">
- <?= gettext("Use ctrl-click (or command-click on the Mac) to select and de-select elements from the 'current networks' list."); ?>
- </span>
- </li>
- </ul>
- </td>
- </tr>
- </table>
- </form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-<script type="text/javascript">
-<!--
-authnet_change();
-//-->
-</script>
-</body>
-</html>
diff --git a/config/archive/freenas/www/services_rsyncd.php b/config/archive/freenas/www/services_rsyncd.php
deleted file mode 100644
index a31aa229..00000000
--- a/config/archive/freenas/www/services_rsyncd.php
+++ /dev/null
@@ -1,277 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- services_rsyncd.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Services"),
- gettext("RSYNCD"),
- gettext("Server"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-/* TODO: use pfSense users/groups. */
-if (!is_array($freenas_config['system']['user']))
- $freenas_config['system']['user'] = array();
-
-users_sort();
-
-$a_user = &$freenas_config['system']['user'];
-
-if (!is_array($freenas_config['rsync']))
-{
- $freenas_config['rsync'] = array();
-}
-
-$pconfig['readonly'] = $freenas_config['rsyncd']['readonly'];
-$pconfig['port'] = $freenas_config['rsyncd']['port'];
-$pconfig['motd'] = $freenas_config['rsyncd']['motd'];
-$pconfig['maxcon'] = $freenas_config['rsyncd']['maxcon'];
-$pconfig['rsyncd_user'] = $freenas_config['rsyncd']['rsyncd_user'];
-$pconfig['enable'] = isset($freenas_config['rsyncd']['enable']);
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- unset($do_format);
- $pconfig = $_POST;
-
- /* input validation */
- if ($_POST['enable'])
- {
- $reqdfields = array_merge($reqdfields, explode(" ", "readonly port"));
- $reqdfieldsn = array_merge($reqdfieldsn, explode(",", "Readonly,Port"));
- }
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if ($_POST['enable']) {
- if (!is_port($_POST['port']))
- $error_bucket[] = array("error" => gettext("The TCP port must be a valid port number."),
- "field" => "port");
- else if (!is_numericint($_POST['maxcon']))
- $error_bucket[] = array("error" => gettext("The value provided by the maximum connections field is not a number"),
- "field" => "maxcon");
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $freenas_config['rsyncd']['readonly'] = $_POST['readonly'];
- $freenas_config['rsyncd']['port'] = $_POST['port'];
- $freenas_config['rsyncd']['motd'] = $_POST['motd'];
- $freenas_config['rsyncd']['maxcon'] = $_POST['maxcon'];
- $freenas_config['rsyncd']['enable'] = $_POST['enable'] ? true : false;
- $freenas_config['rsyncd']['rsyncd_user'] = $_POST['rsyncd_user'];
-
- write_config();
-
- $retval = 0;
- if (!file_exists($d_sysrebootreqd_path))
- {
- /* nuke the cache file */
- config_lock();
- services_rsyncd_configure();
- services_zeroconf_configure();
- config_unlock();
- }
- $savemsg = get_std_save_message($retval);
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-$jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-function enable_change(enable_change) {
- var endis;
-
- endis = !(document.iform.enable.checked || enable_change);
- endis ? color = '#D4D0C8' : color = '#FFFFFF';
-
- document.iform.readonly.disabled = endis;
- document.iform.port.disabled = endis;
- document.iform.motd.disabled = endis;
- document.iform.maxcon.disabled = endis;
- document.iform.rsyncd_user.disabled = endis;
- /* adjust colors */
- document.iform.readonly.style.backgroundColor = color;
- document.iform.port.style.backgroundColor = color;
- document.iform.motd.style.backgroundColor = color;
- document.iform.maxcon.style.backgroundColor = color;
- document.iform.rsyncd_user.style.backgroundColor = color;
-}
-//-->
-</script>
-
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
- <?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Server"), true, "services_rsyncd.php");
- $tab_array[1] = array(gettext("Client"), false, "services_rsyncd_client.php");
- $tab_array[2] = array(gettext("Local"), false, "services_rsyncd_local.php");
- display_top_tabs($tab_array);
- ?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form id="iform" name="iform" action="services_rsyncd.php" method="post">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" valign="middle" class="listtopic" colspan="2">
- <span style="vertical-align: middle; position: relative; left: 0px;"><?=gettext("Rsync Daemon");?></span>
- <span style="vertical-align: middle; position: relative; left: 81%;">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onClick="enable_change(false)" />&nbsp;<?= gettext("Enable"); ?>
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Read only"); ?></td>
- <td width="78%" class="vtable">
- <select name="readonly" class="formselect" id="readonly">
- <?php
- $types = explode(",", "Yes,No");
- $vals = explode(" ", "yes no");
- $j = 0;
-
- for ($j = 0; $j < count($vals); $j++):
- ?>
- <option value="<?=$vals[$j];?>" <?php if ($vals[$j] == $pconfig['readonly']) echo "selected=\"selected\"";?>>
- <?=htmlspecialchars($types[$j]);?>
- </option>
- <?php endfor; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Map to user"); ?></td>
- <td width="78%" class="vtable">
- <select name="rsyncd_user" class="formselect" id="rsyncd_user">
- <option value="ftp"<?php if ($pconfig['rsyncd_user'] == "ftp") echo "selected";?>>
- <?php echo htmlspecialchars("guest"); ?>
- <?php foreach ($a_user as $user): ?>
- <option value="<?=$user['name'];?>"<?php if ($user['name'] == $pconfig['rsyncd_user']) echo "selected";?>>
- <?php echo htmlspecialchars($user['name']); ?>
- </option>
- <?php endforeach; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("TCP port"); ?></td>
- <td width="78%" class="vtable">
- <input name="port" type="text" class="formfld unknown" id="port" size="20" value="<?=htmlspecialchars($pconfig['port']);?>" />
- <br /><?= gettext("Alternate TCP port."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Maximum connections"); ?></td>
- <td width="78%" class="vtable">
- <input name="maxcon" type="text" class="formfld unknown" id="maxcon" size="20" value="<?=htmlspecialchars($pconfig['maxcon']);?>" />
- <br /><?= gettext("Maximum number of simultaneous connections. Default is 0 (unlimited)"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?= gettext("MOTD"); ?></td>
- <td width="78%" class="vtable">
- <textarea name="motd" cols="65" rows="7" id="motd" class="formpre"><?=htmlspecialchars($pconfig['motd']);?></textarea>
- <br />
- <?= gettext("message of the day");?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-<script type="text/javascript">
-<!--
-enable_change(false);
-//-->
-</script>
-</body>
-</html>
diff --git a/config/archive/freenas/www/services_rsyncd_client.php b/config/archive/freenas/www/services_rsyncd_client.php
deleted file mode 100644
index efb0e870..00000000
--- a/config/archive/freenas/www/services_rsyncd_client.php
+++ /dev/null
@@ -1,585 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- services_rsyncd_client.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Services"),
- gettext("RSYNCD"),
- gettext("Client"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['rsyncclient']))
-{
- $freenas_config['rsyncclient'] = array();
-}
-
-$a_months = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
-$a_weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
-$a_mount = array();
-
-$pconfig['readonly'] = $freenas_config['rsyncd']['readonly'];
-$pconfig['port'] = $freenas_config['rsyncd']['port'];
-$pconfig['motd'] = $freenas_config['rsyncd']['motd'];
-$pconfig['maxcon'] = $freenas_config['rsyncd']['maxcon'];
-$pconfig['rsyncd_user'] = $freenas_config['rsyncd']['rsyncd_user'];
-$pconfig['enable'] = isset($freenas_config['rsyncd']['enable']);
-
-if (!is_array($freenas_config['mounts']['mount'])) {
- $nodisk_errors[] = gettext("You must configure mount point first.");
-} else {
- if (! empty($_POST))
- {
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- unset($do_format);
- $pconfig = $_POST;
-
- /* input validation */
- if ($_POST['enable']){
- $reqdfields = array_merge($reqdfields, explode(" ", "rsyncserverip sharetosync"));
- $reqdfieldsn = array_merge($reqdfieldsn, explode(",", "Rsyncserverip,Sharetosync"));
- }
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if ($_POST['enable']) {
- if (!is_port($_POST['port']))
- $error_bucket[] = array("error" => gettext("The TCP port must be a valid port number."),
- "field" => "port");
- else if (!is_numericint($_POST['maxcon']))
- $error_bucket[] = array("error" => gettext("The value provided by the maximum connections field is not a number"),
- "field" => "maxcon");
- }
-
- if (!is_array($freenas_config['mounts']['mount'])) {
- $error_bucket[] = array("error" => gettext("You must configure mount point first."),
- "field" => "none");
- }
-
- if ($_POST['enable'] && !is_ipaddr($_POST['rsyncserverip'])) {
- $error_bucket[] = array("error" => gettext("A valid IP address must be specified."),
- "field" => "rsyncserverip");
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $freenas_config['rsyncclient']['opt_delete'] = $_POST['opt_delete'] ? true : false;;
- $freenas_config['rsyncclient']['rsyncserverip'] = $_POST['rsyncserverip'];
- $freenas_config['rsyncclient']['minute'] = $_POST['minutes'];
- $freenas_config['rsyncclient']['hour'] = $_POST['hours'];
- $freenas_config['rsyncclient']['day'] = $_POST['days'];
- $freenas_config['rsyncclient']['month'] = $_POST['months'];
- $freenas_config['rsyncclient']['weekday'] = $_POST['weekdays'];
- $freenas_config['rsyncclient']['rsyncshare'] = $_POST['rsyncshare'];
- $freenas_config['rsyncclient']['enable'] = $_POST['enable'] ? true : false;
- $freenas_config['rsyncclient']['sharetosync'] = $_POST['sharetosync'];
- $freenas_config['rsyncclient']['all_mins'] = $_POST['all_mins'];
- $freenas_config['rsyncclient']['all_hours'] = $_POST['all_hours'];
- $freenas_config['rsyncclient']['all_days'] = $_POST['all_days'];
- $freenas_config['rsyncclient']['all_months'] = $_POST['all_months'];
- $freenas_config['rsyncclient']['all_weekdays'] = $_POST['all_weekdays'];
-
- write_config();
-
- $retval = 0;
-
- if (!file_exists($d_sysrebootreqd_path)){
- /* nuke the cache file */
- config_lock();
- services_rsyncclient_configure();
- services_cron_configure();
- config_unlock();
- }
-
- $savemsg = get_std_save_message($retval);
- }
- }
-
- mount_sort();
- $a_mount = &$freenas_config['mounts']['mount'];
-
- $pconfig['opt_delete'] = isset($freenas_config['rsyncclient']['opt_delete']);
- $pconfig['enable'] = isset($freenas_config['rsyncclient']['enable']);
- $pconfig['rsyncserverip'] = $freenas_config['rsyncclient']['rsyncserverip'];
- $pconfig['rsyncshare'] = $freenas_config['rsyncclient']['rsyncshare'];
- $pconfig['minute'] = $freenas_config['rsyncclient']['minute'];
- $pconfig['hour'] = $freenas_config['rsyncclient']['hour'];
- $pconfig['day'] = $freenas_config['rsyncclient']['day'];
- $pconfig['month'] = $freenas_config['rsyncclient']['month'];
- $pconfig['weekday'] = $freenas_config['rsyncclient']['weekday'];
- $pconfig['sharetosync'] = $freenas_config['rsyncclient']['sharetosync'];
- $pconfig['all_mins'] = $freenas_config['rsyncclient']['all_mins'];
- $pconfig['all_hours'] = $freenas_config['rsyncclient']['all_hours'];
- $pconfig['all_days'] = $freenas_config['rsyncclient']['all_days'];
- $pconfig['all_months'] = $freenas_config['rsyncclient']['all_months'];
- $pconfig['all_weekdays'] = $freenas_config['rsyncclient']['all_weekdays'];
-
- if ($pconfig['all_mins'] == 1){
- $all_mins_all = " checked";
- } else {
- $all_mins_selected = " checked";
- }
-
- if ($pconfig['all_hours'] == 1){
- $all_hours_all = " checked";
- } else {
- $all_hours_selected = " checked";
- }
-
- if ($pconfig['all_days'] == 1){
- $all_days_all = " checked";
- } else {
- $all_days_selected = " checked";
- }
-
- if ($pconfig['all_months'] == 1){
- $all_months_all = " checked";
- } else {
- $all_months_selected = " checked";
- }
-
- if ($pconfig['all_weekdays'] == 1){
- $all_weekdays_all = " checked";
- } else {
- $all_weekdays_selected = " checked";
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-$jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-function enable_change(enable_change) {
- var endis;
-
- endis = !(document.iform.enable.checked || enable_change);
- endis ? color = '#D4D0C8' : color = '#FFFFFF';
-
-EOD;
-
-$i = 0;
-
-if (is_array($a_mount)) {
- foreach ($a_mount as $mountv) {
- $jscriptstr .= " document.iform.share_" . $i . ".disabled = endis;\n";
- $i++;
- }
-}
-
-/* Note: In contrast to FreeNAS we are only using
- * three minutes and one hours field(s)
- */
-$jscriptstr .= <<<EOD
-
- document.iform.rsyncserverip.disabled = endis;
- document.iform.minutes1.disabled = endis;
- document.iform.minutes2.disabled = endis;
- document.iform.minutes3.disabled = endis;
- document.iform.hours1.disabled = endis;
- /* document.iform.hours2.disabled = endis; */
- document.iform.days1.disabled = endis;
- document.iform.days2.disabled = endis;
- /* document.iform.days3.disabled = endis; */
- document.iform.months.disabled = endis;
- document.iform.weekdays.disabled = endis;
- document.iform.all_mins1.disabled = endis;
- document.iform.all_mins2.disabled = endis;
- document.iform.all_hours1.disabled = endis;
- document.iform.all_hours2.disabled = endis;
- document.iform.all_days1.disabled = endis;
- document.iform.all_days2.disabled = endis;
- document.iform.all_months1.disabled = endis;
- document.iform.all_months2.disabled = endis;
- document.iform.all_weekdays1.disabled = endis;
- document.iform.all_weekdays2.disabled = endis;
- document.iform.opt_delete.disabled = endis;
- /* color adjustments */
- document.iform.rsyncserverip.style.backgroundColor = color;
- document.iform.minutes1.style.backgroundColor = color;
- document.iform.minutes2.style.backgroundColor = color;
- document.iform.minutes3.style.backgroundColor = color;
- document.iform.hours1.style.backgroundColor = color;
- /* document.iform.hours2.style.backgroundColor = color; */
- document.iform.days1.style.backgroundColor = color;
- document.iform.days2.style.backgroundColor = color;
- /* document.iform.days3.style.backgroundColor = color; */
- document.iform.months.style.backgroundColor = color;
- document.iform.weekdays.style.backgroundColor = color;
- document.iform.all_mins1.style.backgroundColor = color;
- document.iform.all_mins2.style.backgroundColor = color;
- document.iform.all_hours1.style.backgroundColor = color;
- document.iform.all_hours2.style.backgroundColor = color;
- document.iform.all_days1.style.backgroundColor = color;
- document.iform.all_days2.style.backgroundColor = color;
- document.iform.all_months1.style.backgroundColor = color;
- document.iform.all_months2.style.backgroundColor = color;
- document.iform.all_weekdays1.style.backgroundColor = color;
- document.iform.all_weekdays2.style.backgroundColor = color;
- document.iform.opt_delete.style.backgroundColor = color;
-}
-//-->
-</script>
-
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Server"), false, "services_rsyncd.php");
- $tab_array[1] = array(gettext("Client"), true, "services_rsyncd_client.php");
- $tab_array[2] = array(gettext("Local"), false, "services_rsyncd_local.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form id="iform" name="iform" action="services_rsyncd_client.php" method="post">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" valign="middle" class="listtopic" colspan="2">
- <span style="vertical-align: middle; position: relative; left: 0px;"><?=gettext("Rsync Client Synchronization");?></span>
- <span style="vertical-align: middle; position: relative; left: 70%;">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onClick="enable_change(false)" />&nbsp;<?= gettext("Enable"); ?>
- </span>
- </td>
- </tr>
- <tr>
- <td width="16%" valign="top" class="vncellreq"><?= gettext("Remote RSYNC Server"); ?></td>
- <td width="84%" class="vtable">
- <input name="rsyncserverip" id="rsyncserverip" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['rsyncserverip']);?>" />
- <br />
- <?= gettext("IP address of remote RSYNC server"); ?>
- </td>
- </tr>
- <tr>
- <td width="16%" valign="top" class="vncellreq"><?= gettext("RSYNC Options"); ?></td>
- <td width="84%" class="vtable">
- <input name="opt_delete" id="opt_delete" type="checkbox" value="yes" <?php if ($pconfig['opt_delete']) echo "checked=\"checked\""; ?> />
- <?= gettext("Delete files that don't exist on sender."); ?>
- </td>
- </tr>
- <tr>
- <td width="16%" valign="top" class="vncellreq"><?= gettext("Shares to be synchronized"); ?></td>
- <td width="84%" class="vtable">
- <?php
- if (is_array($freenas_config['mounts']['mount'])) {
- $i=0;
- foreach ($a_mount as $mountv) {
- echo "<input name=\"sharetosync[]\" id=\"share_" . $i . "\" type=\"checkbox\" value=\"" . $mountv['sharename'] . "\"";
- if ($mountv['sharename'] == $pconfig['sharetosync'])
- echo " checked=\"checked\"";
- echo" />";
- echo $mountv['sharename'] . " (" . $mountv['desc'] . ")<br />\n";
- $i++;
- }
- }
- else
- echo "You must configure mount point before!";
- ?>
- <br />
- <?= gettext("This same local share must be present on the Remote Server."); ?>
- </td>
- </tr>
- <tr>
- <td width="16%" valign="top" class="vncellreq"><?= gettext("Synchronization Time"); ?></td>
- <td width="84%" class="vtable">
- <table width="100%" border="1" cellpadding="4" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listtopic"><?= gettext("minutes"); ?></td>
- <td align="left" valign="top" class="listtopic"><?= gettext("hours"); ?></td>
- <td align="left" valign="top" class="listtopic"><?= gettext("days"); ?></td>
- <td align="left" valign="top" class="listtopic"><?= gettext("months"); ?></td>
- <td align="left" valign="top" class="listtopic"><?= gettext("week days"); ?></td>
- </tr>
- <tr>
- <td align="left" valign="top" class="vncell" nowrap="nowrap">
- <div id="all_min_rdbtns" style="padding-bottom: 10px;" >
- <input type="radio" name="all_mins" id="all_mins1" value="1"<?php echo $all_mins_all;?> />
- <label for="all_mins1">All</label><br />
- <input type="radio" name="all_mins" id="all_mins2" value="0"<?php echo $all_mins_selected;?> />
- <label for="all_mins2">Selected ...</label>
- </div>
- <div id="all_min_select" style="vertical-align: top;">
- <select multiple="multible" class="formselect" size="24" name="minutes[]" id="minutes1" style="vertical-align: top;">
- <?php
- $i = 0;
- while ($i <= 23){
- if (isset($pconfig['minute'])) {
- if (in_array($i, $pconfig['minute'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $i . "\n";
- $i++;
- }
- ?>
- </select>
- <select multiple="multible" class="formselect" size="24" name="minutes[]" id="minutes2" style="vertical-align: top;">
- <?php
- $i = 24;
- while ($i <= 47) {
- if (isset($pconfig['minute'])) {
- if (in_array($i, $pconfig['minute'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $i . "\n";
- $i++;
- }
- ?>
- </select>
- <select multiple="multible" class="formselect" size="12" name="minutes[]" id="minutes3" style="vertical-align: top;">
- <?php
- $i = 48;
- while ($i <= 59) {
- if (isset($pconfig['minute'])) {
- if (in_array($i, $pconfig['minute'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $i . "\n";
- $i++;
- }
- ?>
- </select>
- </div>
- </td>
- <td align="left" valign="top" class="vncell" nowrap="nowrap">
- <div id="all_hours_rdbtns" style="padding-bottom: 10px;" >
- <input type="radio" name="all_hours" id="all_hours1" value="1"<?php echo $all_hours_all;?> />
- <label for="all_hours1">All</label><br />
- <input type="radio" name="all_hours" id="all_hours2" value="0"<?php echo $all_hours_selected;?> />
- <label for="all_hours2">Selected ...</label>
- </div>
- <div id="all_hours_select" style="vertical-align: top;">
- <select multiple size="24" name="hours[]" id="hours1" style="vertical-align: top;">
- <?php
- $i = 0;
- while ($i <= 23) {
- if (isset($pconfig['hour'])) {
- if (in_array($i, $pconfig['hour'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $i . "\n";
- $i++;
- }
- ?>
- </select>
- </div>
- </td>
- <td align="left" valign="top" class="vncell" nowrap="nowrap">
- <div id="all_days_rdbtns" style="padding-bottom: 10px;" >
- <input type="radio" name="all_days" id="all_days1" value="1" <?php echo $all_days_all;?> />
- <label for="all_days1">All</label><br />
- <input type="radio" name="all_days" id="all_days2" value="0"<?php echo $all_days_selected;?> />
- <label for="all_days2">Selected ...</label>
- </div>
- <div id="all_days_select" style="vertical-align: top;">
- <select multiple size="24" name="days[]" id="days1" style="vertical-align: top;">
- <?php
- $i = 1;
- while ($i <= 24) {
- if (isset($pconfig['day'])) {
- if (in_array($i, $pconfig['day'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $i . "\n";
- $i++;
- }
- ?>
- </select>
- <select multiple size="7" name="days[]" id="days2" style="vertical-align: top;">
- <?php
- $i = 25;
- while ($i <= 31) {
- if (isset($pconfig['day'])) {
- if (in_array($i, $pconfig['day'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $i . "\n";
- $i++;
- }
- ?>
- </select>
- </div>
- </td>
- <td align="left" valign="top" class="vncell">
- <div id="all_months_rdbtns" style="padding-bottom: 10px;" >
- <input type="radio" name="all_months" id="all_months1" value="1"<?php echo $all_months_all;?> />
- <label for="all_months1">All</label><br />
- <input type="radio" name="all_months" id="all_months2" value="0"<?php echo $all_months_selected;?> />
- <label for="all_months2">Selected ...</label>
- </div>
- <div id="all_months_select" style="vertical-align: top;">
- <select multiple size="12" name="months[]" id="months" style="vertical-align: top;">
- <?php
- $i=1;
- foreach ($a_months as $monthv) {
- if (isset($pconfig['month'])) {
- if (in_array($i, $pconfig['month'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $monthv . "\n";
- $i++;
- }
- ?>
- </select>
- </div>
- </td>
- <td align="left" valign="top" class="vncell">
- <div id="all_weekdays_rdbtns" style="padding-bottom: 10px;" >
- <input type="radio" name="all_weekdays" id="all_weekdays1" value="1"<?php echo $all_weekdays_all;?> />
- <label for="all_weekdays1">All</label><br />
- <input type="radio" name="all_weekdays" id="all_weekdays2" value="0"<?php echo $all_weekdays_selected;?> />
- <label for="all_weekdays2">Selected ...</label>
- </div>
- <div id="all_weekdays_select" style="vertical-align: top;">
- <select multiple size="7" name="weekdays[]" id="weekdays" style="vertical-align: top;">
- <?php
- $i=0;
- foreach ($a_weekdays as $weekdayv) {
- if (isset($pconfig['weekday'])){
- if (in_array($i, $pconfig['weekday'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $weekdayv . "\n";
- $i++;
- }
- ?>
- </select>
- </div>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" class="vncell" colspan="5">
- <?= gettext("Note: Ctrl-click (or command-click on the Mac) to select and de-select minutes, hours, days and months."); ?>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="16%" valign="top">&nbsp;</td>
- <td width="84%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-<script type="text/javascript">
-<!--
-enable_change(false);
-//-->
-</script>
-</body>
-</html>
diff --git a/config/archive/freenas/www/services_rsyncd_local.php b/config/archive/freenas/www/services_rsyncd_local.php
deleted file mode 100644
index df29961a..00000000
--- a/config/archive/freenas/www/services_rsyncd_local.php
+++ /dev/null
@@ -1,579 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- services_rsyncd_local.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Services"),
- gettext("RSYNCD"),
- gettext("Local"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['rsync_local']))
-{
- $freenas_config['rsync_local'] = array();
-}
-
-$a_months = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
-$a_weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
-
-$pconfig['readonly'] = $freenas_config['rsyncd']['readonly'];
-$pconfig['port'] = $freenas_config['rsyncd']['port'];
-$pconfig['motd'] = $freenas_config['rsyncd']['motd'];
-$pconfig['maxcon'] = $freenas_config['rsyncd']['maxcon'];
-$pconfig['rsyncd_user'] = $freenas_config['rsyncd']['rsyncd_user'];
-$pconfig['enable'] = isset($freenas_config['rsyncd']['enable']);
-
-if (!is_array($freenas_config['mounts']['mount'])) {
- $nodisk_errors[] = gettext("You must configure mount point first.");
-} else {
- if (! empty($_POST))
- {
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- $pconfig = $_POST;
-
- /* input validation */
- if ($_POST['enable']){
- $reqdfields = array_merge($reqdfields, explode(" ", "source destination"));
- $reqdfieldsn = array_merge($reqdfieldsn, explode(",", "Source,Destination"));
- }
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if ($_POST['enable'] && (strcmp($_POST['source'],$_POST['destination'])==0)) {
- $error_bucket[] = array("error" => gettext("You can't have the same mount point for source and destination!"),
- "field" => "source");
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $freenas_config['rsync_local']['opt_delete'] = $_POST['opt_delete'] ? true : false;;
- $freenas_config['rsync_local']['minute'] = $_POST['minutes'];
- $freenas_config['rsync_local']['hour'] = $_POST['hours'];
- $freenas_config['rsync_local']['day'] = $_POST['days'];
- $freenas_config['rsync_local']['month'] = $_POST['months'];
- $freenas_config['rsync_local']['weekday'] = $_POST['weekdays'];
- $freenas_config['rsync_local']['source'] = $_POST['source'];
- $freenas_config['rsync_local']['destination'] = $_POST['destination'];
- $freenas_config['rsync_local']['enable'] = $_POST['enable'] ? true : false;
- $freenas_config['rsync_local']['sharetosync'] = $_POST['sharetosync'];
- $freenas_config['rsync_local']['all_mins'] = $_POST['all_mins'];
- $freenas_config['rsync_local']['all_hours'] = $_POST['all_hours'];
- $freenas_config['rsync_local']['all_days'] = $_POST['all_days'];
- $freenas_config['rsync_local']['all_months'] = $_POST['all_months'];
- $freenas_config['rsync_local']['all_weekdays'] = $_POST['all_weekdays'];
-
- write_config();
-
- $retval = 0;
-
- if (!file_exists($d_sysrebootreqd_path)){
- /* nuke the cache file */
- config_lock();
- services_rsync_local_configure();
- services_cron_configure();
- config_unlock();
- }
-
- $savemsg = get_std_save_message($retval);
- }
- }
-
- mount_sort();
- $a_mount = &$freenas_config['mounts']['mount'];
-
- $pconfig['opt_delete'] = isset($freenas_config['rsync_local']['opt_delete']);
- $pconfig['enable'] = isset($freenas_config['rsync_local']['enable']);
- $pconfig['source'] = $freenas_config['rsync_local']['source'];
- $pconfig['destination'] = $freenas_config['rsync_local']['destination'];
- $pconfig['minute'] = $freenas_config['rsync_local']['minute'];
- $pconfig['hour'] = $freenas_config['rsync_local']['hour'];
- $pconfig['day'] = $freenas_config['rsync_local']['day'];
- $pconfig['month'] = $freenas_config['rsync_local']['month'];
- $pconfig['weekday'] = $freenas_config['rsync_local']['weekday'];
- $pconfig['sharetosync'] = $freenas_config['rsync_local']['sharetosync'];
- $pconfig['all_mins'] = $freenas_config['rsync_local']['all_mins'];
- $pconfig['all_hours'] = $freenas_config['rsync_local']['all_hours'];
- $pconfig['all_days'] = $freenas_config['rsync_local']['all_days'];
- $pconfig['all_months'] = $freenas_config['rsync_local']['all_months'];
- $pconfig['all_weekdays'] = $freenas_config['rsync_local']['all_weekdays'];
-
- if ($pconfig['all_mins'] == 1){
- $all_mins_all = " checked";
- } else {
- $all_mins_selected = " checked";
- }
-
- if ($pconfig['all_hours'] == 1){
- $all_hours_all = " checked";
- } else {
- $all_hours_selected = " checked";
- }
-
- if ($pconfig['all_days'] == 1){
- $all_days_all = " checked";
- } else {
- $all_days_selected = " checked";
- }
-
- if ($pconfig['all_months'] == 1){
- $all_months_all = " checked";
- } else {
- $all_months_selected = " checked";
- }
-
- if ($pconfig['all_weekdays'] == 1){
- $all_weekdays_all = " checked";
- } else {
- $all_weekdays_selected = " checked";
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-$jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-function enable_change(enable_change) {
- var endis;
-
- endis = !(document.iform.enable.checked || enable_change);
- endis ? color = '#D4D0C8' : color = '#FFFFFF';
-
-EOD;
-
-/* Note: In contrast to FreeNAS we are only using
- * three minutes and one hours field(s)
- */
-$jscriptstr .= <<<EOD
-
- document.iform.source.disabled = endis;
- document.iform.destination.disabled = endis;
- document.iform.minutes1.disabled = endis;
- document.iform.minutes2.disabled = endis;
- document.iform.minutes3.disabled = endis;
- document.iform.hours1.disabled = endis;
- /* document.iform.hours2.disabled = endis; */
- document.iform.days1.disabled = endis;
- document.iform.days2.disabled = endis;
- /* document.iform.days3.disabled = endis; */
- document.iform.months.disabled = endis;
- document.iform.weekdays.disabled = endis;
- document.iform.all_mins1.disabled = endis;
- document.iform.all_mins2.disabled = endis;
- document.iform.all_hours1.disabled = endis;
- document.iform.all_hours2.disabled = endis;
- document.iform.all_days1.disabled = endis;
- document.iform.all_days2.disabled = endis;
- document.iform.all_months1.disabled = endis;
- document.iform.all_months2.disabled = endis;
- document.iform.all_weekdays1.disabled = endis;
- document.iform.all_weekdays2.disabled = endis;
- document.iform.opt_delete.disabled = endis;
- /* color adjustments */
- document.iform.source.style.backgroundColor = color;
- document.iform.destination.style.backgroundColor = color;
- document.iform.minutes1.style.backgroundColor = color;
- document.iform.minutes2.style.backgroundColor = color;
- document.iform.minutes3.style.backgroundColor = color;
- document.iform.hours1.style.backgroundColor = color;
- /* document.iform.hours2.style.backgroundColor = color; */
- document.iform.days1.style.backgroundColor = color;
- document.iform.days2.style.backgroundColor = color;
- /* document.iform.days3.style.backgroundColor = color; */
- document.iform.months.style.backgroundColor = color;
- document.iform.weekdays.style.backgroundColor = color;
- document.iform.all_mins1.style.backgroundColor = color;
- document.iform.all_mins2.style.backgroundColor = color;
- document.iform.all_hours1.style.backgroundColor = color;
- document.iform.all_hours2.style.backgroundColor = color;
- document.iform.all_days1.style.backgroundColor = color;
- document.iform.all_days2.style.backgroundColor = color;
- document.iform.all_months1.style.backgroundColor = color;
- document.iform.all_months2.style.backgroundColor = color;
- document.iform.all_weekdays1.style.backgroundColor = color;
- document.iform.all_weekdays2.style.backgroundColor = color;
- document.iform.opt_delete.style.backgroundColor = color;
-}
-//-->
-</script>
-
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Server"), false, "services_rsyncd.php");
- $tab_array[1] = array(gettext("Client"), false, "services_rsyncd_client.php");
- $tab_array[2] = array(gettext("Local"), true, "services_rsyncd_local.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <form id="iform" name="iform" action="services_rsyncd_local.php" method="post">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" valign="middle" class="listtopic" colspan="2">
- <span style="vertical-align: middle; position: relative; left: 0px;"><?=gettext("Rsync Client Synchronization");?></span>
- <span style="vertical-align: middle; position: relative; left: 70%;">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onClick="enable_change(false)" />&nbsp;<?= gettext("Enable"); ?>
- </span>
- </td>
- </tr>
- <tr>
- <td width="16%" valign="top" class="vncellreq"><?= gettext("Source"); ?></td>
- <td width="84%" class="vtable">
- <select name="source" class="formselect" id="source">
- <?php
- if (is_array($freenas_config['mounts']['mount'])) {
- foreach ($a_mount as $mountv) {
- echo "<option value=\"{$mountv['sharename']}\"";
- if (strcmp($mountv['sharename'],$pconfig['source']) == 0)
- echo " selected";
- echo">";
- echo htmlspecialchars($mountv['sharename']);
- echo "</option>";
- }
- }
- else
- echo gettext("You must configure mount point first.");
- ?>
- </select>
- <br />
- <?= gettext("Source Mount Point."); ?>
- </td>
- </tr>
- <tr>
- <td width="16%" valign="top" class="vncellreq"><?= gettext("Destination"); ?></td>
- <td width="84%" class="vtable">
- <select name="destination" class="formselect" id="destination">
- <?php
- if (is_array($freenas_config['mounts']['mount'])) {
- foreach ($a_mount as $mountv) {
- echo "<option value=\"{$mountv['sharename']}\"";
- if (strcmp($mountv['sharename'],$pconfig['destination']) == 0)
- echo " selected";
- echo">";
- echo htmlspecialchars($mountv['sharename']);
- echo "</option>";
- }
- }
- else
- echo gettext("You must configure mount point first.");
- ?>
- </select>
- <br />
- <?= gettext("Destination Mount Point."); ?>
- </td>
- </tr>
- <tr>
- <td width="16%" valign="top" class="vncellreq"><?= gettext("RSYNC Options"); ?></td>
- <td width="84%" class="vtable">
- <input name="opt_delete" id="opt_delete" type="checkbox" value="yes" <?php if ($pconfig['opt_delete']) echo "checked=\"checked\""; ?> />
- <?= gettext("Delete files that don't exist on sender."); ?>
- </td>
- </tr>
- <tr>
- <td width="16%" valign="top" class="vncellreq"><?= gettext("Synchronization Time"); ?></td>
- <td width="84%" class="vtable">
- <table width="100%" border="1" cellpadding="4" cellspacing="0">
- <tr>
- <td align="left" valign="top" class="listtopic"><?= gettext("minutes"); ?></td>
- <td align="left" valign="top" class="listtopic"><?= gettext("hours"); ?></td>
- <td align="left" valign="top" class="listtopic"><?= gettext("days"); ?></td>
- <td align="left" valign="top" class="listtopic"><?= gettext("months"); ?></td>
- <td align="left" valign="top" class="listtopic"><?= gettext("week days"); ?></td>
- </tr>
- <tr>
- <td align="left" valign="top" class="vncell" nowrap="nowrap">
- <div id="all_min_rdbtns" style="padding-bottom: 10px;" >
- <input type="radio" name="all_mins" id="all_mins1" value="1"<?php echo $all_mins_all;?> />
- <label for="all_mins1">All</label><br />
- <input type="radio" name="all_mins" id="all_mins2" value="0"<?php echo $all_mins_selected;?> />
- <label for="all_mins2">Selected ...</label>
- </div>
- <div id="all_min_select" style="vertical-align: top;">
- <select multiple="multible" class="formselect" size="24" name="minutes[]" id="minutes1" style="vertical-align: top;">
- <?php
- $i = 0;
- while ($i <= 23){
- if (isset($pconfig['minute'])) {
- if (in_array($i, $pconfig['minute'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $i . "\n";
- $i++;
- }
- ?>
- </select>
- <select multiple="multible" class="formselect" size="24" name="minutes[]" id="minutes2" style="vertical-align: top;">
- <?php
- $i = 24;
- while ($i <= 47) {
- if (isset($pconfig['minute'])) {
- if (in_array($i, $pconfig['minute'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $i . "\n";
- $i++;
- }
- ?>
- </select>
- <select multiple="multible" class="formselect" size="12" name="minutes[]" id="minutes3" style="vertical-align: top;">
- <?php
- $i = 48;
- while ($i <= 59) {
- if (isset($pconfig['minute'])) {
- if (in_array($i, $pconfig['minute'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $i . "\n";
- $i++;
- }
- ?>
- </select>
- </div>
- </td>
- <td align="left" valign="top" class="vncell" nowrap="nowrap">
- <div id="all_hours_rdbtns" style="padding-bottom: 10px;" >
- <input type="radio" name="all_hours" id="all_hours1" value="1"<?php echo $all_hours_all;?> />
- <label for="all_hours1">All</label><br />
- <input type="radio" name="all_hours" id="all_hours2" value="0"<?php echo $all_hours_selected;?> />
- <label for="all_hours2">Selected ...</label>
- </div>
- <div id="all_hours_select" style="vertical-align: top;">
- <select multiple size="24" name="hours[]" id="hours1" style="vertical-align: top;">
- <?php
- $i = 0;
- while ($i <= 23) {
- if (isset($pconfig['hour'])) {
- if (in_array($i, $pconfig['hour'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $i . "\n";
- $i++;
- }
- ?>
- </select>
- </div>
- </td>
- <td align="left" valign="top" class="vncell" nowrap="nowrap">
- <div id="all_days_rdbtns" style="padding-bottom: 10px;" >
- <input type="radio" name="all_days" id="all_days1" value="1" <?php echo $all_days_all;?> />
- <label for="all_days1">All</label><br />
- <input type="radio" name="all_days" id="all_days2" value="0"<?php echo $all_days_selected;?> />
- <label for="all_days2">Selected ...</label>
- </div>
- <div id="all_days_select" style="vertical-align: top;">
- <select multiple size="24" name="days[]" id="days1" style="vertical-align: top;">
- <?php
- $i = 1;
- while ($i <= 24) {
- if (isset($pconfig['day'])) {
- if (in_array($i, $pconfig['day'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $i . "\n";
- $i++;
- }
- ?>
- </select>
- <select multiple size="7" name="days[]" id="days2" style="vertical-align: top;">
- <?php
- $i = 25;
- while ($i <= 31) {
- if (isset($pconfig['day'])) {
- if (in_array($i, $pconfig['day'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $i . "\n";
- $i++;
- }
- ?>
- </select>
- </div>
- </td>
- <td align="left" valign="top" class="vncell">
- <div id="all_months_rdbtns" style="padding-bottom: 10px;" >
- <input type="radio" name="all_months" id="all_months1" value="1"<?php echo $all_months_all;?> />
- <label for="all_months1">All</label><br />
- <input type="radio" name="all_months" id="all_months2" value="0"<?php echo $all_months_selected;?> />
- <label for="all_months2">Selected ...</label>
- </div>
- <div id="all_months_select" style="vertical-align: top;">
- <select multiple size="12" name="months[]" id="months" style="vertical-align: top;">
- <?php
- $i=1;
- foreach ($a_months as $monthv) {
- if (isset($pconfig['month'])) {
- if (in_array($i, $pconfig['month'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $monthv . "\n";
- $i++;
- }
- ?>
- </select>
- </div>
- </td>
- <td align="left" valign="top" class="vncell">
- <div id="all_weekdays_rdbtns" style="padding-bottom: 10px;" >
- <input type="radio" name="all_weekdays" id="all_weekdays1" value="1"<?php echo $all_weekdays_all;?> />
- <label for="all_weekdays1">All</label><br />
- <input type="radio" name="all_weekdays" id="all_weekdays2" value="0"<?php echo $all_weekdays_selected;?> />
- <label for="all_weekdays2">Selected ...</label>
- </div>
- <div id="all_weekdays_select" style="vertical-align: top;">
- <select multiple size="7" name="weekdays[]" id="weekdays" style="vertical-align: top;">
- <?php
- $i=0;
- foreach ($a_weekdays as $weekdayv) {
- if (isset($pconfig['weekday'])){
- if (in_array($i, $pconfig['weekday'])) {
- $is_selected = " selected";
- } else {
- $is_selected = "";
- }
- }
-
- echo "<option value=\"" . $i . "\"" . $is_selected . ">" . $weekdayv . "\n";
- $i++;
- }
- ?>
- </select>
- </div>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top" class="vncell" colspan="5">
- <?= gettext("Note: Ctrl-click (or command-click on the Mac) to select and de-select minutes, hours, days and months."); ?>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="16%" valign="top">&nbsp;</td>
- <td width="84%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- </td>
- </tr>
- </table>
- </form>
- </div>
- </td>
- </tr>
-</table>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-<script type="text/javascript">
-<!--
-enable_change(false);
-//-->
-</script>
-</body>
-</html>
diff --git a/config/archive/freenas/www/services_samba.php b/config/archive/freenas/www/services_samba.php
deleted file mode 100644
index afd90a08..00000000
--- a/config/archive/freenas/www/services_samba.php
+++ /dev/null
@@ -1,431 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- services_samba.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Services"),
- gettext("CIFS"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['samba']))
-{
- $freenas_config['samba'] = array();
-}
-
-if (!is_array($freenas_config['mounts']['mount']))
- $freenas_config['mounts']['mount'] = array();
-
-mount_sort();
-
-$a_mount = &$freenas_config['mounts']['mount'];
-
-$pconfig['netbiosname'] = $freenas_config['samba']['netbiosname'];
-$pconfig['workgroup'] = $freenas_config['samba']['workgroup'];
-$pconfig['serverdesc'] = $freenas_config['samba']['serverdesc'];
-$pconfig['security'] = $freenas_config['samba']['security'];
-$pconfig['localmaster'] = $freenas_config['samba']['localmaster'];
-$pconfig['winssrv'] = $freenas_config['samba']['winssrv'];
-/* $pconfig['hidemount'] = $freenas_config['samba']['hidemount']; */
-$pconfig['timesrv'] = $freenas_config['samba']['timesrv'];
-$pconfig['unixcharset'] = $freenas_config['samba']['unixcharset'];
-$pconfig['doscharset'] = $freenas_config['samba']['doscharset'];
-$pconfig['loglevel'] = $freenas_config['samba']['loglevel'];
-$pconfig['sndbuf'] = $freenas_config['samba']['sndbuf'];
-$pconfig['rcvbuf'] = $freenas_config['samba']['rcvbuf'];
-$pconfig['enable'] = isset($freenas_config['samba']['enable']);
-$pconfig['recyclebin'] = isset($freenas_config['samba']['recyclebin']);
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- if ($_POST['enable']) {
- $reqdfields = array_merge($reqdfields, explode(" ", "netbiosname workgroup security localmaster"));
- $reqdfieldsn = array_merge($reqdfieldsn, explode(",", "Netbiosname,Workgroup,Security, Localmaster"));
- }
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (($_POST['netbiosname'] && !is_domain($_POST['netbiosname']))) {
- $error_bucket[] = array("error" => gettext("The Netbios name contains invalid characters."),
- "field" => "netbiosname");
- }
- if (($_POST['workgroup'] && !is_domain($_POST['workgroup']))) {
- $error_bucket[] = array("error" => gettext("The Workgroup name contains invalid characters."),
- "field" => "workgroup");
- }
- if (($_POST['winssrv'] && !is_ipaddr($_POST['winssrv']))) {
- $error_bucket[] = array("error" => gettext("The WINS server must be an IP address."),
- "field" => "winssrv");
- }
-
- if (!is_numericint($_POST['sndbuf'])) {
- $error_bucket[] = array("error" => gettext("PediaXThe SND Buffer value must be a number."),
- "field" => "sndbuf");
- }
-
- if (!is_numericint($_POST['rcvbuf'])) {
- $error_bucket[] = array("error" => gettext("The RCV Buffer value must be a number."),
- "field" => "rcvbuf");
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $freenas_config['samba']['netbiosname'] = $_POST['netbiosname'];
- $freenas_config['samba']['workgroup'] = $_POST['workgroup'];
- $freenas_config['samba']['serverdesc'] = $_POST['serverdesc'];
- $freenas_config['samba']['security'] = $_POST['security'];
- $freenas_config['samba']['localmaster'] = $_POST['localmaster'];
- $freenas_config['samba']['winssrv'] = $_POST['winssrv'];
- /* $freenas_config['samba']['hidemount'] = $_POST['hidemount']; */
- $freenas_config['samba']['timesrv'] = $_POST['timesrv'];
- $freenas_config['samba']['doscharset'] = $_POST['doscharset'];
- $freenas_config['samba']['unixcharset'] = $_POST['unixcharset'];
- $freenas_config['samba']['loglevel'] = $_POST['loglevel'];
- $freenas_config['samba']['sndbuf'] = $_POST['sndbuf'];
- $freenas_config['samba']['rcvbuf'] = $_POST['rcvbuf'];
- $freenas_config['samba']['recyclebin'] = $_POST['recyclebin'] ? true : false;
- $freenas_config['samba']['enable'] = $_POST['enable'] ? true : false;
-
- write_config();
-
- $retval = 0;
- if (!file_exists($d_sysrebootreqd_path)) {
- /* nuke the cache file */
- config_lock();
- services_samba_configure();
- services_zeroconf_configure();
- config_unlock();
- }
- $savemsg = get_std_save_message($retval);
- }
-}
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-$jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-function enable_change(enable_change) {
- var endis;
-
- endis = !(document.iform.enable.checked || enable_change);
- endis ? color = '#D4D0C8' : color = '#FFFFFF';
-
- document.iform.netbiosname.disabled = endis;
- document.iform.workgroup.disabled = endis;
- document.iform.localmaster.disabled = endis;
- document.iform.winssrv.disabled = endis;
- document.iform.timesrv.disabled = endis;
- document.iform.serverdesc.disabled = endis;
- document.iform.doscharset.disabled = endis;
- document.iform.unixcharset.disabled = endis;
- document.iform.loglevel.disabled = endis;
- document.iform.sndbuf.disabled = endis;
- document.iform.rcvbuf.disabled = endis;
- document.iform.recyclebin.disabled = endis;
- document.iform.security.disabled = endis;
- /* color adjustments */
- document.iform.netbiosname.style.backgroundColor = color;
- document.iform.workgroup.style.backgroundColor = color;
- document.iform.localmaster.style.backgroundColor = color;
- document.iform.winssrv.style.backgroundColor = color;
- document.iform.timesrv.style.backgroundColor = color;
- document.iform.serverdesc.style.backgroundColor = color;
- document.iform.doscharset.style.backgroundColor = color;
- document.iform.unixcharset.style.backgroundColor = color;
- document.iform.loglevel.style.backgroundColor = color;
- document.iform.sndbuf.style.backgroundColor = color;
- document.iform.rcvbuf.style.backgroundColor = color;
- document.iform.recyclebin.style.backgroundColor = color;
- document.iform.security.style.backgroundColor = color;
-}
-//-->
-</script>
-
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<form id="iform" name="iform" action="services_samba.php" method="post">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<div id="inputerrors"></div>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Settings"), true, "services_samba.php");
- $tab_array[1] = array(gettext("Shares"), false, "services_samba_share.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" valign="middle" class="listtopic" colspan="2">
- <span style="vertical-align: middle; position: relative; left: 0px;"><?=gettext("CIFS share");?></span>
- <span style="vertical-align: middle; position: relative; left: 84%;">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onClick="enable_change(false)" />&nbsp;<?= gettext("Enable"); ?>
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Authentication");?></td>
- <td width="78%" class="vtable">
- <select name="security" class="formselect" id="security">
- <?php
- $types = explode(",", "Anonymous,Local User,Domain");
- $vals = explode(" ", "share user domain");
- $j = 0;
-
- for ($j = 0; $j < count($vals); $j++):
- ?>
- <option value="<?=$vals[$j];?>" <?php if ($vals[$j] == $pconfig['security']) echo "selected=\"selected\"";?>>
- <?=htmlspecialchars($types[$j]);?>
- </option>
- <?php endfor; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("NetBios name");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="netbiosname" type="text" class="formfld unknown" id="netbiosname" size="20" value="<?=htmlspecialchars($pconfig['netbiosname']);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Workgroup");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="workgroup" type="text" class="formfld unknown" id="workgroup" size="20" value="<?=htmlspecialchars($pconfig['workgroup']);?>" />
- <br />
- <?= gettext("Workgroup to be member of.");?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="serverdesc" type="text" class="formfld unknown" id="serverdesc" size="30" value="<?=htmlspecialchars($pconfig['serverdesc']);?>" />
- <br />
- <?= gettext("Server description. This can usually be left blank.");?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Dos charset");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <select name="doscharset" class="formselect" id="doscharset">
- <?php
- $types = explode(",", "CP850,CP852,CP437,ASCII");
- $vals = explode(" ", "CP850 CP852 CP437 ASCII");
- $j = 0;
-
- for ($j = 0; $j < count($vals); $j++):
- ?>
- <option value="<?=$vals[$j];?>" <?php if ($vals[$j] == $pconfig['doscharset']) echo "selected=\"selected\"";?>>
- <?=htmlspecialchars($types[$j]);?>
- </option>
- <?php endfor; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Unix charset");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <select name="unixcharset" class="formselect" id="unixcharset">
- <?php
- $types = explode(",", "UTF-8,iso-8859-1,iso-8859-15,gb2312,ASCII");
- $vals = explode(" ", "UTF-8 iso-8859-1 iso-8859-15 gb2312 ASCII");
- $j = 0;
-
- for ($j = 0; $j < count($vals); $j++):
- ?>
- <option value="<?=$vals[$j];?>" <?php if ($vals[$j] == $pconfig['unixcharset']) echo "selected=\"selected\"";?>>
- <?=htmlspecialchars($types[$j]);?>
- </option>
- <?php endfor; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Log level");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <select name="loglevel" class="formselect" id="loglevel">
- <?php
- $types = explode(",", "Minimum,Normal,Full,Debug");
- $vals = explode(" ", "1 2 3 10");
- $j = 0;
-
- for ($j = 0; $j < count($vals); $j++):
- ?>
- <option value="<?=$vals[$j];?>" <?php if ($vals[$j] == $pconfig['loglevel']) echo "selected=\"selected\"";?>>
- <?=htmlspecialchars($types[$j]);?>
- </option>
- <?php endfor; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Local Master Browser");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <select name="localmaster" class="formselect" id="localmaster">
- <?php
- $types = explode(",", "Yes,No");
- $vals = explode(" ", "yes no");
- $j = 0;
-
- for ($j = 0; $j < count($vals); $j++):
- ?>
- <option value="<?=$vals[$j];?>" <?php if ($vals[$j] == $pconfig['localmaster']) echo "selected=\"selected\"";?>>
- <?=htmlspecialchars($types[$j]);?>
- </option>
- <?php endfor; ?>
- </select>
- <br />
- <?= gettext("Allows FreeNAS to try and become a local master browser."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Time Server");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <select name="timesrv" class="formselect" id="timesrv">
- <?php
- $types = explode(",", "Yes,No");
- $vals = explode(" ", "yes no");
- $j = 0;
-
- for ($j = 0; $j < count($vals); $j++):
- ?>
- <option value="<?=$vals[$j];?>" <?php if ($vals[$j] == $pconfig['timesrv']) echo "selected=\"selected\"";?>>
- <?=htmlspecialchars($types[$j]);?>
- </option>
- <?php endfor; ?>
- </select>
- <br />
- <?= gettext("FreeNAS advertises itself as a time server to Windows clients."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("WINS server");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="winssrv" type="text" class="formfld host" id="winssrv" size="30" value="<?=htmlspecialchars($pconfig['winssrv']);?>" />
- <br />
- <?= gettext("WINS Server IP address."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Recycle Bin");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="recyclebin" type="checkbox" id="recyclebin" value="yes" <?php if ($pconfig['recyclebin']) echo "checked=\"checked\""; ?> />
- <?= gettext("Enable Recycle bin"); ?><br />
- <?= gettext("This will create a recycle bin on the CIFS shares"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Send Buffer Size");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="sndbuf" type="text" class="formfld unknown" id="sndbuf" size="30" value="<?=htmlspecialchars($pconfig['sndbuf']);?>" />
- <br />
- <?= gettext("Size of send buffer (16384 by default)."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Receive Buffer Size");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="rcvbuf" type="text" class="formfld unknown" id="rcvbuf" size="30" value="<?=htmlspecialchars($pconfig['rcvbuf']);?>" />
- <br />
- <?= gettext("Size of receive buffer (16384 by default)."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-<script type="text/javascript">
-<!--
-enable_change(false);
-//-->
-</script>
-</body>
-</html>
diff --git a/config/archive/freenas/www/services_samba_share.php b/config/archive/freenas/www/services_samba_share.php
deleted file mode 100644
index 1545df97..00000000
--- a/config/archive/freenas/www/services_samba_share.php
+++ /dev/null
@@ -1,165 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- services_samba_share.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Services"),
- gettext("CIFS"),
- gettext("Shares"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['mounts']['mount']))
- $freenas_config['mounts']['mount'] = array();
-
-mount_sort();
-
-$a_mount = &$freenas_config['mounts']['mount'];
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- $pconfig = $_POST;
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- if($_POST['apply']) {
- $retval = 0;
- if(!file_exists($d_sysrebootreqd_path)) {
- config_lock();
- services_samba_configure();
- services_zeroconf_configure();
- config_unlock();
- }
-
- $savemsg = get_std_save_message($retval);
-
- if(0 == $retval) {
- if(file_exists($d_smbshareconfdirty_path))
- unlink($d_smbshareconfdirty_path);
- }
- }
- }
-}
-
-if($_GET['act'] == "ret") {
- pfSenseHeader("services_samba_share.php");
- exit;
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<form id="iform" name="iform" action="services_samba_share.php" method="post">
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<?php if (file_exists($d_smbshareconfdirty_path)): ?>
-<?php print_info_box_np(gettext("The shares has been modified.") . "<br />" .
- gettext("You must apply the changes in order for them to take effect."));?>
-<?php endif; ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<div id="inputerrors"></div>
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array(gettext("Settings"), false, "services_samba.php");
- $tab_array[1] = array(gettext("Shares"), true, "services_samba_share.php");
- display_top_tabs($tab_array);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="20%" class="listhdrr"><?= gettext("Share Name"); ?></td>
- <td width="25%" class="listhdrr"><?= gettext("Description"); ?></td>
- <td width="20%" class="listhdrr"><?= gettext("Browseable"); ?></td>
- <td width="10%" class="list"></td>
- </tr>
- <?php $i = 0; foreach($a_mount as $mountv): ?>
- <tr>
- <td class="listr"><?=htmlspecialchars($mountv['sharename']);?></td>
- <td class="listr"><?=htmlspecialchars($mountv['desc']);?></td>
- <td class="listbg"><?=htmlspecialchars((is_array($freenas_config['samba']['hidemount']) && in_array($mountv['sharename'],$freenas_config['samba']['hidemount']))? gettext("No") : gettext("Yes"));?></td>
- <td valign="middle" nowrap class="list">
- <?php if(isset($freenas_config['samba']['enable']))
- echo("<a href='services_samba_share_edit.php?id={$i}'><img src='./themes/" . $g['theme'] . "/images/icons/icon_e.gif' title='" . gettext("Edit Share") . "' width='17' height='17' border='0'></a>");
- ?>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- </table>
- </div>
- </td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/services_samba_share_edit.php b/config/archive/freenas/www/services_samba_share_edit.php
deleted file mode 100644
index d417fa4c..00000000
--- a/config/archive/freenas/www/services_samba_share_edit.php
+++ /dev/null
@@ -1,157 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- services_samba_share_edit.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Services"),
- gettext("CIFS"),
- gettext("Shares"),
- gettext("Edit"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-$id = $_GET['id'];
-if (isset($_POST['id']))
- $id = $_POST['id'];
-
-if (!is_array($freenas_config['mounts']['mount']))
- $freenas_config['mounts']['mount'] = array();
-
-mount_sort();
-
-if(!is_array($freenas_config['samba']['hidemount']))
- $freenas_config['samba']['hidemount'] = array();
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- /* TODO: This logic needs to be tested! */
- if($_POST['browseable'] == gettext("No")) {
- $freenas_config['samba']['hidemount'] = array_merge($freenas_config['samba']['hidemount'],array($freenas_config['mounts']['mount'][$id]['sharename']));
- } else {
- if(is_array($freenas_config['samba']['hidemount']) && in_array($freenas_config['mounts']['mount'][$id]['sharename'],$freenas_config['samba']['hidemount'])) {
- $freenas_config['samba']['hidemount'] = array_diff($freenas_config['samba']['hidemount'],array($freenas_config['mounts']['mount'][$id]['sharename']));
- }
- }
-
- touch($d_smbshareconfdirty_path);
- write_config();
- pfSenseHeader("services_samba_share.php");
- exit;
- }
-}
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
- <div id="inputerrors"></div>
- <form id="iform" name="iform" action="services_samba_share_edit.php" method="post">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Share Name"); ?></td>
- <td width="78%" class="vtable">
- <input type="text" class="formfld file" size="30" value="<?=htmlspecialchars($freenas_config['mounts']['mount'][$id]['sharename']);?>" disabled="disabled" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?= gettext("Description"); ?></td>
- <td width="78%" class="vtable">
- <input type="text" class="formfld unknown" size="30" value="<?=htmlspecialchars($freenas_config['mounts']['mount'][$id]['desc']);?>" disabled="disabled">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?= gettext("Browseable"); ?></td>
- <td width="78%" class="vtable">
- <select name="browseable" class="formselect" id="browseable">
- <?php
- $text = array(gettext("Yes"),gettext("No"));
- $vals = explode(" ","1 0"); $j = 0;
- for($j = 0; $j < count($vals); $j++):
- ?>
- <option value="<?=$vals[$j];?>" <?php if(is_array($freenas_config['samba']['hidemount']) && in_array($freenas_config['mounts']['mount'][$id]['sharename'],$freenas_config['samba']['hidemount'])) echo "selected=\"selected\"";?>>
- <?=htmlspecialchars($text[$j]);?>
- </option>
- <?php endfor;?>
- </select>
- <br><?= gettext("This controls whether this share is seen in the list of available shares in a net view and in the browse list."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%"> <input name="Submit" type="submit" class="formbtn" value="<?= gettext("Save"); ?>">
- <?php if(isset($id)): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- </td>
- </tr>
- </table>
- </form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-</body>
-</html>
diff --git a/config/archive/freenas/www/services_unison.php b/config/archive/freenas/www/services_unison.php
deleted file mode 100644
index eec58865..00000000
--- a/config/archive/freenas/www/services_unison.php
+++ /dev/null
@@ -1,249 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- services_unison.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-/*
- *************************
-
- Unison Installation Notes
-
- To work, unison requires an environment variable UNISON to point at
- a writable directory. Unison keeps information there between syncs to
- speed up the process.
-
- When a user runs the unison client, it will try to invoke ssh to
- connect to the this server. Giving the local ssh a UNISON environment
- variable without compromising ssh turned out to be non-trivial.
- The solution is to modify the default path found in /etc/login.conf.
- The path is seeded with "UNISON=/mnt" and this updated by the
- /etc/inc/services.inc file.
-
- Todo:
- * Arguably, a full client install could be done too to
- allow FreeNAS to FreeNAS syncing.
-
- *************************
-*/
-
-$pgtitle = array(gettext("Services"),
- gettext("Unison"));
-
-require_once("freenas_config.inc");
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['unison'])) {
- $freenas_config['unison'] = array();
-}
-
-$pconfig['enable'] = isset($freenas_config['unison']['enable']);
-$pconfig['share'] = $freenas_config['unison']['share'];
-$pconfig['workdir'] = isset($freenas_config['unison']['workdir']);
-$pconfig['makedir'] = isset($freenas_config['unison']['makedir']);
-
-if (! empty($_POST))
-{
- /* hash */
- unset($error_bucket);
- /* simple error list */
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = split(" ", "share workdir");
- $reqdfieldsn = split(",", "Share,Working Directory");
-
- do_input_validation_new($_POST, $reqdfields, $reqdfieldsn, &$error_bucket);
-
- $fullpath = "/mnt/{$_POST['share']}/{$_POST['workdir']}";
-
- if (!$_POST['makedir'] && ($fullpath) && (!file_exists($fullpath))) {
- $error_bucket[] = array("error" => gettext("The combination of share and working directory does not exist."),
- "field" => "workdir");
- }
-
- if (is_array($error_bucket))
- foreach($error_bucket as $elem)
- $input_errors[] =& $elem["error"];
-
- /* if this is an AJAX caller then handle via JSON */
- if(isAjax() && is_array($error_bucket)) {
- input_errors2Ajax(NULL, $error_bucket);
- exit;
- }
-
- if (!$input_errors)
- {
- $freenas_config['unison']['share'] = $_POST['share'];
- $freenas_config['unison']['workdir'] = $_POST['workdir'];
- $freenas_config['unison']['enable'] = $_POST['enable'] ? true : false;
- $freenas_config['unison']['makedir'] = $_POST['makedir'] ? true : false;
-
- write_config();
-
- $retval = 0;
- if (!file_exists($d_sysrebootreqd_path))
- {
- /* nuke the cache file */
- config_lock();
- services_unison_configure();
- /* services_zeroconf_configure(); */
- config_unlock();
- }
-
- $savemsg = get_std_save_message($retval);
- }
-}
-
-/* retrieve mounts to build list of share names */
-if (!is_array($freenas_config['mounts']['mount']))
- $freenas_config['mounts']['mount'] = array();
-
-mount_sort();
-
-$a_mount = &$freenas_config['mounts']['mount'];
-
-/* if ajax is calling, give them an update message */
-if(isAjax())
- print_info_box_np($savemsg);
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-
-$jscriptstr = <<<EOD
-<script type="text/javascript">
-<!--
-function enable_change(enable_change) {
- var endis;
-
- endis = !(document.iform.enable.checked || enable_change);
- endis ? color = '#D4D0C8' : color = '#FFFFFF';
-
- document.iform.share.disabled = endis;
- document.iform.workdir.disabled = endis;
- document.iform.makedir.disabled = endis;
- /* color adjustments */
- document.iform.share.style.backgroundColor = color;
- document.iform.workdir.style.backgroundColor = color;
- document.iform.makedir.style.backgroundColor = color;
-}
-//-->
-</script>
-
-EOD;
-
-$pfSenseHead->addScript($jscriptstr);
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
- <div id="inputerrors"></div>
- <form id="iform" name="iform" action="services_unison.php" method="post">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100%" valign="middle" class="listtopic" colspan="2">
- <span style="vertical-align: middle; position: relative; left: 0px;"><?=gettext("Unison File Synchronisation");?></span>
- <span style="vertical-align: middle; position: relative; left: 72%;">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onClick="enable_change(false)" />&nbsp;<?= gettext("Enable"); ?>
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Share");?></td>
- <td width="78%" class="vtable">
- <select name="share" class="formselect" id="share">
- <?php foreach ($a_mount as $mount): $tmp=$mount['sharename']; ?>
- <option value="<?=$tmp;?>"
- <?php if ($tmp == $pconfig['share']) echo "selected=\"selected\"";?>><?=$tmp?></option>
- <?php endforeach; ?>
- </select>
- <br />
- <?= gettext("You may need enough space to duplicate all files being synced."); ?>.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Working Directory");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="workdir" type="text" class="formfld file" id="workdir" size="20" value="<?=htmlspecialchars($pconfig['workdir']);?>" />
- <?= gettext("Where the working files will be stored"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Create");?></td>
- <td width="78%" class="vtable" align="left" valign="middle">
- <input name="makedir" type="checkbox" id="makedir" value="yes" <?php if ($pconfig['makedir']) echo "checked=\"checked\""; ?> />
- <?= gettext("Create work directory if it doesn't exist"); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <span class="red">
- <strong><?= gettext("Note"); ?>:</strong>
- </span>
- <br />
- <?= gettext("<a href='/system_advanced.php'>SSHD</a> must be enabled for Unison to work, and the <a href='/system_usermanager.php'>user</a> must have Full Shell enabled."); ?>
- </td>
- </tr>
- </table>
- </form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-<script type="text/javascript">
-<!--
-enable_change(false);
-//-->
-</script>
-</body>
-</html>
diff --git a/config/archive/freenas/www/status_disks.php b/config/archive/freenas/www/status_disks.php
deleted file mode 100644
index 704bc467..00000000
--- a/config/archive/freenas/www/status_disks.php
+++ /dev/null
@@ -1,127 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- status_disks.php
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on FreeNAS (http://www.freenas.org)
- Copyright (C) 2005-2006 Olivier Cochard-Labbé <olivier@freenas.org>.
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-$pgtitle = array(gettext("Status"),
- gettext("Disks"));
-
-require_once("guiconfig.inc");
-require_once("freenas_guiconfig.inc");
-require_once("freenas_functions.inc");
-
-if (!is_array($freenas_config['disks']['disk']))
- $freenas_config['disks']['disk'] = array();
-
-disks_sort();
-
-$raidstatus=get_sraid_disks_list();
-
-$a_disk_conf = &$freenas_config['disks']['disk'];
-
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
- <div id="inputerrors"></div>
- <form id="iform" name="iform" action="status_disks.php" method="post">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="5%" class="listhdrr">Disk</td>
- <td width="5%" class="listhdrr">Size</td>
- <td width="60%" class="listhdrr">Description</td>
- <td width="10%" class="listhdr">Status</td>
- </tr>
- <?php foreach ($a_disk_conf as $disk): ?>
- <tr>
- <td class="listr">
- <?=htmlspecialchars($disk['name']);?>
- </td>
- <td class="listr">
- <?=htmlspecialchars($disk['size']);?>
- </td>
- <td class="listr">
- <?=htmlspecialchars($disk['desc']);?>&nbsp;
- </td>
- <td class="listr">
- <?php
- $stat=disks_status($disk);
- echo $stat;?>&nbsp;
- </td>
- </tr>
- <?php endforeach; ?>
- <?php if (isset($raidstatus)): ?>
- <?php foreach ($raidstatus as $diskk => $diskv): ?>
- <tr>
- <td class="listr">
- <?=htmlspecialchars($diskk);?>
- </td>
- <td class="listr">
- <?=htmlspecialchars($diskv['size']);?>
- </td>
- <td class="listr">
-
- <?=htmlspecialchars("Software RAID volume");?>&nbsp;
- </td>
- <td class="listr">
- <?=htmlspecialchars($diskv['desc']);?>&nbsp;
- </td>
- </tr>
- <?php endforeach; ?>
- <?php endif; ?>
- </table>
- </form>
-<?php include("fend.inc"); ?>
-<?= checkForInputErrors(); ?>
-<script type="text/javascript">
-<!--
-// enable_change(false);
-//-->
-</script>
-</body>
-</html>
diff --git a/config/archive/frickin/bin/frickin b/config/archive/frickin/bin/frickin
deleted file mode 100755
index 450dd733..00000000
--- a/config/archive/frickin/bin/frickin
+++ /dev/null
Binary files differ
diff --git a/config/archive/frickin/bin/frickin2 b/config/archive/frickin/bin/frickin2
deleted file mode 100755
index 8bc99bb9..00000000
--- a/config/archive/frickin/bin/frickin2
+++ /dev/null
Binary files differ
diff --git a/config/archive/frickin/frickin.inc b/config/archive/frickin/frickin.inc
deleted file mode 100644
index 762cc300..00000000
--- a/config/archive/frickin/frickin.inc
+++ /dev/null
@@ -1,147 +0,0 @@
-<?php
-
-/* $Id$ */
-/*
- frickin.inc
- Copyright (C) 2006 Scott Ullrich
- part of pfSense
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-if(!function_exists("filter_configure"))
- require_once("filter.inc");
-
-function frickin_custom_php_install_command() {
- global $config;
- conf_mount_rw();
- if(file_exists("/tmp/frickin2")) {
- exec("mv /tmp/frickin2 /usr/local/sbin/");
- exec("chmod 0555 /usr/local/sbin/frickin2");
- }
- $fout = fopen("/usr/local/etc/rc.d/frickin.sh", "w");
- fwrite($fout, "#!/bin/sh\n# This package was automatically generated\n# by the pfSense package system.\n\n");
- fwrite($fout, "# PACKAGE: Frickin Proxy\n");
- fwrite($fout, "# EXECUTABLE: frickin\n");
- fwrite($fout, "/usr/local/sbin/frickin2");
- fwrite($fout, " -c /usr/local/etc/frickin.conf");
- fwrite($fout, " &\n");
- fclose($fout);
-
- $fout = fopen("/usr/local/etc/frickin.conf", "w");
- $frickin_conf = <<<EOD
-
-proxy {
- user = "nobody";
- group = "nobody";
- client {
- queue = 5; # Maximum connection queue size
- max = 100; # Maximum number of concurrent clients
- multiple = FALSE; # Allow multiple connections from same ip
- }
- session {
- connect = 15; # Connect timout (seconds)
- idle = 60; # Idle timeout (seconds)
- }
-}
-
-listeners {
- default {
- name = "Frickin PPTP Proxy";
- vendor = "Placid Development";
- ip = "127.0.0.1";
- port = 1723;
- }
-}
-
-EOD;
-
- fwrite($fout, "{$frickin_conf}");
- fclose($fout);
-
- mwexec("/usr/bin/killall frickin");
- mwexec("chmod a+rx /usr/local/etc/rc.d/frickin.sh");
- mwexec_bg("/usr/local/etc/rc.d/frickin.sh");
-
-// file_notice("System -> Advanced -> Scrub", "pfSenses scrub option has been disabled. See http://www.openbsd.org/faq/pf/scrub.html for more info.", "Scrub");
-// $config['system']['scrubnodf'] = "enabled";
-// write_config();
-
- conf_mount_ro();
- filter_configure();
-}
-
-function frickin_custom_php_deinstall_command() {
- global $config;
-
-// unset($config['system']['scrubnodf']);
-// file_notice("System -> Advanced -> Scrub", "pfSenses scrub option has been enabled. See http://www.openbsd.org/faq/pf/scrub.html for more info.", "Scrub");
-// write_config();
-
- unlink_if_exists("/usr/local/etc/rc.d/frickin.sh");
- unlink_if_exists("/usr/local/bin/frickin");
-
- mwexec("killall frickin");
-
- filter_configure();
-}
-
-function frickin_generate_rules($type) {
- global $config;
-
- $rules = "";
-
- $frickin_conf = $config['installedpackages']['frickin']['config'][0];
- if (!is_process_running('frickin')) {
- log_error("Frickin is installed but not started. Not installing redirect rules.");
- return;
- }
-
- $ifaces = explode(',', $frickin_conf['active_interface']);
- $ifaces = array_map('convert_friendly_interface_to_real_interface_name', $ifaces);
-
- switch($type) {
- case 'nat':
- foreach ($ifaces as $iface) {
- if(!$iface) {
- //log_error("Not installing frickin pptp proxy rule. Please set it up");
- //continue;
- }
- $rules .= "rdr on $iface proto tcp from any to any port = 1723 -> 127.0.0.1\n";
- $rules .= "rdr on $iface inet proto gre all -> 127.0.0.1\n";
- }
- break;
- case 'filter':
- case 'rule':
- $ext_if = get_real_wan_interface();
- $rules .= "pass out on $ext_if proto gre from any to any keep state\n";
- $rules .= "pass in on $ext_if proto gre from any to any keep state\n";
- break;
- default:
- break;
- }
-
- return $rules;
-}
-
-?>
diff --git a/config/archive/frickin/frickin.xml b/config/archive/frickin/frickin.xml
deleted file mode 100644
index 51e4c0b6..00000000
--- a/config/archive/frickin/frickin.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>frickin</name>
- <version>2.0-BETA1</version>
- <title>Frickin PPTP Proxy</title>
- <include_file>/usr/local/pkg/frickin.inc</include_file>
- <menu>
- <name>Frickin PPTP</name>
- <tooltiptext>Setup Frickin PPTP Proxy specific settings</tooltiptext>
- <section>Services</section>
- <url>/pkg_edit.php?xml=frickin.xml&amp;id=0</url>
- </menu>
- <configpath>installedpackages->package->frickin->configuration->settings</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/frickin/frickin.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/frickin/bin/frickin2</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Proxy interface</fielddescr>
- <fieldname>active_interface</fieldname>
- <description>The interface(s) the proxy server will bind to.</description>
- <type>interfaces_selection</type>
- <required/>
- <default_value>lan</default_value>
- <multiple/>
- </field>
- </fields>
- <custom_add_php_command>
- frickin_custom_php_install_command();
- </custom_add_php_command>
- <custom_php_install_command>
- frickin_custom_php_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- frickin_custom_php_deinstall_command();
- </custom_php_deinstall_command>
- <filter_rules_needed>frickin_generate_rules</filter_rules_needed>
-</packagegui>
diff --git a/config/archive/jail_template.xml b/config/archive/jail_template.xml
deleted file mode 100644
index fc6b2502..00000000
--- a/config/archive/jail_template.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <description>Basic jail template</description>
- <requirements>Disk space...</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>jail_template</name>
- <version>0.1</version>
- <title>Jail template</title>
- <!-- configpath gets expanded out automatically and config items will be
- stored in that location -->
- <configpath>['installedpackages']['$packagename']['config']</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/jail_template/jail_template.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/jail_template/jail_template.img.uzip</item>
- </additional_files_needed>
-
- <include_file>/usr/local/pkg/jail_template.inc</include_file>
- <custom_php_install_command>
- jail_template_install();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- jail_template_deinstall();
- </custom_php_deinstall_command>
- <custom_php_resync_config_command>
- jail_template_resync();
- </custom_php_resync_config_command>
-</packagegui>
-
diff --git a/config/archive/jail_template/jail_template.img.uzip b/config/archive/jail_template/jail_template.img.uzip
deleted file mode 100644
index 1c92fb90..00000000
--- a/config/archive/jail_template/jail_template.img.uzip
+++ /dev/null
Binary files differ
diff --git a/config/archive/jail_template/jail_template.inc b/config/archive/jail_template/jail_template.inc
deleted file mode 100644
index f9c00b79..00000000
--- a/config/archive/jail_template/jail_template.inc
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-function jail_template_install() {
- exec('mkdir /usr/jail_template');
- ## exec('tar -C /usr/jail_template -yxf /tmp/jail_template.tar.bz2 2&gt;&amp;1 &amp;');
- $_rcfile['file']='000.jail_template.sh';
- $_rcfile['start']='';
- $_rcfile['stop']='';
- $_rcfile['start'].='mount -o ro /dev/`mdconfig -af /usr/jail_template.img.uzip`.uzip /usr/jail_template '."\n\t";
- $_rcfile['stop'].='umount -f /usr/jail_template '."\n\t";
- $_rcfile['stop'].='mdconfig -d -u `expr "$(mdconfig -l -v | grep jail_template | grep -v grep)" : "md\([0-9]*\)"` '."\n\t";
- write_rcfile($_rcfile);
- exec('mount -o ro /dev/`mdconfig -af /usr/jail_template.img.uzip`.uzip /usr/jail_template');
-
- $GLOBALS['config']['installedpackages']['pfjailctltemplates']['config'][0]['templates']['jail_template']['name']=
- 'pfSense default jail template';
- $GLOBALS['config']['installedpackages']['pfjailctltemplates']['config'][0]['templates']['jail_template']['path']=
- '/usr/jail_template';
-}
-
-function jail_template_deinstall() {
- exec('umount -f /usr/jail_template');
- exec('mdconfig -d -u `expr "$(mdconfig -l -v | grep jail_template | grep -v grep)" : "md\([0-9]*\)');
- unset($GLOBALS['config']['installedpackages']['pfjailctltemplates']['config'][0]['templates']['jail_template']);
-}
-
-function jail_template_resync() {
- $GLOBALS['config']['installedpackages']['pfjailctltemplates']['config'][0]['templates']['jail_template']['name']=
- 'pfSense default jail template';
- $GLOBALS['config']['installedpackages']['pfjailctltemplates']['config'][0]['templates']['jail_template']['path']=
- '/usr/jail_template';
-}
-?> \ No newline at end of file
diff --git a/config/archive/jailctl.xml b/config/archive/jailctl.xml
deleted file mode 100644
index ab6cf1e3..00000000
--- a/config/archive/jailctl.xml
+++ /dev/null
@@ -1,233 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <description>Jail management</description>
- <requirements>Disk space...</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>pfJailctl</name>
- <version>0.1</version>
- <title>Jails</title>
- <!-- Menu is where this packages menu will appear -->
- <menu>
- <name>Jails</name>
- <tooltiptext>Jail management</tooltiptext>
- <section>Services</section>
- <configfile>jailctl.xml</configfile>
- </menu>
- <service>
- <name>Jails</name>
- <rcfile>jails.sh</rcfile>
- <description>All jails with autostart enabled.</description>
- <custom_php_service_status_command>
- include("/usr/local/pkg/jailctl.inc");
- jailctl_servicestatus();
- </custom_php_service_status_command>
- </service>
- <!-- configpath gets expanded out automatically and config items will be
- stored in that location -->
- <configpath>['installedpackages']['$packagename']['config']</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/jailctl_defaults.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/jailctl_settings.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/jailctl.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/jailctl-utils.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/jailctl_list.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/sbin/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/jailctl</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/sbin/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/sysinstall</item>
- </additional_files_needed>
-
- <tabs>
- <tab>
- <text>Jails</text>
- <url>/pkg.php?xml=jailctl.xml</url>
- <active/>
- </tab>
- <tab>
- <text>Global settings</text>
- <url>/pkg_edit.php?xml=jailctl_settings.xml&amp;id=0</url>
- </tab>
-<!-- <tab>
- <text>Jail defaults</text>
- <url>/pkg_edit.php?xml=jailctl_defaults.xml&amp;id=0</url>
- </tab> -->
- </tabs>
-
-
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>State</fielddescr>
- <fieldname>jstate</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Jail name</fielddescr>
- <fieldname>jname</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Jail IF</fielddescr>
- <fieldname>jifdesc</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Jail IP</fielddescr>
- <fieldname>jip</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Jail path</fielddescr>
- <fieldname>jpath</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Actions</fielddescr>
- <fieldname>jactions</fieldname>
- </columnitem>
-
- </adddeleteeditpagefields>
-
- <fields>
- <field>
- <fielddescr>Jail hostname</fielddescr>
- <fieldname>jname</fieldname>
- <description>FQDN of the jail</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Network interface</fielddescr>
- <fieldname>jif</fieldname>
- <description>Jail will be bound to this interface</description>
- <type>interfaces_selection</type>
- </field>
- <field>
- <fielddescr>IP address</fielddescr>
- <fieldname>jip</fieldname>
- <description>Must be in the same subnet as the parent interface</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Autostart jail on boot?</fielddescr>
- <fieldname>jautostart</fieldname>
- <description>Start this jail automatically when the system boots?</description>
- <type>checkbox</type>
- </field>
-
-
- <field>
- <fielddescr>Jail templates</fielddescr>
- <fieldname>jselect_templates</fieldname>
- <type>listtopic</type>
- <name>Select a predefined template for your jail:</name>
- </field>
- <field>
- <fielddescr>Templates</fielddescr>
- <fieldname>jtemplates</fieldname>
- <description>Files from the templates will be read-only inside the jail.</description>
- <type>select</type>
- <options>
- <option><name> --- select --- </name><value></value></option>
- </options>
- <default_value>jtemplate_default</default_value>
- </field>
- <field>
- <fielddescr>Use unionfs</fielddescr>
- <fieldname>juse_unionfs</fieldname>
- <description>Use unionfs instead of nullfs to mount the template contents into the jail</description>
- <type>checkbox</type>
- </field>
-
- <field>
- <fielddescr>Package sets</fielddescr>
- <fieldname>jselect_sets</fieldname>
- <type>listtopic</type>
- <name>OR select a distribution set to install:</name>
- </field>
- <field>
- <fielddescr>Distribution sets</fielddescr>
- <fieldname>jdistset</fieldname>
- <description>Select a standard set of distributions to install</description>
- <type>select</type>
- <options>
- <option><name> --- select --- </name><value></value></option>
- <option><name>User (binaries only)</name><value>distSetUser</value></option>
- <option><name>Developer (src/all, binaries)</name><value>distSetDeveloper</value></option>
- <option><name>Kernel developer (src/kern, binaries)</name><value>distSetKernDeveloper</value></option>
- <option><name>Minimum (minimal binaries)</name><value>distSet</value></option>
- </options>
- <default_value></default_value>
- </field>
-
- <field>
- <fielddescr>Individual packages</fielddescr>
- <fieldname>jselect_individual</fieldname>
- <type>listtopic</type>
- <name>OR select individual distributions in addition to 'base':</name>
- </field>
-
- <field>
- <fielddescr>Individual distributions</fielddescr>
- <fieldname>jdists</fieldname>
- <description>Select individual distributions (multiple selection)</description>
- <type>select</type>
- <options>
- <option><name>Manual pages</name><value>manpages</value></option>
- <option><name>The Ports collection</name><value>ports</value></option>
- <option><name>Miscellaneous documentation</name><value>doc</value></option>
- <option><name>Local additions collection</name><value>local</value></option>
- <option><name>X.org client binaries</name><value>Xbin</value></option>
- <option><name>X.org libraries</name><value>Xlib</value></option>
- <option><name>X.org manual pages</name><value>Xman</value></option>
- <option><name>X.org imake distribution</name><value>Xprog</value></option>
- <option><name>Games</name><value>games</value></option>
- </options>
- <multiple/>
- </field>
-
- </fields>
-
-
- <!-- php hooks -->
- <include_file>/usr/local/pkg/jailctl_list.inc</include_file>
- <custom_add_php_command>
- sync_package_jailctl();
- </custom_add_php_command>
- <custom_delete_php_command>
- jailctl_delete();
- </custom_delete_php_command>
- <custom_php_resync_config_command>
- sync_package_jailctl();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- jailctl_install();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- jailctl_deinstall();
- </custom_php_deinstall_command>
- <custom_php_after_form_command>
- jailctl_addinterfaces($config);
- jailctl_addtemplates($config);
- </custom_php_after_form_command>
-</packagegui>
-
diff --git a/config/archive/jailctl/jailctl b/config/archive/jailctl/jailctl
deleted file mode 100755
index 542c2db6..00000000
--- a/config/archive/jailctl/jailctl
+++ /dev/null
@@ -1,1053 +0,0 @@
-#!/bin/sh
-
-# -------------------------------------
-# Jail management script
-# Copyright (c) 2004-2008 Eirik Oeverby
-# All rights reserved.
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# * Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following disclaimer in the documentation
-# and/or other materials provided with the distribution.
-# * The name(s) of the author(s) may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-# -------------------------------------
-
-##############################################################################
-# Configuration section #
-# #
-# Change the CFGFILE variable to point to your jail configuration file. #
-##############################################################################
-
-# Clear the hook lists (for security reasons)
-unset BEFORESTART_HOOKS
-unset AFTERSTART_HOOKS
-unset BEFORESTOP_HOOKS
-unset AFTERSTOP_HOOKS
-unset BEFORESTATUS_HOOKS
-unset AFTERSTATUS_HOOKS
-unset BEFOREBACKUP_HOOKS
-unset AFTERBACKUP_HOOKS
-unset BEFORERESTORE_HOOKS
-unset AFTERRESTORE_HOOKS
-unset BEFORECREATE_HOOKS
-unset AFTERCREATE_HOOKS
-unset BEFOREUPGRADE_HOOKS
-unset AFTERUPGRADE_HOOKS
-unset BEFOREDELETE_HOOKS
-unset AFTERDELETE_HOOKS
-
-CFGFILE="/usr/local/etc/jails.conf"
-. ${CFGFILE}
-
-PROCFS=`expr "$PROCFS" : "[tT][rR][uU][eE]"`
-LINPROCFS=`expr "$LINPROCFS" : "[tT][rR][uU][eE]"`
-
-##############################################################################
-# Main function section #
-# #
-# These functions are wrappers for the action functions below. They do #
-# various sanity checking of input parameters, and verify the existence and #
-# required states of the affected jail(s). #
-##############################################################################
-
-usage() {
- ## Output usage information
- echo "Usage:" >&2
- echo "jailctl <command> <jail> [<path>]" >&2
- echo "<command> = start|stop|status|create|delete|upgrade|backup|restore" >&2
- echo "<jail> = hostname|all" >&2
- echo "<path> = Backup destination / restore source" >&2
- echo >&2
-}
-
-jail_status() {
- ## Output the status of one or several jails
- if [ ! $JAIL ] || [ $JAIL = "all" ] || jail_exists ; then
- # Jail exists (or "all" was specified), we can query its status
- if [ ! $JAIL ] || [ $JAIL = "all" ] ; then
- # Output a brief list for all jails
- echo "Jail status (*=running, !=not configured):"
- for JAIL in $JAILS ; do
- # Loop through jails
- JAIL=`expr "$JAIL" : "\(.*\):.*"`
- # Run hooks
- jail_run_hooks before-status
- if jail_exists && jail_running ; then
- # Jail is running
- echo "*$JAIL ($(jail_ip))"
- elif jail_exists ; then
- # Jail not running
- echo " $JAIL ($(jail_ip))"
- else
- # Jail nonexistant or not configured
- echo "!$JAIL ($(jail_ip))"
- fi
- # Run hooks
- jail_run_hooks after-status
- done
- else
- # Output information for a specific jail
- # Run hooks
- jail_run_hooks before-status
- if jail_running ; then
- # Jail is running, be verbose
- echo "$JAIL ($(jail_ip)) is up."
- echo "Path: $(jail_path)"
- echo "Interface: $(jail_if)"
- echo "Process list:"
- # Output process list for jail
- jps
- elif jail_exists; then
- # Jail not running
- echo "$JAIL ($(jail_ip)) is down."
- echo "Path: $(jail_path)"
- echo "Interface: $(jail_if)"
- else
- # Jail nonexistant or not configured
- echo "Unable to query jail $JAIL!"
- echo "Incomplete configuration?"
- fi
- # Run hooks
- jail_run_hooks after-status
- fi
- else
- echo "Path: $(jail_path)"
- echo "Interface: $(jail_if)"
- # No jail was specified, or the specified jail doesn't exist (on disk
- # or in jails.conf. Show usage information)
- echo "No valid jail specified!"
- echo
- usage
- fi
-}
-
-jail_start() {
- ## Start one or several jails
- if [ $JAIL ] && (jail_exists || [ $JAIL = "all" ]) ; then
- # Jail exists (or "all" was specified), we can attempt to start it
- if [ $JAIL = "all" ] ; then
- # Attempting to start all jails
- for JAIL in $JAILS ; do
- # Loop through jails
- JAIL=`expr "$JAIL" : "\(.*\):.*"`
- if jail_running ; then
- # Jail is running, cannot start
- echo "Jail already running!"
- elif jail_exists ; then
- # Jail not running, starting
- echo "Starting jail $JAIL..."
- jstart
- else
- # Jail nonexistant or not configured
- echo "Unable to start jail $JAIL!"
- echo "Incomplete configuration?"
- fi
- done
- else
- # Start a specific jail
- if jail_running && [ ! $FORCE ] ; then
- # Jail is running, cannot start
- echo "Jail already running!"
- elif jail_exists ; then
- # Jail not running, starting
- echo "Starting jail $JAIL..."
- jstart
- else
- # Jail nonexistant or not configured
- echo "Unable to start jail $JAIL!"
- echo "Incomplete configuration?"
- fi
- fi
- else
- # No jail was specified, or the specified jail doesn't exist (on disk
- # or in jails.conf. Show usage information)
- echo "No valid jail specified!"
- echo
- usage
- fi
-}
-
-jail_stop() {
- ## Stop one or several jails
- if [ $JAIL ] && (jail_exists || [ $JAIL = "all" ]) ; then
- # Jail exists (or "all" was specified), we can attempt to stop it
- if [ $JAIL = "all" ] ; then
- # Attempting to stop all jails
- if [ $VERSION -eq 4 ] && [ `ls /proc | wc -l` -eq 0 ] ; then
- # We are on FreeBSD 4.x, and we have no /proc to rely on
- jstop
- else
- for JAIL in $JAILS ; do
- # Loop through jails
- JAIL=`expr "$JAIL" : "\(.*\):.*"`
- if jail_exists && jail_running ; then
- # Jail is running, stopping
- echo "Stopping jail $JAIL..."
- jstop
- elif jail_exists && ! jail_running ; then
- # Jail not running, cannot stop
- echo "Jail not running ($JAIL)!"
- else
- # Jail nonexistant or not configured
- echo "Unable to stop jail $JAIL!"
- echo "Incomplete configuration?"
- fi
- done
- fi
- else
- if jail_exists && jail_running ; then
- if [ $VERSION -eq 4 ] && [ `ls /proc | wc -l` -eq 0 ] ; then
- # We are on FreeBSD 4.x, and we have no /proc to rely on
- echo 'Without a proc filesystem, you must use "jailctl stop all"!'
- else
- # Jail running, stopping
- echo "Stopping jail $JAIL..."
- jstop
- fi
- elif jail_exists && ! jail_running ; then
- # Jail not running, cannot stop
- echo "Jail not running!"
- else
- # Jail nonexistant or not configured
- echo "Unable to start jail $JAIL!"
- echo "Incomplete configuration?"
- fi
- fi
- else
- # No jail was specified, or the specified jail doesn't exist (on disk
- # or in jails.conf. Show usage information)
- echo "No valid jail specified!"
- echo
- usage
- fi
-}
-
-jail_create() {
- ## Create a jail
- # Be more specific in distinguishing return codes from jail_exists
- jail_exists ; RC=$?
- if [ $JAIL ] && [ $RC -eq 1 ] ; then
- # If the jail is configured but does not exist on disk, create the jail
- echo "Creating jail $JAIL..."
- jcreate
- else
- # Jail not configured or already exists
- echo "Jail $JAIL cannot be created!"
- fi
- return 0
-}
-
-jail_upgrade() {
- ## Upgrade one or several jails
- if [ $JAIL ] && (jail_exists || [ $JAIL = "all" ]) ; then
- # Jail exists (or "all" was specified), we can attempt to upgrade it
- if [ $JAIL = "all" ] ; then
- # Attempting to upgrade all jails
- for JAIL in $JAILS ; do
- # Loop through jails
- JAIL=`expr "$JAIL" : "\(.*\):.*"`
- if jail_exists ; then
- # Jail exists and is not running, upgrading
- echo "Upgrading jail $JAIL..."
- jupgrade
- else
- # Jail nonexistant or not configured
- echo "Jail does not exist, or not configured!"
- fi
- done
- else
- if jail_exists ; then
- # Jail exists and is not running, upgrading
- echo "Upgrading jail $JAIL..."
- jupgrade
- else
- # Jail nonexistant or not configured
- echo "Jail does not exist, or not configured!"
- fi
- fi
- else
- # No jail was specified, or the specified jail doesn't exist (on disk
- # or in jails.conf. Show usage information)
- echo "No valid jail specified!"
- echo
- usage
- fi
-}
-
-jail_delete() {
- ## Delete a specific jail
- if [ $JAIL ] && ((jail_exists && ! jail_running) || [ $FORCE ]) ; then
- # Jail exists and is not running, deleting
- echo "Deleting jail $JAIL..."
- jdelete
- else
- # Jail nonexistant, running or not configured, cannot delete
- echo "Jail $JAIL cannot be deleted!"
- fi
- return 0
-}
-
-jail_backup() {
- ## Back up one or several jails
- if [ $JAIL ] && (jail_exists || [ $JAIL = "all" ]) ; then
- # Jail exists (or "all" was specified), we can attempt to back it up
- if [ $JAIL = "all" ] ; then
- # Attempting to back up all jails
- for JAIL in $JAILS ; do
- # Loop through jails
- JAIL=`expr "$JAIL" : "\(.*\):.*"`
- if jail_exists && ! jail_running ; then
- # Jail exists and is not running, doing cold backup
- echo "Doing cold backup of jail $JAIL..."
- jbackup cold
- elif jail_exists && jail_running ; then
- # Jail is running, doing warm backup
- echo "Doing warm backup of jail $JAIL..."
- jbackup
- else
- # Jail nonexistant or not configured
- echo "Jail does not exist, or not configured!"
- fi
- done
- else
- if jail_exists && ! jail_running ; then
- # Jail exists and is not running, doing cold backup
- echo "Doing cold backup of jail $JAIL..."
- jbackup cold
- elif jail_exists && jail_running ; then
- # Jail is running, doing warm backup
- echo "Doing warm backup of jail $JAIL..."
- jbackup
- else
- # Jail nonexistant or not configured
- echo "Jail does not exist, or not configured!"
- fi
- fi
- else
- # No jail was specified, or the specified jail doesn't exist (on disk
- # or in jails.conf. Show usage information)
- echo "No valid jail specified!"
- echo
- usage
- fi
-}
-
-jail_restore() {
- ## Restore a jail
- # Be more specific in distinguishing return codes from jail_exists
- jail_exists ; RC=$?
- if [ $JAIL ] && [ $RC -eq 1 ] ; then
- echo "Restoring jail $JAIL from backup"
- local JP=$(jail_path)
- # Restore the jail
- jrestore
- else
- # No jail was specified, or the specified jail doesn't exist (on disk
- # or in jails.conf. Show usage information)
- echo "No valid jail specified!"
- echo
- usage
- fi
-}
-
-
-#
-### Helper function section
-#
-
-jail_exists() {
- ## Query a jails existence
- local J=`echo $JAILS | tr " " "\n" | grep "^${JAIL}:"`
-# for J in $JAILS ; do
- # Loop through configured jails
- local J_NAME=`expr "$J" : "\(.*\):.*"`
- if [ $J_NAME = $JAIL ] && [ -d "$(jail_path)" ] && \
- [ `expr $(ls -a $(jail_path) | grep -v "^.snap$" | wc -l)` -gt 2 ]; then
- # Jail is configured, its directory exists, and the
- # directory contains more than . and ..
- return 0
- elif [ $J_NAME = $JAIL ] && [ ! -d "$(jail_path)" ] || \
- ( [ -d "$(jail_path)" ] && \
- [ `expr $(ls -a $(jail_path) | grep -v "^.snap$" | wc -l)` -le 2 ]); then
- # Jail is defined, but not yet created (directory missing or empty)
- return 1
- fi
-# done
- # Jail doesn't exist
- return 2
-}
-
-jail_name() {
- ## Query the name of a jail
- ## Must be updated to be able to search per IP. Searching per name makes
- ## no sense
- local J=`echo $JAILS | tr " " "\n" | grep "^${JAIL}:"`
-# for J in $JAILS ; do
- # Loop through configured jails
- local J_NAME=`expr "$J" : "\(.*\):.*"`
- if [ $J_NAME = $JAIL ] ; then
- # Name part of jail definition matches
- echo $J_NAME
- return 0
- fi
-# done
- # Jail not found or error
- return 1
-}
-
-jail_ip() {
- ## Query the IP of a jail
- local J=`echo $JAILS | tr " " "\n" | grep "^${JAIL}:"`
-# for J in $JAILS ; do
- # Loop through configured jails
- local J_NAME=`expr "$J" : "\([^;].*\):.*"`
- if [ $J_NAME = $JAIL ] ; then
- # Name part of jail definition matches, output IP
-echo $J > debug.file
- local J_IP=`expr "$J" : ".*:\([^;]*\)"`
- echo $J_IP
- return 0
- fi
-# done
- # Jail not found or error
- return 1
-}
-
-jail_path() {
- ## Query the path to a jail
- local J=`echo $JAILS | tr " " "\n" | grep "^${JAIL}:"`
-# for J in $JAILS ; do
- # Loop through configured jails
- local J_NAME=`expr "$J" : "\(.*\):.*"`
- if [ $J_NAME = $JAIL ] ; then
- # Name part of jail definition matches, output path
- local J_HOME=`expr "$J" : "[^;]*;\([^;]*\).*$"`
- if [ -n "$J_HOME" ] ; then
- if [ `expr "$J_HOME" : ".*\/$"` -gt 0 ] ; then
- local J_PATH=`expr "$J_HOME" : "\(.*\)/$"`
- else
- local J_PATH="${J_HOME}/${J_NAME}"
- fi
- else
- local J_PATH="${JAIL_HOME}$J_NAME"
- fi
- echo $J_PATH
- return 0
- fi
-# done
- # Jail not found or error
- return 1
-}
-
-jail_if() {
- ## Query the path to a jail
- local J=`echo $JAILS | tr " " "\n" | grep "^${JAIL}:"`
-# for J in $JAILS ; do
- # Loop through configured jails
- local J_NAME=`expr "$J" : "\(.*\):.*"`
- if [ $J_NAME = $JAIL ] ; then
- # Name part of jail definition matches, output path
- local J_HOME=`expr "$J" : "[^;]*;\([^;]*\).*$"`
- local J_IF=`expr "$J" : ".*;[^;]*;\([^;]*\).*$"`
- if [ -z "$J_IF" ] ; then
- local J_IF=$IF
- fi
- echo $J_IF
- return 0
- fi
-# done
- # Jail not found or error
- return 1
-}
-
-jail_running() {
- ## Query the running state of a jail
- if [ $VERSION -ge 5 ] ; then
- # We are on FreeBSD 5.x, using jls(1) tool
- local JLS="`/usr/sbin/jls | grep \"\/${JAIL}$\"`"
- if [ ! "$JLS" ] ; then
- # Jail is not running
- return 1
- fi
- for i in "$JLS" ; do
- # Fetching output string, concatenating
- local J_LIST="$J_LIST $i"
- done
- # Setting JAIL_ID variable; this is the system jail ID
- JAIL_ID=`echo $J_LIST | cut -d \ -f 1`
- local JPS=`expr "\`/usr/sbin/jexec $JAIL_ID /bin/ps ax | grep -v \"ps\ ax\" | wc -l | cut -f 2\`" : "[[:space:]]*\([0-9]*\).*"`
- if [ "$JPS" -lt 2 ] ; then
- # Jail is not running (no processes, anyway)
- return 1
- fi
- else
- # We are on FreeBSD 4.x, use old dirty trick
- if [ ! -f "/var/run/jails/${JAIL}.running" ] ; then
- # Jail is not running
- return 1
- fi
- fi
- # Jail is running
- return 0
-}
-
-#
-### Activity function section
-#
-
-jail_run_hooks() {
- ## Select a hook list to run
- case $1 in
- before-start)
- jrunhooks "$1" "$BEFORESTART_HOOKS"
- ;;
- after-start)
- jrunhooks "$1" "$AFTERSTART_HOOKS"
- ;;
- before-stop)
- jrunhooks "$1" "$BEFORESTOP_HOOKS"
- ;;
- after-stop)
- jrunhooks "$1" "$AFTERSTOP_HOOKS"
- ;;
- before-status)
- jrunhooks "$1" "$BEFORESTATUS_HOOKS"
- ;;
- after-status)
- jrunhooks "$1" "$AFTERSTATUS_HOOKS"
- ;;
- before-backup)
- jrunhooks "$1" "$BEFOREBACKUP_HOOKS"
- ;;
- after-backup)
- jrunhooks "$1" "$AFTERBACKUP_HOOKS"
- ;;
- before-restore)
- jrunhooks "$1" "$BEFORERESTORE_HOOKS"
- ;;
- after-restore)
- jrunhooks "$1" "$AFTERRESTORE_HOOKS"
- ;;
- before-create)
- jrunhooks "$1" "$BEFORECREATE_HOOKS"
- ;;
- after-create)
- jrunhooks "$1" "$AFTERCREATE_HOOKS"
- ;;
- before-upgrade)
- jrunhooks "$1" "$BEFOREUPGRADE_HOOKS"
- ;;
- after-upgrade)
- jrunhooks "$1" "$AFTERUPGRADE_HOOKS"
- ;;
- before-delete)
- jrunhooks "$1" "$BEFOREDELETE_HOOKS"
- ;;
- after-delete)
- jrunhooks "$1" "$AFTERDELETE_HOOKS"
- ;;
- esac
-}
-
-jps() {
- ## List running processes in a jail
- if [ $VERSION -ge 5 ] ; then
- # We are on FreeBSD 5.x, use jexec(1) tool
- /usr/sbin/jexec $JAIL_ID ps auxwww
- else
- # We are on FreeBSD 4.x, use old dirty trick (requires /proc on host!)
- echo "CMD PID TIME UTIME STIME"
- cat /proc/*/status | grep "${JAIL}" | cut -d \ -f 1 -f 2 -f 8 -f 9 -f 10
- fi
- return 0
-}
-
-jstart() {
- ## Start a jail
- local JP=$(jail_path)
- local IP=$(jail_ip)
- local JIF=$(jail_if)
- if [ $PROCFS -gt 0 ] ; then
- # Mount proc filesystem into jail
- /sbin/mount_procfs procfs ${JP}/proc
- fi
- if [ $LINPROCFS -gt 0 ] ; then
- # Mount Linux proc filesystem into jail
- /sbin/mount_linprocfs linprocfs ${JP}/compat/linux/proc
- fi
-
- if [ $VERSION -ge 5 ] ; then
- # Run hooks
- jail_run_hooks before-start
- # We are on FreeBSD 5.x, use devfs
- /sbin/mount -t devfs devfs ${JP}/dev
- devfs -m ${JP}/dev ruleset 4
- devfs -m ${JP}/dev rule applyset
- fi
-
- # Bring up network interface alias and start jail
- [ $(echo $JIF | cut -c 1-4) != 'carp' ] && ifconfig $JIF inet $IP netmask 0xffffffff alias
- echo >> ${JP}/var/log/jailstart.log
- echo $(date) >> ${JP}/var/log/jailstart.log
- jail $JP $JAIL $IP /bin/sh /etc/rc 2>&1 >${JP}/var/log/jailstart.log &
-
- if [ $VERSION -eq 4 ] ; then
- # We're on FreeBSD 4.x, Create run file
- touch /var/run/jails/${JAIL}.running
- fi
-
- if [ $VERSION -ge 5 ] ; then
- # Run hooks
- jail_run_hooks after-start
- fi
-
- return 0
-}
-
-jstop() {
- ## Stop a jail
- local JP=$(jail_path)
- local IP=$(jail_ip)
- local JIF=$(jail_if)
-
- if [ $VERSION -ge 5 ] ; then
- # Run hooks
- jail_run_hooks before-stop
- fi
-
- echo "Sending TERM signal to jail processes..."
- if [ $VERSION -ge 5 ] ; then
- # We are on FreeBSD 5.x, use jexec(1) tool
- /usr/sbin/jexec $JAIL_ID /bin/sh /etc/rc.shutdown
- sleep 2
- /usr/sbin/jexec $JAIL_ID kill -15 -1
- # Waiting for processes to die
- sleep 4
- while jail_running ; do
- # Some processes are still running, do a kill -9 -1
- echo "Some processes would not terminate; sending KILL signal..."
- /usr/sbin/jexec $JAIL_ID kill -9 -1
- # Give processes some time to die
- sleep 2
- done
- umount -f ${JP}/dev
- else
- # We are on FreeBSD 4.x
- if [ "$JAIL" = "all" ] ; then
- # /proc is unavailable, so we can only stop ALL jails at once
- local PS="`ps ax|cut -c 1-16|grep J|cut -d \ -f 1`"
- for PID in "$PS" ; do
- kill -15 $PID 2>/dev/null 1>/dev/null
- done
- # Waiting for processes to die
- sleep 4
- local PS="`ps ax|cut -c 1-16|grep J|cut -d \ -f 1`"
- while [ "$PS" ] ; do
- # Some processes are still running, do a kill -9 on each
- echo "Some processes would not terminate; sending KILL signal..."
- for PID in "$PS" ; do
- # Sending KILL signal to all processes in the jail
- kill -9 $PID 2>/dev/null 1>/dev/null
- done
- # Give processes some time to die
- sleep 2
- local PS="`ps ax|cut -c 1-16|grep J|cut -d \ -f 1`"
- done
- else
- # Use /proc filesystem (REQUIRED for single-jail operation!)
- local PS="`cat /proc/*/status | cut -d \ -f 2 -f 15 2>/dev/null | grep \" ${JAIL} \" | cut -d \ -f 1`"
- for PID in "$PS" ; do
- # Sending TERM signal to all processes in the jail
- kill -15 $PID 2>/dev/null 1>/dev/null
- done
- # Waiting for processes to die
- sleep 4
- local PS="`cat /proc/*/status | cut -d \ -f 2 -f 15 2>/dev/null | grep \" ${JAIL} \" | cut -d \ -f 1`"
- while [ "$PS" ] ; do
- # Some processes are still running, do a kill -9 on each
- echo "Some processes would not terminate; sending KILL signal..."
- for PID in "$PS" ; do
- # Sending KILL signal to all processes in the jail
- kill -9 $PID 2>/dev/null 1>/dev/null
- done
- # Give processes some time to die
- sleep 2
- local PS="`cat /proc/*/status | cut -d \ -f 2 -f 15 2>/dev/null | grep \" ${JAIL} \" | cut -d \ -f 1`"
- done
- fi
- fi
-
- if [ $PROCFS -gt 0 ] ; then
- # Unmount the jail proc filesystem
- umount -f ${JP}/proc
- fi
- if [ $LINPROCFS -gt 0 ] ; then
- # Unmount the jail Linux proc filesystem
- umount -f ${JP}/compat/linux/proc
- fi
-
- if [ $VERSION -eq 4 ] ; then
- # We are on FreeBSD 4.x, remove runfile
- rm /var/run/jails/${JAIL}.running
- fi
-
- # Bring down network interface alias
- [ $(echo $JIF | cut -c 1-4) != 'carp' ] && ifconfig $JIF inet $IP netmask 0xffffffff -alias
-
- if [ $VERSION -ge 5 ] ; then
- # Run hooks
- jail_run_hooks after-stop
- fi
-
- return 0
-}
-
-jcreate() {
- jail_run_hooks before-create
- ## Create a jail
- local JP=$(jail_path)
- local IP=$(jail_ip)
- local JIF=$(jail_if)
-
- # Create jail directory
- mkdir -p $JP
- # Populate jail directory
- jpopulate
- # Initialize jail directory contents
- jinit
- # Remove unneeded files and clean up
- jcleanup
- jail_run_hooks after-create
- return 0
-}
-
-jupgrade() {
- jail_run_hooks before-upgrade
- ## Upgrade a jail
- local JP=$(jail_path)
- # Run mergemaster to prepare the jail for upgrade
- mergemaster -Upi -D $JP
- # Populate jail directory
- jpopulate
- # Run mergemaster to update default configuration files
- mergemaster -Ui -D $JP
- # Remove unneeded files and clean up
- jcleanup
- if jail_running ; then
- echo "Jail running, please restart!"
- fi
- jail_run_hooks after-upgrade
-
-}
-
-jdelete() {
- jail_run_hooks before-delete
- ## Delete a jail
- local JP=$(jail_path)
- local m_search=""
- if [ $PROCFS -gt 0 ] ; then m_search="${JP}/proc" ; fi
- if [ $LINPROCFS -gt 0 ] ; then
- if [ -n "${m_search}" ] ; then m_search="${m_search}\|" ; fi
- m_search="${m_search}${JP}/compat/linux/proc"
- fi
- if [ $VERSION -ge 5 ] ; then
- if [ -n "${m_search}" ] ; then m_search="${m_search}\|" ; fi
- m_search="${m_search}${JP}/dev"
- fi
- MOUNTS=`mount | grep "$JP" | grep -v "${m_search} | cut -d \ -f 3"`
- MOUNTS_NO=`echo -n $MOUNTS | wc -l`
- if [ $MOUNTS_NO -gt 0 ]; then
- echo "WARNING: Mounted directories found in ${JP}:"
- echo $MOUNTS
- echo -n "Unmount ('n' will cancel delete)? [y/n] "
- read ANS
- if [ x$ANS = xy ]; then
- for m in $MOUNTS ; do
- echo -n "Unmounting $m ..."
- umount_msg=`umount -f $m 2>&1`
- umount_res=$?
- sleep 1
- if [ $umount_res -ne 0 ] ; then
- echo "FAILED!"
- echo "$umount_msg"
- else
- echo "ok."
- fi
- done
- MOUNTS=`mount | grep "$JP" | grep -v "${m_search}"`
- MOUNTS_NO=`echo -n $MOUNTS | wc -l`
- echo $MOUNTS_NO
- if [ $MOUNTS_NO -gt 0 ] ; then
- echo "Unmounting failed. Jail not deleted."
- else
- echo "All filesystems unmounted successfully. Deleting jail."
- # Pass one: removing unprotected files
- rm -Rf $JP 2>&1 > /dev/null
- # Pass two: removing SCHG flag from jail tree
- chflags -R noschg $JP
- # Pass three: Removing jail directory
- rm -Rf $JP
- fi
- fi
- else
- # Pass one: removing unprotected files
- rm -Rf $JP 2>&1 > /dev/null
- # Pass two: removing SCHG flag from jail tree
- chflags -R noschg $JP
- # Pass three: Removing jail directory
- rm -Rf $JP
- fi
- jail_run_hooks after-delete
-
-}
-
-jbackup() {
- ## Back up a jail
- local JP=$(jail_path)
-
- # Determine target file for backup
- if [ -n "$CMD" ] ; then
- TARGET=$CMD
- else
- TARGET="${BACKUPDIR}/${JAIL}.tar"
- fi
-
- # Run backup
- jail_run_hooks before-backup
- if [ ! "$1" = "cold" -a $VERSION -ge 5 ] ; then
- # Run warm backup - FreeBSD >=5 only
- if [ -z "$GPG" ] ; then
- /usr/sbin/jexec $JAIL_ID /usr/bin/tar --one-file-system -C / $BACKUP_EXCLUDE -cf - ./. | gzip --fast > ${TARGET}.gz
- else
- /usr/sbin/jexec $JAIL_ID /usr/bin/tar --one-file-system -C / $BACKUP_EXCLUDE -cf - ./. | gzip --fast | $GPG -o ${TARGET}.gz.gpg
- fi
- else
- # Run cold backup
- if [ -z "$GPG" ] ; then
- chroot $JP /usr/bin/tar --one-file-system -C / $BACKUP_EXCLUDE -cf - ./. | gzip --fast > ${TARGET}.gz
- else
- chroot $JP /usr/bin/tar --one-file-system -C / $BACKUP_EXCLUDE -cf - ./. | gzip --fast | $GPG -o ${TARGET}.gz.gpg
- fi
- fi
- jail_run_hooks after-backup
-}
-
-jrestore() {
- ## Restore a jail from backup
- # Create jail home
- mkdir -p $JP && cd $JP
-
- # Determine source file for backup
- if [ -n "$CMD" ] ; then
- SOURCE=$CMD
- else
- SOURCE="${BACKUPDIR}/${JAIL}.tar.gz"
- fi
-
- [ -f $SOURCE ] && jail_run_hooks before-restore
- # Restore
- tar -zpxf $SOURCE
- [ $? -eq 0 ] && jail_run_hooks after-restore
-}
-
-
-#
-### Activity helper function section
-#
-
-jpopulate() {
- ## Populate a jail directory
- cd /usr/src
- # Running installworld into jail directory
- make installworld ${INSTALLWORLD_FLAGS} DESTDIR=${JP} 2>&1 | grep '>>>'
-}
-
-jcleanup() {
- ## Remove unneeded files and clean up a jail
- # Copying the most recent list of files to delete
- if [ $VERSION -ge 5 ] ; then
- cp ${JAIL_HOME}addons/dellist5.txt $JP/dellist.txt
- else
- cp ${JAIL_HOME}addons/dellist4.txt $JP/dellist.txt
- fi
- # Removing protection from files to be deleted
- chroot $JP chflags -R noschg $(cat ${JP}/dellist.txt) 2>/dev/null 1>/dev/null
- # Deleting files
- chroot $JP rm -Rf $(cat ${JP}/dellist.txt) 2>/dev/null 1>/dev/null
-
- # Changing binaries to be jail compatible
- chroot ${JP} ln -f /usr/bin/true /sbin/mount
- chroot ${JP} ln -f /usr/bin/true /sbin/umount
- chroot ${JP} ln -f /usr/bin/true /sbin/swapon
- chroot ${JP} ln -f /usr/bin/true /sbin/swapoff
- chroot ${JP} chflags noschg /sbin/init
- chroot ${JP} rm /sbin/init
- chroot ${JP} ln -f /usr/bin/true /sbin/init
- chroot ${JP} ln -f /usr/bin/true /sbin/adjkerntz
- chroot ${JP} ln -f /usr/bin/true /sbin/ifconfig
-
- # Copy timezone information from host
- cp /etc/localtime ${JP}/etc/localtime
-}
-
-jinit() {
- ## Install default set of configuration files
- cd /usr/src/etc
- # Installing distribution files to jail directory
- make distribution DESTDIR=${JP} -DNO_MAKEDEV_RUN 2>/dev/null 1>/dev/null
-
- # Create directories in jail
- mkdir -p ${JP}/proc
- mkdir -p ${JP}/usr/home
- mkdir -p ${JP}/root/.ssh
- mkdir -p ${JP}/compat/linux/proc
- mkdir -p ${JP}/usr/local/bin
- chroot ${JP} ln -sf /usr/home /home
-
- # Update passwd database with default root user/pw
- IFS2=$IFS
- IFS=$(echo -e '\n\t')
- if [ -z "$BATCH" ] ; then
- echo "Setting root password in jail"
- chroot ${JP} /usr/bin/passwd root
- else
- for L in $(cat ${JP}/etc/master.passwd) ; do
- if [ "$L" = 'root::0:0::0:0:Charlie &:/root:/bin/csh' ] ; then
- echo "root:${ROOT_PW}:0:0::0:0:Charlie &:/root:/bin/csh" >> ${JP}/tmp/jailctl.001
- else
- echo $L >> ${JP}/tmp/jailctl.001
- fi
- done
- pwd_mkdb -p -d ${JP}/etc ${JP}/tmp/jailctl.001
- IFS=$IFS2
- fi
-
- # Install jail hostname and IP into hosts file
- JAIL_HOST=$(expr $JAIL : "\([a-zA-Z0-9\-]*\)\..*")
- JAIL_DOMAIN=$(expr $JAIL : "${JAIL_HOST}\.\(.*\)")
- echo "$IP $JAIL $JAIL_HOST" >> ${JP}/etc/hosts
-
- # Create new rc.conf
- echo '# Default jail rc.conf' > ${JP}/etc/rc.conf
- for L in $RC_CONF ; do
- echo $L >> ${JP}/etc/rc.conf
- done
- echo "hostname=\"$JAIL\"" >> ${JP}/etc/rc.conf
-
- # Update SSH configuration
- sed -i .jailctl -Ee "s/#?PermitRootLogin no/PermitRootLogin yes/" ${JP}/etc/ssh/sshd_config
-
- # Update resolv.conf
- echo "domain $JAIL_DOMAIN" > ${JP}/etc/resolv.conf
- # Update resolv.conf
- for L in $NAMESERVERS ; do
- echo "nameserver $L" >> ${JP}/etc/resolv.conf
- done
-
- # Creating symlinks
- chroot ${JP} ln -sf /dev/null /kernel
- if [ $VERSION -ge 5 ] ; then
- # We are on FreeBSD 5.x, work around distribution bug
- chroot ${JP} ln -sf /lib/libm.so.3 /lib/libm.so.2
- fi
-
- if [ $VERSION -eq 4 ] ; then
- # We are on FreeBSD 4.x, initializing device tree
- cd ${JP}/dev
- sh MAKEDEV jail
- fi
-
- # Installing addons
- cp -R ${JAIL_HOME}addons/* ${JP}/
-
- # Starting jail for the first time, calling runme.sh to install software
- [ $(echo $JIF | cut -c 1-4) != 'carp' ] && ifconfig $JIF inet $IP netmask 0xffffffff alias
- JSTART=$(jail $JP $JAIL $IP /bin/sh /runme.sh)
- [ $(echo $JIF | cut -c 1-4) != 'carp' ] && ifconfig $JIF inet $IP netmask 0xffffffff -alias
-
- # Output commmands used to run installation script for easy re-run
- [ $(echo $JIF | cut -c 1-4) != 'carp' ] && echo "ifconfig $JIF inet $IP netmask 0xffffffff alias"
- echo "jail $JP $JAIL $IP /bin/sh /runme.sh"
- [ $(echo $JIF | cut -c 1-4) != 'carp' ] && echo "ifconfig $JIF inet $IP netmask 0xffffffff -alias"
-}
-
-jrunhooks() {
- ## Run a hook list
- # Find jail ID on FreeBSD >5
- local JAIL_ID=0
- if [ $VERSION -ge 5 ] && jail_running ; then
- local JLS="`/usr/sbin/jls | grep \"\/${JAIL}$\"`"
- for i in "$JLS" ; do
- # Fetching output string, concatenating
- local J_LIST="$J_LIST $i"
- done
- # Setting JAIL_ID variable; this is the system jail ID
- local JAIL_ID=`echo $J_LIST | cut -d \ -f 1`
- fi
-
- for HOOK in $@; do
- # Skip first parameter
- [ ! "$HOOK" = "$1" ] && $HOOK $1 $JAIL $(jail_path) $JAIL_ID
- done
-}
-
-#
-### Main block
-#
-
-## Get current working directory
-CWD=$(pwd)
-
-## Get command line parameters
-ACTION=$1
-JAIL=$2
-CMD=$3
-
-if [ "$CMD" = "force" ] ; then
- FORCE=1
-fi
-
-## Checking current FreeBSD version
-VERSION="`uname -r | cut -c 1`"
-
-if [ $VERSION -eq 4 ] ; then
- # We are on FreeBSD 4.x, creating statefile directory
- if [ ! -d "/var/run/jails" ] ; then
- mkdir -p /var/run/jails
- fi
-fi
-
-case "$ACTION" in
-status) jail_status ;;
-start) jail_start ;;
-stop) jail_stop ;;
-create) jail_create ;;
-upgrade) jail_upgrade ;;
-delete) jail_delete ;;
-backup) jail_backup ;;
-restore) jail_restore ;;
-*) usage ;;
-
-esac
-
-cd $CWD
-
-exit 0
-
diff --git a/config/archive/jailctl/jailctl-utils.inc b/config/archive/jailctl/jailctl-utils.inc
deleted file mode 100644
index 36c50d23..00000000
--- a/config/archive/jailctl/jailctl-utils.inc
+++ /dev/null
@@ -1,272 +0,0 @@
-<?php
-$GLOBALS['jailctl_tmp']['mounts'][]='bin';
-$GLOBALS['jailctl_tmp']['mounts'][]='lib';
-$GLOBALS['jailctl_tmp']['mounts'][]='libexec';
-$GLOBALS['jailctl_tmp']['mounts'][]='sbin';
-$GLOBALS['jailctl_tmp']['mounts'][]='usr/bin';
-$GLOBALS['jailctl_tmp']['mounts'][]='usr/include';
-$GLOBALS['jailctl_tmp']['mounts'][]='usr/lib';
-$GLOBALS['jailctl_tmp']['mounts'][]='usr/libdata';
-$GLOBALS['jailctl_tmp']['mounts'][]='usr/libexec';
-$GLOBALS['jailctl_tmp']['mounts'][]='usr/sbin';
-$GLOBALS['jailctl_tmp']['mounts'][]='usr/share';
-
-$GLOBALS['jailctl_tmp']['unionmounts'][]='etc';
-$GLOBALS['jailctl_tmp']['unionmounts'][]='var';
-$GLOBALS['jailctl_tmp']['unionmounts'][]='usr/local/etc';
-
-$GLOBALS['jailctl_tmp']['mount_unionfs']='mount -t unionfs -o below ';
-$GLOBALS['jailctl_tmp']['mount_nullfs']='mount -t nullfs -o ro';
-
-function jailctl_initialize_jail($jail, $jstatus, $jconfig) {
- $cmd='sed -I "" -e s/"^root:[^:]*:"/"root:'.addcslashes($jconfig['jpasswd'], '$/').':"/ '.$jstatus['jpath'].'/etc/master.passwd '."\n";
- $cmd.='sed -I "" -e s/"^.PermitRootLogin.*"/"PermitRootLogin yes"/ '.$jstatus['jpath'].'/etc/ssh/sshd_config '."\n";
- $cmd.="pwd_mkdb -d ".$jstatus['jpath']."/etc ".$jstatus['jpath']."/etc/master.passwd \n";
- $cmd.="echo '".$jail['jip']." ".$jail['jname']." ".$jstatus['jhostname'][0]."' >> ".$jstatus['jpath']."/etc/hosts \n";
- $cmd.="echo 'hostname=\"".$jail['jname']."\"' > ".$jstatus['jpath']."/etc/rc.conf \n";
-
- if(is_array($jconfig['row'])) {
- foreach($jconfig['row'] as $_row) {
- $cmd.="echo '".$_row['rcconfline']."' >> ".$jstatus['jpath']."/etc/rc.conf \n";
- #$cmd.="echo '".str_replace(' ', "\n", $jconfig['jrcconf'])."' >> ".$jstatus['jpath']."/etc/rc.conf \n";
- }
- }
- $cmd.="echo 'domain ".$jstatus['jhostname'][1]."' > ".$jstatus['jpath']."/etc/resolv.conf \n";
- foreach(explode(' ', trim($jconfig['jdnsservers'])) as $_ns) {
- $cmd.="echo 'nameserver ".str_replace(' ', "\nnameserver ", $_ns)."' >> ".$jstatus['jpath']."/etc/resolv.conf \n";
- }
- return $cmd;
-}
-
-function jailctl_create_template($jail, $jstatus, $jconfig) {
- $mounts=$GLOBALS['jailctl_tmp']['mounts'];
- $unionmounts=$GLOBALS['jailctl_tmp']['unionmounts'];
- $mount_unionfs=$GLOBALS['jailctl_tmp']['mount_unionfs'];
- $mount_nullfs=$GLOBALS['jailctl_tmp']['mount_nullfs'];
-
- $_path=$jstatus['jpath'];
- $_name=$jail['name'];
- $_ip=$jail['jip'];
- $_hostname=$jstatus['jhostname'];
- $_dnsservers=$jconfig['jdnsservers'];
- $_passwd=$jconfig['jpasswd'];
- $_template=$jail['jtemplates'];
-
- exec('mkdir -p '.$_path.'/dev');
- exec('mkdir -p '.$_path.'/root');
- exec('ln -s /usr/home '.$_path.'/home');
-
- $jail['juse_unionfs']=='on' ? $mount=$mount_unionfs : $mount=$mount_nullfs ;
-
- foreach($mounts as $mp) {
- $cmd[]='mkdir -p '.$_path.'/'.$mp;
- $cmd[]=$mount.' '.$_template.'/'.$mp.' '.$_path.'/'.$mp;
- }
-
- foreach($unionmounts as $mp) {
- $cmd[]='mkdir -p '.$_path.'/'.$mp;
- $cmd[]=$mount_unionfs.' '.$_template.'/'.$mp.' '.$_path.'/'.$mp;
- }
-
- foreach($cmd as $_t) {
-# exec($_t.' 2>&1 ', $_mount);
- exec($_t.' 2>&1 ');
- }
-# foreach($_mount as $_out) {
-# echo $_out."<br>";
-# }
-
- $cmd=jailctl_initialize_jail($jail, $jstatus, $jconfig);
- $fd=fopen('/tmp/jcreate_'.$jail['jname'], 'w+');
- fwrite($fd, $cmd);
- fclose($fd);
- exec("sh /tmp/jcreate_".$jail['jname']." 2>&1 >/var/log/jcreate_exec &");
-
- foreach(array_reverse($mounts, true) as $mp) {
- exec('umount -f '.$_path.'/'.$mp);
- }
-
- foreach(array_reverse($unionmounts, true) as $mp) {
- exec('umount -f '.$_path.'/'.$mp);
- }
-}
-
-function jailctl_create_sysinstall($jail, $jstatus, $jconfig) {
- exec('mkdir -p '.$jstatus['jpath']);
- $cmd="sysinstall ";
- $cmd.="_ftpPath=".$jconfig['jftpmirror']." ";
- $cmd.="nonInteractive=yes ";
- $cmd.="mediaSetFTP ";
- $cmd.="releaseName=7.1-RELEASE ";
- if($jail['jdists']) {
- $cmd.="dists=\"base ".str_replace(',', ' ', $jail['jdists'])."\" ";
- $cmd.="distSetCustom ";
- } else {
- $cmd.=$jail['jdistset']." ";
- }
- $cmd.="installRoot=".$jstatus['jpath']." ";
- $cmd.="installCommit ";
- $cmd.="> /var/log/jcreate.log 2>/var/log/jcreate.err \n";
- $cmd.="\n";
-
- $cmd.=jailctl_initialize_jail($jail, $jstatus, $jconfig);
-
- $fd=fopen('/tmp/jcreate_'.$jail['jname'], 'w+');
- fwrite($fd, $cmd);
- fclose($fd);
-
- exec("sh /tmp/jcreate_".$jail['jname']." 2>&1 >/var/log/jcreate_exec &");
-}
-
-function jailctl_find_if($ip) {
- exec("ifconfig | grep -C 1 '".addcslashes($ip, ".")."'", $_ifconfig);
- $if=explode(':', $_ifconfig[0]);
-
- return $if[0];
-}
-
-function jailctl_addinterfaces($config) {
- $vips=$config['virtualip']['vip'];
- ?>
- <script type="text/javascript">
- function isValidIPAddress(ipaddr) {
- var re = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
- if (re.test(ipaddr)) {
- var parts = ipaddr.split(".");
- if (parseInt(parseFloat(parts[0])) == 0) { return false; }
- for (var i=0; i<parts.length; i++) {
- if (parseInt(parseFloat(parts[i])) > 255) { return false; }
- }
- return true;
- } else {
- return false;
- }
- }
- function addinterfaces() {
- <?php
-
- foreach($vips as $vip) {
- if($vip['mode']=='carp') {
- echo("document.forms['iform'].jif.appendChild(new Option('".$vip['descr']." (".$vip['subnet'].")', '".$vip['subnet']."'));");
- }
- }
-
- ?>
- }
- addinterfaces();
-
- for (var i=0; i < document.forms['iform'].jif.length; i++) {
- <?php
- $jif=$config['installedpackages']['pfjailctl']['config'][$_GET['id']]['jif'];
- echo('if (document.forms["iform"].jif[i].value == "'.$jif.'") {');
- ?>
- document.forms['iform'].jif[i].selected = true;
- } else {
- document.forms['iform'].jif[i].selected = false;
- }
- }
- if (isValidIPAddress(document.forms['iform'].jif.value)) {
- document.forms['iform'].jip.disabled=true;
- }
-
- function setdisableip() {
- if (isValidIPAddress(document.forms['iform'].jif.value)) {
- document.forms['iform'].jip.value=document.forms['iform'].jif.value;
- document.forms['iform'].jip.disabled=true;
- } else {
- // document.forms['iform'].jip.value='';
- document.forms['iform'].jip.disabled=false;
- }
- }
- document.forms['iform'].jif.addEventListener('change', setdisableip, true);
- </script>
- <?php
-}
-
-function jailctl_addtemplates($config) {
- $templates=$config['installedpackages']['pfjailctltemplates']['config'][0]['templates'];
- ?>
- <script type="text/javascript">
- function addtemplates() {
- <?php
- foreach($templates as $template) {
- echo("document.forms['iform'].jtemplates.appendChild(new Option('".$template['name']."', '".$template['path']."'));");
- }
- ?>
- }
- addtemplates();
- </script>
- <?php
-}
-
-
-function jailctl_jailstatus($config, $jail) {
- $jconfig=$config['installedpackages']['pfjailctlsettings']['config'][0];
- #echo("<pre>"); print_r($jail); echo("</pre>");
-
-
- $jname=$jail['jname'];
- $jhostname=explode('.', $jname, 2);
- $jpath=$jconfig['jstorage']."/".$jname;
- $jip=$jail['jip'];
- $jif=$jail['jif'];
-
- if(is_ipaddr($jif)) {
- $jrealif=jailctl_find_if($jif);
- #$jrealif=guess_interface_from_ip($jif);
- #$jrealif=link_carp_interface_to_parent($jif);
- } else {
- $jrealif=$config['interfaces'][$jif]['if'];
- }
-
- if($config['interfaces'][$jif]['descr']) {
- $jifdesc=$config['interfaces'][$jif]['descr'];
- } elseif(is_ipaddr($jif)) {
- $vips=$config['virtualip']['vip'];
- foreach($vips as $vip) {
- if($vip['mode']=='carp' and $vip['subnet']==$jif) {
- $jifdesc='CARP on '.strtoupper($vip['interface']);
- }
- }
- } else {
- $jifdesc=strtoupper($jail['jif']);
- }
-
- $_out=Array();
- exec('ps axwww | grep "sysinstall.*'.$jname.'" | grep -v grep', $_out);
- if(count($_out)) {
- $jstate='Building';
- } else {
- $_out=Array();
- exec('/usr/local/sbin/jailctl status '.$jname, $_out);
- #echo("<pre>"); print_r($_out); echo("</pre>");
- if (substr($_out[0], 0, strlen($jname))==$jname) {
- $_tmp=Array();
- ereg("is (.*)\.", array_shift($_out), $_tmp);
- switch ($_tmp[1]) {
- case 'down':
- $jstate='Stopped';
- break;
- case 'up':
- $jstate='Running';
- break;
- default:
- $jstate='Undefined';
- break;
- }
- } else {
- $jstate='New';
- }
- }
-
- $jstatus['jstate']=$jstate;
- $jstatus['jpath']=$jpath;
- $jstatus['jrealif']=$jrealif;
- $jstatus['jifdesc']=$jifdesc;
- $jstatus['jhostname']=$jhostname;
-
- return $jstatus;
-}
-
-
-?>
diff --git a/config/archive/jailctl/jailctl.inc b/config/archive/jailctl/jailctl.inc
deleted file mode 100644
index d6b7344c..00000000
--- a/config/archive/jailctl/jailctl.inc
+++ /dev/null
@@ -1,217 +0,0 @@
-<?php
-/* $Id$ */
-include("jailctl-utils.inc");
-
-if($_POST['xml']=='jailctl_settings.xml' && $_POST['jpasswd']) {
- $_POST['jpasswd']=crypt($_POST['jpasswd']);
-} elseif($_POST['xml']=='jailctl_settings.xml' && !$_POST['jpasswd']) {
- $_POST['jpasswd']=$config['installedpackages']['pfjailctlsettings']['config'][0]['jpasswd'];
-}
-
-if($_POST['xml']=='jailctl_settings.xml') {
- $_count=0;
- while($_count <= count(array_keys($_POST))) {
- if(isset($_POST['rcconfline'.$_count])) {
- $_POST['rcconfline'.$_count]=addcslashes($_POST['rcconfline'.$_count], '"');
- }
- $_count++;
- }
-} elseif($_GET['xml']=='jailctl_settings.xml') {
- $config['installedpackages']['pfjailctlsettings']['config'][0]['jpasswd']='';
-} elseif($_POST['xml']=='jailctl.xml' && is_ipaddr($_POST['jif'])) {
- $_POST['jip']=$_POST['jif'];
-} elseif($_POST['xml']=='jailctl.xml') {
- # Stuff goes here?
-}
-
-
-function jailctl_create($config, $jail) {
- $jstatus=jailctl_jailstatus($config, $jail);
- $jconfig=$config['installedpackages']['pfjailctlsettings']['config'][0];
- if($jail['jtemplates']) {
- jailctl_create_template($jail, $jstatus, $jconfig);
- } else {
- jailctl_create_sysinstall($jail, $jstatus, $jconfig);
- }
-}
-
-function jailctl_delete() {
- global $config, $jconfig, $jails;
-
- $jpath=$jconfig['jstorage']."/".$jails[$_GET['id']]['jname'];
- exec("rm -Rf '".$jpath."' >/dev/null 2>/dev/null &");
-# sync_package_jailctl();
-}
-
-function jailctl_deinstall() {
-# unset($GLOBALS['config']['installedpackages']['pfjailctlsettings']);
-# unset($GLOBALS['config']['installedpackages']['pfjailctl']);
-}
-
-function jailctl_install() {
- $jails=$GLOBALS['config']['installedpackages']['pfjailctl']['config'];
- for($i=0;$i<=count($jails);$i++) {
- if(is_array($jails[$i]) and ! $jails[$i]['jname'])
- unset($GLOBALS['config']['installedpackages']['pfjailctl']['config'][$i]);
- }
-
- if(!$GLOBALS['config']['installedpackages']['pfjailctlsettings']['config'][0]['jif']) {
- $settings['jif']='lan';
- $settings['jdnsservers']=$GLOBALS['config']['interfaces']['lan']['ipaddr'];
- $settings['jstorage']='/usr/local/jails';
- $settings['jbackup']=$settings['jstorage'];
- $settings['jbackupexcludes']='--exclude ./usr/ports/* --exclude ./tmp/* --exclude ./var/tmp/* --exclude ./usr/src/*';
- $settings['jrcconf']='sshd_enable="YES"';
- $settings['jpasswd']='$1$e4.8A4lV$oU.OQciTOnonltQkK12ff0';
-
- $GLOBALS['config']['installedpackages']['pfjailctlsettings']['config'][0]=$settings;
- }
-}
-
-function jailctl_servicestatus() {
- global $config;
- $jconfig=$config['installedpackages']['pfjailctlsettings']['config'][0];
- $jails=$config['installedpackages']['pfjailctl']['config'];
- is_array($jails) ? $num_jails=count($jails) : $num_jails=0;
-
- if($num_jails) {
- for ($i=0;$i<$num_jails;$i++) {
- $jname=$jails[$i]['jname'];
- $jstatus=Array();
- $_jcreate=Array();
- exec('/usr/local/sbin/jailctl status '.$jname, $jstatus);
-
- if (substr($jstatus[0], 0, strlen($jname))==$jname) {
- $_tmp=Array();
- ereg("is (.*)\.", array_shift($jstatus), $_tmp);
- switch ($_tmp[1]) {
- case 'up':
- break;
- default:
- return false;
- }
- } else {
- return false;
- }
- }
- } else {
- return false;
- }
- return true;
-}
-
-function jailctl_do_xmlrpc_sync($config) {
- $jails=$config['installedpackages']['pfjailctl']['config'][0];
- $jconfig=$config['installedpackages']['pfjailctlsettings']['config'][0];
- $sync=$config['installedpackages']['carpsettings']['config'][0];
-
- if(!$sync['synchronizetoip'] or !$sync['password'])
- return;
-
- if($config['system']['webgui']['protocol'] != "") {
- $synchronizetoip = $config['system']['webgui']['protocol'];
- $synchronizetoip .= "://";
- }
- $port = $config['system']['webgui']['port'];
- /* if port is empty lets rely on the protocol selection */
- if($port == "") {
- if($config['system']['webgui']['protocol'] == "http")
- $port = "80";
- else
- $port = "443";
- }
- $synchronizetoip .= $sync['synchronizetoip'];
-
- /* xml will hold the sections to sync */
- $xml = array();
- $xml['pfjailctl'] = $config['installedpackages']['pfjailctl'];
- $xml['pfjailctlsettings'] = $config['installedpackages']['pfjailctlsettings'];
-
- /* assemble xmlrpc payload */
- $params = array(
- XML_RPC_encode($sync['password']),
- XML_RPC_encode($xml)
- );
-
- /* set a few variables needed for sync code borrowed from filter.inc */
- $url = $synchronizetoip;
- log_error("Beginning pfJailctl XMLRPC sync to {$url}:{$port}.");
- $method = 'pfsense.merge_installedpackages_section_xmlrpc';
- $msg = new XML_RPC_Message($method, $params);
- $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
- $cli->setCredentials('admin', $sync['password']);
- /* send our XMLRPC message and timeout after 25 seconds */
- $resp = $cli->send($msg, "25");
- if(!$resp) {
- $error = "A communications error occured while attempting pfJailctl XMLRPC sync with {$url}:{$port}.";
- log_error($error);
- file_notice("sync_settings", $error, "pfJailctl Settings Sync", "");
- } elseif($resp->faultCode()) {
- $cli->setDebug(1);
- $resp = $cli->send($msg, "250");
- $error = "An error code was received while attempting pfJailctl XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
- log_error($error);
- file_notice("sync_settings", $error, "pfJailctl Settings Sync", "");
- } else {
- log_error("pfJailctl XMLRPC sync successfully completed with {$url}:{$port}.");
- }
- #echo "done.<br>";
-}
-
-function sync_package_jailctl() {
- global $config, $g;
- $jconfig=$config['installedpackages']['pfjailctlsettings']['config'][0];
- $jails=$config['installedpackages']['pfjailctl']['config'];
- is_array($jails) ? $num_jails=count($jails) : $num_jails=0;
-
- $jdefaultif=$config['interfaces']['lan']['if'];
-
- conf_mount_rw();
- config_lock();
- $fd = fopen("/usr/local/etc/jails.conf","w");
-
- fwrite($fd, 'IF="'.$jdefaultif.'"'."\n");
- fwrite($fd, 'JAIL_HOME="'.$jconfig['jstorage'].'/"'."\n");
- fwrite($fd, 'BACKUPDIR="'.$jconfig['jbackup'].'"'."\n");
- fwrite($fd, 'BACKUP_EXCLUDE="'.$jconfig['jbackupexcludes'].'"'."\n");
- fwrite($fd, 'INSTALLWORLD_FLAGS="'.$jconfig['jinstallflags'].'"'."\n");
- fwrite($fd, 'BATCH="'.$jconfig['jbatchcreate'].'"'."\n");
- fwrite($fd, 'ROOT_PW="'.$jconfig['jpasswd'].'"'."\n");
- fwrite($fd, 'NAMESERVERS="'.$jconfig['jdnsservers'].'"'."\n");
- fwrite($fd, 'RC_CONF=\''.$jconfig['jrcconf'].'\''."\n");
-
- fwrite($fd, "\nJAILS=''\n");
-
- $_rcfile['file']='jails.sh';
- $_rcfile['start']='';
- $_rcfile['stop']='';
- if($num_jails) {
- for ($i=0;$i<$num_jails;$i++) {
- $jname=$jails[$i]['jname'];
- $jpath=$jconfig['jstorage']."/".$jname."/";
- $jif=$jails[$i]['jif'];
- if(is_ipaddr($jif)) {
- $jip=$jif;
- #$jif=guess_interface_from_ip($jif);
- $jif=jailctl_find_if($jif);
- } else {
- $jif=$config['interfaces'][$jails[$i]['jif']]['if'];
- $jip=$jails[$i]['jip'];
- }
-
- $_cfg="JAILS=\"\$JAILS $jname:$jip;$jpath;$jif\"\n";
- fwrite($fd, $_cfg);
-
- if($jails[$i]['jautostart']=='on') {
- $_rcfile['start'].="/usr/local/sbin/jailctl start $jname \n\t";
- $_rcfile['stop'].="/usr/local/sbin/jailctl stop $jname \n\t";
- }
- }
- }
-
- write_rcfile($_rcfile);
- fclose($fd);
- jailctl_do_xmlrpc_sync($config);
-}
-
-?>
diff --git a/config/archive/jailctl/jailctl.xml b/config/archive/jailctl/jailctl.xml
deleted file mode 100644
index 4c96f88d..00000000
--- a/config/archive/jailctl/jailctl.xml
+++ /dev/null
@@ -1,233 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <description>Jail management</description>
- <requirements>Disk space...</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>pfJailctl</name>
- <version>0.1</version>
- <title>Jails</title>
- <!-- Menu is where this packages menu will appear -->
- <menu>
- <name>Jails</name>
- <tooltiptext>Jail management</tooltiptext>
- <section>Services</section>
- <configfile>jailctl.xml</configfile>
- </menu>
- <service>
- <name>Jails</name>
- <rcfile>jails.sh</rcfile>
- <description>All jails with autostart enabled.</description>
- <custom_php_service_status_command>
- include("/usr/local/pkg/jailctl.inc");
- jailctl_servicestatus();
- </custom_php_service_status_command>
- </service>
- <!-- configpath gets expanded out automatically and config items will be
- stored in that location -->
- <configpath>['installedpackages']['$packagename']['config']</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/jailctl_defaults.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/jailctl_settings.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/jailctl.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/jailctl-utils.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/jailctl_list.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/sbin/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/jailctl/jailctl</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/sbin/</prefix>
- <chmod>0755</chmod>
- <item>http://www.mundounix.com.br/~gugabsd/sysinstall</item>
- </additional_files_needed>
-
- <tabs>
- <tab>
- <text>Jails</text>
- <url>/pkg.php?xml=jailctl.xml</url>
- <active/>
- </tab>
- <tab>
- <text>Global settings</text>
- <url>/pkg_edit.php?xml=jailctl_settings.xml&amp;id=0</url>
- </tab>
-<!-- <tab>
- <text>Jail defaults</text>
- <url>/pkg_edit.php?xml=jailctl_defaults.xml&amp;id=0</url>
- </tab> -->
- </tabs>
-
-
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>State</fielddescr>
- <fieldname>jstate</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Jail name</fielddescr>
- <fieldname>jname</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Jail IF</fielddescr>
- <fieldname>jifdesc</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Jail IP</fielddescr>
- <fieldname>jip</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Jail path</fielddescr>
- <fieldname>jpath</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Actions</fielddescr>
- <fieldname>jactions</fieldname>
- </columnitem>
-
- </adddeleteeditpagefields>
-
- <fields>
- <field>
- <fielddescr>Jail hostname</fielddescr>
- <fieldname>jname</fieldname>
- <description>FQDN of the jail</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Network interface</fielddescr>
- <fieldname>jif</fieldname>
- <description>Jail will be bound to this interface</description>
- <type>interfaces_selection</type>
- </field>
- <field>
- <fielddescr>IP address</fielddescr>
- <fieldname>jip</fieldname>
- <description>Must be in the same subnet as the parent interface</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Autostart jail on boot?</fielddescr>
- <fieldname>jautostart</fieldname>
- <description>Start this jail automatically when the system boots?</description>
- <type>checkbox</type>
- </field>
-
-
- <field>
- <fielddescr>Jail templates</fielddescr>
- <fieldname>jselect_templates</fieldname>
- <type>listtopic</type>
- <name>Select a predefined template for your jail:</name>
- </field>
- <field>
- <fielddescr>Templates</fielddescr>
- <fieldname>jtemplates</fieldname>
- <description>Files from the templates will be read-only inside the jail.</description>
- <type>select</type>
- <options>
- <option><name> --- select --- </name><value></value></option>
- </options>
- <default_value>jtemplate_default</default_value>
- </field>
- <field>
- <fielddescr>Use unionfs</fielddescr>
- <fieldname>juse_unionfs</fieldname>
- <description>Use unionfs instead of nullfs to mount the template contents into the jail</description>
- <type>checkbox</type>
- </field>
-
- <field>
- <fielddescr>Package sets</fielddescr>
- <fieldname>jselect_sets</fieldname>
- <type>listtopic</type>
- <name>OR select a distribution set to install:</name>
- </field>
- <field>
- <fielddescr>Distribution sets</fielddescr>
- <fieldname>jdistset</fieldname>
- <description>Select a standard set of distributions to install</description>
- <type>select</type>
- <options>
- <option><name> --- select --- </name><value></value></option>
- <option><name>User (binaries only)</name><value>distSetUser</value></option>
- <option><name>Developer (src/all, binaries)</name><value>distSetDeveloper</value></option>
- <option><name>Kernel developer (src/kern, binaries)</name><value>distSetKernDeveloper</value></option>
- <option><name>Minimum (minimal binaries)</name><value>distSet</value></option>
- </options>
- <default_value></default_value>
- </field>
-
- <field>
- <fielddescr>Individual packages</fielddescr>
- <fieldname>jselect_individual</fieldname>
- <type>listtopic</type>
- <name>OR select individual distributions in addition to 'base':</name>
- </field>
-
- <field>
- <fielddescr>Individual distributions</fielddescr>
- <fieldname>jdists</fieldname>
- <description>Select individual distributions (multiple selection)</description>
- <type>select</type>
- <options>
- <option><name>Manual pages</name><value>manpages</value></option>
- <option><name>The Ports collection</name><value>ports</value></option>
- <option><name>Miscellaneous documentation</name><value>doc</value></option>
- <option><name>Local additions collection</name><value>local</value></option>
- <option><name>X.org client binaries</name><value>Xbin</value></option>
- <option><name>X.org libraries</name><value>Xlib</value></option>
- <option><name>X.org manual pages</name><value>Xman</value></option>
- <option><name>X.org imake distribution</name><value>Xprog</value></option>
- <option><name>Games</name><value>games</value></option>
- </options>
- <multiple/>
- </field>
-
- </fields>
-
-
- <!-- php hooks -->
- <include_file>/usr/local/pkg/jailctl_list.inc</include_file>
- <custom_add_php_command>
- sync_package_jailctl();
- </custom_add_php_command>
- <custom_delete_php_command>
- jailctl_delete();
- </custom_delete_php_command>
- <custom_php_resync_config_command>
- sync_package_jailctl();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- jailctl_install();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- jailctl_deinstall();
- </custom_php_deinstall_command>
- <custom_php_after_form_command>
- jailctl_addinterfaces($config);
- jailctl_addtemplates($config);
- </custom_php_after_form_command>
-</packagegui>
-
diff --git a/config/archive/jailctl/jailctl_defaults.xml b/config/archive/jailctl/jailctl_defaults.xml
deleted file mode 100644
index c499abcb..00000000
--- a/config/archive/jailctl/jailctl_defaults.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <description>Jail management</description>
- <requirements>Built world in /usr/obj</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>pfJailctl_Defaults</name>
- <version>0.1</version>
- <title>Jails: Jail building defaults</title>
- <!-- configpath gets expanded out automatically and config items will be
- stored in that location -->
- <configpath>['installedpackages']['package']['$packagename']['config']</configpath>
-
- <tabs>
- <tab>
- <text>Jails</text>
- <url>/pkg.php?xml=jailctl.xml</url>
- </tab>
- <tab>
- <text>Global settings</text>
- <url>/pkg_edit.php?xml=jailctl_settings.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Jail defaults</text>
- <url>/pkg_edit.php?xml=jailctl_defaults.xml&amp;id=0</url>
- <active/>
- </tab>
- </tabs>
-
- <fields>
- <field>
- <fielddescr>Package sets</fielddescr>
- <fieldname>jdist_select_sets</fieldname>
- <type>listtopic</type>
- <name>Select a distribution set:</name>
- </field>
- <field>
- <fielddescr>Distribution set</fielddescr>
- <fieldname>jdist_set</fieldname>
- <description>Select a standard set of distributions to install</description>
- <type>select</type>
- <value>eng</value>
- <options>
- <option><name>Developer (src/all, binaries)</name><value>distSetDeveloper</value></option>
- <option><name>Kernel developer (src/kern, binaries)</name><value>distSetKernDeveloper</value></option>
- <option><name>User (binaries only)</name><value>distSetUser</value></option>
- <option><name>Minimum (minimal binaries)</name><value>distSet</value></option>
- </options>
- <default_value>distSetUser</default_value>
- </field>
- <field>
- <fielddescr>Individual packages</fielddescr>
- <fieldname>jdist_select_individual</fieldname>
- <type>listtopic</type>
- <name>OR select individual distributions in addition to base:</name>
- </field>
- <field>
- <fielddescr>Manual pages</fielddescr>
- <fieldname>jdist_manpages</fieldname>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Games</fielddescr>
- <fieldname>jdist_games</fieldname>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>The Ports collection</fielddescr>
- <fieldname>jdist_ports</fieldname>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Miscellaneous documentation</fielddescr>
- <fieldname>jdist_doc</fieldname>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>X.Org client binaries</fielddescr>
- <fieldname>jdist_xbin</fieldname>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>X.Org libraries</fielddescr>
- <fieldname>jdist_xlib</fieldname>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>X.Org manual pages</fielddescr>
- <fieldname>jdist_xman</fieldname>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>X.Org imake distribution</fielddescr>
- <fieldname>jdist_xprog</fieldname>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Local additions collection</fielddescr>
- <fieldname>jdist_local</fieldname>
- <type>checkbox</type>
- </field>
- </fields>
-
-
- <!-- php hooks -->
- <include_file>/usr/local/pkg/jailctl.inc</include_file>
- <custom_add_php_command>
- sync_package_jailctl();
- </custom_add_php_command>
- <custom_delete_php_command>
- sync_package_jailctl();
- </custom_delete_php_command>
- <custom_php_resync_config_command>
- sync_package_jailctl();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- </custom_php_install_command>
- <custom_php_deinstall_command>
- </custom_php_deinstall_command>
-</packagegui>
-
diff --git a/config/archive/jailctl/jailctl_list.inc b/config/archive/jailctl/jailctl_list.inc
deleted file mode 100644
index d1869bd6..00000000
--- a/config/archive/jailctl/jailctl_list.inc
+++ /dev/null
@@ -1,112 +0,0 @@
-<?php
-include('/usr/local/pkg/jailctl.inc');
-
-$jconfig=$config['installedpackages']['pfjailctlsettings']['config'][0];
-$jails=$config['installedpackages']['pfjailctl']['config'];
-is_array($jails) ? $num_jails=count($jails) : $num_jails=0;
-
-
-if($num_jails) {
- for ($i=0;$i<$num_jails;$i++) {
- $jail=$jails[$i];
- $jstatus=jailctl_jailstatus($config, $jail);
- $_path=$jstatus['jpath'];
- $_name=$jail['jname'];
- $_ip=$jail['jip'];
- $_hostname=$jstatus['jhostname'];
- $_dnsservers=$jconfig['jdnsservers'];
- $_passwd=$jconfig['jpasswd'];
- $_template=$jail['jtemplates'];
- $mounts=$GLOBALS['jailctl_tmp']['mounts'];
- $unionmounts=$GLOBALS['jailctl_tmp']['unionmounts'];
- $mount_unionfs=$GLOBALS['jailctl_tmp']['mount_unionfs'];
- $mount_nullfs=$GLOBALS['jailctl_tmp']['mount_nullfs'];
-
- if($_GET['jaction'] && $_GET['id']==$i) {
- switch ($_GET['jaction']) {
- case 'create':
-# if($jstate!='New') break;
- jailctl_create($config, $jail);
- if($jconfig['debug']) {
- echo("Create script:<br><pre>");
- echo(file_get_contents("/tmp/jcreate_".$_name));
- echo("</pre>");
- } else {
- header('Location: /pkg.php?xml=jailctl.xml');
- }
- flush();
- exit;
-
- case 'start':
-# if($jstate!='Stopped') break;
- exec('umount -f '.$_path.'/dev');
- if($_template) {
- $jail['juse_unionfs']=='on' ? $mount=$mount_unionfs : $mount=$mount_nullfs ;
- foreach($mounts as $mp) {
- exec($mount.' '.$_template.'/'.$mp.' '.$_path.'/'.$mp, $_cmd);
- }
- foreach($unionmounts as $mp) {
- exec($mount_unionfs.' '.$_template.'/'.$mp.' '.$_path.'/'.$mp, $_cmd);
- }
- }
-
- $cmd='jailctl start '.$_name;
- exec($cmd, $_cmd);
- if($jconfig['debug']) {
- echo("<script>alert('".addcslashes(implode("\\n", $_cmd), "'")."'); this.location.replace('/pkg.php?xml=jailctl.xml');</script>");
- } else {
- header('Location: /pkg.php?xml=jailctl.xml');
- }
- flush();
- exit;
-
- case 'stop':
-# if($jstate!='Running') break;
- $cmd='jailctl stop '.$_name;
- exec($cmd, $_cmd);
- if($_template) {
- foreach($mounts as $mp) {
- exec('umount -f '.$_template.'/'.$mp.' '.$_path.'/'.$mp, $_cmd);
- }
- foreach($unionmounts as $mp) {
- exec('umount -f '.$_template.'/'.$mp.' '.$_path.'/'.$mp, $_cmd);
- }
- }
- exec('umount -f '.$_path.'/dev');
- if($jconfig['debug']) {
- echo("<script>alert('".addcslashes(implode("\\n", $_cmd), "'")."'); this.location.replace('/pkg.php?xml=jailctl.xml');</script>");
- } else {
- header('Location: /pkg.php?xml=jailctl.xml');
- }
- flush();
- exit;
- }
- }
-
- $config['installedpackages']['pfjailctl']['config'][$i]['jstate']=$jstatus['jstate'];
- $config['installedpackages']['pfjailctl']['config'][$i]['jpath']=$jstatus['jpath'];
- $config['installedpackages']['pfjailctl']['config'][$i]['jifdesc']=
- $jstatus['jifdesc']." (".$jstatus['jrealif'].")";
-
- $jactions=Array();
- switch ($jstatus['jstate']) {
- case 'Building':
- $jactions[]="";
- break;
- case 'New':
- $jactions[]="<a href='/pkg.php?xml=jailctl.xml&jaction=create&id=".$i."'>Create</a>";
- break;
- case 'Stopped':
- $jactions[]="<a href='/pkg.php?xml=jailctl.xml&jaction=start&id=".$i."'>Start</a>";
- #$jactions[]="<a href='/pkg.php?xml=jailctl.xml&jaction=upgrade&id=".$i."'>Upgrade</a>";
- break;
- case 'Running':
- $jactions[]="<a href='/pkg.php?xml=jailctl.xml&jaction=stop&id=".$i."'>Stop</a>";
- break;
- }
- $config['installedpackages']['pfjailctl']['config'][$i]['jactions']=implode(' | ', $jactions);
- }
-}
-
-
-?> \ No newline at end of file
diff --git a/config/archive/jailctl/jailctl_settings.xml b/config/archive/jailctl/jailctl_settings.xml
deleted file mode 100644
index ae09adaf..00000000
--- a/config/archive/jailctl/jailctl_settings.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <description>Jail management</description>
- <requirements>Built world in /usr/obj</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>pfJailctl_Settings</name>
- <version>0.1</version>
- <title>Jails: Settings</title>
- <!-- configpath gets expanded out automatically and config items will be
- stored in that location -->
- <configpath>['installedpackages']['$packagename']['config']</configpath>
-
- <tabs>
- <tab>
- <text>Jails</text>
- <url>/pkg.php?xml=jailctl.xml</url>
- </tab>
- <tab>
- <text>Global settings</text>
- <url>/pkg_edit.php?xml=jailctl_settings.xml&amp;id=0</url>
- <active/>
- </tab>
-<!-- <tab>
- <text>Jail defaults</text>
- <url>/pkg_edit.php?xml=jailctl_defaults.xml&amp;id=0</url>
- </tab> -->
- </tabs>
-
- <fields>
- <field>
- <fielddescr>FTP mirror</fielddescr>
- <fieldname>jftpmirror</fieldname>
- <description>Select a FTP server (mirror) to use for sysinstall</description>
- <type>select</type>
- <options>
- <option><name>ftp-archive.freebsd.org</name><value>ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/</value></option>
- </options>
- <default_value>ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/</default_value>
- </field>
- <field>
- <fielddescr>DNS servers</fielddescr>
- <description>DNS servers to be added to /etc/resolv.conf of jails, space separated IP addresses</description>
- <fieldname>jdnsservers</fieldname>
- <type>textarea</type>
- </field>
- <field>
- <fielddescr>Location for jails</fielddescr>
- <fieldname>jstorage</fieldname>
- <description>Jails will be stored here</description>
- <type>input</type>
- <default>/usr/local/jails</default>
- <default_value>/usr/local/jails</default_value>
- </field>
- <field>
- <fielddescr>Location for jail backups</fielddescr>
- <fieldname>jbackup</fieldname>
- <description>Backups are .tgz files of the jail directory</description>
- <type>input</type>
- <default_value>/usr/local/jails</default_value>
- </field>
- <field>
- <fielddescr>Files to exclude from backup</fielddescr>
- <fieldname>jbackupexcludes</fieldname>
- <description>Files to exclude from backup</description>
- <type>input</type>
- <default_value>--exclude ./usr/ports/* --exclude ./tmp/* --exclude ./var/tmp/* --exclude ./usr/src/*</default_value>
- </field>
- <field>
- <fielddescr>System configuration</fielddescr>
- <fieldname>jrcconf</fieldname>
- <type>rowhelper</type>
- <rowhelper>
- <rowhelperfield>
- <fielddescr>Lines to add to /etc/rc.conf</fielddescr>
- <type>input</type>
- <size>25</size>
- <fieldname>rcconfline</fieldname>
- </rowhelperfield>
- </rowhelper>
- </field>
- <field>
- <fielddescr>Default password for jails</fielddescr>
- <fieldname>jpasswd</fieldname>
- <description>Set to &quot;system&quot; by default.&lt;br&gt;
- &lt;b&gt;NOTE: Only type here if you want to change the current default password!&lt;/b&gt;&lt;br&gt;
- This field will show as empty even if a password has been set. Changing this will not affect existing jails.</description>
- <type>password</type>
- <default_value>system</default_value>
- </field>
- <field>
- <fielddescr>Debug mode</fielddescr>
- <fieldname>debug</fieldname>
- <type>checkbox</type>
- <description>Enable debug information do be shown by the GUI</description>
- </field>
-
- </fields>
-
-
- <!-- php hooks -->
- <include_file>/usr/local/pkg/jailctl.inc</include_file>
- <custom_add_php_command>
- sync_package_jailctl();
- </custom_add_php_command>
- <custom_delete_php_command>
- sync_package_jailctl();
- </custom_delete_php_command>
- <custom_php_resync_config_command>
- sync_package_jailctl();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- </custom_php_install_command>
- <custom_php_deinstall_command>
- </custom_php_deinstall_command>
-</packagegui>
-
diff --git a/config/archive/jailctl/sysinstall b/config/archive/jailctl/sysinstall
deleted file mode 100755
index d4a05fb1..00000000
--- a/config/archive/jailctl/sysinstall
+++ /dev/null
Binary files differ
diff --git a/config/archive/p3scan-pf/p3scan-pf-emer.xml b/config/archive/p3scan-pf/p3scan-pf-emer.xml
deleted file mode 100644
index da39aef8..00000000
--- a/config/archive/p3scan-pf/p3scan-pf-emer.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <!-- change this if configpath works -->
- <name>p3scanpfemer</name>
- <version>1.0</version>
- <title>Services: POP3 Proxy: Emergency Contact</title>
- <include_file>p3scan-pf.inc</include_file>
- <tabs>
- <tab>
- <text>Daemon Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Transparent Proxy Exclusion</text>
- <url>/pkg.php?xml=p3scan-pf-transex.xml</url>
- </tab>
- <tab>
- <text>Message Processing</text>
- <url>/pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Emergency Contact</text>
- <url>/pkg.php?xml=p3scan-pf-emer.xml</url>
- <active />
- </tab>
- <tab>
- <text>Virus Scanner Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>SPAM Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</url>
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['p3scanpf']['config']['contacts']</configpath>
- <!--
- adddeleteeditpagefields items will appear on the first page where you can
- add / delete or edit items. An example of this would be the nat page where
- you add new nat redirects
- -->
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Email Address</fielddescr>
- <fieldname>emailaddress</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <fields>
- <field>
- <fielddescr>Email Address</fielddescr>
- <fieldname>emailaddress</fieldname>
- <description>
- In the event p3scan encounters a catastrophic problem and has to terminate,
- it will send an email to these email addresses just before setting up to
- close down on the next iteration of a child process.
- </description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>Description.</description>
- <type>input</type>
- </field>
- </fields>
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_delete_php_command>
- sync_package_p3scan();
- </custom_delete_php_command>
- <custom_php_resync_config_command>
- sync_package_p3scan();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/archive/p3scan-pf/p3scan-pf-msg.xml b/config/archive/p3scan-pf/p3scan-pf-msg.xml
deleted file mode 100644
index d3f81aa2..00000000
--- a/config/archive/p3scan-pf/p3scan-pf-msg.xml
+++ /dev/null
@@ -1,202 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <!-- change this if configpath works -->
- <name>p3scanpfmsg</name>
- <version>1.0</version>
- <title>Services: POP3 Proxy: Message Processing</title>
- <note>
- This &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt; page uses default values, hence even if each field is
- set, you are still required to save this page if you are editing this page
- for the very first time!
- </note>
- <aftersaveredirect>pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</aftersaveredirect>
- <include_file>p3scan-pf.inc</include_file>
- <tabs>
- <tab>
- <text>Daemon Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Transparent Proxy Exclusion</text>
- <url>/pkg.php?xml=p3scan-pf-transex.xml</url>
- </tab>
- <tab>
- <text>Message Processing</text>
- <url>/pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</url>
- <active />
- </tab>
- <tab>
- <text>Emergency Contact</text>
- <url>/pkg.php?xml=p3scan-pf-emer.xml</url>
- </tab>
- <tab>
- <text>Virus Scanner Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>SPAM Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</url>
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['p3scanpf']['config']['messaging']</configpath>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <fields>
- <field>
- <fielddescr>Just Delete</fielddescr>
- <fieldname>justdelete</fieldname>
- <description>
- Instead of keeping an infected message in the Virus Directory, delete it
- after reporting it to the user.
- </description>
- <type>checkbox</type>
- <donotdisable>true</donotdisable>
- </field>
- <field>
- <fielddescr>Bytes Free</fielddescr>
- <fieldname>bytesfree</fieldname>
- <description>The number of KB's there must be free before processing any mail.</description>
- <type>input</type>
- <required />
- <default_value>10000</default_value>
- </field>
- <field>
- <fielddescr>Broken Email Clients</fielddescr>
- <fieldname>brokenec</fieldname>
- <description>
- Some email clients may require special processing.
- </description>
- <type>checkbox</type>
- <donotdisable>true</donotdisable>
- </field>
- <field>
- <fielddescr>ISP Spam</fielddescr>
- <fieldname>ispspam</fieldname>
- <description>
- This option allows you to set the string your &lt;acronym title=&quot;Internet Service Provider&quot;&gt;ISP&lt;/acronym&gt; uses if it processes
- your email for SPAM. Leave this field blank if you are not going to use
- this option.
- </description>
- <type>input</type>
- <default_value>-- Spam --</default_value>
- </field>
- <field>
- <fielddescr>Subject</fielddescr>
- <fieldname>subject</fieldname>
- <description>
- This option can be used to change the default subject line when
- reporting a virus infected message.
- </description>
- <type>input</type>
- <size>60</size>
- <required />
- <default_value>Subject: "[Virus] found in a mail to you:" &lt;virus name&gt;</default_value>
- </field>
- <field>
- <fielddescr>Notify</fielddescr>
- <fieldname>notify</fieldname>
- <description>
- This option can be used to change the default file deleted notification
- that is displayed in the virus notification message when the
- &quot;justdelete&quot; option is used.
- </description>
- <type>input</type>
- <size>60</size>
- <required />
- <default_value>Per instruction, the message has been deleted.</default_value>
- </field>
- <field>
- <fielddescr>SMTP Reject</fielddescr>
- <fieldname>smtpreject</fieldname>
- <description>
- This option can be used to change the default &lt;acronym title=&quot;Simple Mail Transfer Protocol&quot;&gt;SMTP&lt;/acronym&gt; Reject message that
- is sent to the client in the event a message is rejected due to a virus.
- The error message will have a prefix of &quot;554&quot;.
- </description>
- <type>input</type>
- <size>60</size>
- <required />
- <default_value>Virus detected! P3scan rejected message!</default_value>
- </field>
- <field>
- <fielddescr>Check SMTP size</fielddescr>
- <fieldname>checksize</fieldname>
- <description>
- This option can be used to set the maximum message size (in KBytes)
- that p3scan will use to determine if it should scan an smtp submission.
- Leave this field blank if you are not going to use this option.
- </description>
- <type>input</type>
- <default_value>1024</default_value>
- </field>
- <field>
- <fielddescr>Footer</fielddescr>
- <fieldname>footer</fieldname>
- <description>
- This option is used to add the virus definition info from your scanner
- to an SMTP message. Leave this field blank if you are not going to use
- this option.
- </description>
- <type>input</type>
- <size>40</size>
- <default_value>/usr/local/bin/clamdscan -V</default_value>
- </field>
- </fields>
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_php_resync_config_command>
- sync_package_p3scan();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/archive/p3scan-pf/p3scan-pf-spam.xml b/config/archive/p3scan-pf/p3scan-pf-spam.xml
deleted file mode 100644
index 86301a50..00000000
--- a/config/archive/p3scan-pf/p3scan-pf-spam.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <!-- change this if configpath works -->
- <name>p3scanpfspam</name>
- <version>1.0</version>
- <title>Services: POP3 Proxy: SPAM Settings</title>
- <note>
- This &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt; page uses default values, hence even if each field is
- set, you are still required to save this page if you are editing this page
- for the very first time!
- </note>
- <aftersaveredirect>pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</aftersaveredirect>
- <include_file>p3scan-pf.inc</include_file>
- <tabs>
- <tab>
- <text>Daemon Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Transparent Proxy Exclusion</text>
- <url>/pkg.php?xml=p3scan-pf-transex.xml</url>
- </tab>
- <tab>
- <text>Message Processing</text>
- <url>pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Emergency Contact</text>
- <url>/pkg.php?xml=p3scan-pf-emer.xml</url>
- </tab>
- <tab>
- <text>Virus Scanner Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>SPAM Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</url>
- <active />
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['p3scanpf']['config']['spam']</configpath>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <fields>
- <field>
- <fielddescr>Enable Spam Checking</fielddescr>
- <fieldname>checkspam</fieldname>
- <description>
- If set, will scan for Spam before scanning for a virus.
- </description>
- <type>checkbox</type>
- <donotdisable>true</donotdisable>
- <enablefields>spamcheck</enablefields>
- </field>
- <field>
- <fielddescr>SPAM Executable Command</fielddescr>
- <fieldname>spamcheck</fieldname>
- <description>The command (plus arguments) that should be invoked to check for SPAM messages.</description>
- <type>input</type>
- <size>70</size>
- <!-- the below tag plus its inline text must be on one single line. -->
- <default_value>/usr/local/bin/dspam --user dspamuser --mode=teft --stdout --deliver=innocent,spam --feature=ch,no,wh</default_value>
- </field>
- </fields>
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_php_resync_config_command>
- sync_package_p3scan();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/archive/p3scan-pf/p3scan-pf-transex.xml b/config/archive/p3scan-pf/p3scan-pf-transex.xml
deleted file mode 100644
index e1b2070a..00000000
--- a/config/archive/p3scan-pf/p3scan-pf-transex.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <!-- change this if configpath works -->
- <name>p3scanpftransex</name>
- <version>1.0</version>
- <title>Services: POP3 Proxy: Exclude from Transparent Proxy</title>
- <note>
- Below you will have the opportunity to define specific IP addresses
- which should be exempt from beeing served via transparent proxying.
- </note>
- <include_file>p3scan-pf.inc</include_file>
- <tabs>
- <tab>
- <text>Daemon Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Transparent Proxy Exclusion</text>
- <url>/pkg.php?xml=p3scan-pf-transex.xml</url>
- <active />
- </tab>
- <tab>
- <text>Message Processing</text>
- <url>/pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Emergency Contact</text>
- <url>/pkg.php?xml=p3scan-pf-emer.xml</url>
- </tab>
- <tab>
- <text>Virus Scanner Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>SPAM Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</url>
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['p3scanpf']['config']['virus']</configpath>
-
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Exempted IP</fielddescr>
- <fieldname>ip</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <fields>
- <field>
- <fielddescr>Exempted IP</fielddescr>
- <fieldname>ip</fieldname>
- <description>Enter the IP to exempt from transparent proxy</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>Enter the description for this item</description>
- <type>input</type>
- </field>
- </fields>
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_php_resync_config_command>
- sync_package_p3scan();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/archive/p3scan-pf/p3scan-pf-vir.xml b/config/archive/p3scan-pf/p3scan-pf-vir.xml
deleted file mode 100644
index d96e8a87..00000000
--- a/config/archive/p3scan-pf/p3scan-pf-vir.xml
+++ /dev/null
@@ -1,166 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <!-- change this if configpath works -->
- <name>p3scanpfvir</name>
- <version>1.0</version>
- <title>Services: POP3 Proxy: Virus Scanner Settings</title>
- <note>
- This &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt; page uses default values, hence even if each field is
- set, you are still required to save this page if you are editing this page
- for the very first time!
- </note>
- <aftersaveredirect>pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</aftersaveredirect>
- <include_file>p3scan-pf.inc</include_file>
- <tabs>
- <tab>
- <text>Daemon Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Transparent Proxy Exclusion</text>
- <url>/pkg.php?xml=p3scan-pf-transex.xml</url>
- </tab>
- <tab>
- <text>Message Processing</text>
- <url>/pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Emergency Contact</text>
- <url>/pkg.php?xml=p3scan-pf-emer.xml</url>
- </tab>
- <tab>
- <text>Virus Scanner Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</url>
- <active />
- </tab>
- <tab>
- <text>SPAM Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</url>
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['p3scanpf']['config']['virus']</configpath>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <fields>
- <field>
- <fielddescr>Scanner Type</fielddescr>
- <fieldname>scannertype</fieldname>
- <description>Select here which type of scanner you want to use.</description>
- <type>select</type>
- <size>1</size>
- <default_value>clamd</default_value>
- <options>
- <option><name>Kaspersky Anti-Virus for Linux</name><value>avpd</value></option>
- <option><name>Kaspersky Anti-Virus for Linux (New)</name><value>avpd_new</value></option>
- <option><name>Shell Script</name><value>bash</value></option>
- <option><name>Default Scanner Type</name><value>basic</value></option>
- <option><name>Clam Anti-Virus</name><value>clamd</value></option>
- <option><name>Trophie Daemon</name><value>trophie</value></option>
- </options>
- </field>
- <field>
- <fielddescr>Virusscanner</fielddescr>
- <fieldname>scanner</fieldname>
- <description>Depends on scannertype.</description>
- <type>input</type>
- <required />
- <default_value>127.0.0.1:3310</default_value>
- </field>
- <field>
- <fielddescr>Scanner Returncode</fielddescr>
- <fieldname>viruscode</fieldname>
- <description>
- Specify the returncode(s) which the scanner returns when
- the mail is infected.
- </description>
- <type>input</type>
- <default_value>1</default_value>
- </field>
- <field>
- <fielddescr>Good Scanner return codes</fielddescr>
- <fieldname>goodcode</fieldname>
- <description>
- Some scanners can report more than good or infected. Place valid return
- codes here that will enable the message to be delivered without a warning.
- </description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Regular Expression for Virusname</fielddescr>
- <fieldname>virusregexp</fieldname>
- <description>
- Specify here a regular expression which describes where the name of
- the virus can be found.
- </description>
- <type>input</type>
- <default_value>.*: (.*) FOUND</default_value>
- </field>
- <field>
- <fielddescr>deMIME Setting</fielddescr>
- <fieldname>demime</fieldname>
- <description>
- Tick this if we should parse all &lt;acronym title=&quot;Multipurpose Internet Mail Extensions&quot;&gt;MIME&lt;/acronym&gt;-sections instead of passing the
- message as-is to the scanner.
- </description>
- <type>checkbox</type>
- <donotdisable>true</donotdisable>
- </field>
- </fields>
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_php_resync_config_command>
- sync_package_p3scan();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/archive/p3scan-pf/p3scan-pf.inc b/config/archive/p3scan-pf/p3scan-pf.inc
deleted file mode 100644
index b6f497b2..00000000
--- a/config/archive/p3scan-pf/p3scan-pf.inc
+++ /dev/null
@@ -1,395 +0,0 @@
-<?php
-/* $Id$ */
-/*
- $RCSfile$
- Copyright (C) 2006 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Copyright (C) 2006 Fernando Lemos
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notices,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notices, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/* ====================== USAGE NOTE: ====================== */
-/* Depending on your use case scenario, this software may */
-/* depend on the following software packages: */
-/* */
-/* - renatach (part of the FreeBSD ports collection) */
-/* - a virus scanner (e.g. ClamAV) */
-/* - a spam filter (e.g. DSPAM or SpamAssassin) */
-/* ========================================================= */
-
-
-/* include all configuration functions */
-require_once("functions.inc");
-require_once("notices.inc");
-
-function sync_package_p3scan() {
- global $config, $g;
- conf_mount_rw();
- config_lock();
- $fd = fopen("/etc/p3scan.conf","w");
-
- /* shorten the config path */
- $cfg = $config['installedpackages']['p3scanpf']['config'][0];
- $cfgmsg = $config['installedpackages']['p3scanpfmsg']['config'][0];
- $cfgemer = $config['installedpackages']['p3scanpfemer']['config'];
- $cfgvir = $config['installedpackages']['p3scanpfvir']['config'][0];
- $cfgspam = $config['installedpackages']['p3scanpfspam']['config'][0];
-
- fwrite($fd, "## p3scan-pf config file - generated by pfSense.\n##\n");
- fwrite($fd, "## at: " . date("l dS of F Y h:i:s A") . "\n##\n");
- /* ================================================================ */
- /* == Tab: Daemon Settings == */
- /* ================================================================ */
- fwrite($fd, "## Daemon Settings.\n");
- fwrite($fd, "pidfile = /var/run/p3scan/p3scan.pid\n");
- if (isset($cfg['maxchilds']) && $cfg['maxchilds'] <> "")
- fwrite($fd, "maxchilds = {$cfg['maxchilds']}\n");
- else
- fwrite($fd, "maxchilds = 10\n");
- if (isset($cfg['ipaddr']) && $cfg['ipaddr'] <> "")
- fwrite($fd, "ip = {$cfg['ipaddr']}\n");
- else
- fwrite($fd, "ip = 127.0.0.1\n");
- if (isset($cfg['port']) && $cfg['port'] <> "")
- fwrite($fd, "port = {$cfg['port']}\n");
- else
- fwrite($fd, "port = 8110\n");
- if (isset($cfg['sslport']) && $cfg['sslport'] <> "")
- fwrite($fd, "sslport = {$cfg['sslport']}\n");
- else
- fwrite($fd, "sslport = 995\n");
- if (isset($cfg['targetip']) && $cfg['targetip'] <> "") {
- if ($cfg['targetip'] == "0.0.0.0")
- setup_transparency();
- else
- remove_transparency();
- fwrite($fd, "targetip = {$cfg['targetip']}\n");
- } else {
- setup_transparency();
- fwrite($fd, "targetip = 0.0.0.0\n");
- }
- if (isset($cfg['targetport']) && $cfg['targetport'] <> "")
- fwrite($fd, "targetport = {$cfg['targetport']}\n");
- else
- fwrite($fd, "targetport = 8110\n");
- if (isset($cfg['emailport']) && $cfg['emailport'] <> "")
- fwrite($fd, "emailport = {$cfg['emailport']}\n");
- else
- fwrite($fd, "emailport = 25\n");
- if (isset($cfg['daemonuser']) && $cfg['daemonuser'] <> "")
- fwrite($fd, "user = {$cfg['daemonuser']}\n");
- else
- fwrite($fd, "user = root\n");
- fwrite($fd, "notifydir = /var/spool/p3scan/notify\n");
- fwrite($fd, "virusdir = /var/spool/p3scan\n");
- fwrite($fd, "template = /usr/local/etc/p3scan/p3scan.mail\n");
-
- /* ================================================================ */
- /* == Tab: Message Processing == */
- /* ================================================================ */
- fwrite($fd, "## Message Processing Settings.\n");
- if (isset($cfgmsg['justdelete']) && $cfgmsg['justdelete'] <> "")
- fwrite($fd, "justdelete\n");
- if (isset($cfgmsg['bytesfree']) && $cfgmsg['bytesfree'] <> "")
- fwrite($fd, "bytesfree = {$cfgmsg['bytesfree']}\n");
- else
- fwrite($fd, "bytesfree = 10000\n");
- if (isset($cfgmsg['broken']) && $cfgmsg['broken'] <> "")
- fwrite($fd, "broken\n");
- if (isset($cfgmsg['timeout']) && $cfgmsg['timeout'] <> "")
- fwrite($fd, "timeout = {$cfgmsg['timeout']}\n");
- else
- fwrite($fd, "timeout = 30\n");
- if (isset($cfgmsg['ispspam']) && $cfgmsg['ispspam'] <> "")
- fwrite($fd, "ispspam = {$cfgmsg['ispspam']}\n");
- if (file_exists("/usr/local/bin/renattach"))
- fwrite($fd, "renattach = /usr/local/bin/renattach\n");
- if (isset($cfgmsg['subject']) && $cfgmsg['subject'] <> "")
- fwrite($fd, "subject = {$cfgmsg['subject']}\n");
- else
- fwrite($fd, "subject = Subject: \"[Virus] found in a mail to you:\" <virus name>\n");
- if (isset($cfgmsg['notify']) && $cfgmsg['notify'] <> "")
- fwrite($fd, "notify = {$cfgmsg['notify']}\n");
- else
- fwrite($fd, "notify = Per instruction, the message has been deleted.\n");
- if (isset($cfgmsg['smtpreject']) && $cfgmsg['smtpreject'] <> "")
- fwrite($fd, "smtprset = {$cfgmsg['smtpreject']}\n");
- else
- fwrite($fd, "smtprset = Virus detected! P3scan rejected message!\n");
- if (isset($cfgmsg['checksize']) && $cfgmsg['checksize'] <> "")
- fwrite($fd, "checksize = {$cfgmsg['checksize']}\n");
- if (isset($cfgmsg['footer']) && $cfgmsg['footer'] <> "")
- fwrite($fd, "footer = {$cfgmsg['footer']}\n");
-
- /* ================================================================ */
- /* == Tab: Emergency Contact == */
- /* ================================================================ */
- fwrite($fd, "## Emergency Contacts.\n");
- if (is_array($cfgemer)) {
- foreach ($cfgemer as $addr) {
- $contact .= "{$addr['emailaddress']} ";
- }
- if (isset($contact) && $contact <> "")
- fwrite($fd, "emergcon = {$contact}\n");
- }
-
- /* ================================================================ */
- /* == Tab: Virus Scanner Settings == */
- /* ================================================================ */
- fwrite($fd, "## Virus Scanner Settings.\n");
- if (isset($cfgvir['scannertype']) && $cfgvir['scannertype'] <> "")
- fwrite($fd, "scannertype = {$cfgvir['scannertype']}\n");
- else
- fwrite($fd, "scannertype = clamd\n");
- if (isset($cfgvir['scanner']) && $cfgvir['scanner'] <> "")
- fwrite($fd, "scanner = {$cfgvir['scanner']}\n");
- else
- fwrite($fd, "scanner = 127.0.0.1:3310\n");
- if (isset($cfgvir['viruscode']) && $cfgvir['viruscode'] <> "")
- fwrite($fd, "viruscode = {$cfgvir['viruscode']}\n");
- else
- fwrite($fd, "viruscode = 1\n");
- if (isset($cfgvir['goodcode']) && $cfgvir['goodcode'] <> "")
- fwrite($fd, "goodcode = {$cfgvir['goodcode']}\n");
- if (isset($cfgvir['virusregexp']) && $cfgvir['virusregexp'] <> "")
- fwrite($fd, "virusregexp = {$cfgvir['virusregexp']}\n");
- if (isset($cfgvir['demime']) && $cfgvir['demime'] <> "")
- fwrite($fd, "demime\n");
-
- /* ================================================================ */
- /* == Tab: SPAM Settings == */
- /* ================================================================ */
- if ((isset($cfgspam['checkspam']) && $cfgspam['checkspam'] <> "") ||
- $config['installedpackages']['sassassin']['config'][0]['enable'] == 'on') {
- fwrite($fd, "## SPAM Settings.\n");
- fwrite($fd, "checkspam\n");
- if (isset($cfgspam['spamcheck']) && $cfgspam['spamcheck'] <> "") {
- /* most times the command line for the spam binary becomes
- * quite lengthy, which my be the reason that users are
- * the XML tag and the command line itself into several
- * lines. Thus strip whitespaces.
- */
- $cfgspam['spamcheck'] = trim($cfgspam['spamcheck']);
- fwrite($fd, "spamcheck = {$cfgspam['spamcheck']}\n");
- } else {
- if ($config['installedpackages']['sassassin']['config'][0]['enable'] == 'on') {
- fwrite($fd, "spamcheck = /usr/bin/spamc\n");
- } else {
- fwrite($fd, "spamcheck = /usr/local/bin/dspam --user dspamuser --mode=teft --stdout --deliver=innocent,spam --feature=ch,no,wh\n");
- }
- }
- }
-
- fclose($fd);
-
- /* NOTE: The following code requires the p3scan-pf.inc file to
- * be saved with UNIX Linefeeds. LF that is and NOT CR LF.
- */
- $start = <<<EOD
-test_p3scan_user=`cat /etc/passwd | grep p3scan`
-test_p3scan_group=`cat /etc/passwd | grep p3scan`
-
-if [ -z "\${test_p3scan_group}" ]; then
- pw groupadd p3scan -g 108
-fi
-
-if [ -z "\${test_p3scan_user}" ]; then
- pw useradd p3scan -u 108 -g p3scan -d /var/spool/p3scan -s /sbin/nologin -c 'P3Scan Daemon'
-fi
-
-if [ ! -d "/var/spool/p3scan" ]; then
- mkdir /var/spool/p3scan && chown p3scan:p3scan /var/spool/p3scan
-fi
-
-if [ ! -d "/var/spool/p3scan/children" ]; then
- mkdir /var/spool/p3scan/children && chown p3scan:p3scan /var/spool/p3scan/children
-fi
-
-if [ ! -d "/var/spool/p3scannotify" ]; then
- mkdir /var/spool/p3scannotify && chown p3scan:p3scan /var/spool/p3scannotify
-fi
-
-if [ ! -d "/var/run/p3scan" ]; then
- mkdir /var/run/p3scan && chown p3scan:p3scan /var/run/p3scan
-fi
-
-/sbin/mount_fdescfs fdescfs /dev/fd
-/usr/local/sbin/p3scan --configfile=/usr/local/etc/p3scan/p3scan.conf &
-
-EOD;
-
- $stop = "/usr/bin/killall p3scan\n" .
- "sleep 2";
-
- if (! file_exists("/usr/local/etc/rc.d/030.p3scan.sh")) {
- write_rcfile(array(
- "file" => "030.p3scan.sh",
- "start" => $start,
- "stop" => $stop
- )
- );
- }
-
- /* finally get rid of files that were instaled by the package */
- removePackageLeftovers();
-
- conf_mount_ro();
- config_unlock();
-
- if (! file_exists("/usr/local/etc/p3scan")) {
- mkdir("/usr/local/etc/p3scan");
- }
- if (! file_exists("/usr/local/etc/p3scan/p3scan.conf")) {
- mwexec("ln -s /etc/p3scan.conf /usr/local/etc/p3scan/p3scan.conf");
- }
- if (! file_exists("/usr/local/etc/p3scan/p3scan.mail")) {
- $fd = fopen("/usr/local/etc/p3scan/p3scan.mail","w");
-
- $p3scanmail = <<<EOD
-MIME-Version: 1.0
-Content-Transfer-Encoding: 8bit
-Content-Type: text/plain;
- charset="iso-8859-1"
-
-Hello %USERNAME%.
-This message body was generated automatically from P3Scan, which runs on
-%HOSTNAME%.%DOMAINNAME% for scanning all incoming email.
-
-It replaces the body of a message sent to you that contained a VIRUS!
-
-Instead of the infected email this message has been sent to you.
-
-You may look at the message header of this message for the complete
-email header information of the infected message.
-
-Virus name:
- %VIRUSNAME%
-(Supposed) Sender of the email:
- %MAILFROM%
-Sent To:
- %MAILTO%
-On Date:
- %MAILDATE%
-Subject:
- %SUBJECT%
-Connection data:
- %PROTOCOL% from %CLIENTIP%:%CLIENTPORT% to %SERVERIP%:%SERVERPORT%
-Message File:
- %P3SCANID%
-Virus Definition Info:
- %VDINFO%
---
-%PROGNAME% %VERSION%
-by Jack S. Lai <laitcg@cox.net>
-
-EOD;
-
- fwrite($fd, $p3scanmail);
- fclose($fd);
- }
-
- mwexec("/usr/local/etc/rc.d/030.p3scan.sh stop");
- /* test whether a pid file still exists and remove it if necessary */
- if (! is_service_running("p3scan-pf"))
- unlink_if_exists("/var/run/p3scan/p3scan.pid");
- mwexec("/usr/local/etc/rc.d/030.p3scan.sh start");
-
- return 0;
-}
-
-function custom_php_install_command() {
- global $config, $g;
- sync_package_p3scan();
-}
-
-function custom_php_deinstall_command() {
- global $config, $g;
- conf_mount_rw();
-
- if (is_service_running("p3scan-pf"))
- stop_service("p3scan-pf");
-
- unlink_if_exists("/usr/local/etc/p3scan/p3scan.conf");
- unlink_if_exists("/usr/local/etc/p3scan/p3scan.mail");
- unlink_if_exists("/usr/local/etc/rc.d/030.p3scan.sh");
- rmdir("/usr/local/etc/p3scan");
- mwexec("rm -rf /var/spool/p3scan");
- mwexec("rm -rf /var/run/p3scan");
- mwexec("rm -rf /var/run/p3scan");
-
- conf_mount_ro();
-}
-
-function removePackageLeftovers() {
- unlink_if_exists("/usr/local/etc/rc.d/p3scan.sh");
- unlink_if_exists("/usr/local/etc/p3scan.conf.sample");
- unlink_if_exists("/usr/local/etc/p3scan.mail.sample");
-
-}
-
-function add_trans_table(){
- global $config;
-
- /* Flush all entries first, and then add them. */
- $p3scan_pf_result = mwexec ('pfctl -a "rdr-package/p3scan" -t p3scan -T flush');
- if($p3scan_pf_result <> 0) {
- file_notice("P3SCAN", "There were error(s) flushing the exclude table", "P3SCAN", "");
- }
- if($config['installedpackages']['p3scanpftransex']['config'] != ""){
- foreach($config['installedpackages']['p3scanpftransex']['config'] as $tmp) {
- $p3scan_pf_result = mwexec ('pfctl -a "rdr-package/p3scan" -t p3scan -T add ' . $tmp['ip']);
- if($p3scan_pf_result <> 0) {
- file_notice("P3SCAN", "There were error(s) adding the ip " . $tmp['ip'], "P3SCAN", "");
- }
- }
- }
-}
-
-function remove_transparency() {
- $p3scan_pf_result = mwexec ('pfctl -a "rdr-package/p3scan" -t p3scan -T flush');
- if($p3scan_pf_result <> 0) {
- file_notice("P3SCAN", "There were error(s) flushing the exclude table", "P3SCAN", "");
- }
-}
-
-function setup_transparency() {
- global $config;
- $cfg = $config['installedpackages']['p3scanpf']['config'][0];
- $ip = $cfg['ipaddr'];
- $port = $cfg['port'];
-
- if ($ip == "" || $port == "") { return; }
-
- $trans_file = fopen("/tmp/p3scan_pf.rules","w");
- fwrite($trans_file, "table <p3scan> persist\n");
- fwrite($trans_file, "rdr on " . $config['interfaces']['lan']['if'] . " inet proto tcp from !<p3scan> to ! " . $config['interfaces']['lan']['ipaddr'] . " port = pop3 -> {$ip} port {$port} \n");
- fclose($trans_file);
- $p3scan_pf_result = mwexec ('pfctl -a "rdr-package/p3scan" -f /tmp/p3scan_pf.rules');
- if($p3scan_pf_result <> 0) {
- file_notice("P3SCAN", "There were error(s) loading the transparency rules", "P3SCAN", "");
- }
- add_trans_table();
-}
-?> \ No newline at end of file
diff --git a/config/archive/p3scan-pf/p3scan-pf.xml b/config/archive/p3scan-pf/p3scan-pf.xml
deleted file mode 100644
index d4bea8ec..00000000
--- a/config/archive/p3scan-pf/p3scan-pf.xml
+++ /dev/null
@@ -1,218 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>p3scanpf</name>
- <version>1.0</version>
- <title>Services: POP3 Proxy: Main</title>
- <note>
- This &lt;acronym title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/acronym&gt; page uses default values, hence even if each field is
- set, you are still required to save this page if you are editing this page
- for the very first time!
- </note>
- <aftersaveredirect>pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</aftersaveredirect>
- <include_file>p3scan-pf.inc</include_file>
- <!-- Menu is where this packages menu will appear -->
- <menu>
- <name>POP3 Proxy</name>
- <tooltiptext>A transparent POP3-Proxy with virus-scanning capabilities</tooltiptext>
- <section>Services</section>
- <configfile>p3scan-pf.xml</configfile>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- </menu>
- <service>
- <name>p3scan-pf</name>
- <rcfile>030.p3scan.sh</rcfile>
- <executable>p3scan</executable>
- <description>POP3 virus/spam scanner.</description>
- </service>
- <tabs>
- <tab>
- <text>Daemon Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf.xml&amp;id=0</url>
- <active />
- </tab>
- <tab>
- <text>Transparent Proxy Exclusion</text>
- <url>/pkg.php?xml=p3scan-pf-transex.xml</url>
- </tab>
- <tab>
- <text>Message Processing</text>
- <url>/pkg_edit.php?xml=p3scan-pf-msg.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Emergency Contact</text>
- <url>/pkg.php?xml=p3scan-pf-emer.xml</url>
- </tab>
- <tab>
- <text>Virus Scanner Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-vir.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>SPAM Settings</text>
- <url>/pkg_edit.php?xml=p3scan-pf-spam.xml&amp;id=0</url>
- </tab>
- </tabs>
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['p3scanpf']['config']</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/p3scan-pf/p3scan-pf-msg.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/p3scan-pf/p3scan-pf-transex.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/p3scan-pf/p3scan-pf-emer.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/p3scan-pf/p3scan-pf-vir.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/p3scan-pf/p3scan-pf-spam.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/p3scan-pf/p3scan-pf.inc</item>
- </additional_files_needed>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <fields>
- <field>
- <fielddescr>Max Child's</fielddescr>
- <fieldname>maxchilds</fieldname>
- <description>The maximum number of connections we will handle at once.</description>
- <type>input</type>
- <default_value>10</default_value>
- </field>
- <field>
- <fielddescr>IP Address</fielddescr>
- <fieldname>ipaddr</fieldname>
- <description>The &lt;acronym title=&quot;Internet Protocol&quot;&gt;IP&lt;/acronym&gt; Address we listen on.</description>
- <type>input</type>
- <required />
- <default_value>127.0.0.1</default_value>
- </field>
- <field>
- <fielddescr>Port</fielddescr>
- <fieldname>port</fieldname>
- <description>The &lt;acronym title=&quot;Transmission Control Protocol&quot;&gt;TCP&lt;/acronym&gt; port on we should listen.</description>
- <type>input</type>
- <required />
- <default_value>8110</default_value>
- </field>
- <field>
- <fielddescr>SSL Port</fielddescr>
- <fieldname>sslport</fieldname>
- <description>The TCP &lt;acronym title=&quot;Secure Sockets Layer&quot;&gt;SSL&lt;/acronym&gt; port on we should listen.</description>
- <type>input</type>
- <required />
- <default_value>995</default_value>
- </field>
- <field>
- <fielddescr>Target IP</fielddescr>
- <fieldname>targetip</fieldname>
- <description>Target IP is the IP to connect (0.0.0.0 enables transparent mode).</description>
- <type>input</type>
- <required />
- <default_value>0.0.0.0</default_value>
- </field>
- <field>
- <fielddescr>Target Port</fielddescr>
- <fieldname>targetport</fieldname>
- <description>Target Port is the port to connect.</description>
- <type>input</type>
- <required />
- <default_value>8110</default_value>
- </field>
- <field>
- <fielddescr>Email Port</fielddescr>
- <fieldname>emailport</fieldname>
- <description>The port we should listen on to scan outgoing email messages.</description>
- <type>input</type>
- <required />
- <default_value>25</default_value>
- </field>
- <field>
- <fielddescr>Daemon User</fielddescr>
- <fieldname>daemonuser</fieldname>
- <description>The username the daemon should run as.</description>
- <type>input</type>
- <required />
- <default_value>root</default_value>
- </field>
- </fields>
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_delete_php_command>
- sync_package_p3scan();
- </custom_delete_php_command>
- <custom_php_resync_config_command>
- sync_package_p3scan();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- custom_php_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- custom_php_deinstall_command();
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/archive/p3scan.inc b/config/archive/p3scan.inc
deleted file mode 100644
index 902df50f..00000000
--- a/config/archive/p3scan.inc
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-require_once('globals.inc');
-require_once('config.inc');
-require_once('util.inc');
-require_once('service-utils.inc');
-
-if(!function_exists("filter_configure"))
- require_once("filter.inc");
-
-define('VIRUSDIR', '/var/tmp/p3scan');
-
-function p3scan_install_command() {
- global $g;
-
- $pidfile = "{$g['varrun_path']}/p3scan.pid";
- $rcfile = array();
- $rcfile['file'] = 'p3scan.sh';
- $rcfile['start'] = "p3scan -f /usr/local/etc/p3scan.conf -l $pidfile";
- $rcfile['stop'] = "kill `cat $pidfile`\nrm $pidfile";
- write_rcfile($rcfile);
-
- make_dirs(VIRUSDIR);
- chown(VIRUSDIR, 'proxy');
- chmod(VIRUSDIR, 0700);
- make_dirs(VIRUSDIR . '/children');
- chown(VIRUSDIR, 'proxy');
- chmod(VIRUSDIR, 0700);
-
- p3scan_resync();
-}
-
-function p3scan_resync() {
- global $g, $config;
-
- $virusdir = VIRUSDIR;
- $conf = <<<EOD
-ip = 127.0.0.1
-user = proxy
-justdelete
-virusregexp = .*: (.*) FOUND
-virusdir = $virusdir
-spamcheck = /usr/local/bin/spamc
-template = /usr/local/etc/p3scan.mail
-scannertype = basic
-
-EOD;
-
- if ($config['installedpackages']['sassassin']['config'][0]['enable'] == 'on')
- $conf .= "checkspam\n";
-
- $virusen = $config['installedpackages']['clamav']['config'][0]['scan_pop3'];
- if ($virusen == 'on')
- $scanner = '/usr/local/bin/clamdscan --no-summary';
- else
- $scanner = 'echo';
- $conf .= "scanner = $scanner\n";
-
- file_put_contents('/usr/local/etc/p3scan.conf', $conf);
-
- restart_service('p3scan');
- filter_configure();
-}
-?>
diff --git a/config/archive/p3scan.mail b/config/archive/p3scan.mail
deleted file mode 100644
index 920e5c8c..00000000
--- a/config/archive/p3scan.mail
+++ /dev/null
@@ -1,15 +0,0 @@
-To: %MAILTO%
-Date: %MAILDATE%
-Subject: *** VIRUS *** %SUBJECT%
-Content-Transfer-Encoding: 8bit
-Content-Type: text/plain; charset="iso8859-1"
-MIME-Version: 1.0
-
-Your message was scanned by the pfSense virus scanner for POP3, running on %HOSTNAME%.%DOMAINNAME%, and a virus was found. This email has been sent to you instead of the original infected email. The infected message has been deleted.
-
-The virus contained in the original message was %VIRUSNAME%. The sender of the email was %MAILFROM%.
-
-%FILESTATUS%
-
-Contact the system administrator for further details. This is an automated message, please do not reply to it.
-.
diff --git a/config/archive/p3scan.xml b/config/archive/p3scan.xml
deleted file mode 100644
index 86376536..00000000
--- a/config/archive/p3scan.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>none</name>
- <version>none</version>
- <title>none</title>
- <include_file>p3scan.inc</include_file>
- <service>
- <name>p3scan</name>
- <rcfile>p3scan.sh</rcfile>
- <executable>p3scan</executable>
- <description>POP3 virus/spam scanner.</description>
- </service>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/p3scan.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/bin/</prefix>
- <chmod>0755</chmod>
- <item>https://www.pfsense.org/packages/All/p3scan</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/etc/</prefix>
- <item>https://packages.pfsense.org/packages/config/p3scan.mail</item>
- </additional_files_needed>
- <custom_php_install_command>
- p3scan_install_command();
- </custom_php_install_command>
-</packagegui>
diff --git a/config/archive/phpmrss.xml b/config/archive/phpmrss.xml
deleted file mode 100644
index 3d144642..00000000
--- a/config/archive/phpmrss.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>phpmrss</name>
- <version>0.13</version>
- <title>mRSS</title>
- <custom_delete_php_command>
- </custom_delete_php_command>
- <custom_php_resync_config_command>
- </custom_php_resync_config_command>
- <custom_php_install_command>
- </custom_php_install_command>
- <custom_php_deinstall_command>
- </custom_php_deinstall_command>
-</packagegui> \ No newline at end of file
diff --git a/config/archive/portsentry/portsentry.inc b/config/archive/portsentry/portsentry.inc
deleted file mode 100644
index d51f9035..00000000
--- a/config/archive/portsentry/portsentry.inc
+++ /dev/null
@@ -1,292 +0,0 @@
-<?php
-
-function portsentry_custom_php_deinstall_command() {
- global $config;
-
- conf_mount_rw();
- exec("killall portsentry");
- exec("rm -rf /usr/local/etc/portsentry*");
-}
-
-function portsentry_custom_php_install_command() {
- global $config;
-
- if($config['installedpackages']['portsentry']['config'][0]['blocktcp'])
- $blocktcp = "1";
- else
- $blocktcp = "0";
-
- if($config['installedpackages']['portsentry']['config'][0]['blockudp'])
- $blockudp = "1";
- else
- $blockudp = "0";
-
- if($config['installedpackages']['portsentry']['config'][0]['portbanner'])
- $portbanner = $config['installedpackages']['portsentry']['config'][0]['portbanner'];
- else
- $portbanner = "You have connected to an invalid port. Your connection has been logged.";
-
- if($config['installedpackages']['portsentry']['config'][0]['scantrigger'])
- $scantrigger = $config['installedpackages']['portsentry']['config'][0]['scantrigger'];
- else
- $scantrigger = "0";
-
- $isfirst = true;
-
- $ports = "1,11,15,110,111,143,540,635,1080,1524,2000,12345,12346,20034,32771,32772,32773,32774,49724,54320";
- if($config['installedpackages']['portsentry']['config'][0]['row']) {
- $ports = "";
- foreach($config['installedpackages']['portsentry']['config'][0]['row'] as $ps) {
- if(!$isfirst)
- $ports .= ",";
- if($ps['listenport'])
- $ports .= $ps['listenport'];
- $isfirst = false;
- }
- }
- $tcp_ports = $ports;
- $udp_ports = $ports;
-
- $config = <<<EOF
-# PortSentry Configuration
-
-#######################
-# Port Configurations #
-#######################
-#
-#
-# Some example port configs for classic and basic Stealth modes
-#
-# I like to always keep some ports at the "low" end of the spectrum.
-# This will detect a sequential port sweep really quickly and usually
-# these ports are not in use (i.e. tcpmux port 1)
-#
-# ** X-Windows Users **: If you are running X on your box, you need to be sure
-# you are not binding PortSentry to port 6000 (or port 2000 for OpenWindows users).
-# Doing so will prevent the X-client from starting properly.
-#
-# These port bindings are *ignored* for Advanced Stealth Scan Detection Mode.
-#
-
-# Un-comment these if you are really anal:
-TCP_PORTS="$tcp_ports"
-UDP_PORTS="$udp_ports"
-
-###########################################
-# Advanced Stealth Scan Detection Options #
-###########################################
-#
-# This is the number of ports you want PortSentry to monitor in Advanced mode.
-# Any port *below* this number will be monitored. Right now it watches
-# everything below 1024.
-#
-# On many Linux systems you cannot bind above port 61000. This is because
-# these ports are used as part of IP masquerading. I don't recommend you
-# bind over this number of ports. Realistically: I DON'T RECOMMEND YOU MONITOR
-# OVER 1024 PORTS AS YOUR FALSE ALARM RATE WILL ALMOST CERTAINLY RISE. You've been
-# warned! Don't write me if you have have a problem because I'll only tell
-# you to RTFM and don't run above the first 1024 ports.
-#
-#
-#ADVANCED_PORTS_TCP="1024"
-#ADVANCED_PORTS_UDP="1024"
-#
-# This field tells PortSentry what ports (besides listening daemons) to
-# ignore. This is helpful for services like ident that services such
-# as FTP, SMTP, and wrappers look for but you may not run (and probably
-# *shouldn't* IMHO).
-#
-# By specifying ports here PortSentry will simply not respond to
-# incoming requests, in effect PortSentry treats them as if they are
-# actual bound daemons. The default ports are ones reported as
-# problematic false alarms and should probably be left alone for
-# all but the most isolated systems/networks.
-#
-# Default TCP ident and NetBIOS service
-ADVANCED_EXCLUDE_TCP="113,139"
-# Default UDP route (RIP), NetBIOS, bootp broadcasts.
-ADVANCED_EXCLUDE_UDP="520,138,137,67"
-
-
-######################
-# Configuration Files#
-######################
-#
-# Hosts to ignore
-IGNORE_FILE="/usr/local/etc/portsentry.ignore"
-# Hosts that have been denied (running history)
-HISTORY_FILE="/var/db/portsentry.history"
-# Hosts that have been denied this session only (temporary until next restart)
-BLOCKED_FILE="/var/db/portsentry.blocked"
-
-##############################
-# Misc. Configuration Options#
-##############################
-#
-# DNS Name resolution - Setting this to "1" will turn on DNS lookups
-# for attacking hosts. Setting it to "0" (or any other value) will shut
-# it off.
-RESOLVE_HOST = "1"
-
-###################
-# Response Options#
-###################
-# Options to dispose of attacker. Each is an action that will
-# be run if an attack is detected. If you don't want a particular
-# option then comment it out and it will be skipped.
-#
-# The variable $TARGET$ will be substituted with the target attacking
-# host when an attack is detected. The variable $PORT$ will be substituted
-# with the port that was scanned.
-#
-##################
-# Ignore Options #
-##################
-# These options allow you to enable automatic response
-# options for UDP/TCP. This is useful if you just want
-# warnings for connections, but don't want to react for
-# a particular protocol (i.e. you want to block TCP, but
-# not UDP). To prevent a possible Denial of service attack
-# against UDP and stealth scan detection for TCP, you may
-# want to disable blocking, but leave the warning enabled.
-# I personally would wait for this to become a problem before
-# doing though as most attackers really aren't doing this.
-# The third option allows you to run just the external command
-# in case of a scan to have a pager script or such execute
-# but not drop the route. This may be useful for some admins
-# who want to block TCP, but only want pager/e-mail warnings
-# on UDP, etc.
-#
-#
-# 0 = Do not block UDP/TCP scans.
-# 1 = Block UDP/TCP scans.
-# 2 = Run external command only (KILL_RUN_CMD)
-
-BLOCK_UDP="$block_udp"
-BLOCK_TCP="$block_tcp"
-
-###############
-# TCP Wrappers#
-###############
-# This text will be dropped into the hosts.deny file for wrappers
-# to use. There are two formats for TCP wrappers:
-#
-# Format One: Old Style - The default when extended host processing
-# options are not enabled.
-#
-KILL_HOSTS_DENY="ALL: \$TARGET\$"
-
-# Format Two: New Style - The format used when extended option
-# processing is enabled. You can drop in extended processing
-# options, but be sure you escape all '%' symbols with a backslash
-# to prevent problems writing out (i.e. \%c \%h )
-#
-#KILL_HOSTS_DENY="ALL: \$TARGET\$ : DENY"
-
-###################
-# External Command#
-###################
-# This is a command that is run when a host connects, it can be whatever
-# you want it to be (pager, etc.). This command is executed before the
-# route is dropped or after depending on the KILL_RUN_CMD_FIRST option below
-#
-#
-# I NEVER RECOMMEND YOU PUT IN RETALIATORY ACTIONS AGAINST THE HOST SCANNING
-# YOU!
-#
-# TCP/IP is an *unauthenticated protocol* and people can make scans appear out
-# of thin air. The only time it is reasonably safe (and I *never* think it is
-# reasonable) to run reverse probe scripts is when using the "classic" -tcp mode.
-# This mode requires a full connect and is very hard to spoof.
-#
-# The KILL_RUN_CMD_FIRST value should be set to "1" to force the command
-# to run *before* the blocking occurs and should be set to "0" to make the
-# command run *after* the blocking has occurred.
-#
-#KILL_RUN_CMD_FIRST = "0"
-#
-# \$PORT\$
-KILL_RUN_CMD="pfctl -k \$TARGET\$ ; pfctl -t virusprot -T add \$TARGET\$"
-
-#####################
-# Scan trigger value#
-#####################
-# Enter in the number of port connects you will allow before an
-# alarm is given. The default is 0 which will react immediately.
-# A value of 1 or 2 will reduce false alarms. Anything higher is
-# probably not necessary. This value must always be specified, but
-# generally can be left at 0.
-#
-# NOTE: If you are using the advanced detection option you need to
-# be careful that you don't make a hair trigger situation. Because
-# Advanced mode will react for *any* host connecting to a non-used
-# below your specified range, you have the opportunity to really
-# break things. (i.e someone innocently tries to connect to you via
-# SSL [TCP port 443] and you immediately block them). Some of you
-# may even want this though. Just be careful.
-#
-SCAN_TRIGGER="$scan_trigger"
-
-######################
-# Port Banner Section#
-######################
-#
-# Enter text in here you want displayed to a person tripping the PortSentry.
-# I *don't* recommend taunting the person as this will aggravate them.
-# Leave this commented out to disable the feature
-#
-# Stealth scan detection modes don't use this feature
-#
-PORT_BANNER="$port_banner"
-
-EOF;
-
- conf_mount_rw();
- // Write out configuration
- $fd = fopen("/usr/local/etc/portsentry.conf", "w");
- fwrite($fd, $config);
- fclose($fd);
-
- $svscan = <<<EOD
-#!/bin/sh
-
-# PROVIDE: portsentry
-# REQUIRE: LOGIN
-# KEYWORD: FreeBSD
-
-. /etc/rc.subr
-
-name="portsentry"
-rcvar=`set_rcvar`
-command="/usr/local/bin/portsentry"
-portsentry_enable=\${portsentry_enable-"YES"}
-
-start_cmd="portsentry_start"
-stop_postcmd="portsentry_stop_post"
-
-load_rc_config \$name
-
-portsentry_start () {
- echo "Starting svscan."
- /usr/bin/env \
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
- portsentry
-}
-
-portsentry_stop_post () {
- echo "Stopping portsentry."
- killall portsentry
-}
-
-run_rc_command "\$1"
-
-EOD;
-
- $fd = fopen("/usr/local/etc/rc.d/portsentry.sh", "w");
- fwrite($fd, $svscan);
- fclose($fd);
- exec("chmod a+rx /usr/local/etc/rc.d/portsentry.sh");
- conf_mount_ro();
-}
-
-?> \ No newline at end of file
diff --git a/config/archive/portsentry/portsentry.xml b/config/archive/portsentry/portsentry.xml
deleted file mode 100644
index 175417b5..00000000
--- a/config/archive/portsentry/portsentry.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- portsentry.xml
- Copyright (C) 2009 Scott Ullrich
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <name>portsentry</name>
- <version>1.0</version>
- <title>Portsentry</title>
- <aftersaveredirect><![CDATA[/pkg_edit.php?xml=portsentry.xml&id=1]]></aftersaveredirect>
- <include_file>/usr/local/pkg/portsentry.inc</include_file>
- <menu>
- <name>Portsentry</name>
- <tooltiptext></tooltiptext>
- <section>Services</section>
- <url>http://sourceforge.net/projects/sentrytools/</url>
- </menu>
- <service>
- <name>Portsentry</name>
- <rcfile>portsentry.sh</rcfile>
- <executable>portsentry</executable>
- <description>The Sentry tools provide host-level security services for the Unix platform. PortSentry protect against portscans, and detect suspicious login activity on a continuous basis.</description>
- </service>
- <configpath>installedpackages->portsentry->config</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/portsentry/portsentry.inc</item>
- </additional_files_needed>
- <fields>
- <field>
- <type>rowhelper</type>
- <rowhelper>
- <rowhelperfield>
- <fielddescr>Listen on port</fielddescr>
- <fieldname>listenport</fieldname>
- <description>Instructs portsentry to look for bogus activity on port</description>
- <type>input</type>
- <size>25</size>
- </rowhelperfield>
- </rowhelper>
- </field>
- <field>
- <fielddescr>Scan trigger value</fielddescr>
- <fieldname>scantrigger</fieldname>
- <description>Enter in the number of port connects you will allow before an alarm is given. The default is 0 which will react immediately.A value of 1 or 2 will reduce false alarms. Anything higher is probably not necessary. This value must always be specified, but generally can be left at 0.</description>
- <type>input</type>
- <size>80</size>
- <required/>
- </field>
- <field>
- <fielddescr>Block TCP</fielddescr>
- <fieldname>blocktcp</fieldname>
- <description>Determines if portsentry will listen on defined ports using the TCP protocol.</description>
- <type>checkbox</type>
- <required/>
- </field>
- <field>
- <fielddescr>Block UDP</fielddescr>
- <fieldname>blockudp</fieldname>
- <description>Determines if portsentry will listen on defined ports using the UDP protocol.</description>
- <type>checkbox</type>
- <required/>
- </field>
- <field>
- <fielddescr>Port Banner</fielddescr>
- <fieldname>portbanner</fieldname>
- <description>Text to ouput when client connects to a portsentry port.</description>
- <type>checkbox</type>
- <required/>
- </field>
- </fields>
- <custom_delete_php_command>
- </custom_delete_php_command>
- <custom_add_php_command>
- </custom_add_php_command>
- <custom_php_resync_config_command>
- </custom_php_resync_config_command>
- <custom_php_install_command>
- portsentry_custom_php_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- portsentry_custom_php_deinstall_command();
- </custom_php_deinstall_command>
- <custom_php_command_before_form>
- </custom_php_command_before_form>
-</packagegui> \ No newline at end of file
diff --git a/config/archive/powerdns.xml b/config/archive/powerdns.xml
deleted file mode 100644
index 214da5f4..00000000
--- a/config/archive/powerdns.xml
+++ /dev/null
@@ -1,248 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>powerdns</name>
- <version>2.9.16_4</version>
- <title>Services: PowerDNS</title>
- <preoutput>yes</preoutput>
- <donotsave>true</donotsave>
- <!-- Menu is where this packages menu will appear -->
- <menu>
- <name>PowerDNS</name>
- <tooltiptext></tooltiptext>
- <section>Services</section>
- <configfile>powerdns.xml</configfile>
- </menu>
- <!-- Do not save invokes a simple input menu and will not update
- the configuration database. -->
- <fields>
- <field>
- <fielddescr>pgsql Password</fielddescr>
- <fieldname>password</fieldname>
- <description>Enter the pgsql users password.</description>
- <type>password</type>
- </field>
- <field>
- <fielddescr>pgsql Password AGAIN</fielddescr>
- <fieldname>passwordagain</fieldname>
- <type>password</type>
- </field>
- <field>
- <fielddescr>IP Address</fielddescr>
- <fieldname>ipaddress</fieldname>
- <description>(0.0.0.0 to bind to all)</description>
- <type>input</type>
- <value>0.0.0.0</value>
- </field>
- <field>
- <fielddescr>Cache Time to Live</fielddescr>
- <fieldname>cachettl</fieldname>
- <description>Recommended value: 20</description>
- <type>input</type>
- <value>20</value>
- </field>
- <field>
- <fielddescr>Master</fielddescr>
- <fieldname>master</fieldname>
- <type>select</type>
- <options>
- <option><name>Yes</name><value>yes</value></option>
- <option><name>No</name><value>no</value></option>
- </options>
- </field>
- <field>
- <fielddescr>Slave</fielddescr>
- <fieldname>slave</fieldname>
- <type>select</type>
- <options>
- <option><name>No</name><value>no</value></option>
- <option><name>Yes</name><value>yes</value></option>
- </options>
- </field>
- </fields>
- <custom_add_php_command>
- if($password == $passwordagain) {
- conf_mount_rw();
- config_lock();
- $fd = popen("/usr/sbin/pw usermod -n pgsql -H 0", "w");
- $salt = md5(time());
- $crypted_pw = crypt($_POST['password'],$salt);
- fwrite($fd, $crypted_pw);
- pclose($fd);
- $fout = fopen("/usr/local/etc/pdns.conf","w");
- fwrite($fout, "launch=gpgsql\n");
- fwrite($fout, "gpgsql-host=127.0.0.1\n");
- fwrite($fout, "gpgsql-dbname=powerdns\n");
- fwrite($fout, "gpgsql-user=pgsql\n");
- fwrite($fout, "gpgsql-password=" . $_POST['password'] . "\n");
- fwrite($fout, "chroot=/var/empty\n");
- fwrite($fout, "disable-tcp=no\n");
- fwrite($fout, "guardian=yes\n");
- fwrite($fout, "webserver=yes\n");
- fwrite($fout, "webserver-address=127.0.0.1\n");
- fwrite($fout, "webserver-port=8081\n");
- fwrite($fout, "local-address=" . $_POST['ipaddress'] . "\n");
- fwrite($fout, "master=" . $_POST['master'] . "\n");
- fwrite($fout, "slave=" . $_POST['slave'] . "\n");
- fwrite($fout, "cache-ttl=" . $_POST['cachettl'] . "\n");
- /* XXX: TODO */
- fwrite($fout, "# allow-axfr-ips=\n");
- fwrite($fout, "# allow-recursion=\n");
- fwrite($fout, "# config-dir=/etc\n");
- fwrite($fout, "# config-name=\n");
- fwrite($fout, "# control-console=no\n");
- fwrite($fout, "# default-soa-name=ns.example.com\n");
- fwrite($fout, "# disable-axfr=no\n");
- fwrite($fout, "# distributor-threads=3\n");
- fwrite($fout, "# fancy-records=no\n");
- fwrite($fout, "# launch=\n");
- fwrite($fout, "# lazy-recursion=yes\n");
- fwrite($fout, "# load-modules=\n");
- fwrite($fout, "# local-ipv6=\n");
- fwrite($fout, "# local-port=53\n");
- fwrite($fout, "# log-dns-details=\n");
- fwrite($fout, "# log-failed-updates=\n");
- fwrite($fout, "# logfile=pdns.log\n");
- fwrite($fout, "# logging-facility=\n");
- fwrite($fout, "# loglevel=4\n");
- fwrite($fout, "# max-queue-length=5000\n");
- fwrite($fout, "# max-tcp-connections=10\n");
- fwrite($fout, "# module-dir=/usr/local/bin/../lib\n");
- fwrite($fout, "# negquery-cache-ttl=60\n");
- fwrite($fout, "# only-soa=org\n");
- fwrite($fout, "# out-of-zone-additional-processing=no\n");
- fwrite($fout, "# query-cache-ttl=20\n");
- fwrite($fout, "# query-logging=no\n");
- fwrite($fout, "# queue-limit=1500\n");
- fwrite($fout, "# receiver-threads=1\n");
- fwrite($fout, "# recursive-cache-ttl=10\n");
- fwrite($fout, "# recursor=no\n");
- fwrite($fout, "# setgid=\n");
- fwrite($fout, "# setuid=\n");
- fwrite($fout, "# skip-cname=no\n");
- fwrite($fout, "# slave=no\n");
- fwrite($fout, "# slave-cycle-interval=60\n");
- fwrite($fout, "# soa-minimum-ttl=3600\n");
- fwrite($fout, "# soa-serial-offset=0\n");
- fwrite($fout, "# socket-dir=/var/run\n");
- fwrite($fout, "# strict-rfc-axfrs=no\n");
- fwrite($fout, "# urlredirector=127.0.0.1\n");
- fwrite($fout, "# use-logfile=no\n");
- fwrite($fout, "# webserver-password=\n");
- fwrite($fout, "# webserver-print-arguments=no\n");
- fwrite($fout, "# wildcard-url=no\n");
- fwrite($fout, "# wildcards=\n");
- fclose($fout);
- conf_mount_ro();
- config_unlock();
- system("/usr/local/bin/pg_ctl -m smart 2>/dev/null");
- system("/usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start 2>/dev/null");
- } else {
- echo "Passwords do not much!";
- exit;
- }
- </custom_add_php_command>
- <custom_php_install_command>
- echo "&lt;pre&gt;";
- echo "Creating DB...";
- system("/usr/bin/su -l pgsql -c initdb");
- system("/usr/local/etc/rc.d/010.pgsql.sh start");
- system("/usr/bin/su -l pgsql -c \"dropdb powerdns\" ");
- system("/usr/bin/su -l pgsql -c \"createdb powerdns\" ");
- $fout = fopen("/usr/local/pkg/powerdns.schema","w");
- /* DATABASE SCHEMA */
- fwrite($fout, "create table domains (\n");
- fwrite($fout, "id SERIAL PRIMARY KEY,\n");
- fwrite($fout, "name VARCHAR(255) NOT NULL,\n");
- fwrite($fout, "master VARCHAR(20) DEFAULT NULL,\n");
- fwrite($fout, "last_check INT DEFAULT NULL,\n");
- fwrite($fout, "type VARCHAR(6) NOT NULL,\n");
- fwrite($fout, "notified_serial INT DEFAULT NULL,\n");
- fwrite($fout, "account VARCHAR(40) DEFAULT NULL\n");
- fwrite($fout, ");\n");
- fwrite($fout, "CREATE UNIQUE INDEX name_index ON domains(name);\n");
- fwrite($fout, "CREATE TABLE records (\n");
- fwrite($fout, " id SERIAL PRIMARY KEY,\n");
- fwrite($fout, " domain_id INT DEFAULT NULL,\n");
- fwrite($fout, " name VARCHAR(255) DEFAULT NULL,\n");
- fwrite($fout, " type VARCHAR(6) DEFAULT NULL,\n");
- fwrite($fout, " content VARCHAR(255) DEFAULT NULL,\n");
- fwrite($fout, " ttl INT DEFAULT NULL,\n");
- fwrite($fout, " prio INT DEFAULT NULL,\n");
- fwrite($fout, " change_date INT DEFAULT NULL,\n");
- fwrite($fout, " CONSTRAINT domain_exists\n");
- fwrite($fout, " FOREIGN KEY(domain_id) REFERENCES domains(id)\n");
- fwrite($fout, " ON DELETE CASCADE\n");
- fwrite($fout, ");\n");
- fwrite($fout, "CREATE INDEX rec_name_index ON records(name);\n");
- fwrite($fout, "CREATE INDEX nametype_index ON records(name,type);\n");
- fwrite($fout, "CREATE INDEX domain_id ON records(domain_id);\n");
- fwrite($fout, "create table supermasters (\n");
- fwrite($fout, " ip VARCHAR(25) NOT NULL,\n");
- fwrite($fout, " nameserver VARCHAR(255) NOT NULL,\n");
- fwrite($fout, " account VARCHAR(40) DEFAULT NULL\n");
- fwrite($fout, ");\n");
- fwrite($fout, "GRANT SELECT ON supermasters TO pgsql;\n");
- fwrite($fout, "GRANT ALL ON domains TO pgsql;\n");
- fwrite($fout, "GRANT ALL ON domains_id_seq TO pgsql;\n");
- fwrite($fout, "GRANT ALL ON records TO pgsql;\n");
- fwrite($fout, "GRANT ALL ON records_id_seq TO pgsql;\n");
- fclose($fout);
- system("cat /usr/local/pkg/powerdns.schema | /usr/bin/su -l pgsql -c \"psql powerdns\" ");
- echo "Installation completed!";
- </custom_php_install_command>
- <custom_php_deinstall_command>
- system("/usr/local/bin/pg_ctl -m immediate");
- rmdir_recursive("/usr/local/pgsql");
- system("/usr/sbin/pw userdel pgsql");
- system("/usr/bin/killall -9 postgres");
- echo "&lt;p&gt;";
- echo "Reboot required... One moment...";
- echo "&lt;p&gt;";
- /* system("/sbin/shutdown -r now"); */
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/archive/quagga/quagga.sh b/config/archive/quagga/quagga.sh
deleted file mode 100644
index 6a9727d7..00000000
--- a/config/archive/quagga/quagga.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-#
-# Quagga.sh retrofitted for pfSense
-# part of the pfSense quagga project
-#
-# You may also wish to use the following variables to fine-tune startup:
-# quagga_flags="-d"
-# quagga_daemons="zebra ripd ripngd ospfd ospf6d bgpd isisd"
-# Per daemon tuning may be done with daemon_name_flags
-# zebra_flags="-dP 0"
-# bgpd_flags="-dnrP 0" and so on
-#
-# If the quagga daemons require additional shared libraries to start,
-# use the following variable to run ldconfig(8) in advance:
-# quagga_extralibs_path="/usr/local/lib ..."
-#
-
-. /etc/rc.subr
-
-mkdir -p /var/run/quagga
-
-name="quagga"
-rcvar=`set_rcvar`
-
-stop_postcmd=stop_postcmd
-
-stop_postcmd()
-{
- rm -f $pidfile
-}
-
-# set defaults
-
-load_rc_config $name
-
-quagga_enable="YES"
-quagga_flags="-d"
-quagga_daemons="zebra ripd ripngd ospfd ospf6d bgpd isisd"
-quagga_extralibs_path=""
-
-quagga_cmd=$1
-
-case "$1" in
- force*)
- quagga_cmd=${quagga_cmd#force}
- ;;
- fast*)
- quagga_cmd=${quagga_cmd#fast}
- ;;
-esac
-
-case "${quagga_cmd}" in
- start)
- if [ ! -z ${quagga_extralibs_path} ]; then
- /sbin/ldconfig -m ${quagga_extralibs_path}
- fi
- ;;
- stop)
- quagga_daemons=$(reverse_list ${quagga_daemons})
- ;;
-esac
-
-for daemon in ${quagga_daemons}; do
- command=/usr/local/sbin/${daemon}
- required_files=/usr/local/etc/quagga/${daemon}.conf
- pidfile=/var/run/quagga/${daemon}.pid
- if [ ${quagga_cmd} = "start" -a ! -f ${required_files} ]; then
- continue
- fi
- if [ ${quagga_cmd} = "stop" -a -z $(check_process ${command}) ]; then
- continue
- fi
- eval flags=\$\{${daemon}_flags:-\"${quagga_flags}\"\}
- run_rc_command "$1"
-done
diff --git a/config/archive/quagga/quagga.xml b/config/archive/quagga/quagga.xml
deleted file mode 100644
index 732bd1c1..00000000
--- a/config/archive/quagga/quagga.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>none</name>
- <version>none</version>
- <title>none</title>
- <service>
- <name>quagga</name>
- <rcfile>quagga.sh</rcfile>
- <executable>quagga</executable>
- <description></description>
- </service>
- <additional_files_needed>
- <prefix>/usr/local/etc/rc.d/</prefix>
- <chmod>0777</chmod>
- <item>https://packages.pfsense.org/packages/config/quagga/quagga.sh</item>
- </additional_files_needed>
- <custom_php_install_command>
- mwexec("/usr/local/etc/rc.d/quagga.sh start");
- </custom_php_install_command>
- <custom_php_deinstall_command>
- mwexec("rm /usr/local/etc/rc.d/quagga*");
- mwexec("rm /usr/local/etc/rc.d/watchquagga");
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/archive/sassassin.inc b/config/archive/sassassin.inc
deleted file mode 100644
index 040f12ab..00000000
--- a/config/archive/sassassin.inc
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-require_once('globals.inc');
-require_once('config.inc');
-require_once('service-utils.inc');
-
-function sassassin_install_command() {
- global $g;
-
- $oldrc = '/usr/local/etc/rc.d/sa-spamd.sh';
- if (file_exists($oldrc)) unlink($oldrc);
-
- $pidfile = "$rundir/spamd.pid";
- $rcfile = array();
- $rcfile['file'] = 'spamd.sh';
- $rcfile['start'] = "mkdir -p $rundir\n\tspamd -u proxy -c -d -r $pidfile";
- $rcfile['stop'] = "kill `cat $pidfile`";
- write_rcfile($rcfile);
-}
-
-function sassassin_resync() {
- global $config;
-
- $settings = $config['installedpackages']['sassassin']['config'][0];
-
- $use_bayes = ($settings['bayes'] == 'on' ? 1 : 0);
- $bayes_auto_learn = ($settings['bayes_learn'] == 'on' ? 1 : 0);
- $required_score = $settings['threshold'];
- $rewrite_header = "Subject {$settings['subject']}";
-
- $report_safe_array = array('donotsend' => 0, 'attachment' => 1, 'plaintext' => 2);
- $report_safe = $report_safe_array[$settings['send_spam']];
-
- $local_cf = <<<EOD
-use_bayes $use_bayes
-bayes_auto_learn $bayes_auto_learn
-required_score $required_score
-rewrite_header $rewrite_header
-report_safe $report_safe
-
-EOD;
-
- foreach (array('whitelist' => 'wl', 'blacklist' => 'bl') as $list => $key) {
- foreach ($config['installedpackages']["sassassin{$key}"]['config'] as $item) {
- if (!empty($item))
- $local_cf .= "{$list}_from {$item['address']}\n";
- }
- }
-
- file_put_contents('/usr/local/etc/mail/spamassassin/local.cf', $local_cf);
-
- restart_service('spamassassin');
-
- if (get_pkg_id('p3scan') != -1) {
- require_once('p3scan.inc');
- p3scan_resync();
- }
-}
-
-function sassassin_validate_input($post, $input_errors) {
- if (!is_numeric($post['threshold']))
- $input_errors[] = 'The field \'Spam threshold\' should contain a numeric value.';
-}
-?>
diff --git a/config/archive/sassassin.xml b/config/archive/sassassin.xml
deleted file mode 100644
index 61cc0653..00000000
--- a/config/archive/sassassin.xml
+++ /dev/null
@@ -1,159 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>spamassassin</name>
- <version>none</version>
- <title>Antispam: Configuration</title>
- <include_file>sassassin.inc</include_file>
- <menu>
- <name>Antispam</name>
- <tooltiptext>Configure the Antispam service.</tooltiptext>
- <section>Services</section>
- <url>/pkg_edit.php?xml=sassassin.xml&amp;id=0</url>
- </menu>
- <service>
- <name>SpamAssassin</name>
- <rcfile>spamd.sh</rcfile>
- <executable>spamd</executable>
- <description>The SpamAssassin spam detection software.</description>
- </service>
- <tabs>
- <tab>
- <text>Configuration</text>
- <url>/pkg_edit.php?xml=sassassin.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Whitelist</text>
- <url>/pkg.php?xml=sassassin_wl.xml</url>
- </tab>
- <tab>
- <text>Blacklist</text>
- <url>/pkg.php?xml=sassassin_bl.xml</url>
- </tab>
- </tabs>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/sassassin_wl.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/sassassin_bl.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/sassassin.inc</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Enable antispam</fielddescr>
- <fieldname>enable</fieldname>
- <description>Check to enable the antispam protection.</description>
- <type>checkbox</type>
- <enablefields>bayes,bayes_learn,threshold,subject,send_spam</enablefields>
- <required/>
- </field>
- <field>
- <fielddescr>Bayesian classifier</fielddescr>
- <fieldname>bayes</fieldname>
- <description>Check this to enable the Bayesian classifier.</description>
- <type>checkbox</type>
- <required/>
- <default_value>on</default_value>
- </field>
- <field>
- <fielddescr>Bayesian auto-learning</fielddescr>
- <fieldname>bayes_learn</fieldname>
- <description>Check this to enable the Bayesian auto-learning system.</description>
- <type>checkbox</type>
- <required/>
- <default_value>on</default_value>
- </field>
- <field>
- <fielddescr>Spam threshold</fielddescr>
- <fieldname>threshold</fieldname>
- <description>Set the threshold at which a message is considered spam.</description>
- <type>input</type>
- <required/>
- <default_value>5.0</default_value>
- </field>
- <field>
- <fielddescr>Rewrite subject</fielddescr>
- <fieldname>subject</fieldname>
- <description>This is the string that will be added to the subject of spam emails.</description>
- <type>input</type>
- <default_value>*** SPAM ***</default_value>
- </field>
- <field>
- <fielddescr>How to send spam messages</fielddescr>
- <fieldname>send_spam</fieldname>
- <description>Choose between not sending spam messages, sending them as an RFC-822 MIME attachment (recommended) or as plain text.</description>
- <type>select</type>
- <default_value>attachment</default_value>
- <options>
- <option>
- <name>Do not send</name>
- <value>donotsave</value>
- </option>
- <option>
- <name>Send as an attachment (recommended)</name>
- <value>attachment</value>
- </option>
- <option>
- <name>Send as plain text</name>
- <value>plaintext</value>
- </option>
- </options>
- </field>
- </fields>
- <custom_php_validation_command>
- sassassin_validate_input($_POST, &amp;$input_errors);
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- sassassin_resync();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- sassassin_install_command();
- </custom_php_install_command>
-</packagegui>
diff --git a/config/archive/sassassin_bl.xml b/config/archive/sassassin_bl.xml
deleted file mode 100644
index 850d971c..00000000
--- a/config/archive/sassassin_bl.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>sassassinbl</name>
- <version>none</version>
- <title>AntiSPAM: Blacklist</title>
- <include_file>sassassin.inc</include_file>
- <tabs>
- <tab>
- <text>Configuration</text>
- <url>/pkg_edit.php?xml=sassassin.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Whitelist</text>
- <url>/pkg.php?xml=sassassin_wl.xml</url>
- </tab>
- <tab>
- <text>Blacklist</text>
- <url>/pkg.php?xml=sassassin_bl.xml</url>
- <active/>
- </tab>
- </tabs>
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Address</fielddescr>
- <fieldname>address</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
- <fields>
- <field>
- <fielddescr>Address</fielddescr>
- <fieldname>address</fieldname>
- <description>This is the email address that will be added to the blacklist (valid wildcards: *, ?).</description>
- <type>input</type>
- <required/>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>You may enter a description here for your reference (not parsed).</description>
- <type>input</type>
- </field>
- </fields>
- <custom_php_resync_config_command>
- sassassin_resync();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/archive/sassassin_wl.xml b/config/archive/sassassin_wl.xml
deleted file mode 100644
index 132f3e16..00000000
--- a/config/archive/sassassin_wl.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>sassassinwl</name>
- <version>none</version>
- <title>AntiSPAM: Whitelist</title>
- <include_file>sassassin.inc</include_file>
- <tabs>
- <tab>
- <text>Configuration</text>
- <url>/pkg_edit.php?xml=sassassin.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Whitelist</text>
- <url>/pkg.php?xml=sassassin_wl.xml</url>
- <active/>
- </tab>
- <tab>
- <text>Blacklist</text>
- <url>/pkg.php?xml=sassassin_bl.xml</url>
- </tab>
- </tabs>
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Address</fielddescr>
- <fieldname>address</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
- <fields>
- <field>
- <fielddescr>Address</fielddescr>
- <fieldname>address</fieldname>
- <description>This is the email address that will be added to the whitelist (valid wildcards: *, ?).</description>
- <type>input</type>
- <required/>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>You may enter a description here for your reference (not parsed).</description>
- <type>input</type>
- </field>
- </fields>
- <custom_php_resync_config_command>
- sassassin_resync();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/archive/upclient.xml b/config/archive/upclient.xml
deleted file mode 100644
index 42f71a25..00000000
--- a/config/archive/upclient.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>upclient</name>
- <version>5.0.b8_2</version>
- <title>upclient: Settings</title>
- <aftersaveredirect>pkg_edit.php?xml=upclient.xml&amp;id=0</aftersaveredirect>
- <menu>
- <name>upclient</name>
- <tooltiptext>Modify upclient settings.</tooltiptext>
- <section>Services</section>
- <configfile>upclient.xml</configfile>
- <url>/pkg_edit.php?xml=upclient.xml&amp;id=0</url>
- </menu>
- <service>
- <name>upclient</name>
- <rcfile>upclient.sh</rcfile>
- <executable>upclient</executable>
- </service>
- <configpath>installedpackages->package->$packagename->configuration->settings</configpath>
- <fields>
- <field>
- <fielddescr>Authorization Key</fielddescr>
- <fieldname>authkey</fieldname>
- <description>This system's uptime authorization key.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Update Interval</fielddescr>
- <fieldname>interval</fieldname>
- <description>The interval between updates, in seconds (default 550).</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Uptime Server</fielddescr>
- <fieldname>server</fieldname>
- <description>The server this system should send uptime reports to.</description>
- <type>input</type>
- </field>
- </fields>
- <custom_php_global_functions>
- function sync_package_upclient() {
- global $config;
- conf_mount_rw();
- config_lock();
- $upclient_conf = $config['installedpackages']['upclient']['config'][0];
- $fout = fopen("/usr/local/etc/upclient.conf", "w");
- if($upclient_conf['authkey'] and $upclient_conf['server']) {
- fwrite($fout, "PidFile = /var/run/upclient.pid # Location of pid file\n");
- fwrite($fout, "AuthKey = {$upclient_conf['authkey']}\n");
- $interval = $upclient_conf['interval'] ? $upclient_conf['interval'] : "550";
- fwrite($fout, "Interval = {$interval}\n");
- fwrite($fout, "UptimeServer = {$upclient_conf['server']}\n");
- $static = &lt;&lt;&lt;EOD
-SendIdle = 1 # Send CPU idle percent
-SendUsage = 1 # Send CPU load percent
-SendOSName = 1 # Send name of your Operating System
-SendOSVersion = 1 # Send version of your OS
-SendCPU = 1 # Send CPU name of your machine
-SendCPUDetail = 1 # (BSD, Linux &amp; Solaris only)
-SendLoadAvg = 1 # Send 15-minute Load-average (unix only)
-
-EOD;
- fwrite($fout, $static);
- fclose($fout);
- }
- $start = "/usr/local/sbin/upclient &amp;";
- write_rcfile(array(
- "file" => "upclient.sh",
- "start" => $start
- )
- );
- restart_service("upclient");
- conf_mount_ro();
- config_unlock();
- }
- </custom_php_global_functions>
- <custom_add_php_command>
- sync_package_upclient();
- </custom_add_php_command>
-</packagegui>
-
diff --git a/config/archive/viralator.inc b/config/archive/viralator.inc
deleted file mode 100644
index 36ceb37f..00000000
--- a/config/archive/viralator.inc
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php
-require_once('config.inc');
-
-define('VIRALATOR_DOWNLOADDIR', '/usr/local/www/viralator');
-define('SQUIRM_CONF', '/usr/local/etc/squirm/squirm.conf');
-define('SQUIRM_PATTERNS', '/usr/local/etc/squirm/squirm.patterns');
-define('FORBIDDEN_EXTS', 'html htm css php pl js vbs jpg jpeg gif png');
-
-function viralator_install_command() {
- if (!is_dir(VIRALATOR_DOWNLOADDIR)) mkdir(VIRALATOR_DOWNLOADDIR);
-
- if (!is_file(SQUIRM_CONF)) {
- $conf = <<<EOD
-begin
-network 0.0.0.0/0
-pattern squirm.patterns get
-end
-
-EOD;
- file_put_contents(SQUIRM_CONF, $conf);
- }
-
- if (!is_dir(VIRALATOR_DOWNLOADDIR))
- make_dirs(VIRALATOR_DOWNLOADDIR);
-}
-
-function viralator_validate_input($post, &$input_errors) {
- if (trim($post['http_otherexts'])) {
- foreach (explode(',', $post['http_otherexts']) as $ext) {
- $ext = trim($ext);
- if (in_array($ext, explode(' ', FORBIDDEN_EXTS)))
- $input_errors[] = "The HTTP virus scanner can't scan *.$ext files.";
- else if (!preg_match('/\w+/', $ext))
- $input_errors[] = "*.ext is not a valid file extension.";
- }
- }
-}
-
-function viralator_get_real_lan_ip() {
- global $config;
-
- $lan_if = $config['interfaces']['lan']['if'];
- $line = trim(shell_exec("ifconfig $lan_if | grep inet | grep -v inet6"));
- list($dummy, $ip) = explode(' ', $line);
-
- return $ip;
-}
-
-function viralator_escape_dots($value) {
- return preg_replace('/\./', '\\.', $value);
-}
-
-function viralator_resync() {
- global $config;
- $settings = $config['installedpackages']['clamav']['config'][0];
-
- $exts = (empty($settings['http_exts']) ? array() : explode(',', $settings['http_exts']));
-
- if (trim($settings['http_otherexts'])) {
- foreach (explode(',', $settings['http_otherexts']) as $ext)
- $exts[] = trim($ext);
- }
-
- $towrite = '';
-
- // TODO: Escape any interface Squid listens on
- $lan_ip = viralator_get_real_lan_ip();
- if (is_ipaddr($lan_ip)) {
- $escaped = viralator_escape_dots($lan_ip);
- $towrite .= "abort regexi (^http://$escaped/.*)\n";
- }
-
- foreach (explode(' ', FORBIDDEN_EXTS) as $ext)
- $towrite .= "abort .$ext\n";
-
- foreach ($exts as $ext)
- $towrite .= "regexi (^.*\\.$ext\$) http://$lan_ip/viralator.pl?url=\\1\n";
-
- file_put_contents(SQUIRM_PATTERNS, $towrite);
-
- if (is_package_installed('squid')) {
- require_once('squid.inc');
- squid_resync();
- }
-}
-?>
diff --git a/config/archive/viralator.xml b/config/archive/viralator.xml
deleted file mode 100644
index 3953b126..00000000
--- a/config/archive/viralator.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>none</name>
- <version>none</version>
- <title>none</title>
- <include_file>viralator.inc</include_file>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/viralator.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://www.pfsense.org/packages/All/viralator.tgz</item>
- </additional_files_needed>
- <custom_php_install_command>
- viralator_install_command();
- </custom_php_install_command>
-</packagegui>
diff --git a/config/arpwatch.xml b/config/arpwatch/arpwatch.xml
index ea3f6795..a40422d4 100644
--- a/config/arpwatch.xml
+++ b/config/arpwatch/arpwatch.xml
@@ -72,12 +72,12 @@
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
<chmod>a+rx</chmod>
- <item>https://packages.pfsense.org/packages/config/arpwatch_reports.php</item>
+ <item>https://packages.pfsense.org/packages/config/arpwatch/arpwatch_reports.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/sbin/</prefix>
<chmod>a+rx</chmod>
- <item>https://packages.pfsense.org/packages/config/sm.php</item>
+ <item>https://packages.pfsense.org/packages/config/arpwatch/sm.php</item>
</additional_files_needed>
<fields>
<field>
diff --git a/config/arpwatch_reports.php b/config/arpwatch/arpwatch_reports.php
index 9b3b1c6c..9b3b1c6c 100755
--- a/config/arpwatch_reports.php
+++ b/config/arpwatch/arpwatch_reports.php
diff --git a/config/sm.php b/config/arpwatch/sm.php
index 2e1cc4a0..2e1cc4a0 100644
--- a/config/sm.php
+++ b/config/arpwatch/sm.php
diff --git a/config/bsdstats/bin/dig b/config/bsdstats/bin/dig
deleted file mode 100755
index ae267007..00000000
--- a/config/bsdstats/bin/dig
+++ /dev/null
Binary files differ
diff --git a/config/bsdstats/bsdstats.xml b/config/bsdstats/bsdstats.xml
deleted file mode 100644
index e2cc4393..00000000
--- a/config/bsdstats/bsdstats.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>bsdstats</name>
- <version>0.1</version>
- <title>BSDStats</title>
- <!-- Menu is where this packages menu will appear -->
- <menu>
- <name>BSDStats</name>
- <tooltiptext>BSDStats</tooltiptext>
- <section>Diagnostics</section>
- <url>http://bsdstats.hub.org/</url>
- </menu>
- <additional_files_needed>
- <prefix>/usr/bin/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/bsdstats/bin/dig</item>
- </additional_files_needed>
- <custom_php_install_command>
- system("/bin/mkdir -p /usr/local/etc/periodic/monthly/");
- system("/usr/bin/fetch -q -o /usr/local/etc/periodic/monthly/ http://www.bsdstats.org/downloads/300.statistics");
- system("/bin/chmod a+rx /usr/local/etc/periodic/monthly/300.statistics");
- if(!is_file("/usr/local/etc/periodic/monthly/300.statistics") {
- update_status("Could not fetch 300.statistics from bsdstats.org");
- update_output_window("Install failed. Please check dns, etc");
- exit;
- }
- system("echo monthly_statistics_report_devices=yes >> /etc/periodic.conf");
- system("echo monthly_statistics_enable=yes >> /etc/periodic.conf");
- mwexec_bg("/usr/local/etc/periodic/monthly/300.statistics");
- </custom_php_install_command>
- <custom_php_deinstall_command>
- system("/bin/cat /etc/periodic.conf | grep -n \"monthly_statistics_report_devices\" >/tmp/periodic.conf");
- system("/bin/cat /tmp/periodic.conf | grep -n \"monthly_statistics_enable\" >/etc/periodic.conf");
- system("/bin/rm /usr/local/etc/periodic/monthly/300.statistics");
- system("/bin/rm /tmp/periodic.conf");
- system("/bin/rm /tmp/getid");
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/cg2/sample/i18n/messages_de.xml b/config/cg2/sample/i18n/messages_de.xml
deleted file mode 100644
index 0cfef583..00000000
--- a/config/cg2/sample/i18n/messages_de.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<po creationdate ="2006-09-20 12:37+0100" translator="me@daniel.stefan.haischt.name">
- <message msgid="hey, this is only meant for quick and dirty stuff, do NOT implement anything longer than 2 or 3 commands here! Btw, i was clicked."
- msgstr="Hei, dies eignet sich nur f&#252;r Testzwecke. Benutze nur nur Quellcode der nicht mehr als 2 oder 3 Befehle umfasst! BTW, Ich wurde gedr&#252;ckt." />
- <message msgid="Hi, don't abuse me, use include_javascript instead!"
- msgstr="Hallo, missbrauche mich nicht. Nutze stattdessen include_javascript!" />
-</po> \ No newline at end of file
diff --git a/config/cg2/sample/i18n/messages_en.xml b/config/cg2/sample/i18n/messages_en.xml
deleted file mode 100644
index 1ee7d24d..00000000
--- a/config/cg2/sample/i18n/messages_en.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<po creationdate ="2006-09-20 12:37+0100" translator="me@daniel.stefan.haischt.name">
- <message msgid="hey, this is only meant for quick and dirty stuff, do NOT implement anything longer than 2 or 3 commands here! Btw, i was clicked."
- msgstr="hey, this is only meant for quick and dirty stuff, do NOT implement anything longer than 2 or 3 commands here! Btw, i was clicked." />
- <message msgid="Hi, don't abuse me, use include_javascript instead!"
- msgstr="Hi, don't abuse me, use include_javascript instead!" />
-</po> \ No newline at end of file
diff --git a/config/cg2/sample/sample.inc b/config/cg2/sample/sample.inc
deleted file mode 100644
index 62ec59ab..00000000
--- a/config/cg2/sample/sample.inc
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-//var_dump('BEING INCLUDED');
-
-function sample_on_load_event(&$widgets)
-{
- /* Called when the form is just loaded. You receive the array widgets as
- * argument, and can modify it to alter the behavior of the form. */
- //var_dump('BEING LOADED');
- //$widget =& $widgets[2];
- $widget =& get_widget($widgets, 'mytextarea');
- $widget->value='This example shows how to change the text inside a text box from within the include file, when the form is loaded.';
-}
-
-function sample_on_sync_event()
-{
- /* This is called when the form is posted. You generally want to sync the
- * configurations in the XML file to settings in files spread across the file
- * system or maybe restart a service here. */
- //var_dump('BEING SYNCED');
-}
-
-function sample_on_apply_event()
-{
- /* This is called when a configuration has been changed and the user is
- * prompted to apply the changes and clicks "Apply changes". */
- var_dump('BEING APPLIED');
-}
-
-function sample_on_submit_event()
-{
- /* This allows you to perform an action when an specific submit button is
- * clicked. This should only be used when you have more than one submit
- * button in the same form. Otherwise, <on_load_event> performs better and
- * is cleaner. */
- //var_dump('BEING SUBMITTED');
-}
-?>
diff --git a/config/cg2/sample/sample.xml b/config/cg2/sample/sample.xml
deleted file mode 100644
index d851c54e..00000000
--- a/config/cg2/sample/sample.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<coregui_master>
-<version>2.0</version>
-
-<title>A fancy example</title>
-
-<!--<include>sample.inc</include>-->
-<!--<tabs_callback>sample_generate_tabs</tabs_callback>-->
-<tab>
- <label>My fancy tab</label>
- <interface>sample_ui.xml</interface>
-</tab>
-<tab>
- <label>Another fancy tab</label>
- <interface>sample_ui2.xml</interface>
-</tab>
-
-</coregui_master>
diff --git a/config/cg2/sample/sample_ui.xml b/config/cg2/sample/sample_ui.xml
deleted file mode 100644
index aebe8bfe..00000000
--- a/config/cg2/sample/sample_ui.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<coregui_interface>
-<version>2.0</version>
-<config>sample</config>
-
-<include>sample.inc</include>
-<!--<include>sample2.inc</include>-->
-<include_javascript>sample.js</include_javascript>
-
-<element>
- <type>form</type>
- <on_load_event>sample_on_load_event</on_load_event>
- <on_sync_event>sample_on_sync_event</on_sync_event>
- <widget>
- <type>header</type>
- <label xml:lang="en-US">Headers are useful to separate stuff...</label>
- </widget>
- <widget>
- <type>textbox</type>
- <name>mytextbox</name>
- <label xml:lang="en-US">My fancy textbox</label>
- <description xml:lang="en-US">This is a textbox.</description>
- <value xml:lang="en-US">Welcome to the world of coregui 2.0</value>
- <required/>
- </widget>
- <widget>
- <type>ipsec_select</type>
- <name>ipsec</name>
- <label xml:lang="en-US">IPsec selection</label>
- <description xml:lang="en-US">IPsec selection widget test.</description>
- <multiple/>
- </widget>
- <widget>
- <type>select</type>
- <name>sample_sel</name>
- <label xml:lang="en-US">Sample selection</label>
- <option>
- <name>foo</name>
- <label xml:lang="en-US">Foo</label>
- </option>
- <option>
- <name>bar</name>
- <label xml:lang="en-US">Bar</label>
- </option>
- </widget>
- <widget>
- <type>interfaces_select</type>
- <name>inter_sel</name>
- <label xml:lang="en-US">Sample interfaces select</label>
- <multiple/>
- </widget>
- <widget>
- <type>textarea</type>
- <name>mytextarea</name>
- <label xml:lang="en-US">My fancy textarea</label>
- <description xml:lang="en-US">Just testing descriptions...</description>
- <value xml:lang="en-US">This widget can not be edited!</value>
- <read_only/>
- </widget>
- <widget>
- <type>checkbox</type>
- <name>mycheckbox</name>
- <label xml:lang="en-US">A sample checkbox</label>
- <caption xml:lang="en-US">Check this nice checkbox</caption>
- <description xml:lang="en-US">Now checkboxes can have a caption as well.</description>
- <on_check_javascript>_('hey, this is only meant for quick and dirty stuff, do NOT implement anything longer than 2 or 3 commands here! Btw, i was clicked.');</on_check_javascript>
- </widget>
- <widget>
- <type>submit</type>
- <name>mysubmit</name>
- <caption xml:lang="en-US">Send something</caption>
- <on_submit_event>sample_on_submit_event</on_submit_event>
- <group_start/>
- </widget>
- <widget>
- <type>button</type>
- <name>mybutton</name>
- <caption xml:lang="en-US">Cancel something</caption>
- <description xml:lang="en-US">The description for the last element in a group is the description that matters.</description>
- <on_click_javascript>_('Hi, don\'t abuse me, use include_javascript instead!');</on_click_javascript>
- <group_end/>
- </widget>
- <widget>
- <type>textbox</type>
- <name>dummydummy</name>
- <label xml:lang="en-US">Just some dummy text</label>
- <do_not_display/>
- </widget>
- <widget>
- <type>checkbox</type>
- <name>anothercheckbox</name>
- <label xml:lang="en-US">Another checkbox</label>
- <caption xml:lang="en-US">Enable</caption>
- <description xml:lang="en-US">Another checkbox, this time after a group, and disabled.</description>
- <disabled/>
- </widget>
-</element>
-
-<element>
- <type>table</type>
- <buttons>move,edit,delete,add</buttons>
- <on_apply_event>sample_on_apply_event</on_apply_event>
- <widget>
- <type>checkbox</type>
- <name>dummycheckbox</name>
- <label xml:lang="en-US">Dummy checkbox</label>
- </widget>
- <widget>
- <type>port</type>
- <name>dummyport</name>
- <label xml:lang="en-US">Port</label>
- <description xml:lang="en-US">Enter a port here.</description>
- <value>3128</value>
- <required/>
- </widget>
- <widget>
- <type>textbox</type>
- <name>dummysetting</name>
- <label xml:lang="en-US">Dummy setting</label>
- <description xml:lang="en-US">This dummy setting will not show up in the table.</description>
- <not_in_table/>
- </widget>
- <widget>
- <type>textarea</type>
- <name>longfield</name>
- <label xml:lang="en-US">Very long field</label>
- <description xml:lang="en-US">Very very very very very long field.</description>
- <highlighted/>
- </widget>
-</element>
-
-<element>
- <type>form</type>
- <widget>
- <type>header</type>
- <label xml:lang="en-US">...such as two different forms</label>
- </widget>
- <widget>
- <type>button</type>
- <name>mybutton</name>
- <label xml:lang="en-US">A simple button</label>
- <caption xml:lang="en-US">Another silly button</caption>
- </widget>
-</element>
-
-<element>
- <type>table</type>
- <widget>
- <label xml:lang="en-US">Silly test</label>
- </widget>
- <widget>
- <label xml:lang="en-US">Another field</label>
- </widget>
-</element>
-
-</coregui_interface>
diff --git a/config/cg2/sample/sample_ui2.xml b/config/cg2/sample/sample_ui2.xml
deleted file mode 100644
index aa17d49d..00000000
--- a/config/cg2/sample/sample_ui2.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<coregui_interface>
-<version>2.0</version>
-<config>sample2</config>
-
-<element>
- <type>form</type>
- <widget>
- <type>textbox</type>
- <name>mytextbox</name>
- <label xml:lang="en-US">My fancy textbox</label>
- <value>Welcome to the world of coregui 2.0</value>
- <required/>
- </widget>
- <widget>
- <type>textarea</type>
- <name>mytextarea</name>
- <label xml:lang="en-US">My fancy textarea</label>
- <value>This widget will be encoded to the config</value>
- <encode/>
- </widget>
- <widget>
- <type>submit</type>
- <name>mysubmit</name>
- <caption xml:lang="en-US">Submit this now</caption>
- </widget>
-</element>
-
-</coregui_interface>
diff --git a/config/clamav.inc b/config/clamav.inc
deleted file mode 100644
index 036f69cb..00000000
--- a/config/clamav.inc
+++ /dev/null
@@ -1,264 +0,0 @@
-<?php
-require_once('globals.inc');
-require_once('config.inc');
-require_once('service-utils.inc');
-require_once('pkg-utils.inc');
-require_once('pfsense-utils.inc');
-
-function clamav_install_command() {
- global $g;
- mwexec('rm -f /usr/local/etc/rc.d/clamav*');
-
- $clamav_rundir = "{$g['varrun_path']}/clamav";
-
- $pidfile = "$clamav_rundir/clamd.pid";
- $rcfile = array();
- $rcfile['file'] = 'clamd.sh';
- $rcfile['start'] = "mkdir -p $clamav_rundir\n\tchown proxy:proxy $clamav_rundir\n\tclamd";
- $rcfile['stop'] = "kill `cat $pidfile`";
- write_rcfile($rcfile);
-
- $pidfile = "$clamav_rundir/freshclam.pid";
- $rcfile = array();
- $rcfile['file'] = 'freshclam.sh';
- $rcfile['start'] = "mkdir -p $clamav_rundir\n\tchown proxy:proxy $clamav_rundir\n\tfreshclam -d";
- $rcfile['start'] = 'freshclam -d';
- $rcfile['stop'] = "kill `cat $pidfile`";
- write_rcfile($rcfile);
-
- $dbdir = "{$g['vardb_path']}/clamav";
- make_dirs($dbdir);
- chown($dbdir, 'proxy');
- $conf = <<<EOD
-DatabaseDirectory $dbdir
-PidFile $pidfile
-DatabaseOwner proxy
-AllowSupplementaryGroups
-DatabaseMirror database.clamav.net
-
-EOD;
- file_put_contents('/usr/local/etc/freshclam.conf', $conf);
-
- $static_output = "Fetching the virus database. This can take long. You can cancel this at any time by clicking the stop button in your browser.\n";
- update_output_window($static_output);
- $static_output .= system('freshclam');
- update_output_window($static_output);
- $static_output .= "Done!\n";
- update_output_window($static_output);
-
- start_service('freshclam');
-}
-
-function clamav_resync() {
- global $g, $config;
-
- $settings = $config['installedpackages']['clamav']['config'][0];
-
- $clamav_rundir = "{$g['varrun_path']}/clamav";
- $logfile = "{$g['varlog_path']}/clamd.log";
- $pidfile = "$clamav_rundir/clamd.pid";
- $tempdir = $g['tmp_path'];
- $dbdir = "{$g['vardb_path']}/clamav";
- $socket = "$clamav_rundir/clamd.socket";
-
- $conf = <<<EOD
-LogFile $logfile
-LogTime
-PidFile $pidfile
-TemporaryDirectory $tempdir
-DatabaseDirectory $dbdir
-LocalSocket $socket
-FixStaleSocket
-User proxy
-AllowSupplementaryGroups
-ScanMail
-
-EOD;
-
- if ($settings['expert_mode'] == 'on') $conf .= "DisableDefaultScanOptions";
- else {
- $options = array( 'brokenexec' => 'DetectBrokenExecutables',
- 'scan_pe' => 'ScanPE',
- 'scan_ole2' => 'ScanOLE2',
- 'scan_html' => 'ScanHTML',
- 'scan_archive' => 'ScanArchive');
- foreach ($options as $option => $directive) {
- if ($settings[$option] == 'on')
- $conf .= "$directive\n";
- }
- }
-
- file_put_contents('/usr/local/etc/clamd.conf', $conf);
-
- restart_service('clamav');
-
- if ($settings['scan_pop3'] == 'on') {
- require_once('p3scan.inc');
- p3scan_resync();
- }
-
- if ($settings['scan_smtp'] == 'on') {
- require_once('clamsmtp.inc');
- clamsmtp_resync();
- }
-
- if ($settings['scan_http'] == 'on') {
- require_once('viralator.inc');
- viralator_resync();
- }
-}
-
-function clamav_before_form(&$pkg) {
- global $config;
-
- if (is_package_installed('p3scan')) {
- $field = array();
- $field['fieldname'] = 'scan_pop3';
- $field['fielddescr'] = 'POP3 scanning';
- $field['description'] = 'Enable POP3 scanning.';
- $field['type'] = 'checkbox';
- $field['required'] = true;
- $field['enablefields'] = 'pop3_ifaces[]';
- $pkg['fields']['field'][] = $field;
-
- $field = array();
- $field['fieldname'] = 'pop3_ifaces';
- $field['fielddescr'] = 'POP3 interfaces';
- $field['description'] = 'The POP3 proxy will bind to the selected interfaces';
- $field['default_value'] = 'ALL';
- $field['type'] = 'interfaces_selection';
- $field['multiple'] = 'yes';
- $pkg['fields']['field'][] = $field;
- }
-
- if (is_package_installed('clamsmtp')) {
- $field = array();
- $field['fieldname'] = 'scan_smtp';
- $field['fielddescr'] = 'SMTP scanning';
- $field['description'] = 'Enable SMTP scanning.';
- $field['required'] = true;
- $field['type'] = 'checkbox';
- $field['enablefields'] = 'smtp_ifaces[],smtp_server,smtp_port';
- $pkg['fields']['field'][] = $field;
-
- $field = array();
- $field['fieldname'] = 'smtp_ifaces';
- $field['fielddescr'] = 'SMTP interfaces';
- $field['description'] = 'The SMTP proxy will bind to the selected interfaces';
- $field['default_value'] = 'ALL';
- $field['type'] = 'interfaces_selection';
- $field['multiple'] = 'yes';
- $pkg['fields']['field'][] = $field;
-
- $field = array();
- $field['fieldname'] = 'smtp_server';
- $field['fielddescr'] = 'SMTP server address';
- $field['description'] = 'Enter the IP address of the local SMTP server.';
- $field['type'] = 'input';
- $pkg['fields']['field'][] = $field;
-
- $field = array();
- $field['fieldname'] = 'smtp_port';
- $field['fielddescr'] = 'SMTP server port';
- $field['description'] = 'Enter the port of the local SMTP server.';
- $field['type'] = 'input';
- $pkg['fields']['field'][] = $field;
- }
-
- if (is_package_installed('viralator')) {
- $field = array();
- $field['fieldname'] = 'scan_http';
- $field['fielddescr'] = 'HTTP scanning';
- $field['description'] = 'Enable HTTP scanning. Note that this filtering is triggered by the proxy server. Therefore, to transparently filter out HTTP viruses, you need to set up the proxy server in transparent mode.';
- $field['required'] = 'yes';
- $field['type'] = 'checkbox';
- $field['enablefields'] = 'http_exts[],http_otherexts';
- $pkg['fields']['field'][] = $field;
-
- $field = array();
- $field['fieldname'] = 'http_exts';
- $field['fielddescr'] = 'Extensions to scan';
- $field['description'] = 'Extensions to be scanned by the HTTP virus scanner';
- $field['type'] = 'select';
- $exts = array();
- $exts['zip'] = 'Archives in the ZIP format';
- $exts['rar'] = 'Archives in the RAR format';
- $exts['arj'] = 'Archives in the ARJ format';
- $exts['gz'] = 'Files compressed in the GZ format';
- $exts['bz2'] = 'Files compressed in the BZIP2 format';
- $exts['exe'] = 'Windows/DOS PE (EXE) executables';
- $exts['com'] = 'DOS COM executables';
- $exts['bat'] = 'DOS Batch files';
- foreach ($exts as $ext => $desc)
- $field['options']['option'][] = array('name' => "$desc (*.$ext)", 'value' => $ext);
- $field['multiple'] = 'yes';
- $pkg['fields']['field'][] = $field;
-
- $field = array();
- $field['fieldname'] = 'http_otherexts';
- $field['fielddescr'] = 'Other extensions to scan';
- $field['description'] = 'Comma-separated list of extensions to be scanned by the HTTP virus scanner (e.g.: txt,ppt,doc,wmv).';
- $field['type'] = 'input';
- $pkg['fields']['field'][] = $field;
- }
-}
-
-function clamav_validate_input($post, &$input_errors) {
- if ($post['scan_smtp'] == 'on') {
- require_once('clamsmtp.inc');
- clamsmtp_validate_input($post, $input_errors);
- }
-
- if (is_package_installed('viralator')) {
- require_once('viralator.inc');
- viralator_validate_input($post, $input_errors);
- }
-}
-
-function clamav_generate_rules($type) {
- global $config;
-
- if (!is_service_running('clamav')) return;
-
- $rules = '';
- $clamav_conf = $config['installedpackages']['clamav']['config'][0];
- $sassassin_conf = $config['installedpackages']['sassassin']['config'][0];
-
- $p3scan_enabled = (($clamav_conf['scan_pop3'] == 'on') || ($sassassin_conf['enable'] == 'on'));
- if ($p3scan_enabled && is_service_running('p3scan')) {
- $ifaces = explode(',', $clamav_conf['pop3_ifaces']);
- $ifaces = array_map('convert_friendly_interface_to_real_interface_name', $ifaces);
-
- switch($type) {
- case 'nat':
- foreach ($ifaces as $iface)
- $rules .= "rdr on $iface proto tcp to port pop3 -> 127.0.0.1 port 8110\n";
- break;
- case 'filter':
- case 'rule':
- foreach ($ifaces as $iface)
- $rules .= "pass quick on $iface proto tcp to port pop3 flags S/SA keep state\n";
- break;
- default:
- break;
- }
- }
-
- if ($clamav_conf['scan_smtp'] && is_service_running('clamsmtp')) {
- $ifaces = explode(',', $clamav_conf['pop3_ifaces']);
- $ifaces = array_map('convert_friendly_interface_to_real_interface_name', $ifaces);
-
- if ($type == 'nat') {
- foreach ($ifaces as $iface)
- $rules .= "rdr on $iface proto tcp to ($iface) port smtp -> 127.0.0.1 port 10025\n";
- }
-
- else if ($type == 'filer' || $type == 'rule') {
- foreach ($ifaces as $iface)
- $rules .= "pass quick on $iface proto tcp to ($iface) port smtp flags S/SA keep state\n";
- }
- }
-
- return ($rules);
-}
-?>
diff --git a/config/clamav.xml b/config/clamav.xml
deleted file mode 100644
index aac32d1e..00000000
--- a/config/clamav.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>clamav</name>
- <version>none</version>
- <title>Antivirus</title>
- <include_file>clamav.inc</include_file>
- <menu>
- <name>Antivirus</name>
- <tooltiptext>Configure antivirus settings</tooltiptext>
- <section>Services</section>
- <url>/pkg_edit.php?xml=clamav.xml&amp;id=0</url>
- </menu>
- <service>
- <name>ClamAV</name>
- <rcfile>clamd.sh</rcfile>
- <executable>clamd</executable>
- <description>The ClamAV antivirus.</description>
- </service>
- <service>
- <name>FreshClam</name>
- <rcfile>freshclam.sh</rcfile>
- <executable>freshclam</executable>
- <description>A daemon that periodically updates the ClamAV virus database.</description>
- </service>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/clamav.inc</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Expert mode</fielddescr>
- <fieldname>expert</fieldname>
- <description>This enables the expert mode. Don't check this unless you are sure of what you are doing.</description>
- <type>checkbox</type>
- <enablefields>brokenexec,scan_pe,scan_ole2,scan_html,scan_archive</enablefields>
- <required/>
- </field>
- <field>
- <fielddescr>Detect broken executables</fielddescr>
- <fieldname>brokenexec</fieldname>
- <description>Try to detect broken executables.</description>
- <type>checkbox</type>
- <default_value>on</default_value>
- </field>
- <field>
- <fielddescr>Scan PE</fielddescr>
- <fieldname>scan_pe</fieldname>
- <description>Scan files in 32-bit Windows' Portable Executable format.</description>
- <type>checkbox</type>
- <default_value>on</default_value>
- </field>
- <field>
- <fielddescr>Scan OLE2</fielddescr>
- <fieldname>scan_ole2</fieldname>
- <description>Scan Microsoft Office document macros.</description>
- <type>checkbox</type>
- <default_value>on</default_value>
- </field>
- <field>
- <fielddescr>Scan HTML</fielddescr>
- <fieldname>scan_html</fieldname>
- <description>Perform HTML normalization and decryption of Microsoft Script Encoder code.</description>
- <type>checkbox</type>
- <default_value>on</default_value>
- </field>
- <field>
- <fielddescr>Scan archives</fielddescr>
- <fieldname>scan_archive</fieldname>
- <description>Try to uncompress archived files to scan their content.</description>
- <type>checkbox</type>
- <default_value>on</default_value>
- </field>
- </fields>
- <custom_php_command_before_form>
- clamav_before_form($pkg);
- </custom_php_command_before_form>
- <custom_php_resync_config_command>
- clamav_resync();
- </custom_php_resync_config_command>
- <custom_php_validation_command>
- clamav_validate_input($post, $input_errors);
- </custom_php_validation_command>
- <custom_php_install_command>
- clamav_install_command();
- </custom_php_install_command>
- <filter_rules_needed>clamav_generate_rules</filter_rules_needed>
-</packagegui>
diff --git a/config/countryblock/class.phpmailer.tmp b/config/countryblock/class.phpmailer.tmp
deleted file mode 100644
index c2cbba03..00000000
--- a/config/countryblock/class.phpmailer.tmp
+++ /dev/null
@@ -1,1909 +0,0 @@
-<?php
-/*~ class.phpmailer.php
-.---------------------------------------------------------------------------.
-| Software: PHPMailer - PHP email class |
-| Version: 2.0.4 |
-| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
-| Info: http://phpmailer.sourceforge.net |
-| Support: http://sourceforge.net/projects/phpmailer/ |
-| ------------------------------------------------------------------------- |
-| Author: Andy Prevost (project admininistrator) |
-| Author: Brent R. Matzelle (original founder) |
-| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
-| Copyright (c) 2001-2003, Brent R. Matzelle |
-| ------------------------------------------------------------------------- |
-| License: Distributed under the Lesser General Public License (LGPL) |
-| http://www.gnu.org/copyleft/lesser.html |
-| This program is distributed in the hope that it will be useful - WITHOUT |
-| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
-| FITNESS FOR A PARTICULAR PURPOSE. |
-| ------------------------------------------------------------------------- |
-| We offer a number of paid services (www.codeworxtech.com): |
-| - Web Hosting on highly optimized fast and secure servers |
-| - Technology Consulting |
-| - Oursourcing (highly qualified programmers and graphic designers) |
-'---------------------------------------------------------------------------'
-
-/**
- * PHPMailer - PHP email transport class
- * @package PHPMailer
- * @author Andy Prevost
- * @copyright 2004 - 2009 Andy Prevost
- */
-
-class PHPMailer {
-
- /////////////////////////////////////////////////
- // PROPERTIES, PUBLIC
- /////////////////////////////////////////////////
-
- /**
- * Email priority (1 = High, 3 = Normal, 5 = low).
- * @var int
- */
- var $Priority = 3;
-
- /**
- * Sets the CharSet of the message.
- * @var string
- */
- var $CharSet = 'iso-8859-1';
-
- /**
- * Sets the Content-type of the message.
- * @var string
- */
- var $ContentType = 'text/plain';
-
- /**
- * Sets the Encoding of the message. Options for this are "8bit",
- * "7bit", "binary", "base64", and "quoted-printable".
- * @var string
- */
- var $Encoding = '8bit';
-
- /**
- * Holds the most recent mailer error message.
- * @var string
- */
- var $ErrorInfo = '';
-
- /**
- * Sets the From email address for the message.
- * @var string
- */
- var $From = 'root@localhost';
-
- /**
- * Sets the From name of the message.
- * @var string
- */
- var $FromName = 'Root User';
-
- /**
- * Sets the Sender email (Return-Path) of the message. If not empty,
- * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
- * @var string
- */
- var $Sender = '';
-
- /**
- * Sets the Subject of the message.
- * @var string
- */
- var $Subject = '';
-
- /**
- * Sets the Body of the message. This can be either an HTML or text body.
- * If HTML then run IsHTML(true).
- * @var string
- */
- var $Body = '';
-
- /**
- * Sets the text-only body of the message. This automatically sets the
- * email to multipart/alternative. This body can be read by mail
- * clients that do not have HTML email capability such as mutt. Clients
- * that can read HTML will view the normal Body.
- * @var string
- */
- var $AltBody = '';
-
- /**
- * Sets word wrapping on the body of the message to a given number of
- * characters.
- * @var int
- */
- var $WordWrap = 0;
-
- /**
- * Method to send mail: ("mail", "sendmail", or "smtp").
- * @var string
- */
- var $Mailer = 'mail';
-
- /**
- * Sets the path of the sendmail program.
- * @var string
- */
- var $Sendmail = '/usr/sbin/sendmail';
-
- /**
- * Path to PHPMailer plugins. This is now only useful if the SMTP class
- * is in a different directory than the PHP include path.
- * @var string
- */
- var $PluginDir = '';
-
- /**
- * Holds PHPMailer version.
- * @var string
- */
- var $Version = "2.0.4";
-
- /**
- * Sets the email address that a reading confirmation will be sent.
- * @var string
- */
- var $ConfirmReadingTo = '';
-
- /**
- * Sets the hostname to use in Message-Id and Received headers
- * and as default HELO string. If empty, the value returned
- * by SERVER_NAME is used or 'localhost.localdomain'.
- * @var string
- */
- var $Hostname = '';
-
- /**
- * Sets the message ID to be used in the Message-Id header.
- * If empty, a unique id will be generated.
- * @var string
- */
- var $MessageID = '';
-
- /////////////////////////////////////////////////
- // PROPERTIES FOR SMTP
- /////////////////////////////////////////////////
-
- /**
- * Sets the SMTP hosts. All hosts must be separated by a
- * semicolon. You can also specify a different port
- * for each host by using this format: [hostname:port]
- * (e.g. "smtp1.example.com:25;smtp2.example.com").
- * Hosts will be tried in order.
- * @var string
- */
- var $Host = 'smtp.gmail.com';
-
- /**
- * Sets the default SMTP server port.
- * @var int
- */
- var $Port = 465;
-
- /**
- * Sets the SMTP HELO of the message (Default is $Hostname).
- * @var string
- */
- var $Helo = '';
-
- /**
- * Sets connection prefix.
- * Options are "", "ssl" or "tls"
- * @var string
- */
- var $SMTPSecure = "ssl";
-
- /**
- * Sets SMTP authentication. Utilizes the Username and Password variables.
- * @var bool
- */
- var $SMTPAuth = false;
-
- /**
- * Sets SMTP username.
- * @var string
- */
- var $Username = '';
-
- /**
- * Sets SMTP password.
- * @var string
- */
- var $Password = '';
-
- /**
- * Sets the SMTP server timeout in seconds. This function will not
- * work with the win32 version.
- * @var int
- */
- var $Timeout = 10;
-
- /**
- * Sets SMTP class debugging on or off.
- * @var bool
- */
- var $SMTPDebug = false;
-
- /**
- * Prevents the SMTP connection from being closed after each mail
- * sending. If this is set to true then to close the connection
- * requires an explicit call to SmtpClose().
- * @var bool
- */
- var $SMTPKeepAlive = false;
-
- /**
- * Provides the ability to have the TO field process individual
- * emails, instead of sending to entire TO addresses
- * @var bool
- */
- var $SingleTo = false;
-
- /////////////////////////////////////////////////
- // PROPERTIES, PRIVATE
- /////////////////////////////////////////////////
-
- var $smtp = NULL;
- var $to = array();
- var $cc = array();
- var $bcc = array();
- var $ReplyTo = array();
- var $attachment = array();
- var $CustomHeader = array();
- var $message_type = '';
- var $boundary = array();
- var $language = array();
- var $error_count = 0;
- var $LE = "\n";
- var $sign_cert_file = "";
- var $sign_key_file = "";
- var $sign_key_pass = "";
-
- /////////////////////////////////////////////////
- // METHODS, VARIABLES
- /////////////////////////////////////////////////
-
- /**
- * Sets message type to HTML.
- * @param bool $bool
- * @return void
- */
- function IsHTML($bool) {
- if($bool == true) {
- $this->ContentType = 'text/html';
- } else {
- $this->ContentType = 'text/plain';
- }
- }
-
- /**
- * Sets Mailer to send message using SMTP.
- * @return void
- */
- function IsSMTP() {
- $this->Mailer = 'smtp';
- }
-
- /**
- * Sets Mailer to send message using PHP mail() function.
- * @return void
- */
- function IsMail() {
- $this->Mailer = 'mail';
- }
-
- /**
- * Sets Mailer to send message using the $Sendmail program.
- * @return void
- */
- function IsSendmail() {
- $this->Mailer = 'sendmail';
- }
-
- /**
- * Sets Mailer to send message using the qmail MTA.
- * @return void
- */
- function IsQmail() {
- $this->Sendmail = '/var/qmail/bin/sendmail';
- $this->Mailer = 'sendmail';
- }
-
- /////////////////////////////////////////////////
- // METHODS, RECIPIENTS
- /////////////////////////////////////////////////
-
- /**
- * Adds a "To" address.
- * @param string $address
- * @param string $name
- * @return void
- */
- function AddAddress($address, $name = '') {
- $cur = count($this->to);
- $this->to[$cur][0] = trim($address);
- $this->to[$cur][1] = $name;
- }
-
- /**
- * Adds a "Cc" address. Note: this function works
- * with the SMTP mailer on win32, not with the "mail"
- * mailer.
- * @param string $address
- * @param string $name
- * @return void
- */
- function AddCC($address, $name = '') {
- $cur = count($this->cc);
- $this->cc[$cur][0] = trim($address);
- $this->cc[$cur][1] = $name;
- }
-
- /**
- * Adds a "Bcc" address. Note: this function works
- * with the SMTP mailer on win32, not with the "mail"
- * mailer.
- * @param string $address
- * @param string $name
- * @return void
- */
- function AddBCC($address, $name = '') {
- $cur = count($this->bcc);
- $this->bcc[$cur][0] = trim($address);
- $this->bcc[$cur][1] = $name;
- }
-
- /**
- * Adds a "Reply-To" address.
- * @param string $address
- * @param string $name
- * @return void
- */
- function AddReplyTo($address, $name = '') {
- $cur = count($this->ReplyTo);
- $this->ReplyTo[$cur][0] = trim($address);
- $this->ReplyTo[$cur][1] = $name;
- }
-
- /////////////////////////////////////////////////
- // METHODS, MAIL SENDING
- /////////////////////////////////////////////////
-
- /**
- * Creates message and assigns Mailer. If the message is
- * not sent successfully then it returns false. Use the ErrorInfo
- * variable to view description of the error.
- * @return bool
- */
- function Send() {
- $header = '';
- $body = '';
- $result = true;
-
- if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
- $this->SetError($this->Lang('provide_address'));
- return false;
- }
-
- /* Set whether the message is multipart/alternative */
- if(!empty($this->AltBody)) {
- $this->ContentType = 'multipart/alternative';
- }
-
- $this->error_count = 0; // reset errors
- $this->SetMessageType();
- $header .= $this->CreateHeader();
- $body = $this->CreateBody();
-
- if($body == '') {
- return false;
- }
-
- /* Choose the mailer */
- switch($this->Mailer) {
- case 'sendmail':
- $result = $this->SendmailSend($header, $body);
- break;
- case 'smtp':
- $result = $this->SmtpSend($header, $body);
- break;
- case 'mail':
- $result = $this->MailSend($header, $body);
- break;
- default:
- $result = $this->MailSend($header, $body);
- break;
- //$this->SetError($this->Mailer . $this->Lang('mailer_not_supported'));
- //$result = false;
- //break;
- }
-
- return $result;
- }
-
- /**
- * Sends mail using the $Sendmail program.
- * @access private
- * @return bool
- */
- function SendmailSend($header, $body) {
- if ($this->Sender != '') {
- $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
- } else {
- $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail));
- }
-
- if(!@$mail = popen($sendmail, 'w')) {
- $this->SetError($this->Lang('execute') . $this->Sendmail);
- return false;
- }
-
- fputs($mail, $header);
- fputs($mail, $body);
-
- $result = pclose($mail);
- if (version_compare(phpversion(), '4.2.3') == -1) {
- $result = $result >> 8 & 0xFF;
- }
- if($result != 0) {
- $this->SetError($this->Lang('execute') . $this->Sendmail);
- return false;
- }
- return true;
- }
-
- /**
- * Sends mail using the PHP mail() function.
- * @access private
- * @return bool
- */
- function MailSend($header, $body) {
-
- $to = '';
- for($i = 0; $i < count($this->to); $i++) {
- if($i != 0) { $to .= ', '; }
- $to .= $this->AddrFormat($this->to[$i]);
- }
-
- $toArr = split(',', $to);
-
- $params = sprintf("-oi -f %s", $this->Sender);
- if ($this->Sender != '' && strlen(ini_get('safe_mode')) < 1) {
- $old_from = ini_get('sendmail_from');
- ini_set('sendmail_from', $this->Sender);
- if ($this->SingleTo === true && count($toArr) > 1) {
- foreach ($toArr as $key => $val) {
- $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
- }
- } else {
- $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
- }
- } else {
- if ($this->SingleTo === true && count($toArr) > 1) {
- foreach ($toArr as $key => $val) {
- $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
- }
- } else {
- $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
- }
- }
-
- if (isset($old_from)) {
- ini_set('sendmail_from', $old_from);
- }
-
- if(!$rt) {
- $this->SetError($this->Lang('instantiate'));
- return false;
- }
-
- return true;
- }
-
- /**
- * Sends mail via SMTP using PhpSMTP (Author:
- * Chris Ryan). Returns bool. Returns false if there is a
- * bad MAIL FROM, RCPT, or DATA input.
- * @access private
- * @return bool
- */
- function SmtpSend($header, $body) {
- include_once($this->PluginDir . 'class.smtp.php');
- $error = '';
- $bad_rcpt = array();
-
- if(!$this->SmtpConnect()) {
- return false;
- }
-
- $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
- if(!$this->smtp->Mail($smtp_from)) {
- $error = $this->Lang('from_failed') . $smtp_from;
- $this->SetError($error);
- $this->smtp->Reset();
- return false;
- }
-
- /* Attempt to send attach all recipients */
- for($i = 0; $i < count($this->to); $i++) {
- if(!$this->smtp->Recipient($this->to[$i][0])) {
- $bad_rcpt[] = $this->to[$i][0];
- }
- }
- for($i = 0; $i < count($this->cc); $i++) {
- if(!$this->smtp->Recipient($this->cc[$i][0])) {
- $bad_rcpt[] = $this->cc[$i][0];
- }
- }
- for($i = 0; $i < count($this->bcc); $i++) {
- if(!$this->smtp->Recipient($this->bcc[$i][0])) {
- $bad_rcpt[] = $this->bcc[$i][0];
- }
- }
-
- if(count($bad_rcpt) > 0) { // Create error message
- for($i = 0; $i < count($bad_rcpt); $i++) {
- if($i != 0) {
- $error .= ', ';
- }
- $error .= $bad_rcpt[$i];
- }
- $error = $this->Lang('recipients_failed') . $error;
- $this->SetError($error);
- $this->smtp->Reset();
- return false;
- }
-
- if(!$this->smtp->Data($header . $body)) {
- $this->SetError($this->Lang('data_not_accepted'));
- $this->smtp->Reset();
- return false;
- }
- if($this->SMTPKeepAlive == true) {
- $this->smtp->Reset();
- } else {
- $this->SmtpClose();
- }
-
- return true;
- }
-
- /**
- * Initiates a connection to an SMTP server. Returns false if the
- * operation failed.
- * @access private
- * @return bool
- */
- function SmtpConnect() {
- if($this->smtp == NULL) {
- $this->smtp = new SMTP();
- }
-
- $this->smtp->do_debug = $this->SMTPDebug;
- $hosts = explode(';', $this->Host);
- $index = 0;
- $connection = ($this->smtp->Connected());
-
- /* Retry while there is no connection */
- while($index < count($hosts) && $connection == false) {
- $hostinfo = array();
- if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
- $host = $hostinfo[1];
- $port = $hostinfo[2];
- } else {
- $host = $hosts[$index];
- $port = $this->Port;
- }
-
- if($this->smtp->Connect(((!empty($this->SMTPSecure))?$this->SMTPSecure.'://':'').$host, $port, $this->Timeout)) {
- if ($this->Helo != '') {
- $this->smtp->Hello($this->Helo);
- } else {
- $this->smtp->Hello($this->ServerHostname());
- }
-
- $connection = true;
- if($this->SMTPAuth) {
- if(!$this->smtp->Authenticate($this->Username, $this->Password)) {
- $this->SetError($this->Lang('authenticate'));
- $this->smtp->Reset();
- $connection = false;
- }
- }
- }
- $index++;
- }
- if(!$connection) {
- $this->SetError($this->Lang('connect_host'));
- }
-
- return $connection;
- }
-
- /**
- * Closes the active SMTP session if one exists.
- * @return void
- */
- function SmtpClose() {
- if($this->smtp != NULL) {
- if($this->smtp->Connected()) {
- $this->smtp->Quit();
- $this->smtp->Close();
- }
- }
- }
-
- /**
- * Sets the language for all class error messages. Returns false
- * if it cannot load the language file. The default language type
- * is English.
- * @param string $lang_type Type of language (e.g. Portuguese: "br")
- * @param string $lang_path Path to the language file directory
- * @access public
- * @return bool
- */
- function SetLanguage($lang_type, $lang_path = 'language/') {
- if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php')) {
- include($lang_path.'phpmailer.lang-'.$lang_type.'.php');
- } elseif (file_exists($lang_path.'phpmailer.lang-en.php')) {
- include($lang_path.'phpmailer.lang-en.php');
- } else {
- $PHPMAILER_LANG = array();
- $PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' .
- $PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';
- $PHPMAILER_LANG["execute"] = 'Could not execute: ';
- $PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.';
- $PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.';
- $PHPMAILER_LANG["from_failed"] = 'The following From address failed: ';
- $PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' .
- $PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.';
- $PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.';
- $PHPMAILER_LANG["file_access"] = 'Could not access file: ';
- $PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: ';
- $PHPMAILER_LANG["encoding"] = 'Unknown encoding: ';
- $PHPMAILER_LANG["signing"] = 'Signing Error: ';
- }
- $this->language = $PHPMAILER_LANG;
-
- return true;
- }
-
- /////////////////////////////////////////////////
- // METHODS, MESSAGE CREATION
- /////////////////////////////////////////////////
-
- /**
- * Creates recipient headers.
- * @access private
- * @return string
- */
- function AddrAppend($type, $addr) {
- $addr_str = $type . ': ';
- $addr_str .= $this->AddrFormat($addr[0]);
- if(count($addr) > 1) {
- for($i = 1; $i < count($addr); $i++) {
- $addr_str .= ', ' . $this->AddrFormat($addr[$i]);
- }
- }
- $addr_str .= $this->LE;
-
- return $addr_str;
- }
-
- /**
- * Formats an address correctly.
- * @access private
- * @return string
- */
- function AddrFormat($addr) {
- if(empty($addr[1])) {
- $formatted = $this->SecureHeader($addr[0]);
- } else {
- $formatted = $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">";
- }
-
- return $formatted;
- }
-
- /**
- * Wraps message for use with mailers that do not
- * automatically perform wrapping and for quoted-printable.
- * Original written by philippe.
- * @access private
- * @return string
- */
- function WrapText($message, $length, $qp_mode = false) {
- $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
- // If utf-8 encoding is used, we will need to make sure we don't
- // split multibyte characters when we wrap
- $is_utf8 = (strtolower($this->CharSet) == "utf-8");
-
- $message = $this->FixEOL($message);
- if (substr($message, -1) == $this->LE) {
- $message = substr($message, 0, -1);
- }
-
- $line = explode($this->LE, $message);
- $message = '';
- for ($i=0 ;$i < count($line); $i++) {
- $line_part = explode(' ', $line[$i]);
- $buf = '';
- for ($e = 0; $e<count($line_part); $e++) {
- $word = $line_part[$e];
- if ($qp_mode and (strlen($word) > $length)) {
- $space_left = $length - strlen($buf) - 1;
- if ($e != 0) {
- if ($space_left > 20) {
- $len = $space_left;
- if ($is_utf8) {
- $len = $this->UTF8CharBoundary($word, $len);
- } elseif (substr($word, $len - 1, 1) == "=") {
- $len--;
- } elseif (substr($word, $len - 2, 1) == "=") {
- $len -= 2;
- }
- $part = substr($word, 0, $len);
- $word = substr($word, $len);
- $buf .= ' ' . $part;
- $message .= $buf . sprintf("=%s", $this->LE);
- } else {
- $message .= $buf . $soft_break;
- }
- $buf = '';
- }
- while (strlen($word) > 0) {
- $len = $length;
- if ($is_utf8) {
- $len = $this->UTF8CharBoundary($word, $len);
- } elseif (substr($word, $len - 1, 1) == "=") {
- $len--;
- } elseif (substr($word, $len - 2, 1) == "=") {
- $len -= 2;
- }
- $part = substr($word, 0, $len);
- $word = substr($word, $len);
-
- if (strlen($word) > 0) {
- $message .= $part . sprintf("=%s", $this->LE);
- } else {
- $buf = $part;
- }
- }
- } else {
- $buf_o = $buf;
- $buf .= ($e == 0) ? $word : (' ' . $word);
-
- if (strlen($buf) > $length and $buf_o != '') {
- $message .= $buf_o . $soft_break;
- $buf = $word;
- }
- }
- }
- $message .= $buf . $this->LE;
- }
-
- return $message;
- }
-
- /**
- * Finds last character boundary prior to maxLength in a utf-8
- * quoted (printable) encoded string.
- * Original written by Colin Brown.
- * @access private
- * @param string $encodedText utf-8 QP text
- * @param int $maxLength find last character boundary prior to this length
- * @return int
- */
- function UTF8CharBoundary($encodedText, $maxLength) {
- $foundSplitPos = false;
- $lookBack = 3;
- while (!$foundSplitPos) {
- $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
- $encodedCharPos = strpos($lastChunk, "=");
- if ($encodedCharPos !== false) {
- // Found start of encoded character byte within $lookBack block.
- // Check the encoded byte value (the 2 chars after the '=')
- $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
- $dec = hexdec($hex);
- if ($dec < 128) { // Single byte character.
- // If the encoded char was found at pos 0, it will fit
- // otherwise reduce maxLength to start of the encoded char
- $maxLength = ($encodedCharPos == 0) ? $maxLength :
- $maxLength - ($lookBack - $encodedCharPos);
- $foundSplitPos = true;
- } elseif ($dec >= 192) { // First byte of a multi byte character
- // Reduce maxLength to split at start of character
- $maxLength = $maxLength - ($lookBack - $encodedCharPos);
- $foundSplitPos = true;
- } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back
- $lookBack += 3;
- }
- } else {
- // No encoded character found
- $foundSplitPos = true;
- }
- }
- return $maxLength;
- }
-
- /**
- * Set the body wrapping.
- * @access private
- * @return void
- */
- function SetWordWrap() {
- if($this->WordWrap < 1) {
- return;
- }
-
- switch($this->message_type) {
- case 'alt':
- /* fall through */
- case 'alt_attachments':
- $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap);
- break;
- default:
- $this->Body = $this->WrapText($this->Body, $this->WordWrap);
- break;
- }
- }
-
- /**
- * Assembles message header.
- * @access private
- * @return string
- */
- function CreateHeader() {
- $result = '';
-
- /* Set the boundaries */
- $uniq_id = md5(uniqid(time()));
- $this->boundary[1] = 'b1_' . $uniq_id;
- $this->boundary[2] = 'b2_' . $uniq_id;
-
- $result .= $this->HeaderLine('Date', $this->RFCDate());
- if($this->Sender == '') {
- $result .= $this->HeaderLine('Return-Path', trim($this->From));
- } else {
- $result .= $this->HeaderLine('Return-Path', trim($this->Sender));
- }
-
- /* To be created automatically by mail() */
- if($this->Mailer != 'mail') {
- if(count($this->to) > 0) {
- $result .= $this->AddrAppend('To', $this->to);
- } elseif (count($this->cc) == 0) {
- $result .= $this->HeaderLine('To', 'undisclosed-recipients:;');
- }
- }
-
- $from = array();
- $from[0][0] = trim($this->From);
- $from[0][1] = $this->FromName;
- $result .= $this->AddrAppend('From', $from);
-
- /* sendmail and mail() extract Cc from the header before sending */
- if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->cc) > 0)) {
- $result .= $this->AddrAppend('Cc', $this->cc);
- }
-
- /* sendmail and mail() extract Bcc from the header before sending */
- if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) {
- $result .= $this->AddrAppend('Bcc', $this->bcc);
- }
-
- if(count($this->ReplyTo) > 0) {
- $result .= $this->AddrAppend('Reply-To', $this->ReplyTo);
- }
-
- /* mail() sets the subject itself */
- if($this->Mailer != 'mail') {
- $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject)));
- }
-
- if($this->MessageID != '') {
- $result .= $this->HeaderLine('Message-ID',$this->MessageID);
- } else {
- $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
- }
- $result .= $this->HeaderLine('X-Priority', $this->Priority);
- $result .= $this->HeaderLine('X-Mailer', 'PHPMailer (phpmailer.sourceforge.net) [version ' . $this->Version . ']');
-
- if($this->ConfirmReadingTo != '') {
- $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
- }
-
- // Add custom headers
- for($index = 0; $index < count($this->CustomHeader); $index++) {
- $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
- }
- if (!$this->sign_key_file) {
- $result .= $this->HeaderLine('MIME-Version', '1.0');
- $result .= $this->GetMailMIME();
- }
-
- return $result;
- }
-
- /**
- * Returns the message MIME.
- * @access private
- * @return string
- */
- function GetMailMIME() {
- $result = '';
- switch($this->message_type) {
- case 'plain':
- $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding);
- $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet);
- break;
- case 'attachments':
- /* fall through */
- case 'alt_attachments':
- if($this->InlineImageExists()){
- $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE);
- } else {
- $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;');
- $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
- }
- break;
- case 'alt':
- $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;');
- $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
- break;
- }
-
- if($this->Mailer != 'mail') {
- $result .= $this->LE.$this->LE;
- }
-
- return $result;
- }
-
- /**
- * Assembles the message body. Returns an empty string on failure.
- * @access private
- * @return string
- */
- function CreateBody() {
- $result = '';
- if ($this->sign_key_file) {
- $result .= $this->GetMailMIME();
- }
-
- $this->SetWordWrap();
-
- switch($this->message_type) {
- case 'alt':
- $result .= $this->GetBoundary($this->boundary[1], '', 'text/plain', '');
- $result .= $this->EncodeString($this->AltBody, $this->Encoding);
- $result .= $this->LE.$this->LE;
- $result .= $this->GetBoundary($this->boundary[1], '', 'text/html', '');
- $result .= $this->EncodeString($this->Body, $this->Encoding);
- $result .= $this->LE.$this->LE;
- $result .= $this->EndBoundary($this->boundary[1]);
- break;
- case 'plain':
- $result .= $this->EncodeString($this->Body, $this->Encoding);
- break;
- case 'attachments':
- $result .= $this->GetBoundary($this->boundary[1], '', '', '');
- $result .= $this->EncodeString($this->Body, $this->Encoding);
- $result .= $this->LE;
- $result .= $this->AttachAll();
- break;
- case 'alt_attachments':
- $result .= sprintf("--%s%s", $this->boundary[1], $this->LE);
- $result .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE);
- $result .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body
- $result .= $this->EncodeString($this->AltBody, $this->Encoding);
- $result .= $this->LE.$this->LE;
- $result .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body
- $result .= $this->EncodeString($this->Body, $this->Encoding);
- $result .= $this->LE.$this->LE;
- $result .= $this->EndBoundary($this->boundary[2]);
- $result .= $this->AttachAll();
- break;
- }
-
- if($this->IsError()) {
- $result = '';
- } else if ($this->sign_key_file) {
- $file = tempnam("", "mail");
- $fp = fopen($file, "w");
- fwrite($fp, $result);
- fclose($fp);
- $signed = tempnam("", "signed");
-
- if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), null)) {
- $fp = fopen($signed, "r");
- $result = fread($fp, filesize($this->sign_key_file));
- $result = '';
- while(!feof($fp)){
- $result = $result . fread($fp, 1024);
- }
- fclose($fp);
- } else {
- $this->SetError($this->Lang("signing").openssl_error_string());
- $result = '';
- }
-
- unlink($file);
- unlink($signed);
- }
-
- return $result;
- }
-
- /**
- * Returns the start of a message boundary.
- * @access private
- */
- function GetBoundary($boundary, $charSet, $contentType, $encoding) {
- $result = '';
- if($charSet == '') {
- $charSet = $this->CharSet;
- }
- if($contentType == '') {
- $contentType = $this->ContentType;
- }
- if($encoding == '') {
- $encoding = $this->Encoding;
- }
- $result .= $this->TextLine('--' . $boundary);
- $result .= sprintf("Content-Type: %s; charset = \"%s\"", $contentType, $charSet);
- $result .= $this->LE;
- $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding);
- $result .= $this->LE;
-
- return $result;
- }
-
- /**
- * Returns the end of a message boundary.
- * @access private
- */
- function EndBoundary($boundary) {
- return $this->LE . '--' . $boundary . '--' . $this->LE;
- }
-
- /**
- * Sets the message type.
- * @access private
- * @return void
- */
- function SetMessageType() {
- if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) {
- $this->message_type = 'plain';
- } else {
- if(count($this->attachment) > 0) {
- $this->message_type = 'attachments';
- }
- if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) {
- $this->message_type = 'alt';
- }
- if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) {
- $this->message_type = 'alt_attachments';
- }
- }
- }
-
- /* Returns a formatted header line.
- * @access private
- * @return string
- */
- function HeaderLine($name, $value) {
- return $name . ': ' . $value . $this->LE;
- }
-
- /**
- * Returns a formatted mail line.
- * @access private
- * @return string
- */
- function TextLine($value) {
- return $value . $this->LE;
- }
-
- /////////////////////////////////////////////////
- // CLASS METHODS, ATTACHMENTS
- /////////////////////////////////////////////////
-
- /**
- * Adds an attachment from a path on the filesystem.
- * Returns false if the file could not be found
- * or accessed.
- * @param string $path Path to the attachment.
- * @param string $name Overrides the attachment name.
- * @param string $encoding File encoding (see $Encoding).
- * @param string $type File extension (MIME) type.
- * @return bool
- */
- function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
- if(!@is_file($path)) {
- $this->SetError($this->Lang('file_access') . $path);
- return false;
- }
-
- $filename = basename($path);
- if($name == '') {
- $name = $filename;
- }
-
- $cur = count($this->attachment);
- $this->attachment[$cur][0] = $path;
- $this->attachment[$cur][1] = $filename;
- $this->attachment[$cur][2] = $name;
- $this->attachment[$cur][3] = $encoding;
- $this->attachment[$cur][4] = $type;
- $this->attachment[$cur][5] = false; // isStringAttachment
- $this->attachment[$cur][6] = 'attachment';
- $this->attachment[$cur][7] = 0;
-
- return true;
- }
-
- /**
- * Attaches all fs, string, and binary attachments to the message.
- * Returns an empty string on failure.
- * @access private
- * @return string
- */
- function AttachAll() {
- /* Return text of body */
- $mime = array();
-
- /* Add all attachments */
- for($i = 0; $i < count($this->attachment); $i++) {
- /* Check for string attachment */
- $bString = $this->attachment[$i][5];
- if ($bString) {
- $string = $this->attachment[$i][0];
- } else {
- $path = $this->attachment[$i][0];
- }
-
- $filename = $this->attachment[$i][1];
- $name = $this->attachment[$i][2];
- $encoding = $this->attachment[$i][3];
- $type = $this->attachment[$i][4];
- $disposition = $this->attachment[$i][6];
- $cid = $this->attachment[$i][7];
-
- $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
- $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE);
- $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
-
- if($disposition == 'inline') {
- $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);
- }
-
- $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE);
-
- /* Encode as string attachment */
- if($bString) {
- $mime[] = $this->EncodeString($string, $encoding);
- if($this->IsError()) {
- return '';
- }
- $mime[] = $this->LE.$this->LE;
- } else {
- $mime[] = $this->EncodeFile($path, $encoding);
- if($this->IsError()) {
- return '';
- }
- $mime[] = $this->LE.$this->LE;
- }
- }
-
- $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE);
-
- return join('', $mime);
- }
-
- /**
- * Encodes attachment in requested format. Returns an
- * empty string on failure.
- * @access private
- * @return string
- */
- function EncodeFile ($path, $encoding = 'base64') {
- if(!@$fd = fopen($path, 'rb')) {
- $this->SetError($this->Lang('file_open') . $path);
- return '';
- }
- $magic_quotes = get_magic_quotes_runtime();
- set_magic_quotes_runtime(0);
- $file_buffer = fread($fd, filesize($path));
- $file_buffer = $this->EncodeString($file_buffer, $encoding);
- fclose($fd);
- set_magic_quotes_runtime($magic_quotes);
-
- return $file_buffer;
- }
-
- /**
- * Encodes string to requested format. Returns an
- * empty string on failure.
- * @access private
- * @return string
- */
- function EncodeString ($str, $encoding = 'base64') {
- $encoded = '';
- switch(strtolower($encoding)) {
- case 'base64':
- /* chunk_split is found in PHP >= 3.0.6 */
- $encoded = chunk_split(base64_encode($str), 76, $this->LE);
- break;
- case '7bit':
- case '8bit':
- $encoded = $this->FixEOL($str);
- if (substr($encoded, -(strlen($this->LE))) != $this->LE)
- $encoded .= $this->LE;
- break;
- case 'binary':
- $encoded = $str;
- break;
- case 'quoted-printable':
- $encoded = $this->EncodeQP($str);
- break;
- default:
- $this->SetError($this->Lang('encoding') . $encoding);
- break;
- }
- return $encoded;
- }
-
- /**
- * Encode a header string to best of Q, B, quoted or none.
- * @access private
- * @return string
- */
- function EncodeHeader ($str, $position = 'text') {
- $x = 0;
-
- switch (strtolower($position)) {
- case 'phrase':
- if (!preg_match('/[\200-\377]/', $str)) {
- /* Can't use addslashes as we don't know what value has magic_quotes_sybase. */
- $encoded = addcslashes($str, "\0..\37\177\\\"");
- if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
- return ($encoded);
- } else {
- return ("\"$encoded\"");
- }
- }
- $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
- break;
- case 'comment':
- $x = preg_match_all('/[()"]/', $str, $matches);
- /* Fall-through */
- case 'text':
- default:
- $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
- break;
- }
-
- if ($x == 0) {
- return ($str);
- }
-
- $maxlen = 75 - 7 - strlen($this->CharSet);
- /* Try to select the encoding which should produce the shortest output */
- if (strlen($str)/3 < $x) {
- $encoding = 'B';
- if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) {
- // Use a custom function which correctly encodes and wraps long
- // multibyte strings without breaking lines within a character
- $encoded = $this->Base64EncodeWrapMB($str);
- } else {
- $encoded = base64_encode($str);
- $maxlen -= $maxlen % 4;
- $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
- }
- } else {
- $encoding = 'Q';
- $encoded = $this->EncodeQ($str, $position);
- $encoded = $this->WrapText($encoded, $maxlen, true);
- $encoded = str_replace('='.$this->LE, "\n", trim($encoded));
- }
-
- $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
- $encoded = trim(str_replace("\n", $this->LE, $encoded));
-
- return $encoded;
- }
-
- /**
- * Checks if a string contains multibyte characters.
- * @access private
- * @param string $str multi-byte text to wrap encode
- * @return bool
- */
- function HasMultiBytes($str) {
- if (function_exists('mb_strlen')) {
- return (strlen($str) > mb_strlen($str, $this->CharSet));
- } else { // Assume no multibytes (we can't handle without mbstring functions anyway)
- return False;
- }
- }
-
- /**
- * Correctly encodes and wraps long multibyte strings for mail headers
- * without breaking lines within a character.
- * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php
- * @access private
- * @param string $str multi-byte text to wrap encode
- * @return string
- */
- function Base64EncodeWrapMB($str) {
- $start = "=?".$this->CharSet."?B?";
- $end = "?=";
- $encoded = "";
-
- $mb_length = mb_strlen($str, $this->CharSet);
- // Each line must have length <= 75, including $start and $end
- $length = 75 - strlen($start) - strlen($end);
- // Average multi-byte ratio
- $ratio = $mb_length / strlen($str);
- // Base64 has a 4:3 ratio
- $offset = $avgLength = floor($length * $ratio * .75);
-
- for ($i = 0; $i < $mb_length; $i += $offset) {
- $lookBack = 0;
-
- do {
- $offset = $avgLength - $lookBack;
- $chunk = mb_substr($str, $i, $offset, $this->CharSet);
- $chunk = base64_encode($chunk);
- $lookBack++;
- }
- while (strlen($chunk) > $length);
-
- $encoded .= $chunk . $this->LE;
- }
-
- // Chomp the last linefeed
- $encoded = substr($encoded, 0, -strlen($this->LE));
- return $encoded;
- }
-
- /**
- * Encode string to quoted-printable.
- * @access private
- * @return string
- */
- function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
- $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
- $lines = preg_split('/(?:\r\n|\r|\n)/', $input);
- $eol = "\r\n";
- $escape = '=';
- $output = '';
- while( list(, $line) = each($lines) ) {
- $linlen = strlen($line);
- $newline = '';
- for($i = 0; $i < $linlen; $i++) {
- $c = substr( $line, $i, 1 );
- $dec = ord( $c );
- if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E
- $c = '=2E';
- }
- if ( $dec == 32 ) {
- if ( $i == ( $linlen - 1 ) ) { // convert space at eol only
- $c = '=20';
- } else if ( $space_conv ) {
- $c = '=20';
- }
- } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required
- $h2 = floor($dec/16);
- $h1 = floor($dec%16);
- $c = $escape.$hex[$h2].$hex[$h1];
- }
- if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted
- $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay
- $newline = '';
- // check if newline first character will be point or not
- if ( $dec == 46 ) {
- $c = '=2E';
- }
- }
- $newline .= $c;
- } // end of for
- $output .= $newline.$eol;
- } // end of while
- return $output;
- }
-
- /**
- * Encode string to q encoding.
- * @access private
- * @return string
- */
- function EncodeQ ($str, $position = 'text') {
- /* There should not be any EOL in the string */
- $encoded = preg_replace("[\r\n]", '', $str);
-
- switch (strtolower($position)) {
- case 'phrase':
- $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
- break;
- case 'comment':
- $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
- case 'text':
- default:
- /* Replace every high ascii, control =, ? and _ characters */
- $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
- "'='.sprintf('%02X', ord('\\1'))", $encoded);
- break;
- }
-
- /* Replace every spaces to _ (more readable than =20) */
- $encoded = str_replace(' ', '_', $encoded);
-
- return $encoded;
- }
-
- /**
- * Adds a string or binary attachment (non-filesystem) to the list.
- * This method can be used to attach ascii or binary data,
- * such as a BLOB record from a database.
- * @param string $string String attachment data.
- * @param string $filename Name of the attachment.
- * @param string $encoding File encoding (see $Encoding).
- * @param string $type File extension (MIME) type.
- * @return void
- */
- function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') {
- /* Append to $attachment array */
- $cur = count($this->attachment);
- $this->attachment[$cur][0] = $string;
- $this->attachment[$cur][1] = $filename;
- $this->attachment[$cur][2] = $filename;
- $this->attachment[$cur][3] = $encoding;
- $this->attachment[$cur][4] = $type;
- $this->attachment[$cur][5] = true; // isString
- $this->attachment[$cur][6] = 'attachment';
- $this->attachment[$cur][7] = 0;
- }
-
- /**
- * Adds an embedded attachment. This can include images, sounds, and
- * just about any other document. Make sure to set the $type to an
- * image type. For JPEG images use "image/jpeg" and for GIF images
- * use "image/gif".
- * @param string $path Path to the attachment.
- * @param string $cid Content ID of the attachment. Use this to identify
- * the Id for accessing the image in an HTML form.
- * @param string $name Overrides the attachment name.
- * @param string $encoding File encoding (see $Encoding).
- * @param string $type File extension (MIME) type.
- * @return bool
- */
- function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
-
- if(!@is_file($path)) {
- $this->SetError($this->Lang('file_access') . $path);
- return false;
- }
-
- $filename = basename($path);
- if($name == '') {
- $name = $filename;
- }
-
- /* Append to $attachment array */
- $cur = count($this->attachment);
- $this->attachment[$cur][0] = $path;
- $this->attachment[$cur][1] = $filename;
- $this->attachment[$cur][2] = $name;
- $this->attachment[$cur][3] = $encoding;
- $this->attachment[$cur][4] = $type;
- $this->attachment[$cur][5] = false;
- $this->attachment[$cur][6] = 'inline';
- $this->attachment[$cur][7] = $cid;
-
- return true;
- }
-
- /**
- * Returns true if an inline attachment is present.
- * @access private
- * @return bool
- */
- function InlineImageExists() {
- $result = false;
- for($i = 0; $i < count($this->attachment); $i++) {
- if($this->attachment[$i][6] == 'inline') {
- $result = true;
- break;
- }
- }
-
- return $result;
- }
-
- /////////////////////////////////////////////////
- // CLASS METHODS, MESSAGE RESET
- /////////////////////////////////////////////////
-
- /**
- * Clears all recipients assigned in the TO array. Returns void.
- * @return void
- */
- function ClearAddresses() {
- $this->to = array();
- }
-
- /**
- * Clears all recipients assigned in the CC array. Returns void.
- * @return void
- */
- function ClearCCs() {
- $this->cc = array();
- }
-
- /**
- * Clears all recipients assigned in the BCC array. Returns void.
- * @return void
- */
- function ClearBCCs() {
- $this->bcc = array();
- }
-
- /**
- * Clears all recipients assigned in the ReplyTo array. Returns void.
- * @return void
- */
- function ClearReplyTos() {
- $this->ReplyTo = array();
- }
-
- /**
- * Clears all recipients assigned in the TO, CC and BCC
- * array. Returns void.
- * @return void
- */
- function ClearAllRecipients() {
- $this->to = array();
- $this->cc = array();
- $this->bcc = array();
- }
-
- /**
- * Clears all previously set filesystem, string, and binary
- * attachments. Returns void.
- * @return void
- */
- function ClearAttachments() {
- $this->attachment = array();
- }
-
- /**
- * Clears all custom headers. Returns void.
- * @return void
- */
- function ClearCustomHeaders() {
- $this->CustomHeader = array();
- }
-
- /////////////////////////////////////////////////
- // CLASS METHODS, MISCELLANEOUS
- /////////////////////////////////////////////////
-
- /**
- * Adds the error message to the error container.
- * Returns void.
- * @access private
- * @return void
- */
- function SetError($msg) {
- $this->error_count++;
- $this->ErrorInfo = $msg;
- }
-
- /**
- * Returns the proper RFC 822 formatted date.
- * @access private
- * @return string
- */
- function RFCDate() {
- $tz = date('Z');
- $tzs = ($tz < 0) ? '-' : '+';
- $tz = abs($tz);
- $tz = (int)($tz/3600)*100 + ($tz%3600)/60;
- $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz);
-
- return $result;
- }
-
- /**
- * Returns the appropriate server variable. Should work with both
- * PHP 4.1.0+ as well as older versions. Returns an empty string
- * if nothing is found.
- * @access private
- * @return mixed
- */
- function ServerVar($varName) {
- global $HTTP_SERVER_VARS;
- global $HTTP_ENV_VARS;
-
- if(!isset($_SERVER)) {
- $_SERVER = $HTTP_SERVER_VARS;
- if(!isset($_SERVER['REMOTE_ADDR'])) {
- $_SERVER = $HTTP_ENV_VARS; // must be Apache
- }
- }
-
- if(isset($_SERVER[$varName])) {
- return $_SERVER[$varName];
- } else {
- return '';
- }
- }
-
- /**
- * Returns the server hostname or 'localhost.localdomain' if unknown.
- * @access private
- * @return string
- */
- function ServerHostname() {
- if ($this->Hostname != '') {
- $result = $this->Hostname;
- } elseif ($this->ServerVar('SERVER_NAME') != '') {
- $result = $this->ServerVar('SERVER_NAME');
- } else {
- $result = 'localhost.localdomain';
- }
-
- return $result;
- }
-
- /**
- * Returns a message in the appropriate language.
- * @access private
- * @return string
- */
- function Lang($key) {
- if(count($this->language) < 1) {
- $this->SetLanguage('en'); // set the default language
- }
-
- if(isset($this->language[$key])) {
- return $this->language[$key];
- } else {
- return 'Language string failed to load: ' . $key;
- }
- }
-
- /**
- * Returns true if an error occurred.
- * @return bool
- */
- function IsError() {
- return ($this->error_count > 0);
- }
-
- /**
- * Changes every end of line from CR or LF to CRLF.
- * @access private
- * @return string
- */
- function FixEOL($str) {
- $str = str_replace("\r\n", "\n", $str);
- $str = str_replace("\r", "\n", $str);
- $str = str_replace("\n", $this->LE, $str);
- return $str;
- }
-
- /**
- * Adds a custom header.
- * @return void
- */
- function AddCustomHeader($custom_header) {
- $this->CustomHeader[] = explode(':', $custom_header, 2);
- }
-
- /**
- * Evaluates the message and returns modifications for inline images and backgrounds
- * @access public
- * @return $message
- */
- function MsgHTML($message,$basedir='') {
- preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images);
- if(isset($images[2])) {
- foreach($images[2] as $i => $url) {
- // do not change urls for absolute images (thanks to corvuscorax)
- if (!preg_match('/^[A-z][A-z]*:\/\//',$url)) {
- $filename = basename($url);
- $directory = dirname($url);
- ($directory == '.')?$directory='':'';
- $cid = 'cid:' . md5($filename);
- $fileParts = split("\.", $filename);
- $ext = $fileParts[1];
- $mimeType = $this->_mime_types($ext);
- if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; }
- if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; }
- if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) {
- $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message);
- }
- }
- }
- }
- $this->IsHTML(true);
- $this->Body = $message;
- $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message)));
- if ( !empty($textMsg) && empty($this->AltBody) ) {
- $this->AltBody = html_entity_decode($textMsg);
- }
- if ( empty($this->AltBody) ) {
- $this->AltBody = 'To view this email message, open the email in with HTML compatibility!' . "\n\n";
- }
- }
-
- /**
- * Gets the mime type of the embedded or inline image
- * @access private
- * @return mime type of ext
- */
- function _mime_types($ext = '') {
- $mimes = array(
- 'ai' => 'application/postscript',
- 'aif' => 'audio/x-aiff',
- 'aifc' => 'audio/x-aiff',
- 'aiff' => 'audio/x-aiff',
- 'avi' => 'video/x-msvideo',
- 'bin' => 'application/macbinary',
- 'bmp' => 'image/bmp',
- 'class' => 'application/octet-stream',
- 'cpt' => 'application/mac-compactpro',
- 'css' => 'text/css',
- 'dcr' => 'application/x-director',
- 'dir' => 'application/x-director',
- 'dll' => 'application/octet-stream',
- 'dms' => 'application/octet-stream',
- 'doc' => 'application/msword',
- 'dvi' => 'application/x-dvi',
- 'dxr' => 'application/x-director',
- 'eml' => 'message/rfc822',
- 'eps' => 'application/postscript',
- 'exe' => 'application/octet-stream',
- 'gif' => 'image/gif',
- 'gtar' => 'application/x-gtar',
- 'htm' => 'text/html',
- 'html' => 'text/html',
- 'jpe' => 'image/jpeg',
- 'jpeg' => 'image/jpeg',
- 'jpg' => 'image/jpeg',
- 'hqx' => 'application/mac-binhex40',
- 'js' => 'application/x-javascript',
- 'lha' => 'application/octet-stream',
- 'log' => 'text/plain',
- 'lzh' => 'application/octet-stream',
- 'mid' => 'audio/midi',
- 'midi' => 'audio/midi',
- 'mif' => 'application/vnd.mif',
- 'mov' => 'video/quicktime',
- 'movie' => 'video/x-sgi-movie',
- 'mp2' => 'audio/mpeg',
- 'mp3' => 'audio/mpeg',
- 'mpe' => 'video/mpeg',
- 'mpeg' => 'video/mpeg',
- 'mpg' => 'video/mpeg',
- 'mpga' => 'audio/mpeg',
- 'oda' => 'application/oda',
- 'pdf' => 'application/pdf',
- 'php' => 'application/x-httpd-php',
- 'php3' => 'application/x-httpd-php',
- 'php4' => 'application/x-httpd-php',
- 'phps' => 'application/x-httpd-php-source',
- 'phtml' => 'application/x-httpd-php',
- 'png' => 'image/png',
- 'ppt' => 'application/vnd.ms-powerpoint',
- 'ps' => 'application/postscript',
- 'psd' => 'application/octet-stream',
- 'qt' => 'video/quicktime',
- 'ra' => 'audio/x-realaudio',
- 'ram' => 'audio/x-pn-realaudio',
- 'rm' => 'audio/x-pn-realaudio',
- 'rpm' => 'audio/x-pn-realaudio-plugin',
- 'rtf' => 'text/rtf',
- 'rtx' => 'text/richtext',
- 'rv' => 'video/vnd.rn-realvideo',
- 'sea' => 'application/octet-stream',
- 'shtml' => 'text/html',
- 'sit' => 'application/x-stuffit',
- 'so' => 'application/octet-stream',
- 'smi' => 'application/smil',
- 'smil' => 'application/smil',
- 'swf' => 'application/x-shockwave-flash',
- 'tar' => 'application/x-tar',
- 'text' => 'text/plain',
- 'txt' => 'text/plain',
- 'tgz' => 'application/x-tar',
- 'tif' => 'image/tiff',
- 'tiff' => 'image/tiff',
- 'wav' => 'audio/x-wav',
- 'wbxml' => 'application/vnd.wap.wbxml',
- 'wmlc' => 'application/vnd.wap.wmlc',
- 'word' => 'application/msword',
- 'xht' => 'application/xhtml+xml',
- 'xhtml' => 'application/xhtml+xml',
- 'xl' => 'application/excel',
- 'xls' => 'application/vnd.ms-excel',
- 'xml' => 'text/xml',
- 'xsl' => 'text/xml',
- 'zip' => 'application/zip'
- );
- return ( ! isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)];
- }
-
- /**
- * Set (or reset) Class Objects (variables)
- *
- * Usage Example:
- * $page->set('X-Priority', '3');
- *
- * @access public
- * @param string $name Parameter Name
- * @param mixed $value Parameter Value
- * NOTE: will not work with arrays, there are no arrays to set/reset
- */
- function set ( $name, $value = '' ) {
- if ( isset($this->$name) ) {
- $this->$name = $value;
- } else {
- $this->SetError('Cannot set or reset variable ' . $name);
- return false;
- }
- }
-
- /**
- * Read a file from a supplied filename and return it.
- *
- * @access public
- * @param string $filename Parameter File Name
- */
- function getFile($filename) {
- $return = '';
- if ($fp = fopen($filename, 'rb')) {
- while (!feof($fp)) {
- $return .= fread($fp, 1024);
- }
- fclose($fp);
- return $return;
- } else {
- return false;
- }
- }
-
- /**
- * Strips newlines to prevent header injection.
- * @access private
- * @param string $str String
- * @return string
- */
- function SecureHeader($str) {
- $str = trim($str);
- $str = str_replace("\r", "", $str);
- $str = str_replace("\n", "", $str);
- return $str;
- }
-
- /**
- * Set the private key file and password to sign the message.
- *
- * @access public
- * @param string $key_filename Parameter File Name
- * @param string $key_pass Password for private key
- */
- function Sign($cert_filename, $key_filename, $key_pass) {
- $this->sign_cert_file = $cert_filename;
- $this->sign_key_file = $key_filename;
- $this->sign_key_pass = $key_pass;
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/countryblock/class.smtp.tmp b/config/countryblock/class.smtp.tmp
deleted file mode 100644
index be084a11..00000000
--- a/config/countryblock/class.smtp.tmp
+++ /dev/null
@@ -1,1062 +0,0 @@
-<?php
-/*~ class.smtp.php
-.---------------------------------------------------------------------------.
-| Software: PHPMailer - PHP email class |
-| Version: 2.0.4 |
-| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
-| Info: http://phpmailer.sourceforge.net |
-| Support: http://sourceforge.net/projects/phpmailer/ |
-| ------------------------------------------------------------------------- |
-| Author: Andy Prevost (project admininistrator) |
-| Author: Brent R. Matzelle (original founder) |
-| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
-| Copyright (c) 2001-2003, Brent R. Matzelle |
-| ------------------------------------------------------------------------- |
-| License: Distributed under the Lesser General Public License (LGPL) |
-| http://www.gnu.org/copyleft/lesser.html |
-| This program is distributed in the hope that it will be useful - WITHOUT |
-| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
-| FITNESS FOR A PARTICULAR PURPOSE. |
-| ------------------------------------------------------------------------- |
-| We offer a number of paid services (www.codeworxtech.com): |
-| - Web Hosting on highly optimized fast and secure servers |
-| - Technology Consulting |
-| - Oursourcing (highly qualified programmers and graphic designers) |
-'---------------------------------------------------------------------------'
-
-/**
- * SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
- * commands except TURN which will always return a not implemented
- * error. SMTP also provides some utility methods for sending mail
- * to an SMTP server.
- * @package PHPMailer
- * @author Chris Ryan
- */
-
-class SMTP
-{
- /**
- * SMTP server port
- * @var int
- */
- var $SMTP_PORT = 25;
-
- /**
- * SMTP reply line ending
- * @var string
- */
- var $CRLF = "\r\n";
-
- /**
- * Sets whether debugging is turned on
- * @var bool
- */
- var $do_debug; # the level of debug to perform
-
- /**
- * Sets VERP use on/off (default is off)
- * @var bool
- */
- var $do_verp = false;
-
- /**#@+
- * @access private
- */
- var $smtp_conn; # the socket to the server
- var $error; # error if any on the last call
- var $helo_rply; # the reply the server sent to us for HELO
- /**#@-*/
-
- /**
- * Initialize the class so that the data is in a known state.
- * @access public
- * @return void
- */
- function SMTP() {
- $this->smtp_conn = 0;
- $this->error = null;
- $this->helo_rply = null;
-
- $this->do_debug = 0;
- }
-
- /*************************************************************
- * CONNECTION FUNCTIONS *
- ***********************************************************/
-
- /**
- * Connect to the server specified on the port specified.
- * If the port is not specified use the default SMTP_PORT.
- * If tval is specified then a connection will try and be
- * established with the server for that number of seconds.
- * If tval is not specified the default is 30 seconds to
- * try on the connection.
- *
- * SMTP CODE SUCCESS: 220
- * SMTP CODE FAILURE: 421
- * @access public
- * @return bool
- */
- function Connect($host,$port=0,$tval=30) {
- # set the error val to null so there is no confusion
- $this->error = null;
-
- # make sure we are __not__ connected
- if($this->connected()) {
- # ok we are connected! what should we do?
- # for now we will just give an error saying we
- # are already connected
- $this->error = array("error" => "Already connected to a server");
- return false;
- }
-
- if(empty($port)) {
- $port = $this->SMTP_PORT;
- }
-
- #connect to the smtp server
- $this->smtp_conn = fsockopen($host, # the host of the server
- $port, # the port to use
- $errno, # error number if any
- $errstr, # error message if any
- $tval); # give up after ? secs
- # verify we connected properly
- if(empty($this->smtp_conn)) {
- $this->error = array("error" => "Failed to connect to server",
- "errno" => $errno,
- "errstr" => $errstr);
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": $errstr ($errno)" . $this->CRLF;
- }
- return false;
- }
-
- # sometimes the SMTP server takes a little longer to respond
- # so we will give it a longer timeout for the first read
- // Windows still does not have support for this timeout function
- if(substr(PHP_OS, 0, 3) != "WIN")
- socket_set_timeout($this->smtp_conn, $tval, 0);
-
- # get any announcement stuff
- $announce = $this->get_lines();
-
- # set the timeout of any socket functions at 1/10 of a second
- //if(function_exists("socket_set_timeout"))
- // socket_set_timeout($this->smtp_conn, 0, 100000);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce;
- }
-
- return true;
- }
-
- /**
- * Performs SMTP authentication. Must be run after running the
- * Hello() method. Returns true if successfully authenticated.
- * @access public
- * @return bool
- */
- function Authenticate($username, $password) {
- // Start authentication
- fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($code != 334) {
- $this->error =
- array("error" => "AUTH not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- // Send encoded username
- fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($code != 334) {
- $this->error =
- array("error" => "Username not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- // Send encoded password
- fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($code != 235) {
- $this->error =
- array("error" => "Password not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- return true;
- }
-
- /**
- * Returns true if connected to a server otherwise false
- * @access private
- * @return bool
- */
- function Connected() {
- if(!empty($this->smtp_conn)) {
- $sock_status = socket_get_status($this->smtp_conn);
- if($sock_status["eof"]) {
- # hmm this is an odd situation... the socket is
- # valid but we are not connected anymore
- if($this->do_debug >= 1) {
- echo "SMTP -> NOTICE:" . $this->CRLF .
- "EOF caught while checking if connected";
- }
- $this->Close();
- return false;
- }
- return true; # everything looks good
- }
- return false;
- }
-
- /**
- * Closes the socket and cleans up the state of the class.
- * It is not considered good to use this function without
- * first trying to use QUIT.
- * @access public
- * @return void
- */
- function Close() {
- $this->error = null; # so there is no confusion
- $this->helo_rply = null;
- if(!empty($this->smtp_conn)) {
- # close the connection and cleanup
- fclose($this->smtp_conn);
- $this->smtp_conn = 0;
- }
- }
-
- /***************************************************************
- * SMTP COMMANDS *
- *************************************************************/
-
- /**
- * Issues a data command and sends the msg_data to the server
- * finializing the mail transaction. $msg_data is the message
- * that is to be send with the headers. Each header needs to be
- * on a single line followed by a <CRLF> with the message headers
- * and the message body being seperated by and additional <CRLF>.
- *
- * Implements rfc 821: DATA <CRLF>
- *
- * SMTP CODE INTERMEDIATE: 354
- * [data]
- * <CRLF>.<CRLF>
- * SMTP CODE SUCCESS: 250
- * SMTP CODE FAILURE: 552,554,451,452
- * SMTP CODE FAILURE: 451,554
- * SMTP CODE ERROR : 500,501,503,421
- * @access public
- * @return bool
- */
- function Data($msg_data) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Data() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"DATA" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 354) {
- $this->error =
- array("error" => "DATA command not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- # the server is ready to accept data!
- # according to rfc 821 we should not send more than 1000
- # including the CRLF
- # characters on a single line so we will break the data up
- # into lines by \r and/or \n then if needed we will break
- # each of those into smaller lines to fit within the limit.
- # in addition we will be looking for lines that start with
- # a period '.' and append and additional period '.' to that
- # line. NOTE: this does not count towards are limit.
-
- # normalize the line breaks so we know the explode works
- $msg_data = str_replace("\r\n","\n",$msg_data);
- $msg_data = str_replace("\r","\n",$msg_data);
- $lines = explode("\n",$msg_data);
-
- # we need to find a good way to determine is headers are
- # in the msg_data or if it is a straight msg body
- # currently I am assuming rfc 822 definitions of msg headers
- # and if the first field of the first line (':' sperated)
- # does not contain a space then it _should_ be a header
- # and we can process all lines before a blank "" line as
- # headers.
- $field = substr($lines[0],0,strpos($lines[0],":"));
- $in_headers = false;
- if(!empty($field) && !strstr($field," ")) {
- $in_headers = true;
- }
-
- $max_line_length = 998; # used below; set here for ease in change
-
- while(list(,$line) = @each($lines)) {
- $lines_out = null;
- if($line == "" && $in_headers) {
- $in_headers = false;
- }
- # ok we need to break this line up into several
- # smaller lines
- while(strlen($line) > $max_line_length) {
- $pos = strrpos(substr($line,0,$max_line_length)," ");
-
- # Patch to fix DOS attack
- if(!$pos) {
- $pos = $max_line_length - 1;
- }
-
- $lines_out[] = substr($line,0,$pos);
- $line = substr($line,$pos + 1);
- # if we are processing headers we need to
- # add a LWSP-char to the front of the new line
- # rfc 822 on long msg headers
- if($in_headers) {
- $line = "\t" . $line;
- }
- }
- $lines_out[] = $line;
-
- # now send the lines to the server
- while(list(,$line_out) = @each($lines_out)) {
- if(strlen($line_out) > 0)
- {
- if(substr($line_out, 0, 1) == ".") {
- $line_out = "." . $line_out;
- }
- }
- fputs($this->smtp_conn,$line_out . $this->CRLF);
- }
- }
-
- # ok all the message data has been sent so lets get this
- # over with aleady
- fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "DATA not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Expand takes the name and asks the server to list all the
- * people who are members of the _list_. Expand will return
- * back and array of the result or false if an error occurs.
- * Each value in the array returned has the format of:
- * [ <full-name> <sp> ] <path>
- * The definition of <path> is defined in rfc 821
- *
- * Implements rfc 821: EXPN <SP> <string> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE FAILURE: 550
- * SMTP CODE ERROR : 500,501,502,504,421
- * @access public
- * @return string array
- */
- function Expand($name) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Expand() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "EXPN not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- # parse the reply and place in our array to return to user
- $entries = explode($this->CRLF,$rply);
- while(list(,$l) = @each($entries)) {
- $list[] = substr($l,4);
- }
-
- return $list;
- }
-
- /**
- * Sends the HELO command to the smtp server.
- * This makes sure that we and the server are in
- * the same known state.
- *
- * Implements from rfc 821: HELO <SP> <domain> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE ERROR : 500, 501, 504, 421
- * @access public
- * @return bool
- */
- function Hello($host="") {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Hello() without being connected");
- return false;
- }
-
- # if a hostname for the HELO was not specified determine
- # a suitable one to send
- if(empty($host)) {
- # we need to determine some sort of appopiate default
- # to send to the server
- $host = "localhost";
- }
-
- // Send extended hello first (RFC 2821)
- if(!$this->SendHello("EHLO", $host))
- {
- if(!$this->SendHello("HELO", $host))
- return false;
- }
-
- return true;
- }
-
- /**
- * Sends a HELO/EHLO command.
- * @access private
- * @return bool
- */
- function SendHello($hello, $host) {
- fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => $hello . " not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- $this->helo_rply = $rply;
-
- return true;
- }
-
- /**
- * Gets help information on the keyword specified. If the keyword
- * is not specified then returns generic help, ussually contianing
- * A list of keywords that help is available on. This function
- * returns the results back to the user. It is up to the user to
- * handle the returned data. If an error occurs then false is
- * returned with $this->error set appropiately.
- *
- * Implements rfc 821: HELP [ <SP> <string> ] <CRLF>
- *
- * SMTP CODE SUCCESS: 211,214
- * SMTP CODE ERROR : 500,501,502,504,421
- * @access public
- * @return string
- */
- function Help($keyword="") {
- $this->error = null; # to avoid confusion
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Help() without being connected");
- return false;
- }
-
- $extra = "";
- if(!empty($keyword)) {
- $extra = " " . $keyword;
- }
-
- fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 211 && $code != 214) {
- $this->error =
- array("error" => "HELP not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- return $rply;
- }
-
- /**
- * Starts a mail transaction from the email address specified in
- * $from. Returns true if successful or false otherwise. If True
- * the mail transaction is started and then one or more Recipient
- * commands may be called followed by a Data command.
- *
- * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE SUCCESS: 552,451,452
- * SMTP CODE SUCCESS: 500,501,421
- * @access public
- * @return bool
- */
- function Mail($from) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Mail() without being connected");
- return false;
- }
-
- $useVerp = ($this->do_verp ? "XVERP" : "");
- fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "MAIL not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Sends the command NOOP to the SMTP server.
- *
- * Implements from rfc 821: NOOP <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE ERROR : 500, 421
- * @access public
- * @return bool
- */
- function Noop() {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Noop() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"NOOP" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "NOOP not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Sends the quit command to the server and then closes the socket
- * if there is no error or the $close_on_error argument is true.
- *
- * Implements from rfc 821: QUIT <CRLF>
- *
- * SMTP CODE SUCCESS: 221
- * SMTP CODE ERROR : 500
- * @access public
- * @return bool
- */
- function Quit($close_on_error=true) {
- $this->error = null; # so there is no confusion
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Quit() without being connected");
- return false;
- }
-
- # send the quit command to the server
- fputs($this->smtp_conn,"quit" . $this->CRLF);
-
- # get any good-bye messages
- $byemsg = $this->get_lines();
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg;
- }
-
- $rval = true;
- $e = null;
-
- $code = substr($byemsg,0,3);
- if($code != 221) {
- # use e as a tmp var cause Close will overwrite $this->error
- $e = array("error" => "SMTP server rejected quit command",
- "smtp_code" => $code,
- "smtp_rply" => substr($byemsg,4));
- $rval = false;
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $e["error"] . ": " .
- $byemsg . $this->CRLF;
- }
- }
-
- if(empty($e) || $close_on_error) {
- $this->Close();
- }
-
- return $rval;
- }
-
- /**
- * Sends the command RCPT to the SMTP server with the TO: argument of $to.
- * Returns true if the recipient was accepted false if it was rejected.
- *
- * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250,251
- * SMTP CODE FAILURE: 550,551,552,553,450,451,452
- * SMTP CODE ERROR : 500,501,503,421
- * @access public
- * @return bool
- */
- function Recipient($to) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Recipient() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250 && $code != 251) {
- $this->error =
- array("error" => "RCPT not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Sends the RSET command to abort and transaction that is
- * currently in progress. Returns true if successful false
- * otherwise.
- *
- * Implements rfc 821: RSET <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE ERROR : 500,501,504,421
- * @access public
- * @return bool
- */
- function Reset() {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Reset() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"RSET" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "RSET failed",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- return true;
- }
-
- /**
- * Starts a mail transaction from the email address specified in
- * $from. Returns true if successful or false otherwise. If True
- * the mail transaction is started and then one or more Recipient
- * commands may be called followed by a Data command. This command
- * will send the message to the users terminal if they are logged
- * in.
- *
- * Implements rfc 821: SEND <SP> FROM:<reverse-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE SUCCESS: 552,451,452
- * SMTP CODE SUCCESS: 500,501,502,421
- * @access public
- * @return bool
- */
- function Send($from) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Send() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "SEND not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Starts a mail transaction from the email address specified in
- * $from. Returns true if successful or false otherwise. If True
- * the mail transaction is started and then one or more Recipient
- * commands may be called followed by a Data command. This command
- * will send the message to the users terminal if they are logged
- * in and send them an email.
- *
- * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE SUCCESS: 552,451,452
- * SMTP CODE SUCCESS: 500,501,502,421
- * @access public
- * @return bool
- */
- function SendAndMail($from) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called SendAndMail() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "SAML not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Starts a mail transaction from the email address specified in
- * $from. Returns true if successful or false otherwise. If True
- * the mail transaction is started and then one or more Recipient
- * commands may be called followed by a Data command. This command
- * will send the message to the users terminal if they are logged
- * in or mail it to them if they are not.
- *
- * Implements rfc 821: SOML <SP> FROM:<reverse-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE SUCCESS: 552,451,452
- * SMTP CODE SUCCESS: 500,501,502,421
- * @access public
- * @return bool
- */
- function SendOrMail($from) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called SendOrMail() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "SOML not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * This is an optional command for SMTP that this class does not
- * support. This method is here to make the RFC821 Definition
- * complete for this class and __may__ be implimented in the future
- *
- * Implements from rfc 821: TURN <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE FAILURE: 502
- * SMTP CODE ERROR : 500, 503
- * @access public
- * @return bool
- */
- function Turn() {
- $this->error = array("error" => "This method, TURN, of the SMTP ".
- "is not implemented");
- if($this->do_debug >= 1) {
- echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF;
- }
- return false;
- }
-
- /**
- * Verifies that the name is recognized by the server.
- * Returns false if the name could not be verified otherwise
- * the response from the server is returned.
- *
- * Implements rfc 821: VRFY <SP> <string> <CRLF>
- *
- * SMTP CODE SUCCESS: 250,251
- * SMTP CODE FAILURE: 550,551,553
- * SMTP CODE ERROR : 500,501,502,421
- * @access public
- * @return int
- */
- function Verify($name) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Verify() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250 && $code != 251) {
- $this->error =
- array("error" => "VRFY failed on name '$name'",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return $rply;
- }
-
- /*******************************************************************
- * INTERNAL FUNCTIONS *
- ******************************************************************/
-
- /**
- * Read in as many lines as possible
- * either before eof or socket timeout occurs on the operation.
- * With SMTP we can tell if we have more lines to read if the
- * 4th character is '-' symbol. If it is a space then we don't
- * need to read anything else.
- * @access private
- * @return string
- */
- function get_lines() {
- $data = "";
- while($str = @fgets($this->smtp_conn,515)) {
- if($this->do_debug >= 4) {
- echo "SMTP -> get_lines(): \$data was \"$data\"" .
- $this->CRLF;
- echo "SMTP -> get_lines(): \$str is \"$str\"" .
- $this->CRLF;
- }
- $data .= $str;
- if($this->do_debug >= 4) {
- echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF;
- }
- # if the 4th character is a space then we are done reading
- # so just break the loop
- if(substr($str,3,1) == " ") { break; }
- }
- return $data;
- }
-
-}
-
-
- ?>
diff --git a/config/countryblock/countryblock.inc b/config/countryblock/countryblock.inc
deleted file mode 100644
index dc7bffd3..00000000
--- a/config/countryblock/countryblock.inc
+++ /dev/null
@@ -1,146 +0,0 @@
-<?php
-/* $Id$ */
-/*
-/* ========================================================================== */
-/*
- countryblock.inc
- Copyright (C) 2012 Tom Schaefer
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-
-function php_sync_package_cb()
-{
- global $config;
-}
-
-
-function php_install_command_cb()
-{
-
- global $config;
- conf_mount_rw();
- config_lock();
-
- if (!is_dir('/usr/local/www/packages/')) {
- exec("mkdir /usr/local/www/packages/");
- }
-
- if (!is_dir('/usr/local/www/packages/countryblock/')) {
- exec("mkdir /usr/local/www/packages/countryblock/");
- }
-
- if (!is_dir('/usr/local/www/packages/countryblock/CIDR')) {
- exec("mkdir /usr/local/www/packages/countryblock/CIDR");
- }
-
-
-
-
- //rename PHP files from .tmp to .php
- exec("cp /tmp/countryblock_IPBlocklist.widget.tmp /usr/local/www/widgets/widgets/countryblock_IPBlocklist.widget.php");
- unlink_if_exists("/tmp/countryblock_IPBlocklist.widget.tmp");
-
- exec("cp /tmp/class.phpmailer.tmp /usr/local/www/packages/countryblock/class.phpmailer.php");
- unlink_if_exists("/tmp/class.phpmailer.tmp ");
- exec("cp /tmp/class.smtp.tmp /usr/local/www/packages/countryblock/class.smtp.php");
- unlink_if_exists("/tmp/class.smtp.tmp");
- exec("cp /tmp/email.tmp /usr/local/www/packages/countryblock/email.php");
- unlink_if_exists("/tmp/email.tmp");
- exec("cp /tmp/countryblock.tmp /usr/local/www/packages/countryblock/countryblock.php");
- unlink_if_exists("/tmp/countryblock.tmp");
- exec("cp /tmp/countryblock_if.tmp /usr/local/www/packages/countryblock/countryblock_if.php");
- unlink_if_exists("/tmp/countryblock_if.tmp");
- exec("cp /tmp/index.tmp /usr/local/www/packages/countryblock/index.php");
- unlink_if_exists("/tmp/index.tmp");
- exec("cp /tmp/firewall_shaper.tmp /usr/local/www/packages/countryblock/firewall_shaper.php");
- unlink_if_exists("/tmp/firewall_shaper.tmp");
- exec("cp /tmp/help.tmp /usr/local/www/packages/countryblock/help.php");
- unlink_if_exists("/tmp/help.tmp");
- exec("cp /tmp/settings.tmp /usr/local/www/packages/countryblock/settings.php");
- unlink_if_exists("/tmp/settings.tmp");
- //Get scripts
- exec("cp /tmp/countryblock.sh /usr/local/etc/rc.d/countryblock.sh");
- exec("cp /tmp/countryblock.sh /usr/local/pkg/pf/countryblock.sh");
- unlink_if_exists("/tmp/countryblock.sh");
- exec("cp /tmp/execute.sh /usr/local/www/packages/countryblock/execute.sh");
- unlink_if_exists("/tmp/execute.sh");
- exec("cp /tmp/jquery.min.js /usr/local/www/packages/countryblock/jquery.min.js");
- unlink_if_exists("/tmp/jquery.min.js");
- exec("cp /tmp/ddaccordion.js /usr/local/www/packages/countryblock/ddaccordion.js");
- unlink_if_exists("/tmp/ddaccordion.js");
- exec("cp /tmp/public_smo_scripts.js /usr/local/www/packages/countryblock/public_smo_scripts.js");
- unlink_if_exists("/tmp/public_smo_scripts.js");
- exec("cp /tmp/titlebar.png /usr/local/www/packages/countryblock/titlebar.png");
- unlink_if_exists("/tmp/titlebar.png");
- exec("cp /tmp/titlebar-active.png /usr/local/www/packages/countryblock/titlebar-active.png");
- unlink_if_exists("/tmp/titlebar-active.png");
- exec("cp /tmp/purge.tmp /usr/local/www/packages/countryblock/purge.php");
- unlink_if_exists("/tmp/purge.tmp");
- exec("cp /tmp/whitelist.tmp /usr/local/www/packages/countryblock/whitelist.php");
- unlink_if_exists("/tmp/whitelist.tmp");
- exec("cp /tmp/interfaces.txt /usr/local/www/packages/countryblock/interfaces.txt");
- unlink_if_exists("/tmp/interfaces.txt");
-
- exec("/usr/bin/fetch -o /tmp https://raw.github.com/tommyboy180/pfsense-bin/2812cb9e1c9357bbf2027eff82096773bc4ddc5d/countryblock/CIDR.tar.gz");
-
- exec("cp /tmp/CIDR.tar.gz /usr/local/www/packages/countryblock/CIDR.tar.gz");
- unlink_if_exists("/tmp/CIDR.tar.gz");
-
- exec("tar xzf /usr/local/www/packages/countryblock/CIDR.tar.gz -C /usr/local/www/packages/countryblock/CIDR");
- exec("rm /usr/local/www/packages/countryblock/CIDR.tar.gz");
-
- exec("mkdir /usr/local/www/packages/countryblock/lists");
- exec("touch /usr/local/www/packages/countryblock/lists/countries.txt");
-
- //Attempt to restore from backup
- exec("mkdir /usr/local/www/packages/countryblock_bkup");
- exec("cp /usr/local/www/packages/countryblock_bkup/countries.txt /usr/local/www/packages/countryblock/countries.txt");
-
- conf_mount_ro();
- config_unlock();
-}
-
-
-function deinstall_command_cb()
-{
- conf_mount_rw();
- $handle = popen("/usr/local/etc/rc.d/countryblock.sh stop", "r");
- unlink_if_exists("/usr/local/pkg/countryblock.xml");
- unlink_if_exists("/usr/local/pkg/countryblock.inc");
- //unlink_if_exists("/usr/local/pkg/pf/countryblock.sh");
- exec("rm -R /usr/local/www/packages/countryblock/countryblocks");
- exec("rm -R /usr/local/www/packages/countryblock");
- exec("rm /usr/local/etc/rc.d/countryblock.sh");
- exec("rm /usr/local/pkg/pf/countryblock.sh");
- exec("pfctl -t countryblock -T kill");
- exec("sed -i -e '/countryblock/d' /tmp/rules.debug");
- exec("pfctl -f /tmp/rules.debug");
- conf_mount_ro();
-}
-
-?>
diff --git a/config/countryblock/countryblock.sh b/config/countryblock/countryblock.sh
deleted file mode 100755
index e8454db1..00000000
--- a/config/countryblock/countryblock.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-
-#version 2.4 2012
-#check if countryblock running
-export resultr=`pfctl -s rules | grep -c countryblock`
-#echo $resultr
-if [ "$resultr" -gt "0" ]; then
- echo running
- exit 1
-else
- echo not running
- /usr/bin/logger -s "Countryblock was found not running"
- echo "Countryblock not running" | /usr/local/bin/php /usr/local/www/packages/countryblock/email_send.php
-fi
-
-pfctl -t countryblock -T kill
-sed -i -e '/countryblock/d' /tmp/rules.debug
-
-#Now edit /tmp/rules.debug
-
-#find my line for table
-export i=`grep -n 'block quick from any to <snort2c>' /tmp/rules.debug | grep -o '[0-9]\{2,4\}'`
-export t=`grep -n 'User Aliases' /tmp/rules.debug |grep -o '[0-9]\{1,2\}'`
-
-i=$(($i+'1'))
-t=$(($t+'1'))
-#i = line where <snort2c> is
-#t is where 'User Aliases' is
-echo $i
-echo $t
-
-rm /tmp/rules.debug.tmp
-
-#Insert table-entry limit
-sed -i -e '/900000/d' /tmp/rules.debug
-while read line
- do a=$(($a+1));
- #echo $a;
- if [ "$a" = "$t" ]; then
- echo "" >> /tmp/rules.debug.tmp
- echo "set limit table-entries 900000" >> /tmp/rules.debug.tmp
- fi
- echo $line >> /tmp/rules.debug.tmp
-done < "/tmp/rules.debug"
-
-mv /tmp/rules.debug /tmp/rules.debug.old
-mv /tmp/rules.debug.tmp /tmp/rules.debug
-
-pfctl -o basic -f /tmp/rules.debug > errorOUT.txt 2>&1
-
-rm /tmp/rules.debug.tmp
-
-#Insert countryblock rules
-a="0"
-echo $a
-while read line
- do a=$(($a+1));
- echo $a;
- if [ "$a" = "$i" ]; then
- echo "" >> /tmp/rules.debug.tmp
- echo "#countryblock" >> /tmp/rules.debug.tmp
- echo "table <countryblock> persist file '/usr/local/www/packages/countryblock/lists/countries.txt'" >> /tmp/rules.debug.tmp
- echo "table <countryblockW> persist file '/usr/local/www/packages/countryblock/countries-white.txt'" >> /tmp/rules.debug.tmp
-
- for i in $(cat /usr/local/www/packages/countryblock/interfaces.txt); do
- echo "pass quick from <countryblockW> to $i label 'countryblock'" >> /tmp/rules.debug.tmp
- echo "pass quick from $i to <countryblockW> label 'countryblock'" >> /tmp/rules.debug.tmp
- if [ -f logging ]; then
- echo "block log quick from <countryblock> to $i label 'countryblock'" >> /tmp/rules.debug.tmp
- else
- echo "block quick from <countryblock> to $i label 'countryblock'" >> /tmp/rules.debug.tmp
- fi
- if [ -f OUTBOUND ]; then
- echo "block quick from $i to <countryblock> label 'countryblock'" >> /tmp/rules.debug.tmp
- fi
- done
- fi
- echo $line >> /tmp/rules.debug.tmp
-done < "/tmp/rules.debug"
-
-mv /tmp/rules.debug /tmp/rules.debug.old
-mv /tmp/rules.debug.tmp /tmp/rules.debug
-
-rm errorOUT.txt
-pfctl -o basic -f /tmp/rules.debug > /usr/local/www/packages/countryblock/errorOUT.txt 2>&1
diff --git a/config/countryblock/countryblock.tmp b/config/countryblock/countryblock.tmp
deleted file mode 100644
index eb98f283..00000000
--- a/config/countryblock/countryblock.tmp
+++ /dev/null
@@ -1,2699 +0,0 @@
-<?php
-$pgtitle = "Firewall: Countryblock";
- // TomSchaefer.org countryblock package 2012
- //
- // Notes: Find: ^(.*)$
- // Replace: ob_start();\n$results = exec("cat countries.txt | grep XX");\nob_end_clean();\n\tif ($results == 'XX')\n\t\techo "\1";\n\telse\n\t\techo "\1";\n
- //
- //
- //
- //
- //require_once('config.inc');
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/countryblock/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-if (count($_POST)>0) {
-
- conf_mount_rw();
-
- $ent = array();
-
- if ($_POST['enable'] == 1) {
- //echo "enabled";
- $config['installedpackages']['countryblock_settings']['config'][0]['enable'] = 1;
- //touch countries-white.txt to fix bug
- exec("touch /usr/local/www/packages/countryblock/countries-white.txt");
- //Process list by downloading and extracting
- $myFile = "countries.txt";
- $fileContents = file_get_contents($myFile);
- $lines = explode(PHP_EOL, $fileContents);
- //Remove DIR lists to eliminate duplates
- exec("rm -R lists");
- //Process each list URL, Extract, and put in DIR lists
- exec("mkdir lists");
- foreach ($lines as $line) {
- //echo("fetch -o lists http://www.countryipblocks.net/e_country_data/{$line}_cidr.txt");
- //Fetch countries from server
- //exec("fetch -o lists/temp http://127.0.0.1//packages/countryblock/CIDR/{$line}_cidr.txt");
- //Pull from local file since https or http on other ports may be used
- exec("cat CIDR/{$line}_cidr.txt >> lists/countries.txt");
- //exec("fetch -o lists/temp http://www.countryipblocks.net/e_country_data/{$line}_cidr.txt");
- //Remove cat lists/temp since fetch is not used
- //Thank you g4m3c4ck, 'He got a real pretty mouth ain't he', 1 Feb 2011
- //exec("cat lists/temp >> lists/countries.txt");
- $filename = basename($line);
- //Extract list
- //exec("gzip -d lists/$filename");
- }
- //Prep pfctl
- mwexec("rm lists/temp");
- //mwexec("touch lists/ipfw.ipfw");
- //Now clear ipfw, and process each list to ipfw commands
- //mwexec("pfctl -t countryblock -T kill");
- //mwexec("sed -i -e '/countryblock/d' /tmp/rules.debug");
- mwexec("sh execute.sh");
-
- //attempt to create a backup of countries.txt
- mwexec("cp /usr/local/www/packages/countryblock/countries.txt /usr/local/www/packages/countryblock_bkup/countries.txt");
-
- }
- else {
- //echo "disabled";
- $config['installedpackages']['countryblock_settings']['config'][0]['enable'] = 0;
- //Clear Lists
- mwexec("pfctl -t countryblock -T kill");
- mwexec("rm -R /usr/local/www/packages/countryblock/lists");
- mwexec("sed -i -e '/countryblock/d' /tmp/rules.debug");
- mwexec("pfctl -o basic -f /tmp/rules.debug");
- //Clear errorOUT.txt
- mwexec("rm errorOUT.txt");
-
- }
-
-
- //write_config();
- //services_dnsmasq_configure();
- sleep(1);
- $savemsg_cb = "Country Block settings have been saved/updated. ";
- conf_mount_ro();
-}
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<form method=POST action="">
-<?php
-ob_start();
-$resultstop = exec("pfctl -s rules | grep -c countryblock");
-ob_end_clean();
-if ($config['installedpackages']['countryblock_settings']['config'][0]['enable'] == 1) {
- echo "<input name='enable' type='checkbox' value='1' checked>\n";
-}
-elseif ($resultstop > '0') {
-echo "<input name='enable' type='checkbox' value='1' checked>\n";
-}
-else {
- echo "<input name='enable' type='checkbox' value='1'>\n";
-}
-?><strong>Enable Country Block</strong><br><br>
-<?php if ($savemsg_cb) print_info_box($savemsg_cb);
- //if ($output) print_info_box($output,$output2);
- echo($output);
- echo($output2);
- ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("Countries", true, "countryblock.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "countryblock_if.php");
- $tab_array[4] = array("Help", false, "help.php");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Main</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
-
-<?php
-
-conf_mount_rw();
-mwexec("touch countries.txt");
-//$myFile = "countries.txt";
-//$fh = fopen($myFile, 'a+');
-
-
-
- if(isset($_POST['formSubmit']))
- {
- $aCountry = $_POST['formCountry'];
-
-
- if(empty($aCountry))
- {
- $output = "<b>You didn't select any Countries.";
- exec("rm countries.txt");
- }
- else
- {
-
- $N = count($aCountry);
-
- $myFile = "countries.txt";
- $fh = fopen($myFile, 'w+');
- $output = "<b>You selected $N Countries";
-
- for($i=0; $i < $N; $i++)
- {
- //echo($aCountry[$i] . " ");
- fwrite($fh, $aCountry[$i] . "\n");
- }
- echo("</p>");
- }
- }
-conf_mount_ro();
-?>
-
-
-<script type="text/javascript" src="jquery.min.js"></script>
-
-<script type="text/javascript" src="ddaccordion.js">
-
-/***********************************************
-* Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
-* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
-* This notice must stay intact for legal use
-***********************************************/
-
-</script>
-
-
-<script type="text/javascript">
-
-
-ddaccordion.init({
- headerclass: "expandable", //Shared CSS class name of headers group that are expandable
- contentclass: "categoryitems", //Shared CSS class name of contents group
- revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
- mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
- collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
- defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
- onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
- animatedefault: false, //Should contents open by default be animated into view?
- persiststate: true, //persist state of opened contents within browser session?
- toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
- togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
- animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
- oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
- //do nothing
- },
- onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
- //do nothing
- }
-})
-
-
-</script>
-
-<style type="text/css">
-
-a img {border:none; }
-
-.arrowlistmenu{
-width: 180px; /*width of accordion menu*/
-}
-
-.arrowlistmenu .menuheader{ /*CSS class for menu headers in general (expanding or not!)*/
-font: bold 14px Arial;
-color: white;
-background: black url(titlebar.png) repeat-x center left;
-margin-bottom: 10px; /*bottom spacing between header and rest of content*/
-text-transform: uppercase;
-padding: 4px 0 4px 10px; /*header text is indented 10px*/
-cursor: hand;
-cursor: pointer;
-}
-
-.arrowlistmenu .openheader{ /*CSS class to apply to expandable header when it's expanded*/
-background-image: url(titlebar-active.png);
-}
-
-.arrowlistmenu ul{ /*CSS for UL of each sub menu*/
-list-style-type: none;
-margin: 0;
-padding: 0;
-margin-bottom: 8px; /*bottom spacing between each UL and rest of content*/
-}
-
-.arrowlistmenu ul li{
-padding-bottom: 2px; /*bottom spacing between menu items*/
-}
-
-.arrowlistmenu ul li a{
-color: #A70303;
-background: url(arrowbullet.png) no-repeat center left; /*custom bullet list image*/
-display: block;
-padding: 2px 0;
-padding-left: 19px; /*link text is indented 19px*/
-text-decoration: none;
-font-weight: bold;
-border-bottom: 1px solid #dadada;
-font-size: 90%;
-}
-
-.arrowlistmenu ul li a:visited{
-color: #A70303;
-
-}
-
-.arrowlistmenu ul li a:hover{ /*hover state CSS*/
-color: #A70303;
-background-color: #F3F3F3;
-}
-
-</style>
-
-<script type="text/javascript" src="public_smo_scripts.js"></script>
-
-</head>
-
-
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
- <td >
-
-
- </form>
-
- <form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
- <p>
- <?php
- $countif = "interfaces.txt";
- if (file_exists($countif)) {
- $countif = count(file($countif));
- echo "$countlines";
- } else {
- echo "<span style='color:red'>Warning! No Interfaces Selected Click <a href='countryblock_if.php' target='_parent'><img src='../../themes/nervecenter/images/icons/icon_cablenic.gif' ALT='if'></a></span>";
- }
-
- ?>
- </p>
- <h3><p>Check the country that you would like to block completely. Currently
- <?php
- $countfile = "countries.txt";
- if (file_exists($countfile)) {
- $countlines = count(file($countfile));
- echo "$countlines";
- } else {
- echo "0 ";
- }
-
- ?>
-
- of 252 selected. </h3><input type="checkbox" name="checkall" onClick="checkUncheckAll(this);"/>select/unselect
-
-<br/>
-
-
-<table style="width: 50%">
- <tr>
- <td><div class="arrowlistmenu">
-
-<h3 class="menuheader expandable">Top Spammers</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep KR");
-ob_end_clean();
- if ($results == 'KR')
- echo "<li><input name='formCountry[]' type='checkbox' value='KR' checked/>Korea</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='KR'/>Korea</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CN");
-ob_end_clean();
- if ($results == 'CN')
- echo "<li><input name='formCountry[]' type='checkbox' value='CN' checked/>China</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CN'/>China</li>";
-ob_start();
-$results = exec("cat countries.txt | grep IN");
-ob_end_clean();
- if ($results == 'IN')
- echo "<li><input name='formCountry[]' type='checkbox' value='IN' checked/>India</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='IN' />India</li>";
-ob_start();
-$results = exec("cat countries.txt | grep RU");
-ob_end_clean();
- if ($results == 'RU')
- echo "<li><input name='formCountry[]' type='checkbox' value='RU' checked/>Russia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='RU' />Russia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TR");
-ob_end_clean();
- if ($results == 'TR')
- echo "<li><input name='formCountry[]' type='checkbox' value='TR' checked/>Turkey</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TR' />Turkey</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep VN");
-ob_end_clean();
- if ($results == 'VN')
- echo "<li><input name='formCountry[]' type='checkbox' value='VN' checked/>Vietnam</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='VN' />Vietnam</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep UA");
-ob_end_clean();
- if ($results == 'UA')
- echo "<li><input name='formCountry[]' type='checkbox' value='UA' checked/>Ukraine</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='UA' />Ukraine</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BR");
-ob_end_clean();
- if ($results == 'BR')
- echo "<li><input name='formCountry[]' type='checkbox' value='BR' checked/>Brazil</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BR' />Brazil</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep VE");
-ob_end_clean();
- if ($results == 'VE')
- echo "<li><input name='formCountry[]' type='checkbox' value='VE' checked/>Venezuela</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='VE' />Venezuela</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PK");
-ob_end_clean();
- if ($results == 'PK')
- echo "<li><input name='formCountry[]' type='checkbox' value='PK' checked/>Pakistan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PK' />Pakistan</li>";
-
-
-
-?>
-
-</ul>
-
-<h3 class="menuheader expandable">A&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep AF");
-ob_end_clean();
- if ($results == 'AF')
- echo "<li><input name='formCountry[]' type='checkbox' value='AF' checked/>Afghanistan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AF' />Afghanistan</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AX");
-ob_end_clean();
- if ($results == 'AX')
- echo "<li><input name='formCountry[]' type='checkbox' value='AX' checked/>Aland Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AX' />Aland Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AL");
-ob_end_clean();
- if ($results == 'AL')
- echo "<li><input name='formCountry[]' type='checkbox' value='AL' checked/>Albania</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AL' />Albania</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep DZ");
-ob_end_clean();
- if ($results == 'DZ')
- echo "<li><input name='formCountry[]' type='checkbox' value='DZ' checked/>Algeria</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='DZ' />Algeria</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AS");
-ob_end_clean();
- if ($results == 'AS')
- echo "<li><input name='formCountry[]' type='checkbox' value='AS' checked/>American Samoa</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AS' />American Samoa</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AD");
-ob_end_clean();
- if ($results == 'AD')
- echo "<li><input name='formCountry[]' type='checkbox' value='AD' checked/>Andorra</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AD' />Andorra</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AO");
-ob_end_clean();
- if ($results == 'AO')
- echo "<li><input name='formCountry[]' type='checkbox' value='AO' checked/>Angola</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AO' />Angola</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AI");
-ob_end_clean();
- if ($results == 'AI')
- echo "<li><input name='formCountry[]' type='checkbox' value='AI' checked/>Anguilla</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AI' />Anguilla</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AQ");
-ob_end_clean();
- if ($results == 'AQ')
- echo "<li><input name='formCountry[]' type='checkbox' value='AQ' checked/>Antarctica</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AQ' />Antarctica</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AG");
-ob_end_clean();
- if ($results == 'AG')
- echo "<li><input name='formCountry[]' type='checkbox' value='AG' checked/>Antigua And Barbuda</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AG' />Antigua And Barbuda</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AR");
-ob_end_clean();
- if ($results == 'AR')
- echo " <li><input name='formCountry[]' type='checkbox' value='AR' checked/>Argentina</li>";
- else
- echo " <li><input name='formCountry[]' type='checkbox' value='AR' />Argentina</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AM");
-ob_end_clean();
- if ($results == 'AM')
- echo "<li><input name='formCountry[]' type='checkbox' value='AM' checked/>Armenia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AM' />Armenia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AW");
-ob_end_clean();
- if ($results == 'AW')
- echo "<li><input name='formCountry[]' type='checkbox' value='AW' checked/>Aruba</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AW' />Aruba</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AP");
-ob_end_clean();
- if ($results == 'AP')
- echo "<li><input name='formCountry[]' type='checkbox' value='AP' checked/>Asia Pacific</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AP' />Asia Pacific</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AU");
-ob_end_clean();
- if ($results == 'AU')
- echo "<li><input name='formCountry[]' type='checkbox' value='AU' checked/>Australia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AU' />Australia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AT");
-ob_end_clean();
- if ($results == 'AT')
- echo "<li><input name='formCountry[]' type='checkbox' value='AT' checked/>Austria</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AT' />Austria</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AZ");
-ob_end_clean();
- if ($results == 'AZ')
- echo "<li><input name='formCountry[]' type='checkbox' value='AZ' checked/>Azerbaijan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AZ' />Azerbaijan</li>";
-?>
-</ul>
-
-<h3 class="menuheader expandable">B&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep BS");
-ob_end_clean();
- if ($results == 'BS')
- echo "<li><input name='formCountry[]' type='checkbox' value='BS' checked/>Bahamas</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BS' />Bahamas</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BH");
-ob_end_clean();
- if ($results == 'BH')
- echo "<li><input name='formCountry[]' type='checkbox' value='BH' checked/>Bahrain</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BH' />Bahrain</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BD");
-ob_end_clean();
- if ($results == 'BD')
- echo "<li><input name='formCountry[]' type='checkbox' value='BD' checked/>Bangladesh</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BD' />Bangladesh</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BB");
-ob_end_clean();
- if ($results == 'BB')
- echo "<li><input name='formCountry[]' type='checkbox' value='BB' checked/>Barbados</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BB' />Barbados</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BY");
-ob_end_clean();
- if ($results == 'BY')
- echo "<li><input name='formCountry[]' type='checkbox' value='BY' checked/>Belarus</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BY' />Belarus</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BE");
-ob_end_clean();
- if ($results == 'BE')
- echo "<li><input name='formCountry[]' type='checkbox' value='BE' checked/>Belgium</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BE' />Belgium</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BZ");
-ob_end_clean();
- if ($results == 'BZ')
- echo "<li><input name='formCountry[]' type='checkbox' value='BZ' checked/>Belize</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BZ' />Belize</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BJ");
-ob_end_clean();
- if ($results == 'BJ')
- echo "<li><input name='formCountry[]' type='checkbox' value='BJ' checked/>Benin</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BJ' />Benin</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BM");
-ob_end_clean();
- if ($results == 'BM')
- echo "<li><input name='formCountry[]' type='checkbox' value='BM' checked/>Bermuda</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BM' />Bermuda</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BT");
-ob_end_clean();
- if ($results == 'BT')
- echo "<li><input name='formCountry[]' type='checkbox' value='BT' checked/>Bhutan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BT' />Bhutan</li>";
-/*
-ob_start();
-$results = exec("cat countries.txt | grep XA");
-ob_end_clean();
- if ($results == 'XA')
- echo "<li><input name='formCountry[]' type='checkbox' value='XA' checked/>Bogons</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='XA' />Bogons</li>";
-*/
-ob_start();
-$results = exec("cat countries.txt | grep BO");
-ob_end_clean();
- if ($results == 'BO')
- echo "<li><input name='formCountry[]' type='checkbox' value='BO' checked/>Bolivia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BO' />Bolivia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BQ");
-ob_end_clean();
- if ($results == 'BQ')
- echo "<li><input name='formCountry[]' type='checkbox' value='BQ' checked/>Bonaire, Saint Eustatius and Saba</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BQ' />Bonaire, Saint Eustatius and Saba</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BA");
-ob_end_clean();
- if ($results == 'BA')
- echo "<li><input name='formCountry[]' type='checkbox' value='BA' checked/>Bosnia And Gerzegovia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BA' />Bosnia And Gerzegovia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BW");
-ob_end_clean();
- if ($results == 'BW')
- echo "<li><input name='formCountry[]' type='checkbox' value='BW' checked/>Botswana</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BW' />Botswana</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BV");
-ob_end_clean();
- if ($results == 'BV')
- echo "<li><input name='formCountry[]' type='checkbox' value='BV' checked/>Bouvet Island</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BV' />Bouvet Island</li>";
-
-//ob_start();
-//$results = exec("cat countries.txt | grep BR");
-//ob_end_clean();
-// if ($results == 'BR')
-// echo "<li><input name='formCountry[]' type='checkbox' value='BR' checked/>Brazil</li>";
-// else
-// echo "<li><input name='formCountry[]' type='checkbox' value='BR' />Brazil</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep IO");
-ob_end_clean();
- if ($results == 'IO')
- echo "<li><input name='formCountry[]' type='checkbox' value='IO' checked/>British India Ocean Territory</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='IO' />British India Ocean Territory</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BN");
-ob_end_clean();
- if ($results == 'BN')
- echo "<li><input name='formCountry[]' type='checkbox' value='BN' checked/>Brunei Darussalam</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BN' />Brunei Darussalam</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BG");
-ob_end_clean();
- if ($results == 'BG')
- echo "<li><input name='formCountry[]' type='checkbox' value='BG' checked/>Bulgaria</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BG' />Bulgaria</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BF");
-ob_end_clean();
- if ($results == 'BF')
- echo "<li><input name='formCountry[]' type='checkbox' value='BF' checked/>Burkina Faso</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BF' />Burkina Faso</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep BI");
-ob_end_clean();
- if ($results == 'BI')
- echo "<li><input name='formCountry[]' type='checkbox' value='BI' checked/>Burundi</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BI' />Burundi</li>";
-?>
-</ul>
-<h3 class="menuheader expandable">C&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep KH");
-ob_end_clean();
- if ($results == 'KH')
- echo "<li><input name='formCountry[]' type='checkbox' value='KH' checked/>Cambodia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='KH' />Cambodia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CM");
-ob_end_clean();
- if ($results == 'CM')
- echo "<li><input name='formCountry[]' type='checkbox' value='CM' checked/>Cameroon</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CM' />Cameroon</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CA");
-ob_end_clean();
- if ($results == 'CA')
- echo "<li><input name='formCountry[]' type='checkbox' value='CA' checked/>Canada</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CA' />Canada</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CV");
-ob_end_clean();
- if ($results == 'CV')
- echo "<li><input name='formCountry[]' type='checkbox' value='CV' checked/>Cape Verde</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CV' />Cape Verde</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep KY");
-ob_end_clean();
- if ($results == 'KY')
- echo "<li><input name='formCountry[]' type='checkbox' value='KY' checked/>Cayman Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='KY' />Cayman Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CF");
-ob_end_clean();
- if ($results == 'CF')
- echo "<li><input name='formCountry[]' type='checkbox' value='CF' checked/>Central African Republic</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CF' />Central African Republic</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TD");
-ob_end_clean();
- if ($results == 'TD')
- echo "<li><input name='formCountry[]' type='checkbox' value='TD' checked/>Chad</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TD' />Chad</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CL");
-ob_end_clean();
- if ($results == 'CL')
- echo "<li><input name='formCountry[]' type='checkbox' value='CL' checked/>Chile</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CL' />Chile</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CX");
-ob_end_clean();
- if ($results == 'CX')
- echo "<li><input name='formCountry[]' type='checkbox' value='CX' checked/>Christmas Island</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CX' />Christmas Island</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CC");
-ob_end_clean();
- if ($results == 'CC')
- echo "<li><input name='formCountry[]' type='checkbox' value='CC' checked/>Cocos (Keeling) Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CC' />Cocos (Keeling) Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CO");
-ob_end_clean();
- if ($results == 'CO')
- echo "<li><input name='formCountry[]' type='checkbox' value='CO' checked/>Colombia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CO' />Colombia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep KM");
-ob_end_clean();
- if ($results == 'KM')
- echo "<li><input name='formCountry[]' type='checkbox' value='KM' checked/>Comoros</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='KM' />Comoros</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CG");
-ob_end_clean();
- if ($results == 'CG')
- echo "<li><input name='formCountry[]' type='checkbox' value='CG' checked/>Congo - Brazzaville</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CG' />Congo - Brazzaville</li>";
-
-
-ob_start();
-$results = exec("cat countries.txt | grep CD");
-ob_end_clean();
- if ($results == 'CD')
- echo "<li><input name='formCountry[]' type='checkbox' value='CD' checked/>Congo, The Democratic Republic of the</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CD' />Congo, The Democratic Republic of the</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CK");
-ob_end_clean();
- if ($results == 'CK')
- echo "<li><input name='formCountry[]' type='checkbox' value='CK' checked/>Cook Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CK' />Cook Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CR");
-ob_end_clean();
- if ($results == 'CR')
- echo "<li><input name='formCountry[]' type='checkbox' value='CR' checked/>Costa Rica</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CR' />Costa Rica</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CI");
-ob_end_clean();
- if ($results == 'CI')
- echo "<li><input name='formCountry[]' type='checkbox' value='CI' checked/>Côte d’Ivoire</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CI' />Côte d’Ivoire</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep HR");
-ob_end_clean();
- if ($results == 'HR')
- echo "<li><input name='formCountry[]' type='checkbox' value='HR' checked/>Croatia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='HR' />Croatia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CU");
-ob_end_clean();
- if ($results == 'CU')
- echo "<li><input name='formCountry[]' type='checkbox' value='CU' checked/>Cuba</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CU' />Cuba</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CW");
-ob_end_clean();
- if ($results == 'CW')
- echo "<li><input name='formCountry[]' type='checkbox' value='CW' checked/>Curacao</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CW' />Curacao</li>";
-
-
-ob_start();
-$results = exec("cat countries.txt | grep CY");
-ob_end_clean();
- if ($results == 'CY')
- echo "<li><input name='formCountry[]' type='checkbox' value='CY' checked/>Cyprus</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CY' />Cyprus</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CZ");
-ob_end_clean();
- if ($results == 'CZ')
- echo "<li><input name='formCountry[]' type='checkbox' value='CZ' checked/>Czech Republic</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CZ' />Czech Republic</li>";
-
-?>
-</ul>
-<h3 class="menuheader expandable">D&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep DK");
-ob_end_clean();
- if ($results == 'DK')
- echo "<li><input name='formCountry[]' type='checkbox' value='DK' checked/>Denmark</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='DK' />Denmark</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep DJ");
-ob_end_clean();
- if ($results == 'DJ')
- echo "<li><input name='formCountry[]' type='checkbox' value='DJ' checked/>Djibouti</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='DJ' />Djibouti</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep DM");
-ob_end_clean();
- if ($results == 'DM')
- echo "<li><input name='formCountry[]' type='checkbox' value='DM' checked/>Dominica</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='DM' />Dominica</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep DO");
-ob_end_clean();
- if ($results == 'DO')
- echo "<li><input name='formCountry[]' type='checkbox' value='DO' checked/>Dominican Republic</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='DO' />Dominican Republic</li>";
-
-?>
-</ul>
-<h3 class="menuheader expandable">E&#39;s</h3>
-<ul class="categoryitems">
-<?php
-//ob_start();
-//$results = exec("cat countries.txt | grep XX");
-//ob_end_clean();
-// if ($results == 'XX')
-// echo "<li><input name='formCountry[]' type='checkbox' value='East_Timor' checked/>East Timor</li>";
-// else
-// echo "<li><input name='formCountry[]' type='checkbox' value='East_Timor' />East Timor</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep EC");
-ob_end_clean();
- if ($results == 'EC')
- echo "<li><input name='formCountry[]' type='checkbox' value='EC' checked/>Ecuador</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='EC' />Ecuador</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep EG");
-ob_end_clean();
- if ($results == 'EG')
- echo "<li><input name='formCountry[]' type='checkbox' value='EG' checked/>Egypt</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='EG' />Egypt</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SV");
-ob_end_clean();
- if ($results == 'SV')
- echo "<li><input name='formCountry[]' type='checkbox' value='SV' checked/>El Salvador</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SV' />El Salvador</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GQ");
-ob_end_clean();
- if ($results == 'GQ')
- echo "<li><input name='formCountry[]' type='checkbox' value='GQ' checked/>Equatorial Guinea</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GQ' />Equatorial Guinea</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep ER");
-ob_end_clean();
- if ($results == 'ER')
- echo "<li><input name='formCountry[]' type='checkbox' value='ER' checked/>Eritrea</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='ER' />Eritrea</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep EE");
-ob_end_clean();
- if ($results == 'EE')
- echo "<li><input name='formCountry[]' type='checkbox' value='EE' checked/>Estonia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='EE' />Estonia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep ET");
-ob_end_clean();
- if ($results == 'ET')
- echo "<li><input name='formCountry[]' type='checkbox' value='ET' checked/>Ethiopia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='ET' />Ethiopia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep EU");
-ob_end_clean();
- if ($results == 'EU')
- echo "<li><input name='formCountry[]' type='checkbox' value='EU' checked/>European Union</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='EU' />European Union</li>";
-
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">F&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep FK");
-ob_end_clean();
- if ($results == 'FK')
- echo "<li><input name='formCountry[]' type='checkbox' value='FK' checked/>Falkland Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='FK' />Falkland Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep FO");
-ob_end_clean();
- if ($results == 'FO')
- echo "<li><input name='formCountry[]' type='checkbox' value='FO' checked/>Faroe Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='FO' />Faroe Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep FJ");
-ob_end_clean();
- if ($results == 'FJ')
- echo "<li><input name='formCountry[]' type='checkbox' value='FJ' checked/>Fiji Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='FJ' />Fiji Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep FI");
-ob_end_clean();
- if ($results == 'FI')
- echo "<li><input name='formCountry[]' type='checkbox' value='FI' checked/>Finland</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='FI' />Finland</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep FR");
-ob_end_clean();
- if ($results == 'FR')
- echo "<li><input name='formCountry[]' type='checkbox' value='FR' checked/>France</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='FR' />France</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GF");
-ob_end_clean();
- if ($results == 'GF')
- echo "<li><input name='formCountry[]' type='checkbox' value='GF' checked/>French Guiana</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GF' />French Guiana</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PF");
-ob_end_clean();
- if ($results == 'PF')
- echo "<li><input name='formCountry[]' type='checkbox' value='PF' checked/>French Polynesia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PF' />French Polynesia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TF");
-ob_end_clean();
- if ($results == 'TF')
- echo "<li><input name='formCountry[]' type='checkbox' value='TF' checked/>French Southern territories</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TF' />French Southern territories</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">G&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep GA");
-ob_end_clean();
- if ($results == 'GA')
- echo "<li><input name='formCountry[]' type='checkbox' value='GA' checked/>Gabon</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GA' />Gabon</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GM");
-ob_end_clean();
- if ($results == 'GM')
- echo "<li><input name='formCountry[]' type='checkbox' value='GM' checked/>Gambia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GM' />Gambia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GE");
-ob_end_clean();
- if ($results == 'GE')
- echo "<li><input name='formCountry[]' type='checkbox' value='GE' checked/>Georgia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GE' />Georgia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep DE");
-ob_end_clean();
- if ($results == 'DE')
- echo "<li><input name='formCountry[]' type='checkbox' value='DE' checked/>Germany</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='DE' />Germany</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GH");
-ob_end_clean();
- if ($results == 'GH')
- echo "<li><input name='formCountry[]' type='checkbox' value='GH' checked/>Ghana</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GH' />Ghana</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GI");
-ob_end_clean();
- if ($results == 'GI')
- echo "<li><input name='formCountry[]' type='checkbox' value='GI' checked/>Gibraltar</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GI' />Gibraltar</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GR");
-ob_end_clean();
- if ($results == 'GR')
- echo "<li><input name='formCountry[]' type='checkbox' value='GR' checked/>Greece</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GR' />Greece</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GL");
-ob_end_clean();
- if ($results == 'GL')
- echo "<li><input name='formCountry[]' type='checkbox' value='GL' checked/>Greenland</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GL' />Greenland</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GD");
-ob_end_clean();
- if ($results == 'GD')
- echo "<li><input name='formCountry[]' type='checkbox' value='GD' checked/>Grenada</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GD' />Grenada</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GP");
-ob_end_clean();
- if ($results == 'GP')
- echo "<li><input name='formCountry[]' type='checkbox' value='GP' checked/>Guadeloupe</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GP' />Guadeloupe</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GU");
-ob_end_clean();
- if ($results == 'GU')
- echo "<li><input name='formCountry[]' type='checkbox' value='GU' checked/>Guam</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GU' />Guam</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GT");
-ob_end_clean();
- if ($results == 'GT')
- echo "<li><input name='formCountry[]' type='checkbox' value='GT' checked/>Guatemala</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GT' />Guatemala</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GG");
-ob_end_clean();
- if ($results == 'GG')
- echo "<li><input name='formCountry[]' type='checkbox' value='GG' checked/>Guernsey</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GG' />Guernsey</li>";
-
-
-ob_start();
-$results = exec("cat countries.txt | grep GN");
-ob_end_clean();
- if ($results == 'GN')
- echo "<li><input name='formCountry[]' type='checkbox' value='GN' checked/>Guinea</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GN' />Guinea</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GW");
-ob_end_clean();
- if ($results == 'GW')
- echo "<li><input name='formCountry[]' type='checkbox' value='GW' checked/>Guinea-Bissau</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GW' />Guinea-Bissau</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GY");
-ob_end_clean();
- if ($results == 'GY')
- echo "<li><input name='formCountry[]' type='checkbox' value='GY' checked/>Guyana</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GY' />Guyana</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">H&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep HT");
-ob_end_clean();
- if ($results == 'HT')
- echo "<li><input name='formCountry[]' type='checkbox' value='HT' checked/>Haiti</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='HT' />Haiti</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep HM");
-ob_end_clean();
- if ($results == 'HM')
- echo "<li><input name='formCountry[]' type='checkbox' value='HM' checked/>Heard Island and McDonald Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='HM' />Heard Island and McDonald Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep VA");
-ob_end_clean();
- if ($results == 'VA')
- echo "<li><input name='formCountry[]' type='checkbox' value='VA' checked/>Holy See (Vatican City State)</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='VA' />Holy See (Vatican City State)</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep HN");
-ob_end_clean();
- if ($results == 'HN')
- echo "<li><input name='formCountry[]' type='checkbox' value='HN' checked/>Honduras</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='HN' />Honduras</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep HK");
-ob_end_clean();
- if ($results == 'HK')
- echo "<li><input name='formCountry[]' type='checkbox' value='HK' checked/>Hong Kong</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='HK' />Hong Kong</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep HU");
-ob_end_clean();
- if ($results == 'HU')
- echo "<li><input name='formCountry[]' type='checkbox' value='HU' checked/>Hungary</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='HU' />Hungary</li>";
-
-?>
-</ul>
-</div>
-</td>
- <td><div class="arrowlistmenu">
-<h3 class="menuheader expandable">I&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep IS");
-ob_end_clean();
- if ($results == 'IS')
- echo "<li><input name='formCountry[]' type='checkbox' value='IS' checked/>Iceland</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='IS' />Iceland</li>";
-
-//ob_start();
-//$results = exec("cat countries.txt | grep IN");
-//ob_end_clean();
-// if ($results == 'IN')
-// echo "<li><input name='formCountry[]' type='checkbox' value='IN' checked/>India</li>";
-// else
-// echo "<li><input name='formCountry[]' type='checkbox' value='IN' />India</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep ID");
-ob_end_clean();
- if ($results == 'ID')
- echo "<li><input name='formCountry[]' type='checkbox' value='ID' checked/>Indonesia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='ID' />Indonesia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep IR");
-ob_end_clean();
- if ($results == 'IR')
- echo "<li><input name='formCountry[]' type='checkbox' value='IR' checked/>Iran</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='IR' />Iran</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep IQ");
-ob_end_clean();
- if ($results == 'IQ')
- echo "<li><input name='formCountry[]' type='checkbox' value='IQ' checked/>Iraq</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='IQ' />Iraq</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep IE");
-ob_end_clean();
- if ($results == 'IE')
- echo "<li><input name='formCountry[]' type='checkbox' value='IE' checked/>Ireland</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='IE' />Ireland</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep IM");
-ob_end_clean();
- if ($results == 'IM')
- echo "<li><input name='formCountry[]' type='checkbox' value='IM' checked/>Isle of Man</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='IM' />Isle of Man</li>";
-
-
-ob_start();
-$results = exec("cat countries.txt | grep IL");
-ob_end_clean();
- if ($results == 'IL')
- echo "<li><input name='formCountry[]' type='checkbox' value='IL' checked/>Israel</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='IL' />Israel</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep IT");
-ob_end_clean();
- if ($results == 'IT')
- echo "<li><input name='formCountry[]' type='checkbox' value='IT' checked/>Italy</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='IT' />Italy</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">J&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep JM");
-ob_end_clean();
- if ($results == 'JM')
- echo "<li><input name='formCountry[]' type='checkbox' value='JM' checked/>Jamaica</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='JM' />Jamaica</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep JP");
-ob_end_clean();
- if ($results == 'JP')
- echo "<li><input name='formCountry[]' type='checkbox' value='JP' checked/>Japan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='JP' />Japan</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep JE");
-ob_end_clean();
- if ($results == 'JE')
- echo "<li><input name='formCountry[]' type='checkbox' value='JE' checked/>Jersey</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='JE' />Jersey</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep JO");
-ob_end_clean();
- if ($results == 'JO')
- echo "<li><input name='formCountry[]' type='checkbox' value='JO' checked/>Jordan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='JO' />Jordan</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">K&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep KZ");
-ob_end_clean();
- if ($results == 'KZ')
- echo "<li><input name='formCountry[]' type='checkbox' value='KZ' checked/>Kazakstan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='KZ' />Kazakstan</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep KE");
-ob_end_clean();
- if ($results == 'KE')
- echo "<li><input name='formCountry[]' type='checkbox' value='KE' checked/>Kenya</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='KE' />Kenya</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep KI");
-ob_end_clean();
- if ($results == 'KI')
- echo "<li><input name='formCountry[]' type='checkbox' value='KI' checked/>Kiribati</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='KI' />Kiribati</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep KP");
-ob_end_clean();
- if ($results == 'KP')
- echo "<li><input name='formCountry[]' type='checkbox' value='KP' checked/>Korea, Democratic Replublic</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='KP' />Korea, Democratic Replublic</li>";
-
-//ob_start();
-//$results = exec("cat countries.txt | grep KR");
-//ob_end_clean();
-// if ($results == 'KR')
-// echo "<li><input name='formCountry[]' type='checkbox' value='KR' checked/>Korea</li>";
-// else
-// echo "<li><input name='formCountry[]' type='checkbox' value='KR' />Korea</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CS");
-ob_end_clean();
- if ($results == 'CS')
- echo "<li><input name='formCountry[]' type='checkbox' value='CS' checked/>Kosovo</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CS' />Kosovo</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep KW");
-ob_end_clean();
- if ($results == 'KW')
- echo "<li><input name='formCountry[]' type='checkbox' value='KW' checked/>Kuwait</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='KW' />Kuwait</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep KG");
-ob_end_clean();
- if ($results == 'KG')
- echo "<li><input name='formCountry[]' type='checkbox' value='KG' checked/>Kyrgyzstan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='KG' />Kyrgyzstan</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">L&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep LA");
-ob_end_clean();
- if ($results == 'LA')
- echo "<li><input name='formCountry[]' type='checkbox' value='LA' checked/>Lao Democratic Republic</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='LA' />Lao Democratic Republic</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep LV");
-ob_end_clean();
- if ($results == 'LV')
- echo "<li><input name='formCountry[]' type='checkbox' value='LV' checked/>Latvia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='LV' />Latvia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep LB");
-ob_end_clean();
- if ($results == 'LB')
- echo "<li><input name='formCountry[]' type='checkbox' value='LB' checked/>Lebanon</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='LB' />Lebanon</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep LS");
-ob_end_clean();
- if ($results == 'LS')
- echo "<li><input name='formCountry[]' type='checkbox' value='LS' checked/>Lesotho</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='LS' />Lesotho</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep LR");
-ob_end_clean();
- if ($results == 'LR')
- echo "<li><input name='formCountry[]' type='checkbox' value='LR' checked/>Liberia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='LR' />Liberia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep LY");
-ob_end_clean();
- if ($results == 'LY')
- echo "<li><input name='formCountry[]' type='checkbox' value='LY' checked/>Libyan Arab Jamahiriya</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='LY' />Libyan Arab Jamahiriya</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep LI");
-ob_end_clean();
- if ($results == 'LI')
- echo "<li><input name='formCountry[]' type='checkbox' value='LI' checked/>Liechtenstein</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='LI' />Liechtenstein</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep LT");
-ob_end_clean();
- if ($results == 'LT')
- echo "<li><input name='formCountry[]' type='checkbox' value='LT' checked/>Lithuania</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='LT' />Lithuania</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep LU");
-ob_end_clean();
- if ($results == 'LU')
- echo "<li><input name='formCountry[]' type='checkbox' value='LU' checked/>Luxembourg</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='LU' />Luxembourg</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">M&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep MO");
-ob_end_clean();
- if ($results == 'MO')
- echo "<li><input name='formCountry[]' type='checkbox' value='MO' checked/>Macao</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MO' />Macao</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MK");
-ob_end_clean();
- if ($results == 'MK')
- echo "<li><input name='formCountry[]' type='checkbox' value='MK' checked/>Macedonia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MK' />Macedonia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MG");
-ob_end_clean();
- if ($results == 'MG')
- echo "<li><input name='formCountry[]' type='checkbox' value='MG' checked/>Madagascar</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MG' />Madagascar</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MW");
-ob_end_clean();
- if ($results == 'MW')
- echo "<li><input name='formCountry[]' type='checkbox' value='MW' checked/>Malawi</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MW' />Malawi</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MY");
-ob_end_clean();
- if ($results == 'MY')
- echo "<li><input name='formCountry[]' type='checkbox' value='MY' checked/>Malaysia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MY' />Malaysia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MV");
-ob_end_clean();
- if ($results == 'MV')
- echo "<li><input name='formCountry[]' type='checkbox' value='MV' checked/>Maldives</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MV' />Maldives</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep ML");
-ob_end_clean();
- if ($results == 'ML')
- echo "<li><input name='formCountry[]' type='checkbox' value='ML' checked/>Mali</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='ML' />Mali</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MT");
-ob_end_clean();
- if ($results == 'MT')
- echo "<li><input name='formCountry[]' type='checkbox' value='MT' checked/>Malta</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MT' />Malta</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MH");
-ob_end_clean();
- if ($results == 'MH')
- echo "<li><input name='formCountry[]' type='checkbox' value='MH' checked/>Marshall Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MH' />Marshall Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MQ");
-ob_end_clean();
- if ($results == 'MQ')
- echo "<li><input name='formCountry[]' type='checkbox' value='MQ' checked/>Martinique</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MQ' />Martinique</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MR");
-ob_end_clean();
- if ($results == 'MR')
- echo "<li><input name='formCountry[]' type='checkbox' value='MR' checked/>Mauritania</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MR' />Mauritania</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MU");
-ob_end_clean();
- if ($results == 'MU')
- echo "<li><input name='formCountry[]' type='checkbox' value='MU' checked/>Mauritius</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MU' />Mauritius</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep YT");
-ob_end_clean();
- if ($results == 'YT')
- echo "<li><input name='formCountry[]' type='checkbox' value='YT' checked/>Mayotte</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='YT' />Mayotte</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MX");
-ob_end_clean();
- if ($results == 'MX')
- echo "<li><input name='formCountry[]' type='checkbox' value='MX' checked/>Mexico</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MX' />Mexico</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep FM");
-ob_end_clean();
- if ($results == 'FM')
- echo "<li><input name='formCountry[]' type='checkbox' value='FM' checked/>Micronesia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='FM' />Micronesia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MD");
-ob_end_clean();
- if ($results == 'MD')
- echo "<li><input name='formCountry[]' type='checkbox' value='MD' checked/>Moldova</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MD' />Moldova</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MC");
-ob_end_clean();
- if ($results == 'MC')
- echo "<li><input name='formCountry[]' type='checkbox' value='MC' checked/>Monaco</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MC' />Monaco</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MN");
-ob_end_clean();
- if ($results == 'MN')
- echo "<li><input name='formCountry[]' type='checkbox' value='MN' checked/>Mongolia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MN' />Mongolia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep ME");
-ob_end_clean();
- if ($results == 'ME')
- echo "<li><input name='formCountry[]' type='checkbox' value='ME' checked/>Montenegro</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='ME' />Montenegro</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MS");
-ob_end_clean();
- if ($results == 'MS')
- echo "<li><input name='formCountry[]' type='checkbox' value='MS' checked/>Montserrat</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MS' />Montserrat</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MA");
-ob_end_clean();
- if ($results == 'MA')
- echo "<li><input name='formCountry[]' type='checkbox' value='MA' checked/>Morocco</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MA' />Morocco</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MZ");
-ob_end_clean();
- if ($results == 'MZ')
- echo "<li><input name='formCountry[]' type='checkbox' value='MZ' checked/>Mozambique</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MZ' />Mozambique</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MM");
-ob_end_clean();
- if ($results == 'MM')
- echo "<li><input name='formCountry[]' type='checkbox' value='MM' checked/>Myanmar</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MM' />Myanmar</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">N&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep NA");
-ob_end_clean();
- if ($results == 'NA')
- echo "<li><input name='formCountry[]' type='checkbox' value='NA' checked/>Namibia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='NA' />Namibia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep NR");
-ob_end_clean();
- if ($results == 'NR')
- echo "<li><input name='formCountry[]' type='checkbox' value='NR' checked/>Nauru</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='NR' />Nauru</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep NP");
-ob_end_clean();
- if ($results == 'NP')
- echo "<li><input name='formCountry[]' type='checkbox' value='NP' checked/>Nepal</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='NP' />Nepal</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep NL");
-ob_end_clean();
- if ($results == 'NL')
- echo "<li><input name='formCountry[]' type='checkbox' value='NL' checked/>Netherlands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='NL' />Netherlands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AN");
-ob_end_clean();
- if ($results == 'AN')
- echo "<li><input name='formCountry[]' type='checkbox' value='AN' checked/>Netherlands Antilles</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AN' />Netherlands Antilles</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep NC");
-ob_end_clean();
- if ($results == 'NC')
- echo "<li><input name='formCountry[]' type='checkbox' value='NC' checked/>New Caledonia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='NC' />New Caledonia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep NZ");
-ob_end_clean();
- if ($results == 'NZ')
- echo "<li><input name='formCountry[]' type='checkbox' value='NZ' checked/>New Zealand</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='NZ' />New Zealand</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep NI");
-ob_end_clean();
- if ($results == 'NI')
- echo "<li><input name='formCountry[]' type='checkbox' value='NI' checked/>Nicaragua</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='NI' />Nicaragua</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep NE");
-ob_end_clean();
- if ($results == 'NE')
- echo "<li><input name='formCountry[]' type='checkbox' value='NE' checked/>Niger</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='NE' />Niger</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep NG");
-ob_end_clean();
- if ($results == 'NG')
- echo "<li><input name='formCountry[]' type='checkbox' value='NG' checked/>Nigeria</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='NG' />Nigeria</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep NU");
-ob_end_clean();
- if ($results == 'NU')
- echo "<li><input name='formCountry[]' type='checkbox' value='NU' checked/>Niue</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='NU' />Niue</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep NF");
-ob_end_clean();
- if ($results == 'NF')
- echo "<li><input name='formCountry[]' type='checkbox' value='NF' checked/>Norfolk Island</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='NF' />Norfolk Island</li>";
-
-//ob_start();
-//$results = exec("cat countries.txt | grep XX");
-//ob_end_clean();
-// if ($results == 'XX')
-// echo "<li><input name='formCountry[]' type='checkbox' value='North_Korea' checked/>North Korea</li>";
-// else
-// echo "<li><input name='formCountry[]' type='checkbox' value='North_Korea' />North Korea</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MP");
-ob_end_clean();
- if ($results == 'MP')
- echo "<li><input name='formCountry[]' type='checkbox' value='MP' checked/>Northern Mariana Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MP' />Northern Mariana Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep NO");
-ob_end_clean();
- if ($results == 'NO')
- echo "<li><input name='formCountry[]' type='checkbox' value='NO' checked/>Norway</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='NO' />Norway</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">O&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep OM");
-ob_end_clean();
- if ($results == 'OM')
- echo "<li><input name='formCountry[]' type='checkbox' value='OM' checked/>Oman</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='OM' />Oman</li>";
-
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">P&#39;s</h3>
-<ul class="categoryitems">
-<?php
-//ob_start();
-//$results = exec("cat countries.txt | grep PK");
-//ob_end_clean();
-// if ($results == 'PK')
-// echo "<li><input name='formCountry[]' type='checkbox' value='PK' checked/>Pakistan</li>";
-// else
-// echo "<li><input name='formCountry[]' type='checkbox' value='PK' />Pakistan</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PW");
-ob_end_clean();
- if ($results == 'PW')
- echo "<li><input name='formCountry[]' type='checkbox' value='PW' checked/>Palau</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PW' />Palau</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PS");
-ob_end_clean();
- if ($results == 'PS')
- echo "<li><input name='formCountry[]' type='checkbox' value='PS' checked/>Palestine</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PS' />Palestine</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PA");
-ob_end_clean();
- if ($results == 'PA')
- echo "<li><input name='formCountry[]' type='checkbox' value='PA' checked/>Panama</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PA' />Panama</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PG");
-ob_end_clean();
- if ($results == 'PG')
- echo "<li><input name='formCountry[]' type='checkbox' value='PG' checked/>Papua New Guinea</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PG' />Papua New Guinea</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PY");
-ob_end_clean();
- if ($results == 'PY')
- echo "<li><input name='formCountry[]' type='checkbox' value='PY' checked/>Paraguay</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PY' />Paraguay</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PE");
-ob_end_clean();
- if ($results == 'PE')
- echo "<li><input name='formCountry[]' type='checkbox' value='PE' checked/>Peru</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PE' />Peru</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PH");
-ob_end_clean();
- if ($results == 'PH')
- echo "<li><input name='formCountry[]' type='checkbox' value='PH' checked/>Philippines</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PH' />Philippines</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PN");
-ob_end_clean();
- if ($results == 'PN')
- echo "<li><input name='formCountry[]' type='checkbox' value='PN' checked/>Pitcairn</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PN' />Pitcairn</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PL");
-ob_end_clean();
- if ($results == 'PL')
- echo "<li><input name='formCountry[]' type='checkbox' value='PL' checked/>Poland</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PL' />Poland</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PT");
-ob_end_clean();
- if ($results == 'PT')
- echo "<li><input name='formCountry[]' type='checkbox' value='PT' checked/>Portugal</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PT' />Portugal</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PR");
-ob_end_clean();
- if ($results == 'PR')
- echo "<li><input name='formCountry[]' type='checkbox' value='PR' checked/>Puerto Rico</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PR' />Puerto Rico</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">Q&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep QA");
-ob_end_clean();
- if ($results == 'QA')
- echo "<li><input name='formCountry[]' type='checkbox' value='QA' checked/>Qatar</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='QA' />Qatar</li>";
-
-?>
-</ul>
-</div>
-</td>
- <td><div class="arrowlistmenu">
-
-<h3 class="menuheader expandable">R&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep RE");
-ob_end_clean();
- if ($results == 'RE')
- echo "<li><input name='formCountry[]' type='checkbox' value='RE' checked/>Réunion</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='RE' />Réunion</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep RO");
-ob_end_clean();
- if ($results == 'RO')
- echo "<li><input name='formCountry[]' type='checkbox' value='RO' checked/>Romania</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='RO' />Romania</li>";
-
-//ob_start();
-//$results = exec("cat countries.txt | grep RU");
-//ob_end_clean();
-// if ($results == 'RU')
-// echo "<li><input name='formCountry[]' type='checkbox' value='RU' checked/>Russian Federation</li>";
-// else
-// echo "<li><input name='formCountry[]' type='checkbox' value='RU' />Russian Federation</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep RW");
-ob_end_clean();
- if ($results == 'RW')
- echo "<li><input name='formCountry[]' type='checkbox' value='RW' checked/>Rwanda</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='RW' />Rwanda</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">S&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep BL");
-ob_end_clean();
- if ($results == 'BL')
- echo "<li><input name='formCountry[]' type='checkbox' value='BL' checked/>Saint Barthelemy</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='BL' />Saint Barthelemy</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SH");
-ob_end_clean();
- if ($results == 'SH')
- echo "<li><input name='formCountry[]' type='checkbox' value='SH' checked/>Saint Helena</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SH' />Saint Helena</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep KN");
-ob_end_clean();
- if ($results == 'KN')
- echo "<li><input name='formCountry[]' type='checkbox' value='KN' checked/>Saint Kitts and Nevis</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='KN' />Saint Kitts and Nevis</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep LC");
-ob_end_clean();
- if ($results == 'LC')
- echo "<li><input name='formCountry[]' type='checkbox' value='LC' checked/>Saint Lucia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='LC' />Saint Lucia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep MF");
-ob_end_clean();
- if ($results == 'MF')
- echo "<li><input name='formCountry[]' type='checkbox' value='MF' checked/>Saint Martin</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='MF' />Saint Martin</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep PM");
-ob_end_clean();
- if ($results == 'PM')
- echo "<li><input name='formCountry[]' type='checkbox' value='PM' checked/>Saint Pierre and Miquelon</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='PM' />Saint Pierre and Miquelon</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep VC");
-ob_end_clean();
- if ($results == 'VC')
- echo "<li><input name='formCountry[]' type='checkbox' value='VC' checked/>Saint Vincent and the Grenadines</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='VC' />Saint Vincent and the Grenadines</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep WS");
-ob_end_clean();
- if ($results == 'WS')
- echo "<li><input name='formCountry[]' type='checkbox' value='WS' checked/>Samoa</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='WS' />Samoa</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SM");
-ob_end_clean();
- if ($results == 'SM')
- echo "<li><input name='formCountry[]' type='checkbox' value='SM' checked/>San Marino</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SM' />San Marino</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep ST");
-ob_end_clean();
- if ($results == 'ST')
- echo "<li><input name='formCountry[]' type='checkbox' value='ST' checked/>Sao Tome and Principe</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='ST' />Sao Tome and Principe</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SA");
-ob_end_clean();
- if ($results == 'SA')
- echo "<li><input name='formCountry[]' type='checkbox' value='SA' checked/>Saudi Arabia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SA' />Saudi Arabia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SN");
-ob_end_clean();
- if ($results == 'SN')
- echo "<li><input name='formCountry[]' type='checkbox' value='SN' checked/>Senegal</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SN' />Senegal</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep RS");
-ob_end_clean();
- if ($results == 'RS')
- echo "<li><input name='formCountry[]' type='checkbox' value='RS' checked/>Serbia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='RS' />Serbia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SC");
-ob_end_clean();
- if ($results == 'SC')
- echo "<li><input name='formCountry[]' type='checkbox' value='SC' checked/>Seychelles</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SC' />Seychelles</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SL");
-ob_end_clean();
- if ($results == 'SL')
- echo "<li><input name='formCountry[]' type='checkbox' value='SL' checked/>Sierra Leone</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SL' />Sierra Leone</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SG");
-ob_end_clean();
- if ($results == 'SG')
- echo "<li><input name='formCountry[]' type='checkbox' value='SG' checked/>Singapore</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SG' />Singapore</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SX");
-ob_end_clean();
- if ($results == 'SX')
- echo "<li><input name='formCountry[]' type='checkbox' value='SX' checked/>Sint Maarten</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SX' />Sint Maarten</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SK");
-ob_end_clean();
- if ($results == 'SK')
- echo "<li><input name='formCountry[]' type='checkbox' value='SK' checked/>Slovakia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SK' />Slovakia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SI");
-ob_end_clean();
- if ($results == 'SI')
- echo "<li><input name='formCountry[]' type='checkbox' value='SI' checked/>Slovenia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SI' />Slovenia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SB");
-ob_end_clean();
- if ($results == 'SB')
- echo "<li><input name='formCountry[]' type='checkbox' value='SB' checked/>Solomon Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SB' />Solomon Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SO");
-ob_end_clean();
- if ($results == 'SO')
- echo "<li><input name='formCountry[]' type='checkbox' value='SO' checked/>Somalia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SO' />Somalia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep ZA");
-ob_end_clean();
- if ($results == 'ZA')
- echo "<li><input name='formCountry[]' type='checkbox' value='ZA' checked/>South Africa</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='ZA' />South Africa</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GS");
-ob_end_clean();
- if ($results == 'GS')
- echo "<li><input name='formCountry[]' type='checkbox' value='GS' checked/>South Georgia and the South Sandwich Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GS' />South Georgia and the South Sandwich Islands</li>";
-
-//ob_start();
-//$results = exec("cat countries.txt | grep XX");
-//ob_end_clean();
-// if ($results == 'XX')
-// echo " <li><input name='formCountry[]' type='checkbox' value='South_Korea' checked/>South Korea</li>";
-// else
-// echo " <li><input name='formCountry[]' type='checkbox' value='South_Korea' />South Korea</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep ES");
-ob_end_clean();
- if ($results == 'ES')
- echo "<li><input name='formCountry[]' type='checkbox' value='ES' checked/>Spain</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='ES' />Spain</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep LK");
-ob_end_clean();
- if ($results == 'LK')
- echo "<li><input name='formCountry[]' type='checkbox' value='LK' checked/>Sri Lanka</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='LK' />Sri Lanka</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SD");
-ob_end_clean();
- if ($results == 'SD')
- echo "<li><input name='formCountry[]' type='checkbox' value='SD' checked/>Sudan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SD' />Sudan</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SR");
-ob_end_clean();
- if ($results == 'SR')
- echo "<li><input name='formCountry[]' type='checkbox' value='SR' checked/>Suriname</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SR' />Suriname</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SJ");
-ob_end_clean();
- if ($results == 'SJ')
- echo "<li><input name='formCountry[]' type='checkbox' value='SJ' checked/>Svalbard and Jan Mayen</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SJ' />Svalbard and Jan Mayen</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SZ");
-ob_end_clean();
- if ($results == 'SZ')
- echo "<li><input name='formCountry[]' type='checkbox' value='SZ' checked/>Swaziland</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SZ' />Swaziland</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SE");
-ob_end_clean();
- if ($results == 'SE')
- echo "<li><input name='formCountry[]' type='checkbox' value='SE' checked/>Sweden</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SE' />Sweden</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep CH");
-ob_end_clean();
- if ($results == 'CH')
- echo "<li><input name='formCountry[]' type='checkbox' value='CH' checked/>Switzerland</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='CH' />Switzerland</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep SY");
-ob_end_clean();
- if ($results == 'SY')
- echo "<li><input name='formCountry[]' type='checkbox' value='SY' checked/>Syria</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='SY' />Syria</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">T&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep TW");
-ob_end_clean();
- if ($results == 'TW')
- echo "<li><input name='formCountry[]' type='checkbox' value='TW' checked/>Taiwan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TW' />Taiwan</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TJ");
-ob_end_clean();
- if ($results == 'TJ')
- echo "<li><input name='formCountry[]' type='checkbox' value='TJ' checked/>Tajikistan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TJ' />Tajikistan</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TZ");
-ob_end_clean();
- if ($results == 'TZ')
- echo "<li><input name='formCountry[]' type='checkbox' value='TZ' checked/>Tanzania</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TZ' />Tanzania</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TH");
-ob_end_clean();
- if ($results == 'TH')
- echo "<li><input name='formCountry[]' type='checkbox' value='TH' checked/>Thailand</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TH' />Thailand</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TL");
-ob_end_clean();
- if ($results == 'TL')
- echo "<li><input name='formCountry[]' type='checkbox' value='TL' checked/>Timor-Leste</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TL' />Timor-Leste</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TG");
-ob_end_clean();
- if ($results == 'TG')
- echo "<li><input name='formCountry[]' type='checkbox' value='TG' checked/>Togo</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TG' />Togo</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TK");
-ob_end_clean();
- if ($results == 'TK')
- echo "<li><input name='formCountry[]' type='checkbox' value='TK' checked/>Tokelau</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TK' />Tokelau</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TO");
-ob_end_clean();
- if ($results == 'TO')
- echo "<li><input name='formCountry[]' type='checkbox' value='TO' checked/>Tonga</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TO' />Tonga</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TT");
-ob_end_clean();
- if ($results == 'TT')
- echo "<li><input name='formCountry[]' type='checkbox' value='TT' checked/>Trinidad and Tobago</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TT' />Trinidad and Tobago</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TN");
-ob_end_clean();
- if ($results == 'TN')
- echo "<li><input name='formCountry[]' type='checkbox' value='TN' checked/>Tunisia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TN' />Tunisia</li>";
-
-//ob_start();
-//$results = exec("cat countries.txt | grep TR");
-//ob_end_clean();
-// if ($results == 'TR')
-// echo "<li><input name='formCountry[]' type='checkbox' value='TR' checked/>Turkey</li>";
-// else
-// echo "<li><input name='formCountry[]' type='checkbox' value='TR' />Turkey</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TM");
-ob_end_clean();
-
- if ($results == 'TM')
- echo "<li><input name='formCountry[]' type='checkbox' value='TM' checked/>Turkmenistan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TM' />Turkmenistan</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TC");
-ob_end_clean();
- if ($results == 'TC')
- echo "<li><input name='formCountry[]' type='checkbox' value='TC' checked/>Turks and Caicos Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TC' />Turks and Caicos Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep TV");
-ob_end_clean();
- if ($results == 'TV')
- echo "<li><input name='formCountry[]' type='checkbox' value='TV' checked/>Tuvalu</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='TV' />Tuvalu</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">U&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep UG");
-ob_end_clean();
- if ($results == 'UG')
- echo "<li><input name='formCountry[]' type='checkbox' value='UG' checked/>Uganda</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='UG' />Uganda</li>";
-
-//ob_start();
-//$results = exec("cat countries.txt | grep UA");
-//ob_end_clean();
-// if ($results == 'UA')
-// echo "<li><input name='formCountry[]' type='checkbox' value='UA' checked/>Ukraine</li>";
-// else
-// echo "<li><input name='formCountry[]' type='checkbox' value='UA' />Ukraine</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep AE");
-ob_end_clean();
- if ($results == 'AE')
- echo "<li><input name='formCountry[]' type='checkbox' value='AE' checked/>United Arab Emirates</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='AE' />United Arab Emirates</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep GB");
-ob_end_clean();
- if ($results == 'GB')
- echo "<li><input name='formCountry[]' type='checkbox' value='GB' checked/>United Kingdom</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='GB' />United Kingdom</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep US");
-ob_end_clean();
- if ($results == 'US')
- echo "<li><input name='formCountry[]' type='checkbox' value='US' checked/>United States</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='US' />United States</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep UM");
-ob_end_clean();
- if ($results == 'UM')
- echo "<li><input name='formCountry[]' type='checkbox' value='UM' checked/>United States Minor Outlying Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='UM' />United States Minor Outlying Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep UY");
-ob_end_clean();
- if ($results == 'UY')
- echo "<li><input name='formCountry[]' type='checkbox' value='UY' checked/>Uruguay</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='UY' />Uruguay</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep UZ");
-ob_end_clean();
- if ($results == 'UZ')
- echo "<li><input name='formCountry[]' type='checkbox' value='UZ' checked/>Uzbekistan</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='UZ' />Uzbekistan</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">V&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep VU");
-ob_end_clean();
- if ($results == 'VU')
- echo "<li><input name='formCountry[]' type='checkbox' value='VU' checked/>Vanuatu</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='VU' />Vanuatu</li>";
-
-//ob_start();
-//$results = exec("cat countries.txt | grep VE");
-//ob_end_clean();
-// if ($results == 'VE')
-// echo "<li><input name='formCountry[]' type='checkbox' value='VE' checked/>Venezuela</li>";
-// else
-// echo "<li><input name='formCountry[]' type='checkbox' value='VE' />Venezuela</li>";
-
-//ob_start();
-//$results = exec("cat countries.txt | grep VN");
-//ob_end_clean();
-// if ($results == 'VN')
-// echo "<li><input name='formCountry[]' type='checkbox' value='VN' checked/>Vietnam</li>";
-// else
-// echo "<li><input name='formCountry[]' type='checkbox' value='VN' />Vietnam</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep VG");
-ob_end_clean();
- if ($results == 'VG')
- echo "<li><input name='formCountry[]' type='checkbox' value='VG' checked/>Virgin Islands, British</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='VG' />Virgin Islands, British</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep VI");
-ob_end_clean();
- if ($results == 'VI')
- echo "<li><input name='formCountry[]' type='checkbox' value='VI' checked/>Virgin Islands, U.S.</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='VI' />Virgin Islands, U.S.</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">W&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep WF");
-ob_end_clean();
- if ($results == 'WF')
- echo "<li><input name='formCountry[]' type='checkbox' value='WF' checked/>Wallis and Futuna Islands</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='WF' />Wallis and Futuna Islands</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep EH");
-ob_end_clean();
- if ($results == 'EH')
- echo "<li><input name='formCountry[]' type='checkbox' value='EH' checked/>Western Sahara</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='EH' />Western Sahara</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">X&#39;s</h3>
-<ul class="categoryitems">
-<li>&lt;insert easter egg&gt;</li>
-
-</ul>
-
-<h3 class="menuheader expandable">Y&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep YE");
-ob_end_clean();
- if ($results == 'YE')
- echo "<li><input name='formCountry[]' type='checkbox' value='YE' checked/>Yemen</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='YE' />Yemen</li>";
-
-//ob_start();
-//$results = exec("cat countries.txt | grep XX");
-//ob_end_clean();
-// if ($results == 'XX')
-// echo "<li><input name='formCountry[]' type='checkbox' value='Yugoslavia' checked/>Yugoslavia</li>";
-// else
-// echo "<li><input name='formCountry[]' type='checkbox' value='Yugoslavia' />Yugoslavia</li>";
-
-?>
-</ul>
-
-<h3 class="menuheader expandable">Z&#39;s</h3>
-<ul class="categoryitems">
-<?php
-ob_start();
-$results = exec("cat countries.txt | grep ZM");
-ob_end_clean();
- if ($results == 'ZM')
- echo "<li><input name='formCountry[]' type='checkbox' value='ZM' checked/>Zambia</li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='ZM' />Zambia</li>";
-
-ob_start();
-$results = exec("cat countries.txt | grep ZW");
-ob_end_clean();
- if ($results == 'ZW')
- echo "<li><input name='formCountry[]' type='checkbox' value='ZW' checked/>Zimbabwe </li>";
- else
- echo "<li><input name='formCountry[]' type='checkbox' value='ZW' />Zimbabwe </li>";
-
-?>
-
-</ul>
-
-
-<div>
-</div>
-
-</div>
-</td>
- </tr>
-</table>
-
-
-
- <br/><br/>
- <input type="submit" name="formSubmit" value="Commit Countries" />
- </p>
-</form>
-<br/>
-
-
-
-
-</div>
-<?php
- //This input guarantees that a POST is sent
- echo "<input type='hidden' name='zzz' value='required'>";
-?>
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-</div>
-<br>
-<?php
- echo "Current Status = ";
- ob_start();
- $results = exec("pfctl -s rules | grep -c countryblock");
- ob_end_clean();
- if ($results > '0') echo "Running";
- else
- echo "<span style='color:red'>NOT running</span>";
-
- //Get Errors if exists
- ob_start();
- $results = exec("tail -r errorOUT.txt");
- ob_end_clean();
- echo "<br/><span style='color:red'>";
- echo $results;
- echo "</span>";
-
- //Get IP Count
- echo "<br>You are blocking ";
- ob_start();
- $results = exec("pfctl -T show -t countryblock |grep -v -c Z");
- ob_end_clean();
- echo $results;
- echo " Networks";
- ?>
-<br><br>
-<input type="submit" value="Save/Update"><br><br>
-<p>
-<small>Lists provided by <a href="http://www.countryipblocks.net/">countryipblocks.net</a></small>
-<br /><small>Created by <a href="http://www.tomschaefer.org/pfsense">TomSchaefer</a></small>
-</p>
-</td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/countryblock/countryblock.xml b/config/countryblock/countryblock.xml
deleted file mode 100644
index b7336e98..00000000
--- a/config/countryblock/countryblock.xml
+++ /dev/null
@@ -1,200 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- countryblock.xml
- Copyright (C) 2012 Tom Schaefer
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Country Block</description>
- <requirements>Active Internet</requirements>
- <faq>https://forum.pfsense.org/index.php/topic,25732.0.html</faq>
- <name>Country Block Settings</name>
- <version>0.2.4</version>
- <title>Settings</title>
- <include_file>/usr/local/pkg/countryblock.inc</include_file>
- <menu>
- <name>Country Block</name>
- <tooltiptext>Country Block settings</tooltiptext>
- <section>Firewall</section>
- <configfile>countryblock.xml</configfile>
- <url>/packages/countryblock/countryblock.php</url>
- </menu>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/packages/countryblock/countryblock.php</url>
- <active/>
- </tab>
- </tabs>
- <configpath>installedpackages->package->$packagename->configuration->countryblock</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/countryblock.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/countryblock.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/interfaces.txt</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/countryblock.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/execute.sh</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/countryblock.sh</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/index.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/ddaccordion.js</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/jquery.min.js</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/public_smo_scripts.js</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/titlebar.png</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/titlebar-active.png</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/purge.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/whitelist.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/countryblock_if.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/firewall_shaper.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/help.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/settings.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/class.phpmailer.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/class.smtp.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/email.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/countryblock/countryblock_IPBlocklist.widget.tmp</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Variable One</fielddescr>
- <fieldname>var1</fieldname>
- <description>Enter the variable one here.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Variable Two</fielddescr>
- <fieldname>var1</fieldname>
- <description>Enter the variable one here.</description>
- <type>input</type>
- </field>
- </fields>
- <custom_add_php_command>
- </custom_add_php_command>
- <custom_php_resync_config_command>
- php_sync_package_cb();
- </custom_php_resync_config_command>
- <custom_delete_php_command>
- php_sync_package_cb();
- </custom_delete_php_command>
- <custom_php_install_command>
- php_install_command_cb();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- deinstall_command_cb();
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/countryblock/countryblock_IPBlocklist.widget.tmp b/config/countryblock/countryblock_IPBlocklist.widget.tmp
deleted file mode 100644
index 59911f5a..00000000
--- a/config/countryblock/countryblock_IPBlocklist.widget.tmp
+++ /dev/null
@@ -1,116 +0,0 @@
-<?php
-/*
- Copyright 2012 Thomas Schaefer - Tomschaefer.org
- Part of pfSense widgets (www.pfsense.org)
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$nocsrf = true;
-
-@require_once("guiconfig.inc");
-@require_once("pfsense-utils.inc");
-@require_once("functions.inc");
-
-$ipblocklist_file = "/usr/local/www/packages/ipblocklist/ipblocklist.php";
-$countryblock_file = "/usr/local/www/packages/countryblock/countryblock.php";
-
-echo "<table style=\"padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"";
-echo" <tr>";
-if (file_exists($ipblocklist_file)) {
- echo " <td class=\"listhdrr\">IP-Blocklist";
- ob_start();
- $results = exec("/sbin/pfctl -s rules | grep -c ipblocklist");
- ob_end_clean();
- if ($results > '2') echo "<img src ='/themes/{$g['theme']}/images/icons/icon_interface_up.gif'>";
- else
- echo "<img src ='/themes/{$g['theme']}/images/icons/icon_interface_down.gif'>";
- echo "</td>";
-}
-if (file_exists($countryblock_file)) {
- echo " <td class=\"listhdrr\">Countryblock";
- ob_start();
- $results = exec("/sbin/pfctl -s rules | grep -c countryblock");
- ob_end_clean();
- if ($results > '0') echo "<img src ='/themes/{$g['theme']}/images/icons/icon_interface_up.gif'>";
- else
- echo "<img src ='/themes/{$g['theme']}/images/icons/icon_interface_down.gif'>";
- echo "</td>";
-}
-echo" </tr>";
-echo" <tr>";
-if (file_exists($ipblocklist_file)) {
- echo " <td class=\"listlr\">";
- ob_start();
- $resultsIP = exec("/sbin/pfctl -T show -t ipblocklist |grep -v -c Z");
- ob_end_clean();
- echo $resultsIP;
- echo " Networks";
- echo "</td>";
-}
-if (file_exists($countryblock_file)) {
- echo " <td class=\"listr\">";
- ob_start();
- $resultsCB = exec("pfctl -T show -t countryblock |grep -v -c Z");
- ob_end_clean();
- echo $resultsCB;
- echo " Networks";
- echo "</td>";
-}
-echo" </tr>";
-echo" <tr>";
-if (file_exists($ipblocklist_file)) {
- ob_start();
- $resultsIP = exec("tail -r /usr/local/www/packages/ipblocklist/errorOUT.txt");
- ob_end_clean();
- if ($resultsIP == "") {
- echo " <td></td>";
- } else {
- echo " <td class=\"listlr\">";
- echo "<br/><span style='color:red'>";
- echo $resultsIP;
- echo "</span>";
- echo "</td>";
- }
-}
-if (file_exists($countryblock_file)) {
- ob_start();
- $resultsCB = exec("tail -r /usr/local/www/packages/countryblock/errorOUT.txt");
- ob_end_clean();
- if ($resultsCB == "") {
- echo " <td></td>";
- } else {
- echo " <td class=\"listlr\">";
- echo "<br/><span style='color:red'>";
- echo $resultsCB;
- echo "</span>";
- echo "</td>";
- }
-}
-echo" </tr>";
-//echo" <tr>";
-//if (file_exists($ipblocklist_file)) echo " <td>&nbsp;</td>";
-//if (file_exists($countryblock_file)) echo " <td>&nbsp;</td>";
-//echo" </tr>";
-echo"</table>";
-
-?>
diff --git a/config/countryblock/countryblock_if.tmp b/config/countryblock/countryblock_if.tmp
deleted file mode 100644
index 65b80992..00000000
--- a/config/countryblock/countryblock_if.tmp
+++ /dev/null
@@ -1,206 +0,0 @@
-<?php
-/*
- interfaces_assign.php
- part of m0n0wall (http://m0n0.ch/wall)
- Written by Jim McBeath based on existing m0n0wall files
-
- Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = "Firewall: Countryblock - Interfaces";
-require("guiconfig.inc");
-
-/*
- In this file, "port" refers to the physical port name,
- while "interface" refers to LAN, WAN, or OPTn.
-*/
-
-/* get list without VLAN interfaces */
-$portlist = get_interface_list();
-
-/* add VLAN interfaces */
-if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) {
- $i = 0;
- foreach ($config['vlans']['vlan'] as $vlan) {
- $portlist['vlan' . $i] = $vlan;
- $portlist['vlan' . $i]['isvlan'] = true;
- $i++;
- }
-}
-
-if ($_POST) {
-
- unset($input_errors);
-
- /* input validation */
-
- /* Build a list of the port names so we can see how the interfaces map */
- $portifmap = array();
- foreach ($portlist as $portname => $portinfo)
- $portifmap[$portname] = array();
-
- /* Go through the list of ports selected by the user,
- build a list of port-to-interface mappings in portifmap */
- conf_mount_rw();
- $myFile = "interfaces.txt";
- $fh = fopen($myFile, 'w+');
-
- foreach ($_POST as $ifname => $ifport) {
- //echo $ifname;
- //echo "<br>";
- fwrite($fh, $ifname . "\n");
- //if (($ifname == 'lan') || ($ifname == 'wan') || (substr($ifname, 0, 3) == 'opt'))
- //$portifmap[$ifport][] = strtoupper($ifname);
- }
-
- conf_mount_ro();
-
-
- if (!$input_errors) {
- /* No errors detected, so update the config */
- foreach ($_POST as $ifname => $ifport) {
-
- if (($ifname == 'lan') || ($ifname == 'wan') ||
- (substr($ifname, 0, 3) == 'opt')) {
-
-
- }
- }
-
- $savemsg = get_std_save_message($retval);
-
-
-
- }
-}
-
-
-
-
-
-
-include("head.inc");
-
-
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box("Interfaces selected - Click <a href='countryblock.php'>Here</a> to go back"); ?>
-<form action="" method="post" name="iform" id="iform">
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("Countries", false, "countryblock.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", true, "countryblock_if.php");
- $tab_array[4] = array("Help", false, "help.php");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Interface</td>
- <td class="listhdr">Selected</td>
- <td class="list">&nbsp;</td>
- </tr>
- <?php foreach ($config['interfaces'] as $ifname => $iface):
- if ($iface['descr'])
- $ifdescr = $iface['descr'];
- else
- $ifdescr = strtoupper($ifname);
- ?>
- <tr>
- <td class="listlr" valign="middle"><strong><?=$ifdescr;?></strong></td>
- <td valign="middle" class="listr">
-
-
- <!---<input name='<?=$ifname;?>' type='checkbox' value='<?=$ifname;?>' checked/>- <?=$ifname;?>--->
-
- <?php foreach ($portlist as $portname => $portinfo): ?>
-
- <?php if ($portname == $iface['if']) {
-
- ob_start();
- $resultsany = exec("cat interfaces.txt | grep any");
- $results = exec("cat interfaces.txt | grep $portname");
- ob_end_clean();
-
- if ($results == $portname || $resultsany == any)
- echo "<input name='$portname' type='checkbox' value='$portname' checked/>$portname";
- else
- echo "<input name='$portname' type='checkbox' value='$portname' />$portname";
- }
- ?>
- <?php endforeach; ?>
-
- </td>
- <td valign="middle" class="list">
-
- </td>
- </tr>
- <?php endforeach; ?>
-
- <tr>
- <td class="list" colspan="3" height="10"></td>
- </tr>
-
-</table>
-</div>
- <p><br>
- <input type="submit" class="formbtn" value="Save">
- </p>
- <p>Select the interfaces you want secured. It's recommended to select all interfaces. </p>
- <p>Default: All interfaces are seleted. <br>
- <br>
- </p>
- <p></p></td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-
-
-</body>
-</html>
-
-<?php
-conf_mount_rw();
- if ($_POST) {
- if (!$input_errors)
- touch("interfaces.txt");
-
- }
- conf_mount_ro();
-?>
diff --git a/config/countryblock/ddaccordion.js b/config/countryblock/ddaccordion.js
deleted file mode 100644
index f5fd441c..00000000
--- a/config/countryblock/ddaccordion.js
+++ /dev/null
@@ -1,209 +0,0 @@
-//** Accordion Content script: By Dynamic Drive, at http://www.dynamicdrive.com
-//** Created: Jan 7th, 08'
-
-//Version 1.3: April 3rd, 08':
-//**1) Script now no longer conflicts with other JS frameworks
-//**2) Adds custom oninit() and onopenclose() event handlers that fire when Accordion Content instance has initialized, plus whenever a header is opened/closed
-//**3) Adds support for expanding header(s) using the URL parameter (ie: http://mysite.com/accordion.htm?headerclass=0,1)
-
-//April 9th, 08': Fixed "defaultexpanded" setting not working when page first loads
-
-//Version 1.4: June 4th, 08':
-//**1) Added option to activate a header "mouseover" instead of the default "click"
-//**2) Bug persistence not working when used with jquery 1.2.6
-
-//Version 1.5: June 20th, 08':
-//**1) Adds new "onemustopen:true/false" parameter, which lets you set whether at least one header should be open at all times (so never all closed).
-//**2) Changed cookie path to site wide for persistence feature
-//**3) Fixed bug so "expandedindices" parameter in oninit(headers, expandedindices) returns empty array [] instead of [-1] when no expanded headers found
-
-//**1) Version 1.5.1: June 27th, 08': Fixed "defaultexpanded" setting not working properly when used with jquery 1.2.6
-
-//Version 1.6: Oct 3rd, 08':
-//**1) Adds new "mouseoverdelay" param that sets delay before headers are activated when "revealtype" param is set to "mouseover"
-//**2) Fixed bug with "onemustopen" param not working properly when "revealtype" is set to "click"
-
-//Version 1.7: March 24th, 09': Adds a 3rd revealtype setting "clickgo", which causes browser to navigate to URL specified inside the header after expanding its contents.
-
-//Version 1.7.1: May 28th, 09': Fixed issue that causes margins/paddings in accordion DIVs to be lost in IE8
-
-
-var ddaccordion={
-
- contentclassname:{}, //object to store corresponding contentclass name based on headerclass
-
- expandone:function(headerclass, selected){ //PUBLIC function to expand a particular header
- this.toggleone(headerclass, selected, "expand")
- },
-
- collapseone:function(headerclass, selected){ //PUBLIC function to collapse a particular header
- this.toggleone(headerclass, selected, "collapse")
- },
-
- expandall:function(headerclass){ //PUBLIC function to expand all headers based on their shared CSS classname
- var $=jQuery
- var $headers=$('.'+headerclass)
- $('.'+this.contentclassname[headerclass]+':hidden').each(function(){
- $headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")
- })
- },
-
- collapseall:function(headerclass){ //PUBLIC function to collapse all headers based on their shared CSS classname
- var $=jQuery
- var $headers=$('.'+headerclass)
- $('.'+this.contentclassname[headerclass]+':visible').each(function(){
- $headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")
- })
- },
-
- toggleone:function(headerclass, selected, optstate){ //PUBLIC function to expand/ collapse a particular header
- var $=jQuery
- var $targetHeader=$('.'+headerclass).eq(selected)
- var $subcontent=$('.'+this.contentclassname[headerclass]).eq(selected)
- if (typeof optstate=="undefined" || optstate=="expand" && $subcontent.is(":hidden") || optstate=="collapse" && $subcontent.is(":visible"))
- $targetHeader.trigger("evt_accordion")
- },
-
- expandit:function($targetHeader, $targetContent, config, useractivated, directclick){
- this.transformHeader($targetHeader, config, "expand")
- $targetContent.slideDown(config.animatespeed, function(){
- config.onopenclose($targetHeader.get(0), parseInt($targetHeader.attr('headerindex')), $targetContent.css('display'), useractivated)
- if (config.postreveal=="gotourl" && directclick){ //if revealtype is "Go to Header URL upon click", and this is a direct click on the header
- var targetLink=($targetHeader.is("a"))? $targetHeader.get(0) : $targetHeader.find('a:eq(0)').get(0)
- if (targetLink) //if this header is a link
- setTimeout(function(){location=targetLink.href}, 200) //ignore link target, as window.open(targetLink, targetLink.target) doesn't work in FF if popup blocker enabled
- }
- })
- },
-
- collapseit:function($targetHeader, $targetContent, config, isuseractivated){
- this.transformHeader($targetHeader, config, "collapse")
- $targetContent.slideUp(config.animatespeed, function(){config.onopenclose($targetHeader.get(0), parseInt($targetHeader.attr('headerindex')), $targetContent.css('display'), isuseractivated)})
- },
-
- transformHeader:function($targetHeader, config, state){
- $targetHeader.addClass((state=="expand")? config.cssclass.expand : config.cssclass.collapse) //alternate btw "expand" and "collapse" CSS classes
- .removeClass((state=="expand")? config.cssclass.collapse : config.cssclass.expand)
- if (config.htmlsetting.location=='src'){ //Change header image (assuming header is an image)?
- $targetHeader=($targetHeader.is("img"))? $targetHeader : $targetHeader.find('img').eq(0) //Set target to either header itself, or first image within header
- $targetHeader.attr('src', (state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse) //change header image
- }
- else if (config.htmlsetting.location=="prefix") //if change "prefix" HTML, locate dynamically added ".accordprefix" span tag and change it
- $targetHeader.find('.accordprefix').html((state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse)
- else if (config.htmlsetting.location=="suffix")
- $targetHeader.find('.accordsuffix').html((state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse)
- },
-
- urlparamselect:function(headerclass){
- var result=window.location.search.match(new RegExp(headerclass+"=((\\d+)(,(\\d+))*)", "i")) //check for "?headerclass=2,3,4" in URL
- if (result!=null)
- result=RegExp.$1.split(',')
- return result //returns null, [index], or [index1,index2,etc], where index are the desired selected header indices
- },
-
- getCookie:function(Name){
- var re=new RegExp(Name+"=[^;]+", "i") //construct RE to search for target name/value pair
- if (document.cookie.match(re)) //if cookie found
- return document.cookie.match(re)[0].split("=")[1] //return its value
- return null
- },
-
- setCookie:function(name, value){
- document.cookie = name + "=" + value + "; path=/"
- },
-
- init:function(config){
- document.write('<style type="text/css">\n')
- document.write('.'+config.contentclass+'{display: none}\n') //generate CSS to hide contents
- document.write('<\/style>')
- jQuery(document).ready(function($){
- ddaccordion.urlparamselect(config.headerclass)
- var persistedheaders=ddaccordion.getCookie(config.headerclass)
- ddaccordion.contentclassname[config.headerclass]=config.contentclass //remember contentclass name based on headerclass
- config.cssclass={collapse: config.toggleclass[0], expand: config.toggleclass[1]} //store expand and contract CSS classes as object properties
- config.revealtype=config.revealtype || "click"
- config.revealtype=config.revealtype.replace(/mouseover/i, "mouseenter")
- if (config.revealtype=="clickgo"){
- config.postreveal="gotourl" //remember added action
- config.revealtype="click" //overwrite revealtype to "click" keyword
- }
- if (typeof config.togglehtml=="undefined")
- config.htmlsetting={location: "none"}
- else
- config.htmlsetting={location: config.togglehtml[0], collapse: config.togglehtml[1], expand: config.togglehtml[2]} //store HTML settings as object properties
- config.oninit=(typeof config.oninit=="undefined")? function(){} : config.oninit //attach custom "oninit" event handler
- config.onopenclose=(typeof config.onopenclose=="undefined")? function(){} : config.onopenclose //attach custom "onopenclose" event handler
- var lastexpanded={} //object to hold reference to last expanded header and content (jquery objects)
- var expandedindices=ddaccordion.urlparamselect(config.headerclass) || ((config.persiststate && persistedheaders!=null)? persistedheaders : config.defaultexpanded)
- if (typeof expandedindices=='string') //test for string value (exception is config.defaultexpanded, which is an array)
- expandedindices=expandedindices.replace(/c/ig, '').split(',') //transform string value to an array (ie: "c1,c2,c3" becomes [1,2,3]
- var $subcontents=$('.'+config["contentclass"])
- if (expandedindices.length==1 && expandedindices[0]=="-1") //check for expandedindices value of [-1], indicating persistence is on and no content expanded
- expandedindices=[]
- if (config["collapseprev"] && expandedindices.length>1) //only allow one content open?
- expandedindices=[expandedindices.pop()] //return last array element as an array (for sake of jQuery.inArray())
- if (config["onemustopen"] && expandedindices.length==0) //if at least one content should be open at all times and none are, open 1st header
- expandedindices=[0]
- $('.'+config["headerclass"]).each(function(index){ //loop through all headers
- if (/(prefix)|(suffix)/i.test(config.htmlsetting.location) && $(this).html()!=""){ //add a SPAN element to header depending on user setting and if header is a container tag
- $('<span class="accordprefix"></span>').prependTo(this)
- $('<span class="accordsuffix"></span>').appendTo(this)
- }
- $(this).attr('headerindex', index+'h') //store position of this header relative to its peers
- $subcontents.eq(index).attr('contentindex', index+'c') //store position of this content relative to its peers
- var $subcontent=$subcontents.eq(index)
- var needle=(typeof expandedindices[0]=="number")? index : index+'' //check for data type within expandedindices array- index should match that type
- if (jQuery.inArray(needle, expandedindices)!=-1){ //check for headers that should be expanded automatically (convert index to string first)
- if (config.animatedefault==false)
- $subcontent.show()
- ddaccordion.expandit($(this), $subcontent, config, false) //Last param sets 'isuseractivated' parameter
- lastexpanded={$header:$(this), $content:$subcontent}
- } //end check
- else{
- $subcontent.hide()
- config.onopenclose($(this).get(0), parseInt($(this).attr('headerindex')), $subcontent.css('display'), false) //Last Boolean value sets 'isuseractivated' parameter
- ddaccordion.transformHeader($(this), config, "collapse")
- }
- })
- $('.'+config["headerclass"]).bind("evt_accordion", function(e, isdirectclick){ //assign custom event handler that expands/ contacts a header
- var $subcontent=$subcontents.eq(parseInt($(this).attr('headerindex'))) //get subcontent that should be expanded/collapsed
- if ($subcontent.css('display')=="none"){
- ddaccordion.expandit($(this), $subcontent, config, true, isdirectclick) //2nd last param sets 'isuseractivated' parameter
- if (config["collapseprev"] && lastexpanded.$header && $(this).get(0)!=lastexpanded.$header.get(0)){ //collapse previous content?
- ddaccordion.collapseit(lastexpanded.$header, lastexpanded.$content, config, true) //Last Boolean value sets 'isuseractivated' parameter
- }
- lastexpanded={$header:$(this), $content:$subcontent}
- }
- else if (!config["onemustopen"] || config["onemustopen"] && lastexpanded.$header && $(this).get(0)!=lastexpanded.$header.get(0)){
- ddaccordion.collapseit($(this), $subcontent, config, true) //Last Boolean value sets 'isuseractivated' parameter
- }
- })
- $('.'+config["headerclass"]).bind(config.revealtype, function(){
- if (config.revealtype=="mouseenter"){
- clearTimeout(config.revealdelay)
- var headerindex=parseInt($(this).attr("headerindex"))
- config.revealdelay=setTimeout(function(){ddaccordion.expandone(config["headerclass"], headerindex)}, config.mouseoverdelay || 0)
- }
- else{
- $(this).trigger("evt_accordion", [true])
- return false //cancel default click behavior
- }
- })
- $('.'+config["headerclass"]).bind("mouseleave", function(){
- clearTimeout(config.revealdelay)
- })
- config.oninit($('.'+config["headerclass"]).get(), expandedindices)
- $(window).bind('unload', function(){ //clean up and persist on page unload
- $('.'+config["headerclass"]).unbind()
- var expandedindices=[]
- $('.'+config["contentclass"]+":visible").each(function(index){ //get indices of expanded headers
- expandedindices.push($(this).attr('contentindex'))
- })
- if (config.persiststate==true && $('.'+config["headerclass"]).length>0){ //persist state?
- expandedindices=(expandedindices.length==0)? '-1c' : expandedindices //No contents expanded, indicate that with dummy '-1c' value?
- ddaccordion.setCookie(config.headerclass, expandedindices)
- }
- })
- })
- }
-} \ No newline at end of file
diff --git a/config/countryblock/email.tmp b/config/countryblock/email.tmp
deleted file mode 100644
index e5ac6c18..00000000
--- a/config/countryblock/email.tmp
+++ /dev/null
@@ -1,291 +0,0 @@
-<?php
-
-$pgtitle = "Firewall: Countryblock - Email";
-
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/countryblock/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-
-if (isset($_GET['save'])) {
- exec("rm email_send.php");
- exec("touch email_send.php");
- $file = "email_send.php";
- $smtp_auth = $_POST['smtp_auth'];
- $smtp_secure = $_POST['smtp_secure'];
- $host = $_POST['host'];
- $port = $_POST['port'];
- $user = $_POST['user'];
- $pass = $_POST['pass'];
- $html = $_POST['html'];
- $from = $_POST['from'];
- $to = $_POST['to'];
- $subject = $_POST['subject'];
- $fp = fopen($file, "w") or die("Couldn't open $file for writing!");
- fwrite($fp, "<?php\ninclude(\"class.phpmailer.php\");\n\$mail = new PHPMailer();
-\n\$mail->IsSMTP();\n\$mail->SMTPAuth = ") or die("Couldn't write values to file!");
- fwrite($fp, $smtp_auth) or die("Couldn't write values to file!");
- fwrite($fp, ";\n\$mail->SMTPSecure = \"") or die("Couldn't write values to file!");
- fwrite($fp, $smtp_secure) or die("Couldn't write values to file!");
- fwrite($fp, "\";\n\$mail->Host = \"") or die("Couldn't write values to file!");
- fwrite($fp, $host) or die("Couldn't write values to file!");
- fwrite($fp, "\";\n\$mail->Port = ") or die("Couldn't write values to file!");
- fwrite($fp, $port) or die("Couldn't write values to file!");
- fwrite($fp, ";\n\$mail->Username = \"") or die("Couldn't write values to file!");
- fwrite($fp, $user) or die("Couldn't write values to file!");
- fwrite($fp, "\";\n\$mail->Password = \"") or die("Couldn't write values to file!");
- fwrite($fp, $pass);
- fwrite($fp, "\";\n\$mail->AddReplyTo(\"") or die("Couldn't write values to file!");
- fwrite($fp, $from) or die("Couldn't write values to file!");
- fwrite($fp, "\",\"pfsense countryblock\");\n\$mail->From = \"") or die("Couldn't write values to file!");
- fwrite($fp, $from) or die("Couldn't write values to file!");
- fwrite($fp, "\";\n\$mail->Subject = \"" . $subject . "\";\n\$mail->AltBody = \"To view the message, please use an HTML compatible email viewer!\";\n\$mail->WordWrap = 50;\n\$body = \"Countryblock encountered an event. A system log entry was made with details of event\";\n\$body .= \"<br><br>\" . date('l jS \of F Y h:i:s A') . \"<br><br>Current Status = \";\nob_start();\n\$results = exec(\"pfctl -s rules | grep -c countryblock\");\nob_end_clean();\nif (\$results > '0')\n\$body .= \"Running\";\nelse\n\$body .= \"<span style='color:red'>Restarting</span>\";\nob_start();\n\$results = exec(\"tail -r /usr/local/www/packages/countryblock/errorOUT.txt\");\nob_end_clean();\n\$body .= \"<br/><span style='color:red'>\";\n\$body .= \$results;\n\$body .= \"</span>\";\n\$body .= \"<br>You are blocking \";\nob_start();\n\$results = exec(\"pfctl -T show -t countryblock |grep -v -c Z\");\nob_end_clean();\n\$body .= \$results;\n\$body .= \" Networks\";\n\n\$mail->MsgHTML(\$body);\n\$mail->AddAddress(\"") or die("Couldn't write values to file!");
- fwrite($fp, $to) or die("Couldn't write values to file!");
- fwrite($fp, "\");\n\$mail->IsHTML(") or die("Couldn't write values to file!");
- fwrite($fp, $html) or die("Couldn't write values to file!");
- fwrite($fp, ");\n\nif(!\$mail->Send()) {\n echo \"Mailer Error: \" . \$mail->ErrorInfo;\n} else {\n echo \"Message sent! - <a href=email.php>Go Back</a>\";\n}\n?>") or die("Couldn't write values to file!");
- fclose($fp);
- //echo "Saved successfully!";
-
- exec("rm email_config.html");
- exec("touch email_config.html");
- $file2 = "email_config.html";
- $fp2 = fopen($file2, "w") or die("Couldn't open $file for writing!");
- fwrite($fp2, "<table width=\"100%\" b align=\"center\">
- <tr>
- <td>SMTP Auth</td>") or die("Couldn't write values to file!");
- if ($smtp_auth=="true")
- fwrite($fp2, "<td><select name=\"smtp_auth\"><option label=\"true\" value=\"true\" selected>Yes</option><option label=\"false\" value=\"false\">No</option></select></td>") or die("Couldn't write values to file!");
- else
- fwrite($fp2, "<td><select name=\"smtp_auth\"><option label=\"true\" value=\"true\">Yes</option><option label=\"false\" value=\"false\" selected>No</option></select></td>") or die("Couldn't write values to file!");
- fwrite($fp2, "</tr>
- <tr class=\"d0\">
- <td>SMTP Security</td>") or die("Couldn't write values to file!");
- if ($smtp_secure=="ssl")
- fwrite($fp2, "<td><select name=\"smtp_secure\"><option label=\"ssl\" value=\"ssl\" selected>ssl</option><option label=\"none\" value=\"none\">None</option></select></td>") or die("Couldn't write values to file!");
- else
- fwrite($fp2, "<td><select name=\"smtp_secure\"><option label=\"ssl\" value=\"ssl\">ssl</option><option label=\"none\" value=\"none\" selected>None</option></select></td>") or die("Couldn't write values to file!");
- fwrite($fp2, "</tr>
- <tr>
- <td>Host</td>
- <td><input type=\"text\" name=\"host\" value=\"" . $host ."\"></td>
- </tr>
- <tr class=\"d0\">
- <td>Port</td>
- <td><input type=\"port\" name=\"port\" value=\"" . $port . "\"></td>
- </tr>
- <tr>
- <td>Username</td>
- <td><input type=\"user\" name=\"user\" value=\"" . $user . "\"></td>
- </tr>
- <tr class=\"d0\">
- <td>Password</td>
- <td><input type=\"password\" name=\"pass\" value=\"" . $pass . "\"></td>
- </tr>
- <tr>
- <td>Use HTML formatting</td>") or die("Couldn't write values to file!");
- if ($html=="true")
- fwrite($fp2, "<td><select name=\"html\"><option label=\"true\" value=\"true\" selected>Yes</option><option label=\"false\" value=\"false\">No</option></select></td>") or die("Couldn't write values to file!");
- else
- fwrite($fp2, "<td><select name=\"html\"><option label=\"true\" value=\"true\">Yes</option><option label=\"false\" value=\"false\" selected>No</option></select></td>") or die("Couldn't write values to file!");
- fwrite($fp2, "</tr>
- <tr class=\"d0\">
- <td>From email address</td>
- <td><input type=\"from\" name=\"from\" value=\"" . $from . "\"></td>
- </tr>
- <tr>
- <td>To email address</td>
- <td><input type=\"to\" name=\"to\" value=\"" . $to . "\"></td>
- </tr>
- <tr class=\"d0\">
- <td>Subject</td>
- <td><input type=\"subject\" name=\"subject\" value=\"" . $subject . "\"></td>
- </tr>
-</table>
-<br>
-<input type=\"submit\" value=\"Save\">
-</form>") or die("Couldn't write values to file!");
- fclose($fp2);
-}
-if (isset($_GET['test'])) {
- echo '<script type="text/javascript">' . "\n";
- echo 'window.location="email_send.php";';
- echo '</script>';
-}
-if (isset($_GET['reset'])) {
- exec ("rm email_send.php");
- exec ("rm email_config.html");
- echo '<script type="text/javascript">' . "\n";
- echo 'window.location="email.php";';
- echo '</script>';
-}
-?>
-
-<html>
-<head>
-<style type="text/css">
-.style1 {
- text-align: center;
-}
-tr.d0 td {
- background-color: #eedddd; color: black;
-}
-</style>
-
-</head>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-
-
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("Countries", false, "countryblock.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "countryblock_if.php");
- $tab_array[4] = array("Help", false, "help.php");
- $tab_array[5] = array("Email", true, "email.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Email Settings for SMTP mail</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
-
-<form name="emailform" method="post" action="email.php?save=1">
-<?php
-if (file_exists("email_send.php")) {
- echo "<p>Your settings have already been set. Would you like to overwrite your email settings?</p>\n";
- $content = file_get_contents('email_config.html');
- echo $content;
- echo "<p>\n";
- echo "<input name=\"resetbutton\" type=\"button\" value=\"Reset email config\" onClick=\"window.location='email.php?reset=1'\" />\n";
- echo "</p>\n";
- echo "\n";
-} else {
- echo "<table width=\"100%\" b align=\"center\">\n";
- echo " <tr>\n";
- echo " <td>SMTP Auth</td>\n";
- echo " <td><select name=\"smtp_auth\"><option label=\"true\" value=\"true\">Yes</option><option label=\"false\" value=\"false\">No</option></select></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>SMTP Security</td>\n";
- echo " <td><select name=\"smtp_secure\"><option label=\"ssl\" value=\"ssl\">ssl</option><option label=\"none\" value=\"none\">None</option></select></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Host</td>\n";
- echo " <td><input type=\"text\" name=\"host\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>Port</td>\n";
- echo " <td><input type=\"port\" name=\"port\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Username</td>\n";
- echo " <td><input type=\"user\" name=\"user\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>Password</td>\n";
- echo " <td><input type=\"password\" name=\"pass\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Use HTML formatting</td>\n";
- echo " <td><select name=\"html\"><option label=\"true\" value=\"true\">Yes</option><option label=\"false\" value=\"false\">No</option></select></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>From email address</td>\n";
- echo " <td><input type=\"from\" name=\"from\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>To email address</td>\n";
- echo " <td><input type=\"to\" name=\"to\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>Subject</td>\n";
- echo " <td><input type=\"subject\" name=\"subject\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo "</table>\n";
- echo "\n";
- echo "<br>\n";
- echo "<input type=\"submit\" value=\"Save\">\n";
- echo "\n";
- echo "\n";
- echo "\n";
- echo "</form>\n";
-}
-?>
-
-<input type="button" value="Test" onClick="window.location='email.php?test=1'">
-
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-
-<br>
-<?php
- echo "Current Status = ";
- ob_start();
- $results = exec("pfctl -s rules | grep -c countryblock");
- ob_end_clean();
- if ($results > '0') echo "Running";
- else
- echo "<span style='color:red'>NOT running</span>";
-
- //Get Errors if exists
- ob_start();
- $results = exec("tail -r errorOUT.txt");
- ob_end_clean();
- echo "<br/><span style='color:red'>";
- echo $results;
- echo "</span>";
-
- //Get IP Count
- echo "<br>You are blocking ";
- ob_start();
- $results = exec("pfctl -T show -t countryblock |grep -v -c Z");
- ob_end_clean();
- echo $results;
- echo " Networks";
- ?>
-
-<br><br>
-
-<p>
-</p>
-</td>
- </tr>
-</table>
-
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/countryblock/execute.sh b/config/countryblock/execute.sh
deleted file mode 100755
index d79c37b7..00000000
--- a/config/countryblock/execute.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-
-#version 2.0
-#is countryblock running
-#export resultr=`pfctl -s rules | grep -c countryblock`
-#echo $resultr
-#if [ "$resultr" -gt "0" ]; then
-# echo running
-# exit 1
-#else
-# echo not running
-# /usr/bin/logger -s "Countryblock was found not running"
-# echo "Countryblock not running" | /usr/local/bin/php /usr/local/www/packages/countryblock/email_send.php
-#fi
-
-pfctl -t countryblock -T kill
-sed -i -e '/countryblock/d' /tmp/rules.debug
-
-#Now edit /tmp/rules.debug
-
-#find my line for table
-export i=`grep -n 'block quick from any to <snort2c>' /tmp/rules.debug | grep -o '[0-9]\{2,4\}'`
-export t=`grep -n 'User Aliases' /tmp/rules.debug |grep -o '[0-9]\{1,2\}'`
-
-i=$(($i+'1'))
-t=$(($t+'1'))
-#i = line where <snort2c> is
-#t is where 'User Aliases' is
-echo $i
-echo $t
-
-rm /tmp/rules.debug.tmp
-
-#Insert table-entry limit
-sed -i -e '/900000/d' /tmp/rules.debug
-while read line
- do a=$(($a+1));
- #echo $a;
- if [ "$a" = "$t" ]; then
- echo "" >> /tmp/rules.debug.tmp
- echo "set limit table-entries 900000" >> /tmp/rules.debug.tmp
- fi
- echo $line >> /tmp/rules.debug.tmp
-done < "/tmp/rules.debug"
-
-mv /tmp/rules.debug /tmp/rules.debug.old
-mv /tmp/rules.debug.tmp /tmp/rules.debug
-
-pfctl -o basic -f /tmp/rules.debug > errorOUT.txt 2>&1
-
-rm /tmp/rules.debug.tmp
-
-#Insert countryblock rules
-a="0"
-echo $a
-while read line
- do a=$(($a+1));
- echo $a;
- if [ "$a" = "$i" ]; then
- echo "" >> /tmp/rules.debug.tmp
- echo "#countryblock" >> /tmp/rules.debug.tmp
- echo "table <countryblock> persist file '/usr/local/www/packages/countryblock/lists/countries.txt'" >> /tmp/rules.debug.tmp
- echo "table <countryblockW> persist file '/usr/local/www/packages/countryblock/countries-white.txt'" >> /tmp/rules.debug.tmp
-
- for i in $(cat /usr/local/www/packages/countryblock/interfaces.txt); do
- echo "pass quick from <countryblockW> to $i label 'countryblock'" >> /tmp/rules.debug.tmp
- echo "pass quick from $i to <countryblockW> label 'countryblock'" >> /tmp/rules.debug.tmp
- if [ -f logging ]; then
- echo "block log quick from <countryblock> to $i label 'countryblock'" >> /tmp/rules.debug.tmp
- else
- echo "block quick from <countryblock> to $i label 'countryblock'" >> /tmp/rules.debug.tmp
- fi
- if [ -f OUTBOUND ]; then
- echo "block quick from $i to <countryblock> label 'countryblock'" >> /tmp/rules.debug.tmp
- fi
- done
- fi
- echo $line >> /tmp/rules.debug.tmp
-done < "/tmp/rules.debug"
-
-mv /tmp/rules.debug /tmp/rules.debug.old
-mv /tmp/rules.debug.tmp /tmp/rules.debug
-
-rm errorOUT.txt
-pfctl -o basic -f /tmp/rules.debug > /usr/local/www/packages/countryblock/errorOUT.txt 2>&1 \ No newline at end of file
diff --git a/config/countryblock/firewall_shaper.tmp b/config/countryblock/firewall_shaper.tmp
deleted file mode 100644
index d01ed55c..00000000
--- a/config/countryblock/firewall_shaper.tmp
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<HEAD>
-<SCRIPT language="JavaScript">
-<!--
-window.parent.location="../../firewall_shaper.php";
-//-->
-</SCRIPT>
-</HEAD>
-
-
-</html> \ No newline at end of file
diff --git a/config/countryblock/help.tmp b/config/countryblock/help.tmp
deleted file mode 100644
index 577a7f49..00000000
--- a/config/countryblock/help.tmp
+++ /dev/null
@@ -1,148 +0,0 @@
-<?php
-$pgtitle = "Firewall: Countryblock - Help";
-
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/countryblock/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-
-
-
-
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-
-
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("Countries", false, "countryblock.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "countryblock_if.php");
- $tab_array[4] = array("Help", true, "help.php");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Help</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
-<!---
-Usage:<br><br>
-Countries - Check the country that you would like to block completely.<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-Choose if you want to block outbound access and if you want to log attempts. <br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-Click "Commit Countries" to store your settings.
-<br><br>
-Settings -
-Click the setting you want and save<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-Block outbound blocks all outbound traffic. You will not be able to browse a website hosted in one of these countries. <br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-Enable Logging will log all attempted traffic in/out to any of your selected countries. Logs show in the Firewall secion
-<br><br>
-Whitelist -
-Add networks you don't want blocked and save<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-Add a CIDR Range and press +
-<br><br>
-Interfaces -
-Select which interfaces to block on<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-All selected countries will be blocked from the interfaces you slected.<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-By Default all interfaces are selected.<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-It's highly recommended that you keep all interfaces selected
-<br><br>
-Cron Jobs -
-Setup a cron job for countryblock<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-To run countryblock as a cron job use /usr/local/etc/rc.d/countryblock.sh <br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-*Before the cron job will work, countryblock must be run via the webGUI atleast once
-<br><br>
-
-<span style="color:red">Warning!</span> - Apply after every firewall change or state reset. Use at your own risk.
---->
-<a href="https://doc.pfsense.org/index.php/Country_Block">Please see wiki for help</a> or the <a href="https://forum.pfsense.org/index.php/topic,25732.0.html">Forum</a>
-
-</div>
-
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-</div>
-<br>
-<?php
- echo "Current Status = ";
- ob_start();
- $results = exec("pfctl -s rules | grep -c countryblock");
- ob_end_clean();
- if ($results > '0') echo "Running";
- else
- echo "<span style='color:red'>NOT running</span>";
-
- //Get Errors if exists
- ob_start();
- $results = exec("tail -r errorOUT.txt");
- ob_end_clean();
- echo "<br/><span style='color:red'>";
- echo $results;
- echo "</span>";
-
- //Get IP Count
- echo "<br>You are blocking ";
- ob_start();
- $results = exec("pfctl -T show -t countryblock |grep -v -c Z");
- ob_end_clean();
- echo $results;
- echo " Networks";
- ?>
-
-<br><br>
-
-<p>
-</p>
-</td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
-
diff --git a/config/countryblock/index.tmp b/config/countryblock/index.tmp
deleted file mode 100644
index 7c768af6..00000000
--- a/config/countryblock/index.tmp
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<HEAD>
-<SCRIPT language="JavaScript">
-<!--
-window.parent.location="../../index.php";
-//-->
-</SCRIPT>
-</HEAD>
-
-
-</html> \ No newline at end of file
diff --git a/config/countryblock/interfaces.txt b/config/countryblock/interfaces.txt
deleted file mode 100644
index 124009d7..00000000
--- a/config/countryblock/interfaces.txt
+++ /dev/null
@@ -1 +0,0 @@
-any \ No newline at end of file
diff --git a/config/countryblock/jquery.min.js b/config/countryblock/jquery.min.js
deleted file mode 100644
index b1ae21d8..00000000
--- a/config/countryblock/jquery.min.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * jQuery JavaScript Library v1.3.2
- * http://jquery.com/
- *
- * Copyright (c) 2009 John Resig
- * Dual licensed under the MIT and GPL licenses.
- * http://docs.jquery.com/License
- *
- * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
- * Revision: 6246
- */
-(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
-/*
- * Sizzle CSS Selector Engine - v0.9.3
- * Copyright 2009, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- * More information: http://sizzlejs.com/
- */
-(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/config/countryblock/public_smo_scripts.js b/config/countryblock/public_smo_scripts.js
deleted file mode 100644
index 67125c44..00000000
--- a/config/countryblock/public_smo_scripts.js
+++ /dev/null
@@ -1,160 +0,0 @@
-//Custom JavaScript Functions by Shawn Olson
-//Copyright 2006-2008
-//http://www.shawnolson.net
-//If you copy any functions from this page into your scripts, you must provide credit to Shawn Olson & http://www.shawnolson.net
-//*******************************************
-
- function stripCharacter(words,character) {
- //documentation for this script at http://www.shawnolson.net/a/499/
- var spaces = words.length;
- for(var x = 1; x<spaces; ++x){
- words = words.replace(character, "");
- }
- return words;
- }
-
- function changecss(theClass,element,value) {
- //Last Updated on June 23, 2009
- //documentation for this script at
- //http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html
- var cssRules;
-
- var added = false;
- for (var S = 0; S < document.styleSheets.length; S++){
-
- if (document.styleSheets[S]['rules']) {
- cssRules = 'rules';
- } else if (document.styleSheets[S]['cssRules']) {
- cssRules = 'cssRules';
- } else {
- //no rules found... browser unknown
- }
-
- for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
- if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
- if(document.styleSheets[S][cssRules][R].style[element]){
- document.styleSheets[S][cssRules][R].style[element] = value;
- added=true;
- break;
- }
- }
- }
- if(!added){
- if(document.styleSheets[S].insertRule){
- document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);
- } else if (document.styleSheets[S].addRule) {
- document.styleSheets[S].addRule(theClass,element+': '+value+';');
- }
- }
- }
- }
-
- function checkUncheckAll(theElement) {
- var theForm = theElement.form, z = 0;
- for(z=0; z<theForm.length;z++){
- if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
- theForm[z].checked = theElement.checked;
- }
- }
- }
-
-function checkUncheckSome(controller,theElements) {
- //Programmed by Shawn Olson
- //Copyright (c) 2006-2007
- //Updated on August 12, 2007
- //Permission to use this function provided that it always includes this credit text
- // http://www.shawnolson.net
- //Find more JavaScripts at http://www.shawnolson.net/topics/Javascript/
-
- //theElements is an array of objects designated as a comma separated list of their IDs
- //If an element in theElements is not a checkbox, then it is assumed
- //that the function is recursive for that object and will check/uncheck
- //all checkboxes contained in that element
-
- var formElements = theElements.split(',');
- var theController = document.getElementById(controller);
- for(var z=0; z<formElements.length;z++){
- theItem = document.getElementById(formElements[z]);
- if(theItem.type){
- if (theItem.type=='checkbox') {
- theItem.checked=theController.checked;
- }
- } else {
- theInputs = theItem.getElementsByTagName('input');
- for(var y=0; y<theInputs.length; y++){
- if(theInputs[y].type == 'checkbox' && theInputs[y].id != theController.id){
- theInputs[y].checked = theController.checked;
- }
- }
- }
- }
-}
-
- function changeImgSize(objectId,newWidth,newHeight) {
- imgString = 'theImg = document.getElementById("'+objectId+'")';
- eval(imgString);
- oldWidth = theImg.width;
- oldHeight = theImg.height;
- if(newWidth>0){
- theImg.width = newWidth;
- }
- if(newHeight>0){
- theImg.height = newHeight;
- }
-
- }
-
- function changeColor(theObj,newColor){
- eval('var theObject = document.getElementById("'+theObj+'")');
- if(theObject.style.backgroundColor==null){theBG='white';}else{theBG=theObject.style.backgroundColor;}
- if(theObject.style.color==null){theColor='black';}else{theColor=theObject.style.color;}
- //alert(theObject.style.color+' '+theObject.style.backgroundColor);
- switch(theColor){
- case newColor:
- switch(theBG){
- case 'white':
- theObject.style.color = 'black';
- break;
- case 'black':
- theObject.style.color = 'white';
- break;
- default:
- theObject.style.color = 'black';
- break;
- }
- break;
- default:
- theObject.style.color = newColor;
- break;
- }
- }
-
-//Below script added to prevent my work from being used
-//on websites that are not child-safe
-
-var restrictWords = new Array('free sex','amateurmatch.com','free porn');
-
-function badSites(word){
-//this function helps keep this script from being used on inappropriate websites
-
-var badword = false;
-var word = new String(word);
-word = word.toLowerCase();
-
- for (var i = 0; i<restrictWords.length; i++){
- if (word.match(restrictWords[i])){
-
- badword = true;
- alert("This website is improperly using a script from www.shawnolson.net.\n\nWhile the script is free ... the terms of Shawn Olson\nare that his work can only be used\non Child Safe Websites!\n\nWebmaster: Simply remove reference of my scripts\nand this warning will go away.");
- }
- }
- if (badword==true){document.location='http://www.fbi.gov/hq/cid/cac/states.htm';}
- return badword;
-}
-
-var siteCheckArray = new Array(document.title,document.URL);
-var siteCheckRound = 0;
-
-for(siteCheckRound in siteCheckArray){
- badSites(siteCheckArray[siteCheckRound]);
-} \ No newline at end of file
diff --git a/config/countryblock/purge.tmp b/config/countryblock/purge.tmp
deleted file mode 100644
index 81d16a7c..00000000
--- a/config/countryblock/purge.tmp
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-$line = $_GET["line"];
-
-//echo("$line");
-//exec("more lists.txt > temp_lists.txt");
-if ($line == 0) {
- exec("rm countries-white.txt");
- } else {
- exec("sed $line'd' countries-white.txt > temp_countries-white.txt");
- }
-exec("more temp_countries-white.txt > countries-white.txt");
-exec("rm temp_countries-white.txt");
-
-
-?>
-<html>
-<HEAD>
-<SCRIPT language="JavaScript">
-<!--
-window.parent.location="whitelist.php";
-//-->
-</SCRIPT>
-</HEAD>
-
-
-</html> \ No newline at end of file
diff --git a/config/countryblock/settings.tmp b/config/countryblock/settings.tmp
deleted file mode 100644
index 0a067d83..00000000
--- a/config/countryblock/settings.tmp
+++ /dev/null
@@ -1,220 +0,0 @@
-<?php
-$pgtitle = "Firewall: Countryblock - Settings";
- // TomSchaefer.org countryblock package 2010
- //
- // Notes: Find: ^(.*)$
- // Replace: ob_start();\n$results = exec("cat countries.txt | grep XX");\nob_end_clean();\n\tif ($results == 'XX')\n\t\techo "\1";\n\telse\n\t\techo "\1";\n
- //
- //
- //
- //
- //require_once('config.inc');
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/countryblock/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<form method=POST action="">
-
-<?php if ($savemsg_cb) print_info_box($savemsg_cb);
- //if ($output) print_info_box($output,$output2);
- echo($output);
- echo($output2);
- ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("Countries", false, "countryblock.php");
- $tab_array[1] = array("Settings", true, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "countryblock_if.php");
- $tab_array[4] = array("Help", false, "help.php");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Settings</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
-
-<?php
-
-conf_mount_rw();
-
-
-
- if(isset($_POST['formSubmit']))
- {
- $aCountry = $_POST['formCountry'];
-
- if(isset($_POST['formOutbound']))
- {
- $output2 = " and Outbound access is BLOCKED.</b>";
- exec("touch OUTBOUND");
- }
- else
- {
- $output2 = " and Outbound access is ALLOWED.</b>";
- exec("rm OUTBOUND");
- }
-
- if(isset($_POST['formlogging']))
- {
- exec("touch logging");
- }
- else
- {
- exec("rm logging");
- }
-
-
-
-
- }
-conf_mount_ro();
-?>
-
-
-
-
-</head>
-
-
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
- <td >
-
-
- </form>
-
- <form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
- <p>
- <?php
- $countif = "interfaces.txt";
- if (file_exists($countif)) {
- $countif = count(file($countif));
- echo "$countlines";
- } else {
- echo "<span style='color:red'>Warning! No Interfaces Selected Click <a href='countryblock_if.php' target='_parent'><img src='../../themes/nervecenter/images/icons/icon_cablenic.gif' ALT='if'></a></span>";
- }
-
- ?>
- </p>
-
-
- <p>
- Block outbound?
-<?php
-
- if (file_exists("OUTBOUND")) {
- echo "<input name='formOutbound' type='checkbox' value='Yes' checked/>";
- } else {
- echo "<input name='formOutbound' type='checkbox' value='Yes'/>";
- }
-?>
-
- <br>
- Enable Logging?&nbsp;
-<?php
-
- if (file_exists("logging")) {
- echo "<input name='formlogging' type='checkbox' value='Yes' checked/>";
- } else {
- echo "<input name='formlogging' type='checkbox' value='Yes'/>";
- }
-?>
-<br/>
-
-
-
-
-
-
-
-
- </p>
-
-<br/>
-
-
-
-</div>
-<?php
- //This input guarantees that a POST is sent
- echo "<input type='hidden' name='zzz' value='required'>";
-?>
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-</div>
-<br>
-<?php
- echo "Current Status = ";
- ob_start();
- $results = exec("pfctl -s rules | grep -c countryblock");
- ob_end_clean();
- if ($results > '0') echo "Running";
- else
- echo "<span style='color:red'>NOT running</span>";
-
- //Get Errors if exists
- ob_start();
- $results = exec("tail -r errorOUT.txt");
- ob_end_clean();
- echo "<br/><span style='color:red'>";
- echo $results;
- echo "</span>";
-
- //Get IP Count
- echo "<br>You are blocking ";
- ob_start();
- $results = exec("pfctl -T show -t countryblock |grep -v -c Z");
- ob_end_clean();
- echo $results;
- echo " Networks";
- ?>
-
-<br><br>
-<input type="submit" name="formSubmit" value="Save" /><br><br>
-<p>
-</p>
-</td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
-
diff --git a/config/countryblock/titlebar-active.png b/config/countryblock/titlebar-active.png
deleted file mode 100644
index ad675768..00000000
--- a/config/countryblock/titlebar-active.png
+++ /dev/null
Binary files differ
diff --git a/config/countryblock/titlebar.png b/config/countryblock/titlebar.png
deleted file mode 100644
index f028a918..00000000
--- a/config/countryblock/titlebar.png
+++ /dev/null
Binary files differ
diff --git a/config/countryblock/whitelist.tmp b/config/countryblock/whitelist.tmp
deleted file mode 100644
index d613ee11..00000000
--- a/config/countryblock/whitelist.tmp
+++ /dev/null
@@ -1,241 +0,0 @@
-<?php
-$pgtitle = "Firewall: Countryblock - Whitelist";
-
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/countryblock/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-
-
-
-
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<form method=POST action="">
-<?php
-
-
-mwexec("touch countries-white.txt");
-//$myFile = "countries-white.txt";
-//$fh = fopen($myFile, 'a+');
-
-
-?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("Countries", false, "countryblock.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", true, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "countryblock_if.php");
- $tab_array[4] = array("Help", false, "help.php");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Whitelist</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
-
-<p>
- Enter the CIDR Range you would like to whitlist</p>
- <p><form method="post" action="">
-<input name="content" type="text" />
-<input type="image" src="../../themes/nervecenter/images/icons/icon_plus.gif" value="submit">
-<a href="purge.php?line=0">Purge All</a>
-
-<STYLE type="text/css">
- a img {border:none; }
- </STYLE>
-</head>
-
-<?php
-
-function delLineFromFile($fileName, $lineNum){
-// check the file exists
- if(!is_writable($fileName))
- {
- // print an error
- print "The file $fileName is not writable";
- // exit the function
- exit;
- }
- else
- {
- // read the file into an array
- $arr = file($fileName);
- }
-
- // the line to delete is the line number minus 1, because arrays begin at zero
- $lineToDelete = $lineNum-1;
-
- // check if the line to delete is greater than the length of the file
- if($lineToDelete > sizeof($arr))
- {
- // print an error
- print "You have chosen a line number, <b>[$lineNum]</b>, higher than the length of the file.";
- // exit the function
- exit;
- }
-
- //remove the line
- unset($arr["$lineToDelete"]);
-
- // open the file for reading
- if (!$fp = fopen($fileName, 'w+'))
- {
- // print an error
- print "Cannot open file ($fileName)";
- // exit the function
- exit;
- }
-
- // if $fp is valid
- if($fp)
- {
- // write the array to the file
- foreach($arr as $line) { fwrite($fp,$line); }
-
- // close the file
- fclose($fp);
- }
-
-echo "done";
-}
-
-
-$myFile = "countries-white.txt";
-$content = $_REQUEST['content'];
-$fh = fopen($myFile, 'a+');
-fwrite($fh, $content);
-if (strlen($content) > 1) {
- fwrite($fh, "\n");
- } else {
-}
-fclose($fh);
-
-
-//echo (filesize($myFile));
-if (filesize($myFile) > 1) {
- //$fh = fopen($myFile, 'r');
- //$theData = fread($fh, filesize($myFile));
- //fclose($fh);
- echo "<br/> Current List(s): <br/>";
- // Get the whole file into a single string
- $fileContents = file_get_contents($myFile);
-
- // Explode the file contents string by each line
- $lines = explode(PHP_EOL, $fileContents); // Replace PHP_EOL with "\r\n" or "\n" or "\r" if you like
-
- // Iterate through each line and do what you need with it
-
- foreach ($lines as $line) {
- $i++;
- echo "<a href=purge.php?line=$i style='border-style: none'><img src='../../themes/nervecenter/images/icons/icon_x.gif'></a>";
- echo " ";
- echo $line;
- //echo "";
- // echo $i;
- echo "<br/>";
-
- }
-
-
- //echo $theData;
-
-
-}
-echo "<br/><br/>";
-
-
-
-
-?></p>
-
- <p> <u>Usage</u>
- <br/>
- Enter a CIDR range for the Address you wish to whitlist. <br/>
- Example: 192.168.1.0/24
- <br/><br/>
- </p>
-</form>
-
-
-</div>
-
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-</div>
-<br>
-<?php
- echo "Current Status = ";
- ob_start();
- $results = exec("pfctl -s rules | grep -c countryblock");
- ob_end_clean();
- if ($results > '0') echo "Running";
- else
- echo "<span style='color:red'>NOT running</span>";
-
- //Get Errors if exists
- ob_start();
- $results = exec("tail -r errorOUT.txt");
- ob_end_clean();
- echo "<br/><span style='color:red'>";
- echo $results;
- echo "</span>";
-
- //Get IP Count
- echo "<br>You are blocking ";
- ob_start();
- $results = exec("pfctl -T show -t countryblock |grep -v -c Z");
- ob_end_clean();
- echo $results;
- echo " Networks";
- ?>
-
-<br><br>
-
-<p>
-</p>
-</td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
-
diff --git a/config/dashboard/dashboard.inc b/config/dashboard/dashboard.inc
deleted file mode 100644
index 61b5c501..00000000
--- a/config/dashboard/dashboard.inc
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-function dashboard_install() {
- global $g, $config;
-
- $version = file_get_contents("/etc/version");
- if ($version[0] == "2") {
- echo "Skipping install on 2.0, package is redundant.";
- exit(1);
- } else {
- assign_privs();
-
- /* Copy files for backup. For some odd reason, mv alone does
- * not always result in the proper file being used. */
- mwexec("cp /usr/local/www/index.php /usr/local/www/index.php.before_dashboard");
- unlink("/usr/local/www/index.php");
- mwexec("cp /usr/local/www/diag_logs_filter.php /usr/local/www/diag_logs_filter.php.before_dashboard");
- mwexec("cp /usr/local/www/diag_logs_filter_dynamic.php /usr/local/www/diag_logs_filter_dynamic.php.before_dashboard");
- mwexec("tar xzvpUf /usr/local/pkg/widgets.tgz -C /");
- assign_privs();
- /* Clear the APC cache so that the updates to installed files will work. */
- sleep(5);
- apc_clear_cache();
- }
-}
-
-function assign_privs() {
- /* Fix permissions on replaced files */
- mwexec("chown root:wheel /usr/local/www/index.php");
- mwexec("chown root:wheel /usr/local/www/graph_cpu.php");
- mwexec("chown root:wheel /usr/local/www/stats.php");
- mwexec("chown root:wheel /usr/local/www/diag_logs_filter.php");
- mwexec("chown root:wheel /usr/local/www/diag_logs_filter_dynamic.php");
- mwexec("chmod ug+rw,o-w /usr/local/www/index.php");
- mwexec("chmod ug+rw,o-w /usr/local/www/graph_cpu.php");
- mwexec("chmod ug+rw,o-w /usr/local/www/stats.php");
- mwexec("chmod ug+rw,o-w /usr/local/www/diag_logs_filter.php");
- mwexec("chmod ug+rw,o-w /usr/local/www/diag_logs_filter_dynamic.php");
-}
-
-?> \ No newline at end of file
diff --git a/config/dashboard/dashboard.xml b/config/dashboard/dashboard.xml
deleted file mode 100644
index 5d8b59fc..00000000
--- a/config/dashboard/dashboard.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- dashboard.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Dashboard package</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>dashboard</name>
- <version>0.8.8</version>
- <title>Dashboard</title>
- <include_file>/usr/local/pkg/dashboard.inc</include_file>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/dashboard/dashboard.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://files.pfsense.org/packages/widgets.tgz</item>
- </additional_files_needed>
- <custom_php_install_command>
- dashboard_install();
- </custom_php_install_command>
-</packagegui>
diff --git a/config/denyhosts/denyhosts.inc b/config/denyhosts/denyhosts.inc
deleted file mode 100644
index 37209715..00000000
--- a/config/denyhosts/denyhosts.inc
+++ /dev/null
@@ -1,199 +0,0 @@
-<?php
-/* $Id$ */
-/*
-/* ========================================================================== */
-/*
- denyhosts.inc
- Copyright (C) 2009 Mark J Crane
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-function denyhosts_sync_package()
-{
-
- //global $config;
-
-}
-
-// bounty: https://forum.pfsense.org/index.php/topic,15791.0/topicseen.html
-// pkg_add -r denyhosts
-// python /usr/local/share/denyhosts/denyhosts.py –file=/var/log/auth.log
-// /var/run/denyhosts.pid
-// http://en.wikipedia.org/wiki/DenyHosts
-
-
-function denyhosts_install_command()
-{
-
- global $config;
- conf_mount_rw();
- config_lock();
-
- if (!is_dir('/usr/local/www/packages/')) {
- exec("mkdir /usr/local/www/packages/");
- }
-
- if (!is_dir('/usr/local/www/packages/denyhosts/')) {
- exec("mkdir /usr/local/www/packages/denyhosts/");
- }
-
- exec("pkg_add -r https://files.pfsense.org/packages/security/denyhosts-2.5.tbz");
-
- //misc files
- if (!is_dir('/usr/local/www/edit_area/')) {
- chdir('/tmp/');
- exec("cd /tmp/;fetch ".$download_path."edit_area.tgz");
- chdir('/usr/local/www');
- system('tar xvpfz /tmp/edit_area.tgz edit_area');
- unlink_if_exists("/tmp/edit_area.tgz");
- }
-
- //backup the original hosts.allow file
- exec ("cp /etc/hosts.allow /etc/hosts.allow.bak");
-
- $hosts_allow = "#\n";
- $hosts_allow .= "# hosts.allow access control file for \"tcp wrapped\" applications.\n";
- $hosts_allow .= "#\n";
- $hosts_allow .= "sshd : /etc/hosts.deniedssh : deny\n";
- $hosts_allow .= "sshd : ALL : allow\n";
- $hosts_allow .= "ALL : ALL : allow\n";
- $fout = fopen("/etc/hosts.allow","w");
- fwrite($fout, $hosts_allow);
- unset($hosts_allow);
- fclose($fout);
-
- if(!is_file("/etc/hosts.deniedssh")) {
- exec("touch /etc/hosts.deniedssh");
- exec("chmod 755 /etc/hosts.deniedssh");
- }
-
- if(!is_file("/var/log/denyhosts")) {
- exec ('touch /var/log/denyhosts');
- }
-
- $download_path = 'https://packages.pfsense.org/packages/config/denyhosts/';
-
- //rename PHP files from .tmp to .php
- chdir('/tmp/');
- exec("cd /tmp/;fetch ".$download_path."denyhosts_log.tmp");
- exec("cp /tmp/denyhosts_log.tmp /usr/local/www/packages/denyhosts/denyhosts_log.php");
- unlink_if_exists("/tmp/denyhosts_log.tmp");
-
-
- //$denyhosts_sh = "\n";
- //$denyhosts_sh .= "name=\"denyhosts\"\n";
- //$denyhosts_sh .= "rcvar=\${name}_enable\n";
- //$denyhosts_sh .= "\n";
- //$denyhosts_sh .= "command=\"/usr/local/bin/denyhosts.py\"\n";
- //$denyhosts_sh .= "command_interpreter=\"/usr/local/bin/python2.5\"\n";
- //$denyhosts_sh .= "command_args=\"--config /usr/local/etc/denyhosts.conf --daemon\"\n";
- //$denyhosts_sh .= "pidfile=\"/var/run/\${name}.pid\"\n";
- //$denyhosts_sh .= "\n";
- //$denyhosts_sh .= "load_rc_config \$name\n";
- //$denyhosts_sh .= "\n";
- //$denyhosts_sh .= ": \${denyhosts_enable=\"YES\"}\n";
- //$denyhosts_sh .= "\n";
- //$denyhosts_sh .= "run_rc_command \"\$1\"\n";
- //$fout = fopen("/usr/local/etc/rc.d/denyhosts.sh","w");
- //fwrite($fout, $denyhosts_sh);
- //unset($denyhosts_sh);
- //fclose($fout);
- //exec("chmod 755 /usr/local/etc/rc.d/denyhosts.sh");
-
- $filename = "/usr/local/etc/denyhosts.conf";
- $handle = fopen($filename,"rb");
- $denyhosts_conf = fread($handle, filesize($filename));
- fclose($handle);
- $denyhosts_conf = str_replace("SECURE_LOG = /var/log/auth.log", "SECURE_LOG = /var/log/system.log", $denyhosts_conf);
- $denyhosts_conf = str_replace("#BLOCK_SERVICE = sshd", "BLOCK_SERVICE = sshd", $denyhosts_conf);
- $denyhosts_conf = str_replace("#SYNC_SERVER = http://xmlrpc.denyhosts.net:9911", "SYNC_SERVER = http://xmlrpc.denyhosts.net:9911", $denyhosts_conf);
- $fout = fopen($filename,"w");
- fwrite($fout, $denyhosts_conf);
- unset($filename);
- fclose($fout);
-
- $filename = "/usr/local/etc/denyhosts.conf-dist";
- $fout = fopen($filename,"w");
- fwrite($fout, $denyhosts_conf);
- unset($filename);
- unset($denyhosts_conf);
- fclose($fout);
-
- write_rcfile(array(
- "file" => "denyhosts.sh",
- "start" => "/usr/local/bin/python2.5 /usr/local/bin/denyhosts.py --config /usr/local/etc/denyhosts.conf --daemon",
- "stop" => "rm /var/run/denyhosts.pid"
- )
- );
-
- denyhosts_sync_package();
-
- //start denyhosts
- exec("/usr/local/etc/rc.d/denyhosts.sh start");
-
- //if (pkg_is_service_running('notes')) {
- //documentation purposes
- //}
-
- conf_mount_ro();
- config_unlock();
-
-}
-
-
-function denyhosts_deinstall_command()
-{
-
- conf_mount_rw();
- config_lock();
-
- exec("pkg_delete denyhosts");
- exec("rm -R /usr/local/www/packages/denyhosts/");
-
- //restore original hosts.allow file
- if (file_exists('/usr/local/www/exec.php')) {
- exec ("rm /etc/hosts.allow");
- exec ("cp /etc/hosts.allow.bak /etc/hosts.allow");
- }
-
- //remove the configuration
- exec ("rm /usr/local/etc/denyhosts*");
-
- //create a new hosts.allow file
- //$hosts_allow = "#\n";
- //$hosts_allow .= "# hosts.allow access control file for \"tcp wrapped\" applications.\n";
- //$hosts_allow .= "#\n";
- //$hosts_allow .= "ALL : ALL : allow\n";
- //$fout = fopen("/etc/hosts.allow","w");
- //fwrite($fout, $tmp);
- //unset($tmp);
- //fclose($fout);
-
- conf_mount_ro();
- config_unlock();
-}
-
-?> \ No newline at end of file
diff --git a/config/denyhosts/denyhosts.xml b/config/denyhosts/denyhosts.xml
deleted file mode 100644
index 720f1b95..00000000
--- a/config/denyhosts/denyhosts.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- denyhosts.xml
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>DenyHosts</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>DenyHosts</name>
- <version>0.5.1</version>
- <title>Settings</title>
- <include_file>/usr/local/pkg/denyhosts.inc</include_file>
- <menu>
- <name>DenyHosts</name>
- <tooltiptext>DenyHosts.</tooltiptext>
- <section>Services</section>
- <configfile>denyhosts.xml</configfile>
- <url>/packages/denyhosts/denyhosts_log.php</url>
- </menu>
- <service>
- <name>denyhosts</name>
- <rcfile>denyhosts.sh</rcfile>
- <executable>denyhosts</executable>
- <description>DenyHosts analyzes logs for SSH login attempts and blocks offending IP addresses.</description>
- </service>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/packages/denyhosts/denyhosts_log.php</url>
- <active/>
- </tab>
- </tabs>
- <configpath>installedpackages->package->denyhosts</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/denyhosts/denyhosts.inc</item>
- </additional_files_needed>
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Title</fielddescr>
- <fieldname>title</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Category</fielddescr>
- <fieldname>category</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
- <fields>
- <field>
- <fielddescr>Title</fielddescr>
- <fieldname>title</fieldname>
- <description>Enter the title.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Category</fielddescr>
- <fieldname>category</fieldname>
- <description>Enter a category.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>&lt;b&gt;zzz&lt;/b&gt; &lt;br /&gt; &lt;br /&gt;</fielddescr>
- <fieldname>zzz</fieldname>
- <description></description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <size>30</size>
- <cols>70</cols>
- <rows>20</rows>
- </field>
- </fields>
- <custom_add_php_command>
- </custom_add_php_command>
- <custom_php_resync_config_command>
- denyhosts_sync_package();
- </custom_php_resync_config_command>
- <custom_delete_php_command>
- denyhosts_sync_package();
- </custom_delete_php_command>
- <custom_php_install_command>
- denyhosts_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- denyhosts_deinstall_command();
- </custom_php_deinstall_command>
-</packagegui> \ No newline at end of file
diff --git a/config/denyhosts/denyhosts_log.tmp b/config/denyhosts/denyhosts_log.tmp
deleted file mode 100644
index 0b06d4f5..00000000
--- a/config/denyhosts/denyhosts_log.tmp
+++ /dev/null
@@ -1,177 +0,0 @@
-<?php
-/* $Id$ */
-/*
- denyhosts_log.php
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-require("/usr/local/pkg/denyhosts.inc");
-
-//$a_extensions = &$config['installedpackages']['profiles']['config'];
-
-/*
-if ($_GET['a'] == "default") {
- //conf_mount_rw();
- exec("cp /usr/local/zzz/conf.orig/zzz /usr/local/zzz/conf/zzz");
- $savemsg = "Default Restored";
- //conf_mount_ro();
-}
-
-if ($_POST['a'] == "save") {
- //conf_mount_rw();
- $content = ereg_replace("\r","",$_POST['code']);
- $fd = fopen("/usr/local/zzz/conf/zzz", "w");
- fwrite($fd, $content);
- fclose($fd);
- $savemsg = "Saved";
- //conf_mount_ro();
-}
-*/
-
-if(!is_file("/var/log/denyhosts")) {
- exec ('touch /var/log/denyhosts');
-}
-
-$filename = '/var/log/denyhosts';
-$fd = fopen($filename, "r");
-if (filesize($filename) > 0) {
- $content = fread($fd, filesize($filename));
-}
-else {
- $content = '';
-}
-fclose($fd);
-
-include("head.inc");
-
-?>
-
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-
-<script language="Javascript">
-function sf() { document.forms[0].savetopath.focus(); }
-</script>
-<script language="Javascript" type="text/javascript" src="/edit_area/edit_area_full.js"></script>
-<script language="Javascript" type="text/javascript">
- // initialisation
- editAreaLoader.init({
- id: "code" // id of the textarea to transform
- ,start_highlight: false
- ,allow_toggle: false
- ,language: "en"
- ,syntax: "html"
- ,toolbar: "search, go_to_line,|, fullscreen, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help"
- ,syntax_selection_allow: "css,html,js,php,xml,c,cpp,sql"
- ,show_line_colors: true
- });
-</script>
-
-<?php
-include("fbegin.inc");
-echo "<p class=\"pgtitle\">Deny Hosts</p>\n";
-?>
-
-<div id="mainlevel">
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr><td class="tabnavtbl">
-<?php
-
-//display_top_tabs(build_menu());
-
-?>
-</td></tr>
-</table>
-
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabcont" >
-<!--
-<form action="zzz.php" method="post" name="iform" id="iform">
--->
-<?php
-
-?>
-
- <table width="98%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width='90%'><p><span class="vexpl"><span class="red"><strong>DenyHosts Logs<br>
- </strong></span>
- DenyHosts analyzes logs for SSH login attempts and blocks offending IP addresses.
- </p>
- </td>
- <td width='10%' align='right' valign='middle'><!--<input type="submit" value="save" />--></td>
- </tr>
- </table>
-
- <br />
- <br />
-
- <textarea style="width:98%" id="code" name="code" rows="30" cols="<?php echo $cols; ?>" name="content"><?php echo htmlentities($content); ?></textarea>
- <br />
- <br />
-
- <table width="98%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td>/var/log/denyhosts</td>
- <td align='right'>
- <input type="hidden" name="f" value="<?php echo $_GET['f']; ?>" />
- <input type="hidden" name="a" value="save" />
- <?php
- //echo "<input type='button' value='Restore Default' onclick=\"document.location.href='/packages/zzz/zzz.php?a=default&f=zzz';\" />";
- ?>
- </td>
- </tr>
- </table>
-
-<!--
-</form>
--->
-
-<br>
-<br>
-
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-
-</td>
-</tr>
-</table>
-
-</div>
-
-
-
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/developers/developers.xml b/config/developers/developers.xml
deleted file mode 100644
index 8b7ddb90..00000000
--- a/config/developers/developers.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>developers</name>
- <version>0.1</version>
- <title>Developers</title>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://www.pfsense.org/~sullrich/extra/developer_pkg.tgz</item>
- </additional_files_needed>
- <custom_php_install_command>
- update_status("Extracing Developers package contents... This will take a bit!");
- mwexec_bg("cd / &amp;&amp; tar xzpfU /usr/local/pkg/developer_pkg.tgz");
- </custom_php_install_command>
-</packagegui>
-
-
- \ No newline at end of file
diff --git a/config/dnsblacklist/dnsblacklist.inc b/config/dnsblacklist/dnsblacklist.inc
deleted file mode 100644
index d9c7f364..00000000
--- a/config/dnsblacklist/dnsblacklist.inc
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-/* $Id$ */
-/*
-/* ========================================================================== */
-/*
- dnsblacklist.inc
- Copyright (C) 2009 Mark J Crane
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-function byte_convert( $bytes ) {
- if ($bytes<=0)
- return '0 Byte';
-
- $convention=1000; //[1000->10^x|1024->2^x]
- $s=array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB');
- $e=floor(log($bytes,$convention));
- return round($bytes/pow($convention,$e),2).' '.$s[$e];
-}
-
-
-
-
-function dnsblacklist_sync_package()
-{
- global $config;
-}
-
-
-function dnsblacklist_install_command()
-{
-
- global $config;
- conf_mount_rw();
- config_lock();
-
- if (!is_dir('/usr/local/www/packages/')) {
- exec("mkdir /usr/local/www/packages/");
- }
-
- if (!is_dir('/usr/local/www/packages/dnsblacklist/')) {
- exec("mkdir /usr/local/www/packages/dnsblacklist/");
- }
-
- //extract the blacklist
- exec("cp /tmp/blacklists.tar.gz /usr/local/www/packages/dnsblacklist/blacklists.tar.gz");
- chdir("/usr/local/www/packages/dnsblacklist/");
- exec("tar xvf blacklists.tar.gz");
- exec("rm /tmp/blacklists.tar.gz");
- exec("rm /usr/local/www/packages/dnsblacklist/blacklists.tar.gz");
-
- //rename PHP files from .tmp to .php
- exec("cp /tmp/dnsblacklist.tmp /usr/local/www/packages/dnsblacklist/dnsblacklist.php");
- unlink_if_exists("/tmp/dnsblacklist.tmp");
-
- //write_rcfile(array(
- // "file" => "phpservice.sh",
- // "start" => "/usr/local/bin/php /usr/local/pkg/phpservice.php >> /var/log/phpservice.log &",
- // "stop" => "rm /tmp/phpmonitor.pid"
- // )
- //);
-
- //dnsblacklist_sync_package();
- //$handle = popen("/usr/local/etc/rc.d/phpservice.sh start", "r");
- //pclose($handle);
-
- conf_mount_ro();
- config_unlock();
-}
-
-
-function dnsblacklist_deinstall_command()
-{
- conf_mount_rw();
- $handle = popen("/usr/local/etc/rc.d/dnsblacklist.sh stop", "r");
- unlink_if_exists("/usr/local/pkg/dnsblacklist.xml");
- unlink_if_exists("/usr/local/pkg/dnsblacklist.inc");
- exec("rm -R /usr/local/www/packages/dnsblacklist/blacklists");
- exec("rm -R /usr/local/www/packages/dnsblacklist");
- conf_mount_ro();
-}
-
-?>
diff --git a/config/dnsblacklist/dnsblacklist.tmp b/config/dnsblacklist/dnsblacklist.tmp
deleted file mode 100644
index 73464608..00000000
--- a/config/dnsblacklist/dnsblacklist.tmp
+++ /dev/null
@@ -1,217 +0,0 @@
-<?php
-
- //Blacklist was retrieved from
- //http://cri.univ-tlse1.fr/blacklists/index_en.php
-
- require_once('config.inc');
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/dnsblacklist/blacklists/global_usage';
- $fh = fopen($global_usage, 'r');
- while($line=fgets($fh)) {
- $line = trim($line);
- $line_array = explode (":", $line);
- if (strtolower($line_array[0]) == "name") {
- $name = trim($line_array[1]);
- }
- if (strtolower($line_array[0]) == "name en") {
- $name_en = trim($line_array[1]);
- $category[$name]['name_en'] = $name_en;
- }
- if (strtolower($line_array[0]) == "desc en") {
- $desc_en = trim($line_array[1]);
- $category[$name]['desc_en'] = $desc_en;
- }
- }
-
- //get line count for domains list
- function line_number ($file) {
- $result = trim(exec("wc -l $file"));
- $result_array = explode (" ", $result);
- return $result_array[0];
- }
-
- //print_r($_POST);
- //$x = 0;
- //foreach($_POST['blacklist'] as $value) {
- //$blacklist[$x]['name'] = $val;
- //$blacklist[$value] = 'zzz';
- //echo "\$category[\$x]['name'] = '$val';<br>";
- //echo "\$category['$value'] = 'zzz'; <br/>\n";
- //$x++;
- //}
- //unset($x);
- //echo "<pre>";
- //print_r($_POST["blacklist"]);
- //echo "</pre>";
- //foreach($_POST["blacklist"] as $key => $value) {
- //echo "name: ".$value."<br />";
- //$x++;
- //}
-
-if (count($_POST)>0) {
-
- conf_mount_rw();
-
- $dnsmasqfile = "/usr/local/etc/dnsmasq.conf";
- $targetfile = "/usr/local/etc/dnsmasq.blacklist.conf";
- $includestring = "conf-file=/usr/local/etc/dnsmasq.blacklist.conf";
- $dnsmasqconf = "/usr/local/etc/dnsmasq.conf";
-
- //clear previous values
- $ent = array();
- foreach($category as $key => $value) {
- $ent[$key] = '0';
- }
- $config['installedpackages']['dnsblacklist']['config'][0] = $ent;
- //write_config();
-
- //truncate the dnsmasq.blacklist.conf file
- if (file_exists($targetfile)) {
- $fh = fopen($targetfile, 'w');
- fclose($fh);
- }
-
- if ($_POST['enable'] == 1) {
- //echo "enabled";
- $config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] = 1;
- }
- else {
- //echo "disabled";
- $config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] = 0;
- }
-
- //add the include entry for dnsmasq.blacklist.conf to dnsmasq.conf
- if (file_exists($dnsmasqfile)) {
- $getdnsmasq = file_get_contents($dnsmasqfile);
- if(stristr($getdnsmasq,'conf-file=/usr/local/etc/dnsmasq.blacklist.conf') === TRUE) {
- //include found no need to add it
- }
- else {
- $myfhandle = fopen($dnsmasqconf, 'r+');
- fwrite($myfhandle, $includestring);
- fclose($myfhandle);
- }
- }
- else {
- $my2fhandle = fopen($dnsmasqconf, 'x+');
- fwrite($my2fhandle, $includestring);
- fclose($my2fhandle);
- }
-
- //build the dnsmasq.blacklist.conf
- if (count($_POST["blacklist"]) > 0) {
- foreach($_POST["blacklist"] as $value) {
- //set the current selected values
- $blackfile = "blacklists/$value/domains";
- $config['installedpackages']['dnsblacklist']['config'][0][$value] = 1;
- //if enabled write the selected categories to the dnsmasq.blacklist.conf
- if ($config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] == 1) {
- $fh2 = fopen($targetfile, 'a');
- $fh = fopen($blackfile,'r');
- while($line=fgets($fh)) {
- //remove all characters other than alpha numeric period and dash
- preg_match("/([a-zA-Z0-9.-]*)/i", $line, $arraymatches);
- $line = $arraymatches[1];
- fwrite($fh2, "address=/" .$line. "/74.125.45.100". "\n");
- }
- fclose($fh);
- fclose($fh2);
- }
- }
- }
-
- write_config();
- services_dnsmasq_configure();
- sleep(1);
- $savemsg_dnsb = "DNS Blacklist settings have been saved. ";
- conf_mount_ro();
-}
-?>
-
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: DNS Blacklist</p>
-<form method=POST action="">
-
-<?php
-if ($config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] == 1) {
- echo "<input name='enable' type='checkbox' value='1' checked>\n";
-}
-else {
- echo "<input name='enable' type='checkbox' value='1'>\n";
-}
-?>
-
-<strong>Enable DNS Blacklist</strong><br><br>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr><td class="tabcont" >
-<?php if ($savemsg_dnsb) print_info_box($savemsg_dnsb); ?>
-
-Below is a scroll-box filled with categories you can select to be added to your blacklist. <br><br> Each category has a list of known domains/sites that will be denied access by users of this network.
-<br><br><i>(Note: Using all categories at once will require 300Mb of free memory. The <b>adult</b> category is rather memory intensive, requiring 200Mb.)</i>
-<br><br><br>
-
-
-<div style="height:340px;width:95%;overflow:scroll;">
-<?php
-
-echo "<table>\n";
-foreach($category as $key => $value) {
- $domain_count = line_number("blacklists/$key/domains");
- echo "<tr>\n";
- if ($config['installedpackages']['dnsblacklist']['config'][0][$key] == 1) {
- echo "<td><input type='checkbox' name='blacklist[]' value='$key' checked /></td>\n";
- echo "<td><strong>".$value['name_en']."<strong></td>\n";
- echo "<td>".$value['desc_en']."</td>\n";
- echo "<td><i>($domain_count domains)</i></td>\n";
- }
- else {
- echo "<td><input type='checkbox' name='blacklist[]' value='$key' /></td>\n";
- echo "<td><strong>".$value['name_en']."</strong></td>\n";
- echo "<td>".$value['desc_en']."</td>\n";
- echo "<td><i>($domain_count domains)</i></td>\n";
- }
- echo "</tr>\n";
- $x++;
-}
-echo "</table>\n";
-
-?>
-</div>
-<br />
-<br />
-<!--
-Select a category to edit:
--->
-<?php
-////$tmp_category = array(1=> "Edit Category", );
-////$tmp_category = str_replace(" ", " ", $category);
-//echo "<SELECT name=category>\n";
-//foreach($category as $key => $value) {
-// echo "<OPTION value='".$key."'>".$key."</option>\n";
-// $x++;
-//}
-//echo "</select>\n";
-?>
-<!-- or <u>Add your own domains</u> <i>(Coming Soon)</i>
-<br />
-<br />
--->
-<?php
- //This input guarantees that a POST is sent even if no category is selected.
- echo "<input type='hidden' name='zzz' value='required'>";
-?>
-<input type="submit" value="Save">
-</td>
-</tr>
-</table>
-</form>
-
-<?php include("fend.inc"); ?>
-
-</body>
-</html>
diff --git a/config/dnsblacklist/dnsblacklist.tmp.old b/config/dnsblacklist/dnsblacklist.tmp.old
deleted file mode 100644
index 24d34412..00000000
--- a/config/dnsblacklist/dnsblacklist.tmp.old
+++ /dev/null
@@ -1,276 +0,0 @@
-<?php
-//http://cri.univ-tlse1.fr/blacklists/index_en.php
-
- require_once('config.inc');
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- //create a category blacklist array
- $category['abortion'] = 'Abortion information excluding when related to religion';
- $category['ads'] = 'Advert servers and banned URLs';
- $category['adult'] = 'Sites containing adult material such as swearing but not porn';
- $category['aggressive'] = 'Similar to violence but more promoting than depicting';
- $category['antispyware'] = 'Sites that remove spyware';
- $category['artnudes'] = 'Art sites containing artistic nudity';
- $category['astrology'] = 'Astrology websites';
- $category['audio-video'] = 'Sites with audio or video downloads';
- $category['banking'] = 'Banking websites';
- $category['beer'] = 'Sites with information on beer or liquors';
- $category['blog'] = 'Journal/Diary websites';
- $category['cellphones'] = 'Stuff for mobile/cell phones';
- $category['chat'] = 'Sites with chat rooms etc';
- $category['childcare'] = 'Sites to do with childcare';
- //$category['cleaning'] = 'Sites to do with cleaning';
- //$category['clothing'] = 'Sites about and selling clothing';
- $category['contraception'] = 'Information about contraception';
- //$category['culinary'] = 'Sites about cooking et al';
- $category['dating'] = 'Sites about dating';
- $category['desktopsillies'] = 'Sites containing screen savers, backgrounds, cursers, pointers, and themes';
- $category['dialers'] = 'Sites with dialers such as those for pornography or trojans';
- $category['drugs'] = 'Drug related sites';
- $category['ecommerce'] = 'Sites that provide online shopping';
- $category['entertainment'] = 'Sites that promote movies, books, magazine, humor';
- $category['filehosting'] = 'Sites to do with filehosting';
- //$category['frencheducation'] = 'Sites to do with french education';
- $category['gambling'] = 'Gambling sites including stocks and shares';
- $category['games'] = 'Game related sites';
- //$category['gardening'] = 'Gardening sites';
- $category['government'] = 'Military and schools etc';
- //$category['guns'] = 'Sites with guns';
- $category['hacking'] = 'Hacking/cracking information';
- //$category['homerepair'] = 'Sites about home repair';
- //$category['hygiene'] = 'Sites about hygiene and other personal grooming related stuff';
- $category['instantmessaging'] = 'Sites that contain messenger client download and web-based messaging sites';
- //$category['jewelry'] = 'Sites about and selling jewelry';
- $category['jobsearch'] = 'Sites for finding jobs';
- $category['kidstimewasting'] = 'Sites kids often waste time on';
- $category['mail'] = 'Webmail and email sites';
- $category['marketingware'] = 'Sites about marketing products';
- $category['medical'] = 'Medical websites';
- $category['mixed_adult'] = 'Mixed adult content sites';
- $category['mobile-phone'] = 'Sites to do with mobile phones';
- $category['naturism'] = 'Sites that contain nude pictures and/or promote a nude lifestyle';
- $category['news'] = 'News sites';
- $category['onlineauctions'] = 'Online auctions';
- $category['onlinegames'] = 'Online gaming sites';
- $category['onlinepayment'] = 'Online payment sites';
- $category['personalfinance'] = 'Personal finance sites';
- //$category['pets'] = 'Pet sites';
- $category['phishing'] = 'Sites attempting to trick people into giving out private information.';
- $category['porn'] = 'Pornography';
- $category['proxy'] = 'Sites with proxies to bypass filters';
- $category['radio'] = 'non-news related radio and television';
- $category['ringtones'] = 'Sites containing ring tones, games, pictures and other';
- $category['searchengines'] = 'Search engines such as google';
- $category['sect'] = 'Sites about religious groups';
- $category['sexuality'] = 'Sites dedicated to sexuality, possibly including adult material';
- $category['shopping'] = 'Shopping sites';
- $category['socialnetworking'] = 'Social networking websites';
- $category['sportnews'] = 'Sport news sites';
- $category['sports'] = 'All sport sites';
- $category['spyware'] = 'Sites who run or have spyware software to download';
- $category['updatesites'] = 'Sites where software updates are downloaded from including virus sigs';
- $category['vacation'] = 'Sites about going on holiday';
- $category['violence'] = 'Sites containing violence';
- $category['virusinfected'] = 'Sites who host virus infected files';
- $category['warez'] = 'Sites with illegal pirate software';
- $category['weather'] = 'Weather news sites and weather related';
- //$category['weapons'] = 'Sites detailing or selling weapons';
- $category['webmail'] = 'Just webmail sites';
-
- //get line count for domains list
- function line_number ($file) {
- $result = trim(exec("wc -l $file"));
- $result_array = explode (" ", $result);
- return $result_array[0];
- }
-
- //print_r($_POST);
- //$x = 0;
- //foreach($_POST['blacklist'] as $value) {
- //$blacklist[$x]['name'] = $val;
- //$blacklist[$value] = 'zzz';
- //echo "\$category[\$x]['name'] = '$val';<br>";
- //echo "\$category['$value'] = 'zzz'; <br/>\n";
- //$x++;
- //}
- //unset($x);
- //echo "<pre>";
- //print_r($_POST["blacklist"]);
- //echo "</pre>";
- //foreach($_POST["blacklist"] as $key => $value) {
- //echo "name: ".$value."<br />";
- //$x++;
- //}
-
-if (count($_POST)>0) {
- $dnsmasqfile = "/usr/local/etc/dnsmasq.conf";
- $targetfile = "/usr/local/etc/dnsmasq.blacklist.conf";
- $includestring = "conf-file=/usr/local/etc/dnsmasq.blacklist.conf";
- $dnsmasqconf = "/usr/local/etc/dnsmasq.conf";
- //clear previous values
- foreach($category as $key => $value) {
- $config['installedpackages']['dnsblacklist']['config'][0][$key] = '';
- }
- if ($_POST['enable'] == 1) {
- //echo "enabled";
- $config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] = 1;
- }
- else {
- //echo "disabled";
- $config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] = 0;
- }
- //add the include entry for dnsmasq.blacklist.conf to dnsmasq.conf
- if (file_exists($dnsmasqfile)) {
- $getdnsmasq = file_get_contents($dnsmasqfile);
- if(stristr($getdnsmasq,'conf-file=/usr/local/etc/dnsmasq.blacklist.conf') === TRUE) {
- //include found no need to add it
- }
- else {
- $myfhandle = fopen($dnsmasqconf, 'r+');
- fwrite($myfhandle, $includestring);
- fclose($myfhandle);
- }
- }
- else {
- $my2fhandle = fopen($dnsmasqconf, 'x+');
- fwrite($my2fhandle, $includestring);
- fclose($my2fhandle);
- }
- //truncate the dnsmasq.blacklist.conf file
- if (file_exists($targetfile)) {
- $fh = fopen($targetfile, 'w');
- fclose($fh);
- }
- //build the dnsmasq.blacklist.conf
- if (count($_POST["blacklist"]) > 0) {
- foreach($_POST["blacklist"] as $value) {
- //set the current selected values
- $blackfile = "blacklists/$value/domains";
- $config['installedpackages']['dnsblacklist']['config'][0][$value] = 1;
- //if enabled write the selected categories to the dnsmasq.blacklist.conf
- if ($config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] == 1) {
- $fh2 = fopen($targetfile, 'a');
- $fh = fopen($blackfile,'r');
- while($line=fgets($fh)) {
- fwrite($fh2, "address=/" .trim($line). "/74.125.45.100". "\n");
- }
- fclose($fh);
- fclose($fh2);
- }
- }
- }
- write_config();
- services_dnsmasq_configure();
- sleep(1);
- $savemsg_dnsb = "DNS Blacklist settings have been saved.";
-}
-?>
-
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: DNS Blacklist</p>
-<form method=POST action="">
-
-<?php
-if ($config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] == 1) {
- echo "<input name='enable' type='checkbox' value='1' checked>\n";
-}
-else {
- echo "<input name='enable' type='checkbox' value='1'>\n";
-}
-?>
-
-<strong>Enable DNS Blacklist</strong><br><br>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr><td class="tabcont" >
-<?php if ($savemsg_dnsb) print_info_box($savemsg_dnsb); ?>
-
-Below is a scroll-box filled with categories you can select to be added to your blacklist. <br><br> Each category has a list of known domains/sites that will be denied access by users of this network.
-<br><br><i>(Note: Using all categories at once will require 300Mb of free memory. The <b>adult</b> and <b>porn</b> categories are rather memory intensive, requiring 200Mb together.)</i>
-<br><br><br>
-
-function ListFiles($dir) {
-
- if($dh = opendir($dir)) {
-
- $files = Array();
- $inner_files = Array();
-
- while($file = readdir($dh)) {
- if($file != "." && $file != ".." && $file[0] != '.') {
- if(is_dir($dir . "/" . $file)) {
- array_push($files, $dir);
- //$inner_files = ListFiles($dir . "/" . $file);
- //if(is_array($inner_files)) $files = array_merge($files, $inner_files);
- } else {
- //array_push($files, $dir . "/" . $file);
- }
- }
- }
-
- closedir($dh);
- return $files;
- }
-}
-
-
-foreach (ListFiles('/usr/local/www/packages/dnsblacklist/') as $key=>$file){
- echo $file ."<br />\n";
-}
-
-
-
-<div style="height:340px;width:680px;overflow:scroll;">
-<?php
-/*
-echo "<table>\n";
-foreach($category as $key => $value) {
- $domain_count = line_number("blacklists/$key/domains");
- //echo "name: ".$key."<br />";
- echo "<tr>\n";
- if ($config['installedpackages']['dnsblacklist']['config'][0][$key] == 1) {
- // echo "<td><input type='checkbox' name='blacklist[]' value='$key' checked /></td><td><strong>$key<strong></td><td>$value</td><td><i>($domain_count domains)</i></td>\n";
- }
- else {
- // echo " <td><input type='checkbox' name='blacklist[]' value='$key' /></td><td><strong>$key</strong></td><td>$value</td><td><i>($domain_count domains)</i></td>\n";
- }
- echo "</tr>\n";
- $x++;
-}
-echo "</table>\n";
-*/
-?>
-</div>
-<br />
-<br />
-<!--
-Select a category to edit:
--->
-<?php
-////$tmp_category = array(1=> "Edit Category", );
-////$tmp_category = str_replace(" ", " ", $category);
-//echo "<SELECT name=category>\n";
-//foreach($category as $key => $value) {
-// echo "<OPTION value='".$key."'>".$key."</option>\n";
-// $x++;
-//}
-//echo "</select>\n";
-?>
-<!-- or <u>Add your own domains</u> <i>(Coming Soon)</i>
-<br />
-<br />
--->
-
-<input type="submit" value="Save">
-</td>
-</tr>
-</table>
-</form>
-
-<?php include("fend.inc"); ?>
-
-</body>
-</html>
diff --git a/config/dnsblacklist/dnsblacklist.xml b/config/dnsblacklist/dnsblacklist.xml
deleted file mode 100644
index 75314810..00000000
--- a/config/dnsblacklist/dnsblacklist.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- dnsblacklist.xml
- Copyright (C) 2009 Mark J Crane
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>DNS Blacklist</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>DNS Blacklist Settings</name>
- <version>0.2.4</version>
- <title>Settings</title>
- <include_file>/usr/local/pkg/dnsblacklist.inc</include_file>
- <menu>
- <name>DNS Blacklist</name>
- <tooltiptext>DNS Blacklist settings.</tooltiptext>
- <section>Services</section>
- <configfile>dnsblacklist.xml</configfile>
- <url>/packages/dnsblacklist/dnsblacklist.php</url>
- </menu>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/packages/dnsblacklist/dnsblacklist.php</url>
- <active/>
- </tab>
- </tabs>
- <configpath>installedpackages->package->$packagename->configuration->dnsblacklist</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dnsblacklist/dnsblacklist.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dnsblacklist/dnsblacklist.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dnsblacklist/dnsblacklist.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://files.pfsense.org/packages/blacklists.tar.gz</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Variable One</fielddescr>
- <fieldname>var1</fieldname>
- <description>Enter the variable one here.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Variable Two</fielddescr>
- <fieldname>var1</fieldname>
- <description>Enter the variable one here.</description>
- <type>input</type>
- </field>
- </fields>
- <custom_add_php_command>
- </custom_add_php_command>
- <custom_php_resync_config_command>
- dnsblacklist_sync_package();
- </custom_php_resync_config_command>
- <custom_delete_php_command>
- dnsblacklist_sync_package();
- </custom_delete_php_command>
- <custom_php_install_command>
- dnsblacklist_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- dnsblacklist_deinstall_command();
- </custom_php_deinstall_command>
-</packagegui> \ No newline at end of file
diff --git a/config/dnsmasq-edns/dnsmasq-edns.inc b/config/dnsmasq-edns/dnsmasq-edns.inc
deleted file mode 100644
index d5ed930a..00000000
--- a/config/dnsmasq-edns/dnsmasq-edns.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-function dnsmasq_edns_install() {
- global $g, $config;
-
- // Test to make sure the patch is not already applied.
- $out = `patch -fslC --reverse -p1 -b .before_dnsmasq-edns -d / -i /usr/local/pkg/dnsmasq-edns.patch |& grep -ci reject`;
- if ($out == 0) {
- // If the patch has not already been applied, test to see if it will apply cleanly.
- $out = `patch -fsNlC -p1 -b .before_dnsmasq-edns -d / -i /usr/local/pkg/dnsmasq-edns.patch |& grep -ci reject`;
- if ($out == 0) {
- // The patch should apply cleanly, let 'er rip.
- mwexec("patch -fsNl -p1 -b .before_dnsmasq-edns -d / -i /usr/local/pkg/dnsmasq-edns.patch ");
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/config/dnsmasq-edns/dnsmasq-edns.patch b/config/dnsmasq-edns/dnsmasq-edns.patch
deleted file mode 100644
index 5ef93d1e..00000000
--- a/config/dnsmasq-edns/dnsmasq-edns.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/etc/inc/services.inc b/etc/inc/services.inc
-index d014b13..09b1ae8 100644
---- a/etc/inc/services.inc
-+++ b/etc/inc/services.inc
-@@ -636,7 +636,7 @@ function services_dnsmasq_configure() {
- //}
-
- /* run dnsmasq */
-- mwexec("/usr/local/sbin/dnsmasq --all-servers {$args}");
-+ mwexec("/usr/local/sbin/dnsmasq --all-servers --edns-packet-max=4096 {$args}");
-
- if ($g['booting'])
- echo "done.\n";
diff --git a/config/dnsmasq-edns/dnsmasq-edns.xml b/config/dnsmasq-edns/dnsmasq-edns.xml
deleted file mode 100644
index c63c828e..00000000
--- a/config/dnsmasq-edns/dnsmasq-edns.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- dnsmasq-edns.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Patch to increase dnsmasq EDNS size.</description>
- <requirements>pfSense 1.2.3</requirements>
- <faq>None</faq>
- <name>dnsmasq EDNS size increase</name>
- <version>0.1</version>
- <title>dnsmasq EDNS size increase</title>
- <include_file>/usr/local/pkg/dnsmasq-edns.inc</include_file>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/dnsmasq-edns/dnsmasq-edns.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/dnsmasq-edns/dnsmasq-edns.patch</item>
- </additional_files_needed>
- <custom_php_install_command>
- dnsmasq_edns_install();
- </custom_php_install_command>
-</packagegui>
diff --git a/config/dyntables/pkg/dyntables.inc b/config/dyntables/pkg/dyntables.inc
deleted file mode 100644
index 97e8a422..00000000
--- a/config/dyntables/pkg/dyntables.inc
+++ /dev/null
@@ -1,117 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- dyntables.inc
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-require_once("dyntables_classdefs.inc");
-
-function syncPackageDyntables() {
-
-}
-
-function installPackageDyntables() {
- /* move temp files */
- @rename('/usr/local/www/diag_dhcp_leases.php', '/usr/local/pkg/diag_dhcp_leases.php.org');
- @rename('/usr/local/pkg/dyntables.js', '/usr/local/www/javascript/dyntables.js');
- @rename('/usr/local/pkg/diag_dhcp_leases.php', '/usr/local/www/diag_dhcp_leases.php');
-}
-
-function deinstallPackageDyntables() {
- /* move backup files */
- @unlink('/usr/local/www/diag_dhcp_leases.php');
- @unlink('/usr/local/www/javascript/dyntables.js');
- @rename('/usr/local/pkg/diag_dhcp_leases.php.org', '/usr/local/www/diag_dhcp_leases.php');
-}
-
-function checkForExtension($alertClass) {
- if(! extension_loaded( 'json' )) {
- if(! @dl( 'json.so' )) {
- return openNoExtDialog($alertClass);
- }
- }
-}
-
-/**
- * openNoExtDialog()
- *
- * @param mixed $effectClass
- * @return
- */
-function openNoExtDialog($effectClass) {
- $alertMessage = gettext("PHP extension json.so was not found or could not be loaded. Please check you PHP installation.");
- $dialogScript = "
- <script type='text/javascript'>
- var anchor = document.getElementById('popupanchor');
-
- function openNoExtDialog(html) {
- var effect = new PopupEffect(html, {className: '${effectClass}'});
- Dialog.alert('${alertMessage}',{className:'alphacube', top:150, width:400, height:null, showEffect:effect.show.bind(effect), hideEffect:effect.hide.bind(effect)});
- }
-
- openNoExtDialog(anchor);
- </script>
- ";
-
- return $dialogScript;
-}
-
-/**
-* getWindowJSScriptRefs()
-*
-* @return an array of &lt;script /&gt; elements
-*/
-function getWindowJSScriptRefs(){
- $result = array('<script type="text/javascript" src="/javascript/windows-js/javascript/window.js"></script>',
- '<script type="text/javascript" src="/javascript/windows-js/javascript/window_effects.js"></script>',
- '<script type="text/javascript" src="/javascript/windows-js/javascript/debug.js"></script>');
-
- return $result;
-}
-
-/**
-* getWindowJSStyleRefs()
-*
-* @return an array of &lt;style /&gt; tags
-*/
-function getWindowJSStyleRefs(){
- $result = array('<link href="/javascript/windows-js/themes/default.css" rel="stylesheet" type="text/css" />',
- '<link href="/javascript/windows-js/themes/alert.css" rel="stylesheet" type="text/css" />',
- '<link href="/javascript/windows-js/themes/alphacube.css" rel="stylesheet" type="text/css" />');
-
- return $result;
-}
-
-?> \ No newline at end of file
diff --git a/config/dyntables/pkg/dyntables.xml b/config/dyntables/pkg/dyntables.xml
deleted file mode 100644
index 8047b80b..00000000
--- a/config/dyntables/pkg/dyntables.xml
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- dyntables.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>
- This package adds dynamic reloading support of table data to
- various pfSense web pages. Reloading table data is done using
- Ajax.
- </description>
- <requirements>
- This package is supposed to be run on RELENG based pfSense systems.
- </requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>dyntables</name>
- <version>1.0</version>
- <title>System: Dynamic Tables</title>
- <include_file>/usr/local/pkg/dyntables.inc</include_file>
- <!-- Menu is where this packages menu will appear -->
- <!--
- <menu>
- <name>Menu Name</name>
- <section>Menu Section</section>
- <url>/phpfile.php</url>
- </menu>
- -->
- <!--
- <service>
- <name>yourservice</name>
- <rcfile>/usr/local/etc/rc.d/yourservice.sh</rcfile>
- </service>
- -->
- <tabs />
- <!--
- configpath gets expanded out automatically and config items
- will be stored in that location
- -->
- <configpath>['installedpackages']['dyntables']['config']</configpath>
- <!--
- |
- | PHP files (user management)
- |
- -->
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dyntables/www/php/diag_dhcp_leases.php</item>
- </additional_files_needed>
- <!--
- |
- | JavaScript files (*.js and *.inc.)
- |
- -->
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dyntables/www/js/dyntables.js</item>
- </additional_files_needed>
- <!--
- |
- | Include files (class defs etc.)
- |
- -->
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dyntables/pkg/dyntables.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dyntables/pkg/dyntables_classdefs.inc</item>
- </additional_files_needed>
- <!--
- |
- | Binary files
- |
- -->
- <additional_files_needed>
- <prefix>/usr/local/lib/php/extensions/no-debug-non-zts-20020429/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/dyntables/bin/json.so</item>
- </additional_files_needed>
- <!--
- fields gets invoked when the user adds or edits a item. The following items
- will be parsed and rendered for the user as a gui with input, and selectboxes.
- -->
- <!--
- Arbitrary PHP Code, that gets executed if a certain event gets triggered.
- -->
- <custom_php_resync_config_command>
- syncPackageDyntables();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- installPackageDyntables();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- deinstallPackageDyntables();
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/dyntables/pkg/dyntables_classdefs.inc b/config/dyntables/pkg/dyntables_classdefs.inc
deleted file mode 100644
index 696170d1..00000000
--- a/config/dyntables/pkg/dyntables_classdefs.inc
+++ /dev/null
@@ -1,146 +0,0 @@
-<?php
-/* $Id$ */
-/* ========================================================================== */
-/*
- classdefs.inc
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-if (! class_exists("Object")) {
- class Object {
- function Object() {
- $args = func_get_args();
- if (method_exists($this, '__destruct')) {
- register_shutdown_function(array(&$this, '__destruct'));
- }
- call_user_func_array(array(&$this, '__construct'), $args);
- }
-
- function __construct() {
- }
- }
-}
-
-class Column extends Object {
- var $defaultClass = "listhdrr";
- var $class = null;
- var $name = null;
- var $sortID = null;
-
- function __construct($name) {
- // Perform object initialization here.
- parent::__construct();
- $this->name = $name;
- }
-
- function setClass($class) {
- $this->class = $class;
- }
-
- function getClass() {
- return $this->class;
- }
-
- function setSortID($id) {
- $this->sortID = $id;
- }
-
- function getSortID() {
- return $this->sortID;
- }
-
- function toHTML() {
- global $_GET;
-
- $classString = $this->class != null ? $this->class : $this->defaultClass;
- $allString = isset($_GET['all']) ? ", {$_GET['all']}" : "";
- return "<td class='{$classString}'><a id='{$this->sortID}' href='#' onclick='sortTable(this{$allString});'>{$this->name}</a></td>";
- }
-}
-
-class Table extends Object {
- var $columns = null;
- var $data = null;
-
- function __construct() {
- // Perform object initialization here.
- parent::__construct();
- $this->columns = array();
- $this->data = array();
- }
-
- function addColumn($column, $id = null, $class = null) {
- $column = new Column($column);
-
- if ($id != null) {
- $column->setSortID($id);
- }
- if ($class != null) {
- $column->setClass($class);
- }
-
- $this->columns[] = $column;
- }
-
- function addDataSet($dataSet) {
- if (is_array($dataSet)) {
- if (count($dataSet) == count($this->columns)) {
- $this->data[] = $dataSet;
- } else {
- trigger_error("Dataset does not match column size.");
- }
- } else {
- trigger_error("Adding non arrays as datasets to a table is not supported.");
- }
- }
-
- function setData(&$data) {
- $this->data = $data;
- }
-
- function getData() {
- return $this->data;
- }
-
- function getColumnHTML() {
- $htmlString = "";
-
- foreach($this->columns as $column) {
- $htmlString .= $column->toHtml();
- }
-
- return "<tr>{$htmlString}</tr>";
- }
-}
-
-?> \ No newline at end of file
diff --git a/config/dyntables/www/js/dyntables.js b/config/dyntables/www/js/dyntables.js
deleted file mode 100644
index 0e90a3c1..00000000
--- a/config/dyntables/www/js/dyntables.js
+++ /dev/null
@@ -1,287 +0,0 @@
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng_wizard.js
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
-
-function openInfoDialog() {
- Dialog.info("Reloading table data ...",
- {className:"alphacube", width:200, height:75, top:100, showProgress: true});
-}
-
-/**
- *
- * @access public
- * @return void
- **/
-function getFirstTD(node, index){
- var firstTD = node.childNodes[index];
-
- if (firstTD.tagName == 'TD') {
- return firstTD;
- } else {
- return getFirstTD(node, ++index);
- }
-}
-
-/**
- *
- * @access public
- * @return void
- **/
-function getTableRow(nodes, index){
- var row = nodes[index];
-
- if (row.tagName == 'TR') {
- return row;
- } else {
- return getTableRow(nodes, ++index);
- }
-}
-
-/**
- *
- * @access public
- * @return void
- **/
-function emtyDhcpLeaseTable(table) {
- var tbody = table.childNodes[1];
- var trNodes = tbody.childNodes;
-
- for (i = 0; i < trNodes.length; i++) {
- var currentRow = getTableRow(trNodes, i);
- var firstTd = getFirstTD(currentRow, 0);
- var classAttrib = firstTd.className;
-
- if (classAttrib == 'listhdrr') {
- continue;
- } else if (currentRow.tagName == 'TR') {
- tbody.removeChild(currentRow);
- }
- }
-}
-
-/**
- * TODO: data[if], $fspans, $fspane,
- *
- **/
-function dhcpLeaseTableToHTML(table, json, theme) {
- var tbody = table.childNodes[1];
-
- if (json && json.length > 0) {
- for (i = 0; i < json.length; i++) {
- /* text nodes */
- var newActTxt = document.createTextNode(json[i]['act']);
- var newEndTxt = document.createTextNode(json[i]['end']);
- var newStartTxt = document.createTextNode(json[i]['start']);
- var newHostnameTxt = document.createTextNode(json[i]['hostname']);
- var newIPTxt = document.createTextNode(json[i]['ip']);
- var newMACTxt = document.createTextNode(json[i]['mac']);
- var newOnlineTxt = document.createTextNode(json[i]['online']);
- var newTypeTxt = document.createTextNode(json[i]['type']);
-
- var newTR = document.createElement("tr");
- var newTRIdAttrib = document.createAttribute("id");
- newTRIdAttrib.nodeValue = "dhcpRow" + i;
- newTR.setAttributeNode(newTRIdAttrib);
-
- /* IP td element */
- var newIPTD = document.createElement("td");
- /* TD attributes */
- var newIPTDClassAttrib = document.createAttribute("class");
- newIPTDClassAttrib.nodeValue = "listlr";
- /* assign attribs */
- newIPTD.setAttributeNode(newIPTDClassAttrib);
-
- /* MAC td element */
- var newMACTD = document.createElement("td");
- /* TD attributes */
- var newMACTDClassAttrib = document.createAttribute("class");
- newMACTDClassAttrib.nodeValue = "listr";
- /* assign attribs */
- newMACTD.setAttributeNode(newMACTDClassAttrib);
-
- /* Hostname td element */
- var newHostnameTD = document.createElement("td");
- /* TD attributes */
- var newHostnameTDClassAttrib = document.createAttribute("class");
- newHostnameTDClassAttrib.nodeValue = "listr";
- /* assign attribs */
- newHostnameTD.setAttributeNode(newHostnameTDClassAttrib);
-
- /* Start td element */
- var newStartTD = document.createElement("td");
- /* TD attributes */
- var newStartTDClassAttrib = document.createAttribute("class");
- newStartTDClassAttrib.nodeValue = "listr";
- /* assign attribs */
- newStartTD.setAttributeNode(newStartTDClassAttrib);
-
- /* End td element */
- var newEndTD = document.createElement("td");
- /* TD attributes */
- var newEndTDClassAttrib = document.createAttribute("class");
- newEndTDClassAttrib.nodeValue = "listr";
- /* assign attribs */
- newEndTD.setAttributeNode(newEndTDClassAttrib);
-
- /* Online td element */
- var newOnlineTD = document.createElement("td");
- /* TD attributes */
- var newOnlineTDClassAttrib = document.createAttribute("class");
- newOnlineTDClassAttrib.nodeValue = "listr";
- /* assign attribs */
- newOnlineTD.setAttributeNode(newOnlineTDClassAttrib);
-
- /* Lease td element */
- var newLeaseTD = document.createElement("td");
- /* TD attributes */
- var newLeaseTDClassAttrib = document.createAttribute("class");
- newLeaseTDClassAttrib.nodeValue = "listr";
- /* assign attribs */
- newLeaseTD.setAttributeNode(newLeaseTDClassAttrib);
-
- /* Mapping td element */
- var newMappingTD = document.createElement("td");
- /* TD attributes */
- var newMappingTDClassAttrib = document.createAttribute("class");
- newMappingTDClassAttrib.nodeValue = "list";
- var newMappingTDValignAttrib = document.createAttribute("valign");
- newMappingTDValignAttrib.nodeValue = "middle";
- /* assign attribs */
- newMappingTD.setAttributeNode(newMappingTDClassAttrib);
- newMappingTD.setAttributeNode(newMappingTDValignAttrib);
-
- /* WOL td element */
- var newWOLTD = document.createElement("td");
- /* TD attributes */
- var newWOLTDValignAttrib = document.createAttribute("valign");
- newWOLTDValignAttrib.nodeValue = "middle";
- /* assign attribs */
- newWOLTD.setAttributeNode(newWOLTDValignAttrib);
-
- /* Mapping anchor */
- var newMappingAnchor = document.createElement("a");
- /* Anchor attribs */
- var newMappingAnchorHrefAttrib = document.createAttribute("href");
- newMappingAnchorHrefAttrib.nodeValue = "services_dhcp_edit.php?if=lan&mac=" + json[i]['mac'] + "&hostname=" + json[i]['hostname'];
- /* assign attribs */
- newMappingAnchor.setAttributeNode(newMappingAnchorHrefAttrib);
-
- /* Mapping button */
- var newMappingButton = document.createElement("img");
- /* Button attribs */
- var newMappingButtonSrcAttrib = document.createAttribute("src");
- newMappingButtonSrcAttrib.nodeValue = "/themes/" + theme + "/images/icons/icon_plus.gif";
- var newMappingButtonWidthAttrib = document.createAttribute("width");
- newMappingButtonWidthAttrib.nodeValue = "17";
- var newMappingButtonHeightAttrib = document.createAttribute("height");
- newMappingButtonHeightAttrib.nodeValue = "17";
- var newMappingButtonBorderAttrib = document.createAttribute("border");
- newMappingButtonBorderAttrib.nodeValue = "0";
- var newMappingButtonTitleAttrib = document.createAttribute("title");
- newMappingButtonTitleAttrib.nodeValue = "add a static mapping for this MAC address";
- var newMappingButtonAltAttrib = document.createAttribute("alt");
- newMappingButtonAltAttrib.nodeValue = "add a static mapping for this MAC address";
- /* assign attribs */
- newMappingButton.setAttributeNode(newMappingButtonSrcAttrib);
- newMappingButton.setAttributeNode(newMappingButtonWidthAttrib);
- newMappingButton.setAttributeNode(newMappingButtonHeightAttrib);
- newMappingButton.setAttributeNode(newMappingButtonBorderAttrib);
- newMappingButton.setAttributeNode(newMappingButtonTitleAttrib);
- newMappingButton.setAttributeNode(newMappingButtonAltAttrib);
-
- /* WOL anchor */
- var newWOLAnchor = document.createElement("a");
- /* Anchor attribs */
- var newWOLAnchorHrefAttrib = document.createAttribute("href");
- newWOLAnchorHrefAttrib.nodeValue = "services_wol_edit.php?if=lan&mac=" + json[i]['mac'] + "&descr=pfSense";
- /* assign attribs */
- newWOLAnchor.setAttributeNode(newWOLAnchorHrefAttrib);
-
- /* WOL button */
- var newWOLButton = document.createElement("img");
- /* Button attribs */
- var newWOLButtonSrcAttrib = document.createAttribute("src");
- newWOLButtonSrcAttrib.nodeValue = "/themes/" + theme + "/images/icons/icon_wol_all.gif";
- var newWOLButtonWidthAttrib = document.createAttribute("width");
- newWOLButtonWidthAttrib.nodeValue = "17";
- var newWOLButtonHeightAttrib = document.createAttribute("height");
- newWOLButtonHeightAttrib.nodeValue = "17";
- var newWOLButtonBorderAttrib = document.createAttribute("border");
- newWOLButtonBorderAttrib.nodeValue = "0";
- var newWOLButtonTitleAttrib = document.createAttribute("title");
- newWOLButtonTitleAttrib.nodeValue = "add a Wake on Lan mapping for this MAC address";
- var newWOLButtonAltAttrib = document.createAttribute("alt");
- newWOLButtonAltAttrib.nodeValue = "add a Wake on Lan mapping for this MAC address";
- /* assign attribs */
- newWOLButton.setAttributeNode(newWOLButtonSrcAttrib);
- newWOLButton.setAttributeNode(newWOLButtonWidthAttrib);
- newWOLButton.setAttributeNode(newWOLButtonHeightAttrib);
- newWOLButton.setAttributeNode(newWOLButtonBorderAttrib);
- newWOLButton.setAttributeNode(newWOLButtonTitleAttrib);
- newWOLButton.setAttributeNode(newWOLButtonAltAttrib);
-
- /* assign buttons to anchor elements */
- newMappingAnchor.appendChild(newMappingButton);
- newWOLAnchor.appendChild(newWOLButton);
-
- /* assign anchors to TD elements */
- newMappingTD.appendChild(newMappingAnchor);
- newWOLTD.appendChild(newWOLAnchor);
-
- /* assign text nodes to TD elements */
- newIPTD.appendChild(newIPTxt);
- newMACTD.appendChild(newMACTxt);
- newHostnameTD.appendChild(newHostnameTxt);
- newStartTD.appendChild(newStartTxt);
- newEndTD.appendChild(newEndTxt);
- newOnlineTD.appendChild(newOnlineTxt);
- newLeaseTD.appendChild(newActTxt);
-
- /* populate table body */
- newTR.appendChild(newIPTD);
- newTR.appendChild(newMACTD);
- newTR.appendChild(newHostnameTD);
- newTR.appendChild(newStartTD);
- newTR.appendChild(newEndTD);
- newTR.appendChild(newOnlineTD);
- newTR.appendChild(newLeaseTD);
- newTR.appendChild(newMappingTD);
- newTR.appendChild(newWOLTD);
-
- tbody.appendChild(newTR);
- }
- }
-} \ No newline at end of file
diff --git a/config/dyntables/www/php/diag_dhcp_leases.php b/config/dyntables/www/php/diag_dhcp_leases.php
deleted file mode 100644
index 4ff8e241..00000000
--- a/config/dyntables/www/php/diag_dhcp_leases.php
+++ /dev/null
@@ -1,440 +0,0 @@
-<?php
-/* $Id$ */
-/*
- diag_dhcp_leases.php
- Copyright (C) 2004 Scott Ullrich
- All rights reserved.
-
- originially part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-require("dyntables.inc");
-
-/* ========================================================================== */
-/* ======================= NON GUI RELATED FUNCTIONS ======================== */
-/* ========================================================================== */
-
-function leasecmp($a, $b) {
- return strcmp($a[$_GET['order']], $b[$_GET['order']]);
-}
-
-function adjust_gmt($dt) {
- $ts = strtotime($dt . " GMT");
- return strftime("%Y/%m/%d %H:%M:%S", $ts);
-}
-
-function remove_duplicate($array, $field)
-{
- foreach ($array as $sub)
- $cmp[] = $sub[$field];
- $unique = array_unique($cmp);
- foreach ($unique as $k => $rien)
- $new[] = $array[$k];
- return $new;
-}
-
-$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases";
-$awk = "/usr/bin/awk";
-/* this pattern sticks comments into a single array item */
-$cleanpattern = "'{ gsub(\"#.*\", \"\");} { gsub(\";\", \"\"); print;}'";
-/* We then split the leases file by } */
-$splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i; printf \"}\\n\";}'";
-
-/* stuff the leases file in a proper format into a array by line */
-exec("cat {$leasesfile} | {$awk} {$cleanpattern} | {$awk} {$splitpattern}", $leases_content);
-$leases_count = count($leases_content);
-
-$pools = array();
-$leases = array();
-$i = 0;
-$l = 0;
-$p = 0;
-
-// Put everything together again
-while($i < $leases_count) {
- /* split the line by space */
- $data = explode(" ", $leases_content[$i]);
- /* walk the fields */
- $f = 0;
- $fcount = count($data);
- /* with less then 20 fields there is nothing useful */
- if($fcount < 20) {
- $i++;
- continue;
- }
- while($f < $fcount) {
- switch($data[$f]) {
- case "failover":
- $pools[$p]['name'] = $data[$f+2];
- $pools[$p]['mystate'] = $data[$f+7];
- $pools[$p]['peerstate'] = $data[$f+14];
- $pools[$p]['mydate'] = $data[$f+10];
- $pools[$p]['mydate'] .= " " . $data[$f+11];
- $pools[$p]['peerdate'] = $data[$f+17];
- $pools[$p]['peerdate'] .= " " . $data[$f+18];
- $p++;
- $i++;
- continue 3;
- case "lease":
- $leases[$l]['ip'] = $data[$f+1];
- $leases[$l]['type'] = "dynamic";
- $f = $f+2;
- break;
- case "starts":
- $leases[$l]['start'] = $data[$f+2];
- $leases[$l]['start'] .= " " . $data[$f+3];
- $f = $f+3;
- break;
- case "ends":
- $leases[$l]['end'] = $data[$f+2];
- $leases[$l]['end'] .= " " . $data[$f+3];
- $f = $f+3;
- break;
- case "tstp":
- $f = $f+3;
- break;
- case "tsfp":
- $f = $f+3;
- break;
- case "atsfp":
- $f = $f+3;
- break;
- case "cltt":
- $f = $f+3;
- break;
- case "binding":
- switch($data[$f+2]) {
- case "active":
- $leases[$l]['act'] = "active";
- break;
- case "free":
- $leases[$l]['act'] = "expired";
- $leases[$l]['online'] = "offline";
- break;
- case "backup":
- $leases[$l]['act'] = "reserved";
- $leases[$l]['online'] = "offline";
- break;
- }
- $f = $f+1;
- break;
- case "next":
- /* skip the next binding statement */
- $f = $f+3;
- break;
- case "hardware":
- $leases[$l]['mac'] = $data[$f+2];
- /* check if it's online and the lease is active */
- if($leases[$l]['act'] == "active") {
- $online = exec("/usr/sbin/arp -an |/usr/bin/awk '/{$leases[$l]['ip']}/ {print}'|wc -l");
- if ($online == 1) {
- $leases[$l]['online'] = 'online';
- } else {
- $leases[$l]['online'] = 'offline';
- }
- }
- $f = $f+2;
- break;
- case "client-hostname":
- if($data[$f+1] <> "") {
- $leases[$l]['hostname'] = preg_replace('/"/','',$data[$f+1]);
- } else {
- $hostname = gethostbyaddr($leases[$l]['ip']);
- if($hostname <> "") {
- $leases[$l]['hostname'] = $hostname;
- }
- }
- $f = $f+1;
- break;
- case "uid":
- $f = $f+1;
- break;
- }
- $f++;
- }
- $l++;
- $i++;
-}
-
-/* remove duplicate items by mac address */
-if(count($leases) > 0) {
- $leases = remove_duplicate($leases,"ip");
-}
-
-if(count($pools) > 0) {
- $pools = remove_duplicate($pools,"name");
- asort($pools);
-}
-
-foreach($config['interfaces'] as $ifname => $ifarr) {
- if (is_array($config['dhcpd'][$ifname]['staticmap'])) {
- foreach($config['dhcpd'][$ifname]['staticmap'] as $static) {
- $slease = array();
- $slease['ip'] = $static['ipaddr'];
- $slease['type'] = "static";
- $slease['mac'] = $static['mac'];
- $slease['start'] = gmdate("M d Y H:i:s", time());
- $slease['end'] = gmdate("M d Y H:i:s", time());
- $slease['end'] = gmdate("M d Y H:i:s", strtotime('+5 minutes'));
- $slease['hostname'] = $static['hostname'];
- $slease['act'] = "static";
- $online = exec("/usr/sbin/arp -an |/usr/bin/grep {$slease['mac']}| /usr/bin/wc -l|/usr/bin/awk '{print $1;}'");
- if ($online == 1) {
- $slease['online'] = 'online';
- } else {
- $slease['online'] = 'offline';
- }
- $leases[] = $slease;
- }
- }
-}
-
-/* ========================================================================== */
-/* ====================== PROCESS POST AND GET VARS ========================= */
-/* ========================================================================== */
-
-if ($_GET['order']) {
- usort($leases, "leasecmp");
-} else if ($_GET['refresh']) {
- dl( 'json.so' );
- echo json_encode($leases);
- exit;
-}
-
-/* ========================================================================== */
-/* =================== GUI RELATED FUNCTIONS AND STUFF ====================== */
-/* ========================================================================== */
-
-$pgtitle = "Diagnostics: DHCP leases";
-
-$effectStyle = '
- <style type="text/css">
- .popup_dialog {
- background: #000000;
- opacity: 0.2;
- }
- </style>
-';
-
-include("head.inc");
-
-// add extra stuff to HTML head
-if (isset($pfSenseHead)) {
- $pfSenseHead->setCloseHead(false);
- print($pfSenseHead->getHTML());
-} else {
- $closehead = false;
-}
-
-$scriptaculousRefs = '
- <script type="text/javascript" src="/javascript/scriptaculous/prototype.js"></script>
- <script type="text/javascript" src="/javascript/scriptaculous/scriptaculous.js"></script>
-';
-
-$ajaxRequest = "
-<script type='text/javascript' src='/javascript/dyntables.js'></script>
-<script type='text/javascript'>
-<!--
- function refreshTable(column, all) {
- var myAjax = new Ajax.Request(
- '{$_SERVER['SCRIPT_NAME']}',
- {
- method: 'get',
- parameters: { refresh: 'true' },
- onLoading: openInfoDialog,
- onSuccess: function(transport) {
- var json = transport.responseText.evalJSON();
- var table = document.getElementById('sortabletable');
-
- emtyDhcpLeaseTable(table);
- dhcpLeaseTableToHTML(table, json, '{$g['theme']}');
- Dialog.closeInfo();
- }
- });
- }
-//-->
-</script>
-";
-
-print($ajaxRequest);
-print($scriptaculousRefs);
-
-foreach(getWindowJSScriptRefs() as $jscript){
- print("{$jscript}\n");
-}
-
-foreach(getWindowJSStyleRefs() as $style){
- print("{$style}\n");
-}
-
-print($effectStyle);
-
-?>
-<script type="text/javascript" src="/javascript/sorttable.js"></script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php
-/* only print pool status when we have one */
-if(count($pools) > 0) {
-?>
-<table class="sortable" id="sortabletable" name="sortabletable" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Failover Group</a></td>
- <td class="listhdrr">My State</a></td>
- <td class="listhdrr">Since</a></td>
- <td class="listhdrr">Peer State</a></td>
- <td class="listhdrr">Since</a></td>
- </tr>
-<?php
-foreach ($pools as $data) {
- echo "<tr>\n";
- echo "<td class=\"listlr\">{$fspans}{$data['name']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['mystate']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['mydate']) . "{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['peerstate']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['peerdate']) . "{$fspane}&nbsp;</td>\n";
- echo "<td class=\"list\" valign=\"middle\" width=\"17\">&nbsp;</td>\n";
- echo "<td class=\"list\" valign=\"middle\" width=\"17\">&nbsp;</td>\n";
- echo "</tr>\n";
-}
-
-?>
-</table>
-
-<?php
-/* only print pool status when we have one */
-}
-
-$table = new Table();
-
-// assemble columns
-$table->addColumn("IP address", "ip");
-$table->addColumn("MAC address", "mac");
-$table->addColumn("Hostname", "hostname");
-$table->addColumn("Start", "start");
-$table->addColumn("End", "end");
-$table->addColumn("Online", "online");
-$table->addColumn("Lease Type", "act", "listhdr");
-
-// populate table data
-$table->setData($leases);
-
-?>
-
-<p>
-
-<table class="sortable" id="sortabletable" name="sortabletable" width="100%" border="0" cellpadding="0" cellspacing="0">
-<?= $table->getColumnHTML(); ?>
-<?php
-foreach ($table->getData() as $data) {
- if (($data['act'] == "active") || ($data['act'] == "static") || ($_GET['all'] == 1)) {
- if ($data['act'] != "active" && $data['act'] != "static") {
- $fspans = "<span class=\"gray\">";
- $fspane = "</span>";
- } else {
- $fspans = $fspane = "";
- }
- $lip = ip2long($data['ip']);
- if ($data['act'] == "static") {
- foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
- if(is_array($dhcpifconf['staticmap'])) {
- foreach ($dhcpifconf['staticmap'] as $staticent) {
- if ($data['ip'] == $staticent['ipaddr']) {
- $data['if'] = $dhcpif;
- break;
- }
- }
- }
- /* exit as soon as we have an interface */
- if ($data['if'] != "")
- break;
- }
- } else {
- foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
- if (($lip >= ip2long($dhcpifconf['range']['from'])) && ($lip <= ip2long($dhcpifconf['range']['to']))) {
- $data['if'] = $dhcpif;
- break;
- }
- }
- }
- echo "<tr>\n";
- echo "<td class=\"listlr\">{$fspans}{$data['ip']}{$fspane}&nbsp;</td>\n";
- if ($data['online'] != "online") {
- echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&mac={$data['mac']}\" title=\"send Wake on Lan packet to mac\">{$data['mac']}</a>{$fspane}&nbsp;</td>\n";
- } else {
- echo "<td class=\"listr\">{$fspans}{$data['mac']}{$fspane}&nbsp;</td>\n";
- }
- echo "<td class=\"listr\">{$fspans}{$data['hostname']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['start']) . "{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['end']) . "{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['online']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['act']}{$fspane}&nbsp;</td>\n";
-
- if ($data['type'] == "dynamic") {
- echo "<td class=\"list\" valign=\"middle\"><a href=\"services_dhcp_edit.php?if={$data['if']}&mac={$data['mac']}&hostname={$data['hostname']}\">";
- echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"add a static mapping for this MAC address\"></a></td>\n";
- } else {
- echo "<td class=\"list\" valign=\"middle\">";
- echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus_mo.gif\" width=\"17\" height=\"17\" border=\"0\"></td>\n";
- }
-
- echo "<td valign=\"middle\"><a href=\"services_wol_edit.php?if={$data['if']}&mac={$data['mac']}&descr={$data['hostname']}\">";
- echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_wol_all.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"add a Wake on Lan mapping for this MAC address\"></a></td>\n";
- echo "</tr>\n";
- }
-}
-
-?>
-</table>
-<p>
-<form action="diag_dhcp_leases.php" method="GET">
-<input type="hidden" name="order" value="<?=$_GET['order'];?>">
-<?php if ($_GET['all']): ?>
-<input type="hidden" name="all" value="0">
-<input type="submit" class="formbtn" value="Show active and static leases only">
-<?php else: ?>
-<input type="hidden" name="all" value="1">
-<input type="submit" class="formbtn" value="Show all configured leases">
-<?php endif; ?>
-</form>
-<?php if($leases == 0): ?>
-<p><strong>No leases file found. Is the DHCP server active?</strong></p>
-<?php endif; ?>
-
-<div id="popupanchor">&#160;</div>
-<?= checkForExtension("popup_dialog"); ?>
-<?php include("fend.inc"); ?>
-<script type="text/javascript">
-<!--
- window.setInterval("refreshTable()", 20000);
-//-->
-</script>
-</body>
-</html>
diff --git a/config/freeradius.inc b/config/freeradius/freeradius.inc
index 6f0b1f38..6f0b1f38 100644
--- a/config/freeradius.inc
+++ b/config/freeradius/freeradius.inc
diff --git a/config/freeradius.xml b/config/freeradius/freeradius.xml
index 20f6675b..63cdc8d2 100644
--- a/config/freeradius.xml
+++ b/config/freeradius/freeradius.xml
@@ -119,17 +119,17 @@
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
<chmod>0775</chmod>
- <item>https://packages.pfsense.org/packages/config/freeradiusclients.xml</item>
+ <item>https://packages.pfsense.org/packages/config/freeradius/freeradiusclients.xml</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
<chmod>0775</chmod>
- <item>https://packages.pfsense.org/packages/config/freeradiussettings.xml</item>
+ <item>https://packages.pfsense.org/packages/config/freeradius/freeradiussettings.xml</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
<chmod>0775</chmod>
- <item>https://packages.pfsense.org/packages/config/freeradius.inc</item>
+ <item>https://packages.pfsense.org/packages/config/freeradius/freeradius.inc</item>
</additional_files_needed>
<fields>
<field>
@@ -261,4 +261,4 @@ Here are a few sample time strings with an explanation of what they mean.
<custom_php_deinstall_command>
freeradius_deinstall_command();
</custom_php_deinstall_command>
-</packagegui> \ No newline at end of file
+</packagegui>
diff --git a/config/freeradiusclients.xml b/config/freeradius/freeradiusclients.xml
index e9417581..e9417581 100644
--- a/config/freeradiusclients.xml
+++ b/config/freeradius/freeradiusclients.xml
diff --git a/config/freeradiussettings.xml b/config/freeradius/freeradiussettings.xml
index 31634a37..31634a37 100644
--- a/config/freeradiussettings.xml
+++ b/config/freeradius/freeradiussettings.xml
diff --git a/config/haproxy-stable/haproxy.inc b/config/haproxy-stable/haproxy.inc
deleted file mode 100644
index 2b132a85..00000000
--- a/config/haproxy-stable/haproxy.inc
+++ /dev/null
@@ -1,581 +0,0 @@
-<?php
-/*
- haproxy.inc
- Copyright (C) 2009 Scott Ullrich <sullrich@pfsense.com>
- Copyright (C) 2008 Remco Hoef
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/* include all configuration functions */
-require_once("functions.inc");
-require_once("pkg-utils.inc");
-require_once("notices.inc");
-
-$d_haproxyconfdirty_path = $g['varrun_path'] . "/haproxy.conf.dirty";
-
-$a_acltypes = array();
-$a_acltypes[] = array('name' => 'host_starts_with', 'descr' => 'Host starts with',
- 'mode' => 'http', 'syntax' => 'hdr_beg(host) -i');
-$a_acltypes[] = array('name' => 'host_ends_with', 'descr' => 'Host ends with',
- 'mode' =>'http', 'syntax' => 'hdr_end(host) -i');
-$a_acltypes[] = array('name' => 'host_matches', 'descr' => 'Host matches',
- 'mode' =>'http', 'syntax' => 'hdr(host) -i');
-$a_acltypes[] = array('name' => 'host_regex', 'descr' => 'Host regex',
- 'mode' =>'http', 'syntax' => 'hdr_reg(host) -i');
-$a_acltypes[] = array('name' => 'host_contains', 'descr' => 'Host contains',
- 'mode' => 'http', 'syntax' => 'hdr_dir(host) -i');
-$a_acltypes[] = array('name' => 'path_starts_with', 'descr' => 'Path starts with',
- 'mode' => 'http', 'syntax' => 'path_beg -i');
-$a_acltypes[] = array('name' => 'path_ends_with', 'descr' => 'Path ends with',
- 'mode' => 'http', 'syntax' => 'path_end -i');
-$a_acltypes[] = array('name' => 'path_matches', 'descr' => 'Path matches',
- 'mode' => 'http', 'syntax' => 'path -i');
-$a_acltypes[] = array('name' => 'path_regex', 'descr' => 'Path regex',
- 'mode' => 'http', 'syntax' => 'path_reg -i');
-$a_acltypes[] = array('name' => 'path_contains', 'descr' => 'Path contains',
- 'mode' => 'http', 'syntax' => 'path_dir -i');
-$a_acltypes[] = array('name' => 'source_ip', 'descr' => 'Source IP',
- 'mode' => '', 'syntax' => 'src');
-
-function haproxy_custom_php_deinstall_command() {
- exec("rm /usr/local/sbin/haproxy");
- exec("rm /usr/local/pkg/haproxy.inc");
- exec("rm /usr/local/www/haproxy*");
-}
-
-function haproxy_custom_php_install_command() {
- global $g, $config;
- conf_mount_rw();
-
- $haproxy = <<<EOD
-#!/bin/sh
-
-# PROVIDE: haproxy
-# REQUIRE: LOGIN
-# KEYWORD: FreeBSD
-
-. /etc/rc.subr
-
-name="haproxy"
-rcvar=`set_rcvar`
-command="/usr/local/bin/haproxy"
-haproxy_enable=\${haproxy-"YES"}
-
-start_cmd="haproxy_start"
-stop_postcmd="haproxy_stop"
-
-load_rc_config \$name
-
-haproxy_start () {
- echo "Starting haproxy."
- /usr/bin/env \
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
- /usr/local/bin/php -q -d auto_prepend_file=config.inc <<ENDOFF
- <?php
- require_once("globals.inc");
- require_once("functions.inc");
- require_once("haproxy.inc");
- haproxy_configure();
- ?>
-ENDOFF
-}
-
-haproxy_stop () {
- echo "Stopping haproxy."
- killall haproxy
-}
-
-run_rc_command "\$1"
-
-EOD;
-
- $fd = fopen("/usr/local/etc/rc.d/haproxy.sh", "w");
- fwrite($fd, $haproxy);
- fclose($fd);
- exec("chmod a+rx /usr/local/etc/rc.d/haproxy.sh");
-
- conf_mount_ro();
-
- exec("/usr/local/etc/rc.d/haproxy.sh start");
-}
-
-function haproxy_find_acl($name) {
- global $a_acltypes;
-
- /* XXX why is this broken from xmlsync? */
- if (!$a_acltypes) {
- $a_acltypes = array();
- $a_acltypes[] = array('name' => 'host_starts_with', 'descr' => 'Host starts with',
- 'mode' => 'http', 'syntax' => 'hdr_beg(host) -i');
- $a_acltypes[] = array('name' => 'host_ends_with', 'descr' => 'Host ends with',
- 'mode' =>'http', 'syntax' => 'hdr_end(host) -i');
- $a_acltypes[] = array('name' => 'host_matches', 'descr' => 'Host matches',
- 'mode' =>'http', 'syntax' => 'hdr(host) -i');
- $a_acltypes[] = array('name' => 'host_regex', 'descr' => 'Host regex',
- 'mode' =>'http', 'syntax' => 'hdr_reg(host) -i');
- $a_acltypes[] = array('name' => 'host_contains', 'descr' => 'Host contains',
- 'mode' => 'http', 'syntax' => 'hdr_dir(host) -i');
- $a_acltypes[] = array('name' => 'path_starts_with', 'descr' => 'Path starts with',
- 'mode' => 'http', 'syntax' => 'path_beg -i');
- $a_acltypes[] = array('name' => 'path_ends_with', 'descr' => 'Path ends with',
- 'mode' => 'http', 'syntax' => 'path_end -i');
- $a_acltypes[] = array('name' => 'path_matches', 'descr' => 'Path matches',
- 'mode' => 'http', 'syntax' => 'path -i');
- $a_acltypes[] = array('name' => 'path_regex', 'descr' => 'Path regex',
- 'mode' => 'http', 'syntax' => 'path_reg -i');
- $a_acltypes[] = array('name' => 'path_contains', 'descr' => 'Path contains',
- 'mode' => 'http', 'syntax' => 'path_dir -i');
- $a_acltypes[] = array('name' => 'source_ip', 'descr' => 'Source IP',
- 'mode' => '', 'syntax' => 'src');
- }
-
- if($a_acltypes) {
- foreach ($a_acltypes as $acl) {
- if ($acl['name'] == $name)
- return $acl;
- }
- }
-}
-
-function write_backend($fd, $name, $pool, $frontend) {
- if($pool['status'] != 'active' || !is_array($pool['ha_servers']['item']))
- return;
-
- fwrite ($fd, "backend " . $name . "\n");
- if($pool['cookie_name'] && strtolower($frontend['type']) == "http")
- fwrite ($fd, "\tcookie\t\t\t" . $pool['cookie_name'] . " insert indirect\n");
-
- // https is an alias for tcp for clarity purpouses
- if(strtolower($frontend['type']) == "https") {
- $backend_type = "tcp";
- $httpchk = "ssl-hello-chk";
- } else {
- $backend_type = $frontend['type'];
- $httpchk = "httpchk";
- }
-
- fwrite ($fd, "\tmode\t\t\t" . $backend_type . "\n");
-
- if($frontend['balance'])
- fwrite ($fd, "\tbalance\t\t\t" . $frontend['balance'] . "\n");
-
- if($frontend['connection_timeout'])
- fwrite ($fd, "\tcontimeout\t\t" . $frontend['connection_timeout'] . "\n");
-
- if($frontend['server_timeout'])
- fwrite ($fd, "\tsrvtimeout\t\t" . $frontend['server_timeout'] . "\n");
-
- if($frontend['retries'])
- fwrite ($fd, "\tretries\t\t\t" . $frontend['retries'] . "\n");
-
- if($frontend['stats_enabled']=='yes') {
- fwrite ($fd, "\tstats\t\t\tenable\n");
- if($frontend['stats_uri'])
- fwrite ($fd, "\tstats\t\t\turi ".$frontend['stats_uri']."\n");
- if($frontend['stats_realm'])
- fwrite ($fd, "\tstats\t\t\trealm " . $frontend['stats_realm'] . "\n");
- else
- fwrite ($fd, "\tstats\t\t\trealm .\n");
- fwrite ($fd, "\tstats\t\t\tauth " . $frontend['stats_username'].":". $frontend['stats_password']."\n");
- }
-
- $uri = $pool['monitor_uri'];
- if ($pool['monitor_uri'])
- $uri = $pool['monitor_uri'];
- else
- $uri = "/";
- fwrite ($fd, "\toption\t\t\t{$httpchk} HEAD " . $uri . " HTTP/1.0\n");
-
- if($pool['cookie'] && strtolower($frontend['type']) == "http")
- $cookie = " cookie {$pool['cookie']} ";
- else
- $cookie = "";
- if($pool['advanced']) {
- $advanced = base64_decode($pool['advanced']);
- $advanced_txt = " " . $advanced;
- } else {
- $advanced_txt = "";
- }
- if($pool['checkinter'])
- $checkinter = "check inter {$pool['checkinter']}";
- else if (strtolower($frontend['type']) != "tcp")
- $checkinter = "check inter 1000";
- else
- $checkinter = "";
-
- $a_servers = &$pool['ha_servers']['item'];
- foreach($a_servers as $be) {
- if(!$be['port']) {
- // the listener can specify a default port
- $be['port'] = $frontend['svrport'];
- }
- if(!$be['port']) {
- // last resort, use the frontend port
- $ports = split(",", "{$frontend['port']},");
- $be['port'] = $ports[0];
- }
- if (!$be['name'])
- $be['name'] = $be['address'];
- if($be['backup']) {
- $isbackup = "backup";
- } else {
- $isbackup = "";
- }
- fwrite ($fd, "\tserver\t\t\t" . $be['name'] . " " . $be['address'].":" . $be['port'] . " $cookie " . " $checkinter $isbackup weight " . $be['weight'] . "{$advanced_txt}\n");
- }
- fwrite ($fd, "\n");
-}
-
-function haproxy_configure() {
- global $config, $g;
-
- $a_global = &$config['installedpackages']['haproxy'];
- $a_backends = &$config['installedpackages']['haproxy']['ha_backends']['item'];
- $a_pools = &$config['installedpackages']['haproxy']['ha_pools']['item'];
-
- $fd = fopen("{$g['varetc_path']}/haproxy.cfg", "w");
-
- if(is_array($a_global)) {
- fwrite ($fd, "global\n");
- if($a_global['advanced'])
- fwrite ($fd, "\t" . base64_decode($a_global['advanced']) . "\n");
- fwrite ($fd, "\tmaxconn\t\t\t".$a_global['maxconn']."\n");
- if($a_global['remotesyslog'])
- fwrite ($fd, "\tlog\t\t\t{$a_global['remotesyslog']}\t{$a_global['logfacility']}\t{$a_global['loglevel']}\n");
- fwrite ($fd, "\tuid\t\t\t80\n");
- fwrite ($fd, "\tgid\t\t\t80\n");
- // Set numprocs if defined or use system default (#cores)
- if($a_global['nbproc'])
- $numprocs = $a_global['nbproc'];
- else
- $numprocs = trim(`/sbin/sysctl kern.smp.cpus | cut -d" " -f2`);
- fwrite ($fd, "\tnbproc\t\t\t$numprocs\n");
- fwrite ($fd, "\tchroot\t\t\t/var/empty\n");
- fwrite ($fd, "\tdaemon\n");
- fwrite ($fd, "\n");
- }
-
- // Try and get a unique array for address:port as frontends can duplicate
- $a_bind = array();
- if(is_array($a_backends)) {
- foreach ($a_backends as $backend) {
- if($backend['status'] != 'active')
- continue;
- if(!$backend['pool'])
- continue;
-
- $bname = $backend['extaddr'] . ":" . $backend['port'];
- if (!is_array($a_bind[$bname])) {
- $a_bind[$bname] = array();
- $a_bind[$bname]['config'] = array();
- // Settings which are constant for a merged frontend
- $a_bind[$bname]['name'] = $backend['name'];
- $a_bind[$bname]['defaultpool'] = $backend['pool'] . "_" . strtolower($backend['type']);
- $a_bind[$bname]['extaddr'] = $backend['extaddr'];
- $a_bind[$bname]['port'] = $backend['port'];
- }
- $b = &$a_bind[$bname];
-
- // Overwrite ?
- $b['type'] = $backend['type'];
- $b['forwardfor'] = $backend['forwardfor'];
- $b['httpclose'] = $backend['httpclose'];
- $b['max_connections'] = $backend['max_connections'];
- $b['client_timeout'] = $backend['client_timeout'];
- $b['advanced'] = $backend['advanced'];
-
- // pointer to each backend
- $b['config'][] = $backend;
- }
- }
-
- $a_pendingpl = array();
-
- // Construct and write out configuration file
- if(is_array($a_bind)) {
- foreach ($a_bind as $bind) {
- if (count($bind['config']) > 1)
- $frontendinfo = "frontend {$bind['name']}-merged\n";
- else
- $frontendinfo = "frontend {$bind['name']}\n";
-
- // Prepare ports for processing by splitting
- $portss = "{$bind['port']},";
- $ports = split(",", $portss);
-
- // Initialize variable
- $listenip = "";
-
- // Process and add bind directives for ports
- foreach($ports as $port) {
- if($port) {
- if($bind['extaddr'] == "any")
- $listenip .= "\tbind\t\t\t0.0.0.0:{$port}\n";
- elseif($bind['extaddr'])
- $listenip .= "\tbind\t\t\t{$bind['extaddr']}:{$port}\n";
- else
- $listenip .= "\tbind\t\t\t" . get_current_wan_address('wan') . ":{$port}\n";
- }
- }
-
- fwrite ($fd, "{$frontendinfo}");
- fwrite ($fd, "{$listenip}");
-
- // Advanced pass thru
- if($bind['advanced']) {
- $advanced = base64_decode($bind['advanced']);
- fwrite($fd, "\t" . $advanced . "\n");
- }
-
- // https is an alias for tcp for clarity purpouses
- if(strtolower($bind['type']) == "https") {
- $backend_type = "tcp";
- $httpchk = "ssl-hello-chk";
- } else {
- $backend_type = $bind['type'];
- $httpchk = "httpchk";
- }
-
- fwrite ($fd, "\tmode\t\t\t" . $backend_type . "\n");
- fwrite ($fd, "\tlog\t\t\tglobal\n");
- fwrite ($fd, "\toption\t\t\tdontlognull\n");
-
- if($bind['httpclose'])
- fwrite ($fd, "\toption\t\t\thttpclose\n");
-
- if($bind['forwardfor'])
- fwrite ($fd, "\toption\t\t\tforwardfor\n");
-
- if($bind['max_connections'])
- fwrite ($fd, "\tmaxconn\t\t\t" . $bind['max_connections'] . "\n");
-
- if($bind['client_timeout'])
- fwrite ($fd, "\tclitimeout\t\t" . $bind['client_timeout'] . "\n");
-
- fwrite ($fd, "\tdefault_backend\t\t" . $bind['defaultpool'] . "\n");
-
- // Combine the rest of the listener configs
- $i = 0;
- foreach ($bind['config'] as $bconfig) {
- $a_acl=&$bconfig['ha_acls']['item'];
- if(!is_array($a_acl))
- $a_acl=array();
-
- $poolname = $bconfig['pool'] . "_" . strtolower($bconfig['type']);
- if (!isset($a_pendingpl[$poolname])) {
- $a_pendingpl[$poolname] = array();
- $a_pendingpl[$poolname]['name'] = $poolname;
- $a_pendingpl[$poolname]['frontend'] = $bconfig;
- }
-
- foreach ($a_acl as $entry) {
- $acl = haproxy_find_acl($entry['expression']);
- if (!$acl)
- continue;
-
- // Filter out acls for different modes
- if ($acl['mode'] != '' && $acl['mode'] != strtolower($bind['type']))
- continue;
-
- if ($acl['syntax'] != '')
- $expr = $acl['syntax'] . " " . $entry['value'];
- else
- $expr = $entry['expression'] . " " . $entry['value'];
-
- $aclname = $i . "_" . $entry['name'];
- fwrite ($fd, "\tacl\t\t\t" . $aclname . "\t" . $expr . "\n");
- fwrite ($fd, "\tuse_backend\t\t" . $poolname . " if " . $aclname . "\n");
- $i++;
- }
-
- }
- fwrite ($fd, "\n");
- }
- }
- if (is_array($a_pendingpl) && is_array($a_pools)) {
- foreach ($a_pendingpl as $pending) {
- foreach ($a_pools as $pool) {
- if ($pending['frontend']['pool'] == $pool['name']) {
- write_backend($fd, $pending['name'], $pool, $pending['frontend']);
- }
- }
- }
- }
- fwrite ($fd, "\n");
-
- // Sync HAProxy configuration (if enabled)
- if(isset($config['installedpackages']['haproxy']['enablesync'])) {
- if($config['installedpackages']['haproxy']['synchost1']) {
- haproxy_do_xmlrpc_sync($config['installedpackages']['haproxy']['synchost1'],
- $config['installedpackages']['haproxy']['syncpassword']);
- }
- if($config['installedpackages']['haproxy']['synchost2']) {
- haproxy_do_xmlrpc_sync($config['installedpackages']['haproxy']['synchost2'],
- $config['installedpackages']['haproxy']['syncpassword']);
- }
- if($config['installedpackages']['haproxy']['synchost3']) {
- haproxy_do_xmlrpc_sync($config['installedpackages']['haproxy']['synchost3'],
- $config['installedpackages']['haproxy']['syncpassword']);
- }
- }
-
- // create config file
- fclose($fd);
-
- $freebsd_version = substr(trim(`uname -r`), 0, 1);
- if(!file_exists("/usr/bin/limits")) {
- exec("fetch -q -o /usr/bin/limits https://files.pfsense.org/extras/{$freebsd_version}/limits");
- exec("chmod a+rx /usr/bin/limits");
- }
-
- exec("/usr/bin/limits -n 300014");
-
- // reload haproxy
- if(isset($a_global['enable'])) {
- if(is_process_running('haproxy')) {
- exec("/usr/local/sbin/haproxy -f /var/etc/haproxy.cfg -p /var/run/haproxy.pid -st `cat /var/run/haproxy.pid`");
- } else {
- exec("/usr/local/sbin/haproxy -f /var/etc/haproxy.cfg -p /var/run/haproxy.pid -D");
- }
- return (0);
- } else {
- return (1);
- }
-}
-
-function haproxy_do_xmlrpc_sync($sync_to_ip, $password) {
- global $config, $g;
-
- if(!$password)
- return;
-
- if(!$sync_to_ip)
- return;
-
- // Do not allow syncing to self.
- $donotsync = false;
- $lanip = find_interface_ip($config['interfaces']['lan']['if']);
- if($lanip == $sync_to_ip)
- $donotsync = true;
- $wanip = find_interface_ip($config['interfaces']['wan']['if']);
- if($wanip == $sync_to_ip)
- $donotsync = true;
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- $optip = find_interface_ip($config['interfaces']['opt' . $j]['if']);
- if($optip == $sync_to_ip)
- $donotsync = true;
- }
- if($donotsync) {
- log_error("Disallowing sync loop for HAProxy sync.");
- return;
- }
-
- $xmlrpc_sync_neighbor = $sync_to_ip;
- if($config['system']['webgui']['protocol'] != "") {
- $synchronizetoip = $config['system']['webgui']['protocol'];
- $synchronizetoip .= "://";
- }
- $port = $config['system']['webgui']['port'];
- /* if port is empty lets rely on the protocol selection */
- if($port == "") {
- if($config['system']['webgui']['protocol'] == "http")
- $port = "80";
- else
- $port = "443";
- }
- $synchronizetoip .= $sync_to_ip;
-
- /* xml will hold the sections to sync */
- $xml = array();
- $xml['haproxy'] = $config['installedpackages']['haproxy'];
-
- // Prevent sync loops
- unset($xml['synchost1']);
- unset($xml['synchost2']);
- unset($xml['synchost3']);
- unset($xml['syncpassword']);
-
- /* assemble xmlrpc payload */
- $params = array(
- XML_RPC_encode($password),
- XML_RPC_encode($xml)
- );
-
- /* set a few variables needed for sync code borrowed from filter.inc */
- $url = $synchronizetoip;
- log_error("Beginning HAProxy XMLRPC sync to {$url}:{$port}.");
- $method = 'pfsense.merge_installedpackages_section_xmlrpc';
- $msg = new XML_RPC_Message($method, $params);
- $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
- $cli->setCredentials('admin', $password);
- if($g['debug'])
- $cli->setDebug(1);
- /* send our XMLRPC message and timeout after 250 seconds */
- $resp = $cli->send($msg, "250");
- if(!$resp) {
- $error = "A communications error occurred while attempting HAProxy XMLRPC sync with {$url}:{$port}.";
- log_error($error);
- file_notice("sync_settings", $error, "HAProxy Settings Sync", "");
- } elseif($resp->faultCode()) {
- $cli->setDebug(1);
- $resp = $cli->send($msg, "250");
- $error = "An error code was received while attempting HAProxy XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
- log_error($error);
- file_notice("sync_settings", $error, "HAProxy Settings Sync", "");
- } else {
- log_error("HAProxy XMLRPC sync successfully completed with {$url}:{$port}.");
- }
-
- /* tell haproxy to reload our settings on the destionation sync host. */
- $method = 'pfsense.exec_php';
- $execcmd = "require_once('/usr/local/pkg/haproxy.inc');\n";
- $execcmd .= "haproxy_configure();\n";
-
- /* assemble xmlrpc payload */
- $params = array(
- XML_RPC_encode($password),
- XML_RPC_encode($execcmd)
- );
-
- log_error("HAProxy XMLRPC reload data {$url}:{$port}.");
- $msg = new XML_RPC_Message($method, $params);
- $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
- $cli->setCredentials('admin', $password);
- $resp = $cli->send($msg, "250");
- if(!$resp) {
- $error = "A communications error occurred while attempting HAProxy XMLRPC sync with {$url}:{$port} (pfsense.exec_php).";
- log_error($error);
- file_notice("sync_settings", $error, "HAProxy Settings Reload", "");
- } elseif($resp->faultCode()) {
- $cli->setDebug(1);
- $resp = $cli->send($msg, "250");
- $error = "An error code was received while attempting HAProxy XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
- log_error($error);
- file_notice("sync_settings", $error, "HAProxy Settings Sync", "");
- } else {
- log_error("HAProxy XMLRPC reload data success with {$url}:{$port} (pfsense.exec_php).");
- }
-}
-
-?>
diff --git a/config/haproxy-stable/haproxy.xml b/config/haproxy-stable/haproxy.xml
deleted file mode 100644
index a69b5df9..00000000
--- a/config/haproxy-stable/haproxy.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- haproxy.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2009 Scott Ullrich
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>haproxy</name>
- <version>1.0</version>
- <title>HAProxy</title>
- <aftersaveredirect>/pkg_ediwt.php?xml=haproxy_pools.php</aftersaveredirect>
- <include_file>/usr/local/pkg/haproxy.inc</include_file>
- <menu>
- <name>HAProxy</name>
- <tooltiptext></tooltiptext>
- <section>Services</section>
- <url>/haproxy_listeners.php</url>
- </menu>
- <service>
- <name>HAProxy</name>
- <rcfile>haproxy.sh</rcfile>
- <executable>haproxy</executable>
- <description>The Reliable, High Performance TCP/HTTP Load Balancer</description>
- </service>
- <configpath>installedpackages->haproxy->config</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/haproxy-stable/haproxy.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/haproxy-stable/haproxy_listeners.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/haproxy-stable/haproxy_listeners_edit.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/haproxy-stable/haproxy_global.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/haproxy-stable/haproxy_pools.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/haproxy-stable/haproxy_pool_edit.php</item>
- </additional_files_needed>
- <custom_delete_php_command>
- </custom_delete_php_command>
- <custom_add_php_command>
- </custom_add_php_command>
- <custom_php_resync_config_command>
- </custom_php_resync_config_command>
- <custom_php_install_command>
- $freebsdv=trim(`uname -r | cut -d'.' -f1`);
- conf_mount_rw();
- `fetch -q -o /usr/local/sbin/ https://files.pfsense.org/packages/7/haproxy-dev/haproxy`;
- exec("chmod a+rx /usr/local/sbin/haproxy");
- haproxy_custom_php_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- haproxy_custom_php_deinstall_command();
- </custom_php_deinstall_command>
- <custom_php_command_before_form>
- </custom_php_command_before_form>
-</packagegui>
diff --git a/config/haproxy-stable/haproxy_global.php b/config/haproxy-stable/haproxy_global.php
deleted file mode 100755
index 47c8d1ec..00000000
--- a/config/haproxy-stable/haproxy_global.php
+++ /dev/null
@@ -1,382 +0,0 @@
-<?php
-/* $Id: load_balancer_pool.php,v 1.5.2.6 2007/03/02 23:48:32 smos Exp $ */
-/*
- haproxy_global.php
- part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2009 Scott Ullrich <sullrich@pfsense.com>
- Copyright (C) 2008 Remco Hoef <remcoverhoef@pfsense.com>
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("globals.inc");
-require("guiconfig.inc");
-require_once("haproxy.inc");
-
-$d_haproxyconfdirty_path = $g['varrun_path'] . "/haproxy.conf.dirty";
-
-if (!is_array($config['installedpackages']['haproxy']))
- $config['installedpackages']['haproxy'] = array();
-
-
-if ($_POST) {
- unset($input_errors);
- $pconfig = $_POST;
-
- if ($_POST['apply']) {
- $retval = 0;
- config_lock();
- $retval = haproxy_configure();
- config_unlock();
- $savemsg = get_std_save_message($retval);
- unlink_if_exists($d_haproxyconfdirty_path);
- } else {
- if ($_POST['enable']) {
- $reqdfields = explode(" ", "maxconn");
- $reqdfieldsn = explode(",", "Maximum connections");
- }
-
- $pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
- if ($pf_version < 2.1)
- $input_errors = eval('do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); return $input_errors;');
- else
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
-
- if ($_POST['maxconn'] && (!is_numeric($_POST['maxconn'])))
- $input_errors[] = "The maximum number of connections should be numeric.";
-
- if($_POST['synchost1'] && !is_ipaddr($_POST['synchost1']))
- $input_errors[] = "Synchost1 needs to be an IPAddress.";
- if($_POST['synchost2'] && !is_ipaddr($_POST['synchost2']))
- $input_errors[] = "Synchost2 needs to be an IPAddress.";
- if($_POST['synchost3'] && !is_ipaddr($_POST['synchost3']))
- $input_errors[] = "Synchost3 needs to be an IPAddress.";
-
- if (!$input_errors) {
- $config['installedpackages']['haproxy']['enable'] = $_POST['enable'] ? true : false;
- $config['installedpackages']['haproxy']['maxconn'] = $_POST['maxconn'] ? $_POST['maxconn'] : false;
- $config['installedpackages']['haproxy']['enablesync'] = $_POST['enablesync'] ? true : false;
- $config['installedpackages']['haproxy']['synchost1'] = $_POST['synchost1'] ? $_POST['synchost1'] : false;
- $config['installedpackages']['haproxy']['synchost2'] = $_POST['synchost2'] ? $_POST['synchost2'] : false;
- $config['installedpackages']['haproxy']['synchost2'] = $_POST['synchost3'] ? $_POST['synchost3'] : false;
- $config['installedpackages']['haproxy']['remotesyslog'] = $_POST['remotesyslog'] ? $_POST['remotesyslog'] : false;
- $config['installedpackages']['haproxy']['logfacility'] = $_POST['logfacility'] ? $_POST['logfacility'] : false;
- $config['installedpackages']['haproxy']['loglevel'] = $_POST['loglevel'] ? $_POST['loglevel'] : false;
- $config['installedpackages']['haproxy']['syncpassword'] = $_POST['syncpassword'] ? $_POST['syncpassword'] : false;
- $config['installedpackages']['haproxy']['advanced'] = $_POST['advanced'] ? base64_encode($_POST['advanced']) : false;
- $config['installedpackages']['haproxy']['nbproc'] = $_POST['nbproc'] ? $_POST['nbproc'] : false;
- touch($d_haproxyconfdirty_path);
- write_config();
- }
- }
-
-}
-
-$pconfig['enable'] = isset($config['installedpackages']['haproxy']['enable']);
-$pconfig['maxconn'] = $config['installedpackages']['haproxy']['maxconn'];
-$pconfig['enablesync'] = isset($config['installedpackages']['haproxy']['enablesync']);
-$pconfig['syncpassword'] = $config['installedpackages']['haproxy']['syncpassword'];
-$pconfig['synchost1'] = $config['installedpackages']['haproxy']['synchost1'];
-$pconfig['synchost2'] = $config['installedpackages']['haproxy']['synchost2'];
-$pconfig['synchost3'] = $config['installedpackages']['haproxy']['synchost3'];
-$pconfig['remotesyslog'] = $config['installedpackages']['haproxy']['remotesyslog'];
-$pconfig['logfacility'] = $config['installedpackages']['haproxy']['logfacility'];
-$pconfig['loglevel'] = $config['installedpackages']['haproxy']['loglevel'];
-$pconfig['advanced'] = base64_decode($config['installedpackages']['haproxy']['advanced']);
-$pconfig['nbproc'] = $config['installedpackages']['haproxy']['nbproc'];
-
-// defaults
-if (!$pconfig['logfacility'])
- $pconfig['logfacility'] = 'local0';
-if (!$pconfig['loglevel'])
- $pconfig['loglevel'] = 'info';
-
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version < 2.0)
- $one_two = true;
-
-$pgtitle = "Services: HAProxy: Settings";
-include("head.inc");
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<script type="text/javascript" src="javascript/scriptaculous/prototype.js"></script>
-<script type="text/javascript" src="javascript/scriptaculous/scriptaculous.js"></script>
-<?php include("fbegin.inc"); ?>
-<script language="JavaScript">
-<!--
-function enable_change(enable_change) {
- var endis;
- endis = !(document.iform.enable.checked || enable_change);
- document.iform.maxconn.disabled = endis;
-}
-//-->
-</script>
-<?php if($one_two): ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php endif; ?>
-<form action="haproxy_global.php" method="post" name="iform">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<?php if (file_exists($d_haproxyconfdirty_path)): ?><p>
-<?php print_info_box_np("The load balancer configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
-<?php endif; ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
- <?php
- /* active tabs */
- $tab_array = array();
- $tab_array[] = array("Settings", true, "haproxy_global.php");
- $tab_array[] = array("Listener", false, "haproxy_listeners.php");
- $tab_array[] = array("Server Pool", false, "haproxy_pools.php");
- display_top_tabs($tab_array);
- ?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td colspan="2" valign="top" class="listtopic">General settings</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
- <strong>Enable HAProxy</strong></td>
- </tr>
- <tr>
- <td valign="top" class="vncell">
- Maximum connections
- </td>
- <td class="vtable">
- <table><tr><td>
- <table cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <input name="maxconn" type="text" class="formfld" id="maxconn" size="5" <?if ($pconfig['enable']!='yes') echo "enabled=\"false\"";?> value="<?=htmlspecialchars($pconfig['maxconn']);?>"> per Backend.
- </td>
- </tr>
- </table>
- Sets the maximum per-process number of concurrent connections to X.<br/>
- <strong>NOTE:</strong> setting this value too high will result in HAProxy not being able to allocate enough memory.<br/>
- <?php
- $hascpu = trim(`top | grep haproxy | awk '{ print $6 }'`);
- if($hascpu)
- echo "<p>Current memory usage {$hascpu}.</p>";
- ?>
- </td><td>
- <table style="border: 1px solid #000;">
- <tr>
- <td><font size=-1>Connections</td>
- <td><font size=-1>Memory usage</td>
- </tr>
- <tr>
- <td colspan="2">
- <hr noshade style="border: 1px solid #000;">
- </td>
- </tr>
- <tr>
- <td align="right"><font size=-1>999</td>
- <td><font size=-1>1888K</td>
- </tr>
- <tr>
- <td align="right"><font size=-1>99999</td>
- <td><font size=-1>8032K</td>
- </tr>
- <tr>
- <td align="right"><font size=-1>999999</td>
- <td><font size=-1>50016K</td>
- </tr>
- <tr>
- <td align="right"><font size=-1>9999999</td>
- <td><font size=-1>467M</td>
- </tr>
- </table>
- </td></tr></table>
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">
- Number of processes to start
- </td>
- <td class="vtable">
- <input name="nbproc" type="text" class="formfld" id="nbproc" size="18" value="<?=htmlspecialchars($pconfig['nbproc']);?>">
- <br/>
- Defaults to number of cores/processors installed if left blank (<?php echo trim(`/sbin/sysctl kern.smp.cpus | cut -d" " -f2`); ?> detected).
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">
- Remote syslog host
- </td>
- <td class="vtable">
- <input name="remotesyslog" type="text" class="formfld" id="remotesyslog" size="18" value="<?=htmlspecialchars($pconfig['remotesyslog']);?>">
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">
- Syslog facility
- </td>
- <td class="vtable">
- <select name="logfacility" class="formfld">
- <?php
- $facilities = array("kern", "user", "mail", "daemon", "auth", "syslog", "lpr",
- "news", "uucp", "cron", "auth2", "ftp", "ntp", "audit", "alert", "cron2",
- "local0", "local1", "local2", "local3", "local4", "local5", "local6", "local7");
- foreach ($facilities as $f):
- ?>
- <option value="<?=$f;?>" <?php if ($f == $pconfig['logfacility']) echo "selected"; ?>>
- <?=$f;?>
- </option>
- <?php
- endforeach;
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">
- Syslog level
- </td>
- <td class="vtable">
- <select name="loglevel" class="formfld">
- <?php
- $levels = array("emerg", "alert", "crit", "err", "warning", "notice", "info", "debug");
- foreach ($levels as $l):
- ?>
- <option value="<?=$l;?>" <?php if ($l == $pconfig['loglevel']) echo "selected"; ?>>
- <?=$l;?>
- </option>
- <?php
- endforeach;
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <td>
- &nbsp;
- </td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic">Global Advanced pass thru</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <textarea name='advanced' rows="4" cols="70" id='advanced'><?php echo $pconfig['advanced']; ?></textarea>
- <br/>
- NOTE: paste text into this box that you would like to pass thru in the global settings area.
- </td>
- </tr>
- <tr>
- <td>
- &nbsp;
- </td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic">Configuration synchronization</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <input name="enablesync" type="checkbox" value="yes" <?php if ($pconfig['enablesync']) echo "checked"; ?>>
- <strong>Sync HAProxy configuration to backup CARP members via XMLRPC.</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Synchronization password</td>
- <td width="78%" class="vtable">
- <input name="syncpassword" type="password" value="<?=$pconfig['syncpassword'];?>">
- <br/>
- <strong>Enter the password that will be used during configuration synchronization. This is generally the remote webConfigurator password.</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Sync host #1</td>
- <td width="78%" class="vtable">
- <input name="synchost1" value="<?=$pconfig['synchost1'];?>">
- <br/>
- <strong>Synchronize settings to this hosts IP address.</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Sync host #2</td>
- <td width="78%" class="vtable">
- <input name="synchost2" value="<?=$pconfig['synchost2'];?>">
- <br/>
- <strong>Synchronize settings to this hosts IP address.</strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Sync host #3</td>
- <td width="78%" class="vtable">
- <input name="synchost3" value="<?=$pconfig['synchost3'];?>">
- <br/>
- <strong>Synchronize settings to this hosts IP address.</strong>
- </td>
- </tr>
- <tr>
- <td>
- &nbsp;
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save" onClick="enable_change(true)">
- </td>
- </td>
- </tr>
- </table>
- </div>
-</table>
-
-<?php if(file_exists("/var/etc/haproxy.cfg")): ?>
- <p/>
- <div id="configuration" style="display:none; border-style:dashed; padding: 8px;">
- <b><i>/var/etc/haproxy.cfg file contents:</b></i>
- <?php
- if(file_exists("/var/etc/haproxy.cfg")) {
- echo "<pre>" . trim(file_get_contents("/var/etc/haproxy.cfg")) . "</pre>";
- }
- ?>
- </div>
- <div id="showconfiguration">
- <a onClick="new Effect.Fade('showconfiguration'); new Effect.Appear('configuration'); setTimeout('scroll_after_fade();', 250); return false;" href="#">Show</a> automatically generated configuration.
- </div>
-<?php endif; ?>
-
-</form>
-<script language="JavaScript">
- function scroll_after_fade() {
- scrollTo(0,99999999999);
- }
-<!--
-enable_change(false);
-//-->
-</script>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/haproxy-stable/haproxy_listeners.php b/config/haproxy-stable/haproxy_listeners.php
deleted file mode 100755
index 8c6125f0..00000000
--- a/config/haproxy-stable/haproxy_listeners.php
+++ /dev/null
@@ -1,172 +0,0 @@
-<?php
-/* $Id: load_balancer_virtual_server.php,v 1.6.2.1 2006/01/02 23:46:24 sullrich Exp $ */
-/*
- haproxy_baclkends.php
- part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2009 Scott Ullrich <sullrich@pfsense.com>
- Copyright (C) 2008 Remco Hoef <remcoverhoef@pfsense.com>
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require_once("guiconfig.inc");
-
-$d_haproxyconfdirty_path = $g['varrun_path'] . "/haproxy.conf.dirty";
-
-require_once("haproxy.inc");
-
-if (!is_array($config['installedpackages']['haproxy']['ha_backends']['item'])) {
- $config['installedpackages']['haproxy']['ha_backends']['item'] = array();
-}
-$a_backend = &$config['installedpackages']['haproxy']['ha_backends']['item'];
-
-if ($_POST) {
- $pconfig = $_POST;
-
- if ($_POST['apply']) {
- $retval = 0;
- config_lock();
- $retval = haproxy_configure();
- config_unlock();
- $savemsg = get_std_save_message($retval);
- unlink_if_exists($d_haproxyconfdirty_path);
- }
-}
-
-if ($_GET['act'] == "del") {
- if (isset($a_backend[$_GET['id']])) {
- if (!$input_errors) {
- unset($a_backend[$_GET['id']]);
- write_config();
- touch($d_haproxyconfdirty_path);
- }
- header("Location: haproxy_listeners.php");
- exit;
- }
-}
-
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version < 2.0)
- $one_two = true;
-
-$pgtitle = "Services: HAProxy: Listener";
-include("head.inc");
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<form action="haproxy_listeners.php" method="post">
-<?php if($one_two): ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php endif; ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<?php if (file_exists($d_haproxyconfdirty_path)): ?><p>
-<?php print_info_box_np("The virtual server configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
-<?php endif; ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
- <?php
- /* active tabs */
- $tab_array = array();
- $tab_array[] = array("Settings", false, "haproxy_global.php");
- $tab_array[] = array("Listener", true, "haproxy_listeners.php");
- $tab_array[] = array("Server Pool", false, "haproxy_pools.php");
- display_top_tabs($tab_array);
- ?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="20%" class="listhdrr">Name</td>
- <td width="30%" class="listhdrr">Description</td>
- <td width="20%" class="listhdrr">Address</td>
- <td width="10%" class="listhdrr">Type</td>
- <td width="10%" class="listhdrr">Server&nbsp;pool</td>
- <td width="5%" class="list"></td>
- </tr>
-<?php
- $i = 0;
- foreach ($a_backend as $backend):
- $textss = $textse = "";
- if ($backend['status'] != 'active') {
- $textss = "<span class=\"gray\">";
- $textse = "</span>";
- }
-?>
- <tr>
- <td class="listlr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$i;?>';">
- <?=$textss . $backend['name'] . $textse;?>
- </td>
- <td class="listlr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$i;?>';">
- <?=$textss . $backend['desc'] . $textse;?>
- </td>
- <td class="listlr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$i;?>';">
-<?php
- echo $textss;
- if($backend['extaddr'] == "any")
- echo "0.0.0.0";
- elseif($backend['extaddr'])
- echo $backend['extaddr'];
- else
- echo get_current_wan_address('wan');
- echo ":" . $backend['port'];
- echo $textse;
-?>
- </td>
- <td class="listlr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$i;?>';">
- <?=$textss . $backend['type'] . $textse;?>
- </td>
- <td class="listlr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$i;?>';">
- <?=$textss . $backend['pool'] . $textse;?>
- </td>
- <td class="list" nowrap>
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="haproxy_listeners_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="haproxy_listeners.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this entry?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="haproxy_listeners_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- <tr>
- <td class="list" colspan="5"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="haproxy_listeners_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </div>
- </table>
- </form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/haproxy-stable/haproxy_listeners_edit.php b/config/haproxy-stable/haproxy_listeners_edit.php
deleted file mode 100755
index 3c698d4e..00000000
--- a/config/haproxy-stable/haproxy_listeners_edit.php
+++ /dev/null
@@ -1,779 +0,0 @@
-<?php
-/* $Id: load_balancer_pool_edit.php,v 1.24.2.23 2007/03/03 00:07:09 smos Exp $ */
-/*
- haproxy_listeners_edit.php
- part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2009 Scott Ullrich <sullrich@pfsense.com>
- Copyright (C) 2008 Remco Hoef <remcoverhoef@pfsense.com>
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-require_once("haproxy.inc");
-
-function haproxy_acl_select($mode) {
- global $a_acltypes;
-
- $seltext = '';
- foreach ($a_acltypes as $expr) {
- if ($expr['mode'] == '' || $expr['mode'] == $mode)
- $seltext .= "<option value='" . $expr['name'] . "'>" . $expr['descr'] .":</option>";
- }
- return $seltext;
-}
-
-$d_haproxyconfdirty_path = $g['varrun_path'] . "/haproxy.conf.dirty";
-
-if (!is_array($config['installedpackages']['haproxy']['ha_backends']['item'])) {
- $config['installedpackages']['haproxy']['ha_backends']['item'] = array();
-}
-
-$a_backend = &$config['installedpackages']['haproxy']['ha_backends']['item'];
-$a_pools = &$config['installedpackages']['haproxy']['ha_pools']['item'];
-
-
-if (isset($_POST['id']))
- $id = $_POST['id'];
-else
- $id = $_GET['id'];
-
-if (isset($_GET['dup']))
- $id = $_GET['dup'];
-
-if (isset($id) && $a_backend[$id]) {
- $pconfig['name'] = $a_backend[$id]['name'];
- $pconfig['desc'] = $a_backend[$id]['desc'];
- $pconfig['status'] = $a_backend[$id]['status'];
- $pconfig['connection_timeout'] = $a_backend[$id]['connection_timeout'];
- $pconfig['server_timeout'] = $a_backend[$id]['server_timeout'];
- $pconfig['retries'] = $a_backend[$id]['retries'];
-
- $pconfig['type'] = $a_backend[$id]['type'];
- $pconfig['balance'] = $a_backend[$id]['balance'];
-
- $pconfig['forwardfor'] = $a_backend[$id]['forwardfor'];
- $pconfig['httpclose'] = $a_backend[$id]['httpclose'];
-
- $pconfig['stats_enabled'] = $a_backend[$id]['stats_enabled'];
- $pconfig['stats_username'] = $a_backend[$id]['stats_username'];
- $pconfig['stats_password'] = $a_backend[$id]['stats_password'];
- $pconfig['stats_uri'] = $a_backend[$id]['stats_uri'];
- $pconfig['stats_realm'] = $a_backend[$id]['stats_realm'];
-
- $pconfig['type'] = $a_backend[$id]['type'];
- $pconfig['extaddr'] = $a_backend[$id]['extaddr'];
- $pconfig['pool'] = $a_backend[$id]['pool'];
- $pconfig['max_connections'] = $a_backend[$id]['max_connections'];
- $pconfig['client_timeout'] = $a_backend[$id]['client_timeout'];
- $pconfig['port'] = $a_backend[$id]['port'];
- $pconfig['svrport'] = $a_backend[$id]['svrport'];
- $pconfig['a_acl']=&$a_backend[$id]['ha_acls']['item'];
- $pconfig['advanced'] = base64_decode($a_backend[$id]['advanced']);
-
-}
-
-if (isset($_GET['dup']))
- unset($id);
-
-$changedesc = "Services: HAProxy: Listener";
-$changecount = 0;
-
-if ($_POST) {
- $changecount++;
-
- unset($input_errors);
- $pconfig = $_POST;
-
- if ($_POST['stats_enabled']) {
- $reqdfields = explode(" ", "name connection_timeout server_timeout stats_username stats_password stats_uri stats_realm");
- $reqdfieldsn = explode(",", "Name,Connection timeout,Server timeout,Stats Username,Stats Password,Stats Uri,Stats Realm");
- } else {
- $reqdfields = explode(" ", "name connection_timeout server_timeout");
- $reqdfieldsn = explode(",", "Name,Connection timeout,Server timeout");
- }
-
- $pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
- if ($pf_version < 2.1)
- $input_errors = eval('do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); return $input_errors;');
- else
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
-
- $reqdfields = explode(" ", "name type port max_connections client_timeout");
- $reqdfieldsn = explode(",", "Name,Type,Port,Max connections,Client timeout");
-
- $pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
- if ($pf_version < 2.1)
- $input_errors = eval('do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); return $input_errors;');
- else
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
-
- if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['name']))
- $input_errors[] = "The field 'Name' contains invalid characters.";
-
- if (!is_numeric($_POST['connection_timeout']))
- $input_errors[] = "The field 'Connection timeout' value is not a number.";
-
- if (!is_numeric($_POST['server_timeout']))
- $input_errors[] = "The field 'Server timeout' value is not a number.";
-
- if (!$_POST['retries'] && is_numeric($_POST['retries']))
- $input_errors[] = "The field 'Retries' value is not a number.";
-
- if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['stats_username']))
- $input_errors[] = "The field 'Stats Username' contains invalid characters.";
-
- if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['stats_password']))
- $input_errors[] = "The field 'Stats Password' contains invalid characters.";
-
- if (!is_numeric($_POST['max_connections']))
- $input_errors[] = "The field 'Max connections' value is not a number.";
-
- $ports = split(",", $_POST['port'] . ",");
- foreach($ports as $port)
- if ($port && !is_numeric($port))
- $input_errors[] = "The field 'Port' value is not a number.";
-
- if (!is_numeric($_POST['client_timeout']))
- $input_errors[] = "The field 'Client timeout' value is not a number.";
-
- /* Ensure that our pool names are unique */
- for ($i=0; isset($config['installedpackages']['haproxy']['ha_backends']['item'][$i]); $i++)
- if (($_POST['name'] == $config['installedpackages']['haproxy']['ha_backends']['item'][$i]['name']) && ($i != $id))
- $input_errors[] = "This listener name has already been used. Listener names must be unique.";
-
- $a_acl=array();
- $acl_names=array();
- for($x=0; $x<99; $x++) {
- $acl_name=$_POST['acl_name'.$x];
- $acl_expression=$_POST['acl_expression'.$x];
- $acl_value=$_POST['acl_value'.$x];
-
- if ($acl_name) {
- // check for duplicates
- if (in_array($acl_name, $acl_names)) {
- $input_errors[] = "The name '$acl_name' is duplicate.";
- }
-
- $acl_names[]=$acl_name;
-
- $acl=array();
- $acl['name']=$acl_name;
- $acl['expression']=$acl_expression;
- $acl['value']=$acl_value;
- $a_acl[]=$acl;
-
- if (preg_match("/[^a-zA-Z0-9\.\-_]/", $acl_name))
- $input_errors[] = "The field 'Name' contains invalid characters.";
-
- if (!preg_match("/.{2,}/", $acl_value))
- $input_errors[] = "The field 'Value' is required.";
-
- if (!preg_match("/.{2,}/", $acl_name))
- $input_errors[] = "The field 'Name' is required.";
-
- }
- }
-
- $pconfig['a_acl']=$a_acl;
-
- if (!$input_errors) {
- $backend = array();
- if(isset($id) && $a_backend[$id])
- $backend = $a_backend[$id];
-
- if($backend['name'] != "")
- $changedesc .= " modified '{$backend['name']}' pool:";
-
-
- update_if_changed("name", $backend['name'], $_POST['name']);
- update_if_changed("description", $backend['desc'], $_POST['desc']);
- update_if_changed("status", $backend['status'], $_POST['status']);
- update_if_changed("connection_timeout", $backend['connection_timeout'], $_POST['connection_timeout']);
- update_if_changed("server_timeout", $backend['server_timeout'], $_POST['server_timeout']);
- update_if_changed("retries", $backend['retries'], $_POST['retries']);
- update_if_changed("type", $backend['type'], $_POST['type']);
- update_if_changed("balance", $backend['balance'], $_POST['balance']);
- update_if_changed("cookie_name", $backend['cookie_name'], $_POST['cookie_name']);
- update_if_changed("forwardfor", $backend['forwardfor'], $_POST['forwardfor']);
- update_if_changed("httpclose", $backend['httpclose'], $_POST['httpclose']);
- update_if_changed("stats_enabled", $backend['stats_enabled'], $_POST['stats_enabled']);
- update_if_changed("stats_username", $backend['stats_username'], $_POST['stats_username']);
- update_if_changed("stats_password", $backend['stats_password'], $_POST['stats_password']);
- update_if_changed("stats_uri", $backend['stats_uri'], $_POST['stats_uri']);
- update_if_changed("stats_realm", $backend['stats_realm'], $_POST['stats_realm']);
- update_if_changed("type", $backend['type'], $_POST['type']);
- update_if_changed("port", $backend['port'], $_POST['port']);
- update_if_changed("svrport", $backend['svrport'], $_POST['svrport']);
- update_if_changed("extaddr", $backend['extaddr'], $_POST['extaddr']);
- update_if_changed("pool", $backend['pool'], $_POST['pool']);
- update_if_changed("max_connections", $backend['max_connections'], $_POST['max_connections']);
- update_if_changed("client_timeout", $backend['client_timeout'], $_POST['client_timeout']);
- update_if_changed("advanced", $backend['advanced'], base64_encode($_POST['advanced']));
-
- $backend['ha_acls']['item'] = $a_acl;
-
- if (isset($id) && $a_backend[$id]) {
- $a_backend[$id] = $backend;
- } else {
- $a_backend[] = $backend;
- }
-
- if ($changecount > 0) {
- touch($d_haproxyconfdirty_path);
- write_config($changedesc);
- }
-
- header("Location: haproxy_listeners.php");
- exit;
- }
-}
-
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version < 2.0)
- $one_two = true;
-
-$pgtitle = "HAProxy: Listener: Edit";
-include("head.inc");
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php if($one_two): ?>
-<script type="text/javascript" src="/javascript/scriptaculous/prototype.js"></script>
-<script type="text/javascript" src="/javascript/scriptaculous/scriptaculous.js"></script>
-<?php endif; ?>
-<script type="text/javascript">
- // Global Variables
- var rowname = new Array(99);
- var rowtype = new Array(99);
- var newrow = new Array(99);
- var rowsize = new Array(99);
-
- for (i = 0; i < 99; i++) {
- rowname[i] = '';
- rowtype[i] = '';
- newrow[i] = '';
- rowsize[i] = '25';
- }
-
- var field_counter_js = 0;
- var loaded = 0;
- var is_streaming_progress_bar = 0;
- var temp_streaming_text = "";
-
- var addRowTo = (function() {
- return (function (tableId) {
- var d, tbody, tr, td, bgc, i, ii, j, type, seltext;
- var btable, btbody, btr, btd;
-
- d = document;
- type = d.getElementById("type").value;
- if (type == 'health')
- seltext = "<?php echo haproxy_acl_select('health');?>";
- else if (type == 'tcp')
- seltext = "<?php echo haproxy_acl_select('tcp');?>";
- else if (type == 'https')
- seltext = "<?php echo haproxy_acl_select('https');?>";
- else
- seltext = "<?php echo haproxy_acl_select('http');?>";
- if (seltext == '') {
- alert("No ACL types available in current listener mode");
- return;
- }
-
- tbody = d.getElementById(tableId).getElementsByTagName("tbody").item(0);
- tr = d.createElement("tr");
- totalrows++;
- tr.setAttribute("id","aclrow" + totalrows);
- for (i = 0; i < field_counter_js; i++) {
- td = d.createElement("td");
- if(rowtype[i] == 'textbox') {
- td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows +
- "'></input><input size='" + rowsize[i] + "' name='" + rowname[i] + totalrows +
- "' id='" + rowname[i] + totalrows +
- "'></input> ";
- } else if(rowtype[i] == 'select') {
- td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows +
- "'></input><select name='" + rowname[i] + totalrows +
- "' id='" + rowname[i] + totalrows +
- "'>" + seltext + "</select> ";
- } else {
- td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows +
- "'></input><input type='checkbox' name='" + rowname[i] + totalrows +
- "' id='" + rowname[i] + totalrows + "'></input> ";
- }
- tr.appendChild(td);
- }
- td = d.createElement("td");
- td.rowSpan = "1";
- td.setAttribute("class","list");
-
- // Recreate the button table.
- btable = document.createElement("table");
- btable.setAttribute("border", "0");
- btable.setAttribute("cellspacing", "0");
- btable.setAttribute("cellpadding", "1");
- btbody = document.createElement("tbody");
- btr = document.createElement("tr");
- btd = document.createElement("td");
- btd.setAttribute("valign", "middle");
- btd.innerHTML = '<img src="/themes/' + theme + '/images/icons/icon_x.gif" title="delete entry" width="17" height="17" border="0" onclick="removeRow(this); return false;">';
- btr.appendChild(btd);
- btd = document.createElement("td");
- btd.setAttribute("valign", "middle");
- btd.innerHTML = '<img src="/themes/' + theme + "/images/icons/icon_plus.gif\" title=\"duplicate entry\" width=\"17\" height=\"17\" border=\"0\" onclick=\"dupRow(" + totalrows + ", 'acltable'); return false;\">";
- btr.appendChild(btd);
- btbody.appendChild(btr);
- btable.appendChild(btbody);
-
- td.appendChild(btable);
- tr.appendChild(td);
- tbody.appendChild(tr);
- });
- })();
-
- function dupRow(rowId, tableId) {
- var dupEl;
- var newEl;
-
- addRowTo(tableId);
- for (i = 0; i < field_counter_js; i++) {
- dupEl = document.getElementById(rowname[i] + rowId);
- newEl = document.getElementById(rowname[i] + totalrows);
- if (dupEl && newEl)
- newEl.value = dupEl.value;
- }
- }
-
- function removeRow(el) {
- var cel;
- // Break out of one table first
- while (el && el.nodeName.toLowerCase() != "table")
- el = el.parentNode;
- while (el && el.nodeName.toLowerCase() != "tr")
- el = el.parentNode;
-
- if (el && el.parentNode) {
- cel = el.getElementsByTagName("td").item(0);
- el.parentNode.removeChild(el);
- }
- }
-
- function find_unique_field_name(field_name) {
- // loop through field_name and strip off -NUMBER
- var last_found_dash = 0;
- for (var i = 0; i < field_name.length; i++) {
- // is this a dash, if so, update
- // last_found_dash
- if (field_name.substr(i,1) == "-" )
- last_found_dash = i;
- }
- if (last_found_dash < 1)
- return field_name;
- return(field_name.substr(0,last_found_dash));
- }
-
- rowname[0] = "acl_name";
- rowtype[0] = "textbox";
- rowsize[0] = "20";
-
- rowname[1] = "acl_expression";
- rowtype[1] = "select";
- rowsize[1] = "10";
-
- rowname[2] = "acl_value";
- rowtype[2] = "textbox";
- rowsize[2] = "35";
-
- function toggle_stats() {
- var stats_enabled=document.getElementById('stats_enabled');
- var stats_realm_row=document.getElementById('stats_realm_row');
- var stats_username_row=document.getElementById('stats_username_row');
- var stats_password_row=document.getElementById('stats_password_row');
- var stats_uri_row=document.getElementById('stats_uri_row');
-
- if (stats_enabled.checked) {
- stats_realm_row.style.display='';
- stats_username_row.style.display='';
- stats_password_row.style.display='';
- stats_uri_row.style.display='';
- } else {
- stats_realm_row.style.display='none';
- stats_username_row.style.display='none';
- stats_password_row.style.display='none';
- stats_uri_row.style.display='none';
- }
- }
- function type_change() {
- var type, d, i, j, el, row;
- var count = <?=count($a_acltypes);?>;
- var acl = [ <?php foreach ($a_acltypes as $expr) echo "'".$expr['name']."'," ?> ];
- var mode = [ <?php foreach ($a_acltypes as $expr) echo "'".$expr['mode']."'," ?> ];
-
- d = document;
- type = d.getElementById("type").value;
- for (i = 0; i < 99; i++) {
- el = d.getElementById("acl_expression" + i);
- row = d.getElementById("aclrow" + i);
- if (!el)
- continue;
- for (j = 0; j < count; j++) {
- if (acl[j] == el.value) {
- if (mode[j] != '' && mode[j] != type) {
- Effect.Fade(row,{ duration: 1.0 });
- } else {
- Effect.Appear(row,{ duration: 1.0 });
- }
- }
- }
- }
- }
-</script>
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if($one_two): ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php endif; ?>
-<form action="haproxy_listeners_edit.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td colspan="2" valign="top" class="listtopic">Edit haproxy listener</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Name</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="name" type="text" <?if(isset($pconfig['name'])) echo "value=\"{$pconfig['name']}\"";?> size="25" maxlength="25">
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Description</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="desc" type="text" <?if(isset($pconfig['desc'])) echo "value=\"{$pconfig['desc']}\"";?> size="64">
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncellreq">Status</td>
- <td width="78%" class="vtable" colspan="2">
- <select name="status" id="status">
- <option value="active"<?php if($pconfig['status'] == "active") echo " SELECTED"; ?>>Active</option>
- <option value="disabled"<?php if($pconfig['status'] == "disabled") echo " SELECTED"; ?>>Disabled</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">External address</td>
- <td width="78%" class="vtable">
- <select name="extaddr" class="formfld">
- <option value="" <?php if (!$pconfig['extaddr']) echo "selected"; ?>>Interface address</option>
- <?php
- if (is_array($config['virtualip']['vip'])):
- foreach ($config['virtualip']['vip'] as $sn):
- ?>
- <option value="<?=$sn['subnet'];?>" <?php if ($sn['subnet'] == $pconfig['extaddr']) echo "selected"; ?>>
- <?=htmlspecialchars("{$sn['subnet']} ({$sn['descr']})");?>
- </option>
- <?php
- endforeach;
- endif;
- ?>
- <option value="any" <?php if($pconfig['extaddr'] == "any") echo "selected"; ?>>any</option>
- </select>
- <br />
- <span class="vexpl">
- If you want this rule to apply to another IP address than the IP address of the interface chosen above,
- select it here (you need to define <a href="firewall_virtual_ip.php">Virtual IP</a> addresses on the first).
- Also note that if you are trying to redirect connections on the LAN select the "any" option.
- </span>
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncellreq">External port</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="port" type="text" <?if(isset($pconfig['port'])) echo "value=\"{$pconfig['port']}\"";?> size="10" maxlength="10">
- <div>The port to listen to. To specify multiple ports, separate with a comma (,). EXAMPLE: 80,443</div>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Server pool</td>
- <td width="78%" class="vtable">
- <select name="pool" class="formfld">
- <?php
- if (is_array($a_pools)) {
- foreach ($a_pools as $p):
- ?>
- <option value="<?=$p['name'];?>" <?php if ($p['name'] == $pconfig['pool']) echo "selected"; ?>>
- <?=htmlspecialchars("{$p['name']}");?>
- </option>
- <?php
- endforeach;
- } else {
- ?>
- <option value="-">-</option>
- <?php
- }
- ?>
- </select>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Server Port</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="svrport" type="text" <?if(isset($pconfig['svrport'])) echo "value=\"{$pconfig['svrport']}\"";?> size="10" maxlength="10">
- <div>The default server port.</div>
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncellreq">Type</td>
- <td width="78%" class="vtable" colspan="2">
- <select name="type" id="type" onchange="type_change();">
- <option value="http"<?php if($pconfig['type'] == "http") echo " SELECTED"; ?>>HTTP</option>
- <option value="https"<?php if($pconfig['type'] == "https") echo " SELECTED"; ?>>HTTPS</option>
- <option value="tcp"<?php if($pconfig['type'] == "tcp") echo " SELECTED"; ?>>TCP</option>
- <option value="health"<?php if($pconfig['type'] == "health") echo " SELECTED"; ?>>Health</option>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Access Control lists</td>
- <td width="78%" class="vtable" colspan="2" valign="top">
- <table class="" width="100%" cellpadding="0" cellspacing="0" id='acltable'>
- <tr>
- <td width="35%" class="">Name</td>
- <td width="40%" class="">Expression</td>
- <td width="20%" class="">Value</td>
- <td width="5%" class=""></td>
- </tr>
- <?php
- $a_acl=$pconfig['a_acl'];
-
- if (!is_array($a_acl)) {
- $a_acl=array();
- }
-
- $counter=0;
- foreach ($a_acl as $acl) {
- $t = haproxy_find_acl($acl['expression']);
- $display = '';
- if (!$t || ($t['mode'] != '' && $t['mode'] != strtolower($pconfig['type'])))
- $display = 'style="display: none;"';
- ?>
- <tr id="aclrow<?=$counter;?>" <?=$display;?>>
- <td><input name="acl_name<?=$counter;?>" id="acl_name<?=$counter;?>" type="text" value="<?=$acl['name']; ?>" size="20"/></td>
- <td>
- <select name="acl_expression<?=$counter;?>" id="acl_expression<?=$counter;?>">
- <?php
- foreach ($a_acltypes as $expr) { ?>
- <option value="<?=$expr['name'];?>"<?php if($acl['expression'] == $expr['name']) echo " SELECTED"; ?>><?=$expr['descr'];?>:</option>
- <?php } ?>
- </select>
- </td>
- <td><input name="acl_value<?=$counter;?>" id="acl_value<?=$counter;?>" type="text" value="<?=$acl['value']; ?>" size="35"/></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1"><tr>
- <td valign="middle">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="delete entry" width="17" height="17" border="0" onclick="removeRow(this); return false;">
- </td>
- <td valign="middle">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="duplicate entry" width="17" height="17" border="0" onclick="dupRow(<?=$counter;?>, 'acltable'); return false;">
- </td></tr></table>
- </td>
- </tr>
- <?php
- $counter++;
- }
- ?>
- </table>
- <a onclick="javascript:addRowTo('acltable'); return false;" href="#">
- <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="add another entry" />
- </a><br/>
- For more information about ACL's please see <a href='http://haproxy.1wt.eu/download/1.3/doc/configuration.txt' target='_new'>HAProxy Documentation</a> Section 7 - Using ACL's
- </td>
- </tr>
- </table>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td colspan="2" valign="top" class="listtopic">Advanced settings</td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncellreq">Connection timeout</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="connection_timeout" type="text" <?if(isset($pconfig['connection_timeout'])) echo "value=\"{$pconfig['connection_timeout']}\"";?> size="64">
- <div>the time (in milliseconds) we give up if the connection does not complete within (30000).</div>
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncellreq">Server timeout</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="server_timeout" type="text" <?if(isset($pconfig['server_timeout'])) echo "value=\"{$pconfig['server_timeout']}\"";?> size="64">
- <div>the time (in milliseconds) we accept to wait for data from the server, or for the server to accept data (30000).</div>
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Retries</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="retries" type="text" <?if(isset($pconfig['retries'])) echo "value=\"{$pconfig['retries']}\"";?> size="64">
- <div>After a connection failure to a server, it is possible to retry, potentially
-on another server. This is useful if health-checks are too rare and you don't
-want the clients to see the failures. The number of attempts to reconnect is
-set by the 'retries' parameter (2).</div>
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncellreq">Balance</td>
- <td width="78%" class="vtable" colspan="2">
- <table width="100%">
- <tr>
- <td width="20%" valign="top">
- <input type="radio" name="balance" id="balance" value="roundrobin"<?php if($pconfig['balance'] == "roundrobin") echo " CHECKED"; ?>>Round robin
- </td>
- <td>
- Each server is used in turns, according to their weights.
- This is the smoothest and fairest algorithm when the server's
- processing time remains equally distributed. This algorithm
- is dynamic, which means that server weights may be adjusted
- on the fly for slow starts for instance.
- </td>
- </tr>
- <tr><td valign="top"><input type="radio" name="balance" id="balance" value="source"<?php if($pconfig['balance'] ==
-"source") echo " CHECKED"; ?>>Source</td><td>
- The source IP address is hashed and divided by the total
- weight of the running servers to designate which server will
- receive the request. This ensures that the same client IP
- address will always reach the same server as long as no
- server goes down or up. If the hash result changes due to the
- number of running servers changing, many clients will be
- directed to a different server. This algorithm is generally
- used in TCP mode where no cookie may be inserted. It may also
- be used on the Internet to provide a best-effort stickyness
- to clients which refuse session cookies. This algorithm is
- static, which means that changing a server's weight on the
- fly will have no effect.
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Stats Enabled</td>
- <td width="78%" class="vtable" colspan="2">
- <input id="stats_enabled" name="stats_enabled" type="checkbox" value="yes" <?php if ($pconfig['stats_enabled']=='yes') echo "checked"; ?> onclick='toggle_stats();'><br/>
- EXAMPLE: haproxystats
- </td>
- </tr>
- <tr align="left" id='stats_realm_row' name='stats_realm_row' <?if ($pconfig['stats_enabled']!='yes') echo "style=\"display: none;\"";?>>
- <td width="22%" valign="top" class="vncellreq">Stats Realm</td>
- <td width="78%" class="vtable" colspan="2">
- <input id="stats_realm" name="stats_realm" type="text" <?if(isset($pconfig['stats_realm'])) echo "value=\"{$pconfig['stats_realm']}\"";?> size="64">
- </td>
- </tr>
- <tr align="left" id='stats_uri_row' name='stats_uri_row' <?if ($pconfig['stats_enabled']!='yes') echo "style=\"display: none;\"";?>>
- <td width="22%" valign="top" class="vncellreq">Stats Uri</td>
- <td width="78%" class="vtable" colspan="2">
- <input id="stats_uri" name="stats_uri" type="text" <?if(isset($pconfig['stats_uri'])) echo "value=\"{$pconfig['stats_uri']}\"";?> size="64"><br/>
- EXAMPLE: /haproxy?stats
- </td>
- </tr>
- <tr align="left" id='stats_username_row' name='stats_username_row' <?if ($pconfig['stats_enabled']!='yes') echo "style=\"display: none;\"";?>>
- <td width="22%" valign="top" class="vncellreq">Stats Username</td>
- <td width="78%" class="vtable" colspan="2">
- <input id="stats_username" name="stats_username" type="text" <?if(isset($pconfig['stats_username'])) echo "value=\"{$pconfig['stats_username']}\"";?> size="64">
- </td>
- </tr>
-
- <tr align="left" id='stats_password_row' name='stats_password_row' <?if ($pconfig['stats_enabled']!='yes') echo "style=\"display: none;\"";?>>
- <td width="22%" valign="top" class="vncellreq">Stats Password</td>
- <td width="78%" class="vtable" colspan="2">
- <input id="stats_password" name="stats_password" type="password" <?if(isset($pconfig['stats_password'])) echo "value=\"{$pconfig['stats_password']}\"";?> size="64">
- <br/>
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncellreq">Max connections</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="max_connections" type="text" <?if(isset($pconfig['max_connections'])) echo "value=\"{$pconfig['max_connections']}\"";?> size="10" maxlength="10">
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncellreq">Client timeout</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="client_timeout" type="text" <?if(isset($pconfig['client_timeout'])) echo "value=\"{$pconfig['client_timeout']}\"";?> size="10" maxlength="10">
- <div>the time (in milliseconds) we accept to wait for data from the client, or for the client to accept data (30000).</div>
- </td>
- </tr>
-<?php
-?>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Use 'forwardfor' option</td>
- <td width="78%" class="vtable" colspan="2">
- <input id="forwardfor" name="forwardfor" type="checkbox" value="yes" <?php if ($pconfig['forwardfor']=='yes') echo "checked"; ?>>
- <br/>
- The 'forwardfor' option creates an HTTP 'X-Forwarded-For' header which
- contains the client's IP address. This is useful to let the final web server
- know what the client address was (eg for statistics on domains)
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Use 'httpclose' option</td>
- <td width="78%" class="vtable" colspan="2">
- <input id="httpclose" name="httpclose" type="checkbox" value="yes" <?php if ($pconfig['httpclose']=='yes') echo "checked"; ?>>
- <br/>
- The 'httpclose' option removes any 'Connection' header both ways, and
- adds a 'Connection: close' header in each direction. This makes it easier to
- disable HTTP keep-alive than the previous 4-rules block.
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Advanced pass thru</td>
- <td width="78%" class="vtable" colspan="2">
- <textarea name='advanced' rows="4" cols="70" id='advanced'><?php echo $pconfig['advanced']; ?></textarea>
- <br/>
- NOTE: paste text into this box that you would like to pass thru.
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save">
- <input type="button" class="formbtn" value="Cancel" onclick="history.back()">
- <?php if (isset($id) && $a_backend[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <br/>&nbsp;<br/>
- <td colspan='3'>
- <span class="vexpl"><b>NOTE:</b> You must add a firewall rule permitting access to this frontend!</span>
- </td>
- </tr>
- </table>
- </form>
-<br>
-<script type="text/javascript">
- field_counter_js = 3;
- rows = 1;
- totalrows = <?php echo $counter; ?>;
- loaded = <?php echo $counter; ?>;
-</script>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/haproxy-stable/haproxy_pool_edit.php b/config/haproxy-stable/haproxy_pool_edit.php
deleted file mode 100755
index 51eb4e28..00000000
--- a/config/haproxy-stable/haproxy_pool_edit.php
+++ /dev/null
@@ -1,509 +0,0 @@
-<?php
-/* $Id: load_balancer_pool_edit.php,v 1.24.2.23 2007/03/03 00:07:09 smos Exp $ */
-/*
- haproxy_pool_edit.php
- part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2009 Scott Ullrich <sullrich@pfsense.com>
- Copyright (C) 2008 Remco Hoef <remcoverhoef@pfsense.com>
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-
-$d_haproxyconfdirty_path = $g['varrun_path'] . "/haproxy.conf.dirty";
-
-if (!is_array($config['installedpackages']['haproxy']['ha_pools']['item'])) {
- $config['installedpackages']['haproxy']['ha_pools']['item'] = array();
-}
-
-$a_pools = &$config['installedpackages']['haproxy']['ha_pools']['item'];
-
-if (isset($_POST['id']))
- $id = $_POST['id'];
-else
- $id = $_GET['id'];
-
-if (isset($_GET['dup']))
- $id = $_GET['dup'];
-
-if (isset($id) && $a_pools[$id]) {
- $pconfig['name'] = $a_pools[$id]['name'];
- $pconfig['checkinter'] = $a_pools[$id]['checkinter'];
- $pconfig['monitor_uri'] = $a_pools[$id]['monitor_uri'];
- $pconfig['cookie'] = $a_pools[$id]['cookie'];
- $pconfig['status'] = $a_pools[$id]['status'];
- $pconfig['advanced'] = base64_decode($a_pools[$id]['advanced']);
- $pconfig['a_servers']=&$a_pools[$id]['ha_servers']['item'];
-}
-
-if (isset($_GET['dup']))
- unset($id);
-
-$changedesc = "Services: HAProxy: pools: ";
-$changecount = 0;
-
-if ($_POST) {
- $changecount++;
-
- unset($input_errors);
- $pconfig = $_POST;
-
- $reqdfields = explode(" ", "name");
- $reqdfieldsn = explode(",", "Name");
-
- $pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
- if ($pf_version < 2.1)
- $input_errors = eval('do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); return $input_errors;');
- else
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
-
- if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['name']))
- $input_errors[] = "The field 'Name' contains invalid characters.";
-
- /* Ensure that our pool names are unique */
- for ($i=0; isset($config['installedpackages']['haproxy']['ha_pools']['item'][$i]); $i++)
- if (($_POST['name'] == $config['installedpackages']['haproxy']['ha_pools']['item'][$i]['name']) && ($i != $id))
- $input_errors[] = "This pool name has already been used. Pool names must be unique.";
-
- $a_servers=array();
- for($x=0; $x<99; $x++) {
- $server_name=$_POST['server_name'.$x];
- $server_address=$_POST['server_address'.$x];
- $server_port=$_POST['server_port'.$x];
- $server_weight=$_POST['server_weight'.$x];
- $server_backup=$_POST['server_backup'.$x];
-
- if ($server_address) {
-
- $server=array();
- $server['name']=$server_name;
- $server['address']=$server_address;
- $server['port']=$server_port;
- $server['weight']=$server_weight;
- $server['backup']=$server_backup;
- $a_servers[]=$server;
-
- if (preg_match("/[^a-zA-Z0-9\.\-_]/", $server_name))
- $input_errors[] = "The field 'Name' contains invalid characters.";
- if (preg_match("/[^a-zA-Z0-9\.\-_]/", $server_address))
- $input_errors[] = "The field 'Address' contains invalid characters.";
-
- if (!preg_match("/.{2,}/", $server_name))
- $input_errors[] = "The field 'Name' is required.";
-
- if (!preg_match("/.{2,}/", $server_address))
- $input_errors[] = "The field 'Address' is required.";
-
- if (!preg_match("/.{2,}/", $server_weight))
- $input_errors[] = "The field 'Weight' is required.";
-
- if (!is_numeric($server_weight))
- $input_errors[] = "The field 'Weight' value is not a number.";
- if ($server_port && !is_numeric($server_port))
- $input_errors[] = "The field 'Port' value is not a number.";
- }
- }
-
- if (!$input_errors) {
- $pool = array();
- if(isset($id) && $a_pools[$id])
- $pool = $a_pools[$id];
-
- if ($pool['name'] != $_POST['name']) {
- // name changed:
- if (!is_array($config['installedpackages']['haproxy']['ha_backends']['item'])) {
- $config['installedpackages']['haproxy']['ha_backends']['item'] = array();
- }
- $a_backend = &$config['installedpackages']['haproxy']['ha_backends']['item'];
-
- for ( $i = 0; $i < count($a_backend); $i++) {
- if ($a_backend[$i]['pool'] == $pool['name'])
- $a_backend[$i]['pool'] = $_POST['name'];
- }
- }
-
- if($pool['name'] != "")
- $changedesc .= " modified '{$pool['name']}' pool:";
-
- $pool['ha_servers']['item']=$a_servers;
-
- update_if_changed("name", $pool['name'], $_POST['name']);
- update_if_changed("status", $pool['status'], $_POST['status']);
- update_if_changed("cookie", $pool['cookie'], $_POST['cookie']);
- update_if_changed("advanced", $pool['advanced'], base64_encode($_POST['advanced']));
- update_if_changed("checkinter", $pool['checkinter'], $_POST['checkinter']);
- update_if_changed("monitor_uri", $pool['monitor_uri'], $_POST['monitor_uri']);
-
- if (isset($id) && $a_pools[$id]) {
- $a_pools[$id] = $pool;
- } else {
- $a_pools[] = $pool;
- }
-
- if ($changecount > 0) {
- touch($d_haproxyconfdirty_path);
- write_config($changedesc);
- /*
- echo "<PRE>";
- print_r($config);
- echo "</PRE>";
- */
- }
-
- header("Location: haproxy_pools.php");
- exit;
- }
- $pconfig['a_servers']=&$a_pools[$id]['ha_servers']['item'];
-}
-
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version < 2.0)
- $one_two = true;
-
-$pgtitle = "HAProxy: pool: Edit";
-include("head.inc");
-
-row_helper();
-
-?>
-
-<input type='hidden' name='address_type' value='textbox' />
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<script type="text/javascript" language="javascript" src="pool.js"></script>
-
-<script language="javascript">
-function clearcombo(){
- for (var i=document.iform.serversSelect.options.length-1; i>=0; i--){
- document.iform.serversSelect.options[i] = null;
- }
- document.iform.serversSelect.selectedIndex = -1;
-}
-</script>
-<script type="text/javascript">
- rowname[0] = "server_name";
- rowtype[0] = "textbox";
- rowsize[0] = "30";
- rowname[1] = "server_address";
- rowtype[1] = "textbox";
- rowsize[1] = "30";
- rowname[2] = "server_port";
- rowtype[2] = "textbox";
- rowsize[2] = "5";
- rowname[3] = "server_weight";
- rowtype[3] = "textbox";
- rowsize[3] = "5";
- rowname[4] = "server_backup";
- rowtype[4] = "checkbox";
- rowsize[4] = "5";
-</script>
-<?php include("fbegin.inc"); ?>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if($one_two): ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php endif; ?>
- <form action="haproxy_pool_edit.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td colspan="2" valign="top" class="listtopic">Edit HAProxy pool</td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncellreq">Name</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="name" type="text" <?if(isset($pconfig['name'])) echo "value=\"{$pconfig['name']}\"";?> size="16" maxlength="16">
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncellreq">Status</td>
- <td width="78%" class="vtable" colspan="2">
- <select name="status">
- <option value="active" <?php if($pconfig['status']=='active') echo "SELECTED";?>>active</option>
- <option value="inactive" <?php if($pconfig['status']=='inactive') echo "SELECTED";?>>inactive</option>
- </select>
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Cookie</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="cookie" type="text" <?if(isset($pconfig['cookie'])) echo "value=\"{$pconfig['cookie']}\"";?>size="64"><br/>
- This value will be checked in incoming requests, and the first
- operational pool possessing the same value will be selected. In return, in
- cookie insertion or rewrite modes, this value will be assigned to the cookie
- sent to the client. There is nothing wrong in having several servers sharing
- the same cookie value, and it is in fact somewhat common between normal and
- backup servers. See also the "cookie" keyword in backend section.
-
- </td>
- </tr>
- <tr align="left">
- <td class="vncellreq" colspan="3">Server list</td>
- </tr>
- <tr>
- <td width="78%" class="vtable" colspan="2" valign="top">
- <table class="" width="100%" cellpadding="0" cellspacing="0" id='servertable'>
- <tr>
- <td width="30%" class="">Name</td>
- <td width="30%" class="">Address</td>
- <td width="18%" class="">Port</td>
- <td width="18%" class="">Weight</td>
- <td width="5%" class="">Backup</td>
- <td width="4%" class=""></td>
- </tr>
- <?php
- $a_servers=$pconfig['a_servers'];
-
- if (!is_array($a_servers)) {
- $a_servers=array();
- }
-
- $counter=0;
- foreach ($a_servers as $server) {
- ?>
- <tr id="tr_view_<?=$counter;?>" name="tr_view_<?=$counter;?>">
- <td class="vtable"><?=$server['name']; ?></td>
- <td class="vtable"><?=$server['address']; ?></td>
- <td class="vtable"><?=$server['port']; ?></td>
- <td class="vtable"><?=$server['weight']; ?></td>
- <td class="vtable"><?=$server['backup']; ?></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1"><tr>
- <td valign="middle">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit entry" width="17" height="17" border="0" onclick="editRow(<?=$counter;?>); return false;">
- </td>
- <td valign="middle">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="duplicate entry" width="17" height="17" border="0" onclick="dupRow(<?=$counter;?>, 'servertable'); return false;">
- </td></tr></table>
- </td>
- </tr>
- <tr id="tr_edit_<?=$counter;?>" name="tr_edit_<?=$counter;?>" style="display: none;">
- <td class="vtable">
- <input name="server_name<?=$counter;?>" id="server_name<?=$counter;?>" type="text" value="<?=$server['name']; ?>" size="30"/></td>
- <td class="vtable">
- <input name="server_address<?=$counter;?>" id="server_address<?=$counter;?>" type="text" value="<?=$server['address']; ?>" size="30"/></td>
- <td class="vtable">
- <input name="server_port<?=$counter;?>" id="server_port<?=$counter;?>" type="text" value="<?=$server['port']; ?>" size="5"/></td>
- <td class="vtable">
- <input name="server_weight<?=$counter;?>" id="server_weight<?=$counter;?>" type="text" value="<?=$server['weight']; ?>" size="5"/></td>
- <td class="vtable">
- <input name="server_backup<?=$counter;?>" id="server_backup<?=$counter;?>" type="checkbox" value="yes" <?php if ($server['backup']=='yes') echo "checked"; ?>/></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1"><tr>
- <td valign="middle">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="delete entry" width="17" height="17" border="0" onclick="removeRow(this); return false;">
- </td>
- <td valign="middle">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="duplicate entry" width="17" height="17" border="0" onclick="dupRow(<?=$counter;?>, 'servertable'); return false;">
- </td></tr></table>
- </td>
- </tr>
- <?php
- $counter++;
- }
- ?>
- </table>
- <a onclick="javascript:addRowTo('servertable'); return false;" href="#">
- <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="add another entry" />
- </a>
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Check freq</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="checkinter" type="text" <?if(isset($pconfig['checkinter'])) echo "value=\"{$pconfig['checkinter']}\"";?>size="20"> milliseconds
- <br/>Defaults to 1000 if left blank.
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Health check URI</td>
- <td width="78%" class="vtable" colspan="2">
- <input name="monitor_uri" type="text" <?if(isset($pconfig['monitor_uri'])) echo "value=\"{$pconfig['monitor_uri']}\"";?>size="64">
- <br/>Defaults to / if left blank.
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top" class="vncell">Advanced pass thru</td>
- <td width="78%" class="vtable" colspan="2">
- <textarea name='advanced' rows="4" cols="70" id='advanced'><?php echo $pconfig['advanced']; ?></textarea>
- <br/>
- NOTE: paste text into this box that you would like to pass thru.
- </td>
- </tr>
- <tr align="left">
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save">
- <input type="button" class="formbtn" value="Cancel" onclick="history.back()">
- <?php if (isset($id) && $a_pools[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
- <?php endif; ?>
- </td>
- </tr>
- </table>
- </form>
-<br>
-<?php include("fend.inc"); ?>
-<script type="text/javascript">
- field_counter_js = 5;
- rows = 1;
- totalrows = <?php echo $counter; ?>;
- loaded = <?php echo $counter; ?>;
-</script>
-</body>
-</html>
-
-<?php
-
-function row_helper() {
- echo <<<EOF
-<script type="text/javascript">
-// Global Variables
-var rowname = new Array(99);
-var rowtype = new Array(99);
-var newrow = new Array(99);
-var rowsize = new Array(99);
-
-for (i = 0; i < 99; i++) {
- rowname[i] = '';
- rowtype[i] = '';
- newrow[i] = '';
- rowsize[i] = '25';
-}
-
-var field_counter_js = 0;
-var loaded = 0;
-var is_streaming_progress_bar = 0;
-var temp_streaming_text = "";
-
-var addRowTo = (function() {
- return (function (tableId) {
- var d, tbody, tr, td, bgc, i, ii, j;
- var btable, btbody, btr, btd;
-
- d = document;
- tbody = d.getElementById(tableId).getElementsByTagName("tbody").item(0);
- tr = d.createElement("tr");
- totalrows++;
- for (i = 0; i < field_counter_js; i++) {
- td = d.createElement("td");
- if(rowtype[i] == 'textbox') {
- td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows +
- "'></input><input size='" + rowsize[i] + "' name='" + rowname[i] + totalrows +
- "' id='" + rowname[i] + totalrows + "'></input> ";
- } else if(rowtype[i] == 'select') {
- td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows +
- "'></input><select size='" + rowsize[i] + "' name='" + rowname[i] + totalrows +
- "' id='" + rowname[i] + totalrows + "'>$options</select> ";
- } else {
- td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows +
- "'></input><input type='checkbox' name='" + rowname[i] + totalrows +
- "' id='" + rowname[i] + totalrows + "' value='yes'></input> ";
- }
- td.setAttribute("class","vtable");
- tr.appendChild(td);
- }
- td = d.createElement("td");
- td.rowSpan = "1";
- td.setAttribute("class","list");
-
- // Recreate the button table.
- btable = document.createElement("table");
- btable.setAttribute("border", "0");
- btable.setAttribute("cellspacing", "0");
- btable.setAttribute("cellpadding", "1");
- btbody = document.createElement("tbody");
- btr = document.createElement("tr");
- btd = document.createElement("td");
- btd.setAttribute("valign", "middle");
- btd.innerHTML = '<img src="/themes/' + theme + '/images/icons/icon_x.gif" title="delete entry" width="17" height="17" border="0" onclick="removeRow(this); return false;">';
- btr.appendChild(btd);
- btd = document.createElement("td");
- btd.setAttribute("valign", "middle");
- btd.innerHTML = '<img src="/themes/' + theme + "/images/icons/icon_plus.gif\" title=\"duplicate entry\" width=\"17\" height=\"17\" border=\"0\" onclick=\"dupRow(" + totalrows + ", 'servertable'); return false;\">";
- btr.appendChild(btd);
- btbody.appendChild(btr);
- btable.appendChild(btbody);
-
- td.appendChild(btable);
- tr.appendChild(td);
- tbody.appendChild(tr);
- });
-})();
-
-function dupRow(rowId, tableId) {
- var dupEl;
- var newEl;
-
- addRowTo(tableId);
- for (i = 0; i < field_counter_js; i++) {
- dupEl = document.getElementById(rowname[i] + rowId);
- newEl = document.getElementById(rowname[i] + totalrows);
- if (dupEl && newEl)
- if(rowtype[i] == 'checkbox')
- newEl.checked = dupEl.checked;
- else
- newEl.value = dupEl.value;
- }
-}
-
-function removeRow(el) {
- var cel;
- // Break out of one table first
- while (el && el.nodeName.toLowerCase() != "table")
- el = el.parentNode;
- while (el && el.nodeName.toLowerCase() != "tr")
- el = el.parentNode;
-
- if (el && el.parentNode) {
- cel = el.getElementsByTagName("td").item(0);
- el.parentNode.removeChild(el);
- }
-}
-function editRow(num) {
- var trview = document.getElementById('tr_view_' + num);
- var tredit = document.getElementById('tr_edit_' + num);
-
- trview.style.display='none';
- tredit.style.display='';
-}
-
-function find_unique_field_name(field_name) {
- // loop through field_name and strip off -NUMBER
- var last_found_dash = 0;
- for (var i = 0; i < field_name.length; i++) {
- // is this a dash, if so, update
- // last_found_dash
- if (field_name.substr(i,1) == "-" )
- last_found_dash = i;
- }
- if (last_found_dash < 1)
- return field_name;
- return(field_name.substr(0,last_found_dash));
-}
-</script>
-
-EOF;
-
-}
-
-?>
diff --git a/config/haproxy-stable/haproxy_pools.php b/config/haproxy-stable/haproxy_pools.php
deleted file mode 100755
index 0edc2ad8..00000000
--- a/config/haproxy-stable/haproxy_pools.php
+++ /dev/null
@@ -1,166 +0,0 @@
-<?php
-/* $Id: load_balancer_virtual_server.php,v 1.6.2.1 2006/01/02 23:46:24 sullrich Exp $ */
-/*
- haproxy_pools.php
- part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2009 Scott Ullrich <sullrich@pfsense.com>
- Copyright (C) 2008 Remco Hoef <remcoverhoef@pfsense.com>
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require_once("guiconfig.inc");
-require_once("haproxy.inc");
-
-$d_haproxyconfdirty_path = $g['varrun_path'] . "/haproxy.conf.dirty";
-
-if (!is_array($config['installedpackages']['haproxy']['ha_pools']['item'])) {
- $config['installedpackages']['haproxy']['ha_pools']['item'] = array();
-}
-if (!is_array($config['installedpackages']['haproxy']['ha_backends']['item'])) {
- $config['installedpackages']['haproxy']['ha_backends']['item'] = array();
-}
-
-$a_pools = &$config['installedpackages']['haproxy']['ha_pools']['item'];
-$a_backends = &$config['installedpackages']['haproxy']['ha_backends']['item'];
-
-if ($_POST) {
- $pconfig = $_POST;
-
- if ($_POST['apply']) {
- $retval = 0;
- config_lock();
- $retval = haproxy_configure();
- config_unlock();
- $savemsg = get_std_save_message($retval);
- unlink_if_exists($d_haproxyconfdirty_path);
- }
-}
-
-if ($_GET['act'] == "del") {
- if (isset($a_pools[$_GET['id']])) {
- unset($a_pools[$_GET['id']]);
- write_config();
- touch($d_haproxyconfdirty_path);
- }
- header("Location: haproxy_pools.php");
- exit;
-}
-
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version < 2.0)
- $one_two = true;
-
-$pgtitle = "Services: HAProxy: Server pools";
-include("head.inc");
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<?php if($one_two): ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php endif; ?>
-<form action="haproxy_pools.php" method="post">
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<?php if (file_exists($d_haproxyconfdirty_path)): ?><p>
-<?php print_info_box_np("The virtual pool configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
-<?php endif; ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
- <?php
- /* active tabs */
- $tab_array = array();
- $tab_array[] = array("Settings", false, "haproxy_global.php");
- $tab_array[] = array("Listener", false, "haproxy_listeners.php");
- $tab_array[] = array("Server Pool", true, "haproxy_pools.php");
- display_top_tabs($tab_array);
- ?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="30%" class="listhdrr">Name</td>
- <td width="20%" class="listhdrr">Status</td>
- <td width="30%" class="listhdrr">Listener</td>
- <td width="10%" class="list"></td>
- </tr>
-<?php
- $i = 0;
- foreach ($a_pools as $pool):
- $textss = $textse = "";
- if ($pool['status'] != 'active') {
- $textss = "<span class=\"gray\">";
- $textse = "</span>";
- }
-?>
- <tr>
- <td class="listlr" ondblclick="document.location='haproxy_pool_edit.php?id=<?=$i;?>';">
- <?=$textss . $pool['name'] . $textse;?>
- </td>
- <td class="listlr" ondblclick="document.location='haproxy_pool_edit.php?id=<?=$i;?>';">
- <?=$textss . $pool['status'] . $textse;?>
- </td>
- <td class="listlr" ondblclick="document.location='haproxy_pool_edit.php?id=<?=$i;?>';">
-<?php
- echo $textss;
- $sep = "";
- foreach ($a_backends as $backend) {
- if($backend['pool'] == $pool['name']) {
- echo $sep . $backend['name'];
- $sep = ", ";
- }
- }
- echo $textse;
-?>
- </td>
- <td class="list" nowrap>
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="haproxy_pool_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="haproxy_pools.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this entry?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="haproxy_pool_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="haproxy_pool_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </div>
- </table>
- </form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/havp.inc b/config/havp.inc
deleted file mode 100644
index 3582986b..00000000
--- a/config/havp.inc
+++ /dev/null
@@ -1,219 +0,0 @@
-<?php
-require_once('globals.inc');
-require_once('config.inc');
-require_once('service-utils.inc');
-require_once('pkg-utils.inc');
-require_once('pfsense-utils.inc');
-require_once("notices.inc");
-
-/*
- havp.inc
- part of the HAVP package for pfSense
- Copyright (C) 2006 Rajkumar S <raj@linuxense.com>
- All rights reserved.
- $Id$
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
-*/
-function sync_package_havp() {
- conf_mount_rw();
- config_lock();
- global $config, $g;
- $fd = fopen("/etc/havp.config","w");
- fwrite($fd, "USER havp\n");
- fwrite($fd, "GROUP havp\n");
- fwrite($fd, "ACCESSLOG /var/log/havp/access.log\n");
- fwrite($fd, "ERRORLOG /var/log/havp/error.log\n");
- fwrite($fd, "DISPLAYINITIALMESSAGES false\n");
- fwrite($fd, "ENABLECLAMLIB true\n");
- fwrite($fd, "CLAMDBDIR /var/db/clamav/\n");
- fwrite($fd, "ENABLECLAMD false\n");
- fwrite($fd, "ENABLEFPROT false\n");
- fwrite($fd, "ENABLEAVG false\n");
- fwrite($fd, "ENABLEAVESERVER false\n");
- fwrite($fd, "ENABLESOPHIE false\n");
- fwrite($fd, "ENABLETROPHIE false\n");
- fwrite($fd, "ENABLENOD32 false\n");
- fwrite($fd, "ENABLEAVAST false\n");
- if($config['installedpackages']['havp']['config'] != "") {
- foreach($config['installedpackages']['havp']['config'] as $tmp) {
- if ($tmp['servernumber'] != "") fwrite($fd,"SERVERNUMBER " . $tmp['servernumber'] . "\n");
- if ($tmp['maxservers'] != "") fwrite($fd,"MAXSERVERS " . $tmp['maxservers'] . "\n");
- if ($tmp['port'] != "") fwrite($fd,"PORT " . $tmp['port'] . "\n");
- if ($tmp['source_address'] != "") fwrite($fd,"SOURCE_ADDRESS " . $tmp['source_address'] . " \n");
- if ($tmp['dbreload'] != "") fwrite($fd,"DBRELOAD " . $tmp['dbreload'] . " \n");
- if ($tmp['parentproxy'] != "") fwrite($fd,"PARENTPROXY " . $tmp['parentproxy'] . " \n");
- if ($tmp['parentport'] != "") fwrite($fd,"PARENTPORT " . $tmp['parentport'] . " \n");
- if ($tmp['maxscansize'] != "") fwrite($fd,"MAXSCANSIZE " . $tmp['maxscansize'] . " \n");
- if ($tmp['trickling'] != "") fwrite($fd,"TRICKLING " . $tmp['trickling'] . " \n");
- if ($tmp['maxdownloadsize'] != "") fwrite($fd,"MAXDOWNLOADSIZE " . $tmp['maxdownloadsize'] . " \n");
-
- /* If Transparent then, don't bother with bind address */
- if ($tmp['transparent'] == "on"){
- fwrite($fd,"TRANSPARENT true\n");
- fwrite($fd,"BIND_ADDRESS 127.0.0.1\n");
- setup_transparency();
- }
- else {
- fwrite($fd,"TRANSPARENT false\n");
- if ($tmp['bind_address'] != ""){
- fwrite($fd,"BIND_ADDRESS " . $config['interfaces'][strtolower($tmp['bind_address'])]['ipaddr'] . " \n");
- }else { /* just to be sure, default is lan */
- fwrite($fd,"BIND_ADDRESS " . $config['interfaces']['lan']['ipaddr'] . " \n");
- }
- $havp_pf_result = mwexec ("pfctl -a rdr-package/havp -F nat");
- $havp_pf_result = mwexec ("pfctl -t havp -T kill");
- if($havp_pf_result <> 0) {
- file_notice("HAVP", "There were error(s) clearing the transparency rules", "HAVP", "");
- }
- }
-
- if ($tmp['range'] == "on"){
- fwrite($fd,"RANGE true\n");
- }
- else {
- fwrite($fd,"RANGE false\n");
- }
- if ($tmp['log_oks'] == "on"){
- fwrite($fd,"LOG_OKS true\n");
- }
- else {
- fwrite($fd,"LOG_OKS false\n");
- }
- }
- } else {
- fwrite($fd,"SERVERNUMBER 10\n");
- fwrite($fd,"MAXSERVERS 100\n");
- fwrite($fd,"PORT 8080\n");
- fwrite($fd,"TRANSPARENT false\n");
- fwrite($fd,"RANGE true\n");
- fwrite($fd,"LOG_OKS true\n");
- fwrite($fd,"BIND_ADDRESS " . $config['interfaces']['lan']['ipaddr'] . " \n");
- }
- fclose($fd);
- conf_mount_ro();
- config_unlock();
- unlink_if_exists("/usr/local/etc/havp/havp.config");
- mwexec("ln -sf /etc/havp.config /usr/local/etc/havp/havp.config");
- mwexec("/usr/local/etc/rc.d/havp.sh stop");
- mwexec("/usr/local/etc/rc.d/havp.sh start");
-}
-
-function havp_install_command() {
- global $config, $g;
- mwexec ("mkdir -p /var/log/havp/");
- mwexec ("mkdir -p /var/tmp/havp/");
- mwexec ("mkdir -p /var/run/havp/");
- mwexec ("chown havp:havp /var/log/havp");
- mwexec ("chown havp:havp /var/tmp/havp");
- mwexec ("chown havp:havp /var/run/havp");
- mwexec ("cp /usr/local/pkg/havp.sh /usr/local/etc/rc.d/");
- mwexec ("chmod +x /usr/local/etc/rc.d/havp.sh");
- sync_package_havp();
-}
-
-function havp_deinstall_command() {
- global $config, $g;
- mwexec("/usr/local/etc/rc.d/havp.sh stop");
- conf_mount_rw();
- unlink_if_exists("/usr/local/etc/rc.d/havp.sh");
- unlink_if_exists("/usr/local/etc/havp/havp.config");
- unlink_if_exists("/etc/havp.config");
- conf_mount_ro();
-}
-function sync_package_havp_whitelist() {
- global $config;
- conf_mount_rw();
- config_lock();
- $fd = fopen("/usr/local/etc/havp/whitelist","w");
- if($config['installedpackages']['havpwhitelist']['config'] != "")
- foreach($config['installedpackages']['havpwhitelist']['config'] as $tmp) {
- fwrite($fd, $tmp['url'] . "\n");
- }
- fclose($fd);
- /* signal a reload of all files */
- conf_mount_ro();
- config_unlock();
-}
-
-function sync_package_havp_blacklist() {
- global $config;
- conf_mount_rw();
- config_lock();
- $fd = fopen("/usr/local/etc/havp/blacklist","w");
- if($config['installedpackages']['havpblacklist']['config'] != "")
- foreach($config['installedpackages']['havpblacklist']['config'] as $tmp) {
- fwrite($fd, $tmp['url'] . "\n");
- }
- fclose($fd);
- /* signal a reload of all files */
- conf_mount_ro();
- config_unlock();
-}
-
-function add_trans_table(){
- global $config;
- conf_mount_rw();
- config_lock();
-
- # Flush all entries first, and then add them.
- $havp_pf_result = mwexec ('pfctl -a "rdr-package/havp" -t havp -T flush');
- if($havp_pf_result <> 0) {
- file_notice("HAVP", "There were error(s) flushing the exclude table", "HAVP", "");
- }
- if($config['installedpackages']['havptransexclude']['config'] != ""){
- foreach($config['installedpackages']['havptransexclude']['config'] as $tmp) {
- $havp_pf_result = mwexec ('pfctl -a "rdr-package/havp" -t havp -T add ' . $tmp['ip']);
- if($havp_pf_result <> 0) {
- file_notice("HAVP", "There were error(s) adding the ip " . $tmp['ip'], "HAVP", "");
- }
- }
- }
- /* signal a reload of all files */
- conf_mount_ro();
- config_unlock();
-}
-
-function setup_transparency(){
- global $config;
- $trans_file = fopen("/tmp/havp_pf.rules","w");
- fwrite($trans_file, "table <havp> persist\n");
- fwrite($trans_file, "rdr on " . $config['interfaces']['lan']['if'] . " inet proto tcp from !<havp> to ! " . $config['interfaces']['lan']['ipaddr'] . " port = http -> 127.0.0.1 port 8080 \n");
- fclose($trans_file);
- $havp_pf_result = mwexec ('pfctl -a "rdr-package/havp" -f /tmp/havp_pf.rules');
- if($havp_pf_result <> 0) {
- file_notice("HAVP", "There were error(s) loading the transparency rules", "HAVP", "");
- }
- add_trans_table();
-}
-
-function transparency_init(){
- global $config;
- if($config['installedpackages']['havp']['config'] != "") {
- if($config['installedpackages']['havp']['config'][0]['transparent'] == "on") {
- setup_transparency();
- }
- }
-}
-
-?>
diff --git a/config/havp.sh b/config/havp.sh
deleted file mode 100644
index 88a97250..00000000
--- a/config/havp.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-# HAVP Init script
-# 6/23/06 - Gary Buckmaster
-# Modified by Rajkumar S.
-#
-pidfile=/var/run/havp/havp.pid
-piddir=/var/run/havp/
-logdir=/var/log/havp/
-required_dirs=/var/tmp/havp
-required_files=/usr/local/etc/havp/havp.config
-
-
-rc_start()
-{
- if [ ! -d $piddir ]
- then
- mkdir -p $piddir
- chown havp:havp $piddir
- fi
- if [ ! -d $logdir ]
- then
- mkdir -p $logdir
- chown havp:havp $logdir
- fi
- if [ ! -f $required_files ]
- then
- echo "FATAL: Missing HAVP config file: $required_files"
- return
- fi
- if [ ! -d $required_dirs ]
- then
- echo "FATAL: Missing HAVP working director: $required_dirs"
- mkdir -p $required_dirs
- chown havp:havp $required_dirs
- fi
- if [ -f $pidfile ]
- then
- pid=$(sed 's/ //g' $pidfile)
- echo "FATAL: HAVP already running? pid: $pid"
- return
- else
- echo "Starting HAVP Antivirus HTTP Proxy"
- /usr/local/sbin/havp &
- sleep 4
- /usr/local/bin/php -q /usr/local/pkg/havp_startup.inc &
- sleep 4
- if [ -f $pidfile ]
- then
- pid=$(sed 's/ //g' $pidfile)
- echo "Started pid: $pid"
- else
- echo "An error occurred starting HAVP"
- return
- fi
- fi
-}
-
-rc_stop()
-{
- pid=$(sed 's/ //g' $pidfile)
- if [ ! -f $pidfile ]
- then
- echo "FATAL: HAVP already running pid: $pid"
- return
- else
- echo "Stopping HAVP pid: $pid"
- kill $pid
- rm -f $required_dirs/*
- fi
-}
-
-case $1 in
- start)
- rc_start
- ;;
- stop)
- rc_stop
- ;;
- restart)
- rc_stop
- sleep 5
- rc_start
- ;;
-esac
-
diff --git a/config/havp.xml b/config/havp.xml
deleted file mode 100644
index 0dee82e3..00000000
--- a/config/havp.xml
+++ /dev/null
@@ -1,220 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>havp</name>
- <version>0.3</version>
- <title>Havp: Settings</title>
- <aftersaveredirect>/pkg_edit.php?xml=havp.xml&amp;id=0</aftersaveredirect>
- <include_file>/usr/local/pkg/havp.inc</include_file>
- <menu>
- <name>HAVP</name>
- <tooltiptext>Modify HAVP settings.</tooltiptext>
- <section>Services</section>
- <configfile>havp.xml</configfile>
- <url>/pkg_edit.php?xml=havp.xml&amp;id=0</url>
- </menu>
-
- <service>
- <name>havp</name>
- <rcfile>/usr/local/etc/rc.d/havp.sh</rcfile>
- <description>HTTP Anti Virus Proxy.</description>
- </service>
-
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=havp.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Whitelist</text>
- <url>/pkg.php?xml=havp_whitelist.xml</url>
- </tab>
- <tab>
- <text>Blacklist</text>
- <url>/pkg.php?xml=havp_blacklist.xml</url>
- </tab>
- <tab>
- <text>Exclude from Transparent Proxy</text>
- <url>/pkg.php?xml=havp_trans_exclude.xml</url>
- </tab>
- </tabs>
- <configpath>['installedpackages']['havp]['config']</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>http://agni.linuxense.com/packages/config/havp.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>http://agni.linuxense.com/packages/config/havp_whitelist.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>http://agni.linuxense.com/packages/config/havp_blacklist.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>http://agni.linuxense.com/packages/config/havp_startup.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>http://agni.linuxense.com/packages/config/havp_trans_exclude.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>http://agni.linuxense.com/packages/config/havp.sh</item>
- </additional_files_needed>
-
- <fields>
- <field>
- <fielddescr>Server Number</fielddescr>
- <fieldname>servernumber</fieldname>
- <description>Specify how many servers (child processes) are simultaneously listening on port PORT for a connection. Minimum value should be the peak requests-per-second expected + 5 for headroom.</description>
- <type>input</type>
- <default_value>10</default_value>
- </field>
- <field>
- <fielddescr>Max Server Number</fielddescr>
- <fieldname>maxservers</fieldname>
- <description>This is the hard limit for concurrent requests processed.</description>
- <type>input</type>
- <default_value>100</default_value>
- </field>
- <field>
- <fielddescr>Transparent?</fielddescr>
- <fieldname>transparent</fieldname>
- <description>Run HAVP as transparent Proxy? [Bind Address will be disregarded in this mode, HAVP will listen on localhost] </description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Port</fielddescr>
- <fieldname>port</fieldname>
- <description>Port HAVP is listening on.</description>
- <type>input</type>
- <default_value>8080</default_value>
- </field>
- <field>
- <fielddescr>Bind Address</fielddescr>
- <fieldname>bind_address</fieldname>
- <description>IP address that HAVP listens on. Leave it empty to bind all addresses, defaults to LAN address</description>
- <type>interfaces_selection</type>
- <default_value>lan</default_value>
- </field>
- <field>
- <fielddescr>Source Address</fielddescr>
- <fieldname>source_address</fieldname>
- <description>IP address used for sending outbound packets. Let it be undefined if you want OS to handle right address.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Range Requests</fielddescr>
- <fieldname>range</fieldname>
- <description> Allow HTTP Range Requests?</description>
- <type>checkbox</type>
- <default_value>on</default_value>
- </field>
- <field>
- <fielddescr>Log All Requests?</fielddescr>
- <fieldname>log_oks</fieldname>
- <description>Log Details: true: Log all Requests, false: log only virus hits</description>
- <type>checkbox</type>
- <default_value>on</default_value>
- </field>
- <field>
- <fielddescr>Virus Database Reload Time.</fielddescr>
- <fieldname>dbreload</fieldname>
- <description>Specify here the number of minutes to wait for reloading. Default 60 Minutes.</description>
- <type>input</type>
- <default_value>60</default_value>
- </field>
- <field>
- <fielddescr>Parent Proxy Host</fielddescr>
- <fieldname>parentproxy</fieldname>
- <description>Specify the parent proxy hostname or ip</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Parent Proxy Port</fielddescr>
- <fieldname>parentport</fieldname>
- <description>Specify the parent proxy port</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Max size of temporary files on disk</fielddescr>
- <fieldname>maxscansize</fieldname>
- <description>Temporary file will grow only up to this size. This means scanner will scan data until this limit is reached. The value is in BYTES, not kb or mb. 0 is Unlimited.</description>
- <type>input</type>
- <default_value>0</default_value>
- </field>
- <field>
- <fielddescr>Trickling Time</fielddescr>
- <fieldname>trickling</fieldname>
- <description>After Trickling Time (seconds), some bytes are sent to browser to keep the connection alive. Trickling is not needed if timeouts are not expected. Default is 5 seconds. </description>
- <type>input</type>
- <default_value>5</default_value>
- </field>
- <field>
- <fielddescr>Absolute Maximum Download Size</fielddescr>
- <fieldname>maxdownloadsize</fieldname>
- <description>Downloads larger than this will be blocked, Unless whitelisted. 0 is unlimited.</description>
- <type>input</type>
- <default_value>0</default_value>
- </field>
- </fields>
-
- <custom_php_resync_config_command> sync_package_havp(); </custom_php_resync_config_command>
- <custom_php_install_command> havp_install_command(); </custom_php_install_command>
- <custom_php_deinstall_command> havp_deinstall_command(); </custom_php_deinstall_command>
-
-</packagegui>
-
diff --git a/config/havp_blacklist.xml b/config/havp_blacklist.xml
deleted file mode 100644
index aa82507a..00000000
--- a/config/havp_blacklist.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>havp-blacklist</name>
- <version>0.1.0</version>
- <title>Havp: Blacklist</title>
- <include_file>/usr/local/pkg/havp.inc</include_file>
-
- <menu>
- <name>HAVP Blacklist</name>
- <tooltiptext></tooltiptext>
- <section>Services</section>
- <configfile>havp.xml</configfile>
- </menu>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=havp.xml&amp;act=edit&amp;id=0</url>
- </tab>
- <tab>
- <text>Whitelist</text>
- <url>/pkg.php?xml=havp_whitelist.xml</url>
- </tab>
- <tab>
- <text>Blacklist</text>
- <url>/pkg.php?xml=havp_blacklist.xml</url>
- <active/>
- </tab>
- <tab>
- <text>Exclude from Transparent Proxy</text>
- <url>/pkg.php?xml=havp_trans_exclude.xml</url>
- </tab>
- </tabs>
-
- <configpath>['installedpackages']['havpblacklist']['config']</configpath>
-
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Blocked URL</fielddescr>
- <fieldname>url</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
-
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>http://agni.linuxense.com/packages/config/havp.inc</item>
- </additional_files_needed>
-
- <fields>
- <field>
- <fielddescr>Blocked URL</fielddescr>
- <fieldname>url</fieldname>
- <description>Enter the URL to blacklist</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>Enter the description for this url</description>
- <type>input</type>
- </field>
- </fields>
-
- <custom_php_command_before_form>sync_package_havp_blacklist();</custom_php_command_before_form>
- <custom_delete_php_command>sync_package_havp_blacklist();</custom_delete_php_command>
- <custom_php_resync_config_command>sync_package_havp_blacklist();</custom_php_resync_config_command>
-</packagegui>
diff --git a/config/havp_startup.inc b/config/havp_startup.inc
deleted file mode 100644
index eb4cd31a..00000000
--- a/config/havp_startup.inc
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/local/bin/php
-<?php
-require_once('globals.inc');
-require_once('config.inc');
-require_once('service-utils.inc');
-require_once('pkg-utils.inc');
-require_once('pfsense-utils.inc');
-require_once('/usr/local/pkg/havp.inc');
-global $config;
-transparency_init();
-?>
-
diff --git a/config/havp_trans_exclude.xml b/config/havp_trans_exclude.xml
deleted file mode 100644
index b04d168f..00000000
--- a/config/havp_trans_exclude.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>havp_trans_exclude</name>
- <version>0.1.0</version>
- <title>HAVP: Exclude from Transparent Proxy</title>
- <include_file>/usr/local/pkg/havp.inc</include_file>
-
- <menu>
- <name>Transparency Exclude</name>
- <tooltiptext></tooltiptext>
- <section>Services</section>
- <configfile>havp.xml</configfile>
- </menu>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=havp.xml&amp;act=edit&amp;id=0</url>
- </tab>
- <tab>
- <text>Whitelist</text>
- <url>/pkg.php?xml=havp_whitelist.xml</url>
- </tab>
- <tab>
- <text>Blacklist</text>
- <url>/pkg.php?xml=havp_blacklist.xml</url>
- </tab>
- <tab>
- <text>Exclude from Transparent Proxy</text>
- <url>/pkg.php?xml=havp_trans_exclude.xml</url>
- <active/>
- </tab>
- </tabs>
-
- <configpath>['installedpackages']['havptransexclude']['config']</configpath>
-
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Exempted IP</fielddescr>
- <fieldname>ip</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
-
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>http://agni.linuxense.com/packages/config/havp.inc</item>
- </additional_files_needed>
-
- <fields>
- <field>
- <fielddescr>Exempted IP</fielddescr>
- <fieldname>ip</fieldname>
- <description>Enter the IP to exempt from transparent proxy</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>Enter the description for this item</description>
- <type>input</type>
- </field>
- </fields>
-
- <custom_php_command_before_form>add_trans_table();</custom_php_command_before_form>
- <custom_delete_php_command>add_trans_table();</custom_delete_php_command>
- <custom_php_resync_config_command>add_trans_table();</custom_php_resync_config_command>
-</packagegui>
diff --git a/config/havp_whitelist.xml b/config/havp_whitelist.xml
deleted file mode 100644
index ce64a838..00000000
--- a/config/havp_whitelist.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>havp-whitelist</name>
- <version>0.1.0</version>
- <title>HAVP: Whitelist</title>
- <include_file>/usr/local/pkg/havp.inc</include_file>
-
- <menu>
- <name>HAVP Whitelist</name>
- <tooltiptext></tooltiptext>
- <section>Services</section>
- <configfile>havp.xml</configfile>
- </menu>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=havp.xml&amp;act=edit&amp;id=0</url>
- </tab>
- <tab>
- <text>Whitelist</text>
- <url>/pkg.php?xml=havp_whitelist.xml</url>
- <active/>
- </tab>
- <tab>
- <text>Blacklist</text>
- <url>/pkg.php?xml=havp_blacklist.xml</url>
- </tab>
- <tab>
- <text>Exclude from Transparent Proxy</text>
- <url>/pkg.php?xml=havp_trans_exclude.xml</url>
- </tab>
- </tabs>
-
- <configpath>['installedpackages']['havpwhitelist']['config']</configpath>
-
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Exempted URL</fielddescr>
- <fieldname>url</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
-
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>http://agni.linuxense.com/packages/config/havp.inc</item>
- </additional_files_needed>
-
- <fields>
- <field>
- <fielddescr>Exempted URL</fielddescr>
- <fieldname>url</fieldname>
- <description>Enter the URL to exempt from blacklisting</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>Enter the description for this item</description>
- <type>input</type>
- </field>
- </fields>
-
- <custom_php_command_before_form>sync_package_havp_whitelist();</custom_php_command_before_form>
- <custom_delete_php_command>sync_package_havp_whitelist();</custom_delete_php_command>
- <custom_php_resync_config_command>sync_package_havp_whitelist();</custom_php_resync_config_command>
-</packagegui>
diff --git a/config/hula.xml b/config/hula.xml
deleted file mode 100644
index fa3d7273..00000000
--- a/config/hula.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>hula</name>
- <version>3.0</version>
- <title>Services: Hula</title>
- <savetext>Change</savetext>
- <preoutput>yes</preoutput>
- <donotsave>true</donotsave>
- <!-- Menu is where this packages menu will appear -->
- <menu>
- <name>Hula Setup</name>
- <tooltiptext>This area will help setup Hula for the first time.</tooltiptext>
- <section>Services</section>
- <configfile>hula.xml</configfile>
- </menu>
- <menu>
- <name>Hula Admin</name>
- <tooltiptext>This area will help manage Hula from day to day.</tooltiptext>
- <section>Services</section>
- <url>http://$myurl:89</url>
- </menu>
- <menu>
- <name>Hula Users</name>
- <tooltiptext>This area is for user logins.</tooltiptext>
- <section>Services</section>
- <url>http://$myurl:8080</url>
- </menu>
-
- <additional_files_needed>
- <item>https://www.pfsense.org/packages/All/hula.tgz</item>
- </additional_files_needed>
-
- <!-- Do not save invokes a simple input menu and will not update
- the configuration database. -->
- <fields>
- <field>
- <fielddescr>Hula Default Domain</fielddescr>
- <fieldname>domain</fieldname>
- <description>Enter the default domain that hula will use.</description>
- <type>input</type>
- </field>
- </fields>
- <custom_add_php_command>
- conf_mount_rw();
- config_lock();
- system("/usr/local/hula/sbin/hulasetup --domain=" . $_POST['domain']);
- system("/usr/local/etc/rc.d/hula.sh &amp;");
- conf_mount_ro();
- config_unlock();
- </custom_add_php_command>
- <custom_php_install_command>
- $fout = fopen("/usr/local/etc/rc.d/hula.sh","w");
- fwrite($fout, "#!/bin/sh\n\n");
- fwrite($fout, "/sbin/mount -t linprocfs linprocfs /proc\n");
- fwrite($fout, "/usr/local/hula/sbin/hulamanager &amp;\n");
- fclose($fout);
- chmod("/usr/local/etc/rc.d/hula.sh", 0755);
- </custom_php_install_command>
- <custom_php_deinstall_command>
- mwexec("/usr/bin/killall -9 hulamanager");
- rmdir_recursive("/usr/local/hula");
- unlink_if_exists("/usr/local/etc/rc.d/hula.sh");
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/ifdepd.xml b/config/ifdepd.xml
deleted file mode 100644
index 009a3b73..00000000
--- a/config/ifdepd.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>ifdepd</name>
- <version>20050303</version>
- <title>ifdepd: Settings</title>
- <aftersaveredirect>/pkg_edit.php?xml=ifdepd.xml&amp;id=0</aftersaveredirect>
- <menu>
- <name>ifdepd</name>
- <tooltiptext>Modify ifdepd settings.</tooltiptext>
- <section>Services</section>
- <configfile>ifdepd.xml</configfile>
- <url>pkg_edit.php?xml=ifdepd.xml&amp;id=0</url>
- </menu>
- <service>
- <name>ifdepd</name>
- <rcfile>ifdepd.sh</rcfile>
- <executable>ifdepd</executable>
- </service>
- <configpath>installedpackages->package->$packagename->configuration->settings</configpath>
- <fields>
- <field>
- <fielddescr>Use default values</fielddescr>
- <fieldname>usedefaults</fieldname>
- <description>If this is checked ifdepd will monitor the WAN and LAN interfaces for connectivity and will disable carp0 and carp1 upon their failure.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Source interfaces</fielddescr>
- <fieldname>srcinterface</fieldname>
- <description>Enter a colon seperated list of interfaces to monitor for connectivity. You must use the physical interface names.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Destination interfaces</fielddescr>
- <fieldname>destinterface</fieldname>
- <description>Enter a colon seperated list of interfaces to disable once one of the source interfaces loses connectivity. You must specify physical interface names.</description>
- <type>input</type>
- </field>
- </fields>
- <custom_php_global_functions>
- function sync_package_ifdepd() {
- conf_mount_rw();
- config_lock();
- global $config;
- $ifdepd_config =&amp; $config['installedpackages']['ifdepd']['config'][0];
- if($ifdepd_config != "") {
- if(isset($ifdepd_config['usedefaults'])) {
- $lan_int = $config['interfaces']['lan']['if'];
- $wan_int = $config['interfaces']['wan']['if'];
- $start = "/usr/local/bin/ifdepd -d -S " . $lan_int . ":" . $wan_int . " -D carp0:carp1\n";
- } else {
- $start = "/usr/local/bin/ifdepd -d -S " . $ifdepd_config['srcinterface'] . " -D " . $_POST['destinterface'] . "\n";
- }
- write_rcfile(array(
- "file" => "ifdepd.sh",
- "start" => $start,
- "stop" => "/usr/bin/killall ifdepd"
- )
- );
- restart_service("ifdepd");
- }
- conf_mount_ro();
- config_unlock();
- }
- </custom_php_global_functions>
- <custom_add_php_command>
- sync_package_ifdepd();
- </custom_add_php_command>
- <custom_php_resync_config_command>
- sync_package_ifdepd();
- </custom_php_resync_config_command>
-</packagegui>
-
diff --git a/config/ifstated.xml b/config/ifstated.xml
deleted file mode 100644
index 5adcf9c4..00000000
--- a/config/ifstated.xml
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>ifstated</name>
- <version>20041117</version>
- <title>ifstated: Settings</title>
- <aftersaveredirect>pkg_edit.php?xml=ifstated.xml&amp;id=0&amp;savemsg=Updated</aftersaveredirect>
- <menu>
- <name>ifstated</name>
- <tooltiptext>Modify ifstated settings.</tooltiptext>
- <section>Services</section>
- <configfile>ifstated.xml</configfile>
- <url>/pkg_edit.php?xml=ifstated.xml&amp;id=0</url>
- </menu>
- <modify_system>
- <modifyitem>
- <modifyfilename>/etc/sysctl.conf</modifyfilename>
- <textneeded>net.inet.carp.preempt=1</textneeded>
- </modifyitem>
- </modify_system>
- <configpath>installedpackages->package->$packagename->configuration->settings</configpath>
- <fields>
- <field>
- <fielddescr>External Test IP</fielddescr>
- <fieldname>exttestip</fieldname>
- <description>Enter an IP to test external connectivity with. This should be a host with extremely high availability.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Internal Test IP</fielddescr>
- <fieldname>inttestip</fieldname>
- <description>Enter an IP to test internal connectivity with. This should be a host with extremely high availability.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Paired Firewall External IP</fielddescr>
- <fieldname>pairextip</fieldname>
- <description>Enter the real IP of the other firewall's (real) external interface.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Paired Firewall Internal IP</fielddescr>
- <fieldname>pairintip</fieldname>
- <description>Enter the real IP of the other firewall's (real) internal interface.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Initial State</fielddescr>
- <fieldname>initstate</fieldname>
- <description>Enter the desired initial state for this firewall.</description>
- <type>select</type>
- <options>
- <option>
- <name>Primary</name>
- <value>primary</value>
- </option>
- <option>
- <name>Backup</name>
- <value>backup</value>
- </option>
- </options>
- </field>
- </fields>
- <custom_add_php_command>
- conf_mount_rw();
- config_lock();
- global $config;
- if ($_POST == "") $_POST = $config['installedpackages']['ifstated']['config'];
- $fout = fopen("/usr/local/etc/ifstated.conf","w");
- if($config['installedpackages']['ifstated']['config'] != "") {
- fwrite($fout, "# This file was automatically generated by the pfSense\n# package management system.\n\n");
- fwrite($fout, "init-state " . $_POST['initstate'] . "\n\n");
- fwrite($fout, "carp_up = \"((carp0 link up) and (carp1 link up))\"\ncarp_down = \"((! carp0 link up) and (! carp1 link up))\"\ncarp_sync= \"((carp0 link up and carp1 link up) or ((!carp0 link up) and (!carp1 link up)))\"\n\n");
- fwrite($fout, "net = '( \"ping -q -c 1 -t 1 " . $_POST['exttestip'] . " > /dev/null\" every 10 and \"ping -q -c 1 -t 1 " . $_POST['inttestip'] . " > /dev/null\" every 10)'\n\n");
- fwrite($fout, "peer = '( \"ping -q -c 1 -t 1 " . $_POST['pairextip'] . " > /dev/null\" every 10 and \"ping -q -c 1 -t 1 " . $_POST['pairintip'] . " > /dev/null\" every 10)'\n\n");
- fwrite($fout, "state auto {\nif \$carp_up {\nset-state primary\n}\nif \$carp_down {\nset-state backup\n}\n}\n\n");
- fwrite($fout, "state primary {\ninit {\nrun \"ifconfig carp0 advskew 10\"\nrun \"ifconfig carp1 advskew 10\"\n}\nif ! \$net {\nset-state demoted\n}\n}\n\nstate demoted {\ninit {\nrun \"ifconfig carp0 advskew 254\"\nrun \"ifconfig carp1 advskew 254\"\n}\nif \$net {\nset-state primary\n}\n}\n\n");
- fwrite($fout, "state promoted {\ninit {\nrun \"ifconfig carp0 advskew 0\"\nrun \"ifconfig carp1 advskew 0\"\n}\nif \$peer or ! \$net {\nset-state backup\n}\n}\n\n");
- fwrite($fout, "state backup {\ninit {\nrun \"ifconfig carp0 advskew 100\"\nrun \"ifconfig carp1 advskew 100\"\n}\nif ! \$carp_sync and \$net and \"sleep 5\" every 10 {\nif (! \$carp_sync) and \$net {\nset-state promoted\n}\n}\n}\n");
- }
- fclose($fout);
- conf_mount_ro();
- config_unlock();
- mwexec("/usr/bin/killall -HUP ifstated");
- </custom_add_php_command>
- <custom_php_install_command>
- global $config;
- $fout = fopen("/usr/local/etc/rc.d/ifstated.sh","w");
- fwrite($fout,"#!/bin/sh\n\n/usr/local/sbin/ifstated\n");
- fwrite($fout, "# PACKAGE: IFStated\n");
- fwrite($fout, "# EXECUTABLE: ifstated\n");
- fclose($fout);
- chmod("/usr/local/etc/rc.d/ifstated.sh", 0755);
- </custom_php_install_command>
-</packagegui>
-
diff --git a/config/igmpproxy/filter.tmp b/config/igmpproxy/filter.tmp
deleted file mode 100644
index 027fa204..00000000
--- a/config/igmpproxy/filter.tmp
+++ /dev/null
@@ -1,3315 +0,0 @@
-<?php
-/* $Id: filter.inc,v 1.575.2.368.2.65 2008/01/31 06:19:51 sullrich Exp $ */
-/*
- filter.inc
- Copyright (C) 2004-2006 Scott Ullrich
- Copyright (C) 2005 Bill Marquette
- Copyright (C) 2006 Peter Allgeyer
- All rights reserved.
-
- originally part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-/* include all configuration functions */
-require_once("functions.inc");
-require_once("pkg-utils.inc");
-require_once("notices.inc");
-
-if(!function_exists("filter_configure"))
- require_once("filter.inc");
-
-if($config['system']['shapertype'] <> "m0n0")
- require_once ("shaper.inc");
-
-/* holds the items that will be executed *AFTER* the filter is fully loaded */
-$after_filter_configure_run = array();
-
-function filter_pflog_start() {
- global $config, $g;
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_pflog_start() being called $mt\n";
- }
-
- mute_kernel_msgs();
-
- $pid = `ps awwwux | grep -v "grep" | grep "tcpdump -v -l -n -e -ttt -i pflog0" | awk '{ print $2 }'`;
- if(!$pid)
- mwexec_bg("/usr/sbin/tcpdump -v -l -n -e -ttt -i pflog0 | logger -t pf -p local0.info");
-
- unmute_kernel_msgs();
-
-}
-
-/* reload filter async */
-function filter_configure() {
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_configure() being called $mt\n";
- }
- global $g;
-
- touch($g['tmp_path'] . "/filter_dirty");
-}
-
-/* reload filter sync */
-function filter_configure_sync() {
- global $config, $g, $after_filter_configure_run;
- filter_pflog_start();
- update_filter_reload_status("Initializing");
- /* invalidate interface cache */
- get_interface_arr(true);
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_configure_sync() being called $mt\n";
- }
-
- /* load ipfw / dummynet early on if required */
- if($config['system']['dummynetshaper']) {
- $status = intval(`kldstat | grep ipfw | wc -l | awk '{ print $1 }'`);
- if($status == "0") {
- mwexec("/sbin/kldload ipfw");
- mwexec("/sbin/kldload dummynet");
- }
- } else {
- /* check to see if any rules reference a schedule
- * and if so load ipfw for later usage.
- */
- foreach($config['filter']['rule'] as $rule) {
- if($rule['sched'])
- $time_based_rules = true;
- }
- if($time_based_rules == true) {
- $status = intval(`kldstat | grep ipfw | wc -l | awk '{ print $1 }'`);
- if($status == "0") {
- mute_kernel_msgs();
- mwexec("/sbin/kldload ipfw");
- unmute_kernel_msgs();
- }
- exec("/sbin/ipfw delete set 9");
- exec("/sbin/ipfw delete 2");
- exec("/sbin/ipfw delete 3");
- }
- }
-
- $lan_if = $config['interfaces']['lan']['if'];
- $wan_if = get_real_wan_interface();
-
- /* generate aliases */
- if($g['booting'] == true) echo ".";
- update_filter_reload_status("Creating aliases");
- $aliases = filter_generate_aliases();
- /* generate nat rules */
- if($g['booting'] == true) echo ".";
- update_filter_reload_status("Generating NAT rules");
- $natrules = filter_nat_rules_generate();
- /* generate pfctl rules */
- if($g['booting'] == true) echo ".";
- update_filter_reload_status("Generating filter rules");
- $pfrules = filter_rules_generate();
-
- if (isset($config['shaper']['enable']) and $config['system']['shapertype'] <> "m0n0") {
- /* generate altq interface setup parms */
- if($g['booting'] == true) echo ".";
- update_filter_reload_status("Generating ALTQ interfaces");
- $altq_ints = filter_setup_altq_interfaces();
- /* generate altq queues */
- if($g['booting'] == true) echo ".";
- update_filter_reload_status("Generating ALTQ queues");
- $altq_queues = filter_generate_altq_queues($altq_ints);
- /* generate altq rules */
- if($g['booting'] == true) echo ".";
- /* Setup a default rule that tags ALL packets as unshaped
- * we'll match only unshaped packets in the shaper code later
- * this allows the shaper to be first match
- */
- $pf_altq_rules = "block in all tag unshaped label \"SHAPER: first match rule\"\n";
- update_filter_reload_status("Generating ALTQ rules");
- $pf_altq_rules .= filter_generate_pf_altq_rules();
- }
-
- update_filter_reload_status("Loading filter rules");
-
- /* enable pf if we need to, otherwise disable */
- if (!isset ($config['system']['disablefilter'])) {
- mwexec("/sbin/pfctl -e");
- } else {
- mwexec("/sbin/pfctl -d");
- unlink_if_exists("{$g['tmp_path']}/filter_loading");
- update_filter_reload_status("Filter is disabled. Not loading rules.");
- return;
- }
-
- $fd = fopen("{$g['tmp_path']}/rules.debug", "w");
- $rules = $aliases . " \n";
-
- update_filter_reload_status("Setting up logging information");
-
- $rules .= setup_logging_interfaces();
-
- if ($config['system']['optimization'] <> "")
- $rules .= "set optimization {$config['system']['optimization']}\n";
- else
- $rules .= "set optimization normal\n";
-
- if ($config['system']['maximumstates'] <> "" && is_numeric($config['system']['maximumstates'])) {
- /* User defined maximum states in Advanced menu. */
- $rules .= "set limit states {$config['system']['maximumstates']}\n";
- }
- $rules .= "\n";
-
- update_filter_reload_status("Setting up SCRUB information");
- /* get our wan interface? */
- $wanif = get_real_wan_interface();
-
- /* disable scrub option */
- if(!isset($config['system']['disablescrub'])) {
- /* set up MSS clamping */
- if ($config['interfaces']['wan']['mtu'] <> "" and is_numeric($config['interfaces']['wan']['mtu']))
- $mssclamp = "max-mss " . (intval($config['interfaces']['wan']['mtu'] - 40));
- else
- if ($config['interfaces']['wan']['ipaddr'] == "pppoe")
- $mssclamp = "max-mss 1452";
- else
- $mssclamp = "";
-
- /* configure no-df for linux nfs and others */
- if ($config['system']['scrubnodf'])
- $scrubnodf = "no-df random-id";
- else
- $scrubnodf = "random-id";
- $rules .= "scrub all {$scrubnodf} {$mssclamp} fragment reassemble\n"; // reassemble all directions
- } else if ($config['interfaces']['wan']['mtu'] <> "" and is_numeric($config['interfaces']['wan']['mtu'])) {
- $rules .= "scrub {$mssclamp}\n"; // reassemble all directions
- }
-
- if($config['system']['shapertype'] <> "m0n0") {
- $rules.= "{$altq_ints}\n";
- $rules.= "{$altq_queues}\n";
- }
- $rules.= "{$natrules}\n";
- if($config['system']['shapertype'] <> "m0n0")
- $rules.= "{$pf_altq_rules}\n";
- $rules.= "{$pfrules}\n";
- fwrite($fd, $rules);
- fclose($fd);
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "pfctl being called at $mt\n";
- }
- $rules_loading = mwexec("/sbin/pfctl -o -f {$g['tmp_path']}/rules.debug");
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "pfctl done at $mt\n";
- }
-
- /* check for a error while loading the rules file. if an error has occured
- then output the contents of the error to the caller */
- if($rules_loading <> 0) {
- $rules_error = exec_command("/sbin/pfctl -f {$g['tmp_path']}/rules.debug");
- $line_error = split("\:", $rules_error);
- $line_number = $line_error[1];
- $rules_file = `/bin/cat {$g['tmp_path']}/rules.debug`;
- $line_split = split("\n", $rules_file);
- if(is_array($line_split))
- $line_error = "The line in question reads [{$line_number}]: {$line_split[$line_number-1]}";
- if($line_error and $line_number) {
- file_notice("filter_load", "There were error(s) loading the rules: {$rules_error} {$line_error}", "Filter Reload", "");
- log_error("There were error(s) loading the rules: {$rules_error} - {$line_error}");
- update_filter_reload_status("There were error(s) loading the rules: {$rules_error} - {$line_error}");
- return;
- }
- }
-
- unlink_if_exists("/usr/local/pkg/pf/carp_sync_client.php");
-
- /* run items scheduled for after filter configure run */
- foreach($after_filter_configure_run as $afcr) {
- $fda = fopen("/tmp/commands.txt", "w");
- fwrite($fda, $afcr . "\n");
- fclose($fda);
- }
- if(file_exists("/tmp/commands.txt")) {
- mwexec("sh /tmp/commands.txt &");
- unlink("/tmp/commands.txt");
- }
-
- update_filter_reload_status("Running plugins");
-
- /* process packager manager custom rules */
- $files = return_dir_as_array("/usr/local/pkg/pf/");
- if($files <> "") {
- foreach ($files as $file) {
- if($file) {
- $text = file_get_contents("/usr/local/pkg/pf/" . $file);
- if($text) {
- if(stristr($file, ".sh") == true) {
- mwexec("/usr/local/pkg/pf/" . $file . " start");
- } else {
- if(!stristr($file,"CVS")) {
- if($g['booting'] == true)
- echo "\t{$file}... ";
- require_once("/usr/local/pkg/pf/" . $file);
- }
- }
- }
- }
- }
- }
- update_filter_reload_status("Plugins completed.");
-
- system_start_ftp_helpers();
-
- if($config['system']['shapertype'] == "m0n0") {
- require_once ("/etc/inc/m0n0/shaper.inc");
- shaper_configure();
- }
-
- /* if time based rules are enabled then swap in the set */
- if($time_based_rules == true) {
- tdr_install_cron(true);
- tdr_install_set();
- } else {
- tdr_install_cron(false);
- }
-
- /*
- we need a way to let a user run a shell cmd after each
- filter_configure() call. run this xml command after
- each change.
- */
- if($config['system']['afterfilterchangeshellcmd'] <> "")
- mwexec($config['system']['afterfilterchangeshellcmd']);
-
- /* sync carp entries to other firewalls */
- update_filter_reload_status("Syncing CARP data");
- carp_sync_client();
-
- system_routing_configure();
-
- update_filter_reload_status("Done");
-
- return 0;
-}
-
-function filter_generate_aliases() {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_generate_aliases() being called $mt\n";
- }
- $aliases = "";
-
- $i = 0;
-
- $lanip = find_interface_ip($config['interfaces']['lan']['if']);
- $wanip = find_interface_ip(get_real_wan_interface());
-
- $lan_aliases = " " . link_ip_to_carp_interface($lanip);
- $wan_aliases = " " . link_ip_to_carp_interface($wanip);
-
- if(link_int_to_bridge_interface("lan"))
- $lan_aliases .= " " . link_int_to_bridge_interface("lan");
- if(link_int_to_bridge_interface("wan"))
- $wan_aliases .= " " . link_int_to_bridge_interface("wan");
-
- $aliases .= "# System Aliases \n";
- $aliases .= "loopback = \"{ lo0 }\"\n";
- $aliases .= "lan = \"{ {$config['interfaces']['lan']['if']}{$lan_aliases} }\"\n";
-
- if($config['interfaces']['wan']['ipaddr'] == "pppoe" or $config['interfaces']['wan']['ipaddr'] == "pptp") {
- $aliases .= "ng0 = \"{ " . $config['interfaces']['wan']['if'] . " " . get_real_wan_interface() . " }\" \n";
- $aliases .= "wan = \"{ " . $config['interfaces']['wan']['if'] . "{$wan_aliases} ng0 }\"\n";
- } else {
- $aliases .= "wan = \"{ " . get_real_wan_interface() . "{$wan_aliases} }\"\n";
- }
-
- $aliases .= "enc0 = \"{ enc0 }\"\n";
-
- /* used to count netgraph interfaces */
- $counter = 0;
-
- /* ng ordering is VERY important here. do not alter order */
- if($config['pptpd']['mode'] == "server") {
- /* build pptp alias */
- $tmp = "pptp = \"{ ";
- $starting_pptp = 1;
- if($config['interfaces']['wan']['ipaddr'] == "pppoe")
- $starting_pptp = 1;
- for($x=$starting_pptp; $x<$g["n_pptp_units"]+$starting_pptp; $x++)
- $tmp .= "ng{$x} ";
- $counter = $x;
- $tmp .= "}\" \n";
- if($counter > 0)
- $aliases .= $tmp;
- }
- if($config['pppoe']['mode'] == "server") {
- /* build pppoe alias */
- $tmp = "pppoe = \"{ ";
- $starting_pppoe = 1;
- if($config['interfaces']['wan']['ipaddr'] == "pppoe")
- $starting_pppoe = 1;
- for($x=0; $x<$g["n_pppoe_units"]+$starting_pppoe; $x++) {
- $tmp .= "ng{$counter} ";
- $counter++;
- }
- $tmp .= "}\" \n";
- if($x > 0)
- $aliases .= $tmp;
- }
-
- $ifdescrs = array();
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- $ifdescrs['opt' . $j] = "opt" . $j;
- }
- $bridgetracker = 0;
- foreach ($ifdescrs as $ifdescr => $ifname) {
- /* do not process tun interfaces */
- /* do process tun interfaces for openvpn compatibility */
- /* if(stristr(filter_opt_interface_to_real($ifname), "tun") == true) continue; */
- $aliases .= convert_friendly_interface_to_friendly_descr($ifname) . " = \"{ " . filter_opt_interface_to_real($ifname);
- if(link_int_to_bridge_interface($ifname))
- $aliases .= " " . link_int_to_bridge_interface($ifname);
- $optip = find_interface_ip($config['interfaces'][$ifname]['if']);
- if($optip) {
- $opt_carp_ints = link_ip_to_carp_interface($optip);
- if($opt_carp_ints)
- $aliases .= $opt_carp_ints;
- }
- $aliases .= " }\"\n";
- }
- $aliases .= "# User Aliases \n";
- /* Setup pf groups */
- if (isset($config['aliases']['alias'])) {
- foreach ($config['aliases']['alias'] as $alias) {
- $extraalias = "";
- $ip = find_interface_ip($alias['address']);
- $extraalias = " " . link_ip_to_carp_interface($ip);
- $aliases .= "{$alias['name']} = \"{ {$alias['address']}{$extralias} }\"\n";
- }
- }
-
- return $aliases;
-}
-
-function get_vpns_list() {
- global $config;
- /* build list of vpns */
- $vpns = "";
- $isfirst = true;
- /* ipsec */
- if ($config['ipsec']['tunnel']) {
- foreach ($config['ipsec']['tunnel'] as $tunnel) {
- if ($isfirst == false)
- $vpns .= " ";
- $vpns .= $tunnel['remote-subnet'];
- $isfirst = false;
- }
- }
- /* openvpn */
- foreach (array('client', 'server') as $type) {
- $conf =& $config['installedpackages']["openvpn$type"]['config'];
- if (!is_array($conf)) continue;
- foreach ($conf as $tunnel) {
- if ($isfirst == false)
- $vpns .= " ";
- $vpns .= $tunnel['remote_network'];
- $isfirst = false;
- }
- }
- /* pppoe */
- if ($config['pppoe']['remoteip']) {
- if ($isfirst == false)
- $vpns .= " ";
- $vpns .= $config['pppoe']['remoteip'] ."/". $config['pppoe']['pppoe_subnet'];
- $isfirst = false;
- }
- $vpns .= " ";
- return $vpns;
-}
-
-function generate_optcfg_array(& $optcfg) {
- global $config;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "generate_optcfg_array() being called $mt\n";
- }
-
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $oc = $config['interfaces']['opt' . $i];
-
- if (isset($oc['enable']) && $oc['if']) {
- $oic = array();
- $oic['if'] = $oc['if'];
-
- if ($oc['bridge']) {
- if (!strstr($oc['bridge'], "opt") ||
- isset($config['interfaces'][$oc['bridge']]['enable'])) {
- if (is_ipaddr($config['interfaces'][$oc['bridge']]['ipaddr'])) {
- $oic['ip'] = $config['interfaces'][$oc['bridge']]['ipaddr'];
- $oic['sn'] = $config['interfaces'][$oc['bridge']]['subnet'];
- $oic['sa'] = gen_subnet($oic['ip'], $oic['sn']);
- }
- }
- $oic['bridge'] = 1;
- } else {
- $oic['ip'] = $oc['ipaddr'];
- $oic['sn'] = $oc['subnet'];
- $oic['sa'] = gen_subnet($oic['ip'], $oic['sn']);
- }
-
- $optcfg['opt' . $i] = $oic;
- }
- }
-}
-
-function filter_flush_nat_table() {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_flush_nat_table() being called $mt\n";
- }
- return mwexec("/sbin/pfctl -F nat");
-}
-
-function filter_flush_state_table() {
- global $config, $g;
-
- return mwexec("/sbin/pfctl -F state");
-}
-
-/* Generate a 'nat on' or 'no nat on' rule for given interface */
-function filter_nat_rules_generate_if($if, $src = "any", $srcport = "", $dst = "any", $dstport = "", $natip = "", $natport = "", $nonat = false, $staticnatport = false) {
- global $config;
-
- /* XXX: billm - any idea if this code is needed? */
- if($src == "/32" || $src{0} == "/")
- return;
-
- /* Use interface name if IP isn't specified */
- if ($natip != "")
- $tgt = "{$natip}/32";
- else
- $tgt = "($if)";
-
- /* Add the hard set source port (useful for ISAKMP) */
- if ($natport != "")
- $tgt .= " port {$natport}";
-
- /* sometimes this gets called with "" instead of a value */
- if ($src == "")
- $src = "any";
-
- /* Match on this source port */
- if ($srcport != "")
- $src .= " port {$srcport}";
-
- /* sometimes this gets called with "" instead of a value */
- if ($dst == "")
- $dst = "any";
-
- /* Match on this dest port */
- if ($dstport != "")
- $dst .= " port {$dstport}";
-
- /* Allow for negating NAT entries */
- if ($nonat) {
- $nat = "no nat";
- $target = "";
- } else {
- $nat = "nat";
- $target = "-> {$tgt}";
- }
-
- /* outgoing static-port option, hamachi, Grandstream, VOIP, etc */
- if($staticnatport)
- $staticnatport_txt = " static-port";
- else
- $staticnatport_txt = "";
-
- $if_friendly = convert_real_interface_to_friendly_descr($if);
-
- /* Put all the pieces together */
- if($if_friendly)
- $natrule = "{$nat} on \${$if_friendly} from {$src} to {$dst} {$target}{$staticnatport_txt}\n";
-
- return $natrule;
-}
-
-function is_one_to_one_or_server_nat_rule($iptocheck) {
- global $config, $target;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "is_one_to_one_or_server_nat_rule() being called $mt\n";
- }
-
- if($config['nat']['onetoone'] <> "")
- foreach($config['nat']['onetoone'] as $onetoone) {
- if(ip_in_subnet($iptocheck,$onetoone['internal']."/".$onetoone['subnet']) == true)
- return true;
- if($onetoone['internal'] == $target)
- return true;
- }
-
- if($config['nat']['servernat'] <> "")
- foreach($config['nat']['servernat'] as $onetoone) {
- $int = explode("/", $onetoone['ipaddr']);
- if(ip_in_subnet($iptocheck,$onetoone['ipaddr']."/".$onetoone['subnet']) == true)
- return true;
- if($onetoone['ipaddr'] == $target)
- return true;
- }
-
- if($config['nat']['rule'] <> "")
- foreach($config['nat']['rule'] as $onetoone) {
- $int = explode("/", $onetoone['target']);
- if(ip_in_subnet($iptocheck,$onetoone['target']."/".$onetoone['subnet']) == true)
- return true;
- if($onetoone['target'] == $target)
- return true;
- }
-
- return FALSE;
-}
-
-function filter_nat_rules_generate() {
- global $config, $g, $after_filter_configure_run;
-
- $wancfg = $config['interfaces']['wan'];
- $lancfg = $config['interfaces']['lan'];
-
- $pptpdcfg = $config['pptpd'];
- $pppoecfg = $config['pppoe'];
- $wanif = get_real_wan_interface();
-
- $lanif = $config['interfaces']['lan']['if'];
- $lanip = $config['interfaces']['lan']['ipaddr'];
-
- $lansa = gen_subnet($lancfg['ipaddr'], $lancfg['subnet']);
-
- $natrules .= "nat-anchor \"pftpx/*\"\n";
-
- $natrules .= "nat-anchor \"natearly/*\"\n";
- $natrules .= "nat-anchor \"natrules/*\"\n";
-
- $natrules .= "# FTP proxy\n";
- $natrules .= "rdr-anchor \"pftpx/*\"\n";
-
- update_filter_reload_status("Creating 1:1 rules...");
-
- /* any 1:1 mappings? */
- if (is_array($config['nat']['onetoone'])) {
- foreach ($config['nat']['onetoone'] as $natent) {
- if (!is_numeric($natent['subnet']))
- $sn = 32;
- else
- $sn = $natent['subnet'];
-
- if (!$natent['interface'] || ($natent['interface'] == "wan"))
- $natif = $wanif;
- else
- $natif = $config['interfaces'][$natent['interface']]['if'];
-
- if($natif)
- $natrules .= "binat on $natif from {$natent['internal']}/{$sn} to any -> {$natent['external']}/{$sn}\n";
- }
- }
-
- /* any 1:1 mappings? */
- if (is_array($config['nat']['onetoone'])) {
- $natrules .= "\n";
- foreach ($config['nat']['onetoone'] as $natent) {
- if (!is_numeric($natent['subnet']))
- $sn = 32;
- else
- $sn = $natent['subnet'];
-
- if (!$natent['interface'] || ($natent['interface'] == "wan"))
- $natif = $wanif;
- else
- $natif = $config['interfaces'][$natent['interface']]['if'];
-
- if($natent['interface'])
- $natrules .= "binat on $natif from {$natent['internal']}/{$sn} to any -> {$natent['external']}/{$sn}\n";
- }
- }
-
- $natrules .= "\n# Outbound NAT rules\n";
-
- /* outbound rules - advanced or standard */
- if (isset($config['nat']['advancedoutbound']['enable'])) {
- /* advanced outbound rules */
- if (is_array($config['nat']['advancedoutbound']['rule'])) {
- foreach ($config['nat']['advancedoutbound']['rule'] as $obent) {
-
- update_filter_reload_status("Creating advanced outbound rule {$obent['descr']}");
-
- $src = $obent['source']['network'];
- if (isset($obent['destination']['not']) && !isset($obent['destination']['any']))
- $dst = "!" . $obent['destination']['address'];
- else
- $dst = $obent['destination']['address'];
-
-
- if (!$obent['interface'] || ($obent['interface'] == "wan"))
- $natif = $wanif;
- else
- $natif = $config['interfaces'][$obent['interface']]['if'];
-
- $natrules .= filter_nat_rules_generate_if($natif,
- $src,
- $obent['sourceport'],
- $dst,
- $obent['dstport'],
- $obent['target'],
- $obent['natport'],
- isset($obent['nonat']),
- isset($obent['staticnatport'])
- );
- }
- }
- } else {
- /* standard outbound rules (one for each interface) */
- update_filter_reload_status("Creating outbound NAT rules");
-
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$lansa}/{$lancfg['subnet']}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$lansa}/{$lancfg['subnet']}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$lansa}/{$lancfg['subnet']}");
-
- $optints = array();
- generate_optcfg_array($optints);
-
- /* generate lan nat mappings for opts with a gateway opts */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if (interface_has_gateway("$opt_interface")) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$lansa}/{$lancfg['subnet']}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$lansa}/{$lancfg['subnet']}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$lansa}/{$lancfg['subnet']}");
- }
- }
-
- /* optional interfaces */
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- update_filter_reload_status("Creating outbound rules (opt{$i})");
- $optcfg = $config['interfaces']['opt' . $i];
-
- if ((isset ($optcfg['enable'])) && (!$optcfg['bridge']) && (!interface_has_gateway("opt{$i}"))) {
- $optsa = gen_subnet($optcfg['ipaddr'], $optcfg['subnet']);
-
- /* create outbound nat entries for primary wan */
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$optsa}/{$optcfg['subnet']}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$optsa}/{$optcfg['subnet']}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$optsa}/{$optcfg['subnet']}", null, "", null, null, null, isset($optcfg['nonat']));
-
- /* create outbound nat entries for all opt wans */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if (interface_has_gateway("$opt_interface")) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$optsa}/{$optcfg['subnet']}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$optsa}/{$optcfg['subnet']}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$optsa}/{$optcfg['subnet']}", null, "", null, null, null, isset($optcfg['nonat']));
- }
- }
- }
- }
-
- /* PPTP subnet */
- if ($pptpdcfg['mode'] == "server") {
- $pptp_subnet = $g['pptp_subnet'];
- if($config['pptp']['pptp_subnet'] <> "")
- $pptp_subnet = $config['pptp']['pptp_subnet'];
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}");
-
- /* generate nat mappings for opts with a gateway opts */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if ((is_private_ip($pptpdcfg['remoteip'])) && (interface_has_gateway($opt_interface))) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}");
- }
- }
- }
-
- /* PPPoE subnet */
- if ($pppoecfg['mode'] == "server") {
- $pppoe_subnet = $g['pppoe_subnet'];
- if($config['pppoe']['pppoe_subnet'] <> "")
- $pppoe_subnet = $config['pppoe']['pppoe_subnet'];
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}");
-
- /* generate nat mappings for opts with a gateway opts */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if ((is_private_ip($pppoecfg['remoteip'])) && (interface_has_gateway($opt_interface))) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}");
- }
- }
- }
-
- /* static routes */
- if (is_array($config['staticroutes']['route'])) {
- foreach ($config['staticroutes']['route'] as $route) {
- $netip = explode("/", $route['network']);
- if ((! interface_has_gateway($route['interface'])) && (is_private_ip($netip[0]))) {
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$route['network']}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$route['network']}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$route['network']}", "", null);
- }
- /* generate nat mapping for static routes on opts */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if ((! interface_has_gateway($route['interface'])) && (is_private_ip($netip[0])) && (interface_has_gateway($opt_interface))) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$route['network']}", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$route['network']}", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$route['network']}", "", null);
- }
- }
-
- }
- }
-
- }
-
- $natrules .= "\n#SSH Lockout Table\n";
- $natrules .= "table <sshlockout> persist\n\n";
-
- /* is SPAMD insalled? */
- if (is_package_installed("spamd") == 1) {
- $natrules .= "\n# spam table \n";
-
- $natrules .= "table <whitelist> persist\n";
- $natrules .= "table <blacklist> persist\n";
- $natrules .= "table <spamd> persist\n";
- if(file_exists("/var/db/whitelist.txt"))
- $natrules .= "table <spamd-white> persist file \"/var/db/whitelist.txt\"\n";
- $natrules .= "rdr pass on {$wanif} proto tcp from <blacklist> to port smtp -> 127.0.0.1 port spamd\n";
- $natrules .= "rdr pass on {$wanif} proto tcp from <spamd> to port smtp -> 127.0.0.1 port spamd\n";
- $natrules .= "rdr pass on {$wanif} proto tcp from !<spamd-white> to port smtp -> 127.0.0.1 port spamd\n";
- if($config['installedpackages']['spamdsettings']['config'])
- foreach($config['installedpackages']['spamdsettings']['config'] as $ss)
- $nextmta = $ss['nextmta'];
- if($nextmta <> "") {
- $natrules .= "rdr pass on {$wanif} proto tcp from <spamd-white> to port smtp -> {$nextmta} port smtp\n";
- }
- }
-
- /* load balancer anchor */
- $natrules .= "\n# Load balancing anchor - slbd updates\n";
- $natrules .= "rdr-anchor \"slb\"\n";
-
- update_filter_reload_status("Setting up FTP helper");
-
- $natrules .= "\n# FTP Proxy/helper\n";
- /* build an array of interfaces to work with */
- $iflist = array("lan" => "LAN");
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
- $iflist['opt' . $i] = "opt{$i}";
- $interface_counter = 0;
- $vpns_list = get_vpns_list();
- /* prevent 1:1 ips from pftpx, they will be handled by ftp-sesame */
- if($config['nat']['onetoone'])
- foreach ($config['nat']['onetoone'] as $vipent)
- $onetoone_list .= "{$vipent['internal']} ";
- if($onetoone_list)
- $natrules .= "table <onetoonelist> { $onetoone_list }\n";
- if($vpns_list)
- $natrules .= "table <vpns> { $vpns_list }\n";
- /* loop through all interfaces and handle pftpx redirections */
- foreach ($iflist as $ifent => $ifname) {
- $ifname_lower = convert_friendly_interface_to_friendly_descr(strtolower($ifname));
- $realif = convert_friendly_interface_to_real_interface_name(strtolower($ifname));
- $int_ip = find_interface_ip($realif);
- if(isset($config['interfaces'][strtolower($ifname)]['disableftpproxy'])) {
- if($g['debug'])
- log_error("Filter: FTP proxy disabled for interface {$ifname} - ignoring.");
- $interface_counter++;
- continue;
- }
- if(stristr($ifname, "opt")) {
- if(!isset($config['interfaces'][$ifname]['enable'])) {
- continue;
- }
- }
- /* are we in routed mode? no source nat rules and not a outside interface? */
- /* If we have advanced outbound nat we skip the FTP proxy, we use ftpsesame */
- if((isset($config['nat']['advancedoutbound']['enable'])) && (! interface_has_gateway($ifname))) {
- $sourcenat = 0;
- /* we are using advanced outbound nat, are we in routing mode? */
- $realif = convert_friendly_interface_to_real_interface_name($ifname);
- /* if the interface address lies within a outbound NAT source network we should skip */
- if(! empty($config['nat']['advancedoutbound']['rule'])) {
- foreach($config['nat']['advancedoutbound']['rule'] as $natnetwork) {
- if(ip_in_subnet($int_ip, $natnetwork['source']['network'])) {
- /* if the interface address is matched in the AON Rule we need the ftp proxy */
- $sourcenat++;
- }
- }
- }
- if($sourcenat == 0) {
- if($g['debug'])
- log_error("Filter: No AON rule matched for interface {$ifname} - not using the FTP proxy");
- $interface_counter++;
- continue;
- } else {
- if($g['debug'])
- log_error("Filter: AON Rule matched for interface {$ifname} - using FTP proxy");
- }
- }
- $tmp_port = 8021 + $interface_counter;
- $tmp_interface = convert_friendly_interface_to_real_interface_name($ifname);
- $ifname_lower = strtolower(convert_friendly_interface_to_friendly_descr($ifname));
- $vpns = get_vpns_list();
- /* if the user has defined, include the alias so that we do not redirect ftp
- connections across the tunnels to pftpx */
- $int_ip = find_interface_ip($tmp_interface);
- /* if interface lacks an ip, dont setup a rdr for ftp. they are most likely on a bridged interface */
- if($int_ip and $vpns_list)
- if($ifname_lower) {
- $natrules .= "no rdr on $tmp_interface proto tcp from any to <vpns> port 21\n";
- if($onetoone_list)
- $natrules .= "no rdr on $tmp_interface proto tcp from <onetoonelist> to any port 21\n";
- }
- if($ifname_lower)
- $natrules .= "rdr on $tmp_interface proto tcp from any to any port 21 -> 127.0.0.1 port {$tmp_port}\n";
- $interface_counter++;
- }
- $natrules .= "\n";
-
- /* DIAG: add ipv6 NAT, if requested */
- if (isset($config['diag']['ipv6nat']['enable']) and $config['diag']['ipv6nat']['ipaddr'] <> "") {
- /* XXX: FIX ME! IPV6 */
- $natrules .= "rdr on \$wan proto ipv6 from any to any -> {$config['diag']['ipv6nat']['ipaddr']}\n";
- }
-
- if(file_exists("/var/etc/inetd.conf"))
- mwexec("rm /var/etc/inetd.conf");
- touch("/var/etc/inetd.conf");
-
- if (isset($config['nat']['rule'])) {
- $natrules .= "# NAT Inbound Redirects\n";
-
- if(!isset($config['system']['disablenatreflection'])) {
- $inetd_fd = fopen("/var/etc/inetd.conf","w");
- /* start redirects on port 19000 of localhost */
- $starting_localhost_port = 19000;
- }
-
- foreach ($config['nat']['rule'] as $rule) {
-
- update_filter_reload_status("Creating NAT rule {$rule['descr']}");
-
- /* if item is an alias, expand */
- $extport = "";
- unset($extport);
- if(alias_expand($rule['external-port']))
- $extport[0] = alias_expand_value($rule['external-port']);
- else
- $extport = explode("-", $rule['external-port']);
-
- /* if item is an alias, expand */
- if(alias_expand($rule['local-port']))
- $localport = "";
- else
- $localport = " port {$rule['local-port']}";
-
- $target = alias_expand_host($rule['target']);
-
- if (!$target) {
- $natrules .= "# Unresolvable alias {$rule['target']}\n";
- continue; /* unresolvable alias */
- }
-
- # use tables for aliases in rdr
- if (!is_ipaddr($target)) {
- $natrules .= "table <{$rule['target']}> { $target }\n";
- $target = "<{$rule['target']}>";
- }
-
- if ($rule['external-address'])
- if($rule['external-address'] <> "any")
- $extaddr = $rule['external-address'] . "/32";
- else
- $extaddr = $rule['external-address'];
- else
- $extaddr = get_current_wan_address($rule['interface']);
-
- if (!$rule['interface'] || ($rule['interface'] == "wan"))
- $natif = $wanif;
- else if($rule['interface'] == "\$pptp")
- $natif = "pptp";
- else if($rule['interface'] == "\$pppoe")
- $natif = "pppoe";
- else
- $natif = $config['interfaces'][$rule['interface']]['if'];
-
- $lanif = $lancfg['if'];
-
- /*
- * Expand aliases
- * XXX: may want to integrate this into pf macros
- */
- if(alias_expand($target))
- $target = alias_expand($target);
- if(alias_expand($extaddr))
- $extaddr = alias_expand($extaddr);
-
- /*
- * If FTP Proxy Helper is enabled and the
- * operator has requested a port forward to
- * a ftp server then launch a helper
- */
- $dontinstallrdr = false;
- if($target <> "") {
- $external_address = $rule['external-address'];
- if($extport[0] == "21" and !isset($config['interfaces'][strtolower($rule['interface'])]['disableftpproxy'])) {
- $helpers = exec("/bin/ps awux | grep \"{$target} -b {$external_address}\" | grep -v grep");
- if(!$helpers) {
- if($external_address == "")
- $external_address = find_interface_ip(get_real_wan_interface());
- /* install a pftpx helper, do not set a rule. also use the delay filter configure run
- * routines because if this is the first bootup the filter is not completely configured
- * and thus pf is not fully running. otherwise we end up with: pftpx: pf is disabled
- */
- if(isset($config['shaper']['enable'])) {
- if(isset($config['ezshaper']['step5']['p2pcatchall'])) {
- $shaper_queue = "-q qP2PUp ";
- } else {
- $upq = "q" . convert_friendly_interface_to_friendly_descr($config['ezshaper']['step2']['outside_int']);
- $shaper_queue = "-q {$upq}def ";
- }
- } else {
- $shaper_queue = "";
- }
- $after_filter_configure_run[] = "/usr/local/sbin/pftpx {$shaper_queue}-f {$target} -b {$external_address} -c 21 -g 21";
- }
- $dontinstallrdr = true;
- }
- }
-
- if($extaddr == "")
- $dontinstallrdr = true;
-
- $rdr_on = convert_real_interface_to_friendly_descr($rule['interface']);
-
- if($dontinstallrdr == false) {
- /* is rule a port range? */
- if ((!$extport[1]) || ($extport[0] == $extport[1])) {
-
- switch ($rule['protocol']) {
- case "tcp/udp":
- if($natif) {
- if($rule['external-port'] <> $rule['local-port'])
- $natrules .= "{$nordr}rdr on $natif proto { tcp udp } from any to {$extaddr} port { {$extport[0]} } -> {$target}{$localport}";
- else
- $natrules .= "{$nordr}rdr on $natif proto { tcp udp } from any to {$extaddr} port { {$extport[0]} } -> {$target}";
- }
- break;
- case "udp":
- case "tcp":
- if($extport[0])
- if($natif) {
- if($rule['external-port'] <> $rule['local-port'])
- $natrules .= "rdr on $natif proto {$rule['protocol']} from any to {$extaddr} port { {$extport[0]} } -> {$target}{$localport}";
- else
- $natrules .= "rdr on $natif proto {$rule['protocol']} from any to {$extaddr} port { {$extport[0]} } -> {$target}";
- }
- else
- if($natif)
- $natrules .= "rdr on $natif proto {$rule['protocol']} from any to {$extaddr} -> {$target}{$localport}";
- break;
- default:
- $natrules .= "rdr on $natif proto {$rule['protocol']} from any to {$extaddr} -> {$target}";
- break;
- }
- } else {
- switch ($rule['protocol']) {
- case "tcp/udp":
- if($natif)
- $natrules .= "{$nordr}rdr on $natif proto { tcp udp } from any to {$extaddr} port {$extport[0]}:{$extport[1]} -> {$target}{$localport}:*";
- break;
- case "udp":
- case "tcp":
- if($natif)
- $natrules .= "{$nordr}rdr on $natif proto {$rule['protocol']} from any to {$extaddr} port {$extport[0]}:{$extport[1]} -> {$target}{$localport}:*";
- break;
- default:
- if($natif)
- $natrules .= "{$nordr}rdr on $natif proto {$rule['protocol']} from any to {$extaddr} -> {$target}";
- }
- }
- }
-
- /* does this rule redirect back to a internal host?
- * if so, add some extra goo to help this work.
- */
- $rule_friendly_if = convert_friendly_interface_to_real_interface_name($rule['interface']);
- $rule_interface_ip = find_interface_ip($rule_friendly_if);
- $rule_interface_subnet = $config['interfaces'][$rule['interface']]['subnet'];
- $rule_subnet = gen_subnet($rule_interface_ip, $rule_interface_subnet);
- if($rule['external-address'] == "any" and $rule['interface'] == "lan") {
- $natrules .= "\n";
- if($rule_friendly_if)
- $natrules .= "no nat on {$rule_friendly_if} proto tcp from {$rule_friendly_if} to {$rule_subnet}/{$rule_interface_subnet}\n";
- if($rule_friendly_if)
- $natrules .= "nat on {$rule_friendly_if} proto tcp from {$rule_subnet}/{$rule_interface_subnet} to {$target} port {$extport[0]} -> {$rule_friendly_if}\n";
- }
-
- if(!isset($config['system']['disablenatreflection'])) {
-
- update_filter_reload_status("Setting up reflection");
-
- $natrules .= "\n# Reflection redirects\n";
- foreach ($iflist as $ifent => $ifname) {
-
- /* do not process interfaces with gateways*/
- if($config['interfaces'][$ifname]['gateway'] <> "")
- continue;
-
- /* do not process interfaces that will end up with gateways */
- if($config['interfaces'][$ifname]['ipaddr'] == "dhcp" or
- $config['interfaces'][$ifname]['ipaddr'] == "bigpond" or
- $config['interfaces'][$ifname]['ipaddr'] == "pppoe" or
- $config['interfaces'][$ifname]['ipaddr'] == "pptp")
- continue;
-
- $ifname_real = convert_friendly_interface_to_real_interface_name($ifname);
-
- if($extport[1])
- $range_end = ($extport[1]);
- else
- $range_end = ($extport[0]);
-
- $range_end++;
-
- if($rule['local-port'])
- $lrange_start = $rule['local-port'];
-
- if($range_end - $extport[0] > 500) {
- $range_end = $extport[0]+1;
- log_error("Not installing nat reflection rules for a port range > 500");
- } else {
- /* only install reflection rules for < 19991 items */
- if($starting_localhost_port < 19991) {
- $loc_pt = $lrange_start;
- for($x=$extport[0]; $x<$range_end; $x++) {
-
- $xxx = $x;
-
- /* do not install reflection rules for FTP. This simply
- * opens up pandoras box.
- */
- if($xxx == "21")
- continue;
-
- update_filter_reload_status("Creating reflection rule for {$rule['descr']}...");
-
- $ifname_real = convert_friendly_interface_to_friendly_descr(strtolower($ifname));
-
- if($config['system']['reflectiontimeout'])
- $reflectiontimeout = $config['system']['reflectiontimeout'];
- else
- $reflectiontimeout = "2000";
-
- switch($rule['protocol']) {
-
- case "tcp/udp":
- $protocol = "{ tcp udp }";
- $toadd_array = array();
- if(is_alias($loc_pt)) {
- $loc_pt_translated = alias_expand_value($loc_pt);
- if(stristr($loc_pt_translated, " ")) {
- /* XXX: we should deal with multiple ports */
- $loc_pt_translated_split = split(" ", $loc_pt_translated);
- foreach($loc_pt_translated_split as $lpts)
- $toadd_array[] = $lpts;
- } else {
- $toadd_array[] = $loc_pt_translated;
- }
- } else {
- $loc_pt_translated = $loc_pt;
- $toadd_array[] = $loc_pt_translated;
- }
- foreach($toadd_array as $tda){
- fwrite($inetd_fd, "{$starting_localhost_port}\tstream\ttcp/udp\tnowait/0\tnobody\t/usr/bin/nc nc -u -w {$reflectiontimeout} {$target} {$tda}\n");
- if($ifname_real)
- $natrules .= "rdr on \${$ifname_real} proto tcp from any to {$extaddr} port { {$xxx} } -> 127.0.0.1 port {$starting_localhost_port}\n";
- $starting_localhost_port++;
- fwrite($inetd_fd, "{$starting_localhost_port}\tstream\ttcp/udp\tnowait/0\tnobody\t/usr/bin/nc nc -w {$reflectiontimeout} {$target} {$tda}\n");
- if($ifname_real)
- $natrules .= "rdr on \${$ifname_real} proto udp from any to {$extaddr} port { {$xxx} } -> 127.0.0.1 port {$starting_localhost_port}\n";
- $xxx++;
- $starting_localhost_port++;
- }
- break;
- case "tcp":
- case "udp":
- $protocol = $rule['protocol'];
- $toadd_array = array();
- if(is_alias($loc_pt)) {
- $loc_pt_translated = alias_expand_value($loc_pt);
- if(stristr($loc_pt_translated, " ")) {
- /* XXX: we should deal with multiple ports */
- $loc_pt_translated_split = split(" ", $loc_pt_translated);
- foreach($loc_pt_translated_split as $lpts)
- $toadd_array[] = $lpts;
- } else {
- $toadd_array[] = $loc_pt_translated;
- }
- } else {
- $loc_pt_translated = $loc_pt;
- $toadd_array[] = $loc_pt_translated;
- }
- foreach($toadd_array as $tda){
- if($protocol == "udp")
- $dash_u = "-u ";
- else
- $dash_u = "";
- if($config['system']['reflectiontimeout'])
- $reflectiontimeout = $config['system']['reflectiontimeout'];
- else
- $reflectiontimeout = "20";
- fwrite($inetd_fd, "{$starting_localhost_port}\tstream\t{$protocol}\tnowait/0\tnobody\t/usr/bin/nc nc {$dash_u}-w {$reflectiontimeout} {$target} {$tda}\n");
- if($ifname_real)
- $natrules .= "rdr on \${$ifname_real} proto {$protocol} from any to {$extaddr} port { {$xxx} } -> 127.0.0.1 port {$starting_localhost_port}\n";
- $xxx++;
- $starting_localhost_port++;
- }
- break;
- default:
- break;
- }
- $loc_pt++;
- if($starting_localhost_port > 19990) {
- log_error("Not installing nat reflection rules. Maximum 1,000 reached.");
- $x = $range_end+1;
- }
- }
- }
- }
-
- }
-
- }
-
- $natrules .= "\n";
- }
-
- if(!isset($config['system']['disablenatreflection'])) {
- fclose($inetd_fd);
- $helpers = trim(exec("/bin/ps ax | /usr/bin/grep inetd | /usr/bin/grep -v grep | /usr/bin/grep 127"));
- if(!$helpers)
- mwexec("/usr/sbin/inetd -wW -R 0 -a 127.0.0.1 /var/etc/inetd.conf");
- else
- mwexec("/usr/bin/killall -HUP inetd");
-
- }
- }
-
- if ($pptpdcfg['mode'] && $pptpdcfg['mode'] != "off") {
-
- if ($pptpdcfg['mode'] == "server")
- $pptpdtarget = "127.0.0.1";
- else if ($pptpdcfg['mode'] == "redir")
- $pptpdtarget = $pptpdcfg['redir'];
-
- if ($pptpdcfg['mode'] == "redir") {
-
- $natrules .= <<<EOD
-
-# PPTP
-rdr on \$wan proto gre from any to any -> $pptpdtarget
-rdr on \$wan proto tcp from any to any port 1723 -> $pptpdtarget
-
-EOD;
- }
- }
-
- if (is_package_installed('squid') && file_exists('/usr/local/pkg/squid.inc')) {
- require_once('squid.inc');
- $natrules .= squid_generate_rules('nat');
- }
-
- if (is_package_installed('clamav') && file_exists('/usr/local/pkg/clamav.inc')) {
- require_once('clamav.inc');
- $natrules .= clamav_generate_rules('nat');
- }
-
- if (is_package_installed('frickin') && file_exists('/usr/local/pkg/frickin.inc')) {
- require_once ('frickin.inc');
- $natrules .= frickin_generate_rules('nat');
- }
-
- if (is_package_installed('siproxd') && file_exists('/usr/local/pkg/sipproxd.inc')) {
- require_once('sipproxd.inc');
- $natrules .= siproxd_generate_rules('nat');
- }
-
- $natrules .= process_carp_nat_rules();
-
- $natrules .= "# IMSpector rdr anchor\n";
- $natrules .= "rdr-anchor \"imspector\"\n";
-
- $natrules .= "# UPnPd rdr anchor\n";
- $natrules .= "rdr-anchor \"miniupnpd\"\n";
-
- return $natrules;
-}
-
-function run_command_return_string($cmd) {
- global $config;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "generate_user_filter_rule() being called $mt\n";
- }
-
- $fd = popen($cmd, "r");
- while(!feof($fd)) {
- $tmp .= fread($fd,49);
- }
- fclose($fd);
- return $tmp;
-}
-
-function generate_user_filter_rule_arr($rule, $ngcounter) {
- global $config;
- update_filter_reload_status("Creating filter rules {$rule['descr']} ...");
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "generate_user_filter_rule() being called $mt\n";
- }
- $ret = array();
- $line = generate_user_filter_rule($rule, $ngcounter);
- $ret['rule'] = $line;
- $ret['interface'] = $rule['interface'];
- if ($line[0] != '#') {
- if($rule['descr'] != "" and $line != "")
- $ret['descr'] = "label \"USER_RULE: " . str_replace('"', '', $rule['descr']) . "\"";
- else
- $ret['descr'] = "label \"USER_RULE\"";
- }
- $ret['ackq'] = get_ack_queue($rule['interface']);
-
- return $ret;
-}
-
-function generate_user_filter_rule($rule, $ngcounter) {
- global $config, $g;
- global $table_cache;
- global $schedule_enabled;
-
- if($config['schedules']) {
- foreach($config['schedules']['schedule'] as $sched) {
- $schedule_enabled = true;
- break;
- }
- }
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "generate_user_filter_rule() being called $mt\n";
- }
-
- /* Setup cache array if not already existing */
- if (!isset($table_cache)) {
- if ($g['debug'])
- echo "Creating table cache\n";
- $table_cache = array();
- }
-
- update_filter_reload_status("Creating filter rules {$rule['descr']} ...");
-
- $wancfg = $config['interfaces']['wan'];
- $lancfg = $config['interfaces']['lan'];
- $pptpdcfg = $config['pptpd'];
- $pppoecfg = $config['pppoe'];
-
- $lanif = $lancfg['if'];
- $wanif = get_real_wan_interface();
-
- $lanip = $lancfg['ipaddr'];
- $lansa = gen_subnet($lancfg['ipaddr'], $lancfg['subnet']);
- $lansn = $lancfg['subnet'];
-
- $int = "";
-
- $optcfg = array();
- generate_optcfg_array($optcfg);
-
- $curwanip = get_current_wan_address();
-
- /* don't include disabled rules */
- if (isset($rule['disabled'])) {
- return "# rule " . $rule['descr'] . " disabled ";
- }
-
- $pptpdcfg = $config['pptpd'];
- $pppoecfg = $config['pppoe'];
-
- if ($pptpdcfg['mode'] == "server") {
- $pptpip = $pptpdcfg['localip'];
- $pptpsa = $pptpdcfg['remoteip'];
- $pptpsn = $g['pptp_subnet'];
- if($config['pptp']['pptp_subnet'] <> "")
- $pptpsn = $config['pptp']['pptp_subnet'];
- }
-
- if ($pppoecfg['mode'] == "server") {
- $pppoeip = $pppoecfg['localip'];
- $pppoesa = $pppoecfg['remoteip'];
- $pppoesn = $g['pppoe_subnet'];
- if($config['pppoe']['pppoe_subnet'] <> "")
- $pppoesn = $config['pppoe']['pppoe_subnet'];
- }
-
- /* does the rule deal with a PPTP interface? */
- if ($rule['interface'] == "pptp") {
- if ($pptpdcfg['mode'] != "server")
- return "";
- $nif = $g['n_pptp_units'];
- if($config['pptp']['n_pptp_units'] <> "")
- $nif = $config['pptp']['n_pptp_units'];
- $ispptp = true;
- } else if($rule['interface'] == "pppoe") {
- if ($pppoecfg['mode'] != "server") {
- return " # Error creating pppoe rule";
- }
- $nif = $g['n_pppoe_units'];
- if($config['pppoe']['n_pppoe_units'] <> "")
- $nif = $config['pppoe']['n_pppoe_units'];
- $ispppoe = true;
- } else if(!isset($rule['interface'])) {
- return '# Interface empty for rule: '.$rule['descr'];
- } else {
-
- /* Check to see if the interface is opt and in our opt list */
- if (strstr($rule['interface'], "opt")) {
- if (!array_key_exists($rule['interface'], $optcfg)) {
- $item = "";
- foreach($optcfg as $oc) $item .= $oc['if'];
- return "# {$real_int} {$item} {$rule['interface']} array key does not exist for " . $rule['descr'];
- }
- }
-
- $nif = 1;
- $ispptp = false;
- $ispppoe = false;
- }
-
- if ($pptpdcfg['mode'] != "server") {
- if (($rule['source']['network'] == "pptp") ||
- ($rule['destination']['network'] == "pptp")) {
- return "# source network or destination network == pptp on " . $rule['descr'];
- }
- }
-
- if ($rule['source']['network'] && strstr($rule['source']['network'], "opt")) {
- if (!array_key_exists($rule['source']['network'], $optcfg)) {
- $optmatch = "";
- if(preg_match("/opt([0-999])/", $rule['source']['network'], $optmatch)) {
- $real_opt_int = convert_friendly_interface_to_real_interface_name("opt" . $optmatch[1]);
- $opt_ip = find_interface_ip($real_opt_int);
- if(!$opt_ip)
- return "# unresolvable optarray $real_opt_int - $optmatch[0] - $opt_ip";
- } else {
- return "# {$rule['source']['network']} !array_key_exists source network " . $rule['descr'];
- }
- }
- }
- if ($rule['destination']['network'] && strstr($rule['destination']['network'], "opt")) {
- if (!array_key_exists($rule['destination']['network'], $optcfg)) {
- if(preg_match("/opt([0-999])/", $rule['destination']['network'], $optmatch)) {
- $real_opt_int = convert_friendly_interface_to_real_interface_name("opt" . $optmatch[1]);
- $opt_ip = find_interface_ip($real_opt_int);
- if(!$opt_ip)
- return "# unresolvable oparray $real_opt_int - $optmatch[0] - $opt_ip";
- } else {
- return "# {$item} {$rule['destination']['network']} !array_key_exists dest network " . $rule['descr'];
- }
- }
- }
-
- /* check for unresolvable aliases */
- if ($rule['source']['address'] && !alias_expand($rule['source']['address'])) {
- file_notice("Filter_Reload", "# unresolvable source aliases {$rule['descr']}");
- return "# unresolvable source aliases {$rule['descr']}";
- }
- if ($rule['destination']['address'] && !alias_expand($rule['destination']['address'])) {
- file_notice("Filter_Reload", "# unresolvable dest aliases {$rule['descr']}");
- return "# unresolvable dest aliases {$rule['descr']}";
- }
-
- $ifdescrs = array();
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
- $ifdescrs[] = "opt" . $i;
-
- update_filter_reload_status("Setting up pass/block rules");
-
- for ($iif = 0; $iif < $nif; $iif++) {
-
- $type = $rule['type'];
-
-
- if ($type != "pass" && $type != "block" && $type != "reject") {
- /* default (for older rules) is pass */
- $type = "pass";
- }
-
- if ($type == "reject") {
- /* special reject packet */
- if ($rule['protocol'] == "tcp") {
- $aline['type'] = "block return-rst";
- } else if ($rule['protocol'] == "udp") {
- $aline['type'] = "block return-icmp";
- } else if ($rule['protocol'] == "tcp/udp") {
- $aline['type'] = "block return";
- } else {
- $aline['type'] = "block";
- }
- } else {
- $aline['type'] = $type;
- }
-
- /* ensure the direction is in */
- $aline['direction'] = " in ";
-
- if (isset($rule['log']))
- $aline['log'] = "log ";
-
- $aline['quick'] = "quick ";
-
- if ($ispptp) {
- $aline['interface'] = "on \$pptp ";
- } else if ($ispppoe) {
- $aline['interface'] = "on \$pppoe ";
- } else {
- // translate wan, man, lan, opt to real interface.
- $interface = $rule['interface'];
- $temp = filter_get_opt_interface_descr($interface);
- if($temp <> "") $interface = $temp;
- if(isset($rule['destination']['address'])) {
- $canadd = 0; // XXX: billm - eh? this is a nice little noop
- /* because pf will not allow a interface for proxyARP
- type traffic lets check if its in use and if so leave
- off the interface */
- if(is_one_to_one_or_server_nat_rule($rule['destination']['address']))
- $canadd = 0;
- }
- if($canadd == 0)
- $aline['interface'] = "on \$" . convert_real_interface_to_friendly_descr($rule['interface']) . " ";
- }
-
-
- /* set the gateway interface */
- $ri = filter_translate_type_to_real_interface($rule['interface']);
-
- update_filter_reload_status("Setting up pass/block rules {$rule['descr']}");
-
- /*
- * check to see if /tmp/{${ri}_router exists. This file
- * is created by dhclient for 2nd wan interfaces, etc.
- * else get gateway from the interface config
- */
- if(file_exists("{$g['tmp_path']}/{$ri}_router")) {
- $rg = file_get_contents("{$g['tmp_path']}/{$ri}_router");
- $rg = rtrim($rg);
- } elseif ($config['interfaces'][$rule['interface']]['gateway'] <> "") {
- $rg = $config['interfaces'][$rule['interface']]['gateway'];
- }
-
- /* do not process reply-to for gateway'd rules */
- if(($rule['gateway'] == "") and ($ri != "") and ($rg != "") and (stristr($rule['interface'],"opt") == true)) {
- $aline['reply'] = "reply-to (" . $ri . " " . $rg . ") ";
- }
-
- /* if user has selected a custom gateway, lets work with it */
- if($rule['gateway'] <> "") {
- $foundlb = 0;
- $routeto = " route-to { ";
- if(is_array($config['load_balancer']['lbpool'])) {
- foreach($config['load_balancer']['lbpool'] as $lb) {
- update_filter_reload_status("Creating load balancing item...");
- if($lb['name'] == $rule['gateway']) {
- $gateway = $rule['gateway'];
- /*
- * is $gateway a interface name?
- * if so, lets find out the gateway address
- * from /tmp/router_bleh.router
- */
- if(in_array($gateway, $ifdescrs)==true) {
- if(is_file("{$g['tmp_path']}/{$gateway}_router")) {
- $return_gateway = file_get_contents("{$g['tmp_path']}/{$gateway}_router");
- } else {
- log_error("Could not find {$g['tmp_path']}/{$gateway}_router. Needed for dhcp gateway information");
- continue;
- }
- }
- /* if /tmp/$lbname.pool exists then read in our gateway hints from slbd */
- if(file_exists("{$g['tmp_path']}/{$lb['name']}.pool")) {
- $lbs_tmp = split("\n", file_get_contents("{$g['tmp_path']}/{$lb['name']}.pool"));
- $lbs = array();
- /* process the entire file to prevent empty lines */
- foreach($lbs_tmp as $lb_tmp) {
- if(is_ipaddr($lb_tmp)) {
- $lbs[] = $lb_tmp;
- }
- }
- $lbs_count = count($lbs);
- if($g['debug'])
- log_error("We found $lbs_count valid entries in status file {$g['tmp_path']}/{$lb['name']}.pool");
-
- if(count($lbs) == 0) {
- if($g['debug'])
- log_error("There are no servers found in the status file, using XML config settings!");
- foreach ($lb['servers'] as $lbsvr) {
- $lbsvr_split = split("\|", $lbsvr);
- $lbs[] = $lbsvr_split[1];
- }
- }
- } else {
- if($g['debug'])
- log_error("There is no server status file, using XML config settings!");
- $lbs = array();
- foreach ($lb['servers'] as $lbsvr) {
- $lbsvr_split = split("\|", $lbsvr);
- $lbs[] = $lbsvr_split[1];
- }
- }
- /* If we want failover we only return the first (top) server from the list
- * and work our way down from there. This way we order the failover order.
- */
- if($lb['behaviour'] == "failover") {
- $firstsrv = $lbs[0];
- $lbs = array("$firstsrv");
- }
-
- /* create server/gateway gateway/monitor array */
- $l = 0;
- $lbconfig = array();
- foreach ($lb['servers'] as $lbsvr) {
- $lbsvr_split=split("\|", $lbsvr);
- $lbconfig['gateway'][$l] = $lbsvr_split[0];
- $lbconfig['monitor'][$l] = $lbsvr_split[1];
- $l++;
- }
- $lbconfig_count = count($lbconfig['gateway']);
-
- $l = 0;
- while($l < $lbconfig_count) {
- /* iterate through $lbs and setup items accordingly */
- foreach($lbs as $server) {
- if ($server == "")
- continue;
- unset($gateway, $int);
- if ($lbconfig['monitor'][$l] == $server) {
- /* determine interface gateway */
- if(is_ipaddr($lbconfig['gateway'][$l])) {
- $int = guess_interface_from_ip($lbconfig['gateway'][$l]);
- $gateway = $lbconfig['gateway'][$l];
- log_error("SLBD pool {$lb['name']} is old style. Please recreate.");
- } else if(interface_has_gateway($lbconfig['gateway'][$l])) {
- $int = convert_friendly_interface_to_real_interface_name($lbconfig['gateway'][$l]);
- $gateway = get_interface_gateway($lbconfig['gateway'][$l]);
- }
- if(($int <> "") && ($gateway <> "")) {
- if($g['debug'])
- log_error("Setting up route with {$lbconfig['gateway'][$l]} om $int for monitor {$lbconfig['monitor'][$l]} on gateway $gateway");
- if($foundlb == 1)
- $routeto .= ", ";
- $routeto .= "( {$int} {$gateway} ) ";
- $foundlb = 1;
- }
- /* we have a match, go forth and try the next LB item so we don't setup multiples incorrectly */
- $l++;
- continue;
- }
- }
- $l++;
- }
- /* If we want failover just use route-to else round-robin */
- if($lb['behaviour'] == "failover") {
- $routeto .= "} ";
- } else {
- $routeto .= "} round-robin ";
- if(isset($config['system']['lb_use_sticky']))
- $routeto .= " sticky-address ";
- }
- }
- }
- /* Add the load balanced gateways */
- if ($foundlb == 1)
- $aline['route'] = $routeto;
- }
- /* we're not using load balancing, just setup gateway */
- if($foundlb == 0) {
- $gateway = $rule['gateway'];
- /*
- * is $gateway a interface name?
- * if so, lets find out the gateway address
- * from /tmp/router_bleh.router
- */
- if(in_array($gateway, $ifdescrs)==true) {
- $int=filter_opt_interface_to_real($gateway);
- if(is_file("{$g['tmp_path']}/{$int}_router")) {
- $gatewayip = file_get_contents("{$g['tmp_path']}/{$int}_router");
- $gatewayip = rtrim($gatewayip);
- if (is_ipaddr($gatewayip)) {
- $aline['route'] = " route-to ( {$int} {$gatewayip} ) ";
- }
- } else {
- log_error("Could not find {$g['tmp_path']}/{$int}_router. Needed for dhcp gateway information");
- continue;
- }
- } else {
- /* user picked a real gateway ip */
- if(is_ipaddr($rule['gateway'])) {
- $gatewayip = $rule['gateway'];
- $int = guess_interface_from_ip($gatewayip);
- $aline['route'] = " route-to ( " . guess_interface_from_ip($rule['gateway']) . " {$rule['gateway']} ) ";
- }
- }
- }
- }
-
- if (isset($rule['protocol'])) {
- if($rule['protocol'] == "tcp/udp")
- $aline['prot'] = "proto { tcp udp } ";
- elseif($rule['protocol'] == "icmp")
- $aline['prot'] = "inet proto icmp ";
- else
- $aline['prot'] = "proto {$rule['protocol']} ";
- } else {
- if($rule['source']['port'] <> "" || $rule['destination']['port'] <> "") {
- $aline['prot'] = "proto tcp ";
- }
- }
-
- update_filter_reload_status("Creating rule {$rule['descr']}");
-
- /* source address */
- if (isset($rule['source']['any'])) {
- $src = "any";
- } else if ($rule['source']['network']) {
-
- if (strstr($rule['source']['network'], "opt")) {
- $src = $optcfg[$rule['source']['network']]['sa'] . "/" .
- $optcfg[$rule['source']['network']]['sn'];
- if (isset($rule['source']['not'])) $src = " !{$src}";
- /* check for opt$NUMip here */
- $matches = "";
- if (preg_match("/opt([0-9999])ip/", $rule['source']['network'], $matches)) {
- $optnum = $matches[1];
- $real_int = convert_friendly_interface_to_real_interface_name("opt{$optnum}");
- $src = find_interface_ip($real_int);
- }
- } else {
- switch ($rule['source']['network']) {
- case 'wanip':
- $src = $curwanip;
- break;
- case 'lanip':
- $src = $lanip;
- break;
- case 'lan':
- $src = "{$lansa}/{$lansn}";
- break;
- case 'pptp':
- $src = "{$pptpsa}/{$pptpsn}";
- break;
- case 'pppoe':
- $src = "{$pppoesa}/{$pppoesn}";
- break;
- }
- if (isset($rule['source']['not'])) $src = "!{$src}";
- }
- } else if ($rule['source']['address']) {
- $expsrc = alias_expand($rule['source']['address']);
-
- if (isset($rule['source']['not']))
- $not = "!";
- else
- $not = "";
-
- if (stristr($expsrc, "$")) {
- if($not) {
- $src = "{";
- foreach(preg_split("/[\s]+/", alias_expand_value($rule['source']['address'])) as $item) {
- if($item != "") {
- $src .= " {$not}{$item}";
- }
- }
- /* added support for tables */
- $src .= " 0/0 }";
- $src_table = "<not" . $rule['source']['address'] . ">";
- }
- else {
- $src = "{ {$not} " . alias_expand_value($rule['source']['address']) . " } ";
- $src_table = "<" . $rule['source']['address'] . ">";
- }
-
- /* support for tables */
- $src_table_line = "table $src_table {$src}\n";
- $src = $src_table;
- }
- else
- $src = "{ {$not} {$expsrc} }";
- }
-
- if (!$src || ($src == "/")) {
- return "# at the break!";
- }
-
- $aline['src'] = "from $src ";
-
- if (in_array($rule['protocol'], array("tcp","udp","tcp/udp"))) {
-
- if ($rule['source']['port']) {
- $srcport = explode("-", $rule['source']['port']);
- if(alias_expand($srcport[0]))
- $srcporta = alias_expand($srcport[0]);
- else
- $srcporta = $srcport[0];
- if ((!$srcport[1]) || ($srcport[0] == $srcport[1])) {
- if(alias_expand($srcport[0]))
- $aline['srcport'] = "port {$srcporta} ";
- else
- $aline['srcport'] = "port = {$srcporta} ";
- } else if (($srcport[0] == 1) && ($srcport[1] == 65535)) {
- /* no need for a port statement here */
- } else if ($srcport[1] == 65535) {
- $aline['srcport'] = "port >= {$srcport[0]} ";
- } else if ($srcport[0] == 1) {
- $aline['srcport']= "port <= {$srcport[1]} ";
- } else {
- $srcport[0]--;
- $srcport[1]++;
- $aline['srcport'] = "port {$srcport[0]} >< {$srcport[1]} ";
- }
- }
- /* OS signatures */
- if (($rule['protocol'] == "tcp") && ($rule['os'] <> ""))
- $aline['os'] = "os {$rule['os']} ";
-
- }
-
- /* destination address */
- if (isset($rule['destination']['any'])) {
- $dst = "any";
- } else if ($rule['destination']['network']) {
-
- if (strstr($rule['destination']['network'], "opt")) {
- $dst = $optcfg[$rule['destination']['network']]['sa'] . "/" .
- $optcfg[$rule['destination']['network']]['sn'];
- /* check for opt$NUMip here */
- $matches = "";
- if (preg_match("/opt([0-9999])ip/", $rule['destination']['network'], $matches)) {
- $optnum = $matches[1];
- $real_int = convert_friendly_interface_to_real_interface_name("opt{$optnum}");
- $dst = find_interface_ip($real_int);
- }
- if (isset($rule['destination']['not'])) $dst = " !{$dst}";
- } else {
- switch ($rule['destination']['network']) {
- case 'wanip':
- $dst = $curwanip;
- break;
- case 'lanip':
- $dst = $lanip;
- break;
- case 'lan':
- $dst = "{$lansa}/{$lansn}";
- break;
- case 'pptp':
- $dst = "{$pptpsa}/{$pptpsn}";
- break;
- case 'pppoe':
- $dst = "{$ppoesa}/{$pppoesn}";
- break;
- }
- if (isset($rule['destination']['not'])) $dst = " !{$dst}";
- }
- } else if ($rule['destination']['address']) {
- $expdst = alias_expand($rule['destination']['address']);
-
- if (isset($rule['destination']['not']))
- $not = "!";
- else
- $not = "";
-
- if (stristr($expdst, "$")) {
- if($not) {
- $dst = "{";
- foreach(preg_split("/[\s]+/", alias_expand_value($rule['destination']['address'])) as $item) {
- if($item != "") {
- $dst .= " {$not}{$item}";
- }
- }
- /* added support for tables */
- $dst .= " 0/0 }";
- $dst_table = "<not" . $rule['destination']['address'] . ">";
- }
- else {
- $dst = "{ {$not} " . alias_expand_value($rule['destination']['address']) . " } ";
- $dst_table = "<" . $rule['destination']['address'] . ">";
- }
-
- /* support for tables */
- $dst_table_line = "table $dst_table {$dst}\n";
- $dst = $dst_table;
- }
- else
- $dst = "{ {$not} {$expdst} }";
- }
-
- if (!$dst || ($dst == "/")) {
- return "# returning at dst $dst == \"/\"";
- }
-
- $aline['dst'] = "to $dst ";
-
- if (in_array($rule['protocol'], array("tcp","udp","tcp/udp"))) {
-
- if ($rule['destination']['port']) {
- $dstport = explode("-", $rule['destination']['port']);
- if(alias_expand($dstport[0]))
- $dstporta = alias_expand($dstport[0]);
- else
- $dstporta = $dstport[0];
- if ((!$dstport[1]) || ($dstport[0] == $dstport[1])) {
- if(alias_expand($dstport[0]))
- $aline['dstport'] = "port {$dstporta} ";
- else
- $aline['dstport'] = "port = {$dstporta} ";
- } else if (($dstport[0] == 1) && ($dstport[1] == 65535)) {
- /* no need for a port statement here */
- } else if ($dstport[1] == 65535) {
- $aline['dstport'] = "port >= {$dstport[0]} ";
- } else if ($dstport[0] == 1) {
- $aline['dstport'] = "port <= {$dstport[1]} ";
- } else {
- $dstport[0]--;
- $dstport[1]++;
- $aline['dstport'] = "port {$dstport[0]} >< {$dstport[1]} ";
- }
- }
- }
-
- if (($rule['protocol'] == "icmp") && $rule['icmptype']) {
- $aline['icmp-type'] = "icmp-type {$rule['icmptype']} ";
- }
-
- if ($type == "pass") {
- if (isset($rule['allowopts']))
- $aline['allowopts'] = " allow-opts ";
- if( isset($rule['source-track']) or isset($rule['max-src-nodes']) or isset($rule['max-src-states']) )
- if($rule['protocol'] == "tcp")
- $aline['flags'] = "flags S/SA ";
- /*
- # keep state
- works with TCP, UDP, and ICMP.
- # modulate state
- works only with TCP. pfSense will generate strong Initial Sequence Numbers (ISNs)
- for packets matching this rule.
- # synproxy state
- proxies incoming TCP connections to help protect servers from spoofed TCP SYN floods.
- This option includes the functionality of keep state and modulate state combined.
- # none
- do not use state mechanisms to keep track. this is only useful if your doing advanced
- queueing in certain situations. please check the faq.
- */
- $noadvoptions = false;
- if(isset($rule['statetype']) && $rule['statetype'] <> "") {
- switch($rule['statetype']) {
- case "none":
- $noadvoptions = true;
- break;
- case "modulate state":
- case "synproxy state":
- if($rule['protocol'] == "tcp")
- $aline['flags'] = "{$rule['statetype']} ";
- break;
- default:
- $aline['flags'] = "{$rule['statetype']} ";
- }
- } else {
- $aline['flags'] = "keep state ";
- }
- if($noadvoptions == false)
- if( isset($rule['source-track']) and $rule['source-track'] <> "" or
- isset($rule['max-src-nodes']) and $rule['max-src-nodes'] <> "" or
- isset($rule['max-src-conn-rate']) and $rule['max-src-conn-rate'] <> "" or
- isset($rule['max-src-conn-rates']) and $rule['max-src-conn-rates'] <> "" or
- isset($rule['max-src-states']) and $rule['max-src-states'] <> "" or
- isset($rule['statetimeout']) and $rule['statetimeout'] <> "") {
- $aline['flags'] .= "( ";
- if(isset($rule['source-track']) and $rule['source-track'] <> "")
- $aline['flags'] .= "source-track rule ";
- if(isset($rule['max-src-nodes']) and $rule['max-src-nodes'] <> "")
- $aline['flags'] .= "max-src-nodes " . $rule['max-src-nodes'] . " ";
- if(isset($rule['max-src-states']) and $rule['max-src-states'] <> "")
- $aline['flags'] .= "max-src-states " . $rule['max-src-states'] . " ";
- if(isset($rule['statetimeout']) and $rule['statetimeout'] <> "")
- $aline['flags'] .= "tcp.established " . $rule['statetimeout'] . " ";
- if(isset($rule['max-src-conn-rate']) and $rule['max-src-conn-rate'] <> ""
- and isset($rule['max-src-conn-rates']) and $rule['max-src-conn-rates'] <> "") {
- $aline['flags'] .= "max-src-conn-rate " . $rule['max-src-conn-rate'] . " ";
- $aline['flags'] .= "/" . $rule['max-src-conn-rates'] . ", overload <virusprot> flush global ";
- }
- $aline['flags'] .= " ) ";
- }
- }
- if ($type == "reject" && $rule['protocol'] == "tcp") {
- /* special reject packet */
- $aline['flags'] .= "flags S/SA ";
- }
- }
-
- /* cache entries */
- if (isset($src_table))
- if (isset($table_cache[$src_table])) {
- if ($g['debug'])
- echo "{$src_table} found in cache\n";
- } else {
- if ($g['debug'])
- echo "{$src_table} NOT found in cache...adding\n";
- $table_cache[$src_table] = $src_table_line;
- }
- if (isset($dst_table))
- if (isset($table_cache[$dst_table])) {
- if ($g['debug'])
- echo "{$dst_table} found in cache\n";
- } else {
- if ($g['debug'])
- echo "{$dst_table} NOT found in cache...adding\n";
- $table_cache[$dst_table] = $dst_table_line;
- }
-
- /* exception(s) to a user rules can go here. */
- /* rules with a gateway or pool should create another rule for routing to local networks or vpns */
- /* we only trigger this for a rule with the destination of any and without a gateway */
- if (($aline['route'] <> "") && ($aline['type'] == "pass") && ($dst == "any") && (! interface_has_gateway($aline['interface']))) {
- /* negate VPN/PPTP/PPPoE networks for load balancer rules */
- $vpns = " to <vpns> ";
- $line .= $aline['type'] . $aline['direction'] . $aline['log'] . $aline['quick'] . $aline['interface'] . $aline['prot'] .
- $aline['src'] . $aline['srcport'] . $aline['os'] . $vpns . $aline['dstport'].
- $aline['icmp-type'] . $aline['allowopts'] . $aline['flags'] .
- " label \"NEGATE_ROUTE: Negate policy route for local network(s)\"\n";
- }
-
- /* piece together the actual user rule */
- $line .= $aline['type'] . $aline['direction'] . $aline['log'] . $aline['quick'] . $aline['interface'] . $aline['reply'] .
- $aline['route'] . $aline['prot'] . $aline['src'] . $aline['srcport'] . $aline['os'] . $aline['dst'] .
- $aline['dstport'] . $aline['icmp-type'] . $aline['allowopts'] . $aline['flags'];
-
- /* is a time based rule schedule attached? */
- if($rule['sched']) {
- if($config['schedules']) {
- foreach($config['schedules']['schedule'] as $sched) {
- if($sched['name'] == $rule['sched'])
- $schedule_xml_block = $sched;
- $schedule_enabled = true;
- }
- }
- if($schedule_xml_block)
- $status = get_time_based_rule_status($schedule_xml_block);
- if($status) {
- if($g['debug'])
- log_error("[TDR DEBUG] status true -- rule type '$type'");
- if($type == "block") {
- // active deny rules should deny
- $ipfw_rule = tdr_create_ipfw_rule($rule, "deny");
- tdr_install_rule($ipfw_rule);
- } else {
- // active allow rules should allow
- $ipfw_rule = tdr_create_ipfw_rule($rule, "allow");
- tdr_install_rule($ipfw_rule);
- }
- return "$line";
- } else {
- /* rule is turned off, if type == pass, deny traffic until
- * active else allow traffic until active
- */
- if($type == "pass") {
- // inactive pass rules should deny
- $ipfw_rule = tdr_create_ipfw_rule($rule, "deny");
- tdr_install_rule($ipfw_rule);
- } else {
- // inactive block rules should skipto
- $ipfw_rule = tdr_create_ipfw_rule($rule, "skipto");
- tdr_install_rule($ipfw_rule);
- }
- return "# $line";
- }
- } else {
- if($schedule_enabled) {
- // no schedule allow rules should simply allow
- $ipfw_rule = tdr_create_ipfw_rule($rule, "allow");
- tdr_install_rule($ipfw_rule);
- }
- return $line;
- }
-}
-
-function filter_rules_generate() {
- global $config, $g, $table_cache;
-
- update_filter_reload_status("Creating default rules");
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_rules_generate() being called $mt\n";
- }
-
- $wancfg = $config['interfaces']['wan'];
- $lancfg = $config['interfaces']['lan'];
- $pptpdcfg = $config['pptpd'];
- $pppoecfg = $config['pppoe'];
-
- $lanif = $lancfg['if'];
- $wanif = get_real_wan_interface();
-
- $lanip = $lancfg['ipaddr'];
- $lansa = gen_subnet($lancfg['ipaddr'], $lancfg['subnet']);
- $lansn = $lancfg['subnet'];
-
- $wanip = find_interface_ip(get_real_wan_interface());
-
- if($lansa)
- $lansa_sn_combo = "{$lansa}/{$lansn}";
- else
- $lansa_sn_combo = "192.168.1.1/32";
-
- /* optional interfaces */
- $optcfg = array();
- generate_optcfg_array($optcfg);
-
- if (is_package_installed('squid') && file_exists('/usr/local/pkg/squid.inc')) {
- require_once('squid.inc');
- $ipfrules .= squid_generate_rules('filter');
- }
-
- if (is_package_installed('clamav') && file_exists('/usr/local/pkg/clamav.inc')) {
- require_once('clamav.inc');
- $ipfrules .= clamav_generate_rules('filter');
- }
-
- if (is_package_installed('clamav') && file_exists('/usr/local/pkg/clamav.inc')) {
- require_once('clamav.inc');
- $ipfrules .= clamav_generate_rules('filter');
- }
-
- if (is_package_installed('frickin') && file_exists('/usr/local/pkg/frickin.inc')) {
- require_once ('frickin.inc');
- $ipfrules .= frickin_generate_rules('filter');
- }
-
- if (is_package_installed('siproxd') && file_exists('/usr/local/pkg/sipproxd.inc')) {
- require_once('sipproxd.inc');
- $ipfrules .= siproxd_generate_rules('filter');
- }
-
- /* if captive portal is enabled, ensure that access to this port
- * is allowed on a locked down interface
- */
- if (isset($config['captiveportal']['enable'])) {
- $cp_interface = $config['captiveportal']['interface'];
- $cp_interface_real = convert_friendly_interface_to_real_interface_name($cp_interface);
- $cp_interface_ip = find_interface_ip($cp_interface_real);
- if($cp_interface_ip and $cp_interface_real)
- $ipfrules .= "pass in quick on {$cp_interface_real} proto tcp from any to {$cp_interface_ip} port { 8000 8001 } keep state\n";
- }
-
- /* ftp-sesame */
- $ipfrules .= "anchor \"ftpsesame/*\" \n";
-
- # BEGIN OF firewall rules
- $ipfrules .= "anchor \"firewallrules\"\n";
-
- if ($pptpdcfg['mode'] == "server") {
- $pptpip = $pptpdcfg['localip'];
- $pptpsa = $pptpdcfg['remoteip'];
- $pptpsn = $g['pptp_subnet'];
- if($config['pptp']['pptp_subnet'] <> "")
- $pptpsn = $config['pptp']['pptp_subnet'];
- }
-
- if ($pppoecfg['mode'] == "server") {
- $pppoeip = $pppoecfg['localip'];
- $pppoesa = $pppoecfg['remoteip'];
- $pppoesn = $g['pppoe_subnet'];
- if($config['pppoe']['pppoe_subnet'] <> "")
- $pppoesn = $config['pppoe']['pppoe_subnet'];
- }
-
- /* default block logging? */
- if (!isset($config['syslog']['nologdefaultblock']))
- $log = "log";
- else
- $log = "";
-
- $ipfrules .= <<<EOD
-
-# We use the mighty pf, we cannot be fooled.
-block quick proto { tcp, udp } from any port = 0 to any
-block quick proto { tcp, udp } from any to any port = 0
-
-# snort2c
-table <snort2c> persist
-block quick from <snort2c> to any label "Block snort2c hosts"
-block quick from any to <snort2c> label "Block snort2c hosts"
-
-# loopback
-anchor "loopback"
-pass in quick on \$loopback all label "pass loopback"
-pass out quick on \$loopback all label "pass loopback"
-
-# package manager early specific hook
-anchor "packageearly"
-
-
-# carp
-anchor "carp"
-
-EOD;
-
-if($wanip)
- $ipfrules .= <<<EOD
-
-# permit wan interface to ping out (ping_hosts.sh)
-pass quick proto icmp from {$wanip} to any keep state
-
-EOD;
-
- $ipfrules .= <<<EOD
-
-# NAT Reflection rules
-
-EOD;
-
- if (isset($config['nat']['rule'])) {
- $natrules .= "# NAT Inbound Redirects\n";
-
- if(!isset($config['system']['disablenatreflection'])) {
- //$fd = fopen("/var/etc/inetd.conf","w");
- /* start redirects on port 19000 of localhost */
- $starting_localhost_port = 18999;
- }
-
- foreach ($config['nat']['rule'] as $rule) {
-
- update_filter_reload_status("Creating NAT rule {$rule['descr']}");
-
- /* if item is an alias, expand */
- if(alias_expand($rule['external-port']))
- $extport[0] = alias_expand_value($rule['external-port']);
- else
- $extport = explode("-", $rule['external-port']);
-
- /* if item is an alias, expand */
- if(alias_expand($rule['local-port']))
- $localport = "";
- else
- $localport = " port {$rule['local-port']}";
-
- $target = alias_expand_host($rule['target']);
-
- if (!$target)
- continue; /* unresolvable alias */
-
- if ($rule['external-address'])
- if($rule['external-address'] <> "any")
- $extaddr = $rule['external-address'] . "/32";
- else
- $extaddr = $rule['external-address'];
- else
- $extaddr = get_current_wan_address($rule['interface']);
-
- if (!$rule['interface'] || ($rule['interface'] == "wan"))
- $natif = $wanif;
- else if($rule['interface'] == "\$pptp")
- $natif = "pptp";
- else if($rule['interface'] == "\$pppoe")
- $natif = "pppoe";
- else
- $natif = $config['interfaces'][$rule['interface']]['if'];
-
- $lanif = $lancfg['if'];
-
- /*
- * Expand aliases
- * XXX: may want to integrate this into pf macros
- */
- if(alias_expand($target))
- $target = alias_expand($target);
- if(alias_expand($extaddr))
- $extaddr = alias_expand($extaddr);
-
- if(!isset($config['system']['disablenatreflection'])) {
-
- /* if list */
- $iflist = array("lan" => "LAN");
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
- $iflist['opt' . $i] = "opt{$i}";
-
- foreach ($iflist as $ifent => $ifname) {
-
- /* do not process interfaces with gateways*/
- if($config['interfaces'][$ifname]['gateway'] <> "")
- continue;
-
- /* do not process interfaces that will end up with gateways */
- if($config['interfaces'][$ifname]['ipaddr'] == "dhcp" or
- $config['interfaces'][$ifname]['ipaddr'] == "bigpond" or
- $config['interfaces'][$ifname]['ipaddr'] == "pppoe" or
- $config['interfaces'][$ifname]['ipaddr'] == "pptp")
-
- continue;
-
- $ifname_real = convert_friendly_interface_to_real_interface_name($ifname);
-
- if($extport[1])
- $range_end = ($extport[1]);
- else
- $range_end = ($extport[0]);
-
- $range_end++;
-
- if($rule['local-port'])
- $lrange_start = $rule['local-port'];
-
- if($range_end - $extport[0] > 500) {
- $range_end = $extport[0]+1;
- log_error("Not installing nat reflection rules for a port range > 500");
- } else {
- /* only install reflection rules for < 19991 items */
- if($starting_localhost_port < 19991) {
- $loc_pt = $lrange_start;
- for($x=$extport[0]; $x<$range_end; $x++) {
-
- $starting_localhost_port++;
- $ifname_real = convert_friendly_interface_to_friendly_descr(strtolower($ifname));
-
- switch($rule['protocol']) {
- case "tcp/udp":
- $protocol = "{ tcp udp }";
- $ipfrules .= "pass in quick on \${$ifname_real} inet proto tcp from any to \$loopback port {$starting_localhost_port} keep state label \"NAT REFLECT: Allow traffic to localhost\"\n";
- $starting_localhost_port++;
- $ipfrules .= "pass in quick on \${$ifname_real} inet proto udp from any to \$loopback port {$starting_localhost_port} keep state label \"NAT REFLECT: Allow traffic to localhost\"\n";
- break;
- case "tcp":
- case "udp":
- $protocol = $rule['protocol'];
- $ipfrules .= "pass in quick on \${$ifname_real} inet proto {$rule['protocol']} from any to \$loopback port {$starting_localhost_port} keep state label \"NAT REFLECT: Allow traffic to localhost\"\n";
- break;
- default:
- break;
- }
- $loc_pt++;
- if($starting_localhost_port > 19990) {
- log_error("Not installing nat reflection rules. Maximum 1,000 reached.");
- $x = $range_end+1;
- }
- }
- }
- }
- }
-
- }
- }
- }
-
- $ipfrules .= <<<EOD
-
-# allow access to DHCP server on LAN
-anchor "dhcpserverlan"
-pass in quick on \$lan proto udp from any port = 68 to 255.255.255.255 port = 67 label "allow access to DHCP server on LAN"
-pass in quick on \$lan proto udp from any port = 68 to $lanip port = 67 label "allow access to DHCP server on LAN"
-pass out quick on \$lan proto udp from $lanip port = 67 to any port = 68 label "allow access to DHCP server on LAN"
-
-EOD;
-
- /* allow access to DHCP server on optional interfaces */
- foreach ($optcfg as $on => $oc) {
- if ($config[interfaces][$on][ipaddr] == "dhcp" ) {
- $friendly_on = filter_get_opt_interface_descr($on);
- $ipfrules .= <<<EOD
-
-# Not installing DHCP server firewall rules for $friendly_on which is configured for DHCP.
-
-EOD;
- } elseif (isset($config['dhcpd'][$on]['enable']) && (!$oc['bridge']) ||
- ($oc['bridge'] && isset($config['dhcpd'][$oc['bridge']]['enable']))) {
-
- $friendly_on = filter_get_opt_interface_descr($on);
-
- $ipfrules .= <<<EOD
-
-# allow access to DHCP server on {$on}
-anchor "dhcpserver{$friendly_on}"
-pass in quick on \${$friendly_on} proto udp from any port = 68 to 255.255.255.255 port = 67 label "allow access to DHCP server"
-pass in quick on \${$friendly_on} proto udp from any port = 68 to {$oc['ip']} port = 67 label "allow access to DHCP server"
-pass out quick on \${$friendly_on} proto udp from {$oc['ip']} port = 67 to any port = 68 label "allow access to DHCP server"
-
-EOD;
- }
- }
-
- /* pass traffic between statically routed subnets and the subnet on the
- interface in question to avoid problems with complicated routing
- topologies */
- $sa = "";
- if (isset($config['filter']['bypassstaticroutes']) && is_array($config['staticroutes']['route']) && count($config['staticroutes']['route'])) {
- foreach ($config['staticroutes']['route'] as $route) {
- unset($sa);
- $friendly_int = convert_friendly_interface_to_friendly_descr($route['interface']);
- if ($route['interface'] == "lan") {
- $sa = $lansa;
- $sn = $lansn;
- $if = $lanif;
- $friendly_int = "lan";
- } else if (strstr($route['interface'], "opt")) {
- $oc = $optcfg[$route['interface']];
- if ($oc['ip']) {
- $sa = $oc['sa'];
- $sn = $oc['sn'];
- $if = $oc['if'];
- }
- }
-
- if ($sa) {
- $ipfrules .= <<<EOD
-anchor "staticrouted"
-pass in quick on \${$friendly_int} from {$sa}/{$sn} to {$route['network']} label "pass traffic between statically routed subnets"
-pass in quick on \${$friendly_int} from {$route['network']} to {$sa}/{$sn} label "pass traffic between statically routed subnets"
-pass out quick on \${$friendly_int} from {$sa}/{$sn} to {$route['network']} label "pass traffic between statically routed subnets"
-pass out quick on \${$friendly_int} from {$route['network']} to {$sa}/{$sn} label "pass traffic between statically routed subnets"
-
-EOD;
- }
- }
- }
-
- /* install wan spoof check rule if lan address exists */
- if($lansa) {
- if(!isset($config['interfaces']['wan']['spoofmac'])) {
- $ipfrules .= <<<EOD
-
-# WAN spoof check
-anchor "wanspoof"
-block in $log quick on \$wan from $lansa/$lansn to any label "WAN spoof check"
-
-EOD;
-
- }
- }
-
- foreach ($optcfg as $oc) {
- if (!$oc['bridge'])
- if($oc['sa'] <> "")
- if(isset($oc['enable']))
- $ipfrules .= "block in $log quick on \$wan from {$oc['sa']}/{$oc['sn']} to any label \"interface spoof check\"\n";
- }
-
- /* allow PPTP traffic if PPTP client is enabled on WAN */
- if ($wancfg['ipaddr'] == "pptp") {
- $ipfrules .= <<<EOD
-
-# allow PPTP client
-anchor "pptpclient"
-pass in quick on \$wan proto gre from any to any modulate state label "allow PPTP client"
-pass in quick on \$wan proto gre from any to any modulate state label "allow PPTP client"
-pass in quick on \$wan proto tcp from any port = 1723 to any flags S/SA modulate state label "allow PPTP client"
-pass in quick on \$wan proto tcp from any to any port = 1723 flags S/SA modulate state label "allow PPTP client"
-
-EOD;
- }
-
- if ($wancfg['ipaddr'] == "dhcp") {
-
- $ipfrules .= <<<EOD
-
-# allow our DHCP client out to the WAN
-anchor "wandhcp"
-pass out quick on \$wan proto udp from any port = 68 to any port = 67 label "allow dhcp client out wan"
-
-EOD;
- }
-
-if($config['interfaces']['lan']['bridge'] <> "wan" and $config['interfaces']['wan']['bridge'] <> "lan")
- $ipfrules .= "block in $log quick on \$wan proto udp from any port = 67 to {$lansa_sn_combo} port = 68 label \"block dhcp client out wan\"\n";
-
- $ipfrules .= <<<EOD
-
-pass in quick on \$wan proto udp from any port = 67 to any port = 68 label "allow dhcp client out wan"
-
-# LAN/OPT spoof check (needs to be after DHCP because of broadcast addresses)
-
-EOD;
-
- /* LAN spoof check */
- $lanbridge = false;
- foreach($config['interfaces'] as $int)
- if($int['bridge'] == "lan")
- $lanbridge = true;
- if(!$lanbridge)
- $ipfrules .= filter_rules_spoofcheck_generate('lan', $lanif, $lansa, $lansn, $log);
- $wanbridge = false;
- foreach($config['interfaces'] as $int)
- if($int['bridge'] == "wan")
- $lanbridge = true;
- if($config['interfaces']['lan']['bridge'] == "wan")
- $wanbridge = true;
-
- /* OPT spoof check */
- foreach ($optcfg as $on => $oc) {
- $isbridged = false;
- foreach ($optcfg as $on2 => $oc2) {
- if ($oc2['bridge'] && $oc2['bridge'] == $on) {
- $isbridged = true;
- break;
- }
- }
- if ($oc['ip'] && !(($oc['bridge'] || $isbridged) && isset($config['bridge']['filteringbridge'])))
- $ipfrules .= filter_rules_spoofcheck_generate($on, $oc['if'], $oc['sa'], $oc['sn'], $log);
- }
-
- $ipfrules .= "\nanchor \"spoofing\"\n";
-
- /* block private networks on WAN? */
- if (isset($config['interfaces']['wan']['blockpriv'])) {
- if($wanbridge == false) {
- $ipfrules .= <<<EOD
-
-# block anything from private networks on WAN interface
-anchor "spoofing"
-antispoof for \$wan
-block in $log quick on \$wan from 10.0.0.0/8 to any label "block private networks from wan block 10/8"
-block in $log quick on \$wan from 127.0.0.0/8 to any label "block private networks from wan block 127/8"
-block in $log quick on \$wan from 172.16.0.0/12 to any label "block private networks from wan block 172.16/12"
-block in $log quick on \$wan from 192.168.0.0/16 to any label "block private networks from wan block 192.168/16"
-
-EOD;
-
- }
- }
-
- /*
- * Support for allow limiting of TCP connections by establishment rate
- * Useful for protecting against sudden outburts, etc.
- */
- $ipfrules .= <<<EODF
-# Support for allow limiting of TCP connections by establishment rate
-anchor "limitingesr"
-table <virusprot>
-block in quick from <virusprot> to any label "virusprot overload table"
-
-EODF;
-
- /* block bogon networks on WAN */
- /* http://www.cymru.com/Documents/bogon-bn-nonagg.txt */
- /* file is automatically in cron every 3000 minutes */
- if (isset($config['interfaces']['wan']['blockbogons'])) {
- $ipfrules .= <<<EOD
-
-# block bogon networks
-# http://www.cymru.com/Documents/bogon-bn-nonagg.txt
-anchor "wanbogons"
-table <bogons> persist file "/etc/bogons"
-block in $log quick on \$wan from <bogons> to any label "block bogon networks from wan"
-
-EOD;
- }
-
-if (!isset($config['shaper']['enable']) && !is_array($config['shaper']['queue']) and $config['system']['shapertype'] <> "m0n0") {
-
- $ipfrules .= <<<EOD
-
-# let out anything from the firewall host itself and decrypted IPsec traffic
-pass out quick on \$lan proto icmp keep state label "let out anything from firewall host itself"
-pass out quick on \$wan proto icmp keep state label "let out anything from firewall host itself"
-pass out quick on $wanif all allow-opts keep state label "let out anything from firewall host itself"
-
-EOD;
-
-}
-
- $ipfrules .= create_firewall_outgoing_rules_to_itself();
-
- /* group heads for optional interfaces */
- foreach ($optcfg as $on => $oc) {
- $ipfrules .= <<<EOD
-
-
-# let out anything from the firewall host itself and decrypted IPsec traffic
-pass out quick on {$oc['if']} proto icmp keep state label "let out anything from firewall host itself"
-pass out quick on {$oc['if']} all allow-opts keep state label "let out anything from firewall host itself"
-
-EOD;
-
- }
-
- if($config['interfaces']['wan']['ipaddr'] == "pppoe")
- $ipfrules .= <<<EOD
-# permit wan interface to ping out (ping_hosts.sh)
-pass out quick on ng0 proto icmp keep state label "let out anything from firewall host itself"
-
-EOD;
-
- if (!isset($config['system']['webgui']['noantilockout'])) {
-
- if($lansa and $lansn) {
-
- $ipfrules .= <<<EOD
-
-# make sure the user cannot lock himself out of the webGUI or SSH
-anchor "anti-lockout"
-pass in quick on $lanif from any to $lanip keep state label "anti-lockout web rule"
-
-EOD;
- }
- }
-
- /* PPTPd enabled? */
- if ($pptpdcfg['mode'] && ($pptpdcfg['mode'] != "off")) {
-
- if ($pptpdcfg['mode'] == "server")
- $pptpdtarget = get_current_wan_address();
- else
- $pptpdtarget = $pptpdcfg['redir'];
-
- if($pptpdtarget) {
- $ipfrules .= <<<EOD
-
-# PPTPd rules
-anchor "pptp"
-pass in quick on \$wan proto gre from any to $pptpdtarget keep state label "allow gre pptpd"
-pass in quick on \$wan proto tcp from any to $pptpdtarget port = 1723 modulate state label "allow pptpd {$pptpdtarget}"
-
-EOD;
-
- } else {
- /* this shouldnt ever happen but instead of breaking the clients ruleset
- * log an error.
- */
- log_error("ERROR! PPTP enabled but could not resolve the \$pptpdtarget");
- }
- }
-
- /* BigPond client enabled? */
- if ($wancfg['ipaddr'] == "bigpond") {
-
- $ipfrules .= <<<EOD
-
-# BigPond heartbeat rules
-anchor "bigpond"
-pass in quick proto udp from any to any port = 5050 keep state label "BigPond heartbeat"
-
-# package manager late specific hook
-anchor "packagelate"
-
-
-
-EOD;
- }
-
- $ipfrules .= "\n# SSH lockout\n";
- $ipfrules .= "block in log proto tcp from <sshlockout> to any port 22 label \"sshlockout\"\n\n";
-
- $ipfrules .= "anchor \"ftpproxy\"\n";
- $ipfrules .= "anchor \"pftpx/*\"\n";
-
- $ipfrules .= process_carp_rules();
-
- if (isset($config['filter']['rule'])) {
- /* Pre-cache all our rules so we only have to generate them once */
- $rule_arr = array();
- foreach ($config['filter']['rule'] as $rule) {
- update_filter_reload_status("Pre-caching {$rule['descr']}...");
- $line = "";
- if (!isset($rule['disabled'])) {
- if ($rule['interface'] == "pptp") {
- /* we have a pptp rule but its turned off, ignore */
- if(!$config['pptpd']['mode'] == "server")
- continue;
- $n_pptp_units = $g['n_pptp_units'];
- if($config['pptp']['n_pptp_units'] <> "")
- $nif = $config['pptp']['n_pptp_units'];
- /*
- * now that PPTP server are user rules, detect
- * that user is setting the pptp server rule
- * and setup for all netgraph interfaces
- */
- $rule_arr[] = generate_user_filter_rule_arr($rule, 0);
- } else if($rule['interface'] == "pppoe") {
- if(!$config['pppoe']['mode'] == "server")
- continue;
- $n_pppoe_units = $g['n_pppoe_units'];
- if($config['pppoe']['n_pppoe_units'] <> "")
- $nif = $config['pppoe']['n_pppoe_units'];
- /*
- * now that pppoe server are user rules, detect
- * that user is setting the pppoe server rule
- * and setup for all netgraph interfaces
- */
- $rule_arr[] = generate_user_filter_rule_arr($rule, 0);
- } else {
- $rule_arr[] = generate_user_filter_rule_arr($rule, 0);
- }
- }
- }
-
- $ipfrules .= "\n# User-defined aliases follow\n";
- /* tables for aliases */
- foreach($table_cache as $table) {
- $ipfrules .= $table;
- }
-
- /* Shaper rules */
- if (isset($config['shaper']['enable']) && is_array($config['shaper']['queue']) && isset($config['filter']['rule']) and $config['system']['shapertype'] <> "m0n0") {
-
- $ipfrules .= "\n# Anchors for rules that might be matched by queues\n";
-
- /* This is ugly, but we generate one anchor per queue */
- foreach ($config['shaper']['queue'] as $queue) {
- update_filter_reload_status("Creating filter anchor for {$queue['name']} ...");
- /* Add anchor to rules */
- $ipfrules .= "anchor {$queue['name']} tagged {$queue['name']}\n";
- $ipfrules .= "load anchor {$queue['name']} from \"{$g['tmp_path']}/{$queue['name']}.rules\"\n";
- /* Create rules for anchors */
- $fd = fopen("{$g['tmp_path']}/{$queue['name']}.rules", "w");
- /* aliases don't recurse to anchors */
- $line = filter_generate_aliases();
- fwrite($fd, $line);
- foreach($rule_arr as $rule) {
- if($rule['ackq'] != "")
- $line = "{$rule['rule']} queue ({$queue['name']}, {$rule['ackq']}) {$rule['descr']}\n";
- else
- $line = "{$rule['rule']} queue {$queue['name']} {$rule['descr']}\n";
- fwrite($fd, $line);
- }
- fclose($fd);
- }
- }
-
- $ipfrules .= "\n# User-defined rules follow\n";
- /* Generate user rule lines */
- foreach($rule_arr as $rule) {
- $line = "";
- if (!isset($rule['disabled'])) {
- $line = $rule['rule'];
- if($line <> "") {
- /* Add default queue if we're using the shaper */
- if (isset($config['shaper']['enable']) && is_array($config['shaper']['queue']) and $config['system']['shapertype'] <> "m0n0") {
- $defq = find_default_queue($rule['interface']);
- $ackq = $rule['ackq'];
- if (($defq != "") and ($ackq != ""))
- $line .= " queue ({$defq}, {$ackq}) ";
- }
- /* label */
- $line .= " {$rule['descr']}";
- }
- }
- $line .= "\n";
- $ipfrules .= $line;
- }
- }
-
- update_filter_reload_status("Creating carp rules...");
-
- $ipfrules .= "\n# VPN Rules\n";
- $lan_ip = $config['interfaces']['lan']['ipaddr'];
- $lan_subnet = $config['interfaces']['lan']['subnet'];
- $wanif = get_real_wan_interface();
- $wan_ip = find_interface_ip($wanif);
- if($wan_ip) {
- $internal_subnet = gen_subnet($lan_ip, $lan_subnet) . "/" . $config['interfaces']['lan']['subnet'];
- /* Is IP Compression enabled? */
- if(isset($config['ipsec']['ipcomp']))
- exec("/sbin/sysctl net.inet.ipcomp.ipcomp_enable=1");
- else
- exec("/sbin/sysctl net.inet.ipcomp.ipcomp_enable=0");
-
- /* build an interface collection */
- $ifdescrs = array ("wan");
- for ($j = 1; isset ($config['interfaces']['opt' . $j]); $j++) {
- if(isset($config['interfaces']['opt' . $j]['enable']))
- $ifdescrs['opt' . $j] = filter_get_opt_interface_descr("opt" . $j);
- }
-
- if(is_array($config['ipsec']['tunnel']) && isset($config['ipsec']['enable'])) {
- foreach ($config['ipsec']['tunnel'] as $tunnel) {
- if(isset($tunnel['disabled']))
- continue;
- update_filter_reload_status("Creating IPSEC tunnel items {$tunnel['descr']}...");
- /* if tunnel is disabled, lets skip to next item */
- $ipsec_ips = array(get_current_wan_address($tunnel['interface']));
- /* is this a dynamic dns hostname? */
- $remote_gateway = gethostbyname($tunnel['remote-gateway']);
- if($remote_gateway == "")
- $remote_gateway = $tunnel['remote-gateway'];
- /* do not add items with blank remote_gateway */
- if(!$remote_gateway) {
- $ipfrules .= "# ERROR! Remote gateway not found on {$tunnel['remote-gateway']}\n";
- continue;
- }
- $local_subnet = return_vpn_subnet($tunnel['local-subnet']);
- foreach($ifdescrs as $iface) {
- foreach($ipsec_ips as $interface_ip) {
- if($iface == "wan")
- $interface_ip = find_interface_ip(get_real_wan_interface());
- else
- $interface_ip = find_interface_ip(convert_friendly_interface_to_real_interface_name($iface));
- if(!$interface_ip)
- continue;
- if(!$remote_gateway)
- continue;
- $ipfrules .= "pass out quick on \${$iface} proto udp from any to {$remote_gateway} port = 500 keep state label \"IPSEC: {$tunnel['descr']} - outbound isakmp\"\n";
- $ipfrules .= "pass in quick on \${$iface} proto udp from {$remote_gateway} to any port = 500 keep state label \"IPSEC: {$tunnel['descr']} - inbound isakmp\"\n";
- if ($tunnel['p2']['protocol'] == 'esp') {
- $ipfrules .= "pass out quick on \${$iface} proto esp from any to {$remote_gateway} keep state label \"IPSEC: {$tunnel['descr']} - outbound esp proto\"\n";
- $ipfrules .= "pass in quick on \${$iface} proto esp from {$remote_gateway} to any keep state label \"IPSEC: {$tunnel['descr']} - inbound esp proto\"\n";
- }
- if ($tunnel['p2']['protocol'] == 'ah') {
- $ipfrules .= "pass out quick on \${$iface} proto ah from any to {$remote_gateway} keep state label \"IPSEC: {$tunnel['descr']} - outbound ah proto\"\n";
- $ipfrules .= "pass in quick on \${$iface} proto ah from {$remote_gateway} to any keep state label \"IPSEC: {$tunnel['descr']} - inbound ah proto\"\n";
- }
- }
- }
- }
- }
-
- /* is mobile ipsec enabled? if so lets allow some pretty
- * loose rules to allow mobile clients to phone in.
- */
- $ipseccfg = $config['ipsec'];
- if (isset($ipseccfg['mobileclients']['enable'])) {
- foreach($ifdescrs as $iface) {
- $ipfrules .= "pass in quick on \${$iface} proto udp from any to any port = 500 keep state label \"IPSEC: Mobile - inbound isakmp\"\n";
- $ipfrules .= "pass in quick on \${$iface} proto esp from any to any keep state label \"IPSEC: Mobile - inbound esp proto\"\n";
- $ipfrules .= "pass in quick on \${$iface} proto ah from any to any keep state label \"IPSEC: Mobile - inbound ah proto\"\n";
- }
- }
- }
- $ipfrules .= <<<EOD
-
-pass in quick on $lanif inet proto tcp from any to \$loopback port 8021 keep state label "FTP PROXY: Allow traffic to localhost"
-pass in quick on $lanif inet proto tcp from any to \$loopback port 21 keep state label "FTP PROXY: Allow traffic to localhost"
-pass in quick on $wanif inet proto tcp from port 20 to ($wanif) port > 49000 flags S/SA keep state label "FTP PROXY: PASV mode data connection"
-
-EOD;
-
- if(!isset($config['system']['disableftpproxy'])) {
-
- $ipfrules .= "# enable ftp-proxy\n";
-
- $optcfg = array();
- generate_optcfg_array($optcfg);
- $ftp_counter = "8022";
- foreach($optcfg as $oc) {
- if(!isset($oc['gateway']) && $oc['if'] <> "") {
- $ipfrules .= "pass in quick on " . $oc['if'] . " inet proto tcp from any to \$loopback port {$ftp_counter} keep state label \"FTP PROXY: Allow traffic to localhost\"\n";
- $ipfrules .= "pass in quick on " . $oc['if'] . " inet proto tcp from any to \$loopback port 21 keep state label \"FTP PROXY: Allow traffic to localhost\"\n";
- }
- $ftp_counter++;
- }
-
- if(isset($config['system']['rfc959workaround'])) {
- $ipfrules .= <<<EODEOD
-
-# Fix sites that violate RFC 959 which specifies that the data connection
-# be sourced from the command port - 1 (typically port 20)
-# This workaround doesn't expose us to any extra risk as we'll still only allow
-# connections to the firewall on a port that ftp-proxy is listening on
-pass in quick on $wanif inet proto tcp from any to ($wanif) port > 49000 flags S/SA keep state label "FTP PROXY: RFC959 violation workaround"
-
-EODEOD;
-
- $optcfg = array();
- generate_optcfg_array($optcfg);
- foreach($optcfg as $oc) {
- if($oc['gateway'] <> "")
- $ipfrules .= "pass in quick on {$oc['if']} inet proto tcp from any to ({$oc['if']}) port > 49000 flags S/SA keep state label \"FTP PROXY: RFC959 violation workaround\" \n";
- }
- }
- }
-
- $ipfrules .= <<<EOD
-
-# IMSpector
-anchor "imspector"
-
-# uPnPd
-anchor "miniupnpd"
-
-#---------------------------------------------------------------------------
-# default rules (just to be sure)
-#---------------------------------------------------------------------------
-block in $log quick all label "Default block all just to be sure."
-block out $log quick all label "Default block all just to be sure."
-
-EOD;
-
- return $ipfrules;
-}
-
-function filter_rules_spoofcheck_generate($ifname, $if, $sa, $sn, $log) {
-
- global $g, $config;
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "filter_rules_spoofcheck_generate() being called $mt\n";
- }
-
- $ipfrules = "antispoof for {$if}\n";
-
- return $ipfrules;
-
-}
-
-function setup_logging_interfaces() {
- global $config;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "setup_logging_interfaces() being called $mt\n";
- }
- $rules = "";
- $i = 0;
- $ifdescrs = array('wan', 'lan');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- $ifdescrs['opt' . $j] = "opt" . $j;
- }
- foreach ($ifdescrs as $ifdescr => $ifname) {
- /* do not work with tun interfaces */
- if(stristr(filter_translate_type_to_real_interface($ifname), "tun") == true) continue;
- $int = filter_translate_type_to_real_interface($ifname);
- $rules .= "set loginterface {$int}\n";
- }
- return $rules;
-}
-
-function create_firewall_outgoing_rules_to_itself() {
- global $config, $g;
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "create_firewall_outgoing_rules_to_itself() being called $mt\n";
- }
-
- $i = 0;
- $rule .= "# pass traffic from firewall -> out\n";
- $rule .= "anchor \"firewallout\"\n";
- $ifdescrs = array('wan', 'lan');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++)
- $ifdescrs['opt' . $j] = "opt" . $j;
-
- /* go through primary and optional interfaces */
- foreach ($ifdescrs as $ifdescr => $ifname) {
- $return_gateway = $config['interfaces'][$ifname]['gateway'];
- $ints = array();
- $int = filter_translate_type_to_real_interface($ifname);
- /* if the interface is pppoe, set the ng0 interface */
- update_filter_reload_status("Creating IPSEC tunnel items {$tunnel['descr']}...");
- $ip = find_interface_ip($int);
- if ($config['interfaces'][$ifname]['ipaddr'] == "pppoe")
- $int = " { " . filter_translate_type_to_real_interface($ifname) . " ng0 } ";
- if (isset($config['shaper']['enable']) && is_array($config['shaper']['queue']) and $config['system']['shapertype'] <> "m0n0") {
- $ackq = get_ack_queue($ifname);
- $defq = find_default_queue($ifname);
- /* Handle all tagged packets */
- foreach ($config['shaper']['queue'] as $queue) {
- if(!filter_is_queue_being_used_on_interface($queue['name'], $ifname, 'out'))
- continue;
- if ($ackq == "" || $defq == "") {
- /* Shaper must not be enabled on this interface */
- $q = "";
- } else {
- $q = "queue ({$queue['name']}, {$ackq})";
- }
- $rule .="pass out quick on {$int} all allow-opts keep state tagged {$queue['name']} {$q} label \"let out anything from firewall host itself\"\n";
- }
- /* Handle untagged packets */
- if ($ackq == "" || $defq == "") {
- /* Shaper must not be enabled on this interface */
- $q = "";
- } else {
- $q = "queue ({$defq}, {$ackq})";
- }
- $rule .="pass out quick on {$int} all keep state {$q} allow-opts label \"let out anything from firewall host itself\"\n";
- } else {
- /* first add a rule for the real interface, then for ng0 */
- $rule .="pass out quick on {$int} all allow-opts keep state label \"let out anything from firewall host itself\"\n";
- }
- }
-
- update_filter_reload_status("Setting up bridging items");
- /* is bridging turned on? */
- for($x=0; $x<10; $x++) {
- if(does_interface_exist("bridge{$x}") == true)
- $rule .="pass out quick on bridge{$x} all allow-opts keep state label \"let out anything from firewall host itself\"\n";
- }
-
- update_filter_reload_status("Setting up pptp items");
- if($config['pptpd']['mode'] == "server")
- $rule .="pass out quick on \$pptp all allow-opts keep state label \"let out anything from firewall host itself pptp\"\n";
-
- update_filter_reload_status("Setting up pppoe items");
- if($config['pppoe']['mode'] == "server")
- $rule .="pass out quick on \$pppoe all allow-opts keep state label \"let out anything from firewall host itself pppoe\"\n";
-
- update_filter_reload_status("Setting up gif tunnels");
- /* setup outgoing gif tunnels */
- $number_of_gifs = find_last_gif_device();
- $number_of_gifs++;
- for($x=0; $x<$number_of_gifs; $x++) {
- if(does_interface_exist("gif{$x}") == true)
- $rule .="pass out quick on gif{$x} all allow-opts keep state label \"let out anything from firewall host itself ipsec gif\"\n";
- }
-
- update_filter_reload_status("Setting up tun interfaces (openvpn)");
- /* openvpn tun interfaces. check for 100. */
- for($x=0; $x<100; $x++) {
- if(does_interface_exist("tun{$x}") == true) {
- $rule .="pass out quick on tun{$x} all keep state label \"let out anything from firewall host itself openvpn\"\n";
- $friendlytunif = convert_real_interface_to_friendly_interface_name("tun{$x}");
- /* If the interface has a gateway we do not add a pass in rule. */
- /* Some people use a TUN tunnel with public IP as a Multiwan interface */
- if(interface_has_gateway("tun{$x}")) {
- $rule .= "# Not adding default pass in rule for interface $friendlytunif - tun{$x} with a gateway!";
- } else {
- $rule .="pass in quick on tun{$x} all keep state label \"let out anything from firewall host itself openvpn\"\n";
- }
- }
- }
- for($x=0; $x<100; $x++) {
- if(does_interface_exist("tap{$x}") == true) {
- $rule .="pass out quick on tap{$x} all keep state label \"let out anything from firewall host itself openvpn\"\n";
- $friendlytapif = convert_real_interface_to_friendly_interface_name("tap{$x}");
- /* If the interface has a gateway we do not add a pass in rule. */
- /* Some people use a TAP tunnel with public IP as a Multiwan interface */
- if(interface_has_gateway("tap{$x}")) {
- $rule .= "# Not adding default pass in rule for interface $friendlytapif - tap{$x} with a gateway!";
- } else {
- $rule .="pass in quick on tap{$x} all keep state label \"let out anything from firewall host itself openvpn\"\n";
- }
- }
- }
-
- /* permit internal ipsec outbound traffic */
- $rule .="pass out quick on \$enc0 keep state label \"IPSEC internal host to host\"";
-
- return $rule;
-}
-
-function process_carp_nat_rules() {
- global $g, $config;
-
- update_filter_reload_status("Creating CARP NAT rules");
-
- $wan_interface = get_real_wan_interface();
-
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "process_carp_nat_rules() being called $mt\n";
- }
- $lines = "";
- if($config['installedpackages']['carp']['config'] != "")
- foreach($config['installedpackages']['carp']['config'] as $carp) {
- $ip = $carp['ipaddress'];
- if($ip <> "any") {
- $ipnet = "any";
- } else {
- $int = find_ip_interface($ip);
- $carp_int = find_carp_interface($ip);
- }
- if($int != false and $int != $wan_interface) {
- $ipnet = convert_ip_to_network_format($ip, $carp['netmask']);
- if($int)
- $lines .= "nat on {$int} inet from {$ipnet} to any -> ({$carp_int}) \n";
- }
- }
- return $lines;
-}
-
-function process_carp_rules() {
- global $g, $config;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "process_carp_rules() being called $mt\n";
- }
- $lines = "";
- /* return if there are no carp configured items */
- if($config['installedpackages']['carpsettings']['config'] <> "" or
- $config['virtualip']['vip'] <> "") {
- $lines .= "pass quick proto carp\n";
- $lines .= "pass quick proto pfsync";
- }
- return $lines;
-}
-
-function remove_special_characters($string) {
- $match_array = "";
- preg_match_all("/[a-zA-Z0-9\_\-]+/",$string,$match_array);
- $string = "";
- foreach($match_array[0] as $ma) {
- if($string <> "")
- $string .= " ";
- $string .= $ma;
- }
- return $string;
-}
-
-function carp_sync_xml($url, $password, $sections, $port = 80, $method = 'pfsense.restore_config_section') {
- global $config, $g;
-
- if($g['booting'])
- return;
-
- update_filter_reload_status("Syncing CARP data to {$url}");
-
- /* make a copy of config */
- $config_copy = $config;
-
- /* strip out nosync items */
- for ($x = 0; $x < count($config_copy['nat']['advancedoutbound']['rule']); $x++) {
- if (isset ($config_copy['nat']['advancedoutbound']['rule'][$x]['nosync']))
- unset ($config_copy['nat']['advancedoutbound']['rule'][$x]);
- $config_copy['nat']['advancedoutbound']['rule'][$x]['descr'] = remove_special_characters($config_copy['nat']['advancedoutbound']['rule'][$x]['descr']);
- }
- for ($x = 0; $x < count($config_copy['nat']['rule']); $x++) {
- if (isset ($config_copy['nat']['rule'][$x]['nosync']))
- unset ($config_copy['nat']['rule'][$x]);
- $config_copy['nat']['rule'][$x]['descr'] = remove_special_characters($config_copy['nat']['rule'][$x]['descr']);
- }
- for ($x = 0; $x < count($config_copy['filter']['rule']); $x++) {
- if (isset ($config_copy['filter']['rule'][$x]['nosync']))
- unset ($config_copy['filter']['rule'][$x]);
- $config_copy['filter']['rule'][$x]['descr'] = remove_special_characters($config_copy['filter']['rule'][$x]['descr']);
- }
- for ($x = 0; $x < count($config_copy['aliases']['alias']); $x++) {
- if (isset ($config_copy['aliases']['alias'][$x]['nosync']))
- unset ($config_copy['aliases']['alias'][$x]);
- $config_copy['aliases']['alias'][$x]['descr'] = remove_special_characters($config_copy['aliases']['alias'][$x]['descr']);
- }
- for ($x = 0; $x < count($config_copy['dnsmasq']['hosts']); $x++) {
- if (isset ($config_copy['dnsmasq']['hosts'][$x]['nosync']))
- unset ($config_copy['dnsmasq']['hosts'][$x]);
- $config_copy['dnsmasq']['hosts'][$x]['descr'] = remove_special_characters($config_copy['dnsmasq']['hosts'][$x]['descr']);
- }
- for ($x = 0; $x < count($config_copy['virtualip']['vip']); $x++) {
- if (isset ($config_copy['virtualip']['vip'][$x]['nosync']) or $config_copy['virtualip']['vip'][$x]['mode'] == "proxyarp")
- unset ($config_copy['virtualip']['vip'][$x]);
- $config_copy['virtualip']['vip'][$x]['descr'] = remove_special_characters($config_copy['virtualip']['vip'][$x]['descr']);
- }
- for ($x = 0; $x < count($config_copy['ipsec']['tunnel']); $x++) {
- if (isset ($config_copy['ipsec']['tunnel'][$x]['nosync']))
- unset ($config_copy['ipsec']['tunnel'][$x]);
- $config_copy['ipsec']['tunnel'][$x]['descr'] = remove_special_characters($config_copy['ipsec']['tunnel'][$x]['descr']);
- }
-
- foreach($sections as $section) {
- /* we can't use array_intersect_key()
- due to the vip 'special case' */
- if($section != 'virtualip') {
- $xml[$section] = $config_copy[$section];
- } else {
- $xml[$section] = backup_vip_config_section();
- }
- }
-
- $params = array(
- XML_RPC_encode($password),
- XML_RPC_encode($xml)
- );
-
- log_error("Beginning XMLRPC sync to {$url}:{$port}.");
- $msg = new XML_RPC_Message($method, $params);
- $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
- $cli->setCredentials('admin', $password);
- if($g['debug']) $cli->setDebug(1);
- /* send our XMLRPC message and timeout after 240 seconds */
- $resp = $cli->send($msg, "240");
- if(!$resp) {
- $error = "A communications error occured while attempting XMLRPC sync with username admin {$url}:{$port}.";
- log_error($error);
- file_notice("sync_settings", $error, "Settings Sync", "");
- } elseif($resp->faultCode()) {
- $error = "An error code was received while attempting XMLRPC sync with username admin {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
- log_error($error);
- file_notice("sync_settings", $error, "Settings Sync", "");
- } else {
- log_error("XMLRPC sync successfully completed with {$url}:{$port}.");
- }
-}
-
-function carp_sync_client() {
-
- global $config, $g;
-
- update_filter_reload_status("Building CARP sync information");
-
- if($g['booting'])
- return;
-
- if(is_array($config['installedpackages']['carpsettings']['config'])) {
- foreach($config['installedpackages']['carpsettings']['config'] as $carp) {
- if($carp['synchronizetoip'] != "" ) {
- /*
- * XXX: The way we're finding the port right now is really suboptimal -
- * we can't assume that the other machine is setup identically.
- */
- if($config['system']['webgui']['protocol'] != "") {
- $synchronizetoip = $config['system']['webgui']['protocol'];
- $synchronizetoip .= "://";
- }
- $port = $config['system']['webgui']['port'];
- /* if port is empty lets rely on the protocol selection */
- if($port == "") {
- if($config['system']['webgui']['protocol'] == "http") {
- $port = "80";
- } else {
- $port = "443";
- }
- }
- $synchronizetoip .= $carp['synchronizetoip'];
- if($carp['synchronizerules'] != "" and is_array($config['filter'])) {
- $sections[] = 'filter';
- }
- if($carp['synchronizenat'] != "" and is_array($config['nat'])) {
- $sections[] = 'nat';
- }
- if($carp['synchronizealiases'] != "" and is_array($config['aliases'])) {
- $sections[] = 'aliases';
- }
- if($carp['synchronizedhcpd'] != "" and is_array($config['dhcpd'])) {
- $sections[] = 'dhcpd';
- }
- if($carp['synchronizewol'] != "" and is_array($config['wol'])) {
- $sections[] = 'wol';
- }
- if($carp['synchronizetrafficshaper'] != "" and is_array($config['shaper'])) {
- $sections[] = 'shaper';
- }
- if($carp['synchronizestaticroutes'] != "" and is_array($config['staticroutes'])) {
- $sections[] = 'staticroutes';
- }
- if($carp['synchronizevirtualip'] != "" and is_array($config['virtualip'])) {
- $sections[] = 'virtualip';
- }
- if($carp['synchronizelb'] != "" and is_array($config['load_balancer'])) {
- $sections[] = 'load_balancer';
- }
- if($carp['synchronizeipsec'] != "" and is_array($config['ipsec'])) {
- $sections[] = 'ipsec';
- }
- if($carp['synchronizednsforwarder'] != "" and is_array($config['dnsmasq'])) {
- $sections[] = 'dnsmasq';
- }
- if($carp['synchronizeschedules'] != "" and is_array($config['schedules'])) {
- $sections[] = 'schedules';
- }
- if(count($sections) > 0) {
- update_filter_reload_status("Signaling CARP reload signal...");
- carp_sync_xml($synchronizetoip, $carp['password'], $sections, $port);
- $cli = new XML_RPC_Client('/xmlrpc.php', $synchronizetoip, $port);
- $msg = new XML_RPC_Message('pfsense.filter_configure', array(new XML_RPC_Value($carp['password'], 'string')));
- $cli->setCredentials('admin', $carp['password']);
- $cli->send($msg, "900");
- /* signal a carp reload */
- $msg = new XML_RPC_Message('pfsense.interfaces_carp_configure');
- $cli->send($msg, "900");
- }
- }
- }
- }
-
-}
-
-function return_vpn_subnet($adr) {
- global $config;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "return_vpn_subnet() being called $mt\n";
- }
-
- if ($adr['address']) {
- list($padr, $pmask) = explode("/", $adr['address']);
- if (is_null($pmask))
- return "{$padr}/32";
- return "{$padr}/{$pmask}";
- }
-
- /* XXX: do not return wan, lan, etc */
- if(strstr($adr['network'], "wan") or strstr($adr['network'], "lan") or strstr($adr['network'], "opt"))
- return convert_ip_to_network_format($config['interfaces'][$adr['network']]['ipaddr'],
- $config['interfaces'][$adr['network']]['subnet']);
-
- /* fallback - error */
- return " # error - {$adr['network']} ";
-
-}
-
-?>
diff --git a/config/igmpproxy/firewall_rules_edit.tmp b/config/igmpproxy/firewall_rules_edit.tmp
deleted file mode 100755
index 25b669af..00000000
--- a/config/igmpproxy/firewall_rules_edit.tmp
+++ /dev/null
@@ -1,879 +0,0 @@
-<?php
-/* $Id: firewall_rules_edit.php,v 1.86.2.34.2.5 2007/11/20 00:29:07 cmb Exp $ */
-/*
- firewall_rules_edit.php
- part of pfSense (https://www.pfsense.org)
- Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com)
-
- originally part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-
-$specialsrcdst = explode(" ", "any wanip lanip lan pptp pppoe");
-
-if (!is_array($config['filter']['rule'])) {
- $config['filter']['rule'] = array();
-}
-filter_rules_sort();
-$a_filter = &$config['filter']['rule'];
-
-$id = $_GET['id'];
-if (is_numeric($_POST['id']))
- $id = $_POST['id'];
-
-$after = $_GET['after'];
-
-if (isset($_POST['after']))
- $after = $_POST['after'];
-
-if (isset($_GET['dup'])) {
- $id = $_GET['dup'];
- $after = $_GET['dup'];
-}
-
-if (isset($id) && $a_filter[$id]) {
- $pconfig['interface'] = $a_filter[$id]['interface'];
-
- if (!isset($a_filter[$id]['type']))
- $pconfig['type'] = "pass";
- else
- $pconfig['type'] = $a_filter[$id]['type'];
-
- if (isset($a_filter[$id]['protocol']))
- $pconfig['proto'] = $a_filter[$id]['protocol'];
- else
- $pconfig['proto'] = "any";
-
- if ($a_filter[$id]['protocol'] == "icmp")
- $pconfig['icmptype'] = $a_filter[$id]['icmptype'];
-
- address_to_pconfig($a_filter[$id]['source'], $pconfig['src'],
- $pconfig['srcmask'], $pconfig['srcnot'],
- $pconfig['srcbeginport'], $pconfig['srcendport']);
-
- if($a_filter[$id]['os'] <> "")
- $pconfig['os'] = $a_filter[$id]['os'];
-
- address_to_pconfig($a_filter[$id]['destination'], $pconfig['dst'],
- $pconfig['dstmask'], $pconfig['dstnot'],
- $pconfig['dstbeginport'], $pconfig['dstendport']);
-
- $pconfig['disabled'] = isset($a_filter[$id]['disabled']);
- $pconfig['log'] = isset($a_filter[$id]['log']);
- $pconfig['descr'] = $a_filter[$id]['descr'];
-
- /* advanced */
- if (isset($a_filter[$id]['allowopts']))
- $pconfig['allowopts'] = true;
- $pconfig['max-src-nodes'] = $a_filter[$id]['max-src-nodes'];
- $pconfig['max-src-states'] = $a_filter[$id]['max-src-states'];
- $pconfig['statetype'] = $a_filter[$id]['statetype'];
- $pconfig['statetimeout'] = $a_filter[$id]['statetimeout'];
-
- $pconfig['nosync'] = isset($a_filter[$id]['nosync']);
-
- /* advanced - new connection per second banning*/
- $pconfig['max-src-conn-rate'] = $a_filter[$id]['max-src-conn-rate'];
- $pconfig['max-src-conn-rates'] = $a_filter[$id]['max-src-conn-rates'];
-
- /* Multi-WAN next-hop support */
- $pconfig['gateway'] = $a_filter[$id]['gateway'];
-
- //schedule support
- $pconfig['sched'] = $a_filter[$id]['sched'];
-
-} else {
- /* defaults */
- if ($_GET['if'])
- $pconfig['interface'] = $_GET['if'];
- $pconfig['type'] = "pass";
- $pconfig['src'] = "any";
- $pconfig['dst'] = "any";
-}
-
-if (isset($_GET['dup']))
- unset($id);
-
-if ($_POST) {
-
- if ($_POST['type'] == "reject" && $_POST['proto'] <> "tcp")
- $input_errors[] = "Reject type rules only works when the protocol is set to TCP.";
-
- if (($_POST['proto'] != "tcp") && ($_POST['proto'] != "udp") && ($_POST['proto'] != "tcp/udp")) {
- $_POST['srcbeginport'] = 0;
- $_POST['srcendport'] = 0;
- $_POST['dstbeginport'] = 0;
- $_POST['dstendport'] = 0;
- } else {
-
- if ($_POST['srcbeginport_cust'] && !$_POST['srcbeginport'])
- $_POST['srcbeginport'] = $_POST['srcbeginport_cust'];
- if ($_POST['srcendport_cust'] && !$_POST['srcendport'])
- $_POST['srcendport'] = $_POST['srcendport_cust'];
-
- if ($_POST['srcbeginport'] == "any") {
- $_POST['srcbeginport'] = 0;
- $_POST['srcendport'] = 0;
- } else {
- if (!$_POST['srcendport'])
- $_POST['srcendport'] = $_POST['srcbeginport'];
- }
- if ($_POST['srcendport'] == "any")
- $_POST['srcendport'] = $_POST['srcbeginport'];
-
- if ($_POST['dstbeginport_cust'] && !$_POST['dstbeginport'])
- $_POST['dstbeginport'] = $_POST['dstbeginport_cust'];
- if ($_POST['dstendport_cust'] && !$_POST['dstendport'])
- $_POST['dstendport'] = $_POST['dstendport_cust'];
-
- if ($_POST['dstbeginport'] == "any") {
- $_POST['dstbeginport'] = 0;
- $_POST['dstendport'] = 0;
- } else {
- if (!$_POST['dstendport'])
- $_POST['dstendport'] = $_POST['dstbeginport'];
- }
- if ($_POST['dstendport'] == "any")
- $_POST['dstendport'] = $_POST['dstbeginport'];
- }
-
- if (is_specialnet($_POST['srctype'])) {
- $_POST['src'] = $_POST['srctype'];
- $_POST['srcmask'] = 0;
- } else if ($_POST['srctype'] == "single") {
- $_POST['srcmask'] = 32;
- }
- if (is_specialnet($_POST['dsttype'])) {
- $_POST['dst'] = $_POST['dsttype'];
- $_POST['dstmask'] = 0;
- } else if ($_POST['dsttype'] == "single") {
- $_POST['dstmask'] = 32;
- }
-
- unset($input_errors);
- $pconfig = $_POST;
-
- /* input validation */
- $reqdfields = explode(" ", "type interface proto src dst");
- $reqdfieldsn = explode(",", "Type,Interface,Protocol,Source,Destination");
-
-
- if($_POST['statetype'] == "modulate state" or $_POST['statetype'] == "synproxy state") {
- if( $_POST['proto'] != "tcp" )
- $input_errors[] = "{$_POST['statetype']} is only valid with protocol tcp.";
- if(($_POST['statetype'] == "synproxy state") && ($_POST['gateway'] != ""))
- $input_errors[] = "{$_POST['statetype']} is only valid if the gateway is set to 'default'.";
- }
-
-
- if (!(is_specialnet($_POST['srctype']) || ($_POST['srctype'] == "single"))) {
- $reqdfields[] = "srcmask";
- $reqdfieldsn[] = "Source bit count";
- }
- if (!(is_specialnet($_POST['dsttype']) || ($_POST['dsttype'] == "single"))) {
- $reqdfields[] = "dstmask";
- $reqdfieldsn[] = "Destination bit count";
- }
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if (!$_POST['srcbeginport']) {
- $_POST['srcbeginport'] = 0;
- $_POST['srcendport'] = 0;
- }
- if (!$_POST['dstbeginport']) {
- $_POST['dstbeginport'] = 0;
- $_POST['dstendport'] = 0;
- }
-
- if (($_POST['srcbeginport'] && !alias_expand($_POST['srcbeginport']) && !is_port($_POST['srcbeginport']))) {
- $input_errors[] = "The start source port must be an alias or integer between 1 and 65535.";
- }
- if (($_POST['srcendport'] && !alias_expand($_POST['srcendport']) && !is_port($_POST['srcendport']))) {
- $input_errors[] = "The end source port must be an alias or integer between 1 and 65535.";
- }
- if (($_POST['dstbeginport'] && !alias_expand($_POST['dstbeginport']) && !is_port($_POST['dstbeginport']))) {
- $input_errors[] = "The start destination port must be an alias or integer between 1 and 65535.";
- }
- if (($_POST['dstendport'] && !alias_expand($_POST['dstbeginport']) && !is_port($_POST['dstendport']))) {
- $input_errors[] = "The end destination port must be an alias or integer between 1 and 65535.";
- }
-
- /* if user enters an alias and selects "network" then disallow. */
- if($_POST['srctype'] == "network") {
- if(is_alias($_POST['src']))
- $input_errors[] = "You must specify single host or alias for alias entries.";
- }
- if($_POST['dsttype'] == "network") {
- if(is_alias($_POST['dst']))
- $input_errors[] = "You must specify single host or alias for alias entries.";
- }
-
- if (!is_specialnet($_POST['srctype'])) {
- if (($_POST['src'] && !is_ipaddroranyalias($_POST['src']))) {
- $input_errors[] = "A valid source IP address or alias must be specified.";
- }
- if (($_POST['srcmask'] && !is_numericint($_POST['srcmask']))) {
- $input_errors[] = "A valid source bit count must be specified.";
- }
- }
- if (!is_specialnet($_POST['dsttype'])) {
- if (($_POST['dst'] && !is_ipaddroranyalias($_POST['dst']))) {
- $input_errors[] = "A valid destination IP address or alias must be specified.";
- }
- if (($_POST['dstmask'] && !is_numericint($_POST['dstmask']))) {
- $input_errors[] = "A valid destination bit count must be specified.";
- }
- }
-
- if ($_POST['srcbeginport'] > $_POST['srcendport']) {
- /* swap */
- $tmp = $_POST['srcendport'];
- $_POST['srcendport'] = $_POST['srcbeginport'];
- $_POST['srcbeginport'] = $tmp;
- }
- if ($_POST['dstbeginport'] > $_POST['dstendport']) {
- /* swap */
- $tmp = $_POST['dstendport'];
- $_POST['dstendport'] = $_POST['dstbeginport'];
- $_POST['dstbeginport'] = $tmp;
- }
- if ($_POST['os'])
- if( $_POST['proto'] != "tcp" )
- $input_errors[] = "OS detection is only valid with protocol tcp.";
-
- if (!$input_errors) {
- $filterent = array();
- $filterent['type'] = $_POST['type'];
- $filterent['interface'] = $_POST['interface'];
-
- /* Advanced options */
- if ($_POST['allowopts'] == "yes")
- $filterent['allowopts'] = true;
- else
- unset($filterent['allowopts']);
- $filterent['max-src-nodes'] = $_POST['max-src-nodes'];
- $filterent['max-src-states'] = $_POST['max-src-states'];
- $filterent['statetimeout'] = $_POST['statetimeout'];
- $filterent['statetype'] = $_POST['statetype'];
- $filterent['os'] = $_POST['os'];
-
- /* Nosync directive - do not xmlrpc sync this item */
- if($_POST['nosync'] <> "")
- $filterent['nosync'] = true;
- else
- unset($filterent['nosync']);
-
- /* unless both values are provided, unset the values - ticket #650 */
- if($_POST['max-src-conn-rate'] <> "" and $_POST['max-src-conn-rates'] <> "") {
- $filterent['max-src-conn-rate'] = $_POST['max-src-conn-rate'];
- $filterent['max-src-conn-rates'] = $_POST['max-src-conn-rates'];
- } else {
- unset($filterent['max-src-conn-rate']);
- unset($filterent['max-src-conn-rates']);
- }
-
- if ($_POST['proto'] != "any")
- $filterent['protocol'] = $_POST['proto'];
- else
- unset($filterent['protocol']);
-
- if ($_POST['proto'] == "icmp" && $_POST['icmptype'])
- $filterent['icmptype'] = $_POST['icmptype'];
- else
- unset($filterent['icmptype']);
-
- pconfig_to_address($filterent['source'], $_POST['src'],
- $_POST['srcmask'], $_POST['srcnot'],
- $_POST['srcbeginport'], $_POST['srcendport']);
-
- pconfig_to_address($filterent['destination'], $_POST['dst'],
- $_POST['dstmask'], $_POST['dstnot'],
- $_POST['dstbeginport'], $_POST['dstendport']);
-
- if ($_POST['disabled'])
- $filterent['disabled'] = true;
- else
- unset($filterent['disabled']);
- if ($_POST['log'])
- $filterent['log'] = true;
- else
- unset($filterent['log']);
- strncpy($filterent['descr'], $_POST['descr'], 52);
-
- if ($_POST['gateway'] != "") {
- $filterent['gateway'] = $_POST['gateway'];
- }
-
- if ($_POST['sched'] != "") {
- $filterent['sched'] = $_POST['sched'];
- }
-
- if (isset($id) && $a_filter[$id])
- $a_filter[$id] = $filterent;
- else {
- if (is_numeric($after))
- array_splice($a_filter, $after+1, 0, array($filterent));
- else
- $a_filter[] = $filterent;
- }
-
- write_config();
- touch($d_filterconfdirty_path);
-
- header("Location: firewall_rules.php?if=" . $_POST['interface']);
- exit;
- }
-}
-
-$pgtitle = "Firewall: Rules: Edit";
-$closehead = false;
-
-$page_filename = "firewall_rules_edit.php";
-include("head.inc");
-
-?>
-
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-
-<form action="firewall_rules_edit.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncellreq">Action</td>
- <td width="78%" class="vtable">
- <select name="type" class="formfld">
- <?php $types = explode(" ", "Pass Block Reject"); foreach ($types as $type): ?>
- <option value="<?=strtolower($type);?>" <?php if (strtolower($type) == strtolower($pconfig['type'])) echo "selected"; ?>>
- <?=htmlspecialchars($type);?>
- </option>
- <?php endforeach; ?>
- </select>
- <br/>
- <span class="vexpl">
- Choose what to do with packets that match the criteria specified below. <br/>
- Hint: the difference between block and reject is that with reject, a packet (TCP RST or ICMP port unreachable for UDP) is returned to the sender, whereas with block the packet is dropped silently. In either case, the original packet is discarded. Reject only works when the protocol is set to either TCP or UDP (but not &quot;TCP/UDP&quot;) below.
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Disabled</td>
- <td width="78%" class="vtable">
- <input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>>
- <strong>Disable this rule</strong><br />
- <span class="vexpl">Set this option to disable this rule without removing it from the list.</span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Interface</td>
- <td width="78%" class="vtable">
- <select name="interface" class="formfld">
-<?php
- $interfaces = array('wan' => 'WAN', 'lan' => 'LAN', 'pptp' => 'PPTP', 'pppoe' => 'PPPOE', 'enc0' => 'IPSEC');
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
- }
- foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>><?=htmlspecialchars($ifacename);?></option>
-<?php endforeach; ?>
- </select>
- <br />
- <span class="vexpl">Choose on which interface packets must come in to match this rule.</span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Protocol</td>
- <td width="78%" class="vtable">
- <select name="proto" class="formfld" onchange="proto_change()">
-<?php
- $protocols = explode(" ", "TCP UDP TCP/UDP ICMP ESP AH GRE IGMP any carp pfsync");
- foreach ($protocols as $proto): ?>
- <option value="<?=strtolower($proto);?>" <?php if (strtolower($proto) == $pconfig['proto']) echo "selected"; ?>><?=htmlspecialchars($proto);?></option>
-<?php endforeach; ?>
- </select>
- <br />
- <span class="vexpl">Choose which IP protocol this rule should match. <br /> Hint: in most cases, you should specify <em>TCP</em> &nbsp;here.</span>
- </td>
- </tr>
- <tr id="icmpbox" name="icmpbox">
- <td valign="top" class="vncell">ICMP type</td>
- <td class="vtable">
- <select name="icmptype" class="formfld">
-<?php
- $icmptypes = array(
- "" => "any",
- "echorep" => "Echo reply",
- "unreach" => "Destination unreachable",
- "squench" => "Source quench",
- "redir" => "Redirect",
- "althost" => "Alternate Host",
- "echoreq" => "Echo",
- "routeradv" => "Router advertisement",
- "routersol" => "Router solicitation",
- "timex" => "Time exceeded",
- "paramprob" => "Invalid IP header",
- "timereq" => "Timestamp",
- "timerep" => "Timestamp reply",
- "inforeq" => "Information request",
- "inforep" => "Information reply",
- "maskreq" => "Address mask request",
- "maskrep" => "Address mask reply"
- );
-
- foreach ($icmptypes as $icmptype => $descr): ?>
- <option value="<?=$icmptype;?>" <?php if ($icmptype == $pconfig['icmptype']) echo "selected"; ?>><?=htmlspecialchars($descr);?></option>
-<?php endforeach; ?>
- </select>
- <br />
- <span class="vexpl">If you selected ICMP for the protocol above, you may specify an ICMP type here.</span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Source</td>
- <td width="78%" class="vtable">
- <input name="srcnot" type="checkbox" id="srcnot" value="yes" <?php if ($pconfig['srcnot']) echo "checked"; ?>>
- <strong>not</strong>
- <br />
- Use this option to invert the sense of the match.
- <br />
- <br />
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>Type:&nbsp;&nbsp;</td>
- <td>
- <select name="srctype" class="formfld" onChange="typesel_change()">
-<?php
- $sel = is_specialnet($pconfig['src']); ?>
- <option value="any" <?php if ($pconfig['src'] == "any") { echo "selected"; } ?>>any</option>
- <option value="single" <?php if (($pconfig['srcmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>>Single host or alias</option>
- <option value="network" <?php if (!$sel) echo "selected"; ?>>Network</option>
- <option value="wanip" <?php if ($pconfig['src'] == "wanip") { echo "selected"; } ?>>WAN address</option>
- <option value="lanip" <?php if ($pconfig['src'] == "lanip") { echo "selected"; } ?>>LAN address</option>
- <option value="lan" <?php if ($pconfig['src'] == "lan") { echo "selected"; } ?>>LAN subnet</option>
- <option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected"; } ?>>PPTP clients</option>
- <option value="pppoe" <?php if ($pconfig['src'] == "pppoe") { echo "selected"; } ?>>PPPoE clients</option>
-<?php
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++): ?>
- <option value="opt<?=$i;?>" <?php if ($pconfig['src'] == "opt" . $i) { echo "selected"; } ?>><?=htmlspecialchars($config['interfaces']['opt' . $i]['descr']);?> subnet</option>
- <option value="opt<?=$i;?>ip"<?php if ($pconfig['src'] == "opt" . $i . "ip") { echo "selected"; } ?>>
- <?=$config['interfaces']['opt' . $i]['descr']?> address
- </option>
-<?php endfor; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td>Address:&nbsp;&nbsp;</td>
- <td>
- <input autocomplete='off' name="src" type="text" class="formfldalias" id="src" size="20" value="<?php if (!is_specialnet($pconfig['src'])) echo htmlspecialchars($pconfig['src']);?>"> /
- <select name="srcmask" class="formfld" id="srcmask">
-<?php for ($i = 31; $i > 0; $i--): ?>
- <option value="<?=$i;?>" <?php if ($i == $pconfig['srcmask']) echo "selected"; ?>><?=$i;?></option>
-<?php endfor; ?>
- </select>
- </td>
- </tr>
- </table>
- <div id="showadvancedboxspr">
- <p>
- <input type="button" onClick="show_source_port_range()" value="Advanced"></input> - Show source port range</a>
- </div>
- </td>
- </tr>
- <tr style="display:none" id="sprtable" name="sprtable">
- <td width="22%" valign="top" class="vncellreq">Source port range</td>
- <td width="78%" class="vtable">
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>from:&nbsp;&nbsp;</td>
- <td>
- <select name="srcbeginport" class="formfld" onchange="src_rep_change();ext_change()">
- <option value="">(other)</option>
- <option value="any" <?php $bfound = 0; if ($pconfig['srcbeginport'] == "any") { echo "selected"; $bfound = 1; } ?>>any</option>
-<?php foreach ($wkports as $wkport => $wkportdesc): ?>
- <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['srcbeginport']) { echo "selected"; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option>
-<?php endforeach; ?>
- </select>
- <input autocomplete='off' class="formfldalias" name="srcbeginport_cust" id="srcbeginport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['srcbeginport']) echo $pconfig['srcbeginport']; ?>">
- </td>
- </tr>
- <tr>
- <td>to:</td>
- <td>
- <select name="srcendport" class="formfld" onchange="ext_change()">
- <option value="">(other)</option>
- <option value="any" <?php $bfound = 0; if ($pconfig['srcendport'] == "any") { echo "selected"; $bfound = 1; } ?>>any</option>
-<?php foreach ($wkports as $wkport => $wkportdesc): ?>
- <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['srcendport']) { echo "selected"; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option>
-<?php endforeach; ?>
- </select>
- <input autocomplete='off' class="formfldalias" name="srcendport_cust" id="srcendport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['srcendport']) echo $pconfig['srcendport']; ?>">
- </td>
- </tr>
- </table>
- <br />
- <span class="vexpl">Specify the port or port range for the source of the packet for this rule. This is usually not equal to the destination port range (and is often &quot;any&quot;). <br /> Hint: you can leave the <em>'to'</em> field empty if you only want to filter a single port</span><br/>
- <span class="vexpl"><B>NOTE:</B> You will not need to enter anything here in 99.99999% of the circumstances. If you're unsure, do not enter anything here!</span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Source OS</td>
- <td width="78%" class="vtable">OS Type:&nbsp;
- <select name="os" id="os" class="formfld">
-<?php
- $ostypes = array(
- "" => "any",
- "AIX" => "AIX",
- "Linux" => "Linux",
- "FreeBSD" => "FreeBSD",
- "NetBSD" => "NetBSD",
- "OpenBSD" => "OpenBSD",
- "Solaris" => "Solaris",
- "MacOS" => "MacOS",
- "Windows" => "Windows",
- "Novell" => "Novell",
- "NMAP" => "NMAP"
- );
-
- foreach ($ostypes as $ostype => $descr): ?>
- <option value="<?=$ostype;?>" <?php if ($ostype == $pconfig['os']) echo "selected"; ?>><?=htmlspecialchars($descr);?></option>
-<?php endforeach; ?>
- </select>
- <br />
- Note: this only works for TCP rules
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Destination</td>
- <td width="78%" class="vtable">
- <input name="dstnot" type="checkbox" id="dstnot" value="yes" <?php if ($pconfig['dstnot']) echo "checked"; ?>>
- <strong>not</strong>
- <br />
- Use this option to invert the sense of the match.
- <br />
- <br />
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>Type:&nbsp;&nbsp;</td>
- <td>
- <select name="dsttype" class="formfld" onChange="typesel_change()">
-<?php
- $sel = is_specialnet($pconfig['dst']); ?>
- <option value="any" <?php if ($pconfig['dst'] == "any") { echo "selected"; } ?>>any</option>
- <option value="single" <?php if (($pconfig['dstmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>>Single host or alias</option>
- <option value="network" <?php if (!$sel) echo "selected"; ?>>Network</option>
- <option value="wanip" <?php if ($pconfig['dst'] == "wanip") { echo "selected"; } ?>>WAN address</option>
- <option value="lanip" <?php if ($pconfig['dst'] == "lanip") { echo "selected"; } ?>>LAN address</option>
- <option value="lan" <?php if ($pconfig['dst'] == "lan") { echo "selected"; } ?>>LAN subnet</option>
- <option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected"; } ?>>PPTP clients</option>
- <option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected"; } ?>>PPPoE clients</option>
-<?php for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++): ?>
- <option value="opt<?=$i;?>" <?php if ($pconfig['dst'] == "opt" . $i) { echo "selected"; } ?>><?=htmlspecialchars($config['interfaces']['opt' . $i]['descr']);?> subnet</option>
- <option value="opt<?=$i;?>ip"<?php if ($pconfig['dst'] == "opt" . $i . "ip") { echo "selected"; } ?>>
- <?=$config['interfaces']['opt' . $i]['descr']?> address
- </option>
-<?php endfor; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td>Address:&nbsp;&nbsp;</td>
- <td>
- <input name="dst" type="text" class="formfldalias" id="dst" size="20" value="<?php if (!is_specialnet($pconfig['dst'])) echo htmlspecialchars($pconfig['dst']);?>">
- /
- <select name="dstmask" class="formfld" id="dstmask">
-<?php
- for ($i = 31; $i > 0; $i--): ?>
- <option value="<?=$i;?>" <?php if ($i == $pconfig['dstmask']) echo "selected"; ?>><?=$i;?></option>
-<?php endfor; ?>
- </select>
- </td>
- </tr>
- </table>
-
- </td>
- </tr>
- <tr id="dprtr" name="dprtr">
- <td width="22%" valign="top" class="vncellreq">Destination port range </td>
- <td width="78%" class="vtable">
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>from:&nbsp;&nbsp;</td>
- <td>
- <select name="dstbeginport" class="formfld" onchange="dst_rep_change();ext_change()">
- <option value="">(other)</option>
- <option value="any" <?php $bfound = 0; if ($pconfig['dstbeginport'] == "any") { echo "selected"; $bfound = 1; } ?>>any</option>
-<?php foreach ($wkports as $wkport => $wkportdesc): ?>
- <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['dstbeginport']) { echo "selected"; $bfound = 1; }?>><?=htmlspecialchars($wkportdesc);?></option>
-<?php endforeach; ?>
- </select>
- <input autocomplete='off' class="formfldalias" name="dstbeginport_cust" id="dstbeginport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['dstbeginport']) echo $pconfig['dstbeginport']; ?>">
- </td>
- </tr>
- <tr>
- <td>to:</td>
- <td>
- <select name="dstendport" class="formfld" onchange="ext_change()">
- <option value="">(other)</option>
- <option value="any" <?php $bfound = 0; if ($pconfig['dstendport'] == "any") { echo "selected"; $bfound = 1; } ?>>any</option>
-<?php foreach ($wkports as $wkport => $wkportdesc): ?>
- <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['dstendport']) { echo "selected"; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option>
-<?php endforeach; ?>
- </select>
- <input autocomplete='off' class="formfldalias" name="dstendport_cust" id="dstendport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['dstendport']) echo $pconfig['dstendport']; ?>">
- </td>
- </tr>
- </table>
- <br />
- <span class="vexpl">
- Specify the port or port range for the destination of the packet for this rule.
- <br />
- Hint: you can leave the <em>'to'</em> field empty if you only want to filter a single port
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Log</td>
- <td width="78%" class="vtable">
- <input name="log" type="checkbox" id="log" value="yes" <?php if ($pconfig['log']) echo "checked"; ?>>
- <strong>Log packets that are handled by this rule</strong>
- <br />
- <span class="vexpl">Hint: the firewall has limited local log space. Don't turn on logging for everything. If you want to do a lot of logging, consider using a remote syslog server (see the <a href="diag_logs_settings.php">Diagnostics: System logs: Settings</a> page).</span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Advanced Options</td>
- <td width="78%" class="vtable">
- <div id="aoadv" name="aoadv">
- <input type="button" onClick="show_aodiv();" value="Advanced"> - Show advanced options
- </div>
- <div id="aodivmain" name="aodivmain" style="display:none">
- <input type="checkbox" id="allowopts" value="yes" name="allowopts"<?php if($pconfig['allowopts'] == true) echo " checked"; ?>>
- <br/><span class="vexpl"><?=gettext("This allows packets with ip options to pass otherwise they are blocked by default i.e. with multicast routing/proxing.");?>
-
- <input name="max-src-nodes" id="max-src-nodes" value="<?php echo $pconfig['max-src-nodes'] ?>"><br> Simultaneous client connection limit<p>
- <input name="max-src-states" id="max-src-states" value="<?php echo $pconfig['max-src-states'] ?>"><br> Maximum state entries per host<p>
- <input name="max-src-conn-rate" id="max-src-conn-rate" value="<?php echo $pconfig['max-src-conn-rate'] ?>"> /
- <select name="max-src-conn-rates" id="max-src-conn-rates">
- <option value=""<?php if(intval($pconfig['max-src-conn-rates']) < 1) echo " selected"; ?>></option>
-<?php for($x=1; $x<255; $x++) {
- if($x == $pconfig['max-src-conn-rates']) $selected = " selected"; else $selected = "";
- echo "<option value=\"{$x}\"{$selected}>{$x}</option>\n";
- } ?>
- </select><br />
- Maximum new connections / per second
- <p>
-
- <input name="statetimeout" value="<?php echo $pconfig['statetimeout'] ?>"><br>
- State Timeout in seconds
- <p />
-
- <p><strong>NOTE: Leave these fields blank to disable this feature.</strong>
- </div>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">State Type</td>
- <td width="78%" class="vtable">
- <div id="showadvstatebox">
- <input type="button" onClick="show_advanced_state()" value="Advanced"></input> - Show state</a>
- </div>
- <div id="showstateadv" style="display:none">
- <select name="statetype">
- <option value="keep state" <?php if(!isset($pconfig['statetype']) or $pconfig['statetype'] == "keep state") echo "selected"; ?>>keep state</option>
- <option value="modulate state" <?php if($pconfig['statetype'] == "modulate state") echo "selected"; ?>>modulate state</option>
- <option value="synproxy state"<?php if($pconfig['statetype'] == "synproxy state") echo "selected"; ?>>synproxy state</option>
- <option value="none"<?php if($pconfig['statetype'] == "none") echo "selected"; ?>>none</option>
- </select><br>HINT: Select which type of state tracking mechanism you would like to use. If in doubt, use keep state.
- <p>
- <table width="90%">
- <tr><td width="25%"><ul><li>keep state</li></td><td>Works with all IP protocols.</ul></td></tr>
- <tr><td width="25%"><ul><li>modulate state</li></td><td>Works only with TCP. pfSense will generate strong Initial Sequence Numbers (ISNs) for packets matching this rule.</li></ul></td></tr>
- <tr><td width="25%"><ul><li>synproxy state</li></td><td>Proxies incoming TCP connections to help protect servers from spoofed TCP SYN floods. This option includes the functionality of keep state and modulate state combined.</ul></td></tr>
- <tr><td width="25%"><ul><li>none</li></td><td>do not use state mechanisms to keep track. This is only useful if you're doing advanced queueing in certain situations. Please check the documentation.</ul></td></tr>
- </table>
- </p>
- </div>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">No XMLRPC Sync</td>
- <td width="78%" class="vtable">
- <input type="checkbox" name="nosync"<?php if($pconfig['nosync']) echo " CHECKED"; ?>><br>
- HINT: This prevents the rule from automatically syncing to other carp members.
- </td>
- </tr>
- <?php
- //build list of schedules
- $schedules = array();
- $schedules[] = "none";//leave none to leave rule enabled all the time
- if(is_array($config['schedules']['schedule'])) {
- foreach ($config['schedules']['schedule'] as $schedule) {
- if ($schedule['name'] <> "")
- $schedules[] = $schedule['name'];
- }
- }
- ?>
- <tr>
- <td width="22%" valign="top" class="vncell">Schedule</td>
- <td width="78%" class="vtable">
- <select name='sched'>
-<?php
- foreach($schedules as $schedule) {
- if($schedule == $pconfig['sched']) {
- $selected = " SELECTED";
- } else {
- $selected = "";
- }
- if ($schedule == "none") {
- echo "<option value=\"\" {$selected}>{$schedule}</option>\n";
- } else {
- echo "<option value=\"{$schedule}\" {$selected}>{$schedule}</option>\n";
- }
- }?>
- </select>
- <p>Leave as 'none' to leave the rule enabled all the time.</p>
- <strong>NOTE: schedule logic can be a bit different. Click <a target="_new" href='firewall_rules_schedule_logic.php'>here</a> for more information.</strong>
- </td>
- </tr>
-
-<?php
- /* build a list of gateways */
- $gateways = array();
- $gateways[] = "default"; // default to don't use this feature :)
- foreach($config['interfaces'] as $int) {
- if($int['gateway'] <> "")
- $gateways[]=$int['gateway'];
- }
-?>
- <tr>
- <td width="22%" valign="top" class="vncell">Gateway</td>
- <td width="78%" class="vtable">
- <select name='gateway'>
-<?php
- foreach($gateways as $gw) {
- if($gw == "")
- continue;
- if($gw == $pconfig['gateway']) {
- $selected = " SELECTED";
- } else {
- $selected = "";
- }
- if ($gw == "default") {
- echo "<option value=\"\" {$selected}>{$gw}</option>\n";
- } else {
- echo "<option value=\"{$gw}\" {$selected}>{$gw}</option>\n";
- }
- }
- if(is_array($config['load_balancer']['lbpool'])) {
- foreach($config['load_balancer']['lbpool'] as $lb) {
- if($lb['name'] == "")
- continue;
- if($pconfig['gateway'] == $lb['name']) {
- echo "<option value=\"{$lb['name']}\" SELECTED>{$lb['name']}</option>\n";
- } else {
- echo "<option value=\"{$lb['name']}\">{$lb['name']}</option>\n";
- }
- }
- }
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- if($config['interfaces']['opt' . $i]['ipaddr'] == "dhcp") {
- $descr = $config['interfaces']['opt' . $i]['descr'];
- if ($pconfig['gateway'] == "opt{$i}") {
- $selected = " SELECTED";
- } else {
- $selected = "";
- }
- if($descr <> "")
- echo "<option value=\"opt{$i}\" {$selected}>OPT{$i} - {$descr}</option>\n";
- }
- }
-?>
- </select>
- <p><strong>Leave as 'default' to use the system routing table. Or choose a gateway to utilize policy based routing.</strong></p>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Description</td>
- <td width="78%" class="vtable">
- <input name="descr" type="text" class="formfld" id="descr" size="52" maxlength="52" value="<?=htmlspecialchars($pconfig['descr']);?>">
- <br />
- <span class="vexpl">You may enter a description here for your reference (not parsed).</span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" class="formbtn" value="Cancel" onclick="history.back()">
-<?php if (isset($id) && $a_filter[$id]): ?>
- <input name="id" type="hidden" value="<?=$id;?>">
-<?php endif; ?>
- <input name="after" type="hidden" value="<?=$after;?>">
- </td>
- </tr>
- </table>
-</form>
-<script language="JavaScript">
-<!--
- ext_change();
- typesel_change();
- proto_change();
-
-<?php
- $isfirst = 0;
- $aliases = "";
- $addrisfirst = 0;
- $aliasesaddr = "";
- if($config['aliases']['alias'] <> "" and is_array($config['aliases']['alias']))
- foreach($config['aliases']['alias'] as $alias_name) {
- if(!stristr($alias_name['address'], ".")) {
- if($isfirst == 1) $aliases .= ",";
- $aliases .= "'" . $alias_name['name'] . "'";
- $isfirst = 1;
- } else {
- if($addrisfirst == 1) $aliasesaddr .= ",";
- $aliasesaddr .= "'" . $alias_name['name'] . "'";
- $addrisfirst = 1;
- }
- }
-?>
-
- var addressarray=new Array(<?php echo $aliasesaddr; ?>);
- var customarray=new Array(<?php echo $aliases; ?>);
-
-//-->
-</script>
-
-
-<?php include("fend.inc"); ?>
-</body>
-</html>
-
diff --git a/config/igmpproxy/igmpproxy.inc b/config/igmpproxy/igmpproxy.inc
deleted file mode 100644
index 4d0211b0..00000000
--- a/config/igmpproxy/igmpproxy.inc
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php
-/*
- igmpproxy.inc
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2009 Ermal Luçi
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-function igmpproxy_install() {
-
- if (file_exists("/tmp/firewall_rules_edit.tmp"))
- exec("/bin/cp /tmp/firewall_rules_edit.tmp /usr/local/www/firewall_rules_edit.php");
- if (file_exists("/tmp/filter.tmp"))
- exec("/bin/cp /tmp/filter.tmp /etc/inc/filter.inc");
-}
-
-function igmpproxy_resync() {
- global $config, $g;
-
- /* kill any running igmpproxy */
- killbyname("igmpproxy");
-
- $igmpconf = <<<EOD
-
-##------------------------------------------------------
-## Enable Quickleave mode (Sends Leave instantly)
-##------------------------------------------------------
-quickleave
-
-EOD;
-
- if (!is_array($config['installedpackages']['igmpproxy']['config']))
- return 0;
-
- $igmpcfg =& $config['installedpackages']['igmpproxy']['config'];
- foreach ($igmpcfg as $igmpcf) {
- $realif = convert_friendly_interface_to_real_interface_name($igmpcf['igmpname']);
- if (empty($igmpcf['igmpthreshold']))
- $threshld = 1;
- else
- $threshld = $igmpcf['igmpthreshold'];
- $igmpconf .= "phyint {$realif} {$igmpcf['igmptype']} ratelimit 0 threshold {$threshld}\n";
-
- if (is_array($igmpcf['row'])) {
- foreach ($igmpcf['row'] as $igmpaddr)
- $igmpconf .= "altnet {$igmpaddr['igmpnetaddr']}\n";
- }
- $igmpconf .= "\n";
- }
-
- $igmpfl = fopen($g['tmp_path'] . "/igmpproxy.conf", "w");
- if (!$igmpfl) {
- log_error("Could not write Igmpproxy configuration file!");
- return;
- }
- fwrite($igmpfl, $igmpconf);
- fclose($igmpfl);
-
- mwexec("/usr/local/sbin/igmpproxy -c " . $g['tmp_path'] . "/igmpproxy.conf");
- log_error("Started Igmpproxy service sucsesfully.");
-
- return 0;
-}
-
-?>
diff --git a/config/igmpproxy/igmpproxy.xml b/config/igmpproxy/igmpproxy.xml
deleted file mode 100644
index 2b531039..00000000
--- a/config/igmpproxy/igmpproxy.xml
+++ /dev/null
@@ -1,160 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- igmpproxy.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2009 Ermal Luci
- All rights reserved.
-
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <name>igmpproxy</name>
- <title>Services: IGMP proxy</title>
- <include_file>/usr/local/pkg/igmpproxy.inc</include_file>
- <menu>
- <name>IGMP proxy</name>
- <tooltiptext>Multicast proxy.</tooltiptext>
- <section>Services</section>
- <configfile>igmpproxy.xml</configfile>
- </menu>
- <service>
- <name>igmpproxy</name>
- <rcfile>igmpproxy.sh</rcfile>
- <executable>igmpproxy</executable>
- <description>IGMP(multicast) proxy.</description>
- </service>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/igmpproxy/igmpproxy.inc</item>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://files.pfsense.org/packages/igmpproxy</item>
- <prefix>/usr/local/sbin/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/igmpproxy/firewall_rules_edit.tmp</item>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/igmpproxy/filter.tmp</item>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/igmpproxy/igmpproxy.tbz</item>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <delete_string>An IGMP(multicast) proxy member has been deleted.</delete_string>
- <addedit_string>An IGMP(multicast) proxy member has been created/modified.</addedit_string>
- <adddeleteeditpagefields>
- <columnitem>
- <fieldname>igmpname</fieldname>
- <fielddescr>Name</fielddescr>
- </columnitem>
- <columnitem>
- <fieldname>igmptype</fieldname>
- <fielddescr>Type</fielddescr>
- </columnitem>
- <columnitem>
- <fieldname>description</fieldname>
- <fielddescr>Description</fielddescr>
- </columnitem>
- </adddeleteeditpagefields>
- <fields>
- <field>
- <fieldname>igmpname</fieldname>
- <fielddescr>Interface</fielddescr>
- <required/>
- <type>interfaces_selection</type>
- </field>
- <field>
- <fieldname>description</fieldname>
- <fielddescr>Description</fielddescr>
- <type>input</type>
- </field>
- <field>
- <fieldname>igmptype</fieldname>
- <fielddescr>Type</fielddescr>
- <description>The upstream network interface is the outgoing interface which is
- responsible for communicating to available multicast data sources.
- There can only be one upstream interface.
- Downstream network interfaces are the distribution interfaces to the
- destination networks, where multicast clients can join groups and
- receive multicast data. One or more downstream interfaces must be configured.</description>
- <required/>
- <type>select</type>
- <options>
- <option>
- <value>upstream</value>
- <name>Upstream Interface</name>
- </option>
- <option>
- <value>downstream</value>
- <name>Downstream Interface</name>
- </option>
- </options>
- <default_value>upstream</default_value>
- </field>
- <field>
- <fieldname>igmpthreshold</fieldname>
- <fielddescr>Threshold</fielddescr>
- <description>Defines the TTL threshold for the network interface. Packets
- with a lower TTL than the threshols value will be ignored. This
- setting is optional, and by default the threshold is 1.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Networks</fielddescr>
- <fieldname>none</fieldname>
- <type>rowhelper</type>
- <rowhelper>
- <rowhelperfield>
- <fielddescr>Network Address</fielddescr>
- <type>input</type>
- <size>25</size>
- <fieldname>igmpnetaddr</fieldname>
- </rowhelperfield>
- </rowhelper>
- </field>
- </fields>
- <custom_php_resync_config_command>
- igmpproxy_resync();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- igmpproxy_install();
- </custom_php_install_command>
-</packagegui>
diff --git a/config/ipblocklist/7/IP-Blocklist.sh b/config/ipblocklist/7/IP-Blocklist.sh
deleted file mode 100755
index 4591526b..00000000
--- a/config/ipblocklist/7/IP-Blocklist.sh
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/bin/sh
-
-#check if ipblocklist running
-export resultr=`pfctl -s rules | grep -c ipblocklist`
-
-#echo $resultr
-if [ "$resultr" -gt "0" ]; then
- echo running
- exit 1
-else
- echo not running
- /usr/bin/logger -s "IP-Blocklist was found not running"
- #echo "IP-Blocklist not running" | /usr/local/bin/php /usr/local/www/packages/ipblocklist/email_send.php
-fi
-
-
-##kill tables to elminate dups
-/sbin/pfctl -t ipblocklist -T kill
-/sbin/pfctl -t ipblocklistW -T kill
-/usr/bin/sed -i -e '/ipblocklist/d' /tmp/rules.debug
-/usr/bin/sed -i -e '/ipblocklistW/d' /tmp/rules.debug
-
-##Generate lists to process
-#ls /usr/local/www/packages/ipblocklist/lists > /usr/local/www/packages/ipblocklist/file_list.txt
-#ls /usr/local/www/packages/ipblocklist/Wlists > /usr/local/www/packages/ipblocklist/file_Wlist.txt
-filelist="/usr/local/www/packages/ipblocklist/file_list.txt"
-Wfilelist="/usr/local/www/packages/ipblocklist/file_Wlist.txt"
-
-##READ contents in file_list.txt and process as file
-#for fileline in $(cat $filelist); do
-#iplist="/usr/local/www/packages/ipblocklist/lists/$fileline"
-#iplistout="/usr/local/www/packages/ipblocklist/lists/ipfw.ipfw"
-##sleep 5
-##echo "file name: "
-##echo $iplist
-##sleep 5
-#if [ "$iplist" != "/usr/local/www/packages/ipblocklist/lists/ipfw.ipfw" ]; then
-# #/usr/bin/perl /usr/local/www/packages/ipblocklist/convert.pl $iplist $iplistout
-# #echo "THIS JUST RAN"
-#fi
-##sleep 5
-#done
-
-#Whitelist
-#for Wfileline in $(cat $Wfilelist); do
-#Wiplist="/usr/local/www/packages/ipblocklist/Wlists/$Wfileline"
-#Wiplistout="/usr/local/www/packages/ipblocklist/Wlists/whitelist"
-#/usr/bin/perl /usr/local/www/packages/ipblocklist/convert.pl $Wiplist $Wiplistout
-#done
-#echo "ipfw made"
-
-##clean up ipfw.ipfw (duplicates)
-#rm /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP
-#/usr/bin/sort /usr/local/www/packages/ipblocklist/lists/ipfw.ipfw | uniq >> /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP
-#mv /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP /usr/local/www/packages/ipblocklist/lists/ipfw.ipfw
-##echo "ipfw clean"
-
-##clean up whitelist (duplicates)
-#rm /usr/local/www/packages/ipblocklist/Wlists/whitelistTEMP
-#/usr/bin/sort Wlists/whitelist | uniq >> /usr/local/www/packages/ipblocklist/Wlists/whitelistTEMP
-#mv /usr/local/www/packages/ipblocklist/Wlists/whitelistTEMP /usr/local/www/packages/ipblocklist/Wlists/whitelist
-##echo "whitelist clean"
-
-
-
-##Now edit /tmp/rules.debug
-
-##find my line for table
-export i=`grep -n 'block quick from any to <snort2c>' /tmp/rules.debug | grep -o '[0-9]\{2,4\}'`
-export t=`grep -n 'User Aliases' /tmp/rules.debug |grep -o '[0-9]\{1,2\}'`
-
-i=$(($i+'1'))
-t=$(($t+'1'))
-#echo $i
-#echo $t
-
-rm /tmp/rules.debug.tmp
-
-#Insert table-entry limit
-/usr/bin/sed -i -e '/900000/d' /tmp/rules.debug
-while read line
- do a=$(($a+1));
- #echo $a;
- if [ "$a" = "$t" ]; then
- echo "" >> /tmp/rules.debug.tmp
- echo "set limit table-entries 900000" >> /tmp/rules.debug.tmp
- fi
- echo $line >> /tmp/rules.debug.tmp
-done < "/tmp/rules.debug"
-
-mv /tmp/rules.debug /tmp/rules.debug.old
-mv /tmp/rules.debug.tmp /tmp/rules.debug
-
-/sbin/pfctl -o basic -f /tmp/rules.debug > /usr/local/www/packages/ipblocklist/errorOUT.txt 2>&1
-
-rm /tmp/rules.debug.tmp
-#Insert ipblocklist rules
-a="0"
-echo $a
-while read line
- do a=$(($a+1));
- echo $a;
- if [ "$a" = "$i" ]; then
- echo "" >> /tmp/rules.debug.tmp
- echo "#ipblocklist" >> /tmp/rules.debug.tmp
- echo "table <ipblocklist> persist file '/usr/local/www/packages/ipblocklist/lists/ipfw.ipfw'" >> /tmp/rules.debug.tmp
- echo "table <ipblocklistW> persist file '/usr/local/www/packages/ipblocklist/Wlists/whitelist'" >> /tmp/rules.debug.tmp
-
- for i in $(cat /usr/local/www/packages/ipblocklist/interfaces.txt); do
- echo "pass quick from <ipblocklistW> to any label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- echo "pass quick from $i to <ipblocklistW> label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- if [ -f /usr/local/www/packages/ipblocklist/logging ]; then
- echo "block log quick from <ipblocklist> to $i label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- else
- echo "block quick from <ipblocklist> to $i label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- fi
- if [ -f /usr/local/www/packages/ipblocklist/OUTBOUND ]; then
- echo "block quick from $i to <ipblocklist> label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- fi
- done
- fi
- echo $line >> /tmp/rules.debug.tmp
-done < "/tmp/rules.debug"
-
-mv /tmp/rules.debug /tmp/rules.debug.old
-mv /tmp/rules.debug.tmp /tmp/rules.debug
-
-#Now execute the ipfw list (Take a long time in old version)
-#sh lists/ipfw.ipfw (Version 0.1.4)
-rm /usr/local/www/packages/ipblocklist/errorOUT.txt
-/sbin/pfctl -o basic -f /tmp/rules.debug > /usr/local/www/packages/ipblocklist/errorOUT.txt 2>&1
diff --git a/config/ipblocklist/7/OUTBOUND b/config/ipblocklist/7/OUTBOUND
deleted file mode 100755
index e69de29b..00000000
--- a/config/ipblocklist/7/OUTBOUND
+++ /dev/null
diff --git a/config/ipblocklist/7/class.phpmailer.tmp b/config/ipblocklist/7/class.phpmailer.tmp
deleted file mode 100755
index a4756c52..00000000
--- a/config/ipblocklist/7/class.phpmailer.tmp
+++ /dev/null
@@ -1,1909 +0,0 @@
-<?php
-/*~ class.phpmailer.php
-.---------------------------------------------------------------------------.
-| Software: PHPMailer - PHP email class |
-| Version: 2.0.4 |
-| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
-| Info: http://phpmailer.sourceforge.net |
-| Support: http://sourceforge.net/projects/phpmailer/ |
-| ------------------------------------------------------------------------- |
-| Author: Andy Prevost (project admininistrator) |
-| Author: Brent R. Matzelle (original founder) |
-| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
-| Copyright (c) 2001-2003, Brent R. Matzelle |
-| ------------------------------------------------------------------------- |
-| License: Distributed under the Lesser General Public License (LGPL) |
-| http://www.gnu.org/copyleft/lesser.html |
-| This program is distributed in the hope that it will be useful - WITHOUT |
-| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
-| FITNESS FOR A PARTICULAR PURPOSE. |
-| ------------------------------------------------------------------------- |
-| We offer a number of paid services (www.codeworxtech.com): |
-| - Web Hosting on highly optimized fast and secure servers |
-| - Technology Consulting |
-| - Oursourcing (highly qualified programmers and graphic designers) |
-'---------------------------------------------------------------------------'
-
-/**
- * PHPMailer - PHP email transport class
- * @package PHPMailer
- * @author Andy Prevost
- * @copyright 2004 - 2009 Andy Prevost
- */
-
-class PHPMailer {
-
- /////////////////////////////////////////////////
- // PROPERTIES, PUBLIC
- /////////////////////////////////////////////////
-
- /**
- * Email priority (1 = High, 3 = Normal, 5 = low).
- * @var int
- */
- var $Priority = 3;
-
- /**
- * Sets the CharSet of the message.
- * @var string
- */
- var $CharSet = 'iso-8859-1';
-
- /**
- * Sets the Content-type of the message.
- * @var string
- */
- var $ContentType = 'text/plain';
-
- /**
- * Sets the Encoding of the message. Options for this are "8bit",
- * "7bit", "binary", "base64", and "quoted-printable".
- * @var string
- */
- var $Encoding = '8bit';
-
- /**
- * Holds the most recent mailer error message.
- * @var string
- */
- var $ErrorInfo = '';
-
- /**
- * Sets the From email address for the message.
- * @var string
- */
- var $From = 'root@localhost';
-
- /**
- * Sets the From name of the message.
- * @var string
- */
- var $FromName = 'Root User';
-
- /**
- * Sets the Sender email (Return-Path) of the message. If not empty,
- * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
- * @var string
- */
- var $Sender = '';
-
- /**
- * Sets the Subject of the message.
- * @var string
- */
- var $Subject = '';
-
- /**
- * Sets the Body of the message. This can be either an HTML or text body.
- * If HTML then run IsHTML(true).
- * @var string
- */
- var $Body = '';
-
- /**
- * Sets the text-only body of the message. This automatically sets the
- * email to multipart/alternative. This body can be read by mail
- * clients that do not have HTML email capability such as mutt. Clients
- * that can read HTML will view the normal Body.
- * @var string
- */
- var $AltBody = '';
-
- /**
- * Sets word wrapping on the body of the message to a given number of
- * characters.
- * @var int
- */
- var $WordWrap = 0;
-
- /**
- * Method to send mail: ("mail", "sendmail", or "smtp").
- * @var string
- */
- var $Mailer = 'mail';
-
- /**
- * Sets the path of the sendmail program.
- * @var string
- */
- var $Sendmail = '/usr/sbin/sendmail';
-
- /**
- * Path to PHPMailer plugins. This is now only useful if the SMTP class
- * is in a different directory than the PHP include path.
- * @var string
- */
- var $PluginDir = '';
-
- /**
- * Holds PHPMailer version.
- * @var string
- */
- var $Version = "2.0.4";
-
- /**
- * Sets the email address that a reading confirmation will be sent.
- * @var string
- */
- var $ConfirmReadingTo = '';
-
- /**
- * Sets the hostname to use in Message-Id and Received headers
- * and as default HELO string. If empty, the value returned
- * by SERVER_NAME is used or 'localhost.localdomain'.
- * @var string
- */
- var $Hostname = '';
-
- /**
- * Sets the message ID to be used in the Message-Id header.
- * If empty, a unique id will be generated.
- * @var string
- */
- var $MessageID = '';
-
- /////////////////////////////////////////////////
- // PROPERTIES FOR SMTP
- /////////////////////////////////////////////////
-
- /**
- * Sets the SMTP hosts. All hosts must be separated by a
- * semicolon. You can also specify a different port
- * for each host by using this format: [hostname:port]
- * (e.g. "smtp1.example.com:25;smtp2.example.com").
- * Hosts will be tried in order.
- * @var string
- */
- var $Host = 'localhost';
-
- /**
- * Sets the default SMTP server port.
- * @var int
- */
- var $Port = 25;
-
- /**
- * Sets the SMTP HELO of the message (Default is $Hostname).
- * @var string
- */
- var $Helo = '';
-
- /**
- * Sets connection prefix.
- * Options are "", "ssl" or "tls"
- * @var string
- */
- var $SMTPSecure = "";
-
- /**
- * Sets SMTP authentication. Utilizes the Username and Password variables.
- * @var bool
- */
- var $SMTPAuth = false;
-
- /**
- * Sets SMTP username.
- * @var string
- */
- var $Username = '';
-
- /**
- * Sets SMTP password.
- * @var string
- */
- var $Password = '';
-
- /**
- * Sets the SMTP server timeout in seconds. This function will not
- * work with the win32 version.
- * @var int
- */
- var $Timeout = 10;
-
- /**
- * Sets SMTP class debugging on or off.
- * @var bool
- */
- var $SMTPDebug = false;
-
- /**
- * Prevents the SMTP connection from being closed after each mail
- * sending. If this is set to true then to close the connection
- * requires an explicit call to SmtpClose().
- * @var bool
- */
- var $SMTPKeepAlive = false;
-
- /**
- * Provides the ability to have the TO field process individual
- * emails, instead of sending to entire TO addresses
- * @var bool
- */
- var $SingleTo = false;
-
- /////////////////////////////////////////////////
- // PROPERTIES, PRIVATE
- /////////////////////////////////////////////////
-
- var $smtp = NULL;
- var $to = array();
- var $cc = array();
- var $bcc = array();
- var $ReplyTo = array();
- var $attachment = array();
- var $CustomHeader = array();
- var $message_type = '';
- var $boundary = array();
- var $language = array();
- var $error_count = 0;
- var $LE = "\n";
- var $sign_cert_file = "";
- var $sign_key_file = "";
- var $sign_key_pass = "";
-
- /////////////////////////////////////////////////
- // METHODS, VARIABLES
- /////////////////////////////////////////////////
-
- /**
- * Sets message type to HTML.
- * @param bool $bool
- * @return void
- */
- function IsHTML($bool) {
- if($bool == true) {
- $this->ContentType = 'text/html';
- } else {
- $this->ContentType = 'text/plain';
- }
- }
-
- /**
- * Sets Mailer to send message using SMTP.
- * @return void
- */
- function IsSMTP() {
- $this->Mailer = 'smtp';
- }
-
- /**
- * Sets Mailer to send message using PHP mail() function.
- * @return void
- */
- function IsMail() {
- $this->Mailer = 'mail';
- }
-
- /**
- * Sets Mailer to send message using the $Sendmail program.
- * @return void
- */
- function IsSendmail() {
- $this->Mailer = 'sendmail';
- }
-
- /**
- * Sets Mailer to send message using the qmail MTA.
- * @return void
- */
- function IsQmail() {
- $this->Sendmail = '/var/qmail/bin/sendmail';
- $this->Mailer = 'sendmail';
- }
-
- /////////////////////////////////////////////////
- // METHODS, RECIPIENTS
- /////////////////////////////////////////////////
-
- /**
- * Adds a "To" address.
- * @param string $address
- * @param string $name
- * @return void
- */
- function AddAddress($address, $name = '') {
- $cur = count($this->to);
- $this->to[$cur][0] = trim($address);
- $this->to[$cur][1] = $name;
- }
-
- /**
- * Adds a "Cc" address. Note: this function works
- * with the SMTP mailer on win32, not with the "mail"
- * mailer.
- * @param string $address
- * @param string $name
- * @return void
- */
- function AddCC($address, $name = '') {
- $cur = count($this->cc);
- $this->cc[$cur][0] = trim($address);
- $this->cc[$cur][1] = $name;
- }
-
- /**
- * Adds a "Bcc" address. Note: this function works
- * with the SMTP mailer on win32, not with the "mail"
- * mailer.
- * @param string $address
- * @param string $name
- * @return void
- */
- function AddBCC($address, $name = '') {
- $cur = count($this->bcc);
- $this->bcc[$cur][0] = trim($address);
- $this->bcc[$cur][1] = $name;
- }
-
- /**
- * Adds a "Reply-To" address.
- * @param string $address
- * @param string $name
- * @return void
- */
- function AddReplyTo($address, $name = '') {
- $cur = count($this->ReplyTo);
- $this->ReplyTo[$cur][0] = trim($address);
- $this->ReplyTo[$cur][1] = $name;
- }
-
- /////////////////////////////////////////////////
- // METHODS, MAIL SENDING
- /////////////////////////////////////////////////
-
- /**
- * Creates message and assigns Mailer. If the message is
- * not sent successfully then it returns false. Use the ErrorInfo
- * variable to view description of the error.
- * @return bool
- */
- function Send() {
- $header = '';
- $body = '';
- $result = true;
-
- if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
- $this->SetError($this->Lang('provide_address'));
- return false;
- }
-
- /* Set whether the message is multipart/alternative */
- if(!empty($this->AltBody)) {
- $this->ContentType = 'multipart/alternative';
- }
-
- $this->error_count = 0; // reset errors
- $this->SetMessageType();
- $header .= $this->CreateHeader();
- $body = $this->CreateBody();
-
- if($body == '') {
- return false;
- }
-
- /* Choose the mailer */
- switch($this->Mailer) {
- case 'sendmail':
- $result = $this->SendmailSend($header, $body);
- break;
- case 'smtp':
- $result = $this->SmtpSend($header, $body);
- break;
- case 'mail':
- $result = $this->MailSend($header, $body);
- break;
- default:
- $result = $this->MailSend($header, $body);
- break;
- //$this->SetError($this->Mailer . $this->Lang('mailer_not_supported'));
- //$result = false;
- //break;
- }
-
- return $result;
- }
-
- /**
- * Sends mail using the $Sendmail program.
- * @access private
- * @return bool
- */
- function SendmailSend($header, $body) {
- if ($this->Sender != '') {
- $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
- } else {
- $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail));
- }
-
- if(!@$mail = popen($sendmail, 'w')) {
- $this->SetError($this->Lang('execute') . $this->Sendmail);
- return false;
- }
-
- fputs($mail, $header);
- fputs($mail, $body);
-
- $result = pclose($mail);
- if (version_compare(phpversion(), '4.2.3') == -1) {
- $result = $result >> 8 & 0xFF;
- }
- if($result != 0) {
- $this->SetError($this->Lang('execute') . $this->Sendmail);
- return false;
- }
- return true;
- }
-
- /**
- * Sends mail using the PHP mail() function.
- * @access private
- * @return bool
- */
- function MailSend($header, $body) {
-
- $to = '';
- for($i = 0; $i < count($this->to); $i++) {
- if($i != 0) { $to .= ', '; }
- $to .= $this->AddrFormat($this->to[$i]);
- }
-
- $toArr = split(',', $to);
-
- $params = sprintf("-oi -f %s", $this->Sender);
- if ($this->Sender != '' && strlen(ini_get('safe_mode')) < 1) {
- $old_from = ini_get('sendmail_from');
- ini_set('sendmail_from', $this->Sender);
- if ($this->SingleTo === true && count($toArr) > 1) {
- foreach ($toArr as $key => $val) {
- $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
- }
- } else {
- $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
- }
- } else {
- if ($this->SingleTo === true && count($toArr) > 1) {
- foreach ($toArr as $key => $val) {
- $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
- }
- } else {
- $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
- }
- }
-
- if (isset($old_from)) {
- ini_set('sendmail_from', $old_from);
- }
-
- if(!$rt) {
- $this->SetError($this->Lang('instantiate'));
- return false;
- }
-
- return true;
- }
-
- /**
- * Sends mail via SMTP using PhpSMTP (Author:
- * Chris Ryan). Returns bool. Returns false if there is a
- * bad MAIL FROM, RCPT, or DATA input.
- * @access private
- * @return bool
- */
- function SmtpSend($header, $body) {
- include_once($this->PluginDir . 'class.smtp.php');
- $error = '';
- $bad_rcpt = array();
-
- if(!$this->SmtpConnect()) {
- return false;
- }
-
- $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
- if(!$this->smtp->Mail($smtp_from)) {
- $error = $this->Lang('from_failed') . $smtp_from;
- $this->SetError($error);
- $this->smtp->Reset();
- return false;
- }
-
- /* Attempt to send attach all recipients */
- for($i = 0; $i < count($this->to); $i++) {
- if(!$this->smtp->Recipient($this->to[$i][0])) {
- $bad_rcpt[] = $this->to[$i][0];
- }
- }
- for($i = 0; $i < count($this->cc); $i++) {
- if(!$this->smtp->Recipient($this->cc[$i][0])) {
- $bad_rcpt[] = $this->cc[$i][0];
- }
- }
- for($i = 0; $i < count($this->bcc); $i++) {
- if(!$this->smtp->Recipient($this->bcc[$i][0])) {
- $bad_rcpt[] = $this->bcc[$i][0];
- }
- }
-
- if(count($bad_rcpt) > 0) { // Create error message
- for($i = 0; $i < count($bad_rcpt); $i++) {
- if($i != 0) {
- $error .= ', ';
- }
- $error .= $bad_rcpt[$i];
- }
- $error = $this->Lang('recipients_failed') . $error;
- $this->SetError($error);
- $this->smtp->Reset();
- return false;
- }
-
- if(!$this->smtp->Data($header . $body)) {
- $this->SetError($this->Lang('data_not_accepted'));
- $this->smtp->Reset();
- return false;
- }
- if($this->SMTPKeepAlive == true) {
- $this->smtp->Reset();
- } else {
- $this->SmtpClose();
- }
-
- return true;
- }
-
- /**
- * Initiates a connection to an SMTP server. Returns false if the
- * operation failed.
- * @access private
- * @return bool
- */
- function SmtpConnect() {
- if($this->smtp == NULL) {
- $this->smtp = new SMTP();
- }
-
- $this->smtp->do_debug = $this->SMTPDebug;
- $hosts = explode(';', $this->Host);
- $index = 0;
- $connection = ($this->smtp->Connected());
-
- /* Retry while there is no connection */
- while($index < count($hosts) && $connection == false) {
- $hostinfo = array();
- if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
- $host = $hostinfo[1];
- $port = $hostinfo[2];
- } else {
- $host = $hosts[$index];
- $port = $this->Port;
- }
-
- if($this->smtp->Connect(((!empty($this->SMTPSecure))?$this->SMTPSecure.'://':'').$host, $port, $this->Timeout)) {
- if ($this->Helo != '') {
- $this->smtp->Hello($this->Helo);
- } else {
- $this->smtp->Hello($this->ServerHostname());
- }
-
- $connection = true;
- if($this->SMTPAuth) {
- if(!$this->smtp->Authenticate($this->Username, $this->Password)) {
- $this->SetError($this->Lang('authenticate'));
- $this->smtp->Reset();
- $connection = false;
- }
- }
- }
- $index++;
- }
- if(!$connection) {
- $this->SetError($this->Lang('connect_host'));
- }
-
- return $connection;
- }
-
- /**
- * Closes the active SMTP session if one exists.
- * @return void
- */
- function SmtpClose() {
- if($this->smtp != NULL) {
- if($this->smtp->Connected()) {
- $this->smtp->Quit();
- $this->smtp->Close();
- }
- }
- }
-
- /**
- * Sets the language for all class error messages. Returns false
- * if it cannot load the language file. The default language type
- * is English.
- * @param string $lang_type Type of language (e.g. Portuguese: "br")
- * @param string $lang_path Path to the language file directory
- * @access public
- * @return bool
- */
- function SetLanguage($lang_type, $lang_path = 'language/') {
- if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php')) {
- include($lang_path.'phpmailer.lang-'.$lang_type.'.php');
- } elseif (file_exists($lang_path.'phpmailer.lang-en.php')) {
- include($lang_path.'phpmailer.lang-en.php');
- } else {
- $PHPMAILER_LANG = array();
- $PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' .
- $PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';
- $PHPMAILER_LANG["execute"] = 'Could not execute: ';
- $PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.';
- $PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.';
- $PHPMAILER_LANG["from_failed"] = 'The following From address failed: ';
- $PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' .
- $PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.';
- $PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.';
- $PHPMAILER_LANG["file_access"] = 'Could not access file: ';
- $PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: ';
- $PHPMAILER_LANG["encoding"] = 'Unknown encoding: ';
- $PHPMAILER_LANG["signing"] = 'Signing Error: ';
- }
- $this->language = $PHPMAILER_LANG;
-
- return true;
- }
-
- /////////////////////////////////////////////////
- // METHODS, MESSAGE CREATION
- /////////////////////////////////////////////////
-
- /**
- * Creates recipient headers.
- * @access private
- * @return string
- */
- function AddrAppend($type, $addr) {
- $addr_str = $type . ': ';
- $addr_str .= $this->AddrFormat($addr[0]);
- if(count($addr) > 1) {
- for($i = 1; $i < count($addr); $i++) {
- $addr_str .= ', ' . $this->AddrFormat($addr[$i]);
- }
- }
- $addr_str .= $this->LE;
-
- return $addr_str;
- }
-
- /**
- * Formats an address correctly.
- * @access private
- * @return string
- */
- function AddrFormat($addr) {
- if(empty($addr[1])) {
- $formatted = $this->SecureHeader($addr[0]);
- } else {
- $formatted = $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">";
- }
-
- return $formatted;
- }
-
- /**
- * Wraps message for use with mailers that do not
- * automatically perform wrapping and for quoted-printable.
- * Original written by philippe.
- * @access private
- * @return string
- */
- function WrapText($message, $length, $qp_mode = false) {
- $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
- // If utf-8 encoding is used, we will need to make sure we don't
- // split multibyte characters when we wrap
- $is_utf8 = (strtolower($this->CharSet) == "utf-8");
-
- $message = $this->FixEOL($message);
- if (substr($message, -1) == $this->LE) {
- $message = substr($message, 0, -1);
- }
-
- $line = explode($this->LE, $message);
- $message = '';
- for ($i=0 ;$i < count($line); $i++) {
- $line_part = explode(' ', $line[$i]);
- $buf = '';
- for ($e = 0; $e<count($line_part); $e++) {
- $word = $line_part[$e];
- if ($qp_mode and (strlen($word) > $length)) {
- $space_left = $length - strlen($buf) - 1;
- if ($e != 0) {
- if ($space_left > 20) {
- $len = $space_left;
- if ($is_utf8) {
- $len = $this->UTF8CharBoundary($word, $len);
- } elseif (substr($word, $len - 1, 1) == "=") {
- $len--;
- } elseif (substr($word, $len - 2, 1) == "=") {
- $len -= 2;
- }
- $part = substr($word, 0, $len);
- $word = substr($word, $len);
- $buf .= ' ' . $part;
- $message .= $buf . sprintf("=%s", $this->LE);
- } else {
- $message .= $buf . $soft_break;
- }
- $buf = '';
- }
- while (strlen($word) > 0) {
- $len = $length;
- if ($is_utf8) {
- $len = $this->UTF8CharBoundary($word, $len);
- } elseif (substr($word, $len - 1, 1) == "=") {
- $len--;
- } elseif (substr($word, $len - 2, 1) == "=") {
- $len -= 2;
- }
- $part = substr($word, 0, $len);
- $word = substr($word, $len);
-
- if (strlen($word) > 0) {
- $message .= $part . sprintf("=%s", $this->LE);
- } else {
- $buf = $part;
- }
- }
- } else {
- $buf_o = $buf;
- $buf .= ($e == 0) ? $word : (' ' . $word);
-
- if (strlen($buf) > $length and $buf_o != '') {
- $message .= $buf_o . $soft_break;
- $buf = $word;
- }
- }
- }
- $message .= $buf . $this->LE;
- }
-
- return $message;
- }
-
- /**
- * Finds last character boundary prior to maxLength in a utf-8
- * quoted (printable) encoded string.
- * Original written by Colin Brown.
- * @access private
- * @param string $encodedText utf-8 QP text
- * @param int $maxLength find last character boundary prior to this length
- * @return int
- */
- function UTF8CharBoundary($encodedText, $maxLength) {
- $foundSplitPos = false;
- $lookBack = 3;
- while (!$foundSplitPos) {
- $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
- $encodedCharPos = strpos($lastChunk, "=");
- if ($encodedCharPos !== false) {
- // Found start of encoded character byte within $lookBack block.
- // Check the encoded byte value (the 2 chars after the '=')
- $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
- $dec = hexdec($hex);
- if ($dec < 128) { // Single byte character.
- // If the encoded char was found at pos 0, it will fit
- // otherwise reduce maxLength to start of the encoded char
- $maxLength = ($encodedCharPos == 0) ? $maxLength :
- $maxLength - ($lookBack - $encodedCharPos);
- $foundSplitPos = true;
- } elseif ($dec >= 192) { // First byte of a multi byte character
- // Reduce maxLength to split at start of character
- $maxLength = $maxLength - ($lookBack - $encodedCharPos);
- $foundSplitPos = true;
- } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back
- $lookBack += 3;
- }
- } else {
- // No encoded character found
- $foundSplitPos = true;
- }
- }
- return $maxLength;
- }
-
- /**
- * Set the body wrapping.
- * @access private
- * @return void
- */
- function SetWordWrap() {
- if($this->WordWrap < 1) {
- return;
- }
-
- switch($this->message_type) {
- case 'alt':
- /* fall through */
- case 'alt_attachments':
- $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap);
- break;
- default:
- $this->Body = $this->WrapText($this->Body, $this->WordWrap);
- break;
- }
- }
-
- /**
- * Assembles message header.
- * @access private
- * @return string
- */
- function CreateHeader() {
- $result = '';
-
- /* Set the boundaries */
- $uniq_id = md5(uniqid(time()));
- $this->boundary[1] = 'b1_' . $uniq_id;
- $this->boundary[2] = 'b2_' . $uniq_id;
-
- $result .= $this->HeaderLine('Date', $this->RFCDate());
- if($this->Sender == '') {
- $result .= $this->HeaderLine('Return-Path', trim($this->From));
- } else {
- $result .= $this->HeaderLine('Return-Path', trim($this->Sender));
- }
-
- /* To be created automatically by mail() */
- if($this->Mailer != 'mail') {
- if(count($this->to) > 0) {
- $result .= $this->AddrAppend('To', $this->to);
- } elseif (count($this->cc) == 0) {
- $result .= $this->HeaderLine('To', 'undisclosed-recipients:;');
- }
- }
-
- $from = array();
- $from[0][0] = trim($this->From);
- $from[0][1] = $this->FromName;
- $result .= $this->AddrAppend('From', $from);
-
- /* sendmail and mail() extract Cc from the header before sending */
- if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->cc) > 0)) {
- $result .= $this->AddrAppend('Cc', $this->cc);
- }
-
- /* sendmail and mail() extract Bcc from the header before sending */
- if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) {
- $result .= $this->AddrAppend('Bcc', $this->bcc);
- }
-
- if(count($this->ReplyTo) > 0) {
- $result .= $this->AddrAppend('Reply-To', $this->ReplyTo);
- }
-
- /* mail() sets the subject itself */
- if($this->Mailer != 'mail') {
- $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject)));
- }
-
- if($this->MessageID != '') {
- $result .= $this->HeaderLine('Message-ID',$this->MessageID);
- } else {
- $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
- }
- $result .= $this->HeaderLine('X-Priority', $this->Priority);
- $result .= $this->HeaderLine('X-Mailer', 'PHPMailer (phpmailer.sourceforge.net) [version ' . $this->Version . ']');
-
- if($this->ConfirmReadingTo != '') {
- $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
- }
-
- // Add custom headers
- for($index = 0; $index < count($this->CustomHeader); $index++) {
- $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
- }
- if (!$this->sign_key_file) {
- $result .= $this->HeaderLine('MIME-Version', '1.0');
- $result .= $this->GetMailMIME();
- }
-
- return $result;
- }
-
- /**
- * Returns the message MIME.
- * @access private
- * @return string
- */
- function GetMailMIME() {
- $result = '';
- switch($this->message_type) {
- case 'plain':
- $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding);
- $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet);
- break;
- case 'attachments':
- /* fall through */
- case 'alt_attachments':
- if($this->InlineImageExists()){
- $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE);
- } else {
- $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;');
- $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
- }
- break;
- case 'alt':
- $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;');
- $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
- break;
- }
-
- if($this->Mailer != 'mail') {
- $result .= $this->LE.$this->LE;
- }
-
- return $result;
- }
-
- /**
- * Assembles the message body. Returns an empty string on failure.
- * @access private
- * @return string
- */
- function CreateBody() {
- $result = '';
- if ($this->sign_key_file) {
- $result .= $this->GetMailMIME();
- }
-
- $this->SetWordWrap();
-
- switch($this->message_type) {
- case 'alt':
- $result .= $this->GetBoundary($this->boundary[1], '', 'text/plain', '');
- $result .= $this->EncodeString($this->AltBody, $this->Encoding);
- $result .= $this->LE.$this->LE;
- $result .= $this->GetBoundary($this->boundary[1], '', 'text/html', '');
- $result .= $this->EncodeString($this->Body, $this->Encoding);
- $result .= $this->LE.$this->LE;
- $result .= $this->EndBoundary($this->boundary[1]);
- break;
- case 'plain':
- $result .= $this->EncodeString($this->Body, $this->Encoding);
- break;
- case 'attachments':
- $result .= $this->GetBoundary($this->boundary[1], '', '', '');
- $result .= $this->EncodeString($this->Body, $this->Encoding);
- $result .= $this->LE;
- $result .= $this->AttachAll();
- break;
- case 'alt_attachments':
- $result .= sprintf("--%s%s", $this->boundary[1], $this->LE);
- $result .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE);
- $result .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body
- $result .= $this->EncodeString($this->AltBody, $this->Encoding);
- $result .= $this->LE.$this->LE;
- $result .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body
- $result .= $this->EncodeString($this->Body, $this->Encoding);
- $result .= $this->LE.$this->LE;
- $result .= $this->EndBoundary($this->boundary[2]);
- $result .= $this->AttachAll();
- break;
- }
-
- if($this->IsError()) {
- $result = '';
- } else if ($this->sign_key_file) {
- $file = tempnam("", "mail");
- $fp = fopen($file, "w");
- fwrite($fp, $result);
- fclose($fp);
- $signed = tempnam("", "signed");
-
- if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), null)) {
- $fp = fopen($signed, "r");
- $result = fread($fp, filesize($this->sign_key_file));
- $result = '';
- while(!feof($fp)){
- $result = $result . fread($fp, 1024);
- }
- fclose($fp);
- } else {
- $this->SetError($this->Lang("signing").openssl_error_string());
- $result = '';
- }
-
- unlink($file);
- unlink($signed);
- }
-
- return $result;
- }
-
- /**
- * Returns the start of a message boundary.
- * @access private
- */
- function GetBoundary($boundary, $charSet, $contentType, $encoding) {
- $result = '';
- if($charSet == '') {
- $charSet = $this->CharSet;
- }
- if($contentType == '') {
- $contentType = $this->ContentType;
- }
- if($encoding == '') {
- $encoding = $this->Encoding;
- }
- $result .= $this->TextLine('--' . $boundary);
- $result .= sprintf("Content-Type: %s; charset = \"%s\"", $contentType, $charSet);
- $result .= $this->LE;
- $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding);
- $result .= $this->LE;
-
- return $result;
- }
-
- /**
- * Returns the end of a message boundary.
- * @access private
- */
- function EndBoundary($boundary) {
- return $this->LE . '--' . $boundary . '--' . $this->LE;
- }
-
- /**
- * Sets the message type.
- * @access private
- * @return void
- */
- function SetMessageType() {
- if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) {
- $this->message_type = 'plain';
- } else {
- if(count($this->attachment) > 0) {
- $this->message_type = 'attachments';
- }
- if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) {
- $this->message_type = 'alt';
- }
- if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) {
- $this->message_type = 'alt_attachments';
- }
- }
- }
-
- /* Returns a formatted header line.
- * @access private
- * @return string
- */
- function HeaderLine($name, $value) {
- return $name . ': ' . $value . $this->LE;
- }
-
- /**
- * Returns a formatted mail line.
- * @access private
- * @return string
- */
- function TextLine($value) {
- return $value . $this->LE;
- }
-
- /////////////////////////////////////////////////
- // CLASS METHODS, ATTACHMENTS
- /////////////////////////////////////////////////
-
- /**
- * Adds an attachment from a path on the filesystem.
- * Returns false if the file could not be found
- * or accessed.
- * @param string $path Path to the attachment.
- * @param string $name Overrides the attachment name.
- * @param string $encoding File encoding (see $Encoding).
- * @param string $type File extension (MIME) type.
- * @return bool
- */
- function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
- if(!@is_file($path)) {
- $this->SetError($this->Lang('file_access') . $path);
- return false;
- }
-
- $filename = basename($path);
- if($name == '') {
- $name = $filename;
- }
-
- $cur = count($this->attachment);
- $this->attachment[$cur][0] = $path;
- $this->attachment[$cur][1] = $filename;
- $this->attachment[$cur][2] = $name;
- $this->attachment[$cur][3] = $encoding;
- $this->attachment[$cur][4] = $type;
- $this->attachment[$cur][5] = false; // isStringAttachment
- $this->attachment[$cur][6] = 'attachment';
- $this->attachment[$cur][7] = 0;
-
- return true;
- }
-
- /**
- * Attaches all fs, string, and binary attachments to the message.
- * Returns an empty string on failure.
- * @access private
- * @return string
- */
- function AttachAll() {
- /* Return text of body */
- $mime = array();
-
- /* Add all attachments */
- for($i = 0; $i < count($this->attachment); $i++) {
- /* Check for string attachment */
- $bString = $this->attachment[$i][5];
- if ($bString) {
- $string = $this->attachment[$i][0];
- } else {
- $path = $this->attachment[$i][0];
- }
-
- $filename = $this->attachment[$i][1];
- $name = $this->attachment[$i][2];
- $encoding = $this->attachment[$i][3];
- $type = $this->attachment[$i][4];
- $disposition = $this->attachment[$i][6];
- $cid = $this->attachment[$i][7];
-
- $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
- $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE);
- $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
-
- if($disposition == 'inline') {
- $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);
- }
-
- $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE);
-
- /* Encode as string attachment */
- if($bString) {
- $mime[] = $this->EncodeString($string, $encoding);
- if($this->IsError()) {
- return '';
- }
- $mime[] = $this->LE.$this->LE;
- } else {
- $mime[] = $this->EncodeFile($path, $encoding);
- if($this->IsError()) {
- return '';
- }
- $mime[] = $this->LE.$this->LE;
- }
- }
-
- $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE);
-
- return join('', $mime);
- }
-
- /**
- * Encodes attachment in requested format. Returns an
- * empty string on failure.
- * @access private
- * @return string
- */
- function EncodeFile ($path, $encoding = 'base64') {
- if(!@$fd = fopen($path, 'rb')) {
- $this->SetError($this->Lang('file_open') . $path);
- return '';
- }
- $magic_quotes = get_magic_quotes_runtime();
- set_magic_quotes_runtime(0);
- $file_buffer = fread($fd, filesize($path));
- $file_buffer = $this->EncodeString($file_buffer, $encoding);
- fclose($fd);
- set_magic_quotes_runtime($magic_quotes);
-
- return $file_buffer;
- }
-
- /**
- * Encodes string to requested format. Returns an
- * empty string on failure.
- * @access private
- * @return string
- */
- function EncodeString ($str, $encoding = 'base64') {
- $encoded = '';
- switch(strtolower($encoding)) {
- case 'base64':
- /* chunk_split is found in PHP >= 3.0.6 */
- $encoded = chunk_split(base64_encode($str), 76, $this->LE);
- break;
- case '7bit':
- case '8bit':
- $encoded = $this->FixEOL($str);
- if (substr($encoded, -(strlen($this->LE))) != $this->LE)
- $encoded .= $this->LE;
- break;
- case 'binary':
- $encoded = $str;
- break;
- case 'quoted-printable':
- $encoded = $this->EncodeQP($str);
- break;
- default:
- $this->SetError($this->Lang('encoding') . $encoding);
- break;
- }
- return $encoded;
- }
-
- /**
- * Encode a header string to best of Q, B, quoted or none.
- * @access private
- * @return string
- */
- function EncodeHeader ($str, $position = 'text') {
- $x = 0;
-
- switch (strtolower($position)) {
- case 'phrase':
- if (!preg_match('/[\200-\377]/', $str)) {
- /* Can't use addslashes as we don't know what value has magic_quotes_sybase. */
- $encoded = addcslashes($str, "\0..\37\177\\\"");
- if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
- return ($encoded);
- } else {
- return ("\"$encoded\"");
- }
- }
- $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
- break;
- case 'comment':
- $x = preg_match_all('/[()"]/', $str, $matches);
- /* Fall-through */
- case 'text':
- default:
- $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
- break;
- }
-
- if ($x == 0) {
- return ($str);
- }
-
- $maxlen = 75 - 7 - strlen($this->CharSet);
- /* Try to select the encoding which should produce the shortest output */
- if (strlen($str)/3 < $x) {
- $encoding = 'B';
- if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) {
- // Use a custom function which correctly encodes and wraps long
- // multibyte strings without breaking lines within a character
- $encoded = $this->Base64EncodeWrapMB($str);
- } else {
- $encoded = base64_encode($str);
- $maxlen -= $maxlen % 4;
- $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
- }
- } else {
- $encoding = 'Q';
- $encoded = $this->EncodeQ($str, $position);
- $encoded = $this->WrapText($encoded, $maxlen, true);
- $encoded = str_replace('='.$this->LE, "\n", trim($encoded));
- }
-
- $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
- $encoded = trim(str_replace("\n", $this->LE, $encoded));
-
- return $encoded;
- }
-
- /**
- * Checks if a string contains multibyte characters.
- * @access private
- * @param string $str multi-byte text to wrap encode
- * @return bool
- */
- function HasMultiBytes($str) {
- if (function_exists('mb_strlen')) {
- return (strlen($str) > mb_strlen($str, $this->CharSet));
- } else { // Assume no multibytes (we can't handle without mbstring functions anyway)
- return False;
- }
- }
-
- /**
- * Correctly encodes and wraps long multibyte strings for mail headers
- * without breaking lines within a character.
- * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php
- * @access private
- * @param string $str multi-byte text to wrap encode
- * @return string
- */
- function Base64EncodeWrapMB($str) {
- $start = "=?".$this->CharSet."?B?";
- $end = "?=";
- $encoded = "";
-
- $mb_length = mb_strlen($str, $this->CharSet);
- // Each line must have length <= 75, including $start and $end
- $length = 75 - strlen($start) - strlen($end);
- // Average multi-byte ratio
- $ratio = $mb_length / strlen($str);
- // Base64 has a 4:3 ratio
- $offset = $avgLength = floor($length * $ratio * .75);
-
- for ($i = 0; $i < $mb_length; $i += $offset) {
- $lookBack = 0;
-
- do {
- $offset = $avgLength - $lookBack;
- $chunk = mb_substr($str, $i, $offset, $this->CharSet);
- $chunk = base64_encode($chunk);
- $lookBack++;
- }
- while (strlen($chunk) > $length);
-
- $encoded .= $chunk . $this->LE;
- }
-
- // Chomp the last linefeed
- $encoded = substr($encoded, 0, -strlen($this->LE));
- return $encoded;
- }
-
- /**
- * Encode string to quoted-printable.
- * @access private
- * @return string
- */
- function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
- $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
- $lines = preg_split('/(?:\r\n|\r|\n)/', $input);
- $eol = "\r\n";
- $escape = '=';
- $output = '';
- while( list(, $line) = each($lines) ) {
- $linlen = strlen($line);
- $newline = '';
- for($i = 0; $i < $linlen; $i++) {
- $c = substr( $line, $i, 1 );
- $dec = ord( $c );
- if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E
- $c = '=2E';
- }
- if ( $dec == 32 ) {
- if ( $i == ( $linlen - 1 ) ) { // convert space at eol only
- $c = '=20';
- } else if ( $space_conv ) {
- $c = '=20';
- }
- } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required
- $h2 = floor($dec/16);
- $h1 = floor($dec%16);
- $c = $escape.$hex[$h2].$hex[$h1];
- }
- if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted
- $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay
- $newline = '';
- // check if newline first character will be point or not
- if ( $dec == 46 ) {
- $c = '=2E';
- }
- }
- $newline .= $c;
- } // end of for
- $output .= $newline.$eol;
- } // end of while
- return $output;
- }
-
- /**
- * Encode string to q encoding.
- * @access private
- * @return string
- */
- function EncodeQ ($str, $position = 'text') {
- /* There should not be any EOL in the string */
- $encoded = preg_replace("[\r\n]", '', $str);
-
- switch (strtolower($position)) {
- case 'phrase':
- $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
- break;
- case 'comment':
- $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
- case 'text':
- default:
- /* Replace every high ascii, control =, ? and _ characters */
- $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
- "'='.sprintf('%02X', ord('\\1'))", $encoded);
- break;
- }
-
- /* Replace every spaces to _ (more readable than =20) */
- $encoded = str_replace(' ', '_', $encoded);
-
- return $encoded;
- }
-
- /**
- * Adds a string or binary attachment (non-filesystem) to the list.
- * This method can be used to attach ascii or binary data,
- * such as a BLOB record from a database.
- * @param string $string String attachment data.
- * @param string $filename Name of the attachment.
- * @param string $encoding File encoding (see $Encoding).
- * @param string $type File extension (MIME) type.
- * @return void
- */
- function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') {
- /* Append to $attachment array */
- $cur = count($this->attachment);
- $this->attachment[$cur][0] = $string;
- $this->attachment[$cur][1] = $filename;
- $this->attachment[$cur][2] = $filename;
- $this->attachment[$cur][3] = $encoding;
- $this->attachment[$cur][4] = $type;
- $this->attachment[$cur][5] = true; // isString
- $this->attachment[$cur][6] = 'attachment';
- $this->attachment[$cur][7] = 0;
- }
-
- /**
- * Adds an embedded attachment. This can include images, sounds, and
- * just about any other document. Make sure to set the $type to an
- * image type. For JPEG images use "image/jpeg" and for GIF images
- * use "image/gif".
- * @param string $path Path to the attachment.
- * @param string $cid Content ID of the attachment. Use this to identify
- * the Id for accessing the image in an HTML form.
- * @param string $name Overrides the attachment name.
- * @param string $encoding File encoding (see $Encoding).
- * @param string $type File extension (MIME) type.
- * @return bool
- */
- function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
-
- if(!@is_file($path)) {
- $this->SetError($this->Lang('file_access') . $path);
- return false;
- }
-
- $filename = basename($path);
- if($name == '') {
- $name = $filename;
- }
-
- /* Append to $attachment array */
- $cur = count($this->attachment);
- $this->attachment[$cur][0] = $path;
- $this->attachment[$cur][1] = $filename;
- $this->attachment[$cur][2] = $name;
- $this->attachment[$cur][3] = $encoding;
- $this->attachment[$cur][4] = $type;
- $this->attachment[$cur][5] = false;
- $this->attachment[$cur][6] = 'inline';
- $this->attachment[$cur][7] = $cid;
-
- return true;
- }
-
- /**
- * Returns true if an inline attachment is present.
- * @access private
- * @return bool
- */
- function InlineImageExists() {
- $result = false;
- for($i = 0; $i < count($this->attachment); $i++) {
- if($this->attachment[$i][6] == 'inline') {
- $result = true;
- break;
- }
- }
-
- return $result;
- }
-
- /////////////////////////////////////////////////
- // CLASS METHODS, MESSAGE RESET
- /////////////////////////////////////////////////
-
- /**
- * Clears all recipients assigned in the TO array. Returns void.
- * @return void
- */
- function ClearAddresses() {
- $this->to = array();
- }
-
- /**
- * Clears all recipients assigned in the CC array. Returns void.
- * @return void
- */
- function ClearCCs() {
- $this->cc = array();
- }
-
- /**
- * Clears all recipients assigned in the BCC array. Returns void.
- * @return void
- */
- function ClearBCCs() {
- $this->bcc = array();
- }
-
- /**
- * Clears all recipients assigned in the ReplyTo array. Returns void.
- * @return void
- */
- function ClearReplyTos() {
- $this->ReplyTo = array();
- }
-
- /**
- * Clears all recipients assigned in the TO, CC and BCC
- * array. Returns void.
- * @return void
- */
- function ClearAllRecipients() {
- $this->to = array();
- $this->cc = array();
- $this->bcc = array();
- }
-
- /**
- * Clears all previously set filesystem, string, and binary
- * attachments. Returns void.
- * @return void
- */
- function ClearAttachments() {
- $this->attachment = array();
- }
-
- /**
- * Clears all custom headers. Returns void.
- * @return void
- */
- function ClearCustomHeaders() {
- $this->CustomHeader = array();
- }
-
- /////////////////////////////////////////////////
- // CLASS METHODS, MISCELLANEOUS
- /////////////////////////////////////////////////
-
- /**
- * Adds the error message to the error container.
- * Returns void.
- * @access private
- * @return void
- */
- function SetError($msg) {
- $this->error_count++;
- $this->ErrorInfo = $msg;
- }
-
- /**
- * Returns the proper RFC 822 formatted date.
- * @access private
- * @return string
- */
- function RFCDate() {
- $tz = date('Z');
- $tzs = ($tz < 0) ? '-' : '+';
- $tz = abs($tz);
- $tz = (int)($tz/3600)*100 + ($tz%3600)/60;
- $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz);
-
- return $result;
- }
-
- /**
- * Returns the appropriate server variable. Should work with both
- * PHP 4.1.0+ as well as older versions. Returns an empty string
- * if nothing is found.
- * @access private
- * @return mixed
- */
- function ServerVar($varName) {
- global $HTTP_SERVER_VARS;
- global $HTTP_ENV_VARS;
-
- if(!isset($_SERVER)) {
- $_SERVER = $HTTP_SERVER_VARS;
- if(!isset($_SERVER['REMOTE_ADDR'])) {
- $_SERVER = $HTTP_ENV_VARS; // must be Apache
- }
- }
-
- if(isset($_SERVER[$varName])) {
- return $_SERVER[$varName];
- } else {
- return '';
- }
- }
-
- /**
- * Returns the server hostname or 'localhost.localdomain' if unknown.
- * @access private
- * @return string
- */
- function ServerHostname() {
- if ($this->Hostname != '') {
- $result = $this->Hostname;
- } elseif ($this->ServerVar('SERVER_NAME') != '') {
- $result = $this->ServerVar('SERVER_NAME');
- } else {
- $result = 'localhost.localdomain';
- }
-
- return $result;
- }
-
- /**
- * Returns a message in the appropriate language.
- * @access private
- * @return string
- */
- function Lang($key) {
- if(count($this->language) < 1) {
- $this->SetLanguage('en'); // set the default language
- }
-
- if(isset($this->language[$key])) {
- return $this->language[$key];
- } else {
- return 'Language string failed to load: ' . $key;
- }
- }
-
- /**
- * Returns true if an error occurred.
- * @return bool
- */
- function IsError() {
- return ($this->error_count > 0);
- }
-
- /**
- * Changes every end of line from CR or LF to CRLF.
- * @access private
- * @return string
- */
- function FixEOL($str) {
- $str = str_replace("\r\n", "\n", $str);
- $str = str_replace("\r", "\n", $str);
- $str = str_replace("\n", $this->LE, $str);
- return $str;
- }
-
- /**
- * Adds a custom header.
- * @return void
- */
- function AddCustomHeader($custom_header) {
- $this->CustomHeader[] = explode(':', $custom_header, 2);
- }
-
- /**
- * Evaluates the message and returns modifications for inline images and backgrounds
- * @access public
- * @return $message
- */
- function MsgHTML($message,$basedir='') {
- preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images);
- if(isset($images[2])) {
- foreach($images[2] as $i => $url) {
- // do not change urls for absolute images (thanks to corvuscorax)
- if (!preg_match('/^[A-z][A-z]*:\/\//',$url)) {
- $filename = basename($url);
- $directory = dirname($url);
- ($directory == '.')?$directory='':'';
- $cid = 'cid:' . md5($filename);
- $fileParts = split("\.", $filename);
- $ext = $fileParts[1];
- $mimeType = $this->_mime_types($ext);
- if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; }
- if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; }
- if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) {
- $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message);
- }
- }
- }
- }
- $this->IsHTML(true);
- $this->Body = $message;
- $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message)));
- if ( !empty($textMsg) && empty($this->AltBody) ) {
- $this->AltBody = html_entity_decode($textMsg);
- }
- if ( empty($this->AltBody) ) {
- $this->AltBody = 'To view this email message, open the email in with HTML compatibility!' . "\n\n";
- }
- }
-
- /**
- * Gets the mime type of the embedded or inline image
- * @access private
- * @return mime type of ext
- */
- function _mime_types($ext = '') {
- $mimes = array(
- 'ai' => 'application/postscript',
- 'aif' => 'audio/x-aiff',
- 'aifc' => 'audio/x-aiff',
- 'aiff' => 'audio/x-aiff',
- 'avi' => 'video/x-msvideo',
- 'bin' => 'application/macbinary',
- 'bmp' => 'image/bmp',
- 'class' => 'application/octet-stream',
- 'cpt' => 'application/mac-compactpro',
- 'css' => 'text/css',
- 'dcr' => 'application/x-director',
- 'dir' => 'application/x-director',
- 'dll' => 'application/octet-stream',
- 'dms' => 'application/octet-stream',
- 'doc' => 'application/msword',
- 'dvi' => 'application/x-dvi',
- 'dxr' => 'application/x-director',
- 'eml' => 'message/rfc822',
- 'eps' => 'application/postscript',
- 'exe' => 'application/octet-stream',
- 'gif' => 'image/gif',
- 'gtar' => 'application/x-gtar',
- 'htm' => 'text/html',
- 'html' => 'text/html',
- 'jpe' => 'image/jpeg',
- 'jpeg' => 'image/jpeg',
- 'jpg' => 'image/jpeg',
- 'hqx' => 'application/mac-binhex40',
- 'js' => 'application/x-javascript',
- 'lha' => 'application/octet-stream',
- 'log' => 'text/plain',
- 'lzh' => 'application/octet-stream',
- 'mid' => 'audio/midi',
- 'midi' => 'audio/midi',
- 'mif' => 'application/vnd.mif',
- 'mov' => 'video/quicktime',
- 'movie' => 'video/x-sgi-movie',
- 'mp2' => 'audio/mpeg',
- 'mp3' => 'audio/mpeg',
- 'mpe' => 'video/mpeg',
- 'mpeg' => 'video/mpeg',
- 'mpg' => 'video/mpeg',
- 'mpga' => 'audio/mpeg',
- 'oda' => 'application/oda',
- 'pdf' => 'application/pdf',
- 'php' => 'application/x-httpd-php',
- 'php3' => 'application/x-httpd-php',
- 'php4' => 'application/x-httpd-php',
- 'phps' => 'application/x-httpd-php-source',
- 'phtml' => 'application/x-httpd-php',
- 'png' => 'image/png',
- 'ppt' => 'application/vnd.ms-powerpoint',
- 'ps' => 'application/postscript',
- 'psd' => 'application/octet-stream',
- 'qt' => 'video/quicktime',
- 'ra' => 'audio/x-realaudio',
- 'ram' => 'audio/x-pn-realaudio',
- 'rm' => 'audio/x-pn-realaudio',
- 'rpm' => 'audio/x-pn-realaudio-plugin',
- 'rtf' => 'text/rtf',
- 'rtx' => 'text/richtext',
- 'rv' => 'video/vnd.rn-realvideo',
- 'sea' => 'application/octet-stream',
- 'shtml' => 'text/html',
- 'sit' => 'application/x-stuffit',
- 'so' => 'application/octet-stream',
- 'smi' => 'application/smil',
- 'smil' => 'application/smil',
- 'swf' => 'application/x-shockwave-flash',
- 'tar' => 'application/x-tar',
- 'text' => 'text/plain',
- 'txt' => 'text/plain',
- 'tgz' => 'application/x-tar',
- 'tif' => 'image/tiff',
- 'tiff' => 'image/tiff',
- 'wav' => 'audio/x-wav',
- 'wbxml' => 'application/vnd.wap.wbxml',
- 'wmlc' => 'application/vnd.wap.wmlc',
- 'word' => 'application/msword',
- 'xht' => 'application/xhtml+xml',
- 'xhtml' => 'application/xhtml+xml',
- 'xl' => 'application/excel',
- 'xls' => 'application/vnd.ms-excel',
- 'xml' => 'text/xml',
- 'xsl' => 'text/xml',
- 'zip' => 'application/zip'
- );
- return ( ! isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)];
- }
-
- /**
- * Set (or reset) Class Objects (variables)
- *
- * Usage Example:
- * $page->set('X-Priority', '3');
- *
- * @access public
- * @param string $name Parameter Name
- * @param mixed $value Parameter Value
- * NOTE: will not work with arrays, there are no arrays to set/reset
- */
- function set ( $name, $value = '' ) {
- if ( isset($this->$name) ) {
- $this->$name = $value;
- } else {
- $this->SetError('Cannot set or reset variable ' . $name);
- return false;
- }
- }
-
- /**
- * Read a file from a supplied filename and return it.
- *
- * @access public
- * @param string $filename Parameter File Name
- */
- function getFile($filename) {
- $return = '';
- if ($fp = fopen($filename, 'rb')) {
- while (!feof($fp)) {
- $return .= fread($fp, 1024);
- }
- fclose($fp);
- return $return;
- } else {
- return false;
- }
- }
-
- /**
- * Strips newlines to prevent header injection.
- * @access private
- * @param string $str String
- * @return string
- */
- function SecureHeader($str) {
- $str = trim($str);
- $str = str_replace("\r", "", $str);
- $str = str_replace("\n", "", $str);
- return $str;
- }
-
- /**
- * Set the private key file and password to sign the message.
- *
- * @access public
- * @param string $key_filename Parameter File Name
- * @param string $key_pass Password for private key
- */
- function Sign($cert_filename, $key_filename, $key_pass) {
- $this->sign_cert_file = $cert_filename;
- $this->sign_key_file = $key_filename;
- $this->sign_key_pass = $key_pass;
- }
-
-}
-
-?>
diff --git a/config/ipblocklist/7/class.smtp.tmp b/config/ipblocklist/7/class.smtp.tmp
deleted file mode 100755
index be084a11..00000000
--- a/config/ipblocklist/7/class.smtp.tmp
+++ /dev/null
@@ -1,1062 +0,0 @@
-<?php
-/*~ class.smtp.php
-.---------------------------------------------------------------------------.
-| Software: PHPMailer - PHP email class |
-| Version: 2.0.4 |
-| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
-| Info: http://phpmailer.sourceforge.net |
-| Support: http://sourceforge.net/projects/phpmailer/ |
-| ------------------------------------------------------------------------- |
-| Author: Andy Prevost (project admininistrator) |
-| Author: Brent R. Matzelle (original founder) |
-| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
-| Copyright (c) 2001-2003, Brent R. Matzelle |
-| ------------------------------------------------------------------------- |
-| License: Distributed under the Lesser General Public License (LGPL) |
-| http://www.gnu.org/copyleft/lesser.html |
-| This program is distributed in the hope that it will be useful - WITHOUT |
-| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
-| FITNESS FOR A PARTICULAR PURPOSE. |
-| ------------------------------------------------------------------------- |
-| We offer a number of paid services (www.codeworxtech.com): |
-| - Web Hosting on highly optimized fast and secure servers |
-| - Technology Consulting |
-| - Oursourcing (highly qualified programmers and graphic designers) |
-'---------------------------------------------------------------------------'
-
-/**
- * SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
- * commands except TURN which will always return a not implemented
- * error. SMTP also provides some utility methods for sending mail
- * to an SMTP server.
- * @package PHPMailer
- * @author Chris Ryan
- */
-
-class SMTP
-{
- /**
- * SMTP server port
- * @var int
- */
- var $SMTP_PORT = 25;
-
- /**
- * SMTP reply line ending
- * @var string
- */
- var $CRLF = "\r\n";
-
- /**
- * Sets whether debugging is turned on
- * @var bool
- */
- var $do_debug; # the level of debug to perform
-
- /**
- * Sets VERP use on/off (default is off)
- * @var bool
- */
- var $do_verp = false;
-
- /**#@+
- * @access private
- */
- var $smtp_conn; # the socket to the server
- var $error; # error if any on the last call
- var $helo_rply; # the reply the server sent to us for HELO
- /**#@-*/
-
- /**
- * Initialize the class so that the data is in a known state.
- * @access public
- * @return void
- */
- function SMTP() {
- $this->smtp_conn = 0;
- $this->error = null;
- $this->helo_rply = null;
-
- $this->do_debug = 0;
- }
-
- /*************************************************************
- * CONNECTION FUNCTIONS *
- ***********************************************************/
-
- /**
- * Connect to the server specified on the port specified.
- * If the port is not specified use the default SMTP_PORT.
- * If tval is specified then a connection will try and be
- * established with the server for that number of seconds.
- * If tval is not specified the default is 30 seconds to
- * try on the connection.
- *
- * SMTP CODE SUCCESS: 220
- * SMTP CODE FAILURE: 421
- * @access public
- * @return bool
- */
- function Connect($host,$port=0,$tval=30) {
- # set the error val to null so there is no confusion
- $this->error = null;
-
- # make sure we are __not__ connected
- if($this->connected()) {
- # ok we are connected! what should we do?
- # for now we will just give an error saying we
- # are already connected
- $this->error = array("error" => "Already connected to a server");
- return false;
- }
-
- if(empty($port)) {
- $port = $this->SMTP_PORT;
- }
-
- #connect to the smtp server
- $this->smtp_conn = fsockopen($host, # the host of the server
- $port, # the port to use
- $errno, # error number if any
- $errstr, # error message if any
- $tval); # give up after ? secs
- # verify we connected properly
- if(empty($this->smtp_conn)) {
- $this->error = array("error" => "Failed to connect to server",
- "errno" => $errno,
- "errstr" => $errstr);
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": $errstr ($errno)" . $this->CRLF;
- }
- return false;
- }
-
- # sometimes the SMTP server takes a little longer to respond
- # so we will give it a longer timeout for the first read
- // Windows still does not have support for this timeout function
- if(substr(PHP_OS, 0, 3) != "WIN")
- socket_set_timeout($this->smtp_conn, $tval, 0);
-
- # get any announcement stuff
- $announce = $this->get_lines();
-
- # set the timeout of any socket functions at 1/10 of a second
- //if(function_exists("socket_set_timeout"))
- // socket_set_timeout($this->smtp_conn, 0, 100000);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce;
- }
-
- return true;
- }
-
- /**
- * Performs SMTP authentication. Must be run after running the
- * Hello() method. Returns true if successfully authenticated.
- * @access public
- * @return bool
- */
- function Authenticate($username, $password) {
- // Start authentication
- fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($code != 334) {
- $this->error =
- array("error" => "AUTH not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- // Send encoded username
- fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($code != 334) {
- $this->error =
- array("error" => "Username not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- // Send encoded password
- fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($code != 235) {
- $this->error =
- array("error" => "Password not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- return true;
- }
-
- /**
- * Returns true if connected to a server otherwise false
- * @access private
- * @return bool
- */
- function Connected() {
- if(!empty($this->smtp_conn)) {
- $sock_status = socket_get_status($this->smtp_conn);
- if($sock_status["eof"]) {
- # hmm this is an odd situation... the socket is
- # valid but we are not connected anymore
- if($this->do_debug >= 1) {
- echo "SMTP -> NOTICE:" . $this->CRLF .
- "EOF caught while checking if connected";
- }
- $this->Close();
- return false;
- }
- return true; # everything looks good
- }
- return false;
- }
-
- /**
- * Closes the socket and cleans up the state of the class.
- * It is not considered good to use this function without
- * first trying to use QUIT.
- * @access public
- * @return void
- */
- function Close() {
- $this->error = null; # so there is no confusion
- $this->helo_rply = null;
- if(!empty($this->smtp_conn)) {
- # close the connection and cleanup
- fclose($this->smtp_conn);
- $this->smtp_conn = 0;
- }
- }
-
- /***************************************************************
- * SMTP COMMANDS *
- *************************************************************/
-
- /**
- * Issues a data command and sends the msg_data to the server
- * finializing the mail transaction. $msg_data is the message
- * that is to be send with the headers. Each header needs to be
- * on a single line followed by a <CRLF> with the message headers
- * and the message body being seperated by and additional <CRLF>.
- *
- * Implements rfc 821: DATA <CRLF>
- *
- * SMTP CODE INTERMEDIATE: 354
- * [data]
- * <CRLF>.<CRLF>
- * SMTP CODE SUCCESS: 250
- * SMTP CODE FAILURE: 552,554,451,452
- * SMTP CODE FAILURE: 451,554
- * SMTP CODE ERROR : 500,501,503,421
- * @access public
- * @return bool
- */
- function Data($msg_data) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Data() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"DATA" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 354) {
- $this->error =
- array("error" => "DATA command not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- # the server is ready to accept data!
- # according to rfc 821 we should not send more than 1000
- # including the CRLF
- # characters on a single line so we will break the data up
- # into lines by \r and/or \n then if needed we will break
- # each of those into smaller lines to fit within the limit.
- # in addition we will be looking for lines that start with
- # a period '.' and append and additional period '.' to that
- # line. NOTE: this does not count towards are limit.
-
- # normalize the line breaks so we know the explode works
- $msg_data = str_replace("\r\n","\n",$msg_data);
- $msg_data = str_replace("\r","\n",$msg_data);
- $lines = explode("\n",$msg_data);
-
- # we need to find a good way to determine is headers are
- # in the msg_data or if it is a straight msg body
- # currently I am assuming rfc 822 definitions of msg headers
- # and if the first field of the first line (':' sperated)
- # does not contain a space then it _should_ be a header
- # and we can process all lines before a blank "" line as
- # headers.
- $field = substr($lines[0],0,strpos($lines[0],":"));
- $in_headers = false;
- if(!empty($field) && !strstr($field," ")) {
- $in_headers = true;
- }
-
- $max_line_length = 998; # used below; set here for ease in change
-
- while(list(,$line) = @each($lines)) {
- $lines_out = null;
- if($line == "" && $in_headers) {
- $in_headers = false;
- }
- # ok we need to break this line up into several
- # smaller lines
- while(strlen($line) > $max_line_length) {
- $pos = strrpos(substr($line,0,$max_line_length)," ");
-
- # Patch to fix DOS attack
- if(!$pos) {
- $pos = $max_line_length - 1;
- }
-
- $lines_out[] = substr($line,0,$pos);
- $line = substr($line,$pos + 1);
- # if we are processing headers we need to
- # add a LWSP-char to the front of the new line
- # rfc 822 on long msg headers
- if($in_headers) {
- $line = "\t" . $line;
- }
- }
- $lines_out[] = $line;
-
- # now send the lines to the server
- while(list(,$line_out) = @each($lines_out)) {
- if(strlen($line_out) > 0)
- {
- if(substr($line_out, 0, 1) == ".") {
- $line_out = "." . $line_out;
- }
- }
- fputs($this->smtp_conn,$line_out . $this->CRLF);
- }
- }
-
- # ok all the message data has been sent so lets get this
- # over with aleady
- fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "DATA not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Expand takes the name and asks the server to list all the
- * people who are members of the _list_. Expand will return
- * back and array of the result or false if an error occurs.
- * Each value in the array returned has the format of:
- * [ <full-name> <sp> ] <path>
- * The definition of <path> is defined in rfc 821
- *
- * Implements rfc 821: EXPN <SP> <string> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE FAILURE: 550
- * SMTP CODE ERROR : 500,501,502,504,421
- * @access public
- * @return string array
- */
- function Expand($name) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Expand() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "EXPN not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- # parse the reply and place in our array to return to user
- $entries = explode($this->CRLF,$rply);
- while(list(,$l) = @each($entries)) {
- $list[] = substr($l,4);
- }
-
- return $list;
- }
-
- /**
- * Sends the HELO command to the smtp server.
- * This makes sure that we and the server are in
- * the same known state.
- *
- * Implements from rfc 821: HELO <SP> <domain> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE ERROR : 500, 501, 504, 421
- * @access public
- * @return bool
- */
- function Hello($host="") {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Hello() without being connected");
- return false;
- }
-
- # if a hostname for the HELO was not specified determine
- # a suitable one to send
- if(empty($host)) {
- # we need to determine some sort of appopiate default
- # to send to the server
- $host = "localhost";
- }
-
- // Send extended hello first (RFC 2821)
- if(!$this->SendHello("EHLO", $host))
- {
- if(!$this->SendHello("HELO", $host))
- return false;
- }
-
- return true;
- }
-
- /**
- * Sends a HELO/EHLO command.
- * @access private
- * @return bool
- */
- function SendHello($hello, $host) {
- fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => $hello . " not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- $this->helo_rply = $rply;
-
- return true;
- }
-
- /**
- * Gets help information on the keyword specified. If the keyword
- * is not specified then returns generic help, ussually contianing
- * A list of keywords that help is available on. This function
- * returns the results back to the user. It is up to the user to
- * handle the returned data. If an error occurs then false is
- * returned with $this->error set appropiately.
- *
- * Implements rfc 821: HELP [ <SP> <string> ] <CRLF>
- *
- * SMTP CODE SUCCESS: 211,214
- * SMTP CODE ERROR : 500,501,502,504,421
- * @access public
- * @return string
- */
- function Help($keyword="") {
- $this->error = null; # to avoid confusion
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Help() without being connected");
- return false;
- }
-
- $extra = "";
- if(!empty($keyword)) {
- $extra = " " . $keyword;
- }
-
- fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 211 && $code != 214) {
- $this->error =
- array("error" => "HELP not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- return $rply;
- }
-
- /**
- * Starts a mail transaction from the email address specified in
- * $from. Returns true if successful or false otherwise. If True
- * the mail transaction is started and then one or more Recipient
- * commands may be called followed by a Data command.
- *
- * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE SUCCESS: 552,451,452
- * SMTP CODE SUCCESS: 500,501,421
- * @access public
- * @return bool
- */
- function Mail($from) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Mail() without being connected");
- return false;
- }
-
- $useVerp = ($this->do_verp ? "XVERP" : "");
- fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "MAIL not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Sends the command NOOP to the SMTP server.
- *
- * Implements from rfc 821: NOOP <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE ERROR : 500, 421
- * @access public
- * @return bool
- */
- function Noop() {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Noop() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"NOOP" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "NOOP not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Sends the quit command to the server and then closes the socket
- * if there is no error or the $close_on_error argument is true.
- *
- * Implements from rfc 821: QUIT <CRLF>
- *
- * SMTP CODE SUCCESS: 221
- * SMTP CODE ERROR : 500
- * @access public
- * @return bool
- */
- function Quit($close_on_error=true) {
- $this->error = null; # so there is no confusion
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Quit() without being connected");
- return false;
- }
-
- # send the quit command to the server
- fputs($this->smtp_conn,"quit" . $this->CRLF);
-
- # get any good-bye messages
- $byemsg = $this->get_lines();
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg;
- }
-
- $rval = true;
- $e = null;
-
- $code = substr($byemsg,0,3);
- if($code != 221) {
- # use e as a tmp var cause Close will overwrite $this->error
- $e = array("error" => "SMTP server rejected quit command",
- "smtp_code" => $code,
- "smtp_rply" => substr($byemsg,4));
- $rval = false;
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $e["error"] . ": " .
- $byemsg . $this->CRLF;
- }
- }
-
- if(empty($e) || $close_on_error) {
- $this->Close();
- }
-
- return $rval;
- }
-
- /**
- * Sends the command RCPT to the SMTP server with the TO: argument of $to.
- * Returns true if the recipient was accepted false if it was rejected.
- *
- * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250,251
- * SMTP CODE FAILURE: 550,551,552,553,450,451,452
- * SMTP CODE ERROR : 500,501,503,421
- * @access public
- * @return bool
- */
- function Recipient($to) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Recipient() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250 && $code != 251) {
- $this->error =
- array("error" => "RCPT not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Sends the RSET command to abort and transaction that is
- * currently in progress. Returns true if successful false
- * otherwise.
- *
- * Implements rfc 821: RSET <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE ERROR : 500,501,504,421
- * @access public
- * @return bool
- */
- function Reset() {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Reset() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"RSET" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "RSET failed",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- return true;
- }
-
- /**
- * Starts a mail transaction from the email address specified in
- * $from. Returns true if successful or false otherwise. If True
- * the mail transaction is started and then one or more Recipient
- * commands may be called followed by a Data command. This command
- * will send the message to the users terminal if they are logged
- * in.
- *
- * Implements rfc 821: SEND <SP> FROM:<reverse-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE SUCCESS: 552,451,452
- * SMTP CODE SUCCESS: 500,501,502,421
- * @access public
- * @return bool
- */
- function Send($from) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Send() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "SEND not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Starts a mail transaction from the email address specified in
- * $from. Returns true if successful or false otherwise. If True
- * the mail transaction is started and then one or more Recipient
- * commands may be called followed by a Data command. This command
- * will send the message to the users terminal if they are logged
- * in and send them an email.
- *
- * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE SUCCESS: 552,451,452
- * SMTP CODE SUCCESS: 500,501,502,421
- * @access public
- * @return bool
- */
- function SendAndMail($from) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called SendAndMail() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "SAML not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Starts a mail transaction from the email address specified in
- * $from. Returns true if successful or false otherwise. If True
- * the mail transaction is started and then one or more Recipient
- * commands may be called followed by a Data command. This command
- * will send the message to the users terminal if they are logged
- * in or mail it to them if they are not.
- *
- * Implements rfc 821: SOML <SP> FROM:<reverse-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE SUCCESS: 552,451,452
- * SMTP CODE SUCCESS: 500,501,502,421
- * @access public
- * @return bool
- */
- function SendOrMail($from) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called SendOrMail() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "SOML not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * This is an optional command for SMTP that this class does not
- * support. This method is here to make the RFC821 Definition
- * complete for this class and __may__ be implimented in the future
- *
- * Implements from rfc 821: TURN <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE FAILURE: 502
- * SMTP CODE ERROR : 500, 503
- * @access public
- * @return bool
- */
- function Turn() {
- $this->error = array("error" => "This method, TURN, of the SMTP ".
- "is not implemented");
- if($this->do_debug >= 1) {
- echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF;
- }
- return false;
- }
-
- /**
- * Verifies that the name is recognized by the server.
- * Returns false if the name could not be verified otherwise
- * the response from the server is returned.
- *
- * Implements rfc 821: VRFY <SP> <string> <CRLF>
- *
- * SMTP CODE SUCCESS: 250,251
- * SMTP CODE FAILURE: 550,551,553
- * SMTP CODE ERROR : 500,501,502,421
- * @access public
- * @return int
- */
- function Verify($name) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Verify() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250 && $code != 251) {
- $this->error =
- array("error" => "VRFY failed on name '$name'",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return $rply;
- }
-
- /*******************************************************************
- * INTERNAL FUNCTIONS *
- ******************************************************************/
-
- /**
- * Read in as many lines as possible
- * either before eof or socket timeout occurs on the operation.
- * With SMTP we can tell if we have more lines to read if the
- * 4th character is '-' symbol. If it is a space then we don't
- * need to read anything else.
- * @access private
- * @return string
- */
- function get_lines() {
- $data = "";
- while($str = @fgets($this->smtp_conn,515)) {
- if($this->do_debug >= 4) {
- echo "SMTP -> get_lines(): \$data was \"$data\"" .
- $this->CRLF;
- echo "SMTP -> get_lines(): \$str is \"$str\"" .
- $this->CRLF;
- }
- $data .= $str;
- if($this->do_debug >= 4) {
- echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF;
- }
- # if the 4th character is a space then we are done reading
- # so just break the loop
- if(substr($str,3,1) == " ") { break; }
- }
- return $data;
- }
-
-}
-
-
- ?>
diff --git a/config/ipblocklist/7/convert-execute.sh b/config/ipblocklist/7/convert-execute.sh
deleted file mode 100755
index 75daf448..00000000
--- a/config/ipblocklist/7/convert-execute.sh
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/bin/sh
-
-#check if ipblocklist running
-#export resultr=`pfctl -s rules | grep -c ipblocklist`
-
-#echo $resultr
-#if [ "$resultr" -gt "0" ]; then
-# echo running
-# exit 1
-#else
-# echo not running
-# /usr/bin/logger -s "IP-Blocklist was found not running"
-# echo "IP-Blocklist not running" | /usr/local/bin/php /usr/local/www/packages/ipblocklist/email_send.php
-#fi
-
-
-#kill tables to elminate dups
-/sbin/pfctl -t ipblocklist -T kill
-/sbin/pfctl -t ipblocklistW -T kill
-/usr/bin/sed -i -e '/ipblocklist/d' /tmp/rules.debug
-/usr/bin/sed -i -e '/ipblocklistW/d' /tmp/rules.debug
-
-#Generate lists to process
-ls /usr/local/www/packages/ipblocklist/lists > /usr/local/www/packages/ipblocklist/file_list.txt
-ls /usr/local/www/packages/ipblocklist/Wlists > /usr/local/www/packages/ipblocklist/file_Wlist.txt
-filelist="/usr/local/www/packages/ipblocklist/file_list.txt"
-Wfilelist="/usr/local/www/packages/ipblocklist/file_Wlist.txt"
-
-#READ contents in file_list.txt and process as file
-for fileline in $(cat $filelist); do
-iplist="/usr/local/www/packages/ipblocklist/lists/$fileline"
-iplistout="/usr/local/www/packages/ipblocklist/lists/ipfw.ipfw"
-if [ "$iplist" != "/usr/local/www/packages/ipblocklist/lists/ipfw.ipfw" ]; then
- /usr/bin/perl /usr/local/www/packages/ipblocklist/convert.pl $iplist $iplistout
- #echo "THIS JUST RAN"
-fi
-done
-
-#Whitelist
-for Wfileline in $(cat $Wfilelist); do
-Wiplist="/usr/local/www/packages/ipblocklist/Wlists/$Wfileline"
-Wiplistout="/usr/local/www/packages/ipblocklist/Wlists/whitelist"
-/usr/bin/perl convert.pl $Wiplist $Wiplistout
-done
-#echo "ipfw made"
-
-#clean up ipfw.ipfw (duplicates)
-rm /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP
-/usr/bin/sort lists/ipfw.ipfw | uniq >> /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP
-mv /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP /usr/local/www/packages/ipblocklist/lists/ipfw.ipfw
-#echo "ipfw clean"
-
-#clean up whitelist (duplicates)
-rm Wlists/whitelistTEMP
-/usr/bin/sort Wlists/whitelist | uniq >> Wlists/whitelistTEMP
-mv Wlists/whitelistTEMP Wlists/whitelist
-#echo "whitelist clean"
-
-
-
-#Now edit /tmp/rules.debug
-
-#find my line for table
-export i=`grep -n 'block quick from any to <snort2c>' /tmp/rules.debug | grep -o '[0-9]\{2,4\}'`
-export t=`grep -n 'User Aliases' /tmp/rules.debug |grep -o '[0-9]\{1,2\}'`
-
-i=$(($i+'1'))
-t=$(($t+'1'))
-#echo $i
-#echo $t
-
-rm /tmp/rules.debug.tmp
-
-#Insert table-entry limit
-/usr/bin/sed -i -e '/900000/d' /tmp/rules.debug
-while read line
- do a=$(($a+1));
- #echo $a;
- if [ "$a" = "$t" ]; then
- echo "" >> /tmp/rules.debug.tmp
- echo "set limit table-entries 900000" >> /tmp/rules.debug.tmp
- fi
- echo $line >> /tmp/rules.debug.tmp
-done < "/tmp/rules.debug"
-
-mv /tmp/rules.debug /tmp/rules.debug.old
-mv /tmp/rules.debug.tmp /tmp/rules.debug
-
-/sbin/pfctl -o basic -f /tmp/rules.debug > /usr/local/www/packages/ipblocklist/errorOUT.txt 2>&1
-
-rm /tmp/rules.debug.tmp
-#Insert ipblocklist rules
-a="0"
-echo $a
-while read line
- do a=$(($a+1));
- echo $a;
- if [ "$a" = "$i" ]; then
- echo "" >> /tmp/rules.debug.tmp
- echo "#ipblocklist" >> /tmp/rules.debug.tmp
- echo "table <ipblocklist> persist file '/usr/local/www/packages/ipblocklist/lists/ipfw.ipfw'" >> /tmp/rules.debug.tmp
- echo "table <ipblocklistW> persist file '/usr/local/www/packages/ipblocklist/Wlists/whitelist'" >> /tmp/rules.debug.tmp
-
- for i in $(cat /usr/local/www/packages/ipblocklist/interfaces.txt); do
- echo "pass quick from <ipblocklistW> to any label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- echo "pass quick from $i to <ipblocklistW> label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- if [ -f /usr/local/www/packages/ipblocklist/logging ]; then
- echo "block log quick from <ipblocklist> to $i label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- else
- echo "block quick from <ipblocklist> to $i label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- fi
- if [ -f /usr/local/www/packages/ipblocklist/OUTBOUND ]; then
- echo "block quick from $i to <ipblocklist> label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- fi
- done
- fi
- echo $line >> /tmp/rules.debug.tmp
-done < "/tmp/rules.debug"
-
-mv /tmp/rules.debug /tmp/rules.debug.old
-mv /tmp/rules.debug.tmp /tmp/rules.debug
-
-#Now execute the ipfw list (Take a long time in old version)
-#sh lists/ipfw.ipfw (Version 0.1.4)
-rm /usr/local/www/packages/ipblocklist/errorOUT.txt
-/sbin/pfctl -o basic -f /tmp/rules.debug > /usr/local/www/packages/ipblocklist/errorOUT.txt 2>&1
diff --git a/config/ipblocklist/7/convert.pl b/config/ipblocklist/7/convert.pl
deleted file mode 100755
index f3e9db12..00000000
--- a/config/ipblocklist/7/convert.pl
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-if($#ARGV != 1) {
- print("Usage: $0 <input file> <output file>\n");
- exit(1);
-}
-
-my ($line,$title,$iprange,$cidr);
-my $i = 30000;
-
-open(INFILE,'<',$ARGV[0]) or die("Could not open input file $ARGV[0]");
-open(OUTFILE,'>>',$ARGV[1]) or die("Could not open output file $ARGV[1]");
-
-foreach $line (<INFILE>) {
- chomp($line);
- $line =~ s/:((\d{1,3}[-\.]*){8})//;
- $iprange = $1;
- print OUTFILE "#$line\n";
- foreach $cidr (split(/\n/,range($iprange))) {
- print OUTFILE "$cidr\n";
- #print OUTFILE "ipfw -q add 1000 drop ip from any to $cidr\n"; (version 0.1.4)
- #$i++;
- #print OUTFILE "ipfw -q add 1001 drop ip from $cidr to any\n"; (version 0.1.4)
- #$i++;
- }
-}
-
-close(INFILE);
-close(OUTFILE);
-
-sub ntoa {
- return join ".",unpack("CCCC",pack("N",shift));
-}
-sub aton {
- return unpack 'N', pack 'C4', split/\./, shift;
-}
-sub deaggregate {
- my $thirtytwobits = 4294967295;
- my $start = shift;
- my $end = shift;
- my $base = $start;
- my ($step,$output);
- while ($base <= $end) {
- $step = 0;
- while (($base | (1 << $step)) != $base) {
- if (($base | (((~0) & $thirtytwobits) >> (31-$step))) > $end) {
- last;
- }
- $step++;
- }
- if($step == 0) {
- $output .= ntoa($base);
- }else{
- $output .= ntoa($base)."/" .(32-$step);
- }
- $output .= "\n";
- $base += 1 << $step;
- }
- return $output;
-}
-sub range {
- my ($address,$address2) = split /-/, shift;
- $address = aton($address);
- $address2 = aton($address2);
- return deaggregate($address,$address2);
-}
diff --git a/config/ipblocklist/7/email.tmp b/config/ipblocklist/7/email.tmp
deleted file mode 100755
index abeb4932..00000000
--- a/config/ipblocklist/7/email.tmp
+++ /dev/null
@@ -1,268 +0,0 @@
-<?php
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-//$pgtitle = "Firewall: ipblocklist - Email";
-
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/ipblocklist/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-
-if (isset($_GET['save'])) {
- exec("rm email_send.php");
- exec("touch email_send.php");
- $file = "email_send.php";
- $smtp_auth = $_POST['smtp_auth'];
- $smtp_secure = $_POST['smtp_secure'];
- $host = $_POST['host'];
- $port = $_POST['port'];
- $user = $_POST['user'];
- $pass = $_POST['pass'];
- $html = $_POST['html'];
- $from = $_POST['from'];
- $to = $_POST['to'];
- $subject = $_POST['subject'];
- $fp = fopen($file, "w") or die("Couldn't open $file for writing!");
- fwrite($fp, "<?php\ninclude(\"class.phpmailer.php\");\n\$mail = new PHPMailer();
-\n\$mail->IsSMTP();\n\$mail->SMTPAuth = ") or die("Couldn't write values to file!");
- fwrite($fp, $smtp_auth) or die("Couldn't write values to file!");
- fwrite($fp, ";\n\$mail->SMTPSecure = \"") or die("Couldn't write values to file!");
- fwrite($fp, $smtp_secure) or die("Couldn't write values to file!");
- fwrite($fp, "\";\n\$mail->Host = \"") or die("Couldn't write values to file!");
- fwrite($fp, $host) or die("Couldn't write values to file!");
- fwrite($fp, "\";\n\$mail->Port = ") or die("Couldn't write values to file!");
- fwrite($fp, $port) or die("Couldn't write values to file!");
- fwrite($fp, ";\n\$mail->Username = \"") or die("Couldn't write values to file!");
- fwrite($fp, $user);
- fwrite($fp, "\";\n\$mail->Password = \"") or die("Couldn't write values to file!");
- fwrite($fp, $pass);
- fwrite($fp, "\";\n\$mail->AddReplyTo(\"") or die("Couldn't write values to file!");
- fwrite($fp, $from) or die("Couldn't write values to file!");
- fwrite($fp, "\",\"pfsense ipblocklist\");\n\$mail->From = \"") or die("Couldn't write values to file!");
- fwrite($fp, $from) or die("Couldn't write values to file!");
- fwrite($fp, "\";\n\$mail->Subject = \"" . $subject . "\";\n\$mail->AltBody = \"To view the message, please use an HTML compatible email viewer!\";\n\$mail->WordWrap = 50;\n\$body = \"IP-Blocklist encountered an event. A system log entry was made with details of event\";\n\$body .= \"<br><br>\" . date('l jS \of F Y h:i:s A') . \"<br><br>Current Status = \";\nob_start();\n\$results = exec(\"pfctl -s rules | grep -c ipblocklist\");\nob_end_clean();\nif (\$results > '0')\n\$body .= \"Running\";\nelse\n\$body .= \"<span style='color:red'>Restarting</span>\";\nob_start();\n\$results = exec(\"tail -r /usr/local/www/packages/ipblocklist/errorOUT.txt\");\nob_end_clean();\n\$body .= \"<br/><span style='color:red'>\";\n\$body .= \$results;\n\$body .= \"</span>\";\n\$body .= \"<br>You are blocking \";\nob_start();\n\$results = exec(\"pfctl -T show -t ipblocklist |grep -v -c Z\");\nob_end_clean();\n\$body .= \$results;\n\$body .= \" Networks\";\n\n\$mail->MsgHTML(\$body);\n\$mail->AddAddress(\"") or die("Couldn't write values to file!");
- fwrite($fp, $to) or die("Couldn't write values to file!");
- fwrite($fp, "\");\n\$mail->IsHTML(") or die("Couldn't write values to file!");
- fwrite($fp, $html) or die("Couldn't write values to file!");
- fwrite($fp, ");\n\nif(!\$mail->Send()) {\n echo \"Mailer Error: \" . \$mail->ErrorInfo;\n} else {\n echo \"Message sent! - <a href=email.php>Go Back</a>\";\n}\n?>") or die("Couldn't write values to file!");
- fclose($fp);
- //echo "Saved successfully!";
-
- exec("rm email_config.html");
- exec("touch email_config.html");
- $file2 = "email_config.html";
- $fp2 = fopen($file2, "w") or die("Couldn't open $file for writing!");
- fwrite($fp2, "<table width=\"100%\" b align=\"center\">
- <tr>
- <td>SMTP Auth</td>") or die("Couldn't write values to file!");
- if ($smtp_auth=="true")
- fwrite($fp2, "<td><select name=\"smtp_auth\"><option label=\"true\" value=\"true\" selected>Yes</option><option label=\"false\" value=\"false\">No</option></select></td>") or die("Couldn't write values to file!");
- else
- fwrite($fp2, "<td><select name=\"smtp_auth\"><option label=\"true\" value=\"true\">Yes</option><option label=\"false\" value=\"false\" selected>No</option></select></td>") or die("Couldn't write values to file!");
- fwrite($fp2, "</tr>
- <tr class=\"d0\">
- <td>SMTP Security</td>") or die("Couldn't write values to file!");
- if ($smtp_secure=="ssl")
- fwrite($fp2, "<td><select name=\"smtp_secure\"><option label=\"ssl\" value=\"ssl\" selected>ssl</option><option label=\"none\" value=\"none\">None</option></select></td>") or die("Couldn't write values to file!");
- else
- fwrite($fp2, "<td><select name=\"smtp_secure\"><option label=\"ssl\" value=\"ssl\">ssl</option><option label=\"none\" value=\"none\" selected>None</option></select></td>") or die("Couldn't write values to file!");
- fwrite($fp2, "</tr>
- <tr>
- <td>Host</td>
- <td><input type=\"text\" name=\"host\" value=\"" . $host ."\"></td>
- </tr>
- <tr class=\"d0\">
- <td>Port</td>
- <td><input type=\"port\" name=\"port\" value=\"" . $port . "\"></td>
- </tr>
- <tr>
- <td>Username</td>
- <td><input type=\"user\" name=\"user\" value=\"" . $user . "\"></td>
- </tr>
- <tr class=\"d0\">
- <td>Password</td>
- <td><input type=\"password\" name=\"pass\" value=\"" . $pass . "\"></td>
- </tr>
- <tr>
- <td>Use HTML formatting</td>") or die("Couldn't write values to file!");
- if ($html=="true")
- fwrite($fp2, "<td><select name=\"html\"><option label=\"true\" value=\"true\" selected>Yes</option><option label=\"false\" value=\"false\">No</option></select></td>") or die("Couldn't write values to file!");
- else
- fwrite($fp2, "<td><select name=\"html\"><option label=\"true\" value=\"true\">Yes</option><option label=\"false\" value=\"false\" selected>No</option></select></td>") or die("Couldn't write values to file!");
- fwrite($fp2, "</tr>
- <tr class=\"d0\">
- <td>From email address</td>
- <td><input type=\"from\" name=\"from\" value=\"" . $from . "\"></td>
- </tr>
- <tr>
- <td>To email address</td>
- <td><input type=\"to\" name=\"to\" value=\"" . $to . "\"></td>
- </tr>
- <tr class=\"d0\">
- <td>Subject</td>
- <td><input type=\"subject\" name=\"subject\" value=\"" . $subject . "\"></td>
- </tr>
-</table>
-<br>
-<input type=\"submit\" value=\"Save\">
-</form>") or die("Couldn't write values to file!");
- fclose($fp2);
-}
-if (isset($_GET['test'])) {
- echo '<script type="text/javascript">' . "\n";
- echo 'window.location="email_send.php";';
- echo '</script>';
-}
-if (isset($_GET['reset'])) {
- exec ("rm email_send.php");
- exec ("rm email_config.html");
- echo '<script type="text/javascript">' . "\n";
- echo 'window.location="email.php";';
- echo '</script>';
-}
-?>
-
-<html>
-<head>
-<style type="text/css">
-.style1 {
- text-align: center;
-}
-tr.d0 td {
- background-color: #eedddd; color: black;
-}
-</style>
-
-</head>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-
-
-<br /><br />
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("IP-Blocklist", false, "ipblocklist.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "ipblocklist_if.php");
- $tab_array[4] = array("Help", false, "https://doc.pfsense.org/index.php/IP_Blocklist");
- $tab_array[5] = array("Email", true, "email.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Email Settings for SMTP mail</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
-
-<form name="emailform" method="post" action="email.php?save=1">
-<?php
-if (file_exists("email_send.php")) {
- echo "<p>Your settings have already been set. Would you like to overwrite your email settings?</p>\n";
- $content = file_get_contents('email_config.html');
- echo $content;
- echo "<p>\n";
- echo "<input name=\"resetbutton\" type=\"button\" value=\"Reset email config\" onClick=\"window.location='email.php?reset=1'\" />\n";
- echo "</p>\n";
- echo "\n";
-} else {
- echo "<table width=\"100%\" b align=\"center\">\n";
- echo " <tr>\n";
- echo " <td>SMTP Auth</td>\n";
- echo " <td><select name=\"smtp_auth\"><option label=\"true\" value=\"true\">Yes</option><option label=\"false\" value=\"false\">No</option></select></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>SMTP Security</td>\n";
- echo " <td><select name=\"smtp_secure\"><option label=\"ssl\" value=\"ssl\">ssl</option><option label=\"none\" value=\"none\">None</option></select></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Host</td>\n";
- echo " <td><input type=\"text\" name=\"host\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>Port</td>\n";
- echo " <td><input type=\"port\" name=\"port\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Username</td>\n";
- echo " <td><input type=\"user\" name=\"user\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>Password</td>\n";
- echo " <td><input type=\"password\" name=\"pass\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Use HTML formatting</td>\n";
- echo " <td><select name=\"html\"><option label=\"true\" value=\"true\">Yes</option><option label=\"false\" value=\"false\">No</option></select></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>From email address</td>\n";
- echo " <td><input type=\"from\" name=\"from\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>To email address</td>\n";
- echo " <td><input type=\"to\" name=\"to\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>Subject</td>\n";
- echo " <td><input type=\"subject\" name=\"subject\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo "</table>\n";
- echo "\n";
- echo "<br>\n";
- echo "<input type=\"submit\" value=\"Save\">\n";
- echo "\n";
- echo "\n";
- echo "\n";
- echo "</form>\n";
-}
-?>
-
-<input type="button" value="Test" onClick="window.location='email.php?test=1'">
-
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-
-<br>
-
-
-<br><br>
-
-<p>
-</p>
-</td>
- </tr>
-</table>
-
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/ipblocklist/7/firewall_shaper.tmp b/config/ipblocklist/7/firewall_shaper.tmp
deleted file mode 100755
index 833f87f8..00000000
--- a/config/ipblocklist/7/firewall_shaper.tmp
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<HEAD>
-<SCRIPT language="JavaScript">
-<!--
-window.parent.location="../../firewall_shaper.php";
-//-->
-</SCRIPT>
-</HEAD>
-
-
-</html>
diff --git a/config/ipblocklist/7/index.tmp b/config/ipblocklist/7/index.tmp
deleted file mode 100755
index bcbfad8f..00000000
--- a/config/ipblocklist/7/index.tmp
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<HEAD>
-<SCRIPT language="JavaScript">
-<!--
-window.parent.location="../../index.php";
-//-->
-</SCRIPT>
-</HEAD>
-
-
-</html>
diff --git a/config/ipblocklist/7/interfaces.txt b/config/ipblocklist/7/interfaces.txt
deleted file mode 100755
index faba42a4..00000000
--- a/config/ipblocklist/7/interfaces.txt
+++ /dev/null
@@ -1 +0,0 @@
-any
diff --git a/config/ipblocklist/7/ipblocklist.inc b/config/ipblocklist/7/ipblocklist.inc
deleted file mode 100755
index b0f7849f..00000000
--- a/config/ipblocklist/7/ipblocklist.inc
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php
-/* $Id$ */
-/*
-/* ========================================================================== */
-/*
- ipblocklist.inc
- Copyright (C) 2011 Tom Schaefer
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-function php_sync_package_ip()
-{
- global $config;
-}
-
-
-function php_install_command_ip()
-{
-
- global $config;
- conf_mount_rw();
- config_lock();
-
- if (!is_dir('/usr/local/www/packages/')) {
- exec("mkdir /usr/local/www/packages/");
- }
-
- if (!is_dir('/usr/local/www/packages/ipblocklist/')) {
- exec("mkdir /usr/local/www/packages/ipblocklist/");
- }
-
-
- //install PERL
- exec("pkg_add -r ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/All/perl-5.12.3.tbz");
- exec("pkg_add -r ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/All/p5-Net-CIDR-0.14.tbz");
-
-
- //rename PHP files from .tmp to .php
- exec("cp /tmp/lists.txt /usr/local/www/packages/ipblocklist/lists.txt");
- exec("cp /tmp/class.phpmailer.tmp /usr/local/www/packages/ipblocklist/class.phpmailer.php");
- unlink_if_exists("/tmp/class.phpmailer.tmp ");
- exec("cp /tmp/class.smtp.tmp /usr/local/www/packages/ipblocklist/class.smtp.php");
- unlink_if_exists("/tmp/class.smtp.tmp");
- exec("cp /tmp/email.tmp /usr/local/www/packages/ipblocklist/email.php");
- unlink_if_exists("/tmp/email.tmp");
- exec("cp /tmp/ipblocklist_if.tmp /usr/local/www/packages/ipblocklist/ipblocklist_if.php");
- unlink_if_exists("/tmp/ipblocklist_if.tmp");
- exec("cp /tmp/settings.tmp /usr/local/www/packages/ipblocklist/settings.php");
- unlink_if_exists("/tmp/settings.tmp");
- exec("cp /tmp/interfaces.txt /usr/local/www/packages/ipblocklist/interfaces.txt");
- unlink_if_exists("/tmp/interfaces.txt");
- exec("cp /tmp/firewall_shaper.tmp /usr/local/www/packages/ipblocklist/firewall_shaper.php");
- unlink_if_exists("/tmp/firewall_shaper.tmp");
-
- exec("cp /tmp/ipblocklist.tmp /usr/local/www/packages/ipblocklist/ipblocklist.php");
- unlink_if_exists("/tmp/ipblocklist.tmp");
- exec("cp /tmp/ipblocklist_list.tmp /usr/local/www/packages/ipblocklist/ipblocklist_list.php");
- unlink_if_exists("/tmp/ipblocklist_list.tmp");
- exec("cp /tmp/purge.tmp /usr/local/www/packages/ipblocklist/purge.php");
- unlink_if_exists("/tmp/purge.tmp");
- exec("cp /tmp/index.tmp /usr/local/www/packages/ipblocklist/index.php");
- unlink_if_exists("/tmp/index.tmp");
- exec("cp /tmp/whitelist.tmp /usr/local/www/packages/ipblocklist/whitelist.php");
- unlink_if_exists("/tmp/whitelist.tmp");
- exec("cp /tmp/purgeip.tmp /usr/local/www/packages/ipblocklist/purgeip.php");
- unlink_if_exists("/tmp/purgeip.tmp");
- //Get scripts
- exec("cp /tmp/convert.pl /usr/local/www/packages/ipblocklist/convert.pl");
- unlink_if_exists("/tmp/convert.pl");
- exec("cp /tmp/convert-execute.sh /usr/local/www/packages/ipblocklist/convert-execute.sh");
- unlink_if_exists("/tmp/convert-execute.sh");
- exec("cp /tmp/IP-Blocklist.sh /usr/local/etc/rc.d/IP-Blocklist.sh");
- exec("cp /tmp/IP-Blocklist.sh /usr/local/pkg/pf/IP-Blocklist.sh");
- unlink_if_exists("/tmp/IP-Blocklist.sh");
- //Touch files
- exec("touch /usr/local/www/packages/ipblocklist/wlists.txt");
- exec("/bin/mkdir /usr/local/www/packages/countryblock/lists");
- exec("/bin/mkdir /usr/local/www/packages/ipblocklist/lists");
- exec("/bin/mkdir /usr/local/www/packages/ipblocklist/Wlists");
- exec("/usr/bin/touch /usr/local/www/packages/countryblock/lists/countries.txt");
- exec("/usr/bin/touch /usr/local/www/packages/countryblock/countries-white.txt");
- exec("/usr/bin/touch /usr/local/www/packages/ipblocklist/lists/ipfw.ipfw");
- exec("/usr/bin/touch /usr/local/www/packages/ipblocklist/Wlists/whitelist");
- exec("/usr/bin/touch /usr/local/www/packages/ipblocklist/OUTBOUND");
-
-
- conf_mount_ro();
- config_unlock();
-}
-
-
-function deinstall_command_ip()
-{
- conf_mount_rw();
- $handle = popen("/usr/local/etc/rc.d/ipblocklist.sh stop", "r");
- unlink_if_exists("/usr/local/pkg/ipblocklist7.xml");
- unlink_if_exists("/usr/local/pkg/ipblocklist7.inc");
- exec("rm -R /usr/local/www/packages/ipblocklist/ipblocklists");
- exec("rm -R /usr/local/www/packages/ipblocklist");
- exec("rm /usr/local/etc/rc.d/IP-Blocklist.sh");
- exec("pfctl -t ipblocklist -T kill");
- exec("ipfw -f flush");
- conf_mount_ro();
-}
-
-?>
diff --git a/config/ipblocklist/7/ipblocklist.tmp b/config/ipblocklist/7/ipblocklist.tmp
deleted file mode 100755
index c447df6d..00000000
--- a/config/ipblocklist/7/ipblocklist.tmp
+++ /dev/null
@@ -1,241 +0,0 @@
-<?php
- //Version 3.4
- header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
- header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
- require_once('config.inc');
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/ipblocklist/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-if (count($_POST)>0) {
-
- conf_mount_rw();
-
- $ent = array();
-
- if ($_POST['enable'] == 1) {
- //echo "enabled";
- $config['installedpackages']['ipblocklist_settings']['config'][0]['enable'] = 1;
-
- //Process list by downloading and extracting
-
- $myFile = "lists.txt";
- $myWFile = "wlists.txt";
- $fileContents = file_get_contents($myFile);
- $fileWContents = file_get_contents($myWFile);
- $lines = explode(PHP_EOL, $fileContents);
- $Wlines = explode(PHP_EOL, $fileWContents);
- //Remove DIR lists to eliminate duplates
- exec("/bin/rm -R lists");
- exec("/bin/rm -R Wlists");
- //Process each list URL, Extract, and put in DIR lists
- exec("/bin/mkdir lists");
- exec("/bin/mkdir Wlists");
- foreach ($lines as $line) {
- exec("/usr/bin/fetch -o lists $line");
- $filename = basename($line);
- //Extract list
- exec("/usr/bin/gzip -d lists/$filename");
- }
- foreach ($Wlines as $Wline) {
- exec("/usr/bin/fetch -o Wlists $Wline");
- $Wfilename = basename($Wline);
- //Extract Whitelist
- exec("/usr/bin/gzip -d Wlists/$Wfilename");
- }
- //Prep pfctl
- mwexec("/usr/bin/touch lists/ipfw.ipfw");
- mwexec("/usr/bin/touch Wlists/whitelist");
-
- //Now clear ipfw, and process each list to ipfw commands
- exec("/bin/sh convert-execute.sh");
-
- }
- else {
- //echo "disabled";
- $config['installedpackages']['ipblocklist_settings']['config'][0]['enable'] = 0;
- //Clear Lists
- mwexec("ipfw -f flush");
- mwexec("pfctl -t ipblocklist -T kill");
- mwexec("rm -R /usr/local/www/packages/ipblocklist/lists");
- mwexec("sed -i -e '/ipblocklist/d' /tmp/rules.debug");
- mwexec("pfctl -o basic -f /tmp/rules.debug");
- //Clear errorOUT.txt
- mwexec("rm errorOUT.txt");
-
- }
-
-
- write_config();
- //services_dnsmasq_configure();
- sleep(1);
- $savemsg_dnsb = "IP-Blocklist settings have been saved/updated. ";
- conf_mount_ro();
-}
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<form method=POST action="">
-<?php
-if ($config['installedpackages']['ipblocklist_settings']['config'][0]['enable'] == 1) {
- echo "<input name='enable' type='checkbox' value='1' checked>\n";
-}
-else {
- echo "<input name='enable' type='checkbox' value='1'>\n";
-}
-?>
-<?php
-if(isset($_POST['formSubmit']))
- {
-
-
- //if(isset($_POST['formlogging']))
- //{
- // exec("/usr/bin/touch logging");
- //}
- //else
- //{
- // exec("/bin/rm logging");
- //}
-
- }
-?>
-<strong>Enable IP-Blocklist</strong><br><br>
-<?php if ($savemsg_cb) print_info_box($savemsg_cb);
- //if ($output) print_info_box($output,$output2);
- echo($output);
- echo($output2);
- ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("IP-Blocklist", true, "ipblocklist.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "ipblocklist_if.php");
- $tab_array[4] = array("Help", false, "https://doc.pfsense.org/index.php/IP_Blocklist");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
-</form>
-</td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Main</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
- <br />
- <center>
- <iframe frameboarder=0 boarder=0 src="ipblocklist_list.php" name="lists" id="lists" width="100%" height="200">
- </iframe>
- </center>
-
-
-
-
-
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
- <td >
-
-
- </form>
-
-
-
-
-
- <br/><br/>
- <input type="submit" name="formSubmit" value="Save/Update" />
- </p>
-</form>
-<br/>
-
-
-
-
-</div>
-<?php
- //This input guarantees that a POST is sent
- echo "<input type='hidden' name='zzz' value='required'>";
-?>
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-</div>
-<br>
-<u>Usage</u>
- <br/>
- Add direct link to list and press <img src="../../themes/nervecenter/images/icons/icon_plus.gif">
- (Example:
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level1.gz">Level1</a>,
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level2.gz">Level2</a>,
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level3.gz">Level3</a>)
- <br/>
- Compressed lists should have .gz extention and follows PeerBlock syntax
- <?php
- echo "<br/><br/>Current Status = ";
- ob_start();
- $results = exec("/sbin/pfctl -s rules | grep -c ipblocklist");
- ob_end_clean();
- if ($results > '2') echo "Running";
- else
- echo "<span style='color:red'>NOT running</span>";
-
- //Get Errors if exists
- ob_start();
- $results = exec("/usr/bin/tail -r errorOUT.txt");
- ob_end_clean();
- echo "<br/><span style='color:red'>";
- echo $results;
- echo "</span>";
-
- //Get IP Count
- echo "<br>You are blocking ";
- ob_start();
- $results = exec("/sbin/pfctl -T show -t ipblocklist |grep -v -c Z");
- ob_end_clean();
- echo $results;
- echo " Networks/IPs";
- ?>
-<br><br>
-<small>Created by <a href="http://www.tomschaefer.org/pfsense">TomSchaefer</a></small>
-<br /><small><a href="http://www.iblocklist.com/">I-Blocklist.com</a></small>
-<!--<input type="submit" value="Save/Update"><br><br>
---><p>
-</p>
-</td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
-
diff --git a/config/ipblocklist/7/ipblocklist.xml b/config/ipblocklist/7/ipblocklist.xml
deleted file mode 100755
index d459127b..00000000
--- a/config/ipblocklist/7/ipblocklist.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- ipblocklist.xml
- Copyright (C) 2011 Tom Schaefer
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>IP Blocklist</description>
- <requirements>perl</requirements>
- <faq>https://forum.pfsense.org/index.php/topic,24769.0.html</faq>
- <name>IP Blocklist Settings</name>
- <version>0.3.4</version>
- <title>Settings</title>
- <include_file>/usr/local/pkg/ipblocklist.inc</include_file>
- <menu>
- <name>IP Blocklist</name>
- <tooltiptext>IP Blocklist settings.</tooltiptext>
- <section>Firewall</section>
- <configfile>ipblocklist.xml</configfile>
- <url>/packages/ipblocklist/ipblocklist.php</url>
- </menu>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/packages/ipblocklist/ipblocklist.php</url>
- <active/>
- </tab>
- </tabs>
- <configpath>installedpackages->package->$packagename->configuration->ipblocklist</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/ipblocklist.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/ipblocklist.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/ipblocklist.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/interfaces.txt</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/ipblocklist_list.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/ipblocklist_if.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/firewall_shaper.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/convert.pl</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/convert-execute.sh</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/purge.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/index.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/whitelist.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/purgeip.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/IP-Blocklist.sh</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/settings.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/class.phpmailer.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/class.smtp.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/email.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/7/lists.txt</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Variable One</fielddescr>
- <fieldname>var1</fieldname>
- <description>Enter the variable one here.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Variable Two</fielddescr>
- <fieldname>var1</fieldname>
- <description>Enter the variable one here.</description>
- <type>input</type>
- </field>
- </fields>
- <custom_add_php_command>
- </custom_add_php_command>
- <custom_php_resync_config_command>
- php_sync_package_ip();
- </custom_php_resync_config_command>
- <custom_delete_php_command>
- php_sync_package_ip();
- </custom_delete_php_command>
- <custom_php_install_command>
- php_install_command_ip();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- deinstall_command_ip();
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/ipblocklist/7/ipblocklist_if.tmp b/config/ipblocklist/7/ipblocklist_if.tmp
deleted file mode 100755
index 582d856a..00000000
--- a/config/ipblocklist/7/ipblocklist_if.tmp
+++ /dev/null
@@ -1,217 +0,0 @@
-<?php
-/*
- interfaces_assign.php
- part of m0n0wall (http://m0n0.ch/wall)
- Written by Jim McBeath based on existing m0n0wall files
-
- Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-//$pgtitle = "Firewall: Countryblock - Interfaces";
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-require("guiconfig.inc");
-
-/*
- In this file, "port" refers to the physical port name,
- while "interface" refers to LAN, WAN, or OPTn.
-*/
-
-/* get list without VLAN interfaces */
-$portlist = get_interface_list();
-
-/* add VLAN interfaces */
-if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) {
- $i = 0;
- foreach ($config['vlans']['vlan'] as $vlan) {
- $portlist['vlan' . $i] = $vlan;
- $portlist['vlan' . $i]['isvlan'] = true;
- $i++;
- }
-}
-
-if ($_POST) {
-
- unset($input_errors);
-
- /* input validation */
-
- /* Build a list of the port names so we can see how the interfaces map */
- $portifmap = array();
- foreach ($portlist as $portname => $portinfo) {
- $portifmap[$portname] = array();
- //echo($portname . "done");
- }
-
- /* Go through the list of ports selected by the user,
- build a list of port-to-interface mappings in portifmap */
- conf_mount_rw();
- $myFile = "interfaces.txt";
-
- $fh = fopen($myFile, 'w+');
-
-
- foreach ($_POST as $ifname => $ifport) {
- //echo $ifname;
- //echo "<br>";
- if ($ifname != "__csrf_magic"){
- fwrite($fh, $ifname . "\n");
- }
- else {
- }
- //if (($ifname == 'lan') || ($ifname == 'wan') || (substr($ifname, 0, 3) == 'opt'))
- //$portifmap[$ifport][] = strtoupper($ifname);
- }
-
- conf_mount_ro();
-
-
- if (!$input_errors) {
- /* No errors detected, so update the config */
- foreach ($_POST as $ifname => $ifport) {
-
- if (($ifname == 'lan') || ($ifname == 'wan') ||
- (substr($ifname, 0, 3) == 'opt')) {
-
-
- }
- }
-
- $savemsg = get_std_save_message($retval);
-
-
-
- }
-}
-
-
-
-
-
-
-include("head.inc");
-
-
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box("Interfaces selected - Click <a href='ipblocklist.php'>Here</a> to go back"); ?>
-<form action="" method="post" name="iform" id="iform">
-<br /><br />
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("IP-Blocklist", false, "ipblocklist.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", true, "ipblocklist_if.php");
- $tab_array[4] = array("Help", false, "https://doc.pfsense.org/index.php/IP_Blocklist");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Interface</td>
- <td class="listhdr">Selected</td>
- <td class="list">&nbsp;</td>
- </tr>
- <?php foreach ($config['interfaces'] as $ifname => $iface):
- if ($iface['descr'])
- $ifdescr = $iface['descr'];
- else
- $ifdescr = strtoupper($ifname);
- ?>
- <tr>
- <td class="listlr" valign="middle"><strong><?=$ifdescr;?></strong></td>
- <td valign="middle" class="listr">
-
-
-
-
- <?php foreach ($portlist as $portname => $portinfo): ?>
-
- <?php if ($portname == $iface['if']) {
-
- ob_start();
- $resultsany = exec("cat interfaces.txt | grep any");
- $results = exec("cat interfaces.txt | grep $portname");
- ob_end_clean();
-
- if ($results == $portname || $resultsany == any)
- echo "<input name='$portname' type='checkbox' value='$portname' checked/>$portname";
- else
- echo "<input name='$portname' type='checkbox' value='$portname' />$portname";
- }
- ?>
- <?php endforeach; ?>
-
- </td>
- <td valign="middle" class="list">
-
- </td>
- </tr>
- <?php endforeach; ?>
-
- <tr>
- <td class="list" colspan="3" height="10"></td>
- </tr>
-
-</table>
-</div>
- <p><br>
- <input type="submit" class="formbtn" value="Save">
- </p>
- <p>Select the interfaces you want secured. It's recommended to select all interfaces. </p>
- <p>Default: All interfaces are seleted. <br>
- <br>
- </p>
- <p></p></td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-
-
-</body>
-</html>
-
-<?php
-conf_mount_rw();
- if ($_POST) {
- if (!$input_errors)
- touch("interfaces.txt");
-
- }
- conf_mount_ro();
-?>
diff --git a/config/ipblocklist/7/ipblocklist_list.tmp b/config/ipblocklist/7/ipblocklist_list.tmp
deleted file mode 100755
index ddc6fdb1..00000000
--- a/config/ipblocklist/7/ipblocklist_list.tmp
+++ /dev/null
@@ -1,113 +0,0 @@
-<?php
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-
-//echo "<a href=\"whitelist.php\"><img src=\"../../themes/nervecenter/images/icons/icon_plus.gif\" ALT=\"Whitelist\" ALIGN=RIGHT></a>\n";
-echo "Add List URL: <form method=\"post\" action=\"\">\n";
-echo "<input name=\"content\" type=\"text\" />\n";
-echo "<input type=\"image\" src=\"../../themes/nervecenter/images/icons/icon_plus.gif\" value=\"submit\">\n";
-echo "<a href=\"purge.php?line=0\">Purge All</a>\n";
-echo "<STYLE type=\"text/css\">\n";
-echo " a img {border:none; }\n";
-echo " </STYLE>\n";
-
-function delLineFromFile($fileName, $lineNum){
-// check the file exists
- if(!is_writable($fileName))
- {
- // print an error
- print "The file $fileName is not writable";
- // exit the function
- exit;
- }
- else
- {
- // read the file into an array
- $arr = file($fileName);
- }
-
- // the line to delete is the line number minus 1, because arrays begin at zero
- $lineToDelete = $lineNum-1;
-
- // check if the line to delete is greater than the length of the file
- if($lineToDelete > sizeof($arr))
- {
- // print an error
- print "You have chosen a line number, <b>[$lineNum]</b>, higher than the length of the file.";
- // exit the function
- exit;
- }
-
- //remove the line
- unset($arr["$lineToDelete"]);
-
- // open the file for reading
- if (!$fp = fopen($fileName, 'w+'))
- {
- // print an error
- print "Cannot open file ($fileName)";
- // exit the function
- exit;
- }
-
- // if $fp is valid
- if($fp)
- {
- // write the array to the file
- foreach($arr as $line) { fwrite($fp,$line); }
-
- // close the file
- fclose($fp);
- }
-
-echo "done";
-}
-
-
-$myFile = "lists.txt";
-$content = $_REQUEST['content'];
-$fh = fopen($myFile, 'a+');
-fwrite($fh, $content);
-if (strlen($content) > 1) {
- fwrite($fh, "\n");
- } else {
-}
-fclose($fh);
-
-
-//echo (filesize($myFile));
-if (filesize($myFile) > 1) {
- //$fh = fopen($myFile, 'r');
- //$theData = fread($fh, filesize($myFile));
- //fclose($fh);
- echo "<br/> Current List(s): <br/>";
- // Get the whole file into a single string
- $fileContents = file_get_contents($myFile);
-
- // Explode the file contents string by each line
- $lines = explode(PHP_EOL, $fileContents); // Replace PHP_EOL with "\r\n" or "\n" or "\r" if you like
-
- // Iterate through each line and do what you need with it
-
- foreach ($lines as $line) {
- $i++;
- echo "<a href=purge.php?line=$i style='border-style: none'><img src='../../themes/nervecenter/images/icons/icon_x.gif'></a>";
- echo " ";
- echo $line;
- //echo "";
- // echo $i;
- echo "<br/>";
-
- }
-
-
- //echo $theData;
-
-
-}
-echo "<br/><br/>";
-
-
-
-
-?>
diff --git a/config/ipblocklist/7/lists.txt b/config/ipblocklist/7/lists.txt
deleted file mode 100644
index 50b58f33..00000000
--- a/config/ipblocklist/7/lists.txt
+++ /dev/null
@@ -1 +0,0 @@
-http://iblocklist.whitacrecomputers.com/files/bt_level1.gz
diff --git a/config/ipblocklist/7/manual_add.tmp b/config/ipblocklist/7/manual_add.tmp
deleted file mode 100755
index a2218e61..00000000
--- a/config/ipblocklist/7/manual_add.tmp
+++ /dev/null
@@ -1,69 +0,0 @@
-<html>
-<head>
-<STYLE type="text/css">
- a img {border:none; }
- </STYLE>
-</head>
-<a href="ipblocklist_list.php"><img src="../../themes/nervecenter/images/icons/icon_alias_url_reload.gif" ALT="Manual" ALIGN=RIGHT></a>
-
-<span style="color:red">Experimental!</span> - This uses a different process to block IPs (uses IPFW) <a href="https://forum.pfsense.org/index.php/topic,24822.0.html" target="_blank"><img src="../../themes/nervecenter/images/icons/icon_log.gif"></a>
- <br/>Enter in IP format (xx.xx.xx.xx) or CIDR format (xx.xx.xx.xx/xx)
-<br/><form method="post" action="">
-<input name="content" type="text" />
-<input type="image" src="../../themes/nervecenter/images/icons/icon_plus.gif" value="submit">
-<br/>
-
-<?php
-
-
-$myFile = "ips.ipfw";
-$content = $_REQUEST['content'];
-$fh = fopen($myFile, 'a+');
-fwrite($fh, $content);
-if (strlen($content) > 1) {
- fwrite($fh, "\n");
- } else {
-
-}
-fclose($fh);
-
-
-//echo (filesize($myFile));
-if (filesize($myFile) > 1) {
- //$fh = fopen($myFile, 'r');
- //$theData = fread($fh, filesize($myFile));
- //fclose($fh);
- echo "<br/> Current List(s): <br/>";
- // Get the whole file into a single string
- $fileContents = file_get_contents($myFile);
-
- // Explode the file contents string by each line
- $lines = explode(PHP_EOL, $fileContents); // Replace PHP_EOL with "\r\n" or "\n" or "\r" if you like
-
- // Iterate through each line and do what you need with it
-
- foreach ($lines as $line) {
- $i++;
- echo "<a href=purgeip.php?line=$i style='border-style: none'><img src='../../themes/nervecenter/images/icons/icon_x.gif'></a>";
- echo " ";
- exec("kldload ipfw.ko");
- exec("ipfw -q add 2000 drop ip from any to $line");
- exec("ipfw -q add 2001 drop ip from $line to any");
- echo $line;
- //echo "";
- // echo $i;
- echo "<br/>";
-
- }
-
-
-
-
-
-}
-echo "<br/><br/>";
-
-
-
-
-?>
diff --git a/config/ipblocklist/7/purge.tmp b/config/ipblocklist/7/purge.tmp
deleted file mode 100755
index 2ecf1cf6..00000000
--- a/config/ipblocklist/7/purge.tmp
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-$line = $_GET["line"];
-
-//echo("$line");
-
-//exec("more lists.txt > temp_lists.txt");
-if ($line == 0) {
- exec("/bin/rm lists.txt");
- } else {
- exec("/usr/bin/sed $line'd' lists.txt > temp_lists.txt");
- }
-exec("/usr/bin/more temp_lists.txt > lists.txt");
-exec("/bin/rm temp_lists.txt");
-
-
-header('Location: ipblocklist_list.php');
-
-?>
diff --git a/config/ipblocklist/7/purgeip.tmp b/config/ipblocklist/7/purgeip.tmp
deleted file mode 100755
index b577b8af..00000000
--- a/config/ipblocklist/7/purgeip.tmp
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-$line = $_GET["line"];
-
-//echo("$line");
-//exec("more ips.ipfw > temp_ips.ipfw");
-if ($line == 0) {
- exec("rm wlists.txt");
- } else {
- exec("sed $line'd' wlists.txt > temp_wlists.txt");
- }
-exec("more temp_wlists.txt > wlists.txt");
-exec("rm temp_wlists.txt");
-
-
-?>
-<html>
-<HEAD>
-<SCRIPT language="JavaScript">
-<!--
-window.parent.location="ipblocklist.php";
-//-->
-</SCRIPT>
-</HEAD>
-
-
-</html>
diff --git a/config/ipblocklist/7/settings.tmp b/config/ipblocklist/7/settings.tmp
deleted file mode 100755
index 0c1fd804..00000000
--- a/config/ipblocklist/7/settings.tmp
+++ /dev/null
@@ -1,198 +0,0 @@
-<?php
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-//$pgtitle = "Firewall: Countryblock - Settings";
- // TomSchaefer.org countryblock package 2010
- //
- // Notes: Find: ^(.*)$
- // Replace: ob_start();\n$results = exec("cat countries.txt | grep XX");\nob_end_clean();\n\tif ($results == 'XX')\n\t\techo "\1";\n\telse\n\t\techo "\1";\n
- //
- //
- //
- //
- //require_once('config.inc');
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/ipblocklist/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<!--<p class="pgtitle"><?=$pgtitle?></p>-->
-<br />
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<form method=POST action="">
-
-<?php if ($savemsg_cb) print_info_box($savemsg_cb);
- //if ($output) print_info_box($output,$output2);
- echo($output);
- echo($output2);
- ?>
- <br /><br />
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("IP-Blocklist", false, "ipblocklist.php");
- $tab_array[1] = array("Settings", true, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "ipblocklist_if.php");
- $tab_array[4] = array("Help", false, "https://doc.pfsense.org/index.php/IP_Blocklist");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
-
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Settings</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
-
-<?php
-
-conf_mount_rw();
-
-
-
- if(isset($_POST['formSubmit']))
- {
- $aipblocklist = $_POST['formipblocklist'];
-
- if(isset($_POST['formOutbound']))
- {
- $output2 = " and Outbound access is BLOCKED.</b>";
- exec("touch OUTBOUND");
- }
- else
- {
- $output2 = " and Outbound access is ALLOWED.</b>";
- exec("rm OUTBOUND");
- }
-
- if(isset($_POST['formlogging']))
- {
- exec("touch logging");
- }
- else
- {
- exec("rm logging");
- }
-
-
-
-
- }
-conf_mount_ro();
-?>
-
-
-
-
-</head>
-
-
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
- <td >
-
-
- </form>
-
- <form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
- <p>
- <?php
- $countif = "interfaces.txt";
- if (file_exists($countif)) {
- $countif = count(file($countif));
- echo "$countlines";
- } else {
- echo "<span style='color:red'>Warning! No Interfaces Selected Click <a href='ipblocklist_if.php' target='_parent'><img src='../../themes/nervecenter/images/icons/icon_cablenic.gif' ALT='if'></a></span>";
- }
-
- ?>
- </p>
-
-
- <p>
- Block outbound?
-<?php
-
- if (file_exists("OUTBOUND")) {
- echo "<input name='formOutbound' type='checkbox' value='Yes' checked/>";
- } else {
- echo "<input name='formOutbound' type='checkbox' value='Yes'/>";
- }
-?>
-
- <br>
- Enable Logging?&nbsp;
-<?php
-
- if (file_exists("logging")) {
- echo "<input name='formlogging' type='checkbox' value='Yes' checked/>";
- } else {
- echo "<input name='formlogging' type='checkbox' value='Yes'/>";
- }
-?>
-<br/>
-
-
-
-
-
-
-
-
- </p>
-
-<br/>
-
-
-
-</div>
-<?php
- //This input guarantees that a POST is sent
- echo "<input type='hidden' name='zzz' value='required'>";
-?>
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-</div>
-<br />
-<input type="submit" name="formSubmit" value="Save" /><br><br>
-<p>
-</p>
-</td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
-
diff --git a/config/ipblocklist/7/whitelist.tmp b/config/ipblocklist/7/whitelist.tmp
deleted file mode 100755
index 203cf798..00000000
--- a/config/ipblocklist/7/whitelist.tmp
+++ /dev/null
@@ -1,175 +0,0 @@
-<?php
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-//$pgtitle = "Firewall: IPblo - Whitelist";
-
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/ipblocklist/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-
-
-
-
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<form method=POST action="">
-<?php
-
-
-//mwexec("touch countries-white.txt");
-//$myFile = "countries-white.txt";
-//$fh = fopen($myFile, 'a+');
-
-
-?>
-<br /><br />
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("IP-Blocklist", false, "ipblocklist.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", true, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "ipblocklist_if.php");
- $tab_array[4] = array("Help", false, "https://doc.pfsense.org/index.php/IP_Blocklist");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Whitelist</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
-
-<span style="color:red">White lists</span> - The lists added here will be added to a whitelist
- <br/>Add List URL:
-
- <p><form method="post" action="">
-<input name="content" type="text" />
-<input type="image" src="../../themes/nervecenter/images/icons/icon_plus.gif" value="submit">
-<a href="purgeip.php?line=0">Purge All</a>
-
-<STYLE type="text/css">
- a img {border:none; }
- </STYLE>
-</head>
-
-<?php
-
-
-$myFile = "wlists.txt";
-$content = $_REQUEST['content'];
-$fh = fopen($myFile, 'a+');
-fwrite($fh, $content);
-if (strlen($content) > 1) {
- fwrite($fh, "\n");
- } else {
-}
-fclose($fh);
-
-
-//echo (filesize($myFile));
-if (filesize($myFile) > 1) {
- //$fh = fopen($myFile, 'r');
- //$theData = fread($fh, filesize($myFile));
- //fclose($fh);
- echo "<br/> Current List(s): <br/>";
- // Get the whole file into a single string
- $fileContents = file_get_contents($myFile);
-
- // Explode the file contents string by each line
- $lines = explode(PHP_EOL, $fileContents); // Replace PHP_EOL with "\r\n" or "\n" or "\r" if you like
-
- // Iterate through each line and do what you need with it
-
- foreach ($lines as $line) {
- $i++;
- echo "<a href=purgeip.php?line=$i style='border-style: none'><img src='../../themes/nervecenter/images/icons/icon_x.gif'></a>";
- echo " ";
- echo $line;
- //echo "";
- // echo $i;
- echo "<br/>";
-
- }
-
-
- //echo $theData;
-
-
-}
-echo "<br/><br/>";
-
-
-
-
-?></p>
-
-
-</form>
-
-
-</div>
-
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-
-</div>
-<p> <u>Usage</u>
- <br/>
- Add direct link to list and press <img src="../../themes/nervecenter/images/icons/icon_plus.gif">
- (Example:
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level1.gz">Level1</a>,
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level2.gz">Level2</a>,
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level3.gz">Level3</a>)
- <br/>
- Compressed lists should have .gz extention and follows PeerBlock syntax <br/>
- <br/>
- </p>
-<br>
-
-<br><br>
-
-<p>
-</p>
-</td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
-
diff --git a/config/ipblocklist/8/IP-Blocklist.sh b/config/ipblocklist/8/IP-Blocklist.sh
deleted file mode 100755
index 4591526b..00000000
--- a/config/ipblocklist/8/IP-Blocklist.sh
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/bin/sh
-
-#check if ipblocklist running
-export resultr=`pfctl -s rules | grep -c ipblocklist`
-
-#echo $resultr
-if [ "$resultr" -gt "0" ]; then
- echo running
- exit 1
-else
- echo not running
- /usr/bin/logger -s "IP-Blocklist was found not running"
- #echo "IP-Blocklist not running" | /usr/local/bin/php /usr/local/www/packages/ipblocklist/email_send.php
-fi
-
-
-##kill tables to elminate dups
-/sbin/pfctl -t ipblocklist -T kill
-/sbin/pfctl -t ipblocklistW -T kill
-/usr/bin/sed -i -e '/ipblocklist/d' /tmp/rules.debug
-/usr/bin/sed -i -e '/ipblocklistW/d' /tmp/rules.debug
-
-##Generate lists to process
-#ls /usr/local/www/packages/ipblocklist/lists > /usr/local/www/packages/ipblocklist/file_list.txt
-#ls /usr/local/www/packages/ipblocklist/Wlists > /usr/local/www/packages/ipblocklist/file_Wlist.txt
-filelist="/usr/local/www/packages/ipblocklist/file_list.txt"
-Wfilelist="/usr/local/www/packages/ipblocklist/file_Wlist.txt"
-
-##READ contents in file_list.txt and process as file
-#for fileline in $(cat $filelist); do
-#iplist="/usr/local/www/packages/ipblocklist/lists/$fileline"
-#iplistout="/usr/local/www/packages/ipblocklist/lists/ipfw.ipfw"
-##sleep 5
-##echo "file name: "
-##echo $iplist
-##sleep 5
-#if [ "$iplist" != "/usr/local/www/packages/ipblocklist/lists/ipfw.ipfw" ]; then
-# #/usr/bin/perl /usr/local/www/packages/ipblocklist/convert.pl $iplist $iplistout
-# #echo "THIS JUST RAN"
-#fi
-##sleep 5
-#done
-
-#Whitelist
-#for Wfileline in $(cat $Wfilelist); do
-#Wiplist="/usr/local/www/packages/ipblocklist/Wlists/$Wfileline"
-#Wiplistout="/usr/local/www/packages/ipblocklist/Wlists/whitelist"
-#/usr/bin/perl /usr/local/www/packages/ipblocklist/convert.pl $Wiplist $Wiplistout
-#done
-#echo "ipfw made"
-
-##clean up ipfw.ipfw (duplicates)
-#rm /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP
-#/usr/bin/sort /usr/local/www/packages/ipblocklist/lists/ipfw.ipfw | uniq >> /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP
-#mv /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP /usr/local/www/packages/ipblocklist/lists/ipfw.ipfw
-##echo "ipfw clean"
-
-##clean up whitelist (duplicates)
-#rm /usr/local/www/packages/ipblocklist/Wlists/whitelistTEMP
-#/usr/bin/sort Wlists/whitelist | uniq >> /usr/local/www/packages/ipblocklist/Wlists/whitelistTEMP
-#mv /usr/local/www/packages/ipblocklist/Wlists/whitelistTEMP /usr/local/www/packages/ipblocklist/Wlists/whitelist
-##echo "whitelist clean"
-
-
-
-##Now edit /tmp/rules.debug
-
-##find my line for table
-export i=`grep -n 'block quick from any to <snort2c>' /tmp/rules.debug | grep -o '[0-9]\{2,4\}'`
-export t=`grep -n 'User Aliases' /tmp/rules.debug |grep -o '[0-9]\{1,2\}'`
-
-i=$(($i+'1'))
-t=$(($t+'1'))
-#echo $i
-#echo $t
-
-rm /tmp/rules.debug.tmp
-
-#Insert table-entry limit
-/usr/bin/sed -i -e '/900000/d' /tmp/rules.debug
-while read line
- do a=$(($a+1));
- #echo $a;
- if [ "$a" = "$t" ]; then
- echo "" >> /tmp/rules.debug.tmp
- echo "set limit table-entries 900000" >> /tmp/rules.debug.tmp
- fi
- echo $line >> /tmp/rules.debug.tmp
-done < "/tmp/rules.debug"
-
-mv /tmp/rules.debug /tmp/rules.debug.old
-mv /tmp/rules.debug.tmp /tmp/rules.debug
-
-/sbin/pfctl -o basic -f /tmp/rules.debug > /usr/local/www/packages/ipblocklist/errorOUT.txt 2>&1
-
-rm /tmp/rules.debug.tmp
-#Insert ipblocklist rules
-a="0"
-echo $a
-while read line
- do a=$(($a+1));
- echo $a;
- if [ "$a" = "$i" ]; then
- echo "" >> /tmp/rules.debug.tmp
- echo "#ipblocklist" >> /tmp/rules.debug.tmp
- echo "table <ipblocklist> persist file '/usr/local/www/packages/ipblocklist/lists/ipfw.ipfw'" >> /tmp/rules.debug.tmp
- echo "table <ipblocklistW> persist file '/usr/local/www/packages/ipblocklist/Wlists/whitelist'" >> /tmp/rules.debug.tmp
-
- for i in $(cat /usr/local/www/packages/ipblocklist/interfaces.txt); do
- echo "pass quick from <ipblocklistW> to any label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- echo "pass quick from $i to <ipblocklistW> label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- if [ -f /usr/local/www/packages/ipblocklist/logging ]; then
- echo "block log quick from <ipblocklist> to $i label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- else
- echo "block quick from <ipblocklist> to $i label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- fi
- if [ -f /usr/local/www/packages/ipblocklist/OUTBOUND ]; then
- echo "block quick from $i to <ipblocklist> label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- fi
- done
- fi
- echo $line >> /tmp/rules.debug.tmp
-done < "/tmp/rules.debug"
-
-mv /tmp/rules.debug /tmp/rules.debug.old
-mv /tmp/rules.debug.tmp /tmp/rules.debug
-
-#Now execute the ipfw list (Take a long time in old version)
-#sh lists/ipfw.ipfw (Version 0.1.4)
-rm /usr/local/www/packages/ipblocklist/errorOUT.txt
-/sbin/pfctl -o basic -f /tmp/rules.debug > /usr/local/www/packages/ipblocklist/errorOUT.txt 2>&1
diff --git a/config/ipblocklist/8/OUTBOUND b/config/ipblocklist/8/OUTBOUND
deleted file mode 100755
index e69de29b..00000000
--- a/config/ipblocklist/8/OUTBOUND
+++ /dev/null
diff --git a/config/ipblocklist/8/class.phpmailer.tmp b/config/ipblocklist/8/class.phpmailer.tmp
deleted file mode 100755
index a4756c52..00000000
--- a/config/ipblocklist/8/class.phpmailer.tmp
+++ /dev/null
@@ -1,1909 +0,0 @@
-<?php
-/*~ class.phpmailer.php
-.---------------------------------------------------------------------------.
-| Software: PHPMailer - PHP email class |
-| Version: 2.0.4 |
-| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
-| Info: http://phpmailer.sourceforge.net |
-| Support: http://sourceforge.net/projects/phpmailer/ |
-| ------------------------------------------------------------------------- |
-| Author: Andy Prevost (project admininistrator) |
-| Author: Brent R. Matzelle (original founder) |
-| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
-| Copyright (c) 2001-2003, Brent R. Matzelle |
-| ------------------------------------------------------------------------- |
-| License: Distributed under the Lesser General Public License (LGPL) |
-| http://www.gnu.org/copyleft/lesser.html |
-| This program is distributed in the hope that it will be useful - WITHOUT |
-| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
-| FITNESS FOR A PARTICULAR PURPOSE. |
-| ------------------------------------------------------------------------- |
-| We offer a number of paid services (www.codeworxtech.com): |
-| - Web Hosting on highly optimized fast and secure servers |
-| - Technology Consulting |
-| - Oursourcing (highly qualified programmers and graphic designers) |
-'---------------------------------------------------------------------------'
-
-/**
- * PHPMailer - PHP email transport class
- * @package PHPMailer
- * @author Andy Prevost
- * @copyright 2004 - 2009 Andy Prevost
- */
-
-class PHPMailer {
-
- /////////////////////////////////////////////////
- // PROPERTIES, PUBLIC
- /////////////////////////////////////////////////
-
- /**
- * Email priority (1 = High, 3 = Normal, 5 = low).
- * @var int
- */
- var $Priority = 3;
-
- /**
- * Sets the CharSet of the message.
- * @var string
- */
- var $CharSet = 'iso-8859-1';
-
- /**
- * Sets the Content-type of the message.
- * @var string
- */
- var $ContentType = 'text/plain';
-
- /**
- * Sets the Encoding of the message. Options for this are "8bit",
- * "7bit", "binary", "base64", and "quoted-printable".
- * @var string
- */
- var $Encoding = '8bit';
-
- /**
- * Holds the most recent mailer error message.
- * @var string
- */
- var $ErrorInfo = '';
-
- /**
- * Sets the From email address for the message.
- * @var string
- */
- var $From = 'root@localhost';
-
- /**
- * Sets the From name of the message.
- * @var string
- */
- var $FromName = 'Root User';
-
- /**
- * Sets the Sender email (Return-Path) of the message. If not empty,
- * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
- * @var string
- */
- var $Sender = '';
-
- /**
- * Sets the Subject of the message.
- * @var string
- */
- var $Subject = '';
-
- /**
- * Sets the Body of the message. This can be either an HTML or text body.
- * If HTML then run IsHTML(true).
- * @var string
- */
- var $Body = '';
-
- /**
- * Sets the text-only body of the message. This automatically sets the
- * email to multipart/alternative. This body can be read by mail
- * clients that do not have HTML email capability such as mutt. Clients
- * that can read HTML will view the normal Body.
- * @var string
- */
- var $AltBody = '';
-
- /**
- * Sets word wrapping on the body of the message to a given number of
- * characters.
- * @var int
- */
- var $WordWrap = 0;
-
- /**
- * Method to send mail: ("mail", "sendmail", or "smtp").
- * @var string
- */
- var $Mailer = 'mail';
-
- /**
- * Sets the path of the sendmail program.
- * @var string
- */
- var $Sendmail = '/usr/sbin/sendmail';
-
- /**
- * Path to PHPMailer plugins. This is now only useful if the SMTP class
- * is in a different directory than the PHP include path.
- * @var string
- */
- var $PluginDir = '';
-
- /**
- * Holds PHPMailer version.
- * @var string
- */
- var $Version = "2.0.4";
-
- /**
- * Sets the email address that a reading confirmation will be sent.
- * @var string
- */
- var $ConfirmReadingTo = '';
-
- /**
- * Sets the hostname to use in Message-Id and Received headers
- * and as default HELO string. If empty, the value returned
- * by SERVER_NAME is used or 'localhost.localdomain'.
- * @var string
- */
- var $Hostname = '';
-
- /**
- * Sets the message ID to be used in the Message-Id header.
- * If empty, a unique id will be generated.
- * @var string
- */
- var $MessageID = '';
-
- /////////////////////////////////////////////////
- // PROPERTIES FOR SMTP
- /////////////////////////////////////////////////
-
- /**
- * Sets the SMTP hosts. All hosts must be separated by a
- * semicolon. You can also specify a different port
- * for each host by using this format: [hostname:port]
- * (e.g. "smtp1.example.com:25;smtp2.example.com").
- * Hosts will be tried in order.
- * @var string
- */
- var $Host = 'localhost';
-
- /**
- * Sets the default SMTP server port.
- * @var int
- */
- var $Port = 25;
-
- /**
- * Sets the SMTP HELO of the message (Default is $Hostname).
- * @var string
- */
- var $Helo = '';
-
- /**
- * Sets connection prefix.
- * Options are "", "ssl" or "tls"
- * @var string
- */
- var $SMTPSecure = "";
-
- /**
- * Sets SMTP authentication. Utilizes the Username and Password variables.
- * @var bool
- */
- var $SMTPAuth = false;
-
- /**
- * Sets SMTP username.
- * @var string
- */
- var $Username = '';
-
- /**
- * Sets SMTP password.
- * @var string
- */
- var $Password = '';
-
- /**
- * Sets the SMTP server timeout in seconds. This function will not
- * work with the win32 version.
- * @var int
- */
- var $Timeout = 10;
-
- /**
- * Sets SMTP class debugging on or off.
- * @var bool
- */
- var $SMTPDebug = false;
-
- /**
- * Prevents the SMTP connection from being closed after each mail
- * sending. If this is set to true then to close the connection
- * requires an explicit call to SmtpClose().
- * @var bool
- */
- var $SMTPKeepAlive = false;
-
- /**
- * Provides the ability to have the TO field process individual
- * emails, instead of sending to entire TO addresses
- * @var bool
- */
- var $SingleTo = false;
-
- /////////////////////////////////////////////////
- // PROPERTIES, PRIVATE
- /////////////////////////////////////////////////
-
- var $smtp = NULL;
- var $to = array();
- var $cc = array();
- var $bcc = array();
- var $ReplyTo = array();
- var $attachment = array();
- var $CustomHeader = array();
- var $message_type = '';
- var $boundary = array();
- var $language = array();
- var $error_count = 0;
- var $LE = "\n";
- var $sign_cert_file = "";
- var $sign_key_file = "";
- var $sign_key_pass = "";
-
- /////////////////////////////////////////////////
- // METHODS, VARIABLES
- /////////////////////////////////////////////////
-
- /**
- * Sets message type to HTML.
- * @param bool $bool
- * @return void
- */
- function IsHTML($bool) {
- if($bool == true) {
- $this->ContentType = 'text/html';
- } else {
- $this->ContentType = 'text/plain';
- }
- }
-
- /**
- * Sets Mailer to send message using SMTP.
- * @return void
- */
- function IsSMTP() {
- $this->Mailer = 'smtp';
- }
-
- /**
- * Sets Mailer to send message using PHP mail() function.
- * @return void
- */
- function IsMail() {
- $this->Mailer = 'mail';
- }
-
- /**
- * Sets Mailer to send message using the $Sendmail program.
- * @return void
- */
- function IsSendmail() {
- $this->Mailer = 'sendmail';
- }
-
- /**
- * Sets Mailer to send message using the qmail MTA.
- * @return void
- */
- function IsQmail() {
- $this->Sendmail = '/var/qmail/bin/sendmail';
- $this->Mailer = 'sendmail';
- }
-
- /////////////////////////////////////////////////
- // METHODS, RECIPIENTS
- /////////////////////////////////////////////////
-
- /**
- * Adds a "To" address.
- * @param string $address
- * @param string $name
- * @return void
- */
- function AddAddress($address, $name = '') {
- $cur = count($this->to);
- $this->to[$cur][0] = trim($address);
- $this->to[$cur][1] = $name;
- }
-
- /**
- * Adds a "Cc" address. Note: this function works
- * with the SMTP mailer on win32, not with the "mail"
- * mailer.
- * @param string $address
- * @param string $name
- * @return void
- */
- function AddCC($address, $name = '') {
- $cur = count($this->cc);
- $this->cc[$cur][0] = trim($address);
- $this->cc[$cur][1] = $name;
- }
-
- /**
- * Adds a "Bcc" address. Note: this function works
- * with the SMTP mailer on win32, not with the "mail"
- * mailer.
- * @param string $address
- * @param string $name
- * @return void
- */
- function AddBCC($address, $name = '') {
- $cur = count($this->bcc);
- $this->bcc[$cur][0] = trim($address);
- $this->bcc[$cur][1] = $name;
- }
-
- /**
- * Adds a "Reply-To" address.
- * @param string $address
- * @param string $name
- * @return void
- */
- function AddReplyTo($address, $name = '') {
- $cur = count($this->ReplyTo);
- $this->ReplyTo[$cur][0] = trim($address);
- $this->ReplyTo[$cur][1] = $name;
- }
-
- /////////////////////////////////////////////////
- // METHODS, MAIL SENDING
- /////////////////////////////////////////////////
-
- /**
- * Creates message and assigns Mailer. If the message is
- * not sent successfully then it returns false. Use the ErrorInfo
- * variable to view description of the error.
- * @return bool
- */
- function Send() {
- $header = '';
- $body = '';
- $result = true;
-
- if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
- $this->SetError($this->Lang('provide_address'));
- return false;
- }
-
- /* Set whether the message is multipart/alternative */
- if(!empty($this->AltBody)) {
- $this->ContentType = 'multipart/alternative';
- }
-
- $this->error_count = 0; // reset errors
- $this->SetMessageType();
- $header .= $this->CreateHeader();
- $body = $this->CreateBody();
-
- if($body == '') {
- return false;
- }
-
- /* Choose the mailer */
- switch($this->Mailer) {
- case 'sendmail':
- $result = $this->SendmailSend($header, $body);
- break;
- case 'smtp':
- $result = $this->SmtpSend($header, $body);
- break;
- case 'mail':
- $result = $this->MailSend($header, $body);
- break;
- default:
- $result = $this->MailSend($header, $body);
- break;
- //$this->SetError($this->Mailer . $this->Lang('mailer_not_supported'));
- //$result = false;
- //break;
- }
-
- return $result;
- }
-
- /**
- * Sends mail using the $Sendmail program.
- * @access private
- * @return bool
- */
- function SendmailSend($header, $body) {
- if ($this->Sender != '') {
- $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
- } else {
- $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail));
- }
-
- if(!@$mail = popen($sendmail, 'w')) {
- $this->SetError($this->Lang('execute') . $this->Sendmail);
- return false;
- }
-
- fputs($mail, $header);
- fputs($mail, $body);
-
- $result = pclose($mail);
- if (version_compare(phpversion(), '4.2.3') == -1) {
- $result = $result >> 8 & 0xFF;
- }
- if($result != 0) {
- $this->SetError($this->Lang('execute') . $this->Sendmail);
- return false;
- }
- return true;
- }
-
- /**
- * Sends mail using the PHP mail() function.
- * @access private
- * @return bool
- */
- function MailSend($header, $body) {
-
- $to = '';
- for($i = 0; $i < count($this->to); $i++) {
- if($i != 0) { $to .= ', '; }
- $to .= $this->AddrFormat($this->to[$i]);
- }
-
- $toArr = split(',', $to);
-
- $params = sprintf("-oi -f %s", $this->Sender);
- if ($this->Sender != '' && strlen(ini_get('safe_mode')) < 1) {
- $old_from = ini_get('sendmail_from');
- ini_set('sendmail_from', $this->Sender);
- if ($this->SingleTo === true && count($toArr) > 1) {
- foreach ($toArr as $key => $val) {
- $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
- }
- } else {
- $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
- }
- } else {
- if ($this->SingleTo === true && count($toArr) > 1) {
- foreach ($toArr as $key => $val) {
- $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
- }
- } else {
- $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
- }
- }
-
- if (isset($old_from)) {
- ini_set('sendmail_from', $old_from);
- }
-
- if(!$rt) {
- $this->SetError($this->Lang('instantiate'));
- return false;
- }
-
- return true;
- }
-
- /**
- * Sends mail via SMTP using PhpSMTP (Author:
- * Chris Ryan). Returns bool. Returns false if there is a
- * bad MAIL FROM, RCPT, or DATA input.
- * @access private
- * @return bool
- */
- function SmtpSend($header, $body) {
- include_once($this->PluginDir . 'class.smtp.php');
- $error = '';
- $bad_rcpt = array();
-
- if(!$this->SmtpConnect()) {
- return false;
- }
-
- $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
- if(!$this->smtp->Mail($smtp_from)) {
- $error = $this->Lang('from_failed') . $smtp_from;
- $this->SetError($error);
- $this->smtp->Reset();
- return false;
- }
-
- /* Attempt to send attach all recipients */
- for($i = 0; $i < count($this->to); $i++) {
- if(!$this->smtp->Recipient($this->to[$i][0])) {
- $bad_rcpt[] = $this->to[$i][0];
- }
- }
- for($i = 0; $i < count($this->cc); $i++) {
- if(!$this->smtp->Recipient($this->cc[$i][0])) {
- $bad_rcpt[] = $this->cc[$i][0];
- }
- }
- for($i = 0; $i < count($this->bcc); $i++) {
- if(!$this->smtp->Recipient($this->bcc[$i][0])) {
- $bad_rcpt[] = $this->bcc[$i][0];
- }
- }
-
- if(count($bad_rcpt) > 0) { // Create error message
- for($i = 0; $i < count($bad_rcpt); $i++) {
- if($i != 0) {
- $error .= ', ';
- }
- $error .= $bad_rcpt[$i];
- }
- $error = $this->Lang('recipients_failed') . $error;
- $this->SetError($error);
- $this->smtp->Reset();
- return false;
- }
-
- if(!$this->smtp->Data($header . $body)) {
- $this->SetError($this->Lang('data_not_accepted'));
- $this->smtp->Reset();
- return false;
- }
- if($this->SMTPKeepAlive == true) {
- $this->smtp->Reset();
- } else {
- $this->SmtpClose();
- }
-
- return true;
- }
-
- /**
- * Initiates a connection to an SMTP server. Returns false if the
- * operation failed.
- * @access private
- * @return bool
- */
- function SmtpConnect() {
- if($this->smtp == NULL) {
- $this->smtp = new SMTP();
- }
-
- $this->smtp->do_debug = $this->SMTPDebug;
- $hosts = explode(';', $this->Host);
- $index = 0;
- $connection = ($this->smtp->Connected());
-
- /* Retry while there is no connection */
- while($index < count($hosts) && $connection == false) {
- $hostinfo = array();
- if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
- $host = $hostinfo[1];
- $port = $hostinfo[2];
- } else {
- $host = $hosts[$index];
- $port = $this->Port;
- }
-
- if($this->smtp->Connect(((!empty($this->SMTPSecure))?$this->SMTPSecure.'://':'').$host, $port, $this->Timeout)) {
- if ($this->Helo != '') {
- $this->smtp->Hello($this->Helo);
- } else {
- $this->smtp->Hello($this->ServerHostname());
- }
-
- $connection = true;
- if($this->SMTPAuth) {
- if(!$this->smtp->Authenticate($this->Username, $this->Password)) {
- $this->SetError($this->Lang('authenticate'));
- $this->smtp->Reset();
- $connection = false;
- }
- }
- }
- $index++;
- }
- if(!$connection) {
- $this->SetError($this->Lang('connect_host'));
- }
-
- return $connection;
- }
-
- /**
- * Closes the active SMTP session if one exists.
- * @return void
- */
- function SmtpClose() {
- if($this->smtp != NULL) {
- if($this->smtp->Connected()) {
- $this->smtp->Quit();
- $this->smtp->Close();
- }
- }
- }
-
- /**
- * Sets the language for all class error messages. Returns false
- * if it cannot load the language file. The default language type
- * is English.
- * @param string $lang_type Type of language (e.g. Portuguese: "br")
- * @param string $lang_path Path to the language file directory
- * @access public
- * @return bool
- */
- function SetLanguage($lang_type, $lang_path = 'language/') {
- if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php')) {
- include($lang_path.'phpmailer.lang-'.$lang_type.'.php');
- } elseif (file_exists($lang_path.'phpmailer.lang-en.php')) {
- include($lang_path.'phpmailer.lang-en.php');
- } else {
- $PHPMAILER_LANG = array();
- $PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' .
- $PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';
- $PHPMAILER_LANG["execute"] = 'Could not execute: ';
- $PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.';
- $PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.';
- $PHPMAILER_LANG["from_failed"] = 'The following From address failed: ';
- $PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' .
- $PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.';
- $PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.';
- $PHPMAILER_LANG["file_access"] = 'Could not access file: ';
- $PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: ';
- $PHPMAILER_LANG["encoding"] = 'Unknown encoding: ';
- $PHPMAILER_LANG["signing"] = 'Signing Error: ';
- }
- $this->language = $PHPMAILER_LANG;
-
- return true;
- }
-
- /////////////////////////////////////////////////
- // METHODS, MESSAGE CREATION
- /////////////////////////////////////////////////
-
- /**
- * Creates recipient headers.
- * @access private
- * @return string
- */
- function AddrAppend($type, $addr) {
- $addr_str = $type . ': ';
- $addr_str .= $this->AddrFormat($addr[0]);
- if(count($addr) > 1) {
- for($i = 1; $i < count($addr); $i++) {
- $addr_str .= ', ' . $this->AddrFormat($addr[$i]);
- }
- }
- $addr_str .= $this->LE;
-
- return $addr_str;
- }
-
- /**
- * Formats an address correctly.
- * @access private
- * @return string
- */
- function AddrFormat($addr) {
- if(empty($addr[1])) {
- $formatted = $this->SecureHeader($addr[0]);
- } else {
- $formatted = $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">";
- }
-
- return $formatted;
- }
-
- /**
- * Wraps message for use with mailers that do not
- * automatically perform wrapping and for quoted-printable.
- * Original written by philippe.
- * @access private
- * @return string
- */
- function WrapText($message, $length, $qp_mode = false) {
- $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
- // If utf-8 encoding is used, we will need to make sure we don't
- // split multibyte characters when we wrap
- $is_utf8 = (strtolower($this->CharSet) == "utf-8");
-
- $message = $this->FixEOL($message);
- if (substr($message, -1) == $this->LE) {
- $message = substr($message, 0, -1);
- }
-
- $line = explode($this->LE, $message);
- $message = '';
- for ($i=0 ;$i < count($line); $i++) {
- $line_part = explode(' ', $line[$i]);
- $buf = '';
- for ($e = 0; $e<count($line_part); $e++) {
- $word = $line_part[$e];
- if ($qp_mode and (strlen($word) > $length)) {
- $space_left = $length - strlen($buf) - 1;
- if ($e != 0) {
- if ($space_left > 20) {
- $len = $space_left;
- if ($is_utf8) {
- $len = $this->UTF8CharBoundary($word, $len);
- } elseif (substr($word, $len - 1, 1) == "=") {
- $len--;
- } elseif (substr($word, $len - 2, 1) == "=") {
- $len -= 2;
- }
- $part = substr($word, 0, $len);
- $word = substr($word, $len);
- $buf .= ' ' . $part;
- $message .= $buf . sprintf("=%s", $this->LE);
- } else {
- $message .= $buf . $soft_break;
- }
- $buf = '';
- }
- while (strlen($word) > 0) {
- $len = $length;
- if ($is_utf8) {
- $len = $this->UTF8CharBoundary($word, $len);
- } elseif (substr($word, $len - 1, 1) == "=") {
- $len--;
- } elseif (substr($word, $len - 2, 1) == "=") {
- $len -= 2;
- }
- $part = substr($word, 0, $len);
- $word = substr($word, $len);
-
- if (strlen($word) > 0) {
- $message .= $part . sprintf("=%s", $this->LE);
- } else {
- $buf = $part;
- }
- }
- } else {
- $buf_o = $buf;
- $buf .= ($e == 0) ? $word : (' ' . $word);
-
- if (strlen($buf) > $length and $buf_o != '') {
- $message .= $buf_o . $soft_break;
- $buf = $word;
- }
- }
- }
- $message .= $buf . $this->LE;
- }
-
- return $message;
- }
-
- /**
- * Finds last character boundary prior to maxLength in a utf-8
- * quoted (printable) encoded string.
- * Original written by Colin Brown.
- * @access private
- * @param string $encodedText utf-8 QP text
- * @param int $maxLength find last character boundary prior to this length
- * @return int
- */
- function UTF8CharBoundary($encodedText, $maxLength) {
- $foundSplitPos = false;
- $lookBack = 3;
- while (!$foundSplitPos) {
- $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
- $encodedCharPos = strpos($lastChunk, "=");
- if ($encodedCharPos !== false) {
- // Found start of encoded character byte within $lookBack block.
- // Check the encoded byte value (the 2 chars after the '=')
- $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
- $dec = hexdec($hex);
- if ($dec < 128) { // Single byte character.
- // If the encoded char was found at pos 0, it will fit
- // otherwise reduce maxLength to start of the encoded char
- $maxLength = ($encodedCharPos == 0) ? $maxLength :
- $maxLength - ($lookBack - $encodedCharPos);
- $foundSplitPos = true;
- } elseif ($dec >= 192) { // First byte of a multi byte character
- // Reduce maxLength to split at start of character
- $maxLength = $maxLength - ($lookBack - $encodedCharPos);
- $foundSplitPos = true;
- } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back
- $lookBack += 3;
- }
- } else {
- // No encoded character found
- $foundSplitPos = true;
- }
- }
- return $maxLength;
- }
-
- /**
- * Set the body wrapping.
- * @access private
- * @return void
- */
- function SetWordWrap() {
- if($this->WordWrap < 1) {
- return;
- }
-
- switch($this->message_type) {
- case 'alt':
- /* fall through */
- case 'alt_attachments':
- $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap);
- break;
- default:
- $this->Body = $this->WrapText($this->Body, $this->WordWrap);
- break;
- }
- }
-
- /**
- * Assembles message header.
- * @access private
- * @return string
- */
- function CreateHeader() {
- $result = '';
-
- /* Set the boundaries */
- $uniq_id = md5(uniqid(time()));
- $this->boundary[1] = 'b1_' . $uniq_id;
- $this->boundary[2] = 'b2_' . $uniq_id;
-
- $result .= $this->HeaderLine('Date', $this->RFCDate());
- if($this->Sender == '') {
- $result .= $this->HeaderLine('Return-Path', trim($this->From));
- } else {
- $result .= $this->HeaderLine('Return-Path', trim($this->Sender));
- }
-
- /* To be created automatically by mail() */
- if($this->Mailer != 'mail') {
- if(count($this->to) > 0) {
- $result .= $this->AddrAppend('To', $this->to);
- } elseif (count($this->cc) == 0) {
- $result .= $this->HeaderLine('To', 'undisclosed-recipients:;');
- }
- }
-
- $from = array();
- $from[0][0] = trim($this->From);
- $from[0][1] = $this->FromName;
- $result .= $this->AddrAppend('From', $from);
-
- /* sendmail and mail() extract Cc from the header before sending */
- if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->cc) > 0)) {
- $result .= $this->AddrAppend('Cc', $this->cc);
- }
-
- /* sendmail and mail() extract Bcc from the header before sending */
- if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) {
- $result .= $this->AddrAppend('Bcc', $this->bcc);
- }
-
- if(count($this->ReplyTo) > 0) {
- $result .= $this->AddrAppend('Reply-To', $this->ReplyTo);
- }
-
- /* mail() sets the subject itself */
- if($this->Mailer != 'mail') {
- $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject)));
- }
-
- if($this->MessageID != '') {
- $result .= $this->HeaderLine('Message-ID',$this->MessageID);
- } else {
- $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
- }
- $result .= $this->HeaderLine('X-Priority', $this->Priority);
- $result .= $this->HeaderLine('X-Mailer', 'PHPMailer (phpmailer.sourceforge.net) [version ' . $this->Version . ']');
-
- if($this->ConfirmReadingTo != '') {
- $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
- }
-
- // Add custom headers
- for($index = 0; $index < count($this->CustomHeader); $index++) {
- $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
- }
- if (!$this->sign_key_file) {
- $result .= $this->HeaderLine('MIME-Version', '1.0');
- $result .= $this->GetMailMIME();
- }
-
- return $result;
- }
-
- /**
- * Returns the message MIME.
- * @access private
- * @return string
- */
- function GetMailMIME() {
- $result = '';
- switch($this->message_type) {
- case 'plain':
- $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding);
- $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet);
- break;
- case 'attachments':
- /* fall through */
- case 'alt_attachments':
- if($this->InlineImageExists()){
- $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE);
- } else {
- $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;');
- $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
- }
- break;
- case 'alt':
- $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;');
- $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
- break;
- }
-
- if($this->Mailer != 'mail') {
- $result .= $this->LE.$this->LE;
- }
-
- return $result;
- }
-
- /**
- * Assembles the message body. Returns an empty string on failure.
- * @access private
- * @return string
- */
- function CreateBody() {
- $result = '';
- if ($this->sign_key_file) {
- $result .= $this->GetMailMIME();
- }
-
- $this->SetWordWrap();
-
- switch($this->message_type) {
- case 'alt':
- $result .= $this->GetBoundary($this->boundary[1], '', 'text/plain', '');
- $result .= $this->EncodeString($this->AltBody, $this->Encoding);
- $result .= $this->LE.$this->LE;
- $result .= $this->GetBoundary($this->boundary[1], '', 'text/html', '');
- $result .= $this->EncodeString($this->Body, $this->Encoding);
- $result .= $this->LE.$this->LE;
- $result .= $this->EndBoundary($this->boundary[1]);
- break;
- case 'plain':
- $result .= $this->EncodeString($this->Body, $this->Encoding);
- break;
- case 'attachments':
- $result .= $this->GetBoundary($this->boundary[1], '', '', '');
- $result .= $this->EncodeString($this->Body, $this->Encoding);
- $result .= $this->LE;
- $result .= $this->AttachAll();
- break;
- case 'alt_attachments':
- $result .= sprintf("--%s%s", $this->boundary[1], $this->LE);
- $result .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE);
- $result .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body
- $result .= $this->EncodeString($this->AltBody, $this->Encoding);
- $result .= $this->LE.$this->LE;
- $result .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body
- $result .= $this->EncodeString($this->Body, $this->Encoding);
- $result .= $this->LE.$this->LE;
- $result .= $this->EndBoundary($this->boundary[2]);
- $result .= $this->AttachAll();
- break;
- }
-
- if($this->IsError()) {
- $result = '';
- } else if ($this->sign_key_file) {
- $file = tempnam("", "mail");
- $fp = fopen($file, "w");
- fwrite($fp, $result);
- fclose($fp);
- $signed = tempnam("", "signed");
-
- if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), null)) {
- $fp = fopen($signed, "r");
- $result = fread($fp, filesize($this->sign_key_file));
- $result = '';
- while(!feof($fp)){
- $result = $result . fread($fp, 1024);
- }
- fclose($fp);
- } else {
- $this->SetError($this->Lang("signing").openssl_error_string());
- $result = '';
- }
-
- unlink($file);
- unlink($signed);
- }
-
- return $result;
- }
-
- /**
- * Returns the start of a message boundary.
- * @access private
- */
- function GetBoundary($boundary, $charSet, $contentType, $encoding) {
- $result = '';
- if($charSet == '') {
- $charSet = $this->CharSet;
- }
- if($contentType == '') {
- $contentType = $this->ContentType;
- }
- if($encoding == '') {
- $encoding = $this->Encoding;
- }
- $result .= $this->TextLine('--' . $boundary);
- $result .= sprintf("Content-Type: %s; charset = \"%s\"", $contentType, $charSet);
- $result .= $this->LE;
- $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding);
- $result .= $this->LE;
-
- return $result;
- }
-
- /**
- * Returns the end of a message boundary.
- * @access private
- */
- function EndBoundary($boundary) {
- return $this->LE . '--' . $boundary . '--' . $this->LE;
- }
-
- /**
- * Sets the message type.
- * @access private
- * @return void
- */
- function SetMessageType() {
- if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) {
- $this->message_type = 'plain';
- } else {
- if(count($this->attachment) > 0) {
- $this->message_type = 'attachments';
- }
- if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) {
- $this->message_type = 'alt';
- }
- if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) {
- $this->message_type = 'alt_attachments';
- }
- }
- }
-
- /* Returns a formatted header line.
- * @access private
- * @return string
- */
- function HeaderLine($name, $value) {
- return $name . ': ' . $value . $this->LE;
- }
-
- /**
- * Returns a formatted mail line.
- * @access private
- * @return string
- */
- function TextLine($value) {
- return $value . $this->LE;
- }
-
- /////////////////////////////////////////////////
- // CLASS METHODS, ATTACHMENTS
- /////////////////////////////////////////////////
-
- /**
- * Adds an attachment from a path on the filesystem.
- * Returns false if the file could not be found
- * or accessed.
- * @param string $path Path to the attachment.
- * @param string $name Overrides the attachment name.
- * @param string $encoding File encoding (see $Encoding).
- * @param string $type File extension (MIME) type.
- * @return bool
- */
- function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
- if(!@is_file($path)) {
- $this->SetError($this->Lang('file_access') . $path);
- return false;
- }
-
- $filename = basename($path);
- if($name == '') {
- $name = $filename;
- }
-
- $cur = count($this->attachment);
- $this->attachment[$cur][0] = $path;
- $this->attachment[$cur][1] = $filename;
- $this->attachment[$cur][2] = $name;
- $this->attachment[$cur][3] = $encoding;
- $this->attachment[$cur][4] = $type;
- $this->attachment[$cur][5] = false; // isStringAttachment
- $this->attachment[$cur][6] = 'attachment';
- $this->attachment[$cur][7] = 0;
-
- return true;
- }
-
- /**
- * Attaches all fs, string, and binary attachments to the message.
- * Returns an empty string on failure.
- * @access private
- * @return string
- */
- function AttachAll() {
- /* Return text of body */
- $mime = array();
-
- /* Add all attachments */
- for($i = 0; $i < count($this->attachment); $i++) {
- /* Check for string attachment */
- $bString = $this->attachment[$i][5];
- if ($bString) {
- $string = $this->attachment[$i][0];
- } else {
- $path = $this->attachment[$i][0];
- }
-
- $filename = $this->attachment[$i][1];
- $name = $this->attachment[$i][2];
- $encoding = $this->attachment[$i][3];
- $type = $this->attachment[$i][4];
- $disposition = $this->attachment[$i][6];
- $cid = $this->attachment[$i][7];
-
- $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
- $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE);
- $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
-
- if($disposition == 'inline') {
- $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);
- }
-
- $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE);
-
- /* Encode as string attachment */
- if($bString) {
- $mime[] = $this->EncodeString($string, $encoding);
- if($this->IsError()) {
- return '';
- }
- $mime[] = $this->LE.$this->LE;
- } else {
- $mime[] = $this->EncodeFile($path, $encoding);
- if($this->IsError()) {
- return '';
- }
- $mime[] = $this->LE.$this->LE;
- }
- }
-
- $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE);
-
- return join('', $mime);
- }
-
- /**
- * Encodes attachment in requested format. Returns an
- * empty string on failure.
- * @access private
- * @return string
- */
- function EncodeFile ($path, $encoding = 'base64') {
- if(!@$fd = fopen($path, 'rb')) {
- $this->SetError($this->Lang('file_open') . $path);
- return '';
- }
- $magic_quotes = get_magic_quotes_runtime();
- set_magic_quotes_runtime(0);
- $file_buffer = fread($fd, filesize($path));
- $file_buffer = $this->EncodeString($file_buffer, $encoding);
- fclose($fd);
- set_magic_quotes_runtime($magic_quotes);
-
- return $file_buffer;
- }
-
- /**
- * Encodes string to requested format. Returns an
- * empty string on failure.
- * @access private
- * @return string
- */
- function EncodeString ($str, $encoding = 'base64') {
- $encoded = '';
- switch(strtolower($encoding)) {
- case 'base64':
- /* chunk_split is found in PHP >= 3.0.6 */
- $encoded = chunk_split(base64_encode($str), 76, $this->LE);
- break;
- case '7bit':
- case '8bit':
- $encoded = $this->FixEOL($str);
- if (substr($encoded, -(strlen($this->LE))) != $this->LE)
- $encoded .= $this->LE;
- break;
- case 'binary':
- $encoded = $str;
- break;
- case 'quoted-printable':
- $encoded = $this->EncodeQP($str);
- break;
- default:
- $this->SetError($this->Lang('encoding') . $encoding);
- break;
- }
- return $encoded;
- }
-
- /**
- * Encode a header string to best of Q, B, quoted or none.
- * @access private
- * @return string
- */
- function EncodeHeader ($str, $position = 'text') {
- $x = 0;
-
- switch (strtolower($position)) {
- case 'phrase':
- if (!preg_match('/[\200-\377]/', $str)) {
- /* Can't use addslashes as we don't know what value has magic_quotes_sybase. */
- $encoded = addcslashes($str, "\0..\37\177\\\"");
- if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
- return ($encoded);
- } else {
- return ("\"$encoded\"");
- }
- }
- $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
- break;
- case 'comment':
- $x = preg_match_all('/[()"]/', $str, $matches);
- /* Fall-through */
- case 'text':
- default:
- $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
- break;
- }
-
- if ($x == 0) {
- return ($str);
- }
-
- $maxlen = 75 - 7 - strlen($this->CharSet);
- /* Try to select the encoding which should produce the shortest output */
- if (strlen($str)/3 < $x) {
- $encoding = 'B';
- if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) {
- // Use a custom function which correctly encodes and wraps long
- // multibyte strings without breaking lines within a character
- $encoded = $this->Base64EncodeWrapMB($str);
- } else {
- $encoded = base64_encode($str);
- $maxlen -= $maxlen % 4;
- $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
- }
- } else {
- $encoding = 'Q';
- $encoded = $this->EncodeQ($str, $position);
- $encoded = $this->WrapText($encoded, $maxlen, true);
- $encoded = str_replace('='.$this->LE, "\n", trim($encoded));
- }
-
- $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
- $encoded = trim(str_replace("\n", $this->LE, $encoded));
-
- return $encoded;
- }
-
- /**
- * Checks if a string contains multibyte characters.
- * @access private
- * @param string $str multi-byte text to wrap encode
- * @return bool
- */
- function HasMultiBytes($str) {
- if (function_exists('mb_strlen')) {
- return (strlen($str) > mb_strlen($str, $this->CharSet));
- } else { // Assume no multibytes (we can't handle without mbstring functions anyway)
- return False;
- }
- }
-
- /**
- * Correctly encodes and wraps long multibyte strings for mail headers
- * without breaking lines within a character.
- * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php
- * @access private
- * @param string $str multi-byte text to wrap encode
- * @return string
- */
- function Base64EncodeWrapMB($str) {
- $start = "=?".$this->CharSet."?B?";
- $end = "?=";
- $encoded = "";
-
- $mb_length = mb_strlen($str, $this->CharSet);
- // Each line must have length <= 75, including $start and $end
- $length = 75 - strlen($start) - strlen($end);
- // Average multi-byte ratio
- $ratio = $mb_length / strlen($str);
- // Base64 has a 4:3 ratio
- $offset = $avgLength = floor($length * $ratio * .75);
-
- for ($i = 0; $i < $mb_length; $i += $offset) {
- $lookBack = 0;
-
- do {
- $offset = $avgLength - $lookBack;
- $chunk = mb_substr($str, $i, $offset, $this->CharSet);
- $chunk = base64_encode($chunk);
- $lookBack++;
- }
- while (strlen($chunk) > $length);
-
- $encoded .= $chunk . $this->LE;
- }
-
- // Chomp the last linefeed
- $encoded = substr($encoded, 0, -strlen($this->LE));
- return $encoded;
- }
-
- /**
- * Encode string to quoted-printable.
- * @access private
- * @return string
- */
- function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
- $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
- $lines = preg_split('/(?:\r\n|\r|\n)/', $input);
- $eol = "\r\n";
- $escape = '=';
- $output = '';
- while( list(, $line) = each($lines) ) {
- $linlen = strlen($line);
- $newline = '';
- for($i = 0; $i < $linlen; $i++) {
- $c = substr( $line, $i, 1 );
- $dec = ord( $c );
- if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E
- $c = '=2E';
- }
- if ( $dec == 32 ) {
- if ( $i == ( $linlen - 1 ) ) { // convert space at eol only
- $c = '=20';
- } else if ( $space_conv ) {
- $c = '=20';
- }
- } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required
- $h2 = floor($dec/16);
- $h1 = floor($dec%16);
- $c = $escape.$hex[$h2].$hex[$h1];
- }
- if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted
- $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay
- $newline = '';
- // check if newline first character will be point or not
- if ( $dec == 46 ) {
- $c = '=2E';
- }
- }
- $newline .= $c;
- } // end of for
- $output .= $newline.$eol;
- } // end of while
- return $output;
- }
-
- /**
- * Encode string to q encoding.
- * @access private
- * @return string
- */
- function EncodeQ ($str, $position = 'text') {
- /* There should not be any EOL in the string */
- $encoded = preg_replace("[\r\n]", '', $str);
-
- switch (strtolower($position)) {
- case 'phrase':
- $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
- break;
- case 'comment':
- $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
- case 'text':
- default:
- /* Replace every high ascii, control =, ? and _ characters */
- $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
- "'='.sprintf('%02X', ord('\\1'))", $encoded);
- break;
- }
-
- /* Replace every spaces to _ (more readable than =20) */
- $encoded = str_replace(' ', '_', $encoded);
-
- return $encoded;
- }
-
- /**
- * Adds a string or binary attachment (non-filesystem) to the list.
- * This method can be used to attach ascii or binary data,
- * such as a BLOB record from a database.
- * @param string $string String attachment data.
- * @param string $filename Name of the attachment.
- * @param string $encoding File encoding (see $Encoding).
- * @param string $type File extension (MIME) type.
- * @return void
- */
- function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') {
- /* Append to $attachment array */
- $cur = count($this->attachment);
- $this->attachment[$cur][0] = $string;
- $this->attachment[$cur][1] = $filename;
- $this->attachment[$cur][2] = $filename;
- $this->attachment[$cur][3] = $encoding;
- $this->attachment[$cur][4] = $type;
- $this->attachment[$cur][5] = true; // isString
- $this->attachment[$cur][6] = 'attachment';
- $this->attachment[$cur][7] = 0;
- }
-
- /**
- * Adds an embedded attachment. This can include images, sounds, and
- * just about any other document. Make sure to set the $type to an
- * image type. For JPEG images use "image/jpeg" and for GIF images
- * use "image/gif".
- * @param string $path Path to the attachment.
- * @param string $cid Content ID of the attachment. Use this to identify
- * the Id for accessing the image in an HTML form.
- * @param string $name Overrides the attachment name.
- * @param string $encoding File encoding (see $Encoding).
- * @param string $type File extension (MIME) type.
- * @return bool
- */
- function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
-
- if(!@is_file($path)) {
- $this->SetError($this->Lang('file_access') . $path);
- return false;
- }
-
- $filename = basename($path);
- if($name == '') {
- $name = $filename;
- }
-
- /* Append to $attachment array */
- $cur = count($this->attachment);
- $this->attachment[$cur][0] = $path;
- $this->attachment[$cur][1] = $filename;
- $this->attachment[$cur][2] = $name;
- $this->attachment[$cur][3] = $encoding;
- $this->attachment[$cur][4] = $type;
- $this->attachment[$cur][5] = false;
- $this->attachment[$cur][6] = 'inline';
- $this->attachment[$cur][7] = $cid;
-
- return true;
- }
-
- /**
- * Returns true if an inline attachment is present.
- * @access private
- * @return bool
- */
- function InlineImageExists() {
- $result = false;
- for($i = 0; $i < count($this->attachment); $i++) {
- if($this->attachment[$i][6] == 'inline') {
- $result = true;
- break;
- }
- }
-
- return $result;
- }
-
- /////////////////////////////////////////////////
- // CLASS METHODS, MESSAGE RESET
- /////////////////////////////////////////////////
-
- /**
- * Clears all recipients assigned in the TO array. Returns void.
- * @return void
- */
- function ClearAddresses() {
- $this->to = array();
- }
-
- /**
- * Clears all recipients assigned in the CC array. Returns void.
- * @return void
- */
- function ClearCCs() {
- $this->cc = array();
- }
-
- /**
- * Clears all recipients assigned in the BCC array. Returns void.
- * @return void
- */
- function ClearBCCs() {
- $this->bcc = array();
- }
-
- /**
- * Clears all recipients assigned in the ReplyTo array. Returns void.
- * @return void
- */
- function ClearReplyTos() {
- $this->ReplyTo = array();
- }
-
- /**
- * Clears all recipients assigned in the TO, CC and BCC
- * array. Returns void.
- * @return void
- */
- function ClearAllRecipients() {
- $this->to = array();
- $this->cc = array();
- $this->bcc = array();
- }
-
- /**
- * Clears all previously set filesystem, string, and binary
- * attachments. Returns void.
- * @return void
- */
- function ClearAttachments() {
- $this->attachment = array();
- }
-
- /**
- * Clears all custom headers. Returns void.
- * @return void
- */
- function ClearCustomHeaders() {
- $this->CustomHeader = array();
- }
-
- /////////////////////////////////////////////////
- // CLASS METHODS, MISCELLANEOUS
- /////////////////////////////////////////////////
-
- /**
- * Adds the error message to the error container.
- * Returns void.
- * @access private
- * @return void
- */
- function SetError($msg) {
- $this->error_count++;
- $this->ErrorInfo = $msg;
- }
-
- /**
- * Returns the proper RFC 822 formatted date.
- * @access private
- * @return string
- */
- function RFCDate() {
- $tz = date('Z');
- $tzs = ($tz < 0) ? '-' : '+';
- $tz = abs($tz);
- $tz = (int)($tz/3600)*100 + ($tz%3600)/60;
- $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz);
-
- return $result;
- }
-
- /**
- * Returns the appropriate server variable. Should work with both
- * PHP 4.1.0+ as well as older versions. Returns an empty string
- * if nothing is found.
- * @access private
- * @return mixed
- */
- function ServerVar($varName) {
- global $HTTP_SERVER_VARS;
- global $HTTP_ENV_VARS;
-
- if(!isset($_SERVER)) {
- $_SERVER = $HTTP_SERVER_VARS;
- if(!isset($_SERVER['REMOTE_ADDR'])) {
- $_SERVER = $HTTP_ENV_VARS; // must be Apache
- }
- }
-
- if(isset($_SERVER[$varName])) {
- return $_SERVER[$varName];
- } else {
- return '';
- }
- }
-
- /**
- * Returns the server hostname or 'localhost.localdomain' if unknown.
- * @access private
- * @return string
- */
- function ServerHostname() {
- if ($this->Hostname != '') {
- $result = $this->Hostname;
- } elseif ($this->ServerVar('SERVER_NAME') != '') {
- $result = $this->ServerVar('SERVER_NAME');
- } else {
- $result = 'localhost.localdomain';
- }
-
- return $result;
- }
-
- /**
- * Returns a message in the appropriate language.
- * @access private
- * @return string
- */
- function Lang($key) {
- if(count($this->language) < 1) {
- $this->SetLanguage('en'); // set the default language
- }
-
- if(isset($this->language[$key])) {
- return $this->language[$key];
- } else {
- return 'Language string failed to load: ' . $key;
- }
- }
-
- /**
- * Returns true if an error occurred.
- * @return bool
- */
- function IsError() {
- return ($this->error_count > 0);
- }
-
- /**
- * Changes every end of line from CR or LF to CRLF.
- * @access private
- * @return string
- */
- function FixEOL($str) {
- $str = str_replace("\r\n", "\n", $str);
- $str = str_replace("\r", "\n", $str);
- $str = str_replace("\n", $this->LE, $str);
- return $str;
- }
-
- /**
- * Adds a custom header.
- * @return void
- */
- function AddCustomHeader($custom_header) {
- $this->CustomHeader[] = explode(':', $custom_header, 2);
- }
-
- /**
- * Evaluates the message and returns modifications for inline images and backgrounds
- * @access public
- * @return $message
- */
- function MsgHTML($message,$basedir='') {
- preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images);
- if(isset($images[2])) {
- foreach($images[2] as $i => $url) {
- // do not change urls for absolute images (thanks to corvuscorax)
- if (!preg_match('/^[A-z][A-z]*:\/\//',$url)) {
- $filename = basename($url);
- $directory = dirname($url);
- ($directory == '.')?$directory='':'';
- $cid = 'cid:' . md5($filename);
- $fileParts = split("\.", $filename);
- $ext = $fileParts[1];
- $mimeType = $this->_mime_types($ext);
- if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; }
- if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; }
- if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) {
- $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message);
- }
- }
- }
- }
- $this->IsHTML(true);
- $this->Body = $message;
- $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message)));
- if ( !empty($textMsg) && empty($this->AltBody) ) {
- $this->AltBody = html_entity_decode($textMsg);
- }
- if ( empty($this->AltBody) ) {
- $this->AltBody = 'To view this email message, open the email in with HTML compatibility!' . "\n\n";
- }
- }
-
- /**
- * Gets the mime type of the embedded or inline image
- * @access private
- * @return mime type of ext
- */
- function _mime_types($ext = '') {
- $mimes = array(
- 'ai' => 'application/postscript',
- 'aif' => 'audio/x-aiff',
- 'aifc' => 'audio/x-aiff',
- 'aiff' => 'audio/x-aiff',
- 'avi' => 'video/x-msvideo',
- 'bin' => 'application/macbinary',
- 'bmp' => 'image/bmp',
- 'class' => 'application/octet-stream',
- 'cpt' => 'application/mac-compactpro',
- 'css' => 'text/css',
- 'dcr' => 'application/x-director',
- 'dir' => 'application/x-director',
- 'dll' => 'application/octet-stream',
- 'dms' => 'application/octet-stream',
- 'doc' => 'application/msword',
- 'dvi' => 'application/x-dvi',
- 'dxr' => 'application/x-director',
- 'eml' => 'message/rfc822',
- 'eps' => 'application/postscript',
- 'exe' => 'application/octet-stream',
- 'gif' => 'image/gif',
- 'gtar' => 'application/x-gtar',
- 'htm' => 'text/html',
- 'html' => 'text/html',
- 'jpe' => 'image/jpeg',
- 'jpeg' => 'image/jpeg',
- 'jpg' => 'image/jpeg',
- 'hqx' => 'application/mac-binhex40',
- 'js' => 'application/x-javascript',
- 'lha' => 'application/octet-stream',
- 'log' => 'text/plain',
- 'lzh' => 'application/octet-stream',
- 'mid' => 'audio/midi',
- 'midi' => 'audio/midi',
- 'mif' => 'application/vnd.mif',
- 'mov' => 'video/quicktime',
- 'movie' => 'video/x-sgi-movie',
- 'mp2' => 'audio/mpeg',
- 'mp3' => 'audio/mpeg',
- 'mpe' => 'video/mpeg',
- 'mpeg' => 'video/mpeg',
- 'mpg' => 'video/mpeg',
- 'mpga' => 'audio/mpeg',
- 'oda' => 'application/oda',
- 'pdf' => 'application/pdf',
- 'php' => 'application/x-httpd-php',
- 'php3' => 'application/x-httpd-php',
- 'php4' => 'application/x-httpd-php',
- 'phps' => 'application/x-httpd-php-source',
- 'phtml' => 'application/x-httpd-php',
- 'png' => 'image/png',
- 'ppt' => 'application/vnd.ms-powerpoint',
- 'ps' => 'application/postscript',
- 'psd' => 'application/octet-stream',
- 'qt' => 'video/quicktime',
- 'ra' => 'audio/x-realaudio',
- 'ram' => 'audio/x-pn-realaudio',
- 'rm' => 'audio/x-pn-realaudio',
- 'rpm' => 'audio/x-pn-realaudio-plugin',
- 'rtf' => 'text/rtf',
- 'rtx' => 'text/richtext',
- 'rv' => 'video/vnd.rn-realvideo',
- 'sea' => 'application/octet-stream',
- 'shtml' => 'text/html',
- 'sit' => 'application/x-stuffit',
- 'so' => 'application/octet-stream',
- 'smi' => 'application/smil',
- 'smil' => 'application/smil',
- 'swf' => 'application/x-shockwave-flash',
- 'tar' => 'application/x-tar',
- 'text' => 'text/plain',
- 'txt' => 'text/plain',
- 'tgz' => 'application/x-tar',
- 'tif' => 'image/tiff',
- 'tiff' => 'image/tiff',
- 'wav' => 'audio/x-wav',
- 'wbxml' => 'application/vnd.wap.wbxml',
- 'wmlc' => 'application/vnd.wap.wmlc',
- 'word' => 'application/msword',
- 'xht' => 'application/xhtml+xml',
- 'xhtml' => 'application/xhtml+xml',
- 'xl' => 'application/excel',
- 'xls' => 'application/vnd.ms-excel',
- 'xml' => 'text/xml',
- 'xsl' => 'text/xml',
- 'zip' => 'application/zip'
- );
- return ( ! isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)];
- }
-
- /**
- * Set (or reset) Class Objects (variables)
- *
- * Usage Example:
- * $page->set('X-Priority', '3');
- *
- * @access public
- * @param string $name Parameter Name
- * @param mixed $value Parameter Value
- * NOTE: will not work with arrays, there are no arrays to set/reset
- */
- function set ( $name, $value = '' ) {
- if ( isset($this->$name) ) {
- $this->$name = $value;
- } else {
- $this->SetError('Cannot set or reset variable ' . $name);
- return false;
- }
- }
-
- /**
- * Read a file from a supplied filename and return it.
- *
- * @access public
- * @param string $filename Parameter File Name
- */
- function getFile($filename) {
- $return = '';
- if ($fp = fopen($filename, 'rb')) {
- while (!feof($fp)) {
- $return .= fread($fp, 1024);
- }
- fclose($fp);
- return $return;
- } else {
- return false;
- }
- }
-
- /**
- * Strips newlines to prevent header injection.
- * @access private
- * @param string $str String
- * @return string
- */
- function SecureHeader($str) {
- $str = trim($str);
- $str = str_replace("\r", "", $str);
- $str = str_replace("\n", "", $str);
- return $str;
- }
-
- /**
- * Set the private key file and password to sign the message.
- *
- * @access public
- * @param string $key_filename Parameter File Name
- * @param string $key_pass Password for private key
- */
- function Sign($cert_filename, $key_filename, $key_pass) {
- $this->sign_cert_file = $cert_filename;
- $this->sign_key_file = $key_filename;
- $this->sign_key_pass = $key_pass;
- }
-
-}
-
-?>
diff --git a/config/ipblocklist/8/class.smtp.tmp b/config/ipblocklist/8/class.smtp.tmp
deleted file mode 100755
index be084a11..00000000
--- a/config/ipblocklist/8/class.smtp.tmp
+++ /dev/null
@@ -1,1062 +0,0 @@
-<?php
-/*~ class.smtp.php
-.---------------------------------------------------------------------------.
-| Software: PHPMailer - PHP email class |
-| Version: 2.0.4 |
-| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
-| Info: http://phpmailer.sourceforge.net |
-| Support: http://sourceforge.net/projects/phpmailer/ |
-| ------------------------------------------------------------------------- |
-| Author: Andy Prevost (project admininistrator) |
-| Author: Brent R. Matzelle (original founder) |
-| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
-| Copyright (c) 2001-2003, Brent R. Matzelle |
-| ------------------------------------------------------------------------- |
-| License: Distributed under the Lesser General Public License (LGPL) |
-| http://www.gnu.org/copyleft/lesser.html |
-| This program is distributed in the hope that it will be useful - WITHOUT |
-| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
-| FITNESS FOR A PARTICULAR PURPOSE. |
-| ------------------------------------------------------------------------- |
-| We offer a number of paid services (www.codeworxtech.com): |
-| - Web Hosting on highly optimized fast and secure servers |
-| - Technology Consulting |
-| - Oursourcing (highly qualified programmers and graphic designers) |
-'---------------------------------------------------------------------------'
-
-/**
- * SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
- * commands except TURN which will always return a not implemented
- * error. SMTP also provides some utility methods for sending mail
- * to an SMTP server.
- * @package PHPMailer
- * @author Chris Ryan
- */
-
-class SMTP
-{
- /**
- * SMTP server port
- * @var int
- */
- var $SMTP_PORT = 25;
-
- /**
- * SMTP reply line ending
- * @var string
- */
- var $CRLF = "\r\n";
-
- /**
- * Sets whether debugging is turned on
- * @var bool
- */
- var $do_debug; # the level of debug to perform
-
- /**
- * Sets VERP use on/off (default is off)
- * @var bool
- */
- var $do_verp = false;
-
- /**#@+
- * @access private
- */
- var $smtp_conn; # the socket to the server
- var $error; # error if any on the last call
- var $helo_rply; # the reply the server sent to us for HELO
- /**#@-*/
-
- /**
- * Initialize the class so that the data is in a known state.
- * @access public
- * @return void
- */
- function SMTP() {
- $this->smtp_conn = 0;
- $this->error = null;
- $this->helo_rply = null;
-
- $this->do_debug = 0;
- }
-
- /*************************************************************
- * CONNECTION FUNCTIONS *
- ***********************************************************/
-
- /**
- * Connect to the server specified on the port specified.
- * If the port is not specified use the default SMTP_PORT.
- * If tval is specified then a connection will try and be
- * established with the server for that number of seconds.
- * If tval is not specified the default is 30 seconds to
- * try on the connection.
- *
- * SMTP CODE SUCCESS: 220
- * SMTP CODE FAILURE: 421
- * @access public
- * @return bool
- */
- function Connect($host,$port=0,$tval=30) {
- # set the error val to null so there is no confusion
- $this->error = null;
-
- # make sure we are __not__ connected
- if($this->connected()) {
- # ok we are connected! what should we do?
- # for now we will just give an error saying we
- # are already connected
- $this->error = array("error" => "Already connected to a server");
- return false;
- }
-
- if(empty($port)) {
- $port = $this->SMTP_PORT;
- }
-
- #connect to the smtp server
- $this->smtp_conn = fsockopen($host, # the host of the server
- $port, # the port to use
- $errno, # error number if any
- $errstr, # error message if any
- $tval); # give up after ? secs
- # verify we connected properly
- if(empty($this->smtp_conn)) {
- $this->error = array("error" => "Failed to connect to server",
- "errno" => $errno,
- "errstr" => $errstr);
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": $errstr ($errno)" . $this->CRLF;
- }
- return false;
- }
-
- # sometimes the SMTP server takes a little longer to respond
- # so we will give it a longer timeout for the first read
- // Windows still does not have support for this timeout function
- if(substr(PHP_OS, 0, 3) != "WIN")
- socket_set_timeout($this->smtp_conn, $tval, 0);
-
- # get any announcement stuff
- $announce = $this->get_lines();
-
- # set the timeout of any socket functions at 1/10 of a second
- //if(function_exists("socket_set_timeout"))
- // socket_set_timeout($this->smtp_conn, 0, 100000);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce;
- }
-
- return true;
- }
-
- /**
- * Performs SMTP authentication. Must be run after running the
- * Hello() method. Returns true if successfully authenticated.
- * @access public
- * @return bool
- */
- function Authenticate($username, $password) {
- // Start authentication
- fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($code != 334) {
- $this->error =
- array("error" => "AUTH not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- // Send encoded username
- fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($code != 334) {
- $this->error =
- array("error" => "Username not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- // Send encoded password
- fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($code != 235) {
- $this->error =
- array("error" => "Password not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- return true;
- }
-
- /**
- * Returns true if connected to a server otherwise false
- * @access private
- * @return bool
- */
- function Connected() {
- if(!empty($this->smtp_conn)) {
- $sock_status = socket_get_status($this->smtp_conn);
- if($sock_status["eof"]) {
- # hmm this is an odd situation... the socket is
- # valid but we are not connected anymore
- if($this->do_debug >= 1) {
- echo "SMTP -> NOTICE:" . $this->CRLF .
- "EOF caught while checking if connected";
- }
- $this->Close();
- return false;
- }
- return true; # everything looks good
- }
- return false;
- }
-
- /**
- * Closes the socket and cleans up the state of the class.
- * It is not considered good to use this function without
- * first trying to use QUIT.
- * @access public
- * @return void
- */
- function Close() {
- $this->error = null; # so there is no confusion
- $this->helo_rply = null;
- if(!empty($this->smtp_conn)) {
- # close the connection and cleanup
- fclose($this->smtp_conn);
- $this->smtp_conn = 0;
- }
- }
-
- /***************************************************************
- * SMTP COMMANDS *
- *************************************************************/
-
- /**
- * Issues a data command and sends the msg_data to the server
- * finializing the mail transaction. $msg_data is the message
- * that is to be send with the headers. Each header needs to be
- * on a single line followed by a <CRLF> with the message headers
- * and the message body being seperated by and additional <CRLF>.
- *
- * Implements rfc 821: DATA <CRLF>
- *
- * SMTP CODE INTERMEDIATE: 354
- * [data]
- * <CRLF>.<CRLF>
- * SMTP CODE SUCCESS: 250
- * SMTP CODE FAILURE: 552,554,451,452
- * SMTP CODE FAILURE: 451,554
- * SMTP CODE ERROR : 500,501,503,421
- * @access public
- * @return bool
- */
- function Data($msg_data) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Data() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"DATA" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 354) {
- $this->error =
- array("error" => "DATA command not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- # the server is ready to accept data!
- # according to rfc 821 we should not send more than 1000
- # including the CRLF
- # characters on a single line so we will break the data up
- # into lines by \r and/or \n then if needed we will break
- # each of those into smaller lines to fit within the limit.
- # in addition we will be looking for lines that start with
- # a period '.' and append and additional period '.' to that
- # line. NOTE: this does not count towards are limit.
-
- # normalize the line breaks so we know the explode works
- $msg_data = str_replace("\r\n","\n",$msg_data);
- $msg_data = str_replace("\r","\n",$msg_data);
- $lines = explode("\n",$msg_data);
-
- # we need to find a good way to determine is headers are
- # in the msg_data or if it is a straight msg body
- # currently I am assuming rfc 822 definitions of msg headers
- # and if the first field of the first line (':' sperated)
- # does not contain a space then it _should_ be a header
- # and we can process all lines before a blank "" line as
- # headers.
- $field = substr($lines[0],0,strpos($lines[0],":"));
- $in_headers = false;
- if(!empty($field) && !strstr($field," ")) {
- $in_headers = true;
- }
-
- $max_line_length = 998; # used below; set here for ease in change
-
- while(list(,$line) = @each($lines)) {
- $lines_out = null;
- if($line == "" && $in_headers) {
- $in_headers = false;
- }
- # ok we need to break this line up into several
- # smaller lines
- while(strlen($line) > $max_line_length) {
- $pos = strrpos(substr($line,0,$max_line_length)," ");
-
- # Patch to fix DOS attack
- if(!$pos) {
- $pos = $max_line_length - 1;
- }
-
- $lines_out[] = substr($line,0,$pos);
- $line = substr($line,$pos + 1);
- # if we are processing headers we need to
- # add a LWSP-char to the front of the new line
- # rfc 822 on long msg headers
- if($in_headers) {
- $line = "\t" . $line;
- }
- }
- $lines_out[] = $line;
-
- # now send the lines to the server
- while(list(,$line_out) = @each($lines_out)) {
- if(strlen($line_out) > 0)
- {
- if(substr($line_out, 0, 1) == ".") {
- $line_out = "." . $line_out;
- }
- }
- fputs($this->smtp_conn,$line_out . $this->CRLF);
- }
- }
-
- # ok all the message data has been sent so lets get this
- # over with aleady
- fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "DATA not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Expand takes the name and asks the server to list all the
- * people who are members of the _list_. Expand will return
- * back and array of the result or false if an error occurs.
- * Each value in the array returned has the format of:
- * [ <full-name> <sp> ] <path>
- * The definition of <path> is defined in rfc 821
- *
- * Implements rfc 821: EXPN <SP> <string> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE FAILURE: 550
- * SMTP CODE ERROR : 500,501,502,504,421
- * @access public
- * @return string array
- */
- function Expand($name) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Expand() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "EXPN not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- # parse the reply and place in our array to return to user
- $entries = explode($this->CRLF,$rply);
- while(list(,$l) = @each($entries)) {
- $list[] = substr($l,4);
- }
-
- return $list;
- }
-
- /**
- * Sends the HELO command to the smtp server.
- * This makes sure that we and the server are in
- * the same known state.
- *
- * Implements from rfc 821: HELO <SP> <domain> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE ERROR : 500, 501, 504, 421
- * @access public
- * @return bool
- */
- function Hello($host="") {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Hello() without being connected");
- return false;
- }
-
- # if a hostname for the HELO was not specified determine
- # a suitable one to send
- if(empty($host)) {
- # we need to determine some sort of appopiate default
- # to send to the server
- $host = "localhost";
- }
-
- // Send extended hello first (RFC 2821)
- if(!$this->SendHello("EHLO", $host))
- {
- if(!$this->SendHello("HELO", $host))
- return false;
- }
-
- return true;
- }
-
- /**
- * Sends a HELO/EHLO command.
- * @access private
- * @return bool
- */
- function SendHello($hello, $host) {
- fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => $hello . " not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- $this->helo_rply = $rply;
-
- return true;
- }
-
- /**
- * Gets help information on the keyword specified. If the keyword
- * is not specified then returns generic help, ussually contianing
- * A list of keywords that help is available on. This function
- * returns the results back to the user. It is up to the user to
- * handle the returned data. If an error occurs then false is
- * returned with $this->error set appropiately.
- *
- * Implements rfc 821: HELP [ <SP> <string> ] <CRLF>
- *
- * SMTP CODE SUCCESS: 211,214
- * SMTP CODE ERROR : 500,501,502,504,421
- * @access public
- * @return string
- */
- function Help($keyword="") {
- $this->error = null; # to avoid confusion
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Help() without being connected");
- return false;
- }
-
- $extra = "";
- if(!empty($keyword)) {
- $extra = " " . $keyword;
- }
-
- fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 211 && $code != 214) {
- $this->error =
- array("error" => "HELP not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- return $rply;
- }
-
- /**
- * Starts a mail transaction from the email address specified in
- * $from. Returns true if successful or false otherwise. If True
- * the mail transaction is started and then one or more Recipient
- * commands may be called followed by a Data command.
- *
- * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE SUCCESS: 552,451,452
- * SMTP CODE SUCCESS: 500,501,421
- * @access public
- * @return bool
- */
- function Mail($from) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Mail() without being connected");
- return false;
- }
-
- $useVerp = ($this->do_verp ? "XVERP" : "");
- fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "MAIL not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Sends the command NOOP to the SMTP server.
- *
- * Implements from rfc 821: NOOP <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE ERROR : 500, 421
- * @access public
- * @return bool
- */
- function Noop() {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Noop() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"NOOP" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "NOOP not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Sends the quit command to the server and then closes the socket
- * if there is no error or the $close_on_error argument is true.
- *
- * Implements from rfc 821: QUIT <CRLF>
- *
- * SMTP CODE SUCCESS: 221
- * SMTP CODE ERROR : 500
- * @access public
- * @return bool
- */
- function Quit($close_on_error=true) {
- $this->error = null; # so there is no confusion
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Quit() without being connected");
- return false;
- }
-
- # send the quit command to the server
- fputs($this->smtp_conn,"quit" . $this->CRLF);
-
- # get any good-bye messages
- $byemsg = $this->get_lines();
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg;
- }
-
- $rval = true;
- $e = null;
-
- $code = substr($byemsg,0,3);
- if($code != 221) {
- # use e as a tmp var cause Close will overwrite $this->error
- $e = array("error" => "SMTP server rejected quit command",
- "smtp_code" => $code,
- "smtp_rply" => substr($byemsg,4));
- $rval = false;
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $e["error"] . ": " .
- $byemsg . $this->CRLF;
- }
- }
-
- if(empty($e) || $close_on_error) {
- $this->Close();
- }
-
- return $rval;
- }
-
- /**
- * Sends the command RCPT to the SMTP server with the TO: argument of $to.
- * Returns true if the recipient was accepted false if it was rejected.
- *
- * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250,251
- * SMTP CODE FAILURE: 550,551,552,553,450,451,452
- * SMTP CODE ERROR : 500,501,503,421
- * @access public
- * @return bool
- */
- function Recipient($to) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Recipient() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250 && $code != 251) {
- $this->error =
- array("error" => "RCPT not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Sends the RSET command to abort and transaction that is
- * currently in progress. Returns true if successful false
- * otherwise.
- *
- * Implements rfc 821: RSET <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE ERROR : 500,501,504,421
- * @access public
- * @return bool
- */
- function Reset() {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Reset() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"RSET" . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "RSET failed",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
-
- return true;
- }
-
- /**
- * Starts a mail transaction from the email address specified in
- * $from. Returns true if successful or false otherwise. If True
- * the mail transaction is started and then one or more Recipient
- * commands may be called followed by a Data command. This command
- * will send the message to the users terminal if they are logged
- * in.
- *
- * Implements rfc 821: SEND <SP> FROM:<reverse-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE SUCCESS: 552,451,452
- * SMTP CODE SUCCESS: 500,501,502,421
- * @access public
- * @return bool
- */
- function Send($from) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Send() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "SEND not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Starts a mail transaction from the email address specified in
- * $from. Returns true if successful or false otherwise. If True
- * the mail transaction is started and then one or more Recipient
- * commands may be called followed by a Data command. This command
- * will send the message to the users terminal if they are logged
- * in and send them an email.
- *
- * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE SUCCESS: 552,451,452
- * SMTP CODE SUCCESS: 500,501,502,421
- * @access public
- * @return bool
- */
- function SendAndMail($from) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called SendAndMail() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "SAML not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Starts a mail transaction from the email address specified in
- * $from. Returns true if successful or false otherwise. If True
- * the mail transaction is started and then one or more Recipient
- * commands may be called followed by a Data command. This command
- * will send the message to the users terminal if they are logged
- * in or mail it to them if they are not.
- *
- * Implements rfc 821: SOML <SP> FROM:<reverse-path> <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE SUCCESS: 552,451,452
- * SMTP CODE SUCCESS: 500,501,502,421
- * @access public
- * @return bool
- */
- function SendOrMail($from) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called SendOrMail() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250) {
- $this->error =
- array("error" => "SOML not accepted from server",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return true;
- }
-
- /**
- * This is an optional command for SMTP that this class does not
- * support. This method is here to make the RFC821 Definition
- * complete for this class and __may__ be implimented in the future
- *
- * Implements from rfc 821: TURN <CRLF>
- *
- * SMTP CODE SUCCESS: 250
- * SMTP CODE FAILURE: 502
- * SMTP CODE ERROR : 500, 503
- * @access public
- * @return bool
- */
- function Turn() {
- $this->error = array("error" => "This method, TURN, of the SMTP ".
- "is not implemented");
- if($this->do_debug >= 1) {
- echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF;
- }
- return false;
- }
-
- /**
- * Verifies that the name is recognized by the server.
- * Returns false if the name could not be verified otherwise
- * the response from the server is returned.
- *
- * Implements rfc 821: VRFY <SP> <string> <CRLF>
- *
- * SMTP CODE SUCCESS: 250,251
- * SMTP CODE FAILURE: 550,551,553
- * SMTP CODE ERROR : 500,501,502,421
- * @access public
- * @return int
- */
- function Verify($name) {
- $this->error = null; # so no confusion is caused
-
- if(!$this->connected()) {
- $this->error = array(
- "error" => "Called Verify() without being connected");
- return false;
- }
-
- fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF);
-
- $rply = $this->get_lines();
- $code = substr($rply,0,3);
-
- if($this->do_debug >= 2) {
- echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
- }
-
- if($code != 250 && $code != 251) {
- $this->error =
- array("error" => "VRFY failed on name '$name'",
- "smtp_code" => $code,
- "smtp_msg" => substr($rply,4));
- if($this->do_debug >= 1) {
- echo "SMTP -> ERROR: " . $this->error["error"] .
- ": " . $rply . $this->CRLF;
- }
- return false;
- }
- return $rply;
- }
-
- /*******************************************************************
- * INTERNAL FUNCTIONS *
- ******************************************************************/
-
- /**
- * Read in as many lines as possible
- * either before eof or socket timeout occurs on the operation.
- * With SMTP we can tell if we have more lines to read if the
- * 4th character is '-' symbol. If it is a space then we don't
- * need to read anything else.
- * @access private
- * @return string
- */
- function get_lines() {
- $data = "";
- while($str = @fgets($this->smtp_conn,515)) {
- if($this->do_debug >= 4) {
- echo "SMTP -> get_lines(): \$data was \"$data\"" .
- $this->CRLF;
- echo "SMTP -> get_lines(): \$str is \"$str\"" .
- $this->CRLF;
- }
- $data .= $str;
- if($this->do_debug >= 4) {
- echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF;
- }
- # if the 4th character is a space then we are done reading
- # so just break the loop
- if(substr($str,3,1) == " ") { break; }
- }
- return $data;
- }
-
-}
-
-
- ?>
diff --git a/config/ipblocklist/8/convert-execute.sh b/config/ipblocklist/8/convert-execute.sh
deleted file mode 100755
index 75daf448..00000000
--- a/config/ipblocklist/8/convert-execute.sh
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/bin/sh
-
-#check if ipblocklist running
-#export resultr=`pfctl -s rules | grep -c ipblocklist`
-
-#echo $resultr
-#if [ "$resultr" -gt "0" ]; then
-# echo running
-# exit 1
-#else
-# echo not running
-# /usr/bin/logger -s "IP-Blocklist was found not running"
-# echo "IP-Blocklist not running" | /usr/local/bin/php /usr/local/www/packages/ipblocklist/email_send.php
-#fi
-
-
-#kill tables to elminate dups
-/sbin/pfctl -t ipblocklist -T kill
-/sbin/pfctl -t ipblocklistW -T kill
-/usr/bin/sed -i -e '/ipblocklist/d' /tmp/rules.debug
-/usr/bin/sed -i -e '/ipblocklistW/d' /tmp/rules.debug
-
-#Generate lists to process
-ls /usr/local/www/packages/ipblocklist/lists > /usr/local/www/packages/ipblocklist/file_list.txt
-ls /usr/local/www/packages/ipblocklist/Wlists > /usr/local/www/packages/ipblocklist/file_Wlist.txt
-filelist="/usr/local/www/packages/ipblocklist/file_list.txt"
-Wfilelist="/usr/local/www/packages/ipblocklist/file_Wlist.txt"
-
-#READ contents in file_list.txt and process as file
-for fileline in $(cat $filelist); do
-iplist="/usr/local/www/packages/ipblocklist/lists/$fileline"
-iplistout="/usr/local/www/packages/ipblocklist/lists/ipfw.ipfw"
-if [ "$iplist" != "/usr/local/www/packages/ipblocklist/lists/ipfw.ipfw" ]; then
- /usr/bin/perl /usr/local/www/packages/ipblocklist/convert.pl $iplist $iplistout
- #echo "THIS JUST RAN"
-fi
-done
-
-#Whitelist
-for Wfileline in $(cat $Wfilelist); do
-Wiplist="/usr/local/www/packages/ipblocklist/Wlists/$Wfileline"
-Wiplistout="/usr/local/www/packages/ipblocklist/Wlists/whitelist"
-/usr/bin/perl convert.pl $Wiplist $Wiplistout
-done
-#echo "ipfw made"
-
-#clean up ipfw.ipfw (duplicates)
-rm /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP
-/usr/bin/sort lists/ipfw.ipfw | uniq >> /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP
-mv /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP /usr/local/www/packages/ipblocklist/lists/ipfw.ipfw
-#echo "ipfw clean"
-
-#clean up whitelist (duplicates)
-rm Wlists/whitelistTEMP
-/usr/bin/sort Wlists/whitelist | uniq >> Wlists/whitelistTEMP
-mv Wlists/whitelistTEMP Wlists/whitelist
-#echo "whitelist clean"
-
-
-
-#Now edit /tmp/rules.debug
-
-#find my line for table
-export i=`grep -n 'block quick from any to <snort2c>' /tmp/rules.debug | grep -o '[0-9]\{2,4\}'`
-export t=`grep -n 'User Aliases' /tmp/rules.debug |grep -o '[0-9]\{1,2\}'`
-
-i=$(($i+'1'))
-t=$(($t+'1'))
-#echo $i
-#echo $t
-
-rm /tmp/rules.debug.tmp
-
-#Insert table-entry limit
-/usr/bin/sed -i -e '/900000/d' /tmp/rules.debug
-while read line
- do a=$(($a+1));
- #echo $a;
- if [ "$a" = "$t" ]; then
- echo "" >> /tmp/rules.debug.tmp
- echo "set limit table-entries 900000" >> /tmp/rules.debug.tmp
- fi
- echo $line >> /tmp/rules.debug.tmp
-done < "/tmp/rules.debug"
-
-mv /tmp/rules.debug /tmp/rules.debug.old
-mv /tmp/rules.debug.tmp /tmp/rules.debug
-
-/sbin/pfctl -o basic -f /tmp/rules.debug > /usr/local/www/packages/ipblocklist/errorOUT.txt 2>&1
-
-rm /tmp/rules.debug.tmp
-#Insert ipblocklist rules
-a="0"
-echo $a
-while read line
- do a=$(($a+1));
- echo $a;
- if [ "$a" = "$i" ]; then
- echo "" >> /tmp/rules.debug.tmp
- echo "#ipblocklist" >> /tmp/rules.debug.tmp
- echo "table <ipblocklist> persist file '/usr/local/www/packages/ipblocklist/lists/ipfw.ipfw'" >> /tmp/rules.debug.tmp
- echo "table <ipblocklistW> persist file '/usr/local/www/packages/ipblocklist/Wlists/whitelist'" >> /tmp/rules.debug.tmp
-
- for i in $(cat /usr/local/www/packages/ipblocklist/interfaces.txt); do
- echo "pass quick from <ipblocklistW> to any label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- echo "pass quick from $i to <ipblocklistW> label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- if [ -f /usr/local/www/packages/ipblocklist/logging ]; then
- echo "block log quick from <ipblocklist> to $i label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- else
- echo "block quick from <ipblocklist> to $i label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- fi
- if [ -f /usr/local/www/packages/ipblocklist/OUTBOUND ]; then
- echo "block quick from $i to <ipblocklist> label 'IP-Blocklist'" >> /tmp/rules.debug.tmp
- fi
- done
- fi
- echo $line >> /tmp/rules.debug.tmp
-done < "/tmp/rules.debug"
-
-mv /tmp/rules.debug /tmp/rules.debug.old
-mv /tmp/rules.debug.tmp /tmp/rules.debug
-
-#Now execute the ipfw list (Take a long time in old version)
-#sh lists/ipfw.ipfw (Version 0.1.4)
-rm /usr/local/www/packages/ipblocklist/errorOUT.txt
-/sbin/pfctl -o basic -f /tmp/rules.debug > /usr/local/www/packages/ipblocklist/errorOUT.txt 2>&1
diff --git a/config/ipblocklist/8/convert.pl b/config/ipblocklist/8/convert.pl
deleted file mode 100755
index f3e9db12..00000000
--- a/config/ipblocklist/8/convert.pl
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-if($#ARGV != 1) {
- print("Usage: $0 <input file> <output file>\n");
- exit(1);
-}
-
-my ($line,$title,$iprange,$cidr);
-my $i = 30000;
-
-open(INFILE,'<',$ARGV[0]) or die("Could not open input file $ARGV[0]");
-open(OUTFILE,'>>',$ARGV[1]) or die("Could not open output file $ARGV[1]");
-
-foreach $line (<INFILE>) {
- chomp($line);
- $line =~ s/:((\d{1,3}[-\.]*){8})//;
- $iprange = $1;
- print OUTFILE "#$line\n";
- foreach $cidr (split(/\n/,range($iprange))) {
- print OUTFILE "$cidr\n";
- #print OUTFILE "ipfw -q add 1000 drop ip from any to $cidr\n"; (version 0.1.4)
- #$i++;
- #print OUTFILE "ipfw -q add 1001 drop ip from $cidr to any\n"; (version 0.1.4)
- #$i++;
- }
-}
-
-close(INFILE);
-close(OUTFILE);
-
-sub ntoa {
- return join ".",unpack("CCCC",pack("N",shift));
-}
-sub aton {
- return unpack 'N', pack 'C4', split/\./, shift;
-}
-sub deaggregate {
- my $thirtytwobits = 4294967295;
- my $start = shift;
- my $end = shift;
- my $base = $start;
- my ($step,$output);
- while ($base <= $end) {
- $step = 0;
- while (($base | (1 << $step)) != $base) {
- if (($base | (((~0) & $thirtytwobits) >> (31-$step))) > $end) {
- last;
- }
- $step++;
- }
- if($step == 0) {
- $output .= ntoa($base);
- }else{
- $output .= ntoa($base)."/" .(32-$step);
- }
- $output .= "\n";
- $base += 1 << $step;
- }
- return $output;
-}
-sub range {
- my ($address,$address2) = split /-/, shift;
- $address = aton($address);
- $address2 = aton($address2);
- return deaggregate($address,$address2);
-}
diff --git a/config/ipblocklist/8/countryblock_IPBlocklist.widget.tmp b/config/ipblocklist/8/countryblock_IPBlocklist.widget.tmp
deleted file mode 100644
index 546e27c4..00000000
--- a/config/ipblocklist/8/countryblock_IPBlocklist.widget.tmp
+++ /dev/null
@@ -1,116 +0,0 @@
-<?php
-/*
- Copyright 2011 Thomas Schaefer - Tomschaefer.org
- Part of pfSense widgets (www.pfsense.org)
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$nocsrf = true;
-
-@require_once("guiconfig.inc");
-@require_once("pfsense-utils.inc");
-@require_once("functions.inc");
-
-$ipblocklist_file = "/usr/local/www/packages/ipblocklist/ipblocklist.php";
-$countryblock_file = "/usr/local/www/packages/countryblock/countryblock.php";
-
-echo "<table style=\"padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"";
-echo" <tr>";
-if (file_exists($ipblocklist_file)) {
- echo " <td class=\"listhdrr\">IP-Blocklist";
- ob_start();
- $results = exec("/sbin/pfctl -s rules | grep -c ipblocklist");
- ob_end_clean();
- if ($results > '2') echo "<img src ='/themes/{$g['theme']}/images/icons/icon_interface_up.gif'>";
- else
- echo "<img src ='/themes/{$g['theme']}/images/icons/icon_interface_down.gif'>";
- echo "</td>";
-}
-if (file_exists($countryblock_file)) {
- echo " <td class=\"listhdrr\">Countryblock";
- ob_start();
- $results = exec("/sbin/pfctl -s rules | grep -c countryblock");
- ob_end_clean();
- if ($results > '0') echo "<img src ='/themes/{$g['theme']}/images/icons/icon_interface_up.gif'>";
- else
- echo "<img src ='/themes/{$g['theme']}/images/icons/icon_interface_down.gif'>";
- echo "</td>";
-}
-echo" </tr>";
-echo" <tr>";
-if (file_exists($ipblocklist_file)) {
- echo " <td class=\"listlr\">";
- ob_start();
- $resultsIP = exec("/sbin/pfctl -T show -t ipblocklist |grep -v -c Z");
- ob_end_clean();
- echo $resultsIP;
- echo " Networks";
- echo "</td>";
-}
-if (file_exists($countryblock_file)) {
- echo " <td class=\"listr\">";
- ob_start();
- $resultsCB = exec("pfctl -T show -t countryblock |grep -v -c Z");
- ob_end_clean();
- echo $resultsCB;
- echo " Networks";
- echo "</td>";
-}
-echo" </tr>";
-echo" <tr>";
-if (file_exists($ipblocklist_file)) {
- ob_start();
- $resultsIP = exec("tail -r /usr/local/www/packages/ipblocklist/errorOUT.txt");
- ob_end_clean();
- if ($resultsIP == "") {
- echo " <td></td>";
- } else {
- echo " <td class=\"listlr\">";
- echo "<br/><span style='color:red'>";
- echo $resultsIP;
- echo "</span>";
- echo "</td>";
- }
-}
-if (file_exists($countryblock_file)) {
- ob_start();
- $resultsCB = exec("tail -r /usr/local/www/packages/countryblock/errorOUT.txt");
- ob_end_clean();
- if ($resultsCB == "") {
- echo " <td></td>";
- } else {
- echo " <td class=\"listlr\">";
- echo "<br/><span style='color:red'>";
- echo $resultsCB;
- echo "</span>";
- echo "</td>";
- }
-}
-echo" </tr>";
-//echo" <tr>";
-//if (file_exists($ipblocklist_file)) echo " <td>&nbsp;</td>";
-//if (file_exists($countryblock_file)) echo " <td>&nbsp;</td>";
-//echo" </tr>";
-echo"</table>";
-
-?>
diff --git a/config/ipblocklist/8/email.tmp b/config/ipblocklist/8/email.tmp
deleted file mode 100755
index abeb4932..00000000
--- a/config/ipblocklist/8/email.tmp
+++ /dev/null
@@ -1,268 +0,0 @@
-<?php
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-//$pgtitle = "Firewall: ipblocklist - Email";
-
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/ipblocklist/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-
-if (isset($_GET['save'])) {
- exec("rm email_send.php");
- exec("touch email_send.php");
- $file = "email_send.php";
- $smtp_auth = $_POST['smtp_auth'];
- $smtp_secure = $_POST['smtp_secure'];
- $host = $_POST['host'];
- $port = $_POST['port'];
- $user = $_POST['user'];
- $pass = $_POST['pass'];
- $html = $_POST['html'];
- $from = $_POST['from'];
- $to = $_POST['to'];
- $subject = $_POST['subject'];
- $fp = fopen($file, "w") or die("Couldn't open $file for writing!");
- fwrite($fp, "<?php\ninclude(\"class.phpmailer.php\");\n\$mail = new PHPMailer();
-\n\$mail->IsSMTP();\n\$mail->SMTPAuth = ") or die("Couldn't write values to file!");
- fwrite($fp, $smtp_auth) or die("Couldn't write values to file!");
- fwrite($fp, ";\n\$mail->SMTPSecure = \"") or die("Couldn't write values to file!");
- fwrite($fp, $smtp_secure) or die("Couldn't write values to file!");
- fwrite($fp, "\";\n\$mail->Host = \"") or die("Couldn't write values to file!");
- fwrite($fp, $host) or die("Couldn't write values to file!");
- fwrite($fp, "\";\n\$mail->Port = ") or die("Couldn't write values to file!");
- fwrite($fp, $port) or die("Couldn't write values to file!");
- fwrite($fp, ";\n\$mail->Username = \"") or die("Couldn't write values to file!");
- fwrite($fp, $user);
- fwrite($fp, "\";\n\$mail->Password = \"") or die("Couldn't write values to file!");
- fwrite($fp, $pass);
- fwrite($fp, "\";\n\$mail->AddReplyTo(\"") or die("Couldn't write values to file!");
- fwrite($fp, $from) or die("Couldn't write values to file!");
- fwrite($fp, "\",\"pfsense ipblocklist\");\n\$mail->From = \"") or die("Couldn't write values to file!");
- fwrite($fp, $from) or die("Couldn't write values to file!");
- fwrite($fp, "\";\n\$mail->Subject = \"" . $subject . "\";\n\$mail->AltBody = \"To view the message, please use an HTML compatible email viewer!\";\n\$mail->WordWrap = 50;\n\$body = \"IP-Blocklist encountered an event. A system log entry was made with details of event\";\n\$body .= \"<br><br>\" . date('l jS \of F Y h:i:s A') . \"<br><br>Current Status = \";\nob_start();\n\$results = exec(\"pfctl -s rules | grep -c ipblocklist\");\nob_end_clean();\nif (\$results > '0')\n\$body .= \"Running\";\nelse\n\$body .= \"<span style='color:red'>Restarting</span>\";\nob_start();\n\$results = exec(\"tail -r /usr/local/www/packages/ipblocklist/errorOUT.txt\");\nob_end_clean();\n\$body .= \"<br/><span style='color:red'>\";\n\$body .= \$results;\n\$body .= \"</span>\";\n\$body .= \"<br>You are blocking \";\nob_start();\n\$results = exec(\"pfctl -T show -t ipblocklist |grep -v -c Z\");\nob_end_clean();\n\$body .= \$results;\n\$body .= \" Networks\";\n\n\$mail->MsgHTML(\$body);\n\$mail->AddAddress(\"") or die("Couldn't write values to file!");
- fwrite($fp, $to) or die("Couldn't write values to file!");
- fwrite($fp, "\");\n\$mail->IsHTML(") or die("Couldn't write values to file!");
- fwrite($fp, $html) or die("Couldn't write values to file!");
- fwrite($fp, ");\n\nif(!\$mail->Send()) {\n echo \"Mailer Error: \" . \$mail->ErrorInfo;\n} else {\n echo \"Message sent! - <a href=email.php>Go Back</a>\";\n}\n?>") or die("Couldn't write values to file!");
- fclose($fp);
- //echo "Saved successfully!";
-
- exec("rm email_config.html");
- exec("touch email_config.html");
- $file2 = "email_config.html";
- $fp2 = fopen($file2, "w") or die("Couldn't open $file for writing!");
- fwrite($fp2, "<table width=\"100%\" b align=\"center\">
- <tr>
- <td>SMTP Auth</td>") or die("Couldn't write values to file!");
- if ($smtp_auth=="true")
- fwrite($fp2, "<td><select name=\"smtp_auth\"><option label=\"true\" value=\"true\" selected>Yes</option><option label=\"false\" value=\"false\">No</option></select></td>") or die("Couldn't write values to file!");
- else
- fwrite($fp2, "<td><select name=\"smtp_auth\"><option label=\"true\" value=\"true\">Yes</option><option label=\"false\" value=\"false\" selected>No</option></select></td>") or die("Couldn't write values to file!");
- fwrite($fp2, "</tr>
- <tr class=\"d0\">
- <td>SMTP Security</td>") or die("Couldn't write values to file!");
- if ($smtp_secure=="ssl")
- fwrite($fp2, "<td><select name=\"smtp_secure\"><option label=\"ssl\" value=\"ssl\" selected>ssl</option><option label=\"none\" value=\"none\">None</option></select></td>") or die("Couldn't write values to file!");
- else
- fwrite($fp2, "<td><select name=\"smtp_secure\"><option label=\"ssl\" value=\"ssl\">ssl</option><option label=\"none\" value=\"none\" selected>None</option></select></td>") or die("Couldn't write values to file!");
- fwrite($fp2, "</tr>
- <tr>
- <td>Host</td>
- <td><input type=\"text\" name=\"host\" value=\"" . $host ."\"></td>
- </tr>
- <tr class=\"d0\">
- <td>Port</td>
- <td><input type=\"port\" name=\"port\" value=\"" . $port . "\"></td>
- </tr>
- <tr>
- <td>Username</td>
- <td><input type=\"user\" name=\"user\" value=\"" . $user . "\"></td>
- </tr>
- <tr class=\"d0\">
- <td>Password</td>
- <td><input type=\"password\" name=\"pass\" value=\"" . $pass . "\"></td>
- </tr>
- <tr>
- <td>Use HTML formatting</td>") or die("Couldn't write values to file!");
- if ($html=="true")
- fwrite($fp2, "<td><select name=\"html\"><option label=\"true\" value=\"true\" selected>Yes</option><option label=\"false\" value=\"false\">No</option></select></td>") or die("Couldn't write values to file!");
- else
- fwrite($fp2, "<td><select name=\"html\"><option label=\"true\" value=\"true\">Yes</option><option label=\"false\" value=\"false\" selected>No</option></select></td>") or die("Couldn't write values to file!");
- fwrite($fp2, "</tr>
- <tr class=\"d0\">
- <td>From email address</td>
- <td><input type=\"from\" name=\"from\" value=\"" . $from . "\"></td>
- </tr>
- <tr>
- <td>To email address</td>
- <td><input type=\"to\" name=\"to\" value=\"" . $to . "\"></td>
- </tr>
- <tr class=\"d0\">
- <td>Subject</td>
- <td><input type=\"subject\" name=\"subject\" value=\"" . $subject . "\"></td>
- </tr>
-</table>
-<br>
-<input type=\"submit\" value=\"Save\">
-</form>") or die("Couldn't write values to file!");
- fclose($fp2);
-}
-if (isset($_GET['test'])) {
- echo '<script type="text/javascript">' . "\n";
- echo 'window.location="email_send.php";';
- echo '</script>';
-}
-if (isset($_GET['reset'])) {
- exec ("rm email_send.php");
- exec ("rm email_config.html");
- echo '<script type="text/javascript">' . "\n";
- echo 'window.location="email.php";';
- echo '</script>';
-}
-?>
-
-<html>
-<head>
-<style type="text/css">
-.style1 {
- text-align: center;
-}
-tr.d0 td {
- background-color: #eedddd; color: black;
-}
-</style>
-
-</head>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-
-
-<br /><br />
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("IP-Blocklist", false, "ipblocklist.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "ipblocklist_if.php");
- $tab_array[4] = array("Help", false, "https://doc.pfsense.org/index.php/IP_Blocklist");
- $tab_array[5] = array("Email", true, "email.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Email Settings for SMTP mail</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
-
-<form name="emailform" method="post" action="email.php?save=1">
-<?php
-if (file_exists("email_send.php")) {
- echo "<p>Your settings have already been set. Would you like to overwrite your email settings?</p>\n";
- $content = file_get_contents('email_config.html');
- echo $content;
- echo "<p>\n";
- echo "<input name=\"resetbutton\" type=\"button\" value=\"Reset email config\" onClick=\"window.location='email.php?reset=1'\" />\n";
- echo "</p>\n";
- echo "\n";
-} else {
- echo "<table width=\"100%\" b align=\"center\">\n";
- echo " <tr>\n";
- echo " <td>SMTP Auth</td>\n";
- echo " <td><select name=\"smtp_auth\"><option label=\"true\" value=\"true\">Yes</option><option label=\"false\" value=\"false\">No</option></select></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>SMTP Security</td>\n";
- echo " <td><select name=\"smtp_secure\"><option label=\"ssl\" value=\"ssl\">ssl</option><option label=\"none\" value=\"none\">None</option></select></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Host</td>\n";
- echo " <td><input type=\"text\" name=\"host\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>Port</td>\n";
- echo " <td><input type=\"port\" name=\"port\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Username</td>\n";
- echo " <td><input type=\"user\" name=\"user\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>Password</td>\n";
- echo " <td><input type=\"password\" name=\"pass\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>Use HTML formatting</td>\n";
- echo " <td><select name=\"html\"><option label=\"true\" value=\"true\">Yes</option><option label=\"false\" value=\"false\">No</option></select></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>From email address</td>\n";
- echo " <td><input type=\"from\" name=\"from\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr>\n";
- echo " <td>To email address</td>\n";
- echo " <td><input type=\"to\" name=\"to\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo " <tr class=\"d0\">\n";
- echo " <td>Subject</td>\n";
- echo " <td><input type=\"subject\" name=\"subject\" value=\"\"></td>\n";
- echo " </tr>\n";
- echo "</table>\n";
- echo "\n";
- echo "<br>\n";
- echo "<input type=\"submit\" value=\"Save\">\n";
- echo "\n";
- echo "\n";
- echo "\n";
- echo "</form>\n";
-}
-?>
-
-<input type="button" value="Test" onClick="window.location='email.php?test=1'">
-
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-
-<br>
-
-
-<br><br>
-
-<p>
-</p>
-</td>
- </tr>
-</table>
-
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/ipblocklist/8/firewall_shaper.tmp b/config/ipblocklist/8/firewall_shaper.tmp
deleted file mode 100755
index 833f87f8..00000000
--- a/config/ipblocklist/8/firewall_shaper.tmp
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<HEAD>
-<SCRIPT language="JavaScript">
-<!--
-window.parent.location="../../firewall_shaper.php";
-//-->
-</SCRIPT>
-</HEAD>
-
-
-</html>
diff --git a/config/ipblocklist/8/index.tmp b/config/ipblocklist/8/index.tmp
deleted file mode 100755
index bcbfad8f..00000000
--- a/config/ipblocklist/8/index.tmp
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<HEAD>
-<SCRIPT language="JavaScript">
-<!--
-window.parent.location="../../index.php";
-//-->
-</SCRIPT>
-</HEAD>
-
-
-</html>
diff --git a/config/ipblocklist/8/interfaces.txt b/config/ipblocklist/8/interfaces.txt
deleted file mode 100755
index faba42a4..00000000
--- a/config/ipblocklist/8/interfaces.txt
+++ /dev/null
@@ -1 +0,0 @@
-any
diff --git a/config/ipblocklist/8/ipblocklist.inc b/config/ipblocklist/8/ipblocklist.inc
deleted file mode 100755
index 396631ec..00000000
--- a/config/ipblocklist/8/ipblocklist.inc
+++ /dev/null
@@ -1,140 +0,0 @@
-<?php
-/* $Id$ */
-/*
-/* ========================================================================== */
-/*
- ipblocklist.inc
- Copyright (C) 2012 Tom Schaefer
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-function php_sync_package_ip()
-{
- global $config;
-}
-
-
-function php_install_command_ip()
-{
-
- global $config;
- conf_mount_rw();
- config_lock();
-
- if (!is_dir('/usr/local/www/packages/')) {
- exec("mkdir /usr/local/www/packages/");
- }
-
- if (!is_dir('/usr/local/www/packages/ipblocklist/')) {
- exec("mkdir /usr/local/www/packages/ipblocklist/");
- }
-
-
- //install PERL
- exec("pkg_add -r ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/All/perl-5.12.4_2.tbz");
- exec("pkg_add -r ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/All/p5-Net-CIDR-0.14.tbz");
- //exec("pkg_add -r compat7x-i386.tbz");
- //exec("pkg_add -r compat6x-i386.tbz");
- exec("rehash");
-
- //rename PHP files from .tmp to .php
- exec("cp /tmp/countryblock_IPBlocklist.widget.tmp /usr/local/www/widgets/widgets/countryblock_IPBlocklist.widget.php");
- unlink_if_exists("/tmp/countryblock_IPBlocklist.widget.tmp");
-
- exec("cp /tmp/lists.txt /usr/local/www/packages/ipblocklist/lists.txt");
- exec("cp /tmp/class.phpmailer.tmp /usr/local/www/packages/ipblocklist/class.phpmailer.php");
- unlink_if_exists("/tmp/class.phpmailer.tmp ");
- exec("cp /tmp/class.smtp.tmp /usr/local/www/packages/ipblocklist/class.smtp.php");
- unlink_if_exists("/tmp/class.smtp.tmp");
- exec("cp /tmp/email.tmp /usr/local/www/packages/ipblocklist/email.php");
- unlink_if_exists("/tmp/email.tmp");
- exec("cp /tmp/ipblocklist_if.tmp /usr/local/www/packages/ipblocklist/ipblocklist_if.php");
- unlink_if_exists("/tmp/ipblocklist_if.tmp");
- exec("cp /tmp/settings.tmp /usr/local/www/packages/ipblocklist/settings.php");
- unlink_if_exists("/tmp/settings.tmp");
- exec("cp /tmp/interfaces.txt /usr/local/www/packages/ipblocklist/interfaces.txt");
- unlink_if_exists("/tmp/interfaces.txt");
- exec("cp /tmp/firewall_shaper.tmp /usr/local/www/packages/ipblocklist/firewall_shaper.php");
- unlink_if_exists("/tmp/firewall_shaper.tmp");
-
- exec("cp /tmp/ipblocklist.tmp /usr/local/www/packages/ipblocklist/ipblocklist.php");
- unlink_if_exists("/tmp/ipblocklist.tmp");
- exec("cp /tmp/ipblocklist_list.tmp /usr/local/www/packages/ipblocklist/ipblocklist_list.php");
- unlink_if_exists("/tmp/ipblocklist_list.tmp");
- exec("cp /tmp/purge.tmp /usr/local/www/packages/ipblocklist/purge.php");
- unlink_if_exists("/tmp/purge.tmp");
- exec("cp /tmp/index.tmp /usr/local/www/packages/ipblocklist/index.php");
- unlink_if_exists("/tmp/index.tmp");
- exec("cp /tmp/whitelist.tmp /usr/local/www/packages/ipblocklist/whitelist.php");
- unlink_if_exists("/tmp/whitelist.tmp");
- exec("cp /tmp/purgeip.tmp /usr/local/www/packages/ipblocklist/purgeip.php");
- unlink_if_exists("/tmp/purgeip.tmp");
- //Get scripts
- exec("cp /tmp/convert.pl /usr/local/www/packages/ipblocklist/convert.pl");
- unlink_if_exists("/tmp/convert.pl");
- exec("cp /tmp/convert-execute.sh /usr/local/www/packages/ipblocklist/convert-execute.sh");
- unlink_if_exists("/tmp/convert-execute.sh");
- exec("cp /tmp/IP-Blocklist.sh /usr/local/etc/rc.d/IP-Blocklist.sh");
- exec("cp /tmp/IP-Blocklist.sh /usr/local/pkg/pf/IP-Blocklist.sh");
- unlink_if_exists("/tmp/IP-Blocklist.sh");
- //Touch files
- exec("touch /usr/local/www/packages/ipblocklist/wlists.txt");
- exec("/bin/mkdir /usr/local/www/packages/countryblock/lists");
- exec("/bin/mkdir /usr/local/www/packages/ipblocklist/lists");
- exec("/bin/mkdir /usr/local/www/packages/ipblocklist/Wlists");
- exec("/usr/bin/touch /usr/local/www/packages/countryblock/lists/countries.txt");
- exec("/usr/bin/touch /usr/local/www/packages/countryblock/countries-white.txt");
- exec("/usr/bin/touch /usr/local/www/packages/ipblocklist/lists/ipfw.ipfw");
- exec("/usr/bin/touch /usr/local/www/packages/ipblocklist/Wlists/whitelist");
- exec("/usr/bin/touch /usr/local/www/packages/ipblocklist/OUTBOUND");
-
-
- //Attempt to pull from a backup
- exec("/bin/mkdir /usr/local/www/packages/ipblocklist_bkup");
- exec("cp /usr/local/www/packages/ipblocklist_bkup/lists.txt /usr/local/www/packages/ipblocklist/lists.txt");
-
- conf_mount_ro();
- config_unlock();
-}
-
-
-function deinstall_command_ip()
-{
- conf_mount_rw();
- $handle = popen("/usr/local/etc/rc.d/ipblocklist.sh stop", "r");
- unlink_if_exists("/usr/local/pkg/ipblocklist.xml");
- unlink_if_exists("/usr/local/pkg/ipblocklist.inc");
- unlink_if_exists("/usr/local/pkg/pf/IP-Blocklist.sh");
- exec("rm -R /usr/local/www/packages/ipblocklist/ipblocklists");
- exec("rm -R /usr/local/www/packages/ipblocklist");
- exec("rm /usr/local/etc/rc.d/IP-Blocklist.sh");
- exec("pfctl -t ipblocklist -T kill");
- //exec("ipfw -f flush");
- conf_mount_ro();
-}
-
-?>
diff --git a/config/ipblocklist/8/ipblocklist.tmp b/config/ipblocklist/8/ipblocklist.tmp
deleted file mode 100755
index ae654241..00000000
--- a/config/ipblocklist/8/ipblocklist.tmp
+++ /dev/null
@@ -1,244 +0,0 @@
-<?php
- //Version 3.4
- header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
- header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
- require_once('config.inc');
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/ipblocklist/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-if (count($_POST)>0) {
-
- conf_mount_rw();
-
- $ent = array();
-
- if ($_POST['enable'] == 1) {
- //echo "enabled";
- $config['installedpackages']['ipblocklist_settings']['config'][0]['enable'] = 1;
-
- //Process list by downloading and extracting
-
- $myFile = "lists.txt";
- $myWFile = "wlists.txt";
- $fileContents = file_get_contents($myFile);
- $fileWContents = file_get_contents($myWFile);
- $lines = explode(PHP_EOL, $fileContents);
- $Wlines = explode(PHP_EOL, $fileWContents);
- //Remove DIR lists to eliminate duplates
- exec("/bin/rm -R lists");
- exec("/bin/rm -R Wlists");
- //Process each list URL, Extract, and put in DIR lists
- exec("/bin/mkdir lists");
- exec("/bin/mkdir Wlists");
- foreach ($lines as $line) {
- exec("/usr/bin/fetch -o lists $line");
- $filename = basename($line);
- //Extract list
- exec("/usr/bin/gzip -d lists/$filename");
- }
- foreach ($Wlines as $Wline) {
- exec("/usr/bin/fetch -o Wlists $Wline");
- $Wfilename = basename($Wline);
- //Extract Whitelist
- exec("/usr/bin/gzip -d Wlists/$Wfilename");
- }
- //Prep pfctl
- mwexec("/usr/bin/touch lists/ipfw.ipfw");
- mwexec("/usr/bin/touch Wlists/whitelist");
-
- //Now clear ipfw, and process each list to ipfw commands
- exec("/bin/sh convert-execute.sh");
-
- //Attempt to create a backup of user lists
- mwexec("cp /usr/local/www/packages/ipblocklist/lists.txt /usr/local/www/packages/ipblocklist_bkup/lists.txt");
-
- }
- else {
- //echo "disabled";
- $config['installedpackages']['ipblocklist_settings']['config'][0]['enable'] = 0;
- //Clear Lists
- //mwexec("ipfw -f flush");
- mwexec("pfctl -t ipblocklist -T kill");
- mwexec("rm -R /usr/local/www/packages/ipblocklist/lists");
- mwexec("sed -i -e '/ipblocklist/d' /tmp/rules.debug");
- mwexec("pfctl -o basic -f /tmp/rules.debug");
- //Clear errorOUT.txt
- mwexec("rm errorOUT.txt");
-
- }
-
-
- write_config();
- //services_dnsmasq_configure();
- sleep(1);
- $savemsg_dnsb = "IP-Blocklist settings have been saved/updated. ";
- conf_mount_ro();
-}
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<form method=POST action="">
-<?php
-if ($config['installedpackages']['ipblocklist_settings']['config'][0]['enable'] == 1) {
- echo "<input name='enable' type='checkbox' value='1' checked>\n";
-}
-else {
- echo "<input name='enable' type='checkbox' value='1'>\n";
-}
-?>
-<?php
-if(isset($_POST['formSubmit']))
- {
-
-
- //if(isset($_POST['formlogging']))
- //{
- // exec("/usr/bin/touch logging");
- //}
- //else
- //{
- // exec("/bin/rm logging");
- //}
-
- }
-?>
-<strong>Enable IP-Blocklist</strong><br><br>
-<?php if ($savemsg_cb) print_info_box($savemsg_cb);
- //if ($output) print_info_box($output,$output2);
- echo($output);
- echo($output2);
- ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("IP-Blocklist", true, "ipblocklist.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "ipblocklist_if.php");
- $tab_array[4] = array("Help", false, "https://doc.pfsense.org/index.php/IP_Blocklist");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
-</form>
-</td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Main</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
- <br />
- <center>
- <iframe frameboarder=0 boarder=0 src="ipblocklist_list.php" name="lists" id="lists" width="100%" height="200">
- </iframe>
- </center>
-
-
-
-
-
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
- <td >
-
-
- </form>
-
-
-
-
-
- <br/><br/>
- <input type="submit" name="formSubmit" value="Save/Update" />
- </p>
-</form>
-<br/>
-
-
-
-
-</div>
-<?php
- //This input guarantees that a POST is sent
- echo "<input type='hidden' name='zzz' value='required'>";
-?>
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-</div>
-<br>
-<u>Usage</u>
- <br/>
- Add direct link to list and press <img src="../../themes/nervecenter/images/icons/icon_plus.gif">
- (Example:
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level1.gz">Level1</a>,
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level2.gz">Level2</a>,
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level3.gz">Level3</a>)
- <br/>
- Compressed lists should have .gz extention and follows PeerBlock syntax
- <?php
- echo "<br/><br/>Current Status = ";
- ob_start();
- $results = exec("/sbin/pfctl -s rules | grep -c ipblocklist");
- ob_end_clean();
- if ($results > '2') echo "Running";
- else
- echo "<span style='color:red'>NOT running</span>";
-
- //Get Errors if exists
- ob_start();
- $results = exec("/usr/bin/tail -r errorOUT.txt");
- ob_end_clean();
- echo "<br/><span style='color:red'>";
- echo $results;
- echo "</span>";
-
- //Get IP Count
- echo "<br>You are blocking ";
- ob_start();
- $results = exec("/sbin/pfctl -T show -t ipblocklist |grep -v -c Z");
- ob_end_clean();
- echo $results;
- echo " Networks/IPs";
- ?>
-<br><br>
-<small>Created by <a href="http://www.tomschaefer.org/pfsense">TomSchaefer</a></small>
-<br /><small><a href="http://www.iblocklist.com/">I-Blocklist.com</a></small>
-<!--<input type="submit" value="Save/Update"><br><br>
---><p>
-</p>
-</td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
-
diff --git a/config/ipblocklist/8/ipblocklist.xml b/config/ipblocklist/8/ipblocklist.xml
deleted file mode 100755
index 77c05bab..00000000
--- a/config/ipblocklist/8/ipblocklist.xml
+++ /dev/null
@@ -1,190 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- ipblocklist.xml
- Copyright (C) 2012 Tom Schaefer
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>IP Blocklist</description>
- <requirements>perl</requirements>
- <faq>https://forum.pfsense.org/index.php/topic,24769.0.html</faq>
- <name>IP Blocklist Settings</name>
- <version>0.3.5</version>
- <title>Settings</title>
- <include_file>/usr/local/pkg/ipblocklist.inc</include_file>
- <menu>
- <name>IP Blocklist</name>
- <tooltiptext>IP Blocklist settings.</tooltiptext>
- <section>Firewall</section>
- <configfile>ipblocklist.xml</configfile>
- <url>/packages/ipblocklist/ipblocklist.php</url>
- </menu>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/packages/ipblocklist/ipblocklist.php</url>
- <active/>
- </tab>
- </tabs>
- <configpath>installedpackages->package->$packagename->configuration->ipblocklist</configpath>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/ipblocklist.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/ipblocklist.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/ipblocklist.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/interfaces.txt</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/ipblocklist_list.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/ipblocklist_if.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/firewall_shaper.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/convert.pl</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/convert-execute.sh</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/purge.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/index.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/whitelist.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/purgeip.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/IP-Blocklist.sh</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/settings.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/class.phpmailer.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/class.smtp.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/email.tmp</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/lists.txt</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/tmp/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/ipblocklist/8/countryblock_IPBlocklist.widget.tmp</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Variable One</fielddescr>
- <fieldname>var1</fieldname>
- <description>Enter the variable one here.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Variable Two</fielddescr>
- <fieldname>var1</fieldname>
- <description>Enter the variable one here.</description>
- <type>input</type>
- </field>
- </fields>
- <custom_add_php_command>
- </custom_add_php_command>
- <custom_php_resync_config_command>
- php_sync_package_ip();
- </custom_php_resync_config_command>
- <custom_delete_php_command>
- php_sync_package_ip();
- </custom_delete_php_command>
- <custom_php_install_command>
- php_install_command_ip();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- deinstall_command_ip();
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/ipblocklist/8/ipblocklist_if.tmp b/config/ipblocklist/8/ipblocklist_if.tmp
deleted file mode 100755
index 582d856a..00000000
--- a/config/ipblocklist/8/ipblocklist_if.tmp
+++ /dev/null
@@ -1,217 +0,0 @@
-<?php
-/*
- interfaces_assign.php
- part of m0n0wall (http://m0n0.ch/wall)
- Written by Jim McBeath based on existing m0n0wall files
-
- Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-//$pgtitle = "Firewall: Countryblock - Interfaces";
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-require("guiconfig.inc");
-
-/*
- In this file, "port" refers to the physical port name,
- while "interface" refers to LAN, WAN, or OPTn.
-*/
-
-/* get list without VLAN interfaces */
-$portlist = get_interface_list();
-
-/* add VLAN interfaces */
-if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) {
- $i = 0;
- foreach ($config['vlans']['vlan'] as $vlan) {
- $portlist['vlan' . $i] = $vlan;
- $portlist['vlan' . $i]['isvlan'] = true;
- $i++;
- }
-}
-
-if ($_POST) {
-
- unset($input_errors);
-
- /* input validation */
-
- /* Build a list of the port names so we can see how the interfaces map */
- $portifmap = array();
- foreach ($portlist as $portname => $portinfo) {
- $portifmap[$portname] = array();
- //echo($portname . "done");
- }
-
- /* Go through the list of ports selected by the user,
- build a list of port-to-interface mappings in portifmap */
- conf_mount_rw();
- $myFile = "interfaces.txt";
-
- $fh = fopen($myFile, 'w+');
-
-
- foreach ($_POST as $ifname => $ifport) {
- //echo $ifname;
- //echo "<br>";
- if ($ifname != "__csrf_magic"){
- fwrite($fh, $ifname . "\n");
- }
- else {
- }
- //if (($ifname == 'lan') || ($ifname == 'wan') || (substr($ifname, 0, 3) == 'opt'))
- //$portifmap[$ifport][] = strtoupper($ifname);
- }
-
- conf_mount_ro();
-
-
- if (!$input_errors) {
- /* No errors detected, so update the config */
- foreach ($_POST as $ifname => $ifport) {
-
- if (($ifname == 'lan') || ($ifname == 'wan') ||
- (substr($ifname, 0, 3) == 'opt')) {
-
-
- }
- }
-
- $savemsg = get_std_save_message($retval);
-
-
-
- }
-}
-
-
-
-
-
-
-include("head.inc");
-
-
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box("Interfaces selected - Click <a href='ipblocklist.php'>Here</a> to go back"); ?>
-<form action="" method="post" name="iform" id="iform">
-<br /><br />
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("IP-Blocklist", false, "ipblocklist.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", true, "ipblocklist_if.php");
- $tab_array[4] = array("Help", false, "https://doc.pfsense.org/index.php/IP_Blocklist");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Interface</td>
- <td class="listhdr">Selected</td>
- <td class="list">&nbsp;</td>
- </tr>
- <?php foreach ($config['interfaces'] as $ifname => $iface):
- if ($iface['descr'])
- $ifdescr = $iface['descr'];
- else
- $ifdescr = strtoupper($ifname);
- ?>
- <tr>
- <td class="listlr" valign="middle"><strong><?=$ifdescr;?></strong></td>
- <td valign="middle" class="listr">
-
-
-
-
- <?php foreach ($portlist as $portname => $portinfo): ?>
-
- <?php if ($portname == $iface['if']) {
-
- ob_start();
- $resultsany = exec("cat interfaces.txt | grep any");
- $results = exec("cat interfaces.txt | grep $portname");
- ob_end_clean();
-
- if ($results == $portname || $resultsany == any)
- echo "<input name='$portname' type='checkbox' value='$portname' checked/>$portname";
- else
- echo "<input name='$portname' type='checkbox' value='$portname' />$portname";
- }
- ?>
- <?php endforeach; ?>
-
- </td>
- <td valign="middle" class="list">
-
- </td>
- </tr>
- <?php endforeach; ?>
-
- <tr>
- <td class="list" colspan="3" height="10"></td>
- </tr>
-
-</table>
-</div>
- <p><br>
- <input type="submit" class="formbtn" value="Save">
- </p>
- <p>Select the interfaces you want secured. It's recommended to select all interfaces. </p>
- <p>Default: All interfaces are seleted. <br>
- <br>
- </p>
- <p></p></td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-
-
-</body>
-</html>
-
-<?php
-conf_mount_rw();
- if ($_POST) {
- if (!$input_errors)
- touch("interfaces.txt");
-
- }
- conf_mount_ro();
-?>
diff --git a/config/ipblocklist/8/ipblocklist_list.tmp b/config/ipblocklist/8/ipblocklist_list.tmp
deleted file mode 100755
index ddc6fdb1..00000000
--- a/config/ipblocklist/8/ipblocklist_list.tmp
+++ /dev/null
@@ -1,113 +0,0 @@
-<?php
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-
-//echo "<a href=\"whitelist.php\"><img src=\"../../themes/nervecenter/images/icons/icon_plus.gif\" ALT=\"Whitelist\" ALIGN=RIGHT></a>\n";
-echo "Add List URL: <form method=\"post\" action=\"\">\n";
-echo "<input name=\"content\" type=\"text\" />\n";
-echo "<input type=\"image\" src=\"../../themes/nervecenter/images/icons/icon_plus.gif\" value=\"submit\">\n";
-echo "<a href=\"purge.php?line=0\">Purge All</a>\n";
-echo "<STYLE type=\"text/css\">\n";
-echo " a img {border:none; }\n";
-echo " </STYLE>\n";
-
-function delLineFromFile($fileName, $lineNum){
-// check the file exists
- if(!is_writable($fileName))
- {
- // print an error
- print "The file $fileName is not writable";
- // exit the function
- exit;
- }
- else
- {
- // read the file into an array
- $arr = file($fileName);
- }
-
- // the line to delete is the line number minus 1, because arrays begin at zero
- $lineToDelete = $lineNum-1;
-
- // check if the line to delete is greater than the length of the file
- if($lineToDelete > sizeof($arr))
- {
- // print an error
- print "You have chosen a line number, <b>[$lineNum]</b>, higher than the length of the file.";
- // exit the function
- exit;
- }
-
- //remove the line
- unset($arr["$lineToDelete"]);
-
- // open the file for reading
- if (!$fp = fopen($fileName, 'w+'))
- {
- // print an error
- print "Cannot open file ($fileName)";
- // exit the function
- exit;
- }
-
- // if $fp is valid
- if($fp)
- {
- // write the array to the file
- foreach($arr as $line) { fwrite($fp,$line); }
-
- // close the file
- fclose($fp);
- }
-
-echo "done";
-}
-
-
-$myFile = "lists.txt";
-$content = $_REQUEST['content'];
-$fh = fopen($myFile, 'a+');
-fwrite($fh, $content);
-if (strlen($content) > 1) {
- fwrite($fh, "\n");
- } else {
-}
-fclose($fh);
-
-
-//echo (filesize($myFile));
-if (filesize($myFile) > 1) {
- //$fh = fopen($myFile, 'r');
- //$theData = fread($fh, filesize($myFile));
- //fclose($fh);
- echo "<br/> Current List(s): <br/>";
- // Get the whole file into a single string
- $fileContents = file_get_contents($myFile);
-
- // Explode the file contents string by each line
- $lines = explode(PHP_EOL, $fileContents); // Replace PHP_EOL with "\r\n" or "\n" or "\r" if you like
-
- // Iterate through each line and do what you need with it
-
- foreach ($lines as $line) {
- $i++;
- echo "<a href=purge.php?line=$i style='border-style: none'><img src='../../themes/nervecenter/images/icons/icon_x.gif'></a>";
- echo " ";
- echo $line;
- //echo "";
- // echo $i;
- echo "<br/>";
-
- }
-
-
- //echo $theData;
-
-
-}
-echo "<br/><br/>";
-
-
-
-
-?>
diff --git a/config/ipblocklist/8/lists.txt b/config/ipblocklist/8/lists.txt
deleted file mode 100644
index db2f7b2d..00000000
--- a/config/ipblocklist/8/lists.txt
+++ /dev/null
@@ -1 +0,0 @@
-http://tomschaefer.org/temp/pfsense/tbg_primarythreats.txt
diff --git a/config/ipblocklist/8/manual_add.tmp b/config/ipblocklist/8/manual_add.tmp
deleted file mode 100755
index a2218e61..00000000
--- a/config/ipblocklist/8/manual_add.tmp
+++ /dev/null
@@ -1,69 +0,0 @@
-<html>
-<head>
-<STYLE type="text/css">
- a img {border:none; }
- </STYLE>
-</head>
-<a href="ipblocklist_list.php"><img src="../../themes/nervecenter/images/icons/icon_alias_url_reload.gif" ALT="Manual" ALIGN=RIGHT></a>
-
-<span style="color:red">Experimental!</span> - This uses a different process to block IPs (uses IPFW) <a href="https://forum.pfsense.org/index.php/topic,24822.0.html" target="_blank"><img src="../../themes/nervecenter/images/icons/icon_log.gif"></a>
- <br/>Enter in IP format (xx.xx.xx.xx) or CIDR format (xx.xx.xx.xx/xx)
-<br/><form method="post" action="">
-<input name="content" type="text" />
-<input type="image" src="../../themes/nervecenter/images/icons/icon_plus.gif" value="submit">
-<br/>
-
-<?php
-
-
-$myFile = "ips.ipfw";
-$content = $_REQUEST['content'];
-$fh = fopen($myFile, 'a+');
-fwrite($fh, $content);
-if (strlen($content) > 1) {
- fwrite($fh, "\n");
- } else {
-
-}
-fclose($fh);
-
-
-//echo (filesize($myFile));
-if (filesize($myFile) > 1) {
- //$fh = fopen($myFile, 'r');
- //$theData = fread($fh, filesize($myFile));
- //fclose($fh);
- echo "<br/> Current List(s): <br/>";
- // Get the whole file into a single string
- $fileContents = file_get_contents($myFile);
-
- // Explode the file contents string by each line
- $lines = explode(PHP_EOL, $fileContents); // Replace PHP_EOL with "\r\n" or "\n" or "\r" if you like
-
- // Iterate through each line and do what you need with it
-
- foreach ($lines as $line) {
- $i++;
- echo "<a href=purgeip.php?line=$i style='border-style: none'><img src='../../themes/nervecenter/images/icons/icon_x.gif'></a>";
- echo " ";
- exec("kldload ipfw.ko");
- exec("ipfw -q add 2000 drop ip from any to $line");
- exec("ipfw -q add 2001 drop ip from $line to any");
- echo $line;
- //echo "";
- // echo $i;
- echo "<br/>";
-
- }
-
-
-
-
-
-}
-echo "<br/><br/>";
-
-
-
-
-?>
diff --git a/config/ipblocklist/8/purge.tmp b/config/ipblocklist/8/purge.tmp
deleted file mode 100755
index 2ecf1cf6..00000000
--- a/config/ipblocklist/8/purge.tmp
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-$line = $_GET["line"];
-
-//echo("$line");
-
-//exec("more lists.txt > temp_lists.txt");
-if ($line == 0) {
- exec("/bin/rm lists.txt");
- } else {
- exec("/usr/bin/sed $line'd' lists.txt > temp_lists.txt");
- }
-exec("/usr/bin/more temp_lists.txt > lists.txt");
-exec("/bin/rm temp_lists.txt");
-
-
-header('Location: ipblocklist_list.php');
-
-?>
diff --git a/config/ipblocklist/8/purgeip.tmp b/config/ipblocklist/8/purgeip.tmp
deleted file mode 100755
index b577b8af..00000000
--- a/config/ipblocklist/8/purgeip.tmp
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-$line = $_GET["line"];
-
-//echo("$line");
-//exec("more ips.ipfw > temp_ips.ipfw");
-if ($line == 0) {
- exec("rm wlists.txt");
- } else {
- exec("sed $line'd' wlists.txt > temp_wlists.txt");
- }
-exec("more temp_wlists.txt > wlists.txt");
-exec("rm temp_wlists.txt");
-
-
-?>
-<html>
-<HEAD>
-<SCRIPT language="JavaScript">
-<!--
-window.parent.location="ipblocklist.php";
-//-->
-</SCRIPT>
-</HEAD>
-
-
-</html>
diff --git a/config/ipblocklist/8/settings.tmp b/config/ipblocklist/8/settings.tmp
deleted file mode 100755
index 0c1fd804..00000000
--- a/config/ipblocklist/8/settings.tmp
+++ /dev/null
@@ -1,198 +0,0 @@
-<?php
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-//$pgtitle = "Firewall: Countryblock - Settings";
- // TomSchaefer.org countryblock package 2010
- //
- // Notes: Find: ^(.*)$
- // Replace: ob_start();\n$results = exec("cat countries.txt | grep XX");\nob_end_clean();\n\tif ($results == 'XX')\n\t\techo "\1";\n\telse\n\t\techo "\1";\n
- //
- //
- //
- //
- //require_once('config.inc');
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/ipblocklist/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<!--<p class="pgtitle"><?=$pgtitle?></p>-->
-<br />
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<form method=POST action="">
-
-<?php if ($savemsg_cb) print_info_box($savemsg_cb);
- //if ($output) print_info_box($output,$output2);
- echo($output);
- echo($output2);
- ?>
- <br /><br />
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("IP-Blocklist", false, "ipblocklist.php");
- $tab_array[1] = array("Settings", true, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "ipblocklist_if.php");
- $tab_array[4] = array("Help", false, "https://doc.pfsense.org/index.php/IP_Blocklist");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
-
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Settings</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
-
-<?php
-
-conf_mount_rw();
-
-
-
- if(isset($_POST['formSubmit']))
- {
- $aipblocklist = $_POST['formipblocklist'];
-
- if(isset($_POST['formOutbound']))
- {
- $output2 = " and Outbound access is BLOCKED.</b>";
- exec("touch OUTBOUND");
- }
- else
- {
- $output2 = " and Outbound access is ALLOWED.</b>";
- exec("rm OUTBOUND");
- }
-
- if(isset($_POST['formlogging']))
- {
- exec("touch logging");
- }
- else
- {
- exec("rm logging");
- }
-
-
-
-
- }
-conf_mount_ro();
-?>
-
-
-
-
-</head>
-
-
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
- <td >
-
-
- </form>
-
- <form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
- <p>
- <?php
- $countif = "interfaces.txt";
- if (file_exists($countif)) {
- $countif = count(file($countif));
- echo "$countlines";
- } else {
- echo "<span style='color:red'>Warning! No Interfaces Selected Click <a href='ipblocklist_if.php' target='_parent'><img src='../../themes/nervecenter/images/icons/icon_cablenic.gif' ALT='if'></a></span>";
- }
-
- ?>
- </p>
-
-
- <p>
- Block outbound?
-<?php
-
- if (file_exists("OUTBOUND")) {
- echo "<input name='formOutbound' type='checkbox' value='Yes' checked/>";
- } else {
- echo "<input name='formOutbound' type='checkbox' value='Yes'/>";
- }
-?>
-
- <br>
- Enable Logging?&nbsp;
-<?php
-
- if (file_exists("logging")) {
- echo "<input name='formlogging' type='checkbox' value='Yes' checked/>";
- } else {
- echo "<input name='formlogging' type='checkbox' value='Yes'/>";
- }
-?>
-<br/>
-
-
-
-
-
-
-
-
- </p>
-
-<br/>
-
-
-
-</div>
-<?php
- //This input guarantees that a POST is sent
- echo "<input type='hidden' name='zzz' value='required'>";
-?>
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-</div>
-<br />
-<input type="submit" name="formSubmit" value="Save" /><br><br>
-<p>
-</p>
-</td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
-
diff --git a/config/ipblocklist/8/whitelist.tmp b/config/ipblocklist/8/whitelist.tmp
deleted file mode 100755
index 203cf798..00000000
--- a/config/ipblocklist/8/whitelist.tmp
+++ /dev/null
@@ -1,175 +0,0 @@
-<?php
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
-//$pgtitle = "Firewall: IPblo - Whitelist";
-
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/ipblocklist/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-
-
-
-
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<form method=POST action="">
-<?php
-
-
-//mwexec("touch countries-white.txt");
-//$myFile = "countries-white.txt";
-//$fh = fopen($myFile, 'a+');
-
-
-?>
-<br /><br />
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("IP-Blocklist", false, "ipblocklist.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", true, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "ipblocklist_if.php");
- $tab_array[4] = array("Help", false, "https://doc.pfsense.org/index.php/IP_Blocklist");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Whitelist</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
-
-<span style="color:red">White lists</span> - The lists added here will be added to a whitelist
- <br/>Add List URL:
-
- <p><form method="post" action="">
-<input name="content" type="text" />
-<input type="image" src="../../themes/nervecenter/images/icons/icon_plus.gif" value="submit">
-<a href="purgeip.php?line=0">Purge All</a>
-
-<STYLE type="text/css">
- a img {border:none; }
- </STYLE>
-</head>
-
-<?php
-
-
-$myFile = "wlists.txt";
-$content = $_REQUEST['content'];
-$fh = fopen($myFile, 'a+');
-fwrite($fh, $content);
-if (strlen($content) > 1) {
- fwrite($fh, "\n");
- } else {
-}
-fclose($fh);
-
-
-//echo (filesize($myFile));
-if (filesize($myFile) > 1) {
- //$fh = fopen($myFile, 'r');
- //$theData = fread($fh, filesize($myFile));
- //fclose($fh);
- echo "<br/> Current List(s): <br/>";
- // Get the whole file into a single string
- $fileContents = file_get_contents($myFile);
-
- // Explode the file contents string by each line
- $lines = explode(PHP_EOL, $fileContents); // Replace PHP_EOL with "\r\n" or "\n" or "\r" if you like
-
- // Iterate through each line and do what you need with it
-
- foreach ($lines as $line) {
- $i++;
- echo "<a href=purgeip.php?line=$i style='border-style: none'><img src='../../themes/nervecenter/images/icons/icon_x.gif'></a>";
- echo " ";
- echo $line;
- //echo "";
- // echo $i;
- echo "<br/>";
-
- }
-
-
- //echo $theData;
-
-
-}
-echo "<br/><br/>";
-
-
-
-
-?></p>
-
-
-</form>
-
-
-</div>
-
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-
-</div>
-<p> <u>Usage</u>
- <br/>
- Add direct link to list and press <img src="../../themes/nervecenter/images/icons/icon_plus.gif">
- (Example:
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level1.gz">Level1</a>,
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level2.gz">Level2</a>,
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level3.gz">Level3</a>)
- <br/>
- Compressed lists should have .gz extention and follows PeerBlock syntax <br/>
- <br/>
- </p>
-<br>
-
-<br><br>
-
-<p>
-</p>
-</td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
-
diff --git a/config/iperf.xml b/config/iperf/iperf.xml
index 3b17f549..4312cf25 100644
--- a/config/iperf.xml
+++ b/config/iperf/iperf.xml
@@ -73,7 +73,7 @@
</tab>
</tabs>
<additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/iperfserver.xml</item>
+ <item>https://packages.pfsense.org/packages/config/iperf/iperfserver.xml</item>
</additional_files_needed>
<fields>
<field>
@@ -158,4 +158,4 @@
$iperf_options .= " -c " . escapeshellarg($_POST['hostname']);
system("/usr/local/bin/iperf" . $iperf_options);
</custom_add_php_command>
-</packagegui> \ No newline at end of file
+</packagegui>
diff --git a/config/iperfserver.xml b/config/iperf/iperfserver.xml
index f0dc074a..f0dc074a 100644
--- a/config/iperfserver.xml
+++ b/config/iperf/iperfserver.xml
diff --git a/config/iprangealiases/iprangealiases.inc b/config/iprangealiases/iprangealiases.inc
deleted file mode 100644
index 036bc195..00000000
--- a/config/iprangealiases/iprangealiases.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-function iprangealiases_install() {
- global $g, $config;
-
- // Test to make sure the patch is not already applied.
- $out = `patch -fslC --reverse -p1 -b .before_iprangealiases -d / -i /usr/local/pkg/iprangealiases.patch |& grep -ci reject`;
- if ($out == 0) {
- // If the patch has not already been applied, test to see if it will apply cleanly.
- $out = `patch -fsNlC -p1 -b .before_iprangealiases -d / -i /usr/local/pkg/iprangealiases.patch |& grep -ci reject`;
- if ($out == 0) {
- // The patch should apply cleanly, let 'er rip.
- mwexec("patch -fsNl -p1 -b .before_iprangealiases -d / -i /usr/local/pkg/iprangealiases.patch ");
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/config/iprangealiases/iprangealiases.patch b/config/iprangealiases/iprangealiases.patch
deleted file mode 100644
index 5a80e111..00000000
--- a/config/iprangealiases/iprangealiases.patch
+++ /dev/null
@@ -1,265 +0,0 @@
---- /etc/inc/util.inc.orig 2010-03-09 13:01:37.000000000 -0500
-+++ /etc/inc/util.inc 2010-03-09 13:01:40.000000000 -0500
-@@ -78,6 +78,127 @@
- return long2ip(gen_subnet_mask_long($bits));
- }
-
-+/* Convert IP address to unsigned long int. */
-+function ip2ulong($ip) {
-+ return sprintf("%u", ip2long($ip));
-+}
-+
-+/* Find out how many IPs are contained within a given IP range
-+ * e.g. 192.168.0.0 to 192.168.0.255 returns 256
-+ */
-+function ip_range_size($startip, $endip) {
-+ if (is_ipaddr($startip) && is_ipaddr($endip)) {
-+ // Operate as unsigned long because otherwise it wouldn't work
-+ // when crossing over from 127.255.255.255 / 128.0.0.0 barrier
-+ return abs(ip2ulong($startip) - ip2ulong($endip)) + 1;
-+ }
-+ return -1;
-+}
-+
-+/* Find the smallest possible subnet mask which can contain a given number of IPs
-+ * e.g. 512 IPs can fit in a /23, but 513 IPs need a /22
-+ */
-+function find_smallest_cidr($number) {
-+ $smallest = 1;
-+ for ($b=32; $b > 0; $b--) {
-+ $smallest = ($number <= pow(2,$b)) ? $b : $smallest;
-+ }
-+ return (32-$smallest);
-+}
-+
-+/* Return the previous IP address before the given address */
-+function ip_before($ip) {
-+ return long2ip(ip2long($ip)-1);
-+}
-+
-+/* Return the next IP address after the given address */
-+function ip_after($ip) {
-+ return long2ip(ip2long($ip)+1);
-+}
-+
-+/* Return true if the first IP is 'before' the second */
-+function ip_less_than($ip1, $ip2) {
-+ // Compare as unsigned long because otherwise it wouldn't work when
-+ // crossing over from 127.255.255.255 / 128.0.0.0 barrier
-+ return ip2ulong($ip1) < ip2ulong($ip2);
-+}
-+
-+/* Return true if the first IP is 'after' the second */
-+function ip_greater_than($ip1, $ip2) {
-+ // Compare as unsigned long because otherwise it wouldn't work
-+ // when crossing over from 127.255.255.255 / 128.0.0.0 barrier
-+ return ip2ulong($ip1) > ip2ulong($ip2);
-+}
-+
-+/* Convert a range of IPs to an array of subnets which can contain the range. */
-+function ip_range_to_subnet_array($startip, $endip) {
-+ if (!is_ipaddr($startip) || !is_ipaddr($endip)) {
-+ return array();
-+ }
-+
-+ // Container for subnets within this range.
-+ $rangesubnets = array();
-+
-+ // Figure out what the smallest subnet is that holds the number of IPs in the given range.
-+ $cidr = find_smallest_cidr(ip_range_size($startip, $endip));
-+
-+ // Loop here to reduce subnet size and retest as needed. We need to make sure
-+ // that the target subnet is wholly contained between $startip and $endip.
-+ for ($cidr; $cidr <= 32; $cidr++) {
-+ // Find the network and broadcast addresses for the subnet being tested.
-+ $targetsub_min = gen_subnet($startip, $cidr);
-+ $targetsub_max = gen_subnet_max($startip, $cidr);
-+
-+ // Check best case where the range is exactly one subnet.
-+ if (($targetsub_min == $startip) && ($targetsub_max == $endip)) {
-+ // Hooray, the range is exactly this subnet!
-+ return array("{$startip}/{$cidr}");
-+ }
-+
-+ // These remaining scenarios will find a subnet that uses the largest
-+ // chunk possible of the range being tested, and leave the rest to be
-+ // tested recursively after the loop.
-+
-+ // Check if the subnet begins with $startip and ends before $endip
-+ if (($targetsub_min == $startip) && ip_less_than($targetsub_max, $endip)) {
-+ break;
-+ }
-+
-+ // Check if the subnet ends at $endip and starts after $startip
-+ if (ip_greater_than($targetsub_min, $startip) && ($targetsub_max == $endip)) {
-+ break;
-+ }
-+
-+ // Check if the subnet is between $startip and $endip
-+ if (ip_greater_than($targetsub_min, $startip) && ip_less_than($targetsub_max, $endip)) {
-+ break;
-+ }
-+ }
-+
-+ // Some logic that will recursivly search from $startip to the first IP before the start of the subnet we just found.
-+ // NOTE: This may never be hit, the way the above algo turned out, but is left for completeness.
-+ if ($startip != $targetsub_min) {
-+ $rangesubnets = array_merge($rangesubnets, ip_range_to_subnet_array($startip, ip_before($targetsub_min)));
-+ }
-+
-+ // Add in the subnet we found before, to preserve ordering
-+ $rangesubnets[] = "{$targetsub_min}/{$cidr}";
-+
-+ // And some more logic that will search after the subnet we found to fill in to the end of the range.
-+ if ($endip != $targetsub_max) {
-+ $rangesubnets = array_merge($rangesubnets, ip_range_to_subnet_array(ip_after($targetsub_max), $endip));
-+ }
-+ return $rangesubnets;
-+}
-+
-+function is_iprange($range) {
-+ if (substr_count($range, '-') != 1) {
-+ return false;
-+ }
-+ list($ip1, $ip2) = explode ('-', $range);
-+ return (is_ipaddr($ip1) && is_ipaddr($ip2));
-+}
-+
- function is_numericint($arg) {
- return (preg_match("/[^0-9]/", $arg) ? false : true);
- }
---- /usr/local/www/firewall_aliases_edit.php.orig 2010-03-09 13:08:12.000000000 -0500
-+++ /usr/local/www/firewall_aliases_edit.php 2010-03-10 18:54:36.000000000 -0500
-@@ -96,11 +96,6 @@
- $reqdfields = explode(" ", "name address");
- $reqdfieldsn = explode(",", "Name,Address");
-
-- if ($_POST['type'] == "network") {
-- $reqdfields[] = "address_subnet";
-- $reqdfieldsn[] = "Subnet bit count";
-- }
--
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-
- if(strtolower($_POST['name']) == "lan")
-@@ -122,10 +117,13 @@
- $input_errors[] = "A valid address must be specified.";
- }
- if ($_POST['type'] == "network") {
-- if (!is_ipaddr($_POST['address'])) {
-+ if (!is_numeric($_POST['address_subnet']) && !is_iprange($_POST['address'])) {
-+ $input_errors[] = "Subnet bit count must be specified";
-+ }
-+ if (!is_ipaddr($_POST['address']) && !is_iprange($_POST['address'])) {
- $input_errors[] = "A valid address must be specified.";
- }
-- if (!is_numeric($_POST['address_subnet'])) {
-+ if (!is_numeric($_POST['address_subnet']) && !is_iprange($_POST['address'])) {
- $input_errors[] = "A valid subnet bit count must be specified.";
- }
- }
-@@ -160,21 +158,28 @@
-
- $alias = array();
- $alias['name'] = $_POST['name'];
-- if ($_POST['type'] == "network")
-- $alias['address'] = $_POST['address'] . "/" . $_POST['address_subnet'];
-
-- else
-+ $count = 1;
-+ if ($_POST['type'] == "network") {
-+ if (is_iprange($_POST['address'])) {
-+ list($startip, $endip) = explode('-', $_POST["address"]);
-+ $rangesubnets = ip_range_to_subnet_array($startip, $endip);
-+ $count = count($rangesubnets);
-+ $alias['address'] .= implode($rangesubnets, ' ');
-+ } else {
-+ $alias['address'] = $_POST['address'] . "/" . $_POST['address_subnet'];
-+ }
-+ } else {
- $alias['address'] = $_POST['address'];
-+ }
-
- $address = $alias['address'];
- $final_address_detail = mb_convert_encoding($_POST['detail'],"HTML-ENTITIES","auto");
-- if($final_address_detail <> "") {
-- $final_address_details .= $final_address_detail;
-+ if($final_address_detail <> "") {
-+ $final_address_details .= str_repeat($final_address_detail . "||", $count);
- } else {
-- $final_address_details .= "Entry added" . " ";
-- $final_address_details .= date('r');
-- }
-- $final_address_details .= "||";
-+ $final_address_details .= str_repeat("Entry added " . date('r') . "||", $count);
-+ }
- $isfirst = 0;
-
- if($_POST['type'] == "url") {
-@@ -234,28 +239,38 @@
- } else {
- /* item is a normal alias type */
- for($x=0; $x<299; $x++) {
-+ $count = 1;
- $comd = "\$subnet = \$_POST['address" . $x . "'];";
- eval($comd);
- $comd = "\$subnet_address = \$_POST['address_subnet" . $x . "'];";
- eval($comd);
- if($subnet <> "") {
-- $address .= " ";
-- $address .= $subnet;
-- if($subnet_address <> "") $address .= "/" . $subnet_address;
-+ if ($_POST['type'] == "network" && is_iprange($subnet)) {
-+ list($startip, $endip) = explode('-', $subnet);
-+ $rangesubnets = ip_range_to_subnet_array($startip, $endip);
-+ $count = count($rangesubnets);
-+ if ($address <> "") {
-+ $address .= " ";
-+ }
-+ $address .= implode($rangesubnets, ' ');
-+ } else {
-+ $address .= " " . $subnet;
-+ if ($subnet_address <> "") {
-+ $address .= "/" . $subnet_address;
-+ }
-+ }
-
- /* Compress in details to a single key, data separated by pipes.
- Pulling details here lets us only pull in details for valid
- address entries, saving us from having to track which ones to
- process later. */
-- $comd = "\$final_address_detail = mb_convert_encoding(\$_POST['detail" . $x . "'],'HTML-ENTITIES','auto');";
-- eval($comd);
-- if($final_address_detail <> "") {
-- $final_address_details .= $final_address_detail;
-- } else {
-- $final_address_details .= "Entry added" . " ";
-- $final_address_details .= date('r');
-- }
-- $final_address_details .= "||";
-+ $comd = "\$final_address_detail = mb_convert_encoding(\$_POST['detail" . $x . "'],'HTML-ENTITIES','auto');";
-+ eval($comd);
-+ if($final_address_detail <> "") {
-+ $final_address_details .= str_repeat($final_address_detail . "||", $count);
-+ } else {
-+ $final_address_details .= str_repeat("Entry added " . date('r') . "||", $count);
-+ }
- }
- }
- }
-@@ -358,7 +373,7 @@
- $url_str = gettext("URL");
- $update_freq_str = gettext("Update Freq.");
-
--$networks_help = gettext("Networks can be expressed like 10.0.0.0 format. Select the CIDR (network mask) that pertains to each entry.");
-+$networks_help = gettext("Networks can be expressed like 10.0.0.0 format. Select the CIDR (network mask) that pertains to each entry. You may also enter an IP Range such as 192.168.1.1-192.168.1.254.");
- $hosts_help = gettext("Enter as many hosts as you would like. Hosts should be expressed in their ip address format.");
- $ports_help = gettext("Enter as many ports as you wish. Port ranges can be expressed by seperating with a colon.");
- $url_help = gettext("Enter as many urls as you wish. Also set the time that you would like the url refreshed in days. After saving {$g['product_name']} will download the URL and import the items into the alias.");
-@@ -595,4 +610,4 @@
- }
- fclose($fd);
- }
--?>
-\ No newline at end of file
-+?>
diff --git a/config/iprangealiases/iprangealiases.xml b/config/iprangealiases/iprangealiases.xml
deleted file mode 100644
index 87af9b4b..00000000
--- a/config/iprangealiases/iprangealiases.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- iprangealiases.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Patch to add IP Range Support to Network Aliases</description>
- <requirements>pfSense 1.2.3</requirements>
- <faq>None</faq>
- <name>IP Range Aliases</name>
- <version>0.2</version>
- <title>IP Range Aliases</title>
- <include_file>/usr/local/pkg/iprangealiases.inc</include_file>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/iprangealiases/iprangealiases.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/iprangealiases/iprangealiases.patch</item>
- </additional_files_needed>
- <custom_php_install_command>
- iprangealiases_install();
- </custom_php_install_command>
-</packagegui>
diff --git a/config/mactovendor/bin/diag_arp.php_ b/config/mactovendor/bin/diag_arp.php_
deleted file mode 100644
index b66395a3..00000000
--- a/config/mactovendor/bin/diag_arp.php_
+++ /dev/null
@@ -1,339 +0,0 @@
-<?php
-/*
- diag_arp.php
- part of the pfSense project (https://www.pfsense.org)
- Copyright (C) 2004-2009 Scott Ullrich <sullrich@gmail.com>
-
- originally part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2005 Paul Taylor (paultaylor@winndixie.com) and Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- pfSense_BUILDER_BINARIES: /bin/cat /usr/sbin/arp
- pfSense_MODULE: arp
-*/
-
-##|+PRIV
-##|*IDENT=page-diagnostics-arptable
-##|*NAME=Diagnostics: ARP Table page
-##|*DESCR=Allow access to the 'Diagnostics: ARP Table' page.
-##|*MATCH=diag_arp.php*
-##|-PRIV
-
-@ini_set('zlib.output_compression', 0);
-@ini_set('implicit_flush', 1);
-
-require("guiconfig.inc");
-
-function leasecmp($a, $b) {
- return strcmp($a[$_GET['order']], $b[$_GET['order']]);
-}
-
-function adjust_gmt($dt) {
- $ts = strtotime($dt . " GMT");
- return strftime("%Y/%m/%d %H:%M:%S", $ts);
-}
-
-function remove_duplicate($array, $field) {
- foreach ($array as $sub)
- $cmp[] = $sub[$field];
- $unique = array_unique($cmp);
- foreach ($unique as $k => $rien)
- $new[] = $array[$k];
- return $new;
-}
-
-// Define path to AWK
-$awk = "/usr/bin/awk";
-
-// Read in leases file
-$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases";
-
-/* this pattern sticks comments into a single array item */
-$cleanpattern = "'{ gsub(\"#.*\", \"\");} { gsub(\";\", \"\"); print;}'";
-
-/* We then split the leases file by } */
-$splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i; printf \"}\\n\";}'";
-
-/* stuff the leases file in a proper format into a array by line */
-exec("cat {$leasesfile} | {$awk} {$cleanpattern} | {$awk} {$splitpattern}", $leases_content);
-$leases_count = count($leases_content);
-
-$pools = array();
-$leases = array();
-$i = 0;
-$l = 0;
-$p = 0;
-// Put everything together again
-while($i < $leases_count) {
- /* split the line by space */
- $data = explode(" ", $leases_content[$i]);
- /* walk the fields */
- $f = 0;
- $fcount = count($data);
- /* with less then 20 fields there is nothing useful */
- if($fcount < 20) {
- $i++;
- continue;
- }
- while($f < $fcount) {
- switch($data[$f]) {
- case "failover":
- $pools[$p]['name'] = $data[$f+2];
- $pools[$p]['mystate'] = $data[$f+7];
- $pools[$p]['peerstate'] = $data[$f+14];
- $pools[$p]['mydate'] = $data[$f+10];
- $pools[$p]['mydate'] .= " " . $data[$f+11];
- $pools[$p]['peerdate'] = $data[$f+17];
- $pools[$p]['peerdate'] .= " " . $data[$f+18];
- $p++;
- $i++;
- continue 3;
- case "lease":
- $leases[$l]['ip'] = $data[$f+1];
- $leases[$l]['type'] = "dynamic";
- $f = $f+2;
- break;
- case "starts":
- $leases[$l]['start'] = $data[$f+2];
- $leases[$l]['start'] .= " " . $data[$f+3];
- $f = $f+3;
- break;
- case "ends":
- $leases[$l]['end'] = $data[$f+2];
- $leases[$l]['end'] .= " " . $data[$f+3];
- $f = $f+3;
- break;
- case "tstp":
- $f = $f+3;
- break;
- case "tsfp":
- $f = $f+3;
- break;
- case "atsfp":
- $f = $f+3;
- break;
- case "cltt":
- $f = $f+3;
- break;
- case "binding":
- switch($data[$f+2]) {
- case "active":
- $leases[$l]['act'] = "active";
- break;
- case "free":
- $leases[$l]['act'] = "expired";
- $leases[$l]['online'] = "offline";
- break;
- case "backup":
- $leases[$l]['act'] = "reserved";
- $leases[$l]['online'] = "offline";
- break;
- }
- $f = $f+1;
- break;
- case "next":
- /* skip the next binding statement */
- $f = $f+3;
- break;
- case "hardware":
- $leases[$l]['mac'] = $data[$f+2];
- /* check if it's online and the lease is active */
- if($leases[$l]['act'] == "active") {
- $online = exec("/usr/sbin/arp -an |/usr/bin/awk '/{$leases[$l]['ip']}/ {print}'|wc -l");
- if ($online == 1) {
- $leases[$l]['online'] = 'online';
- } else {
- $leases[$l]['online'] = 'offline';
- }
- }
- $f = $f+2;
- break;
- case "client-hostname":
- if($data[$f+1] <> "") {
- $leases[$l]['hostname'] = preg_replace('/"/','',$data[$f+1]);
- } else {
- $hostname = gethostbyaddr($leases[$l]['ip']);
- if($hostname <> "") {
- $leases[$l]['hostname'] = $hostname;
- }
- }
- $f = $f+1;
- break;
- case "uid":
- $f = $f+1;
- break;
- }
- $f++;
- }
- $l++;
- $i++;
-}
-
-/* remove duplicate items by mac address */
-if(count($leases) > 0) {
- $leases = remove_duplicate($leases,"ip");
-}
-
-if(count($pools) > 0) {
- $pools = remove_duplicate($pools,"name");
- asort($pools);
-}
-
-// Put this in an easy to use form
-$dhcpmac = array();
-$dhcpip = array();
-
-foreach ($leases as $value) {
- $dhcpmac[$value['mac']] = $value['hostname'];
- $dhcpip[$value['ip']] = $value['hostname'];
-}
-
-exec("/usr/sbin/arp -an",$rawdata);
-
-$i = 0;
-
-/* if list */
-$ifdescrs = get_configured_interface_with_descr();
-
-foreach ($ifdescrs as $key =>$interface) {
- $hwif[$config['interfaces'][$key]['if']] = $interface;
-}
-
-$data = array();
-foreach ($rawdata as $line) {
- $elements = explode(' ',$line);
-
- if ($elements[3] != "(incomplete)") {
- $arpent = array();
- $arpent['ip'] = trim(str_replace(array('(',')'),'',$elements[1]));
- $arpent['mac'] = trim($elements[3]);
- $arpent['interface'] = trim($elements[5]);
- $data[] = $arpent;
- }
-}
-
-function _getHostName($mac,$ip)
-{
- global $dhcpmac, $dhcpip;
-
- if ($dhcpmac[$mac])
- return $dhcpmac[$mac];
- else if ($dhcpip[$ip])
- return $dhcpip[$ip];
- else if(gethostbyaddr($ip) <> "" and gethostbyaddr($ip) <> $ip)
- return gethostbyaddr($ip);
- else
- return "";
-}
-
-$pgtitle = array(gettext("Diagnostics"),gettext("ARP Table"));
-include("head.inc");
-
-?>
-
-<body link="#000000" vlink="#000000" alink="#000000">
-
-<?php include("fbegin.inc"); ?>
-
-<div id="loading">
- <img src="/themes/<?=$g['theme'];?>/images/misc/loader.gif"><?= gettext("Loading, please wait..."); ?>
- <p/>&nbsp;
-</div>
-
-<?php
-
-// Flush buffers out to client so that they see Loading, please wait....
-for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); }
-ob_implicit_flush(1);
-
-// Resolve hostnames and replace Z_ with "". The intention
-// is to sort the list by hostnames, alpha and then the non
-// resolvable addresses will appear last in the list.
-foreach ($data as &$entry) {
- $dns = trim(_getHostName($entry['mac'], $entry['ip']));
- if(trim($dns))
- $entry['dnsresolve'] = "$dns";
- else
- $entry['dnsresolve'] = "Z_ ";
-}
-
-// Sort the data alpha first
-$data = msort($data, "dnsresolve");
-
-// Load MAC-Manufacturer table
-$macs=file("/usr/local/pkg/mactovendor/mac-prefixes");
-if ($macs){
- foreach ($macs as $line){
- if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
- /* store values like this $mac_man['000C29']='VMware' */
- $mac_man["$matches[1]"]=$matches[2];
- }
- }
-}
-
-?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><?= gettext("IP address"); ?></td>
- <td class="listhdrr"><?= gettext("MAC address"); ?></td>
- <td class="listhdrr"><?= gettext("Hostname"); ?></td>
- <td class="listhdr"><?= gettext("Interface"); ?></td>
- <td class="list"></td>
- </tr>
- <?php foreach ($data as $entry): ?>
- <tr>
- <td class="listlr"><?=$entry['ip'];?></td>
- <td class="listr">
- <?php
- $mac=$entry['mac'];
- $mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
- if(isset($mac_man[$mac_hi])){
- $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
- print "<span title=\"$mac, {$mac_man[$mac_hi]}\">" . $mac_man_ar[0] . substr($mac, 8) . "</span>"; }
- else{ print $mac; }
- ?>
- </td>
- <td class="listr">
- <?php
- echo str_replace("Z_ ", "", $entry['dnsresolve']);
- ?>
- </td>
- <td class="listr"><?=$hwif[$entry['interface']];?></td>
- </tr>
- <?php endforeach; ?>
- </table>
- </td>
- </tr>
-</table>
-
-<?php include("fend.inc"); ?>
-
-<script type="text/javascript">
- $('loading').innerHTML = '';
-</script>
diff --git a/config/mactovendor/bin/mac-prefixes b/config/mactovendor/bin/mac-prefixes
deleted file mode 100644
index d301012e..00000000
--- a/config/mactovendor/bin/mac-prefixes
+++ /dev/null
@@ -1,12557 +0,0 @@
-# $Id: nmap-mac-prefixes 13888 2009-06-24 21:35:54Z fyodor $ generated with make-mac-prefixes.pl
-# Original data comes from http://standards.ieee.org/regauth/oui/oui.txt
-# These values are known as Organizationally Unique Identifiers (OUIs)
-# See http://standards.ieee.org/faqs/OUI.html
-# We have added a few unregistered OUIs at the end.
-000000 Xerox
-000001 Xerox
-000002 Xerox
-000003 Xerox
-000004 Xerox
-000005 Xerox
-000006 Xerox
-000007 Xerox
-000008 Xerox
-000009 Xerox
-00000A Omron Tateisi Electronics CO.
-00000B Matrix
-00000C Cisco Systems
-00000D Fibronics
-00000E Fujitsu Limited
-00000F NEXT
-000010 Sytek
-000011 Normerel Systemes
-000012 Information Technology Limited
-000013 Camex
-000014 Netronix
-000015 Datapoint
-000016 DU Pont Pixel Systems
-000017 Tekelec
-000018 Webster Computer
-000019 Applied Dynamics International
-00001A Advanced Micro Devices
-00001B Novell
-00001C Bell Technologies
-00001D Cabletron Systems
-00001E Telsist Industria Electronica
-00001F Telco Systems
-000020 Dataindustrier Diab AB
-000021 Sureman COMP. & Commun.
-000022 Visual Technology
-000023 ABB Industrial Systems AB
-000024 Connect AS
-000025 Ramtek
-000026 Sha-ken CO.
-000027 Japan Radio Company
-000028 Prodigy Systems
-000029 IMC Networks
-00002A TRW - Sedd/inp
-00002B Crisp Automation
-00002C Autotote Limited
-00002D Chromatics
-00002E Societe Evira
-00002F Timeplex
-000030 VG Laboratory Systems
-000031 Qpsx Communications
-000032 Marconi plc
-000033 Egan Machinery Company
-000034 Network Resources
-000035 Spectragraphics
-000036 Atari
-000037 Oxford Metrics Limited
-000038 CSS Labs
-000039 Toshiba
-00003A Chyron
-00003B i Controls
-00003C Auspex Systems
-00003D Unisys
-00003E Simpact
-00003F Syntrex
-000040 Applicon
-000041 ICE
-000042 Metier Management Systems
-000043 Micro Technology
-000044 Castelle
-000045 Ford Aerospace & COMM.
-000046 Olivetti North America
-000047 Nicolet Instruments
-000048 Seiko Epson
-000049 Apricot Computers
-00004A ADC Codenoll Technology
-00004B ICL Data OY
-00004C NEC
-00004D DCI
-00004E Ampex
-00004F Logicraft
-000050 Radisys
-000051 HOB Electronic Gmbh & CO. KG
-000052 Intrusion.com
-000053 Compucorp
-000054 Modicon
-000055 Commissariat A L`energie ATOM.
-000056 DR. B. Struck
-000057 Scitex
-000058 Racore Computer Products
-000059 Hellige Gmbh
-00005A SysKonnect GmbH
-00005B Eltec Elektronik AG
-00005C Telematics International
-00005D CS Telecom
-00005E USC Information Sciences Inst
-00005F Sumitomo Electric IND.
-000060 Kontron Elektronik Gmbh
-000061 Gateway Communications
-000062 Bull HN Information Systems
-000063 Barco Control Rooms Gmbh
-000064 Yokogawa Digital Computer
-000065 Network General
-000066 Talaris Systems
-000067 Soft * RITE
-000068 Rosemount Controls
-000069 Concord Communications
-00006A Computer Consoles
-00006B Silicon Graphics/mips
-00006C Private
-00006D Cray Communications
-00006E Artisoft
-00006F Madge
-000070 HCL Limited
-000071 Adra Systems
-000072 Miniware Technology
-000073 Siecor
-000074 Ricoh Company
-000075 Nortel Networks
-000076 Abekas Video System
-000077 Interphase
-000078 Labtam Limited
-000079 Networth Incorporated
-00007A Dana Computer
-00007B Research Machines
-00007C Ampere Incorporated
-00007D SUN Microsystems
-00007E Clustrix
-00007F Linotype-hell AG
-000080 Cray Communications A/S
-000081 BAY Networks
-000082 Lectra Systemes SA
-000083 Tadpole Technology PLC
-000084 Supernet
-000085 Canon
-000086 Megahertz
-000087 Hitachi
-000088 Brocade Communications Systems
-000089 Cayman Systems
-00008A Datahouse Information Systems
-00008B Infotron
-00008C Alloy Computer Products (Australia)
-00008D Cryptek
-00008E Solbourne Computer
-00008F Raytheon
-000090 Microcom
-000091 Anritsu
-000092 Cogent Data Technologies
-000093 Proteon
-000094 Asante Technologies
-000095 Sony Tektronix
-000096 Marconi Electronics
-000097 EMC
-000098 Crosscomm
-000099 MTX
-00009A RC Computer A/S
-00009B Information International
-00009C Rolm Mil-spec Computers
-00009D Locus Computing
-00009E Marli S.A.
-00009F Ameristar Technologies
-0000A0 Sanyo Electric Co.
-0000A1 Marquette Electric CO.
-0000A2 BAY Networks
-0000A3 Network Application Technology
-0000A4 Acorn Computers Limited
-0000A5 Compatible Systems
-0000A6 Network General
-0000A7 Network Computing Devices
-0000A8 Stratus Computer
-0000A9 Network Systems
-0000AA Xerox
-0000AB Logic Modeling
-0000AC Conware Computer Consulting
-0000AD Bruker Instruments
-0000AE Dassault Electronique
-0000AF Nuclear Data Instrumentation
-0000B0 Rnd-rad Network Devices
-0000B1 Alpha Microsystems
-0000B2 Televideo Systems
-0000B3 Cimlinc Incorporated
-0000B4 Edimax Computer Company
-0000B5 Datability Software SYS.
-0000B6 Micro-matic Research
-0000B7 Dove Computer
-0000B8 Seikosha CO.
-0000B9 Mcdonnell Douglas Computer SYS
-0000BA SIIG
-0000BB Tri-data
-0000BC Rockwell Automation
-0000BD Mitsubishi Cable Company
-0000BE THE NTI Group
-0000BF Symmetric Computer Systems
-0000C0 Western Digital
-0000C1 Madge
-0000C2 Information Presentation TECH.
-0000C3 Harris Computer SYS DIV
-0000C4 Waters DIV. OF Millipore
-0000C5 Farallon Computing/netopia
-0000C6 EON Systems
-0000C7 Arix
-0000C8 Altos Computer Systems
-0000C9 Emulex
-0000CA Arris International
-0000CB Compu-shack Electronic Gmbh
-0000CC Densan CO.
-0000CD Allied Telesis Labs
-0000CE Megadata
-0000CF Hayes Microcomputer Products
-0000D0 Develcon Electronics
-0000D1 Adaptec Incorporated
-0000D2 SBE
-0000D3 Wang Laboratories
-0000D4 Pure Data
-0000D5 Micrognosis International
-0000D6 Punch Line Holding
-0000D7 Dartmouth College
-0000D8 Novell
-0000D9 Nippon Telegraph & Telephone
-0000DA Atex
-0000DB British Telecommunications PLC
-0000DC Hayes Microcomputer Products
-0000DD TCL Incorporated
-0000DE Cetia
-0000DF Bell & Howell PUB SYS DIV
-0000E0 Quadram
-0000E1 Grid Systems
-0000E2 Acer Technologies
-0000E3 Integrated Micro Products
-0000E4 IN2 Groupe Intertechnique
-0000E5 Sigmex
-0000E6 Aptor Produits DE Comm Indust
-0000E7 Star Gate Technologies
-0000E8 Accton Technology
-0000E9 Isicad
-0000EA Upnod AB
-0000EB Matsushita COMM. IND. CO.
-0000EC Microprocess
-0000ED April
-0000EE Network Designers
-0000EF KTI
-0000F0 Samsung Electronics CO.
-0000F1 Magna Computer
-0000F2 Spider Communications
-0000F3 Gandalf Data Limited
-0000F4 Allied Telesyn International
-0000F5 Diamond Sales Limited
-0000F6 Applied Microsystems
-0000F7 Youth Keep Enterprise CO
-0000F8 Digital Equipment
-0000F9 Quotron Systems
-0000FA Microsage Computer Systems
-0000FB Rechner ZUR Kommunikation
-0000FC Meiko
-0000FD High Level Hardware
-0000FE Annapolis Micro Systems
-0000FF Camtec Electronics
-000100 Equip'trans
-000101 Private
-000102 3com
-000103 3com
-000104 Dvico Co.
-000105 Beckhoff Automation GmbH
-000106 Tews Datentechnik GmbH
-000107 Leiser GmbH
-000108 Avlab Technology
-000109 Nagano Japan Radio Co.
-00010A CIS Technology
-00010B Space CyberLink
-00010C System Talks
-00010D Coreco
-00010E Bri-Link Technologies Co.
-00010F Brocade Communications Systems
-000110 Gotham Networks
-000111 iDigm
-000112 Shark Multimedia
-000113 Olympus
-000114 Kanda Tsushin Kogyo CO.
-000115 Extratech
-000116 Netspect Technologies
-000117 Canal
-000118 EZ Digital Co.
-000119 RTUnet (Australia)
-00011A EEH DataLink GmbH
-00011B Unizone Technologies
-00011C Universal Talkware
-00011D Centillium Communications
-00011E Precidia Technologies
-00011F RC Networks
-000120 Oscilloquartz S.A.
-000121 Watchguard Technologies
-000122 Trend Communications
-000123 Digital Electronics
-000124 Acer Incorporated
-000125 Yaesu Musen CO.
-000126 PAC Labs
-000127 Open Networks
-000128 EnjoyWeb
-000129 DFI
-00012A Telematica Sistems Inteligente
-00012B Telenet Co.
-00012C Aravox Technologies
-00012D Komodo Technology
-00012E PC Partner
-00012F Twinhead International
-000130 Extreme Networks
-000131 Detection Systems
-000132 Dranetz - BMI
-000133 Kyowa Electronic Instruments
-000134 Selectron Systems AG
-000135 KDC
-000136 CyberTAN Technology
-000137 IT Farm
-000138 XAVi Technologies
-000139 Point Multimedia Systems
-00013A Shelcad Communications
-00013B BNA Systems
-00013C TIW Systems
-00013D RiscStation
-00013E Ascom Tateco AB
-00013F Neighbor World Co.
-000140 Sendtek
-000141 Cable Print
-000142 Cisco Systems
-000143 Cisco Systems
-000144 EMC
-000145 Winsystems
-000146 Tesco Controls
-000147 Zhone Technologies
-000148 X-traWeb
-000149 T.D.T. Transfer Data Test GmbH
-00014A Sony
-00014B Ennovate Networks
-00014C Berkeley Process Control
-00014D Shin Kin Enterprises Co.
-00014E WIN Enterprises
-00014F Adtran
-000150 Gilat Communications
-000151 Ensemble Communications
-000152 Chromatek
-000153 Archtek Telecom
-000154 G3M
-000155 Promise Technology
-000156 Firewiredirect.com
-000157 Syswave CO.
-000158 Electro Industries/Gauge Tech
-000159 S1
-00015A Digital Video Broadcasting
-00015B Italtel S.p.a/rf-up-i
-00015C Cadant
-00015D Sun Microsystems
-00015E Best Technology CO.
-00015F Digital Design Gmbh
-000160 Elmex Co.
-000161 Meta Machine Technology
-000162 Cygnet Technologies
-000163 Cisco Systems
-000164 Cisco Systems
-000165 AirSwitch
-000166 TC Group A/S
-000167 Hioki E.E.
-000168 Vitana
-000169 Celestix Networks Pte
-00016A Alitec
-00016B LightChip
-00016C Foxconn
-00016D CarrierComm
-00016E Conklin
-00016F Inkel
-000170 ESE Embedded System Engineer'g
-000171 Allied Data Technologies
-000172 TechnoLand Co.
-000173 Amcc
-000174 CyberOptics
-000175 Radiant Communications
-000176 Orient Silver Enterprises
-000177 Edsl
-000178 Margi Systems
-000179 Wireless Technology
-00017A Chengdu Maipu Electric Industrial Co.
-00017B Heidelberger Druckmaschinen AG
-00017C AG-E GmbH
-00017D ThermoQuest
-00017E Adtek System Science Co.
-00017F Experience Music Project
-000180 AOpen
-000181 Nortel Networks
-000182 Dica Technologies AG
-000183 Anite Telecoms
-000184 Sieb & Meyer AG
-000185 Aloka Co.
-000186 Uwe Disch
-000187 i2SE GmbH
-000188 Lxco Technologies ag
-000189 Refraction Technology
-00018A ROI Computer AG
-00018B NetLinks Co.
-00018C Mega Vision
-00018D AudeSi Technologies
-00018E Logitec
-00018F Kenetec
-000190 Smk-m
-000191 Syred Data Systems
-000192 Texas Digital Systems
-000193 Hanbyul Telecom Co.
-000194 Capital Equipment
-000195 Sena Technologies
-000196 Cisco Systems
-000197 Cisco Systems
-000198 Darim Vision
-000199 HeiSei Electronics
-00019A Leunig Gmbh
-00019B Kyoto Microcomputer Co.
-00019C JDS Uniphase
-00019D E-Control Systems
-00019E ESS Technology
-00019F Phonex Broadband
-0001A0 Infinilink
-0001A1 Mag-Tek
-0001A2 Logical Co.
-0001A3 Genesys Logic
-0001A4 Microlink
-0001A5 Nextcomm
-0001A6 Scientific-Atlanta Arcodan A/S
-0001A7 Unex Technology
-0001A8 Welltech Computer Co.
-0001A9 BMW AG
-0001AA Airspan Communications
-0001AB Main Street Networks
-0001AC Sitara Networks
-0001AD Coach Master International d.b.a. CMI Worldwide
-0001AE Trex Enterprises
-0001AF Emerson Network Power
-0001B0 Fulltek Technology Co.
-0001B1 General Bandwidth
-0001B2 Digital Processing Systems
-0001B3 Precision Electronic Manufacturing
-0001B4 Wayport
-0001B5 Turin Networks
-0001B6 Saejin T&M Co.
-0001B7 Centos
-0001B8 Netsensity
-0001B9 SKF Condition Monitoring
-0001BA IC-Net
-0001BB Frequentis
-0001BC Brains
-0001BD Peterson Electro-Musical Products
-0001BE Gigalink Co.
-0001BF Teleforce Co.
-0001C0 CompuLab
-0001C1 Vitesse Semiconductor
-0001C2 ARK Research
-0001C3 Acromag
-0001C4 NeoWave
-0001C5 Simpler Networks
-0001C6 Quarry Technologies
-0001C7 Cisco Systems
-0001C8 Thomas Conrad
-0001C8 Conrad
-0001C9 Cisco Systems
-0001CA Geocast Network Systems
-0001CB EVR
-0001CC Japan Total Design Communication Co.
-0001CD ARtem
-0001CE Custom Micro Products
-0001CF Alpha Data Parallel Systems
-0001D0 VitalPoint
-0001D1 CoNet Communications
-0001D2 MacPower Peripherals
-0001D3 Paxcomm
-0001D4 Leisure Time
-0001D5 Haedong Info & Comm CO.
-0001D6 manroland AG
-0001D7 F5 Networks
-0001D8 Teltronics
-0001D9 Sigma
-0001DA Wincomm
-0001DB Freecom Technologies GmbH
-0001DC Activetelco
-0001DD Avail Networks
-0001DE Trango Systems
-0001DF Isdn Communications
-0001E0 Fast Systems
-0001E1 Kinpo Electronics
-0001E2 Ando Electric
-0001E3 Siemens AG
-0001E4 Sitera
-0001E5 Supernet
-0001E6 Hewlett-Packard Company
-0001E7 Hewlett-Packard Company
-0001E8 Force10 Networks
-0001E9 Litton Marine Systems B.V.
-0001EA Cirilium
-0001EB C-COM
-0001EC Ericsson Group
-0001ED Seta
-0001EE Comtrol Europe
-0001EF Camtel Technology
-0001F0 Tridium
-0001F1 Innovative Concepts
-0001F2 Mark of the Unicorn
-0001F3 QPS
-0001F4 Enterasys Networks
-0001F5 Erim S.A.
-0001F6 Association of Musical Electronics Industry
-0001F7 Image Display Systems
-0001F8 Adherent Systems
-0001F9 TeraGlobal Communications
-0001FA Horoscas
-0001FB DoTop Technology
-0001FC Keyence
-0001FD Digital Voice Systems
-0001FE Digital Equipment
-0001FF Data Direct Networks
-000200 Net & Sys Co.
-000201 IFM Electronic gmbh
-000202 Amino Communications
-000203 Woonsang Telecom
-000204 Bodmann Industries Elektronik GmbH
-000205 Hitachi Denshi
-000206 Telital R&D Denmark A/S
-000207 VisionGlobal Network
-000208 Unify Networks
-000209 Shenzhen SED Information Technology Co.
-00020A Gefran Spa
-00020B Native Networks
-00020C Metro-Optix
-00020D Micronpc.com
-00020E ECI Telecom,, NSD-US
-00020F Aatr
-000210 Fenecom
-000211 Nature Worldwide Technology
-000212 SierraCom
-000213 S.d.e.l.
-000214 Dtvro
-000215 Cotas Computer Technology A/B
-000216 Cisco Systems
-000217 Cisco Systems
-000218 Advanced Scientific
-000219 Paralon Technologies
-00021A Zuma Networks
-00021B Kollmorgen-Servotronix
-00021C Network Elements
-00021D Data General Communication
-00021E Simtel S.r.l.
-00021F Aculab PLC
-000220 Canon Aptex
-000221 DSP Application
-000222 Chromisys
-000223 ClickTV
-000224 C-cor
-000225 One Stop Systems
-000226 XESystems
-000227 ESD Electronic System Design GmbH
-000228 Necsom
-000229 Adtec
-00022A Asound Electronic
-00022B SAXA
-00022C ABB Bomem
-00022D Agere Systems
-00022E Teac R&
-00022F P-Cube
-000230 Intersoft Electronics
-000231 Ingersoll-Rand
-000232 Avision
-000233 Mantra Communications
-000234 Imperial Technology
-000235 Paragon Networks International
-000236 Init Gmbh
-000237 Cosmo Research
-000238 Serome Technology
-000239 Visicom
-00023A ZSK Stickmaschinen GmbH
-00023B Redback Networks
-00023C Creative Technology
-00023D NuSpeed
-00023E Selta Telematica S.p.a
-00023F Compal Electronics
-000240 Seedek Co.
-000241 Amer.com
-000242 Videoframe Systems
-000243 Raysis Co.
-000244 Surecom Technology Co.
-000245 Lampus Co
-000246 All-Win Tech Co.
-000247 Great Dragon Information Technology (Group) Co.
-000248 Pilz GmbH & Co.
-000249 Aviv Infocom Co
-00024A Cisco Systems
-00024B Cisco Systems
-00024C SiByte
-00024D Mannesman Dematic Colby
-00024E Datacard Group
-00024F IPM Datacom S.R.L.
-000250 Geyser Networks
-000251 Soma Networks
-000252 Carrier
-000253 Televideo
-000254 WorldGate
-000255 IBM
-000256 Alpha Processor
-000257 Microcom
-000258 Flying Packets Communications
-000259 Tsann Kuen China (Shanghai)Enterprise Co., IT Group
-00025A Catena Networks
-00025B Cambridge Silicon Radio
-00025C SCI Systems (Kunshan) Co.
-00025D Calix Networks
-00025E High Technology
-00025F Nortel Networks
-000260 Accordion Networks
-000261 Tilgin AB
-000262 Soyo Group Soyo Com Tech Co.
-000263 UPS Manufacturing SRL
-000264 AudioRamp.com
-000265 Virditech Co.
-000266 Thermalogic
-000267 Node Runner
-000268 Harris Government Communications
-000269 Nadatel Co.
-00026A Cocess Telecom Co.
-00026B BCM Computers Co.
-00026C Philips CFT
-00026D Adept Telecom
-00026E NeGeN Access
-00026F Senao International Co.
-000270 Crewave Co.
-000271 Vpacket Communications
-000272 CC&C Technologies
-000273 Coriolis Networks
-000274 Tommy Technologies
-000275 Smart Technologies
-000276 Primax Electronics
-000277 Cash Systemes Industrie
-000278 Samsung Electro-Mechanics Co.
-000279 Control Applications
-00027A IOI Technology
-00027B Amplify Net
-00027C Trilithic
-00027D Cisco Systems
-00027E Cisco Systems
-00027F ask-technologies.com
-000280 Mu Net
-000281 Madge
-000282 ViaClix
-000283 Spectrum Controls
-000284 Areva T&D
-000285 Riverstone Networks
-000286 Occam Networks
-000287 Adapcom
-000288 Global Village Communication
-000289 DNE Technologies
-00028A Ambit Microsystems
-00028B Vdsl Systems OY
-00028C Micrel-Synergy Semiconductor
-00028D Movita Technologies
-00028E Rapid 5 Networks
-00028F Globetek
-000290 Woorigisool
-000291 Open Network Co.
-000292 Logic Innovations
-000293 Solid Data Systems
-000294 Tokyo Sokushin Co.
-000295 IP.Access Limited
-000296 Lectron Co
-000297 C-COR.net
-000298 Broadframe
-000299 Apex
-00029A Storage Apps
-00029B Kreatel Communications AB
-00029C 3com
-00029D Merix
-00029E Information Equipment Co.
-00029F L-3 Communication Aviation Recorders
-0002A0 Flatstack
-0002A1 World Wide Packets
-0002A2 Hilscher GmbH
-0002A3 ABB Power Automation
-0002A4 AddPac Technology Co.
-0002A5 Hewlett Packard
-0002A6 Effinet Systems Co.
-0002A7 Vivace Networks
-0002A8 Air Link Technology
-0002A9 Racom, S.r.o.
-0002AA PLcom Co.
-0002AB CTC Union Technologies Co.
-0002AC 3PAR data
-0002AD Hoya
-0002AE Scannex Electronics
-0002AF TeleCruz Technology
-0002B0 Hokubu Communication & Industrial Co.
-0002B1 Anritsu
-0002B2 Cablevision
-0002B3 Intel
-0002B4 Daphne
-0002B5 Avnet
-0002B6 Acrosser Technology Co.
-0002B7 Watanabe Electric Industry Co.
-0002B8 WHI Konsult AB
-0002B9 Cisco Systems
-0002BA Cisco Systems
-0002BB Continuous Computing
-0002BC LVL 7 Systems
-0002BD Bionet Co.
-0002BE Totsu Engineering
-0002BF dotRocket
-0002C0 Bencent Tzeng Industry Co.
-0002C1 Innovative Electronic Designs
-0002C2 Net Vision Telecom
-0002C3 Arelnet
-0002C4 Vector International Bvba
-0002C5 Evertz Microsystems
-0002C6 Data Track Technology PLC
-0002C7 Alps Electric Co.
-0002C8 Technocom Communications Technology (pte)
-0002C9 Mellanox Technologies
-0002CA EndPoints
-0002CB TriState
-0002CC M.c.c.i
-0002CD TeleDream
-0002CE FoxJet
-0002CF ZyGate Communications
-0002D0 Comdial
-0002D1 Vivotek
-0002D2 Workstation AG
-0002D3 NetBotz
-0002D4 PDA Peripherals
-0002D5 ACR
-0002D6 Nice Systems
-0002D7 Empeg
-0002D8 Brecis Communications
-0002D9 Reliable Controls
-0002DA ExiO Communications
-0002DB Netsec
-0002DC Fujitsu General Limited
-0002DD Bromax Communications
-0002DE Astrodesign
-0002DF Net Com Systems
-0002E0 Etas Gmbh
-0002E1 Integrated Network
-0002E2 NDC Infared Engineering
-0002E3 Lite-on Communications
-0002E4 JC Hyun Systems
-0002E5 Timeware
-0002E6 Gould Instrument Systems
-0002E7 CAB GmbH & Co KG
-0002E8 E.d.&a.
-0002E9 CS Systemes De Securite - C3S
-0002EA Focus Enhancements
-0002EB Pico Communications
-0002EC Maschoff Design Engineering
-0002ED DXO Telecom Co.
-0002EE Nokia Danmark A/S
-0002EF CCC Network Systems Group
-0002F0 AME Optimedia Technology Co.
-0002F1 Pinetron Co.
-0002F2 eDevice
-0002F3 Media Serve Co.
-0002F4 Pctel
-0002F5 Vive Synergies
-0002F6 Equipe Communications
-0002F7 ARM
-0002F8 Seakr Engineering
-0002F9 Mimos Semiconductor SDN BHD
-0002FA DX Antenna Co.
-0002FB Baumuller Aulugen-Systemtechnik GmbH
-0002FC Cisco Systems
-0002FD Cisco Systems
-0002FE Viditec
-0002FF Handan BroadInfoCom
-000300 NetContinuum
-000301 Avantas Networks
-000302 Charles Industries
-000303 Jama Electronics Co.
-000304 Pacific Broadband Communications
-000305 Smart Network Devices GmbH
-000306 Fusion In Tech Co.
-000307 Secure Works
-000308 AM Communications
-000309 Texcel Technology PLC
-00030A Argus Technologies
-00030B Hunter Technology
-00030C Telesoft Technologies
-00030D Uniwill Computer
-00030E Core Communications Co.
-00030F Digital China (Shanghai) Networks
-000310 ITX E-Globaledge
-000311 Micro Technology Co.
-000312 TR-Systemtechnik GmbH
-000313 Access Media SPA
-000314 Teleware Network Systems
-000315 Cidco Incorporated
-000316 Nobell Communications
-000317 Merlin Systems
-000318 Cyras Systems
-000319 Infineon AG
-00031A Beijing Broad Telecom
-00031B Cellvision Systems
-00031C Svenska Hardvarufabriken AB
-00031D Taiwan Commate Computer
-00031E Optranet
-00031F Condev
-000320 Xpeed
-000321 Reco Research Co.
-000322 Idis Co.
-000323 Cornet Technology
-000324 Sanyo Multimedia Tottori Co.
-000325 Arima Computer
-000326 Iwasaki Information Systems Co.
-000327 Act'l
-000328 Mace Group
-000329 F3
-00032A UniData Communication Systems
-00032B GAI Datenfunksysteme GmbH
-00032C ABB Switzerland
-00032D Ibase Technology
-00032E Scope Information Management
-00032F Global Sun Technology
-000330 Imagenics, Co.
-000331 Cisco Systems
-000332 Cisco Systems
-000333 Digitel Co.
-000334 Newport Electronics
-000335 Mirae Technology
-000336 Zetes Technologies
-000337 Vaone
-000338 Oak Technology
-000339 Eurologic Systems
-00033A Silicon Wave
-00033B Tami Tech Co.
-00033C Daiden Co.
-00033D Ilshin Lab
-00033E Tateyama System Laboratory Co.
-00033F BigBand Networks
-000340 Floware Wireless Systems
-000341 Axon Digital Design
-000342 Nortel Networks
-000343 Martin Professional A/S
-000344 Tietech.Co.
-000345 Routrek Networks
-000346 Hitachi Kokusai Electric
-000347 Intel
-000348 Norscan Instruments
-000349 Vidicode Datacommunicatie B.V.
-00034A Rias
-00034B Nortel Networks
-00034C Shanghai DigiVision Technology Co.
-00034D Chiaro Networks
-00034E Pos Data Company
-00034F Sur-Gard Security
-000350 Bticino SPA
-000351 Diebold
-000352 Colubris Networks
-000353 Mitac
-000354 Fiber Logic Communications
-000355 TeraBeam Internet Systems
-000356 Wincor Nixdorf International GmbH
-000357 Intervoice-Brite
-000358 Hanyang Digitech Co.
-000359 DigitalSis
-00035A Photron Limited
-00035B BridgeWave Communications
-00035C Saint Song
-00035D Bosung Hi-Net Co.
-00035E Metropolitan Area Networks
-00035F Prueftechnik Condition Monitoring GmbH & Co. KG
-000360 PAC Interactive Technology
-000361 Widcomm
-000362 Vodtel Communications
-000363 Miraesys Co.
-000364 Scenix Semiconductor
-000365 Kira Information & Communications
-000366 ASM Pacific Technology
-000367 Jasmine Networks
-000368 Embedone Co.
-000369 Nippon Antenna Co.
-00036A Mainnet
-00036B Cisco Systems
-00036C Cisco Systems
-00036D Runtop
-00036E Nicon Systems (Pty) Limited
-00036F Telsey SPA
-000370 NXTV
-000371 Acomz Networks
-000372 Ulan
-000373 Aselsan A.S
-000374 Control Microsystems
-000375 NetMedia
-000376 Graphtec Technology
-000377 Gigabit Wireless
-000378 Humax Co.
-000379 Proscend Communications
-00037A Taiyo Yuden Co.
-00037B Idec Izumi
-00037C Coax Media
-00037D Stellcom
-00037E Portech Communications
-00037F Atheros Communications
-000380 SSH Communications Security
-000381 Ingenico International
-000382 A-One Co.
-000383 Metera Networks
-000384 Aeta
-000385 Actelis Networks
-000386 Ho Net
-000387 Blaze Network Products
-000388 Fastfame Technology Co.
-000389 Plantronics
-00038A America Online
-00038B Plus-one I&T
-00038C Total Impact
-00038D PCS Revenue Control Systems
-00038E Atoga Systems
-00038F Weinschel
-000390 Digital Video Communications
-000391 Advanced Digital Broadcast
-000392 Hyundai Teletek Co.
-000393 Apple Computer
-000394 Connect One
-000395 California Amplifier
-000396 EZ Cast Co.
-000397 Watchfront Limited
-000398 Wisi
-000399 Dongju Informations & Communications Co.
-00039A SiConnect
-00039B NetChip Technology
-00039C OptiMight Communications
-00039D Qisda
-00039E Tera System Co.
-00039F Cisco Systems
-0003A0 Cisco Systems
-0003A1 Hiper Information & Communication
-0003A2 Catapult Communications
-0003A3 Mavix
-0003A4 Imation
-0003A5 Medea
-0003A6 Traxit Technology
-0003A7 Unixtar Technology
-0003A8 Idot Computers
-0003A9 Axcent Media AG
-0003AA Watlow
-0003AB Bridge Information Systems
-0003AC Fronius Schweissmaschinen
-0003AD Emerson Energy Systems AB
-0003AE Allied Advanced Manufacturing Pte
-0003AF Paragea Communications
-0003B0 Xsense Technology
-0003B1 Hospira
-0003B2 Radware
-0003B3 IA Link Systems Co.
-0003B4 Macrotek International
-0003B5 Entra Technology Co.
-0003B6 QSI
-0003B7 Zaccess Systems
-0003B8 NetKit Solutions
-0003B9 Hualong Telecom Co.
-0003BA Sun Microsystems
-0003BB Signal Communications Limited
-0003BC COT GmbH
-0003BD OmniCluster Technologies
-0003BE Netility
-0003BF Centerpoint Broadband Technologies
-0003C0 Rftnc Co.
-0003C1 Packet Dynamics
-0003C2 Solphone K.K.
-0003C3 Micronik Multimedia
-0003C4 Tomra Systems ASA
-0003C5 Mobotix AG
-0003C6 Icue Systems
-0003C7 hopf Elektronik GmbH
-0003C8 CML Emergency Services
-0003C9 Tecom Co.
-0003CA MTS Systems
-0003CB Nippon Systems Development Co.
-0003CC Momentum Computer
-0003CD Clovertech
-0003CE Eten Technologies
-0003CF Muxcom
-0003D0 Koankeiso Co.
-0003D1 Takaya
-0003D2 Crossbeam Systems
-0003D3 Internet Energy Systems
-0003D4 Alloptic
-0003D5 Advanced Communications Co.
-0003D6 Radvision
-0003D7 NextNet Wireless
-0003D8 iMPath Networks
-0003D9 Secheron SA
-0003DA Takamisawa Cybernetics Co.
-0003DB Apogee Electronics
-0003DC Lexar Media
-0003DD Comark
-0003DE OTC Wireless
-0003DF Desana Systems
-0003E0 RadioFrame Networks
-0003E1 Winmate Communication
-0003E2 Comspace
-0003E3 Cisco Systems
-0003E4 Cisco Systems
-0003E5 Hermstedt SG
-0003E6 Entone
-0003E7 Logostek Co.
-0003E8 Wavelength Digital Limited
-0003E9 Akara Canada
-0003EA Mega System Technologies
-0003EB Atrica
-0003EC ICG Research
-0003ED Shinkawa Electric Co.
-0003EE MKNet
-0003EF Oneline AG
-0003F0 Redfern Broadband Networks
-0003F1 Cicada Semiconductor
-0003F2 Seneca Networks
-0003F3 Dazzle Multimedia
-0003F4 NetBurner
-0003F5 Chip2Chip
-0003F6 Allegro Networks
-0003F7 Plast-Control GmbH
-0003F8 SanCastle Technologies
-0003F9 Pleiades Communications
-0003FA TiMetra Networks
-0003FB Enegate Co.
-0003FC Intertex Data AB
-0003FD Cisco Systems
-0003FE Cisco Systems
-0003FF Microsoft
-000400 Lexmark International
-000401 Osaki Electric Co.
-000402 Nexsan Technologies
-000403 Nexsi
-000404 Makino Milling Machine Co.
-000405 ACN Technologies
-000406 Fa. Metabox AG
-000407 Topcon Positioning Systems
-000408 Sanko Electronics Co.
-000409 Cratos Networks
-00040A Sage Systems
-00040B 3com Europe
-00040C Kanno Work's
-00040D Avaya
-00040E AVM GmbH
-00040F Asus Network Technologies
-000410 Spinnaker Networks
-000411 Inkra Networks
-000412 WaveSmith Networks
-000413 Snom Technology AG
-000414 Umezawa Musen Denki Co.
-000415 Rasteme Systems Co.
-000416 Parks S/A Comunicacoes Digitais
-000417 Elau AG
-000418 TeltronicU.
-000419 Fibercycle Networks
-00041A Ines Test and Measurement GmbH & CoKG
-00041B Bridgeworks
-00041C ipDialog
-00041D Corega of America
-00041E Shikoku Instrumentation Co.
-00041F Sony Computer Entertainment
-000420 Slim Devices
-000421 Ocular Networks
-000422 Gordon Kapes
-000423 Intel
-000424 TMC s.r.l.
-000425 Atmel
-000426 Autosys
-000427 Cisco Systems
-000428 Cisco Systems
-000429 Pixord
-00042A Wireless Networks
-00042B IT Access Co.
-00042C Minet
-00042D Sarian Systems
-00042E Netous Technologies
-00042F International Communications Products
-000430 Netgem
-000431 GlobalStreams
-000432 Voyetra Turtle Beach
-000433 Cyberboard A/S
-000434 Accelent Systems
-000435 Comptek International
-000436 Elansat Technologies
-000437 Powin Information Technology
-000438 Nortel Networks
-000439 Rosco Entertainment Technology
-00043A Intelligent Telecommunications
-00043B Lava Computer Mfg.
-00043C Sonos Co.
-00043D Indel AG
-00043E Telencomm
-00043F Electronic Systems Technology
-000440 cyberPIXIE
-000441 Half Dome Systems
-000442 Nact
-000443 Agilent Technologies
-000444 Western Multiplex
-000445 LMS Skalar Instruments GmbH
-000446 Cyzentech Co.
-000447 Acrowave Systems Co.
-000448 Polaroid
-000449 Mapletree Networks
-00044A iPolicy Networks
-00044B Nvidia
-00044C Jenoptik
-00044D Cisco Systems
-00044E Cisco Systems
-00044F Leukhardt Systemelektronik GmbH
-000450 DMD Computers SRL
-000451 Medrad
-000452 RocketLogix
-000453 YottaYotta
-000454 Quadriga UK
-000455 Antara.net
-000456 Motorola PTP
-000457 Universal Access Technology
-000458 Fusion X Co.
-000459 Veristar
-00045A The Linksys Group
-00045B Techsan Electronics Co.
-00045C Mobiwave Pte
-00045D Beka Elektronik
-00045E PolyTrax Information Technology AG
-00045F Evalue Technology
-000460 Knilink Technology
-000461 Epox Computer Co.
-000462 Dakos Data & Communication Co.
-000463 Bosch Security Systems
-000464 Fantasma Networks
-000465 i.s.t isdn-support technik GmbH
-000466 Armitel Co.
-000467 Wuhan Research Institute of MII
-000468 Vivity
-000469 Innocom
-00046A Navini Networks
-00046B Palm Wireless
-00046C Cyber Technology Co.
-00046D Cisco Systems
-00046E Cisco Systems
-00046F Digitel S/A Industria Eletronica
-000470 ipUnplugged AB
-000471 IPrad
-000472 Telelynx
-000473 Photonex
-000474 Legrand
-000475 3 Com
-000476 3 Com
-000477 Scalant Systems
-000478 G. Star Technology
-000479 Radius Co.
-00047A Axxessit ASA
-00047B Schlumberger
-00047C Skidata AG
-00047D Pelco
-00047E Optelecom=NKF
-00047F Chr. Mayr GmbH & Co. KG
-000480 Foundry Networks
-000481 Econolite Control Products
-000482 Medialogic
-000483 Deltron Technology
-000484 Amann GmbH
-000485 PicoLight
-000486 ITTC, University of Kansas
-000487 Cogency Semiconductor
-000488 Eurotherm Controls
-000489 Yafo Networks
-00048A Temia Vertriebs GmbH
-00048B Poscon
-00048C Nayna Networks
-00048D Tone Commander Systems
-00048E Ohm Tech Labs
-00048F TD Systems
-000490 Optical Access
-000491 Technovision
-000492 Hive Internet
-000493 Tsinghua Unisplendour Co.
-000494 Breezecom
-000495 Tejas Networks
-000496 Extreme Networks
-000497 MacroSystem Digital Video AG
-000498 Mahi Networks
-000499 Chino
-00049A Cisco Systems
-00049B Cisco Systems
-00049C Surgient Networks
-00049D Ipanema Technologies
-00049E Wirelink Co.
-00049F Freescale Semiconductor
-0004A0 Verity Instruments
-0004A1 Pathway Connectivity
-0004A2 L.S.I. Japan Co.
-0004A3 Microchip Technology
-0004A4 NetEnabled
-0004A5 Barco Projection Systems NV
-0004A6 SAF Tehnika
-0004A7 FabiaTech
-0004A8 Broadmax Technologies
-0004A9 SandStream Technologies
-0004AA Jetstream Communications
-0004AB Comverse Network Systems
-0004AC IBM
-0004AD Malibu Networks
-0004AE Sullair
-0004AF Digital Fountain
-0004B0 Elesign Co.
-0004B1 Signal Technology
-0004B2 Essegi SRL
-0004B3 Videotek
-0004B4 Ciac
-0004B5 Equitrac
-0004B6 Stratex Networks
-0004B7 AMB i.t. Holding
-0004B8 Kumahira Co.
-0004B9 S.I. Soubou
-0004BA KDD Media Will
-0004BB Bardac
-0004BC Giantec
-0004BD Motorola BCS
-0004BE OptXCon
-0004BF VersaLogic
-0004C0 Cisco Systems
-0004C1 Cisco Systems
-0004C2 Magnipix
-0004C3 Castor Informatique
-0004C4 Allen & Heath Limited
-0004C5 ASE Technologies
-0004C6 Yamaha Motor Co.
-0004C7 NetMount
-0004C8 Liba Maschinenfabrik Gmbh
-0004C9 Micro Electron Co.
-0004CA FreeMs
-0004CB Tdsoft Communication
-0004CC Peek Traffic B.V.
-0004CD Informedia Research Group
-0004CE Patria Ailon
-0004CF Seagate Technology
-0004D0 Softlink s.r.o.
-0004D1 Drew Technologies
-0004D2 Adcon Telemetry GmbH
-0004D3 Toyokeiki Co.
-0004D4 Proview Electronics Co.
-0004D5 Hitachi Information & Communication Engineering
-0004D6 Takagi Industrial Co.
-0004D7 Omitec Instrumentation
-0004D8 IPWireless
-0004D9 Titan Electronics
-0004DA Relax Technology
-0004DB Tellus Group
-0004DC Nortel Networks
-0004DD Cisco Systems
-0004DE Cisco Systems
-0004DF Teracom Telematica Ltda.
-0004E0 Procket Networks
-0004E1 Infinior Microsystems
-0004E2 SMC Networks
-0004E3 Accton Technology
-0004E4 Daeryung Ind.
-0004E5 Glonet Systems
-0004E6 Banyan Network Private Limited
-0004E7 Lightpointe Communications
-0004E8 IER
-0004E9 Infiniswitch
-0004EA Hewlett-Packard Company
-0004EB Paxonet Communications
-0004EC Memobox SA
-0004ED Billion Electric Co.
-0004EE Lincoln Electric Company
-0004EF Polestar
-0004F0 International Computers
-0004F1 WhereNet
-0004F2 Polycom
-0004F3 FS Forth-systeme Gmbh
-0004F4 Infinite Electronics
-0004F5 SnowShore Networks
-0004F6 Amphus
-0004F7 Omega Band
-0004F8 Qualicable TV Industria E Com.
-0004F9 Xtera Communications
-0004FA NBS Technologies
-0004FB Commtech
-0004FC Stratus Computer (DE)
-0004FD Japan Control Engineering Co.
-0004FE Pelago Networks
-0004FF Acronet Co.
-000500 Cisco Systems
-000501 Cisco Systems
-000502 Apple Computer
-000503 Iconag
-000504 Naray Information & Communication Enterprise
-000505 Systems Integration Solutions
-000506 Reddo Networks AB
-000507 Fine Appliance
-000508 Inetcam
-000509 Avoc Nishimura
-00050A ICS Spa
-00050B Sicom Systems
-00050C Network Photonics
-00050D Midstream Technologies
-00050E 3ware
-00050F Tanaka S/S
-000510 Infinite Shanghai Communication Terminals
-000511 Complementary Technologies
-000512 MeshNetworks
-000513 VTLinx Multimedia Systems
-000514 KDT Systems Co.
-000515 Nuark Co.
-000516 Smart Modular Technologies
-000517 Shellcomm
-000518 Jupiters Technology
-000519 Siemens Building Technologies AG,
-00051A 3Com Europe
-00051B Magic Control Technology
-00051C Xnet Technology
-00051D Airocon
-00051E Brocade Communications Systems
-00051F Taijin Media Co.
-000520 Smartronix
-000521 Control Microsystems
-000522 LEA*D
-000523 AVL List GmbH
-000524 BTL System (HK) Limited
-000525 Puretek Industrial Co.
-000526 Ipas Gmbh
-000527 SJ Tek Co.
-000528 New Focus
-000529 Shanghai Broadan Communication Technology Co.
-00052A Ikegami Tsushinki Co.
-00052B Horiba
-00052C Supreme Magic
-00052D Zoltrix International Limited
-00052E Cinta Networks
-00052F Leviton Network Solutions
-000530 Andiamo Systems
-000531 Cisco Systems
-000532 Cisco Systems
-000533 Brocade Communications Systems
-000534 Northstar Engineering
-000535 Chip PC
-000536 Danam Communications
-000537 Nets Technology Co.
-000538 Merilus
-000539 A Brand New World in Sweden AB
-00053A Willowglen Services Pte
-00053B Harbour Networks, Co. Beijing
-00053C Xircom
-00053D Agere Systems
-00053E KID Systeme GmbH
-00053F VisionTek
-000540 Fast
-000541 Advanced Systems Co.
-000542 Otari
-000543 IQ Wireless GmbH
-000544 Valley Technologies
-000545 Internet Photonics
-000546 Kddi Network & Solultions
-000547 Starent Networks
-000548 Disco
-000549 Salira Optical Network Systems
-00054A Ario Data Networks
-00054B Micro Innovation AG
-00054C RF Innovations
-00054D Brans Technologies
-00054E Philips
-00054F Private
-000550 Vcomms Limited
-000551 F & S Elektronik Systeme GmbH
-000552 Xycotec Computer GmbH
-000553 DVC Company
-000554 Rangestar Wireless
-000555 Japan Cash Machine Co.
-000556 360 Systems
-000557 Agile TV
-000558 Synchronous
-000559 Intracom S.A.
-00055A Power Dsine
-00055B Charles Industries
-00055C Kowa Company
-00055D D-Link Systems
-00055E Cisco Systems
-00055F Cisco Systems
-000560 Leader Comm.co.
-000561 nac Image Technology
-000562 Digital View Limited
-000563 J-Works
-000564 Tsinghua Bitway Co.
-000565 Tailyn Communication Company
-000566 Secui.com
-000567 Etymonic Design
-000568 Piltofish Networks AB
-000569 Vmware
-00056A Heuft Systemtechnik GmbH
-00056B C.P. Technology Co.
-00056C Hung Chang Co.
-00056D Pacific
-00056E National Enhance Technology
-00056F Innomedia Technologies Pvt.
-000570 Baydel
-000571 Seiwa Electronics Co.
-000572 Deonet Co.
-000573 Cisco Systems
-000574 Cisco Systems
-000575 CDS-Electronics BV
-000576 NSM Technology
-000577 SM Information & Communication
-000578 Private
-000579 Universal Control Solution
-00057A Hatteras Networks
-00057B Chung Nam Electronic Co.
-00057C RCO Security AB
-00057D Sun Communications
-00057E Eckelmann Steuerungstechnik GmbH
-00057F Acqis Technology
-000580 Fibrolan
-000581 Snell & Wilcox
-000582 ClearCube Technology
-000583 ImageCom Limited
-000584 AbsoluteValue Systems
-000585 Juniper Networks
-000586 Lucent Technologies
-000587 Locus, Incorporated
-000588 Sensoria
-000589 National Datacomputer
-00058A Netcom Co.
-00058B IPmental
-00058C Opentech
-00058D Lynx Photonic Networks
-00058E Flextronics International GmbH & Co. Nfg. KG
-00058F CLCsoft co.
-000590 Swissvoice
-000591 Active Silicon
-000592 Pultek
-000593 Grammar Engine
-000594 Ixxat Automation Gmbh
-000595 Alesis
-000596 Genotech Co.
-000597 Eagle Traffic Control Systems
-000598 Cronos S.r.l.
-000599 DRS Test and Energy Management or DRS-TEM
-00059A Cisco Systems
-00059B Cisco Systems
-00059C Kleinknecht GmbH, Ing. Buero
-00059D Daniel Computing Systems
-00059E Zinwell
-00059F Yotta Networks
-0005A0 Mobiline Kft.
-0005A1 Zenocom
-0005A2 Celox Networks
-0005A3 QEI
-0005A4 Lucid Voice
-0005A5 Kott
-0005A6 Extron Electronics
-0005A7 Hyperchip
-0005A8 Wyle Electronics
-0005A9 Princeton Networks
-0005AA Moore Industries International
-0005AB Cyber Fone
-0005AC Northern Digital
-0005AD Topspin Communications
-0005AE Mediaport USA
-0005AF InnoScan Computing A/S
-0005B0 Korea Computer Technology Co.
-0005B1 ASB Technology BV
-0005B2 Medison Co.
-0005B3 Asahi-Engineering Co.
-0005B4 Aceex
-0005B5 Broadcom Technologies
-0005B6 Insys Microelectronics Gmbh
-0005B7 Arbor Technology
-0005B8 Electronic Design Associates
-0005B9 Airvana
-0005BA Area Netwoeks
-0005BB Myspace AB
-0005BC Resorsys
-0005BD Roax BV
-0005BE Kongsberg Seatex AS
-0005BF JustEzy Technology
-0005C0 Digital Network Alacarte Co.
-0005C1 A-Kyung Motion
-0005C2 Soronti
-0005C3 Pacific Instruments
-0005C4 Telect
-0005C5 Flaga HF
-0005C6 Triz Communications
-0005C7 I/f-com A/S
-0005C8 Verytech
-0005C9 LG Innotek Co.
-0005CA Hitron Technology
-0005CB Rois Technologies
-0005CC Sumtel Communications
-0005CD Denon
-0005CE Prolink Microsystems
-0005CF Thunder River Technologies
-0005D0 Solinet Systems
-0005D1 Metavector Technologies
-0005D2 DAP Technologies
-0005D3 eProduction Solutions
-0005D4 FutureSmart Networks
-0005D5 Speedcom Wireless
-0005D6 Titan Wireless
-0005D7 Vista Imaging
-0005D8 Arescom
-0005D9 Techno Valley
-0005DA Apex Automationstechnik
-0005DB Nentec Netzwerktechnologie Gmbh
-0005DC Cisco Systems
-0005DD Cisco Systems
-0005DE Gi Fone Korea
-0005DF Electronic Innovation
-0005E0 Empirix
-0005E1 Trellis Photonics
-0005E2 Creativ Network Technologies
-0005E3 LightSand Communications
-0005E4 Red Lion Controls
-0005E5 Renishaw PLC
-0005E6 Egenera
-0005E7 Netrake an AudioCodes Company
-0005E8 TurboWave
-0005E9 Unicess Network
-0005EA Rednix
-0005EB Blue Ridge Networks
-0005EC Mosaic Systems
-0005ED Technikum Joanneum GmbH
-0005EE Bewator Group
-0005EF Adoir Digital Technology
-0005F0 Satec
-0005F1 Vrcom
-0005F2 Power
-0005F3 Weboyn
-0005F4 System Base Co.
-0005F5 OYO Geospace
-0005F6 Young Chang Co.
-0005F7 Analog Devices
-0005F8 Real Time Access
-0005F9 TOA
-0005FA IPOptical
-0005FB ShareGate
-0005FC Schenck Pegasus
-0005FD PacketLight Networks
-0005FE Traficon N.V.
-0005FF SNS Solutions
-000600 Toshiba Teli
-000601 Otanikeiki Co.
-000602 Cirkitech Electronics Co.
-000603 Baker Hughes
-000604 @Track Communications
-000605 Inncom International
-000606 RapidWAN
-000607 Omni Directional Control Technology
-000608 At-Sky SAS
-000609 Crossport Systems
-00060A Blue2space
-00060B Paceline Systems
-00060C Melco Industries
-00060D Wave7 Optics
-00060E Igys Systems
-00060F Narad Networks
-000610 Abeona Networks
-000611 Zeus Wireless
-000612 Accusys
-000613 Kawasaki Microelectronics Incorporated
-000614 Prism Holdings
-000615 Kimoto Electric Co.
-000616 Tel Net Co.
-000617 Redswitch
-000618 DigiPower Manufacturing
-000619 Connection Technology Systems
-00061A Zetari
-00061B Notebook Development Lab. Lenovo Japan
-00061C Hoshino Metal Industries
-00061D MIP Telecom
-00061E Maxan Systems
-00061F Vision Components GmbH
-000620 Serial System
-000621 Hinox, Co.
-000622 Chung Fu Chen Yeh Enterprise
-000623 MGE UPS Systems France
-000624 Gentner Communications
-000625 The Linksys Group
-000626 MWE GmbH
-000627 Uniwide Technologies
-000628 Cisco Systems
-000629 IBM
-00062A Cisco Systems
-00062B Intraserver Technology
-00062C Bivio Networks
-00062D TouchStar Technologies, L.L.C.
-00062E Aristos Logic
-00062F Pivotech Systems
-000630 Adtranz Sweden
-000631 Optical Solutions
-000632 Mesco Engineering GmbH
-000633 Cross Match Technologies GmbH
-000634 GTE Airfone
-000635 PacketAir Networks
-000636 Jedai Broadband Networks
-000637 Toptrend-Meta Information (ShenZhen)
-000638 Sungjin C&C Co.
-000639 Newtec
-00063A Dura Micro
-00063B Arcturus Networks
-00063C Intrinsyc Europe
-00063D Microwave Data Systems
-00063E Opthos
-00063F Everex Communications
-000640 White Rock Networks
-000641 Itcn
-000642 Genetel Systems
-000643 Sono Computer Co.
-000644 Digital Technologies
-000645 Meisei Electric Co.
-000646 ShenZhen XunBao Network Technology Co
-000647 Etrali S.A.
-000648 Seedsware
-000649 3M Deutschland GmbH
-00064A Honeywell Co., (korea)
-00064B Alexon Co.
-00064C Invicta Networks
-00064D Sencore
-00064E Broad Net Technology
-00064F Pro-nets Technology
-000650 Tiburon Networks
-000651 Aspen Networks
-000652 Cisco Systems
-000653 Cisco Systems
-000654 Winpresa Building Automation Technologies GmbH
-000655 Yipee
-000656 Tactel AB
-000657 Market Central
-000658 Helmut Fischer GmbH Institut fr Elektronik und Messtechnik
-000659 EAL (Apeldoorn) B.V.
-00065A Strix Systems
-00065B Dell Computer
-00065C Malachite Technologies
-00065D Heidelberg Web Systems
-00065E Photuris
-00065F ECI Telecom - Ngts
-000660 Nadex Co.
-000661 NIA Home Technologies
-000662 MBM Technology
-000663 Human Technology Co.
-000664 Fostex
-000665 Sunny Giken
-000666 Roving Networks
-000667 Tripp Lite
-000668 Vicon Industries
-000669 Datasound Laboratories
-00066A InfiniCon Systems
-00066B Sysmex
-00066C Robinson
-00066D Compuprint S.P.A.
-00066E Delta Electronics
-00066F Korea Data Systems
-000670 Upponetti Oy
-000671 Softing AG
-000672 Netezza
-000673 Optelecom-nkf
-000674 Spectrum Control
-000675 Banderacom
-000676 Novra Technologies
-000677 Sick AG
-000678 Marantz Brand Company
-000679 Konami
-00067A JMP Systems
-00067B Toplink C&C
-00067C Cisco Systems
-00067D Takasago
-00067E WinCom Systems
-00067F Rearden Steel Technologies
-000680 Card Access
-000681 Goepel Electronic GmbH
-000682 Convedia
-000683 Bravara Communications
-000684 Biacore AB
-000685 NetNearU
-000686 Zardcom Co.
-000687 Omnitron Systems Technology
-000688 Telways Communication Co.
-000689 yLez Technologies Pte
-00068A NeuronNet Co. R&D Center
-00068B AirRunner Technologies
-00068C 3Com
-00068D Sepaton
-00068E HID
-00068F Telemonitor
-000690 Euracom Communication GmbH
-000691 PT Inovacao
-000692 Intruvert Networks
-000693 Flexus Computer Technology
-000694 Mobillian
-000695 Ensure Technologies
-000696 Advent Networks
-000697 R & D Center
-000698 egnite Software GmbH
-000699 Vida Design Co.
-00069A e & Tel
-00069B AVT Audio Video Technologies GmbH
-00069C Transmode Systems AB
-00069D Petards Mobile Intelligence
-00069E Uniqa
-00069F Kuokoa Networks
-0006A0 Mx Imaging
-0006A1 Celsian Technologies
-0006A2 Microtune
-0006A3 Bitran
-0006A4 Innowell
-0006A5 Pinon
-0006A6 Artistic Licence (UK)
-0006A7 Primarion
-0006A8 KC Technology
-0006A9 Universal Instruments
-0006AA VT Miltope
-0006AB W-Link Systems
-0006AC Intersoft Co.
-0006AD KB Electronics
-0006AE Himachal Futuristic Communications
-0006AF Xalted Networks
-0006B0 Comtech EF Data
-0006B1 Sonicwall
-0006B2 Linxtek Co.
-0006B3 Diagraph
-0006B4 Vorne Industries
-0006B5 Luminent
-0006B6 Nir-Or Israel
-0006B7 Telem Gmbh
-0006B8 Bandspeed
-0006B9 A5TEK
-0006BA Westwave Communications
-0006BB ATI Technologies
-0006BC Macrolink
-0006BD Bntechnology Co.
-0006BE Baumer Optronic GmbH
-0006BF Accella Technologies Co.
-0006C0 United Internetworks
-0006C1 Cisco Systems
-0006C2 Smartmatic
-0006C3 Schindler Elevator
-0006C4 Piolink
-0006C5 Innovi Technologies Limited
-0006C6 lesswire AG
-0006C7 Rfnet Technologies Pte (S)
-0006C8 Sumitomo Metal Micro Devices
-0006C9 Technical Marketing Research
-0006CA American Computer & Digital Components, (acdc)
-0006CB Jotron Electronics A/S
-0006CC JMI Electronics Co.
-0006CD Kodak IL
-0006CE Dateno
-0006CF Thales Avionics In-Flight Systems
-0006D0 Elgar Electronics
-0006D1 Tahoe Networks
-0006D2 Tundra Semiconductor
-0006D3 Alpha Telecom, U.S.A.
-0006D4 Interactive Objects
-0006D5 Diamond Systems
-0006D6 Cisco Systems
-0006D7 Cisco Systems
-0006D8 Maple Optical Systems
-0006D9 IPM-Net S.p.A.
-0006DA Itran Communications
-0006DB Ichips Co.
-0006DC Syabas Technology (Amquest)
-0006DD AT & T Laboratories - Cambridge
-0006DE Flash Technology
-0006DF Aidonic
-0006E0 MAT Co.
-0006E1 Techno Trade s.a
-0006E2 Ceemax Technology Co.
-0006E3 Quantitative Imaging
-0006E4 Citel Technologies
-0006E5 Fujian Newland Computer Co.
-0006E6 DongYang Telecom Co.
-0006E7 Bit Blitz Communications
-0006E8 Optical Network Testing
-0006E9 Intime
-0006EA Elzet80 Mikrocomputer Gmbh&co. KG
-0006EB Global Data
-0006EC M/A COM Private Radio System
-0006ED Inara Networks
-0006EE Shenyang Neu-era Information & Technology Stock Co.
-0006EF Maxxan Systems
-0006F0 Digeo
-0006F1 Optillion
-0006F2 Platys Communications
-0006F3 AcceLight Networks
-0006F4 Prime Electronics & Satellitics
-0006F8 CPU Technology
-0006F9 Mitsui Zosen Systems Research
-0006FA IP Square Co
-0006FB Hitachi Printing Solutions
-0006FC Fnet Co.
-0006FD Comjet Information Systems
-0006FE Celion Networks
-0006FF Sheba Systems Co.
-000700 Zettamedia Korea
-000701 Racal-datacom
-000702 Varian Medical Systems
-000703 Csee Transport
-000705 Endress & Hauser GmbH & Co
-000706 Sanritz
-000707 Interalia
-000708 Bitrage
-000709 Westerstrand Urfabrik AB
-00070A Unicom Automation Co.
-00070B Octal
-00070C SVA-Intrusion.com Co.
-00070D Cisco Systems
-00070E Cisco Systems
-00070F Fujant
-000710 Adax
-000711 Acterna
-000712 JAL Information Technology
-000713 IP One
-000714 Brightcom
-000715 General Research of Electronics
-000716 J & S Marine
-000717 Wieland Electric GmbH
-000718 iCanTek Co.
-000719 Mobiis Co.
-00071A Finedigital
-00071B CDV Americas
-00071C AT&T Fixed Wireless Services
-00071D Satelsa Sistemas Y Aplicaciones De Telecomunicaciones
-00071E Tri-M Engineering / Nupak Dev.
-00071F European Systems Integration
-000720 Trutzschler GmbH & Co. KG
-000721 Formac Elektronik GmbH
-000722 The Nielsen Company
-000723 Elcon Systemtechnik Gmbh
-000724 Telemax Co.
-000725 Bematech International
-000727 Zi (HK)
-000728 Neo Telecom
-000729 Kistler Instrumente AG
-00072A Innovance Networks
-00072B Jung Myung Telecom Co.
-00072C Fabricom
-00072D CNSystems
-00072E North Node AB
-00072F Intransa
-000730 Hutchison Optel Telecom Technology Co.
-000731 Ophir-Spiricon
-000732 Aaeon Technology
-000733 Dancontrol Engineering
-000734 ONStor
-000735 Flarion Technologies
-000736 Data Video Technologies Co.
-000737 Soriya Co.
-000738 Young Technology Co.
-000739 Motion Media Technology
-00073A Inventel Systemes
-00073B Tenovis GmbH & Co KG
-00073C Telecom Design
-00073D Nanjing Postel Telecommunications Co.
-00073E China Great-Wall Computer Shenzhen Co.
-00073F Woojyun Systec Co.
-000740 Melco
-000741 Sierra Automated Systems
-000742 Current Technologies
-000743 Chelsio Communications
-000744 Unico
-000745 Radlan Computer Communications
-000746 Turck
-000747 Mecalc
-000748 The Imaging Source Europe
-000749 CENiX
-00074A Carl Valentin GmbH
-00074B Daihen
-00074C Beicom
-00074D Zebra Technologies
-00074E Naughty boy co.
-00074F Cisco Systems
-000750 Cisco Systems
-000751 mut AG
-000752 Rhythm Watch Co.
-000753 Beijing Qxcomm Technology Co.
-000754 Xyterra Computing
-000755 Lafon SA
-000756 Juyoung Telecom
-000757 Topcall International AG
-000758 Dragonwave
-000759 Boris Manufacturing
-00075A Air Products and Chemicals
-00075B Gibson Guitars
-00075C Eastman Kodak Company
-00075D Celleritas
-00075E Ametek Power Instruments
-00075F VCS Video Communication Systems AG
-000760 Tomis Information & Telecom
-000761 Logitech SA
-000762 Group Sense Limited
-000763 Sunniwell Cyber Tech. Co.
-000764 YoungWoo Telecom Co.
-000765 Jade Quantum Technologies
-000766 Chou Chin Industrial Co.
-000767 Yuxing Electronics Company Limited
-000768 Danfoss A/S
-000769 Italiana Macchi SpA
-00076A Nexteye Co.
-00076B Stralfors AB
-00076C Daehanet
-00076D Flexlight Networks
-00076E Sinetica Limited
-00076F Synoptics Limited
-000770 Locusnetworks
-000771 Embedded System
-000772 Alcatel Shanghai Bell Co.
-000773 Ascom Powerline Communications
-000774 GuangZhou Thinker Technology Co.
-000775 Valence Semiconductor
-000776 Federal APD
-000777 Motah
-000778 Gerstel Gmbh & Co. KG
-000779 Sungil Telecom Co.
-00077A Infoware System Co.
-00077B Millimetrix Broadband Networks
-00077C Westermo Teleindustri AB
-00077E Elrest GmbH
-00077F J Communications Co.
-000780 Bluegiga Technologies OY
-000781 Itron
-000782 Sun Microsystems
-000783 SynCom Network
-000784 Cisco Systems
-000785 Cisco Systems
-000786 Wireless Networks
-000787 Idea System Co.
-000788 Clipcomm
-000789 Eastel Systems
-00078A Mentor Data System
-00078B Wegener Communications
-00078C Elektronikspecialisten i Borlange AB
-00078D NetEngines
-00078E Garz & Friche GmbH
-00078F Emkay Innovative Products
-000790 Tri-M Technologies (s) Limited
-000791 International Data Communications
-000792 Suetron Electronic GmbH
-000793 Shin Satellite Public Company Limited
-000794 Simple Devices
-000795 Elitegroup Computer System Co. (ECS)
-000796 LSI Systems
-000797 Netpower Co.
-000798 Selea SRL
-000799 Tipping Point Technologies
-00079A Verint Systems
-00079B Aurora Networks
-00079C Golden Electronics Technology Co.
-00079D Musashi Co.
-00079E Ilinx Co.
-00079F Action Digital
-0007A0 e-Watch
-0007A1 Viasys Healthcare Gmbh
-0007A2 Opteon
-0007A3 Ositis Software
-0007A4 GN Netcom
-0007A5 Y.D.K Co.
-0007A6 Home Automation
-0007A7 A-Z
-0007A8 Haier Group Technologies
-0007A9 Novasonics
-0007AA Quantum Data
-0007AC Eolring
-0007AD Pentacon GmbH Foto-und Feinwerktechnik
-0007AE Britestream Networks
-0007AF N-Tron
-0007B0 Office Details
-0007B1 Equator Technologies
-0007B2 Transaccess S.A.
-0007B3 Cisco Systems
-0007B4 Cisco Systems
-0007B5 Any One Wireless
-0007B6 Telecom Technology
-0007B7 Samurai Ind. Prods Eletronicos Ltda
-0007B8 American Predator
-0007B9 Ginganet
-0007BA UTStarcom
-0007BB Candera
-0007BC Identix
-0007BD Radionet
-0007BE DataLogic SpA
-0007BF Armillaire Technologies
-0007C0 NetZerver
-0007C1 Overture Networks
-0007C2 Netsys Telecom
-0007C3 Thomson
-0007C4 Jean Co.
-0007C5 Gcom
-0007C6 VDS Vosskuhler GmbH
-0007C7 Synectics Systems Limited
-0007C8 Brain21
-0007C9 Technol Seven Co.
-0007CA Creatix Polymedia Ges Fur Kommunikaitonssysteme
-0007CB Freebox SA
-0007CC Kaba Benzing GmbH
-0007CD Nmtel Co.
-0007CE Cabletime Limited
-0007CF Anoto AB
-0007D0 Automat Engenharia de Automaoa Ltda.
-0007D1 Spectrum Signal Processing
-0007D2 Logopak Systeme
-0007D3 Stork Digital Imaging B.V.
-0007D4 Zhejiang Yutong Network Communication Co
-0007D5 3e Technologies Int;.
-0007D6 Commil
-0007D7 Caporis Networks AG
-0007D8 Hitron Systems
-0007D9 Splicecom
-0007DA Neuro Telecom Co.
-0007DB Kirana Networks
-0007DC Atek Co
-0007DD Cradle Technologies
-0007DE eCopilt AB
-0007DF Vbrick Systems
-0007E0 Palm
-0007E1 WIS Communications Co.
-0007E2 Bitworks
-0007E3 Navcom Technology
-0007E4 SoftRadio Co.
-0007E5 Coup
-0007E6 edgeflow Canada
-0007E7 FreeWave Technologies
-0007E8 St. Bernard Software
-0007E9 Intel
-0007EA Massana
-0007EB Cisco Systems
-0007EC Cisco Systems
-0007ED Altera
-0007EE telco Informationssysteme GmbH
-0007EF Lockheed Martin Tactical Systems
-0007F0 Beckett LogiSync
-0007F1 TeraBurst Networks
-0007F2 IOA
-0007F3 Thinkengine Networks
-0007F4 Eletex Co.
-0007F5 Bridgeco Co AG
-0007F6 Qqest Software Systems
-0007F7 Galtronics
-0007F8 ITDevices
-0007F9 Phonetics
-0007FA ITT Co.
-0007FB Giga Stream Umts Technologies Gmbh
-0007FC Adept Systems
-0007FD LANergy
-0007FE Rigaku
-0007FF Gluon Networks
-000800 Multitech Systems
-000801 HighSpeed Surfing
-000802 Hewlett Packard
-000803 Cos Tron
-000804 ICA
-000805 Techno-Holon
-000806 Raonet Systems
-000807 Access Devices Limited
-000808 PPT Vision
-000809 Systemonic AG
-00080A Espera-Werke GmbH
-00080B Birka BPA Informationssystem AB
-00080C VDA Elettronica spa
-00080D Toshiba
-00080E Motorola
-00080F Proximion Fiber Optics AB
-000810 Key Technology
-000811 Voix
-000812 GM-2
-000813 Diskbank
-000814 TIL Technologies
-000815 Cats Co.
-000816 Bluetags A/S
-000817 EmergeCore Networks
-000818 Pixelworks
-000819 Banksys
-00081A Sanrad Intelligence Storage Communications (2000)
-00081B Windigo Systems
-00081C @pos.com
-00081D Ipsil, Incorporated
-00081E Repeatit AB
-00081F Pou Yuen Tech
-000820 Cisco Systems
-000821 Cisco Systems
-000822 InPro Comm
-000823 Texa
-000824 Copitrak
-000825 Acme Packet
-000826 Colorado Med Tech
-000827 Pirelli Broadband Solutions
-000828 Koei Engineering
-000829 Aval Nagasaki
-00082A Powerwallz Network Security
-00082B Wooksung Electronics
-00082C Homag AG
-00082D Indus Teqsite Private Limited
-00082E Multitone Electronics PLC
-00084E DivergeNet
-00084F Qualstar
-000850 Arizona Instrument
-000851 Canadian Bank Note Company
-000852 Davolink Co.
-000853 Schleicher GmbH & Co. Relaiswerke KG
-000854 Netronix
-000855 Nasa-goddard Space Flight Center
-000856 Gamatronic Electronic Industries
-000857 Polaris Networks
-000858 Novatechnology
-000859 ShenZhen Unitone Electronics Co.
-00085A IntiGate
-00085B Hanbit Electronics Co.
-00085C Shanghai Dare Technologies Co.
-00085D Aastra
-00085E PCO AG
-00085F Picanol N.V.
-000860 LodgeNet Entertainment
-000861 SoftEnergy Co.
-000862 NEC Eluminant Technologies
-000863 Entrisphere
-000864 Fasy S.p.A.
-000865 Jascom CO.
-000866 DSX Access Systems
-000867 Uptime Devices
-000868 PurOptix
-000869 Command-e Technology Co.
-00086A Industrie Technik IPS GmbH
-00086B Mipsys
-00086C Plasmon LMS
-00086D Missouri FreeNet
-00086E Hyglo AB
-00086F Resources Computer Network
-000870 Rasvia Systems
-000871 Northdata Co.
-000872 Sorenson Technologies
-000873 DAP Design B.V.
-000874 Dell Computer
-000875 Acorp Electronics
-000876 SDSystem
-000877 Liebert-Hiross Spa
-000878 Benchmark Storage Innovations
-000879 CEM
-00087A Wipotec GmbH
-00087B RTX Telecom A/S
-00087C Cisco Systems
-00087D Cisco Systems
-00087E Bon Electro-Telecom
-00087F Spaun Electronic Gmbh & Co. KG
-000880 BroadTel Canada Communications
-000881 Digital Hands Co.
-000882 Sigma
-000883 Hewlett-Packard Company
-000884 Index Braille AB
-000885 EMS Dr. Thomas Wuensche
-000886 Hansung Teliann
-000887 Maschinenfabrik Reinhausen GmbH
-000888 Oullim Information Technology
-000889 Echostar Technologies
-00088A Minds@Work
-00088B Tropic Networks
-00088C Quanta Network Systems
-00088D Sigma-Links
-00088E Nihon Computer Co.
-00088F Advanced Digital Technology
-000890 Avilinks SA
-000891 Lyan
-000892 EM Solutions
-000893 LE Information Communication
-000894 InnoVISION Multimedia
-000895 Dirc Technologie Gmbh &KG
-000896 Printronix
-000897 Quake Technologies
-000898 Gigabit Optics
-000899 Netbind
-00089A Alcatel Microelectronics
-00089B ICP Electronics
-00089C Elecs Industry Co.
-00089D UHD-Elektronik
-00089E Beijing Enter-NetLTD
-00089F EFM Networks
-0008A0 Stotz Feinmesstechnik GmbH
-0008A1 CNet Technology
-0008A2 ADI Engineering
-0008A3 Cisco Systems
-0008A4 Cisco Systems
-0008A5 Peninsula Systems
-0008A6 Multiware & Image Co.
-0008A7 iLogic
-0008A8 Systec Co.
-0008A9 SangSang Technology
-0008AA Karam
-0008AB EnerLinx.com
-0008AC Eltromat GmbH
-0008AD Toyo-Linx Co.
-0008AE PacketFront Sweden AB
-0008AF Novatec
-0008B0 BKtel communications GmbH
-0008B1 ProQuent Systems
-0008B2 Shenzhen Compass Technology Development Co.
-0008B3 Fastwel
-0008B4 Syspol
-0008B5 TAI Guen Enterprise CO.
-0008B6 RouteFree
-0008B7 HIT Incorporated
-0008B8 E.F. Johnson
-0008B9 Kaon Media Co.
-0008BA Erskine Systems
-0008BB NetExcell
-0008BC Ilevo AB
-0008BD Tepg-us
-0008BE Xenpak MSA Group
-0008BF Aptus Elektronik AB
-0008C0 ASA Systems
-0008C1 Avistar Communications
-0008C2 Cisco Systems
-0008C3 Contex A/S
-0008C4 Hikari Co.
-0008C5 Liontech Co.
-0008C6 Philips Consumer Communications
-0008C7 Hewlett Packard
-0008C8 Soneticom
-0008C9 TechniSat Digital GmbH
-0008CA TwinHan Technology Co.
-0008CB Zeta Broadband
-0008CC Remotec
-0008CD With-Net
-0008CE IPMobileNet
-0008CF Nippon Koei Power Systems Co.
-0008D0 Musashi Engineering Co.
-0008D1 Karel
-0008D2 Zoom Networks
-0008D3 Hercules Technologies S.A.
-0008D4 IneoQuest Technologies
-0008D5 Vanguard Managed Solutions
-0008D6 Hassnet
-0008D7 HOW
-0008D8 Dowkey Microwave
-0008D9 Mitadenshi Co.
-0008DA SofaWare Technologies
-0008DB Corrigent Systems
-0008DC Wiznet
-0008DD Telena Communications
-0008DE 3UP Systems
-0008DF Alistel
-0008E0 ATO Technology
-0008E1 Barix AG
-0008E2 Cisco Systems
-0008E3 Cisco Systems
-0008E4 Envenergy
-0008E5 IDK
-0008E6 Littlefeet
-0008E7 SHI ControlSystems
-0008E8 Excel Master
-0008E9 NextGig
-0008EA Motion Control Engineering
-0008EB Romwin Co.
-0008EC Zonu
-0008ED ST&T Instrument
-0008EE Logic Product Development
-0008EF Dibal
-0008F0 Next Generation Systems
-0008F1 Voltaire
-0008F2 C&S Technology
-0008F3 Wany
-0008F4 Bluetake Technology Co.
-0008F5 Yestechnology Co.
-0008F6 Sumitomo Electric System Solutions Co.
-0008F7 Hitachi, Semiconductor &amp; Integrated Circuits Gr
-0008F8 Guardall
-0008F9 Padcom
-0008FA Karl E.Brinkmann GmbH
-0008FB SonoSite
-0008FC Gigaphoton
-0008FD BlueKorea Co.
-0008FE Unik C&C Co.
-0008FF Trilogy Communications
-000900 TMT
-000901 Shenzhen Shixuntong Information & Technoligy Co
-000902 Redline Communications
-000903 Panasas
-000904 Mondial Electronic
-000905 iTEC Technologies
-000906 Esteem Networks
-000907 Chrysalis Development
-000908 VTech Technology
-000909 Telenor Connect A/S
-00090A SnedFar Technology Co.
-00090B MTL Instruments PLC
-00090C Mayekawa Mfg. Co.
-00090D Leader Electronics
-00090E Helix Technology
-00090F Fortinet
-000910 Simple Access
-000911 Cisco Systems
-000912 Cisco Systems
-000913 SystemK
-000914 Computrols
-000915 CAS
-000916 Listman Home Technologies
-000917 WEM Technology
-000918 Samsung Techwin Co.
-000919 MDS Gateways
-00091A Macat Optics & Electronics Co.
-00091B Digital Generation
-00091C CacheVision
-00091D Proteam Computer
-00091E Firstech Technology
-00091F A&amp;D Co.
-000920 Epox Computer Co.
-000921 Planmeca Oy
-000922 TST Biometrics GmbH
-000923 Heaman System Co.
-000924 Telebau GmbH
-000925 VSN Systemen BV
-000926 Yoda Communications
-000927 Toyokeiki Co.
-000928 Telecore
-000929 Sanyo Industries (UK) Limited
-00092A Mytecs Co.
-00092B iQstor Networks
-00092C Hitpoint
-00092D HTC
-00092E B&Tech System
-00092F Akom Technology
-000930 AeroConcierge
-000931 Future Internet
-000932 Omnilux
-000933 Optovalley Co.
-000934 Dream-Multimedia-Tv GmbH
-000935 Sandvine Incorporated
-000936 Ipetronik GmbH &KG
-000937 Inventec Appliance
-000938 Allot Communications
-000939 ShibaSoku Co.
-00093A Molex Fiber Optics
-00093B Hyundai Networks
-00093C Jacques Technologies P/L
-00093D Newisys
-00093E C&I Technologies
-00093F Double-Win Enterpirse CO.
-000940 Agfeo Gmbh & Co. KG
-000941 Allied Telesis K.K.
-000942 Cresco
-000943 Cisco Systems
-000944 Cisco Systems
-000945 Palmmicro Communications
-000946 Cluster Labs GmbH
-000947 Aztek
-000948 Vista Control Systems
-000949 Glyph Technologies
-00094A Homenet Communications
-00094B FillFactory NV
-00094C Communication Weaver Co.
-00094D Braintree Communications
-00094E Bartech Systems International
-00094F elmegt GmbH & Co. KG
-000950 Independent Storage
-000951 Apogee Instruments
-000952 Auerswald GmbH & Co. KG
-000953 Linkage System IntegrationLtd.
-000954 AMiT spol. s. r. o.
-000955 Young Generation International
-000956 Network Systems Group, (NSG)
-000957 Supercaller
-000958 Intelnet S.A.
-000959 Sitecsoft
-00095A Racewood Technology
-00095B Netgear
-00095C Philips Medical Systems - Cardiac and Monitoring Systems (CM
-00095D Dialogue Technology
-00095E Masstech Group
-00095F Telebyte
-000960 Yozan
-000961 Switchgear and Instrumentation
-000962 Sonitor Technologies AS
-000963 Dominion Lasercom
-000964 Hi-Techniques
-000965 HyunJu Computer Co.
-000966 Thales Navigation
-000967 Tachyon
-000968 Technoventure
-000969 Meret Optical Communications
-00096A Cloverleaf Communications
-00096B IBM
-00096C Imedia Semiconductor
-00096D Powernet Technologies
-00096E Giant Electronics
-00096F Beijing Zhongqing Elegant Tech.,Limited
-000970 Vibration Research
-000971 Time Management
-000972 Securebase
-000973 Lenten Technology Co.
-000974 Innopia Technologies
-000975 fSONA Communications
-000976 Datasoft Isdn Systems Gmbh
-000977 Brunner Elektronik AG
-000978 Aiji System Co.
-000979 Advanced Television Systems Committee
-00097A Louis Design Labs.
-00097B Cisco Systems
-00097C Cisco Systems
-00097D SecWell Networks Oy
-00097E IMI Technology CO.
-00097F Vsecure 2000
-000980 Power Zenith
-000981 Newport Networks
-000982 Loewe Opta GmbH
-000983 Gvision Incorporated
-000984 MyCasa Network
-000985 Auto Telecom Company
-000986 Metalink
-000987 Nishi Nippon Electric Wire & Cable Co.
-000988 Nudian Electron Co.
-000989 VividLogic
-00098A EqualLogic
-00098B Entropic Communications
-00098C Option Wireless Sweden
-00098D Velocity Semiconductor
-00098E ipcas GmbH
-00098F Cetacean Networks
-000990 Acksys Communications & Systems
-000991 GE Fanuc Automation Manufacturing
-000992 InterEpoch Technology
-000993 Visteon
-000994 Cronyx Engineering
-000995 Castle Technology
-000996 RDI
-000997 Nortel Networks
-000998 Capinfo Company Limited
-000999 CP Georges Renault
-00099A Elmo Company, Limited
-00099B Western Telematic
-00099C Naval Research Laboratory
-00099D Haliplex Communications
-00099E Testech
-00099F Videx
-0009A0 Microtechno
-0009A1 Telewise Communications
-0009A2 Interface Co.
-0009A3 Leadfly Techologies
-0009A4 Hartec
-0009A5 Hansung Eletronic Industries Development CO.
-0009A6 Ignis Optics
-0009A7 Bang & Olufsen A/S
-0009A8 Eastmode Pte
-0009A9 Ikanos Communications
-0009AA Data Comm for Business
-0009AB Netcontrol Oy
-0009AC Lanvoice
-0009AD Hyundai Syscomm
-0009AE Okano Electric Co.
-0009AF e-generis
-0009B0 Onkyo
-0009B1 Kanematsu Electronics
-0009B2 L&F
-0009B3 MCM Systems
-0009B4 Kisan Telecom CO.
-0009B5 3J Tech. Co.
-0009B6 Cisco Systems
-0009B7 Cisco Systems
-0009B8 Entise Systems
-0009B9 Action Imaging Solutions
-0009BA Maku Informationstechik Gmbh
-0009BB MathStar
-0009BC Integrian
-0009BD Epygi Technologies
-0009BE Mamiya-OP Co.
-0009BF Nintendo Co.
-0009C0 6wind
-0009C1 Proces-data A/S
-0009C2 Private
-0009C3 Netas
-0009C4 Medicore Co.
-0009C5 Kingene Technology
-0009C6 Visionics
-0009C7 Movistec
-0009C8 Sinagawa Tsushin Keisou Service
-0009C9 BlueWINC Co.
-0009CA iMaxNetworks(Shenzhen)Limited.
-0009CB HBrain
-0009CC Moog GmbH
-0009CD Hudson Soft Co.
-0009CE SpaceBridge Semiconductor
-0009CF iAd GmbH
-0009D0 Solacom Technologies
-0009D1 Seranoa Networks
-0009D2 Mai Logic
-0009D3 Western DataCom Co.
-0009D4 Transtech Networks
-0009D5 Signal Communication
-0009D6 KNC One GmbH
-0009D7 DC Security Products
-0009D8 Flt Communications AB
-0009D9 Neoscale Systems
-0009DA Control Module
-0009DB eSpace
-0009DC Galaxis Technology AG
-0009DD Mavin Technology
-0009DE Samjin Information & Communications Co.
-0009DF Vestel Komunikasyon Sanayi ve Ticaret A.S.
-0009E0 Xemics S.A.
-0009E1 Gemtek Technology Co.
-0009E2 Sinbon Electronics Co.
-0009E3 Angel Iglesias S.A.
-0009E4 K Tech Infosystem
-0009E5 Hottinger Baldwin Messtechnik GmbH
-0009E6 Cyber Switching
-0009E7 ADC Techonology
-0009E8 Cisco Systems
-0009E9 Cisco Systems
-0009EA YEM
-0009EB HuMANDATA
-0009EC Daktronics
-0009ED CipherOptics
-0009EE Meikyo Electric Co.
-0009EF Vocera Communications
-0009F0 Shimizu Technology
-0009F1 Yamaki Electric
-0009F2 Cohu,, Electronics Division
-0009F3 Well Communication
-0009F4 Alcon Laboratories
-0009F5 Emerson Network Power Co.
-0009F6 Shenzhen Eastern Digital Tech
-0009F7 SED, a division of Calian
-0009F8 Unimo Technology CO.
-0009F9 ART Japan CO.
-0009FB Philips Patient Monitoring
-0009FC Ipflex
-0009FD Ubinetics Limited
-0009FE Daisy Technologies
-0009FF X.net 2000 GmbH
-000A00 Mediatek
-000A01 Sohoware
-000A02 Annso CO.
-000A03 Endesa Servicios
-000A04 3Com
-000A05 Widax
-000A06 Teledex
-000A07 WebWayOne
-000A08 Alpine Electronics
-000A09 TaraCom Integrated Products
-000A0A Sunix Co.
-000A0B Sealevel Systems
-000A0C Scientific Research
-000A0D MergeOptics GmbH
-000A0E Invivo Research
-000A0F Ilryung Telesys
-000A10 Fast Media Integrations AG
-000A11 ExPet Technologies
-000A12 Azylex Technology
-000A13 Honeywell Video Systems
-000A14 Teco a.s.
-000A15 Silicon Data
-000A16 Lassen Research
-000A17 Nestar Communications
-000A18 Vichel
-000A19 Valere Power
-000A1A Imerge
-000A1B Stream Labs
-000A1C Bridge Information Co.
-000A1D Optical Communications Products
-000A1E Red-M Products Limited
-000A1F ART Ware Telecommunication Co.
-000A20 SVA Networks
-000A21 Integra Telecom Co.
-000A22 Amperion
-000A23 Parama Networks
-000A24 Octave Communications
-000A25 Ceragon Networks
-000A26 Ceia S.p.a.
-000A27 Apple Computer
-000A28 Motorola
-000A29 Pan Dacom Networking AG
-000A2A QSI Systems
-000A2B Etherstuff
-000A2C Active Tchnology
-000A2D Cabot Communications Limited
-000A2E Maple Networks CO.
-000A2F Artnix
-000A30 Johnson Controls-ASG
-000A31 HCV Wireless
-000A32 Xsido
-000A33 Emulex
-000A34 Identicard Systems Incorporated
-000A35 Xilinx
-000A36 Synelec Telecom Multimedia
-000A37 Procera Networks
-000A38 Apani Networks
-000A39 LoPA Information Technology
-000A3A J-three International Holding Co.
-000A3B GCT Semiconductor
-000A3C Enerpoint
-000A3D Elo Sistemas Eletronicos S.A.
-000A3E Eads Telecom
-000A3F Data East
-000A40 Crown Audio -- Harmanm International
-000A41 Cisco Systems
-000A42 Cisco Systems
-000A43 Chunghwa Telecom Co.
-000A44 Avery Dennison Deutschland GmbH
-000A45 Audio-Technica
-000A46 ARO Controls SAS
-000A47 Allied Vision Technologies
-000A48 Albatron Technology
-000A49 F5 Networks
-000A4A Targa Systems
-000A4B DataPower Technology
-000A4C Molecular Devices
-000A4D Noritz
-000A4E Unitek Electronics
-000A4F Brain Boxes Limited
-000A50 Remotek
-000A51 GyroSignal Technology Co.
-000A52 AsiaRF
-000A53 Intronics, Incorporated
-000A54 Laguna Hills
-000A55 Markem
-000A56 Hitachi Maxell
-000A57 Hewlett-Packard Company - Standards
-000A58 Ingenieur-Buero Freyer & Siegel
-000A59 HW server
-000A5A GreenNET Technologies Co.
-000A5B Power-One as
-000A5C Carel s.p.a.
-000A5D PUC Founder (MSC) Berhad
-000A5E 3COM
-000A5F almedio
-000A60 Autostar Technology Pte
-000A61 Cellinx Systems
-000A62 Crinis Networks
-000A63 DHD GmbH
-000A64 Eracom Technologies
-000A65 GentechMedia.co.
-000A66 Mitsubishi Electric System & Service Co.
-000A67 OngCorp
-000A68 SolarFlare Communications
-000A69 Sunny Bell Technology Co.
-000A6A SVM Microwaves s.r.o.
-000A6B Tadiran Telecom Business Systems
-000A6C Walchem
-000A6D EKS Elektronikservice GmbH
-000A6E Broadcast Technology Limited
-000A6F ZyFLEX Technologies
-000A70 Mpls Forum
-000A71 Avrio Technologies
-000A72 STEC
-000A73 Scientific Atlanta
-000A74 Manticom Networks
-000A75 Caterpillar
-000A76 Beida Jade Bird Huaguang Technology Co.
-000A77 Bluewire Technologies
-000A78 Olitec
-000A79 corega K.K.
-000A7A Kyoritsu Electric Co.
-000A7B Cornelius Consult
-000A7C Tecton
-000A7D Valo
-000A7E The Advantage Group
-000A7F Teradon Industries
-000A80 Telkonet
-000A81 Teima Audiotex S.L.
-000A82 Tatsuta System Electronics Co.
-000A83 Salto Systems S.L.
-000A84 Rainsun Enterprise Co.
-000A85 Plat'c2
-000A86 Lenze
-000A87 Integrated Micromachines
-000A88 InCypher S.A.
-000A89 Creval Systems
-000A8A Cisco Systems
-000A8B Cisco Systems
-000A8C Guardware Systems
-000A8D Eurotherm Limited
-000A8E Invacom
-000A8F Aska International
-000A90 Bayside Interactive
-000A91 HemoCue AB
-000A92 Presonus
-000A93 W2 Networks
-000A94 ShangHai cellink CO.
-000A95 Apple Computer
-000A96 Mewtel Technology
-000A97 Sonicblue
-000A98 M+F Gwinner GmbH & Co
-000A99 Dataradio
-000A9A Aiptek International
-000A9B Towa Meccs
-000A9C Server Technology
-000A9D King Young Technology Co.
-000A9E BroadWeb Corportation
-000A9F Pannaway Technologies
-000AA0 Cedar Point Communications
-000AA1 V V S Limited
-000AA2 Systek
-000AA3 Shimafuji Electric Co.
-000AA4 Shanghai Surveillance Technology Co
-000AA5 Maxlink Industries Limited
-000AA6 Hochiki
-000AA7 FEI Electron Optics
-000AA8 ePipe
-000AA9 Brooks Automation GmbH
-000AAA AltiGen Communications
-000AAB Toyota Technical Development
-000AAC TerraTec Electronic GmbH
-000AAD Stargames
-000AAE Rosemount Process Analytical
-000AAF Pipal Systems
-000AB0 Loytec Electronics Gmbh
-000AB1 Genetec
-000AB2 Fresnel Wireless Systems
-000AB3 Fa. Gira
-000AB4 Etic Telecommunications
-000AB5 Digital Electronic Network
-000AB6 Compunetix
-000AB7 Cisco Systems
-000AB8 Cisco Systems
-000AB9 Astera Technologies
-000ABA Arcon Technology Limited
-000ABB Taiwan Secom Co
-000ABC Seabridge
-000ABD Rupprecht & Patashnick Co.
-000ABE Opnet Technologies CO.
-000ABF Hirota SS
-000AC0 Fuyoh Video Industry CO.
-000AC1 Futuretel
-000AC2 FiberHome Telecommunication Technologies CO.
-000AC3 eM Technics Co.
-000AC4 Daewoo Teletech Co.
-000AC5 Color Kinetics
-000AC6 Ceterus Networks
-000AC7 Unication Group
-000AC8 Zpsys Co.,ltd. (planning&management)
-000AC9 Zambeel
-000ACA Yokoyama Shokai Co.
-000ACB Xpak MSA Group
-000ACC Winnow Networks
-000ACD Sunrich Technology Limited
-000ACE Radiantech
-000ACF Provideo Multimedia Co.
-000AD0 Niigata Develoment Center, F.I.T. Co.
-000AD1 MWS
-000AD2 Jepico
-000AD3 Initech Co.
-000AD4 CoreBell Systems
-000AD5 Brainchild Electronic Co.
-000AD6 BeamReach Networks
-000AD7 Origin Electric Co.
-000AD8 IPCserv Technology
-000AD9 Sony Ericsson Mobile Communications AB
-000ADA Vindicator Technologies
-000ADB SkyPilot Network
-000ADC RuggedCom
-000ADD Allworx
-000ADE Happy Communication Co.
-000ADF Gennum
-000AE0 Fujitsu Softek
-000AE1 EG Technology
-000AE2 Binatone Electronics International
-000AE3 Yang MEI Technology CO.
-000AE4 Wistron
-000AE5 ScottCare
-000AE6 Elitegroup Computer System Co. (ECS)
-000AE7 Eliop S.A.
-000AE8 Cathay Roxus Information Technology Co.
-000AE9 AirVast Technology
-000AEA Adam Elektroniksti.
-000AEB Shenzhen Tp-Link Technology Co;
-000AEC Koatsu Gas Kogyo Co.
-000AED Harting Systems Gmbh & Co KG
-000AEE GCD Hard- & Software GmbH
-000AEF Otrum ASA
-000AF0 Shin-oh Electronics CO., R&D
-000AF1 Clarity Design
-000AF2 NeoAxiom
-000AF3 Cisco Systems
-000AF4 Cisco Systems
-000AF5 Airgo Networks
-000AF6 Emerson Climate Technologies Retail Solutions
-000AF7 Broadcom
-000AF8 American Telecare
-000AF9 HiConnect
-000AFA Traverse Technologies Australia
-000AFB Ambri Limited
-000AFC Core Tec Communications
-000AFD Viking Electronic Services
-000AFE NovaPal
-000AFF Kilchherr Elektronik AG
-000B00 Fujian Start Computer Equipment Co.
-000B01 Daiichi Electronics CO.
-000B02 Dallmeier electronic
-000B03 Taekwang Industrial Co.
-000B04 Volktek
-000B05 Pacific Broadband Networks
-000B06 Motorola BCS
-000B07 Voxpath Networks
-000B08 Pillar Data Systems
-000B09 Ifoundry Systems Singapore
-000B0A dBm Optics
-000B0B Corrent
-000B0C Agile Systems
-000B0D Air2U
-000B0E Trapeze Networks
-000B0F Nyquist Industrial Control BV
-000B10 11wave Technonlogy Co.
-000B11 Himeji ABC Trading Co.
-000B12 Nuri Telecom Co.
-000B13 Zetron
-000B14 ViewSonic
-000B15 Platypus Technology
-000B16 Communication Machinery
-000B17 MKS Instruments
-000B18 Private
-000B19 Vernier Networks
-000B1A Industrial Defender
-000B1B Systronix
-000B1C Sibco bv
-000B1D LayerZero Power Systems
-000B1E Kappa Opto-electronics Gmbh
-000B1F I CON Computer Co.
-000B20 Hirata
-000B21 G-Star Communications
-000B22 Environmental Systems and Services
-000B23 Siemens Subscriber Networks
-000B24 AirLogic
-000B25 Aeluros
-000B26 Wetek
-000B27 Scion
-000B28 Quatech
-000B29 LS(LG) Industrial Systems co.
-000B2A Howtel Co.
-000B2B Hostnet
-000B2C Eiki Industrial Co.
-000B2D Danfoss
-000B2E Cal-Comp Electronics (Thailand) Public Company Limited Taipe
-000B2F bplan GmbH
-000B30 Beijing Gongye Science & Technology Co.
-000B31 Yantai ZhiYang Scientific and technology industry CO.
-000B32 Vormetric
-000B33 Vivato
-000B34 ShangHai Broadband TechnologiesLTD
-000B35 Quad Bit System co.
-000B36 Productivity Systems
-000B37 Manufacture DES Montres Rolex SA
-000B38 Knuerr AG
-000B39 Keisoku Giken Co.
-000B3A QuStream
-000B3B devolo AG
-000B3C Cygnal Integrated Products
-000B3D Contal OK
-000B3E BittWare
-000B3F Anthology Solutions
-000B40 OpNext
-000B41 Ing. Buero Dr. Beutlhauser
-000B42 commax Co.
-000B43 Microscan Systems
-000B44 Concord IDea
-000B45 Cisco
-000B46 Cisco
-000B47 Advanced Energy
-000B48 sofrel
-000B49 RF-Link System
-000B4A Visimetrics (UK)
-000B4B Visiowave SA
-000B4C Clarion (M) Sdn Bhd
-000B4D Emuzed
-000B4E VertexRSI, General Dynamics SatCOM Technologies
-000B4F Verifone
-000B50 Oxygnet
-000B51 Micetek International
-000B52 Joymax Electronics
-000B53 Initium Co.
-000B54 BiTMICRO Networks
-000B55 ADInstruments
-000B56 Cybernetics
-000B57 Silicon Laboratories
-000B58 Astronautics C.A
-000B59 ScriptPro
-000B5A HyperEdge
-000B5B Rincon Research
-000B5C Newtech Co.
-000B5D Fujitsu Limited
-000B5E Audio Engineering Society
-000B5F Cisco Systems
-000B60 Cisco Systems
-000B61 Friedrich Ltze GmbH &Co.
-000B62 Ingenieurbuero fuer Elektronikdesign Ingo Mohnen
-000B63 Kaleidescape
-000B64 Kieback & Peter GmbH & Co KG
-000B65 Sy.A.C. srl
-000B66 Teralink Communications
-000B67 Topview Technology
-000B68 Addvalue Communications Pte
-000B69 Franke Finland Oy
-000B6A Asiarock Incorporation
-000B6B Wistron Neweb
-000B6C Sychip
-000B6D Solectron Japan Nakaniida
-000B6E Neff Instrument
-000B6F Media Streaming Networks
-000B70 Load Technology
-000B71 Litchfield Communications
-000B72 Lawo AG
-000B73 Kodeos Communications
-000B74 Kingwave Technology Co.
-000B75 Iosoft
-000B76 ET&T Technology Co.
-000B77 Cogent Systems
-000B78 Taifatech
-000B79 X-COM
-000B7A Wave Science
-000B7B Test-Um
-000B7C Telex Communications
-000B7D Solomon Extreme International
-000B7E Saginomiya Seisakusho
-000B7F OmniWerks
-000B80 Lycium Networks
-000B81 Kaparel
-000B82 Grandstream Networks
-000B83 Datawatt B.V.
-000B84 Bodet
-000B85 Cisco Systems
-000B86 Aruba Networks
-000B87 American Reliance
-000B88 Vidisco
-000B89 Top Global Technology
-000B8A Miteq
-000B8B Kerajet
-000B8C Flextronics
-000B8D Avvio Networks
-000B8E Ascent
-000B8F Akita Electronics Systems Co.
-000B90 Adva Optical Networking
-000B91 Aglaia Gesellschaft fr Bildverarbeitung und Kommunikation
-000B92 Ascom Danmark A/S
-000B93 Ritter Elektronik
-000B94 Digital Monitoring Products
-000B95 eBet Gaming Systems
-000B96 Innotrac Diagnostics Oy
-000B97 Matsushita Electric Industrial Co.
-000B98 NiceTechVision
-000B99 SensAble Technologies
-000B9A Shanghai Ulink Telecom Equipment Co.
-000B9B Sirius System Co
-000B9C TriBeam Technologies
-000B9D TwinMOS Technologies
-000B9E Yasing Technology
-000B9F Neue Elsa Gmbh
-000BA0 T&L Information
-000BA1 Syscom
-000BA2 Sumitomo Electric Networks
-000BA3 Siemens AG
-000BA4 Shiron Satellite Communications (1996)
-000BA5 Quasar Cipta Mandiri
-000BA6 Miyakawa Electric Works
-000BA7 Maranti Networks
-000BA8 Hanback Electronics CO.
-000BA9 CloudShield Technologies
-000BAA Aiphone co.
-000BAB Advantech Technology (china) Co.
-000BAC 3Com
-000BAD PC-PoS
-000BAE Vitals System
-000BAF Wooju Communications Co
-000BB0 Sysnet Telematica srl
-000BB1 Super Star Technology Co.
-000BB2 Smallbig Technology
-000BB3 RiT technologies
-000BB4 RDC Semiconductor,
-000BB5 nStor Technologies
-000BB6 Mototech
-000BB7 Micro Systems Co.
-000BB8 Kihoku Electronic Co.
-000BB9 Imsys AB
-000BBA Harmonic Broadband Access Networks
-000BBB Etin Systems Co.
-000BBC En Garde Systems
-000BBD Connexionz Limited
-000BBE Cisco Systems
-000BBF Cisco Systems
-000BC0 China Iwncomm Co.
-000BC1 Bay Microsystems
-000BC2 Corinex Communication
-000BC3 Multiplex
-000BC4 Biotronik Gmbh & Co
-000BC5 SMC Networks
-000BC6 ISAC
-000BC7 Icet S.p.a.
-000BC8 AirFlow Networks
-000BC9 Electroline Equipment
-000BCA Datavan International
-000BCB Fagor Automation , S. Coop
-000BCC Jusan
-000BCD Hewlett Packard
-000BCE Free2move AB
-000BCF Agfa NDT
-000BD0 XiMeta Technology Americas
-000BD1 Aeronix
-000BD2 Remopro Technology
-000BD3 cd3o
-000BD4 Beijing Wise Technology & Science DevelopmentLtd
-000BD5 Nvergence
-000BD6 Paxton Access
-000BD7 MBB Gelma GmbH
-000BD8 Industrial Scientific
-000BD9 General Hydrogen
-000BDA EyeCross Co.
-000BDB Dell ESG Pcba Test
-000BDC Akcp
-000BDD Tohoku Ricoh Co.
-000BDE Teldix Gmbh
-000BDF Shenzhen RouterD Networks Limited
-000BE0 SercoNet
-000BE1 Nokia NET Product Operations
-000BE2 Lumenera
-000BE3 Key Stream Co.
-000BE4 Hosiden
-000BE5 Hims Korea Co.
-000BE6 Datel Electronics
-000BE7 Comflux Technology
-000BE8 Aoip
-000BE9 Actel
-000BEA Zultys Technologies
-000BEB Systegra AG
-000BEC Nippon Electric Instrument
-000BED ELM
-000BEE inc.jet, Incorporated
-000BEF Code
-000BF0 MoTEX Products Co.
-000BF1 LAP Laser Applikations
-000BF2 Chih-Kan Technology Co.
-000BF3 BAE Systems
-000BF4 Private
-000BF5 Shanghai Sibo Telecom Technology Co.
-000BF6 Nitgen Co.
-000BF7 Nidek Co.
-000BF8 Infinera
-000BF9 Gemstone communications
-000BFA Exemys SRL
-000BFB D-NET International
-000BFC Cisco Systems
-000BFD Cisco Systems
-000BFE Castel Broadband Limited
-000BFF Berkeley Camera Engineering
-000C00 BEB Industrie-Elektronik AG
-000C01 Abatron AG
-000C02 ABB Oy
-000C03 Hdmi Licensing
-000C04 Tecnova
-000C05 RPA Reserch Co.
-000C06 Nixvue Systems Pte
-000C07 Iftest AG
-000C08 Humex Technologies
-000C09 Hitachi IE Systems Co.
-000C0A Guangdong Province Electronic Technology Research Institute
-000C0B Broadbus Technologies
-000C0C Appro Technology
-000C0D Communications & Power Industries / Satcom Division
-000C0E XtremeSpectrum
-000C0F Techno-One Co.
-000C10 PNI
-000C11 Nippon Dempa Co.
-000C12 Micro-Optronic-Messtechnik GmbH
-000C13 MediaQ
-000C14 Diagnostic Instruments
-000C15 CyberPower Systems
-000C16 Concorde Microsystems
-000C17 AJA Video Systems
-000C18 Zenisu Keisoku
-000C19 Telio Communications GmbH
-000C1A Quest Technical Solutions
-000C1B Oracom Co
-000C1C MicroWeb Co.
-000C1D Mettler & Fuchs AG
-000C1E Global Cache
-000C1F Glimmerglass Networks
-000C20 Fi WIn
-000C21 Faculty of Science and Technology, Keio University
-000C22 Double D Electronics
-000C23 Beijing Lanchuan Tech. Co.
-000C24 Anator
-000C25 Allied Telesyn Networks
-000C26 Weintek Labs.
-000C27 Sammy
-000C28 Rifatron
-000C29 VMware
-000C2A Octtel Communication Co.
-000C2B Elias Technology
-000C2C Enwiser
-000C2D FullWave Technology Co.
-000C2E Openet information technology(shenzhen) Co.
-000C2F SeorimTechnology Co.
-000C30 Cisco
-000C31 Cisco
-000C32 Avionic Design Development GmbH
-000C33 Compucase Enterprise Co.
-000C34 Vixen Co.
-000C35 KaVo Dental GmbH & Co. KG
-000C36 Sharp Takaya Electronics Industry Co.
-000C37 Geomation
-000C38 TelcoBridges
-000C39 Sentinel Wireless
-000C3A Oxance
-000C3B Orion Electric Co.
-000C3C MediaChorus
-000C3D Glsystech Co.
-000C3E Crest Audio
-000C3F Cogent Defence & Security Networks,
-000C40 Altech Controls
-000C41 Cisco-Linksys
-000C42 Routerboard.com
-000C43 Ralink Technology
-000C44 Automated Interfaces
-000C45 Animation Technologies
-000C46 Allied Telesyn
-000C47 SK Teletech(R&D Planning Team)
-000C48 QoStek
-000C49 Dangaard Telecom RTC Division A/S
-000C4A Cygnus Microsystems (P) Limited
-000C4B Cheops Elektronik
-000C4C Arcor AG&Co.
-000C4D Acra Control
-000C4E Winbest Technology CO
-000C4F UDTech Japan
-000C50 Seagate Technology
-000C51 Scientific Technologies
-000C52 Roll Systems
-000C53 Private
-000C54 Pedestal Networks
-000C55 Microlink Communications
-000C56 Megatel Computer (1986)
-000C57 Mackie Engineering Services Belgium Bvba
-000C58 M&S Systems
-000C59 Indyme Electronics
-000C5A IBSmm Industrieelektronik Multimedia
-000C5B Hanwang Technology Co.
-000C5C GTN Systems B.V.
-000C5D Chic Technology (china)
-000C5E Calypso Medical
-000C5F Avtec
-000C60 ACM Systems
-000C61 AC Tech DBA Advanced Digital
-000C62 ABB Automation Technology Products AB, Control
-000C63 Zenith Electronics
-000C64 X2 MSA Group
-000C65 Sunin Telecom
-000C66 Pronto Networks
-000C67 OYO Electric Co.
-000C68 SigmaTel
-000C69 National Radio Astronomy Observatory
-000C6A Mbari
-000C6B Kurz Industrie-Elektronik GmbH
-000C6C Elgato Systems
-000C6D Edwards
-000C6E Asustek Computer
-000C6F Amtek system co.
-000C70 ACC GmbH
-000C71 Wybron
-000C72 Tempearl Industrial Co.
-000C73 Telson Electronics CO.
-000C74 Rivertec
-000C75 Oriental integrated electronics.
-000C76 Micro-star International CO.
-000C77 Life Racing
-000C78 In-Tech Electronics Limited
-000C79 Extel Communications P/L
-000C7A DaTARIUS Technologies GmbH
-000C7B Alpha Project Co.
-000C7C Internet Information Image
-000C7D Teikoku Electric MFG. CO.
-000C7E Tellium Incorporated
-000C7F synertronixx GmbH
-000C80 Opelcomm
-000C81 Nulec Industries
-000C82 Network Technologies
-000C83 Logical Solutions
-000C84 Eazix
-000C85 Cisco Systems
-000C86 Cisco Systems
-000C87 AMD
-000C88 Apache Micro Peripherals
-000C89 AC Electric Vehicles
-000C8A Bose
-000C8B Connect Tech
-000C8C Kodicom Co.
-000C8D Matrix Vision Gmbh
-000C8E Mentor Engineering
-000C8F Nergal s.r.l.
-000C90 Octasic
-000C91 Riverhead Networks
-000C92 WolfVision Gmbh
-000C93 Xeline Co.
-000C94 United Electronic Industries, (EUI)
-000C95 PrimeNet
-000C96 OQO
-000C97 NV ADB TTV Technologies SA
-000C98 Letek Communications
-000C99 Hitel Link Co.
-000C9A Hitech Electronics
-000C9B EE Solutions
-000C9C Chongho information & communications
-000C9D AirWalk Communications
-000C9E MemoryLink
-000C9F NKE
-000CA0 StorCase Technology
-000CA1 Sigmacom Co.
-000CA2 Scopus Network Technologies
-000CA3 Rancho Technology
-000CA4 Prompttec Product Management GmbH
-000CA5 Naman NZ
-000CA6 Mintera
-000CA7 Metro (Suzhou) Technologies Co.
-000CA8 Garuda Networks
-000CA9 Ebtron
-000CAA Cubic Transportation Systems
-000CAB Commend International
-000CAC Citizen Watch Co.
-000CAD BTU International
-000CAE Ailocom Oy
-000CAF TRI Term Co.
-000CB0 Star Semiconductor
-000CB1 Salland Engineering (Europe) BV
-000CB2 Comstar Co.
-000CB3 Round Co.
-000CB4 AutoCell Laboratories
-000CB5 Premier Technolgies
-000CB6 Nanjing SEU Mobile & Internet Technology Co.
-000CB7 Nanjing Huazhuo Electronics Co.
-000CB8 Medion AG
-000CB9 LEA
-000CBA Jamex
-000CBB Iskraemeco
-000CBC Iscutum
-000CBD Interface Masters
-000CBE Innominate Security Technologies AG
-000CBF Holy Stone Ent. Co.
-000CC0 Genera Oy
-000CC1 Cooper Industries
-000CC2 ControlNet (India) Private Limited
-000CC3 BeWAN systems
-000CC4 Tiptel AG
-000CC5 Nextlink Co.
-000CC6 Ka-Ro electronics GmbH
-000CC7 Intelligent Computer Solutions
-000CC8 Xytronix Research & Design
-000CC9 Ilwoo Data & Technology Co.
-000CCA Hitachi Global Storage Technologies
-000CCB Design Combus
-000CCC Aeroscout
-000CCD IEC - Tc57
-000CCE Cisco Systems
-000CCF Cisco Systems
-000CD0 Symetrix
-000CD1 Sfom Technology
-000CD2 Schaffner EMV AG
-000CD3 Prettl Elektronik Radeberg GmbH
-000CD4 Positron Public Safety Systems
-000CD5 Passave
-000CD6 Partner Tech
-000CD7 Nallatech
-000CD8 M. K. Juchheim GmbH & Co
-000CD9 Itcare Co.
-000CDA FreeHand Systems
-000CDB Foundry Networks
-000CDC Becs Technology
-000CDD AOS Technologies AG
-000CDE ABB Stotz-kontakt Gmbh
-000CDF Pulnix America
-000CE0 Trek Diagnostics
-000CE1 The Open Group
-000CE2 Rolls-Royce
-000CE3 Option International N.V.
-000CE4 NeuroCom International
-000CE5 Motorola BCS
-000CE6 Meru Networks
-000CE7 MediaTek
-000CE8 GuangZhou AnJuBao Co.
-000CE9 Bloomberg L.P.
-000CEA aphona Kommunikationssysteme
-000CEB Cnmp Networks
-000CEC Spectracom
-000CED Real Digital Media
-000CEE jp-embedded
-000CEF Open Networks Engineering
-000CF0 M & N GmbH
-000CF1 Intel
-000CF2 Gamesa Elica
-000CF3 Call Image SA
-000CF4 Akatsuki Electric Mfg.co.
-000CF5 InfoExpress
-000CF6 Sitecom Europe BV
-000CF7 Nortel Networks
-000CF8 Nortel Networks
-000CF9 ITT Flygt AB
-000CFA Digital Systems
-000CFB Korea Network Systems
-000CFC S2io Technologies
-000CFD Hyundai ImageQuest Co.
-000CFE Grand Electronic Co.
-000CFF Mro-tek Limited
-000D00 Seaway Networks
-000D01 P&E Microcomputer Systems
-000D02 NEC AccessTechnica
-000D03 Matrics
-000D04 Foxboro Eckardt Development GmbH
-000D05 cybernet manufacturing
-000D06 Compulogic Limited
-000D07 Calrec Audio
-000D08 AboveCable
-000D09 Yuehua(Zhuhai) Electronic CO.
-000D0A Projectiondesign as
-000D0B Buffalo
-000D0C MDI Security Systems
-000D0D ITSupported
-000D0E Inqnet Systems
-000D0F Finlux
-000D10 Embedtronics Oy
-000D11 Dentsply - Gendex
-000D12 Axell
-000D13 Wilhelm Rutenbeck GmbH&Co.
-000D14 Vtech Innovation LP dba Advanced American Telephones
-000D15 Voipac s.r.o.
-000D16 UHS Systems
-000D17 Turbo NetworksLtd
-000D18 Mega-Trend Electronics CO.
-000D19 Robe Show Lighting
-000D1A Mustek System
-000D1B Kyoto Electronics Manufacturing Co.
-000D1C Amesys Defense
-000D1D High-tek Harness ENT. CO.
-000D1E Control Techniques
-000D1F AV Digital
-000D20 Asahikasei Technosystem Co.
-000D21 Wiscore
-000D22 Unitronics
-000D23 Smart Solution
-000D24 Sentec E&E CO.
-000D25 Sanden
-000D26 Primagraphics Limited
-000D27 Microplex Printware AG
-000D28 Cisco
-000D29 Cisco
-000D2A Scanmatic AS
-000D2B Racal Instruments
-000D2C Patapsco Designs
-000D2D NCT Deutschland GmbH
-000D2E Matsushita Avionics Systems
-000D2F AIN Comm.Tech.Co.
-000D30 IceFyre Semiconductor
-000D31 Compellent Technologies
-000D32 DispenseSource
-000D33 Prediwave
-000D34 Shell International Exploration and Production
-000D35 PAC International
-000D36 Wu Han Routon Electronic Co.
-000D37 Wiplug
-000D38 Nissin
-000D39 Network Electronics
-000D3A Microsoft
-000D3B Microelectronics Technology
-000D3C i.Tech Dynamic
-000D3D Hammerhead Systems
-000D3E Aplux Communications
-000D3F VTI Instruments
-000D40 Verint Loronix Video Solutions
-000D41 Siemens AG ICM MP UC RD IT KLF1
-000D42 Newbest Development Limited
-000D43 DRS Tactical Systems
-000D44 Audio BU - Logitech
-000D45 Tottori Sanyo Electric Co.
-000D46 Parker SSD Drives
-000D47 Collex
-000D48 Aewin Technologies Co.
-000D49 Triton Systems of Delaware
-000D4A Steag ETA-Optik
-000D4B Roku
-000D4C Outline Electronics
-000D4D Ninelanes
-000D4E NDR Co.
-000D4F Kenwood
-000D50 Galazar Networks
-000D51 Divr Systems
-000D52 Comart system
-000D53 Beijing 5w Communication
-000D54 3Com
-000D55 Sanycom Technology Co.
-000D56 Dell Pcba Test
-000D57 Fujitsu I-Network Systems Limited.
-000D58 Private
-000D59 Amity Systems
-000D5A Tiesse SpA
-000D5B Smart Empire Investments Limited
-000D5C Robert Bosch GmbH, Vt-atmo
-000D5D Raritan Computer
-000D5E NEC CustomTechnica
-000D5F Minds
-000D60 IBM
-000D61 Giga-Byte Technology Co.
-000D62 Funkwerk Dabendorf GmbH
-000D63 Dent Instruments
-000D64 Comag Handels AG
-000D65 Cisco Systems
-000D66 Cisco Systems
-000D67 BelAir Networks
-000D68 Vinci Systems
-000D69 TMT&D
-000D6A Redwood Technologies
-000D6B Mita-Teknik A/S
-000D6C M-Audio
-000D6D K-Tech Devices
-000D6E K-Patents Oy
-000D6F Ember
-000D70 Datamax
-000D71 boca systems
-000D72 2Wire
-000D73 Technical Support
-000D74 Sand Network Systems
-000D75 Kobian Pte - Taiwan Branch
-000D76 Hokuto Denshi Co
-000D77 FalconStor Software
-000D78 Engineering & Security
-000D79 Dynamic Solutions Co
-000D7A DiGATTO Asia Pacific Pte
-000D7B Consensys Computers
-000D7C Codian
-000D7D Afco Systems
-000D7E Axiowave Networks
-000D7F Midas Communication Technologies PTE ( Foreign Branch)
-000D80 Online Development
-000D81 Pepperl+Fuchs GmbH
-000D82 PHS srl
-000D83 Sanmina-SCI Hungary
-000D84 Makus
-000D85 Tapwave
-000D86 Huber + Suhner AG
-000D87 Elitegroup Computer System Co. (ECS)
-000D88 D-Link
-000D89 Bils Technology
-000D8A Winners Electronics Co.
-000D8B T&D
-000D8C Shanghai Wedone Digital CO.
-000D8D ProLinx Communication Gateways
-000D8E Koden Electronics Co.
-000D8F King Tsushin Kogyo Co.
-000D90 Factum Electronics AB
-000D91 Eclipse (HQ Espana) S.L.
-000D92 Arima Communication
-000D93 Apple Computer
-000D94 Afar Communications
-000D95 Opti-cell
-000D96 Vtera Technology
-000D97 Tropos Networks
-000D98 S.W.A.C. Schmitt-Walter Automation Consult GmbH
-000D99 Orbital Sciences; Launch Systems Group
-000D9A Infotec
-000D9B Heraeus Electro-Nite International N.V.
-000D9C Elan GmbH & Co KG
-000D9D Hewlett Packard
-000D9E Tokuden Ohizumi Seisakusyo Co.
-000D9F RF Micro Devices
-000DA0 Nedap N.V.
-000DA1 Mirae ITS Co.
-000DA2 Infrant Technologies
-000DA3 Emerging Technologies Limited
-000DA4 Dosch & Amand Systems AG
-000DA5 Fabric7 Systems
-000DA6 Universal Switching
-000DA7 Private
-000DA8 Teletronics Technology
-000DA9 T.e.a.m. S.L.
-000DAA S.A.Tehnology co.
-000DAB Parker Hannifin GmbH Electromechanical Division Europe
-000DAC Japan CBM
-000DAD Dataprobe
-000DAE Samsung Heavy Industries CO.
-000DAF Plexus (UK)
-000DB0 Olym-tech Co.
-000DB1 Japan Network Service Co.
-000DB2 Ammasso
-000DB3 SDO Communication Corperation
-000DB4 Netasq
-000DB5 Globalsat Technology
-000DB6 Teknovus
-000DB7 Sanko Electric Co
-000DB8 Schiller AG
-000DB9 PC Engines GmbH
-000DBA Oc Document Technologies GmbH
-000DBB Nippon Dentsu Co.
-000DBC Cisco Systems
-000DBD Cisco Systems
-000DBE Bel Fuse Europe
-000DBF TekTone Sound & Signal Mfg.
-000DC0 Spagat AS
-000DC1 SafeWeb
-000DC2 Private
-000DC3 First Communication
-000DC4 Emcore
-000DC5 EchoStar International
-000DC6 DigiRose Technology Co.
-000DC7 Cosmic Engineering
-000DC8 AirMagnet
-000DC9 Thales Elektronik Systeme Gmbh
-000DCA Tait Electronics
-000DCB Petcomkorea Co.
-000DCC Neosmart
-000DCD Groupe Txcom
-000DCE Dynavac Technology Pte
-000DCF Cidra
-000DD0 TetraTec Instruments GmbH
-000DD1 Stryker
-000DD2 Simrad Optronics ASA
-000DD3 Samwoo Telecommunication Co.
-000DD4 Symantec
-000DD5 O'rite Technology Co.
-000DD6 ITI
-000DD7 Bright
-000DD8 BBN
-000DD9 Anton Paar GmbH
-000DDA Allied Telesis K.K.
-000DDB Airwave Technologies
-000DDC VAC
-000DDD Proflo Telra Elektronk Sanay VE Tcaret A..
-000DDE Joyteck Co.
-000DDF Japan Image & Network
-000DE0 Icpdas Co.
-000DE1 Control Products
-000DE2 CMZ Sistemi Elettronici
-000DE3 AT Sweden AB
-000DE4 Diginics
-000DE5 Samsung Thales
-000DE6 Youngbo Engineering Co.
-000DE7 Snap-on OEM Group
-000DE8 Nasaco Electronics Pte.
-000DE9 Napatech Aps
-000DEA Kingtel Telecommunication
-000DEB CompXs Limited
-000DEC Cisco Systems
-000DED Cisco Systems
-000DEE Andrew RF Power Amplifier Group
-000DEF Soc. Coop. Bilanciai
-000DF0 Qcom Technology
-000DF1 Ionix
-000DF2 Private
-000DF3 Asmax Solutions
-000DF4 Watertek Co.
-000DF5 Teletronics International
-000DF6 Technology Thesaurus
-000DF7 Space Dynamics Lab
-000DF8 Orga Kartensysteme Gmbh
-000DF9 NDS Limited
-000DFA Micro Control Systems
-000DFB Komax AG
-000DFC Itfor
-000DFD Huges Hi-Tech,
-000DFE Hauppauge Computer Works
-000DFF Chenming Mold Industry
-000E00 Atrie
-000E01 Asip Technologies
-000E02 Advantech AMT
-000E03 Emulex
-000E04 CMA/Microdialysis AB
-000E05 Wireless Matrix
-000E06 Team Simoco
-000E07 Sony Ericsson Mobile Communications AB
-000E08 Cisco Linksys
-000E09 Shenzhen Coship Software Co.
-000E0A Sakuma Design Office
-000E0B Netac Technology Co.
-000E0C Intel
-000E0D Hesch Schrder Gmbh
-000E0E ESA elettronica S.P.A.
-000E0F Ermme
-000E10 C-guys
-000E11 BDT Bro- und Datentechnik GmbH & Co. KG
-000E12 Adaptive Micro Systems
-000E13 Accu-Sort Systems
-000E14 Visionary Solutions
-000E15 Tadlys
-000E16 SouthWing S.L.
-000E17 Private
-000E18 MyA Technology
-000E19 LogicaCMG
-000E1A JPS Communications
-000E1B IAV GmbH
-000E1C Hach Company
-000E1D Arion Technology
-000E1E NetXen
-000E1F TCL Networks Equipment Co.
-000E20 Access Systems Americas
-000E21 MTU Friedrichshafen GmbH
-000E22 Private
-000E23 Incipient
-000E24 Huwell Technology
-000E25 Hannae Technology Co.
-000E26 Gincom Technology
-000E27 Crere Networks
-000E28 Dynamic Ratings P/L
-000E29 Shester Communications
-000E2A Private
-000E2B Safari Technologies
-000E2C Netcodec co.
-000E2D Hyundai Digital Technology Co.
-000E2E Edimax Technology Co.
-000E2F Disetronic Medical Systems AG
-000E30 Aeras Networks
-000E31 Olympus Soft Imaging Solutions GmbH
-000E32 Kontron Medical
-000E33 Shuko Electronics Co.
-000E34 NexGen City
-000E35 Intel
-000E36 Heinesys
-000E37 Harms & Wende GmbH &KG
-000E38 Cisco Systems
-000E39 Cisco Systems
-000E3A Cirrus Logic
-000E3B Hawking Technologies
-000E3C Transact Technologies
-000E3D Televic N.V.
-000E3E Sun Optronics
-000E3F Soronti
-000E40 Nortel Networks
-000E41 Nihon Mechatronics Co.
-000E42 Motic Incoporation
-000E43 G-Tek Electronics Sdn. Bhd.
-000E44 Digital
-000E45 Beijing Newtry Electronic Technology
-000E46 Niigata Seimitsu Co.
-000E47 NCI System Co.
-000E48 Lipman TransAction Solutions
-000E49 Forsway Scandinavia AB
-000E4A Changchun Huayu Webpad Co.
-000E4B atrium c and
-000E4C Bermai
-000E4D Numesa
-000E4E Waveplus Technology Co.
-000E4F Trajet GmbH
-000E50 Thomson Telecom Belgium
-000E51 tecna elettronica srl
-000E52 Optium
-000E53 AV Tech
-000E54 AlphaCell Wireless
-000E55 Auvitran
-000E56 4G Systems GmbH & Co. KG
-000E57 Iworld Networking
-000E58 Sonos
-000E59 Sagem SA
-000E5A Telefield
-000E5B ParkerVision - Direct2Data
-000E5C Motorola BCS
-000E5D Triple Play Technologies A/S
-000E5E Raisecom Technology
-000E5F activ-net GmbH & Co. KG
-000E60 360SUN Digital Broadband
-000E61 Microtrol Limited
-000E62 Nortel Networks
-000E63 Lemke Diagnostics GmbH
-000E64 Elphel
-000E65 TransCore
-000E66 Hitachi Advanced Digital
-000E67 Eltis Microelectronics
-000E68 E-TOP Network Technology
-000E69 China Electric Power Research Institute
-000E6A 3Com
-000E6B Janitza electronics GmbH
-000E6C Device Drivers Limited
-000E6D Murata Manufacturing Co.
-000E6E Micrelec Electronics S.A
-000E6F Iris Berhad
-000E70 in2 Networks
-000E71 Gemstar Technology Development
-000E72 CTS electronics
-000E73 Tpack A/S
-000E74 Solar Telecom. Tech
-000E75 New York Air Brake
-000E76 Gemsoc Innovision
-000E77 Decru
-000E78 Amtelco
-000E79 Ample Communications
-000E7A GemWon Communications Co.
-000E7B Toshiba
-000E7C Televes S.A.
-000E7D Electronics Line 3000
-000E7E ionSign Oy
-000E7F Hewlett Packard
-000E80 Thomson Technology
-000E81 Devicescape Software
-000E82 Commtech Wireless
-000E83 Cisco Systems
-000E84 Cisco Systems
-000E85 Catalyst Enterprises
-000E86 Alcatel North America
-000E87 adp Gauselmann GmbH
-000E88 Videotron
-000E89 Clematic
-000E8A Avara Technologies
-000E8B Astarte Technology Co
-000E8C Siemens AG A&D ET
-000E8D Systems in Progress Holding GmbH
-000E8E SparkLAN Communications
-000E8F Sercomm
-000E90 Ponico
-000E91 Navico Auckland
-000E92 Millinet Co.
-000E93 Milnio 3 Sistemas Electrnicos
-000E94 Maas International BV
-000E95 Fujiya Denki Seisakusho Co.
-000E96 Cubic Defense Applications
-000E97 Ultracker Technology CO.
-000E98 Vitec CC
-000E99 Spectrum Digital
-000E9A BOE Technology Group Co.
-000E9B Ambit Microsystems
-000E9C Pemstar
-000E9D Tiscali UK
-000E9E Topfield Co.
-000E9F Temic SDS Gmbh
-000EA0 NetKlass Technology
-000EA1 Formosa Teletek
-000EA2 Secure Computing
-000EA3 Cncr-it Co.,ltd,hangzhou P.r.china
-000EA4 Certance
-000EA5 Blip Systems
-000EA6 Asustek Computer
-000EA7 Endace Technology
-000EA8 United Technologists Europe Limited
-000EA9 Shanghai Xun Shi Communications Equipment Co.
-000EAA Scalent Systems
-000EAB Cray
-000EAC Mintron Enterprise CO.
-000EAD Metanoia Technologies
-000EAE Gawell Technologies
-000EAF Castel
-000EB0 Solutions Radio BV
-000EB1 Newcotech
-000EB2 Micro-Research Finland Oy
-000EB3 Hewlett-Packard
-000EB4 Guangzhou Gaoke Communications Technologyltd.
-000EB5 Ecastle Electronics Co.
-000EB6 Riverbed Technology
-000EB7 Knovative
-000EB8 Iiga co.
-000EB9 Hashimoto Electronics Industry Co.
-000EBA Hanmi Semiconductor CO.
-000EBB Everbee Networks
-000EBC Paragon Fidelity GmbH
-000EBD Burdick, a Quinton Compny
-000EBE B&B Electronics Manufacturing Co.
-000EBF Remsdaq Limited
-000EC0 Nortel Networks
-000EC1 Mynah Technologies
-000EC2 Lowrance Electronics
-000EC3 Logic Controls
-000EC4 Iskra Transmission d.d.
-000EC5 Digital Multitools
-000EC6 Asix Electronics
-000EC7 Motorola Korea
-000EC8 Zoran
-000EC9 Yoko Technology
-000ECA Wtss
-000ECB VineSys Technology
-000ECC Tableau
-000ECD Skov A/S
-000ECE S.I.T.T.I. S.p.A.
-000ECF Profibus Nutzerorganisation e.V.
-000ED0 Privaris
-000ED1 Osaka Micro Computer.
-000ED2 Filtronic plc
-000ED3 Epicenter
-000ED4 Cresitt Industrie
-000ED5 Copan Systems
-000ED6 Cisco Systems
-000ED7 Cisco Systems
-000ED8 Aktino
-000ED9 Aksys
-000EDA C-tech United
-000EDB XiNCOM
-000EDC Tellion
-000EDD Shure Incorporated
-000EDE Remec
-000EDF PLX Technology
-000EE0 Mcharge
-000EE1 ExtremeSpeed
-000EE2 Custom Engineering S.p.A.
-000EE3 Chiyu Technology Co.
-000EE4 BOE Technology Group Co.
-000EE5 bitWallet
-000EE6 Adimos Systems
-000EE7 AAC Electronics
-000EE8 zioncom
-000EE9 WayTech Development
-000EEA Shadong Luneng Jicheng Electronics,Co.
-000EEB Sandmartin(zhong shan)Electronics Co.
-000EEC Orban
-000EED Nokia Danmark A/S
-000EEE Muco Industrie BV
-000EEF Private
-000EF0 Festo AG & Co. KG
-000EF1 Ezquest
-000EF2 Infinico
-000EF3 Smarthome
-000EF4 Kasda Digital Technology Co.
-000EF5 iPAC Technology Co.
-000EF6 E-TEN Information Systems Co.
-000EF7 Vulcan Portals
-000EF8 SBC ASI
-000EF9 REA Elektronik GmbH
-000EFA Optoway Technology Incorporation
-000EFB Macey Enterprises
-000EFC Jtag Technologies B.V.
-000EFD Fujinon
-000EFE EndRun Technologies
-000EFF Megasolution
-000F00 Legra Systems
-000F01 Digitalks
-000F02 Digicube Technology Co.
-000F03 Com&c CO.
-000F04 cim-usa
-000F05 3B System
-000F06 Nortel Networks
-000F07 Mangrove Systems
-000F08 Indagon Oy
-000F09 Private
-000F0A Clear Edge Networks
-000F0B Kentima Technologies AB
-000F0C Synchronic Engineering
-000F0D Hunt Electronic Co.
-000F0E WaveSplitter Technologies
-000F0F Real ID Technology Co.
-000F10 RDM
-000F11 Prodrive B.V.
-000F12 Panasonic Europe
-000F13 Nisca
-000F14 Mindray Co.
-000F15 Kjaerulff1 A/S
-000F16 JAY HOW Technology CO.,
-000F17 Insta Elektro GmbH
-000F18 Industrial Control Systems
-000F19 Boston Scientific
-000F1A Gaming Support B.V.
-000F1B Ego Systems
-000F1C DigitAll World Co.
-000F1D Cosmo Techs Co.
-000F1E Chengdu KT Electricof High & New Technology
-000F1F WW Pcba Test
-000F20 Hewlett Packard
-000F21 Scientific Atlanta
-000F22 Helius
-000F23 Cisco Systems
-000F24 Cisco Systems
-000F25 AimValley B.V.
-000F26 WorldAccxx
-000F27 Teal Electronics
-000F28 Itronix
-000F29 Augmentix
-000F2A Cableware Electronics
-000F2B Greenbell Systems
-000F2C Uplogix
-000F2D Chung-hsin Electric & Machinery Mfg.corp.
-000F2E Megapower International
-000F2F W-linx Technology CO.
-000F30 Raza Microelectronics
-000F31 Prosilica
-000F32 LuTong Electronic Technology Co.
-000F33 Duali
-000F34 Cisco Systems
-000F35 Cisco Systems
-000F36 Accurate Techhnologies
-000F37 Xambala Incorporated
-000F38 Netstar
-000F39 Iris Sensors
-000F3A Hisharp
-000F3B Fuji System Machines Co.
-000F3C Endeleo Limited
-000F3D D-Link
-000F3E CardioNet
-000F3F Big Bear Networks
-000F40 Optical Internetworking Forum
-000F41 Zipher
-000F42 Xalyo Systems
-000F43 Wasabi Systems
-000F44 Tivella
-000F45 Stretch
-000F46 Sinar AG
-000F47 Robox SPA
-000F48 Polypix
-000F49 Northover Solutions Limited
-000F4A Kyushu-kyohan co.
-000F4B Virtual Iron Software
-000F4C Elextech
-000F4D TalkSwitch
-000F4E Cellink
-000F4F Cadmus Technology
-000F50 StreamScale Limited
-000F51 Azul Systems
-000F52 York Refrigeration, Marine & Controls
-000F53 Solarflare Communications
-000F54 Entrelogic
-000F55 Datawire Communication Networks
-000F56 Continuum Photonics
-000F57 Cablelogic Co.
-000F58 Adder Technology Limited
-000F59 Phonak Communications AG
-000F5A Peribit Networks
-000F5B Delta Information Systems
-000F5C Day One Digital Media Limited
-000F5D 42Networks AB
-000F5E Veo
-000F5F Nicety Technologies (NTS)
-000F60 Lifetron Co.
-000F61 Hewlett Packard
-000F62 Alcatel Bell Space N.V.
-000F63 Obzerv Technologies
-000F64 D&R Electronica Weesp BV
-000F65 icube
-000F66 Cisco-Linksys
-000F67 West Instruments
-000F68 Vavic Network Technology
-000F69 SEW Eurodrive GmbH & Co. KG
-000F6A Nortel Networks
-000F6B GateWare Communications GmbH
-000F6C Addi-data Gmbh
-000F6D Midas Engineering
-000F6E BBox
-000F6F FTA Communication Technologies
-000F70 Wintec Industries
-000F71 Sanmei Electronics Co.
-000F72 Sandburst
-000F73 Rockwell Automation Korea
-000F74 Qamcom Technology AB
-000F75 First Silicon Solutions
-000F76 Digital Keystone
-000F77 Dentum Co.
-000F78 Datacap Systems
-000F79 Bluetooth Interest Group
-000F7A BeiJing NuQX Technology CO.
-000F7B Arce Sistemas
-000F7C ACTi
-000F7D Xirrus
-000F7E Ablerex Electronics Co.
-000F7F Ubstorage Co.
-000F80 Trinity Security Systems
-000F81 Secure Info Imaging
-000F82 Mortara Instrument
-000F83 Brainium Technologies
-000F84 Astute Networks
-000F85 Addo-japan
-000F86 Research In Motion Limited
-000F87 Maxcess International
-000F88 Ametek
-000F89 Winnertec System Co.
-000F8A WideView
-000F8B Orion MultiSystems
-000F8C Gigawavetech Pte
-000F8D Fast Tv-server AG
-000F8E Dongyang Telecom Co.
-000F8F Cisco Systems
-000F90 Cisco Systems
-000F91 Aerotelecom Co.
-000F92 Microhard Systems
-000F93 Landis+Gyr
-000F94 Genexis
-000F95 Elecom Co.,ltd Laneed Division
-000F96 Critical Telecom
-000F97 Avanex
-000F98 Avamax Co.
-000F99 Apac Opto Electronics
-000F9A Synchrony
-000F9B Ross Video Limited
-000F9C Panduit
-000F9D DisplayLink (UK)
-000F9E Murrelektronik GmbH
-000F9F Motorola BCS
-000FA0 Canon Korea Business Solutions
-000FA1 Gigabit Systems
-000FA2 Digital Path Networks
-000FA3 Alpha Networks
-000FA4 Sprecher Automation GmbH
-000FA5 SMP / BWA Technology GmbH
-000FA6 S2 Security
-000FA7 Raptor Networks Technology
-000FA8 Photometrics
-000FA9 PC Fabrik
-000FAA Nexus Technologies
-000FAB Kyushu Electronics Systems
-000FAC Ieee 802.11
-000FAD FMN communications GmbH
-000FAE E2O Communications
-000FAF Dialog
-000FB0 Compal Electronics
-000FB1 Cognio
-000FB2 Broadband Pacenet (India) Pvt.
-000FB3 Actiontec Electronics
-000FB4 Timespace Technology
-000FB5 Netgear
-000FB6 Europlex Technologies
-000FB7 Cavium Networks
-000FB8 CallURL
-000FB9 Adaptive Instruments
-000FBA Tevebox AB
-000FBB Nokia Siemens Networks GmbH & Co. KG
-000FBC Onkey Technologies
-000FBD MRV Communications (Networks)
-000FBE e-w/you
-000FBF DGT Sp. z o.o.
-000FC0 Delcomp
-000FC1 Wave
-000FC2 Uniwell
-000FC3 PalmPalm Technology
-000FC4 NST co.
-000FC5 KeyMed
-000FC6 Eurocom Industries A/S
-000FC7 Dionica R&D
-000FC8 Chantry Networks
-000FC9 Allnet GmbH
-000FCA A-jin Techline CO
-000FCB 3Com
-000FCC Netopia
-000FCD Nortel Networks
-000FCE Kikusui Electronics
-000FCF Datawind Research
-000FD0 Astri
-000FD1 Applied Wireless Identifications Group
-000FD2 EWA Technologies
-000FD3 Digium
-000FD4 Soundcraft
-000FD5 Schwechat - Rise
-000FD6 Sarotech Co.
-000FD7 Harman Music Group
-000FD8 Force
-000FD9 FlexDSL Telecommunications AG
-000FDA Yazaki
-000FDB Westell Technologies
-000FDC Ueda Japan Radio Co.
-000FDD Sordin AB
-000FDE Sony Ericsson Mobile Communications AB
-000FDF Solomon Technology
-000FE0 NComputing Co.
-000FE1 ID Digital
-000FE2 Hangzhou H3C Technologies Co.
-000FE3 Damm Cellular Systems A/S
-000FE4 Pantech Co.
-000FE5 Mercury Security
-000FE6 MBTech Systems
-000FE7 Lutron Electronics Co.
-000FE8 Lobos
-000FE9 GW Technologies Co.
-000FEA Giga-Byte Technology Co.
-000FEB Cylon Controls
-000FEC Arkus
-000FED Anam Electronics Co.
-000FEE XTec, Incorporated
-000FEF Thales e-Transactions GmbH
-000FF0 Sunray Co.
-000FF1 nex-G Systems Pte.Ltd
-000FF2 Loud Technologies
-000FF3 Jung Myoung Communications&Technology
-000FF4 Guntermann & Drunck GmbH
-000FF5 GN&S company
-000FF6 Darfon Electronics
-000FF7 Cisco Systems
-000FF8 Cisco Systems
-000FF9 Valcretec
-000FFA Optinel Systems
-000FFB Nippon Denso Industry Co.
-000FFC Merit Li-Lin Ent.
-000FFD Glorytek Network
-000FFE G-pro Computer
-000FFF Control4
-001000 Cable Television Laboratories
-001001 Citel
-001002 Actia
-001003 Imatron
-001004 THE Brantley Coile Company
-001005 UEC Commercial
-001006 Thales Contact Solutions
-001007 Cisco Systems
-001008 Vienna Systems
-001009 Horo Quartz
-00100A Williams Communications Group
-00100B Cisco Systems
-00100C ITO CO.
-00100D Cisco Systems
-00100E Micro Linear Coporation
-00100F Industrial CPU Systems
-001010 Initio
-001011 Cisco Systems
-001012 Processor Systems (I) PVT
-001013 Kontron America
-001014 Cisco Systems
-001015 OOmon
-001016 T.sqware
-001017 Micos Gmbh
-001018 Broadcom
-001019 Sirona Dental Systems Gmbh & Co. KG
-00101A PictureTel
-00101B Cornet Technology
-00101C OHM Technologies INTL
-00101D Winbond Electronics
-00101E Matsushita Electronic Instruments
-00101F Cisco Systems
-001020 Hand Held Products
-001021 Encanto Networks
-001022 SatCom Media
-001023 Network Equipment Technologies
-001024 Nagoya Electric Works CO.
-001025 Grayhill
-001026 Accelerated Networks
-001027 L-3 Communications East
-001028 Computer Technica
-001029 Cisco Systems
-00102A ZF Microsystems
-00102B Umax Data Systems
-00102C Lasat Networks A/S
-00102D Hitachi Software Engineering
-00102E Network Systems & Technologies PVT.
-00102F Cisco Systems
-001030 Eion
-001031 Objective Communications
-001032 Alta Technology
-001033 Accesslan Communications
-001034 GNP Computers
-001035 Elitegroup Computer Systems CO.
-001036 Inter-tel Integrated Systems
-001037 CYQ've Technology Co.
-001038 Micro Research Institute
-001039 Vectron Systems AG
-00103A Diamond Network Tech
-00103B Hippi Networking Forum
-00103C IC Ensemble
-00103D Phasecom
-00103E Netschools
-00103F Tollgrade Communications
-001040 Intermec
-001041 Bristol Babcock
-001042 Alacritech
-001043 A2
-001044 InnoLabs
-001045 Nortel Networks
-001046 Alcorn Mcbride
-001047 Echo Eletric CO.
-001048 Htrc Automation
-001049 ShoreTel
-00104A The Parvus
-00104B 3com
-00104C LeCroy
-00104D Surtec Industries
-00104E Ceologic
-00104F Sun Microsystems
-001050 Rion CO.
-001051 Cmicro
-001052 Mettler-toledo (albstadt) Gmbh
-001053 Computer Technology
-001054 Cisco Systems
-001055 Fujitsu Microelectronics
-001056 Sodick CO.
-001057 Rebel.com
-001058 ArrowPoint Communications
-001059 Diablo Research CO.
-00105A 3com
-00105B NET Insight AB
-00105C Quantum Designs (h.k.)
-00105D Draeger Medical
-00105E Hekimian Laboratories
-00105F In-snec
-001060 Billionton Systems
-001061 Hostlink
-001062 NX Server
-001063 Starguide Digital Networks
-001064 DNPG
-001065 Radyne
-001066 Advanced Control Systems
-001067 Redback Networks
-001068 Comos Telecom
-001069 Helioss Communications
-00106A Digital Microwave
-00106B Sonus Networks
-00106C Infratec AG
-00106D Axxcelera Broadband Wireless
-00106E Tadiran COM.
-00106F Trenton Technology
-001070 Caradon Trend
-001071 Advanet
-001072 GVN Technologies
-001073 Technobox
-001074 Aten International CO.
-001075 Maxtor
-001076 Eurem Gmbh
-001077 SAF Drive Systems
-001078 Nuera Communications
-001079 Cisco Systems
-00107A AmbiCom
-00107B Cisco Systems
-00107C P-com
-00107D Aurora Communications
-00107E Bachmann Electronic Gmbh
-00107F Crestron Electronics
-001080 Metawave Communications
-001081 DPS
-001082 JNA Telecommunications Limited
-001083 Hewlett-packard Company
-001084 K-bot Communications
-001085 Polaris Communications
-001086 Atto Technology
-001087 Xstreamis PLC
-001088 American Networks
-001089 WebSonic
-00108A TeraLogic
-00108B Laseranimation Sollinger Gmbh
-00108C Fujitsu Telecommunications Europe
-00108D Johnson Controls
-00108E Hugh Symons Concept Technologies
-00108F Raptor Systems
-001090 Cimetrics
-001091 NO Wires Needed BV
-001092 Netcore
-001093 CMS Computers
-001094 Performance Analysis Broadband, Spirent plc
-001095 Thomson
-001096 Tracewell Systems
-001097 WinNet Metropolitan Communications Systems
-001098 Starnet Technologies
-001099 InnoMedia
-00109A Netline
-00109B Emulex
-00109C M-system CO.
-00109D Clarinet Systems
-00109E Aware
-00109F PAVO
-0010A0 Innovex Technologies
-0010A1 Kendin Semiconductor
-0010A2 TNS
-0010A3 Omnitronix
-0010A4 Xircom
-0010A5 Oxford Instruments
-0010A6 Cisco Systems
-0010A7 Unex Technology
-0010A8 Reliance Computer
-0010A9 Adhoc Technologies
-0010AA Media4
-0010AB Koito Industries
-0010AC Imci Technologies
-0010AD Softronics USB
-0010AE Shinko Electric Industries CO.
-0010AF TAC Systems
-0010B0 Meridian Technology
-0010B1 For-a CO.
-0010B2 Coactive Aesthetics
-0010B3 Nokia Multimedia Terminals
-0010B4 Atmosphere Networks
-0010B5 Accton Technology
-0010B6 Entrata Communications
-0010B7 Coyote Technologies
-0010B8 Ishigaki Computer System CO.
-0010B9 Maxtor
-0010BA Martinho-davis Systems
-0010BB Data & Information Technology
-0010BC Aastra Telecom
-0010BD THE Telecommunication Technology Committee
-0010BE Telexis
-0010BF InterAir Wireless
-0010C0 ARMA
-0010C1 OI Electric CO.
-0010C2 Willnet
-0010C3 Csi-control Systems
-0010C4 Media Links CO.
-0010C5 Protocol Technologies
-0010C6 USI
-0010C7 Data Transmission Network
-0010C8 Communications Electronics Security Group
-0010C9 Mitsubishi Electronics Logistic Support CO.
-0010CA Integral Access
-0010CB Facit K.K.
-0010CC CLP Computer Logistik Planung Gmbh
-0010CD Interface Concept
-0010CE Volamp
-0010CF Fiberlane Communications
-0010D0 Witcom
-0010D1 Top Layer Networks
-0010D2 Nitto Tsushinki CO.
-0010D3 Grips Electronic Gmbh
-0010D4 Storage Computer
-0010D5 Imasde Canarias
-0010D6 ITT - A/cd
-0010D7 Argosy Research
-0010D8 Calista
-0010D9 IBM Japan, Fujisawa Mt+d
-0010DA Motion Engineering
-0010DB Juniper Networks
-0010DC Micro-star International CO.
-0010DD Enable Semiconductor
-0010DE International Datacasting
-0010DF Rise Computer
-0010E0 Sun Microsystems
-0010E1 S.I. TECH
-0010E2 ArrayComm
-0010E3 Hewlett Packard
-0010E4 NSI
-0010E5 Solectron Texas
-0010E6 Applied Intelligent Systems
-0010E7 BreezeCom
-0010E8 Telocity, Incorporated
-0010E9 Raidtec
-0010EA Adept Technology
-0010EB Selsius Systems
-0010EC RPCG
-0010ED Sundance Technology
-0010EE CTI Products
-0010EF Dbtel Incorporated
-0010F1 I-O
-0010F2 Antec
-0010F3 Nexcom International Co.
-0010F4 Vertical Communications
-0010F5 Amherst Systems
-0010F6 Cisco Systems
-0010F7 Iriichi Technologies
-0010F8 Texio
-0010F9 Unique Systems
-0010FA Apple
-0010FB Zida Technologies Limited
-0010FC Broadband Networks
-0010FD Cocom A/S
-0010FE Digital Equipment
-0010FF Cisco Systems
-001100 Schneider Electric
-001101 CET Technologies Pte
-001102 Aurora Multimedia
-001103 kawamura electric
-001104 Telexy
-001105 Sunplus Technology Co.
-001106 Siemens NV (Belgium)
-001107 RGB Networks
-001108 Orbital Data
-001109 Micro-Star International
-00110A Hewlett Packard
-00110B Franklin Technology Systems
-00110C Atmark Techno
-00110D Sanblaze Technology
-00110E Tsurusaki Sealand Transportation Co.
-00110F netplat
-001110 Maxanna Technology Co.
-001111 Intel
-001112 Honeywell Cmss
-001113 Fraunhofer Fokus
-001114 EverFocus Electronics
-001115 Epin Technologies
-001116 Coteau Vert CO.
-001117 Cesnet
-001118 BLX IC Design
-001119 Solteras
-00111A Motorola BCS
-00111B Targa Systems Div L-3 Communications Canada
-00111C Pleora Technologies
-00111D Hectrix Limited
-00111E Epsg (ethernet Powerlink Standardization Group)
-00111F Doremi Labs
-001120 Cisco Systems
-001121 Cisco Systems
-001122 Cimsys
-001123 Appointech
-001124 Apple Computer
-001125 IBM
-001126 Venstar
-001127 TASI
-001128 Streamit
-001129 Paradise Datacom
-00112A Niko NV
-00112B NetModule
-00112C IZT GmbH
-00112D iPulse Systems
-00112E Ceicom
-00112F Asustek Computer
-001130 Allied Telesis (Hong Kong)
-001131 Unatech. Co.
-001132 Synology Incorporated
-001133 Siemens Austria Simea
-001134 MediaCell
-001135 Grandeye
-001136 Goodrich Sensor Systems
-001137 Aichi Electric CO.
-001138 Taishin CO.
-001139 Stoeber Antriebstechnik Gmbh + Co. KG.
-00113A Shinboram
-00113B Micronet Communications
-00113C Micronas GmbH
-00113D KN Soltec Co.
-00113E JL
-00113F Alcatel DI
-001140 Nanometrics
-001141 GoodMan
-001142 E-smartcom
-001143 Dell
-001144 Assurance Technology
-001145 ValuePoint Networks
-001146 Telecard-Pribor
-001147 Secom-IndustryLTD.
-001148 Prolon Control Systems
-001149 Proliphix
-00114A Kayaba Industry Co
-00114B Francotyp-Postalia AG & Co. KG
-00114C caffeina applied research
-00114D Atsumi Electric Co.
-00114E 690885 Ontario
-00114F US Digital Television
-001150 Belkin
-001151 Mykotronx
-001152 Eidsvoll Electronics AS
-001153 Trident Tek
-001154 Webpro Technologies
-001155 Sevis Systems
-001156 Pharos Systems NZ
-001157 OF Networks Co.
-001158 Nortel Networks
-001159 Matisse Networks
-00115A Ivoclar Vivadent AG
-00115B Elitegroup Computer System Co. (ECS)
-00115C Cisco
-00115D Cisco
-00115E ProMinent Dosiertechnik GmbH
-00115F ITX Security Co.
-001160 Artdio Company Co.
-001161 NetStreams
-001162 Star Micronics Co.
-001163 System SPA DEPT. Electronics
-001164 Acard Technology
-001165 Znyx Networks
-001166 Taelim Electronics Co.
-001167 Integrated System Solution
-001168 HomeLogic
-001169 EMS Satcom
-00116A Domo
-00116B Digital Data Communications Asia Co.
-00116C Nanwang Multimedia
-00116D American Time and Signal
-00116E PePLink
-00116F Netforyou Co.
-001170 GSC SRL
-001171 Dexter Communications
-001172 Cotron
-001173 Adtron
-001174 Wibhu Technologies
-001175 PathScale
-001176 Intellambda Systems
-001177 Coaxial Networks
-001178 Chiron Technology
-001179 Singular Technology Co.
-00117A Singim International
-00117B Bchi Labortechnik AG
-00117C e-zy.net
-00117D ZMD America
-00117E Progeny
-00117F Neotune Information Technology
-001180 Motorola BCS
-001181 InterEnergyLtd,
-001182 IMI Norgren
-001183 Datalogic Mobile
-001184 Humo Laboratory
-001185 Hewlett Packard
-001186 Prime Systems
-001187 Category Solutions
-001188 Enterasys
-001189 Aerotech
-00118A Viewtran Technology Limited
-00118B Alcatel-Lucent, Enterprise Business Group
-00118C Missouri Department of Transportation
-00118D Hanchang System
-00118E Halytech Mace
-00118F Eutech Instruments PTE.
-001190 Digital Design
-001191 CTS-Clima Temperatur Systeme GmbH
-001192 Cisco Systems
-001193 Cisco Systems
-001194 Chi Mei Communication Systems
-001195 D-Link
-001196 Actuality Systems
-001197 Monitoring Technologies Limited
-001198 Prism Media Products Limited
-001199 2wcom GmbH
-00119A Alkeria srl
-00119B Telesynergy Research
-00119C EP&T Energy
-00119D Diginfo Technology
-00119E Solectron Brazil
-00119F Nokia Danmark A/S
-0011A0 Vtech Engineering Canada
-0011A1 Vision Netware Co.
-0011A2 Manufacturing Technology
-0011A3 LanReady Technologies
-0011A4 JStream Technologies
-0011A5 Fortuna Electronic
-0011A6 Sypixx Networks
-0011A7 Infilco Degremont
-0011A8 Quest Technologies
-0011A9 Moimstone Co.
-0011AA Uniclass Technology, Co.
-0011AB Trustable Technology Co.
-0011AC Simtec Electronics
-0011AD Shanghai Ruijie Technology
-0011AE Motorola BCS
-0011AF Medialink-i
-0011B0 Fortelink
-0011B1 BlueExpert Technology
-0011B2 2001 Technology
-0011B3 Yoshimiya Co.
-0011B4 Westermo Teleindustri AB
-0011B5 Shenzhen Powercom Co.
-0011B6 Open Systems International
-0011B7 Onroerend Groen B.V.
-0011B8 Liebherr - Elektronik GmbH
-0011B9 Inner Range
-0011BA Elexol
-0011BB Cisco Systems
-0011BC Cisco Systems
-0011BD Bombardier Transportation
-0011BE AGP Telecom Co.
-0011BF Aesys S.p.a.
-0011C0 Aday Technology
-0011C1 4P Mobile Data Processing
-0011C2 United Fiber Optic Communication
-0011C3 Transceiving System Technology
-0011C4 Terminales de Telecomunicacion Terrestre
-0011C5 TEN Technology
-0011C6 Seagate Technology
-0011C7 Raymarine UK
-0011C8 Powercom Co.
-0011C9 MTT
-0011CA Long Range Systems
-0011CB Jacobsons AB
-0011CC Guangzhou Jinpeng Group Co.
-0011CD Axsun Technologies
-0011CE Ubisense Limited
-0011CF Thrane & Thrane A/S
-0011D0 Tandberg Data ASA
-0011D1 Soft Imaging System GmbH
-0011D2 Perception Digital
-0011D3 NextGenTel Holding ASA
-0011D4 NetEnrich
-0011D5 Hangzhou Sunyard System Engineering Co.
-0011D6 HandEra
-0011D7 eWerks
-0011D8 Asustek Computer
-0011D9 TiVo
-0011DA Vivaas Technology
-0011DB Land-Cellular
-0011DC Glunz & Jensen
-0011DD Fromus TEC. Co.
-0011DE Eurilogic
-0011DF Arecont Systems
-0011E0 U-media Communications
-0011E1 Beko Electronics Co.
-0011E2 Hua Jung Components Co.
-0011E3 Thomson
-0011E4 Danelec Electronics A/S
-0011E5 KCodes
-0011E6 Scientific Atlanta
-0011E7 Worldsat - Texas de France
-0011E8 Tixi.Com
-0011E9 Starnex CO.
-0011EA Iwics
-0011EB Innovative Integration
-0011EC Avix
-0011ED 802 Global
-0011EE Estari
-0011EF Conitec Datensysteme GmbH
-0011F0 Wideful Limited
-0011F1 QinetiQ
-0011F2 Institute of Network Technologies
-0011F3 Gavitec AG- mobile digit
-0011F4 woori-net
-0011F5 Askey Computer
-0011F6 Asia Pacific Microsystems
-0011F7 Shenzhen Forward Industry Co.
-0011F8 Airaya
-0011F9 Nortel Networks
-0011FA Rane
-0011FB Heidelberg Engineering GmbH
-0011FC Harting Electric Gmbh &KG
-0011FD Korg
-0011FE Keiyo System Research
-0011FF Digitro Tecnologia Ltda
-001200 Cisco
-001201 Cisco
-001202 Decrane Aerospace - Audio International
-001203 Activ Networks
-001204 u10 Networks
-001205 Terrasat Communications
-001206 iQuest (NZ)
-001207 Head Strong International Limited
-001208 Gantner Electronic GmbH
-001209 Fastrax
-00120A Emerson Electric GmbH & Co. OHG
-00120B Chinasys Technologies Limited
-00120C CE-Infosys Pte
-00120D Advanced Telecommunication Technologies
-00120E AboCom
-00120F Ieee 802.3
-001210 WideRay
-001211 Protechna Herbst GmbH & Co. KG
-001212 Plus Vision
-001213 Metrohm AG
-001214 Koenig & Bauer AG
-001215 iStor Networks
-001216 ICP Internet Communication Payment AG
-001217 Cisco-Linksys
-001218 Aruze
-001219 Ahead Communication Systems
-00121A Techno Soft Systemnics
-00121B Sound Devices
-00121C Parrot S.A.
-00121D Netfabric
-00121E Juniper Networks
-00121F Harding Intruments
-001220 Cadco Systems
-001221 B.Braun Melsungen AG
-001222 Skardin (UK)
-001223 Pixim
-001224 NexQL
-001225 Motorola BCS
-001226 Japan Direx
-001227 Franklin Electric Co.
-001228 Data
-001229 BroadEasy Technologies Co.
-00122A VTech Telecommunications
-00122B Virbiage
-00122C Soenen Controls N.V.
-00122D SiNett
-00122E Signal Technology - Aisd
-00122F Sanei Electric
-001230 Picaso Infocommunication CO.
-001231 Motion Control Systems
-001232 LeWiz Communications
-001233 JRC Tokki Co.
-001234 Camille Bauer
-001235 Andrew
-001236 ConSentry Networks
-001237 Texas Instruments
-001238 SetaBox Technology Co.
-001239 S Net Systems
-00123A Posystech
-00123B KeRo Systems ApS
-00123C Second Rule
-00123D GES
-00123E Erune Technology Co.
-00123F Dell
-001240 Amoi Electronics Co.
-001241 a2i marketing center
-001242 Millennial Net
-001243 Cisco
-001244 Cisco
-001245 Zellweger Analytics
-001246 T.O.M Technology.
-001247 Samsung Electronics Co.
-001248 EMC (Kashya)
-001249 Delta Elettronica S.p.A.
-00124A Dedicated Devices
-00124B Texas Instruments
-00124C Bbwm
-00124D Inducon BV
-00124E XAC Automation
-00124F Tyco Thermal Controls
-001250 Tokyo Aircaft Instrument Co.
-001251 Silink
-001252 Citronix
-001253 AudioDev AB
-001254 Spectra Technologies Holdings Company
-001255 NetEffect Incorporated
-001256 LG Information & COMM.
-001257 LeapComm Communication Technologies
-001258 Activis Polska
-001259 Thermo Electron Karlsruhe
-00125A Microsoft
-00125B Kaimei Electroni
-00125C Green Hills Software
-00125D CyberNet
-00125E Caen
-00125F Awind
-001260 Stanton Magnetics
-001261 Adaptix
-001262 Nokia Danmark A/S
-001263 Data Voice Technologies GmbH
-001264 daum electronic gmbh
-001265 Enerdyne Technologies
-001266 Swisscom Hospitality Services SA
-001267 Matsushita Electronic Components Co.
-001268 IPS d.o.o.
-001269 Value Electronics
-00126A Optoelectronics Co.
-00126B Ascalade Communications Limited
-00126C Visonic
-00126D University of California, Berkeley
-00126E Seidel Elektronik GmbH Nfg.KG
-00126F Rayson Technology Co.
-001270 Nges Denro Systems
-001271 Measurement Computing
-001272 Redux Communications
-001273 Stoke
-001274 NIT lab
-001275 Sentilla
-001276 Microsol Holdings
-001277 Korenix Technologies Co.
-001278 International Bar Code
-001279 Hewlett Packard
-00127A Sanyu Industry Co.
-00127B VIA Networking Technologies
-00127C Swegon AB
-00127D MobileAria
-00127E Digital Lifestyles Group
-00127F Cisco
-001280 Cisco
-001281 Cieffe srl
-001282 Qovia
-001283 Nortel Networks
-001284 Lab33 Srl
-001285 Gizmondo Europe
-001286 Endevco
-001287 Digital Everywhere Unterhaltungselektronik GmbH
-001288 2Wire
-001289 Advance Sterilization Products
-00128A Motorola PCS
-00128B Sensory Networks
-00128C Woodward Governor
-00128D STB Datenservice GmbH
-00128E Q-Free ASA
-00128F Montilio
-001290 Kyowa Electric & Machinery
-001291 KWS Computersysteme GmbH
-001292 Griffin Technology
-001293 GE Energy
-001294 Eudyna Devices
-001295 Aiware
-001296 Addlogix
-001297 O2Micro
-001298 Mico Electric(shenzhen) Limited
-001299 Ktech Telecommunications
-00129A IRT Electronics
-00129B E2S Electronic Engineering Solutions
-00129C Yulinet
-00129D First International Computer do Brasil
-00129E Surf Communications
-00129F RAE Systems
-0012A0 NeoMeridian Sdn Bhd
-0012A1 BluePacket Communications Co.
-0012A2 Vita
-0012A3 Trust International B.V.
-0012A4 ThingMagic
-0012A5 Stargen
-0012A6 Dolby Australia
-0012A7 ISR Technologies
-0012A8 intec GmbH
-0012A9 3Com
-0012AA IEE
-0012AB WiLife
-0012AC Ontimetek
-0012AD IDS GmbH
-0012AE HLS Hard-line Solutions
-0012AF Elpro Technologies
-0012B0 Efore Oyj (Plc)
-0012B1 Dai Nippon Printing Co.
-0012B2 Avolites
-0012B3 Advance Wireless Technology
-0012B4 Work Microwave GmbH
-0012B5 Vialta
-0012B6 Santa Barbara Infrared
-0012B7 PTW Freiburg
-0012B8 G2 Microsystems
-0012B9 Fusion Digital Technology
-0012BA FSI Systems
-0012BB Telecommunications Industry Association TR-41 Committee
-0012BC Echolab
-0012BD Avantec Manufacturing Limited
-0012BE Astek
-0012BF Arcadyan Technology
-0012C0 HotLava Systems
-0012C1 Check Point Software Technologies
-0012C2 Apex Electronics Factory
-0012C3 WIT S.A.
-0012C4 Viseon
-0012C5 V-Show Technology (China) Co.
-0012C6 TGC America
-0012C7 Securay Technologiesco.
-0012C8 Perfect tech
-0012C9 Motorola BCS
-0012CA Mechatronic Brick Aps
-0012CB CSS
-0012CC Bitatek CO.
-0012CD Asem SpA
-0012CE Advanced Cybernetics Group
-0012CF Accton Technology
-0012D0 Gossen-Metrawatt-GmbH
-0012D1 Texas Instruments
-0012D2 Texas Instruments
-0012D3 Zetta Systems
-0012D4 Princeton Technology
-0012D5 Motion Reality
-0012D6 Jiangsu Yitong High-Tech Co.
-0012D7 Invento Networks
-0012D8 International Games System Co.
-0012D9 Cisco Systems
-0012DA Cisco Systems
-0012DB Ziehl Industrie-elektronik Gmbh + Co KG
-0012DC SunCorp Industrial Limited
-0012DD Shengqu Information Technology (Shanghai) Co.
-0012DE Radio Components Sweden AB
-0012DF Novomatic AG
-0012E0 Codan Limited
-0012E1 Alliant Networks
-0012E2 Alaxala Networks
-0012E3 Agat-RT
-0012E4 Ziehl Industrie-electronik Gmbh + Co KG
-0012E5 Time America
-0012E6 Spectec Computer CO.
-0012E7 Projectek Networking Electronics
-0012E8 Fraunhofer IMS
-0012E9 Abbey Systems
-0012EA Trane
-0012EB R2DI
-0012EC Movacolor b.v.
-0012ED AVG Advanced Technologies
-0012EE Sony Ericsson Mobile Communications AB
-0012EF OneAccess SA
-0012F0 Intel Corporate
-0012F1 Ifotec
-0012F2 Foundry Networks
-0012F3 connectBlue AB
-0012F4 Belco International Co.
-0012F5 Prolificx
-0012F6 MDK Co.
-0012F7 Xiamen Xinglian Electronics Co.
-0012F8 WNI Resources
-0012F9 Uryu Seisaku
-0012FA THX
-0012FB Samsung Electronics
-0012FC Planet System Co.
-0012FD Optimus IC S.A.
-0012FE Lenovo Mobile Communication Technology
-0012FF Lely Industries N.V.
-001300 It-factory
-001301 IronGate S.L.
-001302 Intel Corporate
-001303 GateConnect Technologies GmbH
-001304 Flaircomm Technologies Co.
-001305 Epicom
-001306 Always On Wireless
-001307 Paravirtual
-001308 Nuvera Fuel Cells
-001309 Ocean Broadband Networks
-00130A Nortel
-00130B Mextal B.V.
-00130C HF System
-00130D Galileo Avionica
-00130E Focusrite Audio Engineering Limited
-00130F Egemen Bilgisayar Muh San ve Tic STI
-001310 Cisco-Linksys
-001311 Arris International
-001312 Amedia Networks
-001313 GuangZhou Post & Telecom Equipment
-001314 Asiamajor
-001315 Sony Computer Entertainment,
-001316 L-S-B GmbH
-001317 GN Netcom as
-001318 Dgstation Co.
-001319 Cisco Systems
-00131A Cisco Systems
-00131B BeCell Innovations
-00131C LiteTouch
-00131D Scanvaegt International A/S
-00131E Peiker acustic GmbH & Co. KG
-00131F NxtPhase T&D
-001320 Intel Corporate
-001321 Hewlett Packard
-001322 DAQ Electronics
-001323 Cap Co.
-001324 Schneider Electric Ultra Terminal
-001325 Cortina Systems
-001326 ECM Systems
-001327 Data Acquisitions limited
-001328 Westech Korea,
-001329 Vsst Co.
-00132A Sitronics Telecom Solutions
-00132B Phoenix Digital
-00132C MAZ Brandenburg GmbH
-00132D iWise Communications
-00132E ITian Coporation
-00132F Interactek
-001330 Euro Protection Surveillance
-001331 CellPoint Connect
-001332 Beijing Topsec Network Security Technology Co.
-001333 Baud Technology
-001334 Arkados
-001335 VS Industry Berhad
-001336 Tianjin 712 Communication Broadcasting co.
-001337 Orient Power Home Network
-001338 Fresenius-vial
-001339 El-me AG
-00133A VadaTech
-00133B Speed Dragon Multimedia Limited
-00133C Quintron Systems
-00133D Micro Memory
-00133E MetaSwitch
-00133F Eppendorf Instrumente GmbH
-001340 AD.EL s.r.l.
-001341 Shandong New Beiyang Information Technology Co.
-001342 Vision Research
-001343 Matsushita Electronic Components (Europe) GmbH
-001344 Fargo Electronics
-001345 Eaton
-001346 D-Link
-001347 BlueTree Wireless Data
-001348 Artila Electronics Co.
-001349 ZyXEL Communications
-00134A Engim
-00134B ToGoldenNet Technology
-00134C YDT Technology International
-00134D IPC systems
-00134E Valox Systems
-00134F Tranzeo Wireless Technologies
-001350 Silver Spring Networks
-001351 Niles Audio
-001352 Naztec
-001353 Hydac Filtertechnik Gmbh
-001354 Zcomax Technologies
-001355 Tomen Cyber-business Solutions
-001356 target systemelectronic gmbh
-001357 Soyal Technology Co.
-001358 Realm Systems
-001359 ProTelevision Technologies A/S
-00135A Project T&E Limited
-00135B PanelLink Cinema
-00135C OnSite Systems
-00135D Nttpc Communications
-00135E Eab/rwi/k
-00135F Cisco Systems
-001360 Cisco Systems
-001361 Biospace Co.
-001362 ShinHeung Precision Co.
-001363 Verascape
-001364 Paradigm Technology.
-001365 Nortel
-001366 Neturity Technologies
-001367 Narayon. Co.
-001368 Maersk Data Defence
-001369 Honda Electron Co.
-00136A Hach Ultra Analytics
-00136B E-tec
-00136C TomTom
-00136D Tentaculus AB
-00136E Techmetro
-00136F PacketMotion
-001370 Nokia Danmark A/S
-001371 Motorola CHS
-001372 Dell
-001373 BLwave Electronics Co.
-001374 Atheros Communications
-001375 American Security Products Co.
-001376 Tabor Electronics
-001377 Samsung Electronics CO.
-001378 Qsan Technology
-001379 Ponder Information Industries
-00137A Netvox Technology Co.
-00137B Movon
-00137C Kaicom co.
-00137D Dynalab
-00137E CorEdge Networks
-00137F Cisco Systems
-001380 Cisco Systems
-001381 Chips & Systems
-001382 Cetacea Networks
-001383 Application Technologies and Engineering Research Laboratory
-001384 Advanced Motion Controls
-001385 Add-On Technology Co.
-001386 ABB/Totalflow
-001387 27M Technologies AB
-001388 WiMedia Alliance
-001389 Redes de Telefona Mvil S.A.
-00138A Qingdao Goertek Electronics Co.
-00138B Phantom Technologies
-00138C Kumyoung.Co.Ltd
-00138D Kinghold
-00138E Foab Elektronik AB
-00138F Asiarock Incorporation
-001390 Termtek Computer Co.
-001391 Ouen Co.
-001392 Ruckus Wireless
-001393 Panta Systems
-001394 Infohand Co.
-001395 congatec AG
-001396 Acbel Polytech
-001397 Xsigo Systems
-001398 TrafficSim Co.
-001399 Stac
-00139A K-ubique ID
-00139B ioIMAGE
-00139C Exavera Technologies
-00139D Design of Systems on Silicon S.A.
-00139E Ciara Technologies
-00139F Electronics Design Services, Co.
-0013A0 Algosystem Co.
-0013A1 Crow Electronic Engeneering
-0013A2 MaxStream
-0013A3 Siemens Com CPE Devices
-0013A4 KeyEye Communications
-0013A5 General Solutions
-0013A6 Extricom
-0013A7 Battelle Memorial Institute
-0013A8 Tanisys Technology
-0013A9 Sony
-0013AA ALS & TEC
-0013AB Telemotive AG
-0013AC Sunmyung Electronics Co.
-0013AD Sendo
-0013AE Radiance Technologies
-0013AF Numa Technology
-0013B0 Jablotron
-0013B1 Intelligent Control Systems (Asia) Pte
-0013B2 Carallon Limited
-0013B3 Ecom Communications Technology Co.
-0013B4 Appear TV
-0013B5 Wavesat
-0013B6 Sling Media
-0013B7 Scantech ID
-0013B8 RyCo Electronic Systems Limited
-0013B9 BM SPA
-0013BA ReadyLinks
-0013BB Smartvue
-0013BC Artimi
-0013BD Hymatom SA
-0013BE Virtual Conexions
-0013BF Media System Planning
-0013C0 Trix Tecnologia Ltda.
-0013C1 Asoka USA
-0013C2 Wacom Co.
-0013C3 Cisco Systems
-0013C4 Cisco Systems
-0013C5 Lightron Fiber-optic Devices
-0013C6 OpenGear
-0013C7 Ionos Co.
-0013C8 Pirelli Broadband Solutions S.p.a.
-0013C9 Beyond Achieve Enterprises
-0013CA X-Digital Systems
-0013CB Zenitel Norway AS
-0013CC Tall Maple Systems
-0013CD MTI co.
-0013CE Intel Corporate
-0013CF 4Access Communications
-0013D0 t+ Medical
-0013D1 Kirk Telecom A/S
-0013D2 Page Iberica
-0013D3 Micro-star International CO.
-0013D4 Asustek Computer
-0013D5 WiNetworks
-0013D6 TII Network Technologies
-0013D7 Spidcom Technologies SA
-0013D8 Princeton Instruments
-0013D9 Matrix Product Development
-0013DA Diskware Co.
-0013DB Shoei Electric Co.
-0013DC Ibtek
-0013DD Abbott Diagnostics
-0013DE Adapt4
-0013DF Ryvor
-0013E0 Murata Manufacturing Co.
-0013E1 Iprobe AB
-0013E2 GeoVision
-0013E3 CoVi Technologies
-0013E4 Yangjae Systems
-0013E5 Tenosys
-0013E6 Technolution
-0013E7 Halcro
-0013E8 Intel Corporate
-0013E9 VeriWave
-0013EA Kamstrup A/S
-0013EB Sysmaster
-0013EC Sunbay Software AG
-0013ED Psia
-0013EE JBX Designs
-0013EF Kingjon Digital Technology Co.
-0013F0 Wavefront Semiconductor
-0013F1 Amod Technology Co.
-0013F2 Klas
-0013F3 Giga-byte Communications
-0013F4 Psitek (Pty)
-0013F5 Akimbi Systems
-0013F6 Cintech
-0013F7 SMC Networks
-0013F8 Dex Security Solutions
-0013F9 Cavera Systems
-0013FA LifeSize Communications
-0013FB RKC Instrument
-0013FC SiCortex
-0013FD Nokia Danmark A/S
-0013FE Grandtec Electronic
-0013FF Dage-MTI of MC
-001400 Minerva Korea CO.
-001401 Rivertree Networks
-001402 kk-electronic a/s
-001403 Renasis
-001404 Motorola CHS
-001405 OpenIB
-001406 Go Networks
-001407 Sperian Protection Instrumentation
-001408 Eka Systems
-001409 Magneti Marelli S.E. S.p.a.
-00140A Wepio Co.
-00140B First International Computer
-00140C GKB Cctv CO.
-00140D Nortel
-00140E Nortel
-00140F Federal State Unitary Enterprise Leningrad R&D Institute of
-001410 Suzhou Keda Technology CO.
-001411 Deutschmann Automation GmbH & Co. KG
-001412 S-TEC electronics AG
-001413 Trebing & Himstedt Prozessautomation GmbH & Co. KG
-001414 Jumpnode Systems
-001415 Intec Automation
-001416 Scosche Industries
-001417 RSE Informations Technologie GmbH
-001418 C4Line
-001419 Sidsa
-00141A Deicy
-00141B Cisco Systems
-00141C Cisco Systems
-00141D Lust Antriebstechnik GmbH
-00141E P.A. Semi
-00141F SunKwang Electronics Co.
-001420 G-Links networking company
-001421 Total Wireless Technologies Pte.
-001422 Dell
-001423 J-S Co. Neurocom
-001424 Merry Electrics CO.
-001425 Galactic Computing
-001426 NL Technology
-001427 JazzMutant
-001428 Vocollect
-001429 V Center Technologies Co.
-00142A Elitegroup Computer System Co.
-00142B Edata Communication
-00142C Koncept International
-00142D Toradex AG
-00142E 77 Elektronika Kft.
-00142F WildPackets
-001430 ViPowER
-001431 PDL Electronics
-001432 Tarallax Wireless
-001433 Empower Technologies(Canada)
-001434 Keri Systems
-001435 CityCom
-001436 Qwerty Elektronik AB
-001437 GSTeletech Co.
-001438 Hewlett Packard
-001439 Blonder Tongue Laboratories
-00143A Raytalk International SRL
-00143B Sensovation AG
-00143C Rheinmetall Canada
-00143D Aevoe
-00143E AirLink Communications
-00143F Hotway Technology
-001440 Atomic
-001441 Innovation Sound Technology Co.
-001442 Atto
-001443 Consultronics Europe
-001444 Grundfos Electronics
-001445 Telefon-Gradnja d.o.o.
-001446 SuperVision Solutions
-001447 Boaz
-001448 Inventec Multimedia & Telecom
-001449 Sichuan Changhong Electric
-00144A Taiwan Thick-Film Ind.
-00144B Hifn
-00144C General Meters
-00144D Intelligent Systems
-00144E Srisa
-00144F Sun Microsystems
-001450 Heim Systems GmbH
-001451 Apple Computer
-001452 Calculex
-001453 Advantech Technologies Co.
-001454 Symwave
-001455 Coder Electronics
-001456 Edge Products
-001457 T-vips AS
-001458 HS Automatic ApS
-001459 Moram Co.
-00145A Neratec AG
-00145B SeekerNet
-00145C Intronics B.V.
-00145D WJ Communications
-00145E IBM
-00145F Aditec CO.
-001460 Kyocera Wireless
-001461 Corona
-001462 Digiwell Technology
-001463 Idcs N.V.
-001464 Cryptosoft
-001465 Novo Nordisk A/S
-001466 Kleinhenz Elektronik GmbH
-001467 ArrowSpan
-001468 CelPlan International
-001469 Cisco Systems
-00146A Cisco Systems
-00146B Anagran
-00146C Netgear
-00146D RF Technologies
-00146E H. Stoll GmbH & Co. KG
-00146F Kohler Co
-001470 Prokom Software SA
-001471 Eastern Asia Technology Limited
-001472 China Broadband Wireless IP Standard Group
-001473 Bookham
-001474 K40 Electronics
-001475 Wiline Networks
-001476 MultiCom Industries Limited
-001477 Nertec
-001478 Shenzhen Tp-link Technologies Co.
-001479 NEC Magnus Communications
-00147A Eubus GmbH
-00147B Iteris
-00147C 3Com
-00147D Aeon Digital International
-00147E InnerWireless
-00147F Thomson Telecom Belgium
-001480 Hitachi-LG Data Storage Korea
-001481 Multilink
-001482 GoBackTV
-001483 eXS
-001484 Cermate Technologies
-001485 Giga-Byte
-001486 Echo Digital Audio
-001487 American Technology Integrators
-001488 Akorri
-001489 B15402100 - Jandei
-00148A Elin Ebg Traction Gmbh
-00148B Globo Electronic GmbH & Co. KG
-00148C Fortress Technologies
-00148D Cubic Defense Simulation Systems
-00148E Tele Power
-00148F Protronic (Far East)
-001490 ASP
-001491 Daniels Electronics
-001492 Liteon, Mobile Media Solution SBU
-001493 Systimax Solutions
-001494 ESU AG
-001495 2Wire
-001496 Phonic
-001497 Zhiyuan Eletronics Co.
-001498 Viking Design Technology
-001499 Helicomm
-00149A Motorola Mobile Devices Business
-00149B Nokota Communications
-00149C HF Company
-00149D Sound ID
-00149E UbONE Co.
-00149F System and Chips
-0014A0 Accsense
-0014A1 Synchronous Communication
-0014A2 Core Micro Systems
-0014A3 Vitelec BV
-0014A4 Hon Hai Precision Ind. Co.
-0014A5 Gemtek Technology Co.
-0014A6 Teranetics
-0014A7 Nokia Danmark A/S
-0014A8 Cisco Systems
-0014A9 Cisco Systems
-0014AA Ashly Audio
-0014AB Senhai Electronic Technology Co.
-0014AC Bountiful WiFi
-0014AD Gassner Wiege- u. Metechnik GmbH
-0014AE Wizlogics Co.
-0014AF Datasym
-0014B0 Naeil Community
-0014B1 Avitec AB
-0014B2 mCubelogics
-0014B3 CoreStar International
-0014B4 General Dynamics United Kingdom
-0014B5 Physiometrix
-0014B6 Enswer Technology
-0014B7 AR Infotek
-0014B8 Hill-Rom
-0014B9 Mstar Semiconductor
-0014BA Carvers SA de CV
-0014BB Open Interface North America
-0014BC Synectic Telecom Exports PVT.
-0014BD incNETWORKS
-0014BE Wink communication technologyLTD
-0014BF Cisco-Linksys
-0014C0 Symstream Technology Group
-0014C1 U.S. Robotics
-0014C2 Hewlett Packard
-0014C3 Seagate Technology
-0014C4 Vitelcom Mobile Technology
-0014C5 Alive Technologies
-0014C6 Quixant
-0014C7 Nortel
-0014C8 Contemporary Research
-0014C9 Brocade Communications Systems
-0014CA Key Radio Systems Limited
-0014CB LifeSync
-0014CC Zetec
-0014CD DigitalZone Co.
-0014CE NF
-0014CF Nextlink.to A/S
-0014D0 BTI Systems
-0014D1 Trendware International
-0014D2 Kyuki
-0014D3 Sepsa
-0014D4 K Technology
-0014D5 Datang Telecom Technology CO. , LCD,Optical Communication Br
-0014D6 Jeongmin Electronics Co.
-0014D7 Datastore Technology
-0014D8 bio-logic SA
-0014D9 IP Fabrics
-0014DA Huntleigh Healthcare
-0014DB Elma Trenew Electronic GmbH
-0014DC Communication System Design & Manufacturing (csdm)
-0014DD Covergence
-0014DE Sage Instruments
-0014DF HI-P Tech
-0014E0 LET'S
-0014E1 Data Display AG
-0014E2 datacom systems
-0014E3 mm-lab GmbH
-0014E4 Integral Technologies
-0014E5 Alticast
-0014E6 AIM Infrarotmodule GmbH
-0014E7 Stolinx
-0014E8 Motorola CHS
-0014E9 Nortech International
-0014EA S Digm (Safe Paradigm)
-0014EB AwarePoint
-0014EC Acro Telecom
-0014ED Airak
-0014EE Western Digital Technologies
-0014EF TZero Technologies
-0014F0 Business Security OL AB
-0014F1 Cisco Systems
-0014F2 Cisco Systems
-0014F3 ViXS Systems
-0014F4 DekTec Digital Video B.V.
-0014F5 OSI Security Devices
-0014F6 Juniper Networks
-0014F7 Crevis
-0014F8 Scientific Atlanta
-0014F9 Vantage Controls
-0014FA AsGa S.A.
-0014FB Technical Solutions
-0014FC Extandon
-0014FD Thecus Technology
-0014FE Artech Electronics
-0014FF Precise Automation
-001500 Intel Corporate
-001501 LexBox
-001502 Beta Tech
-001503 Proficomms S.r.o.
-001504 Game Plus CO.
-001505 Actiontec Electronics
-001506 Neo Photonics
-001507 Renaissance Learning
-001508 Global Target Enterprise
-001509 Plus Technology Co.
-00150A Sonoa Systems
-00150B Sage Infotech
-00150C AVM GmbH
-00150D Hoana Medical
-00150E Openbrain Technologies CO.
-00150F mingjong
-001510 Techsphere Co.
-001511 Data Center Systems
-001512 Zurich University of Applied Sciences
-001513 EFS sas
-001514 Hu Zhou Nava Networks&electronics
-001515 Leipold+Co.GmbH
-001516 Uriel Systems
-001517 Intel Corporate
-001518 Shenzhen 10MOONS Technology Development CO.
-001519 StoreAge Networking Technologies
-00151A Hunter Engineering Company
-00151B Isilon Systems
-00151C Leneco
-00151D M2I
-00151E Ethernet Powerlink Standardization Group (epsg)
-00151F Multivision Intelligent Surveillance (Hong Kong)
-001520 Radiocrafts AS
-001521 Horoquartz
-001522 Dea Security
-001523 Meteor Communications
-001524 Numatics
-001525 Chamberlain Access Solutions
-001526 Remote Technologies
-001527 Balboa Instruments
-001528 Beacon Medical Products d.b.a. BeaconMedaes
-001529 N3
-00152A Nokia GmbH
-00152B Cisco Systems
-00152C Cisco Systems
-00152D TenX Networks
-00152E PacketHop
-00152F Motorola CHS
-001530 Bus-Tech
-001531 Kocom
-001532 Consumer Technologies Group
-001533 Nadam.co.
-001534 A Beltrnica, Companhia de Comunicaes
-001535 OTE Spa
-001536 Powertech co.
-001537 Ventus Networks
-001538 RFID
-001539 Technodrive SRL
-00153A Shenzhen Syscan Technology Co.
-00153B EMH Elektrizittszhler GmbH & CoKG
-00153C Kprotech Co.
-00153D Elim Product CO.
-00153E Q-Matic Sweden AB
-00153F Alcatel Alenia Space Italia
-001540 Nortel
-001541 StrataLight Communications
-001542 Microhard S.r.l.
-001543 Aberdeen Test Center
-001544 coM.s.a.t. AG
-001545 Seecode Co.
-001546 ITG Worldwide Sdn Bhd
-001547 AiZen Solutions
-001548 Cube Technologies
-001549 Dixtal Biomedica Ind. Com. Ltda
-00154A Wanshih Electronic CO.
-00154B Wonde Proud Technology Co.
-00154C Saunders Electronics
-00154D Netronome Systems
-00154E IEC
-00154F one RF Technology
-001550 Nits Technology
-001551 RadioPulse
-001552 Wi-Gear
-001553 Cytyc
-001554 Atalum Wireless S.A.
-001555 DFM GmbH
-001556 Sagem Communication
-001557 Olivetti
-001558 Foxconn
-001559 Securaplane Technologies
-00155A Dainippon Pharmaceutical CO.
-00155B Sampo
-00155C Dresser Wayne
-00155D Microsoft
-00155E Morgan Stanley
-00155F GreenPeak Technologies
-001560 Hewlett Packard
-001561 JJPlus
-001562 Cisco Systems
-001563 Cisco Systems
-001564 Behringer Spezielle Studiotechnik Gmbh
-001565 Xiamen Yealink Network Technology Co.
-001566 A-First Technology Co.
-001567 Radwin
-001568 Dilithium Networks
-001569 Peco II
-00156A DG2L Technologies Pvt.
-00156B Perfisans Networks
-00156C Sane System CO.
-00156D Ubiquiti Networks
-00156E A. W. Communication Systems
-00156F Xiranet Communications GmbH
-001570 Symbol TechnologiesWholly owned Subsidiary of Motorola
-001571 Nolan Systems
-001572 Red-Lemon
-001573 NewSoft Technology
-001574 Horizon Semiconductors
-001575 Nevis Networks
-001576 scil animal care company GmbH
-001577 Allied Telesyn
-001578 Audio / Video Innovations
-001579 Lunatone Industrielle Elektronik GmbH
-00157A Telefin S.p.A.
-00157B Leuze electronic GmbH + Co. KG
-00157C Dave Networks
-00157D Posdata CO.
-00157E Heyfra Electronic Gmbh
-00157F ChuanG International Holding CO.
-001580 U-way
-001581 Makus
-001582 TVonics
-001583 IVT
-001584 Schenck Process GmbH
-001585 Aonvision Technolopy
-001586 Xiamen Overseas Chinese Electronic Co.
-001587 Takenaka Seisakusho Co.
-001588 Balda-Thong Fook Solutions Sdn. Bhd.
-001589 D-MAX Technology Co.
-00158A Surecom Technology
-00158B Park Air Systems
-00158C Liab ApS
-00158D Jennic
-00158E Plustek.INC
-00158F NTT Advanced Technology
-001590 Hectronic GmbH
-001591 RLW
-001592 Facom UK (Melksham)
-001593 U4EA Technologies
-001594 Bixolon Co.
-001595 Quester Tangent
-001596 Arris International
-001597 Aeta Audio Systems
-001598 Kolektor group
-001599 Samsung Electronics Co.
-00159A Motorola CHS
-00159B Nortel
-00159C B-kyung System Co.
-00159D Minicom Advanced Systems
-00159E Mad Catz Interactive
-00159F Terascala
-0015A0 Nokia Danmark A/S
-0015A1 Eca-sinters
-0015A2 Arris International
-0015A3 Arris International
-0015A4 Arris International
-0015A5 DCI Co.
-0015A6 Digital Electronics Products
-0015A7 Robatech AG
-0015A8 Motorola Mobile Devices
-0015A9 Kwang WOO I&C Co.
-0015AA Rextechnik International Co.,
-0015AB PRO CO Sound
-0015AC Capelon AB
-0015AD Accedian Networks
-0015AE kyung il
-0015AF AzureWave Technologies
-0015B0 Autotelenet Co.
-0015B1 Ambient
-0015B2 Advanced Industrial Computer
-0015B3 Caretech AB
-0015B4 Polymap Wireless
-0015B5 CI Network
-0015B6 ShinMaywa Industries
-0015B7 Toshiba
-0015B8 Tahoe
-0015B9 Samsung Electronics Co.
-0015BA iba AG
-0015BB SMA Solar Technology AG
-0015BC Develco
-0015BD Group 4 Technology
-0015BE Iqua
-0015BF technicob
-0015C0 Digital Telemedia Co.
-0015C1 Sony Computer Entertainment,
-0015C2 3M Germany
-0015C3 Ruf Telematik AG
-0015C4 Flovel CO.
-0015C5 Dell
-0015C6 Cisco Systems
-0015C7 Cisco Systems
-0015C8 FlexiPanel
-0015C9 Gumstix
-0015CA TeraRecon
-0015CB Surf Communication Solutions
-0015CC Tepco Uquest
-0015CD Exartech International
-0015CE Arris International
-0015CF Arris International
-0015D0 Arris International
-0015D1 Arris Group
-0015D2 Xantech
-0015D3 Pantech&Curitel Communications
-0015D4 Emitor AB
-0015D5 Nicevt
-0015D6 OSLiNK Sp. z o.o.
-0015D7 Reti
-0015D8 Interlink Electronics
-0015D9 PKC Electronics Oy
-0015DA Iritel A.D.
-0015DB Canesta
-0015DC KT&C Co.
-0015DD IP Control Systems
-0015DE Nokia Danmark A/S
-0015DF Clivet S.p.A.
-0015E0 Ericsson Mobile Platforms
-0015E1 picoChip Designs
-0015E2 Dr.Ing. Herbert Knauer GmbH
-0015E3 Dream Technologies
-0015E4 Zimmer Elektromedizin
-0015E5 Cheertek
-0015E6 Mobile Technika
-0015E7 Quantec ProAudio
-0015E8 Nortel
-0015E9 D-Link
-0015EA Tellumat (Pty)
-0015EB ZTE
-0015EC Boca Devices
-0015ED Fulcrum Microsystems
-0015EE Omnex Control Systems
-0015EF NEC Tokin
-0015F0 EGO BV
-0015F1 Kylink Communications
-0015F2 Asustek Computer
-0015F3 Peltor AB
-0015F4 Eventide
-0015F5 Sustainable Energy Systems
-0015F6 Science AND Engineering Services
-0015F7 Wintecronics
-0015F8 Kingtronics Industrial Co.
-0015F9 Cisco Systems
-0015FA Cisco Systems
-0015FB setex schermuly textile computer gmbh
-0015FC Startco Engineering
-0015FD Complete Media Systems
-0015FE Schilling Robotics
-0015FF Novatel Wireless
-001600 CelleBrite Mobile Synchronization
-001601 Buffalo
-001602 Ceyon Technology Co.
-001603 Coolksky Co.
-001604 Sigpro
-001605 Yorkville Sound
-001606 Ideal Industries
-001607 Curves International
-001608 Sequans Communications
-001609 Unitech electronics co.
-00160A Sweex Europe BV
-00160B TVWorks
-00160C LPL Development S.A. DE C.V
-00160D Be Here
-00160E Optica Technologies
-00160F Badger Meter
-001610 Carina Technology
-001611 Altecon Srl
-001612 Otsuka Electronics Co.
-001613 LibreStream Technologies
-001614 Picosecond Pulse Labs
-001615 Nittan Company, Limited
-001616 Browan Communication
-001617 MSI
-001618 Hivion Co.
-001619 La Factora de Comunicaciones Aplicadas
-00161A Dametric AB
-00161B Micronet
-00161C e:cue
-00161D Innovative Wireless Technologies
-00161E Woojinnet
-00161F Sunwavetec Co.
-001620 Sony Ericsson Mobile Communications AB
-001621 Colorado Vnet
-001622 BBH Systems Gmbh
-001623 Interval Media
-001624 Teneros
-001625 Impinj
-001626 Motorola CHS
-001627 Embedded-logic Design AND More Gmbh
-001628 Ultra Electronics Manufacturing and Card Systems
-001629 Nivus GmbH
-00162A Antik computers & communications s.r.o.
-00162B Togami Electric Mfg.co.
-00162C Xanboo
-00162D STNet Co.
-00162E Space Shuttle Hi-Tech Co.
-00162F Geutebrck GmbH
-001630 Vativ Technologies
-001631 Xteam
-001632 Samsung Electronics CO.
-001633 Oxford Diagnostics
-001634 Mathtech
-001635 Hewlett Packard
-001636 Quanta Computer
-001637 Citel Srl
-001638 Tecom Co.
-001639 Ubiquam Co.
-00163A Yves Technology CO.
-00163B VertexRSI/General Dynamics
-00163C Rebox B.V.
-00163D Tsinghua Tongfang Legend Silicon Tech. Co.
-00163E Xensource
-00163F Crete Systems
-001640 Asmobile Communication
-001641 USI
-001642 Pangolin
-001643 Sunhillo
-001644 Lite-on Technology
-001645 Power Distribution
-001646 Cisco Systems
-001647 Cisco Systems
-001648 SSD Company Limited
-001649 SetOne GmbH
-00164A Vibration Technology Limited
-00164B Quorion Data Systems GmbH
-00164C Planet INT Co.
-00164D Alcatel North America IP Division
-00164E Nokia Danmark A/S
-00164F World Ethnic Broadcastin
-001650 Eyal Microwave
-001651 Exeo Systems
-001652 Hoatech Technologies
-001653 Lego System A/S IE Electronics Division
-001654 Flex-P Industries Sdn. Bhd.
-001655 Fuho Technology Co.
-001656 Nintendo Co.
-001657 Aegate
-001658 Fusiontech Technologies
-001659 Z.m.p. Radwag
-00165A Harman Specialty Group
-00165B Grip Audio
-00165C Trackflow
-00165D AirDefense
-00165E Precision I/O
-00165F Fairmount Automation
-001660 Nortel
-001661 Novatium Solutions (P)
-001662 Liyuh Technology
-001663 KBT Mobile
-001664 Prod-El SpA
-001665 Cellon France
-001666 Quantier Communication
-001667 A-TEC Subsystem
-001668 Eishin Electronics
-001669 MRV Communication (Networks)
-00166A TPS
-00166B Samsung Electronics
-00166C Samsung Electonics Digital Video System Division
-00166D Yulong Computer Telecommunication Scientific(shenzhen)Co.
-00166E Arbitron
-00166F Intel
-001670 Sknet
-001671 Symphox Information Co.
-001672 Zenway enterprise
-001673 Bury GmbH & Co. KG
-001674 EuroCB (Phils.)
-001675 Motorola MDb
-001676 Intel
-001677 Bihl+Wiedemann GmbH
-001678 Shenzhen Baoan Gaoke Electronics CO.
-001679 eOn Communications
-00167A Skyworth Overseas Dvelopment
-00167B Haver&Boecker
-00167C iRex Technologies BV
-00167D Sky-Line Information Co.
-00167E Diboss.co.
-00167F Bluebird Soft
-001680 Bally Gaming + Systems
-001681 Vector Informatik GmbH
-001682 Pro Dex
-001683 Webio International Co.
-001684 Donjin Co.
-001685 Elisa Oyj
-001686 Karl Storz Imaging
-001687 Chubb CSC-Vendor AP
-001688 ServerEngines
-001689 Pilkor Electronics Co.
-00168A id-Confirm
-00168B Paralan
-00168C DSL Partner AS
-00168D Korwin CO.
-00168E Vimicro
-00168F GN Netcom as
-001690 J-tek Incorporation
-001691 Moser-Baer AG
-001692 Scientific-Atlanta
-001693 PowerLink Technology
-001694 Sennheiser Communications A/S
-001695 AVC Technology Limited
-001696 QDI Technology (H.K.) Limited
-001697 NEC
-001698 T&A Mobile Phones
-001699 Tonic DVB Marketing
-00169A Quadrics
-00169B Alstom Transport
-00169C Cisco Systems
-00169D Cisco Systems
-00169E TV One
-00169F Vimtron Electronics Co.
-0016A0 Auto-Maskin
-0016A1 3Leaf Networks
-0016A2 CentraLite Systems
-0016A3 Ingeteam Transmission&Distribution
-0016A4 Ezurio
-0016A5 Tandberg Storage ASA
-0016A6 Dovado FZ-LLC
-0016A7 Aweta G&P
-0016A8 CWT CO.
-0016A9 2EI
-0016AA Kei Communication Technology
-0016AB PBI-Dansensor A/S
-0016AC Toho Technology
-0016AD BT-Links Company Limited
-0016AE Inventel
-0016AF Shenzhen Union Networks Equipment Co.
-0016B0 VK
-0016B1 KBS
-0016B2 DriveCam
-0016B3 Photonicbridges (China) Co.
-0016B4 Private
-0016B5 Motorola CHS
-0016B6 Cisco-Linksys
-0016B7 Seoul Commtech
-0016B8 Sony Ericsson Mobile Communications
-0016B9 ProCurve Networking
-0016BA Weathernews
-0016BB Law-Chain Computer Technology Co
-0016BC Nokia Danmark A/S
-0016BD ATI Industrial Automation
-0016BE Infranet
-0016BF PaloDEx Group Oy
-0016C0 Semtech
-0016C1 Eleksen
-0016C2 Avtec Systems
-0016C3 BA Systems
-0016C4 SiRF Technology
-0016C5 Shenzhen Xing Feng Industry Co.
-0016C6 North Atlantic Industries
-0016C7 Cisco Systems
-0016C8 Cisco Systems
-0016C9 NAT Seattle
-0016CA Nortel
-0016CB Apple Computer
-0016CC Xcute Mobile
-0016CD Hiji High-tech CO.
-0016CE Hon Hai Precision Ind. Co.
-0016CF Hon Hai Precision Ind. Co.
-0016D0 ATech elektronika d.o.o.
-0016D1 ZAT a.s.
-0016D2 Caspian
-0016D3 Wistron
-0016D4 Compal Communications
-0016D5 Synccom Co.
-0016D6 TDA Tech
-0016D7 Sunways AG
-0016D8 Senea AB
-0016D9 Ningbo Bird Co.
-0016DA Futronic Technology Co.
-0016DB Samsung Electronics Co.
-0016DC Archos
-0016DD Gigabeam
-0016DE Fast
-0016DF Lundinova AB
-0016E0 3Com
-0016E1 SiliconStor
-0016E2 American Fibertek
-0016E3 Askey Computer
-0016E4 Vanguard Security Engineering
-0016E5 Fordley Development Limited
-0016E6 Giga-byte Technology Co.
-0016E7 Dynamix Promotions Limited
-0016E8 Sigma Designs
-0016E9 Tiba Medical
-0016EA Intel
-0016EB Intel
-0016EC Elitegroup Computer Systems Co.
-0016ED Integrian
-0016EE RoyalDigital
-0016EF Koko Fitness
-0016F0 Dell
-0016F1 OmniSense
-0016F2 Dmobile System Co.
-0016F3 Cast Information Co.
-0016F4 Eidicom Co.
-0016F5 Dalian Golden Hualu Digital Technology Co.
-0016F6 Video Products Group
-0016F7 L-3 Communications, Electrodynamics
-0016F8 Aviqtech Technology CO.
-0016F9 Cetrta POT, D.o.o.
-0016FA ECI Telecom
-0016FB Shenzhen MTC Co.
-0016FC Tohken Co.
-0016FD Jaty Electronics
-0016FE Alps Electric Co.
-0016FF Wamin Optocomm Mfg
-001700 Motorola MDb
-001701 KDE
-001702 Osung Midicom Co.
-001703 Mosdan Internation Co.
-001704 Shinco Electronics Group Co.
-001705 Methode Electronics
-001706 Techfaith Wireless Communication Technology Limited.
-001707 InGrid
-001708 Hewlett Packard
-001709 Exalt Communications
-00170A Inew Digital Company
-00170B Contela
-00170C GeoSentric OYj
-00170D Dust Networks
-00170E Cisco Systems
-00170F Cisco Systems
-001710 Casa Systems
-001711 GE Healthcare Bio-Sciences AB
-001712 Isco International
-001713 Tiger NetCom
-001714 BR Controls Nederland bv
-001715 Qstik
-001716 Qno Technology
-001717 Leica Geosystems AG
-001718 Vansco Electronics Oy
-001719 AudioCodes USA
-00171A Winegard Company
-00171B Innovation Lab
-00171C NT MicroSystems
-00171D Digit
-00171E Theo Benning GmbH & Co. KG
-00171F IMV
-001720 Image Sensing Systems
-001721 Fitre S.p.a.
-001722 Hanazeder Electronic GmbH
-001723 Summit Data Communications
-001724 Studer Professional Audio GmbH
-001725 Liquid Computing
-001726 m2c Electronic Technology
-001727 Thermo Ramsey Italia s.r.l.
-001728 Selex Communications
-001729 UbicodLTD
-00172A Proware Technology
-00172B Global Technologies
-00172C Taejin Infotech
-00172D Axcen Photonics
-00172E FXC
-00172F NeuLion Incorporated
-001730 Automation Electronics
-001731 Asustek Computer
-001732 Science-technical Center "rissa"
-001733 neuf cegetel
-001734 LGC Wireless
-001735 Private
-001736 iiTron
-001737 Industrie Dial Face S.p.A.
-001738 International Business Machines
-001739 Bright Headphone Electronics Company
-00173A Reach Systems
-00173B Arched Rock
-00173C Extreme Engineering Solutions
-00173D Neology
-00173E LeucotronEquipamentos Ltda.
-00173F Belkin
-001740 Technologies Labtronix
-001741 Defidev
-001742 Fujitsu Limited
-001743 Deck Srl
-001744 Araneo
-001745 Innotz CO.
-001746 Freedom9
-001747 Trimble
-001748 Neokoros Brasil Ltda
-001749 Hyundae Yong-o-sa Co.
-00174A Socomec
-00174B Nokia Danmark A/S
-00174C Millipore
-00174D Dynamic Network Factory
-00174E Parama-tech Co.
-00174F iCatch
-001750 GSI Group, MicroE Systems
-001751 Online
-001752 DAGS
-001753 nFore Technology
-001754 Arkino
-001755 GE Security
-001756 Vinci Labs Oy
-001757 RIX Technology Limited
-001758 ThruVision
-001759 Cisco Systems
-00175A Cisco Systems
-00175B ACS Solutions Switzerland
-00175C Sharp
-00175D Dongseo system.
-00175E Zed-3
-00175F Xenolink Communications Co.
-001760 Naito Densei Machida MFG.CO.
-001761 ZKSoftware
-001762 Solar Technology
-001763 Essentia S.p.A.
-001764 ATMedia GmbH
-001765 Nortel
-001766 Accense Technology
-001767 Earforce AS
-001768 Zinwave
-001769 Cymphonix
-00176A Avago Technologies
-00176B Kiyon
-00176C Pivot3
-00176D Core
-00176E Ducati Sistemi
-00176F PAX Computer Technology(Shenzhen)
-001770 Arti Industrial Electronics
-001771 APD Communications
-001772 Astro Strobel Kommunikationssysteme Gmbh
-001773 Laketune Technologies Co.
-001774 Elesta GmbH
-001775 TTE Germany GmbH
-001776 Meso Scale Diagnostics
-001777 Obsidian Research
-001778 Central Music Co.
-001779 QuickTel
-00177A Assa Abloy AB
-00177B Azalea Networks
-00177C D-Link India
-00177D IDT International Limited
-00177E Meshcom Technologies
-00177F Worldsmart Retech
-001780 Applera Holding B.V. Singapore Operations
-001781 Greystone Data System
-001782 LoBenn
-001783 Texas Instruments
-001784 Motorola Mobile Devices
-001785 Sparr Electronics
-001786 wisembed
-001787 Brother, Brother & Sons ApS
-001788 Philips Lighting BV
-001789 Zenitron
-00178A Darts Technologies
-00178B Teledyne Technologies Incorporated
-00178C Independent Witness
-00178D Checkpoint Systems
-00178E Gunnebo Cash Automation AB
-00178F Ningbo Yidong Electronic Co.
-001790 Hyundai Digitech Co
-001791 LinTech GmbH
-001792 Falcom Wireless Comunications Gmbh
-001793 Tigi
-001794 Cisco Systems
-001795 Cisco Systems
-001796 Rittmeyer AG
-001797 Telsy Elettronica S.p.A.
-001798 Azonic Technology Co.
-001799 SmarTire Systems
-00179A D-Link
-00179B Chant Sincere CO.
-00179C Deprag Schulz Gmbh u. CO.
-00179D Kelman Limited
-00179E Sirit
-00179F Apricorn
-0017A0 RoboTech srl
-0017A1 3soft
-0017A2 Camrivox
-0017A3 MIX s.r.l.
-0017A4 Hewlett Packard
-0017A5 TrendChip Technologies
-0017A6 Yosin Electronics CO.
-0017A7 Mobile Computing Promotion Consortium
-0017A8 EDM
-0017A9 Sentivision
-0017AA elab-experience
-0017AB Nintendo Co.
-0017AC O'Neil Product Development
-0017AD AceNet
-0017AE GAI-Tronics
-0017AF Enermet
-0017B0 Nokia Danmark A/S
-0017B1 Acist Medical Systems
-0017B2 SK Telesys
-0017B3 Aftek Infosys Limited
-0017B4 Remote Security Systems
-0017B5 Peerless Systems
-0017B6 Aquantia
-0017B7 Tonze Technology Co.
-0017B8 Novatron CO.
-0017B9 Gambro Lundia AB
-0017BA Sedo CO.
-0017BB Syrinx Industrial Electronics
-0017BC Touchtunes Music
-0017BD Tibetsystem
-0017BE Tratec Telecom B.V.
-0017BF Coherent Research Limited
-0017C0 PureTech Systems
-0017C1 CM Precision Technology
-0017C2 Pirelli Broadband Solutions
-0017C3 KTF Technologies
-0017C4 Quanta Microsystems
-0017C5 SonicWALL
-0017C6 Cross Match Technologies
-0017C7 Mara Systems Consulting AB
-0017C8 Kyocera Mita
-0017C9 Samsung Electronics Co.
-0017CA Qisda
-0017CB Juniper Networks
-0017CC Alcatel-Lucent
-0017CD CEC Wireless R&D
-0017CE MB International Telecom Labs srl
-0017CF iMCA-GmbH
-0017D0 Opticom Communications
-0017D1 Nortel
-0017D2 Thinlinx
-0017D3 Etymotic Research
-0017D4 Monsoon Multimedia
-0017D5 Samsung Electronics Co.
-0017D6 Bluechips Microhouse Co.
-0017D7 ION Geophysical
-0017D8 Magnum Semiconductor
-0017D9 AAI
-0017DA Spans Logic
-0017DB Canko Technologies
-0017DC Daemyung Zero1
-0017DD Clipsal Australia
-0017DE Advantage Six
-0017DF Cisco Systems
-0017E0 Cisco Systems
-0017E1 Dacos Technologies Co.
-0017E2 Motorola Mobile Devices
-0017E3 Texas Instruments
-0017E4 Texas Instruments
-0017E5 Texas Instruments
-0017E6 Texas Instruments
-0017E7 Texas Instruments
-0017E8 Texas Instruments
-0017E9 Texas Instruments
-0017EA Texas Instruments
-0017EB Texas Instruments
-0017EC Texas Instruments
-0017ED WooJooIT
-0017EE Motorola CHS
-0017EF Blade Network Technologies
-0017F0 Szcom Broadband Network Technology Co.
-0017F1 Renu Electronics Pvt
-0017F2 Apple Computer
-0017F3 M/A-COM Wireless Systems
-0017F4 Zeron Alliance
-0017F5 LIG Neoptek
-0017F6 Pyramid Meriden
-0017F7 CEM Solutions Pvt
-0017F8 Motech Industries
-0017F9 Forcom Sp. z o.o.
-0017FA Microsoft
-0017FB FA
-0017FC Suprema
-0017FD Amulet Hotkey
-0017FE Talos System
-0017FF Playline Co.
-001800 Unigrand
-001801 Actiontec Electronics
-001802 Alpha Networks
-001803 ArcSoft Shanghai Co.
-001804 E-tek Digital Technology Limited
-001805 Beijing InHand Networking Technology Co.
-001806 Hokkei Industries Co.
-001807 Fanstel
-001808 SightLogix
-001809 Cresyn
-00180A Meraki
-00180B Brilliant Telecommunications
-00180C Optelian Access Networks
-00180D Terabytes Server Storage Tech
-00180E Avega Systems
-00180F Nokia Danmark A/S
-001810 IPTrade S.A.
-001811 Neuros Technology International
-001812 Beijing Xinwei Telecom Technology Co.
-001813 Sony Ericsson Mobile Communications
-001814 Mitutoyo
-001815 GZ Technologies
-001816 Ubixon Co.
-001817 D. E. Shaw Research
-001818 Cisco Systems
-001819 Cisco Systems
-00181A AVerMedia Information
-00181B TaiJin Metal Co.
-00181C Exterity Limited
-00181D Asia Electronics Co.
-00181E GDX Technologies
-00181F Palmmicro Communications
-001820 w5networks
-001821 Sindoricoh
-001822 CEC Telecom Co.
-001823 Delta Electronics
-001824 Kimaldi Electronics
-001825 Wavion
-001826 Cale Access AB
-001827 NEC Philips Unified Solutions Nederland BV
-001828 e2v technologies (UK)
-001829 Gatsometer
-00182A Taiwan Video & Monitor
-00182B Softier
-00182C Ascend Networks
-00182D Artec Group O
-00182E XStreamHD
-00182F Texas Instruments
-001830 Texas Instruments
-001831 Texas Instruments
-001832 Texas Instruments
-001833 Texas Instruments
-001834 Texas Instruments
-001835 Thoratec / ITC
-001836 Reliance Electric Limited
-001837 Universal Abit Co.
-001838 PanAccess Communications
-001839 Cisco-Linksys
-00183A Westell Technologies
-00183B Cenits Co.
-00183C Encore Software Limited
-00183D Vertex Link
-00183E Digilent
-00183F 2Wire
-001840 3 Phoenix
-001841 High Tech Computer
-001842 Nokia Danmark A/S
-001843 Dawevision
-001844 Heads Up Technologies
-001845 NPL Pulsar
-001846 Crypto S.A.
-001847 AceNet Technology
-001848 Vecima Networks
-001849 Pigeon Point Systems
-00184A Catcher
-00184B Las Vegas Gaming
-00184C Bogen Communications
-00184D Netgear
-00184E Lianhe Technologies
-00184F 8 Ways Technology
-001850 Secfone Kft
-001851 SWsoft
-001852 StorLink Semiconductors
-001853 Atera Networks
-001854 Argard Co.
-001855 Aeromaritime Systembau GmbH
-001856 EyeFi
-001857 Unilever R&D
-001858 TagMaster AB
-001859 Strawberry Linux Co.
-00185A uControl
-00185B Network Chemistry
-00185C EDS Lab Pte
-00185D Taiguen Technology (shen-zhen) CO.
-00185E Nexterm
-00185F TAC
-001860 SIM Technology Group Shanghai Simcom,
-001861 Ooma
-001862 Seagate Technology
-001863 Veritech Electronics Limited
-001864 Cybectec
-001865 Siemens Healthcare Diagnostics Manufacturing
-001866 Leutron Vision
-001867 Evolution Robotics Retail
-001868 Scientific Atlanta, A Cisco Company
-001869 Kingjim
-00186A Global Link Digital Technology Co
-00186B Sambu Communics CO.
-00186C Neonode AB
-00186D Zhenjiang Sapphire Electronic Industry CO.
-00186E 3Com
-00186F Setha Industria Eletronica Ltda
-001870 E28 Shanghai Limited
-001871 Hewlett Packard
-001872 Expertise Engineering
-001873 Cisco Systems
-001874 Cisco Systems
-001875 AnaCise Testnology Pte
-001876 WowWee
-001877 Amplex A/S
-001878 Mackware GmbH
-001879 dSys
-00187A Wiremold
-00187B 4NSYS Co.
-00187C Intercross
-00187D Armorlink shanghai Co.
-00187E RGB Spectrum
-00187F Zodianet
-001880 Maxim Integrated Circuits
-001881 Buyang Electronics Industrial Co.
-001882 Huawei Technologies Co.
-001883 Formosa21
-001884 FON
-001885 Avigilon
-001886 El-tech
-001887 Metasystem SpA
-001888 Gotive a.s.
-001889 WinNet Solutions Limited
-00188A Infinova
-00188B Dell
-00188C Mobile Action Technology
-00188D Nokia Danmark A/S
-00188E Ekahau
-00188F Montgomery Technology
-001890 RadioCOM, s.r.o.
-001891 Zhongshan General K-mate Electronics Co.
-001892 ads-tec GmbH
-001893 Shenzhen Photon Broadband Technology Co.
-001894 zimocom
-001895 Hansun Technologies
-001896 Great Well Electronic
-001897 Jess-link Products Co.
-001898 Kingstate Electronics
-001899 ShenZhen jieshun Science&Technology Industry CO
-00189A Hana Micron
-00189B Thomson
-00189C Weldex
-00189D Navcast
-00189E Omnikey GmbH.
-00189F Lenntek
-0018A0 Cierma Ascenseurs
-0018A1 Tiqit Computers
-0018A2 XIP Technology AB
-0018A3 Zippy Technology
-0018A4 Motorola Mobile Devices
-0018A5 ADigit Technologies
-0018A6 Persistent Systems
-0018A7 Yoggie Security Systems
-0018A8 AnNeal Technology
-0018A9 Ethernet Direct
-0018AA Protec Fire Detection plc
-0018AB Beijing Lhwt Microelectronics
-0018AC Shanghai Jiao Da Hisys Technology Co.
-0018AD Nidec Sankyo
-0018AE TVT Co.
-0018AF Samsung Electronics Co.
-0018B0 Nortel
-0018B1 Blade Network Technologies
-0018B2 Adeunis RF
-0018B3 TEC WizHome Co.
-0018B4 Dawon Media
-0018B5 Magna Carta
-0018B6 S3C
-0018B7 D3 LED
-0018B8 New Voice International AG
-0018B9 Cisco Systems
-0018BA Cisco Systems
-0018BB Eliwell Controls srl
-0018BC ZAO NVP Bolid
-0018BD Shenzhen Dvbworld Technology CO.
-0018BE Ansa
-0018BF Essence Technology Solution
-0018C0 Motorola CHS
-0018C1 Almitec Informtica e Comrcio Ltda.
-0018C2 Firetide
-0018C3 C&S Microwave
-0018C4 Raba Technologies
-0018C5 Nokia Danmark A/S
-0018C6 OPW Fuel Management Systems
-0018C7 Real Time Automation
-0018C8 Isonas
-0018C9 EOps Technology Limited
-0018CA Viprinet GmbH
-0018CB Tecobest Technology Limited
-0018CC Axiohm SAS
-0018CD Erae Electronics Industry Co.
-0018CE Dreamtech Co.
-0018CF Baldor Electric Company
-0018D0 AtRoad, A Trimble Company
-0018D1 Siemens Home & Office Comm. Devices
-0018D2 High-Gain Antennas
-0018D3 Teamcast
-0018D4 Unified Display Interface SIG
-0018D5 Reigncom
-0018D6 Swirlnet A/S
-0018D7 Javad Navigation Systems
-0018D8 Arch Meter
-0018D9 Santosha Internatonal
-0018DA Amber Wireless Gmbh
-0018DB EPL Technology
-0018DC Prostar Co.
-0018DD Silicondust Engineering
-0018DE Intel
-0018DF The Morey
-0018E0 Anaveo
-0018E1 Verkerk Service Systemen
-0018E2 Topdata Sistemas de Automacao Ltda
-0018E3 Visualgate Systems
-0018E4 Yiguang
-0018E5 Adhoco AG
-0018E6 Computer Hardware Design SIA
-0018E7 Cameo Communications
-0018E8 Hacetron
-0018E9 Numata
-0018EA Alltec GmbH
-0018EB BroVis Wireless Networks
-0018EC Welding Technology
-0018ED Accutech Ultrasystems Co.
-0018EE Videology Imaging Solutions
-0018EF Escape Communications
-0018F0 Joytoto Co.
-0018F1 Chunichi Denshi Co.
-0018F2 Beijing Tianyu Communication Equipment Co.
-0018F3 Asustek Computer
-0018F4 EO Technics Co.
-0018F5 Shenzhen Streaming Video Technology Company Limited
-0018F6 Thomson Telecom Belgium
-0018F7 Kameleon Technologies
-0018F8 Cisco-Linksys
-0018F9 Vvond
-0018FA Yushin Precision Equipment Co.
-0018FB Compro Technology
-0018FC Altec Electronic AG
-0018FD Optimal Technologies International
-0018FE Hewlett Packard
-0018FF PowerQuattro Co.
-001900 Intelliverese - DBA Voicecom
-001901 F1media
-001902 Cambridge Consultants
-001903 Bigfoot Networks
-001904 WB Electronics Sp. z o.o.
-001905 Schrack Seconet AG
-001906 Cisco Systems
-001907 Cisco Systems
-001908 Duaxes
-001909 Devi A/S
-00190A Hasware
-00190B Southern Vision Systems
-00190C Encore Electronics
-00190D Ieee 1394c
-00190E Atech Technology Co.
-00190F Advansus
-001910 Knick Elektronische Messgeraete GmbH & Co. KG
-001911 Just In Mobile Information Technologies (Shanghai) Co.
-001912 Welcat
-001913 Chuang-Yi Network EquipmentLtd.
-001914 Winix Co.
-001915 Tecom Co.
-001916 PayTec AG
-001917 Posiflex
-001918 Interactive Wear AG
-001919 Astel
-00191A Irlink
-00191B Sputnik Engineering AG
-00191C Sensicast Systems
-00191D Nintendo Co.
-00191E Beyondwiz Co.
-00191F Microlink communications
-001920 Kume Electric Co.
-001921 Elitegroup Computer System Co.
-001922 CM Comandos Lineares
-001923 Phonex Korea Co.
-001924 Lbnl Engineering
-001925 Intelicis
-001926 BitsGen Co.
-001927 ImCoSys
-001928 Siemens AG, Transportation Systems
-001929 2m2b Montadora de Maquinas Bahia Brasil Ltda
-00192A Antiope Associates
-00192B Aclara RF Systems
-00192C Motorola Mobile Devices
-00192D Nokia
-00192E Spectral Instruments
-00192F Cisco Systems
-001930 Cisco Systems
-001931 Balluff GmbH
-001932 Gude Analog- und Digialsysteme GmbH
-001933 Strix Systems
-001934 Trendon Touch Technology
-001935 Duerr Dental GmbH & Co. KG
-001936 Sterlite Optical Technologies Limited
-001937 CommerceGuard AB
-001938 UMB Communications Co.
-001939 Gigamips
-00193A Oesolutions
-00193B Wilibox Deliberant Group
-00193C HighPoint Technologies Incorporated
-00193D GMC Guardian Mobility
-00193E Pirelli Broadband Solutions
-00193F RDI technology(Shenzhen) Co.
-001940 Rackable Systems
-001941 Pitney Bowes
-001942 ON Software International Limited
-001943 Belden
-001944 Fossil Partners
-001945 Ten-Tec
-001946 Cianet Industria e Comercio S/A
-001947 Scientific Atlanta, A Cisco Company
-001948 AireSpider Networks
-001949 Tentel Comtech CO.
-00194A Testo AG
-00194B Sagem Communication
-00194C Fujian Stelcom information & Technology CO.
-00194D Avago Technologies Sdn Bhd
-00194E Ultra Electronics - TCS (Tactical Communication Systems)
-00194F Nokia Danmark A/S
-001950 Harman Multimedia
-001951 Netcons, S.r.o.
-001952 Acogito Co.
-001953 Chainleader Communications
-001954 Leaf
-001955 Cisco Systems
-001956 Cisco Systems
-001957 Saafnet Canada
-001958 Bluetooth SIG
-001959 Staccato Communications
-00195A Jenaer Antriebstechnik GmbH
-00195B D-Link
-00195C Innotech
-00195D ShenZhen XinHuaTong Opto Electronics Co.
-00195E Motorola CHS
-00195F Valemount Networks
-001960 DoCoMo Systems
-001961 Blaupunkt GmbH
-001962 Commerciant
-001963 Sony Ericsson Mobile Communications AB
-001964 Doorking
-001965 YuHua TelTech (ShangHai) Co.
-001966 Asiarock Technology Limited
-001967 Teldat Sp.J.
-001968 Digital Video Networks(Shanghai) CO.
-001969 Nortel
-00196A MikroM GmbH
-00196B Danpex
-00196C Etrovision Technology
-00196D Raybit Systems Korea
-00196E Metacom (Pty)
-00196F SensoPart GmbH
-001970 Z-Com
-001971 Guangzhou Unicomp Technology Co.
-001972 Plexus (Xiamen) Co.
-001973 Zeugma Systems
-001974 AboCom Systems
-001975 Beijing Huisen networks technology
-001976 Xipher Technologies
-001977 Aerohive Networks
-001978 Datum Systems
-001979 Nokia Danmark A/S
-00197A MAZeT GmbH
-00197B Picotest
-00197C Riedel Communications GmbH
-00197D Hon Hai Precision Ind. Co.
-00197E Hon Hai Precision Ind. Co.
-00197F Plantronics
-001980 Gridpoint Systems
-001981 Vivox
-001982 SmarDTV
-001983 CCT R&D Limited
-001984 Estic
-001985 IT Watchdogs
-001986 Cheng Hongjian
-001987 Panasonic Mobile Communications Co.
-001988 Wi2Wi
-001989 Sonitrol
-00198A Northrop Grumman Systems
-00198B Novera Optics Korea
-00198C iXSea
-00198D Ocean Optics
-00198E Oticon A/S
-00198F Alcatel Bell N.V.
-001990 ELM Data Co.
-001991 avinfo
-001992 Bluesocket
-001993 Changshu Switchgear MFG. Co.,Ltd. (Former Changshu Switchgea
-001994 Jorjin Technologies
-001995 Jurong Hi-Tech (Suzhou)Co.ltd
-001996 TurboChef Technologies
-001997 Soft Device Sdn Bhd
-001998 Sato
-001999 Fujitsu Technology Solutions
-00199A Edo-evi
-00199B Diversified Technical Systems
-00199C Ctring
-00199D Vizio
-00199E Showadenshi Electronics
-00199F DKT A/S
-0019A0 Nihon Data Systens
-0019A1 LG Information & COMM.
-0019A2 Orion Tele-equipments PVT
-0019A3 asteel electronique atlantique
-0019A4 Austar Technology (hang zhou) Co.
-0019A5 RadarFind
-0019A6 Motorola CHS
-0019A7 Itu-t
-0019A8 WiQuest Communications
-0019A9 Cisco Systems
-0019AA Cisco Systems
-0019AB Raycom CO
-0019AC GSP Systems
-0019AD Bobst SA
-0019AE Hopling Technologies b.v.
-0019AF Rigol Technologies
-0019B0 HanYang System
-0019B1 Arrow7
-0019B2 XYnetsoft Co.
-0019B3 Stanford Research Systems
-0019B4 VideoCast
-0019B5 Famar Fueguina S.A.
-0019B6 Euro Emme s.r.l.
-0019B7 Nokia Danmark A/S
-0019B8 Boundary Devices
-0019B9 Dell
-0019BA Paradox Security Systems
-0019BB Hewlett Packard
-0019BC Electro Chance SRL
-0019BD New Media Life
-0019BE Altai Technologies Limited
-0019BF Citiway technology Co.
-0019C0 Motorola Mobile Devices
-0019C1 Alps Electric Co.
-0019C2 Equustek Solutions
-0019C3 Qualitrol
-0019C4 Infocrypt
-0019C5 Sony Computer Entertainment,
-0019C6 ZTE
-0019C7 Cambridge Industries(Group) Co.
-0019C8 AnyDATA
-0019C9 S&C Electric Company
-0019CA Broadata Communications
-0019CB ZyXEL Communications
-0019CC RCG (HK)
-0019CD Chengdu ethercom information technology
-0019CE Progressive Gaming International
-0019CF Salicru
-0019D0 Cathexis
-0019D1 Intel
-0019D2 Intel
-0019D3 Trak Microwave
-0019D4 ICX Technologies
-0019D5 IP Innovations
-0019D6 LS Cable
-0019D7 Fortunetek CO.
-0019D8 Maxfor
-0019D9 Zeutschel GmbH
-0019DA Welltrans O&E Technology Co.
-0019DB Micro-star International CO.
-0019DC Enensys Technologies
-0019DD FEI-Zyfer
-0019DE Mobitek
-0019DF Thomson
-0019E0 Tp-link Technologies Co.
-0019E1 Nortel
-0019E2 Juniper Networks
-0019E3 Apple Computer
-0019E4 2Wire
-0019E5 Lynx Studio Technology
-0019E6 Toyo Medic Co.
-0019E7 Cisco Systems
-0019E8 Cisco Systems
-0019E9 S-Information Technolgy, Co.
-0019EA TeraMage Technologies Co.
-0019EB Pyronix
-0019EC Sagamore Systems
-0019ED Axesstel
-0019EE Carlo Gavazzi Controls Spa-controls Division
-0019EF Shenzhen Linnking Electronics Co.
-0019F0 Unionman Technology Co.
-0019F1 Star Communication Network Technology Co.
-0019F2 Teradyne K.K.
-0019F3 Telematrix
-0019F4 Convergens Oy
-0019F5 Imagination Technologies
-0019F6 Acconet (PTE)
-0019F7 Onset Computer
-0019F8 Embedded Systems Design
-0019F9 TDK-Lambda
-0019FA Cable Vision Electronics CO.
-0019FB Amstrad PLC
-0019FC PT. Ufoakses Sukses Luarbiasa
-0019FD Nintendo Co.
-0019FE Shenzhen Seecomm Technology Co.
-0019FF Finnzymes
-001A00 Matrix
-001A01 Smiths Medical
-001A02 Secure Care Products
-001A03 Angel Electronics Co.
-001A04 Interay Solutions BV
-001A05 Optibase
-001A06 OpVista
-001A07 Arecont Vision
-001A08 Dalman Technical Services
-001A09 Wayfarer Transit Systems
-001A0A Adaptive Micro-Ware
-001A0B Bona Technology
-001A0C Swe-Dish Satellite Systems AB
-001A0D HandHeld entertainment
-001A0E Cheng Uei Precision Industry Co.
-001A0F Sistemas Avanzados de Control
-001A10 Lucent Trans Electronics Co.
-001A11 Google
-001A12 Essilor
-001A13 Wanlida Group Co.
-001A14 Xin Hua Control Engineering Co.
-001A15 gemalto e-Payment
-001A16 Nokia Danmark A/S
-001A17 Teak Technologies
-001A18 Advanced Simulation Technology
-001A19 Computer Engineering Limited
-001A1A Gentex/Electro-Acoustic Products
-001A1B Motorola Mobile Devices
-001A1C GT&T Engineering Pte
-001A1D PChome Online
-001A1E Aruba Networks
-001A1F Coastal Environmental Systems
-001A20 Cmotech Co.
-001A21 Indac B.V.
-001A22 eq-3 GmbH
-001A23 Ice Qube
-001A24 Galaxy Telecom Technologies
-001A25 Delta Dore
-001A26 Deltanode Solutions AB
-001A27 Ubistar
-001A28 Aswt Co., Taiwan Branch H.K.
-001A29 Techsonic Industries d/b/a Humminbird
-001A2A Arcadyan Technology
-001A2B Ayecom Technology Co.
-001A2C Satec Co.
-001A2D The Navvo Group
-001A2E Ziova Coporation
-001A2F Cisco Systems
-001A30 Cisco Systems
-001A31 Scan Coin Industries AB
-001A32 Activa Multimedia
-001A33 ASI Communications
-001A34 Konka Group Co.
-001A35 Bartec Gmbh
-001A36 Aipermon GmbH & Co. KG
-001A37 Lear
-001A38 Sanmina-SCI
-001A39 Merten GmbH&CoKG
-001A3A Dongahelecomm
-001A3B Doah Elecom
-001A3C Technowave
-001A3D Ajin Vision Co.
-001A3E Faster Technology
-001A3F intelbras
-001A40 A-four Tech CO.
-001A41 Inocova Co.
-001A42 Techcity Technology co.
-001A43 Logical Link Communications
-001A44 JWTrading Co.
-001A45 GN Netcom as
-001A46 Digital Multimedia Technology Co.
-001A47 Agami Systems
-001A48 Takacom
-001A49 Micro Vision Co.
-001A4A Qumranet
-001A4B Hewlett Packard
-001A4C Crossbow Technology
-001A4D Giga-byte Technology Co.
-001A4E NTI AG / LinMot
-001A4F AVM GmbH
-001A50 PheeNet Technology
-001A51 Alfred Mann Foundation
-001A52 Meshlinx Wireless
-001A53 Zylaya
-001A54 Hip Shing Electronics
-001A55 ACA-Digital
-001A56 ViewTel Co
-001A57 Matrix Design Group
-001A58 Celectronic GmbH
-001A59 Ircona
-001A5A Korea Electric Power Data Network (KDN) Co.
-001A5B NetCare Service Co.
-001A5C Euchner GmbH+Co. KG
-001A5D Mobinnova
-001A5E Thincom Technology Co.
-001A5F KitWorks.fi
-001A60 Wave Electronics Co.
-001A61 PacStar
-001A62 Data Robotics, Incorporated
-001A63 Elster Electricity
-001A64 IBM
-001A65 Seluxit
-001A66 Motorola CHS
-001A67 Infinite QL Sdn Bhd
-001A68 Weltec Enterprise Co.
-001A69 Wuhan Yangtze Optical Technology CO.
-001A6A Tranzas
-001A6B USI
-001A6C Cisco Systems
-001A6D Cisco Systems
-001A6E Impro Technologies
-001A6F MI.TEL s.r.l.
-001A70 Cisco-Linksys
-001A71 Diostech Co.
-001A72 Mosart Semiconductor
-001A73 Gemtek Technology Co.
-001A74 Procare International Co
-001A75 Sony Ericsson Mobile Communications
-001A76 SDT information Technology Co.
-001A77 Motorola Mobile Devices
-001A78 ubtos
-001A79 Telecomunication Technologies
-001A7A Lismore Instruments Limited
-001A7B Teleco
-001A7C Hirschmann Automation and Control B.V.
-001A7D cyber-blue(HK)Ltd
-001A7E LN Srithai Comm
-001A7F GCI Science&Technology Co.
-001A80 Sony
-001A81 Zelax
-001A82 Proba Building Automation Co.
-001A83 Pegasus Technologies
-001A84 V One Multimedia Pte
-001A85 NV Michel Van de Wiele
-001A86 AdvancedIO Systems
-001A87 Canhold International Limited
-001A88 Venergy
-001A89 Nokia Danmark A/S
-001A8A Samsung Electronics Co.
-001A8B Chunil Electric IND.
-001A8C Astaro AG
-001A8D Avecs Bergen Gmbh
-001A8E 3Way Networks
-001A8F Nortel
-001A90 Trpico Sistemas e Telecomunicaes da Amaznia LTDA.
-001A91 FusionDynamic
-001A92 Asustek Computer
-001A93 Erco Leuchten Gmbh
-001A94 Votronic GmbH
-001A95 Hisense Mobile Communications Technoligy Co.
-001A96 Ecler S.A.
-001A97 fitivision technology
-001A98 Asotel Communication Limited Taiwan Branch
-001A99 Smarty (HZ) Information Electronics Co.
-001A9A Skyworth Digital technology(shenzhen)co.ltd.
-001A9B Adec & Parter AG
-001A9C RightHand Technologies
-001A9D Skipper Wireless
-001A9E Icon Digital International Limited
-001A9F A-Link Europe
-001AA0 Dell
-001AA1 Cisco Systems
-001AA2 Cisco Systems
-001AA3 Delorme
-001AA4 Future University-Hakodate
-001AA5 BRN Phoenix
-001AA6 Telefunken Radio Communication Systems GmbH &CO.KG
-001AA7 Torian Wireless
-001AA8 Mamiya Digital Imaging Co.
-001AA9 Fujian Star-net Communication Co.
-001AAA Analogic
-001AAB eWings s.r.l.
-001AAC Corelatus AB
-001AAD Motorola CHS
-001AAE Savant Systems
-001AAF Blusens Technology
-001AB0 Signal Networks Pvt.,
-001AB1 Asia Pacific Satellite Industries Co.
-001AB2 Cyber Solutions
-001AB3 Visionite
-001AB4 Ffei
-001AB5 Home Network System
-001AB6 Luminary Micro
-001AB7 Ethos Networks
-001AB8 Anseri
-001AB9 PMC
-001ABA Caton Overseas Limited
-001ABB Fontal Technology Incorporation
-001ABC U4EA Technologies
-001ABD Impatica
-001ABE Computer Hi-tech
-001ABF Trumpf Laser Marking Systems AG
-001AC0 Joybien Technologies CO.
-001AC1 3Com
-001AC2 YEC Co.
-001AC3 Scientific-Atlanta
-001AC4 2Wire
-001AC5 BreakingPoint Systems
-001AC6 Micro Control Designs
-001AC7 Unipoint
-001AC8 ISL (Instrumentation Scientifique de Laboratoire)
-001AC9 Suzuken Co.
-001ACA Tilera
-001ACB Autocom Products
-001ACC Celestial Semiconductor
-001ACD Tidel Engineering LP
-001ACE Yupiteru
-001ACF C.T. Elettronica
-001AD0 Albis Technologies AG
-001AD1 Fargo CO.
-001AD2 Eletronica Nitron Ltda
-001AD3 Vamp
-001AD4 iPOX Technology Co.
-001AD5 KMC Chain Industrial CO.
-001AD6 Jiagnsu Aetna Electric Co.
-001AD7 Christie Digital Systems
-001AD8 AlsterAero GmbH
-001AD9 International Broadband Electric Communications
-001ADA Biz-2-Me
-001ADB Motorola Mobile Devices
-001ADC Nokia Danmark A/S
-001ADD PePWave
-001ADE Motorola CHS
-001ADF Interactivetv Limited
-001AE0 Mythology Tech Express
-001AE1 Edge Access
-001AE2 Cisco Systems
-001AE3 Cisco Systems
-001AE4 Liposonix,
-001AE5 Mvox Technologies
-001AE6 Atlanta Advanced Communications Holdings Limited
-001AE7 Aztek Networks
-001AE8 Siemens Enterprise Communications GmbH & Co. KG
-001AE9 Nintendo Co.
-001AEA Radio Terminal Systems
-001AEB Allied Telesis K.K.
-001AEC Keumbee Electronics Co.
-001AED Incotec Gmbh
-001AEE Shenztech
-001AEF Loopcomm Technology
-001AF0 Alcatel - IPD
-001AF1 Embedded Artists AB
-001AF2 Dynavisions Schweiz AG
-001AF3 Samyoung Electronics
-001AF4 Handreamnet
-001AF5 Pentaone. CO.
-001AF6 Woven Systems
-001AF7 dataschalt e+a GmbH
-001AF8 Copley Controls
-001AF9 AeroVIronment (AV)
-001AFA Welch Allyn
-001AFB Joby
-001AFC ModusLink
-001AFD Evolis
-001AFE Sofacreal
-001AFF Wizyoung Tech.
-001B00 Neopost Technologies
-001B01 Applied Radio Technologies
-001B02 EDLtd
-001B03 Action Technology (SZ) Co.
-001B04 Affinity International S.p.a
-001B05 Young Media Concepts GmbH
-001B06 Ateliers R. Laumonier
-001B07 Mendocino Software
-001B08 Danfoss Drives A/S
-001B09 Matrix Telecom Pvt.
-001B0A Intelligent Distributed Controls
-001B0B Phidgets
-001B0C Cisco Systems
-001B0D Cisco Systems
-001B0E InoTec GmbH Organisationssysteme
-001B0F Petratec
-001B10 ShenZhen Kang Hui Technology Co.
-001B11 D-Link
-001B12 Apprion
-001B13 Icron Technologies
-001B14 Carex Lighting Equipment Factory
-001B15 Voxtel
-001B16 Celtro
-001B17 Palo Alto Networks
-001B18 Tsuken Electric Ind. Co.
-001B19 Ieee 1588 Standard
-001B1A e-trees Japan
-001B1B Siemens AG,
-001B1C Coherent
-001B1D Phoenix International Co.
-001B1E Hart Communication Foundation
-001B1F Delta - Danish Electronics, Light & Acoustics
-001B20 TPine Technology
-001B21 Intel Corporate
-001B22 Palit Microsystems ( H.K.)
-001B23 SimpleComTools
-001B24 Quanta Computer
-001B25 Nortel
-001B26 RON-Telecom ZAO
-001B27 Merlin CSI
-001B28 Polygon
-001B29 Avantis.Co.
-001B2A Cisco Systems
-001B2B Cisco Systems
-001B2C Atron Electronic Gmbh
-001B2D Med-Eng Systems
-001B2E Sinkyo Electron
-001B2F Netgear
-001B30 Solitech
-001B31 Neural Image. Co.
-001B32 QLogic
-001B33 Nokia Danmark A/S
-001B34 Focus System
-001B35 Chongqing Jinou Science & Technology Development Co.
-001B36 Tsubata Engineering Co.,Ltd. (Head Office)
-001B37 Computec Oy
-001B38 Compal Information (kunshan) CO.
-001B39 Proxicast
-001B3A Sims
-001B3B Yi-Qing CO.
-001B3C Software Technologies Group
-001B3D EuroTel Spa
-001B3E Curtis
-001B3F ProCurve Networking by HP
-001B40 Network Automation mxc AB
-001B41 General Infinity Co.
-001B42 Wise & Blue
-001B43 Beijing DG Telecommunications equipment Co.
-001B44 SanDisk
-001B45 ABB AS, Division Automation Products
-001B46 Blueone Technology Co.
-001B47 Futarque A/S
-001B48 Shenzhen Lantech Electronics Co.
-001B49 Roberts Radio limited
-001B4A W&W Communications
-001B4B Sanion Co.
-001B4C Signtech
-001B4D Areca Technology
-001B4E Navman New Zealand
-001B4F Avaya
-001B50 Nizhny Novgorod Factory Named After M.frunze, Fsue (nzif)
-001B51 Vector Technology
-001B52 Motorola Mobile Devices
-001B53 Cisco Systems
-001B54 Cisco Systems
-001B55 Hurco Automation
-001B56 Tehuti Networks
-001B57 Semindia Systems Private Limited
-001B58 ACE CAD Enterprise Co.
-001B59 Sony Ericsson Mobile Communications AB
-001B5A Apollo Imaging Technologies
-001B5B 2Wire
-001B5C Azuretec Co.
-001B5D Vololink
-001B5E BPL Limited
-001B5F Alien Technology
-001B60 Navigon AG
-001B61 Digital Acoustics
-001B62 JHT Optoelectronics Co.
-001B63 Apple Computer
-001B64 IsaacLandKorea Co.
-001B65 China Gridcom Co.
-001B66 Sennheiser electronic GmbH & Co. KG
-001B67 Ubiquisys
-001B68 Modnnet Co.
-001B69 Equaline
-001B6A Powerwave Technologies Sweden AB
-001B6B Swyx Solutions AG
-001B6C LookX Digital Media BV
-001B6D Midtronics
-001B6E Anue Systems
-001B6F Teletrak
-001B70 IRI Ubiteq
-001B71 Telular
-001B72 Sicep s.p.a.
-001B73 DTL Broadcast
-001B74 MiraLink
-001B75 Hypermedia Systems
-001B76 Ripcode
-001B77 Intel Corporate
-001B78 Hewlett Packard
-001B79 Faiveley Transport
-001B7A Nintendo Co.
-001B7B The Tintometer
-001B7C A & R Cambridge
-001B7D CXR Anderson Jacobson
-001B7E Beckmann GmbH
-001B7F TMN Technologies Telecomunicacoes Ltda
-001B80 Lord
-001B81 Dataq Instruments
-001B82 Taiwan Semiconductor Co.
-001B83 Finsoft
-001B84 Scan Engineering Telecom
-001B85 MAN Diesel SE
-001B86 Bosch Access Systems GmbH
-001B87 Deepsound Tech. Co.
-001B88 Divinet Access Technologies
-001B89 Emza Visual Sense
-001B8A 2M Electronic A/S
-001B8B NEC AccessTechnica
-001B8C JMicron Technology
-001B8D Electronic Computer Systems
-001B8E Hulu Sweden AB
-001B8F Cisco Systems
-001B90 Cisco Systems
-001B91 Efkon AG
-001B92 l-acoustics
-001B93 JC Decaux SA DNT
-001B94 T.E.M.A. S.p.A.
-001B95 Video Systems SRL
-001B96 Snif Labs
-001B97 Violin Technologies
-001B98 Samsung Electronics Co.
-001B99 KS System GmbH
-001B9A Apollo Fire Detectors
-001B9B Hose-McCann Communications
-001B9C Satel sp. z o.o.
-001B9D Novus Security Sp. z o.o.
-001B9E Askey Computer
-001B9F Calyptech
-001BA0 Awox
-001BA1 mic AB
-001BA2 IDS Imaging Development Systems GmbH
-001BA3 Flexit Group GmbH
-001BA4 S.A.E Afikim
-001BA5 MyungMin Systems
-001BA6 intotech
-001BA7 Lorica Solutions
-001BA8 Ubi&mobi
-001BA9 Brother Industries
-001BAA XenICs nv
-001BAB Telchemy, Incorporated
-001BAC Curtiss Wright Controls Embedded Computing
-001BAD iControl Incorporated
-001BAE Micro Control Systems
-001BAF Nokia Danmark A/S
-001BB0 Bharat Electronics
-001BB1 Wistron Neweb
-001BB2 Intellect International NV
-001BB3 Condalo GmbH
-001BB4 Airvod Limited
-001BB5 ZF Electronics GmbH
-001BB6 Bird Electronic
-001BB7 Alta Heights Technology
-001BB8 Blueway Electronic Co;ltd
-001BB9 Elitegroup Computer System Co.
-001BBA Nortel
-001BBB RFTech Co.
-001BBC Silver Peak Systems
-001BBD FMC Kongsberg Subsea AS
-001BBE Icop Digital
-001BBF Sagem Communication
-001BC0 Juniper Networks
-001BC1 Holux Technology
-001BC2 Integrated Control Technology Limitied
-001BC3 Mobisolution Co.
-001BC4 Ultratec
-001BC5 Ieee Registration Authority
-001BC6 Strato Rechenzentrum AG
-001BC7 StarVedia Technology
-001BC8 Miura Co.
-001BC9 FSN Display
-001BCA Beijing Run Technology Company
-001BCB Pempek Systems
-001BCC Kingtek Cctv Alliance CO.
-001BCD Daviscomms (S) PTE
-001BCE Measurement Devices
-001BCF Dataupia
-001BD0 Identec Solutions
-001BD1 Sogestmatic
-001BD2 Ultra-x Asia Pacific
-001BD3 Matsushita Electric Panasonic AVC
-001BD4 Cisco Systems
-001BD5 Cisco Systems
-001BD6 Kelvin Hughes
-001BD7 Scientific Atlanta, A Cisco Company
-001BD8 DVTel
-001BD9 Edgewater Computer Systems
-001BDA UTStarcom
-001BDB Valeo Vecs
-001BDC Vencer Co.
-001BDD Motorola CHS
-001BDE Renkus-Heinz
-001BDF Iskra MIS
-001BE0 Telenot Electronic Gmbh
-001BE1 ViaLogy
-001BE2 AhnLab
-001BE3 Health Hero Network
-001BE4 Townet SRL
-001BE5 802automation Limited
-001BE6 VR AG
-001BE7 Postek Electronics Co.
-001BE8 Ultratronik GmbH
-001BE9 Broadcom
-001BEA Nintendo Co.
-001BEB DMP Electronics
-001BEC Netio Technologies Co.
-001BED Foundry Networks
-001BEE Nokia Danmark A/S
-001BEF Blossoms Digital Technology Co.
-001BF0 Value Platforms Limited
-001BF1 Nanjing SilverNet Software Co.
-001BF2 Kworld Computer CO.
-001BF3 Transradio Sendersysteme Berlin AG
-001BF4 Kenwin Industrial(hk)
-001BF5 Tellink Sistemas de Telecomunicacin S.L.
-001BF6 Conwise Technology
-001BF7 Lund IP Products AB
-001BF8 Digitrax
-001BF9 Intellitect Water
-001BFA G.i.N. mbH
-001BFB Alps Electric Co.
-001BFC Asustek Computer
-001BFD Dignsys
-001BFE Zavio
-001BFF Millennia Media
-001C00 Entry Point
-001C01 ABB Oy Drives
-001C02 Atto Devices
-001C03 Betty TV Technology AG
-001C04 Airgain
-001C05 Nonin Medical
-001C06 Siemens Numerical Control, Nanjing
-001C07 Cwlinux Limited
-001C08 Anystream
-001C09 SAE Electronic Co.
-001C0A Shenzhen AEE Technology Co.
-001C0B SmartAnt Telecom
-001C0C Tanita
-001C0D G-Technology
-001C0E Cisco Systems
-001C0F Cisco Systems
-001C10 Cisco-Linksys
-001C11 Motorola CHS
-001C12 Motorola Mobile Devices
-001C13 Optsys Technology CO.
-001C14 VMware
-001C15 TXP
-001C16 ThyssenKrupp Elevator
-001C17 Nortel
-001C18 Sicert S.r.L.
-001C19 secunet Security Networks AG
-001C1A Thomas Instrumentation
-001C1B Hyperstone GmbH
-001C1C Center Communication Systems GmbH
-001C1D Chenzhou Gospell Digital Technology Co.
-001C1E emtrion GmbH
-001C1F Quest Retail Technology
-001C20 CLB Benelux
-001C21 Nucsafe
-001C22 Aeris Elettronica s.r.l.
-001C23 Dell
-001C24 Formosa Wireless Systems
-001C25 Hon Hai Precision Ind. Co.
-001C26 Hon Hai Precision Ind. Co.
-001C27 Sunell Electronics Co.
-001C28 Sphairon Access Systems GmbH
-001C29 Core Digital Electronics CO.
-001C2A Envisacor Technologies
-001C2B Alertme.com Limited
-001C2C Synapse
-001C2D FlexRadio Systems
-001C2E ProCurve Networking by HP
-001C2F Pfister GmbH
-001C30 Mode Lighting (UK
-001C31 Mobile XP Technology Co.
-001C32 Telian
-001C33 Sutron
-001C34 Huey Chiao International CO.
-001C35 Nokia Danmark A/S
-001C36 iNEWiT NV
-001C37 Callpod
-001C38 Bio-Rad Laboratories
-001C39 S Netsystems
-001C3A Element Labs
-001C3B AmRoad Technology
-001C3C Seon Design
-001C3D WaveStorm
-001C3E ECKey Limited
-001C3F International Police Technologies
-001C40 VDG-Security bv
-001C41 scemtec Transponder Technology GmbH
-001C42 Parallels
-001C43 Samsung Electronics Co.
-001C44 Bosch Security Systems BV
-001C45 Chenbro Micom Co.
-001C46 Qtum
-001C47 Hangzhou Hollysys Automation Co.
-001C48 WiDeFi
-001C49 Zoltan Technology
-001C4A AVM GmbH
-001C4B Gener8
-001C4C Petrotest Instruments
-001C4D Zeetoo
-001C4E Tasa International Limited
-001C4F Macab AB
-001C50 TCL Technoly Electronics(Huizhou)Co.
-001C51 Celeno Communications
-001C52 Visionee SRL
-001C53 Synergy Lighting Controls
-001C54 Hillstone Networks
-001C55 Shenzhen Kaifa Technology Co.
-001C56 Pado Systems
-001C57 Cisco Systems
-001C58 Cisco Systems
-001C59 Devon IT
-001C5A Advanced Relay
-001C5B Chubb Electronic Security Systems
-001C5C Integrated Medical Systems
-001C5D Leica Microsystems
-001C5E Aston France
-001C5F Winland Electronics
-001C60 CSP Frontier Technologies
-001C61 Galaxy Technology (HK)
-001C62 LG Electronics
-001C63 Truen
-001C64 Cellnet+Hunt
-001C65 JoeScan
-001C66 Ucamp Co.
-001C67 Pumpkin Networks
-001C68 Anhui Sun Create Electronics Co.
-001C69 Packet Vision
-001C6A Weiss Engineering
-001C6B Covax Co.
-001C6C Jabil Circuit (Guangzhou) Limited
-001C6D Kyohritsu Electronic Industry CO.
-001C6E Newbury Networks
-001C6F Emfit
-001C70 Novacomm Ltda
-001C71 Emergent Electronics
-001C72 Mayer & Cie GmbH & Co KG
-001C73 Arista Networks
-001C74 Syswan Technologies
-001C75 RF Systems GmbH
-001C76 The Wandsworth Group
-001C77 Prodys
-001C78 Wyplay SAS
-001C79 Cohesive Financial Technologies
-001C7A Perfectone Netware Company
-001C7B Castlenet Technology
-001C7C Perq Systems
-001C7D Excelpoint Manufacturing Pte
-001C7E Toshiba
-001C7F Check Point Software Technologies
-001C80 New Business Division/Rhea-Information CO.
-001C81 NextGen Venturi
-001C82 Genew Technologies
-001C83 New Level Telecom Co.
-001C84 STL Solution Co.
-001C85 Eunicorn
-001C86 Cranite Systems
-001C87 Uriver
-001C88 Transystem
-001C89 Force Communications
-001C8A Verari Systems
-001C8B MJ Innovations
-001C8C Dial Technology
-001C8D Mesa Imaging
-001C8E Alcatel-Lucent IPD
-001C8F Advanced Electronic Design
-001C90 Empacket
-001C91 Gefen
-001C92 Tervela
-001C93 ExaDigm
-001C94 LI-COR Biosciences
-001C95 Opticomm
-001C96 Linkwise Technology Pte
-001C97 Enzytek Technology,
-001C98 Lucky Technology (hk) Company Limited
-001C99 Shunra Software
-001C9A Nokia Danmark A/S
-001C9B Feig Electronic Gmbh
-001C9C Nortel
-001C9D Liecthi AG
-001C9E Dualtech IT AB
-001C9F Razorstream
-001CA0 Production Resource Group
-001CA1 Akamai Technologies
-001CA2 Pirelli Broadband Solutions
-001CA3 Terra
-001CA4 Sony Ericsson Mobile Communications
-001CA5 Zygo
-001CA6 Win4NET
-001CA7 International Quartz Limited
-001CA8 AirTies Wireless Networks
-001CA9 Audiomatica Srl
-001CAA Bellon
-001CAB Meyer Sound Laboratories
-001CAC Qniq Technology
-001CAD Wuhan Telecommunication Devices Co.
-001CAE WiChorus
-001CAF Plato Networks
-001CB0 Cisco Systems
-001CB1 Cisco Systems
-001CB2 BPT SPA
-001CB3 Apple
-001CB4 Iridium Satellite
-001CB5 Neihua Network Technology Co.,LTD.(NHN)
-001CB6 Duzon CNT Co.
-001CB7 USC DigiArk
-001CB8 CBC Co.
-001CB9 Kwang Sung Electronics CO.
-001CBA VerScient
-001CBB MusicianLink
-001CBC CastGrabber
-001CBD Ezze Mobile Tech.
-001CBE Nintendo Co.
-001CBF Intel Corporate
-001CC0 Intel Corporate
-001CC1 Motorola Mobile Devices
-001CC2 Part II Research
-001CC3 Pace Micro Technology plc
-001CC4 Hewlett Packard
-001CC5 3com
-001CC6 ProStor Systems
-001CC7 Rembrandt Technologies, D/b/a Remstream
-001CC8 Industronic Industrie-electronic Gmbh & Co. KG
-001CC9 Kaise Electronic Technology Co.
-001CCA Shanghai Gaozhi Science & Technology Development Co.
-001CCB Forth Public Company Limited
-001CCC Research In Motion Limited
-001CCD Alektrona
-001CCE By Techdesign
-001CCF Limetek
-001CD0 Circleone Co.
-001CD1 Waves Audio
-001CD2 King Champion (Hong Kong) Limited
-001CD3 ZP Engineering SEL
-001CD4 Nokia Danmark A/S
-001CD5 ZeeVee
-001CD6 Nokia Danmark A/S
-001CD7 Harman/Becker Automotive Systems GmbH
-001CD8 BlueAnt Wireless
-001CD9 GlobalTop Technology
-001CDA Exegin Technologies Limited
-001CDB Carpoint Co.
-001CDC Custom Computer Services
-001CDD Cowbell Engineering CO.
-001CDE Interactive Multimedia eXchange
-001CDF Belkin International
-001CE0 Dasan TPS
-001CE1 Indra Sistemas
-001CE2 Attero Tech
-001CE3 Optimedical Systems
-001CE4 EleSy JSC
-001CE5 MBS Electronic Systems GmbH
-001CE6 Innes
-001CE7 Rocon PLC Research Centre
-001CE8 Cummins
-001CE9 Galaxy Technology Limited
-001CEA Scientific-Atlanta
-001CEB Nortel
-001CEC Mobilesoft (Aust.)
-001CED Environnement SA
-001CEE Sharp
-001CEF Primax Electronics
-001CF0 D-Link
-001CF1 SUPoX Technology Co.
-001CF2 Tenlon Technology Co.
-001CF3 EVS Broadcast Equipment
-001CF4 Media Technology Systems
-001CF5 Wiseblue Technology Limited
-001CF6 Cisco Systems
-001CF7 AudioScience
-001CF8 Parade Technologies
-001CF9 Cisco Systems
-001CFA Alarm.com
-001CFB Motorola CHS
-001CFC Suminet Communication Technologies (Shanghai) Co.
-001CFD Universal Electronics
-001CFE Quartics
-001CFF Napera Networks
-001D00 Brivo Systems
-001D01 Neptune Digital
-001D02 Cybertech Telecom Development
-001D03 Design Solutions
-001D04 Zipit Wireless
-001D05 iLight
-001D06 HM Electronics
-001D07 Shenzhen Sang Fei Consumer Communications Co.
-001D08 Jiangsu Yinhe Electronics CO.
-001D09 Dell
-001D0A Davis Instruments
-001D0B Power Standards Lab
-001D0C MobileCompia
-001D0D Sony Computer Entertainment
-001D0E Agapha Technology co.
-001D0F Tp-link Technologies Co.
-001D10 LightHaus Logic
-001D11 Analogue & Micro
-001D12 Rohm CO.
-001D13 NextGTV
-001D14 Speradtone Information Technology Limited
-001D15 Shenzhen Dolphin Electronic Co.
-001D16 Efixo
-001D17 Digital Sky
-001D18 Power Innovation GmbH
-001D19 Arcadyan Technology
-001D1A OvisLink S.A.
-001D1B Sangean Electronics
-001D1C Gennet s.a.
-001D1D Inter-M
-001D1E Kyushu TEN Co.
-001D1F Siauliu Tauro Televizoriai
-001D20 Comtrend CO.
-001D21 Alcad SL
-001D22 Foss Analytical A/S
-001D23 Sensus Metering Systems
-001D24 Aclara Power-Line Systems
-001D25 Samsung Electronics Co.
-001D26 Rockridgesound Technology Co.
-001D27 Nac-intercom
-001D28 Sony Ericsson Mobile Communications AB
-001D29 Doro AB
-001D2A Tideway Electronic
-001D2B Wuhan Pont Technology CO.
-001D2C Wavetrend Technologies (Pty) Limited
-001D2D Pylone
-001D2E Ruckus Wireless
-001D2F QuantumVision
-001D30 YX Wireless S.A.
-001D31 Highpro International R&D Co
-001D32 Longkay Communication & Technology (Shanghai) Co.
-001D33 Maverick Systems
-001D34 Syris Technology
-001D35 Viconics Electronics
-001D36 Electronics OF India Limited
-001D37 Thales-Panda Transportation System
-001D38 Seagate Technology
-001D39 Moohadigital CO.
-001D3A mh acoustics
-001D3B Nokia Danmark A/S
-001D3C Muscle
-001D3D Avidyne
-001D3E Saka Techno Science Co.
-001D3F Mitron
-001D40 Living Independently Group
-001D41 Hardy Instruments
-001D42 Nortel
-001D43 Shenzhen G-link Digital Technology Co.
-001D44 Krohne
-001D45 Cisco Systems
-001D46 Cisco Systems
-001D47 Covote GmbH & Co KG
-001D48 Sensor-Technik Wiedemann GmbH
-001D49 Innovation Wireless
-001D4A Carestream Health
-001D4B Grid Connect
-001D4C Alcatel-Lucent
-001D4D Adaptive Recognition Hungary
-001D4E TCM Mobile
-001D4F Apple Computer
-001D50 Spinetix SA
-001D51 GE Energy
-001D52 Defzone B.V.
-001D53 S&O Electronics (Malaysia) Sdn. Bhd.
-001D54 Sunnic Technology & Merchandise
-001D55 Zantaz
-001D56 Kramer Electronics
-001D57 Caetec Messtechnik
-001D58 CQ
-001D59 Mitra Energy & Infrastructure
-001D5A 2Wire
-001D5B Tecvan Informatica Ltda
-001D5C Tom Communication Industrial Co.
-001D5D Control Dynamics
-001D5E Coming Media
-001D5F Overspeed Sarl
-001D60 Asustek Computer
-001D61 BIJ
-001D62 InPhase Technologies
-001D63 Miele & Cie. KG
-001D64 Adam Communications Systems Int
-001D65 Microwave Radio Communications
-001D66 Hyundai Telecom
-001D67 Amec
-001D68 Thomson Telecom Belgium
-001D69 Knorr-Bremse AG
-001D6A Alpha Networks
-001D6B Motorola (formerly Netopia
-001D6C ClariPhy Communications
-001D6D Confidant International
-001D6E Nokia Danmark A/S
-001D6F Chainzone Technology Co.
-001D70 Cisco Systems
-001D71 Cisco Systems
-001D72 Wistron
-001D73 Buffalo
-001D74 Tianjin China-Silicon Microelectronics Co.
-001D75 Radioscape PLC
-001D76 Eyeheight
-001D77 NSGate
-001D78 Invengo Information Technology Co.
-001D79 Signamax
-001D7A Wideband Semiconductor
-001D7B Ice Energy
-001D7C ABE Elettronica S.p.A.
-001D7D Giga-byte Technology Co.
-001D7E Cisco-Linksys
-001D7F Tekron International
-001D80 Beijing Huahuan Eletronics Co.
-001D81 Guangzhou Gateway Electronics CO.
-001D82 GN A/S (GN Netcom A/S)
-001D83 Emitech
-001D84 Gateway
-001D85 Call Direct Cellular Solutions
-001D86 Shinwa Industries(China)
-001D87 VigTech Labs Sdn Bhd
-001D88 Clearwire
-001D89 VaultStor
-001D8A TechTrex
-001D8B Pirelli Broadband Solutions
-001D8C La Crosse Technology
-001D8D Raytek GmbH
-001D8E Alereon
-001D8F PureWave Networks
-001D90 Emco Flow Systems
-001D91 Digitize
-001D92 Micro-star Int'l Co.
-001D93 Modacom
-001D94 Climax Technology Co.
-001D95 Flash
-001D96 WatchGuard Video
-001D97 Alertus Technologies
-001D98 Nokia Danmark A/S
-001D99 Cyan Optic
-001D9A Godex International CO.
-001D9B Hokuyo Automatic Co.
-001D9C Rockwell Automation
-001D9D Artjoy International Limited
-001D9E Axion Technologies
-001D9F Matt R.p.traczynscy Sp.J.
-001DA0 Heng Yu Electronic Manufacturing Company Limited
-001DA1 Cisco Systems
-001DA2 Cisco Systems
-001DA3 SabiOso
-001DA4 Hangzhou System Technology CO.
-001DA5 WB Electronics
-001DA6 Media Numerics Limited
-001DA7 Seamless Internet
-001DA8 Takahata Electronics Co.
-001DA9 Castles Technology, Co.
-001DAA DrayTek
-001DAB SwissQual License AG
-001DAC Gigamon Systems
-001DAD Sinotech Engineering Consultants, Geotechnical Enginee
-001DAE Chang Tseng Technology CO.
-001DAF Nortel
-001DB0 FuJian HengTong Information Technology Co.
-001DB1 Crescendo Networks
-001DB2 Hokkaido Electric Engineering Co.
-001DB3 ProCurve Networking by HP
-001DB4 Kumho ENG Co.
-001DB5 Juniper networks
-001DB6 BestComm Networks
-001DB7 Tendril Networks
-001DB8 Intoto
-001DB9 Wellspring Wireless
-001DBA Sony
-001DBB Dynamic System Electronics
-001DBC Nintendo Co.
-001DBD Versamed
-001DBE Motorola Mobile Devices
-001DBF Radiient Technologies
-001DC0 Enphase Energy
-001DC1 Audinate
-001DC2 Xortec OY
-001DC3 Rikor TV
-001DC4 Aioi Systems Co.
-001DC5 Beijing Jiaxun Feihong Electricial Co.
-001DC6 SNR
-001DC7 L-3 Communications Geneva Aerospace
-001DC8 ScadaMetrcs
-001DC9 GainSpan
-001DCA PAV Electronics Limited
-001DCB Exns Development Oy
-001DCC Hetra Secure Solutions
-001DCD Arris Group
-001DCE Arris Group
-001DCF Arris Group
-001DD0 Arris Group
-001DD1 Arris Group
-001DD2 Arris Group
-001DD3 Arris Group
-001DD4 Arris Group
-001DD5 Arris Group
-001DD6 Arris Group
-001DD7 Algolith
-001DD8 Microsoft
-001DD9 Hon Hai Precision Ind.Co.
-001DDA Mikroelektronika spol. s r. o.
-001DDB C-BEL
-001DDC HangZhou DeChangLong Tech&Info Co.
-001DDD DAT H.K. Limited
-001DDE Zhejiang Broadcast&Television Technology Co.
-001DDF Sunitec Enterprise Co.
-001DE0 Intel Corporate
-001DE1 Intel Corporate
-001DE2 Radionor Communications
-001DE3 Intuicom
-001DE4 Visioneered Image Systems
-001DE5 Cisco Systems
-001DE6 Cisco Systems
-001DE7 Marine Sonic Technology
-001DE8 Nikko Denki Tsushin Company(ndtc)
-001DE9 Nokia Danmark A/S
-001DEA Commtest Instruments
-001DEB Dinec International
-001DEC Marusys
-001DED Grid Net
-001DEE Nextvision Sistemas Digitais DE Televiso LTDA.
-001DEF Trimm
-001DF0 Vidient Systems
-001DF1 Intego Systems
-001DF2 Netflix
-001DF3 SBS Science & Technology Co.
-001DF4 Magellan Technology Limited
-001DF5 Sunshine Co
-001DF6 Samsung Electronics Co.
-001DF7 R. Stahl Schaltgerte Gmbh
-001DF8 Webpro Vision Technology
-001DF9 Cybiotronics (Far East) Limited
-001DFA Fujian Landi Commercial Equipment Co.
-001DFB Netcleus Systems
-001DFC Ksic
-001DFD Nokia Danmark A/S
-001DFE Palm
-001DFF Network Critical Solutions
-001E00 Shantou Institute of Ultrasonic Instruments
-001E01 Renesas Technology Sales Co.
-001E02 Sougou Keikaku Kougyou Co.
-001E03 LiComm Co.
-001E04 Hanson Research
-001E05 Xseed Technologies & Computing
-001E06 Wibrain
-001E07 Winy Technology Co.
-001E08 Centec Networks
-001E09 Zefatek Co.
-001E0A Syba Tech Limited
-001E0B Hewlett Packard
-001E0C Sherwood Information Partners
-001E0D Micran
-001E0E Maxi View Holdings Limited
-001E0F Briot International
-001E10 ShenZhen Huawei Communication Technologies Co.
-001E11 Elelux International
-001E12 Ecolab
-001E13 Cisco Systems
-001E14 Cisco Systems
-001E15 Beech Hill Electronics
-001E16 Keytronix
-001E17 STN BV
-001E18 Radio Activity srl
-001E19 Gtri
-001E1A Best Source Taiwan
-001E1B Digital Stream Technology
-001E1C SWS Australia Limited
-001E1D East Coast Datacom
-001E1E Honeywell Life Safety
-001E1F Nortel
-001E20 Intertain
-001E21 Qisda Co.
-001E22 Arvoo Imaging Products BV
-001E23 Electronic Educational Devices
-001E24 Zhejiang Bell Technology Co.
-001E25 Intek Digital
-001E26 Digifriends Co.
-001E27 SBN Tech Co.
-001E28 Lumexis
-001E29 Hypertherm
-001E2A Netgear
-001E2B Radio Systems Design
-001E2C CyVerse
-001E2D Stim
-001E2E Sirti S.p.a.
-001E2F DiMoto
-001E30 Shireen
-001E31 Infomark Co.
-001E32 Zensys
-001E33 Inventec
-001E34 CryptoMetrics
-001E35 Nintendo Co.
-001E36 Ipte
-001E37 USI
-001E38 Bluecard Software Technology Co.
-001E39 Comsys Communication
-001E3A Nokia Danmark A/S
-001E3B Nokia Danmark A/S
-001E3C Lyngbox Media AB
-001E3D Alps Electric Co.
-001E3E KMW
-001E3F Private
-001E40 Shanghai DareGlobal Technologies Co.
-001E41 Microwave Communication & Component
-001E42 Teltonika
-001E43 Aisin AW Co.
-001E44 Santec
-001E45 Sony Ericsson Mobile Communications AB
-001E46 Motorola CHS
-001E47 PT. Hariff Daya Tunggal Engineering
-001E48 Wi-Links
-001E49 Cisco Systems
-001E4A Cisco Systems
-001E4B City Theatrical
-001E4C Hon Hai Precision Ind.Co.
-001E4D Welkin Sciences
-001E4E Dako Edv-ingenieur- und Systemhaus Gmbh
-001E4F Dell
-001E50 Battistoni Research
-001E51 Converter Industry Srl
-001E52 Apple Computer
-001E53 Further Tech Co.
-001E54 Toyo Electric
-001E55 Cowon Systems
-001E56 Bally Wulff Entertainment GmbH
-001E57 Alcoma, spol. s r.o.
-001E58 D-Link
-001E59 Silicon Turnkey Express
-001E5A Motorola CHS
-001E5B Unitron Company
-001E5C RB GeneralEkonomik
-001E5D Holosys d.o.o.
-001E5E COmputime
-001E5F KwikByte
-001E60 Digital Lighting Systems
-001E61 Itec Gmbh
-001E62 Siemon
-001E63 Vibro-Meter SA
-001E64 Intel Corporate
-001E65 Intel Corporate
-001E66 Resol Elektronische Regelungen Gmbh
-001E67 Intel Corporate
-001E68 Quanta Computer
-001E69 Thomson
-001E6A Beijing Bluexon Technology Co.
-001E6B Scientific Atlanta, A Cisco Company
-001E6C Spliced Networks
-001E6D IT R&D Center
-001E6E Shenzhen First Mile Communications
-001E6F Magna-Power Electronics
-001E70 Cobham Defence Communications
-001E71 IgeaCare Systems
-001E72 PCS
-001E73 ZTE
-001E74 Sagem Communication
-001E75 LG Electronics
-001E76 Thermo Fisher Scientific
-001E77 Air2App
-001E78 Owitek Technology,
-001E79 Cisco Systems
-001E7A Cisco Systems
-001E7B R.I.CO. S.r.l.
-001E7C Taiwick Limited
-001E7D Samsung Electronics Co.
-001E7E Nortel
-001E7F CBM of America
-001E80 Last Mile
-001E81 CNB Technology
-001E82 Pliant Technology
-001E83 Lan/man Standards Association (lmsc)
-001E84 Pika Technologies
-001E85 Lagotek
-001E86 MEL Co.
-001E87 Realease Limited
-001E88 Andor System Support CO.
-001E89 Crfs Limited
-001E8A eCopy
-001E8B Infra Access Korea Co.
-001E8C Asustek Computer
-001E8D Motorola Mobile Devices
-001E8E Hunkeler AG
-001E8F Canon
-001E90 Elitegroup Computer Systems Co
-001E91 Kimin Electronic Co.
-001E92 Jeulin S.A.
-001E93 CiriTech Systems
-001E94 Supercom Technology
-001E95 Sigmalink
-001E96 Sepura Plc
-001E97 Medium Link System Technology CO.
-001E98 GreenLine Communications
-001E99 Vantanol Industrial
-001E9A Hamilton Bonaduz AG
-001E9B San-Eisha
-001E9C Fidustron
-001E9D Recall Technologies
-001E9E ddm hopt + schuler Gmbh + Co. KG
-001E9F Visioneering Systems
-001EA0 XLN-t
-001EA1 Brunata a/s
-001EA2 Symx Systems
-001EA3 Nokia Danmark A/S
-001EA4 Nokia Danmark A/S
-001EA5 Robotous
-001EA6 Best IT World (India) Pvt.
-001EA7 ActionTec Electronics
-001EA8 Datang Mobile Communications Equipment CO.
-001EA9 Nintendo Co.
-001EAA E-Senza Technologies GmbH
-001EAB TeleWell Oy
-001EAC Armadeus Systems
-001EAD Wingtech Group Limited
-001EAE Continental Automotive Systems
-001EAF Ophir Optronics
-001EB0 ImesD Electronica S.L.
-001EB1 Cryptsoft
-001EB2 LG innotek
-001EB3 Primex Wireless
-001EB4 Unifat Technology
-001EB5 Ever Sparkle Technologies
-001EB6 TAG Heuer SA
-001EB7 TBTech, Co.
-001EB8 Fortis
-001EB9 Sing Fai Technology Limited
-001EBA High Density Devices AS
-001EBB Bluelight Technology
-001EBC Wintech Automation Co.
-001EBD Cisco Systems
-001EBE Cisco Systems
-001EBF Haas Automation
-001EC0 ZeroG Wireless
-001EC1 3com Europe
-001EC2 Apple
-001EC3 Kozio
-001EC4 Celio
-001EC5 Middle Atlantic Products
-001EC6 Obvius Holdings
-001EC7 2Wire
-001EC8 Rapid Mobile (Pty)
-001EC9 Dell
-001ECA Nortel
-001ECB "RPC "Energoautomatika"
-001ECC Cdvi
-001ECD Kyland
-001ECE Bisa Technologies (hong Kong) Limited
-001ECF Philips Electronics UK
-001ED0 Connexium
-001ED1 Keyprocessor B.V.
-001ED2 Ray Shine Video Technology
-001ED3 Dot Technology Int'l Co.
-001ED4 Doble Engineering
-001ED5 Tekon-Automatics
-001ED6 Alentec & Orion AB
-001ED7 H-Stream Wireless
-001ED8 Digital United
-001ED9 Mitsubishi Precision Co.
-001EDA Wesemann Elektrotechniek B.V.
-001EDB Giken Trastem Co.
-001EDC Sony Ericsson Mobile Communications AB
-001EDD Wasko S.A.
-001EDE BYD Company Limited
-001EDF Master Industrialization Center Kista
-001EE0 Urmet Domus SpA
-001EE1 Samsung Electronics Co.
-001EE2 Samsung Electronics Co.
-001EE3 T&W Electronics (ShenZhen) Co.
-001EE4 ACS Solutions France
-001EE5 Cisco-Linksys
-001EE6 Shenzhen Advanced Video Info-Tech Co.
-001EE7 Epic Systems
-001EE8 Mytek
-001EE9 Stoneridge Electronics AB
-001EEA Sensor Switch
-001EEB Talk-A-Phone Co.
-001EEC Compal Information (kunshan) CO.
-001EED Adventiq
-001EEE ETL Systems
-001EEF Cantronic International Limited
-001EF0 Gigafin Networks
-001EF1 Servimat
-001EF2 Micro Motion
-001EF3 From2
-001EF4 L-3 Communications Display Systems
-001EF5 Hitek Automated
-001EF6 Cisco Systems
-001EF7 Cisco Systems
-001EF8 Emfinity
-001EF9 Pascom Kommunikations systeme GmbH.
-001EFA Protei
-001EFB Trio Motion Technology
-001EFC JSC "massa-k"
-001EFD Microbit 2.0 AB
-001EFE Level S.r.o.
-001EFF Mueller-Elektronik GmbH & Co. KG
-001F00 Nokia Danmark A/S
-001F01 Nokia Danmark A/S
-001F02 Pixelmetrix Pte
-001F03 NUM AG
-001F04 Granch
-001F05 iTAS Technology
-001F06 Integrated Dispatch Solutions
-001F07 Azteq Mobile
-001F08 Risco
-001F09 Jastec CO.
-001F0A Nortel
-001F0B Federal State Unitary Enterprise Industrial Union"Electropribor"
-001F0C Intelligent Digital Services GmbH
-001F0D L3 Communications - Telemetry West
-001F0E Japan Kyastem Co.
-001F0F Select Engineered Systems
-001F10 Toledo DO Brasil Industria DE Balancas Ltda
-001F11 Openmoko
-001F12 Juniper Networks
-001F13 S.& A.S.
-001F14 NexG
-001F15 Bioscrypt
-001F16 Wistron
-001F17 IDX Company
-001F18 Hakusan.Mfg.Co
-001F19 Ben-ri Electronica S.A.
-001F1A Prominvest
-001F1B RoyalTek Company
-001F1C Kobishi Electric Co.
-001F1D Atlas Material Testing Technology
-001F1E Astec Technology Co.
-001F1F Edimax Technology Co.
-001F20 Logitech Europe SA
-001F21 Inner Mongolia Yin An Science & Technology Development Co.
-001F22 Fiberxon
-001F23 Interacoustics
-001F24 Digitview Technology CO.
-001F25 MBS GmbH
-001F26 Cisco Systems
-001F27 Cisco Systems
-001F28 ProCurve Networking by HP
-001F29 Hewlett Packard
-001F2A Accm
-001F2B Orange Logic
-001F2C Starbridge Networks
-001F2D Electro-Optical Imaging
-001F2E Triangle Research Int'l Pte
-001F2F Berker GmbH & Co. KG
-001F30 Travelping
-001F31 Radiocomp
-001F32 Nintendo Co.
-001F33 Netgear
-001F34 Lung Hwa Electronics Co.
-001F35 Air802
-001F36 Bellwin Information Co.,
-001F37 Genesis I&C
-001F38 Positron
-001F39 Construcciones y Auxiliar de Ferrocarriles
-001F3A Hon Hai Precision Ind.Co.
-001F3B Intel Corporate
-001F3C Intel Corporate
-001F3D Qbit GmbH
-001F3E RP-Technik e.K.
-001F3F AVM GmbH
-001F40 Speakercraft
-001F41 Ruckus Wireless
-001F42 Etherstack
-001F43 Entes Elektronik
-001F44 GE Transportation Systems
-001F45 Enterasys
-001F46 Nortel
-001F47 MCS Logic
-001F48 Mojix
-001F49 Eurosat Distribution
-001F4A Albentia Systems S.A.
-001F4B Lineage Power
-001F4C Roseman Engineering
-001F4D Segnetics
-001F4E ConMed Linvatec
-001F4F Thinkware Co.
-001F50 Swissdis AG
-001F51 HD Communications
-001F52 UVT Unternehmensberatung fr Verkehr und Technik GmbH
-001F53 Gemac Gesellschaft fr Mikroelektronikanwendung Chemnitz mbH
-001F54 Lorex Technology
-001F55 Honeywell Security (China) Co.
-001F56 Digital Forecast
-001F57 Phonik Innovation Co.
-001F58 EMH Energiemesstechnik GmbH
-001F59 Kronback Tracers
-001F5A Beckwith Electric Co.
-001F5B Apple
-001F5C Nokia Danmark A/S
-001F5D Nokia Danmark A/S
-001F5E Dyna Technology Co.
-001F5F Blatand GmbH
-001F60 Compass Systems
-001F61 Talent Communication Networks
-001F62 JSC "Stilsoft"
-001F63 JSC Goodwin-Europa
-001F64 Beijing Autelan Technology
-001F65 Korea Electric Terminal CO.
-001F66 Planar
-001F67 Hitachi
-001F68 Martinsson Elektronik AB
-001F69 Pingood Technology Co.
-001F6A PacketFlux Technologies
-001F6B LG Electronics
-001F6C Cisco Systems
-001F6D Cisco Systems
-001F6E Vtech Engineering
-001F6F Fujian Sunnada Communication Co.
-001F70 Botik Technologies
-001F71 xG Technology
-001F72 QingDao Hiphone Technology Co
-001F73 Teraview Technology Co.
-001F74 Eigen Development
-001F75 GiBahn Media
-001F76 AirLogic Systems
-001F77 Heol Design
-001F78 Blue Fox Porini Textile
-001F79 Lodam Electronics A/S
-001F7A WiWide
-001F7B TechNexion
-001F7C Witelcom AS
-001F7D embedded wireless GmbH
-001F7E Motorola Mobile Devices
-001F7F Phabrix Limited
-001F80 Lucas Holding bv
-001F81 Accel Semiconductor
-001F82 Cal-Comp Electronics & Communications Co.
-001F83 Teleplan Technology Services Sdn Bhd
-001F84 Gigle Semiconductor
-001F85 Apriva ISS
-001F86 digEcor
-001F87 Skydigital
-001F88 FMS Force Measuring Systems AG
-001F89 Signalion GmbH
-001F8A Ellion Digital
-001F8B Storspeed
-001F8C CCS
-001F8D Ingenieurbuero Stark GmbH und Ko. KG
-001F8E Metris USA
-001F8F Shanghai Bellmann Digital Source Co.
-001F90 Actiontec Electronics
-001F91 DBS Lodging Technologies
-001F92 VideoIQ
-001F93 Xiotech
-001F94 Lascar Electronics
-001F95 Sagem Communication
-001F96 Aprotechltd
-001F97 Bertana SRL
-001F98 Daiichi-dentsu
-001F99 Seronicsltd
-001F9A Nortel Networks
-001F9B Posbro
-001F9C Ledco
-001F9D Cisco Systems
-001F9E Cisco Systems
-001F9F Thomson Telecom Belgium
-001FA0 A10 Networks
-001FA1 Gtran
-001FA2 Datron World Communications
-001FA3 T&W Electronics(Shenzhen)Co.
-001FA4 ShenZhen Gongjin Electronics Co.
-001FA5 Blue-White Industries
-001FA6 Stilo srl
-001FA7 Sony Computer Entertainment
-001FA8 ANI Technologies
-001FA9 Atlanta DTH
-001FAA Taseon
-001FAB I.S High Tech.inc
-001FAC Goodmill Systems
-001FAD Brown Innovations
-001FAE Blick South Africa (Pty)
-001FAF NextIO
-001FB0 TimeIPS
-001FB1 Cybertech
-001FB2 Sontheim Industrie Elektronik GmbH
-001FB3 2Wire
-001FB4 SmartShare Systems
-001FB5 I/O Interconnect
-001FB6 Chi Lin Technology Co.
-001FB7 WiMate Technologies
-001FB8 Universal Remote Control
-001FB9 Paltronics
-001FBA BoYoung Tech. & Marketing
-001FBB Xenatech Co.
-001FBC Evga
-001FBD Kyocera Wireless
-001FBE Shenzhen Mopnet Industrial Co.
-001FBF Fulhua Microelectronics Taiwan Branch
-001FC0 Control Express Finland Oy
-001FC1 Hanlong Technology Co.
-001FC2 Jow Tong Technology Co
-001FC3 SmartSynch
-001FC4 Motorola CHS
-001FC5 Nintendo Co.
-001FC6 Asustek Computer
-001FC7 Casio Hitachi Mobile Comunications Co.
-001FC8 Up-Today Industrial Co.
-001FC9 Cisco Systems
-001FCA Cisco Systems
-001FCB NIW Solutions
-001FCC Samsung Electronics Co.
-001FCD Samsung Electronics
-001FCE Qtech
-001FCF MSI Technology GmbH
-001FD0 Giga-byte Technology Co.
-001FD1 Optex Co.
-001FD2 Commtech Technology Macao Commercial Offshore
-001FD3 Riva Networks
-001FD4 4ipnet
-001FD5 Microrisc S.r.o.
-001FD6 Shenzhen Allywll
-001FD7 Telerad SA
-001FD8 A-trust Computer
-001FD9 RSD Communications
-001FDA Nortel Networks
-001FDB Network Supply,
-001FDC Mobile Safe Track
-001FDD GDI
-001FDE Nokia Danmark A/S
-001FDF Nokia Danmark A/S
-001FE0 EdgeVelocity
-001FE1 Hon Hai Precision Ind. Co.
-001FE2 Hon Hai Precision Ind. Co.
-001FE3 LG Electronics
-001FE4 Sony Ericsson Mobile Communications
-001FE5 In-Circuit GmbH
-001FE6 Alphion
-001FE7 Simet
-001FE8 Kurusugawa Electronics Industry
-001FE9 Printrex
-001FEA Applied Media Technologies
-001FEB Trio Datacom
-001FEC Synapse lectronique
-001FED Tecan Systems
-001FEE ubisys technologies GmbH
-001FEF Shinsei Industries Co.
-001FF0 Audio Partnership
-001FF1 Paradox Hellas S.A.
-001FF2 VIA Technologies
-001FF3 Apple
-001FF4 Power Monitors
-001FF5 Kongsberg Defence & Aerospace
-001FF6 PS Audio International
-001FF7 Nakajima All Precision Co.
-001FF8 Siemens AG, Sector Industry, Drive Technologies, Motion Control Systems
-001FF9 Advanced Knowledge Associates
-001FFA Coretree, Co
-001FFB Green Packet Bhd
-001FFC Riccius+Sohn GmbH
-001FFD Indigo Mobile Technologies
-001FFE ProCurve Networking by HP
-001FFF Respironics
-002000 Lexmark International
-002001 DSP Solutions
-002002 Seritech Enterprise CO.
-002003 Pixel Power
-002004 Yamatake-honeywell CO.
-002005 Simple Technology
-002006 Garrett Communications
-002007 SFA
-002008 Cable & Computer Technology
-002009 Packard Bell Elec.
-00200A Source-comm
-00200B Octagon Systems
-00200C Adastra Systems
-00200D Carl Zeiss
-00200E Satellite Technology MGMT
-00200F Tanbac CO.
-002010 Jeol System Technology CO.
-002011 Canopus CO.
-002012 Camtronics Medical Systems
-002013 Diversified Technology
-002014 Global View CO.
-002015 Actis Computer SA
-002016 Showa Electric Wire & Cable CO
-002017 Orbotech
-002018 CIS Technology
-002019 Ohler Gmbh
-00201A MRV Communications
-00201B Northern Telecom/network
-00201C Excel
-00201D Katana Products
-00201E Netquest
-00201F Best Power Technology
-002020 Megatron Computer Industries
-002021 Algorithms Software PVT.
-002022 NMS Communications
-002023 T.C. Technologies
-002024 Pacific Communication Sciences
-002025 Control Technology
-002026 Amkly Systems
-002027 Ming Fortune Industry CO.
-002028 West EGG Systems
-002029 Teleprocessing Products
-00202A N.V. Dzine
-00202B Advanced Telecommunications Modules
-00202C Welltronix CO.
-00202D Taiyo
-00202E Daystar Digital
-00202F Zeta Communications
-002030 Analog & Digital Systems
-002031 Ertec Gmbh
-002032 Alcatel Taisel
-002033 Synapse Technologies
-002034 Rotec Industrieautomation Gmbh
-002035 IBM
-002036 BMC Software
-002037 Seagate Technology
-002038 VME Microsystems International
-002039 Scinets
-00203A Digital Bi0metrics
-00203B Wisdm
-00203C Eurotime AB
-00203D Honeywell ECC
-00203E LogiCan Technologies
-00203F Juki
-002040 Motorola Broadband Communications Sector
-002041 Data NET
-002042 Datametrics
-002043 Neuron Company Limited
-002044 Genitech
-002045 ION Networks
-002046 Ciprico
-002047 Steinbrecher
-002048 Marconi Communications
-002049 Comtron
-00204A Pronet Gmbh
-00204B Autocomputer CO.
-00204C Mitron Computer PTE
-00204D Inovis Gmbh
-00204E Network Security Systems
-00204F Deutsche Aerospace AG
-002050 Korea Computer
-002051 Verilink
-002052 Ragula Systems
-002053 Huntsville Microsystems
-002054 Sycamore Networks
-002055 Altech CO.
-002056 Neoproducts
-002057 Titze Datentechnik Gmbh
-002058 Allied Signal
-002059 Miro Computer Products AG
-00205A Computer Identics
-00205B Kentrox
-00205C InterNet Systems of Florida
-00205D Nanomatic OY
-00205E Castle ROCK
-00205F Gammadata Computer Gmbh
-002060 Alcatel Italia S.p.a.
-002061 GarrettCom
-002062 Scorpion Logic
-002063 Wipro Infotech
-002064 Protec Microsystems
-002065 Supernet Networking
-002066 General Magic
-002067 Private
-002068 Isdyne
-002069 Isdn Systems
-00206A Osaka Computer
-00206B Konica Minolta Holdings
-00206C Evergreen Technology
-00206D Data RACE
-00206E XACT
-00206F Flowpoint
-002070 Hynet
-002071 IBR Gmbh
-002072 Worklink Innovations
-002073 Fusion Systems
-002074 Sungwoon Systems
-002075 Motorola Communication Israel
-002076 Reudo
-002077 Kardios Systems
-002078 Runtop
-002079 Mikron Gmbh
-00207A WiSE Communications
-00207B Intel
-00207C Autec Gmbh
-00207D Advanced Computer Applications
-00207E Finecom Co.
-00207F Kyoei Sangyo CO.
-002080 Synergy (uk)
-002081 Titan Electronics
-002082 Oneac
-002083 Presticom Incorporated
-002084 OCE Printing Systems
-002085 Exide Electronics
-002086 Microtech Electronics Limited
-002087 Memotec Communications
-002088 Global Village Communication
-002089 T3plus Networking
-00208A Sonix Communications
-00208B Lapis Technologies
-00208C Galaxy Networks
-00208D CMD Technology
-00208E Chevin Software ENG.
-00208F ECI Telecom
-002090 Advanced Compression Technology
-002091 J125, National Security Agency
-002092 Chess Engineering B.V.
-002093 Landings Technology
-002094 Cubix
-002095 Riva Electronics
-002096 Invensys
-002097 Applied Signal Technology
-002098 Hectronic AB
-002099 BON Electric CO.
-00209A THE 3DO Company
-00209B Ersat Electronic Gmbh
-00209C Primary Access
-00209D Lippert Automationstechnik
-00209E Brown's Operating System Services
-00209F Mercury Computer Systems
-0020A0 OA Laboratory CO.
-0020A1 Dovatron
-0020A2 Galcom Networking
-0020A3 Divicom
-0020A4 Multipoint Networks
-0020A5 API Engineering
-0020A6 Proxim
-0020A7 Pairgain Technologies
-0020A8 Sast Technology
-0020A9 White Horse Industrial
-0020AA Digimedia Vision
-0020AB Micro Industries
-0020AC Interflex Datensysteme Gmbh
-0020AD Linq Systems
-0020AE Ornet Data Communication TECH.
-0020AF 3com
-0020B0 Gateway Devices
-0020B1 Comtech Research
-0020B2 GKD Gesellschaft Fur Kommunikation Und Datentechnik
-0020B3 Scltec Communications Systems
-0020B4 Terma Elektronik AS
-0020B5 Yaskawa Electric
-0020B6 Agile Networks
-0020B7 Namaqua Computerware
-0020B8 Prime Option
-0020B9 Metricom
-0020BA Center FOR High Performance
-0020BB ZAX
-0020BC Long Reach Networks
-0020BD Niobrara R &
-0020BE LAN Access
-0020BF Aehr Test Systems
-0020C0 Pulse Electronics
-0020C1 SAXA
-0020C2 Texas Memory Systems
-0020C3 Counter Solutions
-0020C4 Inet
-0020C5 Eagle Technology
-0020C6 Nectec
-0020C7 Akai Professional M.I.
-0020C8 Larscom Incorporated
-0020C9 Victron BV
-0020CA Digital Ocean
-0020CB Pretec Electronics
-0020CC Digital Services
-0020CD Hybrid Networks
-0020CE Logical Design Group
-0020CF Test & Measurement Systems
-0020D0 Versalynx
-0020D1 Microcomputer Systems (M) SDN.
-0020D2 RAD Data Communications
-0020D3 OST (ouest Standard Telematiqu
-0020D4 Cabletron - Zeittnet
-0020D5 Vipa Gmbh
-0020D6 Breezecom
-0020D7 Japan Minicomputer Systems CO.
-0020D8 Nortel Networks
-0020D9 Panasonic Technologies,/mieco-us
-0020DA Alcatel North America ESD
-0020DB Xnet Technology
-0020DC Densitron Taiwan
-0020DD Cybertec
-0020DE Japan Digital Laborat'yltd
-0020DF Kyosan Electric MFG. CO.
-0020E0 Actiontec Electronics
-0020E1 Alamar Electronics
-0020E2 Information Resource Engineering
-0020E3 MCD Kencom
-0020E4 Hsing Tech Enterprise CO.
-0020E5 Apex DATA
-0020E6 Lidkoping Machine Tools AB
-0020E7 B&W Nuclear Service Company
-0020E8 Datatrek
-0020E9 Dantel
-0020EA Efficient Networks
-0020EB Cincinnati Microwave
-0020EC Techware Systems
-0020ED Giga-byte Technology CO.
-0020EE Gtech
-0020EF USC
-0020F0 Universal Microelectronics CO.
-0020F1 Altos India Limited
-0020F2 SUN Microsystems
-0020F3 Raynet
-0020F4 Spectrix
-0020F5 Pandatel AG
-0020F6 NET TEK AND Karlnet
-0020F7 Cyberdata
-0020F8 Carrera Computers
-0020F9 Paralink Networks
-0020FA GDE Systems
-0020FB Octel Communications
-0020FC Matrox
-0020FD ITV Technologies
-0020FE Topware / Grand Computer
-0020FF Symmetrical Technologies
-002100 GemTek Technology Co.
-002101 Aplicaciones Electronicas Quasar (AEQ)
-002102 UpdateLogic
-002103 GHI Electronics
-002104 Gigaset Communications GmbH
-002105 Alcatel-Lucent
-002106 RIM Testing Services
-002107 Seowonintech Co
-002108 Nokia Danmark A/S
-002109 Nokia Danmark A/S
-00210A byd:sign
-00210B Gemini Traze Rfid PVT.
-00210C Cymtec Systems
-00210D Samsin Innotec
-00210E Orpak Systems L.T.D.
-00210F Cernium
-002110 Clearbox Systems
-002111 Uniphone
-002112 Wiscom System Co.
-002113 Padtec S/A
-002114 Hylab Technology
-002115 Phywe Systeme Gmbh & Co. KG
-002116 Transcon Electronic Systems, spol. s r. o.
-002117 Tellord
-002118 Athena Tech
-002119 Samsung Electro-Mechanics
-00211A LInTech
-00211B Cisco Systems
-00211C Cisco Systems
-00211D Dataline AB
-00211E Motorola CHS
-00211F Shinsung Deltatech Co.
-002120 Sequel Technologies
-002121 VRmagic GmbH
-002122 Chip-pro
-002123 Aerosat Avionics
-002124 Optos Plc
-002125 KUK JE Tong Shin Co.
-002126 Shenzhen Torch Equipment Co.
-002127 Tp-link Technology Co.
-002128 Sun Microsystems
-002129 Cisco-Linksys
-00212A Audiovox
-00212B MSA Auer
-00212C SemIndia System Private Limited
-00212D Scimolex
-00212E dresden-elektronik
-00212F Phoebe Micro
-002130 Keico Hightech
-002131 Blynke
-002132 Masterclock
-002133 Building
-002134 Brandywine Communications
-002135 Alcatel-lucent
-002136 Motorola Mobile Devices business (MDb)
-002137 Bay Controls
-002138 Cepheid
-002139 Escherlogic
-00213A Winchester Systems
-00213B Berkshire Products
-00213C AliphCom
-00213D Cermetek Microelectronics
-00213E TomTom
-00213F A-Team Technology
-002140 EN Technologies
-002141 Radlive
-002142 ABS Control Systems doo
-002143 Motorola CHS
-002144 SS Telecoms
-002145 Semptian Technologies
-002146 SCI Technology
-002147 Nintendo Co.
-002148 Kaco Solar Korea
-002149 China Daheng Group
-00214A Pixel Velocity
-00214B Shenzhen Hamp Science & Technology Co.
-00214C Samsung Electronics CO.
-00214D Guangzhou Skytone Transmission Technology Com.
-00214E GS Yuasa Power Supply
-00214F Alps Electric Co.
-002150 Eyeview Electronics
-002151 Millinet Co.
-002152 General Satellite Trading Limited
-002153 SeaMicro
-002154 D-tacq Solutions
-002155 Cisco Systems
-002156 Cisco Systems
-002157 National Datacast
-002158 Style Flying Technology Co.
-002159 Juniper Networks
-00215A Hewlett Packard
-00215B Inotive
-00215C Intel Corporate
-00215D Intel Corporate
-00215E IBM
-00215F Ihse Gmbh
-002160 Hidea Solutions Co.
-002161 Yournet
-002162 Nortel
-002163 Askey Computer
-002164 Special Design Bureau for Seismic Instrumentation
-002165 Presstek
-002166 NovAtel
-002167 HWA JIN T&I
-002168 iVeia
-002169 Prologix
-00216A Intel Corporate
-00216B Intel Corporate
-00216C Odva
-00216D Soltech Co.
-00216E Function ATI (Huizhou) Telecommunications Co.
-00216F SymCom
-002170 Dell
-002171 Wesung TNC Co.
-002172 Seoultek Valley
-002173 Ion Torrent Systems
-002174 AvaLAN Wireless
-002175 Pacific Satellite International
-002176 YMax Telecom
-002177 W. L. Gore & Associates
-002178 Matuschek Messtechnik GmbH
-002179 Iogear
-00217A Sejin Electron
-00217B Bastec AB
-00217C 2Wire
-00217D Pyxis S.r.l.
-00217E Telit Communication s.p.a
-00217F Intraco Technology Pte
-002180 Motorola CHS
-002181 Si2 Microsystems Limited
-002182 SandLinks Systems
-002183 Vatech Hydro
-002184 Powersoft SRL
-002185 Micro-star Int'l Co.
-002186 USI
-002187 Imacs GmbH
-002188 Data Domain
-002189 AppTech
-00218A Electronic Design and Manufacturing Company
-00218B Wescon Technology
-00218C Topcontrol Gmbh
-00218D AP Router Ind. Eletronica Ltda
-00218E Mekics CO.
-00218F Avantgarde Acoustic Lautsprechersysteme GmbH
-002190 Goliath Solutions
-002191 D-Link
-002192 Baoding Galaxy Electronic Technology Co.
-002193 Videofon MV
-002194 Ping Communication
-002195 GWD Media Limited
-002196 Telsey S.p.A.
-002197 Elitegroup Computer System
-002198 Thai Radio Co
-002199 Vacon Plc
-00219A Cambridge Visual Networks
-00219B Dell
-00219C Honeywld Technology
-00219D Adesys BV
-00219E Sony Ericsson Mobile Communications
-00219F Satel OY
-0021A0 Cisco Systems
-0021A1 Cisco Systems
-0021A2 EKE-Electronics
-0021A3 Micromint
-0021A4 Dbii Networks
-0021A5 Erlphase Power Technologies
-0021A6 Videotec Spa
-0021A7 Hantle System Co.
-0021A8 Telephonics
-0021A9 Mobilink Telecom Co.
-0021AA Nokia Danmark A/S
-0021AB Nokia Danmark A/S
-0021AC Infrared Integrated Systems
-0021AD Nordic ID Oy
-0021AE Alcatel-lucent France - WTD
-0021AF Radio Frequency Systems
-0021B0 Tyco Telecommunications
-0021B1 Digital Solutions
-0021B2 Fiberblaze A/S
-0021B3 Ross Controls
-0021B4 Apro Media CO.
-0021B5 Vyro Games Limited
-0021B6 Triacta Power Technologies
-0021B7 Lexmark International
-0021B8 Inphi
-0021B9 Universal Devices
-0021BA Texas Instruments
-0021BB Riken Keiki Co.
-0021BC Zala Computer
-0021BD Nintendo Co.
-0021BE Cisco, Service Provider Video Technology Group
-0021BF Hitachi High-Tech Control Systems
-0021C0 Mobile Appliance
-0021C1 ABB Oy / Distribution Automation
-0021C2 GL Communications
-0021C3 Cornell Communications
-0021C4 Consilium AB
-0021C5 3DSP
-0021C6 CSJ Global
-0021C7 Russound
-0021C8 Lohuis Networks
-0021C9 Wavecom Asia Pacific Limited
-0021CA ART System Co.
-0021CB SMS Tecnologia Eletronica Ltda
-0021CC Flextronics International
-0021CD LiveTV
-0021CE NTC-Metrotek
-0021CF The Crypto Group
-0021D0 Global Display Solutions Spa
-0021D1 Samsung Electronics Co.
-0021D2 Samsung Electronics Co.
-0021D3 Bocom Security(asia Pacific) Limited
-0021D4 Vollmer Werke GmbH
-0021D5 X2E GmbH
-0021D6 LXI Consortium
-0021D7 Cisco Systems
-0021D8 Cisco Systems
-0021D9 Sekonic
-0021DA Automation Products Group
-0021DB Santachi Video Technology (Shenzhen) Co.
-0021DC Tecnoalarm S.r.l.
-0021DD Northstar Systems
-0021DE Firepro Wireless
-0021DF Martin Christ GmbH
-0021E0 CommAgility
-0021E1 Nortel Networks
-0021E2 Creative Electronic GmbH
-0021E3 SerialTek
-0021E4 I-win
-0021E5 Display Solution AG
-0021E6 Starlight Video Limited
-0021E7 Informatics Services
-0021E8 Murata Manufacturing Co.
-0021E9 Apple
-0021EA Bystronic Laser AG
-0021EB ESP Systems
-0021EC Solutronic GmbH
-0021ED Telegesis
-0021EE Full Spectrum
-0021EF Kapsys
-0021F0 EW3 Technologies
-0021F1 Tutus Data AB
-0021F2 Easy3call Technology Limited
-0021F3 Si14 SpA
-0021F4 INRange Systems
-0021F5 Western Engravers Supply
-0021F6 Virtual Iron Software
-0021F7 ProCurve Networking by HP
-0021F8 Enseo
-0021F9 Wirecom Technologies
-0021FA A4SP Technologies
-0021FB LG Electronics
-0021FC Nokia Danmark A/S
-0021FD Dsta S.L.
-0021FE Nokia Danmark A/S
-0021FF Cyfrowy Polsat SA
-002200 Blade Network Technology
-002201 Aksys Networks
-002202 Excito Elektronik i Skne AB
-002203 Glensound Electronics
-002204 Koratek
-002205 WeLink Solutions
-002206 Cyberdyne
-002207 Inteno Broadband Technology AB
-002208 Certicom
-002209 Omron Healthcare Co.
-00220A Rearden Labs
-00220B National Source Coding Center
-00220C Cisco Systems
-00220D Cisco Systems
-00220E Indigo Security Co.
-00220F MoCA (Multimedia over Coax Alliance)
-002210 Motorola CHS
-002211 Rohati Systems
-002212 CAI Networks
-002213 PCI
-002214 Rinnai Korea
-002215 Asustek Computer
-002216 Shibaura Vending Machine
-002217 Neat Electronics
-002218 Verivue
-002219 Dell
-00221A Audio Precision
-00221B Morega Systems
-00221C Private
-00221D Freegene Technology
-00221E Media Devices Co.
-00221F eSang Technologies Co.
-002220 Mitac Technology
-002221 Itoh Denki Co
-002222 Betec Engineering GmbH
-002223 TimeKeeping Systems
-002224 Good Will Instrument Co.
-002225 Thales Avionics
-002226 Avaak
-002227 uv-electronic GmbH
-002228 Breeze Innovations
-002229 Compumedics
-00222A SoundEar A/S
-00222B Nucomm
-00222C Ceton
-00222D SMC Networks
-00222E maintech GmbH
-00222F Open Grid Computing
-002230 FutureLogic
-002231 SMT&C Co.
-002232 Design Design Technology
-002233 Pirelli Broadband Solutions
-002234 Corventis
-002235 Strukton Systems bv
-002236 Vector SP. Z O.O.
-002237 Shinhint Group
-002238 Logiplus
-002239 Indiana Life Sciences Incorporated
-00223A Scientific Atlanta, Cisco Spvt Group
-00223B Communication Networks
-00223C Ratio Entwicklungen Gmbh
-00223D JumpGen Systems
-00223E IRTrans GmbH
-00223F Netgear
-002240 Universal Telecom S/A
-002241 Apple
-002242 Alacron
-002243 AzureWave Technologies
-002244 Chengdu Linkon Communications Device Co.
-002245 Leine & Linde AB
-002246 Evoc Intelligent Technology Co.
-002247 DAC Engineering CO.
-002248 Microsoft
-002249 Home Multienergy SL
-00224A Raylase AG
-00224B Airtech Technologies
-00224C Nintendo Co.
-00224D Mitac International
-00224E SEEnergy
-00224F Byzoro Networks
-002250 Point Six Wireless
-002251 Lumasense Technologies
-002252 Zoll Lifecor
-002253 Entorian Technologies
-002254 Bigelow Aerospace
-002255 Cisco Systems
-002256 Cisco Systems
-002257 3Com Europe
-002258 Taiyo Yuden Co.
-002259 Guangzhou New Postcom Equipment Co.
-00225A Garde Security AB
-00225B Teradici
-00225C Multimedia & Communication Technology
-00225D Digicable Network India Pvt.
-00225E Uwin Technologies Co.
-00225F Liteon Technology
-002260 Afreey
-002261 Frontier Silicon
-002262 BEP Marine
-002263 Koos Technical Services
-002264 Hewlett Packard
-002265 Nokia Danmark A/S
-002266 Nokia Danmark A/S
-002267 Nortel Networks
-002268 Hon Hai Precision Ind. Co.
-002269 Hon Hai Precision Ind. Co.
-00226A Honeywell
-00226B Cisco-Linksys
-00226C LinkSprite Technologies
-00226D Shenzhen Giec Electronics Co.
-00226E Gowell Electronic Limited
-00226F 3onedata Technology Co.
-002270 ABK North America
-002271 Jger Computergesteuerte Messtechnik GmbH
-002272 American Micro-Fuel Device
-002273 Techway
-002274 FamilyPhone AB
-002275 Belkin International
-002276 Triple EYE B.V.
-002277 NEC Australia
-002278 Shenzhen Tongfang Multimedia Technology Co.
-002279 Nippon Conlux Co.
-00227A Telecom Design
-00227B Apogee Labs
-00227C Woori SMT Co.
-00227D YE Data
-00227E Chengdu 30Kaitian Communication IndustryLtd
-00227F Ruckus Wireless
-002280 A2B Electronics AB
-002281 Daintree Networks
-002282 8086 Limited
-002283 Juniper Networks
-002284 Desay A&V Science AND Technology Co.
-002285 Nomus Comm Systems
-002286 Astron
-002287 Titan Wireless
-002288 Sagrad
-002289 Optosecurity
-00228A Teratronik elektronische systeme gmbh
-00228B Kensington Computer Products Group
-00228C Photon Europe GmbH
-00228D GBS Laboratories
-00228E Tv-numeric
-00228F Cnrs
-002290 Cisco Systems
-002291 Cisco Systems
-002292 Cinetal
-002293 ZTE
-002294 Kyocera
-002295 SGM Technology for lighting spa
-002296 LinoWave
-002297 Xmos Semiconductor
-002298 Sony Ericsson Mobile Communications
-002299 SeaMicro
-00229A Lastar
-00229B AverLogic Technologies
-00229C Verismo Networks
-00229D Pyung-hwa Ind.co.
-00229E Social Aid Research Co.
-00229F Sensys Traffic AB
-0022A0 Delphi
-0022A1 Huawei Symantec Technologies Co.
-0022A2 Xtramus Technologies
-0022A3 California Eastern Laboratories
-0022A4 2Wire
-0022A5 Texas Instruments
-0022A6 Sony Computer Entertainment America
-0022A7 Tyco Electronics AMP GmbH
-0022A8 Ouman Finland Oy
-0022A9 LG Electronics
-0022AA Nintendo Co.
-0022AB Shenzhen Turbosight Technology
-0022AC Hangzhou Siyuan Tech. Co.
-0022AD Telesis Technologies
-0022AE Mattel
-0022AF Safety Vision
-0022B0 D-Link
-0022B1 Elbit Systems
-0022B2 4RF Communications
-0022B3 Sei S.p.A.
-0022B4 Motorola Mobile Devices
-0022B5 Novita
-0022B6 Superflow Technologies Group
-0022B7 GSS Grundig SAT-Systems GmbH
-0022B8 Norcott
-0022B9 Analogix Seminconductor
-0022BA Huth Elektronik Systeme Gmbh
-0022BB beyerdynamic GmbH & Co. KG
-0022BC Jdsu France SAS
-0022BD Cisco Systems
-0022BE Cisco Systems
-0022BF SieAmp Group of Companies
-0022C0 Shenzhen Forcelink Electronic Co
-0022C1 Active Storage
-0022C2 Proview Eletronica do Brasil Ltda
-0022C3 Zeeport Technology
-0022C4 epro GmbH
-0022C5 Inforson Co
-0022C6 Sutus
-0022C7 Segger Microcontroller Gmbh & Co. KG
-0022C8 Applied Instruments
-0022C9 Lenord, Bauer & Co GmbH
-0022CA Anviz Biometric Tech. Co.
-0022CB Ionodes
-0022CC SciLog
-0022CD Ared Technology Co.
-0022CE Cisco, Service Provider Video Technology Group
-0022CF Planex Communications
-0022D0 Polar Electro Oy
-0022D1 Albrecht Jung GmbH & Co. KG
-0022D2 All Earth Comrcio de Eletrnicos LTDA.
-0022D3 Hub-Tech
-0022D4 ComWorth Co.
-0022D5 Eaton Electrical Group Data Center Solutions - Pulizzi
-0022D6 Cypak AB
-0022D7 Nintendo Co.
-0022D8 Shenzhen GST Security and Safety Technology Limited
-0022D9 Fortex Industrial
-0022DA Anatek
-0022DB Translogic
-0022DC Vigil Health Solutions
-0022DD Protecta Electronics
-0022DE Oppo Digital
-0022DF Tamuz Monitors
-0022E0 Atlantic Software Technologies S.r.L.
-0022E1 Zort Labs
-0022E2 Wabtec Transit Division
-0022E3 Amerigon
-0022E4 Apass Technology CO.
-0022E5 Fisher-Rosemount Systems
-0022E6 Intelligent Data
-0022E7 WPS Parking Systems
-0022E8 Applition Co.
-0022E9 ProVision Communications
-0022EA Rustelcom
-0022EB Data Respons A/S
-0022EC Idealbt Technology
-0022ED TSI Power
-0022EE Algo Communication Products
-0022EF Ibis Tek
-0022F0 3 Greens Aviation Limited
-0022F1 Private
-0022F2 SunPower
-0022F3 Sharp
-0022F4 Ampak Technology
-0022F5 Advanced Realtime Tracking GmbH
-0022F6 Syracuse Research
-0022F7 Conceptronic
-0022F8 Pima Electronic Systems
-0022F9 Pollin Electronic GmbH
-0022FA Intel Corporate
-0022FB Intel Corporate
-0022FC Nokia Danmark A/S
-0022FD Nokia Danmark A/S
-0022FE Microprocessor Designs
-0022FF Nivis
-002300 Cayee Computer
-002301 Witron Technology Limited
-002302 Cobalt Digital
-002303 Lite-on IT
-002304 Cisco Systems
-002305 Cisco Systems
-002306 Alps Electric Co.
-002307 Future Innovation Tech Co.
-002308 Arcadyan Technology
-002309 Janam Technologies
-00230A Arburg Gmbh & Co KG
-00230B Motorola CHS
-00230C Clover Electronics Co.
-00230D Nortel Networks
-00230E Gorba AG
-00230F Hirsch Electronics
-002310 LNC Technology Co.
-002311 Gloscom Co.
-002312 Apple
-002313 Qool Technologies
-002314 Intel Corporate
-002315 Intel Corporate
-002316 Kisan Electronics CO
-002317 Lasercraft
-002318 Toshiba
-002319 Sielox
-00231A ITF Co.
-00231B Danaher Motion - Kollmorgen
-00231C Fourier Systems
-00231D Deltacom Electronics
-00231E Cezzer Multimedia Technologies
-00231F Guangda Electronic & Telecommunication Technology Development Co.
-002320 Nicira Network
-002321 Avitech International
-002322 Kiss Teknical Solutions
-002323 Zylin AS
-002324 G-pro Computer
-002325 Iolan Holding
-002326 Fujitsu Limited
-002327 Shouyo Electronics CO.
-002328 Alcon Telecommunications CO.
-002329 DDRdrive
-00232A eonas IT-Beratung und -Entwicklung GmbH
-00232B IRD A/S
-00232C Senticare
-00232D SandForce
-00232E Kedah Electronics Engineering
-00232F Advanced Card Systems
-002330 Dizipia
-002331 Nintendo Co.
-002332 Apple
-002333 Cisco Systems
-002334 Cisco Systems
-002335 Linkflex Co.
-002336 Metel S.r.o.
-002337 Global Star Solutions ULC
-002338 OJ-Electronics A/S
-002339 Samsung Electronics
-00233A Samsung Electronics Co.
-00233B C-Matic Systems
-00233C Alflex
-00233D novero GmbH
-00233E Alcatel-Lucent-IPD
-00233F Purechoice
-002340 MiX Telematics
-002341 Siemens Building Technologies Fire & Security Products GmbH & Co. oHG
-002342 Coffee Equipment Company
-002343 TEM AG
-002344 Objective Interface Systems
-002345 Sony Ericsson Mobile Communications
-002346 Vestac
-002347 ProCurve Networking by HP
-002348 Sagem Communication
-002349 Helmholtz Centre Berlin for Material and Energy
-00234A Private
-00234B Inyuan Technology
-00234C KTC AB
-00234D Hon Hai Precision Ind. Co.
-00234E Hon Hai Precision Ind. Co.
-00234F Luminous Power Technologies Pvt.
-002350 LynTec
-002351 2Wire
-002352 Datasensor S.p.a.
-002353 F E T Elettronica snc
-002354 Asustek Computer
-002355 Kinco Electric (Shanghai)
-002356 Packet Forensics
-002357 Pitronot Technologies and Engineering P.T.E.
-002358 Systel SA
-002359 Benchmark Electronics ( Thailand ) Public Company Limited
-00235A Compal Information (kunshan) CO.
-00235B Gulfstream
-00235C Aprius
-00235D Cisco Systems
-00235E Cisco Systems
-00235F Silicon Micro Sensors GmbH
-002360 Lookit Co.
-002361 Unigen
-002362 Goldline Controls
-002363 Zhuhai RaySharp Technology Co.
-002364 Power Instruments Pte
-002365 Elka-elektronik Gmbh
-002366 Beijing Siasun Electronic System Co.
-002367 UniControls a.s.
-002368 Motorola
-002369 Cisco-Linksys
-00236A ClearAccess
-00236B Xembedded
-00236C Apple
-00236D ResMed
-00236E Burster GmbH & Co KG
-00236F DAQ System
-002370 Pro-bel Limited
-002371 Soam Systel
-002372 More Star Industrial Group Limited
-002373 GridIron Systems
-002374 Motorola CHS
-002375 Motorola CHS
-002376 HTC
-002377 Isotek Electronics
-002378 GN Netcom A/S
-002379 Union Business Machines Co.
-00237A RIM
-00237B Whdi
-00237C Neotion
-00237D Hewlett Packard
-00237E Elster Gmbh
-00237F Plantronics
-002380 Nanoteq
-002381 Lengda Technology(Xiamen) Co.
-002382 Lih Rong Electronic Enterprise Co.
-002383 InMage Systems
-002384 GGH Engineering s.r.l.
-002385 Antipode
-002386 Tour & Andersson AB
-002387 ThinkFlood
-002388 V.T. Telematica S.p.a.
-002389 Hangzhou H3C Technologies Co.
-00238A Ciena
-00238B Quanta Computer
-00238C Private
-00238D Techno Design Co.
-00238E Pirelli Broadband Solutions
-00238F Nidec Copal
-002390 Algolware
-002391 Maxian
-002392 Proteus Industries
-002393 Ajinextek
-002394 Samjeon
-002395 Motorola CHS
-002396 Andes Technology
-002397 Westell Technologies
-002398 Sky Control
-002399 VD Division, Samsung Electronics Co.
-00239A EasyData Software GmbH
-00239B Elster Integrated Solutions
-00239C Juniper Networks
-00239D Mapower Electronics Co.
-00239E Jiangsu Lemote Technology Limited
-00239F Institut fr Prftechnik
-0023A0 Hana CNS Co.
-0023A1 Trend Electronics
-0023A2 Motorola CHS
-0023A3 Motorola CHS
-0023A4 New Concepts Development
-0023A5 SageTV
-0023A6 E-Mon
-0023A7 Redpine Signals
-0023A8 Marshall Electronics
-0023A9 Beijing Detianquan Electromechanical Equipment Co.
-0023AA HFR
-0023AB Cisco Systems
-0023AC Cisco Systems
-0023AD Xmark
-0023AE Dell
-0023AF Motorola Mobile Devices
-0023B0 Comxion Technology
-0023B1 Longcheer Technology (Singapore) Pte
-0023B2 Intelligent Mechatronic Systems
-0023B3 Lyyn AB
-0023B4 Nokia Danmark A/S
-0023B5 Ortana
-0023B6 Securite Communications / Honeywell
-0023B7 Q-Light Co.
-0023B8 Sichuan Jiuzhou Electronic Technology Co.
-0023B9 Eads Deutschland Gmbh
-0023BA Chroma
-0023BB Schmitt Industries
-0023BC EQ-SYS GmbH
-0023BD Digital Ally
-0023BE Cisco Spvtg
-0023BF Mainpine
-0023C0 Broadway Networks
-0023C1 Securitas Direct AB
-0023C2 Samsung Electronics. Co.
-0023C3 LogMeIn
-0023C4 Lux Lumen
-0023C5 Radiation Safety and Control Services
-0023C6 SMC
-0023C7 AVSystem
-0023C8 Team-r
-0023C9 Sichuan Tianyi Information Science & Technology Stock CO.
-0023CA Behind The Set
-0023CB Shenzhen Full-join Technology Co.
-0023CC Nintendo Co.
-0023CD Tp-link Technologies CO.
-0023CE Kita Denshi
-0023CF Cummins-allison
-0023D0 Uniloc USA
-0023D1 TRG
-0023D2 Inhand Electronics
-0023D3 AirLink WiFi Networking
-0023D4 Texas Instruments
-0023D5 Warema Electronic Gmbh
-0023D6 Samsung Electronics Co.
-0023D7 Samsung Electronics
-0023D8 Ball-It Oy
-0023D9 Banner Engineering
-0023DA Industrial Computer Source (Deutschland)GmbH
-0023DB saxnet gmbh
-0023DC Benein
-0023DD Elgin S.A.
-0023DE Ansync
-0023DF Apple
-0023E0 INO Therapeutics
-0023E1 Cavena Image Products AB
-0023E2 SEA Signalisation
-0023E3 Microtronic AG
-0023E4 IPnect co.
-0023E5 IPaXiom Networks
-0023E6 Pirkus
-0023E7 Hinke A/S
-0023E8 Demco
-0023E9 F5 Networks
-0023EA Cisco Systems
-0023EB Cisco Systems
-0023EC Algorithmix GmbH
-0023ED Motorola CHS
-0023EE Motorola CHS
-0023EF Zuend Systemtechnik AG
-0023F0 Shanghai Jinghan Weighing Apparatus Co.
-0023F1 Sony Ericsson Mobile Communications
-0023F2 TVLogic
-0023F3 Glocom
-0023F4 Masternaut
-0023F5 Wilo SE
-0023F6 Softwell Technology Co.
-0023F7 Private
-0023F8 ZyXEL Communications
-0023F9 Double-Take Software
-0023FA RG Nets
-0023FB IP Datatel
-0023FC Ultra Stereo Labs
-0023FD AFT Atlas Fahrzeugtechnik GmbH
-0023FE Biodevices
-0023FF Beijing Httc Technology
-002400 Nortel Networks
-002401 D-Link
-002402 Op-Tection GmbH
-002403 Nokia Danmark A/S
-002404 Nokia Danmark A/S
-002405 Dilog Nordic AB
-002406 Pointmobile
-002407 Telem SAS
-002408 Pacific Biosciences
-002409 The Toro Company
-00240A US Beverage Net
-00240B Virtual Computer
-00240C Delec Gmbh
-00240D OnePath Networks
-00240E Inventec Besta Co.
-00240F Ishii Tool & Engineering
-002410 Nueteq Technology
-002411 PharmaSmart
-002412 Benign Technologies Co
-002413 Cisco Systems
-002414 Cisco Systems
-002415 Magnetic Autocontrol GmbH
-002416 Any Use
-002417 Thomson Telecom Belgium
-002418 Nextwave Semiconductor
-002419 Private
-00241A Red Beetle
-00241B iWOW Communications Pte
-00241C FuGang Electronic (DG) Co.
-00241D Giga-byte Technology Co.
-00241E Nintendo Co.
-00241F DCT-Delta GmbH
-002420 NetUP
-002421 Micro-star Int'l CO.
-002422 Knapp Logistik Automation GmbH
-002423 AzureWave Technologies (Shanghai)
-002424 Axis Network Technology
-002425 Shenzhenshi chuangzhicheng Technology Co.
-002426 Nohmi Bosai
-002427 SSI Computer
-002428 EnergyICT
-002429 MK Master
-00242A Hittite Microwave
-00242B Hon Hai Precision Ind.Co.
-00242C Hon Hai Precision Ind. Co.
-00242D Ronan Engineering
-00242E Datastrip
-00242F VirtenSys
-002430 Ruby Tech
-002431 Uni-v co.
-002432 Neostar Technology Co.
-002433 Alps Electric Co.
-002434 Lectrosonics
-002435 Wide
-002436 Apple
-002437 Motorola - BSG
-002438 Foundry Networks
-002439 Essential Viewing Systems Limited
-00243A Ludl Electronic Products
-00243B Cssi (S) Pte
-00243C S.a.a.a.
-00243D Emerson Appliance Motors and Controls
-00243E Private
-00243F Storwize
-002440 Halo Monitoring
-002441 Wanzl Metallwarenfabrik GmbH
-002442 Axona Limited
-002443 Nortel Networks
-002444 Nintendo Co.
-002445 LiquidxStream Systems
-002446 MMB Research
-002447 Kaztek Systems
-002448 SpiderCloud Wireless
-002449 Shen Zhen Lite Star Electronics Technology Co.
-00244A Voyant International
-00244B Perceptron
-00244C Solartron Metrology
-00244D Hokkaido Electronics
-00244E RadChips
-00244F Asantron Technologies
-002450 Cisco Systems
-002451 Cisco Systems
-002452 Silicon Software GmbH
-002453 Initra d.o.o.
-002454 Samsung Electronics Co.
-002455 MuLogic BV
-002456 2Wire
-002457 Hammock Coporation
-002458 PA Bastion CC
-002459 ABB Stotz-kontakt Gmbh
-00245A Nanjing Panda Electronics Company Limited
-00245B Raidon Technology
-00245C Design-Com Technologies
-00245D Terberg besturingstechniek B.V.
-00245E Hivision Co.
-00245F Vine Telecom CO.
-002460 Giaval Science Development Co.
-002461 Shin Wang Tech.
-002462 Rayzone
-002463 Phybridge
-002464 Bridge Technologies Co AS
-002465 Elentec
-002466 Unitron nv
-002467 AOC International (Europe) GmbH
-002468 Sumavision Technologies Co.
-002469 Smart Doorphones
-00246A Solid Year Co.
-00246B Coventive
-00246C Aruba Networks
-00246D Weinzierl Engineering GmbH
-00246E Phihong USA
-00246F Onda Communication spa
-002470 Aurotech Ultrasound AS.
-002471 Fusion MultiSystems dba Fusion-io
-002472 ReDriven Power
-002473 3Com Europe
-002474 Autronica Fire And Securirty
-002475 Compass System(Embedded Dept.)
-002476 TAP.tv
-002477 Tibbo Technology
-002478 Mag Tech Electronics Co Limited
-002479 Optec Displays
-00247A FU YI Cheng Technology Co.
-00247B Actiontec Electronics
-00247C Nokia Danmark A/S
-00247D Nokia Danmark A/S
-00247E USI
-00247F Nortel Networks
-002480 Meteocontrol GmbH
-002481 Hewlett Packard
-002482 Ruckus Wireless
-002483 LG Electronics
-002484 Bang and Olufsen Medicom a/s
-002485 ConteXtream
-002486 DesignArt Networks
-002487 Blackboard
-002488 Centre For Development Of Telematics
-002489 Vodafone Omnitel N.V.
-00248A Kaga Electronics Co.
-00248B Hybus CO.
-00248C Asustek Computer
-00248D Sony Computer Entertainment
-00248E Infoware ZRt.
-00248F Do-monix
-002490 Samsung Electronics Co.
-002491 Samsung Electronics
-002492 Motorola, Broadband Solutions Group
-002493 Motorola
-002494 Shenzhen Baoxin Tech CO.
-002495 Motorola Mobile Devices
-002496 Ginzinger electronic systems
-002497 Cisco Systems
-002498 Cisco Systems
-002499 Aquila Technologies
-00249A Beijing Zhongchuang Telecommunication Test Co.
-00249B Action Star Enterprise Co.
-00249C Bimeng Comunication System Co.
-00249D NES Technology
-00249E ADC-Elektronik GmbH
-00249F RIM Testing Services
-0024A0 Motorola CHS
-0024A1 Motorola CHS
-0024A2 Hong Kong Middleware Technology Limited
-0024A3 Sonim Technologies
-0024A4 Siklu Communication
-0024A5 Buffalo
-0024A6 Telestar Digital Gmbh
-0024A7 Advanced Video Communications
-0024A8 ProCurve Networking by HP
-0024A9 Ag Leader Technology
-0024AA Dycor Technologies
-0024AB A7 Engineering
-0024AC Hangzhou DPtech Technologies Co.
-0024AD Adolf Thies Gmbh & Co. KG
-0024AE Sagem Securite
-0024AF EchoStar Technologies
-0024B0 Esab AB
-0024B1 Coulomb Technologies
-0024B2 Netgear
-0024B3 Graf-Syteco GmbH & Co. KG
-0024B4 Escatronic Gmbh
-0024B5 Nortel Networks
-0024B6 Seagate Technology
-0024B7 GridPoint
-0024B8 free alliance sdn bhd
-0024B9 Wuhan Higheasy Electronic Technology DevelopmentLtd
-0024BA Texas Instruments
-0024BB Central
-0024BC HuRob Co.
-0024BD Hainzl Industriesysteme GmbH
-0024BE Sony
-0024BF Ciat
-0024C0 NTI Comodo
-0024C1 Hangzhou Motorola Technologies
-0024C2 Asumo Co.
-0024C3 Cisco Systems
-0024C4 Cisco Systems
-0024C5 Meridian Audio Limited
-0024C6 Hager Electro SAS
-0024C7 Mobilarm
-0024C8 Broadband Solutions Group
-0024C9 Broadband Solutions Group
-0024CA Tobii Technology AB
-0024CB Autonet Mobile
-0024CC Fascinations Toys and Gifts
-0024CD Willow Garage
-0024CE Exeltech
-0024CF Inscape Data
-0024D0 Shenzhen Sogood Industry Co.
-0024D1 Thomson
-0024D2 Askey Computer
-0024D3 Qualica
-0024D4 Freebox SA
-0024D5 Winward Industrial Limited
-0024D6 Intel Corporate
-0024D7 Intel Corporate
-0024D8 IlSung Precision
-0024D9 Bicom
-0024DA Innovar Systems Limited
-0024DB Alcohol Monitoring Systems
-0024DC Juniper Networks
-0024DD Centrak
-0024DE Global Technology
-0024DF Digitalbox Europe GmbH
-0024E0 DS Tech
-0024E1 Convey Computer
-0024E2 Hasegawa Electric Co.
-0024E3 CAO Group
-0024E4 Withings
-0024E5 Seer Technology
-0024E6 In Motion Technology
-0024E7 Plaster Networks
-0024E8 Dell
-0024E9 Samsung Electronics Co.,, Storage System Division
-0024EA iris-GmbH infrared & intelligent sensors
-0024EB ClearPath Networks
-0024EC United Information Technology Co.
-0024ED YT Elec. Co
-0024EE Aictek Co.
-0024EF Sony Ericsson Mobile Communications
-0024F0 Seanodes
-0024F1 Shenzhen Fanhai Sanjiang Electronics Co.
-0024F2 Uniphone Telecommunication Co.
-0024F3 Nintendo Co.
-0024F4 Kaminario Technologies
-0024F5 NDS Surgical Imaging
-0024F6 Miyoshi Electronics
-0024F7 Cisco Systems
-0024F8 Technical Solutions Company
-0024F9 Cisco Systems
-0024FA Hilger u. Kern Gmbh
-0024FB Private
-0024FC QuoPin Co.
-0024FD Prosilient Technologies AB
-0024FE AVM GmbH
-0024FF QLogic
-002500 Apple
-002501 JSC "Supertel"
-002502 NaturalPoint
-002503 Blade Network Technology
-002504 Valiant Communications Limited
-002505 eks Engel GmbH & Co. KG
-002506 A.I. Antitaccheggio Italia SRL
-002507 Astak
-002508 Maquet Cardiopulmonary AG
-002509 Sharetronic Group
-00250A Security Expert Co.
-00250B Centrofactor
-00250C Enertrac
-00250D GZT Telkom-Telmor sp. z o.o.
-00250E gt german telematics gmbh
-00250F On-Ramp Wireless
-002510 Pico-Tesla Magnetic Therapies
-002511 Elitegroup Computer System CO.
-002512 ZTE
-002513 CXP Digital BV
-002514 PC Worth Int'l Co.
-002515 Neuf Cegetel
-002516 Integrated Design Tools
-002517 Venntis
-002518 Power Plus Communications AG
-002519 Viaas
-00251A Psiber Data Systems
-00251B Philips CareServant
-00251C EDT
-00251D DSA Encore
-00251E Rotel Technologies
-00251F Zynus Vision
-002520 SMA Railway Technology GmbH
-002521 Logitek Electronic Systems
-002522 ASRock Incorporation
-002523 OCP
-002524 Lightcomm Technology Co.
-002525 Ctera Networks
-002526 Genuine Technologies Co.
-002527 Bitrode
-002528 Daido Signal Co.
-002529 Comelit Group S.P.A
-00252A Chengdu GeeYa Technology Co.
-00252B Stirling Energy Systems
-00252C Entourage Systems
-00252D Kiryung Electronics
-00252E Cisco Spvtg
-00252F Energy
-002530 Aetas Systems
-002531 Cloud Engines
-002532 Digital Recorders
-002533 Wittenstein AG
-002534 Private
-002535 Minimax GmbH & Co KG
-002536 Oki Electric Industry Co.
-002537 Runcom Technologies
-002538 Samsung Electronics Co.,, Memory Division
-002539 IfTA GmbH
-00253A CEVA
-00253B din Dietmar Nocker Facilitymanagement GmbH
-00253C 2Wire
-00253D DRS Consolidated Controls
-00253E Telemetric
-00253F Private
-002540 Quasar Technologies
-002541 Maquet Critical Care AB
-002542 Pittasoft
-002543 Moneytech
-002544 LoJack
-002545 Cisco Systems
-002546 Cisco Systems
-002547 Nokia Danmark A/S
-002548 Nokia Danmark A/S
-002549 Jeorich Tech. Co.
-00254A RingCube Technologies
-00254B Apple
-00254C Videon Central
-00254D Singapore Technologies Electronics Limited
-00254E Vertex Wireless Co.
-00254F Elettrolab Srl
-002550 Mazu Networks
-002551 SE-Elektronic GmbH
-002552 VXI
-002553 Pirelli Broadband Solutions
-002554 Pixel8 Networks
-002555 Visonic Technologies 1993
-002556 Hon Hai Precision Ind. Co.
-002557 Research In Motion
-002558 Mpedia
-002559 Syphan Technologies
-00255A Tantalus Systems
-00255B CoachComm
-00255C NEC
-00255D Morningstar
-00255E Shanghai Dare Technologies Co.
-00255F SenTec AG
-002560 Ibridge Networks & Communications
-002561 ProCurve Networking by HP
-002562 interbro Co.
-002563 Luxtera
-002564 Dell
-002565 Vizimax
-002566 Samsung Electronics Co.
-002567 Samsung Electronics
-002568 Shenzhen Huawei Communication Technologies Co.
-002569 Sagem Communication
-00256A inIT - Institut Industrial IT
-00256B Atenix E.E. S.r.l.
-00256C "Azimut" Production Association JSC
-00256D Broadband Forum
-00256E Van Breda B.V.
-00256F Dantherm Power
-002570 Eastern Communications Company Limited
-002571 Zhejiang Tianle Digital Electric Co.
-002572 Nemo-Q International AB
-002573 ST Electronics (Info-Security) Pte
-002574 Kunimi Media Device Co.
-002575 FiberPlex
-002576 Neli Technologies
-002577 D-BOX Technologies
-002578 JSC "Concern "Sozvezdie"
-002579 J & F Labs
-00257A Camco Produktions- und Vertriebs-gmbh fr Beschallungs- und Beleuchtungsanlagen
-00257B STJ Electronics PVT
-00257C Huachentel Technology Development Co.
-00257D PointRed Telecom Private
-00257E NEW POS Technology Limited
-00257F CallTechSolution Co.
-002580 Equipson S.A.
-002581 x-star networks
-002582 Maksat Technologies (P)
-002583 Cisco Systems
-002584 Cisco Systems
-002585 Kokuyo S&T Co.
-002586 Tp-link Technologies Co.
-002587 Vitality
-002588 Genie Industries
-002589 Hills Industries Limited
-00258A Pole/Zero
-00258B Mellanox Technologies
-00258C Esus Elektronik SAN. VE DIS. TIC. STI.
-00258D Haier
-00258E The Weather Channel
-00258F Trident Microsystems
-002590 Super Micro Computer
-002591 Nextek
-002592 Guangzhou Shirui Electronic Co.
-002593 DatNet Informatikai Kft.
-002594 Eurodesign BG
-002595 Northwest Signal Supply
-002596 Gigavision srl
-002597 Kalki Communication Technologies
-002598 Zhong Shan City Litai Electronic Industrial Co.
-002599 Hedon e.d. B.V.
-00259A CEStronics GmbH
-00259B Beijing Pkunity Microsystems Technology Co.
-00259C Cisco-Linksys
-00259D Private
-00259E Huawei Technologies Co.
-00259F TechnoDigital Technologies GmbH
-0025A0 Nintendo Co.
-0025A1 Enalasys
-0025A2 Alta Definicion Linceo S.L.
-0025A3 Trimax Wireless
-0025A4 EuroDesign embedded technologies GmbH
-0025A5 Walnut Media Network
-0025A6 Central Network Solution Co.
-0025A7 Comverge
-0025A8 Kontron (BeiJing) Technology Co.
-0025A9 Shanghai Embedway Information Technologies Co.
-0025AA Beijing Soul Technology Co.
-0025AB AIO LCD PC BU / TPV
-0025AC I-Tech
-0025AD Manufacturing Resources International
-0025AE Microsoft
-0025AF Comfile Technology
-0025B0 Schmartz
-0025B1 Maya-Creation
-0025B2 Ope2
-0025B3 Hewlett Packard
-0025B4 Cisco Systems
-0025B5 Cisco Systems
-0025B6 Telecom FM
-0025B7 Costar electronics
-0025B8 Agile Communications
-0025B9 Agilink Systems
-0025BA Alcatel-Lucent IPD
-0025BB Innerint Co.
-0025BC Apple
-0025BD Italdata Ingegneria dell'Idea S.p.A.
-0025BE Tektrap Systems
-0025BF Wireless Cables
-0025C0 ZillionTV
-0025C1 Nawoo Korea
-0025C2 RingBell Co.
-0025C3 Nortel Networks
-0025C4 Ruckus Wireless
-0025C5 Star Link Communication Pvt.
-0025C6 kasercorp
-0025C7 altek
-0025C8 S-Access GmbH
-0025C9 Shenzhen Huapu Digital CO.
-0025CA LS Research
-0025CB Reiner SCT
-0025CC Mobile Communications Korea Incorporated
-0025CD Skylane Optics
-0025CE InnerSpace
-0025CF Nokia Danmark A/S
-0025D0 Nokia Danmark A/S
-0025D1 Eastech Electronics (Taiwan)
-0025D2 InpegVision Co.
-0025D3 AzureWave Technologies
-0025D4 Fortress Technologies
-0025D5 Robonica (Pty)
-0025D6 The Kroger Co.
-0025D7 Cedo
-0025D8 Korea Maintenance
-0025D9 DataFab Systems
-0025DA Secura Key
-0025DB ATI Electronics(Shenzhen) Co.
-0025DC Sumitomo Electric Networks
-0025DD Sunnytek Information CO.
-0025DE Probits Co.
-0025DF Private
-0025E0 CeedTec Sdn Bhd
-0025E1 Shanghai Seeyoo Electronic & Technology CO.
-0025E2 Everspring Industry Co.
-0025E3 Hanshinit
-0025E4 Omni-wifi
-0025E5 LG Electronics
-0025E6 Belgian Monitoring Systems bvba
-0025E7 Sony Ericsson Mobile Communications
-0025E8 Idaho Technology
-0025E9 i-mate Development
-0025EA Iphion BV
-0025EB Reutech Radar Systems (PTY)
-0025EC Humanware
-0025ED NuVo Technologies
-0025EE Avtex
-0025EF I-TEC Co.
-0025F0 Suga Electronics Limited
-0025F1 Motorola CHS
-0025F2 Motorola CHS
-0025F3 Nordwestdeutsche Zhlerrevision
-0025F4 KoCo Connector AG
-0025F5 DVS Korea, Co.
-0025F6 netTALK.com
-0025F7 Ansaldo STS USA
-0025F8 Zamir Recognition Systems
-0025F9 GMK electronic design GmbH
-0025FA J&M Analytik AG
-0025FB Tunstall Healthcare A/S
-0025FC Enda Endustriyel Elektronik STI.
-0025FD OBR Centrum Techniki Morskiej S.A.
-0025FE Pilot Electronics
-0025FF CreNova Technology GmbH
-002600 Teac Australia
-002601 Private
-002602 Smart Temps
-002603 Shenzhen Wistar Technology Co.
-002604 Audio Processing Technology
-002605 CC Systems AB
-002606 Raumfeld Gmbh
-002607 Enabling Technology
-002608 Apple
-002609 Phyllis Co.
-00260A Cisco Systems
-00260B Cisco Systems
-00260C Dataram
-00260D Micronetics
-00260E Ablaze Systems
-00260F Linn Products
-002610 Apacewave Technologies
-002611 Licera AB
-002612 Space Exploration Technologies
-002613 Engel Axil S.L.
-002614 Ktnf
-002615 Teracom Limited
-002616 Rosemount
-002617 OEM Worldwide
-002618 Asustek Computer
-002619 FRC
-00261A Femtocomm System Technology
-00261B Laurel Bank Machines CO.
-00261C Neovia
-00261D COP Security System
-00261E Qingbang Elec(sz) CO.
-00261F SAE Magnetics (H.K.)
-002620 Isgus Gmbh
-002621 InteliCloud Technology
-002622 Compal Information (kunshan) CO.
-002623 JRD Communication
-002624 Thomson
-002625 MediaSputnik
-002626 Geophysical Survey Systems
-002627 Truesell
-002628 companytec automao e controle ltda
-002629 Juphoon System Software
-00262A Proxense
-00262B Wongs Electronics Co.
-00262C IKT Advanced Technologies s.r.o.
-00262D Wistron
-00262E Chengdu Jiuzhou Electronic Technology
-00262F Hamamatsu TOA Electronics
-002630 AcorelS
-002631 Commtact
-002632 Instrumentation Technologies d.d.
-002633 MIR - Medical International Research
-002634 Infineta Systems
-002635 Bluetechnix GmbH
-002636 Motorola Mobile Devices
-002637 Samsung Electro-Mechanics
-002638 Xia Men Joyatech Co.
-002639 T.M. Electronics
-00263A Digitec Systems
-00263B Onbnetech
-00263C Bachmann GmbH & Co. KG
-00263D MIA
-00263E Trapeze Networks
-00263F Lios Technology Gmbh
-002640 Baustem Broadband Technologies
-002641 Motorola
-002642 Motorola
-002643 Alps Electric Co.
-002644 Thomson Telecom Belgium
-002645 Circontrol S.A.
-002646 Shenyang Tongfang Multimedia Technology Company Limited
-002647 WFE Technology
-002648 Emitech
-002649 StockerYale
-00264A Apple
-00264B WaveIP
-002654 3Com
-003000 Allwell Technology
-003001 SMP
-003002 Expand Networks
-003003 Phasys
-003004 Leadtek Research
-003005 Fujitsu Siemens Computers
-003006 Superpower Computer
-003007 OPTI
-003008 Avio Digital
-003009 Tachion Networks
-00300A Aztech Systems
-00300B mPHASE Technologies
-00300C Congruency
-00300D MMC Technology
-00300E Klotz Digital AG
-00300F IMT - Information Management
-003010 Visionetics International
-003011 HMS Fieldbus Systems AB
-003012 Digital Engineering
-003013 NEC
-003014 Divio
-003015 CP Clare
-003016 Ishida CO.
-003017 BlueArc UK
-003018 Jetway Information Co.
-003019 Cisco Systems
-00301A Smartbridges PTE.
-00301B Shuttle
-00301C Altvater Airdata Systems
-00301D Skystream
-00301E 3COM Europe
-00301F Optical Networks
-003020 TSI
-003021 Hsing TECH. Enterprise Co.
-003022 Fong Kai Industrial Co.
-003023 Cogent Computer Systems
-003024 Cisco Systems
-003025 Checkout Computer Systems
-003026 HeiTel Digital Video GmbH
-003027 Kerbango
-003028 Fase Saldatura srl
-003029 Opicom
-00302A Southern Information
-00302B Inalp Networks
-00302C Sylantro Systems
-00302D Quantum Bridge Communications
-00302E Hoft & Wessel AG
-00302F GE Aviation System
-003030 Harmonix
-003031 Lightwave Communications
-003032 MagicRam
-003033 Orient Telecom CO.
-003034 SET Engineering
-003035 Corning Incorporated
-003036 RMP Elektroniksysteme Gmbh
-003037 Packard Bell Nec Services
-003038 XCP
-003039 Softbook Press
-00303A Maatel
-00303B PowerCom Technology
-00303C Onnto
-00303D IVA
-00303E Radcom
-00303F TurboComm Tech
-003040 Cisco Systems
-003041 Saejin T & M CO.
-003042 DeTeWe-Deutsche Telephonwerke
-003043 Idream Technologies, PTE.
-003044 Portsmith
-003045 Village Networks, (VNI)
-003046 Controlled Electronic Manageme
-003047 Nissei Electric CO.
-003048 Supermicro Computer
-003049 Bryant Technology
-00304A Fraunhofer Ipms
-00304B Orbacom Systems
-00304C Appian Communications
-00304D ESI
-00304E Bustec Production
-00304F Planet Technology
-003050 Versa Technology
-003051 Orbit Avionic & Communication
-003052 Elastic Networks
-003053 Basler AG
-003054 Castlenet Technology
-003055 Renesas Technology America
-003056 Beck IPC GmbH
-003057 QTelNet
-003058 API Motion
-003059 Digital-logic AG
-00305A Telgen
-00305B Toko
-00305C Smar Laboratories
-00305D Digitra Systems
-00305E Abelko Innovation
-00305F Hasselblad
-003060 Powerfile
-003061 MobyTEL
-003062 Path 1 Network Technol's
-003063 Santera Systems
-003064 Adlink Technology
-003065 Apple Computer
-003066 Cirronet
-003067 Biostar Microtech Int'l
-003068 Cybernetics TECH. CO.
-003069 Impacct Technology
-00306A Penta Media CO.
-00306B Cmos Systems
-00306C Hitex Holding GmbH
-00306D Lucent Technologies
-00306E Hewlett Packard
-00306F Seyeon TECH. CO.
-003070 1Net
-003071 Cisco Systems
-003072 Intellibyte
-003073 International Microsystems
-003074 Equiinet
-003075 Adtech
-003076 Akamba
-003077 Onprem Networks
-003078 Cisco Systems
-003079 CQOS
-00307A Advanced Technology & Systems
-00307B Cisco Systems
-00307C Adid SA
-00307D GRE America
-00307E Redflex Communication Systems
-00307F Irlan
-003080 Cisco Systems
-003081 Altos C&C
-003082 Taihan Electric Wire CO.
-003083 Ivron Systems
-003084 Allied Telesyn Internaional
-003085 Cisco Systems
-003086 Transistor Devices
-003087 Vega Grieshaber KG
-003088 Siara Systems
-003089 Spectrapoint Wireless
-00308A Nicotra Sistemi S.P.A
-00308B Brix Networks
-00308C Quantum
-00308D Pinnacle Systems
-00308E Cross Match Technologies
-00308F Micrilor
-003090 Cyra Technologies
-003091 Taiwan First Line ELEC.
-003092 ModuNORM GmbH
-003093 Sonnet Technologies
-003094 Cisco Systems
-003095 Procomp Informatics
-003096 Cisco Systems
-003097 AB Regin
-003098 Global Converging Technologies
-003099 Boenig UND Kallenbach OHG
-00309A Astro Terra
-00309B Smartware
-00309C Timing Applications
-00309D Nimble Microsystems
-00309E Workbit
-00309F Amber Networks
-0030A0 Tyco Submarine Systems
-0030A1 Webgate
-0030A2 Lightner Engineering
-0030A3 Cisco Systems
-0030A4 Woodwind Communications System
-0030A5 Active Power
-0030A6 Vianet Technologies
-0030A7 Schweitzer Engineering
-0030A8 Ol'e Communications
-0030A9 Netiverse
-0030AA Axus Microsystems
-0030AB Delta Networks
-0030AC Systeme Lauer GmbH & Co.
-0030AD Shanghai Communication
-0030AE Times N System
-0030AF Honeywell GmbH
-0030B0 Convergenet Technologies
-0030B1 aXess-pro networks GmbH
-0030B2 L-3 Sonoma EO
-0030B3 San Valley Systems
-0030B4 Intersil
-0030B5 Tadiran Microwave Networks
-0030B6 Cisco Systems
-0030B7 Teletrol Systems
-0030B8 RiverDelta Networks
-0030B9 Ectel
-0030BA Ac&t System CO.
-0030BB CacheFlow
-0030BC Optronic AG
-0030BD Belkin Components
-0030BE City-Net Technology
-0030BF Multidata Gmbh
-0030C0 Lara Technology
-0030C1 Hewlett-packard
-0030C2 Comone
-0030C3 Flueckiger Elektronik AG
-0030C4 Canon Imaging Systems
-0030C5 Cadence Design Systems
-0030C6 Control Solutions
-0030C7 Macromate
-0030C8 GAD LINE
-0030C9 LuxN
-0030CA Discovery Com
-0030CB Omni Flow Computers
-0030CC Tenor Networks
-0030CD Conexant Systems
-0030CE Zaffire
-0030CF TWO Technologies
-0030D0 Tellabs
-0030D1 Inova
-0030D2 WIN Technologies, CO.
-0030D3 Agilent Technologies
-0030D4 AAE Systems
-0030D5 DResearch GmbH
-0030D6 MSC Vertriebs Gmbh
-0030D7 Innovative Systems, L.L.C.
-0030D8 Sitek
-0030D9 Datacore Software
-0030DA Comtrend CO.
-0030DB Mindready Solutions
-0030DC Rightech
-0030DD Indigita
-0030DE Wago Kontakttechnik Gmbh
-0030DF Kb/tel Telecomunicaciones
-0030E0 Oxford Semiconductor
-0030E1 Acrotron Systems
-0030E2 Garnet Systems CO.
-0030E3 Sedona Networks
-0030E4 Chiyoda System Riken
-0030E5 Amper Datos S.A.
-0030E6 Draeger Medical Systems
-0030E7 CNF Mobile Solutions
-0030E8 Ensim
-0030E9 GMA Communication Manufact'g
-0030EA TeraForce Technology
-0030EB Turbonet Communications
-0030EC Borgardt
-0030ED Expert Magnetics
-0030EE DSG Technology
-0030EF Neon Technology
-0030F0 Uniform Industrial
-0030F1 Accton Technology
-0030F2 Cisco Systems
-0030F3 At Work Computers
-0030F4 Stardot Technologies
-0030F5 Wild Lab.
-0030F6 Securelogix
-0030F7 Ramix
-0030F8 Dynapro Systems
-0030F9 Sollae Systems Co.
-0030FA Telica
-0030FB AZS Technology AG
-0030FC Terawave Communications
-0030FD Integrated Systems Design
-0030FE DSA GmbH
-0030FF Datafab Systems
-004000 PCI Componentes DA Amzonia
-004001 Zyxel Communications
-004002 Perle Systems Limited
-004003 Emerson Process Management Power & Water Solutions
-004004 ICM CO.
-004005 ANI Communications
-004006 Sampo Technology
-004007 Telmat Informatique
-004008 A Plus Info
-004009 Tachibana Tectron CO.
-00400A Pivotal Technologies
-00400B Cisco Systems
-00400C General Micro Systems
-00400D Lannet Data Communications
-00400E Memotec Communications
-00400F Datacom Technologies
-004010 Sonic Systems
-004011 Andover Controls
-004012 Windata
-004013 NTT Data COMM. Systems
-004014 Comsoft Gmbh
-004015 Ascom Infrasys AG
-004016 ADC - Global Connectivity Solutions Division
-004017 Silex Technology America
-004018 Adobe Systems
-004019 Aeon Systems
-00401A Fuji Electric CO.
-00401B Printer Systems
-00401C AST Research
-00401D Invisible Software
-00401E ICC
-00401F Colorgraph
-004020 Tyco Electronics (UK)
-004021 Raster Graphics
-004022 Klever Computers
-004023 Logic
-004024 Compac
-004025 Molecular Dynamics
-004026 Melco
-004027 SMC Massachusetts
-004028 Netcomm Limited
-004029 Compex
-00402A Canoga-perkins
-00402B Trigem Computer
-00402C Isis Distributed Systems
-00402D Harris Adacom
-00402E Precision Software
-00402F Xlnt Designs
-004030 GK Computer
-004031 Kokusai Electric CO.
-004032 Digital Communications
-004033 Addtron Technology CO.
-004034 Bustek
-004035 Opcom
-004036 Tribe Computer Works
-004037 Sea-ilan
-004038 Talent Electric Incorporated
-004039 Optec Daiichi Denko CO.
-00403A Impact Technologies
-00403B Synerjet International
-00403C Forks
-00403D Teradata
-00403E Raster OPS
-00403F Ssangyong Computer Systems
-004040 Ring Access
-004041 Fujikura
-004042 N.a.t. Gmbh
-004043 Nokia Siemens Networks GmbH & Co. KG.
-004044 Qnix Computer CO.
-004045 Twinhead
-004046 UDC Research Limited
-004047 Wind River Systems
-004048 SMD Informatica S.A.
-004049 Tegimenta AG
-00404A West Australian Department
-00404B Maple Computer Systems
-00404C Hypertec
-00404D Telecommunications Techniques
-00404E Fluent
-00404F Space & Naval Warfare Systems
-004050 Ironics, Incorporated
-004051 Gracilis
-004052 Star Technologies
-004053 Ampro Computers
-004054 Connection Machines Services
-004055 Metronix Gmbh
-004056 MCM Japan
-004057 Lockheed - Sanders
-004058 Kronos
-004059 Yoshida Kogyo K. K.
-00405A Goldstar Information & COMM.
-00405B Funasset Limited
-00405C Future Systems
-00405D Star-tek
-00405E North Hills Israel
-00405F AFE Computers
-004060 Comendec
-004061 Datatech Enterprises CO.
-004062 E-systems,/garland DIV.
-004063 VIA Technologies
-004064 KLA Instruments
-004065 GTE Spacenet
-004066 Hitachi Cable
-004067 Omnibyte
-004068 Extended Systems
-004069 Lemcom Systems
-00406A Kentek Information Systems
-00406B Sysgen
-00406C Copernique
-00406D Lanco
-00406E Corollary
-00406F Sync Research
-004070 Interware CO.
-004071 ATM Computer Gmbh
-004072 Applied Innovation
-004073 Bass Associates
-004074 Cable AND Wireless
-004075 M-trade (uk)
-004076 Sun Conversion Technologies
-004077 Maxton Technology
-004078 Wearnes Automation PTE
-004079 Juko Manufacture Company
-00407A Societe D'exploitation DU Cnit
-00407B Scientific Atlanta
-00407C Qume
-00407D Extension Technology
-00407E Evergreen Systems
-00407F Flir Systems
-004080 Athenix
-004081 Mannesmann Scangraphic Gmbh
-004082 Laboratory Equipment
-004083 TDA Industria DE Produtos
-004084 Honeywell
-004085 Saab Instruments AB
-004086 Michels & Kleberhoff Computer
-004087 Ubitrex
-004088 Mobius Technologies
-004089 Meidensha
-00408A TPS Teleprocessing SYS. Gmbh
-00408B Raylan
-00408C Axis Communications AB
-00408D THE Goodyear Tire & Rubber CO.
-00408E Digilog
-00408F Wm-data Minfo AB
-004090 Ansel Communications
-004091 Procomp Industria Eletronica
-004092 ASP Computer Products
-004093 Paxdata Networks
-004094 Shographics
-004095 R.p.t. Intergroups Int'l
-004096 Cisco Systems
-004097 Datex Division OF
-004098 Dressler Gmbh & CO.
-004099 Newgen Systems
-00409A Network Express
-00409B HAL Computer Systems
-00409C Transware
-00409D Digiboard
-00409E Concurrent Technologies
-00409F Lancast/casat Technology
-0040A0 Goldstar CO.
-0040A1 Ergo Computing
-0040A2 Kingstar Technology
-0040A3 Microunity Systems Engineering
-0040A4 Rose Electronics
-0040A5 Clinicomp INTL.
-0040A6 Cray
-0040A7 Itautec Philco S.A.
-0040A8 IMF International
-0040A9 Datacom
-0040AA Valmet Automation
-0040AB Roland DG
-0040AC Super Workstation
-0040AD SMA Regelsysteme Gmbh
-0040AE Delta Controls
-0040AF Digital Products
-0040B0 Bytex, Engineering
-0040B1 Codonics
-0040B2 Systemforschung
-0040B3 PAR Microsystems
-0040B4 Nextcom K.K.
-0040B5 Video Technology Computers
-0040B6 Computerm
-0040B7 Stealth Computer Systems
-0040B8 Idea Associates
-0040B9 Macq Electronique SA
-0040BA Alliant Computer Systems
-0040BB Goldstar Cable CO.
-0040BC Algorithmics
-0040BD Starlight Networks
-0040BE Boeing Defense & Space
-0040BF Channel Systems Intern'l
-0040C0 Vista Controls
-0040C1 Bizerba-werke Wilheim Kraut
-0040C2 Applied Computing Devices
-0040C3 Fischer AND Porter CO.
-0040C4 Kinkei System
-0040C5 Micom Communications
-0040C6 Fibernet Research
-0040C7 Ruby Tech
-0040C8 Milan Technology
-0040C9 Ncube
-0040CA First Internat'l Computer
-0040CB Lanwan Technologies
-0040CC Silcom Manuf'g Technology
-0040CD Tera Microsystems
-0040CE Net-source
-0040CF Strawberry TREE
-0040D0 Mitac International
-0040D1 Fukuda Denshi CO.
-0040D2 Pagine
-0040D3 Kimpsion International
-0040D4 Gage Talker
-0040D5 Sartorius AG
-0040D6 Locamation B.V.
-0040D7 Studio GEN
-0040D8 Ocean Office Automation
-0040D9 American Megatrends
-0040DA Telspec
-0040DB Advanced Technical Solutions
-0040DC Tritec Electronic Gmbh
-0040DD Hong Technologies
-0040DE Elettronica SAN Giorgio
-0040DF Digalog Systems
-0040E0 Atomwide
-0040E1 Marner International
-0040E2 Mesa Ridge Technologies
-0040E3 Quin Systems
-0040E4 E-M Technology
-0040E5 Sybus
-0040E6 C.a.e.n.
-0040E7 Arnos Instruments & Computer
-0040E8 Charles River Data Systems
-0040E9 Accord Systems
-0040EA Plain Tree Systems
-0040EB Martin Marietta
-0040EC Mikasa System Engineering
-0040ED Network Controls Int'natl
-0040EE Optimem
-0040EF Hypercom
-0040F0 Micro Systems
-0040F1 Chuo Electronics CO.
-0040F2 Janich & Klass Computertechnik
-0040F3 Netcor
-0040F4 Cameo Communications
-0040F5 OEM Engines
-0040F6 Katron Computers
-0040F7 Polaroid
-0040F8 Systemhaus Discom
-0040F9 Combinet
-0040FA Microboards
-0040FB Cascade Communications
-0040FC IBR Computer Technik Gmbh
-0040FD LXE
-0040FE Symplex Communications
-0040FF Telebit
-004252 RLX Technologies
-004501 Versus Technology
-005000 Nexo Communications
-005001 Yamashita Systems
-005002 Omnisec AG
-005003 Gretag Macbeth AG
-005004 3com
-005006 TAC AB
-005007 Siemens Telecommunication Systems Limited
-005008 Tiva Microcomputer (tmc)
-005009 Philips Broadband Networks
-00500A Iris Technologies
-00500B Cisco Systems
-00500C e-Tek Labs
-00500D Satori Electoric CO.
-00500E Chromatis Networks
-00500F Cisco Systems
-005010 NovaNET Learning
-005012 CBL - Gmbh
-005013 Chaparral Network Storage
-005014 Cisco Systems
-005015 Bright Star Engineering
-005016 Sst/woodhead Industries
-005017 RSR S.r.l.
-005018 AMIT
-005019 Spring Tide Networks
-00501A IQinVision
-00501B ABL Canada
-00501C Jatom Systems
-00501E Miranda Technologies
-00501F MRG Systems
-005020 Mediastar CO.
-005021 EIS International
-005022 Zonet Technology
-005023 PG Design Electronics
-005024 Navic Systems
-005026 Cosystems
-005027 Genicom
-005028 Aval Communications
-005029 1394 Printer Working Group
-00502A Cisco Systems
-00502B Genrad
-00502C Soyo Computer
-00502D Accel
-00502E Cambex
-00502F TollBridge Technologies
-005030 Future Plus Systems
-005031 Aeroflex Laboratories
-005032 Picazo Communications
-005033 Mayan Networks
-005036 Netcam
-005037 Koga Electronics CO.
-005038 Dain Telecom CO.
-005039 Mariner Networks
-00503A Datong Electronics
-00503B Mediafire
-00503C Tsinghua Novel Electronics
-00503E Cisco Systems
-00503F Anchor Games
-005040 Panasonic Electric Works Co.
-005041 Coretronic
-005042 SCI Manufacturing Singapore PTE
-005043 Marvell Semiconductor
-005044 Asaca
-005045 Rioworks Solutions
-005046 Menicx International CO.
-005047 Private
-005048 Infolibria
-005049 Arbor Networks
-00504A Elteco A.S.
-00504B Barconet N.V.
-00504C Galil Motion Control
-00504D Tokyo Electron Device Limited
-00504E Sierra Monitor
-00504F Olencom Electronics
-005050 Cisco Systems
-005051 Iwatsu Electric CO.
-005052 Tiara Networks
-005053 Cisco Systems
-005054 Cisco Systems
-005055 Doms A/S
-005056 VMWare
-005057 Broadband Access Systems
-005058 VegaStream Group Limted
-005059 iBAHN
-00505A Network Alchemy
-00505B Kawasaki LSI U.s.a.
-00505C Tundo
-00505E Digitek Micrologic S.A.
-00505F Brand Innovators
-005060 Tandberg Telecom AS
-005062 Kouwell Electronics **
-005063 OY Comsel System AB
-005064 CAE Electronics
-005065 TDK-Lambda
-005066 AtecoM GmbH advanced telecomunication modules
-005067 Aerocomm
-005068 Electronic Industries Association
-005069 PixStream Incorporated
-00506A Edeva
-00506B Spx-ateg
-00506C Beijer Electronics Products AB
-00506D Videojet Systems
-00506E Corder Engineering
-00506F G-connect
-005070 Chaintech Computer CO.
-005071 Aiwa CO.
-005072 Corvis
-005073 Cisco Systems
-005074 Advanced Hi-tech
-005075 Kestrel Solutions
-005076 IBM
-005077 Prolific Technology
-005078 Megaton House
-005079 Private
-00507A Xpeed
-00507B Merlot Communications
-00507C Videocon AG
-00507D IFP
-00507E Newer Technology
-00507F DrayTek
-005080 Cisco Systems
-005081 Murata Machinery
-005082 Foresson
-005083 Gilbarco
-005084 ATL Products
-005086 Telkom SA
-005087 Terasaki Electric CO.
-005088 Amano
-005089 Safety Management Systems
-00508B Hewlett Packard
-00508C RSI Systems
-00508D Abit Computer
-00508E Optimation
-00508F Asita Technologies Int'l
-005090 Dctri
-005091 Netaccess
-005092 Rigaku Industrial
-005093 Boeing
-005094 Pace Micro Technology PLC
-005095 Peracom Networks
-005096 Salix Technologies
-005097 Mmc-embedded Computertechnik Gmbh
-005098 Globaloop
-005099 3com Europe
-00509A TAG Electronic Systems
-00509B Switchcore AB
-00509C Beta Research
-00509D THE Industree B.V.
-00509E Les Technologies SoftAcoustik
-00509F Horizon Computer
-0050A0 Delta Computer Systems
-0050A1 Carlo Gavazzi
-0050A2 Cisco Systems
-0050A3 TransMedia Communications
-0050A4 IO TECH
-0050A5 Capitol Business Systems
-0050A6 Optronics
-0050A7 Cisco Systems
-0050A8 OpenCon Systems
-0050A9 Moldat Wireless Technolgies
-0050AA Konica Minolta Holdings
-0050AB Naltec
-0050AC Maple Computer
-0050AD CommUnique Wireless
-0050AE Iwaki Electronics CO.
-0050AF Intergon
-0050B0 Technology Atlanta
-0050B1 Giddings & Lewis
-0050B2 Brodel Automation
-0050B3 Voiceboard
-0050B4 Satchwell Control Systems
-0050B5 Fichet-bauche
-0050B6 Good WAY IND. CO.
-0050B7 Boser Technology CO.
-0050B8 Inova Computers Gmbh & CO. KG
-0050B9 Xitron Technologies
-0050BA D-link
-0050BB CMS Technologies
-0050BC Hammer Storage Solutions
-0050BD Cisco Systems
-0050BE Fast Multimedia AG
-0050BF Mototech
-0050C0 Gatan
-0050C1 Gemflex Networks
-0050C2 Ieee Registration Authority
-0050C4 IMD
-0050C5 ADS Technologies
-0050C6 Loop Telecommunication International
-0050C8 Addonics Communications
-0050C9 Maspro Denkoh
-0050CA NET TO NET Technologies
-0050CB Jetter
-0050CC Xyratex
-0050CD Digianswer A/S
-0050CE LG International
-0050CF Vanlink Communication Technology Research Institute
-0050D0 Minerva Systems
-0050D1 Cisco Systems
-0050D2 CMC Electronics
-0050D3 Digital Audio Processing
-0050D4 Joohong Information
-0050D5 AD Systems
-0050D6 Atlas Copco Tools AB
-0050D7 Telstrat
-0050D8 Unicorn Computer
-0050D9 Engetron-engenharia Eletronica IND. e COM. Ltda
-0050DA 3com
-0050DB Contemporary Control
-0050DC TAS Telefonbau A. Schwabe Gmbh & CO. KG
-0050DD Serra Soldadura
-0050DE Signum Systems
-0050DF AirFiber
-0050E1 NS Tech Electronics SDN BHD
-0050E2 Cisco Systems
-0050E3 Motorola
-0050E4 Apple Computer
-0050E6 Hakusan
-0050E7 Paradise Innovations (asia)
-0050E8 Nomadix
-0050EA XEL Communications
-0050EB Alpha-top
-0050EC Olicom A/S
-0050ED Anda Networks
-0050EE TEK Digitel
-0050EF SPE Systemhaus GmbH
-0050F0 Cisco Systems
-0050F1 Libit Signal Processing
-0050F2 Microsoft
-0050F3 Global NET Information CO.
-0050F4 Sigmatek Gmbh & CO. KG
-0050F6 Pan-international Industrial
-0050F7 Venture Manufacturing (singapore)
-0050F8 Entrega Technologies
-0050F9 Sensormatic ACD
-0050FA Oxtel
-0050FB VSK Electronics
-0050FC Edimax Technology CO.
-0050FD Visioncomm CO.
-0050FE Pctvnet ASA
-0050FF Hakko Electronics CO.
-006000 Xycom
-006001 InnoSys
-006002 Screen Subtitling Systems
-006003 Teraoka Weigh System PTE
-006004 Computadores Modulares SA
-006005 Feedback Data
-006006 Sotec CO.
-006007 Acres Gaming
-006008 3com
-006009 Cisco Systems
-00600A Sord Computer
-00600B Logware Gmbh
-00600C Applied Data Systems
-00600D Digital Logic GmbH
-00600E Wavenet International
-00600F Westell
-006010 Network Machines
-006011 Crystal Semiconductor
-006012 Power Computing
-006013 Netstal Maschinen AG
-006014 Edec CO.
-006015 Net2net
-006016 Clariion
-006017 Tokimec
-006018 Stellar ONE
-006019 Roche Diagnostics
-00601A Keithley Instruments
-00601B Mesa Electronics
-00601C Telxon
-00601D Lucent Technologies
-00601E Softlab
-00601F Stallion Technologies
-006020 Pivotal Networking
-006021 DSC
-006022 Vicom Systems
-006023 Pericom Semiconductor
-006024 Gradient Technologies
-006025 Active Imaging PLC
-006026 Viking Components
-006027 Superior Modular Products
-006028 Macrovision
-006029 Cary Peripherals
-00602A Symicron Computer Communications
-00602B Peak Audio
-00602C Linx Data Terminals
-00602D Alerton Technologies
-00602E Cyclades
-00602F Cisco Systems
-006030 Village Tronic Entwicklung
-006031 HRK Systems
-006032 I-cube
-006033 Acuity Imaging
-006034 Robert Bosch Gmbh
-006035 Dallas Semiconductor
-006036 Austrian Research Center Seibersdorf
-006037 NXP Semiconductors
-006038 Nortel Networks
-006039 SanCom Technology
-00603A Quick Controls
-00603B Amtec spa
-00603C Hagiwara Sys-com CO.
-00603D 3CX
-00603E Cisco Systems
-00603F Patapsco Designs
-006040 Netro
-006041 Yokogawa Electric
-006042 TKS (usa)
-006043 iDirect
-006044 Litton/poly-scientific
-006045 Pathlight Technologies
-006046 Vmetro
-006047 Cisco Systems
-006048 EMC
-006049 Vina Technologies
-00604A Saic Ideas Group
-00604B Safe-com GmbH & Co. KG
-00604C Sagem Communication
-00604D MMC Networks
-00604E Cycle Computer
-00604F Suzuki MFG. CO.
-006050 Internix
-006051 Quality Semiconductor
-006052 Peripherals Enterprise CO.
-006053 Toyoda Machine Works
-006054 Controlware Gmbh
-006055 Cornell University
-006056 Network Tools
-006057 Murata Manufacturing CO.
-006058 Copper Mountain Communications
-006059 Technical Communications
-00605A Celcore
-00605B IntraServer Technology
-00605C Cisco Systems
-00605D Scanivalve
-00605E Liberty Technology Networking
-00605F Nippon Unisoft
-006060 Dawning Technologies
-006061 Whistle Communications
-006062 Telesync
-006063 Psion Dacom PLC.
-006064 Netcomm Limited
-006065 Bernecker & Rainer Industrie-elektronic Gmbh
-006066 Lacroix Technolgie
-006067 Acer Netxus
-006068 Dialogic
-006069 Brocade Communications Systems
-00606A Mitsubishi Wireless Communications.
-00606B Synclayer
-00606C Arescom
-00606D Digital Equipment
-00606E Davicom Semiconductor
-00606F Clarion OF America
-006070 Cisco Systems
-006071 Midas LAB
-006072 VXL Instruments, Limited
-006073 Redcreek Communications
-006074 QSC Audio Products
-006075 Pentek
-006076 Schlumberger Technologies Retail Petroleum Systems
-006077 Prisa Networks
-006078 Power Measurement
-006079 Mainstream Data
-00607A DVS GmbH
-00607B Fore Systems
-00607C WaveAccess
-00607D Sentient Networks
-00607E Gigalabs
-00607F Aurora Technologies
-006080 Microtronix Datacom
-006081 Tv/com International
-006082 Novalink Technologies
-006083 Cisco Systems
-006084 Digital Video
-006085 Storage Concepts
-006086 Logic Replacement TECH.
-006087 Kansai Electric CO.
-006088 White Mountain DSP
-006089 Xata
-00608A Citadel Computer
-00608B ConferTech International
-00608C 3com
-00608D Unipulse
-00608E HE Electronics, Technologie & Systemtechnik Gmbh
-00608F Tekram Technology CO.
-006090 Able Communications
-006091 First Pacific Networks
-006092 Micro/sys
-006093 Varian
-006094 IBM
-006095 Accu-time Systems
-006096 T.S. Microtech
-006097 3com
-006098 HT Communications
-006099 SBE
-00609A NJK Techno CO.
-00609B Astro-med
-00609C Perkin-Elmer Incorporated
-00609D PMI Food Equipment Group
-00609E ASC X3 - Information Technology Standards Secretariats
-00609F Phast
-0060A0 Switched Network Technologies
-0060A1 VPNet
-0060A2 Nihon Unisys Limited CO.
-0060A3 Continuum Technology
-0060A4 Grinaker System Technologies
-0060A5 Performance Telecom
-0060A6 Particle Measuring Systems
-0060A7 Microsens Gmbh & CO. KG
-0060A8 Tidomat AB
-0060A9 Gesytec MbH
-0060AA Intelligent Devices (idi)
-0060AB Larscom Incorporated
-0060AC Resilience
-0060AD MegaChips
-0060AE Trio Information Systems AB
-0060AF Pacific Micro DATA
-0060B0 Hewlett-packard CO.
-0060B1 Input/output
-0060B2 Process Control
-0060B3 Z-com
-0060B4 Glenayre R&D
-0060B5 Keba Gmbh
-0060B6 Land Computer CO.
-0060B7 Channelmatic
-0060B8 Corelis
-0060B9 NEC Infrontia
-0060BA Sahara Networks
-0060BB Cabletron - Netlink
-0060BC KeunYoung Electronics & Communication Co.
-0060BD Hubbell-pulsecom
-0060BE Webtronics
-0060BF Macraigor Systems
-0060C0 Nera Networks AS
-0060C1 WaveSpan
-0060C2 MPL AG
-0060C3 Netvision
-0060C4 Soliton Systems K.K.
-0060C5 Ancot
-0060C6 DCS AG
-0060C7 Amati Communications
-0060C8 Kuka Welding Systems & Robots
-0060C9 ControlNet
-0060CA Harmonic Systems Incorporated
-0060CB Hitachi Zosen
-0060CC Emtrak, Incorporated
-0060CD VideoServer
-0060CE Acclaim Communications
-0060CF Alteon Networks
-0060D0 Snmp Research Incorporated
-0060D1 Cascade Communications
-0060D2 Lucent Technologies Taiwan Telecommunications CO.
-0060D3 At&t
-0060D4 Eldat Communication
-0060D5 Miyachi Technos
-0060D6 NovAtel Wireless Technologies
-0060D7 Ecole Polytechnique Federale DE Lausanne (epfl)
-0060D8 Elmic Systems
-0060D9 Transys Networks
-0060DA JBM Electronics CO.
-0060DB NTP Elektronik A/S
-0060DC Toyo Network Systems & System Integration Co.
-0060DD Myricom
-0060DE Kayser-Threde GmbH
-0060DF Brocade Communications Systems
-0060E0 Axiom Technology CO.
-0060E1 Orckit Communications
-0060E2 Quest Engineering & Development
-0060E3 Arbin Instruments
-0060E4 Compuserve
-0060E5 Fuji Automation CO.
-0060E6 Shomiti Systems Incorporated
-0060E7 Randata
-0060E8 Hitachi Computer Products (america)
-0060E9 Atop Technologies
-0060EA StreamLogic
-0060EB Fourthtrack Systems
-0060EC Hermary Opto Electronics
-0060ED Ricardo Test Automation
-0060EE Apollo
-0060EF Flytech Technology CO.
-0060F0 Johnson & Johnson Medical
-0060F1 EXP Computer
-0060F2 Lasergraphics
-0060F3 Performance Analysis Broadband, Spirent plc
-0060F4 Advanced Computer Solutions
-0060F5 Icon WEST
-0060F6 Nextest Communications Products
-0060F7 Datafusion Systems
-0060F8 Loran International Technologies
-0060F9 Diamond Lane Communications
-0060FA Educational Technology Resources
-0060FB Packeteer
-0060FC Conservation Through Innovation
-0060FD NetICs
-0060FE Lynx System Developers
-0060FF QuVis
-0070B0 M/a-com Companies
-0070B3 Data Recall
-008000 Multitech Systems
-008001 Periphonics
-008002 Satelcom (uk)
-008003 Hytec Electronics
-008004 Antlow Communications
-008005 Cactus Computer
-008006 Compuadd
-008007 Dlog Nc-systeme
-008008 Dynatech Computer Systems
-008009 Jupiter Systems
-00800A Japan Computer
-00800B CSK
-00800C Videcom Limited
-00800D Vosswinkel F.U.
-00800E Atlantix
-00800F Standard Microsystems
-008010 Commodore International
-008011 Digital Systems Int'l.
-008012 Integrated Measurement Systems
-008013 Thomas-conrad
-008014 Esprit Systems
-008015 Seiko Systems
-008016 Wandel AND Goltermann
-008017 PFU Limited
-008018 Kobe Steel
-008019 Dayna Communications
-00801A Bell Atlantic
-00801B Kodiak Technology
-00801C Newport Systems Solutions
-00801D Integrated Inference Machines
-00801E Xinetron
-00801F Krupp Atlas Electronik Gmbh
-008020 Network Products
-008021 Alcatel Canada
-008022 Scan-optics
-008023 Integrated Business Networks
-008024 Kalpana
-008025 Stollmann Gmbh
-008026 Network Products
-008027 Adaptive Systems
-008028 Tradpost (hk)
-008029 Eagle Technology
-00802A Test Systems & Simulations
-00802B Integrated Marketing CO
-00802C THE Sage Group PLC
-00802D Xylogics
-00802E Castle Rock Computing
-00802F National Instruments
-008030 Nexus Electronics
-008031 Basys
-008032 Access CO.
-008033 Formation
-008034 SMT Goupil
-008035 Technology Works
-008036 Reflex Manufacturing Systems
-008037 Ericsson Group
-008038 Data Research & Applications
-008039 Alcatel STC Australia
-00803A Varityper
-00803B APT Communications
-00803C TVS Electronics
-00803D Surigiken CO.
-00803E Synernetics
-00803F Tatung Company
-008040 John Fluke Manufacturing CO.
-008041 VEB Kombinat Robotron
-008042 Emerson Network Power
-008043 Networld
-008044 Systech Computer
-008045 Matsushita Electric IND. CO
-008046 University OF Toronto
-008047 In-net
-008048 Compex Incorporated
-008049 Nissin Electric CO.
-00804A Pro-log
-00804B Eagle Technologiesltd.
-00804C Contec CO.
-00804D Cyclone Microsystems
-00804E Apex Computer Company
-00804F Daikin Industries
-008050 Ziatech
-008051 Fibermux
-008052 Technically Elite Concepts
-008053 Intellicom
-008054 Frontier Technologies
-008055 Fermilab
-008056 Sphinx Elektronik Gmbh
-008057 Adsoft
-008058 Printer Systems
-008059 Stanley Electric CO.
-00805A Tulip Computers Internat'l B.V
-00805B Condor Systems
-00805C Agilis
-00805D Canstar
-00805E LSI Logic
-00805F Hewlett Packard
-008060 Network Interface
-008061 Litton Systems
-008062 Interface CO.
-008063 Richard Hirschmann Gmbh & CO.
-008064 Wyse Technology
-008065 Cybergraphic Systems
-008066 Arcom Control Systems
-008067 Square D Company
-008068 Yamatech Scientific
-008069 Computone Systems
-00806A ERI (empac Research)
-00806B Schmid Telecommunication
-00806C Cegelec Projects
-00806D Century Systems
-00806E Nippon Steel
-00806F Onelan
-008070 Computadoras Micron
-008071 SAI Technology
-008072 Microplex Systems
-008073 DWB Associates
-008074 Fisher Controls
-008075 Parsytec Gmbh
-008076 Mcnc
-008077 Brother Industries
-008078 Practical Peripherals
-008079 Microbus Designs
-00807A Aitech Systems
-00807B Artel Communications
-00807C Fibercom
-00807D Equinox Systems
-00807E Southern Pacific
-00807F Dy-4 Incorporated
-008080 Datamedia
-008081 Kendall Square Research
-008082 PEP Modular Computers Gmbh
-008083 Amdahl
-008084 THE Cloud
-008085 H-three Systems
-008086 Computer Generation
-008087 OKI Electric Industry CO.
-008088 Victor Company OF Japan
-008089 Tecnetics (pty)
-00808A Summit Microsystems
-00808B Dacoll Limited
-00808C NetScout Systems
-00808D Westcoast Technology B.V.
-00808E Radstone Technology
-00808F C. Itoh Electronics
-008090 Microtek International
-008091 Tokyo Electric Co.
-008092 Silex Technology
-008093 Xyron
-008094 Alfa Laval Automation AB
-008095 Basic Merton Handelsges.m.b.h.
-008096 Human Designed Systems
-008097 Centralp Automatismes
-008098 TDK
-008099 Klockner Moeller IPC
-00809A Novus Networks
-00809B Justsystem
-00809C Luxcom
-00809D Commscraft
-00809E Datus Gmbh
-00809F Alcatel Business Systems
-0080A0 Edisa Hewlett Packard S/A
-0080A1 Microtest
-0080A2 Creative Electronic Systems
-0080A3 Lantronix
-0080A4 Liberty Electronics
-0080A5 Speed International
-0080A6 Republic Technology
-0080A7 Measurex
-0080A8 Vitacom
-0080A9 Clearpoint Research
-0080AA Maxpeed
-0080AB Dukane Network Integration
-0080AC Imlogix, Division OF Genesys
-0080AD Cnet Technology
-0080AE Hughes Network Systems
-0080AF Allumer CO.
-0080B0 Advanced Information
-0080B1 Softcom A/S
-0080B2 Network Equipment Technologies
-0080B3 Aval Data
-0080B4 Sophia Systems
-0080B5 United Networks
-0080B6 Themis Computer
-0080B7 Stellar Computer
-0080B8 BUG, Incorporated
-0080B9 Arche Technoligies
-0080BA Specialix (asia) PTE
-0080BB Hughes LAN Systems
-0080BC Hitachi Engineering CO.
-0080BD THE Furukawa Electric CO.
-0080BE Aries Research
-0080BF Takaoka Electric MFG. CO.
-0080C0 Penril Datacomm
-0080C1 Lanex
-0080C2 Ieee 802.1 Committee
-0080C3 Bicc Information Systems & SVC
-0080C4 Document Technologies
-0080C5 Novellco DE Mexico
-0080C6 National Datacomm
-0080C7 Xircom
-0080C8 D-link Systems
-0080C9 Alberta Microelectronic Centre
-0080CA Netcom Research Incorporated
-0080CB Falco Data Products
-0080CC Microwave Bypass Systems
-0080CD Micronics Computer
-0080CE Broadcast Television Systems
-0080CF Embedded Performance
-0080D0 Computer Peripherals
-0080D1 Kimtron
-0080D2 Shinnihondenko CO.
-0080D3 Shiva
-0080D4 Chase Research
-0080D5 Cadre Technologies
-0080D6 Nuvotech
-0080D7 Fantum Engineering
-0080D8 Network Peripherals
-0080D9 EMK Elektronik GmbH & Co. KG
-0080DA Bruel & Kjaer
-0080DB Graphon
-0080DC Picker International
-0080DD GMX/gimix
-0080DE Gipsi S.A.
-0080DF ADC Codenoll Technology
-0080E0 XTP Systems
-0080E1 Stmicroelectronics
-0080E2 T.d.i. CO.
-0080E3 Coral Network
-0080E4 Northwest Digital Systems
-0080E5 LSI Logic
-0080E6 Peer Networks
-0080E7 Lynwood Scientific DEV.
-0080E8 Cumulus Corporatiion
-0080E9 Madge
-0080EA Adva Optical Networking
-0080EB Compcontrol B.V.
-0080EC Supercomputing Solutions
-0080ED IQ Technologies
-0080EE Thomson CSF
-0080EF Rational
-0080F0 Panasonic Communications Co.
-0080F1 Opus Systems
-0080F2 Raycom Systems
-0080F3 SUN Electronics
-0080F4 Telemecanique Electrique
-0080F5 Quantel
-0080F6 Synergy Microsystems
-0080F7 Zenith Electronics
-0080F8 Mizar
-0080F9 Heurikon
-0080FA RWT Gmbh
-0080FB BVM Limited
-0080FC Avatar
-0080FD Exsceed Corpration
-0080FE Azure Technologies
-0080FF SOC. DE Teleinformatique RTC
-009000 Diamond Multimedia
-009001 Nishimu Electronics Industries CO.
-009002 Allgon AB
-009003 Aplio
-009004 3com Europe
-009005 Protech Systems CO.
-009006 Hamamatsu Photonics K.K.
-009007 Domex Technology
-009008 HanA Systems
-009009 i Controls
-00900A Proton Electronic Industrial CO.
-00900B Lanner Electronics
-00900C Cisco Systems
-00900D Overland Storage
-00900E Handlink Technologies
-00900F Kawasaki Heavy Industries
-009010 Simulation Laboratories
-009011 Wavtrace
-009012 Globespan Semiconductor
-009013 Samsan
-009014 Rotork Instruments
-009015 Centigram Communications
-009016 ZAC
-009017 Zypcom
-009018 ITO Electric Industry CO
-009019 Hermes Electronics CO.
-00901A Unisphere Solutions
-00901B Digital Controls
-00901C mps Software Gmbh
-00901D PEC (nz)
-00901E Selesta Ingegneria S.p.A.
-00901F Adtec Productions
-009020 Philips Analytical X-ray B.V.
-009021 Cisco Systems
-009022 Ivex
-009023 Zilog
-009024 Pipelinks
-009025 BAE Systems Australia (Electronic Systems)
-009026 Advanced Switching Communications
-009027 Intel
-009028 Nippon Signal CO.
-009029 Crypto AG
-00902A Communication Devices
-00902B Cisco Systems
-00902C Data & Control Equipment
-00902D Data Electronics (aust.)
-00902E Namco Limited
-00902F Netcore Systems
-009030 Honeywell-dating
-009031 Mysticom
-009032 Pelcombe Group
-009033 Innovaphone AG
-009034 Imagic
-009035 Alpha Telecom
-009036 ens
-009037 Acucomm
-009038 Fountain Technologies
-009039 Shasta Networks
-00903A Nihon Media Tool
-00903B TriEMS Research Lab
-00903C Atlantic Network Systems
-00903D Biopac Systems
-00903E N.V. Philips Industrial Activities
-00903F Aztec Radiomedia
-009040 Siemens Network Convergence
-009041 Applied Digital Access
-009042 ECCS
-009043 Nichibei Denshi CO.
-009044 Assured Digital
-009045 Marconi Communications
-009046 Dexdyne
-009047 Giga Fast E.
-009048 Zeal
-009049 Entridia
-00904A Concur System Technologies
-00904B GemTek Technology Co.
-00904C Epigram
-00904D Spec S.A.
-00904E Delem BV
-00904F ABB Power T&D Company
-009050 Teleste OY
-009051 Ultimate Technology
-009052 Selcom Elettronica S.r.l.
-009053 Daewoo Electronics CO.
-009054 Innovative Semiconductors
-009055 Parker Hannifin Compumotor Division
-009056 Telestream
-009057 AANetcom
-009058 Ultra Electronics, Command and Control Systems
-009059 Telecom Device K.K.
-00905A Dearborn Group
-00905B Raymond AND LAE Engineering
-00905C Edmi
-00905D Netcom Sicherheitstechnik Gmbh
-00905E Rauland-borg
-00905F Cisco Systems
-009060 System Create
-009061 Pacific Research & Engineering
-009062 ICP Vortex Computersysteme Gmbh
-009063 Coherent Communications Systems
-009064 Thomson
-009065 Finisar
-009066 Troika Networks
-009067 WalkAbout Computers
-009068 DVT
-009069 Juniper Networks
-00906A Turnstone Systems
-00906B Applied Resources
-00906C Sartorius Hamburg GmbH
-00906D Cisco Systems
-00906E Praxon
-00906F Cisco Systems
-009070 NEO Networks
-009071 Applied Innovation
-009072 Simrad AS
-009073 Gaio Technology
-009074 Argon Networks
-009075 NEC DO Brasil S.A.
-009076 FMT Aircraft Gate Support Systems AB
-009077 Advanced Fibre Communications
-009078 MER Telemanagement Solutions
-009079 ClearOne
-00907A Polycom
-00907B E-tech
-00907C Digitalcast
-00907D Lake Communications
-00907E Vetronix
-00907F WatchGuard Technologies
-009080 NOT Limited
-009081 Aloha Networks
-009082 Force Institute
-009083 Turbo Communication
-009084 Atech System
-009085 Golden Enterprises
-009086 Cisco Systems
-009087 Itis
-009088 Baxall Security
-009089 Softcom Microsystems
-00908A Bayly Communications
-00908B PFU Systems
-00908C Etrend Electronics
-00908D Vickers Electronics Systems
-00908E Nortel Networks Broadband Access
-00908F Audio Codes
-009090 I-bus
-009091 DigitalScape
-009092 Cisco Systems
-009093 Nanao
-009094 Osprey Technologies
-009095 Universal Avionics
-009096 Askey Computer
-009097 Sycamore Networks
-009098 SBC Designs
-009099 Allied Telesis
-00909A ONE World Systems
-00909B Imaje
-00909C Motorola
-00909D NovaTech Process Solutions
-00909E Critical IO
-00909F Digi-data
-0090A0 8X8
-0090A1 Flying Pig Systems/High End Systems
-0090A2 Cybertan Technology
-0090A3 Corecess
-0090A4 Altiga Networks
-0090A5 Spectra Logic
-0090A6 Cisco Systems
-0090A7 Clientec
-0090A8 NineTiles Networks
-0090A9 Western Digital
-0090AA Indigo Active Vision Systems Limited
-0090AB Cisco Systems
-0090AC Optivision
-0090AD Aspect Electronics
-0090AE Italtel S.p.a.
-0090AF J. Morita MFG.
-0090B0 Vadem
-0090B1 Cisco Systems
-0090B2 Avici Systems
-0090B3 Agranat Systems
-0090B4 Willowbrook Technologies
-0090B5 Nikon
-0090B6 Fibex Systems
-0090B7 Digital Lightwave
-0090B8 Rohde & Schwarz Gmbh & CO. KG
-0090B9 Beran Instruments
-0090BA Valid Networks
-0090BB Tainet Communication System
-0090BC Telemann CO.
-0090BD Omnia Communications
-0090BE Ibc/integrated Business Computers
-0090BF Cisco Systems
-0090C0 K.J. LAW Engineers
-0090C1 Peco II
-0090C2 JK microsystems
-0090C3 Topic Semiconductor
-0090C4 Javelin Systems
-0090C5 Internet Magic
-0090C6 Optim Systems
-0090C7 Icom
-0090C8 Waverider Communications (canada)
-0090C9 Dpac Technologies
-0090CA Accord Video Telecommunications
-0090CB Wireless OnLine
-0090CC Planex Communications
-0090CD Ent-empresa Nacional DE Telecommunicacoes
-0090CE Tetra Gmbh
-0090CF Nortel
-0090D0 Thomson Telecom Belgium
-0090D1 Leichu Enterprise CO.
-0090D2 Artel Video Systems
-0090D3 Giesecke & Devrient Gmbh
-0090D4 BindView Development
-0090D5 Euphonix
-0090D6 Crystal Group
-0090D7 NetBoost
-0090D8 Whitecross Systems
-0090D9 Cisco Systems
-0090DA Dynarc
-0090DB Next Level Communications
-0090DC Teco Information Systems
-0090DD THE Miharu Communications CO.
-0090DE Cardkey Systems
-0090DF Mitsubishi Chemical America
-0090E0 Systran
-0090E1 Telena S.p.a.
-0090E2 Distributed Processing Technology
-0090E3 Avex Electronics
-0090E4 NEC America
-0090E5 Teknema
-0090E6 ALi
-0090E7 Horsch Elektronik AG
-0090E8 Moxa Technologies
-0090E9 Janz Computer AG
-0090EA Alpha Technologies
-0090EB Sentry Telecom Systems
-0090EC Pyrescom
-0090ED Central System Research CO.
-0090EE Personal Communications Technologies
-0090EF Integrix
-0090F0 Harmonic Video Systems
-0090F1 DOT Hill Systems
-0090F2 Cisco Systems
-0090F3 Aspect Communications
-0090F4 Lightning Instrumentation
-0090F5 Clevo CO.
-0090F6 Escalate Networks
-0090F7 Nbase Communications
-0090F8 Mediatrix Telecom
-0090F9 Leitch
-0090FA Emulex
-0090FB Portwell
-0090FC Network Computing Devices
-0090FD CopperCom
-0090FE Elecom CO., (laneed DIV.)
-0090FF Tellus Technology
-0091D6 Crystal Group
-009D8E Cardiac Recorders
-00A000 Centillion Networks
-00A001 DRS Signal Solutions
-00A002 Leeds & Northrup Australia
-00A003 Staefa Control System
-00A004 Netpower
-00A005 Daniel Instruments
-00A006 Image Data Processing System Group
-00A007 Apexx Technology
-00A008 Netcorp
-00A009 Whitetree Network
-00A00A Airspan
-00A00B Computex CO.
-00A00C Kingmax Technology
-00A00D THE Panda Project
-00A00E Visual Networks
-00A00F Broadband Technologies
-00A010 Syslogic Datentechnik AG
-00A011 Mutoh Industries
-00A012 B.a.t.m. Advanced Technologies
-00A013 Teltrend
-00A014 Csir
-00A015 Wyle
-00A016 Micropolis
-00A017 J B
-00A018 Creative Controllers
-00A019 Nebula Consultants
-00A01A Binar Elektronik AB
-00A01B Premisys Communications
-00A01C Nascent Networks
-00A01D Sixnet
-00A01E EST
-00A01F Tricord Systems
-00A020 Citicorp/tti
-00A021 General Dynamics
-00A022 Centre FOR Development OF Advanced Computing
-00A023 Applied Creative Technology
-00A024 3com
-00A025 Redcom Labs
-00A026 Teldat
-00A027 Firepower Systems
-00A028 Conner Peripherals
-00A029 Coulter
-00A02A Trancell Systems
-00A02B Transitions Research
-00A02C interWAVE Communications
-00A02D 1394 Trade Association
-00A02E Brand Communications
-00A02F Pirelli Cavi
-00A030 Captor Nv/sa
-00A031 Hazeltine, MS 1-17
-00A032 GES Singapore PTE.
-00A033 imc MeBsysteme GmbH
-00A034 Axel
-00A035 Cylink
-00A036 Applied Network Technology
-00A037 Mindray DS USA
-00A038 Email Electronics
-00A039 Ross Technology
-00A03A Kubotek
-00A03B Toshin Electric CO.
-00A03C Eg&g Nuclear Instruments
-00A03D Opto-22
-00A03E ATM Forum
-00A03F Computer Society Microprocessor & Microprocessor Standards
-00A040 Apple Computer
-00A041 Inficon
-00A042 Spur Products
-00A043 American Technology LABS
-00A044 NTT IT CO.
-00A045 Phoenix Contact Gmbh & CO.
-00A046 Scitex
-00A047 Integrated Fitness
-00A048 Questech
-00A049 Digitech Industries
-00A04A Nisshin Electric CO.
-00A04B TFL LAN
-00A04C Innovative Systems & Technologies
-00A04D EDA Instruments
-00A04E Voelker Technologies
-00A04F Ameritec
-00A050 Cypress Semiconductor
-00A051 Angia Communications.
-00A052 Stanilite Electronics
-00A053 Compact Devices
-00A054 Private
-00A055 Data Device
-00A056 Micropross
-00A057 Lancom Systems Gmbh
-00A058 Glory
-00A059 Hamilton Hallmark
-00A05A Kofax Image Products
-00A05B Marquip
-00A05C Inventory Conversion
-00A05D CS Computer Systeme Gmbh
-00A05E Myriad Logic
-00A05F BTG Electronics Design BV
-00A060 Acer Peripherals
-00A061 Puritan Bennett
-00A062 AES Prodata
-00A063 JRL Systems
-00A064 Kvb/analect
-00A065 Symantec
-00A066 ISA CO.
-00A067 Network Services Group
-00A068 BHP Limited
-00A069 Symmetricom
-00A06A Verilink
-00A06B DMS Dorsch Mikrosystem Gmbh
-00A06C Shindengen Electric MFG. CO.
-00A06D Mannesmann Tally
-00A06E Austron
-00A06F THE Appcon Group
-00A070 Coastcom
-00A071 Video Lottery Technologies
-00A072 Ovation Systems
-00A073 Com21
-00A074 Perception Technology
-00A075 Micron Technology
-00A076 Cardware LAB
-00A077 Fujitsu Nexion
-00A078 Marconi Communications
-00A079 Alps Electric (usa)
-00A07A Advanced Peripherals Technologies
-00A07B Dawn Computer Incorporation
-00A07C Tonyang Nylon CO.
-00A07D Seeq Technology
-00A07E Avid Technology
-00A07F Gsm-syntel
-00A080 SBE
-00A081 Alcatel Data Networks
-00A082 NKT Elektronik A/S
-00A083 Asimmphony Turkey
-00A084 Dataplex
-00A085 Private
-00A086 Amber Wave Systems
-00A087 Zarlink Semiconductor
-00A088 Essential Communications
-00A089 Xpoint Technologies
-00A08A Brooktrout Technology
-00A08B Aston Electronic Designs
-00A08C MultiMedia LANs
-00A08D Jacomo
-00A08E Nokia Internet Communications
-00A08F Desknet Systems
-00A090 TimeStep
-00A091 Applicom International
-00A092 H. Bollmann Manufacturers
-00A093 B/E Aerospace
-00A094 Comsat
-00A095 Acacia Networks
-00A096 Mitumi Electric CO.
-00A097 JC Information Systems
-00A098 NetApp
-00A099 K-net
-00A09A Nihon Kohden America
-00A09B Qpsx Communications
-00A09C Xyplex
-00A09D Johnathon Freeman Technologies
-00A09E Ictv
-00A09F Commvision
-00A0A0 Compact DATA
-00A0A1 Epic Data
-00A0A2 Digicom S.p.a.
-00A0A3 Reliable Power Meters
-00A0A4 Micros Systems
-00A0A5 Teknor Microsysteme
-00A0A6 M.I. Systems
-00A0A7 Vorax
-00A0A8 Renex
-00A0A9 Navtel Communications
-00A0AA Spacelabs Medical
-00A0AB Netcs Informationstechnik Gmbh
-00A0AC Gilat Satellite Networks
-00A0AD Marconi SPA
-00A0AE Nucom Systems
-00A0AF WMS Industries
-00A0B0 I-O Data Device
-00A0B1 First Virtual
-00A0B2 Shima Seiki
-00A0B3 Zykronix
-00A0B4 Texas Microsystems
-00A0B5 3H Technology
-00A0B6 Sanritz Automation CO.
-00A0B7 Cordant
-00A0B8 Symbios Logic
-00A0B9 Eagle Technology
-00A0BA Patton Electronics CO.
-00A0BB Hilan Gmbh
-00A0BC Viasat, Incorporated
-00A0BD I-tech
-00A0BE Integrated Circuit Systems, Communications Group
-00A0BF Wireless Data Group Motorola
-00A0C0 Digital Link
-00A0C1 Ortivus Medical AB
-00A0C2 R.A. Systems CO.
-00A0C3 Unicomputer Gmbh
-00A0C4 Cristie Electronics
-00A0C5 Zyxel Communication
-00A0C6 Qualcomm Incorporated
-00A0C7 Tadiran Telecommunications
-00A0C8 Adtran
-00A0C9 Intel - Hf1-06
-00A0CA Fujitsu Denso
-00A0CB ARK Telecommunications
-00A0CC Lite-on Communications
-00A0CD DR. Johannes Heidenhain Gmbh
-00A0CE Astrocom
-00A0CF Sotas
-00A0D0 TEN X Technology
-00A0D1 Inventec
-00A0D2 Allied Telesis International
-00A0D3 Instem Computer Systems
-00A0D4 Radiolan
-00A0D5 Sierra Wireless
-00A0D6 SBE
-00A0D7 Kasten Chase Applied Research
-00A0D8 Spectra - TEK
-00A0D9 Convex Computer
-00A0DA Integrated Systems Technology
-00A0DB Fisher & Paykel Production
-00A0DC O.N. Electronic CO.
-00A0DD Azonix
-00A0DE Yamaha
-00A0DF STS Technologies
-00A0E0 Tennyson Technologies
-00A0E1 Westport Research Associates
-00A0E2 Keisokugiken
-00A0E3 XKL Systems
-00A0E4 Optiquest
-00A0E5 NHC Communications
-00A0E6 Dialogic
-00A0E7 Central Data
-00A0E8 Reuters Holdings PLC
-00A0E9 Electronic Retailing Systems International
-00A0EA Ethercom
-00A0EB Encore Networks
-00A0EC Transmitton
-00A0ED Brooks Automation
-00A0EE Nashoba Networks
-00A0EF Lucidata
-00A0F0 Toronto Microelectronics
-00A0F1 MTI
-00A0F2 Infotek Communications
-00A0F3 Staubli
-00A0F4 GE
-00A0F5 Radguard
-00A0F6 AutoGas Systems
-00A0F7 V.I Computer
-00A0F8 Symbol Technologies
-00A0F9 Bintec Communications Gmbh
-00A0FA Marconi Communication GmbH
-00A0FB Toray Engineering CO.
-00A0FC Image Sciences
-00A0FD Scitex Digital Printing
-00A0FE Boston Technology
-00A0FF Tellabs Operations
-00AA00 Intel
-00AA01 Intel
-00AA02 Intel
-00AA3C Olivetti Telecom SPA (olteco)
-00B009 Grass Valley Group
-00B017 InfoGear Technology
-00B019 Casi-Rusco
-00B01C Westport Technologies
-00B01E Rantic Labs
-00B02A Orsys Gmbh
-00B02D ViaGate Technologies
-00B03B HiQ Networks
-00B048 Marconi Communications
-00B04A Cisco Systems
-00B052 Intellon
-00B064 Cisco Systems
-00B069 Honewell Oy
-00B06D Jones Futurex
-00B080 Mannesmann Ipulsys B.V.
-00B086 LocSoft Limited
-00B08E Cisco Systems
-00B091 Transmeta
-00B094 Alaris
-00B09A Morrow Technologies
-00B09D Point Grey Research
-00B0AC Siae-microelettronica S.p.a.
-00B0AE Symmetricom
-00B0B3 Xstreamis PLC
-00B0C2 Cisco Systems
-00B0C7 Tellabs Operations
-00B0CE Technology Rescue
-00B0D0 Dell Computer
-00B0DB Nextcell
-00B0DF Reldata
-00B0E7 British Federal
-00B0EC Eacem
-00B0EE Ajile Systems
-00B0F0 Caly Networks
-00B0F5 NetWorth Technologies
-00BAC0 Biometric Access Company
-00BB01 Octothorpe
-00BBF0 Ungermann-bass
-00C000 Lanoptics
-00C001 Diatek Patient Managment
-00C002 Sercomm
-00C003 Globalnet Communications
-00C004 Japan Business Computerltd
-00C005 Livingston Enterprises
-00C006 Nippon Avionics CO.
-00C007 Pinnacle Data Systems
-00C008 Seco SRL
-00C009 KT Technology (S) PTE
-00C00A Micro Craft
-00C00B Norcontrol A.S.
-00C00C Relia Technolgies
-00C00D Advanced Logic Research
-00C00E Psitech
-00C00F Quantum Software Systems
-00C010 Hirakawa Hewtech
-00C011 Interactive Computing Devices
-00C012 Netspan
-00C013 Netrix
-00C014 Telematics Calabasas Int'l
-00C015 NEW Media
-00C016 Electronic Theatre Controls
-00C017 Fluke
-00C018 Lanart
-00C019 Leap Technology
-00C01A Corometrics Medical Systems
-00C01B Socket Communications
-00C01C Interlink Communications
-00C01D Grand Junction Networks
-00C01E LA Francaise DES Jeux
-00C01F S.e.r.c.e.l.
-00C020 Arco Electronic, Control
-00C021 Netexpress
-00C022 Lasermaster Technologies
-00C023 Tutankhamon Electronics
-00C024 Eden Sistemas DE Computacao SA
-00C025 Dataproducts
-00C026 Lans Technology CO.
-00C027 Cipher Systems
-00C028 Jasco
-00C029 Nexans Deutschland GmbH - ANS
-00C02A Ohkura Electric CO.
-00C02B Gerloff Gesellschaft FUR
-00C02C Centrum Communications
-00C02D Fuji Photo Film CO.
-00C02E Netwiz
-00C02F Okuma
-00C030 Integrated Engineering B. V.
-00C031 Design Research Systems
-00C032 I-cubed Limited
-00C033 Telebit Communications APS
-00C034 Transaction Network
-00C035 Quintar Company
-00C036 Raytech Electronic
-00C037 Dynatem
-00C038 Raster Image Processing System
-00C039 Teridian Semiconductor
-00C03A Men-mikro Elektronik Gmbh
-00C03B Multiaccess Computing
-00C03C Tower Tech S.r.l.
-00C03D Wiesemann & Theis Gmbh
-00C03E FA. GEBR. Heller Gmbh
-00C03F Stores Automated Systems
-00C040 Ecci
-00C041 Digital Transmission Systems
-00C042 Datalux
-00C043 Stratacom
-00C044 Emcom
-00C045 Isolation Systems
-00C046 Blue Chip Technology
-00C047 Unimicro Systems
-00C048 BAY Technical Associates
-00C049 U.S. Robotics
-00C04A Group 2000 AG
-00C04B Creative Microsystems
-00C04C Department OF Foreign Affairs
-00C04D Mitec
-00C04E Comtrol
-00C04F Dell Computer
-00C050 Toyo Denki Seizo K.K.
-00C051 Advanced Integration Research
-00C052 Burr-brown
-00C053 Aspect Software
-00C054 Network Peripherals
-00C055 Modular Computing Technologies
-00C056 Somelec
-00C057 Myco Electronics
-00C058 Dataexpert
-00C059 Denso
-00C05A Semaphore Communications
-00C05B Networks Northwest
-00C05C Elonex PLC
-00C05D L&N Technologies
-00C05E Vari-lite
-00C05F Fine-pal Company Limited
-00C060 ID Scandinavia AS
-00C061 Solectek
-00C062 Impulse Technology
-00C063 Morning Star Technologies
-00C064 General Datacomm IND.
-00C065 Scope Communications
-00C066 Docupoint
-00C067 United Barcode Industries
-00C068 Philip Drake Electronics
-00C069 Axxcelera Broadband Wireless
-00C06A Zahner-elektrik Gmbh & CO. KG
-00C06B OSI Plus
-00C06C Svec Computer
-00C06D Boca Research
-00C06E Haft Technology
-00C06F Komatsu
-00C070 Sectra Secure-transmission AB
-00C071 Areanex Communications
-00C072 KNX
-00C073 Xedia
-00C074 Toyoda Automatic Loom
-00C075 Xante
-00C076 I-data International A-S
-00C077 Daewoo Telecom
-00C078 Computer Systems Engineering
-00C079 Fonsys Co.
-00C07A Priva B.V.
-00C07B Ascend Communications
-00C07C Hightech Information
-00C07D Risc Developments
-00C07E Kubota Electronic
-00C07F Nupon Computing
-00C080 Netstar
-00C081 Metrodata
-00C082 Moore Products CO.
-00C083 Trace Mountain Products
-00C084 Data Link
-00C085 Electronics FOR Imaging
-00C086 THE Lynk
-00C087 Uunet Technologies
-00C088 EKF Elektronik Gmbh
-00C089 Telindus Distribution
-00C08A Lauterbach Datentechnik Gmbh
-00C08B Risq Modular Systems
-00C08C Performance Technologies
-00C08D Tronix Product Development
-00C08E Network Information Technology
-00C08F Panasonic Electric Works Co.
-00C090 Praim S.r.l.
-00C091 Jabil Circuit
-00C092 Mennen Medical
-00C093 Alta Research
-00C094 VMX
-00C095 Znyx
-00C096 Tamura
-00C097 Archipel SA
-00C098 Chuntex Electronic CO.
-00C099 Yoshiki Industrial Co.
-00C09A Photonics
-00C09B Reliance Comm/tec
-00C09C Hioki E.E.
-00C09D Distributed Systems Int'l
-00C09E Cache Computers
-00C09F Quanta Computer
-00C0A0 Advance Micro Research
-00C0A1 Tokyo Denshi Sekei CO.
-00C0A2 Intermedium A/S
-00C0A3 Dual Enterprises
-00C0A4 Unigraf OY
-00C0A5 Dickens Data Systems
-00C0A6 Exicom Australia
-00C0A7 Seel
-00C0A8 GVC
-00C0A9 Barron Mccann
-00C0AA Silicon Valley Computer
-00C0AB Telco Systems
-00C0AC Gambit Computer Communications
-00C0AD Marben Communication Systems
-00C0AE Towercom CO. DBA PC House
-00C0AF Teklogix
-00C0B0 GCC Technologies
-00C0B1 Genius NET CO.
-00C0B2 Norand
-00C0B3 Comstat Datacomm
-00C0B4 Myson Technology
-00C0B5 Corporate Network Systems
-00C0B6 Overland Storage
-00C0B7 American Power Conversion
-00C0B8 Fraser's Hill
-00C0B9 Funk Software
-00C0BA Netvantage
-00C0BB Forval Creative
-00C0BC Telecom Australia/cssc
-00C0BD Inex Technologies
-00C0BE Alcatel - SEL
-00C0BF Technology Concepts
-00C0C0 Shore Microsystems
-00C0C1 Quad/graphics
-00C0C2 Infinite Networks
-00C0C3 Acuson Computed Sonography
-00C0C4 Computer Operational
-00C0C5 SID Informatica
-00C0C6 Personal Media
-00C0C7 Sparktrum Microsystems
-00C0C8 Micro Byte
-00C0C9 Elsag Bailey Process
-00C0CA ALFA
-00C0CB Control Technology
-00C0CC Telesciences CO Systems
-00C0CD Comelta
-00C0CE CEI Systems & Engineering PTE
-00C0CF Imatran Voima OY
-00C0D0 Ratoc System
-00C0D1 Comtree Technology
-00C0D2 Syntellect
-00C0D3 Olympus Image Systems
-00C0D4 Axon Networks
-00C0D5 Werbeagentur Jrgen Siebert
-00C0D6 J1 Systems
-00C0D7 Taiwan Trading Center DBA
-00C0D8 Universal Data Systems
-00C0D9 Quinte Network Confidentiality
-00C0DA Nice Systems
-00C0DB IPC (pte)
-00C0DC EOS Technologies
-00C0DD QLogic
-00C0DE Zcomm
-00C0DF KYE Systems
-00C0E0 DSC Communication
-00C0E1 Sonic Solutions
-00C0E2 Calcomp
-00C0E3 Ositech Communications
-00C0E4 Siemens Building
-00C0E5 Gespac
-00C0E6 Verilink
-00C0E7 Fiberdata AB
-00C0E8 Plexcom
-00C0E9 OAK Solutions
-00C0EA Array Technology
-00C0EB SEH Computertechnik Gmbh
-00C0EC Dauphin Technology
-00C0ED US Army Electronic
-00C0EE Kyocera
-00C0EF Abit
-00C0F0 Kingston Technology
-00C0F1 Shinko Electric CO.
-00C0F2 Transition Networks
-00C0F3 Network Communications
-00C0F4 Interlink System CO.
-00C0F5 Metacomp
-00C0F6 Celan Technology
-00C0F7 Engage Communication
-00C0F8 About Computing
-00C0F9 Motorola Embedded Computing Group
-00C0FA Canary Communications
-00C0FB Advanced Technology Labs
-00C0FC Elastic Reality
-00C0FD Prosum
-00C0FE Aptec Computer Systems
-00C0FF DOT Hill Systems
-00CBBD Cambridge Broadband Networks
-00CF1C Communication Machinery
-00D000 Ferran Scientific
-00D001 VST Technologies
-00D002 Ditech
-00D003 Comda Enterprises
-00D004 Pentacom
-00D005 ZHS Zeitmanagementsysteme
-00D006 Cisco Systems
-00D007 MIC Associates
-00D008 Mactell
-00D009 Hsing TECH. Enterprise CO.
-00D00A Lanaccess Telecom S.A.
-00D00B RHK Technology
-00D00C Snijder Micro Systems
-00D00D Micromeritics Instrument
-00D00E Pluris
-00D00F Speech Design Gmbh
-00D010 Convergent Networks
-00D011 Prism Video
-00D012 Gateworks
-00D013 Primex Aerospace Company
-00D014 ROOT
-00D015 Univex Microtechnology
-00D016 SCM Microsystems
-00D017 Syntech Information CO.
-00D018 QWES. COM
-00D019 Dainippon Screen Corporate
-00D01A Urmet TLC S.p.a.
-00D01B Mimaki Engineering CO.
-00D01C SBS Technologies,
-00D01D Furuno Electric CO.
-00D01E Pingtel
-00D01F Ctam
-00D020 AIM System
-00D021 Regent Electronics
-00D022 Incredible Technologies
-00D023 Infortrend Technology
-00D024 Cognex
-00D025 Xrosstech
-00D026 Hirschmann Austria Gmbh
-00D027 Applied Automation
-00D028 Omneon Video Networks
-00D029 Wakefern Food
-00D02A Voxent Systems
-00D02B Jetcell
-00D02C Campbell Scientific
-00D02D Ademco
-00D02E Communication Automation
-00D02F Vlsi Technology
-00D030 Safetran Systems
-00D031 Industrial Logic
-00D032 Yano Electric CO.
-00D033 Dalian Daxian Network
-00D034 Ormec Systems
-00D035 Behavior TECH. Computer
-00D036 Technology Atlanta
-00D037 Pace France
-00D038 Fivemere
-00D039 Utilicom
-00D03A Zoneworx
-00D03B Vision Products
-00D03C Vieo
-00D03D Galileo Technology
-00D03E Rocketchips
-00D03F American Communication
-00D040 Sysmate CO.
-00D041 Amigo Technology CO.
-00D042 Mahlo Gmbh & CO. UG
-00D043 Zonal Retail Data Systems
-00D044 Alidian Networks
-00D045 Kvaser AB
-00D046 Dolby Laboratories
-00D047 XN Technologies
-00D048 Ecton
-00D049 Impresstek CO.
-00D04A Presence Technology Gmbh
-00D04B LA CIE Group S.A.
-00D04C Eurotel Telecom
-00D04D DIV OF Research & Statistics
-00D04E Logibag
-00D04F Bitronics
-00D050 Iskratel
-00D051 O2 Micro
-00D052 Ascend Communications
-00D053 Connected Systems
-00D054 SAS Institute
-00D055 Kathrein-werke KG
-00D056 Somat
-00D057 Ultrak
-00D058 Cisco Systems
-00D059 Ambit Microsystems
-00D05A Symbionics
-00D05B Acroloop Motion Control
-00D05C Technotrend Systemtechnik Gmbh
-00D05D Intelliworxx
-00D05E Stratabeam Technology
-00D05F Valcom
-00D060 Panasonic Europe
-00D061 Tremon Enterprises CO.
-00D062 Digigram
-00D063 Cisco Systems
-00D064 Multitel
-00D065 Toko Electric
-00D066 Wintriss Engineering
-00D067 Campio Communications
-00D068 Iwill
-00D069 Technologic Systems
-00D06A Linkup Systems
-00D06B SR Telecom
-00D06C Sharewave
-00D06D Acrison
-00D06E Trendview Recorders
-00D06F KMC Controls
-00D070 Long Well Electronics
-00D071 Echelon
-00D072 Broadlogic
-00D073 ACN Advanced Communications
-00D074 Taqua Systems
-00D075 Alaris Medical Systems
-00D076 Merrill Lynch & Co.
-00D077 Lucent Technologies
-00D078 Eltex of Sweden AB
-00D079 Cisco Systems
-00D07A Amaquest Computer
-00D07B Comcam International
-00D07C Koyo Electronics Co.
-00D07D Cosine Communications
-00D07E Keycorp
-00D07F Strategy & Technology, Limited
-00D080 Exabyte
-00D081 RTD Embedded Technologies
-00D082 Iowave
-00D083 Invertex
-00D084 Nexcomm Systems
-00D085 Otis Elevator Company
-00D086 Foveon
-00D087 Microfirst
-00D088 Motorola
-00D089 Dynacolor
-00D08A Photron USA
-00D08B Adva Optical Networking
-00D08C Genoa Technology
-00D08D Phoenix Group
-00D08E Nvision
-00D08F Ardent Technologies
-00D090 Cisco Systems
-00D091 Smartsan Systems
-00D092 Glenayre Western Multiplex
-00D093 TQ - Components Gmbh
-00D094 Timeline Vista
-00D095 Alcatel-Lucent, Enterprise Business Group
-00D096 3com Europe
-00D097 Cisco Systems
-00D098 Photon Dynamics Canada
-00D099 Elcard OY
-00D09A Filanet
-00D09B Spectel
-00D09C Kapadia Communications
-00D09D Veris Industries
-00D09E 2wire
-00D09F Novtek Test Systems
-00D0A0 Mips Denmark
-00D0A1 Oskar Vierling Gmbh + CO. KG
-00D0A2 Integrated Device
-00D0A3 Vocal DATA
-00D0A4 Alantro Communications
-00D0A5 American Arium
-00D0A6 Lanbird Technology CO.
-00D0A7 Tokyo Sokki Kenkyujo CO.
-00D0A8 Network Engines
-00D0A9 Shinano Kenshi CO.
-00D0AA Chase Communications
-00D0AB Deltakabel Telecom CV
-00D0AC Grayson Wireless
-00D0AD TL Industries
-00D0AE Oresis Communications
-00D0AF Cutler-hammer
-00D0B0 Bitswitch
-00D0B1 Omega Electronics SA
-00D0B2 Xiotech
-00D0B3 DRS Flight Safety AND
-00D0B4 Katsujima CO.
-00D0B5 IPricot formerly DotCom
-00D0B6 Crescent Networks
-00D0B7 Intel
-00D0B8 Iomega
-00D0B9 Microtek International
-00D0BA Cisco Systems
-00D0BB Cisco Systems
-00D0BC Cisco Systems
-00D0BD Silicon Image GmbH
-00D0BE Emutec
-00D0BF Pivotal Technologies
-00D0C0 Cisco Systems
-00D0C1 Harmonic Data Systems
-00D0C2 Balthazar Technology AB
-00D0C3 Vivid Technology PTE
-00D0C4 Teratech
-00D0C5 Computational Systems
-00D0C6 Thomas & Betts
-00D0C7 Pathway
-00D0C8 Prevas A/S
-00D0C9 Advantech CO.
-00D0CA Intrinsyc Software International
-00D0CB Dasan CO.
-00D0CC Technologies Lyre
-00D0CD Atan Technology
-00D0CE Asyst Electronic
-00D0CF Moreton BAY
-00D0D0 Zhongxing Telecom
-00D0D1 Sycamore Networks
-00D0D2 Epilog
-00D0D3 Cisco Systems
-00D0D4 V-bits
-00D0D5 Grundig AG
-00D0D6 Aethra Telecomunicazioni
-00D0D7 B2C2
-00D0D8 3Com
-00D0D9 Dedicated Microcomputers
-00D0DA Taicom Data Systems CO.
-00D0DB Mcquay International
-00D0DC Modular Mining Systems
-00D0DD Sunrise Telecom
-00D0DE Philips Multimedia Network
-00D0DF Kuzumi Electronics
-00D0E0 Dooin Electronics CO.
-00D0E1 Avionitek Israel
-00D0E2 MRT Micro
-00D0E3 Ele-chem Engineering CO.
-00D0E4 Cisco Systems
-00D0E5 Solidum Systems
-00D0E6 Ibond
-00D0E7 Vcon Telecommunication
-00D0E8 MAC System CO.
-00D0E9 Advantage Century Telecommunication
-00D0EA Nextone Communications
-00D0EB Lightera Networks
-00D0EC Nakayo Telecommunications
-00D0ED Xiox
-00D0EE Dictaphone
-00D0EF IGT
-00D0F0 Convision Technology Gmbh
-00D0F1 Sega Enterprises
-00D0F2 Monterey Networks
-00D0F3 Solari DI Udine SPA
-00D0F4 Carinthian Tech Institute
-00D0F5 Orange Micro
-00D0F6 Alcatel Canada
-00D0F7 Next Nets
-00D0F8 Fujian Star Terminal
-00D0F9 Acute Communications
-00D0FA Thales e-Security
-00D0FB TEK Microsystems, Incorporated
-00D0FC Granite Microsystems
-00D0FD Optima Tele.com
-00D0FE Astral Point
-00D0FF Cisco Systems
-00DD00 Ungermann-bass
-00DD01 Ungermann-bass
-00DD02 Ungermann-bass
-00DD03 Ungermann-bass
-00DD04 Ungermann-bass
-00DD05 Ungermann-bass
-00DD06 Ungermann-bass
-00DD07 Ungermann-bass
-00DD08 Ungermann-bass
-00DD09 Ungermann-bass
-00DD0A Ungermann-bass
-00DD0B Ungermann-bass
-00DD0C Ungermann-bass
-00DD0D Ungermann-bass
-00DD0E Ungermann-bass
-00DD0F Ungermann-bass
-00E000 Fujitsu Limited
-00E001 Strand Lighting Limited
-00E002 Crossroads Systems
-00E003 Nokia Wireless Business Commun
-00E004 Pmc-sierra
-00E005 Technical
-00E006 Silicon Integrated SYS.
-00E007 Avaya ECS
-00E008 Amazing Controls!
-00E009 Marathon Technologies
-00E00A DIBA
-00E00B Rooftop Communications
-00E00C Motorola
-00E00D Radiant Systems
-00E00E Avalon Imaging Systems
-00E00F Shanghai Baud Data
-00E010 Hess Sb-automatenbau Gmbh
-00E011 Uniden
-00E012 Pluto Technologies International
-00E013 Eastern Electronic CO.
-00E014 Cisco Systems
-00E015 Heiwa
-00E016 Rapid City Communications
-00E017 Exxact Gmbh
-00E018 Asustek Computer
-00E019 ING. Giordano Elettronica
-00E01A Comtec Systems. CO.
-00E01B Sphere Communications
-00E01C Cradlepoint
-00E01D Webtv Networks
-00E01E Cisco Systems
-00E01F Avidia Systems
-00E020 Tecnomen OY
-00E021 Freegate
-00E022 Analog Devices
-00E023 Telrad
-00E024 Gadzoox Networks
-00E025 dit Co.
-00E026 Redlake Masd
-00E027 DUX
-00E028 Aptix
-00E029 Standard Microsystems
-00E02A Tandberg Television AS
-00E02B Extreme Networks
-00E02C AST Computer
-00E02D InnoMediaLogic
-00E02E SPC Electronics
-00E02F Mcns Holdings
-00E030 Melita International
-00E031 Hagiwara Electric CO.
-00E032 Misys Financial Systems
-00E033 E.E.P.D. GmbH
-00E034 Cisco Systems
-00E035 Emerson Network Power
-00E036 Pioneer
-00E037 Century
-00E038 Proxima
-00E039 Paradyne
-00E03A Cabletron Systems
-00E03B Prominet
-00E03C AdvanSys
-00E03D Focon Electronic Systems A/S
-00E03E Alfatech
-00E03F Jaton
-00E040 DeskStation Technology
-00E041 Cspi
-00E042 Pacom Systems
-00E043 VitalCom
-00E044 Lsics
-00E045 Touchwave
-00E046 Bently Nevada
-00E047 InFocus
-00E048 SDL Communications
-00E049 Microwi Electronic Gmbh
-00E04A Enhanced Messaging Systems
-00E04B Jump Industrielle Computertechnik Gmbh
-00E04C Realtek Semiconductor
-00E04D Internet Initiative Japan
-00E04E Sanyo Denki CO.
-00E04F Cisco Systems
-00E050 Executone Information Systems
-00E051 Talx
-00E052 Foundry Networks
-00E053 Cellport LABS
-00E054 Kodai Hitec CO.
-00E055 Ingenieria Electronica Comercial Inelcom S.A.
-00E056 Holontech
-00E057 HAN Microtelecom. CO.
-00E058 Phase ONE Denmark A/S
-00E059 Controlled Environments
-00E05A Galea Network Security
-00E05B West END Systems
-00E05C Matsushita Kotobuki Electronics Industries
-00E05D Unitec CO.
-00E05E Japan Aviation Electronics Industry
-00E05F e-Net
-00E060 Sherwood
-00E061 EdgePoint Networks
-00E062 Host Engineering
-00E063 Cabletron - Yago Systems
-00E064 Samsung Electronics
-00E065 Optical Access International
-00E066 ProMax Systems
-00E067 eac Automation-consulting Gmbh
-00E068 Merrimac Systems
-00E069 Jaycor
-00E06A Kapsch AG
-00E06B W&G Special Products
-00E06C AEP Systems International
-00E06D Compuware
-00E06E FAR Systems S.p.a.
-00E06F Motorola
-00E070 DH Technology
-00E071 Epis Microcomputer
-00E072 Lynk
-00E073 National Amusement Network
-00E074 Tiernan Communications
-00E075 Verilink
-00E076 Development Concepts
-00E077 Webgear
-00E078 Berkeley Networks
-00E079 A.t.n.r.
-00E07A Mikrodidakt AB
-00E07B BAY Networks
-00E07C Mettler-toledo
-00E07D Netronix
-00E07E Walt Disney Imagineering
-00E07F Logististem S.r.l.
-00E080 Control Resources
-00E081 Tyan Computer
-00E082 Anerma
-00E083 Jato Technologies
-00E084 Compulite R&D
-00E085 Global Maintech
-00E086 Cybex Computer Products
-00E087 LeCroy - Networking Productions Division
-00E088 LTX
-00E089 ION Networks
-00E08A GEC Avery
-00E08B QLogic
-00E08C Neoparadigm LABS
-00E08D Pressure Systems
-00E08E Utstarcom
-00E08F Cisco Systems
-00E090 Beckman LAB. Automation DIV.
-00E091 LG Electronics
-00E092 Admtek Incorporated
-00E093 Ackfin Networks
-00E094 Osai SRL
-00E095 Advanced-vision Technolgies
-00E096 Shimadzu
-00E097 Carrier Access
-00E098 AboCom Systems
-00E099 Samson AG
-00E09A Positron
-00E09B Engage Networks
-00E09C MII
-00E09D Sarnoff
-00E09E Quantum
-00E09F Pixel Vision
-00E0A0 Wiltron CO.
-00E0A1 Hima Paul Hildebrandt Gmbh Co. KG
-00E0A2 Microslate
-00E0A3 Cisco Systems
-00E0A4 Esaote S.p.a.
-00E0A5 ComCore Semiconductor
-00E0A6 Telogy Networks
-00E0A7 IPC Information Systems
-00E0A8 SAT GmbH & Co.
-00E0A9 Funai Electric CO.
-00E0AA Electrosonic
-00E0AB Dimat S.A.
-00E0AC Midsco
-00E0AD EES Technology
-00E0AE Xaqti
-00E0AF General Dynamics Information Systems
-00E0B0 Cisco Systems
-00E0B1 Alcatel-Lucent, Enterprise Business Group
-00E0B2 Telmax Communications
-00E0B3 EtherWAN Systems
-00E0B4 Techno Scope CO.
-00E0B5 Ardent Communications
-00E0B6 Entrada Networks
-00E0B7 PI Group
-00E0B8 Gateway 2000
-00E0B9 Byas Systems
-00E0BA Berghof Automationstechnik Gmbh
-00E0BB NBX
-00E0BC Symon Communications
-00E0BD Interface Systems
-00E0BE Genroco International
-00E0BF Torrent Networking Technologies
-00E0C0 Seiwa Electric MFG. CO.
-00E0C1 Memorex Telex Japan
-00E0C2 Necsy S.p.a.
-00E0C3 Sakai System Development
-00E0C4 Horner Electric
-00E0C5 Bcom Electronics
-00E0C6 Link2it, L.l.c.
-00E0C7 Eurotech SRL
-00E0C8 Virtual Access
-00E0C9 AutomatedLogic
-00E0CA Best Data Products
-00E0CB Reson
-00E0CC Hero Systems
-00E0CD Sensis
-00E0CE ARN
-00E0CF Integrated Device Technology
-00E0D0 Netspeed
-00E0D1 Telsis Limited
-00E0D2 Versanet Communications
-00E0D3 Datentechnik Gmbh
-00E0D4 Excellent Computer
-00E0D5 Emulex
-00E0D6 Computer & Communication Research LAB.
-00E0D7 Sunshine Electronics
-00E0D8 Lanbit Computer
-00E0D9 Tazmo CO.
-00E0DA Alcatel North America ESD
-00E0DB ViaVideo Communications
-00E0DC Nexware
-00E0DD Zenith Electronics
-00E0DE Datax NV
-00E0DF Keymile Gmbh
-00E0E0 SI Electronics
-00E0E1 G2 Networks
-00E0E2 Innova
-00E0E3 Sk-elektronik Gmbh
-00E0E4 Fanuc Robotics North America
-00E0E5 Cinco Networks
-00E0E6 Incaa Datacom B.V.
-00E0E7 Raytheon E-systems
-00E0E8 Gretacoder Data Systems AG
-00E0E9 Data LABS
-00E0EA Innovat Communications
-00E0EB Digicom Systems, Incorporated
-00E0EC Celestica
-00E0ED Silicom
-00E0EE Marel HF
-00E0EF Dionex
-00E0F0 Abler Technology
-00E0F1 That
-00E0F2 Arlotto Comnet
-00E0F3 WebSprint Communications
-00E0F4 Inside Technology A/S
-00E0F5 Teles AG
-00E0F6 Decision Europe
-00E0F7 Cisco Systems
-00E0F8 Dicna Control AB
-00E0F9 Cisco Systems
-00E0FA TRL Technology
-00E0FB Leightronix
-00E0FC Huawei Technologies CO.
-00E0FD A-trend Technology CO.
-00E0FE Cisco Systems
-00E0FF Security Dynamics Technologies
-00E6D3 Nixdorf Computer
-020701 Racal-datacom
-021C7C Perq Systems
-026086 Logic Replacement TECH.
-02608C 3com
-027001 Racal-datacom
-0270B0 M/a-com Companies
-0270B3 Data Recall
-029D8E Cardiac Recorders
-02AA3C Olivetti Telecomm SPA (olteco)
-02BB01 Octothorpe
-02C08C 3com
-02CF1C Communication Machinery
-02E6D3 Nixdorf Computer
-040AE0 Xmit AG Computer Networks
-04E0C4 Triumph-adler AG
-080001 Computervision
-080002 Bridge Communications
-080003 Advanced Computer COMM.
-080004 Cromemco Incorporated
-080005 Symbolics
-080006 Siemens AG
-080007 Apple Computer
-080008 Bolt Beranek AND Newman
-080009 Hewlett Packard
-08000A Nestar Systems Incorporated
-08000B Unisys
-08000C Miklyn Development CO.
-08000D International Computers
-08000E NCR
-08000F Mitel
-080011 Tektronix
-080012 Bell Atlantic Integrated SYST.
-080013 Exxon
-080014 Excelan
-080015 STC Business Systems
-080016 Barrister Info SYS
-080017 National Semiconductor
-080018 Pirelli Focom Networks
-080019 General Electric
-08001A Tiara/ 10net
-08001B EMC
-08001C Kdd-kokusai Debnsin Denwa CO.
-08001D Able Communications
-08001E Apollo Computer
-08001F Sharp
-080020 SUN Microsystems
-080021 3M Company
-080022 NBI
-080023 Panasonic Communications Co.
-080024 10net Communications/dca
-080025 Control Data
-080026 Norsk Data A.S.
-080027 Cadmus Computer Systems
-080028 Texas Instruments
-080029 Megatek
-08002A Mosaic Technologies
-08002B Digital Equipment
-08002C Britton LEE
-08002D Lan-tec
-08002E Metaphor Computer Systems
-08002F Prime Computer
-080030 Network Research
-080030 Cern
-080030 Royal Melbourne Inst OF Tech
-080031 Little Machines
-080032 Tigan Incorporated
-080033 Bausch & Lomb
-080034 Filenet
-080035 Microfive
-080036 Intergraph
-080037 Fuji-xerox CO.
-080038 CII Honeywell Bull
-080039 Spider Systems Limited
-08003A Orcatech
-08003B Torus Systems Limited
-08003C Schlumberger Well Services
-08003D Cadnetix Corporations
-08003E Codex
-08003F Fred Koschara Enterprises
-080040 Ferranti Computer SYS. Limited
-080041 Racal-milgo Information SYS..
-080042 Japan Macnics
-080043 Pixel Computer
-080044 David Systems
-080045 Concurrent Computer
-080046 Sony
-080047 Sequent Computer Systems
-080048 Eurotherm Gauging Systems
-080049 Univation
-08004A Banyan Systems
-08004B Planning Research
-08004C Hydra Computer Systems
-08004D Corvus Systems
-08004E 3com Europe
-08004F Cygnet Systems
-080050 Daisy Systems
-080051 Experdata
-080052 Insystec
-080053 Middle East TECH. University
-080055 Stanford Telecomm.
-080056 Stanford Linear Accel. Center
-080057 Evans & Sutherland
-080058 Systems Concepts
-080059 A/S Mycron
-08005A IBM
-08005B VTA Technologies
-08005C Four Phase Systems
-08005D Gould
-08005E Counterpoint Computer
-08005F Saber Technology
-080060 Industrial Networking
-080061 Jarogate
-080062 General Dynamics
-080063 Plessey
-080064 Autophon AG
-080065 Genrad
-080066 Agfa
-080067 Comdesign
-080068 Ridge Computers
-080069 Silicon Graphics
-08006A ATT Bell Laboratories
-08006B Accel Technologies
-08006C Suntek Technology Int'l
-08006D Whitechapel Computer Works
-08006E Masscomp
-08006F Philips Apeldoorn B.V.
-080070 Mitsubishi Electric
-080071 Matra (dsie)
-080072 Xerox Univ Grant Program
-080073 Tecmar
-080074 Casio Computer CO.
-080075 Dansk Data Electronik
-080076 PC LAN Technologies
-080077 TSL Communications
-080078 Accell
-080079 THE Droid Works
-08007A Indata
-08007B Sanyo Electric CO.
-08007C Vitalink Communications
-08007E Amalgamated Wireless(aus)
-08007F Carnegie-mellon University
-080080 AES Data
-080081 ,astech
-080082 Veritas Software
-080083 Seiko Instruments
-080084 Tomen Electronics
-080085 Elxsi
-080086 Konica Minolta Holdings
-080087 Xyplex
-080088 Brocade Communications Systems
-080089 Kinetics
-08008A Performance Technology
-08008B Pyramid Technology
-08008C Network Research
-08008D Xyvision
-08008E Tandem Computers
-08008F Chipcom
-080090 Sonoma Systems
-081443 Unibrain S.A.
-08BBCC Ak-nord EDV Vertriebsges. mbH
-100000 Private
-10005A IBM
-1000E8 National Semiconductor
-1100AA Private
-800010 ATT Bell Laboratories
-A06A00 Verilink
-AA0000 Digital Equipment
-AA0001 Digital Equipment
-AA0002 Digital Equipment
-AA0003 Digital Equipment
-AA0004 Digital Equipment
-ACDE48 Private
-525400 QEMU Virtual NIC
-B0C420 Bochs Virtual NIC
-DEADCA PearPC Virtual NIC
-00FFD1 Cooperative Linux virtual NIC \ No newline at end of file
diff --git a/config/mactovendor/bin/status_dhcp_leases.php_ b/config/mactovendor/bin/status_dhcp_leases.php_
deleted file mode 100644
index 311b617c..00000000
--- a/config/mactovendor/bin/status_dhcp_leases.php_
+++ /dev/null
@@ -1,434 +0,0 @@
-<?php
-/* $Id$ */
-/*
- status_dhcp_leases.php
- Copyright (C) 2004-2009 Scott Ullrich
- All rights reserved.
-
- originially part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- pfSense_BUILDER_BINARIES: /usr/bin/awk /bin/cat /usr/sbin/arp /usr/bin/wc /usr/bin/grep
- pfSense_MODULE: dhcpserver
-*/
-
-##|+PRIV
-##|*IDENT=page-status-dhcpleases
-##|*NAME=Status: DHCP leases page
-##|*DESCR=Allow access to the 'Status: DHCP leases' page.
-##|*MATCH=status_dhcp_leases.php*
-##|-PRIV
-
-require("guiconfig.inc");
-
-$pgtitle = array(gettext("Status"),gettext("DHCP leases"));
-
-$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases";
-
-if (($_GET['deleteip']) && (is_ipaddr($_GET['deleteip']))) {
- /* Stop DHCPD */
- killbyname("dhcpd");
-
- /* Read existing leases */
- $leases_contents = explode("\n", file_get_contents($leasesfile));
- $newleases_contents = array();
- $i=0;
- while ($i < count($leases_contents)) {
- /* Find the lease(s) we want to delete */
- if ($leases_contents[$i] == "lease {$_GET['deleteip']} {") {
- /* Skip to the end of the lease declaration */
- do {
- $i++;
- } while ($leases_contents[$i] != "}");
- } else {
- /* It's a line we want to keep, copy it over. */
- $newleases_contents[] = $leases_contents[$i];
- }
- $i++;
- }
-
- /* Write out the new leases file */
- $fd = fopen($leasesfile, 'w');
- fwrite($fd, implode("\n", $newleases_contents));
- fclose($fd);
-
- /* Restart DHCP Service */
- services_dhcpd_configure();
- header("Location: status_dhcp_leases.php?all={$_GET['all']}");
-}
-
-include("head.inc");
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<?php
-
-function leasecmp($a, $b) {
- return strcmp($a[$_GET['order']], $b[$_GET['order']]);
-}
-
-function adjust_gmt($dt) {
- $ts = strtotime($dt . " GMT");
- return strftime("%Y/%m/%d %H:%M:%S", $ts);
-}
-
-function remove_duplicate($array, $field)
-{
- foreach ($array as $sub)
- $cmp[] = $sub[$field];
- $unique = array_unique(array_reverse($cmp,true));
- foreach ($unique as $k => $rien)
- $new[] = $array[$k];
- return $new;
-}
-
-$awk = "/usr/bin/awk";
-/* this pattern sticks comments into a single array item */
-$cleanpattern = "'{ gsub(\"#.*\", \"\");} { gsub(\";\", \"\"); print;}'";
-/* We then split the leases file by } */
-$splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i; printf \"}\\n\";}'";
-
-/* stuff the leases file in a proper format into a array by line */
-exec("/bin/cat {$leasesfile} | {$awk} {$cleanpattern} | {$awk} {$splitpattern}", $leases_content);
-$leases_count = count($leases_content);
-exec("/usr/sbin/arp -an", $rawdata);
-$arpdata = array();
-foreach ($rawdata as $line) {
- $elements = explode(' ',$line);
- if ($elements[3] != "(incomplete)") {
- $arpent = array();
- $arpent['ip'] = trim(str_replace(array('(',')'),'',$elements[1]));
- // $arpent['mac'] = trim($elements[3]);
- // $arpent['interface'] = trim($elements[5]);
- $arpdata[] = $arpent['ip'];
- }
-}
-
-$pools = array();
-$leases = array();
-$i = 0;
-$l = 0;
-$p = 0;
-
-// Put everything together again
-while($i < $leases_count) {
- /* split the line by space */
- $data = explode(" ", $leases_content[$i]);
- /* walk the fields */
- $f = 0;
- $fcount = count($data);
- /* with less then 20 fields there is nothing useful */
- if($fcount < 20) {
- $i++;
- continue;
- }
- while($f < $fcount) {
- switch($data[$f]) {
- case "failover":
- $pools[$p]['name'] = $data[$f+2];
- $pools[$p]['mystate'] = $data[$f+7];
- $pools[$p]['peerstate'] = $data[$f+14];
- $pools[$p]['mydate'] = $data[$f+10];
- $pools[$p]['mydate'] .= " " . $data[$f+11];
- $pools[$p]['peerdate'] = $data[$f+17];
- $pools[$p]['peerdate'] .= " " . $data[$f+18];
- $p++;
- $i++;
- continue 3;
- case "lease":
- $leases[$l]['ip'] = $data[$f+1];
- $leases[$l]['type'] = "dynamic";
- $f = $f+2;
- break;
- case "starts":
- $leases[$l]['start'] = $data[$f+2];
- $leases[$l]['start'] .= " " . $data[$f+3];
- $f = $f+3;
- break;
- case "ends":
- $leases[$l]['end'] = $data[$f+2];
- $leases[$l]['end'] .= " " . $data[$f+3];
- $f = $f+3;
- break;
- case "tstp":
- $f = $f+3;
- break;
- case "tsfp":
- $f = $f+3;
- break;
- case "atsfp":
- $f = $f+3;
- break;
- case "cltt":
- $f = $f+3;
- break;
- case "binding":
- switch($data[$f+2]) {
- case "active":
- $leases[$l]['act'] = "active";
- break;
- case "free":
- $leases[$l]['act'] = "expired";
- $leases[$l]['online'] = "offline";
- break;
- case "backup":
- $leases[$l]['act'] = "reserved";
- $leases[$l]['online'] = "offline";
- break;
- }
- $f = $f+1;
- break;
- case "next":
- /* skip the next binding statement */
- $f = $f+3;
- break;
- case "hardware":
- $leases[$l]['mac'] = $data[$f+2];
- /* check if it's online and the lease is active */
- if (in_array($leases[$l]['ip'], $arpdata)) {
- $leases[$l]['online'] = 'online';
- } else {
- $leases[$l]['online'] = 'offline';
- }
- $f = $f+2;
- break;
- case "client-hostname":
- if($data[$f+1] <> "") {
- $leases[$l]['hostname'] = preg_replace('/"/','',$data[$f+1]);
- } else {
- $hostname = gethostbyaddr($leases[$l]['ip']);
- if($hostname <> "") {
- $leases[$l]['hostname'] = $hostname;
- }
- }
- $f = $f+1;
- break;
- case "uid":
- $f = $f+1;
- break;
- }
- $f++;
- }
- $l++;
- $i++;
-}
-
-/* remove duplicate items by mac address */
-if(count($leases) > 0) {
- $leases = remove_duplicate($leases,"ip");
-}
-
-if(count($pools) > 0) {
- $pools = remove_duplicate($pools,"name");
- asort($pools);
-}
-
-foreach($config['interfaces'] as $ifname => $ifarr) {
- if (is_array($config['dhcpd'][$ifname]) &&
- is_array($config['dhcpd'][$ifname]['staticmap'])) {
- foreach($config['dhcpd'][$ifname]['staticmap'] as $static) {
- $slease = array();
- $slease['ip'] = $static['ipaddr'];
- $slease['type'] = "static";
- $slease['mac'] = $static['mac'];
- $slease['start'] = "";
- $slease['end'] = "";
- $slease['hostname'] = htmlentities($static['hostname']);
- $slease['act'] = "static";
- $online = exec("/usr/sbin/arp -an |/usr/bin/grep {$slease['mac']}| /usr/bin/wc -l|/usr/bin/awk '{print $1;}'");
- if ($online == 1) {
- $slease['online'] = 'online';
- } else {
- $slease['online'] = 'offline';
- }
- $leases[] = $slease;
- }
- }
-}
-
-if ($_GET['order'])
- usort($leases, "leasecmp");
-
-/* only print pool status when we have one */
-if(count($pools) > 0) {
-?>
-<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><?=gettext("Failover Group"); ?></a></td>
- <td class="listhdrr"><?=gettext("My State"); ?></a></td>
- <td class="listhdrr"><?=gettext("Since"); ?></a></td>
- <td class="listhdrr"><?=gettext("Peer State"); ?></a></td>
- <td class="listhdrr"><?=gettext("Since"); ?></a></td>
- </tr>
-<?php
-foreach ($pools as $data) {
- echo "<tr>\n";
- echo "<td class=\"listlr\">{$fspans}{$data['name']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['mystate']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['mydate']) . "{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['peerstate']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['peerdate']) . "{$fspane}&nbsp;</td>\n";
- echo "<td class=\"list\" valign=\"middle\" width=\"17\">&nbsp;</td>\n";
- echo "<td class=\"list\" valign=\"middle\" width=\"17\">&nbsp;</td>\n";
- echo "</tr>\n";
-}
-
-?>
-</table>
-
-<?php
-/* only print pool status when we have one */
-}
-?>
-
-<p>
-
-<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><a href="#"><?=gettext("IP address"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("MAC address"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("Hostname"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("Start"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("End"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("Online"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("Lease Type"); ?></a></td>
- </tr>
-<?php
-// Load MAC-Manufacturer table
-$macs=file("/usr/local/pkg/mactovendor/mac-prefixes");
-if ($macs){
- foreach ($macs as $line){
- if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
- /* store values like this $mac_man['000C29']='VMware' */
- $mac_man["$matches[1]"]=$matches[2];
- }
- }
-}
-
-foreach ($leases as $data) {
- if (($data['act'] == "active") || ($data['act'] == "static") || ($_GET['all'] == 1)) {
- if ($data['act'] != "active" && $data['act'] != "static") {
- $fspans = "<span class=\"gray\">";
- $fspane = "</span>";
- } else {
- $fspans = $fspane = "";
- }
- $lip = ip2ulong($data['ip']);
- if ($data['act'] == "static") {
- foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
- if(is_array($dhcpifconf['staticmap'])) {
- foreach ($dhcpifconf['staticmap'] as $staticent) {
- if ($data['ip'] == $staticent['ipaddr']) {
- $data['if'] = $dhcpif;
- break;
- }
- }
- }
- /* exit as soon as we have an interface */
- if ($data['if'] != "")
- break;
- }
- } else {
- foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
- if (($lip >= ip2ulong($dhcpifconf['range']['from'])) && ($lip <= ip2ulong($dhcpifconf['range']['to']))) {
- $data['if'] = $dhcpif;
- break;
- }
- }
- }
- echo "<tr>\n";
- echo "<td class=\"listlr\">{$fspans}{$data['ip']}{$fspane}&nbsp;</td>\n";
- $mac=$data['mac'];
- $mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
- if ($data['online'] != "online") {
- if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
- $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
- echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&mac=$mac\" title=\"" . gettext("$mac, {$mac_man[$mac_hi]} - send Wake on LAN packet to this MAC address") ."\">" . $mac_man_ar[0] . substr($mac, 8) . "</a>{$fspane}&nbsp;</td>\n";
- }else{
- echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&mac={$data['mac']}\" title=\"" . gettext("send Wake on LAN packet to this MAC address") ."\">{$data['mac']}</a>{$fspane}&nbsp;</td>\n";
- }
- } else {
- if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
- $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
- echo "<td class=\"listr\">{$fspans}<span title=\"$mac, {$mac_man[$mac_hi]}\">" . $mac_man_ar[0] . substr($mac, 8) . "</span>{$fspane}&nbsp;</td>\n";
- }else{
- echo "<td class=\"listr\">{$fspans}{$data['mac']}{$fspane}&nbsp;</td>\n";
- }
- }
- echo "<td class=\"listr\">{$fspans}" . htmlentities($data['hostname']) . "{$fspane}&nbsp;</td>\n";
- if ($data['type'] != "static") {
- echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['start']) . "{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['end']) . "{$fspane}&nbsp;</td>\n";
- } else {
- echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
- }
- echo "<td class=\"listr\">{$fspans}{$data['online']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['act']}{$fspane}&nbsp;</td>\n";
-
- if ($data['type'] == "dynamic") {
- echo "<td valign=\"middle\"><a href=\"services_dhcp_edit.php?if={$data['if']}&mac={$data['mac']}&hostname={$data['hostname']}\">";
- echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("add a static mapping for this MAC address") ."\"></a></td>\n";
- } else {
- echo "<td class=\"list\" valign=\"middle\">";
- echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus_mo.gif\" width=\"17\" height=\"17\" border=\"0\"></td>\n";
- }
-
- echo "<td valign=\"middle\"><a href=\"services_wol_edit.php?if={$data['if']}&mac={$data['mac']}&descr={$data['hostname']}\">";
- echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_wol_all.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("add a Wake on LAN mapping for this MAC address") ."\"></a></td>\n";
-
- /* Only show the button for offline dynamic leases */
- if (($data['type'] == "dynamic") && ($data['online'] != "online")) {
- echo "<td class=\"list\" valign=\"middle\"><a href=\"status_dhcp_leases.php?deleteip={$data['ip']}&all=" . htmlspecialchars($_GET['all']) . "\">";
- echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_x.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("delete this DHCP lease") . "\"></a></td>\n";
- }
- echo "</tr>\n";
- }
-}
-
-?>
-</table>
-<p>
-<form action="status_dhcp_leases.php" method="GET">
-<input type="hidden" name="order" value="<?=htmlspecialchars($_GET['order']);?>">
-<?php if ($_GET['all']): ?>
-<input type="hidden" name="all" value="0">
-<input type="submit" class="formbtn" value="<?=gettext("Show active and static leases only"); ?>">
-<?php else: ?>
-<input type="hidden" name="all" value="1">
-<input type="submit" class="formbtn" value="<?=gettext("Show all configured leases"); ?>">
-<?php endif; ?>
-</form>
-<?php if($leases == 0): ?>
-<p><strong><?=gettext("No leases file found. Is the DHCP server active"); ?>?</strong></p>
-<?php endif; ?>
-
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/mactovendor/bin/status_interfaces.php_ b/config/mactovendor/bin/status_interfaces.php_
deleted file mode 100644
index 1d8f8c9c..00000000
--- a/config/mactovendor/bin/status_interfaces.php_
+++ /dev/null
@@ -1,353 +0,0 @@
-<?php
-/* $Id$ */
-/*
- status_interfaces.php
- part of pfSense
- Copyright (C) 2009 Scott Ullrich <sullrich@gmail.com>.
- All rights reserved.
-
- originally part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-/*
- pfSense_MODULE: interfaces
-*/
-
-##|+PRIV
-##|*IDENT=page-status-interfaces
-##|*NAME=Status: Interfaces page
-##|*DESCR=Allow access to the 'Status: Interfaces' page.
-##|*MATCH=status_interfaces.php*
-##|-PRIV
-
-require_once("guiconfig.inc");
-
-if ($_GET['if']) {
- $interface = $_GET['if'];
- if ($_GET['action'] == "Disconnect" || $_GET['action'] == "Release") {
- interface_bring_down($interface);
- } else if ($_GET['action'] == "Connect" || $_GET['action'] == "Renew") {
- interface_configure($interface);
- }
- header("Location: status_interfaces.php");
- exit;
-}
-
-$pgtitle = array(gettext("Status"),gettext("Interfaces"));
-include("head.inc");
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
-<?php
- $i = 0;
- $ifdescrs = get_configured_interface_with_descr(false, true);
- foreach ($ifdescrs as $ifdescr => $ifname):
- $ifinfo = get_interface_info($ifdescr);
- // Load MAC-Manufacturer table
- $macs=file("/usr/local/pkg/mactovendor/mac-prefixes");
- if ($macs){
- foreach ($macs as $line){
- if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
- /* store values like this $mac_man['000C29']='VMware' */
- $mac_man["$matches[1]"]=$matches[2];
- }
- }
- }
-?>
-<?php if ($i): ?>
- <tr>
- <td colspan="8" class="list" height="12"></td>
- </tr>
-<?php endif; ?>
- <tr>
- <td colspan="2" class="listtopic">
- <?=htmlspecialchars($ifname);?> <?=gettext("interface"); ?> (<?=htmlspecialchars($ifinfo['hwif']);?>)
- </td>
- </tr>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Status"); ?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['status']);?>
- </td>
- </tr>
- <?php if ($ifinfo['dhcplink']): ?>
- <tr>
- <td width="22%" class="vncellt">
- DHCP
- </td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['dhcplink']);?>&nbsp;&nbsp;
- <?php if ($ifinfo['dhcplink'] == "up"): ?>
- <a href="status_interfaces.php?action=Release&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Release");?>" class="formbtns">
- <?php else: ?>
- <a href="status_interfaces.php?action=Renew&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Renew");?>" class="formbtns">
- <?php endif; ?>
- </a>
- </td>
- </tr>
- <?php endif; if ($ifinfo['pppoelink']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("PPPoE"); ?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['pppoelink']);?>&nbsp;&nbsp;
- <?php if ($ifinfo['pppoelink'] == "up"): ?>
- <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
- <?php else: ?>
- <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
- <?php endif; ?>
- </a>
- </td>
- </tr>
- <?php endif; if ($ifinfo['pptplink']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("PPTP"); ?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['pptplink']);?>&nbsp;&nbsp;
- <?php if ($ifinfo['pptplink'] == "up"): ?>
- <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
- <?php else: ?>
- <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
- <?php endif; ?>
- </a>
- </td>
- </tr>
- <?php endif; if ($ifinfo['ppplink']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("PPP"); ?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['pppinfo']);?>
- <?php if ($ifinfo['ppplink'] == "up"): ?>
- <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
- <?php else: ?>
- <?php if (!$ifinfo['nodevice']): ?>
- <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
- <?php endif; ?>
- <?php endif; ?>
- </a>
- </td>
- </tr>
- <?php endif; if ($ifinfo['ppp_uptime'] || $ifinfo['ppp_uptime_accumulated']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Uptime ");?><?php if ($ifinfo['ppp_uptime_accumulated']) echo "(historical)"; ?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['ppp_uptime']);?> <?=htmlspecialchars($ifinfo['ppp_uptime_accumulated']);?>
- </td>
- </tr>
- <?php endif; if ($ifinfo['macaddr']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("MAC address");?></td>
- <td width="78%" class="listr">
- <?php
- $mac=$ifinfo['macaddr'];
- $mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
- if(isset($mac_man[$mac_hi])){
- $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
- print "<span title=\"$mac, {$mac_man[$mac_hi]}\">" . $mac_man_ar[0] . substr($mac, 8) . "</span>"; }
- else {print htmlspecialchars($mac);}
- ?>
- </td>
- </tr>
- <?php endif; if ($ifinfo['status'] != "down"): ?>
- <?php if ($ifinfo['dhcplink'] != "down" && $ifinfo['pppoelink'] != "down" && $ifinfo['pptplink'] != "down"): ?>
- <?php if ($ifinfo['ipaddr']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("IP address");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['ipaddr']);?>
- &nbsp;
- </td>
- </tr>
- <?php endif; ?><?php if ($ifinfo['subnet']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Subnet mask");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['subnet']);?>
- </td>
- </tr>
- <?php endif; ?><?php if ($ifinfo['gateway']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Gateway");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($config['interfaces'][$ifdescr]['gateway']);?>
- <?=htmlspecialchars($ifinfo['gateway']);?>
- </td>
- </tr>
- <?php endif; if ($ifdescr == "wan" && file_exists("{$g['varetc_path']}/resolv.conf")): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("ISP DNS servers");?></td>
- <td width="78%" class="listr">
- <?php
- $dns_servers = get_dns_servers();
- foreach($dns_servers as $dns) {
- echo "{$dns}<br>";
- }
- ?>
- </td>
- </tr>
- <?php endif; endif; if ($ifinfo['media']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Media");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['media']);?>
- </td>
- </tr>
-<?php endif; ?><?php if ($ifinfo['channel']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Channel");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['channel']);?>
- </td>
- </tr>
-<?php endif; ?><?php if ($ifinfo['ssid']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("SSID");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['ssid']);?>
- </td>
- </tr>
-<?php endif; ?><?php if ($ifinfo['bssid']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("BSSID");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['bssid']);?>
- </td>
- </tr>
-<?php endif; ?><?php if ($ifinfo['rate']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Rate");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['rate']);?>
- </td>
- </tr>
-<?php endif; ?><?php if ($ifinfo['rssi']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("RSSI");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['rssi']);?>
- </td>
- </tr>
-<?php endif; ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("In/out packets");?></td>
- <td width="78%" class="listr">
- <?php
- echo htmlspecialchars($ifinfo['inpkts'] . "/" . $ifinfo['outpkts'] . " (");
- echo htmlspecialchars(format_bytes($ifinfo['inbytes']) . "/" . format_bytes($ifinfo['outbytes']) . ")");
- ?>
- </td>
- </tr>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("In/out packets (pass)");?></td>
- <td width="78%" class="listr">
- <?php
- echo htmlspecialchars($ifinfo['inpktspass'] . "/" . $ifinfo['outpktspass'] . " (");
- echo htmlspecialchars(format_bytes($ifinfo['inbytespass']) . "/" . format_bytes($ifinfo['outbytespass']) . ")");
- ?>
- </td>
- </tr>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("In/out packets (block)");?></td>
- <td width="78%" class="listr">
- <?php
- echo htmlspecialchars($ifinfo['inpktsblock'] . "/" . $ifinfo['outpktsblock'] . " (");
- echo htmlspecialchars(format_bytes($ifinfo['inbytesblock']) . "/" . format_bytes($ifinfo['outbytesblock']) . ")");
- ?>
- </td>
- </tr>
-<?php if (isset($ifinfo['inerrs'])): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("In/out errors");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['inerrs'] . "/" . $ifinfo['outerrs']);?>
- </td>
- </tr>
-<?php endif; ?>
-<?php if (isset($ifinfo['collisions'])): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Collisions");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['collisions']);?>
- </td>
- </tr>
-<?php endif; ?>
-<?php endif; ?>
-<?php if ($ifinfo['bridge']): ?>
- <tr>
- <td width="22%" class="vncellt"><?php printf(gettext("Bridge (%s)"),$ifinfo['bridgeint']);?></td>
- <td width="78%" class="listr">
- <?=$ifinfo['bridge'];?>
- </td>
- </tr>
-<?php endif; ?>
-<?php if(file_exists("/usr/bin/vmstat")): ?>
-<?php
- $real_interface = "";
- $interrupt_total = "";
- $interrupt_sec = "";
- $real_interface = $ifinfo['hwif'];
- $interrupt_total = `vmstat -i | grep $real_interface | awk '{ print $3 }'`;
- $interrupt_sec = `vmstat -i | grep $real_interface | awk '{ print $4 }'`;
- if(strstr($interrupt_total, "hci")) {
- $interrupt_total = `vmstat -i | grep $real_interface | awk '{ print $4 }'`;
- $interrupt_sec = `vmstat -i | grep $real_interface | awk '{ print $5 }'`;
- }
- unset($interrupt_total); // XXX: FIX ME! Need a regex and parse correct data 100% of the time.
-?>
-<?php if($interrupt_total): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Interrupts/Second");?></td>
- <td width="78%" class="listr">
- <?php
- echo $interrupt_total . " " . gettext("total");
- echo "<br/>";
- echo $interrupt_sec . " " . gettext("rate");
- ?>
- </td>
- </tr>
-<?php endif; ?>
-<?php endif; ?>
-<?php $i++; endforeach; ?>
-</table>
-
-<br/>
-
-</strong><?php printf(gettext("Using dial-on-demand will bring the connection up again if any packet ".
-"triggers it. To substantiate this point: disconnecting manually ".
-"will %snot%s prevent dial-on-demand from making connections ".
-"to the outside! Don't use dial-on-demand if you want to make sure that the line ".
-"is kept disconnected."),'<strong>','</strong>')?>
-
-<?php include("fend.inc"); ?>
diff --git a/config/mactovendor/bin/status_wireless.php_ b/config/mactovendor/bin/status_wireless.php_
deleted file mode 100644
index 8e54e06e..00000000
--- a/config/mactovendor/bin/status_wireless.php_
+++ /dev/null
@@ -1,208 +0,0 @@
-<?php
-/*
- status_wireless.php
- Copyright (C) 2004 Scott Ullrich
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-/*
- pfSense_MODULE: interfaces
-*/
-
-##|+PRIV
-##|*IDENT=page-diagnostics-wirelessstatus
-##|*NAME=Status: Wireless page
-##|*DESCR=Allow access to the 'Status: Wireless' page.
-##|*MATCH=status_wireless.php*
-##|-PRIV
-
-require_once("guiconfig.inc");
-
-$pgtitle = array(gettext("Status"),gettext("Wireless"));
-include("head.inc");
-
-$if = $_POST['if'];
-if($_GET['if'] <> "")
- $if = $_GET['if'];
-
-$ciflist = get_configured_interface_with_descr();
-if(empty($if)) {
- /* Find the first interface
- that is wireless */
- foreach($ciflist as $interface => $ifdescr) {
- if(is_interface_wireless(get_real_interface($interface))) {
- $if = $interface;
- break;
- }
- }
-}
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php
-include("fbegin.inc");
-?>
-<form action="status_wireless.php" method="post">
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr><td>
-<?php
-$tab_array = array();
-foreach($ciflist as $interface => $ifdescr) {
- if (is_interface_wireless(get_real_interface($interface))) {
- $enabled = false;
- if($if == $interface)
- $enabled = true;
- $tab_array[] = array(gettext("Status") . " ({$ifdescr})", $enabled, "status_wireless.php?if={$interface}");
- }
-}
-$rwlif = get_real_interface($if);
-if($_POST['rescanwifi'] <> "") {
- mwexec_bg("/sbin/ifconfig {$rwlif} scan 2>&1");
- $savemsg = gettext("Rescan has been initiated in the background. Refresh this page in 10 seconds to see the results.");
-}
-if ($savemsg) print_info_box($savemsg);
-display_top_tabs($tab_array);
-?>
-</td></tr>
-<tr><td>
-<div id="mainarea">
-<table class="tabcont" colspan="3" cellpadding="3" width="100%">
-<?php
-
- // Load MAC-Manufacturer table
- $macs=file("/usr/local/pkg/mactovendor/mac-prefixes");
- if ($macs){
- foreach ($macs as $line){
- if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
- /* store values like this $mac_man['000C29']='VMware' */
- $mac_man["$matches[1]"]=$matches[2];
- }
- }
- }
-
- /* table header */
- print "<input type=\"hidden\" name=\"if\" id=\"if\" value=\"{$if}\">\n";
- print "<tr><td colspan=7><b><input type=\"submit\" name=\"rescanwifi\" id=\"rescanwifi\" value=\"Rescan\"><br/></td></tr>\n";
- print "<tr><td colspan=7><b>" . gettext("Nearby access points or ad-hoc peers") . ".<br/></td></tr>\n";
- print "\n<tr>";
- print "<tr bgcolor='#990000'>";
- print "<td><b><font color='#ffffff'>SSID</td>";
- print "<td><b><font color='#ffffff'>BSSID</td>";
- print "<td><b><font color='#ffffff'>CHAN</td>";
- print "<td><b><font color='#ffffff'>RATE</td>";
- print "<td><b><font color='#ffffff'>RSSI</td>";
- print "<td><b><font color='#ffffff'>INT</td>";
- print "<td><b><font color='#ffffff'>CAPS</td>";
- print "</tr>\n\n";
-
- exec("/sbin/ifconfig {$rwlif} list scan 2>&1", $states, $ret);
- /* Skip Header */
- array_shift($states);
-
- $counter=0;
- foreach($states as $state) {
- /* Split by Mac address for the SSID Field */
- $split = preg_split("/([0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f])/i", $state);
- preg_match("/([0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f])/i", $state, $bssid);
- $ssid = htmlspecialchars($split[0]);
- $bssid = $bssid[0];
- /* Split the rest by using spaces for this line using the 2nd part */
- $split = preg_split("/[ ]+/i", $split[1]);
- $channel = $split[1];
- $rate = $split[2];
- $rssi = $split[3];
- $int = $split[4];
- $caps = "$split[5] $split[6] $split[7] $split[8] $split[9] $split[10] $split[11] ";
-
- print "<tr>";
- print "<td>{$ssid}</td>";
- $mac_hi = strtoupper($bssid[0] . $bssid[1] . $bssid[3] . $bssid[4] . $bssid[6] . $bssid[7]);
- if(isset($mac_man[$mac_hi])){
- $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
- print "<td><span title=\"$bssid, {$mac_man[$mac_hi]}\">" . $mac_man_ar[0] . substr($bssid, 8) . "</span></td>";
- }else
- print "<td>{$bssid}</td>";
- print "<td>{$channel}</td>";
- print "<td>{$rate}</td>";
- print "<td>{$rssi}</td>";
- print "<td>{$int}</td>";
- print "<td>{$caps}</td>";
- print "</tr>\n";
- }
-
- print "</table><table class=\"tabcont\" colspan=\"3\" cellpadding=\"3\" width=\"100%\">";
-
- /* table header */
- print "\n<tr>";
- print "<tr><td colspan=7><b>" . gettext("Associated or ad-hoc peers") . "<br/></td></tr>\n";
- print "<tr bgcolor='#990000'>";
- print "<td><b><font color='#ffffff'>ADDR</td>";
- print "<td><b><font color='#ffffff'>AID</td>";
- print "<td><b><font color='#ffffff'>CHAN</td>";
- print "<td><b><font color='#ffffff'>RATE</td>";
- print "<td><b><font color='#ffffff'>RSSI</td>";
- print "<td><b><font color='#ffffff'>IDLE</td>";
- print "<td><b><font color='#ffffff'>TXSEQ</td>";
- print "<td><b><font color='#ffffff'>RXSEQ</td>";
- print "<td><b><font color='#ffffff'>CAPS</td>";
- print "<td><b><font color='#ffffff'>ERP</td>";
- print "</tr>\n\n";
-
- $states = array();
- exec("/sbin/ifconfig {$rwlif} list sta 2>&1", $states, $ret);
- array_shift($states);
-
- $counter=0;
- foreach($states as $state) {
- $split = preg_split("/[ ]+/i", $state);
- /* Split the rest by using spaces for this line using the 2nd part */
- print "<tr>";
- print "<td>{$split[0]}</td>";
- print "<td>{$split[1]}</td>";
- print "<td>{$split[2]}</td>";
- print "<td>{$split[3]}</td>";
- print "<td>{$split[4]}</td>";
- print "<td>{$split[5]}</td>";
- print "<td>{$split[6]}</td>";
- print "<td>{$split[7]}</td>";
- print "<td>{$split[8]}</td>";
- print "<td>{$split[9]}</td>";
- print "</tr>\n";
- }
-
-/* XXX: what stats to we get for adhoc mode? */
-
-?>
-</table>
-</div><br>
- <b>Flags:</b> A = authorized, E = Extended Rate (802.11g), P = Power save mode<br>
- <b>Capabilities:</b> E = ESS (infrastructure mode), I = IBSS (ad-hoc mode), P = privacy (WEP/TKIP/AES),
- S = Short preamble, s = Short slot time
-</td></tr>
-</table>
-
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/mactovendor/mactovendor.inc b/config/mactovendor/mactovendor.inc
deleted file mode 100644
index 7abc3580..00000000
--- a/config/mactovendor/mactovendor.inc
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-
-/**
- * Author: Evgeny Yurchenko
- * Email: ey@tm-k.com
- *
- * Developed for: pfSense.com
- *
- * Copyright (c) 2010, pfSense.com
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution.
- * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-require('filter.inc');
-
-function mactovendor_custom_php_install_command()
-{
- exec("mkdir -p /usr/local/pkg/mactovendor/backup");
- // Let's backup everything
- copy("/usr/local/www/diag_arp.php", "/usr/local/pkg/mactovendor/backup/diag_arp.php.bak");
- copy("/usr/local/www/status_dhcp_leases.php", "/usr/local/pkg/mactovendor/backup/status_dhcp_leases.php.bak");
- copy("/usr/local/www/status_interfaces.php", "/usr/local/pkg/mactovendor/backup/status_interfaces.php.bak");
- copy("/usr/local/www/status_wireless.php", "/usr/local/pkg/mactovendor/backup/status_wireless.php.bak");
-
-
- // Install patches
- copy("/usr/local/pkg/mactovendor/diag_arp.php_", "/usr/local/www/diag_arp.php");
- copy("/usr/local/pkg/mactovendor/status_dhcp_leases.php_", "/usr/local/www/status_dhcp_leases.php");
- copy("/usr/local/pkg/mactovendor/status_interfaces.php_", "/usr/local/www/status_interfaces.php");
- copy("/usr/local/pkg/mactovendor/status_wireless.php_", "/usr/local/www/status_wireless.php");
-}
-
-function mactovendor_custom_php_deinstall_command()
-{
- copy("/usr/local/pkg/mactovendor/backup/diag_arp.php.bak", "/usr/local/www/diag_arp.php");
- copy("/usr/local/pkg/mactovendor/backup/status_dhcp_leases.php.bak", "/usr/local/www/status_dhcp_leases.php");
- copy("/usr/local/pkg/mactovendor/backup/status_interfaces.php.bak", "/usr/local/www/status_interfaces.php");
- copy("/usr/local/pkg/mactovendor/backup/status_wireless.php.bak", "/usr/local/www/status_wireless.php");
- exec("rm -r /usr/local/pkg/mactovendor");
-}
-
-?>
diff --git a/config/mactovendor/mactovendor.xml b/config/mactovendor/mactovendor.xml
deleted file mode 100644
index ab92f9fe..00000000
--- a/config/mactovendor/mactovendor.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<packagegui>
- <description>MAC-address to Vendor translation</description>
- <requirements></requirements>
- <name>MAC-to-Vendor</name>
- <version>0.2</version>
- <title>MAC-to-Vendor</title>
- <aftersaveredirect></aftersaveredirect>
- <include_file>/usr/local/pkg/mactovendor/mactovendor.inc</include_file>
- <additional_files_needed>
- <prefix>/usr/local/pkg/mactovendor/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/mactovendor/mactovendor.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/mactovendor/</prefix>
- <chmod>644</chmod>
- <item>https://packages.pfsense.org/packages/config/mactovendor/bin/diag_arp.php_</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/mactovendor/</prefix>
- <chmod>644</chmod>
- <item>https://packages.pfsense.org/packages/config/mactovendor/bin/status_dhcp_leases.php_</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/mactovendor/</prefix>
- <chmod>644</chmod>
- <item>https://packages.pfsense.org/packages/config/mactovendor/bin/status_interfaces.php_</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/mactovendor/</prefix>
- <chmod>644</chmod>
- <item>https://packages.pfsense.org/packages/config/mactovendor/bin/status_wireless.php_</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/mactovendor/</prefix>
- <chmod>644</chmod>
- <item>https://packages.pfsense.org/packages/config/mactovendor/bin/mac-prefixes</item>
- </additional_files_needed>
- <custom_php_install_command>
- mactovendor_custom_php_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- mactovendor_custom_php_deinstall_command();
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/miniupnpd/miniupnpd.inc b/config/miniupnpd/miniupnpd.inc
deleted file mode 100644
index 98e44951..00000000
--- a/config/miniupnpd/miniupnpd.inc
+++ /dev/null
@@ -1,290 +0,0 @@
-<?php
-
-/* package is now in base, check to see
- * if we are already being included
- */
-if(!function_exists("upnp_action")) {
-
- require_once("config.inc");
- require_once("functions.inc");
-
- /* MiniUPnPd */
-
- define('UPNP_RCFILE', '/usr/local/etc/rc.d/miniupnpd.sh');
- define('UPNP_CONFIG','/usr/local/etc/miniupnpd.conf');
-
- function upnp_notice ($msg) { syslog(LOG_NOTICE, "miniupnpd: {$msg}"); }
- function upnp_warn ($msg) { syslog(LOG_WARNING, "miniupnpd: {$msg}"); }
-
- function upnp_action ($action) {
- if (file_exists(UPNP_RCFILE))
- mwexec(UPNP_RCFILE.' '.$action);
- }
-
- function upnp_running () {
- if((int)exec('pgrep miniupnpd | wc -l') > 0)
- return true;
- return false;
- }
-
- function upnp_write_config($file, $text) {
- $handle = fopen($file, 'w');
- if(!$handle) {
- upnp_warn("Could not open {$file} for writing.");
- exit;
- }
- fwrite($handle, $text);
- fclose($handle);
- }
-
- function upnp_uuid() {
- /* md5 hash of wan mac */
- $uuid = md5(exec('arp -an -i '.get_real_wan_interface().' | /usr/bin/cut -d " " -f4'));
- /* put uuid in correct format 8-4-4-4-12 */
- return substr($uuid,0,8).'-'.substr($uuid,9,4).'-'.substr($uuid,13,4).'-'.substr($uuid,17,4).'-'.substr($uuid,21,12);
- }
-
- function upnp_validate_ip($ip,$check_cdir) {
- /* validate cdir */
- if($check_cdir) {
- $ip_array = explode('/',$ip);
- if(count($ip_array) == 2) {
- if($ip_array[1] < 1 || $ip_array[1] > 32)
- return false;
- } else
- if(count($ip_array) != 1)
- return false;
- } else
- $ip_array[] = $ip;
-
- /* validate ip */
- if(!eregi('^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$', $ip_array[0]))
- return false;
- foreach(explode('.', $ip_array[0]) as $sub)
- if($sub < 0 || $sub > 256)
- return false;
- return true;
- }
-
- function upnp_validate_port($port) {
- foreach(explode('-', $port) as $sub)
- if($sub < 0 || $sub > 65535)
- return false;
- return true;
- }
-
- function before_form_miniupnpd($pkg) {
- global $config;
-
- config_lock();
-
- /* if shaper connection speed defined hide fields */
- if($config['ezshaper']['step2']['download'] && $config['ezshaper']['step2']['upload']) {
- $i=0;
- foreach ($pkg['fields']['field'] as $field) {
- if ($field['fieldname'] == 'download' || $field['fieldname'] == 'upload')
- unset($pkg['fields']['field'][$i]);
- $i++;
- }
- }
-
- config_unlock();
- }
-
- function validate_form_miniupnpd($post, $input_errors) {
- if($post['iface_array'])
- foreach($post['iface_array'] as $iface)
- if($iface == 'wan')
- $input_errors[] = 'It is a security risk to specify WAN in the \'Interface\' field';
- if($post['overridewanip'] && !upnp_validate_ip($post['overridewanip'],false))
- $input_errors[] = 'You must specify a valid ip address in the \'Override WAN address\' field';
- if(($post['download'] && !$post['upload']) || ($post['upload'] && !$post['download']))
- $input_errors[] = 'You must fill in both \'Maximum Download Speed\' and \'Maximum Upload Speed\' fields';
- if($post['download'] && $post['download'] <= 0)
- $input_errors[] = 'You must specify a value greater than 0 in the \'Maximum Download Speed\' field';
- if($post['upload'] && $post['upload'] <= 0)
- $input_errors[] = 'You must specify a value greater than 0 in the \'Maximum Upload Speed\' field';
-
- /* user permissions validation */
- for($i=1; $i<=4; $i++) {
- if($post["permuser{$i}"]) {
- $perm = explode(' ',$post["permuser{$i}"]);
- /* should explode to 4 args */
- if(count($perm) != 4) {
- $input_errors[] = "You must follow the specified format in the 'User specified permissions {$i}' field";
- } else {
- /* must with allow or deny */
- if(!($perm[0] == 'allow' || $perm[0] == 'deny'))
- $input_errors[] = "You must begin with allow or deny in the 'User specified permissions {$i}' field";
- /* verify port or port range */
- if(!upnp_validate_port($perm[1]) || !upnp_validate_port($perm[3]))
- $input_errors[] = "You must specify a port or port range between 0 and 65535 in the 'User specified
- permissions {$i}' field";
- /* verify ip address */
- if(!upnp_validate_ip($perm[2],true))
- $input_errors[] = "You must specify a valid ip address in the 'User specified permissions {$i}' field";
- }
- }
- }
- }
-
- function sync_package_miniupnpd() {
- global $config;
- global $input_errors;
-
- config_lock();
-
- $upnp_config = $config['installedpackages']['miniupnpd']['config'][0];
-
- $config_text = "ext_ifname=".get_real_wan_interface()."\n";
- $config_text .= "port=2189\n";
-
- $ifaces_active = '';
-
- /* since config is written before this file invoked we don't need to read post data */
- if($upnp_config['enable'] && $upnp_config['iface_array'])
- $iface_array = explode(',', $upnp_config['iface_array']);
-
- if($iface_array) {
- foreach($iface_array as $iface) {
- $if = convert_friendly_interface_to_real_interface_name($iface);
- /* above function returns iface if fail */
- if($if!=$iface) {
- $addr = find_interface_ip($if);
- /* non enabled interfaces are displayed in list on miniupnpd settings page */
- /* check that the interface has an ip address before adding parameters */
- if($addr) {
- $config_text .= "listening_ip={$addr}\n";
- if(!$ifaces_active) {
- $webgui_ip = $addr;
- $ifaces_active = $iface;
- } else {
- $ifaces_active .= ", {$iface}";
- }
- } else {
- upnp_warn("Interface {$iface} has no ip address, ignoring");
- }
- } else {
- upnp_warn("Could not resolve real interface for {$iface}");
- }
- }
-
- if($ifaces_active) {
- /* override wan ip address, common for carp, etc */
- if($upnp_config['overridewanip'])
- $config_text .= "ext_ip={$upnp_config['overridewanip']}\n";
-
- /* if shaper connection speed defined use those values */
- if($config['ezshaper']['step2']['download'] && $config['ezshaper']['step2']['upload']) {
- $download = $config['ezshaper']['step2']['download']*1000;
- $upload = $config['ezshaper']['step2']['upload']*1000;
- } else {
- $download = $upnp_config['download']*1000;
- $upload = $upnp_config['upload']*1000;
- }
-
- /* set upload and download bitrates */
- if($download && $upload) {
- $config_text .= "bitrate_down={$download}\n";
- $config_text .= "bitrate_up={$upload}\n";
- }
-
- /* enable logging of packets handled by miniupnpd rules */
- if($upnp_config['logpackets'])
- $config_text .= "packet_log=yes\n";
-
- /* enable system uptime instead of miniupnpd uptime */
- if($upnp_config['sysuptime'])
- $config_text .= "system_uptime=yes\n";
-
- /* set webgui url */
- if($config['system']['webgui']['protocol']) {
- $config_text .= "presentation_url={$config['system']['webgui']['protocol']}://{$webgui_ip}";
- if($config['system']['webgui']['port'])
- $config_text .= ":{$config['system']['webgui']['port']}";
- $config_text .= "/\n";
- }
-
- /* set uuid and serial */
- $config_text .= "uuid=".upnp_uuid()."\n";
- $config_text .= "serial=".strtoupper(substr(upnp_uuid(),0,8))."\n";
-
- /* set model number */
- $config_text .= "model_number=".exec("/bin/cat /etc/version")."\n";
-
- /* upnp access restrictions */
- for($i=1; $i<=4; $i++) {
- if($upnp_config["permuser{$i}"])
- $config_text .= "{$upnp_config["permuser{$i}"]}\n";
- }
-
- if($upnp_config['permdefault'])
- $config_text .= "deny 0-65535 0.0.0.0/0 0-65535\n";
-
- /* generate rc file start and stop */
- $stop = <<<EOD
-if [ `pgrep miniupnpd | wc -l` != 0 ]; then
- /usr/bin/killall miniupnpd
- while [ `pgrep miniupnpd | wc -l` != 0 ]; do
- sleep 1
- done
- fi
- # Clear existing rules and rdr entries
- if [ `pfctl -aminiupnpd -sr | wc -l` != 0 ]; then
- /sbin/pfctl -aminiupnpd -Fr 2>&1 >/dev/null
- fi
- if [ `pfctl -aminiupnpd -sn | wc -l` != 0 ]; then
- /sbin/pfctl -aminiupnpd -Fn 2>&1 >/dev/null
- fi
-EOD;
- $start = $stop."\n\t/usr/local/sbin/miniupnpd -f ".UPNP_CONFIG;
-
- /* write out the configuration */
- conf_mount_rw();
- upnp_write_config(UPNP_CONFIG, $config_text);
- write_rcfile(array(
- 'file' => 'miniupnpd.sh',
- 'start' => $start,
- 'stop' => $stop
- )
- );
- conf_mount_ro();
-
- /* if miniupnpd not running start it */
- if(!upnp_running()) {
- upnp_notice("Starting service on interface: {$ifaces_active}");
- upnp_action('start');
- }
- /* or restart miniupnpd if settings were changed */
- elseif($_POST['iface_array']) {
- upnp_notice("Restarting service on interface: {$ifaces_active}");
- upnp_action('restart');
- }
- }
- }
-
- if(!$iface_array || !$ifaces_active) {
- /* no parameters user does not want miniupnpd running */
- /* lets stop the service and remove the rc file */
-
- if(file_exists(UPNP_RCFILE)) {
- if(!$upnp_config['enable'])
- upnp_notice('Stopping service: miniupnpd disabled');
- else
- upnp_notice('Stopping service: no interfaces selected');
-
- upnp_action('stop');
-
- conf_mount_rw();
- unlink(UPNP_RCFILE);
- unlink(UPNP_CONFIG);
- conf_mount_ro();
- }
- }
-
- config_unlock();
- }
-
-}
-
-?> \ No newline at end of file
diff --git a/config/miniupnpd/miniupnpd.xml b/config/miniupnpd/miniupnpd.xml
deleted file mode 100644
index 5474e4ee..00000000
--- a/config/miniupnpd/miniupnpd.xml
+++ /dev/null
@@ -1,182 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>miniupnpd</name>
- <version>20070927</version>
- <title>Services: MiniUPnPd</title>
- <savetext>Change</savetext>
- <aftersaveredirect>/status_upnp.php</aftersaveredirect>
- <include_file>/usr/local/pkg/miniupnpd.inc</include_file>
- <menu>
- <name>MiniUPnPd</name>
- <tooltiptext>Set miniupnpd settings such as interfaces to listen on.</tooltiptext>
- <section>Services</section>
- <url>/status_upnp.php</url>
- </menu>
- <service>
- <name>miniupnpd</name>
- <rcfile>miniupnpd.sh</rcfile>
- <executable>miniupnpd</executable>
- </service>
- <tabs>
- <tab>
- <text>UPnP Status</text>
- <url>/status_upnp.php</url>
- </tab>
- <tab>
- <text>MiniUPnPd Settings</text>
- <url>/pkg_edit.php?xml=miniupnpd.xml&amp;id=0</url>
- <active/>
- </tab>
- </tabs>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/miniupnpd/miniupnpd.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/miniupnpd/status_upnp.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/sbin/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/miniupnpd/sbin/miniupnpd</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Enable MiniUPnPd</fielddescr>
- <fieldname>enable</fieldname>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Interfaces (generally LAN)</fielddescr>
- <fieldname>iface_array</fieldname>
- <description>You can use the CTRL or COMMAND key to select multiple interfaces.</description>
- <type>interfaces_selection</type>
- <size>3</size>
- <required/>
- <value>lan</value>
- <multiple>true</multiple>
- </field>
- <field>
- <fielddescr>Maximum Download Speed (Kbits/second)</fielddescr>
- <fieldname>download</fieldname>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Maximum Upload Speed (Kbits/second)</fielddescr>
- <fieldname>upload</fieldname>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Override WAN address</fielddescr>
- <fieldname>overridewanip</fieldname>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Log packets handled by miniupnpd rules?</fielddescr>
- <fieldname>logpackets</fieldname>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Use system uptime instead of miniupnpd uptime?</fielddescr>
- <fieldname>sysuptime</fieldname>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>By default deny access to miniupnpd?</fielddescr>
- <fieldname>permdefault</fieldname>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>User specified permissions 1</fielddescr>
- <fieldname>permuser1</fieldname>
- <description>Format: [allow or deny] [ext port or range] [int ipaddr or ipaddr/cdir] [int port or range]
- &lt;br /&gt;Example: allow 1024-65535 192.168.0.0/24 1024-65535</description>
- <type>input</type>
- <size>60</size>
- </field>
- <field>
- <fielddescr>User specified permissions 2</fielddescr>
- <fieldname>permuser2</fieldname>
- <description>Format: [allow or deny] [ext port or range] [int ipaddr or ipaddr/cdir] [int port or range]</description>
- <type>input</type>
- <size>60</size>
- </field>
- <field>
- <fielddescr>User specified permissions 3</fielddescr>
- <fieldname>permuser3</fieldname>
- <description>Format: [allow or deny] [ext port or range] [int ipaddr or ipaddr/cdir] [int port or range]</description>
- <type>input</type>
- <size>60</size>
- </field>
- <field>
- <fielddescr>User specified permissions 4</fielddescr>
- <fieldname>permuser4</fieldname>
- <description>Format: [allow or deny] [ext port or range] [int ipaddr or ipaddr/cdir] [int port or range]</description>
- <type>input</type>
- <size>60</size>
- </field>
- </fields>
- <custom_php_command_before_form>
- before_form_miniupnpd(&amp;$pkg);
- </custom_php_command_before_form>
- <custom_php_validation_command>
- validate_form_miniupnpd($_POST, &amp;$input_errors);
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- sync_package_miniupnpd();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- sync_package_miniupnpd();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- exec("rm -f /usr/local/etc/rc.d/miniupnpd*");
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/miniupnpd/sbin/miniupnpd b/config/miniupnpd/sbin/miniupnpd
deleted file mode 100755
index cdd5de0e..00000000
--- a/config/miniupnpd/sbin/miniupnpd
+++ /dev/null
Binary files differ
diff --git a/config/miniupnpd/status_upnp.php b/config/miniupnpd/status_upnp.php
deleted file mode 100644
index 5164c501..00000000
--- a/config/miniupnpd/status_upnp.php
+++ /dev/null
@@ -1,120 +0,0 @@
-<?php
-/* $Id$ */
-/*
- status_upnp.php
- part of pfSense (https://www.pfsense.org/)
-
- Copyright (C) 2006 Seth Mos <seth.mos@dds.nl>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-
-/* Defaults to this page but if no settings are present, redirect to setup page */
-if(!$config['installedpackages']['miniupnpd']['config'][0]['iface_array'] ||
- !$config['installedpackages']['miniupnpd']['config'][0]['enable'])
- Header("Location: /pkg_edit.php?xml=miniupnpd.xml&id=0");
-
-if ($_POST) {
- if ($_POST['clear'] == "Clear") {
- mwexec("/bin/sh /usr/local/etc/rc.d/miniupnpd.sh restart");
- $savemsg = "Rules have been cleared and the daemon restarted";
- }
-}
-
-$rdr_entries = array();
-exec("/sbin/pfctl -aminiupnpd -sn", $rdr_entries, $pf_ret);
-
-$now = time();
-$year = date("Y");
-
-$pgtitle = "Status: UPnP Status";
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-//$pfSenseHead->addMeta("<meta http-equiv=\"refresh\" content=\"120;url={$_SERVER['SCRIPT_NAME']}\" />");
-//echo $pfSenseHead->getHTML();
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></font></p>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="mainlevel">
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<?php
- $tab_array = array();
- $tab_array[] = array(gettext("UPnP Status "), true, "/status_upnp.php");
- $tab_array[] = array(gettext("MiniUPnPd Settings "), false, "/pkg_edit.php?xml=miniupnpd.xml&id=0");
- display_top_tabs($tab_array);
-?>
-</table>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabcont" >
- <form action="status_upnp.php" method="post">
- <b><input type="submit" name="clear" id="clear" value="Clear" /></b>
- </form>
- </td>
- </tr>
- <tr>
- <td class="tabcont" >
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="10%" class="listhdrr"><?=gettext("Port")?></td>
- <td width="10%" class="listhdrr"><?=gettext("Protocol")?></td>
- <td width="20%" class="listhdrr"><?=gettext("Internal IP")?></td>
- <td width="60%" class="listhdr"><?=gettext("Description")?></td>
- </tr>
- <?php $i = 0; foreach ($rdr_entries as $rdr_entry) {
- if (preg_match("/on (.*) inet proto (.*) from any to any port = (.*) label \"(.*)\" -> (.*) port (.*)/", $rdr_entry, $matches))
- $rdr_proto = $matches[2];
- $rdr_port = $matches[3];
- $rdr_ip = $matches[5];
- $rdr_label =$matches[4];
- ?>
- <tr>
- <td class="listlr">
- <?php print $rdr_port;?>
- </td>
- <td class="listlr">
- <?php print $rdr_proto;?>
- </td>
- <td class="listlr">
- <?php print $rdr_ip;?>
- </td>
- <td class="listlr">
- <?php print $rdr_label;?>
- </td>
- </tr>
- <?php $i++; }?>
- </table>
- </td>
- </tr>
-</table>
-</div>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/mtr-nox11.xml b/config/mtr-nox11/mtr-nox11.xml
index e0125333..e0125333 100644
--- a/config/mtr-nox11.xml
+++ b/config/mtr-nox11/mtr-nox11.xml
diff --git a/config/netio-newpkg.xml b/config/netio-newpkg.xml
deleted file mode 100644
index 6f8551b8..00000000
--- a/config/netio-newpkg.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<package>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <nosync/>
- <info>
- <name>netio-newpkg</name>
- <descr>This is a network benchmark for DOS, OS/2 2.x, Windows NT/2000 and Unix. It measures the net throughput of a network via NetBIOS and/or TCP/IP protocols (Unix and DOS only support TCP/IP) using various different packet sizes.</descr>
- <category>Network Management</category>
- <version>1.14</version>
- <status>ALPHA</status>
- </info>
- <files>
- <file>
- <type>package</type>
- <location>http://ftp2.freebsd.org/pub/FreeBSD/ports/i386/packages-6-current/All/netio-1.14.tbz</location>
- </file>
- <file>
- <type>configfile</type>
- <location>https://packages.pfsense.org/packages/config/netioserver-newpkg.xml</location>
- </file>
- </files>
- <services>
- <service>
- <name>netio-newpkg</name>
- <executable>netio</executable>
- </service>
- </services>
- <gui>
- <title>netio: Client</title>
- <donotsave>true</donotsave>
- <preoutput>yes</preoutput>
- <menus>
- <menu>
- <name>netio</name>
- <tooltiptext>Run netio in client or server mode.</tooltiptext>
- <section>Diagnostics</section>
- <configfile>netio-newpkg.xml</configfile>
- </menu>
- </menus>
- <tabs>
- <tab>
- <text>Client</text>
- <url>/pkg_edit.php?xml=netio-newpkg.xml</url>
- <active/>
- </tab>
- <tab>
- <text>Server</text>
- <url>/pkg_edit.php?xml=netioserver-newpkg.xml</url>
- </tab>
- </tabs>
- <fields>
- <field>
- <fielddescr>Server</fielddescr>
- <fieldname>hostname</fieldname>
- <description>Enter the IP address or hostname that netio will connect to.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Port</fielddescr>
- <fieldname>port</fieldname>
- <description>Enter the port that netio will connect to. (default 18767)</description>
- <type>input</type>
- </field>
- </fields>
- </gui>
- <commands>
- <add_commands>
- stop_service("netio-newpkg");
- $netio_options = "";
- if($_POST['port'] != "") $netio_options .= " -p {$_POST['port']}";
- $netio_options .= $_POST['hostname'];
- system("/usr/local/bin/netio " . $netio_options);
- </add_commands>
- </commands>
-</package>
-
diff --git a/config/netio.xml b/config/netio/netio.xml
index cf0839d7..8e49f64c 100644
--- a/config/netio.xml
+++ b/config/netio/netio.xml
@@ -68,7 +68,7 @@
</tab>
</tabs>
<additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/netioserver.xml</item>
+ <item>https://packages.pfsense.org/packages/config/netio/netioserver.xml</item>
</additional_files_needed>
<fields>
<field>
diff --git a/config/netioserver.xml b/config/netio/netioserver.xml
index 4c32ee19..4c32ee19 100644
--- a/config/netioserver.xml
+++ b/config/netio/netioserver.xml
diff --git a/config/netioserver-newpkg.xml b/config/netioserver-newpkg.xml
deleted file mode 100644
index 1a0c709c..00000000
--- a/config/netioserver-newpkg.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<package>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <nosync/>
- <info>
- <name>netioserver-newpkg</name>
- </info>
- <gui>
- <title>netio: Server</title>
- <donotsave>true</donotsave>
- <preoutput>yes</preoutput>
- <tabs>
- <tab>
- <text>Client</text>
- <url>/pkg_edit.php?xml=netio-newpkg.xml</url>
- </tab>
- <tab>
- <text>Server</text>
- <url>/pkg_edit.php?xml=netioserver-newpkg.xml</url>
- <active/>
- </tab>
- </tabs>
- <fields>
- <field>
- <fielddescr>Port</fielddescr>
- <fieldname>port</fieldname>
- <description>Enter the port that netio will bind to. (default 18767)</description>
- <type>input</type>
- </field>
- </fields>
- </gui>
- <commands>
- <add_commands>
- stop_service("netio-newpkg");
- if($_POST['port'] != "") $netioserver_options = " -p {$_POST['port']}";
- system("/usr/local/bin/netio -s" . $netioserver_options);
- </add_commands>
- </commands>
-</package>
-
diff --git a/config/olsrd.inc b/config/olsrd/olsrd.inc
index 9eee0196..9eee0196 100644
--- a/config/olsrd.inc
+++ b/config/olsrd/olsrd.inc
diff --git a/config/olsrd.xml b/config/olsrd/olsrd.xml
index a1669a33..3939f357 100644
--- a/config/olsrd.xml
+++ b/config/olsrd/olsrd.xml
@@ -24,7 +24,7 @@
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
<chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/olsrd.inc</item>
+ <item>https://packages.pfsense.org/packages/config/olsrd/olsrd.inc</item>
</additional_files_needed>
<!-- configpath gets expanded out automatically and config items will be
stored in that location -->
diff --git a/config/onatproto/onatproto.inc b/config/onatproto/onatproto.inc
deleted file mode 100644
index 93454107..00000000
--- a/config/onatproto/onatproto.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-function onatproto_install() {
- global $g, $config;
-
- // Test to make sure the patch is not already applied.
- $out = `patch -fslC --reverse -p1 -b .before_onatproto -d / -i /usr/local/pkg/onatproto.patch |& grep -ci reject`;
- if ($out == 0) {
- // If the patch has not already been applied, test to see if it will apply cleanly.
- $out = `patch -fsNlC -p1 -b .before_onatproto -d / -i /usr/local/pkg/onatproto.patch |& grep -ci reject`;
- if ($out == 0) {
- // The patch should apply cleanly, let 'er rip.
- mwexec("patch -fsNl -p1 -b .before_onatproto -d / -i /usr/local/pkg/onatproto.patch ");
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/config/onatproto/onatproto.patch b/config/onatproto/onatproto.patch
deleted file mode 100644
index c8d802f3..00000000
--- a/config/onatproto/onatproto.patch
+++ /dev/null
@@ -1,267 +0,0 @@
---- /etc/inc/filter.inc.orig 2009-02-24 15:11:55.000000000 -0500
-+++ /etc/inc/filter.inc 2009-02-24 19:38:51.000000000 -0500
-@@ -494,7 +494,7 @@
- }
-
- /* Generate a 'nat on' or 'no nat on' rule for given interface */
--function filter_nat_rules_generate_if($if, $src = "any", $srcport = "", $dst = "any", $dstport = "", $natip = "", $natport = "", $nonat = false, $staticnatport = false) {
-+function filter_nat_rules_generate_if($if, $src = "any", $proto = "any", $srcport = "", $dst = "any", $dstport = "", $natip = "", $natport = "", $nonat = false, $staticnatport = false) {
- global $config;
-
- /* XXX: billm - any idea if this code is needed? */
-@@ -507,6 +507,12 @@
- else
- $tgt = "($if)";
-
-+ /* Add the protocol, if defined */
-+ if (($proto != "") && ($proto != "any"))
-+ $protocol = " proto {$proto}";
-+ else
-+ $protocol = "";
-+
- /* Add the hard set source port (useful for ISAKMP) */
- if ($natport != "")
- $tgt .= " port {$natport}";
-@@ -546,7 +552,7 @@
-
- /* Put all the pieces together */
- if($if_friendly)
-- $natrule = "{$nat} on \${$if_friendly} from {$src} to {$dst} {$target}{$staticnatport_txt}\n";
-+ $natrule = "{$nat} on \${$if_friendly} {$protocol} from {$src} to {$dst} {$target}{$staticnatport_txt}\n";
-
- return $natrule;
- }
-@@ -654,6 +660,7 @@
-
- $natrules .= filter_nat_rules_generate_if($natif,
- $src,
-+ $obent['protocol'],
- $obent['sourceport'],
- $dst,
- $obent['dstport'],
-@@ -669,9 +676,9 @@
- update_filter_reload_status("Creating outbound NAT rules");
-
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$lansa}/{$lancfg['subnet']}", 500, "", 500, null, 500, false);
-+ "{$lansa}/{$lancfg['subnet']}", "any", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$lansa}/{$lancfg['subnet']}", 5060, "", 5060, null, 5060, false);
-+ "{$lansa}/{$lancfg['subnet']}", "any", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$lansa}/{$lancfg['subnet']}");
-
-@@ -683,9 +690,9 @@
- $opt_interface = $oc['if'];
- if (interface_has_gateway("$opt_interface")) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
-- "{$lansa}/{$lancfg['subnet']}", 500, "", 500, null, 500, false);
-+ "{$lansa}/{$lancfg['subnet']}", "any", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
-- "{$lansa}/{$lancfg['subnet']}", 5060, "", 5060, null, 5060, false);
-+ "{$lansa}/{$lancfg['subnet']}", "any", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$lansa}/{$lancfg['subnet']}");
- }
-@@ -701,22 +708,22 @@
-
- /* create outbound nat entries for primary wan */
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$optsa}/{$optcfg['subnet']}", 500, "", 500, null, 500, false);
-+ "{$optsa}/{$optcfg['subnet']}", "any", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$optsa}/{$optcfg['subnet']}", 5060, "", 5060, null, 5060, false);
-+ "{$optsa}/{$optcfg['subnet']}", "any", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$optsa}/{$optcfg['subnet']}", null, "", null, null, null, isset($optcfg['nonat']));
-+ "{$optsa}/{$optcfg['subnet']}", "any", null, "", null, null, null, isset($optcfg['nonat']));
-
- /* create outbound nat entries for all opt wans */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if (interface_has_gateway("$opt_interface")) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
-- "{$optsa}/{$optcfg['subnet']}", 500, "", 500, null, 500, false);
-+ "{$optsa}/{$optcfg['subnet']}", "any", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
-- "{$optsa}/{$optcfg['subnet']}", 5060, "", 5060, null, 5060, false);
-+ "{$optsa}/{$optcfg['subnet']}", "any", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
-- "{$optsa}/{$optcfg['subnet']}", null, "", null, null, null, isset($optcfg['nonat']));
-+ "{$optsa}/{$optcfg['subnet']}", "any", null, "", null, null, null, isset($optcfg['nonat']));
- }
- }
- }
-@@ -728,9 +735,9 @@
- if($config['pptp']['pptp_subnet'] <> "")
- $pptp_subnet = $config['pptp']['pptp_subnet'];
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 500, "", 500, null, 500, false);
-+ "{$pptpdcfg['remoteip']}/{$pptp_subnet}", "any", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 5060, "", 5060, null, 5060, false);
-+ "{$pptpdcfg['remoteip']}/{$pptp_subnet}", "any", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}");
-
-@@ -739,9 +746,9 @@
- $opt_interface = $oc['if'];
- if ((is_private_ip($pptpdcfg['remoteip'])) && (interface_has_gateway($opt_interface))) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
-- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 500, "", 500, null, 500, false);
-+ "{$pptpdcfg['remoteip']}/{$pptp_subnet}", "any", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
-- "{$pptpdcfg['remoteip']}/{$pptp_subnet}", 5060, "", 5060, null, 5060, false);
-+ "{$pptpdcfg['remoteip']}/{$pptp_subnet}", "any", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pptpdcfg['remoteip']}/{$pptp_subnet}");
- }
-@@ -754,20 +761,20 @@
- if($config['pppoe']['pppoe_subnet'] <> "")
- $pppoe_subnet = $config['pppoe']['pppoe_subnet'];
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 500, "", 500, null, 500, false);
-+ "{$pppoecfg['remoteip']}/{$pppoe_subnet}", "any", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 5060, "", 5060, null, 5060, false);
-+ "{$pppoecfg['remoteip']}/{$pppoe_subnet}", "any", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$pppoecfg['remoteip']}/{$pppoe_subnet}");
-+ "{$pppoecfg['remoteip']}/{$pppoe_subnet}", "any");
-
- /* generate nat mappings for opts with a gateway opts */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if ((is_private_ip($pppoecfg['remoteip'])) && (interface_has_gateway($opt_interface))) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
-- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 500, "", 500, null, 500, false);
-+ "{$pppoecfg['remoteip']}/{$pppoe_subnet}", "any", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
-- "{$pppoecfg['remoteip']}/{$pppoe_subnet}", 5060, "", 5060, null, 5060, false);
-+ "{$pppoecfg['remoteip']}/{$pppoe_subnet}", "any", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
- "{$pppoecfg['remoteip']}/{$pppoe_subnet}");
- }
-@@ -780,22 +787,22 @@
- $netip = explode("/", $route['network']);
- if ((! interface_has_gateway($route['interface'])) && (is_private_ip($netip[0]))) {
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$route['network']}", 500, "", 500, null, 500, false);
-+ "{$route['network']}", "any", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$route['network']}", 5060, "", 5060, null, 5060, false);
-+ "{$route['network']}", "any", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($wanif,
-- "{$route['network']}", "", null);
-+ "{$route['network']}", "any", "", null);
- }
- /* generate nat mapping for static routes on opts */
- foreach($optints as $oc) {
- $opt_interface = $oc['if'];
- if ((! interface_has_gateway($route['interface'])) && (is_private_ip($netip[0])) && (interface_has_gateway($opt_interface))) {
- $natrules .= filter_nat_rules_generate_if($opt_interface,
-- "{$route['network']}", 500, "", 500, null, 500, false);
-+ "{$route['network']}", "any", 500, "", 500, null, 500, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
-- "{$route['network']}", 5060, "", 5060, null, 5060, false);
-+ "{$route['network']}", "any", 5060, "", 5060, null, 5060, false);
- $natrules .= filter_nat_rules_generate_if($opt_interface,
-- "{$route['network']}", "", null);
-+ "{$route['network']}", "any", "", null);
- }
- }
-
---- /usr/local/www-orig/firewall_nat_out.php 2008-01-07 21:14:44.000000000 -0500
-+++ /usr/local/www/firewall_nat_out.php 2009-02-24 18:21:20.000000000 -0500
-@@ -102,6 +102,7 @@
- $natent['interface'] = "wan";
- $natent['destination']['any'] = true;
- $natent['natport'] = "";
-+ $natent['protocol'] = "any";
- $a_out[] = $natent;
- }
- $savemsg = "Default rules for each interface have been created.";
-@@ -265,6 +266,11 @@
- echo "LAN";
- else
- echo htmlspecialchars($config['interfaces'][$natent['interface']]['descr']);
-+
-+ if (($natent['protocol'] != "any") && ($natent['protocol'] != ""))
-+ $proto = $natent['protocol'] . "/";
-+ else
-+ $proto = "";
- ?>
- &nbsp;
- </td>
-@@ -273,10 +279,11 @@
- </td>
- <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
- <?php
-+
- if (!$natent['sourceport'])
-- echo "*";
-+ echo $proto . "*";
- else
-- echo $natent['sourceport'];
-+ echo $proto . $natent['sourceport'];
- ?>
- </td>
- <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
-@@ -293,9 +300,9 @@
- <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
- <?php
- if (!$natent['dstport'])
-- echo "*";
-+ echo $proto . "*";
- else
-- echo $natent['dstport'];
-+ echo $proto . $natent['dstport'];
- ?>
- </td>
- <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
---- /usr/local/www-orig/firewall_nat_out_edit.php 2008-11-08 17:53:23.000000000 -0500
-+++ /usr/local/www/firewall_nat_out_edit.php 2009-02-25 12:07:33.000000000 -0500
-@@ -49,6 +49,7 @@
- }
-
- if (isset($id) && $a_out[$id]) {
-+ $pconfig['proto'] = $a_out[$id]['protocol'];
- list($pconfig['source'],$pconfig['source_subnet']) = explode('/', $a_out[$id]['source']['network']);
- $pconfig['sourceport'] = $a_out[$id]['sourceport'];
- address_to_pconfig($a_out[$id]['destination'], $pconfig['destination'],
-@@ -170,6 +171,9 @@
- if (!$natent['interface'])
- $natent['interface'] == "wan";
-
-+ if ($natent['proto'] != $_POST['proto'])
-+ continue;
-+
- if (($natent['interface'] == $_POST['interface']) && ($natent['source']['network'] == $osn)) {
- if (isset($natent['destination']['not']) == isset($_POST['destination_not'])) {
- if ((isset($natent['destination']['any']) && ($ext == "any")) ||
-@@ -188,6 +192,7 @@
- $natent['descr'] = $_POST['descr'];
- $natent['target'] = $_POST['target'];
- $natent['interface'] = $_POST['interface'];
-+ $natent['protocol'] = $_POST['proto'];
-
- /* static-port */
- if(isset($_POST['staticnatport']))
-@@ -316,6 +321,17 @@
- Hint: in most cases, you'll want to use WAN here.</span></td>
- </tr>
- <tr>
-+ <td width="22%" valign="top" class="vncellreq">Protocol</td>
-+ <td width="78%" class="vtable">
-+ <select name="proto" class="formfld" onChange="proto_change(); check_for_aliases();">
-+ <?php $protocols = explode(" ", "any TCP UDP GRE ESP AH L2TP ICMP"); foreach ($protocols as $proto): ?>
-+ <option value="<?=strtolower($proto);?>" <?php if (strtolower($proto) == $pconfig['proto']) echo "selected"; ?>><?=htmlspecialchars($proto);?></option>
-+ <?php endforeach; ?>
-+ </select> <br> <span class="vexpl">Choose which IP protocol
-+ this rule should match.<br>
-+ Hint: in most cases, you should specify <em>any</em> &nbsp;here.</span></td>
-+ </tr>
-+ <tr>
- <td width="22%" valign="top" class="vncellreq">Source</td>
- <td width="78%" class="vtable">
- <table border="0" cellspacing="1" cellpadding="1">
diff --git a/config/onatproto/onatproto.xml b/config/onatproto/onatproto.xml
deleted file mode 100644
index 46dd72c7..00000000
--- a/config/onatproto/onatproto.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- onatproto.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Patch to add Protocol options to Manual Outbound NAT</description>
- <requirements>pfSense 1.2.x</requirements>
- <faq>Only needed if you want to NAT outbound based on protocol as well as port.</faq>
- <name>onatproto</name>
- <version>0.1</version>
- <title>onatproto</title>
- <include_file>/usr/local/pkg/onatproto.inc</include_file>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/onatproto/onatproto.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/onatproto/onatproto.patch</item>
- </additional_files_needed>
- <custom_php_install_command>
- onatproto_install();
- </custom_php_install_command>
-</packagegui>
diff --git a/config/openospfd/openospfd.inc b/config/openospfd/openospfd.inc
deleted file mode 100644
index 86e043d5..00000000
--- a/config/openospfd/openospfd.inc
+++ /dev/null
@@ -1,249 +0,0 @@
-<?php
-/*
- openospfd.inc
- Copyright (C) 2010 Ermal Luçi
- part of pfSense
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-require_once("config.inc");
-require_once("functions.inc");
-require_once("service-utils.inc");
-
-function ospfd_display_friendlyiface () {
- global $evaledvar, $config, $g;
-
- if (intval($g['latest_config']) >= 6)
- return;
-
- if ($evaledvar) {
- foreach ($evaledvar as $idx => $field) {
- if ($field['interface']) {
- if (empty($config['interfaces'][$field['interface']]['descr']))
- $evaledvar[$idx]['interface'] = strtoupper($evaledvar[$idx]['interface']);
- else
- $evaledvar[$idx]['interface'] = $config['interfaces'][$field['interface']]['descr'];
- }
- }
- }
-}
-
-function ospfd_install_conf() {
- global $config, $g, $input_errors;
-
- conf_mount_rw();
-
- if ($config['installedpackages']['ospfd']['rawconfig'] && $config['installedpackages']['ospfd']['rawconfig']['item']) {
- // if there is a raw config specifyed in tthe config.xml use that instead of the assisted config
- $conffile = implode("\n",$config['installedpackages']['ospfd']['rawconfig']['item']);
- //$conffile = $config['installedpackages']['ospfd']['rawconfig'];
- } else {
- // generate ospfd.conf based on the assistant
- if($config['installedpackages']['ospfd']['config'])
- $ospfd_conf = &$config['installedpackages']['ospfd']['config'][0];
- else {
- log_error("OpenOSPFd: No config data found.");
- return;
- }
-
- $conffile = "# This file was created by the pfSense package manager. Do not edit!\n\n";
-
- // Specify router id
- if($ospfd_conf['routerid'])
- $conffile .= "router-id {$ospfd_conf['routerid']}\n";
-
- if ($ospfd_conf['updatefib'])
- $conffile .= "fib-update no\n";
-
- if (is_array($ospfd_conf['row'])) {
- foreach ($ospfd_conf['row'] as $redistr) {
- if (empty($redistr['routevalue']))
- continue;
- if (isset($redistr['redistribute']))
- $conffile .= "no ";
- $conffile .= "redistribute {$redistr['routevalue']}\n";
- }
- }
-
- if ($ospfd_conf['redistributeconnectedsubnets'])
- $conffile .= "redistribute connected\n";
-
- if ($ospfd_conf['redistributedefaultroute'])
- $conffile .= "redistribute default\n";
-
- if ($ospfd_conf['redistributestatic'])
- $conffile .= "redistribute static\n";
-
- if ($ospfd_conf['spfholdtime'])
- $conffile .= "spf-holdtime {$ospfd_conf['spfholdtime']}\n";
-
- if ($ospfd_conf['spfdelay'])
- $conffile .= "spf-delay {$ospfd_conf['spfdelay']}\n";
-
- if ($ospfd_conf['rfc1583'])
- $conffile .= "rfc1583compat yes\n";
-
- $conffile .= "area {$ospfd_conf['area']} {\n";
-
- if ($config['installedpackages']['ospfdinterfaces']['config']) {
- foreach ($config['installedpackages']['ospfdinterfaces']['config'] as $conf) {
- if (intval($g['latest_config']) >= 6) {
- $ospfdif = get_real_interface($conf['interface']);
- if ($ospfdif)
- $conffile .= "\tinterface {$ospfdif}";
- else
- continue;
- } else
- $conffile .= "\tinterface " . $config['interfaces'][$conf['interface']]['if'];
- $options_present = false;
- $ifconfigs = "";
- if (!empty($conf['metric'])) {
- $options_present = true;
- $ifconfigs .= "\t\tmetric {$conf['metric']}\n";
- }
- if (!empty($conf['hellointervalinseconds'])) {
- $options_present = true;
- $ifconfigs .= "\t\thello-interval {$conf['hellointervalinseconds']}\n";
- }
- if ($conf['md5password'] && !empty($conf['password'])) {
- $options_present = true;
- $ifconfigs .= "\t\tauth-type crypt\n";
- $ifconfigs .= "\t\tauth-md 1 \"" . substr($conf['password'], 0, 15) . "\"\n";
- $ifconfigs .= "\t\tauth-md-keyid 1\n";
- } else if (!empty($conf['password'])) {
- $options_present = true;
- $ifconfigs .= "\t\tauth-type simple\n";
- $ifconfigs .= "\t\tauth-key \"" . substr($conf['password'], 0, 8) . "\"\n";
- }
- if (!empty($conf['routerpriorityelections'])) {
- $options_present = true;
- $ifconfigs .= "\t\trouter-priority {$conf['routerpriorityelections']}\n";
- }
- if (!empty($conf['retransmitinterval'])) {
- $options_present = true;
- $ifconfigs .= "\t\tretransmit-interval {$conf['retransmitinterval']}\n";
- }
- if (!empty($conf['deadtimer'])) {
- $options_present = true;
- $ifconfigs .= "\t\trouter-dead-time {$conf['deadtimer']}\n";
- }
- if (!empty($conf['passive'])) {
- $options_present = true;
- $ifconfigs .= "\t\tpassive\n";
- }
- if (!empty($ifconfigs)) {
- $conffile .= " {\n {$ifconfigs} \n";
- if ($options_present == true)
- $conffile .= "\t}\n";
- } else
- $conffile .= "\n";
- }
- }
- $conffile .= "}\n";
- }
-
- $fd = fopen("/usr/local/etc/ospfd.conf", "w");
-
- // Write out the configuration file
- fwrite($fd, $conffile);
-
- // Close file handle
- fclose($fd);
-
- // Create rc.d file
- $rc_file_stop = "killall ospfd";
- $rc_file_start = <<<EOF
-/usr/local/sbin/ospfctl reload
-if [ "$0" != "0" ]; then
- /bin/pkill -x ospfd
- /usr/local/sbin/ospfd -f /usr/local/etc/ospfd.conf
-fi
-
-EOF;
- write_rcfile(array(
- "file" => "ospfd.sh",
- "start" => $rc_file_start,
- "stop" => $rc_file_stop
- )
- );
-
- // Ensure files have correct permissions
- exec("chmod a+rx /usr/local/etc/rc.d/ospfd.sh");
- exec("chmod a-rw /usr/local/etc/ospfd.conf");
- exec("chmod u+rw /usr/local/etc/ospfd.conf");
-
- // Kick off newly created rc.d script
- exec("/usr/local/etc/rc.d/ospfd.sh start");
-
- // Back to RO mount for NanoBSD and friends
- conf_mount_ro();
-}
-
-function ospfd_validate_interface() {
- global $config, $g, $id, $input_errors;
-
- if ($config['installedpackages']['ospfdinterfaces']['config']) {
- foreach ($config['installedpackages']['ospfdinterfaces']['config'] as $index => $conf) {
- if ($index == 0)
- continue;
- if ($id != $index && $conf['interface'] == $_POST['interface'])
- $input_errors[] = "Interface {$_POST['interface']} is already configured.";
- }
- }
- if ($_POST['md5password'] && empty($_POST['password']))
- $input_errors[] = "Please input a password.";
-}
-
-function ospfd_validate_input() {
- global $config, $g, $input_errors;
-
- if (!empty($_POST['routerid']) && !is_ipaddr($_POST['routerid']))
- $input_errors[] = "Router ID must be an address.";
- if (!is_ipaddr($_POST['area']))
- $input_errors[] = "Area needs to be a valid ip_address.";
- if ($_POST['spfholdtime'] <> "" && ($_POST['spfholdtime'] < 1 || $_POST['spfholdtime'] > 5))
- $input_errors[] = "SPF holdtime needs to be between 1 and 5.";
- if ($_POST['spfdelay'] <> "" && ($_POST['spfdelay'] < 1 || $_POST['spfdelay'] > 10))
- $input_errors[] = "SPF delay needs to be between 1 and 10.";
- if (!$config['installedpackages']['ospfdinterfaces']['config'])
- $input_errors[] = "Please select an interface to use for OpenOSPFd.";
-}
-
-// get the raw ospfd confi file for manual inspection/editing
-function ospfd_get_raw_config() {
- return file_get_contents("/usr/local/etc/ospfd.conf");
-}
-
-// serialize the raw ospfd confi file to config.xml
-function ospfd_put_raw_config($conffile) {
- global $config;
- if ($conffile == "")
- unset($config['installedpackages']['ospfd']['rawconfig']);
- else {
- $config['installedpackages']['ospfd']['rawconfig'] = array();
- $config['installedpackages']['ospfd']['rawconfig']['item'] = explode("\n",$_POST['ospfd_raw']);
- $config['installedpackages']['ospfd']['rawconfig'] = $conffile;
- }
-}
-
-?>
diff --git a/config/openospfd/openospfd.xml b/config/openospfd/openospfd.xml
deleted file mode 100644
index 9498100f..00000000
--- a/config/openospfd/openospfd.xml
+++ /dev/null
@@ -1,141 +0,0 @@
-<packagegui>
- <name>ospfd</name>
- <version>0.1</version>
- <title>Services: OpenOSPFd</title>
- <include_file>/usr/local/pkg/openospfd.inc</include_file>
- <aftersaveredirect>pkg_edit.php?xml=openospfd.xml&amp;id=0</aftersaveredirect>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/openospfd/openospfd.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/openospfd/openospfd_interfaces.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/openospfd/status_ospfd.php</item>
- </additional_files_needed>
- <menu>
- <name>OpenOSPFd</name>
- <tooltiptext>Modify ospfd settings.</tooltiptext>
- <section>Services</section>
- <configfile>openospfd.xml</configfile>
- <url>/pkg_edit.php?xml=openospfd.xml&amp;id=0</url>
- </menu>
- <tabs>
- <tab>
- <text>Global Settings</text>
- <url>pkg_edit.php?xml=openospfd.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Interface Settings</text>
- <url>pkg.php?xml=openospfd_interfaces.xml</url>
- </tab>
- <tab>
- <text>Status</text>
- <url>/status_ospfd.php</url>
- </tab>
- </tabs>
- <service>
- <name>OpenOSPFd</name>
- <rcfile>ospfd.sh</rcfile>
- <executable>ospfd</executable>
- <description>OpenBSD OSPF Daemon</description>
- </service>
- <fields>
- <field>
- <fielddescr>Router ID</fielddescr>
- <fieldname>routerid</fieldname>
- <description>
- <![CDATA[
- Specify the Router ID. RID is the highest logical (loopback) IP address configured on a router. For more information on router identifiers see <a target='_new' href='http://en.wikipedia.org/wiki/Open_Shortest_Path_First'>wikipedia</a>.
- ]]>
- </description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Area</fielddescr>
- <fieldname>area</fieldname>
- <description>
- <![CDATA[
- OpenOSPFd area for this instance of OSPF. For more information on Areas see <a target='_new' href='http://en.wikipedia.org/wiki/Open_Shortest_Path_First#Area_types'>wikipedia</a>.
- ]]>
- </description>
- <type>input</type>
- <required/>
- </field>
- <field>
- <fielddescr>Disable FIB updates (Routing table)</fielddescr>
- <fieldname>updatefib</fieldname>
- <description>Disables the updating of the host routing table(turns into stub router).</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Redistribute connected subnets</fielddescr>
- <fieldname>redistributeconnectedsubnets</fieldname>
- <description>Enables the redistribution of connected networks (Default no)</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Redistribute default route</fielddescr>
- <fieldname>redistributedefaultroute</fieldname>
- <description>Enables the redistribution of a default route to this device (Default no)</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Redistribute static</fielddescr>
- <fieldname>redistributestatic</fieldname>
- <description>Enables the redistribution of static routes</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>SPF Hold Time</fielddescr>
- <fieldname>spfholdtime</fieldname>
- <description>Set the SPF holdtime in seconds. The minimum time between two consecutive shortest path first calculations. The default value is 5 seconds; the valid range is 1-5 seconds.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>SPF Delay</fielddescr>
- <fieldname>spfdelay</fieldname>
- <description>Set SPF delay in seconds. The delay between receiving an update to the link state database and starting the shortest path first calculation. The default value is 1; valid range is 1-10 seconds.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>RFC 1583 compatible</fielddescr>
- <fieldname>rfc1583</fieldname>
- <description>If set to yes, decisions regarding AS-external routes are evaluated according to RFC 1583. The default is no.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>These rules take precedence over any redistribute options specified above.</fielddescr>
- <fieldname>none</fieldname>
- <type>rowhelper</type>
- <rowhelper>
- <rowhelperfield>
- <fielddescr>Disable &lt;br/&gt;Redistribution</fielddescr>
- <fieldname>redistribute</fieldname>
- <description>Redistribute rules.</description>
- <type>checkbox</type>
- <size>20</size>
- </rowhelperfield>
- <rowhelperfield>
- <fielddescr>Subnet to Route</fielddescr>
- <fieldname>routevalue</fieldname>
- <type>input</type>
- <size>25</size>
- </rowhelperfield>
- </rowhelper>
- </field>
- </fields>
- <custom_php_resync_config_command>
- ospfd_install_conf();
- </custom_php_resync_config_command>
- <custom_php_validation_command>
- ospfd_validate_input();
- </custom_php_validation_command>
-</packagegui> \ No newline at end of file
diff --git a/config/openospfd/openospfd_interfaces.xml b/config/openospfd/openospfd_interfaces.xml
deleted file mode 100644
index 61d36976..00000000
--- a/config/openospfd/openospfd_interfaces.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<packagegui>
- <name>OSPFd Interfaces</name>
- <version>0.1</version>
- <title>Services: OpenOSPFd</title>
- <include_file>/usr/local/pkg/openospfd.inc</include_file>
- <aftersaveredirect>pkg.php?xml=openospfd_interfaces.xml</aftersaveredirect>
- <custom_php_command_before_form>ospfd_display_friendlyiface();</custom_php_command_before_form>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/openospfd/openospfd.inc</item>
- </additional_files_needed>
- <menu>
- <name>OSPF</name>
- <tooltiptext>Modify ospfd settings.</tooltiptext>
- <section>Services</section>
- <configfile>openospfd.xml</configfile>
- <url>/pkg_edit.php?xml=openospfd.xml&amp;id=0</url>
- </menu>
- <tabs>
- <tab>
- <text>Global Settings</text>
- <url>pkg_edit.php?xml=openospfd.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Interface Settings</text>
- <url>pkg.php?xml=openospfd_interfaces.xml</url>
- <active/>
- </tab>
- <tab>
- <text>Status</text>
- <url>/status_ospfd.php</url>
- </tab>
- </tabs>
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Interface</fielddescr>
- <fieldname>interface</fieldname>
- <type>interface</type>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>descr</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
- <service>
- <name>OpenOSPFd</name>
- <rcfile>ospfd.sh</rcfile>
- <executable>ospfd</executable>
- </service>
- <fields>
- <field>
- <fielddescr>Interface</fielddescr>
- <fieldname>interface</fieldname>
- <description>Enter the desired participating interface here.</description>
- <type>interfaces_selection</type>
- <required/>
- </field>
- <field>
- <fielddescr>Metric</fielddescr>
- <fieldname>metric</fieldname>
- <description>Metric for this OSPF interface (leave blank for default).</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>descr</fieldname>
- <size>30</size>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Interface is Passive</fielddescr>
- <fieldname>passive</fieldname>
- <description>Prevent transmission and reception of OSPF packets on this interface. The specified interface will be announced as a stub network.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Enable MD5 password for this OpenOSPFd interface (default no)</fielddescr>
- <fieldname>md5password</fieldname>
- <description>Enables the use of an MD5 password to on this instance</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Password</fielddescr>
- <fieldname>password</fieldname>
- <description>Password for this OSPF interface.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Router Priority</fielddescr>
- <fieldname>routerpriorityelections</fieldname>
- <description>
- Router priority when participating in elections for DR (Default 1) Valid range is 0-255. 0 will cause the router to not participate in election.
- </description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Hello Interval</fielddescr>
- <fieldname>hellointervalinseconds</fieldname>
- <description>Hello Interval this OSPF interface in seconds (Default 10).</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Retransmit Interval</fielddescr>
- <fieldname>retransmitinterval</fieldname>
- <description>Retransmit Interval this OSPF interface in seconds (Default 5).</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Dead Timer</fielddescr>
- <fieldname>deadtimer</fieldname>
- <description>Dead Timer for this OSPF interface in seconds (Default 40).</description>
- <type>input</type>
- </field>
- </fields>
- <custom_php_resync_config_command>
- ospfd_install_conf();
- </custom_php_resync_config_command>
- <custom_php_validation_command>
- ospfd_validate_interface();
- </custom_php_validation_command>
-</packagegui>
diff --git a/config/openospfd/status_ospfd.php b/config/openospfd/status_ospfd.php
deleted file mode 100644
index 25f18d85..00000000
--- a/config/openospfd/status_ospfd.php
+++ /dev/null
@@ -1,147 +0,0 @@
-<?php
-/*
- status_ospfd.php
- Copyright (C) 2010 Nick Buraglio; nick@buraglio.com
- Copyright (C) 2010 Scott Ullrich <sullrich@pfsense.org>
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INClUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-
-$pgtitle = "OpenOSPFd: Status";
-include("head.inc");
-
-/* List all of the commands as an index. */
-function listCmds() {
- global $commands;
- echo "<br/>This status page includes the following information:\n";
- echo "<ul width=\"100%\">\n";
- for ($i = 0; isset($commands[$i]); $i++ ) {
- echo "<li><strong><a href=\"#" . $commands[$i][0] . "\">" . $commands[$i][0] . "</a></strong></li>\n";
- }
- echo "</ul>\n";
-}
-
-function execCmds() {
- global $commands;
- for ($i = 0; isset($commands[$i]); $i++ ) {
- doCmdT($commands[$i][0], $commands[$i][1]);
- }
-}
-
-/* Define a command, with a title, to be executed later. */
-function defCmdT($title, $command) {
- global $commands;
- $title = htmlspecialchars($title,ENT_NOQUOTES);
- $commands[] = array($title, $command);
-}
-
-function doCmdT($title, $command) {
- echo "<p>\n";
- echo "<a name=\"" . $title . "\">\n";
- echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
- echo "<tr><td class=\"listtopic\">" . $title . "</td></tr>\n";
- echo "<tr><td class=\"listlr\"><pre>"; /* no newline after pre */
-
- if ($command == "dumpconfigxml") {
- $fd = @fopen("/conf/config.xml", "r");
- if ($fd) {
- while (!feof($fd)) {
- $line = fgets($fd);
- /* remove sensitive contents */
- $line = preg_replace("/<password>.*?<\\/password>/", "<password>xxxxx</password>", $line);
- $line = preg_replace("/<pre-shared-key>.*?<\\/pre-shared-key>/", "<pre-shared-key>xxxxx</pre-shared-key>", $line);
- $line = preg_replace("/<rocommunity>.*?<\\/rocommunity>/", "<rocommunity>xxxxx</rocommunity>", $line);
- $line = str_replace("\t", " ", $line);
- echo htmlspecialchars($line,ENT_NOQUOTES);
- }
- }
- fclose($fd);
- } else {
- $execOutput = "";
- $execStatus = "";
- exec ($command . " 2>&1", $execOutput, $execStatus);
- for ($i = 0; isset($execOutput[$i]); $i++) {
- if ($i > 0) {
- echo "\n";
- }
- echo htmlspecialchars($execOutput[$i],ENT_NOQUOTES);
- }
- }
- echo "</pre></tr>\n";
- echo "</table>\n";
-}
-
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version < 2.0)
- $one_two = true;
-
-?>
-
-<html>
- <body link="#0000CC" vlink="#0000CC" alink="#0000CC">
- <?php include("fbegin.inc"); ?>
- <?php if($one_two): ?>
- <p class="pgtitle"><?=$pgtitle?></font></p>
- <?php endif; ?>
- <?php if ($savemsg) print_info_box($savemsg); ?>
-
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=openospfd.xml&id=0");
- $tab_array[] = array(gettext("Interface Settings"), false, "/pkg.php?xml=openospfd_interfaces.xml");
- $tab_array[] = array(gettext("Status"), true, "/status_ospfd.php");
- display_top_tabs($tab_array);
- ?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td>
-<?php
- defCmdT("OpenOSPFd Summary","/usr/local/sbin/ospfctl show summary");
- defCmdT("OpenOSPFd Neighbors","/usr/local/sbin/ospfctl show neighbor");
- defCmdT("OpenOSPFd FIB","/usr/local/sbin/ospfctl show fib");
- defCmdT("OpenOSPFd RIB","/usr/local/sbin/ospfctl show rib");
- defCmdT("OpenOSPFd Interfaces","/usr/local/sbin/ospfctl show interfaces");
- defCmdT("OpenOSPFD Database","/usr/local/sbin/ospfctl show database");
-?>
- <div id="cmdspace" style="width:100%">
- <?php listCmds(); ?>
- <?php execCmds(); ?>
- </div>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
- </table>
- <?php include("fend.inc"); ?>
- </body>
-</html>
diff --git a/config/openvpn-status/openvpn-status.xml b/config/openvpn-status/openvpn-status.xml
deleted file mode 100644
index cecd6952..00000000
--- a/config/openvpn-status/openvpn-status.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- status_openvpn.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2010 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>OpenVPN Status Page</description>
- <requirements>Management Port Defined in OpenVPN Config</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>OpenVPN Status</name>
- <version>1.3</version>
- <title>Status: OpenVPN</title>
- <menu>
- <name>OpenVPN</name>
- <tooltiptext></tooltiptext>
- <section>Status</section>
- <url>/status_openvpn.php</url>
- </menu>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/openvpn-status/status_openvpn.php</item>
- </additional_files_needed>
- <custom_php_deinstall_command>
- <![CDATA[
- $version = file_get_contents("/etc/version");
- if ($version[0] < 2) {
- unlink_if_exists("/usr/local/www/status_openvpn.php");
- }
- ]]>
- </custom_php_deinstall_command>
-</packagegui> \ No newline at end of file
diff --git a/config/openvpn-status/status_openvpn.php b/config/openvpn-status/status_openvpn.php
deleted file mode 100644
index bd4178c0..00000000
--- a/config/openvpn-status/status_openvpn.php
+++ /dev/null
@@ -1,249 +0,0 @@
-<?php
-/*
- status_ovpenvpn.php
-
- Copyright (C) 2010 Jim Pingle
- Copyright (C) 2008 Shrew Soft Inc.
-
- AJAX bits borrowed from diag_dump_states.php
- Copyright (C) 2005 Scott Ullrich, Colin Smith
-
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = "Status: OpenVPN";
-require("guiconfig.inc");
-require_once("vpn.inc");
-include("head.inc");
-
-/* Handle AJAX */
-if($_GET['action']) {
- if($_GET['action'] == "kill") {
- $port = $_GET['port'];
- $remipp = $_GET['remipp'];
- if (!empty($port) and !empty($remipp)) {
- $retval = kill_client($port, $remipp);
- echo htmlentities("|{$port}|{$remipp}|{$retval}|");
- } else {
- echo "invalid input";
- }
- exit;
- }
-}
-
-
-function kill_client($port, $remipp) {
- $fp = @fsockopen("127.0.0.1", $port, $errval, $errstr, 1);
- $killed = -1;
- if ($fp) {
- fputs($fp, "kill {$remipp}\n");
- while (!feof($fp)) {
- $line = fgets($fp, 1024);
- /* parse header list line */
- if (strpos($line, "INFO:"))
- continue;
- if (strpos($line, "UCCESS")) {
- $killed = 0;
- }
- break;
- }
- fclose($fp);
- }
- return $killed;
-}
-
-$servers = array();
-
-$ovpnservers = $config['installedpackages']['openvpnserver']['config'];
-if (is_array($ovpnservers)) {
- foreach ($ovpnservers as $settings) {
-
- $prot = $settings['protocol'];
- $port = $settings['local_port'];
-
- $server = array();
- $server['port'] = $settings['local_port'];
- if ($settings['description'])
- $server['name'] = "{$settings['description']} {$prot}:{$port}";
- else
- $server['name'] = "Server {$prot}:{$port}";
- $server['conns'] = array();
-
- $errval;
- $errstr;
-
- /* open a tcp connection to the management port of each server */
- $fp = @fsockopen("127.0.0.1", $port, $errval, $errstr, 1);
- if ($fp) {
-
- /* send our status request */
- fputs($fp, "status 2\n");
-
- /* recv all response lines */
- while (!feof($fp)) {
-
- /* read the next line */
- $line = fgets($fp, 1024);
-
- /* parse header list line */
- if (strstr($line, "HEADER"))
- continue;
-
- /* parse end of output line */
- if (strstr($line, "END"))
- break;
-
- /* parse client list line */
- if (strstr($line, "CLIENT_LIST")) {
- $list = explode(",", $line);
- $conn = array();
- $conn['common_name'] = $list[1];
- $conn['remote_host'] = $list[2];
- $conn['virtual_addr'] = $list[3];
- $conn['bytes_recv'] = $list[4];
- $conn['bytes_sent'] = $list[5];
- $conn['connect_time'] = $list[6];
- $server['conns'][] = $conn;
- }
- }
-
- /* cleanup */
- fclose($fp);
- } else {
- $conn = array();
- $conn['common_name'] = "[error]";
- $conn['remote_host'] = "No Management Daemon";
- $conn['virtual_addr'] = "See Note Below";
- $conn['bytes_recv'] = 0;
- $conn['bytes_sent'] = 0;
- $conn['connect_time'] = 0;
- $server['conns'][] = $conn;
- }
-
- $servers[] = $server;
- }
-} ?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?=$jsevents["body"]["onload"];?>">
-<script src="/javascript/sorttable.js" type="text/javascript"></script>
-<script src="/javascript/scriptaculous/prototype.js" type="text/javascript"></script>
-<script src="/javascript/scriptaculous/scriptaculous.js" type="text/javascript"></script>
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?php echo $pgtitle; ?></p>
-<form action="status_openvpn.php" method="get" name="iform">
-
-<script type="text/javascript">
- function killClient(mport, remipp) {
- var busy = function(icon) {
- icon.onclick = "";
- icon.src = icon.src.replace("\.gif", "_d.gif");
- icon.style.cursor = "wait";
- }
-
- $A(document.getElementsByName("i:" + mport + ":" + remipp)).each(busy);
-
- new Ajax.Request(
- "<?=$_SERVER['SCRIPT_NAME'];?>" +
- "?action=kill&port=" + mport + "&remipp=" + remipp,
- { method: "get", onComplete: killComplete }
- );
- }
-
- function killComplete(req) {
- var values = req.responseText.split("|");
- if(values[3] != "0") {
- alert('<?=gettext("An error occurred.");?>' + ' (' + values[3] + ')');
- return;
- }
-
- $A(document.getElementsByName("r:" + values[1] + ":" + values[2])).each(
- function(row) { Effect.Fade(row, { duration: 1.0 }); }
- );
- }
-</script>
-
-
-<?php foreach ($servers as $server): ?>
-
-<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td colspan="6" class="listtopic">
- Client connections for <?=$server['name'];?>
- </td>
- </tr>
- <tr>
- <td>
- <table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Common Name</td>
- <td class="listhdrr">Real Address</td>
- <td class="listhdrr">Virtual Address</td>
- <td class="listhdrr">Connected Since</td>
- <td class="listhdrr">Bytes Sent</td>
- <td class="listhdrr">Bytes Received</td>
- </tr>
-
- <?php foreach ($server['conns'] as $conn): ?>
- <tr name='<?php echo "r:{$server['port']}:{$conn['remote_host']}"; ?>'>
- <td class="listlr">
- <?=$conn['common_name'];?>
- </td>
- <td class="listr">
- <?=$conn['remote_host'];?>
- </td>
- <td class="listr">
- <?=$conn['virtual_addr'];?>
- </td>
- <td class="listr">
- <?=$conn['connect_time'];?>
- </td>
- <td class="listr">
- <?=$conn['bytes_sent'];?>
- </td>
- <td class="listr">
- <?=$conn['bytes_recv'];?>
- </td>
- <td class='list'>
- <img src='/themes/<?php echo $g['theme']; ?>/images/icons/icon_x.gif' height='17' width='17' border='0'
- onclick="killClient('<?php echo $server['port']; ?>', '<?php echo $conn['remote_host']; ?>');" style='cursor:pointer;'
- name='<?php echo "i:{$server['port']}:{$conn['remote_host']}"; ?>'
- title='Kill client connection from <?php echo $conn['remote_host']; ?>' alt='' />
- </td>
- </tr>
-
- <?php endforeach; ?>
- <tr>
- <td colspan="6" class="list" height="12"></td>
- </tr>
-
- </table>
- </td>
- </tr>
-</table>
-
-<?php endforeach; ?>
-<br/>
-<br/><b>NOTE:</b> You must enable the OpenVPN management interface for each server you want to monitor. You can do this by placing "management 127.0.0.1 &lt;port&gt;;" in the custom options box for the server, where &lt;port&gt; is the port number set for that server.
-
-<?php include("fend.inc"); ?>
diff --git a/config/ovpnenhance/openvpn.inc_tls b/config/ovpnenhance/openvpn.inc_tls
deleted file mode 100644
index d06a0338..00000000
--- a/config/ovpnenhance/openvpn.inc_tls
+++ /dev/null
@@ -1,671 +0,0 @@
-<?php
-
-/* $Id: openvpn.inc,v 1.55 2007/06/30 21:20:11 sullrich Exp $ */
-/*
- $RCSfile: openvpn.inc,v $
- Copyright (C) 2006 Fernando Lemos
- All rights reserved.
-
- Copyright (C) 2005 Peter Allgeyer <allgeyer_AT_web.de>
- All rights reserved.
-
- Copyright (C) 2004 Peter Curran (peter@closeconsultants.com).
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notices,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notices, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require_once('config.inc');
-require_once('pfsense-utils.inc');
-require_once('util.inc');
-
-if(!function_exists("filter_configure"))
- require_once("filter.inc");
-
-// Return the list of ciphers OpenVPN supports
-function openvpn_get_ciphers($pkg) {
- foreach ($pkg['fields']['field'] as $i => $field) {
- if ($field['fieldname'] == 'crypto') break;
- }
- $option_array = &$pkg['fields']['field'][$i]['options']['option'];
- $ciphers_out = shell_exec('openvpn --show-ciphers | grep "default key" | awk \'{print $1, "(" $2 "-" $3 ")";}\'');
- $ciphers = explode("\n", trim($ciphers_out));
- sort($ciphers);
- foreach ($ciphers as $cipher) {
- $value = explode(' ', $cipher);
- $value = $value[0];
- $option_array[] = array('value' => $value, 'name' => $cipher);
- }
-}
-
-
-function openvpn_validate_port($value, $name) {
- $value = trim($value);
- if (!empty($value) && !(is_numeric($value) && ($value > 0) && ($value < 65535)))
- return "The field '$name' must contain a valid port, ranging from 0 to 65535.";
- return false;
-}
-
-
-function openvpn_validate_cidr($value, $name) {
- $value = trim($value);
- if (!empty($value)) {
- list($ip, $mask) = explode('/', $value);
- if (!is_ipaddr($ip) or !is_numeric($mask) or ($mask > 32) or ($mask < 0))
- return "The field '$name' must contain a valid CIDR range.";
- }
- return false;
-}
-
-
-// Do the input validation
-function openvpn_validate_input($mode, $post, $input_errors) {
- $Mode = ucfirst($mode);
-
- if ($mode == 'server') {
- if ($result = openvpn_validate_port($post['local_port'], 'Local port'))
- $input_errors[] = $result;
-
- if ($result = openvpn_validate_cidr($post['addresspool'], 'Address pool'))
- $input_errors[] = $result;
-
- if ($result = openvpn_validate_cidr($post['local_network'], 'Local network'))
- $input_errors[] = $result;
-
-/* check for port in use - update of existing entries not possible because $_GET['act'] is not passed from pkg_edit.php :-( mfuchs
- $portinuse = shell_exec('sockstat | grep '.$post['local_port'].' | grep '.strtolower($post['protocol']));
- if (!empty($portinuse))
- $input_errors[] = 'The port '.$post['local_port'].'/'.strtolower($post['protocol']).' is already in use.';
-*/
-
- if (!empty($post['dhcp_dns'])) {
- $servers = explode(';', $post['dhcp_dns']);
- foreach ($servers as $server) if (!is_ipaddr($server))
- {$input_errors[] = 'The field \'DHCP-Opt.: DNS-Server\' must contain a valid IP address and no whitespaces.';
- break;}}
- if (!empty($post['dhcp_wins'])) {
- $servers = explode(';', $post['dhcp_wins']);
- foreach ($servers as $server) if (!is_ipaddr($server))
- {$input_errors[] = 'The field \'DHCP-Opt.: WINS-Server\' must contain a valid IP address and no whitespaces.';
- break;}}
- if (!empty($post['dhcp_nbdd'])) {
- $servers = explode(';', $post['dhcp_nbdd']);
- foreach ($servers as $server) if (!is_ipaddr($server))
- {$input_errors[] = 'The field \'DHCP-Opt.: NBDD-Server\' must contain a valid IP address and no whitespaces.';
- break;}}
- if (!empty($post['dhcp_ntp'])) {
- $servers = explode(';', $post['dhcp_ntp']);
- foreach ($servers as $server) if (!is_ipaddr($server))
- {$input_errors[] = 'The field \'DHCP-Opt.: NTP-Server\' must contain a valid IP address and no whitespaces.';
- break;}}
- if (isset($post['maxclients']) && $post['maxclients'] != "") {
- if (!is_numeric($post['maxclients']))
- $input_errors[] = 'The field \'Maximum clients\' must be numeric.';
- }
-
- }
-
- else { // Client mode
- if ($result = openvpn_validate_port($post['serverport'], 'Server port'))
- $input_errors[] = $result;
-
- $server_addr = trim($post['serveraddr']);
- if (!empty($value) && !(is_domain($server_addr) || is_ipaddr($server_addr)))
- $input_errors[] = 'The field \'Server address\' must contain a valid IP address or domain name.';
-
- if ($result = openvpn_validate_cidr($post['interface_ip'], 'Interface IP'))
- $input_errors[] = $result;
-
- if ($post['auth_method'] == 'shared_key') {
- if (empty($post['interface_ip']))
- $input_errors[] = 'The field \'Interface IP\' is required.';
- }
- if (isset($post['proxy_hostname']) && $post['proxy_hostname'] != "") {
- if (!is_domain($post['proxy_hostname']) || is_ipaddr($post['proxy_hostname']))
- $input_errors[] = 'The field \'Proxy Host\' must contain a valid IP address or domain name.';
- if (!is_port($post['proxy_port']))
- $input_errors[] = 'The field \'Proxy port\' must contain a valid port number.';
- if ($post['protocol'] != "TCP")
- $input_errors[] = 'The protocol must be TCP to use a HTTP proxy server.';
- }
- if (isset($post['use_shaper']) && $post['use_shaper'] != "") {
- if (!is_numeric($post['use_shaper']))
- $input_errors[] = 'The field \'Limit outgoing bandwidth\' must be numeric.';
- }
-
- }
-
- if ($result = openvpn_validate_cidr($post['remote_network'], 'Remote network'))
- $input_errors[] = $result;
-
- if ($_POST['auth_method'] == 'shared_key') {
- $reqfields[] = 'shared_key';
- $reqfieldsn[] = 'Shared key';
- }
- else {
- $req = explode(' ', "ca_cert {$mode}_cert {$mode}_key");
- $reqn = array( 'CA certificate',
- ucfirst($mode) . ' certificate',
- ucfirst($mode) . ' key');
- $reqfields = array_merge($reqfields, $req);
- $reqfieldsn = array_merge($reqfieldsn, $reqn);
- if ($mode == 'server') {
- $reqfields[] = 'dh_params';
- $reqfieldsn[] = 'DH parameters';
- }
- }
- do_input_validation($post, $reqfields, $reqfieldsn, &$input_errors);
-
- $value = trim($post['shared_key']);
- $items = array();
-
- if ($_POST['auth_method'] == 'shared_key') {
- $items[] = array( 'field' => 'shared_key',
- 'string' => 'OpenVPN Static key V1',
- 'name' => 'Shared key');
- }
- else {
- $items[] = array( 'field' => 'ca_cert',
- 'string' => 'CERTIFICATE',
- 'name' => 'CA certificate');
- $items[] = array( 'field' => "{$mode}_cert",
- 'string' => 'CERTIFICATE',
- 'name' => "$Mode certificate");
- $items[] = array( 'field' => "{$mode}_key",
- 'string' => 'RSA PRIVATE KEY',
- 'name' => "$Mode key");
- $items[] = array( 'field' => 'tls',
- 'string' => 'OpenVPN Static key V1',
- 'name' => 'TLS');
- if ($mode == 'server') {
- $items[] = array( 'field' => 'dh_params',
- 'string' => 'DH PARAMETERS',
- 'name' => 'DH parameters');
- $items[] = array( 'field' => 'crl',
- 'string' => 'X509 CRL',
- 'name' => 'CRL');
- }
- }
- foreach ($items as $item) {
- $value = trim($_POST[$item['field']]);
- $string = $item['string'];
- if ($value && (!strstr($value, "-----BEGIN {$string}-----") || !strstr($value, "-----END {$string}-----")))
- $input_errors[] = "The field '{$item['name']}' does not appear to be valid";
- }
-}
-
-
-function openvpn_validate_input_csc($post, $input_errors) {
- if ($result = openvpn_validate_cidr($post['ifconfig_push'], 'Interface IP'))
- $input_errors[] = $result;
-
- if ($post['push_reset'] != 'on') {
- if (!empty($post['dhcp_domainname']))
- $input_errors[] = 'It makes no sense to unselect push reset and configure dhcp-options';
- elseif (!empty($post['dhcp_dns']))
- $input_errors[] = 'It makes no sense to unselect push reset and configure dhcp-options';
- elseif (!empty($post['dhcp_wins']))
- $input_errors[] = 'It makes no sense to unselect push reset and configure dhcp-options';
- elseif (!empty($post['dhcp_nbdd']))
- $input_errors[] = 'It makes no sense to unselect push reset and configure dhcp-options';
- elseif (!empty($post['dhcp_ntp']))
- $input_errors[] = 'It makes no sense to unselect push reset and configure dhcp-options';
- elseif ($post['dhcp_nbttype'])
- $input_errors[] = 'It makes no sense to unselect push reset and configure dhcp-options';
- elseif (!empty($post['dhcp_nbtscope']))
- $input_errors[] = 'It makes no sense to unselect push reset and configure dhcp-options';
- elseif ($post['dhcp_nbtdisable'])
- $input_errors[] = 'It makes no sense to unselect push reset and configure dhcp-options';
-
- }
- else {
-
- if (!empty($post['dhcp_dns'])) {
- $servers = explode(';', $post['dhcp_dns']);
- foreach ($servers as $server) if (!is_ipaddr($server))
- {$input_errors[] = 'The field \'DHCP-Opt.: DNS-Server\' must contain a valid IP address and no whitespaces.';
- break;}}
- if (!empty($post['dhcp_wins'])) {
- $servers = explode(';', $post['dhcp_wins']);
- foreach ($servers as $server) if (!is_ipaddr($server))
- {$input_errors[] = 'The field \'DHCP-Opt.: WINS-Server\' must contain a valid IP address and no whitespaces.';
- break;}}
- if (!empty($post['dhcp_nbdd'])) {
- $servers = explode(';', $post['dhcp_nbdd']);
- foreach ($servers as $server) if (!is_ipaddr($server))
- {$input_errors[] = 'The field \'DHCP-Opt.: NBDD-Server\' must contain a valid IP address and no whitespaces.';
- break;}}
- if (!empty($post['dhcp_ntp'])) {
- $servers = explode(';', $post['dhcp_ntp']);
- foreach ($servers as $server) if (!is_ipaddr($server))
- {$input_errors[] = 'The field \'DHCP-Opt.: NTP-Server\' must contain a valid IP address and no whitespaces.';
- break;}}
-
-}}
-
-// Rewrite the settings
-function openvpn_reconfigure($mode, $id) {
- global $g, $config;
-
- $settings = $config['installedpackages']["openvpn$mode"]['config'][$id];
- if ($settings['disable']) return;
-
- $lport = 1194 + $id;
-
- // Set the keys up
- // Note that the keys' extension is also the directive that goes to the config file
- $base_file = $g['varetc_path'] . "/openvpn_{$mode}{$id}.";
- $keys = array();
- if ($settings['auth_method'] == 'shared_key')
- $keys[] = array('field' => 'shared_key', 'ext' => 'secret', 'directive' => 'secret');
- else {
- $keys[] = array('field' => 'ca_cert', 'ext' => 'ca', 'directive' => 'ca');
- $keys[] = array('field' => "{$mode}_cert", 'ext' => 'cert', 'directive' => 'cert');
- $keys[] = array('field' => "{$mode}_key", 'ext' => 'key', 'directive' => 'key');
- if ($mode == 'server')
- $keys[] = array('field' => 'dh_params', 'ext' => 'dh', 'directive' => 'dh');
- if ($settings['crl'])
- $keys[] = array('field' => 'crl', 'ext' => 'crl', 'directive' => 'crl-verify');
- if ($settings['tls'])
- $keys[] = array('field' => 'tls', 'ext' => 'tls', 'directive' => 'tls-auth');
-
- }
- foreach($keys as $key) {
- $filename = $base_file . $key['ext'];
- file_put_contents($filename, base64_decode($settings[$key['field']]));
- chown($filename, 'nobody');
- chgrp($filename, 'nobody');
- }
-
- $pidfile = $g['varrun_path'] . "/openvpn_{$mode}{$id}.pid";
- $proto = ($settings['protocol'] == 'UDP' ? 'udp' : "tcp-{$mode}");
- $cipher = $settings['crypto'];
- $openvpn_conf = <<<EOD
-writepid $pidfile
-#user nobody
-#group nobody
-daemon
-keepalive 10 60
-ping-timer-rem
-persist-tun
-persist-key
-dev tun
-proto $proto
-cipher $cipher
-up /etc/rc.filter_configure
-down /etc/rc.filter_configure
-
-EOD;
-
- // Mode-specific stuff
- if ($mode == 'server') {
- list($ip, $mask) = explode('/', $settings['addresspool']);
- $mask = gen_subnet_mask($mask);
-
- // Using a shared key or not dynamically assigning IPs to the clients
- if (($settings['auth_method'] == 'shared_key') || ($settings['nopool'] == 'on')) {
- if ($settings['auth_method'] == 'pki') $openvpn_conf .= "tls-server\n";
-
- $baselong = ip2long($ip) & ip2long($mask);
- $ip1 = long2ip($baselong + 1);
- $ip2 = long2ip($baselong + 2);
- $openvpn_conf .= "ifconfig $ip1 $ip2\n";
- }
- // Using a PKI
- else if ($settings['auth_method'] == 'pki') {
- if ($settings['client2client']) $openvpn_conf .= "client-to-client\n";
- $openvpn_conf .= "server $ip $mask\n";
- $csc_dir = "{$g['varetc_path']}/openvpn_csc";
- $openvpn_conf .= "client-config-dir $csc_dir\n";
- }
-
- // We can push routes
- if (!empty($settings['local_network'])) {
- list($ip, $mask) = explode('/', $settings['local_network']);
- $mask = gen_subnet_mask($mask);
- $openvpn_conf .= "push \"route $ip $mask\"\n";
- }
-
- // The port we'll listen at
- $openvpn_conf .= "lport {$settings['local_port']}\n";
-
- // DHCP-Options
- if (!empty($settings['dhcp_domainname'])) $openvpn_conf .= "push \"dhcp-option DOMAIN {$settings['dhcp_domainname']}\"\n";
-
- if (!empty($settings['dhcp_dns'])) {
- $servers = explode(';', $settings['dhcp_dns']);
- if (is_array($servers)) {
- foreach ($servers as $server) $openvpn_conf .= "push \"dhcp-option DNS {$server}\"\n";
- }
- else {
- $openvpn_conf .= "push \"dhcp-option DNS {$settings['dhcp_dns']}\"\n";
- }
- }
-
- if (!empty($settings['dhcp_wins'])) {
- $servers = explode(';', $settings['dhcp_wins']);
- if (is_array($servers)) {
- foreach ($servers as $server) $openvpn_conf .= "push \"dhcp-option WINS {$server}\"\n";
- }
- else {
- $openvpn_conf .= "push \"dhcp-option WINS {$settings['dhcp_wins']}\"\n";
- }
- }
-
- if (!empty($settings['dhcp_nbdd'])) {
- $servers = explode(';', $settings['dhcp_nbdd']);
- if (is_array($servers)) {
- foreach ($servers as $server) $openvpn_conf .= "push \"dhcp-option NBDD {$server}\"\n";
- }
- else {
- $openvpn_conf .= "push \"dhcp-option NBDD {$settings['dhcp_nbdd']}\"\n";
- }
- }
-
- if (!empty($settings['dhcp_ntp'])) {
- $servers = explode(';', $settings['dhcp_ntp']);
- if (is_array($servers)) {
- foreach ($servers as $server) $openvpn_conf .= "push \"dhcp-option NTP {$server}\"\n";
- }
- else {
- $openvpn_conf .= "push \"dhcp-option NTP {$settings['dhcp_ntp']}\"\n";
- }
- }
-
- if (!empty($settings['dhcp_nbttype']) && $settings['dhcp_nbttype'] !=0) $openvpn_conf .= "push \"dhcp-option NBT {$settings['dhcp_nbttype']}\"\n";
- if (!empty($settings['dhcp_nbtscope'])) $openvpn_conf .= "push \"dhcp-option NBS {$settings['dhcp_nbtscope']}\"\n";
- if (!empty($settings['dhcp_nbtdisable'])) $openvpn_conf .= "push \"dhcp-option DISABLE-NBT\"\n";
- if (!empty($settings['tls'])) $openvpn_conf .= "tls-auth {$g['varetc_path']}/openvpn_server{$id}.tls 0\n";
- if (!empty($settings['maxclients'])) $openvpn_conf .= "max-clients {$settings['maxclients']}\n";
- if ($settings['gwredir']) $openvpn_conf .= "push \"redirect-gateway def1\"\n";
- }
-
- else { // $mode == client
- // The remote server
- $openvpn_conf .= "remote {$settings['serveraddr']} {$settings['serverport']}\n";
-
- if ($settings['auth_method'] == 'pki') $openvpn_conf .= "client\n";
-
- if ($settings['use_dynamicport']) $openvpn_conf .= "nobind\n";
- else
- // The port we'll listen at
- $openvpn_conf .= "lport {$lport}\n";
-
- if (!empty($settings['use_shaper'])) $openvpn_conf .= "shaper {$settings['use_shaper']}\n";
-
- if (!empty($settings['interface_ip'])) {
- // Configure the IPs according to the address pool
- list($ip, $mask) = explode('/', $settings['interface_ip']);
- $mask = gen_subnet_mask($mask);
- $baselong = ip2long($ip) & ip2long($mask);
- $ip1 = long2ip($baselong + 1);
- $ip2 = long2ip($baselong + 2);
- $openvpn_conf .= "ifconfig $ip2 $ip1\n";
- }
- if (isset($settings['proxy_hostname']) && $settings['proxy_hostname'] != "") {
- /* ;http-proxy-retry # retry on connection failures */
- $openvpn_conf .= "http-proxy {$settings['proxy_hostname']} {$settings['proxy_port']}\n";
- }
-
- if (!empty($settings['tls'])) $openvpn_conf .= "tls-auth {$g['varetc_path']}/openvpn_client{$id}.tls 1\n";
-
- }
-
- // Add the routes if they're set
- if (!empty($settings['remote_network'])) {
- list($ip, $mask) = explode('/', $settings['remote_network']);
- $mask = gen_subnet_mask($mask);
- $openvpn_conf .= "route $ip $mask\n";
- }
-
- // Write the settings for the keys
- foreach ($keys as $key)
- if ($key['directive'] != 'tls-auth') {
- $openvpn_conf .= $key['directive'] . ' ' . $base_file . $key['ext'] . "\n";
- }
-
- if ($settings['use_lzo']) $openvpn_conf .= "comp-lzo\n";
-
- if ($settings['passtos']) $openvpn_conf .= "passtos\n";
-
- if ($settings['infiniteresolvretry']) $openvpn_conf .= "resolv-retry infinite\n";
-
- if ($settings['dynamic_ip']) {
- $openvpn_conf .= "persist-remote-ip\n";
- $openvpn_conf .= "float\n";
- }
-
- if (!empty($settings['custom_options'])) {
- $options = explode(';', $settings['custom_options']);
- if (is_array($options)) {
- foreach ($options as $option)
- $openvpn_conf .= "$option\n";
- }
- else {
- $openvpn_conf .= "{$settings['custom_options']}\n";
- }
- }
-
- file_put_contents($g['varetc_path'] . "/openvpn_{$mode}{$id}.conf", $openvpn_conf);
-}
-
-
-function openvpn_resync_csc($id) {
- global $g, $config;
-
- $settings = $config['installedpackages']['openvpncsc']['config'][$id];
-
- if ($settings['disable'] == 'on') {
- $filename = "{$g['varetc_path']}/openvpn_csc/{$settings['commonname']}";
- unlink_if_exists($filename);
- return;
- }
-
- $conf = '';
- if ($settings['block'] == 'on') $conf .= "disable\n";
- if ($settings['push_reset'] == 'on') $conf .= "push-reset\n";
- if (!empty($settings['ifconfig_push'])) {
- list($ip, $mask) = explode('/', $settings['ifconfig_push']);
- $baselong = ip2long($ip) & gen_subnet_mask_long($mask);
- $conf .= 'ifconfig-push ' . long2ip($baselong + 1) . ' ' . long2ip($baselong + 2) . "\n";
- }
-
-// DHCP-Options
- if (!empty($settings['dhcp_domainname'])) $conf .= "push \"dhcp-option DOMAIN {$settings['dhcp_domainname']}\"\n";
-
- if (!empty($settings['dhcp_dns'])) {
- $servers = explode(';', $settings['dhcp_dns']);
- if (is_array($servers)) {
- foreach ($servers as $server) $conf .= "push \"dhcp-option DNS {$server}\"\n";
- }
- else {
- $conf .= "push \"dhcp-option DNS {$settings['dhcp_dns']}\"\n";
- }
- }
-
- if (!empty($settings['dhcp_wins'])) {
- $servers = explode(';', $settings['dhcp_wins']);
- if (is_array($servers)) {
- foreach ($servers as $server) $conf .= "push \"dhcp-option WINS {$server}\"\n";
- }
- else {
- $conf .= "push \"dhcp-option WINS {$settings['dhcp_wins']}\"\n";
- }
- }
-
- if (!empty($settings['dhcp_nbdd'])) {
- $servers = explode(';', $settings['dhcp_nbdd']);
- if (is_array($servers)) {
- foreach ($servers as $server) $conf .= "push \"dhcp-option NBDD {$server}\"\n";
- }
- else {
- $conf .= "push \"dhcp-option NBDD {$settings['dhcp_nbdd']}\"\n";
- }
- }
-
- if (!empty($settings['dhcp_ntp'])) {
- $servers = explode(';', $settings['dhcp_ntp']);
- if (is_array($servers)) {
- foreach ($servers as $server) $conf .= "push \"dhcp-option NTP {$server}\"\n";
- }
- else {
- $conf .= "push \"dhcp-option NTP {$settings['dhcp_ntp']}\"\n";
- }
- }
-
- if (!empty($settings['dhcp_nbttype']) && $settings['dhcp_nbttype'] !=0) $conf .= "push \"dhcp-option NBT {$settings['dhcp_nbttype']}\"\n";
- if (!empty($settings['dhcp_nbtscope'])) $conf .= "push \"dhcp-option NBS {$settings['dhcp_nbtscope']}\"\n";
- if ($settings['dhcp_nbtdisable']) $conf .= "push \"dhcp-option DISABLE-NBT\"\n";
- if ($settings['gwredir']) $conf .= "push \"redirect-gateway def1\"\n";
-
-
- if (!empty($settings['custom_options'])) {
- $options = explode(';', $settings['custom_options']);
- if (is_array($options)) {
- foreach ($options as $option)
- $conf .= "$option\n";
- }
- else {
- $conf .= "{$settings['custom_options']}\n";
- }
- }
-
- $filename = "{$g['varetc_path']}/openvpn_csc/{$settings['commonname']}";
- file_put_contents($filename, $conf);
- chown($filename, 'nobody');
- chgrp($filename, 'nogroup');
-
-}
-
-
-function openvpn_restart($mode, $id) {
- global $g, $config;
-
- $pidfile = $g['varrun_path'] . "/openvpn_{$mode}{$id}.pid";
- killbypid($pidfile);
- sleep(2);
-
- $settings = $config['installedpackages']["openvpn$mode"]['config'][$id];
- if ($settings['disable']) return;
-
- $configfile = $g['varetc_path'] . "/openvpn_{$mode}{$id}.conf";
- mwexec_bg("nohup openvpn --config $configfile");
- touch("{$g['tmp_path']}/filter_dirty");
-}
-
-
-// Resync the configuration and restart the VPN
-function openvpn_resync($mode, $id) {
- openvpn_reconfigure($mode, $id);
- openvpn_restart($mode, $id);
-}
-
-function openvpn_create_cscdir() {
- global $g;
-
- $csc_dir = "{$g['varetc_path']}/openvpn_csc";
- if (is_dir($csc_dir))
- rmdir_recursive($csc_dir);
- make_dirs($csc_dir);
- chown($csc_dir, 'nobody');
- chgrp($csc_dir, 'nobody');
-}
-
-// Resync and restart all VPNs
-function openvpn_resync_all() {
- global $config;
-
- foreach (array('server', 'client') as $mode) {
- if (is_array($config['installedpackages']["openvpn$mode"]['config'])) {
- foreach ($config['installedpackages']["openvpn$mode"]['config'] as $id => $settings)
- openvpn_resync($mode, $id);
- }
- }
-
- openvpn_create_cscdir();
- if (is_array($config['installedpackages']['openvpncsc']['config'])) {
- foreach ($config['installedpackages']['openvpncsc']['config'] as $id => $csc)
- openvpn_resync_csc($id);
- }
-
- /* give speedy machines time to settle */
- sleep(5);
-
- /* reload the filter policy */
- filter_configure();
-
-}
-
-function openvpn_print_javascript($mode) {
- $javascript = <<<EOD
-<script language="JavaScript">
-<!--
-function onAuthMethodChanged() {
- var method = document.iform.auth_method;
- var endis = (method.options[method.selectedIndex].value == 'shared_key');
-
- document.iform.shared_key.disabled = !endis;
- document.iform.ca_cert.disabled = endis;
- document.iform.{$mode}_cert.disabled = endis;
- document.iform.{$mode}_key.disabled = endis;
- document.iform.tls.disabled = endis;
-
-EOD;
- if ($mode == 'server') {
- $javascript .= <<<EOD
- document.iform.dh_params.disabled = endis;
- document.iform.crl.disabled = endis;
- document.iform.tls.disabled = endis;
- document.iform.nopool.disabled = endis;
- document.iform.local_network.disabled = endis;
- document.iform.client2client.disabled = endis;
- document.iform.maxclients.disabled = endis;
-
-EOD;
- }
-
- else { // Client mode
- $javascript .= "\tdocument.iform.remote_network.disabled = !endis;\n";
- }
-
- $javascript .= <<<EOD
-}
-//-->
-</script>
-
-EOD;
- print($javascript);
-}
-
-
-function openvpn_print_javascript2() {
- $javascript = <<<EOD
-<script language="JavaScript">
-<!--
- onAuthMethodChanged();
-//-->
-</script>
-
-EOD;
- print($javascript);
-}
-?>
diff --git a/config/ovpnenhance/openvpn.xml_tls b/config/ovpnenhance/openvpn.xml_tls
deleted file mode 100644
index e7932e38..00000000
--- a/config/ovpnenhance/openvpn.xml_tls
+++ /dev/null
@@ -1,329 +0,0 @@
-<packagegui>
- <name>openvpnserver</name>
- <title>OpenVPN: Server</title>
- <include_file>openvpn.inc</include_file>
- <delete_string>An OpenVPN server has been deleted.</delete_string>
- <addedit_string>An OpenVPN server has been created/modified.</addedit_string>
- <tabs>
- <tab>
- <text>Server</text>
- <url>/pkg.php?xml=openvpn.xml</url>
- <active/>
- </tab>
- <tab>
- <text>Client</text>
- <url>/pkg.php?xml=openvpn_cli.xml</url>
- </tab>
- <tab>
- <text>Client-specific configuration</text>
- <url>/pkg.php?xml=openvpn_csc.xml</url>
- </tab>
- </tabs>
- <adddeleteeditpagefields>
- <columnitem>
- <fieldname>disable</fieldname>
- <fielddescr>Disabled</fielddescr>
- <type>checkbox</type>
- </columnitem>
- <columnitem>
- <fieldname>protocol</fieldname>
- <fielddescr>Protocol</fielddescr>
- </columnitem>
- <columnitem>
- <fieldname>addresspool</fieldname>
- <fielddescr>Address pool</fielddescr>
- </columnitem>
- <columnitem>
- <fieldname>description</fieldname>
- <fielddescr>Description</fielddescr>
- </columnitem>
- </adddeleteeditpagefields>
- <fields>
- <field>
- <fieldname>disable</fieldname>
- <fielddescr>Disable this tunnel</fielddescr>
- <description>This allows you to disable this tunnel without removing it from the list.</description>
- <required/>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>protocol</fieldname>
- <fielddescr>Protocol</fielddescr>
- <description>The protocol to be used for the VPN.</description>
- <required/>
- <type>select</type>
- <options>
- <option>
- <value>TCP</value>
- <name>TCP</name>
- </option>
- <option>
- <value>UDP</value>
- <name>UDP</name>
- </option>
- </options>
- <default_value>UDP</default_value>
- </field>
- <field>
- <fieldname>dynamic_ip</fieldname>
- <fielddescr>Dynamic IP</fielddescr>
- <description>Assume dynamic IPs, so that DHCP clients can connect.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>local_port</fieldname>
- <fielddescr>Local port</fielddescr>
- <description>The port OpenVPN will listen on. You generally want 1194 here.</description>
- <required/>
- <type>input</type>
- <default_value>1194</default_value>
- <size>5</size>
- </field>
- <field>
- <fieldname>addresspool</fieldname>
- <fielddescr>Address pool</fielddescr>
- <description>This is the address pool to be assigned to the clients. Expressed as a CIDR range (eg. 10.0.8.0/24). If the 'Use static IPs' field isn't set, clients will be assigned addresses from this pool. Otherwise, this will be used to set the local interface's IP.</description>
- <required/>
- <type>input</type>
- </field>
- <field>
- <fieldname>nopool</fieldname>
- <fielddescr>Use static IPs</fielddescr>
- <description>If this option is set, IPs won't be assigned to clients. Instead, the server will use static IPs on its side, and the clients are expected to use this same value in the 'Address pool' field.</description>
- <required/>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>local_network</fieldname>
- <fielddescr>Local network</fielddescr>
- <description>This is the network that will be accessable from the remote endpoint. Expressed as a CIDR range. You may leave this blank you don't want to add a route to your network through this tunnel in the remote machine. This is generally set to your LAN network.</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>remote_network</fieldname>
- <fielddescr>Remote network</fielddescr>
- <description>This is a network that will be routed through the tunnel, so that a site-to-site VPN can be established without manually changing the routing tables. Expressed as a CIDR range. If this is a site-to-site VPN, enter here the remote LAN here. You may leave this blank if you don't want a site-to-site VPN.</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>client2client</fieldname>
- <fielddescr>Client-to-client VPN</fielddescr>
- <description>If this option is set, clients will be able to talk to each other. Otherwise, they will only be able to talk to the server.</description>
- <required/>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>crypto</fieldname>
- <fielddescr>Cryptography</fielddescr>
- <description>Here you can choose the cryptography algorithm to be used.</description>
- <required/>
- <type>select</type>
- <default_value>BF-CBC</default_value>
- </field>
- <field>
- <fieldname>auth_method</fieldname>
- <fielddescr>Authentication method</fielddescr>
- <description>The authentication method to be used.</description>
- <required/>
- <type>select</type>
- <options>
- <option>
- <value>shared_key</value>
- <name>Shared key</name>
- </option>
- <option>
- <value>pki</value>
- <name>PKI (Public Key Infrastructure)</name>
- </option>
- </options>
- <onchange>onAuthMethodChanged()</onchange>
- </field>
- <field>
- <fieldname>shared_key</fieldname>
- <fielddescr>Shared key</fielddescr>
- <description>Paste your shared key here.</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <rows>8</rows>
- <cols>40</cols>
- </field>
- <field>
- <fieldname>ca_cert</fieldname>
- <fielddescr>CA certificate</fielddescr>
- <description>Paste your CA certificate in X.509 format here.</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <rows>8</rows>
- <cols>40</cols>
- </field>
- <field>
- <fieldname>server_cert</fieldname>
- <fielddescr>Server certificate</fielddescr>
- <description>Paste your server certificate in X.509 format here.</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <rows>8</rows>
- <cols>40</cols>
- </field>
- <field>
- <fieldname>server_key</fieldname>
- <fielddescr>Server key</fielddescr>
- <description>Paste your server key in RSA format here.</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <rows>8</rows>
- <cols>40</cols>
- </field>
- <field>
- <fieldname>dh_params</fieldname>
- <fielddescr>DH parameters</fielddescr>
- <description>Paste your Diffie Hellman parameters in PEM format here.</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <rows>8</rows>
- <cols>40</cols>
- </field>
- <field>
- <fieldname>crl</fieldname>
- <fielddescr>CRL</fielddescr>
- <description>Paste your certificate revocation list (CRL) in PEM format here (optional).</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <rows>8</rows>
- <cols>40</cols>
- </field>
- <field>
- <fieldname>tls</fieldname>
- <fielddescr>TLS</fielddescr>
- <description>Paste your HMAC signature (TLS) here (optional).</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <rows>8</rows>
- <cols>40</cols>
- </field>
- <field>
- <fieldname>dhcp_domainname</fieldname>
- <fielddescr>DHCP-Opt.: DNS-Domainname</fielddescr>
- <description>Set connection-specific DNS Suffix.</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>dhcp_dns</fieldname>
- <fielddescr>DHCP-Opt.: DNS-Server</fielddescr>
- <description>Set domain name server addresses, separated by semi-colons (;).</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>dhcp_wins</fieldname>
- <fielddescr>DHCP-Opt.: WINS-Server</fielddescr>
- <description>Set WINS server addresses (NetBIOS over TCP/IP Name Server), separated by semi-colons (;).</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>dhcp_nbdd</fieldname>
- <fielddescr>DHCP-Opt.: NBDD-Server</fielddescr>
- <description>Set NBDD server addresses (NetBIOS over TCP/IP Datagram Distribution Server), separated by semi-colons (;).</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>dhcp_ntp</fieldname>
- <fielddescr>DHCP-Opt.: NTP-Server</fielddescr>
- <description>Set NTP server addresses (Network Time Protocol), separated by semi-colons (;).</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>dhcp_nbttype</fieldname>
- <fielddescr>DHCP-Opt.: NetBIOS node type</fielddescr>
- <description>Set NetBIOS over TCP/IP Node type. Possible options: b-node (broadcasts), p-node (point-to-point name queries to a WINS server), m-node (broadcast then query name server), and h-node (query name server, then broadcast).</description>
- <type>select</type>
- <options>
- <option>
- <value>0</value>
- <name>none</name>
- </option>
- <option>
- <value>1</value>
- <name>b-node</name>
- </option>
- <option>
- <value>2</value>
- <name>p-node</name>
- </option>
- <option>
- <value>4</value>
- <name>m-node</name>
- </option>
- <option>
- <value>8</value>
- <name>h-node</name>
- </option>
- </options>
- <default_value>0</default_value>
- </field>
- <field>
- <fieldname>dhcp_nbtscope</fieldname>
- <fielddescr>DHCP-Opt.: NetBIOS Scope</fielddescr>
- <description>Set NetBIOS over TCP/IP Scope. A NetBIOS Scope ID provides an extended naming service for NetBIOS over TCP/IP. The NetBIOS scope ID isolates NetBIOS traffic on a single network to only those nodes with the same NetBIOS scope ID.</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>dhcp_nbtdisable</fieldname>
- <fielddescr>DHCP-Opt.: Disable NetBIOS</fielddescr>
- <description>If this option is set, Netbios-over-TCP/IP will be disabled.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>use_lzo</fieldname>
- <fielddescr>LZO compression</fielddescr>
- <description>Checking this will compress the packets using the LZO algorithm before sending them.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>maxclients</fieldname>
- <fielddescr>Maximum clients</fielddescr>
- <description>The maximum number of concurrently connected clients we want to allow.</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>passtos</fieldname>
- <fielddescr>Pass Type-Of-Service</fielddescr>
- <description>Checking this will set the TOS field of the tunnel packet to what the payload's TOS is.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>gwredir</fieldname>
- <fielddescr>Redirect Gateway</fielddescr>
- <description>Redirect ALL traffic through the OpenVPN server.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>custom_options</fieldname>
- <fielddescr>Custom options</fielddescr>
- <description>You can put your own custom options here, separated by semi-colons (;). They'll be added to the server configuration.</description>
- <type>textarea</type>
- <cols>65</cols>
- <rows>5</rows>
- </field>
- <field>
- <fieldname>description</fieldname>
- <fielddescr>Description</fielddescr>
- <description>You may enter a description here. This is optional and is not parsed.</description>
- <type>input</type>
- </field>
- </fields>
- <custom_php_command_before_form>
- openvpn_get_ciphers(&amp;$pkg);
- </custom_php_command_before_form>
- <custom_php_after_head_command>
- openvpn_print_javascript('server');
- </custom_php_after_head_command>
- <custom_php_after_form_command>
- openvpn_print_javascript2();
- </custom_php_after_form_command>
- <custom_php_validation_command>
- openvpn_validate_input('server', $_POST, &amp;$input_errors);
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- openvpn_resync('server', $id);
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/ovpnenhance/openvpn_cli.xml_tls b/config/ovpnenhance/openvpn_cli.xml_tls
deleted file mode 100644
index b9b85cf6..00000000
--- a/config/ovpnenhance/openvpn_cli.xml_tls
+++ /dev/null
@@ -1,240 +0,0 @@
-<packagegui>
- <name>openvpnclient</name>
- <title>OpenVPN: Client</title>
- <include_file>openvpn.inc</include_file>
- <delete_string>An OpenVPN client has been deleted.</delete_string>
- <addedit_string>An OpenVPN client has been created/modified.</addedit_string>
- <tabs>
- <tab>
- <text>Server</text>
- <url>/pkg.php?xml=openvpn.xml</url>
- </tab>
- <tab>
- <text>Client</text>
- <url>/pkg.php?xml=openvpn_cli.xml</url>
- <active/>
- </tab>
- <tab>
- <text>Client-specific configuration</text>
- <url>/pkg.php?xml=openvpn_csc.xml</url>
- </tab>
- </tabs>
- <adddeleteeditpagefields>
- <columnitem>
- <fieldname>disable</fieldname>
- <fielddescr>Disabled</fielddescr>
- <type>checkbox</type>
- </columnitem>
- <columnitem>
- <fieldname>serveraddr</fieldname>
- <fielddescr>Server</fielddescr>
- </columnitem>
- <columnitem>
- <fieldname>protocol</fieldname>
- <fielddescr>Protocol</fielddescr>
- </columnitem>
- <columnitem>
- <fieldname>description</fieldname>
- <fielddescr>Description</fielddescr>
- </columnitem>
- </adddeleteeditpagefields>
- <fields>
- <field>
- <fieldname>disable</fieldname>
- <fielddescr>Disable this tunnel</fielddescr>
- <description>This allows you to disable this tunnel without removing it from the list.</description>
- <required/>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>protocol</fieldname>
- <fielddescr>Protocol</fielddescr>
- <description>The protocol to be used for the VPN.</description>
- <required/>
- <type>select</type>
- <options>
- <option>
- <value>TCP</value>
- <name>TCP</name>
- </option>
- <option>
- <value>UDP</value>
- <name>UDP</name>
- </option>
- </options>
- <default_value>UDP</default_value>
- </field>
- <field>
- <fieldname>serveraddr</fieldname>
- <fielddescr>Server address</fielddescr>
- <description>This is the address OpenVPN will try to connect to in order to establish the tunnel. Set it to the remote endpoint's address.</description>
- <required/>
- <type>input</type>
- </field>
- <field>
- <fieldname>serverport</fieldname>
- <fielddescr>Server port</fielddescr>
- <description>The port OpenVPN will use to connect to the server. Most people would want to use 1194 here.</description>
- <required/>
- <type>input</type>
- <default_value>1194</default_value>
- <size>5</size>
- </field>
- <field>
- <fieldname>interface_ip</fieldname>
- <fielddescr>Interface IP</fielddescr>
- <description>This specifies the IPs to be assigned to the local interface. Expressed as a CIDR range. The first address in the range will be set to the remote endpoint of the interface, and the second will be assigned to the local endpoint. For TLS VPNs, the interface IPs are assigned by the server pool.</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>remote_network</fieldname>
- <fielddescr>Remote network</fielddescr>
- <description>This is the network that will be accessable from your endpoint. Expressed as a CIDR range. You may leave this blank if all you want is to access the VPN clients. You normally want this set to the remote endpoint's LAN network.</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>proxy_hostname</fieldname>
- <fielddescr>Proxy Host</fielddescr>
- <description>Proxy server hostname.</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>proxy_port</fieldname>
- <fielddescr>Proxy port</fielddescr>
- <description>The port OpenVPN will use on the proxy server.</description>
- <type>input</type>
- <default_value>3128</default_value>
- <size>5</size>
- </field>
- <field>
- <fieldname>crypto</fieldname>
- <fielddescr>Cryptography</fielddescr>
- <description>Here you can choose the cryptography algorithm to be used.</description>
- <required/>
- <type>select</type>
- <default_value>BF-CBC</default_value>
- </field>
- <field>
- <fieldname>auth_method</fieldname>
- <fielddescr>Authentication method</fielddescr>
- <description>The authentication method to be used.</description>
- <required/>
- <type>select</type>
- <options>
- <option>
- <value>shared_key</value>
- <name>Shared key</name>
- </option>
- <option>
- <value>pki</value>
- <name>PKI (Public Key Infrastructure)</name>
- </option>
- </options>
- <onchange>onAuthMethodChanged()</onchange>
- </field>
- <field>
- <fieldname>shared_key</fieldname>
- <fielddescr>Shared key</fielddescr>
- <description>Paste your shared key here.</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <rows>8</rows>
- <cols>40</cols>
- </field>
- <field>
- <fieldname>ca_cert</fieldname>
- <fielddescr>CA certificate</fielddescr>
- <description>Paste the server's CA certificate in X.509 format here.</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <rows>8</rows>
- <cols>40</cols>
- </field>
- <field>
- <fieldname>client_cert</fieldname>
- <fielddescr>Client certificate</fielddescr>
- <description>Paste your client certificate in X.509 format here.</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <rows>8</rows>
- <cols>40</cols>
- </field>
- <field>
- <fieldname>client_key</fieldname>
- <fielddescr>Client key</fielddescr>
- <description>Paste your client key in RSA format here.</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <rows>8</rows>
- <cols>40</cols>
- </field>
- <field>
- <fieldname>tls</fieldname>
- <fielddescr>TLS</fielddescr>
- <description>Paste your HMAC signature (TLS) here (optional).</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <rows>8</rows>
- <cols>40</cols>
- </field>
- <field>
- <fieldname>use_lzo</fieldname>
- <fielddescr>LZO compression</fielddescr>
- <description>Checking this will compress the packets using the LZO algorithm before sending them.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>use_shaper</fieldname>
- <fielddescr>Limit outgoing bandwidth</fielddescr>
- <description>Maximum outgoing bandwidth for this tunnel. Leave empty for no limit. The input value has to be something between 100 bytes/sec and 100 Mbytes/sec (entered as bytes per second).</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>use_dynamicport</fieldname>
- <fielddescr>Dynamic sourceport</fielddescr>
- <description>Checking this will let the openvpn client choose a dynamic sourceport for this connection.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>passtos</fieldname>
- <fielddescr>Pass Type-Of-Service</fielddescr>
- <description>Checking this will set the TOS field of the tunnel packet to what the payload's TOS is.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>infiniteresolvretry</fieldname>
- <fielddescr>Infinitely resolve server</fielddescr>
- <description>Infinitely retry to resolve the host name of the OpenVPN server. Useful for not permanently internet-connected machines.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>custom_options</fieldname>
- <fielddescr>Custom options</fielddescr>
- <description>You can put your own custom options here, separated by semi-colons (;). They'll be added to the client configuration.</description>
- <type>textarea</type>
- <cols>65</cols>
- <rows>5</rows>
- </field>
- <field>
- <fieldname>description</fieldname>
- <fielddescr>Description</fielddescr>
- <description>You may enter a description here. This is optional and is not parsed.</description>
- <type>input</type>
- </field>
- </fields>
- <custom_php_command_before_form>
- openvpn_get_ciphers(&amp;$pkg);
- </custom_php_command_before_form>
- <custom_php_after_head_command>
- openvpn_print_javascript('client');
- </custom_php_after_head_command>
- <custom_php_after_form_command>
- openvpn_print_javascript2();
- </custom_php_after_form_command>
- <custom_php_validation_command>
- openvpn_validate_input('client', $_POST, &amp;$input_errors);
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- openvpn_resync('client', $id);
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/ovpnenhance/openvpn_csc.xml_tls b/config/ovpnenhance/openvpn_csc.xml_tls
deleted file mode 100644
index 1025ad09..00000000
--- a/config/ovpnenhance/openvpn_csc.xml_tls
+++ /dev/null
@@ -1,169 +0,0 @@
-<packagegui>
- <name>openvpncsc</name>
- <title>OpenVPN: Client-specific configuration</title>
- <include_file>openvpn.inc</include_file>
- <delete_string>An OpenVPN client-specific configuration has been deleted.</delete_string>
- <addedit_string>An OpenVPN client-specific configuration has been created/modified.</addedit_string>
- <tabs>
- <tab>
- <text>Server</text>
- <url>/pkg.php?xml=openvpn.xml</url>
- </tab>
- <tab>
- <text>Client</text>
- <url>/pkg.php?xml=openvpn_cli.xml</url>
- </tab>
- <tab>
- <text>Client-specific configuration</text>
- <url>/pkg.php?xml=openvpn_csc.xml</url>
- <active/>
- </tab>
- </tabs>
- <adddeleteeditpagefields>
- <columnitem>
- <fieldname>disable</fieldname>
- <fielddescr>Disabled</fielddescr>
- <type>checkbox</type>
- </columnitem>
- <columnitem>
- <fieldname>commonname</fieldname>
- <fielddescr>Common name</fielddescr>
- </columnitem>
- <columnitem>
- <fieldname>description</fieldname>
- <fielddescr>Description</fielddescr>
- </columnitem>
- </adddeleteeditpagefields>
- <fields>
- <field>
- <fieldname>disable</fieldname>
- <fielddescr>Disabled</fielddescr>
- <description>Set this option to disable this client-specific configuration without removing it from the list.</description>
- <required/>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>commonname</fieldname>
- <fielddescr>Common name</fielddescr>
- <description>Enter the client's X.509 common name here.</description>
- <required/>
- <type>input</type>
- </field>
- <field>
- <fieldname>block</fieldname>
- <fielddescr>Blocked</fielddescr>
- <description>Check this to block (disable) this client, based on its common name. Don't use this option to disable a client due to key or password compromise. Use a CRL (certificate revocation list) instead.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>push_reset</fieldname>
- <fielddescr>Push reset</fielddescr>
- <description>Setting this option will make this client not inherit the global push options.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>ifconfig_push</fieldname>
- <fielddescr>Interface IP</fielddescr>
- <description>Set this option to push an IP to the client's interface. Expressed as a CIDR range (e.g. 10.5.0.0/16). The first IP in the range will be used as the remote IP of the interface, and the second IP will be used as the local IP of the interface.</description>
- <type>input</type>
- </field>
-
- <field>
- <fieldname>dhcp_domainname</fieldname>
- <fielddescr>DHCP-Opt.: DNS-Domainname</fielddescr>
- <description>Set connection-specific DNS Suffix.</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>dhcp_dns</fieldname>
- <fielddescr>DHCP-Opt.: DNS-Server</fielddescr>
- <description>Set domain name server addresses, separated by semi-colons (;).</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>dhcp_wins</fieldname>
- <fielddescr>DHCP-Opt.: WINS-Server</fielddescr>
- <description>Set WINS server addresses (NetBIOS over TCP/IP Name Server), separated by semi-colons (;).</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>dhcp_nbdd</fieldname>
- <fielddescr>DHCP-Opt.: NBDD-Server</fielddescr>
- <description>Set NBDD server addresses (NetBIOS over TCP/IP Datagram Distribution Server), separated by semi-colons (;).</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>dhcp_ntp</fieldname>
- <fielddescr>DHCP-Opt.: NTP-Server</fielddescr>
- <description>Set NTP server addresses (Network Time Protocol), separated by semi-colons (;).</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>dhcp_nbttype</fieldname>
- <fielddescr>DHCP-Opt.: NetBIOS node type</fielddescr>
- <description>Set NetBIOS over TCP/IP Node type. Possible options: b-node (broadcasts), p-node (point-to-point name queries to a WINS server), m-node (broadcast then query name server), and h-node (query name server, then broadcast).</description>
- <type>select</type>
- <options>
- <option>
- <value>0</value>
- <name>none</name>
- </option>
- <option>
- <value>1</value>
- <name>b-node</name>
- </option>
- <option>
- <value>2</value>
- <name>p-node</name>
- </option>
- <option>
- <value>4</value>
- <name>m-node</name>
- </option>
- <option>
- <value>8</value>
- <name>h-node</name>
- </option>
- </options>
- <default_value>0</default_value>
- </field>
- <field>
- <fieldname>dhcp_nbtscope</fieldname>
- <fielddescr>DHCP-Opt.: NetBIOS Scope</fielddescr>
- <description>Set NetBIOS over TCP/IP Scope. A NetBIOS Scope ID provides an extended naming service for NetBIOS over TCP/IP. The NetBIOS scope ID isolates NetBIOS traffic on a single network to only those nodes with the same NetBIOS scope ID.</description>
- <type>input</type>
- </field>
- <field>
- <fieldname>dhcp_nbtdisable</fieldname>
- <fielddescr>DHCP-Opt.: Disable NetBIOS</fielddescr>
- <description>If this option is set, Netbios-over-TCP/IP will be disabled.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>gwredir</fieldname>
- <fielddescr>Redirect Gateway</fielddescr>
- <description>Redirect ALL traffic through the OpenVPN server.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fieldname>custom_options</fieldname>
- <fielddescr>Custom options</fielddescr>
- <description>You can put your own custom options here, separated by semi-colons (;). They'll be added to the client-specific configuration.</description>
- <type>textarea</type>
- <cols>65</cols>
- <rows>5</rows>
- </field>
- <field>
- <fieldname>description</fieldname>
- <fielddescr>Description</fielddescr>
- <description>You may enter a description here for your reference (not parsed).</description>
- <type>input</type>
- </field>
- </fields>
- <custom_php_validation_command>
- openvpn_validate_input_csc($_POST, &amp;$input_errors);
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- openvpn_resync_csc($id);
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/ovpnenhance/ovpnenhance.inc b/config/ovpnenhance/ovpnenhance.inc
deleted file mode 100644
index a281180f..00000000
--- a/config/ovpnenhance/ovpnenhance.inc
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-
-function ovpnenhance_install() {
- global $g, $config;
-
-mwexec("mv /usr/local/pkg/openvpn.inc_tls /etc/inc/openvpn.inc");
-mwexec("ln -s /etc/inc/openvpn.inc /usr/local/pkg/openvpn.inc");
-mwexec("mv /usr/local/pkg/openvpn.xml_tls /usr/local/pkg/openvpn.xml");
-mwexec("mv /usr/local/pkg/openvpn_cli.xml_tls /usr/local/pkg/openvpn_cli.xml");
-mwexec("mv /usr/local/pkg/openvpn_csc.xml_tls /usr/local/pkg/openvpn_csc.xml");
-mwexec("rm /usr/local/pkg/ovpnenhance.inc");
-}
-
-?> \ No newline at end of file
diff --git a/config/ovpnenhance/ovpnenhance.xml b/config/ovpnenhance/ovpnenhance.xml
deleted file mode 100644
index e6e5ad9d..00000000
--- a/config/ovpnenhance/ovpnenhance.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <description>Enhance OpenVPN with TLS-auth and client/server-options</description>
- <requirements>pfSense 1.2.x</requirements>
- <faq>Enhances OpenVPN with TLS-auth and client/server-options. Cannot be uninstalled.</faq>
- <name>ovpnenhance</name>
- <version>0.1</version>
- <title>ovpnenhance</title>
- <include_file>/usr/local/pkg/ovpnenhance.inc</include_file>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>644</chmod>
- <item>https://packages.pfsense.org/packages/config/ovpnenhance/ovpnenhance.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>644</chmod>
- <item>https://packages.pfsense.org/packages/config/ovpnenhance/openvpn.inc_tls</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>644</chmod>
- <item>https://packages.pfsense.org/packages/config/ovpnenhance/openvpn.xml_tls</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>644</chmod>
- <item>https://packages.pfsense.org/packages/config/ovpnenhance/openvpn_cli.xml_tls</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>644</chmod>
- <item>https://packages.pfsense.org/packages/config/ovpnenhance/openvpn_csc.xml_tls</item>
- </additional_files_needed>
- <custom_php_install_command>
- ovpnenhance_install();
- </custom_php_install_command>
-</packagegui>
diff --git a/config/packetcapturefix/packetcapturefix.inc b/config/packetcapturefix/packetcapturefix.inc
deleted file mode 100644
index 8636c25c..00000000
--- a/config/packetcapturefix/packetcapturefix.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-function packetcapturefix_install() {
- global $g, $config;
-
- // Test to make sure the patch is not already applied.
- $out = `patch -fslC --reverse -p1 -b .before_packetcapturefix -d / -i /usr/local/pkg/packetcapturefix.patch |& grep -ci reject`;
- if ($out == 0) {
- // If the patch has not already been applied, test to see if it will apply cleanly.
- $out = `patch -fsNlC -p1 -b .before_packetcapturefix -d / -i /usr/local/pkg/packetcapturefix.patch |& grep -ci reject`;
- if ($out == 0) {
- // The patch should apply cleanly, let 'er rip.
- mwexec("patch -fsNl -p1 -b .before_packetcapturefix -d / -i /usr/local/pkg/packetcapturefix.patch ");
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/config/packetcapturefix/packetcapturefix.patch b/config/packetcapturefix/packetcapturefix.patch
deleted file mode 100644
index 992d0d61..00000000
--- a/config/packetcapturefix/packetcapturefix.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- diag_packet_capture.php.orig 2010-08-05 18:33:38.000000000 +0000
-+++ diag_packet_capture.php 2010-08-05 18:40:24.000000000 +0000
-@@ -266,6 +266,7 @@
- <?php
- system ("/usr/sbin/tcpdump $disabledns $detail -r $fp$fn");?>
- </textarea><?php
-+ conf_mount_ro();
- }
- }?>
- </td>
-@@ -277,8 +278,6 @@
- </td></tr></table>
- <?php
-
--conf_mount_ro();
--
- include("fend.inc");
-
- ?>
diff --git a/config/packetcapturefix/packetcapturefix.xml b/config/packetcapturefix/packetcapturefix.xml
deleted file mode 100644
index cea6f4d1..00000000
--- a/config/packetcapturefix/packetcapturefix.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- packetcapturefix.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Patch to fix packet capture on 1.2.3 Embedded (NanoBSD)</description>
- <requirements>pfSense 1.2.3</requirements>
- <faq>None</faq>
- <name>Packet Capture NanoBSD Fix</name>
- <version>0.2</version>
- <title>Packet Capture NanoBSD Fix</title>
- <include_file>/usr/local/pkg/packetcapturefix.inc</include_file>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/packetcapturefix/packetcapturefix.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/packetcapturefix/packetcapturefix.patch</item>
- </additional_files_needed>
- <custom_php_install_command>
- packetcapturefix_install();
- </custom_php_install_command>
-</packagegui>
diff --git a/config/per-user-bandwidth-distribution.xml b/config/per-user-bandwidth-distribution.xml
deleted file mode 100644
index 08728380..00000000
--- a/config/per-user-bandwidth-distribution.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>peruserbw</name>
- <version>1.0.2</version>
- <title>Services: Per User Bandwidth</title>
- <aftersaveredirect>pkg_edit.php?xml=per-user-bandwidth-distribution.xml&amp;id=0</aftersaveredirect>
- <menu>
- <name>PerUserBW</name>
- <tooltiptext>Enforce a fair use bandwidth policy</tooltiptext>
- <section>Services</section>
- <url>pkg_edit.php?xml=per-user-bandwidth-distribution.xml&amp;id=0</url>
- </menu>
- <service>
- <name>PerUserBW</name>
- <rcfile>per_user_bandwidth_distribution.sh</rcfile>
- </service>
- <fields>
- <field>
- <fielddescr>Incoming Bandwidth</fielddescr>
- <fieldname>incoming_bandwidth</fieldname>
- <description>Enter the bandwidth you would like to distribute fairly among the clients:</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Incoming Bandwidth Type</fielddescr>
- <fieldname>incoming_bandwidthtype</fieldname>
- <type>select</type>
- <options>
- <option>
- <name>Kbit/s</name>
- <value>Kbit/s</value>
- </option>
- <option>
- <name>Kbyte/s</name>
- <value>Kbyte/s</value>
- </option>
- <option>
- <name>Mbit/s</name>
- <value>Mbit/s</value>
- </option>
- </options>
- </field>
- <field>
- <fielddescr>Outgoing Bandwidth</fielddescr>
- <fieldname>outgoing_bandwidth</fieldname>
- <description>Enter the bandwidth you would like to distribute fairly among the clients:</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Outgoing Bandwidth Type</fielddescr>
- <fieldname>outgoing_bandwidthtype</fieldname>
- <type>select</type>
- <options>
- <option>
- <name>Kbit/s</name>
- <value>Kbit/s</value>
- </option>
- <option>
- <name>Kbyte/s</name>
- <value>Kbyte/s</value>
- </option>
- <option>
- <name>Mbit/s</name>
- <value>Mbit/s</value>
- </option>
- </options>
- </field>
- </fields>
- <custom_add_php_command>
- conf_mount_rw();
- $wanif = get_real_wan_interface();
- $fd = fopen("/usr/local/etc/rc.d/per_user_bandwidth_distribution.sh","w");
- fwrite($fd, "# This file was automatically generated by the pfSense\n");
- fwrite($fd, "# package manager system\n\n");
- fwrite($fd, "/sbin/kldload ipfw\n");
- fwrite($fd, "/sbin/kldload dummynet\n");
- fwrite($fd, "/sbin/ipfw delete 10\n");
- fwrite($fd, "/sbin/ipfw pipe 101 config mask src-ip 0x000000ff bw {$_POST['incoming_bandwidth']}{$_POST['incoming_bandwidthtype']}\n");
- fwrite($fd, "/sbin/ipfw pipe 102 config mask dst-ip 0x000000ff bw {$_POST['outgoing_bandwidth']}{$_POST['outgoing_bandwidthtype']}\n");
- fwrite($fd, "/sbin/ipfw add 10 pipe 102 ip from any to any out via {$wanif}\n");
- fwrite($fd, "/sbin/ipfw add 10 pipe 101 ip from any to any in via {$wanif}\n");
- fwrite($fd, "/sbin/ipfw add 10 allow all from any to any\n");
- fclose($fd);
- mwexec("chmod a+rx /usr/local/etc/rc.d/per_user_bandwidth_distribution.sh");
- mwexec_bg("/usr/local/etc/rc.d/per_user_bandwidth_distribution.sh");
- $config['system']['dummynetshaper'] = true;
- write_config();
- conf_mount_ro();
- </custom_add_php_command>
- <custom_php_deinstall_command>
- mwexec("/sbin/ipfw delete 10");
- mwexec("/sbin/kldunload dummynet");
- mwexec("/sbin/kldunload ipfw");
- conf_mount_rw();
- unlink_if_exists("/usr/local/etc/rc.d/per_user_bandwidth_distribution.sh");
- unset($config['system']['dummynetshaper']);
- write_config();
- conf_mount_ro();
- </custom_php_deinstall_command>
-</packagegui> \ No newline at end of file
diff --git a/config/pfflowd.xml b/config/pfflowd/pfflowd.xml
index 2470e2b2..2470e2b2 100644
--- a/config/pfflowd.xml
+++ b/config/pfflowd/pfflowd.xml
diff --git a/config/pfstat.php b/config/pfstat.php
deleted file mode 100644
index e0d25820..00000000
--- a/config/pfstat.php
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/local/bin/php
-<?php
-/*
- pkg.php
- Copyright (C) 2004 Scott Ullrich
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-
-function gentitle_pkg($pgname) {
- global $config;
- return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pgname;
-}
-
-$pgtitle = "Firewall: NAT: Port Forward";
-include("head.inc");
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php
-include("fbegin.inc");
-?>
-<p class="pgtitle"><?=$title?></p>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<?php
-if($config['installedpackages']['pfstat']['config'] <> "") {
- foreach($config['installedpackages']['pfstat']['config'] as $graph) {
- echo "<table BORDERCOLOR=\"#990000\" width=\"100%\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\">";
- echo "<tr bgcolor='#990000'><td><center><font color='white'>" . $graph['graphname'] . "</td></tr>\n";
- echo "<td><center><table width=\"100%\"><tr><td width='100%'>";
- echo "<center><br><a href=\"/pfstat/" . $graph['imagename'] . "\"><img border=\"0\" width=\"500\" \"height\" src='/pfstat/" . $graph['imagename'] . "'></a>";
- echo "</td></tr>";
- echo "<tr bgcolor='#990000'><td><center><font color='white'>" . $graph['description'] . "</td></tr>";
- echo "</table>\n";
- echo "</td></tr>\n";
- echo "</table>&nbsp;<br>";
- }
-} else {
-
-echo "<center>There are currently no graphs defined.";
-
-}
-?>
-
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/pfstat.xml b/config/pfstat.xml
deleted file mode 100644
index eb07f732..00000000
--- a/config/pfstat.xml
+++ /dev/null
@@ -1,324 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>pfstat</name>
- <version>1.7</version>
- <title>Services: PFStat Settings</title>
- <!-- Menu is where this packages menu will appear -->
- <menu>
- <name>PFStat Settings</name>
- <tooltiptext>pfstat is a small utility that collects packet filter statistics and produces graphs.</tooltiptext>
- <section>Services</section>
- <configfile>pfstat.xml</configfile>
- </menu>
- <menu>
- <name>PFStat Graphs</name>
- <tooltiptext>pfstat is a small utility that collects packet filter statistics and produces graphs.</tooltiptext>
- <section>Status</section>
- <url>/pfstat.php</url>
- </menu>
- <modify_system>
- <modifyitem>
- <modifyfilename>/etc/crontab</modifyfilename>
- <textneeded>
-*/5 * * * * root nice -n 20 /usr/local/bin/pfstat -q >> /var/log/pfstat
- </textneeded>
- </modifyitem>
- <modifyitem>
- <modifyfilename>/etc/crontab</modifyfilename>
- <textneeded>
-*/10 * * * * root nice -n 20 /usr/local/bin/pfstat -c /usr/local/etc/pfstat.conf -d /var/log/pfstat
- </textneeded>
- </modifyitem>
- <modifyitem>
- <modifyfilename>/etc/crontab</modifyfilename>
- <textneeded>
-1 1 * * 1 root nice -n 20 tail -n 50000 /var/log/pfstat >/tmp/pfstat &amp;&amp; mv /tmp/pfstat /var/log/pfstat
- </textneeded>
- </modifyitem>
- </modify_system>
- <!-- configpath gets expanded out automatically and config items will be
- stored in that location -->
- <configpath>['installedpackages']['pfstat']['config']</configpath>
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Graph Name</fielddescr>
- <fieldname>graphname</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
-
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/pfstat.php</item>
- </additional_files_needed>
- <!-- modify system will modify a file and make sure the text needed to run the
- package is in place. The following example edits /etc/crontab and adds the
- code necessart to invoke the pfstat command every 5 minutes. -->
- <!-- adddeleteeditpagefields items will appear on the first page where you can add / delete or edit
- items. An example of this would be the nat page where you add new nat redirects -->
- <!-- fields gets invoked when the user adds or edits a item. the following items
- will be parsed and rendered for the user as a gui with input, and selectboxes. -->
- <fields>
- <field>
- <fielddescr>Graph Name</fielddescr>
- <fieldname>graphname</fieldname>
- <description>Enter the name of the graph here</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Graph Description</fielddescr>
- <fieldname>description</fieldname>
- <description>Enter the description of the graph here</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Image Name</fielddescr>
- <fieldname>imagename</fieldname>
- <description>Enter the filename for this image. Must end in .jpg. ex. filename.jpg</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Graph Size Width</fielddescr>
- <fieldname>graphsizewidth</fieldname>
- <description>Graph width in pixels. Recommend 960 for large images, 320 for small images.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Graph Size Height</fielddescr>
- <fieldname>graphsizeheight</fieldname>
- <description>Graph height in pixels. Recommend 300 for large images, 200 for small images.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Update interval</fielddescr>
- <fieldname>from</fieldname>
- <description></description>
- <type>input</type>
- <size>1</size>
- <value>1</value>
- <combinefieldsbegin>true</combinefieldsbegin>
- </field>
- <field>
- <fielddescr>Update interval duration</fielddescr>
- <fieldname>fromclassification</fieldname>
- <description></description>
- <type>select</type>
- <options>
- <option><name>Minutes</name><value>minutes</value></option>
- <option><name>Hours</name><value>hours</value></option>
- <option><name>Days</name><value>days</value></option>
- <option><name>Weeks</name><value>weeks</value></option>
- <option><name>Months</name><value>months</value></option>
- </options>
- <combinefieldsend>true</combinefieldsend>
- <dontdisplayname>true</dontdisplayname>
- <dontcombinecells>true</dontcombinecells>
- </field>
- <field>
- <fielddescr>none</fielddescr>
- <fieldname>none</fieldname>
- <type>rowhelper</type>
- <rowhelper>
- <rowhelperfield>
- <fielddescr>Location</fielddescr>
- <fieldname>location</fieldname>
- <description>Location of graph</description>
- <type>select</type>
- <options>
- <option><name>Left</name><value>left</value></option>
- <option><name>Right</name><value>right</value></option>
- </options>
- </rowhelperfield>
- <rowhelperfield>
- <fielddescr>Graph Source</fielddescr>
- <fieldname>counters</fieldname>
- <description></description>
- <type>select</type>
- <options>
- <option><name>Bytes in (IPv4)</name><value>bytes_v4_in</value></option>
- <option><name>Bytes out (IPv4)</name><value>bytes_v4_out</value></option>
- <option><name>Bytes in (IPv6)</name><value>bytes_v6_in</value></option>
- <option><name>Bytes out (IPv6)</name><value>bytes_v6_out</value></option>
- <option><name>Packets in passed (IPv4)</name><value>packets_v4_in_pass</value></option>
- <option><name>Packets in dropped (IPv4)</name><value>packets_v4_in_drop</value></option>
- <option><name>Packets out passed (IPv4)</name><value>packets_v4_out_pass</value></option>
- <option><name>Packets out dropped (IPv4)</name><value>packets_v4_out_drop</value></option>
- <option><name>Packets in passed (IPv6)</name><value>packets_v6_in_pass</value></option>
- <option><name>Packets in dropped (IPv6)</name><value>packets_v6_in_drop</value></option>
- <option><name>Packets out passed (IPv6)</name><value>packets_v6_out_pass</value></option>
- <option><name>Packets out dropped (IPv6)</name><value>packets_v6_out_drop</value></option>
- <option><name>State table entries</name><value>states_entries</value></option>
- <option><name>State searches</name><value>states_searches</value></option>
- <option><name>State Table Insertions</name><value>states_inserts</value></option>
- <option><name>State Table Removals</name><value>states_removals</value></option>
- <option><name>Match Counter</name><value>counters_match</value></option>
- <option><name>Bad Offset Counter</name><value>counters_badoffset</value></option>
- <option><name>Fragment Counter</name><value>counters_fragment</value></option>
- <option><name>Short Counter</name><value>counters_short</value></option>
- <option><name>Normalize Counter</name><value>counters_normalize</value></option>
- <option><name>Memory Counter</name><value>counters_memory</value></option>
- </options>
- </rowhelperfield>
- <rowhelperfield>
- <fielddescr>Color</fielddescr>
- <fieldname>color</fieldname>
- <description>Color of graph</description>
- <type>select</type>
- <options>
- <option><name>Light Hard Azure</name><value>51 153 255</value></option>
- <option><name>Light Faded Blue</name><value>102 102 255</value></option>
- <option><name>Blue</name><value>0 0 255</value></option>
- <option><name>Dark Dull Red</name><value>153 51 51</value></option>
- <option><name>Pale Weak Red</name><value>255 204 204</value></option>
- <option><name>Red</name><value>255 204 204</value></option>
- <option><name>Pale Weak Red</name><value>255 0 0</value></option>
- <option><name>Light Hard Pink</name><value>255 51 153</value></option>
- <option><name>Dark Dull Pink</name><value>153 51 102</value></option>
- <option><name>Light Faded Red</name><value>255 102 102</value></option>
- <option><name>Pale Weak Green</name><value>204 255 204</value></option>
- <option><name>Green</name><value>0 255 0</value></option>
- <option><name>Pale Weak Yellow</name><value>255 255 204</value></option>
- <option><name>Yellow</name><value>125 125 0</value></option>
- <option><name>Purple</name><value>72 00 190</value></option>
- <option><name>Pale Weak Magenta</name><value>255 204 255</value></option>
- <option><name>Pale Weak Cyan</name><value>204 255 255</value></option>
- <option><name>Cyan</name><value>00 120 120</value></option>
- <option><name>Dark Dull Cyan</name><value>51 153 153</value></option>
- <option><name>Orange</name><value>255 255 0</value></option>
- <option><name>Dark Dull Orange</name><value>153 102 51</value></option>
- <option><name>Pale Dull Orange</name><value>255 204 153</value></option>
- <option><name>Grey</name><value>125 125 125</value></option>
- <option><name>Pale Gray</name><value>204 204 204</value></option>
- <option><name>Black</name><value>0 0 0</value></option>
- </options>
- </rowhelperfield>
- <rowhelperfield>
- <fielddescr>Appearance</fielddescr>
- <fieldname>appearance</fieldname>
- <description>Appearance type</description>
- <type>select</type>
- <options>
- <option><name>Filled</name><value>filled</value></option>
- <option><name>Unfilled</name><value></value></option>
- </options>
- </rowhelperfield>
- </rowhelper>
- </field>
- </fields>
- <custom_php_global_functions>
- function sync_package_pfstat() {
- conf_mount_rw();
- config_lock();
- global $config;
- $fout = fopen("/usr/local/etc/pfstat.conf","w");
- if($config['installedpackages']['pfstat']['config'] != "") {
- foreach($config['installedpackages']['pfstat']['config'] as $rowhelper) {
- $leftgraphtext = "";
- $rightgraphtext = "";
- $isfirstleft = 0;
- $isfirstright = 0;
- $fromclassification = $rowhelper['fromclassification'];
- $imagename = $rowhelper['imagename'];
- $pos = strrpos($imagename, ".jpg");
- if ($pos === false) {
- $imagename .= ".jpg";
- }
- $from = $rowhelper['from'];
- $graphsizewidth = $rowhelper['graphsizewidth'];
- $graphsizeheight = $rowhelper['graphsizeheight'];
- foreach($rowhelper['row'] as $row) {
- if($row['location'] == "left") {
- if($isfirstleft == 1) $leftgraphtext .= ",\n";
- $leftgraphtext .= "graph " . $row['counters'] . " label \"" . $row['counters'] . "\" color " . $row['color'] . " " . $row['appearance'];
- $isfirstleft = 1;
- } else {
- if($isfirstright == 1) $rightgraphtext .= ",\n";
- $rightgraphtext .= "graph " . $row['counters'] . " label \"" . $row['counters'] . "\" color " . $row['color'] . " " . $row['appearance'];
- $isfirstright = 1;
- }
- }
- fwrite($fout, "image \"/usr/local/www/pfstat/" . $imagename ."\" { \n");
- if($from == "") $from = "30";
- fwrite($fout, "from " . $from . " " . $fromclassification . " to now \n");
- fwrite($fout, "width " . $graphsizewidth . " height " . $graphsizeheight . " \n");
- if($leftgraphtext != "") {
- fwrite($fout, " left \n");
- fwrite($fout, " " . $leftgraphtext . "\n");
- }
- if($rightgraphtext != "") {
- fwrite($fout, " right \n");
- fwrite($fout, " " . $rightgraphtext . "\n");
- }
- fwrite($fout, "}\n\n");
- }
- }
- fclose($fout);
- conf_mount_ro();
- config_unlock();
- }
- </custom_php_global_functions>
- <custom_php_command_before_form>
- sync_package_pfstat();
- </custom_php_command_before_form>
- <custom_php_resync_config_command>
- sync_package_pfstat();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- make_dirs("/usr/local/www/pfstat");
- system("/usr/bin/killall cron 2>/dev/null");
- system("/usr/sbin/cron 2>/dev/null");
- </custom_php_install_command>
- <custom_php_deinstall_command>
- unlink_if_exists("/usr/local/etc/pfstat");
- rmdir_recursive("/usr/local/www/pfstat");
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/postfix.xml b/config/postfix.xml
deleted file mode 100644
index 65b4d11f..00000000
--- a/config/postfix.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>postfix</name>
- <version>1.1.12_1</version>
- <title>Services: Postfix Forwarder</title>
- <savetext>Change</savetext>
- <preoutput>yes</preoutput>
- <aftersaveredirect>pkg_edit.php?xml=postfix.xml&amp;id=1</aftersaveredirect>
- <menu>
- <name>Postfix Forwarder</name>
- <tooltiptext>Configure Postfix Forwarder</tooltiptext>
- <section>Services</section>
- <url>pkg_edit.php?xml=postfix.xml&amp;id=1</url>
- </menu>
- <fields>
- <field>
- <fielddescr>Primary Domain</fielddescr>
- <fieldname>primarydomain</fieldname>
- <description>Enter your primary domain. (ex: example.com)</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>My Hostname</fielddescr>
- <fieldname>hostname</fieldname>
- <description>Enter the hostname of this system to be used by Postfix. (ex: mail.example.com)</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>none</fielddescr>
- <fieldname>none</fieldname>
- <type>rowhelper</type>
- <rowhelper>
- <rowhelperfield>
- <fielddescr>Domain</fielddescr>
- <fieldname>domain</fieldname>
- <description>Enter the domain here (ex: example.com)</description>
- <type>input</type>
- <size>20</size>
- </rowhelperfield>
- <rowhelperfield>
- <fielddescr>Mail Server IP</fielddescr>
- <fieldname>mailserverip</fieldname>
- <description>Enter the mail server IP to forward to here.</description>
- <type>input</type>
- <size>20</size>
- </rowhelperfield>
- </rowhelper>
- </field>
- </fields>
- <custom_add_php_command>
- </custom_add_php_command>
- <start_command>/usr/local/sbin/postfix start</start_command>
- <restart_command>/usr/local/sbin/postmap /usr/local/etc/postfix/transport ; /usr/local/sbin/postfix reload</restart_command>
- <custom_php_install_command>
- </custom_php_install_command>
- <custom_php_deinstall_command>
- </custom_php_deinstall_command>
- <templates>
- <template>
- <filename>/usr/local/etc/postfix/main.cf</filename>
- <templatecontents>
-myhostname = hostname_fieldvalue \n
-mydomain = primarydomain_fieldvalue \n
-relay_domains = domain_fieldvalue[ ] \n
- </templatecontents>
- </template>
- <template>
- <filename>/usr/local/etc/postfix/transport</filename>
- <templatecontents>domain_fieldvalue smtp:[mailserverip_fieldvalue]\n</templatecontents>
- </template>
- </templates>
-</packagegui>
diff --git a/config/pre2upgrade/pre2upgrade.php b/config/pre2upgrade/pre2upgrade.php
deleted file mode 100644
index c9112850..00000000
--- a/config/pre2upgrade/pre2upgrade.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-/*
- pre2upgrade.php
- Copyright (C) 2011 Jim Pingle
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require_once("config.inc");
-require_once("guiconfig.inc");
-
-$pgtitle = "Diagnostics: Pre 2.0 Upgrade Check";
-include("head.inc");
-
-exec("/usr/local/bin/xmllint /conf/config.xml 2>&1", $out, $err);
-
-if ($err) {
- $out = implode("\n", $out);
-} else {
- $out = "OK";
-}
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php
-include("fbegin.inc");
-?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr><td>
-<div id="mainarea">
-<table class="tabcont" colspan="3" cellpadding="3" width="100%">
-<tr><td>
-This configuration check will report any invalid XML. The most common cause of this is international/special characters inside of your configuration in places where they are not supported. You must remove these characters from your configuration before proceeding with the upgrade, or else you <b>will</b> have problems, as your config.xml is not well-formed. Once you have upgraded to 2.0 you can put the characters back in descriptions, as they are properly supported in the new format.
-<br/><br/>
-Config check output:
-<font size="2">
-<pre>
-<?php echo htmlspecialchars($out); ?>
-</pre>
-</font>
-<?php if ($err): ?>
-<font color="red"><b>Please fix the errors found above.</b></font><br/>It may help to view a <a href="/diag_backup.php">config.xml backup file</a> to see where the characters are exactly.
-<?php endif; ?>
-<br/><br/>
-Before proceeding with the upgrade, you should look over the upgrade guide on the doc wiki, which can be found here:<br/>
-<a href="https://doc.pfsense.org/index.php/Upgrade_Guide">https://doc.pfsense.org/index.php/Upgrade_Guide</a>.
-</td></tr>
-</table>
-</div>
-</td></tr>
-</table>
-
-<?php include("fend.inc"); ?>
-</body>
-</html> \ No newline at end of file
diff --git a/config/pre2upgrade/pre2upgrade.xml b/config/pre2upgrade/pre2upgrade.xml
deleted file mode 100644
index a0a26956..00000000
--- a/config/pre2upgrade/pre2upgrade.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- pre2upgrade.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2011 Jim Pingle
- All rights reserved. */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE. */
-/* ========================================================================== */
- ]]>
- </copyright>
- <name>pre2upgrade</name>
- <version>1.0</version>
- <title>Diagnostics: Pre-2.0 Upgrade Check</title>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <item>https://packages.pfsense.org/packages/config/pre2upgrade/pre2upgrade.php</item>
- </additional_files_needed>
- <menu>
- <name>Pre-Upgrade Check</name>
- <tooltiptext>Check your system for potential 2.0 upgrade issues.</tooltiptext>
- <section>Diagnostics</section>
- <url>/pre2upgrade.php</url>
- </menu>
- <custom_php_deinstall_command>
- <![CDATA[
- exec("rm /usr/local/www/pre2upgrade.php");
- ]]>
- </custom_php_deinstall_command>
-</packagegui> \ No newline at end of file
diff --git a/config/pubkey.xml b/config/pubkey.xml
deleted file mode 100644
index cab2cbb4..00000000
--- a/config/pubkey.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- pubkey.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2008 Scott Ullrich
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Updates the pfSense release security certificate</description>
- <name>pubkey</name>
- <version>0.1</version>
- <title>pubkey</title>
- <custom_php_install_command>
- $fd = fopen("/etc/pubkey.pem","w");
- fwrite($fd, "ssh-dss AAAAB3NzaC1kc3MAAACBAN08c22jym3KCRUF8/rKNXgU/J0vv6UC9eCta/ATTNgeW/z2rp/HsjcPkMLx9dLaqufShC0VzsUbGlqCsdQT8jfwBiLG2pjUkX20qTStRG/rs9Tv0rS/8eVNT/DbQ6zL3PTdp+XAIq+KQLucqcBazTqSzyF7ghZ7OVmsX1/ixTP3AAAAFQCYcP378X/dQ08l6u8O5uvEtxbvEwAAAIEAyOOuWttXGrprzBhKrjhop58bZTOZp0J0IMHMwi/J+K3HUuPZnaltGoW21MjqSvVor4m22r/3b8aUIom+jp4I/bmpxTOUgO6owTlCVX614fGPWcCw2M017aghQ/vUa/92DaMLO//FYD8X2b7WgyPNrJh9ckZ14oncBleJUfXmue8AAACBAKw00/IkoMJzTumFfT9+Jb442O1KZvtGyj1YWpyYXf3xbQFGXND7m4rTIS2zPvTcOauCHbZwZ9uBxE4zTdlGJ4XirPEbWwOl1TU71bZ3OqonVesyqSC04LLiuLGlIHyXxyc/UCzg1UL8mCBlLzqmPUkJoL0ZINo8Raqip8WM63KM root@freebsd-nexus-computers.pfsense.org");
- fclose($fd);
- </custom_php_install_command>
- <custom_php_deinstall_command>
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/pure-ftpd.xml b/config/pure-ftpd/pure-ftpd.xml
index 4bace5cf..e5dcc79f 100644
--- a/config/pure-ftpd.xml
+++ b/config/pure-ftpd/pure-ftpd.xml
@@ -78,7 +78,7 @@
</adddeleteeditpagefields>
<additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/pure-ftpdsettings.xml</item>
+ <item>https://packages.pfsense.org/packages/config/pure-ftpd/pure-ftpdsettings.xml</item>
</additional_files_needed>
<!-- fields gets invoked when the user adds or edits a item. the following items
diff --git a/config/pure-ftpdsettings.xml b/config/pure-ftpd/pure-ftpdsettings.xml
index f904545c..f904545c 100644
--- a/config/pure-ftpdsettings.xml
+++ b/config/pure-ftpd/pure-ftpdsettings.xml
diff --git a/config/rate/bandwidth_by_ip.php b/config/rate/bandwidth_by_ip.php
deleted file mode 100644
index 8d9a9246..00000000
--- a/config/rate/bandwidth_by_ip.php
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- *
- *
- *
- *
- *
- */
-
-require_once('guiconfig.inc');
-require_once('interfaces.inc');
-require_once('pfsense-utils.inc');
-require_once('util.inc');
-
-$listedIPs = "";
-
-//get interface IP and break up into an array
-$interface = $_GET['if'];
-$real_interface = convert_friendly_interface_to_real_interface_name($interface);
-$intip = find_interface_ip($real_interface);
-$intip = explode (".", $intip);
-
-//use class A subnet to make sure we capture all traffic on specified interface
-$intsubnet = $intip[0] . ".0.0.0/8";
-
-exec("rate -i {$real_interface} -nlq 1 -A -c {$intsubnet}", $listedIPs);
-
-unset($bandwidthinfo);
-unset($receivebytesarray);
-unset($transmitbytesarray);
-
-$someinfo = false;
-for ($x=2; $x<12; $x++){
-
- $bandwidthinfo = $listedIPs[$x];
-
- // echo $bandwidthinfo;
- $emptyinfocounter = 1;
- if ($bandwidthinfo != "") {
- $splitinfo = explode ("|",$bandwidthinfo);
- $receivebytesarray = explode(" ",$splitinfo[0]);
- //print IP of host;
- echo $receivebytesarray[0] . ";";
-
- //skip empty array elements until first element found with data
- while ($receivebytesarray[$emptyinfocounter] == "")
- {
- $emptyinfocounter++;
- }
- //print received bytes for host
- echo $receivebytesarray[$emptyinfocounter] . ";";
-
- $transmitbytesarray = explode(" ",$splitinfo[1]);
-
- $emptyinfocounter = 1;
-
- //skip empty array elements until first element found with data
- while ($transmitbytesarray[$emptyinfocounter] == "")
- {
- $emptyinfocounter++;
- }
- //print transmitted bytes for host
- echo $transmitbytesarray[$emptyinfocounter] . "|";
-
- //mark that we collected information
- $someinfo = true;
- }
-}
-
-
-//no bandwidth usage found
-if ($someinfo == false)
- echo "no info";
-
-?>
diff --git a/config/rate/rate.inc b/config/rate/rate.inc
deleted file mode 100644
index 34d394ab..00000000
--- a/config/rate/rate.inc
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-function rate_install() {
- global $g, $config;
- conf_mount_rw();
- /* Copy files for backup. */
- mwexec("cp /usr/local/www/status_graph.php /usr/local/www/status_graph.php.orig");
- unlink_if_exists("/usr/local/www/status_graph.php");
- mwexec("cp /usr/local/pkg/bandwidth_by_ip.php /usr/local/www/bandwidth_by_ip.php");
- mwexec("cp /usr/local/pkg/status_graph.php /usr/local/www/status_graph.php");
-
- rate_assign_privs();
- /* Clear the APC cache so that the updates to installed files will work. */
- apc_clear_cache();
- conf_mount_ro();
-}
-
-function rate_deinstall() {
- conf_mount_rw();
- unlink_if_exists("/usr/local/www/status_graph.php");
- unlink_if_exists("/usr/local/www/bandwidth_by_ip.php");
- mwexec("cp /usr/local/www/status_graph.php.orig /usr/local/www/status_graph.php");
- conf_mount_ro();
-}
-
-function rate_assign_privs() {
- conf_mount_rw();
- /* Fix permissions on replaced files */
- mwexec("chown root:wheel /usr/local/www/bandwidth_by_ip.php");
- mwexec("chown root:wheel /usr/local/www/status_graph.php");
- conf_mount_ro();
-}
-
-?> \ No newline at end of file
diff --git a/config/rate/rate.xml b/config/rate/rate.xml
deleted file mode 100644
index a4aa4739..00000000
--- a/config/rate/rate.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- rate.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Per-IP Realtime Bandwidth Rate Monitor</description>
- <requirements>FreeBSD rate-0.9 package</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>rate</name>
- <version>0.9</version>
- <title>Rate</title>
- <include_file>/usr/local/pkg/rate.inc</include_file>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/rate/rate.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/rate/bandwidth_by_ip.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/rate/status_graph.php</item>
- </additional_files_needed>
- <custom_php_install_command>
- rate_install();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- rate_deinstall();
- </custom_php_deinstall_command>
-</packagegui> \ No newline at end of file
diff --git a/config/rate/status_graph.php b/config/rate/status_graph.php
deleted file mode 100644
index a5c8cbcd..00000000
--- a/config/rate/status_graph.php
+++ /dev/null
@@ -1,291 +0,0 @@
-<?php
-/* $Id$ */
-/*
- status_graph.php
- Part of pfSense
- Copyright (C) 2004 Scott Ullrich
- All rights reserved.
-
- Originally part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-##|+PRIV
-##|*IDENT=page-status-trafficgraph
-##|*NAME=Status: Traffic Graph page
-##|*DESCR=Allow access to the 'Status: Traffic Graph' page.
-##|*MATCH=status_graph.php*
-##|-PRIV
-
-
-
-require("guiconfig.inc");
-
-if ($_POST['width'])
- $width = $_POST['width'];
-else
- $width = "100%";
-
-if ($_POST['height'])
- $height = $_POST['height'];
-else
- $height = "200";
-
-
-if ($_GET['if'])
- $curif = $_GET['if'];
-else
- $curif = "wan";
-
-$pgtitle = array("Status","Traffic Graph");
-
-include("head.inc");
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-
-<script src="/javascript/scriptaculous/prototype.js" type="text/javascript"></script>
-<script src="/javascript/scriptaculous/scriptaculous.js" type="text/javascript"></script>
-<script language="javascript" type="text/javascript">
-
-function updateBandwidth(){
- var hostinterface = "<?php echo $curif; ?>";
- bandwidthAjax(hostinterface);
-}
-
-function bandwidthAjax(hostinterface) {
- uri = "bandwidth_by_ip.php?if=" + hostinterface;
- var opt = {
- // Use GET
- method: 'get',
- asynchronous: true,
- // Handle 404
- on404: function(t) {
- alert('Error 404: location "' + t.statusText + '" was not found.');
- },
- // Handle other errors
- onFailure: function(t) {
- alert('Error ' + t.status + ' -- ' + t.statusText);
- },
- onSuccess: function(t) {
- updateBandwidthHosts(t.responseText);
- }
- }
- new Ajax.Request(uri, opt);
-}
-
-function updateBandwidthHosts(data){
- var hosts_split = data.split("|");
- d = document;
- //parse top ten bandwidth abuser hosts
- for (var y=0; y<10; y++){
- if (hosts_split[y] != "" && hosts_split[y] != "no info"){
- if (hosts_split[y]) {
- hostinfo = hosts_split[y].split(";");
-
- //update host ip info
- var HostIpID = "hostip" + y;
- var hostip = d.getElementById(HostIpID);
- hostip.innerHTML = hostinfo[0];
-
- //update bandwidth inbound to host
- var hostbandwidthInID = "bandwidthin" + y;
- var hostbandwidthin = d.getElementById(hostbandwidthInID);
- hostbandwidthin.innerHTML = hostinfo[1] + " Bytes/sec";
-
- //update bandwidth outbound from host
- var hostbandwidthOutID = "bandwidthout" + y;
- var hostbandwidthOut = d.getElementById(hostbandwidthOutID);
- hostbandwidthOut.innerHTML = hostinfo[2] + " Bytes/sec";
-
- //make the row appear if hidden
- var rowid = "host" + y;
- textlink = d.getElementById(rowid);
- if (textlink.style.display == "none"){
- //hide rows that contain no data
- Effect.Appear(rowid, {duration:1});
- }
- }
- }
- else
- {
- var rowid = "host" + y;
- textlink = d.getElementById(rowid);
- if (textlink.style.display != "none"){
- //hide rows that contain no data
- Effect.Fade(rowid, {duration:2});
- }
- }
- }
-
- setTimeout('updateBandwidth()', 3000);
-}
-
-
-</script>
-
-<?php include("fbegin.inc"); ?>
-<?php
-$ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
-
-for($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- if(isset($config['interfaces']['opt' . $j]['enable']))
- $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
-}
-if((isset($config['ipsec']['enable'])) || (isset($config['ipsec']['mobileclients']['enable']))) {
- $ifdescrs['ipsec'] = "IPSEC";
-}
-
-/* link the ipsec interface magically */
-if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))
- $ifdescrs['enc0'] = "IPsec";
-
-?>
-<form name="form1" action="status_graph.php" method="get" style="padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid #999999">
-Interface:
-<select name="if" class="formselect" style="z-index: -10;" onchange="document.form1.submit()">
-<?php
-foreach ($ifdescrs as $ifn => $ifd) {
- echo "<option value=\"$ifn\"";
- if ($ifn == $curif) echo " selected";
- echo ">" . htmlspecialchars($ifd) . "</option>\n";
-}
-?>
-</select>
-</form>
-<p><span class="red"><strong>Note:</strong></span> the <a href="http://www.adobe.com/svg/viewer/install/" target="_blank">Adobe SVG Viewer</a>, Firefox 1.5 or later or other browser supporting SVG is required to view the graph.
-<p><form method="post" action="status_graph.php">
-</form>
-<p>
-<div>
- <div class="widgetdiv" style="padding: 5px; float:left; width:46%">
- <object data="graph.php?ifnum=<?=$curif;?>&amp;ifname=<?=rawurlencode($ifdescrs[$curif]);?>" type="image/svg+xml" width="<?=$width;?>" height="<?=$height;?>">
- <param name="src" value="graph.php?ifnum=<?=$curif;?>&amp;ifname=<?=rawurlencode($ifdescrs[$curif]);?>" />
- Your browser does not support the type SVG! You need to either use Firefox or download the Adobe SVG plugin.
- </object>
- </div>
- <div class="widgetdiv" style="padding: 5px; float:right; width:48%">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td class="listtopic" valign="top">Host IP</td>
- <td class="listtopic" valign="top">Bandwidth In</td>
- <td class="listtopic" valign="top">Bandwidth Out</td>
- </tr>
- <tr id="host0" style="display:none">
- <td id="hostip0" class="vncell">
- </td>
- <td id="bandwidthin0" class="listr">
- </td>
- <td id="bandwidthout0" class="listr">
- </td>
- </tr>
- <tr id="host1" style="display:none">
- <td id="hostip1" class="vncell">
- </td>
- <td id="bandwidthin1" class="listr">
- </td>
- <td id="bandwidthout1" class="listr">
- </td>
- </tr>
- <tr id="host2" style="display:none">
- <td id="hostip2" class="vncell">
- </td>
- <td id="bandwidthin2" class="listr">
- </td>
- <td id="bandwidthout2" class="listr">
- </td>
- </tr>
- <tr id="host3" style="display:none">
- <td id="hostip3" class="vncell">
- </td>
- <td id="bandwidthin3" class="listr">
- </td>
- <td id="bandwidthout3" class="listr">
- </td>
- </tr>
- <tr id="host4" style="display:none">
- <td id="hostip4" class="vncell">
- </td>
- <td id="bandwidthin4" class="listr">
- </td>
- <td id="bandwidthout4" class="listr">
- </td>
- </tr>
- <tr id="host5" style="display:none">
- <td id="hostip5" class="vncell">
- </td>
- <td id="bandwidthin5" class="listr">
- </td>
- <td id="bandwidthout5" class="listr">
- </td>
- </tr>
- <tr id="host6" style="display:none">
- <td id="hostip6" class="vncell">
- </td>
- <td id="bandwidthin6" class="listr">
- </td>
- <td id="bandwidthout6" class="listr">
- </td>
- </tr>
- <tr id="host7" style="display:none">
- <td id="hostip7" class="vncell">
- </td>
- <td id="bandwidthin7" class="listr">
- </td>
- <td id="bandwidthout7" class="listr">
- </td>
- </tr>
- <tr id="host8" style="display:none">
- <td id="hostip8" class="vncell">
- </td>
- <td id="bandwidthin8" class="listr">
- </td>
- <td id="bandwidthout8" class="listr">
- </td>
- </tr>
- <tr id="host9" style="display:none">
- <td id="hostip9" class="vncell">
- </td>
- <td id="bandwidthin9" class="listr">
- </td>
- <td id="bandwidthout9" class="listr">
- </td>
- </tr>
- </table>
- </div>
-</div>
-
-<?php include("fend.inc"); ?>
-
-<script type="text/javascript">
-window.onload = function(in_event)
- {
- updateBandwidth();
- }
-
-</script>
-</body>
-</html>
diff --git a/config/siproxd.inc b/config/siproxd/siproxd.inc
index d76f79d3..d76f79d3 100644
--- a/config/siproxd.inc
+++ b/config/siproxd/siproxd.inc
diff --git a/config/siproxd.xml b/config/siproxd/siproxd.xml
index dd833629..8b1b5856 100644
--- a/config/siproxd.xml
+++ b/config/siproxd/siproxd.xml
@@ -70,17 +70,17 @@
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
<chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/siproxdusers.xml</item>
+ <item>https://packages.pfsense.org/packages/config/siproxd/siproxdusers.xml</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
<chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/siproxd.inc</item>
+ <item>https://packages.pfsense.org/packages/config/siproxd/siproxd.inc</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
<chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/siproxd_registered_phones.php</item>
+ <item>https://packages.pfsense.org/packages/config/siproxd/siproxd_registered_phones.php</item>
</additional_files_needed>
<fields>
<field>
diff --git a/config/siproxd_registered_phones.php b/config/siproxd/siproxd_registered_phones.php
index a8789d7f..a8789d7f 100644
--- a/config/siproxd_registered_phones.php
+++ b/config/siproxd/siproxd_registered_phones.php
diff --git a/config/siproxdusers.xml b/config/siproxd/siproxdusers.xml
index 4ed4abc7..4ed4abc7 100644
--- a/config/siproxdusers.xml
+++ b/config/siproxd/siproxdusers.xml
diff --git a/config/squid-head/squid.inc b/config/squid-head/squid.inc
deleted file mode 100644
index b647392c..00000000
--- a/config/squid-head/squid.inc
+++ /dev/null
@@ -1,864 +0,0 @@
-<?php
-require_once('globals.inc');
-require_once('config.inc');
-require_once('util.inc');
-require_once('pfsense-utils.inc');
-require_once('pkg-utils.inc');
-require_once('service-utils.inc');
-
-if(!function_exists("filter_configure"))
- require_once("filter.inc");
-
-define('RC_BASE', '/usr/local/etc/rc.d');
-define('SQUID_CONFBASE', '/usr/local/etc/squid');
-define('SQUID_LOGDIR', '/var/squid/log');
-define('SQUID_CACHEDIR', '/var/squid/cache');
-define('SQUID_ACLDIR', '/var/squid/acl');
-define('SQUID_PASSWD', '/var/etc/squid.passwd');
-define('MSNTAUTH_CONF', '/usr/local/etc/squid/msntauth.conf');
-
-$valid_acls = array();
-
-
-function squid_get_real_interface_address($iface) {
- global $config;
-
- $iface = convert_friendly_interface_to_real_interface_name($iface);
- $line = trim(shell_exec("ifconfig $iface | grep inet | grep -v inet6"));
- list($dummy, $ip, $dummy2, $netmask) = explode(' ', $line);
-
- return array($ip, long2ip(hexdec($netmask)));
-}
-
-function squid_chown_recursive($dir, $user, $group) {
- chown($dir, $user);
- chgrp($dir, $group);
- $handle = opendir($dir) ;
- while (($item = readdir($handle)) !== false) {
- if (($item != ".") && ($item != "..")) {
- $path = "$dir/$item";
- if (is_dir($path))
- squid_chown_recursive($path, $user, $group);
- else {
- chown($path, $user);
- chgrp($path, $group);
- }
- }
- }
-}
-
-function squid_is_valid_acl($acl) {
- global $valid_acls;
-
- return in_array($acl, $valid_acls);
-}
-
-function squid_install_command() {
- /* Create cache */
- update_output_window('Initializing cache... This may take a moment...');
- mwexec('/usr/local/sbin/squid -z');
-
- $rc = array();
- $rc['file'] = 'squid.sh';
- $rc['start'] = '/usr/local/sbin/squid -D';
- $rc['stop'] = RC_BASE . "/proxy_monitor.sh stop\n";
- $rc['stop'] .= <<<EOD
-/usr/local/sbin/squid -k shutdown
-# Just to be sure...
-killall squid 2>/dev/null
-sleep 1
-killall squid 2>/dev/null
-
-EOD;
- $rc['restart'] = <<<EOD
-if [ -z "`pgrep squid`" ]; then
- /usr/local/sbin/squid -D
- else
- /usr/local/sbin/squid -k reconfigure
- fi
-
-EOD;
- write_rcfile($rc);
-
- $rc = array();
- $rc['file'] = 'proxy_monitor.sh';
- $rc['start'] = '/usr/local/bin/squid_monitor.sh';
- $rc['stop'] = 'killall squid_monitor.sh';
- write_rcfile($rc);
-
- foreach (array( SQUID_CONFBASE,
- SQUID_LOGDIR,
- SQUID_ACLDIR,
- SQUID_CACHEDIR,
- ) as $dir) {
- make_dirs($dir);
- squid_chown_recursive($dir, 'proxy', 'proxy');
- }
-
- restart_service('squid');
- sleep(1);
- restart_service('proxy_monitor');
-
- if (!file_exists(SQUID_CONFBASE . '/mime.conf') && file_exists(SQUID_CONFBASE . '/mime.conf.default'))
- copy(SQUID_CONFBASE . '/mime.conf.default', SQUID_CONFBASE . '/mime.conf');
-}
-
-function squid_deinstall_command() {
- stop_service('proxy_monitor');
- stop_service('squid');
-
- filter_configure();
-
- mwexec('rm -rf ' . SQUID_CACHEDIR);
-}
-
-function squid_before_form_general(&$pkg) {
- $values = get_dir(SQUID_CONFBASE . '/errors/');
- // Get rid of '..' and '.'
- array_shift($values);
- array_shift($values);
- $name = array();
- foreach ($values as $value)
- $names[] = implode(' ', explode('_', $value));
-
- $i = 0;
- foreach ($pkg['fields']['field'] as $field) {
- if ($field['fieldname'] == 'error_language')
- break;
- $i++;
- }
- $field = &$pkg['fields']['field'][$i];
-
- for ($i = 0; $i < count($values) - 1; $i++)
- $field['options']['option'][] = array('name' => $names[$i], 'value' => $values[$i]);
-}
-
-function squid_validate_general($post, &$input_errors) {
- $icp_port = trim($post['icp_port']);
- if (!empty($icp_port) && !is_port($icp_port))
- $input_errors[] = 'You must enter a valid port number in the \'ICP port\' field';
-
- $children = $post['redirect_children'];
- if (!empty($children) && !is_numeric($children))
- $input_errors[] = 'You must enter a valid number for the \'Redirect children\' field';
-}
-
-function squid_validate_upstream($post, &$input_errors) {
- if ($post['proxy_forwarding'] == 'on') {
- $addr = trim($post['proxy_addr']);
- if (empty($addr))
- $input_errors[] = 'The field \'Hostname\' is required';
- else {
- if (!is_ipaddr($addr) && !is_domain($addr))
- $input_errors[] = 'You must enter a valid IP address or host name in the \'Proxy hostname\' field';
- }
-
- foreach (array('proxy_port' => 'TCP port', 'icp_port' => 'ICP port') as $field => $name) {
- $port = trim($post[$field]);
- if (empty($port))
- $input_errors[] = "The field '$name' is required";
- else {
- if (!is_port($port))
- $input_errors[] = "The field '$name' must contain a valid port number, between 0 and 65535";
- }
- }
- }
-}
-
-function squid_validate_cache($post, &$input_errors) {
- $num_fields = array( 'harddisk_cache_size' => 'Hard disk cache size',
- 'memory_cache_size' => 'Memory cache size',
- 'maximum_object_size' => 'Maximum object size',
- );
- foreach ($num_fields as $field => $name) {
- $value = trim($post[$field]);
- if (!is_numeric($value) || ($value < 1))
- $input_errors[] = "You must enter a valid value for '$field'";
- }
-
- $value = trim($post['minimum_object_size']);
- if (!is_numeric($value) || ($value < 0))
- $input_errors[] = 'You must enter a valid value for \'Minimum object size\'';
-
- foreach (explode(',', $post['donotcache']) as $host) {
- $host = trim($host);
- if (!is_ipaddr($host) && !is_domain($host))
- $input_errors[] = "$host is not a valid IP or host name";
- }
-}
-
-function squid_validate_nac($post, &$input_errors) {
- $allowed_subnets = explode(',', trim($post['allowed_subnets']));
- foreach ($allowed_subnets as $subnet) {
- $subnet = trim($subnet);
- if (!empty($subnet) && !is_subnet($subnet))
- $input_errors[] = "'$subnet' is not a valid CIDR range";
- }
-
- foreach (array( 'unrestricted_hosts',
- 'banned_hosts',
- 'whitelist',
- 'blacklist',
- ) as $hosts) {
- foreach (explode(',', $post[$hosts]) as $host) {
- $host = trim($host);
- if (!empty($host) && !is_ipaddr($host))
- $input_errors[] = "'$host' is not a valid IP address";
- }
- }
-
- foreach (array('unrestricted_macs', 'banned_macs') as $macs) {
- foreach (explode(',', $post[$macs]) as $mac) {
- $mac = trim($mac);
- if (!empty($mac) && !is_macaddr($mac))
- $input_errors[] = "'$mac' is not a valid MAC address";
- }
- }
-
- foreach (explode(',', $post['timelist']) as $time) {
- $time = trim($time);
- if (!empty($time) && !squid_is_timerange($time))
- $input_errors[] = "'$time' is not a valid time range";
- }
-}
-
-function squid_validate_traffic($post, &$input_errors) {
- $num_fields = array(
- 'max_download_size' => 'Maximum download size',
- 'max_upload_size' => 'Maximum upload size',
- 'perhost_capping' => 'Per-host bandwidth capping',
- 'overall_capping' => 'Overall bandwidth capping',
- 'perhost_throttling' => 'Per-host bandwidth throttling',
- 'overall_throttling' => 'Overall bandwidth throttling',
- 'initial_bucket_level' => 'Initial bucket level',
- );
- foreach ($num_fields as $field => $name) {
- $value = trim($post[$field]);
- if (!is_numeric($value) || ($value < 0))
- $input_errors[] = "The field '$name' must contain a positive number";
- }
-}
-
-function squid_validate_auth($post, &$input_errors) {
- $num_fields = array( array('auth_processes', 'Authentication processes', 1),
- array('auth_ttl', 'Authentication TTL', 0),
- );
- foreach ($num_fields as $field) {
- $value = trim($post[$field[0]]);
- if (!empty($value) && (!is_numeric($value) || ($value < $field[2])))
- $input_errors[] = "The field '{$field[1]}' must contain a valid number greater than {$field[2]}";
- }
-
- $auth_method = $post['auth_method'];
- if (($auth_method != 'none') && ($auth_method != 'local')) {
- $server = trim($post['auth_server']);
- if (empty($server))
- $input_errors[] = 'The field \'Authentication server\' is required';
- else if (!is_ipaddr($server) && !is_domain($server))
- $input_errors[] = 'The field \'Authentication server\' must contain a valid IP address or domain name';
-
- $port = trim($post['auth_server_port']);
- if (!empty($port) && !is_port($port))
- $input_errors[] = 'The field \'Authentication server port\' must contain a valid port number';
-
- switch ($auth_method) {
- case 'ldap':
- $required = array(
- 'ldap_basedn' => 'LDAP base DN',
- 'ldap_filter' => 'LDAP filter',
- );
- foreach ($required as $field => $descr) {
- $value = trim($post[$field]);
- if (empty($value))
- $input_errors[] = "The field '$descr' is required";
- }
-
- $user = trim($post['ldap_user']);
- $password = trim($post['ldap_password']);
- if (!empty($password) && empty($user))
- $input_errors[] = 'You must specify an username if you specify a password';
-
- break;
- case 'radius':
- $secret = trim($post['radius_secret']);
- if (empty($secret))
- $input_errors[] = 'The field \'RADIUS secret\' is required';
- break;
- case 'msnt':
- $bdc = $post['msnt_bdc'];
- if (!empty($bdc) && !is_ipaddr($bdc) && !is_domain($bdc))
- $input_errors[] = "'$bdc' isn't a valid IP address or domain name";
- $domain = $post['msnt_domain'];
- if (empty($domain) || !is_domain($domain))
- $input_errors[] = 'You must enter a valid domain name in the \'NT domain\' field';
- break;
- }
-
- $no_auth = explode(',', trim($post['no_auth_hosts']));
- foreach ($no_auth as $host) {
- $host = trim($host);
- if (!empty($host) && !is_subnet($host))
- $input_errors[] = "'$host' isn't a valid CIDR range";
- }
- }
-}
-
-function squid_resync_general() {
- global $g, $config, $valid_acls;
-
- $settings = $config['installedpackages']['squid']['config'][0];
- $conf = '';
-
- if ($settings['transparent_proxy'] == 'on') {
- $conf .= <<<EOD
-httpd_accel_host virtual
-httpd_accel_port 80
-httpd_accel_with_proxy on
-httpd_accel_uses_host_header on
-
-EOD;
- }
-
- $port = $settings['proxy_port'] ? $settings['proxy_port'] : 3128;
- $ifaces = $settings['active_interface'] ? $settings['active_interface'] : 'lan';
- $real_ifaces = array();
- foreach (explode(',', $ifaces) as $i => $iface) {
- $real_ifaces[] = squid_get_real_interface_address($iface);
- if (!empty($real_ifaces[$i][0]))
- $conf .= "http_port {$real_ifaces[$i][0]}:$port\n";
- }
-
- $icp_port = $settings['icp_port'] ? $settings['icp_port'] : 0;
-
- $pidfile = "{$g['varrun_path']}/squid.pid";
- $language = $settings['error_language'] ? $settings['error_language'] : 'English';
- $errordir = SQUID_CONFBASE . '/errors/' . $language;
- $hostname = $settings['visible_hostname'] ? $settings['visible_hostname'] : 'localhost';
- $email = $settings['admin_email'] ? $settings['admin_email'] : 'admin@localhost';
-
- $logdir_cache = SQUID_LOGDIR . '/cache.log';
- $logdir_access = $settings['log_enabled'] == 'on' ? SQUID_LOGDIR . '/access.log' : '/dev/null';
-
- $conf .= <<<EOD
-icp_port $icp_port
-
-pid_filename $pidfile
-cache_effective_user proxy
-cache_effective_group proxy
-error_directory $errordir
-visible_hostname $hostname
-cache_mgr $email
-
-cache_access_log $logdir_access
-cache_log $logdir_cache
-cache_store_log none
-
-EOD;
-
- if ($settings['allow_interface'] == 'on') {
- $src = '';
- foreach ($real_ifaces as $iface) {
- list($ip, $mask) = $iface;
- $ip = long2ip(ip2long($ip) & ip2long($mask));
- $src .= " $ip/$mask";
- }
- $conf .= "acl localnet src $src\n";
- $valid_acls[] = 'localnet';
- }
-
- restart_service('proxy_monitor');
-
- return $conf;
-}
-
-function squid_resync_cache() {
- global $config;
-
- $settings = $config['installedpackages']['squidcache']['config'][0];
-
- $cachedir = SQUID_CACHEDIR;
- $disk_cache_size = $settings['harddisk_cache_size'] ? $settings['harddisk_cache_size'] : 100;
- $level1 = $settings['level1_subdirs'] ? $settings['level1_subdirs'] : 16;
- $memory_cache_size = $settings['memory_cache_size'] ? $settings['memory_cache_size'] : 8;
- $max_objsize = $settings['maximum_object_size'] ? $settings['maximum_object_size'] : 4;
- $min_objsize = $settings['minimum_object_size'] ? $settings['minimum_object_size'] : 0;
- $cache_policy = $settings['cache_replacement_policy'] ? $settings['cache_replacement_policy'] : 'heap LFUDA';
- $memory_policy = $settings['memory_replacement_policy'] ? $settings['memory_replacement_policy'] : 'heap GDSF';
- $offline_mode = $settings['enable_offline'] == 'on' ? 'on' : 'off';
-
- $conf = <<<EOD
-cache_dir diskd $cachedir $disk_cache_size $level1 256
-cache_mem $memory_cache_size MB
-maximum_object_size $max_objsize KB
-minimum_object_size $min_objsize KB
-cache_replacement_policy $cache_policy
-memory_replacement_policy $memory_policy
-offline_mode $offline_mode
-
-EOD;
-
- $donotcache = trim(implode("\n", array_map('trim', explode(',', $settings['donotcache']))));
- if (!empty($donotcache)) {
- file_put_contents(SQUID_ACLDIR . '/donotcache.acl', $donotcache);
- $conf .= 'acl donotcache dstdomain "' . SQUID_ACLDIR . "/donotcache.acl\"\n";
- $conf .= 'no_cache deny donotcache';
- }
-
- return $conf;
-}
-
-function squid_resync_upstream() {
- global $config;
- $settings = $config['installedpackages']['squidupstream']['config'][0];
-
- $conf = '';
- if ($settings['proxy_forwarding'] == 'on') {
- $conf .= "cache_peer {$settings['proxy_addr']} parent {$settings['proxy_port']} {$settings['icp_port']} ";
-
- if (!empty($settings['username']))
- $conf .= " login={$settings['username']}";
- if (!empty($settings['password']))
- $conf .= ":{$settings['password']}";
- }
-
- return $conf;
-}
-
-function squid_resync_redirector() {
- global $config;
-
- $httpav_enabled = $config['installedpackages']['clamav']['config'][0]['scan_http'] == 'on';
- if ($httpav_enabled)
- return ('redirect_program /usr/local/bin/squirm');
- return '# No redirector configured';
-}
-
-function squid_resync_nac() {
- global $config, $valid_acls;
-
- $settings = $config['installedpackages']['squidnac']['config'][0];
-
- $conf = <<<EOD
-acl all src 0.0.0.0/0
-acl localhost src 127.0.0.1
-acl safeports port 21 70 80 210 280 443 488 563 591 631 777 901 1025-65535
-acl sslports port 443 563
-acl manager proto cache_object
-acl purge method PURGE
-acl connect method CONNECT
-acl dynamic urlpath_regex cgi-bin \?
-
-EOD;
-
- $allowed = implode(' ', array_map('trim', explode(',', $settings['allowed_subnets'])));
- if (!empty($allowed)) {
- $conf .= "acl allowed_subnets src $allowed\n";
- $valid_acls[] = 'allowed_subnets';
- }
-
- $options = array( 'unrestricted_hosts' => 'src',
- 'unrestricted_macs' => 'arp',
- 'banned_hosts' => 'src',
- 'banned_macs' => 'arp',
- 'whitelist' => 'url_regex -i',
- 'blacklist' => 'url_regex -i',
- );
- foreach ($options as $option => $directive) {
- $contents = trim(implode("\n", array_map('trim', explode(',', $settings[$option]))));
- if (!empty($contents)) {
- file_put_contents(SQUID_ACLDIR . "/$option.acl", $contents);
- $conf .= "acl $option $directive \"" . SQUID_ACLDIR . "/$option.acl\"\n";
- $valid_acls[] = $option;
- }
- }
-
- $conf .= <<<EOD
-no_cache deny dynamic
-http_access allow manager localhost
-http_access deny manager
-http_access allow purge localhost
-http_access deny purge
-http_access deny !safeports
-http_access deny CONNECT !sslports
-
-http_access allow localhost
-
-EOD;
-
- return $conf;
-}
-
-function squid_resync_traffic() {
- global $config, $valid_acls;
-
- $settings = $config['installedpackages']['squidtraffic']['config'][0];
- $conf = '';
-
- $up_limit = $settings['max_upload_size'] ? $settings['max_upload_size'] : 0;
- $down_limit = $settings['max_download_size'] ? $settings['max_download_size'] : 0;
- $conf .= "request_body_max_size $up_limit KB\n";
- $conf .= 'reply_body_max_size ' . ($down_limit * 1024) . " allow all\n";
-
- foreach (array('perhost', 'overall') as $field) {
- $capping = $settings["{$field}_capping"];
- $throttling = $settings["{$field}_throttling"];
-
- if (!isset($capping) || $capping == 0)
- $capping = '-1';
- else
- $capping *= 1024; // Kbytes
-
- if (!isset($throttling) || $throttling == 0) {
- if ($capping == '-1')
- $throttling = '-1';
- else
- $throttling = $capping;
- } else {
- $throttling *= 1024; // Kbytes
- }
-
- $$field = "$throttling/$capping";
- }
-
- $initial_bucket_level = $settings['initial_bucket_level'];
- if (!isset($initial_bucket_level) || $initial_bucket_level == 0)
- $initial_bucket_level = '100%';
- else
- $initial_bucket_level *= 1024; // Kbytes
-
- $conf .= <<<EOD
-delay_initial_bucket_level $initial_bucket_level
-delay_pools 1
-delay_class 1 2
-delay_parameters 1 $overall $perhost
-
-EOD;
-
- foreach (array('unrestricted_hosts', 'unrestricted_macs') as $item) {
- if (in_array($item, $valid_acls))
- $conf .= "delay_access 1 deny $item\n";
- }
-
- if ($settings['throttle_specific'] == 'on') {
- $exts = array();
- $binaries = 'bin,cab,sea,ar,arj,tar,tgz,gz,tbz,bz2,zip,exe,com';
- $cdimages = 'iso,bin,mds,nrg,gho,bwt,b5t,pqi';
- $multimedia = 'aiff?,asf,avi,divx,mov,mp3,mp4,mpe?g,qt,ra?m';
- foreach (array( 'throttle_binaries' => $binaries,
- 'throttle_cdimages' => $cdimages,
- 'throttle_multimedia' => $multimedia) as $field => $set) {
- if ($settings[$field] == 'on')
- $exts = array_merge($exts, explode(',', $set));
- }
-
- foreach (explode(',', $settings['throttle_others']) as $ext) {
- if (!empty($ext)) $exts[] = $ext;
- }
-
- $contents = '';
- foreach ($exts as $ext)
- $contents .= "\.$ext\$\n";
- file_put_contents(SQUID_ACLDIR . '/throttle_exts.acl', $contents);
-
- if (!empty($contents)) { // avoid crashing Squid
- $conf .= 'acl throttle_exts url_regex -i "' . SQUID_ACLDIR . "/throttle_exts.acl\"\n";
- $conf .= "delay_access 1 allow throttle_exts\n";
- $conf .= "delay_access 1 deny all\n";
- }
- }
- else
- $conf .= "delay_access 1 allow all\n";
-
- return $conf;
-}
-
-function squid_resync_auth() {
- global $config, $valid_acls;
-
- $settings = $config['installedpackages']['squidauth']['config'][0];
- $conf = '';
-
- // Deny the banned guys before allowing the good guys
- $banned = array( 'banned_hosts',
- 'banned_macs',
- );
- $banned = array_filter($banned, 'squid_is_valid_acl');
- foreach ($banned as $acl)
- $conf .= "http_access deny $acl\n";
-
- // Whitelist and blacklist also take precendence
- if (squid_is_valid_acl('whitelist'))
- $conf .= "http_access allow whitelist\n";
- if (squid_is_valid_acl('blacklist'))
- $conf .= "http_access deny blacklist\n";
-
- $transparent_proxy = $config['installedpackages']['squid']['config'][0]['transparent_proxy'] == 'on';
- $auth_method = ($settings['auth_method'] && !$transparent_proxy) ? $settings['auth_method'] : 'none';
-
- // Allow the remaining ACLs if no authentication is set
- if ($auth_method == 'none') {
- $allowed = array('localnet', 'allowed_subnets', 'unrestricted_hosts', 'unrestricted_macs');
- $allowed = array_filter($allowed, 'squid_is_valid_acl');
- foreach ($allowed as $acl)
- $conf .= "http_access allow $acl\n";
- }
-
- else {
- $noauth = implode(' ', array_map('trim', explode(',', $settings['no_auth_hosts'])));
- if (!empty($noauth)) {
- $conf .= "acl noauth src $noauth\n";
- $valid_acls[] = 'noauth';
- }
-
- // Set up the external authentication programs
- $auth_ttl = $settings['auth_ttl'] ? $settings['auth_ttl'] : 60;
- $processes = $settings['auth_processes'] ? $settings['auth_processes'] : 5;
- $prompt = $settings['auth_prompt'] ? $settings['auth_prompt'] : 'Please enter your credentials to access the proxy';
- switch ($auth_method) {
- case 'local':
- $conf .= 'auth_param basic program /usr/local/libexec/squid/ncsa_auth ' . SQUID_PASSWD . "\n";
- break;
- case 'ldap':
- $port = isset($settings['auth_port']) ? ":{$settings['auth_port']}" : '';
- $user = isset($settings['ldap_user']) ? "-D {$settings['ldap_user']}" : '';
- $password = isset($settings['ldap_password']) ? "-w '{$settings['ldap_password']}'" : '';
- $filter = isset($settings['ldap_filter']) ? "-f '{$settings['ldap_filter']}'" : '';
- $conf .= "auth_param basic program /usr/local/libexec/squid/squid_ldap_auth -b {$settings['ldap_basedn']} $user $password $filter {$settings['auth_server']}$port\n";
- break;
- case 'radius':
- $port = isset($settings['auth_port']) ? "-p {$settings['auth_server_port']}" : '';
- $conf .= "auth_param basic program /usr/local/libexec/squid/squid_radius_auth -w {$settings['radius_secret']} -h {$settings['auth_server']} $port\n";
- break;
- case 'msnt':
- $conf .= "auth_param basic program /usr/local/libexec/squid/msnt_auth\n";
-
- $bdc = trim($settings['msnt_bdc']);
- if (empty($bdc)) $bdc = $settings['auth_server'];
- $msntauth_conf = "server {$settings['auth_server']} $bdc {$settings['msnt_domain']}\n";
- file_put_contents(MSNTAUTH_CONF, $msntauth_conf);
-
- break;
- }
- $conf .= <<<EOD
-auth_param basic children $processes
-auth_param basic realm $prompt
-auth_param basic credentialsttl $auth_ttl minutes
-acl password proxy_auth REQUIRED
-
-EOD;
-
- // Onto the ACLs
- $password = array('localnet', 'allowed_subnets');
- $passwordless = array('unrestricted_hosts', 'unrestricted_macs');
- if ($settings['unrestricted_auth'] == 'on') {
- // Even the unrestricted hosts should authenticate
- $password = array_merge($password, $passwordless);
- $passwordless = array();
- }
- $passwordless[] = 'noauth';
- $password = array_filter($password, 'squid_is_valid_acl');
- $passwordless = array_filter($passwordless, 'squid_is_valid_acl');
-
- // Allow the ACLs that don't need to authenticate
- foreach ($passwordless as $acl)
- $conf .= "http_access allow $acl\n";
-
- // Allow the other ACLs as long as they authenticate
- foreach ($password as $acl)
- $conf .= "http_access allow password $acl\n";
- }
-
-
- $conf .= "http_access deny all\n";
-
- return $conf;
-}
-
-function squid_resync_users() {
- global $config;
-
- $users = $config['installedpackages']['squidusers']['config'];
- $contents = '';
- if (is_array($users)) {
- foreach ($users as $user)
- $contents .= $user['username'] . ':' . crypt($user['password'], base64_encode($user['password'])) . "\n";
- }
- file_put_contents(SQUID_PASSWD, $contents);
- chown(SQUID_PASSWD, 'proxy');
- chmod(SQUID_PASSWD, 0600);
-}
-
-function squid_resync() {
- $conf = squid_resync_general() . "\n";
- $conf .= squid_resync_cache() . "\n";
- $conf .= squid_resync_redirector() . "\n";
- $conf .= squid_resync_upstream() . "\n";
- $conf .= squid_resync_nac() . "\n";
- $conf .= squid_resync_traffic() . "\n";
- $conf .= squid_resync_auth();
- squid_resync_users();
-
- file_put_contents(SQUID_CONFBASE . '/squid.conf', $conf);
-
- if (!is_dir(SQUID_CACHEDIR . '/0/0')) {
- log_error(SQUID_CACHEDIR . ' does not exist. Creating.');
- mwexec('/usr/local/sbin/squid -z');
- }
-
- restart_service('squid');
- sleep(1);
- restart_service('proxy_monitor');
-
- filter_configure();
-}
-
-function squid_print_javascript_auth() {
- global $config;
- $transparent_proxy = $config['installedpackages']['squid']['config'][0]['transparent_proxy'] == 'on';
-
- // No authentication for transparent proxy
- if ($transparent_proxy) {
- $javascript = <<<EOD
-<script language="JavaScript">
-<!--
-function on_auth_method_changed() {
- document.iform.auth_method.disabled = 1;
- document.iform.auth_server.disabled = 1;
- document.iform.auth_server_port.disabled = 1;
- document.iform.ldap_user.disabled = 1;
- document.iform.ldap_password.disabled = 1;
- document.iform.ldap_basedn.disabled = 1;
- document.iform.ldap_filter.disabled = 1;
- document.iform.radius_secret.disabled = 1;
- document.iform.msnt_bdc.disabled = 1;
- document.iform.msnt_domain.disabled = 1;
- document.iform.auth_prompt.disabled = 1;
- document.iform.auth_processes.disabled = 1;
- document.iform.auth_ttl.disabled = 1;
- document.iform.unrestricted_auth.disabled = 1;
- document.iform.no_auth_hosts.disabled = 1;
-}
--->
-</script>
-
-EOD;
- }
- else {
- $javascript = <<<EOD
-<script language="JavaScript">
-<!--
-function on_auth_method_changed() {
- var field = document.iform.auth_method;
- var auth_method = field.options[field.selectedIndex].value;
-
- if (auth_method == 'none') {
- document.iform.auth_server.disabled = 1;
- document.iform.auth_server_port.disabled = 1;
- document.iform.ldap_user.disabled = 1;
- document.iform.ldap_password.disabled = 1;
- document.iform.ldap_basedn.disabled = 1;
- document.iform.ldap_filter.disabled = 1;
- document.iform.radius_secret.disabled = 1;
- document.iform.msnt_bdc.disabled = 1;
- document.iform.msnt_domain.disabled = 1;
- document.iform.auth_prompt.disabled = 1;
- document.iform.auth_processes.disabled = 1;
- document.iform.auth_ttl.disabled = 1;
- document.iform.unrestricted_auth.disabled = 1;
- document.iform.no_auth_hosts.disabled = 1;
- }
- else {
- document.iform.auth_prompt.disabled = 0;
- document.iform.auth_processes.disabled = 0;
- document.iform.auth_ttl.disabled = 0;
- document.iform.unrestricted_auth.disabled = 0;
- document.iform.no_auth_hosts.disabled = 0;
- }
-
- switch (auth_method) {
- case 'local':
- document.iform.auth_server.disabled = 1;
- document.iform.auth_server_port.disabled = 1;
- document.iform.ldap_user.disabled = 1;
- document.iform.ldap_password.disabled = 1;
- document.iform.ldap_basedn.disabled = 1;
- document.iform.ldap_filter.disabled = 1;
- document.iform.radius_secret.disabled = 1;
- document.iform.msnt_bdc.disabled = 1;
- document.iform.msnt_domain.disabled = 1;
- break;
- case 'ldap':
- document.iform.auth_server.disabled = 0;
- document.iform.auth_server_port.disabled = 0;
- document.iform.ldap_user.disabled = 0;
- document.iform.ldap_password.disabled = 0;
- document.iform.ldap_basedn.disabled = 0;
- document.iform.ldap_filter.disabled = 0;
- document.iform.radius_secret.disabled = 1;
- document.iform.msnt_bdc.disabled = 1;
- document.iform.msnt_domain.disabled = 1;
- break;
- case 'radius':
- document.iform.auth_server.disabled = 0;
- document.iform.auth_server_port.disabled = 0;
- document.iform.ldap_user.disabled = 1;
- document.iform.ldap_password.disabled = 1;
- document.iform.ldap_basedn.disabled = 1;
- document.iform.ldap_filter.disabled = 1;
- document.iform.radius_secret.disabled = 0;
- document.iform.msnt_bdc.disabled = 1;
- document.iform.msnt_domain.disabled = 1;
- break;
- case 'msnt':
- document.iform.auth_server.disabled = 0;
- document.iform.auth_server_port.disabled = 1;
- document.iform.ldap_user.disabled = 1;
- document.iform.ldap_password.disabled = 1;
- document.iform.ldap_basedn.disabled = 1;
- document.iform.ldap_filter.disabled = 1;
- document.iform.radius_secret.disabled = 1;
- document.iform.msnt_bdc.disabled = 0;
- document.iform.msnt_domain.disabled = 0;
- break;
- }
-}
--->
-</script>
-
-EOD;
- }
-
- print($javascript);
-}
-
-function squid_print_javascript_auth2() {
- print("<script language=\"JavaScript\">on_auth_method_changed()</script>\n");
-}
-
-function squid_generate_rules($type) {
- global $config;
-
- $squid_conf = $config['installedpackages']['squid']['config'][0];
- if (!is_service_running('squid') || ($squid_conf['transparent_proxy'] != 'on')) {
- log_error('Squid is installed but not started. Not installing redirect rules.');
- return;
- }
-
- $port = isset($squid_conf['proxy_port']) ? $squid_conf['proxy_port'] : 3128;
- $ifaces = explode(',', $squid_conf['active_interface']);
- $ifaces = array_map('convert_friendly_interface_to_real_interface_name', $ifaces);
-
- switch($type) {
- case 'nat':
- foreach ($ifaces as $iface)
- $rules .= "rdr on $iface inet proto tcp from any to !($iface) port 80 -> ($iface) port $port\n";
- break;
- case 'filter':
- foreach ($ifaces as $iface)
- $rules .= "pass quick on $iface inet proto tcp from any to !($iface) port 80 flags S/SA keep state\n";
- break;
- }
-
- return $rules;
-}
-?>
diff --git a/config/squid-head/squid.xml b/config/squid-head/squid.xml
deleted file mode 100644
index 4db431fc..00000000
--- a/config/squid-head/squid.xml
+++ /dev/null
@@ -1,215 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>squid</name>
- <version>none</version>
- <title>Proxy server: General settings</title>
- <include_file>squid.inc</include_file>
-
- <menu>
- <name>Web proxy cache</name>
- <tooltiptext>Modify the web proxy cache's settings</tooltiptext>
- <section>Services</section>
- <url>/pkg_edit.php?xml=squid.xml&amp;id=0</url>
- </menu>
- <service>
- <name>Squid</name>
- <rcfile>squid.sh</rcfile>
- <executable>squid</executable>
- <description>Web proxy cache.</description>
- </service>
- <tabs>
- <tab>
- <text>General settings</text>
- <url>/pkg_edit.php?xml=squid.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Upstream proxy</text>
- <url>/pkg_edit.php?xml=squid_upstream.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Cache management</text>
- <url>/pkg_edit.php?xml=squid_cache.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Access control</text>
- <url>/pkg_edit.php?xml=squid_nac.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Traffic management</text>
- <url>/pkg_edit.php?xml=squid_traffic.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Auth settings</text>
- <url>/pkg_edit.php?xml=squid_auth.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Local users</text>
- <url>/pkg.php?xml=squid_users.xml</url>
- </tab>
- </tabs>
- <!-- Installation -->
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/squid.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/squid_cache.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/squid_nac.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/squid_traffic.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/squid_upstream.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/squid_auth.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/squid_users.xml</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/bin/</prefix>
- <chmod>0755</chmod>
- <item>https://www.pfsense.org/packages/All/squid_monitor.sh</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Proxy interface</fielddescr>
- <fieldname>active_interface</fieldname>
- <description>The interface(s) the proxy server will bind to.</description>
- <type>interfaces_selection</type>
- <required/>
- <default_value>lan</default_value>
- <multiple/>
- </field>
- <field>
- <fielddescr>Allow users on interface</fielddescr>
- <fieldname>allow_interface</fieldname>
- <description>If this field is checked, the users connected to the interface selected in the 'Proxy interface' field will be allowed to use the proxy, i.e., there will be no need to add the interface's subnet to the list of allowed subnets. This is just a shortcut.</description>
- <type>checkbox</type>
- <required/>
- <default_value>on</default_value>
- </field>
- <field>
- <fielddescr>Transparent proxy</fielddescr>
- <fieldname>transparent_proxy</fieldname>
- <description>If transparent mode is enabled, all requests for destination port 80 will be forwarded to the proxy server without any additional configuration necessary.</description>
- <type>checkbox</type>
- <required/>
- </field>
- <field>
- <fielddescr>Enabled logging</fielddescr>
- <fieldname>log_enabled</fieldname>
- <description>This will enable the access log. Don't switch this on if you don't have much disk space left.</description>
- <type>checkbox</type>
- <enablefields>log_query_terms,log_user_agents</enablefields>
- </field>
- <field>
- <fielddescr>Proxy port</fielddescr>
- <fieldname>proxy_port</fieldname>
- <description>This is the port the proxy server will listen on.</description>
- <type>input</type>
- <size>5</size>
- <required/>
- <default_value>3128</default_value>
- </field>
- <field>
- <fielddescr>ICP port</fielddescr>
- <fieldname>icp_port</fieldname>
- <description>This is the port the proxy server will send and receive ICP queries to and from neighbor caches. Leave this blank if you don't want the proxy server to communicate with neighbor caches through ICP.</description>
- <type>input</type>
- <size>5</size>
- </field>
- <field>
- <fielddescr>Visible hostname</fielddescr>
- <fieldname>visible_hostname</fieldname>
- <description>This is the hostname to be displayed in proxy server error messages.</description>
- <type>input</type>
- <default_value>localhost</default_value>
- </field>
- <field>
- <fielddescr>Administrator email</fielddescr>
- <fieldname>admin_email</fieldname>
- <description>This is the email address displayed in error messages to the users.</description>
- <type>input</type>
- <default_value>admin@localhost</default_value>
- </field>
- <field>
- <fielddescr>Language</fielddescr>
- <fieldname>error_language</fieldname>
- <description>Select the language in which the proxy server will display error messages to users.</description>
- <type>select</type>
- <default_value>English</default_value>
- </field>
- <field>
- <fielddescr>Redirect children</fielddescr>
- <fieldname>redirect_children</fieldname>
- <description>Specify the number of redirectors to spawn (if using redirectors at all) when launching Squid. If you leave this field blank, Squid will start 5 redirector processes. If your network load is high, feel free to increase this value (at the expense of a higher memory consumption).</description>
- <type>input</type>
- <default_value>5</default_value>
- </field>
- </fields>
- <custom_php_command_before_form>
- squid_before_form_general($pkg);
- </custom_php_command_before_form>
- <custom_php_validation_command>
- squid_validate_general($_POST, $input_errors);
- </custom_php_validation_command>
-<custom_php_resync_config_command>
- squid_resync();
- </custom_php_resync_config_command>
- <custom_php_install_command>
- squid_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- squid_deinstall_command();
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/squid-head/squid_auth.xml b/config/squid-head/squid_auth.xml
deleted file mode 100644
index ded7b516..00000000
--- a/config/squid-head/squid_auth.xml
+++ /dev/null
@@ -1,202 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>squidauth</name>
- <version>none</version>
- <title>Proxy server: Authentication</title>
- <include_file>squid.inc</include_file>
- <tabs>
- <tab>
- <text>General settings</text>
- <url>/pkg_edit.php?xml=squid.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Upstream proxy</text>
- <url>/pkg_edit.php?xml=squid_upstream.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Cache management</text>
- <url>/pkg_edit.php?xml=squid_cache.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Access control</text>
- <url>/pkg_edit.php?xml=squid_nac.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Traffic management</text>
- <url>/pkg_edit.php?xml=squid_traffic.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Auth settings</text>
- <url>/pkg_edit.php?xml=squid_auth.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Local users</text>
- <url>/pkg.php?xml=squid_users.xml</url>
- </tab>
- </tabs>
- <fields>
- <field>
- <fielddescr>Authentication method</fielddescr>
- <fieldname>auth_method</fieldname>
- <description>Select an authentication method. This will allow users to be authenticated by local or external services.</description>
- <type>select</type>
- <default_value>none</default_value>
- <options>
- <option><name>None</name><value>none</value></option>
- <option><name>Local</name><value>local</value></option>
- <option><name>LDAP</name><value>ldap</value></option>
- <option><name>RADIUS</name><value>radius</value></option>
- <option><name>NT domain</name><value>msnt</value></option>
- </options>
- <onchange>on_auth_method_changed()</onchange>
- </field>
- <field>
- <fielddescr>Authentication server</fielddescr>
- <fieldname>auth_server</fieldname>
- <description>Enter here the IP or hostname of the server that will perform the authentication. For NT domain authentication, this is the Primary Domain Controller (PDC).</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Authentication server port</fielddescr>
- <fieldname>auth_server_port</fieldname>
- <description>Enter here the port to use to connect to the authentication server. Leave this field blank to use the authentication method's default port.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>LDAP server user DN</fielddescr>
- <fieldname>ldap_user</fieldname>
- <description>Enter here the user distinguished name (DN) to bind to connect to the LDAP server (e.g., "cn=Administrator,cn=Users,dc=foobar,dc=com"). You can leave this field blank if you don't want to use authentication.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>LDAP password</fielddescr>
- <fieldname>ldap_password</fieldname>
- <description>Enter here the password to use to connect to the LDAP server. You may leave this field unfilled.</description>
- <type>password</type>
- </field>
- <field>
- <fielddescr>LDAP base DN</fielddescr>
- <fieldname>ldap_basedn</fieldname>
- <description>For LDAP authentication, enter here the base DN for the search (e.g., "cn=Users,dc=foobar,dc=com").</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>LDAP filter</fielddescr>
- <fieldname>ldap_filter</fieldname>
- <description>Enter the string to be used to filter the results of the search, or leave this blank to get the results unfiltered. This must be in compliance with RFC 2254, and ocurrences of the string "%s" will be set to the username given to the proxy. You generally want something like '(sAMAccountName=%s)' here.</description>
- <type>input</type>
- <default_value>(sAMAccountName=%s)</default_value>
- </field>
- <field>
- <fielddescr>RADIUS secret</fielddescr>
- <fieldname>radius_secret</fieldname>
- <description>The RADIUS secret for RADIUS authentication.</description>
- <type>password</type>
- </field>
- <field>
- <fielddescr>Backup Domain Controller</fielddescr>
- <fieldname>msnt_bdc</fieldname>
- <description>Enter the address of the Backup Domain Controller (BDC) or leave this field blank if you don't want to use a backup controller.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>NT domain</fielddescr>
- <fieldname>msnt_domain</fieldname>
- <description>Enter the NT domain to be used.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Authentication prompt</fielddescr>
- <fieldname>auth_prompt</fieldname>
- <description>This string will be displayed at the top of the authentication request window.</description>
- <type>input</type>
- <default_value>Please enter your credentials to access the proxy</default_value>
- </field>
- <field>
- <fielddescr>Authentication processes</fielddescr>
- <fieldname>auth_processes</fieldname>
- <description>The number of authenticator processes to spawn. If many authentications are expected within a short timeframe, increase this number accordingly.</description>
- <type>input</type>
- <default_value>5</default_value>
- </field>
- <field>
- <fielddescr>Authentication TTL</fielddescr>
- <fieldname>auth_ttl</fieldname>
- <description>This specifies for how long (in minutes) the proxy server assumes an externally validated username and password combination is valid (Time To Live). When the TTL expires, the user will be prompted for credentials again.</description>
- <type>input</type>
- <default_value>60</default_value>
- </field>
- <field>
- <fielddescr>Requiere authentication for unrestricted hosts</fielddescr>
- <fieldname>unrestricted_auth</fieldname>
- <description>If this option is enabled, even users tagged as unrestricted through access control are required to authenticate to use the proxy.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Subnets that don't need authentication</fielddescr>
- <fieldname>no_auth_hosts</fieldname>
- <description>A comma-separated list of subnets (in CIDR range, e.g.: 10.5.0.0/16, 192.168.1.50/32) whose hosts won't be asked for authentication to access the proxy.</description>
- <type>textarea</type>
- <cols>50</cols>
- <rows>5</rows>
- </field>
- </fields>
- <custom_php_validation_command>
- squid_validate_auth($_POST, $input_errors);
- </custom_php_validation_command>
- <custom_php_after_form_command>
- squid_print_javascript_auth2();
- </custom_php_after_form_command>
- <custom_php_resync_config_command>
- squid_resync();
- </custom_php_resync_config_command>
- <custom_php_after_head_command>
- squid_print_javascript_auth();
- </custom_php_after_head_command>
-</packagegui>
diff --git a/config/squid-head/squid_cache.xml b/config/squid-head/squid_cache.xml
deleted file mode 100644
index 6bce3d6f..00000000
--- a/config/squid-head/squid_cache.xml
+++ /dev/null
@@ -1,180 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>squidcache</name>
- <version>none</version>
- <title>Proxy server: Cache management</title>
- <include_file>squid.inc</include_file>
- <tabs>
- <tab>
- <text>General settings</text>
- <url>/pkg_edit.php?xml=squid.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Upstream proxy</text>
- <url>/pkg_edit.php?xml=squid_upstream.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Cache management</text>
- <url>/pkg_edit.php?xml=squid_cache.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Access control</text>
- <url>/pkg_edit.php?xml=squid_nac.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Traffic management</text>
- <url>/pkg_edit.php?xml=squid_traffic.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Auth settings</text>
- <url>/pkg_edit.php?xml=squid_auth.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Local users</text>
- <url>/pkg.php?xml=squid_users.xml</url>
- </tab>
- </tabs>
- <fields>
- <field>
- <fielddescr>Hard disk cache size</fielddescr>
- <fieldname>harddisk_cache_size</fieldname>
- <description>This is the amount of disk space (in megabytes) to use for cached objects.</description>
- <type>input</type>
- <required/>
- <default_value>100</default_value>
- </field>
- <field>
- <fielddescr>Memory cache size</fielddescr>
- <fieldname>memory_cache_size</fieldname>
- <description>This is the amount of physical RAM (in megabytes) to be used for negative cache and in-transit objects. This value should not exceed more than 50% of the installed RAM. The minimum value is 1MB.</description>
- <type>input</type>
- <required/>
- <default_value>8</default_value>
- </field>
- <field>
- <fielddescr>Minimum object size</fielddescr>
- <fieldname>minimum_object_size</fieldname>
- <description>Objects smaller than the size specified (in kilobytes) will not be saved on disk. The default value is 0, meaning there is no minimum.</description>
- <type>input</type>
- <required/>
- <default_value>0</default_value>
- </field>
- <field>
- <fielddescr>Maximum object size</fielddescr>
- <fieldname>maximum_object_size</fieldname>
- <description>Objects larger than the size specified (in kilobytes) will not be saved on disk. If you wish to increase speed more than you want to save bandwidth, this should be set to a low value.</description>
- <type>input</type>
- <required/>
- <default_value>4</default_value>
- </field>
- <field>
- <fielddescr>Level 1 subdirectories</fielddescr>
- <fieldname>level1_subdirs</fieldname>
- <description>Each level 1 (L1) directory contains 256 subdirectories, so a value of 256 L1 directories will use a total of 65536 directories for the hard disk cache. This will significantly slow down the startup process of the proxy service, but can speed up the caching under certain conditions.</description>
- <type>select</type>
- <default_value>16</default_value>
- <options>
- <option><name>4</name><value>4</value></option>
- <option><name>8</name><value>8</value></option>
- <option><name>16</name><value>16</value></option>
- <option><name>32</name><value>32</value></option>
- <option><name>64</name><value>64</value></option>
- <option><name>128</name><value>128</value></option>
- <option><name>256</name><value>256</value></option>
- </options>
- </field>
- <field>
- <fielddescr>Memory replacement policy</fielddescr>
- <fieldname>memory_replacement</fieldname>
- <description>The memory replacement policy determines which objects are purged from memory when space is needed. The default policy for memory replacement is GDSF.</description>
- <type>select</type>
- <default_value>heap GDSF</default_value>
- <options>
- <option><name>LRU</name><value>LRU</value></option>
- <option><name>Heap LRU</name><value>heap LRU</value></option>
- <option><name>Heap LFUDA</name><value>heap LFUDA</value></option>
- <option><name>Heap GDSF</name><value>heap GDSF</value></option>
- </options>
- </field>
- <field>
- <fielddescr>Cache replacement policy</fielddescr>
- <fieldname>cache_replacement</fieldname>
- <description>The cache replacement policy decides which objects will remain in cache and which objects are replaced to create space for the new objects. The default policy for cache replacement is LFUDA.</description>
- <type>select</type>
- <default_value>heap LFUDA</default_value>
- <options>
- <option><name>LRU</name><value>lru</value></option>
- <option><name>Heap LRU</name><value>heap LRU</value></option>
- <option><name>Heap LFUDA</name><value>heap LFUDA</value></option>
- <option><name>Heap GDSF</name><value>heap GDSF</value></option>
- </options>
- </field>
- <field>
- <fielddescr>Do not cache</fielddescr>
- <fieldname>donotcache</fieldname>
- <description>The specified domains or IP addresses (separated by commas) will never be cached.</description>
- <type>textarea</type>
- <cols>50</cols>
- <rows>5</rows>
- </field>
- <field>
- <fielddescr>Enable offline mode</fielddescr>
- <fieldname>enable_offline</fieldname>
- <description>Enable this option and the proxy server will never try to validate cached objects. The offline mode also gives access to more cached information than the proposed feature would allow (stale cached versions, where the origin server should have been contacted).</description>
- <type>checkbox</type>
- <required/>
- </field>
- </fields>
- <custom_php_validation_command>
- squid_validate_cache($_POST, $input_errors);
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- squid_resync();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/squid-head/squid_monitor.sh b/config/squid-head/squid_monitor.sh
deleted file mode 100644
index c821ae4c..00000000
--- a/config/squid-head/squid_monitor.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-# $Id$ */
-#
-# proxy_monitor.sh
-# Copyright (C) 2006 Scott Ullrich
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-
-set -e
-
-LOOP_SLEEP=300
-
-if [ -f /var/run/squid_alarm ]; then
- rm /var/run/squid_alarm
-fi
-
-# Squid monitor 1.0
-while [ /bin/true ]; do
- if [ ! -f /var/run/squid_alarm ]; then
- NUM_PROCS=`ps awux | grep "squid -D" | grep -v "grep" | wc -l | awk '{ print $1 }'`
- if [ $NUM_PROCS -lt 1 ]; then
- # squid is down
- echo "Squid has exited. Reconfiguring filter." | \
- logger -p daemon.info -i -t Squid_Alarm
- echo "Attempting restart..." | logger -p daemon.info -i -t Squid_Alarm
- /usr/local/etc/rc.d/squid.sh start
- sleep 3
- echo "Reconfiguring filter..." | logger -p daemon.info -i -t Squid_Alarm
- /etc/rc.filter_configure
- touch /var/run/squid_alarm
- fi
- fi
- NUM_PROCS=`ps awux | grep "squid -D" | grep -v "grep" | wc -l | awk '{ print $1 }'`
- if [ $NUM_PROCS -gt 0 ]; then
- if [ -f /var/run/squid_alarm ]; then
- echo "Squid has resumed. Reconfiguring filter." | \
- logger -p daemon.info -i -t Squid_Alarm
- /etc/rc.filter_configure
- rm /var/run/squid_alarm
- fi
- fi
- sleep $LOOP_SLEEP
-done
-
-if [ -f /var/run/squid_alarm ]; then
- rm /var/run/squid_alarm
-fi
-
diff --git a/config/squid-head/squid_nac.xml b/config/squid-head/squid_nac.xml
deleted file mode 100644
index 00de75e2..00000000
--- a/config/squid-head/squid_nac.xml
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>squidnac</name>
- <version>none</version>
- <title>Proxy server: Access control</title>
- <include_file>squid.inc</include_file>
- <tabs>
- <tab>
- <text>General settings</text>
- <url>/pkg_edit.php?xml=squid.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Upstream proxy</text>
- <url>/pkg_edit.php?xml=squid_upstream.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Cache management</text>
- <url>/pkg_edit.php?xml=squid_cache.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Access control</text>
- <url>/pkg_edit.php?xml=squid_nac.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Traffic management</text>
- <url>/pkg_edit.php?xml=squid_traffic.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Auth settings</text>
- <url>/pkg_edit.php?xml=squid_auth.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Local users</text>
- <url>/pkg.php?xml=squid_users.xml</url>
- </tab>
- </tabs>
- <fields>
- <field>
- <fielddescr>Allowed subnets</fielddescr>
- <fieldname>allowed_subnets</fieldname>
- <description>Those are the subnets (separated by commas) that are allowed to use the proxy. The subnets must be expressed as CIDR ranges (e.g.: 192.168.1.0/24). Note that the proxy interface subnet is already an allowed subnet. All the other subnets won't be able to use the proxy.</description>
- <type>textarea</type>
- <cols>50</cols>
- <rows>5</rows>
- </field>
- <field>
- <fielddescr>Unrestricted IPs</fielddescr>
- <fieldname>unrestricted_hosts</fieldname>
- <description>The IP addresses specified here (separated by commas) won't be filtered out by the other access control directives set in this page.</description>
- <type>textarea</type>
- <cols>50</cols>
- <rows>5</rows>
- </field>
- <field>
- <fielddescr>Unrestricted MAC Addresses</fielddescr>
- <fieldname>unrestricted_macs</fieldname>
- <description>The MAC addresses specified here (separated by commas) won't be filtered out by the other access control directives set in this page.</description>
- <type>textarea</type>
- <cols>50</cols>
- <rows>5</rows>
- </field>
- <field>
- <fielddescr>Banned host addresses</fielddescr>
- <fieldname>banned_hosts</fieldname>
- <description>The IP addresses specified here (separated by commas) won't be allowed to use the proxy.</description>
- <type>textarea</type>
- <cols>50</cols>
- <rows>5</rows>
- </field>
- <field>
- <fielddescr>Banned MAC addresses</fielddescr>
- <fieldname>banned_macs</fieldname>
- <description>The MAC addresses specified here (separated by commas) won't be allowed to use the proxy.</description>
- <type>textarea</type>
- <cols>50</cols>
- <rows>5</rows>
- </field>
- <field>
- <fielddescr>Whitelist</fielddescr>
- <fieldname>whitelist</fieldname>
- <description>Those are the sites (separated by commas) that will be accessable to the users that are allowed to use the proxy.</description>
- <type>textarea</type>
- <cols>50</cols>
- <rows>5</rows>
- </field>
- <field>
- <fielddescr>Blacklist</fielddescr>
- <fieldname>blacklist</fieldname>
- <description>Those are the sites (separated by commas) that will be blocked to the users that are allowed to use the proxy.</description>
- <type>textarea</type>
- <cols>50</cols>
- <rows>5</rows>
- </field>
- </fields>
- <custom_php_validation_command>
- squid_validate_nac($_POST, $input_errors);
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- squid_resync();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/squid-head/squid_traffic.xml b/config/squid-head/squid_traffic.xml
deleted file mode 100644
index b6865596..00000000
--- a/config/squid-head/squid_traffic.xml
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>squidtraffic</name>
- <version>none</version>
- <title>Proxy server: Traffic management</title>
- <include_file>squid.inc</include_file>
- <tabs>
- <tab>
- <text>General settings</text>
- <url>/pkg_edit.php?xml=squid.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Upstream proxy</text>
- <url>/pkg_edit.php?xml=squid_upstream.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Cache management</text>
- <url>/pkg_edit.php?xml=squid_cache.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Access control</text>
- <url>/pkg_edit.php?xml=squid_nac.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Traffic management</text>
- <url>/pkg_edit.php?xml=squid_traffic.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Auth settings</text>
- <url>/pkg_edit.php?xml=squid_auth.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Local users</text>
- <url>/pkg.php?xml=squid_users.xml</url>
- </tab>
- </tabs>
- <fields>
- <field>
- <fielddescr>Maximum download size</fielddescr>
- <fieldname>max_download_size</fieldname>
- <description>Limit the maximum total download size to the size specified here (in kilobytes). Downloads bigger than the specified size will be denied. Set to 0 to disable.</description>
- <type>input</type>
- <required/>
- <default_value>0</default_value>
- </field>
- <field>
- <fielddescr>Maximum upload size</fielddescr>
- <fieldname>max_upload_size</fieldname>
- <description>Limit the maximum total upload size to the size specified here (in kilobytes). Uploads bigger than the specified size will be denied. Set to 0 to disable.</description>
- <type>input</type>
- <required/>
- <default_value>0</default_value>
- </field>
- <field>
- <fielddescr>Overall capping</fielddescr>
- <fieldname>overall_capping</fieldname>
- <description>Caps the download speeds of the network that connects to the proxy as a whole at the specified size (in kilobytes per second). Set to 0 to disable.</description>
- <type>input</type>
- <required/>
- <default_value>0</default_value>
- </field>
- <field>
- <fielddescr>Per-host capping</fielddescr>
- <fieldname>perhost_capping</fieldname>
- <description>Caps the download speeds of each user that connects to the proxy at the specified size (in kilobytes per second). Set to 0 to disable.</description>
- <type>input</type>
- <required/>
- <default_value>0</default_value>
- </field>
- <field>
- <fielddescr>Overall bandwidth throttling</fielddescr>
- <fieldname>overall_throttling</fieldname>
- <description>This value specifies (in kilobytes per second) the bandwidth throttle for downloads. Users will gradually have their download speed increased according to this value. Set to 0 to disable bandwidth throttling.</description>
- <type>input</type>
- <required/>
- <default_value>0</default_value>
- </field>
- <field>
- <fielddescr>Per-host throttling</fielddescr>
- <fieldname>perhost_throttling</fieldname>
- <description>This value specifies the download throttling per host. Set to 0 to disable this.</description>
- <type>input</type>
- <required/>
- <default_value>0</default_value>
- </field>
- <field>
- <fielddescr>Initial bucket level</fielddescr>
- <fieldname>initial_bucket_level</fieldname>
- <description>The initial bucket level is used to determine how much is put in each bucket when a connection is established. Set to 0 to set the initial bucket level to 100%.</description>
- <type>input</type>
- <required/>
- <default_value>0</default_value>
- </field>
- <field>
- <fielddescr>Throttle only specific extensions</fielddescr>
- <fieldname>throttle_specific</fieldname>
- <description>Leave this checked to be able to choose the extensions that throttling will be applied to. Otherwise, all files will be throttled.</description>
- <type>checkbox</type>
- <enablefields>throttle_binaries,throttle_cdimages,throttle_multimedia,throttle_others</enablefields>
- <default_value>on</default_value>
- </field>
- <field>
- <fielddescr>Throttle binary files</fielddescr>
- <fieldname>throttle_binaries</fieldname>
- <description>Check this to apply bandwidth throttle to binary files. This includes compressed archives and executables.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Throttle CD images</fielddescr>
- <fieldname>throttle_cdimages</fieldname>
- <description>Check this to apply bandwidth throttle to CD image files.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Throttle multimedia files</fielddescr>
- <fieldname>throttle_multimedia</fieldname>
- <description>Check this to apply bandwidth throttle to multimedia files, such as movies or songs.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Throttle other extensions</fielddescr>
- <fieldname>throttle_others</fieldname>
- <description>Comma-separated list of extensions to apply bandwidth throttle to.</description>
- <type>input</type>
- </field>
- </fields>
- <custom_php_validation_command>
- squid_validate_traffic($_POST, $input_errors);
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- squid_resync();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/squid-head/squid_upstream.xml b/config/squid-head/squid_upstream.xml
deleted file mode 100644
index ac33b31e..00000000
--- a/config/squid-head/squid_upstream.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>squidupstream</name>
- <version>none</version>
- <title>Proxy server: Upstream proxy settings</title>
- <include_file>squid.inc</include_file>
- <tabs>
- <tab>
- <text>General settings</text>
- <url>/pkg_edit.php?xml=squid.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Upstream proxy</text>
- <url>/pkg_edit.php?xml=squid_upstream.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Cache management</text>
- <url>/pkg_edit.php?xml=squid_cache.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Access control</text>
- <url>/pkg_edit.php?xml=squid_nac.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Traffic management</text>
- <url>/pkg_edit.php?xml=squid_traffic.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Auth settings</text>
- <url>/pkg_edit.php?xml=squid_auth.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Local users</text>
- <url>/pkg.php?xml=squid_users.xml</url>
- </tab>
- </tabs>
- <fields>
- <field>
- <fielddescr>Enable forwarding</fielddescr>
- <fieldname>proxy_forwarding</fieldname>
- <description>This option enables the proxy server to forward requests to an upstream server.</description>
- <type>checkbox</type>
- <enablefields>proxy_addr,proxy_port,icp_port,username,password</enablefields>
- <required/>
- </field>
- <field>
- <fielddescr>Hostname</fielddescr>
- <fieldname>proxy_addr</fieldname>
- <description>Enter here the IP address or host name of the upstream proxy.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>TCP port</fielddescr>
- <fieldname>proxy_port</fieldname>
- <description>Enter the port to use to connect to the upstream proxy.</description>
- <type>input</type>
- <size>5</size>
- <default_value>3128</default_value>
- </field>
- <field>
- <fielddescr>ICP port</fielddescr>
- <fieldname>icp_port</fieldname>
- <description>Enter the port to connect to the upstream proxy for the ICP protocol. Use port number 7 to disable ICP communication between the proxies.</description>
- <type>input</type>
- <size>5</size>
- <default_value>7</default_value>
- </field>
- <field>
- <fielddescr>Username</fielddescr>
- <fieldname>username</fieldname>
- <description>If the upstream proxy requires a username, specify it here.</description>
- <type>input</type>
- </field>
- <field>
- <fielddescr>Password</fielddescr>
- <fieldname>password</fieldname>
- <description>If the upstream proxy requires a password, specify it here.</description>
- <type>password</type>
- </field>
- </fields>
- <custom_php_validation_command>
- squid_validate_upstream($_POST, $input_errors);
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- squid_resync();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/squid-head/squid_users.xml b/config/squid-head/squid_users.xml
deleted file mode 100644
index 34260817..00000000
--- a/config/squid-head/squid_users.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>squidusers</name>
- <version>none</version>
- <title>Proxy server: Local users</title>
- <include_file>squid.inc</include_file>
- <delete_string>A proxy server user has been deleted.</delete_string>
- <addedit_string>A proxy server user has been created/modified.</addedit_string>
- <tabs>
- <tab>
- <text>General settings</text>
- <url>/pkg_edit.php?xml=squid.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Upstream proxy</text>
- <url>/pkg_edit.php?xml=squid_upstream.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Cache management</text>
- <url>/pkg_edit.php?xml=squid_cache.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Access control</text>
- <url>/pkg_edit.php?xml=squid_nac.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Traffic management</text>
- <url>/pkg_edit.php?xml=squid_traffic.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Auth settings</text>
- <url>/pkg_edit.php?xml=squid_auth.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Local users</text>
- <url>/pkg.php?xml=squid_users.xml</url>
- <active/>
- </tab>
- </tabs>
- <adddeleteeditpagefields>
- <columnitem>
- <fielddescr>Username</fielddescr>
- <fieldname>username</fieldname>
- </columnitem>
- <columnitem>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- </columnitem>
- </adddeleteeditpagefields>
- <fields>
- <field>
- <fielddescr>Username</fielddescr>
- <fieldname>username</fieldname>
- <description>Enter the username here.</description>
- <type>input</type>
- <required/>
- </field>
- <field>
- <fielddescr>Password</fielddescr>
- <fieldname>password</fieldname>
- <description>Enter the password here.</description>
- <type>password</type>
- <required/>
- </field>
- <field>
- <fielddescr>Description</fielddescr>
- <fieldname>description</fieldname>
- <description>You may enter a description here for your reference (not parsed).</description>
- <type>input</type>
- </field>
- </fields>
- <custom_php_resync_config_command>
- squid_resync_users();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/squidGuard.xml b/config/squidGuard.xml
deleted file mode 100644
index dd837e50..00000000
--- a/config/squidGuard.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>squidGuard</name>
- <version>none</version>
- <title>none</title>
- <process_kill_command>squid</process_kill_command>
- <custom_php_install_command>
- $fout = fopen("/usr/local/etc/squid/squidGuard.conf","w");
- fwrite($fout, "# This configuration was generated by the pfSense package manager.\n");
- fwrite($fout, "logdir /usr/local/squid/logs\n");
- fwrite($fout, "dbhome /var/db/squidGuard\n");
- fwrite($fout, "dest ads {\n");
- fwrite($fout, "\t domainlist\t ads/domains\n");
- fwrite($fout, "\t urllist\t ads/urls\n");
- fwrite($fout, "}\n");
- fwrite($fout, "dest aggressive {\n");
- fwrite($fout, "\t domainlist\t aggressive/domains\n");
- fwrite($fout, "\t urllist\t aggressive/urls\n");
- fwrite($fout, "}\n");
- fwrite($fout, "dest audio-video {\n");
- fwrite($fout, "\t domainlist\t audio-video/domains\n");
- fwrite($fout, "\t urllist\t audio-video/urls\n");
- fwrite($fout, "}\n");
- fwrite($fout, "dest drugs {\n");
- fwrite($fout, "\t domainlist\t drugs/domains\n");
- fwrite($fout, "\t urllist\t drugs/urls\n");
- fwrite($fout, "}\n");
- fwrite($fout, "dest gambling {\n");
- fwrite($fout, "\t domainlist\t gambling/domains\n");
- fwrite($fout, "\t urllist\t gambling/urls\n");
- fwrite($fout, "}\n");
- fwrite($fout, "dest hacking {\n");
- fwrite($fout, "\t domainlist\t hacking/domains\n");
- fwrite($fout, "\t urllist\t hacking/urls\n");
- fwrite($fout, "}\n");
- fwrite($fout, "dest mail {\n");
- fwrite($fout, "\t domainlist\t mail/domains\n");
- fwrite($fout, "}\n");
- fwrite($fout, "dest porn {\n");
- fwrite($fout, "\t domainlist\t porn/domains\n");
- fwrite($fout, "\t urllist\t porn/urls\n");
- fwrite($fout, "}\n");
- fwrite($fout, "dest proxy {\n");
- fwrite($fout, "\t domainlist\t proxy/domains\n");
- fwrite($fout, "\t urllist\t proxy/urls\n");
- fwrite($fout, "}\n");
- fwrite($fout, "dest violence {\n");
- fwrite($fout, "\t domainlist\t violence/domains\n");
- fwrite($fout, "\t urllist\t violence/urls\n");
- fwrite($fout, "}\n");
- fwrite($fout, "dest warez {\n");
- fwrite($fout, "\t domainlist\t warez/domains\n");
- fwrite($fout, "\t urllist\t warez/urls\n");
- fwrite($fout, "}\n");
- fwrite($fout, "acl {\n");
- fwrite($fout, "\t default {\n");
- fwrite($fout, "\t pass !ads !aggressive !audio-video !drugs !gambling !hacking !mail !porn !proxy !violence !warez all\n");
- fwrite($fout, "\t redirect http://bkw.lindesign.se/tmp/denied.html");
- fwrite($fout, "\t }\n");
- fwrite($fout, "}\n");
- fclose($fout);
- add_text_to_file("/usr/local/etc/squid/squid.conf", "redirect_program /usr/local/bin/squidGuard -c /usr/local/etc/squid/squidGuard.conf");
- /* $fout = fopen("/usr/local/etc/squid/squid.conf","a");
- fwrite($fout, "redirect_program /usr/local/bin/squidGuard -c /usr/local/etc/squid/squidGuard.conf\n");
- fclose($fout); */
- mwexec("/usr/bin/touch /usr/local/squid/logs/squidGuard.log");
- mwexec("/usr/sbin/chown squid /usr/local/squid/logs/squidGuard.log");
- mwexec("/usr/bin/chgrp squid /usr/local/squid/logs/squidGuard.log");
- mwexec("/bin/chmod 744 /usr/local/squid/logs/squidGuard.log");
- mwexec("/usr/sbin/chown -R squid /var/db/squidGuard");
- mwexec("/usr/bin/chgrp -R squid /var/db/squidGuard");
- mwexec("/usr/local/sbin/squid -k reconfigure");
- </custom_php_install_command>
- <custom_php_deinstall_command>
- unlink_if_exists("/var/log/squidGuard.log");
- rmdir_recursive("/var/db/squidGuard");
- remove_text_from_file("/usr/local/etc/squid/squid.conf", "redirect_program /usr/local/bin/squidGuard -c /usr/local/etc/squid/squidGuard.conf");
- mwexec("/usr/local/sbin/squid -k reconfigure");
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/sshterm/diag_shell_head.php b/config/sshterm/diag_shell_head.php
deleted file mode 100644
index a16f0835..00000000
--- a/config/sshterm/diag_shell_head.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-/*
- diag_ping.php
- part of m0n0wall (http://m0n0.ch/wall)
-
- Copyright (C) 2003-2005 Bob Zoller (bob@kludgebox.com) and Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = array(gettext("Diagnostics"), gettext("Shell"));
-
-require("guiconfig.inc");
-
-if ($_POST) {
- unset($input_errors);
- /* NOP */
-}
-
-$pgtitle = "Diagnostics: Shell";
-include("head.inc");
-/* put your custom HTML head content here */
-/* using some of the $pfSenseHead function calls */
-echo $pfSenseHead->getHTML();
-
-?>
-<body link="#000000" vlink="#000000" alink="#000000" onload="<?= $jsevents["body"]["onload"] ?>">
-<? include("fbegin.inc"); ?>
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="diag_ping.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="10%" valign="top" class="vncellreq"><?=gettext("SSH Terminal");?>:</td>
- <td align="left" valign="top" width="90%">
- <applet width="640"
- height="480"
- archive="SSHTermApplet-signed.jar,SSHTermApplet-jdkbug-workaround-signed.jar"
- code="com.sshtools.sshterm.SshTermApplet"
- codebase="java"
- style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1">
- <param name="sshapps.connection.host" value="<?= $config['interfaces']['lan']['ipaddr'] ?>">
- <param name="sshapps.connection.userName" value="root">
- <param name="sshapps.connection.authenticationMethod" value="password">
- <param name="sshapps.connection.connectImmediately" value="true">
- <param name="sshapps.connection.sshapps.connection.showConnectionDialog" value="false">
- <param name="sshterm.ui.scrollBar" value="true">
- <param name="sshapps.ui.toolBar" value="false">
- <param name="sshapps.ui.menuBar" value="true">
- <param name="sshapps.ui.statusBar" value="true">
- <param name="sshapps.ui.disabledActions" value="Open,About">
-
- </applet>
- </td>
- </tr>
- </table>
-</form>
-</td></tr></table>
-<?php include("fend.inc"); ?>
diff --git a/config/sshterm/diag_shell_releng.php b/config/sshterm/diag_shell_releng.php
deleted file mode 100644
index 00e4d49b..00000000
--- a/config/sshterm/diag_shell_releng.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-/*
- diag_ping.php
- part of m0n0wall (http://m0n0.ch/wall)
-
- Copyright (C) 2003-2005 Bob Zoller (bob@kludgebox.com) and Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-$pgtitle = "Diagnostics: Shell";
-require("guiconfig.inc");
-
-if ($_POST) {
- unset($input_errors);
- /* NOP */
-}
-
-include("head.inc"); ?>
-<body link="#000000" vlink="#000000" alink="#000000">
-<? include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="diag_ping.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="10%" valign="top" class="vncellreq">SSH Terminal:</td>
- <td width="90%">
- <applet width="640"
- height="480"
- archive="SSHTermApplet-signed.jar,SSHTermApplet-jdkbug-workaround-signed.jar"
- code="com.sshtools.sshterm.SshTermApplet"
- codebase="java"
- style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1">
- <param name="sshapps.connection.host" value="<?= $config['interfaces']['lan']['ipaddr'] ?>">
- <param name="sshapps.connection.userName" value="root">
- <param name="sshapps.connection.authenticationMethod" value="password">
- <param name="sshapps.connection.connectImmediately" value="true">
- <param name="sshapps.connection.sshapps.connection.showConnectionDialog" value="false">
- <param name="sshterm.ui.scrollBar" value="true">
- <param name="sshapps.ui.toolBar" value="false">
- <param name="sshapps.ui.menuBar" value="true">
- <param name="sshapps.ui.statusBar" value="true">
- <param name="sshapps.ui.disabledActions" value="Open,About">
-
- </applet>
- </td>
- </tr>
- </table>
-</form>
-</td></tr></table>
-<?php include("fend.inc"); ?>
diff --git a/config/sshterm/sshterm.xml b/config/sshterm/sshterm.xml
deleted file mode 100644
index 69098f01..00000000
--- a/config/sshterm/sshterm.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>sshterm</name>
- <version>1.0</version>
- <title>Diagnostics: Shell</title>
- <aftersaveredirect />
- <!-- Menu is where this packages menu will appear -->
- <menu>
- <name>Shell</name>
- <section>Diagnostics</section>
- <configfile>sshterm.xml</configfile>
- <url>/diag_shell.php</url>
- </menu>
- <!--
- configpath gets expanded out automatically and config
- items will be stored in that location
- -->
- <configpath>['installedpackages']['sshterm']['config']</configpath>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/sshterm/diag_shell_head.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- <item>https://packages.pfsense.org/packages/config/sshterm/diag_shell_releng.php</item>
- </additional_files_needed>
- <!--
- fields gets invoked when the user adds or edits a item.
- the following items will be parsed and rendered for the
- user as a gui with input, and selectboxes.
- -->
- <fields />
- <custom_php_command_before_form>
- </custom_php_command_before_form>
- <custom_delete_php_command>
- </custom_delete_php_command>
- <custom_php_resync_config_command>
- </custom_php_resync_config_command>
- <custom_php_install_command>
- $version = file_get_contents("/etc/version");
-
- if (strpos($version, "HEAD") !== false) {
- unlink("/usr/local/www/diag_shell_releng.php");
- rename("/usr/local/www/diag_shell_head.php",
- "/usr/local/www/diag_shell.php");
- } else {
- unlink("/usr/local/www/diag_shell_head.php");
- rename("/usr/local/www/diag_shell_releng.php",
- "/usr/local/www/diag_shell.php");
- }
- </custom_php_install_command>
- <custom_php_deinstall_command>
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/states-summary/diag_states_summary.php b/config/states-summary/diag_states_summary.php
deleted file mode 100644
index 973c2630..00000000
--- a/config/states-summary/diag_states_summary.php
+++ /dev/null
@@ -1,161 +0,0 @@
-<?php
-/*
- diag_states_summary.php
- Copyright (C) 2010 Jim Pingle
-
- Portions borrowed from diag_dump_states.php:
- Copyright (C) 2005-2009 Scott Ullrich
- Copyright (C) 2005 Colin Smith
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-exec("/sbin/pfctl -s state", $states);
-
-$srcipinfo = array();
-$dstipinfo = array();
-$allipinfo = array();
-$pairipinfo = array();
-
-function addipinfo(&$iparr, $ip, $proto, $srcport, $dstport) {
- $iparr[$ip]['seen']++;
- $iparr[$ip]['protos'][$proto]['seen']++;
- if (!empty($srcport)) {
- $iparr[$ip]['protos'][$proto]['srcports'][$srcport]++;
- }
- if (!empty($dstport)) {
- $iparr[$ip]['protos'][$proto]['dstports'][$dstport]++;
- }
-}
-
-$row = 0;
-if(count($states) > 0) {
- foreach($states as $line) {
- $line_split = preg_split("/\s+/", $line);
- $type = array_shift($line_split);
- $proto = array_shift($line_split);
- $state = array_pop($line_split);
- $info = implode(" ", $line_split);
-
- /* break up info and extract $srcip and $dstip */
- $ends = preg_split("/\<?-\>?/", $info);
-
- if (strpos($info, '->') === FALSE) {
- $srcinfo = $ends[count($ends) - 1];
- $dstinfo = $ends[0];
- } else {
- $srcinfo = $ends[0];
- $dstinfo = $ends[count($ends) - 1];
- }
-
- $parts = split(":", $srcinfo);
- $srcip = trim($parts[0]);
- $srcport = trim($parts[1]);
-
- $parts = split(":", $dstinfo);
- $dstip = trim($parts[0]);
- $dstport = trim($parts[1]);
-
- addipinfo($srcipinfo, $srcip, $proto, $srcport, $dstport);
- addipinfo($dstipinfo, $dstip, $proto, $srcport, $dstport);
- addipinfo($pairipinfo, "{$srcip} -> {$dstip}", $proto, $srcport, $dstport);
-
- addipinfo($allipinfo, $srcip, $proto, $srcport, $dstport);
- addipinfo($allipinfo, $dstip, $proto, $srcport, $dstport);
-
- }
-}
-
-function sort_by_ip($a, $b) {
- return sprintf("%u", ip2long($a)) < sprintf("%u", ip2long($b)) ? -1 : 1;
-}
-
-function build_port_info($portarr, $proto) {
- $ports = array();
- asort($portarr);
- foreach (array_reverse($portarr, TRUE) as $port => $count) {
- $str = "";
- $service = getservbyport($port, strtolower($proto));
- $port = "{$proto}/{$port}";
- if ($service)
- $port = "{$port} ({$service})";
- $ports[] = "{$port}: {$count}";
- }
- return implode($ports, ', ');
-}
-
-function print_summary_table($label, $iparr, $sort = TRUE) { ?>
-
-<h3><?php echo $label; ?></h3>
-<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td class="listhdrr">IP</td>
- <td class="listhdrr"># States</td>
- <td class="listhdrr">Proto</td>
- <td class="listhdrr"># States</td>
- <td class="listhdrr">Src Ports</td>
- <td class="listhdrr">Dst Ports</td>
- </tr>
-<?php if ($sort)
- uksort($iparr, "sort_by_ip");
- foreach($iparr as $ip => $ipinfo) { ?>
- <tr>
- <td class='vncell'><?php echo $ip; ?></td>
- <td class='vncell'><?php echo $ipinfo['seen']; ?></td>
- <td class='vncell'>&nbsp;</td>
- <td class='vncell'>&nbsp;</td>
- <td class='vncell'>&nbsp;</td>
- <td class='vncell'>&nbsp;</td>
- </tr>
- <?php foreach($ipinfo['protos'] as $proto => $protoinfo) { ?>
- <tr>
- <td class='list'>&nbsp;</td>
- <td class='list'>&nbsp;</td>
- <td class='listlr'><?php echo $proto; ?></td>
- <td class='listr' align="center"><?php echo $protoinfo['seen']; ?></td>
- <td class='listr' align="center"><span title="<?php echo build_port_info($protoinfo['srcports'], $proto); ?>"><?php echo count($protoinfo['srcports']); ?></span></td>
- <td class='listr' align="center"><span title="<?php echo build_port_info($protoinfo['dstports'], $proto); ?>"><?php echo count($protoinfo['dstports']); ?></span></td>
- </tr>
- <?php } ?>
-<?php } ?>
-
-</table>
-
-<?
-}
-
-$pgtitle = "Diagnostics: State Table Summary";
-require_once("guiconfig.inc");
-include("head.inc");
-include("fbegin.inc");
-?>
-<p class="pgtitle"><?=$pgtitle?></font></p>
-
-<?
-print_summary_table("By Source IP", $srcipinfo);
-print_summary_table("By Destination IP", $dstipinfo);
-print_summary_table("Total per IP", $allipinfo);
-print_summary_table("By IP Pair", $pairipinfo, FALSE);
-?>
-
-<?php include("fend.inc"); ?>
diff --git a/config/states-summary/states-summary.xml b/config/states-summary/states-summary.xml
deleted file mode 100644
index 7071420f..00000000
--- a/config/states-summary/states-summary.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- states-summary.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2010 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>States Summary Page</description>
- <requirements>None</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>States Summary</name>
- <version>1.0</version>
- <title>Diagnostics: States Summart</title>
- <menu>
- <name>State Summary</name>
- <tooltiptext></tooltiptext>
- <section>Diagnostics</section>
- <url>/diag_states_summary.php</url>
- </menu>
- <additional_files_needed>
- <prefix>/usr/local/www/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/states-summary/diag_states_summary.php</item>
- </additional_files_needed>
- <custom_php_deinstall_command>
- <![CDATA[
- $version = file_get_contents("/etc/version");
- if ($version[0] < 2) {
- unlink_if_exists("/usr/local/www/diag_states_summary.php");
- }
- ]]>
- </custom_php_deinstall_command>
-</packagegui> \ No newline at end of file
diff --git a/config/stunnel.xml b/config/stunnel/stunnel.xml
index 21e023a9..21e023a9 100644
--- a/config/stunnel.xml
+++ b/config/stunnel/stunnel.xml
diff --git a/config/urltables/urltables.inc b/config/urltables/urltables.inc
deleted file mode 100644
index a2c372ce..00000000
--- a/config/urltables/urltables.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-function urltables_install() {
- global $g, $config;
-
- // Test to make sure the patch is not already applied.
- $out = `patch -fslC --reverse -p1 -b .before_urltables -d / -i /usr/local/pkg/urltables.patch |& grep -ci reject`;
- if ($out == 0) {
- // If the patch has not already been applied, test to see if it will apply cleanly.
- $out = `patch -fsNlC -p1 -b .before_urltables -d / -i /usr/local/pkg/urltables.patch |& grep -ci reject`;
- if ($out == 0) {
- // The patch should apply cleanly, let 'er rip.
- mwexec("patch -fsNl -p1 -b .before_urltables -d / -i /usr/local/pkg/urltables.patch ");
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/config/urltables/urltables.patch b/config/urltables/urltables.patch
deleted file mode 100644
index bdf16cb9..00000000
--- a/config/urltables/urltables.patch
+++ /dev/null
@@ -1,364 +0,0 @@
-diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
-index ba71d04..17acae3 100644
---- a/etc/inc/filter.inc
-+++ b/etc/inc/filter.inc
-@@ -415,7 +415,13 @@ function filter_generate_aliases() {
- $extraalias = "";
- $ip = find_interface_ip($alias['address']);
- $extraalias = " " . link_ip_to_carp_interface($ip);
-- $aliases .= "{$alias['name']} = \"{ {$alias['address']}{$extralias} }\"\n";
-+ if ($alias['type'] != 'urltable')
-+ $aliases .= "{$alias['name']} = \"{ {$alias['address']}{$extralias} }\"\n";
-+ else {
-+ $urlfn = alias_expand_urltable($alias['name']);
-+ if ($urlfn)
-+ $aliases .= "table <{$alias['name']}> persist file \"{$urlfn}\"\n";
-+ }
- }
- }
-
-@@ -2013,7 +2019,8 @@ function generate_user_filter_rule($rule, $ngcounter) {
- } else {
- if ($g['debug'])
- echo "{$src_table} NOT found in cache...adding\n";
-- $table_cache[$src_table] = $src_table_line;
-+ if (strpos($src_table_line, 'http://') === false)
-+ $table_cache[$src_table] = $src_table_line;
- }
- if (isset($dst_table))
- if (isset($table_cache[$dst_table])) {
-@@ -2022,7 +2029,8 @@ function generate_user_filter_rule($rule, $ngcounter) {
- } else {
- if ($g['debug'])
- echo "{$dst_table} NOT found in cache...adding\n";
-- $table_cache[$dst_table] = $dst_table_line;
-+ if (strpos($dst_table_line, 'http://') === false)
-+ $table_cache[$dst_table] = $dst_table_line;
- }
-
- /* exception(s) to a user rules can go here. */
-diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
-index c45def5..2f0f6fb 100644
---- a/etc/inc/pfsense-utils.inc
-+++ b/etc/inc/pfsense-utils.inc
-@@ -3905,4 +3905,47 @@ function update_alias_names_upon_change($section, $subsection, $fielda, $fieldb,
-
- }
-
-+function process_alias_urltable($name, $url, $freq, $forceupdate=false) {
-+ $aliastable_prefix = "/var/db/aliastables/";
-+ $aliastable_filename = $aliastable_prefix . $name . ".txt";
-+
-+ // Make the aliases directory if it doesn't exist
-+ if (!file_exists($aliastable_prefix)) {
-+ mkdir($aliastable_prefix);
-+ } elseif (!is_dir($aliastable_prefix)) {
-+ unlink($aliastable_prefix);
-+ mkdir($aliastable_prefix);
-+ }
-+
-+ // If the file doesn't exist or is older than update_freq days, fetch a new copy.
-+ if (!file_exists($aliastable_filename)
-+ || ((time() - filemtime($aliastable_filename)) > ($freq * 86400))
-+ || $forceupdate) {
-+
-+ // Try to fetch the URL supplied
-+ conf_mount_rw();
-+ unlink_if_exists($aliastable_filename . ".tmp");
-+ mwexec("/usr/bin/fetch -q -o " . escapeshellarg($aliastable_filename) . ".tmp " . escapeshellarg($url));
-+ mwexec("/usr/bin/grep -v '^#' " . escapeshellarg($aliastable_filename) . ".tmp > " . escapeshellarg($aliastable_filename));
-+ unlink_if_exists($aliastable_filename . ".tmp");
-+ conf_mount_ro();
-+ if (filesize($aliastable_filename)) {
-+ return true;
-+ } else {
-+ // If it's unfetchable or an empty file, bail
-+ return false;
-+ }
-+ } else {
-+ // File exists, and it doesn't need updated.
-+ return -1;
-+ }
-+}
-+
-+function is_valid_http_url($url) {
-+ $parsed = parse_url($url);
-+ if (($parsed['scheme'] == 'http') && (is_fqdn($parsed['host']) || is_ipaddr($parsed['host'])))
-+ return true;
-+ else
-+ return false;
-+}
- ?>
-diff --git a/etc/inc/util.inc b/etc/inc/util.inc
-index 61d2e55..efeaf01 100644
---- a/etc/inc/util.inc
-+++ b/etc/inc/util.inc
-@@ -487,6 +487,21 @@ function alias_expand_net($name) {
- return null;
- }
-
-+function alias_expand_urltable($name) {
-+ global $aliastable;
-+ $aliastable_prefix = "/var/db/aliastables/";
-+ $aliastable_filename = $aliastable_prefix . $name . ".txt";
-+
-+ if (isset($aliastable[$name])
-+ && (is_valid_http_url($aliastable[$name]))
-+ && file_exists($aliastable_filename))
-+ return $aliastable_filename;
-+ elseif (process_alias_urltable($name, $aliastable[$name], 0, true))
-+ return $aliastable_filename;
-+ else
-+ return null;
-+}
-+
- /* find out whether two subnets overlap */
- function check_subnets_overlap($subnet1, $bits1, $subnet2, $bits2) {
-
-diff --git a/etc/rc.update_urltables b/etc/rc.update_urltables
-new file mode 100755
-index 0000000..506a5b0
---- /dev/null
-+++ b/etc/rc.update_urltables
-@@ -0,0 +1,49 @@
-+#!/usr/local/bin/php -q
-+<?php
-+require_once("config.inc");
-+require_once("util.inc");
-+require_once("pfsense-utils.inc");
-+
-+if (!is_array($config['aliases']['alias'])) {
-+ // No aliases
-+ exit;
-+}
-+
-+// Gather list of urltable aliases
-+$todo = array();
-+foreach ($config['aliases']['alias'] as $alias) {
-+ if ($alias['type'] = 'urltable') {
-+ $tmp = array();
-+ $tmp['name'] = $alias['name'];
-+ $tmp['url'] = $alias['address'];
-+ $tmp['freq'] = $alias['address_subnet'];
-+ $todo[] = $tmp;
-+ }
-+}
-+
-+if (count($todo) > 0) {
-+ log_error("{$argv[0]}: Starting up.");
-+
-+ if ($argv[1] != "now") {
-+ // Wait a little before updating.
-+ $wait = mt_rand(5, 60);
-+ log_error("{$argv[0]}: Sleeping for {$wait} seconds.");
-+ sleep($wait);
-+ }
-+
-+ log_error("{$argv[0]}: Starting URL table alias updates");
-+
-+ foreach ($todo as $t) {
-+ $r = process_alias_urltable($t['name'], $t['url'], $t['freq']);
-+ if ($r == 1) {
-+ $result = "";
-+ exec("/sbin/pfctl -t " . escapeshellarg($t['name']) . " -T replace -f /var/db/aliastables/" . escapeshellarg($t['name']) . ".txt 2>&1", $result);
-+ log_error("{$argv[0]}: Updated {$t['name']} content from {$t['url']}: {$result[0]}");
-+ } elseif ($r == -1) {
-+ log_error("{$argv[0]}: {$t['name']} does not need updated.");
-+ } else {
-+ log_error("{$argv[0]}: ERROR: could not update {$t['name']} content from {$t['url']}");
-+ }
-+ }
-+}
-+?>
-\ No newline at end of file
-diff --git a/usr/local/www/firewall_aliases.php b/usr/local/www/firewall_aliases.php
-index e453200..9be52a4 100755
---- a/usr/local/www/firewall_aliases.php
-+++ b/usr/local/www/firewall_aliases.php
-@@ -85,7 +85,7 @@ if ($_GET['act'] == "del") {
- $referenced_by = $rule['descr'];
- break;
- }
-- if($rule['source']['address'] == $alias_name) {
-+ if($rule['destination']['address'] == $alias_name) {
- $is_alias_referenced = true;
- $referenced_by = $rule['descr'];
- break;
-@@ -177,11 +177,10 @@ include("head.inc");
- </td>
- <td class="listr" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';">
- <?php
-- $addresses = implode(", ", array_slice(explode(" ", $alias['address']), 0, 10));
-+ $tmpaddr = explode(" ", $alias['address']);
-+ $addresses = implode(", ", array_slice($tmpaddr, 0, 10));
- echo $addresses;
-- if(count($addresses) < 10) {
-- echo " ";
-- } else {
-+ if(count($tmpaddr) > 10) {
- echo "...";
- }
- ?>
-diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php
-index 62e1272..f88b4b3 100755
---- a/usr/local/www/firewall_aliases_edit.php
-+++ b/usr/local/www/firewall_aliases_edit.php
-@@ -65,10 +65,14 @@ if (isset($id) && $a_aliases[$id]) {
- if ($addresssubnettest)
- $pconfig['type'] = "network";
- else
-- if (is_ipaddr($address[0]))
-+ if (is_ipaddr($address[0])) {
- $pconfig['type'] = "host";
-- else
-+ } elseif (is_valid_http_url($pconfig['address'])) {
-+ $pconfig['type'] = $a_aliases[$id]['type'];
-+ $pconfig['address_subnet'] = $a_aliases[$id]['address_subnet'];
-+ } else {
- $pconfig['type'] = "port";
-+ }
-
- if($a_aliases[$id]['aliasurl'] <> "") {
- $pconfig['type'] = "url";
-@@ -99,6 +103,9 @@ if ($_POST) {
- if ($_POST['type'] == "network") {
- $reqdfields[] = "address_subnet";
- $reqdfieldsn[] = "Subnet bit count";
-+ } elseif ($_POST['type'] == "urltable") {
-+ $reqdfields[] = "address_subnet";
-+ $reqdfieldsn[] = "Update Frequency";
- }
-
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
-@@ -131,10 +138,18 @@ if ($_POST) {
- }
-
- if ($_POST['type'] == "url") {
-- if(stristr($_POST['address'], "http") == false)
-+ if(is_valid_http_url($_POST['address']) == false)
- $input_errors[] = "You must provide a valid URL to the resource.";
- }
-
-+ if ($_POST['type'] == "urltable") {
-+ if(is_valid_http_url($_POST['address']) == false)
-+ $input_errors[] = "You must provide a valid URL to the resource.";
-+ if (!is_numeric($_POST['address_subnet'])) {
-+ $input_errors[] = "A valid update frequency must be specified.";
-+ }
-+ }
-+
- if ($_POST['type'] == "port")
- if (! is_port($_POST['address']) && ! is_portrange($_POST['address']))
- $input_errors[] = "Please specify a valid port or portrange.";
-@@ -177,7 +192,25 @@ if ($_POST) {
- $final_address_details .= "||";
- $isfirst = 0;
-
-- if($_POST['type'] == "url") {
-+ if ($_POST['type'] == "urltable") {
-+ $address = "";
-+ $isfirst = 0;
-+
-+ /* item is a url type */
-+ if ($_POST['address']) {
-+ /* fetch down and add in */
-+ $isfirst = 0;
-+ $address = $_POST['address'];
-+ $alias['address_subnet'] = $_POST['address_subnet'];
-+ if (strtolower(substr($_POST['address'], 0, 4)) != "http") {
-+ $input_errors[] = "You must provide a valid URL.";
-+ $dont_update = true;
-+ } elseif (! process_alias_urltable($_POST['name'], $_POST['address'], $_POST['address_subnet'], true)) {
-+ $input_errors[] = "Unable to fetch usable data.";
-+ $dont_update = true;
-+ }
-+ }
-+ } elseif($_POST['type'] == "url") {
- $address = "";
- $isfirst = 0;
- $address_count = 2;
-@@ -355,13 +388,14 @@ $hosts_str = gettext("Host(s)");
- $ip_str = gettext("IP");
- $ports_str = gettext("Port(s)");
- $port_str = gettext("Port");
-+$urltable_str = gettext("URL Table");
- $url_str = gettext("URL");
- $update_freq_str = gettext("Update Freq.");
-
- $networks_help = gettext("Networks can be expressed like 10.0.0.0 format. Select the CIDR (network mask) that pertains to each entry.");
- $hosts_help = gettext("Enter as many hosts as you would like. Hosts should be expressed in their ip address format.");
- $ports_help = gettext("Enter as many ports as you wish. Port ranges can be expressed by seperating with a colon.");
--$url_help = gettext("Enter as many urls as you wish. Also set the time that you would like the url refreshed in days. After saving {$g['product_name']} will download the URL and import the items into the alias.");
-+$urltable_help = gettext("Enter a single URL and set the time that you would like the url refreshed in days. After saving {$g['product_name']} will download the URL and save the items as a persistent table, which works like the bogons list. (cron job to update is not added automatically)");
-
- $jscriptstr .= <<<EOD
-
-@@ -376,6 +410,7 @@ function update_box_type() {
- document.getElementById ("twocolumn").firstChild.data = "{$cidr_str}";
- document.getElementById ("threecolumn").firstChild.data = "{$description_str}";
- document.getElementById ("itemhelp").firstChild.data = "{$networks_help}";
-+ document.getElementById ("addrowbutton").style.display = 'block';
- } else if(selected == '{$hosts_str}') {
- document.getElementById ("addressnetworkport").firstChild.data = "{$hosts_str}";
- document.getElementById ("address_subnet").visible = false;
-@@ -384,6 +419,7 @@ function update_box_type() {
- document.getElementById ("twocolumn").firstChild.data = "";
- document.getElementById ("threecolumn").firstChild.data = "{$description_str}";
- document.getElementById ("itemhelp").firstChild.data = "{$hosts_help}";
-+ document.getElementById ("addrowbutton").style.display = 'block';
- } else if(selected == '{$ports_str}') {
- document.getElementById ("addressnetworkport").firstChild.data = "{$ports_str}";
- document.getElementById ("address_subnet").visible = false;
-@@ -392,6 +428,7 @@ function update_box_type() {
- document.getElementById ("twocolumn").firstChild.data = "";
- document.getElementById ("threecolumn").firstChild.data = "{$description_str}";
- document.getElementById ("itemhelp").firstChild.data = "{$ports_help}";
-+ document.getElementById ("addrowbutton").style.display = 'block';
- } else if(selected == '{$url_str}') {
- document.getElementById ("addressnetworkport").firstChild.data = "{$url_str}";
- document.getElementById ("address_subnet").visible = true;
-@@ -400,6 +437,16 @@ function update_box_type() {
- document.getElementById ("twocolumn").firstChild.data = "{$update_freq_str}";
- document.getElementById ("threecolumn").firstChild.data = "{$description_str}";
- document.getElementById ("itemhelp").firstChild.data = "{$url_help}";
-+ document.getElementById ("addrowbutton").style.display = 'block';
-+ } else if(selected == '{$urltable_str}') {
-+ document.getElementById ("addressnetworkport").firstChild.data = "{$url_str}";
-+ document.getElementById ("address_subnet").visible = true;
-+ document.getElementById ("address_subnet").disabled = false;
-+ document.getElementById ("onecolumn").firstChild.data = "{$url_str}";
-+ document.getElementById ("twocolumn").firstChild.data = "{$update_freq_str}";
-+ document.getElementById ("threecolumn").firstChild.data = "{$description_str}";
-+ document.getElementById ("itemhelp").firstChild.data = "{$urltable_help}";
-+ document.getElementById ("addrowbutton").style.display = 'none';
- }
- }
- </script>
-@@ -480,6 +527,7 @@ EOD;
- <option value="host" <?php if ($pconfig['type'] == "host") echo "selected"; ?>>Host(s)</option>
- <option value="network" <?php if ($pconfig['type'] == "network") echo "selected"; ?>>Network(s)</option>
- <option value="port" <?php if ($pconfig['type'] == "port") echo "selected"; ?>>Port(s)</option>
-+ <option value="urltable" <?php if ($pconfig['type'] == "urltable") echo "selected"; ?>>URL Table</option>
- </select>
- </td>
- </tr>
-@@ -525,7 +573,7 @@ EOD;
- <select name="address_subnet<?php echo $tracker; ?>" class="formselect" id="address_subnet<?php echo $tracker; ?>">
- <option></option>
- <?php for ($i = 32; $i >= 1; $i--): ?>
-- <option value="<?=$i;?>" <?php if ($i == $address_subnet) echo "selected"; ?>><?=$i;?></option>
-+ <option value="<?=$i;?>" <?php if (($i == $address_subnet) || ($i == $pconfig['address_subnet'])) echo "selected"; ?>><?=$i;?></option>
- <?php endfor; ?>
- </select>
- </td>
-@@ -549,8 +597,8 @@ EOD;
-
- </tfoot>
- </table>
-- <a onclick="javascript:addRowTo('maintable'); typesel_change(); return false;" href="#">
-- <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="add another entry" />
-+ <div id="addrowbutton"><a onclick="javascript:addRowTo('maintable'); typesel_change(); return false;" href="#">
-+ <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="add another entry" /></div>
- </a>
- </td>
- </tr>
diff --git a/config/urltables/urltables.xml b/config/urltables/urltables.xml
deleted file mode 100644
index c9a9062b..00000000
--- a/config/urltables/urltables.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- urltables.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Patch to add URL Table Aliases</description>
- <requirements>pfSense 1.2.3</requirements>
- <faq>None</faq>
- <name>URL Table Aliases</name>
- <version>0.2</version>
- <title>URL Table Aliases</title>
- <include_file>/usr/local/pkg/urltables.inc</include_file>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/urltables/urltables.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>077</chmod>
- <item>https://packages.pfsense.org/packages/config/urltables/urltables.patch</item>
- </additional_files_needed>
- <custom_php_install_command>
- urltables_install();
- </custom_php_install_command>
-</packagegui>
diff --git a/config/widentd.xml b/config/widentd/widentd.xml
index ca73d436..ca73d436 100644
--- a/config/widentd.xml
+++ b/config/widentd/widentd.xml
diff --git a/config/widget-snort/snort_alerts.js b/config/widget-snort/snort_alerts.js
deleted file mode 100644
index c5c743df..00000000
--- a/config/widget-snort/snort_alerts.js
+++ /dev/null
@@ -1,90 +0,0 @@
-
-var snortlines = Array();
-var snorttimer;
-var snortupdateDelay = 22000;
-var snortisBusy = false;
-var snortisPaused = false;
-
-function snort_alerts_fetch_new_rules_callback(callback_data) {
- if(snortisPaused)
- return;
-
- var data_split;
- var new_data_to_add = Array();
- var data = callback_data.content;
-
- data_split = data.split("\n");
-
- for(var x=0; x<data_split.length-1; x++) {
- /* loop through rows */
- row_split = data_split[x].split("||");
- var line = '';
- line = '<td width="30%" class="listr" >' + row_split[6] + '<br>' + row_split[7]+ '</td>';
- line += '<td width="40%" class="listr" >' + row_split[3] + '<br>' + row_split[4] + '</td>';
- line += '<td width="40%" class="listr" >' + 'Pri : ' + row_split[1] + '<br>' + 'Cat : ' + row_split[2] + '</td>';
- new_data_to_add[new_data_to_add.length] = line;
- }
- snort_alerts_update_div_rows(new_data_to_add);
- snortisBusy = false;
-}
-function snort_alerts_update_div_rows(data) {
- if(snortisPaused)
- return;
-
- var isIE = navigator.appName.indexOf('Microsoft') != -1;
- var isSafari = navigator.userAgent.indexOf('Safari') != -1;
- var isOpera = navigator.userAgent.indexOf('Opera') != -1;
- var rulestable = document.getElementById('snort_alerts');
- var rows = rulestable.getElementsByTagName('tr');
- var showanim = 1;
- if (isIE) {
- showanim = 0;
- }
- //alert(data.length);
- for(var x=0; x<data.length; x++) {
- var numrows = rows.length;
- /* if reverse logging is enabled we need to show the
- * records in a reverse order with new items appearing
- * on the top
- */
- if(isReverse == false) {
- for (var i = 1; i < numrows; i++) {
- nextrecord = i + 1;
- if(nextrecord < numrows)
- rows[i].innerHTML = rows[nextrecord].innerHTML;
- }
- } else {
- for (var i = numrows; i > 0; i--) {
- nextrecord = i + 1;
- if(nextrecord < numrows)
- rows[nextrecord].innerHTML = rows[i].innerHTML;
- }
- }
- var item = document.getElementById('snort-firstrow');
- if(x == data.length-1) {
- /* nothing */
- showanim = false;
- } else {
- showanim = false;
- }
- if (showanim) {
- item.style.display = 'none';
- item.innerHTML = data[x];
- new Effect.Appear(item);
- } else {
- item.innerHTML = data[x];
- }
- }
- /* rechedule AJAX interval */
- snorttimer = setInterval('snort_alerts_fetch_new_rules()', snortupdateDelay);
-}
-function snort_alerts_toggle_pause() {
- if(snortisPaused) {
- snortisPaused = false;
- snort_alerts_fetch_new_rules();
- } else {
- snortisPaused = true;
- }
-}
-/* start local AJAX engine */
-snorttimer = setInterval('snort_alerts_fetch_new_rules()', snortupdateDelay);
diff --git a/config/widget-snort/snort_alerts.widget.php b/config/widget-snort/snort_alerts.widget.php
deleted file mode 100644
index ddf8ac59..00000000
--- a/config/widget-snort/snort_alerts.widget.php
+++ /dev/null
@@ -1,180 +0,0 @@
-<?php
-/*
- snort_alerts.widget.php
- Copyright (C) 2009 Jim Pingle
- mod 24-07-2012
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INClUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require_once("guiconfig.inc");
-require_once("/usr/local/www/widgets/include/widget-snort.inc");
-
-global $config, $g;
-
-/* array sorting */
-function sksort(&$array, $subkey="id", $sort_ascending=false) {
- /* an empty array causes sksort to fail - this test alleviates the error */
- if(empty($array))
- return false;
- if (count($array)) {
- $temp_array[key($array)] = array_shift($array);
- };
- foreach ($array as $key => $val){
- $offset = 0;
- $found = false;
- foreach ($temp_array as $tmp_key => $tmp_val) {
- if (!$found and strtolower($val[$subkey]) > strtolower($tmp_val[$subkey])) {
- $temp_array = array_merge((array)array_slice($temp_array,0,$offset), array($key => $val), array_slice($temp_array,$offset));
- $found = true;
- };
- $offset++;
- };
- if (!$found) $temp_array = array_merge($temp_array, array($key => $val));
- };
-
- if ($sort_ascending) {
- $array = array_reverse($temp_array);
- } else $array = $temp_array;
- /* below is the complement for empty array test */
- return true;
-};
-
-/* check if firewall widget variable is set */
-$nentries = $config['widgets']['widget_snort_display_lines'];
-if (!isset($nentries) || $nentries < 0) $nentries = 5;
-
-if(isset($_POST['widget_snort_display_lines'])) {
- $config['widgets']['widget_snort_display_lines'] = $_POST['widget_snort_display_lines'];
- write_config("Saved Snort Alerts Widget Displayed Lines Parameter via Dashboard");
- header("Location: ../../index.php");
-}
-
-/* check if Snort include file exists before we use it */
-if (file_exists("/usr/local/pkg/snort/snort.inc")) {
- require_once("/usr/local/pkg/snort/snort.inc");
-
- /* retrieve snort variables */
- if (!is_array($config['installedpackages']['snortglobal']['rule']))
- $config['installedpackages']['snortglobal']['rule'] = array();
- $a_instance = &$config['installedpackages']['snortglobal']['rule'];
-
- /* read log file(s) */
- $counter=0;
- foreach ($a_instance as $instanceid => $instance) {
- $snort_uuid = $a_instance[$instanceid]['uuid'];
- $if_real = snort_get_real_interface($a_instance[$instanceid]['interface']);
-
- /* make sure alert file exists */
- if (file_exists("/var/log/snort/snort_{$if_real}{$snort_uuid}/alert")) {
- exec("tail -n{$nentries} /var/log/snort/snort_{$if_real}{$snort_uuid}/alert > /tmp/alert_{$snort_uuid}");
- if (file_exists("/tmp/alert_{$snort_uuid}")) {
- $tmpblocked = array_flip(snort_get_blocked_ips());
-
- /* 0 1 2 3 4 5 6 7 8 9 10 11 12 */
- /* File format timestamp,sig_generator,sig_id,sig_rev,msg,proto,src,srcport,dst,dstport,id,classification,priority */
- $fd = fopen("/tmp/alert_{$snort_uuid}", "r");
- while (($fields = fgetcsv($fd, 1000, ',', '"')) !== FALSE) {
- if(count($fields) < 11)
- continue;
-
- $snort_alerts[$counter]['instanceid'] = $a_instance[$instanceid]['interface'];
- // fields[0] is the timestamp. Reverse its date order to YY/MM/DD for proper sorting
- $tmp = substr($fields[0],6,2) . '/' . substr($fields[0],0,2) . '/' . substr($fields[0],3,2);
- $snort_alerts[$counter]['timestamp'] = str_replace(substr($fields[0],0,8),$tmp,$fields[0]);
- $snort_alerts[$counter]['timeonly'] = substr($fields[0], strpos($fields[0], '-')+1, -8);
- $snort_alerts[$counter]['dateonly'] = substr($fields[0], 0, strpos($fields[0], '-'));
- $snort_alerts[$counter]['src'] = $fields[6];
- $snort_alerts[$counter]['srcport'] = $fields[7];
- $snort_alerts[$counter]['dst'] = $fields[8];
- $snort_alerts[$counter]['dstport'] = $fields[9];
- $snort_alerts[$counter]['priority'] = $fields[12];
- $snort_alerts[$counter]['category'] = $fields[11];
- $counter++;
- };
- fclose($fd);
- @unlink("/tmp/alert_{$snort_uuid}");
- };
- };
- };
-
- /* sort the array */
- if (isset($config['syslog']['reverse'])) {
- sksort($snort_alerts, 'timestamp', false);
- } else {
- sksort($snort_alerts, 'timestamp', true);
- };
-} else {
- $msg = gettext("The Snort package is not installed.");
-}
-
-/* display the result */
-?>
-
-<input type="hidden" id="snort_alerts-config" name="snort_alerts-config" value="" />
-<div id="snort_alerts-settings" class="widgetconfigdiv" style="display:none;">
- <form action="/widgets/widgets/snort_alerts.widget.php" method="post" name="iformd">
- Enter number of recent alerts to display (default is 5)<br/>
- <input type="text" size="5" name="widget_snort_display_lines" class="formfld unknown" id="widget_snort_display_lines" value="<?= $config['widgets']['widget_snort_display_lines'] ?>" />
- &nbsp;&nbsp;<input id="submitd" name="submitd" type="submit" class="formbtn" value="Save" />
- </form>
-</div>
-
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tbody>
- <tr class="snort-alert-header">
- <td width="30%" class="widgetsubheader" >IF/Date</td>
- <td width="40%" class="widgetsubheader">Src/Dst</td>
- <td width="40%" class="widgetsubheader">Details</td>
- </tr>
-<?php
-$counter=0;
-if (is_array($snort_alerts)) {
- foreach ($snort_alerts as $alert) {
- echo(" <tr class='snort-alert-entry'" . $activerow . ">
- <td width='30%' class='listr'>" . $alert['instanceid'] . "<br>" . $alert['timeonly'] . " " . $alert['dateonly'] . "</td>
- <td width='40%' class='listr'>" . $alert['src'] . ":" . $alert['srcport'] . "<br>" . $alert['dst'] . ":" . $alert['dstport'] . "</td>
- <td width='40%' class='listr'>Pri : " . $alert['priority'] . "<br>Cat : " . $alert['category'] . "</td>
- </tr>");
- $counter++;
- if($counter >= $nentries) break;
- }
-} else {
- if (!empty($msg)) {
- echo (" <tr class=\"snort-alert-entry\">
- <td colspan=\"3\" align=\"center\"><br>{$msg}</br></td>
- </tr>");
- }
-}
-?>
- </tbody>
-</table>
-
-<!-- needed to display the widget settings menu -->
-<script type="text/javascript">
-//<![CDATA[
- selectIntLink = "snort_alerts-configure";
- textlink = document.getElementById(selectIntLink);
- textlink.style.display = "inline";
-//]]>
-</script>
-
diff --git a/config/widget-snort/widget-snort.inc b/config/widget-snort/widget-snort.inc
deleted file mode 100644
index b9cfbeac..00000000
--- a/config/widget-snort/widget-snort.inc
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-require_once("config.inc");
-
-//set variable for custom title
-$snort_alerts_title = "Snort Alerts";
-$snort_alerts_title_link = "snort/snort_alerts.php";
-
-function widget_snort_uninstall() {
-
- global $config;
-
- /* Remove the Snort widget from the Dashboard display list */
- $widgets = $config['widgets']['sequence'];
- if (!empty($widgets)) {
- $widgetlist = explode(",", $widgets);
- foreach ($widgetlist as $key => $widget) {
- if (strstr($widget, "snort_alerts-container"))
- unset($widgetlist[$key]);
- }
- $config['widgets']['sequence'] = implode(",", $widgetlist);
- write_config();
- }
-
- /* Remove our associated files */
- unlink("/usr/local/www/widgets/include/widget-snort.inc");
- unlink("/usr/local/www/widgets/widgets/snort_alerts.widget.php");
- unlink("/usr/local/www/widgets/javascript/snort_alerts.js");
-}
-?>
diff --git a/config/widget-snort/widget-snort.xml b/config/widget-snort/widget-snort.xml
deleted file mode 100644
index 959f9529..00000000
--- a/config/widget-snort/widget-snort.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- widget-snort.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2009 Jim Pingle
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Snort widget add-on for Dashboard package</description>
- <requirements>Dashboard package and Snort</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>widget-snort</name>
- <version>0.3.6</version>
- <title>Widget - Snort</title>
- <include_file>/usr/local/www/widgets/include/widget-snort.inc</include_file>
- <additional_files_needed>
- <prefix>/usr/local/www/widgets/javascript/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/widget-snort/snort_alerts.js</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/widgets/widgets/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/widget-snort/snort_alerts.widget.php</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/www/widgets/include/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/widget-snort/widget-snort.inc</item>
- </additional_files_needed>
- <custom_php_deinstall_command>
- widget_snort_uninstall();
- </custom_php_deinstall_command>
-</packagegui>
diff --git a/config/zebedee/zebedee.inc b/config/zebedee/zebedee.inc
deleted file mode 100755
index 90a538e7..00000000
--- a/config/zebedee/zebedee.inc
+++ /dev/null
@@ -1,329 +0,0 @@
-<?php
-/*
- zebedee.inc
- part of the Postfix package for pfSense
- Copyright (C) 2010 Erik Fonnesbeck
- Copyright (C) 2011 Marcello Coutinho
- Copyright (C) 2011 Jorge Lustosa
-
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
-*/
-require_once("util.inc");
-require_once("functions.inc");
-require_once("pkg-utils.inc");
-require_once("globals.inc");
-
-function zb_text_area_decode($text){
- return preg_replace('/\r\n/', "\n",base64_decode($text));
-}
-
-function zb_get_real_interface_address($iface) {
- global $config;
- $iface = convert_friendly_interface_to_real_interface_name($iface);
- $line = trim(shell_exec("ifconfig $iface | grep inet | grep -v inet6"));
- list($dummy, $ip, $dummy2, $netmask) = explode(" ", $line);
- return array($ip, long2ip(hexdec($netmask)));
-}
-
-function sync_package_zebedee() {
- global $config;
-
-
- $zebedee_config=$config['installedpackages']['zebedee']['config'][0];
-
-# set Default values
-if($zebedee_config['keylength']=="")$zebedee_config['keylength']="256" ;
-if($zebedee_config['keylifetime']=="")$zebedee_config['keylifetime']="36000" ;
-if($zebedee_config['maxbufsize']=="")$zebedee_config['maxbufsize']="16383" ;
-
-
-# Write main zebedee configuration file
-$fd = fopen("/usr/local/etc/server.zbd", "w");
-$cfg_file = <<<EOF
-verbosity {$zebedee_config['verbosity']}
-server true
-detached {$zebedee_config['detached']}
-udpmode {$zebedee_config['udpmode']}
-ipmode {$zebedee_config['ipmode']}
-keygenlevel {$zebedee_config['keygenlevel']}
-compression {$zebedee_config['compression']}:{$zebedee_config['compression_level']}
-keylength {$zebedee_config['keylength']}
-keylifetime {$zebedee_config['keylifetime']}
-maxbufsize {$zebedee_config['maxbufsize']}
-logfile '/var/log/zebedee.log'
-checkidfile '/usr/local/etc/clients.id'
-include '/usr/local/etc/tunnels.zbd'
-EOF;
-
- fwrite($fd, $cfg_file);
- fclose($fd);
-
- // manual restart of zebede
- mwexec_bg("/usr/local/etc/rc.d/zebedee.sh");
-
-}
-
-function zebedee_tunnels() {
- global $config;
-
- $zebedee_config=$config['installedpackages']['zebedeetunnels']['config'][0]['row'];
- $redirect = $config['installedpackages']['zebedeetunnels']['config'][0]['redirect'] ;
-
- foreach ($zebedee_config as $k => $v)
- {
- // especify only one port for this host
- if($v['port']=="") $end=" " ; else $end = ":".$v['port'] ;
- $tunnels .= "target ".$v['ipaddress'].$end."\n" ;
- }
-
-
-# Write tunnels and targets configuration file
-$fd = fopen("/usr/local/etc/tunnels.zbd", "w");
-$cfg_file = <<<EOF
-{$tunnels}
-redirect {$redirect}
-EOF;
-
- fwrite($fd, $cfg_file);
- fclose($fd);
-
- // manual restart of zebede
- mwexec_bg("/usr/local/etc/rc.d/zebedee.sh");
-
-}
-
-
-function zebedee_key()
-{
-
- global $config;
-
- $zebedee_config=$config['installedpackages']['zebedeekeys']['config'];
- $priv = exec("cat /usr/local/etc/zebedee/".$_REQUEST['id'].".priv") ;
-
- if(!$priv)
- {
- $gen_private_key = exec("/usr/local/bin/zebedee -p >> /usr/local/etc/zebedee/".$_REQUEST['id'].".priv") ;
- $public_key = exec("/usr/local/bin/zebedee -P -f /usr/local/etc/zebedee/".$_REQUEST['id'].".priv") ;
- $private_key = exec("cat /usr/local/etc/zebedee/".$_REQUEST['id'].".priv ") ;
- }
- else
- {
- $private_key = exec("cat /usr/local/etc/zebedee/".$_REQUEST['id'].".priv ") ;
- $public_key = exec("/usr/local/bin/zebedee -P -f /usr/local/etc/zebedee/".$_REQUEST['id'].".priv") ;
- }
-
- $private_key = substr($private_key,12,40) ;
- $public_key = substr($public_key,0,40) ;
- $config['installedpackages']['zebedeekeys']['config'][$_REQUEST['id']]['private_key'] = $private_key ;
- $config['installedpackages']['zebedeekeys']['config'][$_REQUEST['id']]['public_key'] = $public_key ;
-
- write_config();
-
- // write clients.id file
- foreach ($config['installedpackages']['zebedeekeys']['config'] as $key)
- {
- $clients .= $key["public_key"]." ".$key["ident"]."\n" ;
- }
-
- $fd = fopen("/usr/local/etc/clients.id", "w");
-$cfg_file = <<<EOF
-{$clients}
-EOF;
- fwrite($fd, $cfg_file);
- fclose($fd);
-
- // redirect
- header("Location: zebedee_keys.php");
-
- exit ;
-
-}
-
-
-function zebedee_start(){
- global $config;
-
- //need be implemented
-
-
-}
-
-function zebedee_validate_input($post, &$input_errors) {
- foreach ($post as $key => $value)
- {
- if (empty($value))
- continue;
- if($key == "greet_time" && !preg_match("/(\d+),(\d+)(s|m|h|w)/",$value))
- $input_errors[] = "Wrong greet time sintax.";
- if($key == "message_size_limit" && !is_numeric($value))
- $input_errors[] = "Message size limit must be numeric.";
- if($key == "process_limit" && !is_numeric($value))
- $input_errors[] = "Process limit must be numeric.";
- if($key == "freq" && (!preg_match("/^\d+(h|m|d)$/",$value) || $value == 0))
- $input_errors[] = "A valid number with a time reference is required for the field 'Frequency'";
- if (substr($key, 0, 2) == "dc" && !is_hostname($value))
- $input_errors[] = "{$value} is not a valid host name.";
- if (substr($key, 0, 6) == "domain" && is_numeric(substr($key, 6))) {
- if (!is_domain($value))
- $input_errors[] = "{$value} is not a valid domain name.";
- } else if (substr($key, 0, 12) == "mailserverip" && is_numeric(substr($key, 12))) {
- if (empty($post['domain' . substr($key, 12)]))
- $input_errors[] = "Domain for {$value} cannot be blank.";
- if (!is_ipaddr($value) && !is_hostname($value))
- $input_errors[] = "{$value} is not a valid IP address or host name.";
- }
- }
-}
-
-function zebedee_php_install_command() {
- sync_package_zebedee();
-}
-
-function zebedee_php_deinstall_command() {
-
-
- mwexec_bg("killall -9 zebedee");
-
- sleep(1);
- conf_mount_rw();
- unlink_if_exists("/usr/local/etc/rc.d/zebedee.sh");
- conf_mount_ro();
-}
-
-/* Uses XMLRPC to synchronize the changes to a remote node */
-function zebedee_sync_on_changes() {
- global $config, $g;
- log_error("[zebedee] zebedee xml_rpc is starting.");
- $synconchanges = $config['installedpackages']['zebedeesync']['config'][0]['synconchanges'];
- if(!$synconchanges)
- return;
- foreach ($config['installedpackages']['zebedeesync']['config'] as $rs ){
- foreach($rs['row'] as $sh){
- $sync_to_ip = $sh['ipaddress'];
- $password = $sh['password'];
- if($password && $sync_to_ip)
- zebedee_do_xmlrpc_sync($sync_to_ip, $password);
- }
- }
- log_error("[zebedee] postfix_xmlrpc_sync.php is ending.");
-}
-
-/* Do the actual XMLRPC sync */
-function zebedee_do_xmlrpc_sync($sync_to_ip, $password) {
- global $config, $g;
-
- if(!$password)
- return;
-
- if(!$sync_to_ip)
- return;
-
- $xmlrpc_sync_neighbor = $sync_to_ip;
- if($config['system']['webgui']['protocol'] != "") {
- $synchronizetoip = $config['system']['webgui']['protocol'];
- $synchronizetoip .= "://";
- }
- $port = $config['system']['webgui']['port'];
- /* if port is empty lets rely on the protocol selection */
- if($port == "") {
- if($config['system']['webgui']['protocol'] == "http")
- $port = "80";
- else
- $port = "443";
- }
- $synchronizetoip .= $sync_to_ip;
-
- /* xml will hold the sections to sync */
- $xml = array();
- $xml['zebedee'] = $config['installedpackages']['zebedee'];
- $xml['zebedeetunnels'] = $config['installedpackages']['zebedeetunnels'];
- $xml['zebedeekeys'] = $config['installedpackages']['zebedeekeys'];
- $xml['zebedeesync'] = $config['installedpackages']['zebedeesync'];
-
- /* assemble xmlrpc payload */
- $params = array(
- XML_RPC_encode($password),
- XML_RPC_encode($xml)
- );
-
- /* set a few variables needed for sync code borrowed from filter.inc */
- $url = $synchronizetoip;
- log_error("Beginning Postfix XMLRPC sync to {$url}:{$port}.");
- $method = 'pfsense.merge_installedpackages_section_xmlrpc';
- $msg = new XML_RPC_Message($method, $params);
- $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
- $cli->setCredentials('admin', $password);
- if($g['debug'])
- $cli->setDebug(1);
- /* send our XMLRPC message and timeout after 250 seconds */
- $resp = $cli->send($msg, "250");
- if(!$resp) {
- $error = "A communications error occurred while attempting zebedee XMLRPC sync with {$url}:{$port}.";
- log_error($error);
- file_notice("sync_settings", $error, "Zebedee Settings Sync", "");
- } elseif($resp->faultCode()) {
- $cli->setDebug(1);
- $resp = $cli->send($msg, "250");
- $error = "An error code was received while attempting zebedee XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
- log_error($error);
- file_notice("sync_settings", $error, "Postfix Settings Sync", "");
- } else {
- log_error("Zebedee XMLRPC sync successfully completed with {$url}:{$port}.");
- }
-
- /* tell zebedee to reload our settings on the destionation sync host. */
- $method = 'pfsense.exec_php';
- $execcmd = "require_once('/usr/local/pkg/zebedee.inc');\n";
- $execcmd .= "sync_package_zebedee();";
-
- /* assemble xmlrpc payload */
- $params = array(
- XML_RPC_encode($password),
- XML_RPC_encode($execcmd)
- );
-
- log_error("zebedee XMLRPC reload data {$url}:{$port}.");
- $msg = new XML_RPC_Message($method, $params);
- $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
- $cli->setCredentials('admin', $password);
- $resp = $cli->send($msg, "250");
- if(!$resp) {
- $error = "A communications error occurred while attempting zebedee XMLRPC sync with {$url}:{$port} (exec_php).";
- log_error($error);
- file_notice("sync_settings", $error, "zebedee Settings Sync", "");
- } elseif($resp->faultCode()) {
- $cli->setDebug(1);
- $resp = $cli->send($msg, "250");
- $error = "An error code was received while attempting zebedee XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
- log_error($error);
- file_notice("sync_settings", $error, "zebedee Settings Sync", "");
- } else {
- log_error("zebedee XMLRPC reload data success with {$url}:{$port} (exec_php).");
- }
-
-}
-
-?>
diff --git a/config/zebedee/zebedee.sh b/config/zebedee/zebedee.sh
deleted file mode 100755
index b431ffec..00000000
--- a/config/zebedee/zebedee.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-if [ ! -d "/usr/local/etc/zebedee" ]; then
-mkdir /usr/local/etc/zebedee
-fi
-killall zebedee
-/usr/local/bin/zebedee -t -f /usr/local/etc/server.zbd &
diff --git a/config/zebedee/zebedee.xml b/config/zebedee/zebedee.xml
deleted file mode 100644
index 2a208b27..00000000
--- a/config/zebedee/zebedee.xml
+++ /dev/null
@@ -1,304 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- zebedee.xml
- part of the Zebedee package for pfSense
- Copyright (C) 2010 Erik Fonnesbeck
- Copyright (C) 2011 Marcello Coutinho
- Copyright (C) 2011 Jorge Lustosa
-
-
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>zebedee</name>
- <version>1.2.1</version>
- <title>Zebedee Tunneling</title>
- <include_file>/usr/local/pkg/zebedee.inc</include_file>
- <menu>
- <name>Zebedee</name>
- <tooltiptext>Configure Zebedee</tooltiptext>
- <section>Services</section>
- <url>pkg_edit.php?xml=zebedee.xml&amp;id=0</url>
- </menu>
- <service>
- <name>zebedee</name>
- <rcfile>zebedee.sh</rcfile>
- <executable>zebedee</executable>
- <description>Tunneling Service</description>
- </service>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/zebedee/zebedee.inc</item>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/zebedee/zebedee_tunnels.xml</item>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/zebedee/zebedee_key_details.xml</item>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/zebedee/zebedee_sync.xml</item>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/zebedee/zebedee_del_key.php</item>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/zebedee/zebedee_get_key.php</item>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/zebedee/zebedee_keys.php</item>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/zebedee/zebedee_log.php</item>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/zebedee/zebedee_view_config.php</item>
- <prefix>/usr/local/www/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
- <additional_files_needed>
- <item>https://packages.pfsense.org/packages/config/zebedee/zebedee.sh</item>
- <prefix>/usr/local/etc/rc.d/</prefix>
- <chmod>0755</chmod>
- </additional_files_needed>
-<tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=zebedee.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Tunnels</text>
- <url>/pkg_edit.php?xml=zebedee_tunnels.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Keys</text>
- <url>/zebedee_keys.php</url>
- </tab>
- <tab>
- <text>XMLRPC Sync</text>
- <url>/pkg_edit.php?xml=zebedee_sync.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>View config files</text>
- <url>/zebedee_view_config.php</url>
- </tab>
- <tab>
- <text>View log files</text>
- <url>/zebedee_log.php</url>
- </tab>
-</tabs>
- <fields>
- <field>
- <name>Zebedee General Settings</name>
- <type>listtopic</type>
- </field>
- <field>
- <fielddescr>Enable Zebedee</fielddescr>
- <fieldname>enable_zebedee</fieldname>
- <type>checkbox</type>
- <description></description>
- </field>
- <field>
- <fielddescr>Listen interface(s)</fielddescr>
- <fieldname>enabled_interface</fieldname>
- <description><![CDATA[Interface(s) that daemon will bind to.]]></description>
- <type>interfaces_selection</type>
- <required/>
- <default_value>WAN</default_value>
- </field>
- <field>
- <fielddescr>External Address</fielddescr>
- <fieldname>external_address</fieldname>
- <type>input</type>
- <size>60</size>
- <description>
- This specifies the external name are put in client.zbd file in field serverhost. Ex: 200.111.111.22 or zebedee.example.com
- </description>
- </field>
- <field>
- <fielddescr>Verbosity</fielddescr>
- <fieldname>verbosity</fieldname>
- <type>select</type>
- <options>
- <option><name>0</name><value>0</value></option>
- <option><name>1</name><value>1</value></option>
- <option><name>2</name><value>2</value></option>
- </options>
- <description>
- This is an integer specifying the level of message logging with 0 being just error messages and 5 giving excruciating detail of the message traffic. The default (and generally most useful level) is 1.
- </description>
- </field>
- <field>
- <fielddescr>Detached</fielddescr>
- <fieldname>detached</fieldname>
- <type>select</type>
- <options>
- <option><name>enabled</name><value>true</value></option>
- <option><name>disabled</name><value>false</value></option>
- </options>
- <description>
- This is a boolean indicating whether the process should detach itself from the controlling terminal and run in the background (in UNIX terms, to run as a daemon). This is valid for both client and server and is true by default.
- </description>
- </field>
- <field>
- <fielddescr>Udp Mode</fielddescr>
- <fieldname>udpmode</fieldname>
- <type>select</type>
- <options>
- <option><name>enabled</name><value>true</value></option>
- <option><name>disabled</name><value>false</value></option>
- </options>
- <description>
- By default Zebedee handles connection-oriented TCP/IP traffic. If this keyword is set true Zebedee handles UDP/IP connectionless traffic instead.
- </description>
- </field>
- <field>
- <fielddescr>Ipmode</fielddescr>
- <fieldname>ipmode</fieldname>
- <type>select</type>
- <options>
- <option><name>tcp</name><value>tcp</value></option>
- <option><name>udp</name><value>udp</value></option>
- <option><name>both</name><value>both</value></option>
- </options>
- <description>
- Zebedee client or server can handle both TCP and UDP traffic simultaneously. This is controlled by the ipmode keyword. It can have a value of tcp, udp or both.
- </description>
- </field>
- <field>
- <fielddescr>Keygenlevel</fielddescr>
- <fieldname>keygenlevel</fieldname>
- <type>select</type>
- <options>
- <option><name>0</name><value>0</value></option>
- <option><name>1</name><value>1</value></option>
- <option><name>2</name><value>2</value></option>
- </options>
- <description>
- This is an integer between 0 and 2 inclusive that determines how strong the private key generation in Zebedee should be. The default is 2 (the strongest) and you should generally not change this unless connection set-up performance becomes unacceptable.
- </description>
- </field>
- <field>
- <fielddescr>Compression</fielddescr>
- <fieldname>compression</fieldname>
- <type>select</type>
- <options>
- <option><name>zlib</name><value>zlib</value></option>
- <option><name>bzip2</name><value>bzip2</value></option>
- </options>
- <description>
- Zebedee can support both zlib and, if enabled when it is built, bzip2 compression. This keyword specifies the type and level of compression to be used
- </description>
- </field>
- <field>
- <fielddescr>Compression Level</fielddescr>
- <fieldname>compression_level</fieldname>
- <type>select</type>
- <options>
- <option><name>0</name><value>0</value></option>
- <option><name>1</name><value>1</value></option>
- <option><name>2</name><value>2</value></option>
- <option><name>3</name><value>3</value></option>
- <option><name>4</name><value>4</value></option>
- <option><name>5</name><value>5</value></option>
- <option><name>6</name><value>6</value></option>
- <option><name>7</name><value>7</value></option>
- <option><name>8</name><value>8</value></option>
- <option><name>9</name><value>9</value></option>
- </options>
- <description>
- The level specifies the maximum compression level to used (9 is the maximum and 0 is no compression). The actual compression level used will be the minimum of the client and server values. For these purposes all bzip2 levels (except 0) are considered to be greater than all zlib levels so if either client or server does not support bzip2 the protocol degrades gracefully to using zlib.
- </description>
- </field>
- <field>
- <fielddescr>Keylength</fielddescr>
- <fieldname>keylength</fieldname>
- <type>input</type>
- <size>5</size>
- <description>
- This is an integer specifying the maximum key length (in bits) for the Blowfish encryption. It should be a multiple of 4 between 4 and 576. The key length used will be the minimum of the client and server values
- </description>
- </field>
- <field>
- <fielddescr>Keylifetime</fielddescr>
- <fieldname>keylifetime</fieldname>
- <type>input</type>
- <size>5</size>
- <description>
- If the value of this parameter is non-zero it causes the client to request the re-use of a previously established shared secret key for deriving session keys for subsequent connections. This means that on the first connection between a Zebedee client and server the full key exchange dialogue will take place to establish a shared secret key. On subsequent connections, until the key expires, the same secret key will be reused to generate a new session key. Once the key expires a new key exchange will automatically be performed when necessary.
- </description>
- </field>
- <field>
- <fielddescr>Maxbufsize</fielddescr>
- <fieldname>maxbufsize</fieldname>
- <type>input</type>
- <size>5</size>
- <description>
- This specifies the size, in bytes, of the buffer Zebedee will use to read data from applications. The actual size of buffer used will be the minimum of the client and server values.
- </description>
- </field>
- </fields>
- <custom_php_install_command>
- zebedee_php_install_command();
- </custom_php_install_command>
- <custom_php_deinstall_command>
- zebedee_php_deinstall_command();
- </custom_php_deinstall_command>
- <custom_php_validation_command>
- zebedee_validate_input($_POST, $input_errors);
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- sync_package_zebedee();
- </custom_php_resync_config_command>
-</packagegui>
diff --git a/config/zebedee/zebedee_del_key.php b/config/zebedee/zebedee_del_key.php
deleted file mode 100644
index 9b52bbd9..00000000
--- a/config/zebedee/zebedee_del_key.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/*
- zebedee_del_key.php
- part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com>
- Copyright (C) 2010 Marcello Coutinho
- Copyright (C) 2010 Jorge Lustosa
-
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version < 2.0)
- $one_two = true;
-
-$zebede_keys = $config['installedpackages']['zebedeekeys']['config'] ;
-
-// remove item
-unset($zebede_keys[$_REQUEST['id']]) ;
-
-$config['installedpackages']['zebedeekeys']['config'] = $zebede_keys ;
-write_config() ;
-
-
-// redirect
-header("Location: zebedee_keys.php");
-
-
-?>
-
-
diff --git a/config/zebedee/zebedee_get_key.php b/config/zebedee/zebedee_get_key.php
deleted file mode 100644
index ce54f954..00000000
--- a/config/zebedee/zebedee_get_key.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?
-
-require_once("pkg-utils.inc");
-
-$id= $_REQUEST['id'] ;
-//echo "<pre>" ;
-$external = $config['installedpackages']['zebedee']['config'][0]['external_address'] ;
-$chave = $config['installedpackages']['zebedeekeys']["config"][$id] ;
-
-//print_r($chave['row']) ;
-
-
-
-foreach ($chave['row'] as $k => $v)
-{
- // especify only one port for this host
-// if($v['port']=="") $end=" " ; else $end = ":".$v['port'] ;
- $tunnels .= "tunnel ".$v['loc_port'].":".$v['ipaddress'].":".$v['rmt_port']."\r\n" ;
-}
-
-
-header('Content-Type: application/download');
-header('Content-Disposition: filename=client.txt');
-
-$chave_result = <<<EOF
-verbosity 2
-server false
-message {$chave["ident"]}
-detached true
-privatekey "{$chave["private_key"]}"
-ipmode both
-compression zlib:9
-
-serverhost {$external}
-
-{$tunnels}
-
-EOF;
-
-
-echo $chave_result ;
-
-
-?> \ No newline at end of file
diff --git a/config/zebedee/zebedee_key_details.xml b/config/zebedee/zebedee_key_details.xml
deleted file mode 100644
index 98f3151c..00000000
--- a/config/zebedee/zebedee_key_details.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* ========================================================================== */
-/*
- zebedee_tunnels.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2008 Scott Ullrich <sullrich@gmail.com>
- Copyright (C) 2011 Marcello Coutinho
- Copyright (C) 2011 Jorge Lustosa
-
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>zebedeekeys</name>
- <version>0.1</version>
- <title>Zebedee key</title>
- <include_file>/usr/local/pkg/zebedee.inc</include_file>
- <tabs>
- <tab>
- <text>Keys</text>
- <url>/zebedee_keys.php</url>
- </tab>
- </tabs>
- <fields>
- <field>
- <type>listtopic</type>
- <fieldname>targets</fieldname>
- <name>Identificatin</name>
- </field>
-
-
- <field>
- <fielddescr>Name</fielddescr>
- <fieldname>ident</fieldname>
- <type>input</type>
- <size>10</size>
- <disabled>true</disabled>
- </field>
-
- <field>
- <type>listtopic</type>
- <fieldname>targets</fieldname>
- <name>Targets</name>
- </field>
- <field>
- <fielddescr>Remote Server</fielddescr>
- <fieldname>none</fieldname>
- <type>rowhelper</type>
- <rowhelper>
- <rowhelperfield>
- <fielddescr>Local Port</fielddescr>
- <fieldname>loc_port</fieldname>
- <description>Password for remote server.</description>
- <type>input</type>
- <size>5</size>
- </rowhelperfield>
- <rowhelperfield>
- <fielddescr>IP Address</fielddescr>
- <fieldname>ipaddress</fieldname>
- <description>IP Address of remote server</description>
- <type>input</type>
- <size>20</size>
- </rowhelperfield>
- <rowhelperfield>
- <fielddescr>Remote Port</fielddescr>
- <fieldname>rmt_port</fieldname>
- <description>Destionation Port</description>
- <type>input</type>
- <size>5</size>
- </rowhelperfield>
- </rowhelper>
- </field>
- </fields>
- <custom_php_resync_config_command>
- zebedee_key();
- </custom_php_resync_config_command>
- <custom_delete_php_command>
- zebedee_del_key();
- </custom_delete_php_command>
- <custom_php_command_before_form>
- unset($_POST['temp']);
- </custom_php_command_before_form>
-</packagegui> \ No newline at end of file
diff --git a/config/zebedee/zebedee_keys.php b/config/zebedee/zebedee_keys.php
deleted file mode 100644
index 58adc79d..00000000
--- a/config/zebedee/zebedee_keys.php
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php
-/*
- zebedee_keys.php
- part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com>
- Copyright (C) 2010 Marcello Coutinho
- Copyright (C) 2010 Jorge Lustosa
-
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-
-require("guiconfig.inc");
-
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version < 2.0)
- $one_two = true;
-
-$pgtitle = "Zebedee Tunneling";
-include("head.inc");
-
-error_reporting(0);
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-
-<?php if($one_two): ?>
-<p class="pgtitle"><?=$pgtitle?></font></p>
-<?php endif; ?>
-
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="varnishstat_view_config.php" method="post">
-
-<div id="mainlevel">
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
-
-
-
-<?php
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=zebedee.xml&amp;id=0");
- $tab_array[] = array(gettext("Tunnels"), false, "/pkg_edit.php?xml=zebedee_tunnels.xml&amp;id=0");
- $tab_array[] = array(gettext("Keys"), true, "/zebedee_keys.php");
- $tab_array[] = array(gettext("XMLRPC Sync"), false, "/pkg_edit.php?xml=zebedee_sync.xml&amp;id=0");
- $tab_array[] = array(gettext("View Configuration"), false, "/zebedee_view_config.php");
- $tab_array[] = array(gettext("View log files"), false, "/zebedee_log.php");
- display_top_tabs($tab_array);
-
- $zebede_keys = $config['installedpackages']['zebedeekeys']['config'] ;
- $next_row = sizeof($zebede_keys) ;
- if($next_row == 1 && !array_key_exists("config", $config['installedpackages']["zebedeekeys"]))$next_row =0 ;
-
- //echo "<pre>" ;
- //print_r($config['installedpackages']);
-?>
- </td>
- </tr>
- <tr>
- <td>
- <div id="mainarea">
-
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><?=gettext("Identifier"); ?></td>
- <td class="listhdr"><?=gettext("Public key"); ?></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td width="20" heigth="17"></td>
- <td width="20" heigth="17"></td>
- <td width="20" heigth="17"></td>
-
- <td align="left"><a href="pkg_edit.php?xml=zebedee_key_details.xml&id=<?php echo $next_row?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add key"); ?>" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <?php $i = 0; foreach ($zebede_keys as $key): ?>
- <tr>
- <td class="listlr">
- <?=htmlspecialchars($key['ident']);?>
- </td>
- <td class="listr">
- <?=htmlspecialchars($key['public_key']);?>
- </td>
- <td class="list" nowrap>
- <a href="pkg_edit.php?xml=zebedee_key_details.xml&id=<?php echo $i?>">
- <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit key"); ?>" width="17" height="17" border="0"></a>
- <a href="/zebedee_del_key.php?id=<?php echo $i?>"><img height="17" border="0" width="17" src="./themes/pfsense_ng/images/icons/icon_x.gif"></a>
- <a alt="Download client.zbd file" href="/zebedee_get_key.php?id=<?php echo $i?>" target="_blank"><img height="17" border="0" width="17" src="./themes/pfsense_ng/images/icons/icon_right.gif" alt="Download client.zbd file"></a>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
-
-
- <tr>
- <td class="list" colspan="2"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td width="20" heigth="17"></td>
- <td width="20" heigth="17"></td>
- <td width="20" heigth="17"></td>
-
- <td><a href="pkg_edit.php?xml=zebedee_key_details.xml&id=<?php echo $next_row?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add key"); ?>" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
-
-
- </div>
- </td>
- </tr>
- </table>
-</div>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/zebedee/zebedee_log.php b/config/zebedee/zebedee_log.php
deleted file mode 100644
index 4e7911c6..00000000
--- a/config/zebedee/zebedee_log.php
+++ /dev/null
@@ -1,112 +0,0 @@
-<?php
-/*
- varnishstat_view_logs.php
- part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2006 Scott Ullrich <sullrich@gmail.com>
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-
-if($_REQUEST['getactivity']) {
- $varnishstatlogs = `tail -n 100 /var/log/zebedee.log`;
- echo "<h2>Zebedee Server logs as of " . date("D M j G:i:s T Y") . "</h2>";
- echo $varnishstatlogs;
- exit;
-}
-
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version < 2.0)
- $one_two = true;
-
-$pgtitle = "Zebedee: Logs";
-include("head.inc");
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<script src="/javascript/scriptaculous/prototype.js" type="text/javascript"></script>
- <script type="text/javascript">
- function getlogactivity() {
- var url = "/zebedee_log.php";
- var pars = 'getactivity=yes';
- var myAjax = new Ajax.Request(
- url,
- {
- method: 'post',
- parameters: pars,
- onComplete: activitycallback
- });
- }
- function activitycallback(transport) {
- $('varnishstatlogs').innerHTML = '<font face="Courier"><pre>' + transport.responseText + '</pre></font>';
- setTimeout('getlogactivity()', 2500);
- }
- setTimeout('getlogactivity()', 1000);
- </script>
-<?php include("fbegin.inc"); ?>
-
-<?php if($one_two): ?>
-<p class="pgtitle"><?=$pgtitle?></font></p>
-<?php endif; ?>
-
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<div id="mainlevel">
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
-<?php
-
-$tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=zebedee.xml&amp;id=0");
- $tab_array[] = array(gettext("Tunnels"), false, "/pkg_edit.php?xml=zebedee_tunnels.xml&amp;id=0");
- $tab_array[] = array(gettext("Keys"), false, "/zebedee_keys.php");
- $tab_array[] = array(gettext("XMLRPC Sync"), false, "/pkg_edit.php?xml=zebedee_sync.xml&amp;id=0");
- $tab_array[] = array(gettext("View Configuration"), false, "/zebedee_view_config.php");
- $tab_array[] = array(gettext("View log files"), true, "/zebedee_log.php");
- display_top_tabs($tab_array);
-
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabcont" >
- <form action="zebedee_log.php" method="post">
- <div id="varnishstatlogs">
- <pre>One moment please, loading logs...</pre>
- </div>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
- </table>
-</div>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/config/zebedee/zebedee_sync.xml b/config/zebedee/zebedee_sync.xml
deleted file mode 100644
index 2a4a4e14..00000000
--- a/config/zebedee/zebedee_sync.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* ========================================================================== */
-/*
- zebedee_sync.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2008 Scott Ullrich <sullrich@gmail.com>
- Copyright (C) 2011 Marcello Coutinho
- Copyright (C) 2011 Jorge Lustosa
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>zebedeesync</name>
- <version>1.1</version>
- <title>Zebedee: Manual Sync</title>
- <include_file>/usr/local/pkg/zebedee.inc</include_file>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=zebedee.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Tunnels</text>
- <url>/pkg_edit.php?xml=zebedee_tunnels.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Keys</text>
- <url>/zebedee_keys.php</url>
- </tab>
- <tab>
- <text>XMLRPC Sync</text>
- <url>/pkg_edit.php?xml=zebedee_sync.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>View config files</text>
- <url>/zebedee_view_config.php</url>
- </tab>
- <tab>
- <text>View log files</text>
- <url>/zebedee_log.php</url>
- </tab>
- </tabs>
- <configpath>installedpackages->package->zebedee</configpath>
- <fields>
- <field>
- <type>listtopic</type>
- <fieldname>temp</fieldname>
- <name>Enable Zebedee configuration sync</name>
- </field>
- <field>
- <fielddescr>Automatically sync Zebedee configuration changes</fielddescr>
- <fieldname>synconchanges</fieldname>
- <description>Automatically sync changes to the hosts defined below.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Remote Server</fielddescr>
- <fieldname>none</fieldname>
- <type>rowhelper</type>
- <rowhelper>
- <rowhelperfield>
- <fielddescr>IP Address</fielddescr>
- <fieldname>ipaddress</fieldname>
- <description>IP Address of remote server</description>
- <type>input</type>
- <size>20</size>
- </rowhelperfield>
- <rowhelperfield>
- <fielddescr>Password</fielddescr>
- <fieldname>password</fieldname>
- <description>Password for remote server.</description>
- <type>password</type>
- <size>20</size>
- </rowhelperfield>
- </rowhelper>
- </field>
- </fields>
- <custom_php_resync_config_command>
- zebedee_sync_on_changes();
- </custom_php_resync_config_command>
- <custom_php_command_before_form>
- unset($_POST['temp']);
- </custom_php_command_before_form>
-</packagegui> \ No newline at end of file
diff --git a/config/zebedee/zebedee_tunnels.xml b/config/zebedee/zebedee_tunnels.xml
deleted file mode 100755
index 419835be..00000000
--- a/config/zebedee/zebedee_tunnels.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* ========================================================================== */
-/*
- zebedee_tunnels.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2008 Scott Ullrich <sullrich@gmail.com>
- Copyright (C) 2011 Marcello Coutinho
- Copyright (C) 2011 Jorge Lustosa
-
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>zebedeetunnels</name>
- <version>0.1</version>
- <title>Zebedee Tunneling</title>
- <include_file>/usr/local/pkg/zebedee.inc</include_file>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=zebedee.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Tunnels</text>
- <url>/pkg_edit.php?xml=zebedee_tunnels.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Keys</text>
- <url>/zebedee_keys.php</url>
- </tab>
- <tab>
- <text>XMLRPC Sync</text>
- <url>/pkg_edit.php?xml=zebedee_sync.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>View config files</text>
- <url>/zebedee_view_config.php</url>
- </tab>
- <tab>
- <text>View log files</text>
- <url>/zebedee_log.php</url>
- </tab>
- </tabs>
- <fields>
- <field>
- <type>listtopic</type>
- <fieldname>targets</fieldname>
- <name>Targets</name>
- </field>
- <field>
- <fielddescr>Remote Server</fielddescr>
- <fieldname>none</fieldname>
- <type>rowhelper</type>
- <rowhelper>
- <rowhelperfield>
- <fielddescr>IP Address</fielddescr>
- <fieldname>ipaddress</fieldname>
- <description>IP Address of remote server</description>
- <type>input</type>
- <size>20</size>
- </rowhelperfield>
- <rowhelperfield>
- <fielddescr>Port</fielddescr>
- <fieldname>port</fieldname>
- <description>Password for remote server.</description>
- <type>input</type>
- <size>5</size>
- </rowhelperfield>
- </rowhelper>
- </field>
- <field>
- <type>listtopic</type>
- <fieldname>Redirect Ports</fieldname>
- <name>Redirect Ports</name>
- </field>
- <field>
- <fielddescr>Redirects</fielddescr>
- <fieldname>redirect</fieldname>
- <type>textarea</type>
- <cols>80</cols>
- <rows>2</rows>
- <description>
- separated by comma. Ex 80,443,22
- </description>
- </field>
-
- </fields>
- <custom_php_resync_config_command>
- zebedee_tunnels();
- </custom_php_resync_config_command>
- <custom_php_command_before_form>
- unset($_POST['temp']);
- </custom_php_command_before_form>
-</packagegui> \ No newline at end of file
diff --git a/config/zebedee/zebedee_view_config.php b/config/zebedee/zebedee_view_config.php
deleted file mode 100644
index 26e0f1ff..00000000
--- a/config/zebedee/zebedee_view_config.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-/*
- varnish_view_config.php
- part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com>
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-
-require("guiconfig.inc");
-
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version < 2.0)
- $one_two = true;
-
-$pgtitle = "Zebedee: View Configuration";
-include("head.inc");
-
-?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-
-<?php if($one_two): ?>
-<p class="pgtitle"><?=$pgtitle?></font></p>
-<?php endif; ?>
-
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<form action="zebedee_view_config.php" method="post">
-
-<div id="mainlevel">
- <table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
-<?php
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=zebedee.xml&amp;id=0");
- $tab_array[] = array(gettext("Tunnels"), false, "/pkg_edit.php?xml=zebedee_tunnels.xml&amp;id=0");
- $tab_array[] = array(gettext("Keys"), false, "/zebedee_keys.php");
- $tab_array[] = array(gettext("XMLRPC Sync"), false, "/pkg_edit.php?xml=zebedee_sync.xml&amp;id=0");
- $tab_array[] = array(gettext("View Configuration"), true, "/zebedee_view_config.php");
- $tab_array[] = array(gettext("View log files"), false, "/zebedee_log.php");
- display_top_tabs($tab_array);
-?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="tabcont" >
- <p class="pgtitle">/usr/local/etc/server.zbd</font></p>
- <textarea id="zebedeetext" rows="20" cols="80">
-<?php
- $config_file = file_get_contents("/usr/local/etc/server.zbd");
- echo $config_file;
-?>
- </textarea>
- <p class="pgtitle">/usr/local/etc/tunnels.zbd</font></p>
- <textarea id="zebedeetext" rows="20" cols="80">
-<?php
- $config_file = file_get_contents("/usr/local/etc/tunnels.zbd");
- echo $config_file;
-?>
- </textarea>
-
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
- </table>
-</div>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/pkg_config.10.xml b/pkg_config.10.xml
index 4f197ef7..5266e618 100644
--- a/pkg_config.10.xml
+++ b/pkg_config.10.xml
@@ -350,7 +350,7 @@
<website>http://www.olsr.org/</website>
<descr>The olsr.org OLSR daemon is an implementation of the Optimized Link State Routing protocol. OLSR is a routing protocol for mobile ad-hoc networks. The protocol is pro-active, table driven and utilizes a technique called multipoint relaying for message flooding.</descr>
<category>Services</category>
- <config_file>https://packages.pfsense.org/packages/config/olsrd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/olsrd/olsrd.xml</config_file>
<depends_on_package_pbi>olsrd-0.6.6.2_1-##ARCH##.pbi</depends_on_package_pbi>
<build_pbi>
<port>net/olsrd</port>
@@ -459,7 +459,7 @@
<website>http://siproxd.sourceforge.net/</website>
<descr>Proxy for handling NAT of multiple SIP devices to a single public IP.</descr>
<category>Services</category>
- <config_file>https://packages.pfsense.org/packages/config/siproxd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/siproxd/siproxd.xml</config_file>
<depends_on_package_pbi>siproxd-0.8.0-##ARCH##.pbi</depends_on_package_pbi>
<pkginfolink>https://doc.pfsense.org/index.php/Siproxd_package</pkginfolink>
<build_pbi>
@@ -730,7 +730,7 @@
<website>http://www.mindrot.org/pfflowd.html</website>
<descr>pfflowd converts OpenBSD PF status messages (sent via the pfsync interface) to Cisco NetFlow datagrams. These datagrams may be sent (via UDP) to a host of one's choice. Utilising the OpenBSD stateful packet filter infrastructure means that flow tracking is very fast and accurate.</descr>
<category>Network Management</category>
- <config_file>https://packages.pfsense.org/packages/config/pfflowd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/pfflowd/pfflowd.xml</config_file>
<depends_on_package_pbi>pfflowd-0.8-##ARCH##.pbi</depends_on_package_pbi>
<version>0.8 pkg v1.0.2</version>
<status>Stable</status>
@@ -752,7 +752,7 @@
<status>Stable</status>
<pkginfolink>https://doc.pfsense.org/index.php/Widentd_package</pkginfolink>
<required_version>2.2</required_version>
- <config_file>https://packages.pfsense.org/packages/config/widentd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/widentd/widentd.xml</config_file>
<configurationfile>widentd.xml</configurationfile>
<build_pbi>
<port>net/widentd</port>
@@ -810,7 +810,7 @@
<status>Stable</status>
<pkginfolink>https://doc.pfsense.org/index.php/Stunnel_package</pkginfolink>
<required_version>2.2</required_version>
- <config_file>https://packages.pfsense.org/packages/config/stunnel.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/stunnel/stunnel.xml</config_file>
<configurationfile>stunnel.xml</configurationfile>
<build_pbi>
<port>security/stunnel</port>
@@ -822,7 +822,7 @@
<website>http://dast.nlanr.net/Projects/Iperf/</website>
<descr>Iperf is a tool for testing network throughput, loss, and jitter.</descr>
<category>Network Management</category>
- <config_file>https://packages.pfsense.org/packages/config/iperf.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/iperf/iperf.xml</config_file>
<depends_on_package_pbi>iperf-2.0.5-##ARCH##.pbi</depends_on_package_pbi>
<version>2.0.5_1</version>
<status>Beta</status>
@@ -838,7 +838,7 @@
<website>http://freshmeat.net/projects/netio/</website>
<descr>This is a network benchmark for DOS, OS/2 2.x, Windows NT/2000 and Unix. It measures the net throughput of a network via NetBIOS and/or TCP/IP protocols (Unix and DOS only support TCP/IP) using various different packet sizes.</descr>
<category>Network Management</category>
- <config_file>https://packages.pfsense.org/packages/config/netio.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/netio/netio.xml</config_file>
<depends_on_package_pbi>netio-1.26-##ARCH##.pbi</depends_on_package_pbi>
<version>1.26</version>
<required_version>2.2</required_version>
@@ -858,7 +858,7 @@
<version>0.85_1.1</version>
<status>Stable</status>
<required_version>2.2</required_version>
- <config_file>https://packages.pfsense.org/packages/config/mtr-nox11.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/mtr-nox11/mtr-nox11.xml</config_file>
<configurationfile>mtr-nox11.xml</configurationfile>
<build_pbi>
<port>net/mtr</port>
@@ -956,7 +956,7 @@
<version>2.1.a15_8 pkg v1.1.2</version>
<status>ALPHA</status>
<required_version>2.2</required_version>
- <config_file>https://packages.pfsense.org/packages/config/arpwatch.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/arpwatch/arpwatch.xml</config_file>
<configurationfile>arpwatch.xml</configurationfile>
<logging>
<facilityname>arpwatch</facilityname>
diff --git a/pkg_config.7.xml b/pkg_config.7.xml
deleted file mode 100644
index 749914c4..00000000
--- a/pkg_config.7.xml
+++ /dev/null
@@ -1,1061 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- pfSense packages -->
-<pfsensepkgs>
- <packages>
- <package>
- <name>Filer</name>
- <website/>
- <descr>Allows you to create and overwrite files from the GUI.</descr>
- <category>File Management</category>
- <pkginfolink>https://doc.pfsense.org/index.php/Filer_package</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/filer/filer.xml</config_file>
- <version>0.60</version>
- <status>Beta</status>
- <required_version>1.2.3</required_version>
- <maintainer>bscholer@cshl.edu</maintainer>
- <configurationfile>filer.xml</configurationfile>
- </package>
- <package>
- <name>File Manager</name>
- <website/>
- <descr>PHP File Manager</descr>
- <category>Diagnostics</category>
- <pkginfolink>https://forum.pfsense.org/index.php/topic,26974.0.html</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/filemgr/filemgr.xml</config_file>
- <version>0.1.4</version>
- <status>Beta</status>
- <required_version>1.2.2</required_version>
- <maintainer>tom@tomschaefer.org</maintainer>
- <configurationfile>filemgr.xml</configurationfile>
- </package>
- <package>
- <name>IP-Blocklist</name>
- <website/>
- <descr>IP-Blocklist is the new PeerBlock. IP lists are used to add deny/allow rules to the firewall for in &amp; out traffic.</descr>
- <category>Firewall</category>
- <pkginfolink>https://forum.pfsense.org/index.php/topic,24769.0.html</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/ipblocklist/7/ipblocklist.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.3.4</version>
- <status>Beta</status>
- <required_version>1.2.2</required_version>
- <maintainer>tom@tomschaefer.org</maintainer>
- <configurationfile>ipblocklist.xml</configurationfile>
- </package>
- <package>
- <name>anyterm</name>
- <descr>Ajax Interactive Shell - Have you ever wanted SSH or telnet access to your system from an internet desert - from behind a strict firewall, from an internet cafe, or even from a mobile phone? Anyterm is a combination of a web page and a process that runs on your web server that provides this access. WARNING! We suggest using Stunnel in combination with this package!</descr>
- <website>http://anyterm.org/</website>
- <pkginfolink>https://doc.pfsense.org/index.php/AnyTerm_package</pkginfolink>
- <category>Diagnostics</category>
- <version>0.5</version>
- <status>BETA</status>
- <required_version>1.2.3</required_version>
- <config_file>http://packages.pfsense.org/packages/config/anyterm/anyterm.xml</config_file>
- <configurationfile>anyterm.xml</configurationfile>
- </package>
- <package>
- <pkginfolink>https://doc.pfsense.org/index.php/haproxy_package</pkginfolink>
- <name>haproxy</name>
- <descr>The Reliable, High Performance TCP/HTTP Load Balancer</descr>
- <website>http://haproxy.1wt.eu/</website>
- <category>Services</category>
- <version>0.32</version>
- <status>BETA</status>
- <required_version>1.2.3</required_version>
- <config_file>http://packages.pfsense.org/packages/config/haproxy/haproxy.xml</config_file>
- <configurationfile>haproxy.xml</configurationfile>
- </package>
- <package>
- <pkginfolink>https://doc.pfsense.org/index.php/haproxy_package</pkginfolink>
- <name>haproxy-stable</name>
- <descr>The Reliable, High Performance TCP/HTTP Load Balancer</descr>
- <website>http://haproxy.1wt.eu/</website>
- <category>Services</category>
- <version>0.30</version>
- <status>BETA</status>
- <required_version>1.2.3</required_version>
- <config_file>http://packages.pfsense.org/packages/config/haproxy-stable/haproxy.xml</config_file>
- <configurationfile>haproxy.xml</configurationfile>
- </package>
- <package>
- <name>Proxy Server with mod_security</name>
- <pkginfolink>https://doc.pfsense.org/index.php/ProxyServerModSecurity_package</pkginfolink>
- <website>http://www.modsecurity.org/</website>
- <descr>ModSecurity is a web application firewall that can work either embedded or as a reverse proxy. It provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring, logging and real-time analysis. In addition this package allows URL forwarding which can be convenient for hosting multiple websites behind pfSense using 1 IP address.</descr>
- <category>Network Management</category>
- <version>0.1.2</version>
- <status>ALPHA</status>
- <required_version>1.2.3</required_version>
- <config_file>http://packages.pfsense.org/packages/config/apache_mod_security/apache_mod_security.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>mod_security-2.5.9.tbz</depends_on_package>
- <depends_on_package>apache-2.2.11_7.tbz</depends_on_package>
- <depends_on_package>db42-4.2.52_5.tbz</depends_on_package>
- <depends_on_package>gdbm-1.8.3_3.tbz</depends_on_package>
- <depends_on_package>apr-gdbm-db42-1.3.5.1.3.7_3.tbz</depends_on_package>
- <configurationfile>apache_mod_security.xml</configurationfile>
- <after_install_info>Please visit the ProxyServer settings tab and set the service up so that it may be started.</after_install_info>
- </package>
- <package>
- <name>pure-ftpd</name>
- <website>http://www.pureftpd.org/</website>
- <descr>*DO NOT RUN THIS ON A FIREWALL. USE A DEDICATED MACHINE!* Pure FTPd Server is a fast, production quality, standards-conformant FTP server based on Troll-FTPd. It has no known vulnerabilities, is trivial to set up, and is especially designed for modern kernels. Features include PAM support, IPv6, chroot()ed home directories, virtual domains, built-in 'ls', FXP protocol, anti-warez system, bandwidth throttling, restricted ports for passive downloads, an LDAP backend, XML output, and more.</descr>
- <category>FTP</category>
- <config_file>http://packages.pfsense.org/packages/config/pure-ftpd.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>pure-ftpd-1.0.20_3.tbz</depends_on_package>
- <version>1.0.21</version>
- <status>Stable</status>
- <configurationfile>pure-ftpd.xml</configurationfile>
- <required_version>2.0</required_version>
- <logging>
- <facilityname>ftp</facilityname>
- <logfilename>pure-ftpd.log</logfilename>
- </logging>
- </package>
- <package>
- <name>Avahi</name>
- <pkginfolink>https://doc.pfsense.org/index.php/Avahi_package</pkginfolink>
- <website>http://www.avahi.org/</website>
- <descr>Avahi is a system which facilitates service discovery on a local network. This means that you can plug your laptop or computer into a network and instantly be able to view other people who you can chat with, find printers to print to or find files being shared. This kind of technology is already found in Apple MacOS X (branded Rendezvous, Bonjour and sometimes Zeroconf) and is very convenient. Avahi is mainly based on Lennart Poettering's flexmdns mDNS implementation for Linux which has been discontinued in favour of Avahi.</descr>
- <category>Network Management</category>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.6.25_2</version>
- <status>ALPHA</status>
- <required_version>1.2.3</required_version>
- <config_file>http://packages.pfsense.org/packages/config/avahi/avahi.xml</config_file>
- <configurationfile>avahi.xml</configurationfile>
- <after_install_info>Please visit the Avahi settings tab and select which interfaces you do not wish Avahi to listen on and click save to start the service.</after_install_info>
- </package>
- <package>
- <name>ntop</name>
- <website>http://www.ntop.org/</website>
- <descr>ntop is a network probe that shows network usage in a way similar to what top does for processes. In interactive mode, it displays the network status on the user's terminal. In Web mode it acts as a Web server, creating an HTML dump of the network status. It sports a NetFlow/sFlow emitter/collector, an HTTP-based client interface for creating ntop-centric monitoring applications, and RRD for persistently storing traffic statistics.</descr>
- <category>Network Management</category>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>ntop-3.3.8.tbz</depends_on_package>
- <depends_on_package>gdbm-1.8.3_3.tbz</depends_on_package>
- <depends_on_package>perl-5.8.8_1.tbz</depends_on_package>
- <version>3.3.8</version>
- <status>BETA</status>
- <required_version>1.2.1</required_version>
- <config_file>http://packages.pfsense.org/packages/config/ntop/ntop.xml</config_file>
- <configurationfile>ntop.xml</configurationfile>
- <noembedded>true</noembedded>
- </package>
- <package>
- <name>Pubkey</name>
- <descr>pfSense release key</descr>
- <website>http://pfsense.org</website>
- <category>System</category>
- <version>1.0</version>
- <required_version>1.0</required_version>
- <status>RELEASE</status>
- <pkginfolink>https://doc.pfsense.org/index.php/Pubkey_package</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/pubkey.xml</config_file>
- <configurationfile>pubkey.xml</configurationfile>
- <after_install_info>The pfSense release key has been updated.</after_install_info>
- </package>
- <package>
- <name>Dashboard</name>
- <descr>Adds pfSense dashboard that will be included with 2.0. WARNING! Cannot be deinstalled.</descr>
- <category>System</category>
- <config_file>http://packages.pfsense.org/packages/config/dashboard/dashboard.xml</config_file>
- <version>0.8.8</version>
- <status>BETA</status>
- <required_version>1.2</required_version>
- <maximum_version>1.9</maximum_version>
- <configurationfile>dashboard.xml</configurationfile>
- </package>
- <package>
- <name>Dashboard Widget: Snort</name>
- <descr>Dashboard widget for Snort.</descr>
- <category>System</category>
- <config_file>http://packages.pfsense.org/packages/config/widget-snort/widget-snort.xml</config_file>
- <version>0.3</version>
- <status>BETA</status>
- <required_version>1.2</required_version>
- <configurationfile>widget-snort.xml</configurationfile>
- </package>
- <package>
- <name>Dashboard Widget: HAVP</name>
- <descr>Dashboard widget for HAVP alerts.</descr>
- <category>System</category>
- <config_file>http://packages.pfsense.org/packages/config/widget-havp/widget-havp.xml</config_file>
- <version>0.1</version>
- <status>BETA</status>
- <required_version>1.2</required_version>
- <configurationfile>widget-havp.xml</configurationfile>
- </package>
- <package>
- <name>Dashboard Widget: Antivirus Status</name>
- <descr>Dashboard widget for HAVP status.</descr>
- <category>System</category>
- <config_file>http://packages.pfsense.org/packages/config/widget-antivirus/widget-antivirus.xml</config_file>
- <version>0.1</version>
- <status>BETA</status>
- <required_version>1.2</required_version>
- <configurationfile>widget-havp.xml</configurationfile>
- </package>
- <package>
- <name>FreeSWITCH</name>
- <website>http://www.freeswitch.org/</website>
- <descr>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. pfSense 1.2.3 or higher is recommended.</descr>
- <category>Services</category>
- <pkginfolink>https://doc.pfsense.org/index.php/FreeSWITCH</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/freeswitch/freeswitch.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.9.6</version>
- <status>Beta</status>
- <required_version>1.2.1</required_version>
- <maintainer>markjcrane@gmail.com</maintainer>
- <configurationfile>freeswitch.xml</configurationfile>
- <noembedded>true</noembedded>
- </package>
- <package>
- <name>FreeSWITCH Dev</name>
- <website>http://www.freeswitch.org/</website>
- <descr>FreeSWITCH package development version.</descr>
- <category>Services</category>
- <pkginfolink>https://doc.pfsense.org/index.php/FreeSWITCH</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/freeswitch_dev/freeswitch.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.9.7.26</version>
- <status>Beta</status>
- <required_version>1.2.3</required_version>
- <maintainer>markjcrane@gmail.com</maintainer>
- <configurationfile>freeswitch.xml</configurationfile>
- <noembedded>true</noembedded>
- </package>
- <package>
- <name>Notes</name>
- <website/>
- <descr>Track things you want to note for this system.</descr>
- <category>Status</category>
- <pkginfolink/>
- <config_file>http://packages.pfsense.org/packages/config/notes/notes.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.2.4</version>
- <status>Stable</status>
- <required_version>1.2.1</required_version>
- <maintainer>markjcrane@gmail.com</maintainer>
- <configurationfile>notes.xml</configurationfile>
- </package>
- <package>
- <name>TFTP</name>
- <website/>
- <descr>Trivial File Transport Protocol is a very simple file transfer protocol. Often used with routers, voip phones and more.</descr>
- <category>Services</category>
- <pkginfolink/>
- <config_file>http://packages.pfsense.org/packages/config/tftp/tftp.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>1.0.7</version>
- <status>Stable</status>
- <required_version>1.2.1</required_version>
- <maintainer>markjcrane@gmail.com</maintainer>
- <configurationfile>tftp.xml</configurationfile>
- </package>
- <package>
- <name>PHPService</name>
- <website/>
- <descr>PHP run as a service it can do anything PHP can do including but not limited to monitoring files, CPU, RAM, and send alerts to the syslog.</descr>
- <category>Services</category>
- <pkginfolink>https://doc.pfsense.org/index.php/PHPService</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/phpservice/phpservice.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.4.1</version>
- <status>Beta</status>
- <required_version>1.2.1</required_version>
- <maintainer>markjcrane@gmail.com</maintainer>
- <configurationfile>phpservice.xml</configurationfile>
- </package>
- <package>
- <name>Backup</name>
- <website/>
- <descr>Tool to Backup and Restore files and directories.</descr>
- <category>System</category>
- <pkginfolink></pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/backup/backup.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.1.7</version>
- <status>Stable</status>
- <required_version>1.2</required_version>
- <maintainer>markjcrane@gmail.com</maintainer>
- <configurationfile>backup.xml</configurationfile>
- </package>
- <package>
- <name>Cron</name>
- <website/>
- <descr>The cron utility is used to manage commands on a schedule.</descr>
- <category>Services</category>
- <pkginfolink></pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/cron/cron.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.2.2</version>
- <status>Beta</status>
- <required_version>1.2</required_version>
- <maintainer>markjcrane@gmail.com</maintainer>
- <configurationfile>cron.xml</configurationfile>
- </package>
- <package>
- <name>Shellcmd</name>
- <website/>
- <descr>The shellcmd utility is used to manage commands on system startup.</descr>
- <category>Services</category>
- <pkginfolink></pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/shellcmd/shellcmd.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.5</version>
- <status>Beta</status>
- <required_version>1.2</required_version>
- <maintainer>markjcrane@gmail.com</maintainer>
- <configurationfile>shellcmd.xml</configurationfile>
- </package>
- <package>
- <name>DenyHosts</name>
- <website/>
- <descr>DenyHosts analyzes logs for SSH login attempts and blocks offending IP addresses.</descr>
- <category>Services</category>
- <pkginfolink></pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/denyhosts/denyhosts.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.5.1</version>
- <status>Beta</status>
- <required_version>1.2.3</required_version>
- <maintainer>markjcrane@gmail.com</maintainer>
- <configurationfile>denyhosts.xml</configurationfile>
- </package>
- <package>
- <name>DNS Blacklist</name>
- <website/>
- <descr>DNS Blacklist uses dnsmasq entries to block domain names by category.</descr>
- <category>Services</category>
- <pkginfolink></pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/dnsblacklist/dnsblacklist.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.2.4</version>
- <status>Beta</status>
- <required_version>1.2.2</required_version>
- <maintainer>markjcrane@gmail.com</maintainer>
- <configurationfile>dnsblacklist.xml</configurationfile>
- </package>
- <package>
- <name>vHosts</name>
- <website/>
- <descr>It is a web server package that can host HTML, Javascript, CSS, and PHP. It uses the lighttpd web server that is already installed. It uses PHP5 in FastCGI mode and has access to PHP Data Ojbects and PDO SQLite.</descr>
- <category>Services</category>
- <pkginfolink>https://doc.pfsense.org/index.php/vhosts</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/vhosts/vhosts.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.7.4</version>
- <status>Stable</status>
- <required_version>1.2.3</required_version>
- <maintainer>markjcrane@gmail.com</maintainer>
- <configurationfile>vhosts.xml</configurationfile>
- </package>
- <package>
- <name>snort-old</name>
- <pkginfolink>https://forum.pfsense.org/index.php/topic,16847.0.html</pkginfolink>
- <website>http://www.snort.org</website>
- <descr>WARNING: This is the old snort package. A few current snort.org rules are not supported in this package. This package will not be supported in Pfsense 2.0.</descr>
- <category>Security</category>
- <depends_on_package_base_url>http://files.pfsense.org/packages/70/All/</depends_on_package_base_url>
- <depends_on_package>libdnet-1.11_3.tbz</depends_on_package>
- <depends_on_package>pcre-7.9.tbz</depends_on_package>
- <depends_on_package>perl-5.8.9_3.tbz</depends_on_package>
- <depends_on_package>mysql-client-5.1.34.tbz</depends_on_package>
- <depends_on_package>snort-2.8.4.1_1.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/snort-old/snort.xml</config_file>
- <version>2.8.4.1_5 pkg v.1.8</version>
- <required_version>1.2.3</required_version>
- <status>legacy</status>
- <configurationfile>snort.xml</configurationfile>
- <after_install_info>Please visit the Snort settings tab and enter your oinkid code. Afterwards visit the update rules tab to download the snort rules.</after_install_info>
- </package>
- <package>
- <name>snort</name>
- <pkginfolink>https://forum.pfsense.org/index.php/topic,16847.0.html</pkginfolink>
- <website>http://www.snort.org</website>
- <descr>Used by fortune 500 companies and governments Snort is the most widely deployed IDS/IPS technology worldwide. It features rules based logging and can perform content searching/matching in addition to being used to detect a variety of other attacks and probes, such as buffer overflows, stealth port scans, CGI attacks, SMB probes, and much more.</descr>
- <category>Security</category>
- <depends_on_package_base_url>http://packages.pfsense.org/packages/config/snort/bin/7.3.x86/</depends_on_package_base_url>
- <depends_on_package>pcre-8.10.tbz</depends_on_package>
- <depends_on_package>mysql-client-5.1.50_1.tbz</depends_on_package>
- <depends_on_package>snort-2.8.6.1.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/snort/snort.xml</config_file>
- <version>2.8.6.1 pkg v. 1.35</version>
- <required_version>1.2.3</required_version>
- <status>Stable</status>
- <configurationfile>/snort.xml</configurationfile>
- <after_install_info>Please visit the Snort settings tab and enter your oinkid code. Afterwards visit the update rules tab to download the snort rules.</after_install_info>
- </package>
- <package>
- <name>siproxd</name>
- <website>http://siproxd.sourceforge.net/</website>
- <descr>Proxy for handling NAT of multiple SIP devices to a single public IP.</descr>
- <category>Services</category>
- <config_file>http://packages.pfsense.org/packages/config/siproxd.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>siproxd-0.8.0.tbz</depends_on_package>
- <pkginfolink>https://doc.pfsense.org/index.php/Siproxd_package</pkginfolink>
- <version>0.8.0_2</version>
- <status>Beta</status>
- <required_version>1.2.1</required_version>
- <configurationfile>siproxd.xml</configurationfile>
- </package>
- <package>
- <name>OpenBGPD</name>
- <descr>OpenBGPD is a FREE implementation of the Border Gateway Protocol, Version 4. It allows ordinary machines to be used as routers exchanging routes with other systems speaking the BGP protocol.</descr>
- <category>NET</category>
- <config_file>http://packages.pfsense.org/packages/config/openbgpd/openbgpd.xml</config_file>
- <version>0.4.2</version>
- <status>STABLE</status>
- <required_version>1.3</required_version>
- <configurationfile>openbgpd.xml</configurationfile>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>openbgpd-4.5.20090709.tbz</depends_on_package>
- </package>
- <package>
- <name>Lightsquid</name>
- <descr>High performance web proxy report. Requires squid.</descr>
- <website>http://lightsquid.sf.net/</website>
- <category>Network</category>
- <version>1.7.1 pkg v.1.2</version>
- <maintainer>dv_serg@mail.ru</maintainer>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>lightsquid-1.7.1_1.tbz</depends_on_package>
- <depends_on_package>perl-5.8.8_1.tbz</depends_on_package>
- <status>Beta1</status>
- <required_version>1.2.1</required_version>
- <config_file>http://packages.pfsense.org/packages/config/lightsquid/lightsquid.xml</config_file>
- <configurationfile>lightsquid.xml</configurationfile>
- <noembedded>true</noembedded>
- </package>
- <package>
- <name>vnstat</name>
- <website>http://humdi.net/vnstat/</website>
- <descr>A console-based network traffic monitor + vnstat PHP frontend</descr>
- <pkginfolink>https://forum.pfsense.org/index.php/topic,14179.0.html</pkginfolink>
- <category>Network Management</category>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>vnstat-1.6_3.tbz</depends_on_package>
- <version>1.6.3</version>
- <status>Stable</status>
- <required_version>1.2.3</required_version>
- <maintainer>crazypark2@yahoo.dk</maintainer>
- <config_file>http://packages.pfsense.org/packages/config/vnstat/vnstat.xml</config_file>
- <configurationfile>vnstat.xml</configurationfile>
- <after_install_info></after_install_info>
- </package>
- <package>
- <name>phpSysInfo</name>
- <website>http://phpsysinfo.sourceforge.net/</website>
- <descr>PHPSysInfo is a customizable PHP Script that parses /proc, and formats information nicely. It will display information about system facts like Uptime, CPU, Memory, PCI devices, SCSI devices, IDE devices, Network adapters, Disk usage, and more.</descr>
- <category>System</category>
- <version>2.5.4</version>
- <status>Beta</status>
- <required_version>1.0</required_version>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>mbmon-205_4.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/phpsysinfo/phpsysinfo.xml</config_file>
- <configurationfile>phpsysinfo.xml</configurationfile>
- <noembedded>true</noembedded>
- </package>
- <package>
- <name>Fit123</name>
- <website>http://pfsense.comuf.com</website>
- <descr>With Fit123 a small set of features can be added to pfSense 1.2.3 (Date)Adds current date to front page (LTSP)Adds 3th network boot option (After Filter Change) Clear states after filter reload (DNS Servers)Adds option for a 3th and 4th DNS Server (DDNS)A more customize way to update dynamic dns (CASS) Clear states for 1 voip client after dynamic ip update on wan.</descr>
- <category>System</category>
- <version>1.0</version>
- <status>Stable</status>
- <required_version>1.2.3</required_version>
- <maximum_version>1.2.3</maximum_version>
- <maintainer>crazypark2@yahoo.dk</maintainer>
- <config_file>http://packages.pfsense.org/packages/config/Fit123/fit123.xml</config_file>
- <configurationfile>fit123.xml</configurationfile>
- </package>
- <package>
- <name>dns-server</name>
- <descr>pfSense version of TinyDNS which features failover host support</descr>
- <website>http://cr.yp.to/djbdns.html</website>
- <category>Services</category>
- <version>1.0.6.14</version>
- <status>Beta</status>
- <pkginfolink>https://doc.pfsense.org/index.php/Tinydns_package</pkginfolink>
- <required_version>1.2</required_version>
- <config_file>http://packages.pfsense.org/packages/config/tinydns/tinydns.xml</config_file>
- <configurationfile>tinydns.xml</configurationfile>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>ucspi-tcp-0.88_2.tbz</depends_on_package>
- <depends_on_package>daemontools-0.76_12.tbz</depends_on_package>
- <depends_on_package>djbdns-1.05_12.tbz</depends_on_package>
- </package>
- <package>
- <name>Open-VM-Tools</name>
- <descr>VMware Tools</descr>
- <website>http://open-vm-tools.sourceforge.net/</website>
- <category>Services</category>
- <version>167859</version>
- <status>Stable</status>
- <pkginfolink>https://doc.pfsense.org/index.php/Open_VM_Tools_package</pkginfolink>
- <required_version>1.2.1</required_version>
- <config_file>http://packages.pfsense.org/packages/config/open-vm-tools/open-vm-tools.xml</config_file>
- <configurationfile>open-vm-tools.xml</configurationfile>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>open-vm-tools-nox11-253928.tbz</depends_on_package>
- <depends_on_package>libtool-2.2.6b.tbz</depends_on_package>
- <depends_on_package>libiconv-1.13.1.tbz</depends_on_package>
- <depends_on_package>libdnet-1.11_3.tbz</depends_on_package>
- <depends_on_package>icu-3.8.1_3.tbz</depends_on_package>
- <depends_on_package>gmake-3.81_4.tbz</depends_on_package>
- <depends_on_package>gettext-0.17_1.tbz</depends_on_package>
- <depends_on_package>glib-2.24.1_1.tbz</depends_on_package>
- </package>
- <package>
- <name>AutoConfigBackup</name>
- <maintainer>portal@pfsense.org</maintainer>
- <descr>Automatically backs up your pfSense configuration. All contents are encrypted on the server. Requires Gold Subscription from https://portal.pfsense.org</descr>
- <website>https://portal.pfsense.org</website>
- <category>Services</category>
- <version>1.26</version>
- <status>Stable</status>
- <required_version>1.2</required_version>
- <pkginfolink>https://doc.pfsense.org/index.php/AutoConfigBackup</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/autoconfigbackup/autoconfigbackup.xml</config_file>
- <configurationfile>autoconfigbackup.xml</configurationfile>
- </package>
- <package>
- <name>arping</name>
- <descr>Broadcasts a who-has ARP packet on the network and prints answers. </descr>
- <website>http://www.habets.pp.se/synscan/programs.php?prog=arping</website>
- <category>Services</category>
- <version>2.06.1</version>
- <status>Stable</status>
- <pkginfolink>https://doc.pfsense.org/index.php/Arping_package</pkginfolink>
- <required_version>1.0.1</required_version>
- <config_file>http://packages.pfsense.org/packages/config/arping/arping.xml</config_file>
- <configurationfile>arping.xml</configurationfile>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>arping-2.06.tbz</depends_on_package>
- </package>
- <package>
- <name>nmap</name>
- <maintainer>billm@pfsense.org</maintainer>
- <descr>NMap is a utility for network exploration or security auditing. It supports ping scanning (determine which hosts are up), many port scanning techniques (determine what services the hosts are offering), version detection (determine what application/service is runing on a port), and TCP/IP fingerprinting (remote host OS or device identification). It also offers flexible target and port specification, decoy/stealth scanning, SunRPC scanning, and more. Most Unix and Windows platforms are supported in both GUI and command line modes. Several popular handheld devices are also supported, including the Sharp Zaurus and the iPAQ.</descr>
- <category>Security</category>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>nmap-4.76.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/nmap/nmap.xml</config_file>
- <version>4.76</version>
- <status>Stable</status>
- <pkginfolink>https://doc.pfsense.org/index.php/Nmap_package</pkginfolink>
- <required_version>1.2.1</required_version>
- <configurationfile>nmap.xml</configurationfile>
- </package>
- <package>
- <name>OpenOSPFD</name>
- <descr>OSPF routing protocol</descr>
- <maintainer>cmb@pfsense.org</maintainer>
- <version>4.6 pkg v0.5.2</version>
- <category>Routing</category>
- <status>BETA</status>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>openospfd-4.6.tbz</depends_on_package>
- <depends_on_package>libevent-1.4.14b_2.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/openospfd/openospfd.xml</config_file>
- <pkginfolink></pkginfolink>
- <required_version>1.2.1</required_version>
- <configurationfile>openospfd.xml</configurationfile>
- </package>
- <package>
- <name>imspector</name>
- <descr>IMSpector is an Instant Messenger transparent proxy with logging capabilities. Currently it supports MSN, AIM, ICQ, Yahoo and IRC to different degrees.</descr>
- <website>http://www.imspector.org/</website>
- <category>Network Management</category>
- <maintainer>billm@pfsense.org</maintainer>
- <version>0.8-9</version>
- <required_version>1.2.1</required_version>
- <status>BETA</status>
- <pkginfolink>https://doc.pfsense.org/index.php/IMSpector_package</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/imspector/imspector.xml</config_file>
- <configurationfile>imspector.xml</configurationfile>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>imspector-0.8.tbz</depends_on_package>
- <depends_on_package>libiconv-1.11_1.tbz</depends_on_package>
- <depends_on_package>mysql-client-5.0.77.tbz</depends_on_package>
- <depends_on_package>sqlite3-3.6.10.tbz</depends_on_package>
- </package>
- <package>
- <name>nut</name>
- <descr>Network UPS Tools</descr>
- <website>http://www.networkupstools.org/</website>
- <category>Network Management</category>
- <version>2.2.2b pkg 1.4</version>
- <status>BETA</status>
- <required_version>1.2.1</required_version>
- <maintainer>rswagoner@gmail.com</maintainer>
- <config_file>http://packages.pfsense.org/packages/config/nut/nut.xml</config_file>
- <configurationfile>nut.xml</configurationfile>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>nut-2.2.2.tbz</depends_on_package>
- <pkginfolink>https://doc.pfsense.org/index.php/Nut_package</pkginfolink>
- </package>
- <package>
- <name>diag_new_states</name>
- <descr>Paul Taylors version of Diagnostics States which utilizes pftop.</descr>
- <website>http://www.addressplus.net</website>
- <category>Network Management</category>
- <version>0.2</version>
- <maintainer>ptaylor@addressplus.net</maintainer>
- <required_version>1.2.1</required_version>
- <status>BETA</status>
- <config_file>http://packages.pfsense.org/packages/config/diag_states_pt/diag_new_states.xml</config_file>
- <configurationfile>http://packages.pfsense.org/packages/config/diag_states_pt/diag_new_states.xml</configurationfile>
- </package>
- <package>
- <name>darkstat</name>
- <website>http://dmr.ath.cx/net/darkstat/</website>
- <descr>darkstat is a network statistics gatherer. It's a packet sniffer that runs as a background process on a cable/DSL router, gathers all sorts of statistics about network usage, and serves them over HTTP.</descr>
- <category>Network Management</category>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>darkstat-3.0.712.tbz</depends_on_package>
- <depends_on_package>gettext-0.17_1.tbz</depends_on_package>
- <version>3.0.712</version>
- <status>Stable</status>
- <required_version>1.2.1</required_version>
- <maintainer>sullrich+pfsp@gmail.com</maintainer>
- <config_file>http://packages.pfsense.org/packages/config/darkstat/darkstat.xml</config_file>
- <configurationfile>darkstat.xml</configurationfile>
- </package>
- <package>
- <name>pfflowd</name>
- <website>http://www.mindrot.org/pfflowd.html</website>
- <descr>pfflowd converts OpenBSD PF status messages (sent via the pfsync interface) to Cisco NetFlow datagrams. These datagrams may be sent (via UDP) to a host of one's choice. Utilising the OpenBSD stateful packet filter infrastructure means that flow tracking is very fast and accurate.</descr>
- <category>Network Management</category>
- <config_file>http://packages.pfsense.org/packages/config/pfflowd.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>pfflowd-0.8.tbz</depends_on_package>
- <version>0.8.2</version>
- <status>Stable</status>
- <required_version>1.2.3</required_version>
- <configurationfile>pfflowd.xml</configurationfile>
- <maintainer></maintainer>
- </package>
- <package>
- <name>widentd</name>
- <descr>RFC1413 auth/identd daemon with fixed fake reply</descr>
- <website>http://www.webweaving.org/widentd</website>
- <category>Services</category>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>widentd-1.03_1.tbz</depends_on_package>
- <version>1.03_1</version>
- <status>Stable</status>
- <pkginfolink>https://doc.pfsense.org/index.php/Widentd_package</pkginfolink>
- <required_version>1.2.1</required_version>
- <config_file>http://packages.pfsense.org/packages/config/widentd.xml</config_file>
- <configurationfile>widentd.xml</configurationfile>
- </package>
- <package>
- <name>freeradius</name>
- <website>http://www.freeradius.org/</website>
- <descr>A free implementation of the RADIUS protocol.</descr>
- <category>System</category>
- <version>1.1.2_1</version>
- <status>BETA</status>
- <required_version>1.2.1</required_version>
- <maintainer>none</maintainer>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>freeradius-1.1.7_3.tbz</depends_on_package>
- <depends_on_package>libltdl-1.5.26.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/freeradius.xml</config_file>
- <configurationfile>freeradius.xml</configurationfile>
- </package>
- <package>
- <name>bandwidthd</name>
- <website>http://bandwidthd.sourceforge.net/</website>
- <descr>BandwidthD tracks usage of TCP/IP network subnets and builds html files with graphs to display utilization. Charts are built by individual IPs, and by default display utilization over 2 day, 8 day, 40 day, and 400 day periods. Furthermore, each ip address's utilization can be logged out at intervals of 3.3 minutes, 10 minutes, 1 hour or 12 hours in cdf format, or to a backend database server. HTTP, TCP, UDP, ICMP, VPN, and P2P traffic are color coded.</descr>
- <category>System</category>
- <version>2.0.1.2</version>
- <status>BETA</status>
- <required_version>1.2.1</required_version>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>bandwidthd-2.0.1_1.tbz</depends_on_package>
- <depends_on_package>libiconv-1.11_1.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/bandwidthd/bandwidthd.xml</config_file>
- <configurationfile>bandwidthd.xml</configurationfile>
- <noembedded>true</noembedded>
- </package>
- <package>
- <name>stunnel</name>
- <website>http://www.stunnel.org/</website>
- <descr>An SSL encryption wrapper between remote client and local or remote servers. </descr>
- <category>Network Management</category>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>stunnel-4.25.tbz</depends_on_package>
- <version>4.30.2</version>
- <status>Stable</status>
- <pkginfolink>https://doc.pfsense.org/index.php/Stunnel_package</pkginfolink>
- <required_version>1.2.1</required_version>
- <config_file>http://packages.pfsense.org/packages/config/stunnel.xml</config_file>
- <configurationfile>stunnel.xml</configurationfile>
- </package>
- <package>
- <name>iperf</name>
- <website>http://dast.nlanr.net/Projects/Iperf/</website>
- <descr>Iperf is a tool for testing network throughput, loss, and jitter.</descr>
- <category>Network Management</category>
- <config_file>http://packages.pfsense.org/packages/config/iperf.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>iperf-2.0.4.tbz</depends_on_package>
- <version>2.0.2_2</version>
- <status>Beta</status>
- <pkginfolink>https://doc.pfsense.org/index.php/Iperf_package</pkginfolink>
- <required_version>1.2.1</required_version>
- <configurationfile>iperf.xml</configurationfile>
- </package>
- <package>
- <name>netio</name>
- <website>http://freshmeat.net/projects/netio/</website>
- <descr>This is a network benchmark for DOS, OS/2 2.x, Windows NT/2000 and Unix. It measures the net throughput of a network via NetBIOS and/or TCP/IP protocols (Unix and DOS only support TCP/IP) using various different packet sizes.</descr>
- <category>Network Management</category>
- <config_file>http://packages.pfsense.org/packages/config/netio.xml</config_file>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All</depends_on_package_base_url>
- <depends_on_package>netio-1.26.tbz</depends_on_package>
- <version>1.26</version>
- <required_version>2.0</required_version>
- <status>ALPHA</status>
- <configurationfile>netio.xml</configurationfile>
- </package>
- <package>
- <name>mtr-nox11</name>
- <maintainer>billm@pfsense.org</maintainer>
- <descr>Enhanced traceroute replacement</descr>
- <website>http://www.bitwizard.nl/mtr/</website>
- <category>Network Management</category>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>mtr-nox11-0.73_1.tbz</depends_on_package>
- <version>0.65_2</version>
- <status>Stable</status>
- <required_version>2.0</required_version>
- <config_file>http://packages.pfsense.org/packages/config/mtr-nox11.xml</config_file>
- <configurationfile>mtr-nox11.xml</configurationfile>
- </package>
- <package>
- <name>squid</name>
- <descr>High performance web proxy cache.</descr>
- <website>http://www.squid-cache.org/</website>
- <category>Network</category>
- <version>2.7.9 pkg v.4.3.1</version>
- <status>Stable</status>
- <required_version>1.2.1</required_version>
- <maintainer>fernando@netfilter.com.br seth.mos@dds.nl mfuchs77@googlemail.com</maintainer>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>squid-2.7.9.tbz</depends_on_package>
- <depends_on_package>squid_radius_auth-1.10.tbz</depends_on_package>
- <depends_on_package>openldap-sasl-client-2.4.25_1.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/squid/squid.xml</config_file>
- <configurationfile>squid.xml</configurationfile>
- </package>
- <package>
- <name>LCDproc</name>
- <descr>LCD display driver</descr>
- <website>http://www.lcdproc.org/</website>
- <category>Utility</category>
- <version>lcdproc-0.5.2_3</version>
- <status>BETA</status>
- <required_version>1.2.1</required_version>
- <maintainer>seth.mos@dds.nl</maintainer>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>lcdproc-0.5.2_2.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/lcdproc/lcdproc.xml</config_file>
- <configurationfile>lcdproc.xml</configurationfile>
- </package>
- <package>
- <name>arpwatch</name>
- <descr>Arpwatch monitors ethernet/ip address pairings. It also logs certain changes to syslog.</descr>
- <website>http://www-nrg.ee.lbl.gov/</website>
- <category>Security</category>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>arpwatch-2.1.a15_4.tbz</depends_on_package>
- <version>2.1.a13</version>
- <status>ALPHA</status>
- <required_version>2.0</required_version>
- <config_file>http://packages.pfsense.org/packages/config/arpwatch.xml</config_file>
- <configurationfile>arpwatch.xml</configurationfile>
- <logging>
- <facilityname>arpwatch</facilityname>
- <logfilename>arpwatch.log</logfilename>
- </logging>
- </package>
- <package>
- <name>squidGuard</name>
- <descr>High performance web proxy URL filter. Requires proxy Squid package.</descr>
- <website>http://www.squidGuard.org/</website>
- <maintainer>dv_serg@mail.ru</maintainer>
- <category>Network Management</category>
- <version>1.4_3 pkg v.1.9</version>
- <status>Beta</status>
- <required_version>1.1</required_version>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>squidGuard-1.4_3.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/squidGuard/squidguard.xml</config_file>
- <configurationfile>squidguard.xml</configurationfile>
- </package>
- <package>
- <name>Zabbix Agent</name>
- <descr>Monitoring agent.</descr>
- <category>Services</category>
- <config_file>http://packages.pfsense.org/packages/config/zabbix-agent/zabbix-agent.xml</config_file>
- <version>1.8.2_2</version>
- <status>FINAL</status>
- <required_version>1.2.3</required_version>
- <configurationfile>zabbix-agent.xml</configurationfile>
- <maintainer>remco.verhoef@redfive.biz</maintainer>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>zabbix-agent-1.8.2_2,2.tbz</depends_on_package>
- </package>
- <package>
- <name>Zabbix Proxy</name>
- <descr>Monitoring agent proxy.</descr>
- <category>Services</category>
- <config_file>http://packages.pfsense.org/packages/config/zabbix-proxy/zabbix-proxy.xml</config_file>
- <version>1.8.3,2_1</version>
- <status>FINAL</status>
- <required_version>1.2.3</required_version>
- <configurationfile>zabbix-proxy.xml</configurationfile>
- <maintainer>cmb@pfsense.org</maintainer>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>zabbix-proxy-1.8.3,2.tbz</depends_on_package>
- </package>
- <package>
- <name>OpenVPN Client Export Utility</name>
- <descr>Allows a pre-configured OpenVPN Windows Client or Mac OSX's Viscosity configuration bundle to be exported directly from pfSense.</descr>
- <category>Security</category>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>p7zip-4.58.tbz</depends_on_package>
- <version>0.1</version>
- <status>BETA</status>
- <required_version>2.0</required_version>
- <config_file>http://packages.pfsense.org/packages/config/openvpn-client-export/openvpn-client-export.xml</config_file>
- <configurationfile>openvpn-client-export.xml</configurationfile>
- </package>
- <package>
- <name>HAVP antivirus</name>
- <pkginfolink></pkginfolink>
- <website>http://www.server-side.de/</website>
- <descr>Antivirus: HAVP (HTTP Antivirus Proxy) is a proxy with a ClamAV anti-virus scanner. The main aims are continuous, non-blocking downloads and smooth scanning of dynamic and password protected HTTP traffic. Havp antivirus proxy has a parent and transparent proxy mode. It can be used with squid or standalone. And File Scanner for local files.</descr>
- <category>Network Management</category>
- <depends_on_package_base_url>http://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.3-release/All/</depends_on_package_base_url>
- <depends_on_package>havp-0.91.tbz</depends_on_package>
- <version>0.91</version>
- <status>BETA</status>
- <required_version>1.2.2</required_version>
- <config_file>http://packages.pfsense.org/packages/config/havp/havp.xml</config_file>
- <configurationfile>havp.xml</configurationfile>
- <maintainer>dv_serg@mail.ru</maintainer>
- <after_install_info>Please check the HAVP settings.</after_install_info>
- <noembedded>true</noembedded>
- <maximum_version>1.2.3</maximum_version>
- </package>
- <package>
- <name>onatproto</name>
- <descr>Patch to add Protocol options to Manual Outbound NAT. WARNING! Cannot be uninstalled.</descr>
- <category>System</category>
- <config_file>http://packages.pfsense.org/packages/config/onatproto/onatproto.xml</config_file>
- <version>0.1</version>
- <status>BETA</status>
- <required_version>1.2.1</required_version>
- <maximum_version>1.2.3</maximum_version>
- </package>
- <package>
- <name>pfJailctl</name>
- <descr>pfSense wrapper for jailctl - a jail management tool. Allows you to run jails on pfSense.</descr>
- <website>http://anduin.net/jailctl/</website>
- <category>System</category>
- <version>0.51</version>
- <required_version>1.2.3</required_version>
- <status>BETA</status>
- <pkginfolink>https://doc.pfsense.org/index.php/PfJailctl_package</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/jailctl.xml</config_file>
- <configurationfile>jailctl.xml</configurationfile>
- <maintainer>ltning-jailctl@anduin.net</maintainer>
- <noembedded>true</noembedded>
- </package>
- <package>
- <name>jail_template</name>
- <descr>Basic template for jails, probably requires pfJailctl to be useful. Includes 'base' and 'manpages' dists.</descr>
- <website>http://anduin.net/jailctl/</website>
- <category>System</category>
- <version>0.2</version>
- <required_version>1.2.3</required_version>
- <status>BETA</status>
- <pkginfolink>https://doc.pfsense.org/index.php/PfJailctl_package</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/jail_template.xml</config_file>
- <configurationfile>jail_template.xml</configurationfile>
- <maintainer>ltning-jailctl@anduin.net</maintainer>
- <noembedded>true</noembedded>
- </package>
- <package>
- <name>IGMPproxy</name>
- <descr>An IGMP proxy for multicast traffic.</descr>
- <category>Network</category>
- <version>0.1</version>
- <required_version>1.2.2</required_version>
- <status>BETA</status>
- <pkginfolink>https://doc.pfsense.org/index.php/IGMPproxy</pkginfolink>
- <config_file>http://packages.pfsense.org/packages/config/igmpproxy/igmpproxy.xml</config_file>
- <configurationfile>igmpproxy.xml</configurationfile>
- <maintainer>eri@pfsense.org</maintainer>
- </package>
- <package>
- <name>NRPE v2</name>
- <website>http://wiki.nagios.org/index.php/Howtos:nrpe_nsca</website>
- <descr>NRPE is an addon for Nagios that allows you to execute plugins on remote Linux/Unix hosts. This is useful if you need to monitor local resources/attributes like disk usage, CPU load, memory usage, etc. on a remote host.</descr>
- <category>Services</category>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>nrpe-2.12_1.tbz</depends_on_package>
- <depends_on_package>nagios-plugins-1.4.13,1.tbz</depends_on_package>
- <depends_on_package>libiconv-1.11_1.tbz</depends_on_package>
- <depends_on_package>gettext-0.17_1.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/nrpe2/nrpe2.xml</config_file>
- <version>2.11</version>
- <status>Beta</status>
- <required_version>1.2</required_version>
- <maintainer>erik@erikkristensen.com</maintainer>
- <configurationfile>nrpe2.xml</configurationfile>
- </package>
- <package>
- <name>OpenVPN-Enhancements</name>
- <maintainer>mfuchs77@googlemail.com</maintainer>
- <website>http://pfsense.trendchiller.com</website>
- <descr>Enhance OpenVPN with TLS-auth and client/server-options. WARNING! Cannot be uninstalled.</descr>
- <category>Security</category>
- <version>1.2</version>
- <status>STABLE</status>
- <required_version>1.2</required_version>
- <maximum_version>1.2.9</maximum_version>
- <config_file>http://packages.pfsense.org/packages/config/ovpnenhance/ovpnenhance.xml</config_file>
- <configurationfile>ovpnenhance.xml</configurationfile>
- </package>
- <package>
- <name>rate</name>
- <descr>This package adds a table of realtime bandwidth usage by IP address to Status -&gt; Traffic Graphs</descr>
- <category>Network Management</category>
- <version>0.9</version>
- <status>BETA</status>
- <maintainer>jimp@pfsense.org</maintainer>
- <required_version>1.2.2</required_version>
- <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <depends_on_package>rate-0.9.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/rate/rate.xml</config_file>
- <configurationfile>rate.xml</configurationfile>
- </package>
- <package>
- <name>blinkled</name>
- <descr>Allows you to use LEDs for network activity on supported platforms (ALIX, WRAP, Soekris, etc)</descr>
- <category>System</category>
- <version>0.0.0.0.0.1</version>
- <status>So Alpha it's Omega</status>
- <maintainer>jimp@pfsense.org</maintainer>
- <required_version>1.2.3</required_version>
- <config_file>http://packages.pfsense.org/packages/config/blinkled/blinkled.xml</config_file>
- <configurationfile>blinkled.xml</configurationfile>
- </package>
- <package>
- <name>OpenVPN Status</name>
- <descr>OpenVPN Status Page, backported from 2.0</descr>
- <category>System</category>
- <version>1.5</version>
- <status>Beta</status>
- <maintainer>jimp@pfsense.org</maintainer>
- <required_version>1.2.3</required_version>
- <config_file>http://packages.pfsense.org/packages/config/openvpn-status/openvpn-status.xml</config_file>
- <configurationfile>openvpn-status.xml</configurationfile>
- </package>
- <package>
- <name>States Summary</name>
- <descr>States Summary Page, which will summarize firewall states by IP address and protocol.</descr>
- <category>System</category>
- <version>0.5</version>
- <status>Beta</status>
- <maintainer>jimp@pfsense.org</maintainer>
- <required_version>1.2.3</required_version>
- <config_file>http://packages.pfsense.org/packages/config/states-summary/states-summary.xml</config_file>
- <configurationfile>states-summary.xml</configurationfile>
- </package>
- <package>
- <name>IP Range Aliases</name>
- <descr>Patch to add IP Range support to Network Aliases. WARNING! Cannot be uninstalled. Probably does not play nice with URL Table patch.</descr>
- <category>System</category>
- <config_file>http://packages.pfsense.org/packages/config/iprangealiases/iprangealiases.xml</config_file>
- <version>0.2</version>
- <status>BETA</status>
- <required_version>1.2.3</required_version>
- <maximum_version>1.2.3</maximum_version>
- </package>
- <package>
- <name>URL Table Aliases</name>
- <descr>Patch to add URL Table alias support to pull a list of CIDRs/IPs from a file by URL into a persist table. WARNING! Cannot be uninstalled. Probably does not play nice with IP Range Aliases patch. This is NOT a way to add an alias for host URLs.</descr>
- <category>System</category>
- <config_file>http://packages.pfsense.org/packages/config/urltables/urltables.xml</config_file>
- <version>0.1</version>
- <status>BETA</status>
- <required_version>1.2.3</required_version>
- <maximum_version>1.2.3</maximum_version>
- </package>
- <package>
- <name>dnsmasq EDNS size increase</name>
- <descr>Patch to increase dnsmasq EDNS size to 4096 if needed. WARNING! Cannot be uninstalled.</descr>
- <category>System</category>
- <config_file>http://packages.pfsense.org/packages/config/dnsmasq-edns/dnsmasq-edns.xml</config_file>
- <version>0.1</version>
- <status>BETA</status>
- <required_version>1.2.3</required_version>
- <maximum_version>1.2.3</maximum_version>
- </package>
- <package>
- <name>Packet Capture Fix</name>
- <descr>Patch to fix packet capture on 1.2.3 embedded (NanoBSD)</descr>
- <category>System</category>
- <config_file>http://packages.pfsense.org/packages/config/packetcapturefix/packetcapturefix.xml</config_file>
- <version>0.2</version>
- <status>BETA</status>
- <required_version>1.2.3</required_version>
- <maximum_version>1.2.3</maximum_version>
- </package>
- <package>
- <name>RRD Summary</name>
- <descr>RRD Summary Page, which will give a total amount of traffic passed In/Out during this and the previous month.</descr>
- <category>System</category>
- <version>1.1</version>
- <status>Beta</status>
- <maintainer>jimp@pfsense.org</maintainer>
- <required_version>1.2.3</required_version>
- <config_file>http://packages.pfsense.org/packages/config/rrd-summary/rrd-summary.xml</config_file>
- <configurationfile>rrd-summary.xml</configurationfile>
- </package>
- <package>
- <name>Patch rc to leave filter_dirty</name>
- <descr>Patch to stop /etc/rc from removing /tmp/filter_dirty on boot. Fixes boot issues with some packages on certain platforms.</descr>
- <category>System</category>
- <config_file>http://packages.pfsense.org/packages/config/patch_rc_filter_dirty/patch_rc_filter_dirty.xml</config_file>
- <version>0.1</version>
- <status>BETA</status>
- <required_version>1.2.3</required_version>
- <maximum_version>1.2.3</maximum_version>
- </package>
- <package>
- <name>Pre-2.0 Upgrade Check</name>
- <descr>Pre-2.0 Upgrade Check</descr>
- <category>Diagnostics</category>
- <depends_on_package_base_url>http://ftp-archive.freebsd.org/mirror/FreeBSD-Archive/ports/i386/packages-7.2-release/All/</depends_on_package_base_url>
- <depends_on_package>libxml2-2.7.3.tbz</depends_on_package>
- <config_file>http://packages.pfsense.org/packages/config/pre2upgrade/pre2upgrade.xml</config_file>
- <version>1.0</version>
- <status>Stable</status>
- <required_version>1.2</required_version>
- <configurationfile>pre2upgrade.xml</configurationfile>
- </package>
- </packages>
-</pfsensepkgs>
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index 44df54a6..81f575a3 100644
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -282,7 +282,7 @@
<website>http://www.pureftpd.org/</website>
<descr>*DO NOT RUN THIS ON A FIREWALL. USE A DEDICATED MACHINE!* Pure FTPd Server is a fast, production quality, standards-conformant FTP server based on Troll-FTPd. It has no known vulnerabilities, is trivial to set up, and is especially designed for modern kernels. Features include PAM support, IPv6, chroot()ed home directories, virtual domains, built-in 'ls', FXP protocol, anti-warez system, bandwidth throttling, restricted ports for passive downloads, an LDAP backend, XML output, and more.</descr>
<category>FTP</category>
- <config_file>https://packages.pfsense.org/packages/config/pure-ftpd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/pure-ftpd/pure-ftpd.xml</config_file>
<depends_on_package_base_url>https://files.pfsense.org/packages/8/All/</depends_on_package_base_url>
<depends_on_package>pure-ftpd-1.0.35.tbz</depends_on_package>
<depends_on_package_pbi>pure-ftpd-1.0.36-i386.pbi</depends_on_package_pbi>
@@ -480,7 +480,7 @@
<website>http://www.olsr.org/</website>
<descr>The olsr.org OLSR daemon is an implementation of the Optimized Link State Routing protocol. OLSR is a routing protocol for mobile ad-hoc networks. The protocol is pro-active, table driven and utilizes a technique called multipoint relaying for message flooding.</descr>
<category>Services</category>
- <config_file>https://packages.pfsense.org/packages/config/olsrd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/olsrd/olsrd.xml</config_file>
<depends_on_package_base_url>https://files.pfsense.org/packages/8/All/</depends_on_package_base_url>
<depends_on_package>olsrd-0.6.2.tbz</depends_on_package>
<depends_on_package_pbi>olsrd-0.6.3-i386.pbi</depends_on_package_pbi>
@@ -607,7 +607,7 @@
<website>http://siproxd.sourceforge.net/</website>
<descr>Proxy for handling NAT of multiple SIP devices to a single public IP.</descr>
<category>Services</category>
- <config_file>https://packages.pfsense.org/packages/config/siproxd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/siproxd/siproxd.xml</config_file>
<depends_on_package_base_url>https://files.pfsense.org/packages/8/All/</depends_on_package_base_url>
<depends_on_package>siproxd-0.8.0.tbz</depends_on_package>
<depends_on_package_pbi>siproxd-0.8.0-i386.pbi</depends_on_package_pbi>
@@ -958,7 +958,7 @@
<website>http://www.mindrot.org/pfflowd.html</website>
<descr>pfflowd converts OpenBSD PF status messages (sent via the pfsync interface) to Cisco NetFlow datagrams. These datagrams may be sent (via UDP) to a host of one's choice. Utilising the OpenBSD stateful packet filter infrastructure means that flow tracking is very fast and accurate.</descr>
<category>Network Management</category>
- <config_file>https://packages.pfsense.org/packages/config/pfflowd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/pfflowd/pfflowd.xml</config_file>
<depends_on_package_base_url>https://files.pfsense.org/packages/8/All/</depends_on_package_base_url>
<depends_on_package>pfflowd-0.8.tbz</depends_on_package>
<depends_on_package_pbi>pfflowd-0.8-i386.pbi</depends_on_package_pbi>
@@ -981,7 +981,7 @@
<status>Stable</status>
<pkginfolink>https://doc.pfsense.org/index.php/Widentd_package</pkginfolink>
<required_version>1.2.1</required_version>
- <config_file>https://packages.pfsense.org/packages/config/widentd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/widentd/widentd.xml</config_file>
<configurationfile>widentd.xml</configurationfile>
<build_port_path>/usr/ports/net/widentd</build_port_path>
</package>
@@ -998,7 +998,7 @@
<depends_on_package>freeradius-1.1.8_4.tbz</depends_on_package>
<depends_on_package>libltdl-2.4_1.tbz</depends_on_package>
<depends_on_package_pbi>freeradius-1.1.8_5-i386.pbi</depends_on_package_pbi>
- <config_file>https://packages.pfsense.org/packages/config/freeradius.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/freeradius/freeradius.xml</config_file>
<configurationfile>freeradius.xml</configurationfile>
<build_port_path>/usr/ports/net/freeradius</build_port_path>
<build_port_path>/usr/ports/devel/libltdl</build_port_path>
@@ -1069,7 +1069,7 @@
<status>Stable</status>
<pkginfolink>https://doc.pfsense.org/index.php/Stunnel_package</pkginfolink>
<required_version>1.2.1</required_version>
- <config_file>https://packages.pfsense.org/packages/config/stunnel.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/stunnel/stunnel.xml</config_file>
<configurationfile>stunnel.xml</configurationfile>
<build_port_path>/usr/ports/security/stunnel</build_port_path>
<build_options>WITHOUT_FORK=true;WITH_PTHREAD=true;WITHOUT_UCONTEXT=true;WITHOUT_IPV6=true;WITH_LIBWRAP=true;WITHOUT_SSL_PORT=true</build_options>
@@ -1079,7 +1079,7 @@
<website>http://dast.nlanr.net/Projects/Iperf/</website>
<descr>Iperf is a tool for testing network throughput, loss, and jitter.</descr>
<category>Network Management</category>
- <config_file>https://packages.pfsense.org/packages/config/iperf.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/iperf/iperf.xml</config_file>
<depends_on_package_base_url>https://files.pfsense.org/packages/8/All/</depends_on_package_base_url>
<depends_on_package>iperf-2.0.5.tbz</depends_on_package>
<depends_on_package_pbi>iperf-2.0.5-i386.pbi</depends_on_package_pbi>
@@ -1095,7 +1095,7 @@
<website>http://freshmeat.net/projects/netio/</website>
<descr>This is a network benchmark for DOS, OS/2 2.x, Windows NT/2000 and Unix. It measures the net throughput of a network via NetBIOS and/or TCP/IP protocols (Unix and DOS only support TCP/IP) using various different packet sizes.</descr>
<category>Network Management</category>
- <config_file>https://packages.pfsense.org/packages/config/netio.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/netio/netio.xml</config_file>
<depends_on_package_base_url>https://files.pfsense.org/packages/8/All</depends_on_package_base_url>
<depends_on_package>netio-1.26.tbz</depends_on_package>
<depends_on_package_pbi>netio-1.26-i386.pbi</depends_on_package_pbi>
@@ -1117,7 +1117,7 @@
<version>0.85_1.1</version>
<status>Stable</status>
<required_version>2.0</required_version>
- <config_file>https://packages.pfsense.org/packages/config/mtr-nox11.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/mtr-nox11/mtr-nox11.xml</config_file>
<configurationfile>mtr-nox11.xml</configurationfile>
<build_port_path>/usr/ports/net/mtr</build_port_path>
<build_options>mtr_UNSET_FORCE=X11</build_options>
@@ -1255,7 +1255,7 @@
<version>2.1.a15_6 pkg v1.1.2</version>
<status>ALPHA</status>
<required_version>2.0</required_version>
- <config_file>https://packages.pfsense.org/packages/config/arpwatch.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/arpwatch/arpwatch.xml</config_file>
<configurationfile>arpwatch.xml</configurationfile>
<logging>
<facilityname>arpwatch</facilityname>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index 83e3ef47..63439301 100644
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -269,7 +269,7 @@
<website>http://www.pureftpd.org/</website>
<descr>*DO NOT RUN THIS ON A FIREWALL. USE A DEDICATED MACHINE!* Pure FTPd Server is a fast, production quality, standards-conformant FTP server based on Troll-FTPd. It has no known vulnerabilities, is trivial to set up, and is especially designed for modern kernels. Features include PAM support, IPv6, chroot()ed home directories, virtual domains, built-in 'ls', FXP protocol, anti-warez system, bandwidth throttling, restricted ports for passive downloads, an LDAP backend, XML output, and more.</descr>
<category>FTP</category>
- <config_file>https://packages.pfsense.org/packages/config/pure-ftpd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/pure-ftpd/pure-ftpd.xml</config_file>
<depends_on_package_base_url>https://files.pfsense.org/packages/amd64/8/All/</depends_on_package_base_url>
<depends_on_package>pure-ftpd-1.0.35.tbz</depends_on_package>
<depends_on_package_pbi>pure-ftpd-1.0.36-amd64.pbi</depends_on_package_pbi>
@@ -467,7 +467,7 @@
<website>http://www.olsr.org/</website>
<descr>The olsr.org OLSR daemon is an implementation of the Optimized Link State Routing protocol. OLSR is a routing protocol for mobile ad-hoc networks. The protocol is pro-active, table driven and utilizes a technique called multipoint relaying for message flooding.</descr>
<category>Services</category>
- <config_file>https://packages.pfsense.org/packages/config/olsrd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/olsrd/olsrd.xml</config_file>
<depends_on_package_base_url>https://files.pfsense.org/packages/amd64/8/All/</depends_on_package_base_url>
<depends_on_package>olsrd-0.6.2.tbz</depends_on_package>
<depends_on_package_pbi>olsrd-0.6.3-amd64.pbi</depends_on_package_pbi>
@@ -594,7 +594,7 @@
<website>http://siproxd.sourceforge.net/</website>
<descr>Proxy for handling NAT of multiple SIP devices to a single public IP.</descr>
<category>Services</category>
- <config_file>https://packages.pfsense.org/packages/config/siproxd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/siproxd/siproxd.xml</config_file>
<depends_on_package_base_url>https://files.pfsense.org/packages/amd64/8/All/</depends_on_package_base_url>
<depends_on_package>siproxd-0.8.0.tbz</depends_on_package>
<depends_on_package_pbi>siproxd-0.8.0-amd64.pbi</depends_on_package_pbi>
@@ -945,7 +945,7 @@
<website>http://www.mindrot.org/pfflowd.html</website>
<descr>pfflowd converts OpenBSD PF status messages (sent via the pfsync interface) to Cisco NetFlow datagrams. These datagrams may be sent (via UDP) to a host of one's choice. Utilising the OpenBSD stateful packet filter infrastructure means that flow tracking is very fast and accurate.</descr>
<category>Network Management</category>
- <config_file>https://packages.pfsense.org/packages/config/pfflowd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/pfflowd/pfflowd.xml</config_file>
<depends_on_package_base_url>https://files.pfsense.org/packages/amd64/8/All/</depends_on_package_base_url>
<depends_on_package>pfflowd-0.8.tbz</depends_on_package>
<depends_on_package_pbi>pfflowd-0.8-amd64.pbi</depends_on_package_pbi>
@@ -968,7 +968,7 @@
<status>Stable</status>
<pkginfolink>https://doc.pfsense.org/index.php/Widentd_package</pkginfolink>
<required_version>1.2.1</required_version>
- <config_file>https://packages.pfsense.org/packages/config/widentd.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/widentd/widentd.xml</config_file>
<configurationfile>widentd.xml</configurationfile>
<build_port_path>/usr/ports/net/widentd</build_port_path>
</package>
@@ -985,7 +985,7 @@
<depends_on_package>freeradius-1.1.8_4.tbz</depends_on_package>
<depends_on_package>libltdl-2.4_1.tbz</depends_on_package>
<depends_on_package_pbi>freeradius-1.1.8_5-amd64.pbi</depends_on_package_pbi>
- <config_file>https://packages.pfsense.org/packages/config/freeradius.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/freeradius/freeradius.xml</config_file>
<configurationfile>freeradius.xml</configurationfile>
<build_port_path>/usr/ports/net/freeradius</build_port_path>
<build_port_path>/usr/ports/devel/libltdl</build_port_path>
@@ -1056,7 +1056,7 @@
<status>Stable</status>
<pkginfolink>https://doc.pfsense.org/index.php/Stunnel_package</pkginfolink>
<required_version>1.2.1</required_version>
- <config_file>https://packages.pfsense.org/packages/config/stunnel.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/stunnel/stunnel.xml</config_file>
<configurationfile>stunnel.xml</configurationfile>
<build_port_path>/usr/ports/security/stunnel</build_port_path>
<build_options>WITHOUT_FORK=true;WITH_PTHREAD=true;WITHOUT_UCONTEXT=true;WITHOUT_IPV6=true;WITH_LIBWRAP=true;WITHOUT_SSL_PORT=true</build_options>
@@ -1066,7 +1066,7 @@
<website>http://dast.nlanr.net/Projects/Iperf/</website>
<descr>Iperf is a tool for testing network throughput, loss, and jitter.</descr>
<category>Network Management</category>
- <config_file>https://packages.pfsense.org/packages/config/iperf.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/iperf/iperf.xml</config_file>
<depends_on_package_base_url>https://files.pfsense.org/packages/amd64/8/All/</depends_on_package_base_url>
<depends_on_package>iperf-2.0.5.tbz</depends_on_package>
<depends_on_package_pbi>iperf-2.0.5-amd64.pbi</depends_on_package_pbi>
@@ -1082,7 +1082,7 @@
<website>http://freshmeat.net/projects/netio/</website>
<descr>This is a network benchmark for DOS, OS/2 2.x, Windows NT/2000 and Unix. It measures the net throughput of a network via NetBIOS and/or TCP/IP protocols (Unix and DOS only support TCP/IP) using various different packet sizes.</descr>
<category>Network Management</category>
- <config_file>https://packages.pfsense.org/packages/config/netio.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/netio/netio.xml</config_file>
<depends_on_package_base_url>https://files.pfsense.org/packages/amd64/8/All</depends_on_package_base_url>
<depends_on_package>netio-1.26.tbz</depends_on_package>
<depends_on_package_pbi>netio-1.26-amd64.pbi</depends_on_package_pbi>
@@ -1104,7 +1104,7 @@
<version>0.85_1.1</version>
<status>Stable</status>
<required_version>2.0</required_version>
- <config_file>https://packages.pfsense.org/packages/config/mtr-nox11.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/mtr-nox11/mtr-nox11.xml</config_file>
<configurationfile>mtr-nox11.xml</configurationfile>
<build_port_path>/usr/ports/net/mtr</build_port_path>
<build_options>mtr_UNSET_FORCE=X11</build_options>
@@ -1242,7 +1242,7 @@
<version>2.1.a15_6 pkg v1.1.2</version>
<status>ALPHA</status>
<required_version>2.0</required_version>
- <config_file>https://packages.pfsense.org/packages/config/arpwatch.xml</config_file>
+ <config_file>https://packages.pfsense.org/packages/config/arpwatch/arpwatch.xml</config_file>
<configurationfile>arpwatch.xml</configurationfile>
<logging>
<facilityname>arpwatch</facilityname>