Pkg.php with up and down function - almost there
-
Just submit it as a pull request and I can use the system patches package to pull it in and try it from there before actually committing it.
-
Thanks Jimp, the code is now part of pfsense :)
I've also finished some pkg_edit.php improvements including the end of the "for($x=0; $x<99; $x++)" rowhelper loop.
using for:
if($fields['type'] == "rowhelper") { // save rowhelper items. for($x=0; $x<99; $x++) { // XXX: this really should be passed from the form. // XXX: this really is not helping embedded platforms. foreach($fields['rowhelper']['rowhelperfield'] as $rowhelperfield) { if($firstfield == "") { $firstfield = $rowhelperfield['fieldname']; } else { if($firstfield == $rowhelperfield['fieldname']) $rows++; } $fieldname = str_replace("\\", "", $rowhelperfield['fieldname']); $comd = "\$value = \$_POST['" . $fieldname . $x . "'];"; eval($comd); if($value <> "") { $comd = "\$pkgarr['row'][" . $x . "]['" . $fieldname . "'] = \"" . $value . "\";"; //echo($comd . " "); eval($comd); } } }
using a loop between rowhelper and post:
case "rowhelper": // save rowhelper items. foreach($fields['rowhelper']['rowhelperfield'] as $rowhelperfield) foreach($_POST as $key => $value){ if (preg_match("/^{$rowhelperfield['fieldname']}(\d+)$/",$key,$matches)) $pkgarr['row'][$matches[1]][$rowhelperfield['fieldname']]=$value; } break;
link to full code:
http://e-sac.siteseguro.ws/packages/pkg_edit.21.txtI'll start again more tests before the pull request.
att,
Marcello Coutinho -
GeekGod approved it right away before I had a chance to look at it and test, he must have thought it looked OK. :-)
-
Hi again,
probably I missed something in this thread but is this feature implemented in actual pfsense 2.1 snapshots ?
I tried with<adddeleteeditpagefields><columnitem><fielddescr>Username</fielddescr> <fieldname>varusersusername</fieldname></columnitem> <columnitem><fielddescr>Use One Time Password</fielddescr> <fieldname>varusersmotpenable</fieldname></columnitem> <columnitem><fielddescr>Simult. Connections</fielddescr> <fieldname>varuserssimultaneousconnect</fieldname></columnitem> <columnitem><fielddescr>IP Address</fielddescr> <fieldname>varusersframedipaddress</fieldname></columnitem> <columnitem><fielddescr>Expiration Date</fielddescr> <fielddescr>Simult. Connections</fielddescr> <fieldname>varuserssimultaneousconnect</fieldname></columnitem> <columnitem><fielddescr>IP Address</fielddescr> <fieldname>varusersframedipaddress</fieldname></columnitem> <columnitem><fielddescr>Expiration Date</fielddescr> <fieldname>varusersexpiration</fieldname></columnitem> <columnitem><fielddescr>Session Timeout</fielddescr> <fieldname>varuserssessiontimeout</fieldname></columnitem> <columnitem><fielddescr>Possible Login Times</fielddescr> <fieldname>varuserslogintime</fieldname></columnitem> <columnitem><fielddescr>VLAN ID</fielddescr> <fieldname>varusersvlanid</fieldname></columnitem> <columnitem><fielddescr>Description</fielddescr> <fieldname>description</fieldname></columnitem> <movable>text</movable></adddeleteeditpagefields>
but had no luck.
Further I would like to sort this fields - how to implement the sorting featur - if possible !?
Thank you :-) -
probably I missed something in this thread but is this feature implemented in actual pfsense 2.1 snapshots ?
but had no luck.On 2.1 it's drag and drop. :)
Further I would like to sort this fields - how to implement the sorting featur - if possible !?
There is a sorting field on pkg.php, but it's used to filter records.
-
probably I missed something in this thread but is this feature implemented in actual pfsense 2.1 snapshots ?
but had no luck.On 2.1 it's drag and drop. :)
Much better ;D
Further I would like to sort this fields - how to implement the sorting featur - if possible !?
There is a sorting field on pkg.php, but it's used to filter records.
Hmm - any examples of this - GUI and code ? I cannot really imagine if this would help me or not ;-)
I would like - if I have 200 freeradius user entries - to sort them all by name ascending or by VLAN-ID and so on.
Could this be done by this filter option ?Thank you! :)
-
Nachtfalke,
Install IpGuard package, I think that this help you.
See the /usr/local/pkg/ipguard.xml file.
;)
-
Nachtfalke,
Install IpGuard package, I think that this help you.
See the /usr/local/pkg/ipguard.xml file.
;)
Hmm, that's probably not what I want but nice to know that it will work :P
-
Hmm, that's probably not what I want but nice to know that it will work :P
It's usefull to find/filter fields in a large list. maybe I'll change dansguardian user tab to this.
-
Ok, ok, ok!
You got me. I added this to freeradius2 package ;)It is not exactly what I want - it is more (complex) - but I think it will be helpful as bigger as the user file is :P