Jump to content

Upcoming SSL Certificate Renewals on Admin Homepage


Patty

Recommended Posts

I wanted a way to view all SSL cetificates that are to be renewed some time before expiration date, so I can send clients an email offering to renew it, since WHMCS doesn't do this (at least for the eNom module). So I put this together. It will show on the admin homepage a list of the SSL expiring within the next 45 days (it can be changed to any number of days) based on the due date (date the certificate was created + 1 year, since WHMCS doesn't have a due date for certificates). It could use some improvements (I'm no programmer :oops: ), this was the best I could do. It's working fine for my needs, I hope it can be usefull to other people.

 

<!-- START ADMIN UPCOMING SSL RENEWALS -->
<h3 align="left"><span class="textred"><b>Upcoming SSL Certificate Renewals - Next 45 Days</b></span></h3>

<table bgcolor="#cccccc" align="center" style="margin-bottom:5px;width:100%;" cellspacing="1">
<tr bgcolor="#efefef" style="text-align:center;font-weight:bold;"><td>Company/User Name</td><td>Certificate</td>
<td>SSL Order ID</td>
<td>Next Due Date</td>
<td>Status</td></tr>
{php}
$i=1; $i<=46;

   $result = mysql_query("SELECT tblsslorders.*,tblclients.companyname,tblclients.firstname,tblclients.lastname FROM `tblsslorders`,`tblclients` WHERE tblsslorders.status = 'Completed' AND tblsslorders.userid = tblclients.id ORDER BY tblsslorders.completiondate ASC");

   while ($data = @mysql_fetch_array ($result)) {
       $usersname = $data['firstname']. ' ' .$data['lastname'];
       $cdate = $data['completiondate'];
       $duedate = strtotime('+1 year', strtotime($cdate)) ;
       $duedate = date('d/m/Y', $duedate);
       $today = date('d-m-Y');
       $days = (strtotime('+1 year', strtotime($cdate)) - strtotime($today)) / 86400;

        if ($days <= 46)

       echo '<tr bgcolor="#ffffff" style="text-align:center;"><td align="left"><a href="clientssummary.php?userid='.$data['userid'].'" target="_blank">'.(($data['companyname'])?$data['companyname']:$usersname).'</a></td><td><a href="clientshosting.php?userid='.$data['userid'].'&id='.$data['serviceid'].'" target="_blank">'.$data['certtype'].'</a></td><td>'.$data['remoteid'].'</td><td>'.$duedate.'</td><td>'.$data['status'].'</td></tr>'; $i=0;
   }
if ($i) echo '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="6">No upcoming SSL Certificate renewals</td></tr>';
{/php}
</table>
<br />
<!-- END UPCOMING SSL RENEWALS -->

Link to comment
Share on other sites

  • 3 weeks later...
Google helps a lot. Plus CTRL C and CTRL V what was already there. :D

 

LOL!

 

Looks like a useful addition and also a framework for other stuff.

 

One small thing - where does it go?

There isn't any 'adminxxxx.tpl or anything related to it as far as I can see :(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated