Commit Tidy allow public_cert to be null and move public_cert before notes

This commit is contained in:
johnnyq
2022-01-04 11:35:34 -05:00
parent c59e2e938c
commit 7112463e41
4 changed files with 21 additions and 22 deletions

View File

@@ -51,15 +51,15 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Public Key </label> <label>Public Key </label>
<div class="input-group"> <div class="input-group">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span> <span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
</div> </div>
<textarea class="form-control" name="public_key" placeholder="-----BEGIN CERTIFICATE-----"></textarea> <textarea class="form-control" name="public_key" placeholder="-----BEGIN CERTIFICATE-----"></textarea>
</div> </div>
</div> </div>
</div> </div>
<div class="modal-footer bg-white"> <div class="modal-footer bg-white">

4
db.sql
View File

@@ -186,11 +186,11 @@ CREATE TABLE `certificates` (
`certificate_domain` varchar(200) DEFAULT NULL, `certificate_domain` varchar(200) DEFAULT NULL,
`certificate_issued_by` varchar(200) NOT NULL, `certificate_issued_by` varchar(200) NOT NULL,
`certificate_expire` date DEFAULT NULL, `certificate_expire` date DEFAULT NULL,
`certificate_public_key` varchar(1500) DEFAULT NULL,
`certificate_notes` text DEFAULT NULL, `certificate_notes` text DEFAULT NULL,
`certificate_created_at` datetime NOT NULL, `certificate_created_at` datetime NOT NULL,
`certificate_updated_at` datetime DEFAULT NULL, `certificate_updated_at` datetime DEFAULT NULL,
`certificate_archived_at` datetime DEFAULT NULL, `certificate_archived_at` datetime DEFAULT NULL,
`certificate_public_key` varchar(1500) NOT NULL,
`certificate_client_id` int(11) NOT NULL, `certificate_client_id` int(11) NOT NULL,
`company_id` int(11) NOT NULL, `company_id` int(11) NOT NULL,
PRIMARY KEY (`certificate_id`) PRIMARY KEY (`certificate_id`)
@@ -1154,4 +1154,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2021-12-27 12:04:12 -- Dump completed on 2022-01-04 11:34:48

View File

@@ -51,15 +51,15 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Public Key </label> <label>Public Key </label>
<div class="input-group"> <div class="input-group">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span> <span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
</div> </div>
<textarea class="form-control" name="public_key"><?php echo $certificate_public_key; ?></textarea> <textarea class="form-control" name="public_key"><?php echo $certificate_public_key; ?></textarea>
</div> </div>
</div> </div>
</div> </div>
<div class="modal-footer bg-white"> <div class="modal-footer bg-white">

View File

@@ -953,14 +953,13 @@ if(isset($_POST['add_company_settings'])){
<li>Acquire balance can be useful for customer's to get their balance by phone</li> <li>Acquire balance can be useful for customer's to get their balance by phone</li>
</ul> </ul>
<?php <?php
// Check that there is access to write config.php // Check that there is access to write config.php
if (!file_put_contents("config.php", "Test")) { if(!file_put_contents("config.php", "Test")){
echo "<div class=\"alert alert-danger\" role=\"alert\">Warning: config.php is not writable. Ensure Apache has write access. </div>"; echo "<div class='alert alert-danger'>Warning: config.php is not writable. Ensure the webserver user has write access.</div>";
} }else{
else { // Else, able to write. Tidy up
// Else, able to write. Tidy up unlink("config.php");
unlink("config.php"); }
}
?> ?>
<center><a href="?database" class="btn btn-primary">Setup <i class="fa fa-fw fa-arrow-alt-circle-right"></i></a></center> <center><a href="?database" class="btn btn-primary">Setup <i class="fa fa-fw fa-arrow-alt-circle-right"></i></a></center>
</div> </div>