Skip to content

Commit

Permalink
Format with CodeSniffer --standard=PSR2
Browse files Browse the repository at this point in the history
  • Loading branch information
reetp committed Mar 3, 2021
1 parent fbf3170 commit 6703d98
Show file tree
Hide file tree
Showing 23 changed files with 2,494 additions and 2,404 deletions.
11 changes: 6 additions & 5 deletions about.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
<?php


include('./config.php');
include('./include/my_functions.php');
include('./include/common.php');

printHeader('about');

?>

<p>
PHPki is an <a href=http://www.opensource.org target=_blank>Open Source</a>
Web application for managing a <a href=<?php echo BASE_URL?>help/glossary.html#PKI target=help/glossary>
Public Key Infrastructure</a> within a small organizations. PHPki acts as a
mechanism for the centralized creation and management of digital certificates.
PHPki is capable of managing certificates for multiple organizations or user
accounts.
accounts.</p>

<p>
PHPki requires the Apache Web Server, the <href=http://www.php.net target=_blank>PHP</a> Scripting Language, and <href=http://www.openssl.org target=_blank>
OpenSSL</a>, all of which are included with any major
<a href=http://www.linux.org target=_blank> Linux Operating System</a>
<a href=http://www.redhat.com target=_blank>distribution</a>.
</p>

<p>
This software may be freely redistributed under the terms of the
<a href=http://www.gnu.org target=_blank>GNU</a> Public
License provided this page and all copyright notices remain completely intact.
</p>

<p>
<center><h4>Copyright: 2003, William E. Roadcap</h4>
<form>
Expand All @@ -36,7 +37,7 @@
</textarea>
</form>
</center>
<p>
</p>

<?php
printFooter();
Expand Down
201 changes: 100 additions & 101 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,118 +10,117 @@
$passwd = gpvar('passwd');
$passwdv = gpvar('passwdv');

