From: Ben Schmidt Date: Fri, 29 Oct 2010 11:25:56 +0000 (+1100) Subject: Changes to indentation in php-admin and php-user X-Git-Tag: RELEASE_1_2_18a1~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ec99e37ad5d826c779e1201d6da570fb02a92f1;p=thirdparty%2Fmlmmj.git Changes to indentation in php-admin and php-user --- diff --git a/contrib/web/php-admin/htdocs/edit.php b/contrib/web/php-admin/htdocs/edit.php index 2fc46411..77871468 100644 --- a/contrib/web/php-admin/htdocs/edit.php +++ b/contrib/web/php-admin/htdocs/edit.php @@ -34,9 +34,9 @@ function mlmmj_boolean($name, $nicename, $text) global $tpl, $topdir, $list; if(is_file($topdir."/".$list."/control/".$name)) - $checked = TRUE; + $checked = TRUE; else - $checked = FALSE; + $checked = FALSE; $tpl->assign(array("NAME" => htmlentities($name), "NICENAME" => htmlentities($nicename), @@ -54,8 +54,8 @@ function mlmmj_string($name, $nicename, $text) $value = ""; if(is_file($file)) { - $lines = file($file); - $value = $lines[0]; + $lines = file($file); + $value = $lines[0]; } $tpl->assign(array("NAME" => htmlentities($name), @@ -74,7 +74,7 @@ function mlmmj_list($name, $nicename, $text) $value = ""; if(is_file($file)) - $value = file_get_contents($file); + $value = file_get_contents($file); $tpl->assign(array("NAME" => htmlentities($name), "NICENAME" => htmlentities($nicename), diff --git a/contrib/web/php-admin/htdocs/save.php b/contrib/web/php-admin/htdocs/save.php index 47a6f130..2867eea1 100644 --- a/contrib/web/php-admin/htdocs/save.php +++ b/contrib/web/php-admin/htdocs/save.php @@ -37,13 +37,14 @@ function mlmmj_boolean($name, $nicename, $text) if(isset($_POST[$name]) && !empty($_POST[$name])) { - if(!touch($file)) - die("Couldn't open ".$file." for writing"); - if (!chmod($file, 0644)) - die("Couldn't chmod ".$file); + if(!touch($file)) + die("Couldn't open ".$file." for writing"); + if (!chmod($file, 0644)) + die("Couldn't chmod ".$file); + } + else { + @unlink($file); } - else - @unlink($file); } function mlmmj_string ($name, $nicename, $text) @@ -59,17 +60,18 @@ function mlmmj_list($name, $nicename, $text) if(isset($_POST[$name]) && !empty($_POST[$name])) { - if (!$fp = fopen($file, "w")) - die("Couldn't open ".$file." for writing"); + if (!$fp = fopen($file, "w")) + die("Couldn't open ".$file." for writing"); fwrite($fp, preg_replace('/\\r/',"",$_POST[$name])); - fclose($fp); + fclose($fp); - if (!chmod($file, 0644)) - die("Couldn't chmod ".$file); + if (!chmod($file, 0644)) + die("Couldn't chmod ".$file); + } + else { + @unlink($file); } - else - @unlink($file); }