Fix to client_templates.inc.php

Discussion in 'Developers' Forum' started by Patrik Forsberg, Jul 25, 2022.

  1. Patrik Forsberg

    Patrik Forsberg New Member HowtoForge Supporter

    During my setup of a new ISPConfig setup I ran into a minor issue before I had all types of servers installed(mail,web,dns and so forth) when trying to create or edit a client template so I made this minor adjustment and thought it might come handy for the ISPConfig devs so sharing it here. Sorry if I do it in the wrong place!

    Code:
    --- /usr/local/ispconfig/interface/lib/classes/client_templates.inc.php.orig    2022-07-25 00:24:19.274792269 +0200
    +++ /usr/local/ispconfig/interface/lib/classes/client_templates.inc.php 2022-07-25 00:24:37.327211152 +0200
    @@ -229,9 +229,11 @@
                                                                            $limits_unified = array_unique(array_merge($limits_values, $additional_values));
                                                                    } else {
                                                                            $limits_unified = array();
    -                                                                       foreach($form["tabs"]["limits"]["fields"][$k]["value"] as $key => $val){
    -                                                                               if (in_array($key, $limits_values) || in_array($key, $additional_values)) $limits_unified[] = $key;
    -                                                                       }
    +                                    if(isset($form["tabs"]["limits"]["fields"][$k]) and isset($form["tabs"]["limits"]["fields"][$k]["value"])){
    +                                                                           foreach($form["tabs"]["limits"]["fields"][$k]["value"] as $key => $val){
    +                                                                                   if (in_array($key, $limits_values) || in_array($key, $additional_values)) $limits_unified[] = $key;
    +                                                                           }
    +                                    }
                                                                    }
                                                                    $limits[$k] = implode($form["tabs"]["limits"]["fields"][$k]["separator"], $limits_unified);
                                                                    break;
    Do with it what you want :)
     
  2. ahrasis

    ahrasis Well-Known Member

    ISPConfig is an open source software where all are invited to contribute. Though the best place for that is normally at its git site, I am sure they will be happy to see your proposal and involvement.
     

Share This Page