function main_configfile(){ $users=new usersMenus(); if($_GET["hostname"]==null){$hostname=$users->hostname;}else{$hostname=$_GET["hostname"];} $squid=new squid($hostname); $squid->BuildConfig(); $squid->SaveToLdap(); $conf=$squid->squid_conf; $table=explode("\n",$conf); $html= main_tabs() . " <br> <div style='padding:5px;margin:5px'> <table style='width:100%'> "; while (list ($num, $val) = each ($table) ){ $linenum=$num+1; $html=$html . "<tr><td width=1% style='background-color:#CCCCCCC'><strong>$linenum</strong></td><td width=99%'><code>$val</code></td></tr>"; } $html=$html . "</table> </div>"; $tpl=new templates(); echo $tpl->_parse_body($html); }
function main_apply_conf() { $hostname = $_GET["hostname"]; $squid = new squid($hostname); $squid->BuildConfig(); $squid->SaveToLdap(); $squid->SaveToServer(); }