diff options
author | Phil Davis <phil.davis@inf.org> | 2015-05-30 21:42:30 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-05-30 21:42:30 +0545 |
commit | 73fa304bfc6ced005d8862be8dcbdab81aface9d (patch) | |
tree | 514e9385615938547030b76dd98d42999cee9279 /usr/local/www/system_usermanager_passwordmg.php | |
parent | 417008f782aeab859f9e6fb98940105e86af4cdc (diff) | |
download | pfsense-73fa304bfc6ced005d8862be8dcbdab81aface9d.zip pfsense-73fa304bfc6ced005d8862be8dcbdab81aface9d.tar.gz |
Code style system user manager
Diffstat (limited to 'usr/local/www/system_usermanager_passwordmg.php')
-rw-r--r-- | usr/local/www/system_usermanager_passwordmg.php | 93 |
1 files changed, 51 insertions, 42 deletions
diff --git a/usr/local/www/system_usermanager_passwordmg.php b/usr/local/www/system_usermanager_passwordmg.php index 9491824..6d785ee 100644 --- a/usr/local/www/system_usermanager_passwordmg.php +++ b/usr/local/www/system_usermanager_passwordmg.php @@ -27,8 +27,8 @@ POSSIBILITY OF SUCH DAMAGE. */ /* - pfSense_BUILDER_BINARIES: - pfSense_MODULE: auth + pfSense_BUILDER_BINARIES: + pfSense_MODULE: auth */ ##|+PRIV @@ -42,7 +42,7 @@ require_once("auth.inc"); require_once("certs.inc"); require_once("guiconfig.inc"); -$pgtitle = array(gettext("System"),gettext("User Password")); +$pgtitle = array(gettext("System"), gettext("User Password")); if (isset($_POST['save'])) { unset($input_errors); @@ -52,12 +52,14 @@ if (isset($_POST['save'])) { $reqdfieldsn = array(gettext("Password")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); - if ($_POST['passwordfld1'] != $_POST['passwordfld2']) + if ($_POST['passwordfld1'] != $_POST['passwordfld2']) { $input_errors[] = gettext("The passwords do not match."); + } if (!$input_errors) { - if (!session_id()) + if (!session_id()) { session_start(); + } // all values are okay --> saving changes $userent =& $config['system']['user'][$userindex[$_SESSION['Username']]]; @@ -72,14 +74,17 @@ if (isset($_POST['save'])) { } } -if (!session_id()) +if (!session_id()) { session_start(); +} /* determine if user is not local to system */ $islocal = false; -foreach($config['system']['user'] as $user) - if($user['name'] == $_SESSION['Username']) +foreach ($config['system']['user'] as $user) { + if ($user['name'] == $_SESSION['Username']) { $islocal = true; + } +} session_commit(); @@ -91,10 +96,12 @@ include("head.inc"); <?php include("fbegin.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); -if ($savemsg) +} +if ($savemsg) { print_info_box($savemsg); +} if ($islocal == false) { echo gettext("Sorry, you cannot change the password for a non-local user."); @@ -105,41 +112,43 @@ if ($islocal == false) { ?> <div id="mainarea"> - <div class="tabcont"> - <form action="system_usermanager_passwordmg.php" method="post" name="iform" id="iform"> - <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area"> - <tr> -<?php if (!session_id()) + <div class="tabcont"> + <form action="system_usermanager_passwordmg.php" method="post" name="iform" id="iform"> + <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area"> + <tr> +<?php + if (!session_id()) { session_start(); + } ?> - <td colspan="2" valign="top" class="listtopic"><?=$_SESSION['Username']?>'s <?=gettext("Password"); ?></td> + <td colspan="2" valign="top" class="listtopic"><?=$_SESSION['Username']?>'s <?=gettext("Password"); ?></td> <?php session_commit(); ?> - </tr> - <tr> - <td width="22%" valign="top" class="vncell" rowspan="2"><?=gettext("Password"); ?></td> - <td width="78%" class="vtable"> - <input name="passwordfld1" type="password" class="formfld pwd" id="passwordfld1" size="20" /> - </td> - </tr> - <tr> - <td width="78%" class="vtable"> - <input name="passwordfld2" type="password" class="formfld pwd" id="passwordfld2" size="20" /> - <?=gettext("(confirmation)");?> - <br /> - <span class="vexpl"> - <?=gettext("Select a new password");?> - </span> - </td> - </tr> - <tr> - <td width="22%" valign="top"> </td> - <td width="78%"> - <input name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>" /> - </td> - </tr> - </table> - </form> - </div> + </tr> + <tr> + <td width="22%" valign="top" class="vncell" rowspan="2"><?=gettext("Password"); ?></td> + <td width="78%" class="vtable"> + <input name="passwordfld1" type="password" class="formfld pwd" id="passwordfld1" size="20" /> + </td> + </tr> + <tr> + <td width="78%" class="vtable"> + <input name="passwordfld2" type="password" class="formfld pwd" id="passwordfld2" size="20" /> + <?=gettext("(confirmation)");?> + <br /> + <span class="vexpl"> + <?=gettext("Select a new password");?> + </span> + </td> + </tr> + <tr> + <td width="22%" valign="top"> </td> + <td width="78%"> + <input name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>" /> + </td> + </tr> + </table> + </form> + </div> </div> <?php include("fend.inc");?> </body> |