function GetNewForm(){ $pure=new milter_greylist(); $id=$_GET["class"]; $line=$pure->ParseAcl($pure->acl[$id]); switch ($_GET["ChangeFormType"]) { case "dnsrbl": if(!preg_match('#delay\s+([0-9]+)([a-z])#',$line[3],$re)){ $re[1]=15; $re[2]="m"; } $form= "<table style='width:100%'> <tr> <td strong width=1% nowrap align='right'>{dnsrbl_service}:</strong></td> <td>" . Field_array_Hash($pure->dnsrbl_class,'dnsrbl_class',null) . "</td> </tr> <tr> <td strong width=1% nowrap align='right'>{delay}:</strong></td> <td>" . Field_text("delay","{$re[1]}{$re[2]}",'width:100px') . "</td> </tr> </table>"; break; default:$form="<table style='width:100%'> <tr> <td align='right' width=1% nowrap>{pattern}:</strong></td> <td><textarea name='pattern' rows=3 style='width:100%'>{$line[3]}</textarea> </tr> </table>"; break; } $tpl=new templates(); echo $tpl->_ENGINE_parse_body($form); }
function GetNewForm() { $pure = new milter_greylist(false, $_GET["hostname"], base64_decode($_GET["ou"])); $id = $_GET["class"]; $line = $pure->ParseAcl($pure->acl[$id]); switch ($_GET["ChangeFormType"]) { case "dnsrbl": if (!preg_match('#delay\\s+([0-9]+)([a-z])#', $line[3], $re)) { $re[1] = 15; $re[2] = "m"; } $line[3] = trim($line[3]); $form = "<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td strong width=1% nowrap align='right'><strong>{dnsrbl_service}:</strong></td>\n\t\t\t\t\t<td>" . Field_array_Hash($pure->dnsrbl_class, 'dnsrbl_class', null) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td strong width=1% nowrap align='right'><strong>{delay}:</strong></td>\n\t\t\t\t\t<td>" . Field_text("delay", "{$re[1]}{$re[2]}", 'width:100px') . "</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t</table>"; break; default: $form = "<table style='width:100%'>\n\t\t\t<tr>\n\t\t\t\t<td align='right' width=1% nowrap valign='top'><strong style='font-size:13px'> {pattern}:</strong></td>\n\t\t\t\t<td><textarea name='pattern' id='pattern' rows=2 style='width:100%;font-size:14px;font-weight:bold'>{$line[3]}</textarea>\n\t\t\t</tr>\n\t\t</table>"; break; } $tpl = new templates(); echo $tpl->_ENGINE_parse_body($form); }
function GetNewForm() { $pure = new milter_greylist(); $id = $_GET["class"]; $ArrayACL = $pure->getAclContent($id); $line = $pure->ParseAcl($ArrayACL["full"]); switch ($_GET["ChangeFormType"]) { case "dnsrbl": if (!preg_match('#delay\\s+([0-9]+)([a-z])#', $line[3], $re)) { $re[1] = 15; $re[2] = "m"; } $line[3] = trim($line[3]); $form = "<table style='width:99%' class=form>\n\t\t\t\t<tr>\n\t\t\t\t\t<td strong width=1% nowrap align='right'><strong style='font-size:14px'>{dnsrbl_service}:</strong></td>\n\t\t\t\t\t<td>" . Field_array_Hash($pure->dnsrbl_class, 'dnsrbl_class', null, null, null, 0, "font-size:14px") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td strong width=1% nowrap align='right'><strong style='font-size:14px'>{delay}:</strong></td>\n\t\t\t\t\t<td>" . Field_text("delay", "{$re[1]}{$re[2]}", 'width:100px;font-size:14px') . "</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t</table>"; break; case "gpid": if (preg_match('#gpid:([0-9]+)#', $ArrayACL["pattern"], $re)) { $gpid = $re[1]; } if (!preg_match('#delay\\s+([0-9]+)([a-z])#', $ArrayACL["pattern"], $re)) { $re[1] = 15; $re[2] = "m"; } $sql = "SELECT ID,objectname FROM miltergreylist_objects WHERE enabled=1 AND instance='{$_GET["hostname"]}' ORDER BY objectname"; $tt[null] = "{select}"; $q = new mysql(); $results = $q->QUERY_SQL($sql, "artica_backup"); while ($ligne = mysql_fetch_assoc($results)) { $tt[$ligne["ID"]] = $ligne["objectname"]; } $form = $pure->acl[$id] . "<table style='width:99%' class=form>\n\t\t\t\t<tr>\n\t\t\t\t\t<td strong width=1% nowrap align='right'><strong style='font-size:14px'>{group}:</strong></td>\n\t\t\t\t\t<td>" . Field_array_Hash($tt, 'gpid_class', $gpid, null, null, 0, "font-size:14px") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td strong width=1% nowrap align='right'><strong style='font-size:14px'>{delay}:</strong></td>\n\t\t\t\t\t<td>" . Field_text("delay", "{$re[1]}{$re[2]}", 'width:100px;font-size:14px') . "</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t</table>"; break; default: $form = "\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tr>\n\t\t\t\t<td align='right' width=1% nowrap ><strong style='font-size:14px'> {pattern}:</strong></td>\n\t\t\t\t<td><textarea name='pattern' id='pattern' rows=2 style='width:100%;font-size:14px;font-weight:bold'>{$line[3]}</textarea>\n\t\t\t</tr>\n\t\t</table>"; break; } $tpl = new templates(); echo $tpl->_ENGINE_parse_body($form); }