switch($stage) {
case 'list_users':
printHeader('admin');
switch ($stage) {
case 'list_users':
printHeader('admin');
print '<p><h3>Contents of '.htvar($config['passwd_file']).' file:</h3><pre>';
readfile($config['passwd_file'])

?>
</pre>
<form action="<?php echo $PHP_SELF?>" method="post">
<input type=submit name=submit value="Back to Menu">
</form>
<?php
printFooter(false);
break;
?>
</pre>
<form action="<?php echo $PHP_SELF?>" method="post">
<input type=submit name=submit value="Back to Menu">
</form>
<?php
printFooter(false);
break;

case 'add_user_form';
printHeader('admin');
?>
<body onLoad="self.focus();document.form.login.focus()">
<form action="<?php echo $PHP_SELF?>" method="post" name="form">
<table>
<th colspan=2><h3>Add User or Change Password</h3></th>
<tr><td>User ID</td><td><input type=text name=login value="<?php echo htvar($login)?>" maxlength=15 size=15></td></tr>
<tr><td>Password </td><td><input type=password name=passwd value='' size=20></td></tr>
<tr><td>Verify Password </td><td><input type=password name=passwdv value='' size=20></td></tr>
</table>
<input type=hidden name=stage value=add_user>
<input type=submit name=submit value='Submit'>
</form>
<?php
break;
case 'add_user_form';
printHeader('admin');
?>
<body onLoad="self.focus();document.form.login.focus()">
<form action="<?php echo $PHP_SELF?>" method="post" name="form">
<table>
<th colspan=2><h3>Add User or Change Password</h3></th>
<tr><td>User ID</td><td><input type=text name=login value="<?php echo htvar($login)?>" maxlength=15 size=15></td></tr>
<tr><td>Password </td><td><input type=password name=passwd value='' size=20></td></tr>
<tr><td>Verify Password </td><td><input type=password name=passwdv value='' size=20></td></tr>
</table>
<input type=hidden name=stage value=add_user>
<input type=submit name=submit value='Submit'>
</form>
<?php
break;

case 'add_user':
printHeader('admin');
if (! $passwd || ! $passwdv || $passwd != $passwdv || strlen($passwd) < 8) {
print "<center><h2><font color=red>Missing or invalid password or password and password verification do not match.</font></h2></center>"
case 'add_user':
printHeader('admin');
if (! $passwd || ! $passwdv || $passwd != $passwdv || strlen($passwd) < 8) {
print "<center><h2><font color=red>Missing or invalid password or password and password verification do not match.</font></h2></center>"

?>
<p><center>
<form action="<?php echo $PHP_SELF?>" method="post">
<input type=hidden name=stage value=add_user_form>
<input type=hidden name=login value="<?php echo htvar($login)?>">
<input type=submit name=submit value=Back>
</form></center>
<?php
}
else {
$pwdfile = escapeshellarg($config['passwd_file']);
$login = escapeshellarg($login);
$passwd = escapeshellarg($passwd);
?>
<p><center>
<form action="<?php echo $PHP_SELF?>" method="post">
<input type=hidden name=stage value=add_user_form>
<input type=hidden name=login value="<?php echo htvar($login)?>">
<input type=submit name=submit value=Back>
</form></center>
<?php
} else {
$pwdfile = escapeshellarg($config['passwd_file']);
$login = escapeshellarg($login);
$passwd = escapeshellarg($passwd);

print 'Results of htpasswd command:<br>';
system("htpasswd -bm $pwdfile $login $passwd 2>&1")
?>
<p>
<form action="<?php echo $PHP_SELF?>" method="post">
<input type=submit name=submit value="Back to Menu">
</form>
<?php
}
printFooter();
break;
print 'Results of htpasswd command:<br>';
system("htpasswd -bm $pwdfile $login $passwd 2>&1")
?>
<p>
<form action="<?php echo $PHP_SELF?>" method="post">
<input type=submit name=submit value="Back to Menu">
</form>
<?php
}
printFooter();
break;

case 'del_user_form';
printHeader('admin');
?>
<body onLoad="self.focus();document.form.login.focus();">
<form action="<?php echo $PHP_SELF?>" method="post" name="form">
<table>
<th colspan=2><h3>Remove User</h3></th>
<tr><td>User ID</td><td><input type=text name=login value="<?php echo htvar($login)?>" maxlength=15 size=15></td></tr>
</table>
<input type=hidden name=stage value=del_user>
<input type=submit name=submit value='Submit'>
</form>
<?php
printFooter();
break;
case 'del_user':
printHeader('admin');
case 'del_user_form';
printHeader('admin');
?>
<body onLoad="self.focus();document.form.login.focus();">
<form action="<?php echo $PHP_SELF?>" method="post" name="form">
<table>
<th colspan=2><h3>Remove User</h3></th>
<tr><td>User ID</td><td><input type=text name=login value="<?php echo htvar($login)?>" maxlength=15 size=15></td></tr>
</table>
<input type=hidden name=stage value=del_user>
<input type=submit name=submit value='Submit'>
</form>
<?php
printFooter();
break;
case 'del_user':
printHeader('admin');

$pwdfile = escapeshellarg($config['passwd_file']);
$login = escapeshellarg($login);
$pwdfile = escapeshellarg($config['passwd_file']);
$login = escapeshellarg($login);

print 'Results of htpasswd command:<br>';
system("htpasswd -D $pwdfile $login 2>&1")
?>
<p>
<form action="<?php echo $PHP_SELF?>" method="post">
<input type=submit name=submit value="Back to Menu">
</form>
<?php
printFooter();
break;
print 'Results of htpasswd command:<br>';
system("htpasswd -D $pwdfile $login 2>&1")
?>
<p>
<form action="<?php echo $PHP_SELF?>" method="post">
<input type=submit name=submit value="Back to Menu">
</form>
<?php
printFooter();
break;

default:
printHeader('admin');
?>
<br>
<br>
<center>
<table class=menu><th class=menu>SYSADMIN MENU</th>
<tr><td class=menu style="padding-left: 1em;"><table>
<tr><td class=menu-pad><a href=<?php echo $PHP_SELF?>?stage=add_user_form>Add User or Change Password</a></td></tr>
<tr><td class=menu-pad><a href=<?php echo $PHP_SELF?>?stage=del_user_form>Remove User</a></td></tr>
<tr><td class=menu-pad><a href=<?php echo $PHP_SELF?>?stage=list_users>List Password File Contents</a></td></tr>
</table></td></tr>
</table>
</center>
<br><br>
<?php
printFooter();
default:
printHeader('admin');
?>
<br>
<br>
<center>
<table class=menu><th class=menu>SYSADMIN MENU</th>
<tr><td class=menu style="padding-left: 1em;"><table>
<tr><td class=menu-pad><a href=<?php echo $PHP_SELF?>?stage=add_user_form>Add User or Change Password</a></td></tr>
<tr><td class=menu-pad><a href=<?php echo $PHP_SELF?>?stage=del_user_form>Remove User</a></td></tr>
<tr><td class=menu-pad><a href=<?php echo $PHP_SELF?>?stage=list_users>List Password File Contents</a></td></tr>
</table></td></tr>
</table>
</center>
<br><br>
<?php
printFooter();
}

?>
1 change: 0 additions & 1 deletion ca/index.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<?php
header("Location: ./../index.php");
?>
Loading

0 comments on commit 6703d98

Please sign in to comment.