*space changes only*
This commit is contained in:
parent
9025bcd78c
commit
06313e510a
|
@ -3,18 +3,13 @@
|
||||||
/**
|
/**
|
||||||
* SSL Api of AlternC, used by alternc-api package
|
* SSL Api of AlternC, used by alternc-api package
|
||||||
*/
|
*/
|
||||||
class Alternc_Api_Object_Ssl {
|
class Alternc_Api_Object_Ssl extends Alternc_Api_Legacyobject {
|
||||||
|
|
||||||
const ERR_INVALID_ARGUMENT = 11151901;
|
protected $ssl;
|
||||||
const ERR_ALTERNC_FUNCTION = 11151902;
|
|
||||||
|
|
||||||
function __construct($service) {
|
function __construct($service) {
|
||||||
global $ssl,$cuid;
|
global $ssl;
|
||||||
if (!($service instanceof Alternc_Api_Service)) {
|
parent::__construct($service);
|
||||||
throw new \Exception("Bad argument: service is not an Alternc_Api_Service", self::ERR_INVALID_ARGUMENT);
|
|
||||||
}
|
|
||||||
// We store the global $cuid to AlternC legacy classes
|
|
||||||
$cuid=$service->token->uid;
|
|
||||||
// We use the global $ssl from AlternC legacy classes
|
// We use the global $ssl from AlternC legacy classes
|
||||||
$this->ssl=$ssl;
|
$this->ssl=$ssl;
|
||||||
}
|
}
|
||||||
|
@ -189,14 +184,4 @@ class Alternc_Api_Object_Ssl {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** return a proper Alternc_Api_Response from an error class and error string
|
|
||||||
* from AlternC legacy class
|
|
||||||
*/
|
|
||||||
private function alterncLegacyErrorManager() {
|
|
||||||
global $err;
|
|
||||||
return new Alternc_Api_Response( array("code" => self::ERR_ALTERNC_FUNCTION, "message" => "[".$err->clsid."] ".$err->error) );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // class Alternc_Api_Object_Ssl
|
} // class Alternc_Api_Object_Ssl
|
|
@ -1,52 +1,53 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
AlternC - Web Hosting System
|
AlternC - Web Hosting System
|
||||||
Copyright (C) 2002 by the AlternC Development Team.
|
Copyright (C) 2002 by the AlternC Development Team.
|
||||||
http://alternc.org/
|
http://alternc.org/
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License (GPL)
|
modify it under the terms of the GNU General Public License (GPL)
|
||||||
as published by the Free Software Foundation; either version 2
|
as published by the Free Software Foundation; either version 2
|
||||||
of the License, or (at your option) any later version.
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
Original Author of file: Benjamin Sonntag
|
Original Author of file: Benjamin Sonntag
|
||||||
Purpose of file: Create / Import an SSL Certificate
|
Purpose of file: Create / Import an SSL Certificate
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if ( !isset($is_include) ) {
|
if (!isset($is_include)) {
|
||||||
$fields = array (
|
$fields = array(
|
||||||
"key" => array ("post", "string", ""),
|
"key" => array("post", "string", ""),
|
||||||
"crt" => array ("post", "string", ""),
|
"crt" => array("post", "string", ""),
|
||||||
"chain" => array ("post", "string", ""),
|
"chain" => array("post", "string", ""),
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$key && !$crt) {
|
if (!$key && !$crt) {
|
||||||
$error=_("Please enter an ssl key and a certificate");
|
$error = _("Please enter an ssl key and a certificate");
|
||||||
require_once("ssl_new.php");
|
require_once("ssl_new.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$id=$ssl->import_cert($key,$crt,$chain);
|
$id = $ssl->import_cert($key, $crt, $chain);
|
||||||
$error=$err->errstr();
|
$error = $err->errstr();
|
||||||
if ($error) {
|
if ($error) {
|
||||||
require_once("ssl_new.php");
|
require_once("ssl_new.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
header("Location: /ssl_view.php?id=".$id);
|
header("Location: /ssl_view.php?id=" . $id);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,54 +1,57 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
AlternC - Web Hosting System
|
AlternC - Web Hosting System
|
||||||
Copyright (C) 2002 by the AlternC Development Team.
|
Copyright (C) 2002 by the AlternC Development Team.
|
||||||
http://alternc.org/
|
http://alternc.org/
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License (GPL)
|
modify it under the terms of the GNU General Public License (GPL)
|
||||||
as published by the Free Software Foundation; either version 2
|
as published by the Free Software Foundation; either version 2
|
||||||
of the License, or (at your option) any later version.
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
Original Author of file: Benjamin Sonntag
|
Original Author of file: Benjamin Sonntag
|
||||||
Purpose of file: Create / Import an SSL Certificate
|
Purpose of file: Create / Import an SSL Certificate
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if ( !isset($is_include) ) {
|
if (!isset($is_include)) {
|
||||||
$fields = array (
|
$fields = array(
|
||||||
"fqdn" => array ("request", "string", ""),
|
"fqdn" => array("request", "string", ""),
|
||||||
"fqdnt" => array ("request", "string", ""),
|
"fqdnt" => array("request", "string", ""),
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$fqdn && !$fqdnt) {
|
if (!$fqdn && !$fqdnt) {
|
||||||
$error=_("Please enter a proper domain name");
|
$error = _("Please enter a proper domain name");
|
||||||
require_once("ssl_new.php");
|
require_once("ssl_new.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($fqdnt) $d=$fqdnt;
|
if ($fqdnt)
|
||||||
if ($fqdn) $d=$fqdn;
|
$d = $fqdnt;
|
||||||
|
if ($fqdn)
|
||||||
|
$d = $fqdn;
|
||||||
|
|
||||||
$id=$ssl->new_csr($d);
|
$id = $ssl->new_csr($d);
|
||||||
$error=$err->errstr();
|
$error = $err->errstr();
|
||||||
if ($error) {
|
if ($error) {
|
||||||
require_once("ssl_new.php");
|
require_once("ssl_new.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_include=true;
|
$is_include = true;
|
||||||
require_once("ssl_view.php");
|
require_once("ssl_view.php");
|
||||||
|
|
||||||
|
|
|
@ -1,44 +1,45 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
AlternC - Web Hosting System
|
AlternC - Web Hosting System
|
||||||
Copyright (C) 2002 by the AlternC Development Team.
|
Copyright (C) 2002 by the AlternC Development Team.
|
||||||
http://alternc.org/
|
http://alternc.org/
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License (GPL)
|
modify it under the terms of the GNU General Public License (GPL)
|
||||||
as published by the Free Software Foundation; either version 2
|
as published by the Free Software Foundation; either version 2
|
||||||
of the License, or (at your option) any later version.
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
Original Author of file: Benjamin Sonntag
|
Original Author of file: Benjamin Sonntag
|
||||||
Purpose of file: Create / Import an SSL Certificate
|
Purpose of file: Create / Import an SSL Certificate
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
$fields = array (
|
$fields = array(
|
||||||
"id" => array ("post", "integer", ""),
|
"id" => array("post", "integer", ""),
|
||||||
"crt" => array ("post", "string", ""),
|
"crt" => array("post", "string", ""),
|
||||||
"chain" => array ("post", "string", ""),
|
"chain" => array("post", "string", ""),
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
$cert=$ssl->finalize($id,$crt,$chain);
|
$cert = $ssl->finalize($id, $crt, $chain);
|
||||||
echo $ssl->error;
|
echo $ssl->error;
|
||||||
$error=$err->errstr();
|
$error = $err->errstr();
|
||||||
if ($error) {
|
if ($error) {
|
||||||
require_once("ssl_list.php");
|
require_once("ssl_list.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$info=_("Your ssl certificate has been imported successfully");
|
$info = _("Your ssl certificate has been imported successfully");
|
||||||
|
|
||||||
require_once("ssl_view.php");
|
require_once("ssl_view.php");
|
||||||
|
|
|
@ -1,106 +1,110 @@
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
AlternC - Web Hosting System
|
AlternC - Web Hosting System
|
||||||
Copyright (C) 2002 by the AlternC Development Team.
|
Copyright (C) 2002 by the AlternC Development Team.
|
||||||
http://alternc.org/
|
http://alternc.org/
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License (GPL)
|
modify it under the terms of the GNU General Public License (GPL)
|
||||||
as published by the Free Software Foundation; either version 2
|
as published by the Free Software Foundation; either version 2
|
||||||
of the License, or (at your option) any later version.
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
Original Author of file: Benjamin Sonntag
|
Original Author of file: Benjamin Sonntag
|
||||||
Purpose of file: Create / Import an SSL Certificate
|
Purpose of file: Create / Import an SSL Certificate
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if ( !isset($is_include) ) {
|
if (!isset($is_include)) {
|
||||||
$fields = array (
|
$fields = array(
|
||||||
"filter" => array ("request", "integer", null),
|
"filter" => array("request", "integer", null),
|
||||||
"filter1" => array ("request", "integer", 0),
|
"filter1" => array("request", "integer", 0),
|
||||||
"filter2" => array ("request", "integer", 0),
|
"filter2" => array("request", "integer", 0),
|
||||||
"filter4" => array ("request", "integer", 0),
|
"filter4" => array("request", "integer", 0),
|
||||||
"filter8" => array ("request", "integer", 0),
|
"filter8" => array("request", "integer", 0),
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($filter1) && isset($filter2) && isset($filter4) && isset($filter8)) {
|
if (isset($filter1) && isset($filter2) && isset($filter4) && isset($filter8)) {
|
||||||
$filter=$filter1+$filter2+$filter4+$filter8;
|
$filter = $filter1 + $filter2 + $filter4 + $filter8;
|
||||||
if ($filter==0) $filter=null;
|
if ($filter == 0)
|
||||||
|
$filter = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$r=$ssl->get_list($filter);
|
$r = $ssl->get_list($filter);
|
||||||
|
|
||||||
if (!$error) $error.=$err->errstr();
|
if (!$error)
|
||||||
|
$error.=$err->errstr();
|
||||||
|
|
||||||
$astatus=array(
|
$astatus = array(
|
||||||
$ssl::STATUS_PENDING => _("Pending Certificate"),
|
$ssl::STATUS_PENDING => _("Pending Certificate"),
|
||||||
$ssl::STATUS_OK => _("Valid"),
|
$ssl::STATUS_OK => _("Valid"),
|
||||||
$ssl::STATUS_EXPIRED => ("Expired"),
|
$ssl::STATUS_EXPIRED => ("Expired"),
|
||||||
);
|
);
|
||||||
|
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if ($error) {
|
if ($error) {
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||||
}
|
}
|
||||||
if ($info) {
|
if ($info) {
|
||||||
echo "<p class=\"alert alert-info\">$info</p>";
|
echo "<p class=\"alert alert-info\">$info</p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<h3><?php __("Your Certificates"); ?></h3>
|
<h3><?php __("Your Certificates"); ?></h3>
|
||||||
|
|
||||||
<p><?php __("Please find below your SSL Certificates. Some may be provided by the administrator of the server, some may be Expired or Pending (waiting for a CRT from your Certificate Provider)"); ?></p>
|
<p><?php __("Please find below your SSL Certificates. Some may be provided by the administrator of the server, some may be Expired or Pending (waiting for a CRT from your Certificate Provider)"); ?></p>
|
||||||
<form method="get" action="ssl_list.php" name="filter">
|
<form method="get" action="ssl_list.php" name="filter">
|
||||||
<p><?php __("Only show the following certificates:"); ?> <br />
|
<p><?php __("Only show the following certificates:"); ?> <br />
|
||||||
<label for="filter1"><input type="checkbox" onclick="document.forms['filter'].submit()" name="filter1" id="filter1" value="1" <?php cbox($filter & $ssl::FILTER_PENDING); ?>><?php __("Pending Certificates"); ?></label>
|
<label for="filter1"><input type="checkbox" onclick="document.forms['filter'].submit()" name="filter1" id="filter1" value="1" <?php cbox($filter & $ssl::FILTER_PENDING); ?>><?php __("Pending Certificates"); ?></label>
|
||||||
<label for="filter2"><input type="checkbox" onclick="document.forms['filter'].submit()" name="filter2" id="filter2" value="2" <?php cbox($filter & $ssl::FILTER_OK); ?>><?php __("Valid Certificates"); ?></label>
|
<label for="filter2"><input type="checkbox" onclick="document.forms['filter'].submit()" name="filter2" id="filter2" value="2" <?php cbox($filter & $ssl::FILTER_OK); ?>><?php __("Valid Certificates"); ?></label>
|
||||||
<label for="filter4"><input type="checkbox" onclick="document.forms['filter'].submit()" name="filter4" id="filter4" value="4" <?php cbox($filter & $ssl::FILTER_EXPIRED); ?>><?php __("Expired Certificates"); ?></label>
|
<label for="filter4"><input type="checkbox" onclick="document.forms['filter'].submit()" name="filter4" id="filter4" value="4" <?php cbox($filter & $ssl::FILTER_EXPIRED); ?>><?php __("Expired Certificates"); ?></label>
|
||||||
<br />
|
<br />
|
||||||
<label for="filter8"><input type="checkbox" onclick="document.forms['filter'].submit()" name="filter8" id="filter8" value="8" <?php cbox($filter & $ssl::FILTER_SHARED); ?>><?php __("Certificates Shared by the Administrator"); ?></label>
|
<label for="filter8"><input type="checkbox" onclick="document.forms['filter'].submit()" name="filter8" id="filter8" value="8" <?php cbox($filter & $ssl::FILTER_SHARED); ?>><?php __("Certificates Shared by the Administrator"); ?></label>
|
||||||
|
|
||||||
<input type="submit" name="go" value="<?php __("Filter"); ?>"/>
|
<input type="submit" name="go" value="<?php __("Filter"); ?>"/>
|
||||||
</form>
|
</form>
|
||||||
<table class="tlist">
|
<table class="tlist">
|
||||||
<tr><th></th><th><?php __("FQDN"); ?></th><th><?php __("Status"); ?></th><th><?php __("Valid From"); ?></th><th><?php __("Valid Until"); ?></th></tr>
|
<tr><th></th><th><?php __("FQDN"); ?></th><th><?php __("Status"); ?></th><th><?php __("Valid From"); ?></th><th><?php __("Valid Until"); ?></th></tr>
|
||||||
<?php
|
<?php
|
||||||
reset($r);
|
reset($r);
|
||||||
while (list($key,$val)=each($r)) { ?>
|
while (list($key, $val) = each($r)) {
|
||||||
<tr class="lst">
|
?>
|
||||||
<td><div class="ina edit"><a href="ssl_view.php?id=<?php echo $val["id"] ?>"><?php __("Details"); ?></a></div></td>
|
<tr class="lst">
|
||||||
|
<td><div class="ina edit"><a href="ssl_view.php?id=<?php echo $val["id"] ?>"><?php __("Details"); ?></a></div></td>
|
||||||
|
|
||||||
<td><?php echo $val["fqdn"]; ?></td>
|
<td><?php echo $val["fqdn"]; ?></td>
|
||||||
<td><?php echo $astatus[$val["status"]];
|
<td><?php echo $astatus[$val["status"]];
|
||||||
if ($val["shared"]) echo " <i>"._("(shared)")."</i>"; ?></td>
|
if ($val["shared"])
|
||||||
<?php
|
echo " <i>" . _("(shared)") . "</i>";
|
||||||
if ($val["status"]!=$ssl::STATUS_PENDING) {
|
?></td>
|
||||||
?>
|
<?php
|
||||||
<td><?php echo format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s",$val["validstartts"])); ?></td>
|
if ($val["status"] != $ssl::STATUS_PENDING) {
|
||||||
<td><?php echo format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s",$val["validendts"])); ?></td>
|
?>
|
||||||
<?php } else { ?>
|
<td><?php echo format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'), date("Y-m-d H:i:s", $val["validstartts"])); ?></td>
|
||||||
<td><?php __("Requested on: "); ?></td>
|
<td><?php echo format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'), date("Y-m-d H:i:s", $val["validendts"])); ?></td>
|
||||||
<td><?php echo format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s",$val["validstartts"])); ?></td>
|
<?php } else { ?>
|
||||||
<?php } ?>
|
<td><?php __("Requested on: "); ?></td>
|
||||||
</tr>
|
<td><?php echo format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'), date("Y-m-d H:i:s", $val["validstartts"])); ?></td>
|
||||||
<?php
|
<?php } ?>
|
||||||
}
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
<p>
|
<p>
|
||||||
<span class="inb add"><a href="ssl_new.php"><?php __("Create or Import a new SSL Certificate"); ?></a></span>
|
<span class="inb add"><a href="ssl_new.php"><?php __("Create or Import a new SSL Certificate"); ?></a></span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php include_once("foot.php"); ?>
|
<?php include_once("foot.php"); ?>
|
||||||
|
|
|
@ -1,162 +1,163 @@
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
AlternC - Web Hosting System
|
AlternC - Web Hosting System
|
||||||
Copyright (C) 2002 by the AlternC Development Team.
|
Copyright (C) 2002 by the AlternC Development Team.
|
||||||
http://alternc.org/
|
http://alternc.org/
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License (GPL)
|
modify it under the terms of the GNU General Public License (GPL)
|
||||||
as published by the Free Software Foundation; either version 2
|
as published by the Free Software Foundation; either version 2
|
||||||
of the License, or (at your option) any later version.
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
Original Author of file: Benjamin Sonntag
|
Original Author of file: Benjamin Sonntag
|
||||||
Purpose of file: Create / Import an SSL Certificate
|
Purpose of file: Create / Import an SSL Certificate
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if ( !isset($is_include) ) {
|
if (!isset($is_include)) {
|
||||||
$fields = array (
|
$fields = array(
|
||||||
"fqdnt" => array ("request", "string", ""),
|
"fqdnt" => array("request", "string", ""),
|
||||||
"key" => array ("request", "string", ""),
|
"key" => array("request", "string", ""),
|
||||||
"crt" => array ("request", "string", ""),
|
"crt" => array("request", "string", ""),
|
||||||
"chain" => array ("request", "string", ""),
|
"chain" => array("request", "string", ""),
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
$advice=$ssl->get_new_advice();
|
$advice = $ssl->get_new_advice();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h3><?php __("New SSL Certificate"); ?></h3>
|
<h3><?php __("New SSL Certificate"); ?></h3>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
if (isset($error) && $error) {
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
<?php __("An SSL certificate is a file which must be obtained from a Certificate Authority, and allow you to enable HTTPS encryption on a domain name."); ?>
|
<?php __("An SSL certificate is a file which must be obtained from a Certificate Authority, and allow you to enable HTTPS encryption on a domain name."); ?>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<?php __("To obtain one, you need to generate a <i>Certificate Request</i> (CSR) and a <i>RSA Key</i> (KEY) here, then give the CSR to the Certificate Authority, which will give you a certificate (CRT) and also often a chained certificate (CHAIN)."); ?>
|
<?php __("To obtain one, you need to generate a <i>Certificate Request</i> (CSR) and a <i>RSA Key</i> (KEY) here, then give the CSR to the Certificate Authority, which will give you a certificate (CRT) and also often a chained certificate (CHAIN)."); ?>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<?php __("If you already know what it is and already have all those files (CRT/KEY/CHAIN) You can import them here too."); ?>
|
<?php __("If you already know what it is and already have all those files (CRT/KEY/CHAIN) You can import them here too."); ?>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<div id="tabsssl">
|
<div id="tabsssl">
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li class="add"><a href="#tabsssl-create"><?php __("Create a CSR/KEY"); ?></a></li>
|
<li class="add"><a href="#tabsssl-create"><?php __("Create a CSR/KEY"); ?></a></li>
|
||||||
<li class="settings"><a href="#tabsssl-import"><?php __("Import existing files"); ?></a></li>
|
<li class="settings"><a href="#tabsssl-import"><?php __("Import existing files"); ?></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="tabsssl-create">
|
<div id="tabsssl-create">
|
||||||
<h3><?php __("Create a CSR/KEY for a given domain name"); ?></h3>
|
<h3><?php __("Create a CSR/KEY for a given domain name"); ?></h3>
|
||||||
|
|
||||||
<p><?php __("Use this form to generate a <i>Certificate Request file</i> (CSR) and a <i>RSA Key file</i> (KEY) for a given domain name"); ?></p>
|
<p><?php __("Use this form to generate a <i>Certificate Request file</i> (CSR) and a <i>RSA Key file</i> (KEY) for a given domain name"); ?></p>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function switchmanual() {
|
function switchmanual() {
|
||||||
if ($("#fqdn").val()==-1) {
|
if ($("#fqdn").val() == -1) {
|
||||||
$("#fqdn").hide();
|
$("#fqdn").hide();
|
||||||
$("#fqdnt").show();
|
$("#fqdnt").show();
|
||||||
$("#relist").show();
|
$("#relist").show();
|
||||||
$("#fqdn").val("");
|
$("#fqdn").val("");
|
||||||
$("#fqdnt").focus();
|
$("#fqdnt").focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchlist() {
|
function switchlist() {
|
||||||
$("#fqdn").show();
|
$("#fqdn").show();
|
||||||
$("#fqdnt").hide();
|
$("#fqdnt").hide();
|
||||||
$("#relist").hide();
|
$("#relist").hide();
|
||||||
$("#fqdnt").val("");
|
$("#fqdnt").val("");
|
||||||
$("#fqdn").val("");
|
$("#fqdn").val("");
|
||||||
$("#fqdn").focus();
|
$("#fqdn").focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form method="post" action="ssl_donew.php" name="main" id="main">
|
<form method="post" action="ssl_donew.php" name="main" id="main">
|
||||||
<table border="1" cellspacing="0" cellpadding="4" class="tedit">
|
<table border="1" cellspacing="0" cellpadding="4" class="tedit">
|
||||||
<tr><td colspan="2">
|
<tr><td colspan="2">
|
||||||
<?php __("Please choose the domain name for which you want a SSL Certificate, or enter it manually"); ?>
|
<?php __("Please choose the domain name for which you want a SSL Certificate, or enter it manually"); ?>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><label for="fqdn"><?php __("Fully Qualified Domain Name"); ?></label></th>
|
<th><label for="fqdn"><?php __("Fully Qualified Domain Name"); ?></label></th>
|
||||||
<td>
|
<td>
|
||||||
<select name="fqdn" id="fqdn" onchange="switchmanual()"<?php if ($fqdnt!="") echo " style=\"display: none\""; ?>>
|
<select name="fqdn" id="fqdn" onchange="switchmanual()"<?php if ($fqdnt != "") echo " style=\"display: none\""; ?>>
|
||||||
<option value=""><?php __("--- Choose here ---"); ?></option>
|
<option value=""><?php __("--- Choose here ---"); ?></option>
|
||||||
<?php foreach($advice as $a) {
|
<?php
|
||||||
echo "<option>".$a."</option>";
|
foreach ($advice as $a) {
|
||||||
}
|
echo "<option>" . $a . "</option>";
|
||||||
?>
|
}
|
||||||
<option value="-1" style="font-style: italic; padding-left: 80px"> <?php __("... or click here to enter it manually"); ?></option>
|
?>
|
||||||
</select>
|
<option value="-1" style="font-style: italic; padding-left: 80px"> <?php __("... or click here to enter it manually"); ?></option>
|
||||||
<input<?php if ($fqdnt=="") echo " style=\"display: none\""; ?> type="text" class="int" name="fqdnt" id="fqdnt" value="" size="40" maxlength="64" /><input <?php if ($fqdnt=="") echo " style=\"display: none\""; ?> type="button" id="relist" name="relist" value=" list v " onclick="switchlist()" />
|
</select>
|
||||||
</td>
|
<input<?php if ($fqdnt == "") echo " style=\"display: none\""; ?> type="text" class="int" name="fqdnt" id="fqdnt" value="" size="40" maxlength="64" /><input <?php if ($fqdnt == "") echo " style=\"display: none\""; ?> type="button" id="relist" name="relist" value=" list v " onclick="switchlist()" />
|
||||||
</tr>
|
</td>
|
||||||
</table>
|
</tr>
|
||||||
<p>
|
</table>
|
||||||
<input type="submit" class="inb ok" name="submit" value="<?php __("Save"); ?>"/>
|
<p>
|
||||||
<input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='ssl_list.php'"/>
|
<input type="submit" class="inb ok" name="submit" value="<?php __("Save"); ?>"/>
|
||||||
</p>
|
<input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location = 'ssl_list.php'"/>
|
||||||
</form>
|
</p>
|
||||||
|
</form>
|
||||||
|
|
||||||
<div style="padding-left: 40px; margin-top: 20px; background: url(/images/warning.png) 5px 5px no-repeat">
|
<div style="padding-left: 40px; margin-top: 20px; background: url(/images/warning.png) 5px 5px no-repeat">
|
||||||
<p><?php __("Please note that a SSL Certificate is only valid for one fully qualified domain name. As a result, a certificate for <code>www.example.com</code> is NOT valid for <code>intranet.example.com</code> or <code>intranet.www.example.com</code> !"); ?> <br /><?php __("<i>(If you want to get a valid certificate for all the subdomains of a domain, use a wildcard notation (eg: *.example.com). Please note that a wildcard certificate is usually more expensive than normal one.)</i>"); ?></p>
|
<p><?php __("Please note that a SSL Certificate is only valid for one fully qualified domain name. As a result, a certificate for <code>www.example.com</code> is NOT valid for <code>intranet.example.com</code> or <code>intranet.www.example.com</code> !"); ?> <br /><?php __("<i>(If you want to get a valid certificate for all the subdomains of a domain, use a wildcard notation (eg: *.example.com). Please note that a wildcard certificate is usually more expensive than normal one.)</i>"); ?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div> <!-- create -->
|
</div> <!-- create -->
|
||||||
|
|
||||||
|
|
||||||
<div id="tabsssl-import">
|
<div id="tabsssl-import">
|
||||||
<h3><?php __("Import existing Key Certificate and Chain files"); ?></h3>
|
<h3><?php __("Import existing Key Certificate and Chain files"); ?></h3>
|
||||||
|
|
||||||
<p><?php __("If you already have a RSA Key file, a Certificate for this key and (maybe) a Chained certificate, please paste their content here."); ?></p>
|
<p><?php __("If you already have a RSA Key file, a Certificate for this key and (maybe) a Chained certificate, please paste their content here."); ?></p>
|
||||||
<p><?php __("We will verify the content of those files and add them in your certificate repository"); ?></p>
|
<p><?php __("We will verify the content of those files and add them in your certificate repository"); ?></p>
|
||||||
|
|
||||||
<form method="post" action="ssl_doimport.php" name="main" id="main">
|
<form method="post" action="ssl_doimport.php" name="main" id="main">
|
||||||
<table border="1" cellspacing="0" cellpadding="4" class="tedit">
|
<table border="1" cellspacing="0" cellpadding="4" class="tedit">
|
||||||
<tr>
|
<tr>
|
||||||
<th><label for="key"><?php __("RSA Key"); ?></label></th>
|
<th><label for="key"><?php __("RSA Key"); ?></label></th>
|
||||||
<td><textarea class="int" name="key" id="key" style="width: 420px; height: 120px;"></textarea></td>
|
<td><textarea class="int" name="key" id="key" style="width: 420px; height: 120px;"></textarea></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><label for="crt"><?php __("SSL Certificate"); ?></label></th>
|
<th><label for="crt"><?php __("SSL Certificate"); ?></label></th>
|
||||||
<td><textarea class="int" name="crt" id="crt" style="width: 420px; height: 120px;"></textarea></td>
|
<td><textarea class="int" name="crt" id="crt" style="width: 420px; height: 120px;"></textarea></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><label for="chain"><?php __("Chained Certificate<br />(not mandatory)"); ?></label></th>
|
<th><label for="chain"><?php __("Chained Certificate<br />(not mandatory)"); ?></label></th>
|
||||||
<td><textarea class="int" name="chain" id="chain" style="width: 420px; height: 120px;"></textarea></td>
|
<td><textarea class="int" name="chain" id="chain" style="width: 420px; height: 120px;"></textarea></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<p>
|
<p>
|
||||||
<input type="submit" class="inb ok" name="submit" value="<?php __("Save"); ?>"/>
|
<input type="submit" class="inb ok" name="submit" value="<?php __("Save"); ?>"/>
|
||||||
<input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='ssl_list.php'"/>
|
<input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location = 'ssl_list.php'"/>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div> <!-- create -->
|
</div> <!-- create -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$("#tabsssl").tabs(<?php if ($crt!="" and $key!="") echo "{ active: 'tabsssl-import' }"; ?>);
|
$("#tabsssl").tabs(<?php if ($crt != "" and $key != "") echo "{ active: 'tabsssl-import' }"; ?>);
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
include_once("foot.php");
|
include_once("foot.php");
|
||||||
|
|
|
@ -1,44 +1,45 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
AlternC - Web Hosting System
|
AlternC - Web Hosting System
|
||||||
Copyright (C) 2002 by the AlternC Development Team.
|
Copyright (C) 2002 by the AlternC Development Team.
|
||||||
http://alternc.org/
|
http://alternc.org/
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License (GPL)
|
modify it under the terms of the GNU General Public License (GPL)
|
||||||
as published by the Free Software Foundation; either version 2
|
as published by the Free Software Foundation; either version 2
|
||||||
of the License, or (at your option) any later version.
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
Original Author of file: Benjamin Sonntag
|
Original Author of file: Benjamin Sonntag
|
||||||
Purpose of file: Create / Import an SSL Certificate
|
Purpose of file: Create / Import an SSL Certificate
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
__("This page is restricted to authorized staff");
|
__("This page is restricted to authorized staff");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = array (
|
$fields = array(
|
||||||
"id" => array ("request", "integer", 0),
|
"id" => array("request", "integer", 0),
|
||||||
"action" => array ("request", "integer", 0),
|
"action" => array("request", "integer", 0),
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if ($ssl->share($id,$action)) {
|
if ($ssl->share($id, $action)) {
|
||||||
require_once("ssl_view.php");
|
require_once("ssl_view.php");
|
||||||
} else {
|
} else {
|
||||||
require_once("ssl_list.php");
|
require_once("ssl_list.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,197 +1,200 @@
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
AlternC - Web Hosting System
|
AlternC - Web Hosting System
|
||||||
Copyright (C) 2002 by the AlternC Development Team.
|
Copyright (C) 2002 by the AlternC Development Team.
|
||||||
http://alternc.org/
|
http://alternc.org/
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License (GPL)
|
modify it under the terms of the GNU General Public License (GPL)
|
||||||
as published by the Free Software Foundation; either version 2
|
as published by the Free Software Foundation; either version 2
|
||||||
of the License, or (at your option) any later version.
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
Original Author of file: Benjamin Sonntag
|
Original Author of file: Benjamin Sonntag
|
||||||
Purpose of file: Create / Import an SSL Certificate
|
Purpose of file: Create / Import an SSL Certificate
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if ( !isset($is_include) ) {
|
if (!isset($is_include)) {
|
||||||
$fields = array (
|
$fields = array(
|
||||||
"id" => array ("request", "integer", ""),
|
"id" => array("request", "integer", ""),
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cert=$ssl->get_certificate($id);
|
$cert = $ssl->get_certificate($id);
|
||||||
$error=$err->errstr();
|
$error = $err->errstr();
|
||||||
if ($error) {
|
if ($error) {
|
||||||
require_once("ssl_list.php");
|
require_once("ssl_list.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if ($info) {
|
if ($info) {
|
||||||
echo "<p class=\"alert alert-info\">$info</p>";
|
echo "<p class=\"alert alert-info\">$info</p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cert["status"]==$ssl::STATUS_PENDING) {
|
if ($cert["status"] == $ssl::STATUS_PENDING) {
|
||||||
?>
|
|
||||||
<h3><?php __("Pending Certificate"); ?></h3>
|
|
||||||
|
|
||||||
<p><?php __("Your <i>Certificate Request File</i> (CSR) has been created, along with its <i>private RSA Key</i> (KEY). Please find below the CSR you must send to your SSL Certificate provider."); ?></p>
|
|
||||||
|
|
||||||
<p><?php __("Once you'll have your <i>Certificate File</i> (CRT) and a <i>Chained Certificate File</i> (CHAIN), please paste them here to finish the enrollment."); ?></p>
|
|
||||||
|
|
||||||
<form method="post" action="ssl_finalize.php" name="main" id="main">
|
|
||||||
<input type="hidden" name="id" id="id" value="<?php echo $cert["id"]; ?>"/>
|
|
||||||
<table border="1" cellspacing="0" cellpadding="4" class="tedit">
|
|
||||||
<tr>
|
|
||||||
<th><label for="fqdn"><?php __("Fully Qualified Domain Name"); ?></label></th>
|
|
||||||
<td><?php echo $cert["fqdn"]; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><label for="validstart"><?php __("Date of the request"); ?></label></th>
|
|
||||||
<td><?php echo format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s",$cert["validstartts"])); ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><label for="csr"><?php __("Certificate Request File"); ?></label></th>
|
|
||||||
<td><textarea readonly="readonly" onclick="this.focus();this.select()" class="int cert" name="csr" id="csr" style="width: 500px; height: 120px;"><?php echo $cert["sslcsr"]; ?></textarea></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><label for="crt"><?php __("SSL Certificate"); ?></label></th>
|
|
||||||
<td><textarea class="int cert" name="crt" id="crt" style="width: 500px; height: 120px;"><?php echo $cert["sslcrt"]; ?></textarea></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><label for="chain"><?php __("Chained Certificate<br />(not mandatory)"); ?></label></th>
|
|
||||||
<td><textarea class="int cert" name="chain" id="chain" style="width: 500px; height: 120px;"><?php echo $cert["sslchain"]; ?></textarea></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<p>
|
|
||||||
<input type="submit" class="inb ok" name="submit" value="<?php __("Save"); ?>"/>
|
|
||||||
<input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='ssl_list.php'"/>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
else {
|
|
||||||
|
|
||||||
if ($cert["status"]==$ssl::STATUS_OK) {
|
|
||||||
?>
|
|
||||||
<h3><?php __("Valid Certificate"); ?></h3>
|
|
||||||
<p><?php __("Please find below your valid certificate data."); ?></p>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
if ($cert["status"]==$ssl::STATUS_EXPIRED) {
|
|
||||||
?>
|
|
||||||
<h3><?php __("EXPIRED Certificate"); ?></h3>
|
|
||||||
<p><?php __("Your certificate is EXPIRED. You should not use it for any purpose. Please find below its data."); ?></p>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<p>
|
|
||||||
<span class="inb ok"><a href="ssl_list.php"><?php __("Back to my SSL Certificates"); ?></a></span>
|
|
||||||
</p>
|
|
||||||
<table border="1" cellspacing="0" cellpadding="4" class="tedit">
|
|
||||||
<tr>
|
|
||||||
<th><?php __("Valid From:"); ?></th>
|
|
||||||
<td><?php echo format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s",$cert["validstartts"]));
|
|
||||||
echo " ";
|
|
||||||
$days=intval((time()-$cert["validstartts"])/86400);
|
|
||||||
if ($days<60) {
|
|
||||||
printf(_("(%d days ago)"),$days);
|
|
||||||
} else {
|
|
||||||
$month=intval($days/30);
|
|
||||||
printf(_("(%d month ago)"),$month);
|
|
||||||
}
|
|
||||||
?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><?php __("Valid Until:"); ?></th>
|
|
||||||
<td><?php echo format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s",$cert["validendts"]));
|
|
||||||
echo " ";
|
|
||||||
$days=intval(($cert["validendts"]-time())/86400);
|
|
||||||
if ($days<60) {
|
|
||||||
printf(_("(%d days from now)"),$days);
|
|
||||||
} else {
|
|
||||||
$month=intval($days/30);
|
|
||||||
printf(_("(%d month from now)"),$month);
|
|
||||||
}
|
|
||||||
?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><?php __("FQDN:"); ?></th>
|
|
||||||
<td><?php echo $cert["fqdn"]; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><?php __("Other Valid FQDN:"); ?></th>
|
|
||||||
<td><?php echo nl2br($cert["altnames"]); ?></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th><label for="csr"><?php __("Certificate Request File"); ?></label></th>
|
|
||||||
<td><textarea readonly="readonly" onclick="this.focus();this.select()" class="int cert" name="csr" id="csr" style="width: 500px; height: 120px;"><?php echo $cert["sslcsr"]; ?></textarea></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><label for="crt"><?php __("SSL Certificate"); ?></label></th>
|
|
||||||
<td><textarea readonly="readonly" onclick="this.focus();this.select()" class="int cert" name="crt" id="crt" style="width: 500px; height: 120px;"><?php echo $cert["sslcrt"]; ?></textarea></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><label for="chain"><?php __("Chained Certificate<br />(not mandatory)"); ?></label></th>
|
|
||||||
<td><textarea readonly="readonly" onclick="this.focus();this.select()" class="int cert" name="chain" id="chain" style="width: 500px; height: 120px;"><?php echo $cert["sslchain"]; ?></textarea></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
// The admin is allowed to share (or not share) his valid certificates
|
|
||||||
if ($admin->enabled) {
|
|
||||||
?>
|
|
||||||
<p><?php __("As an administrator you can allow any account on this server to use this certificate to host his services. <br />(This is only useful for wildcard or multi-domain certificates)."); ?></p>
|
|
||||||
<p>
|
|
||||||
<?php
|
|
||||||
if ($cert["shared"]) {
|
|
||||||
echo _("This certificate is currently <b>shared</b>");
|
|
||||||
if ($cert["uid"]==$cuid) {
|
|
||||||
?>
|
|
||||||
</p>
|
|
||||||
<form method="post" action="ssl_share.php">
|
|
||||||
<input type="hidden" name="id" id="id" value="<?php echo $cert["id"]; ?>"/>
|
|
||||||
<input type="hidden" name="action" id="action" value="0" />
|
|
||||||
<input class="inb cancel" type="submit" name="unshare" value="<?php __("Click here to stop sharing this certificate"); ?>" />
|
|
||||||
</form>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
echo _("This certificate is currently <b>NOT shared</b>");
|
|
||||||
if ($cert["uid"]==$cuid) {
|
|
||||||
?>
|
?>
|
||||||
|
<h3><?php __("Pending Certificate"); ?></h3>
|
||||||
|
|
||||||
|
<p><?php __("Your <i>Certificate Request File</i> (CSR) has been created, along with its <i>private RSA Key</i> (KEY). Please find below the CSR you must send to your SSL Certificate provider."); ?></p>
|
||||||
|
|
||||||
|
<p><?php __("Once you'll have your <i>Certificate File</i> (CRT) and a <i>Chained Certificate File</i> (CHAIN), please paste them here to finish the enrollment."); ?></p>
|
||||||
|
|
||||||
|
<form method="post" action="ssl_finalize.php" name="main" id="main">
|
||||||
|
<input type="hidden" name="id" id="id" value="<?php echo $cert["id"]; ?>"/>
|
||||||
|
<table border="1" cellspacing="0" cellpadding="4" class="tedit">
|
||||||
|
<tr>
|
||||||
|
<th><label for="fqdn"><?php __("Fully Qualified Domain Name"); ?></label></th>
|
||||||
|
<td><?php echo $cert["fqdn"]; ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><label for="validstart"><?php __("Date of the request"); ?></label></th>
|
||||||
|
<td><?php echo format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'), date("Y-m-d H:i:s", $cert["validstartts"])); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><label for="csr"><?php __("Certificate Request File"); ?></label></th>
|
||||||
|
<td><textarea readonly="readonly" onclick="this.focus();
|
||||||
|
this.select()" class="int cert" name="csr" id="csr" style="width: 500px; height: 120px;"><?php echo $cert["sslcsr"]; ?></textarea></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><label for="crt"><?php __("SSL Certificate"); ?></label></th>
|
||||||
|
<td><textarea class="int cert" name="crt" id="crt" style="width: 500px; height: 120px;"><?php echo $cert["sslcrt"]; ?></textarea></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><label for="chain"><?php __("Chained Certificate<br />(not mandatory)"); ?></label></th>
|
||||||
|
<td><textarea class="int cert" name="chain" id="chain" style="width: 500px; height: 120px;"><?php echo $cert["sslchain"]; ?></textarea></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<p>
|
||||||
|
<input type="submit" class="inb ok" name="submit" value="<?php __("Save"); ?>"/>
|
||||||
|
<input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location = 'ssl_list.php'"/>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if ($cert["status"] == $ssl::STATUS_OK) {
|
||||||
|
?>
|
||||||
|
<h3><?php __("Valid Certificate"); ?></h3>
|
||||||
|
<p><?php __("Please find below your valid certificate data."); ?></p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
if ($cert["status"] == $ssl::STATUS_EXPIRED) {
|
||||||
|
?>
|
||||||
|
<h3><?php __("EXPIRED Certificate"); ?></h3>
|
||||||
|
<p><?php __("Your certificate is EXPIRED. You should not use it for any purpose. Please find below its data."); ?></p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<p>
|
||||||
|
<span class="inb ok"><a href="ssl_list.php"><?php __("Back to my SSL Certificates"); ?></a></span>
|
||||||
</p>
|
</p>
|
||||||
<form method="post" action="ssl_share.php">
|
<table border="1" cellspacing="0" cellpadding="4" class="tedit">
|
||||||
<input type="hidden" name="id" id="id" value="<?php echo $cert["id"]; ?>"/>
|
<tr>
|
||||||
<input type="hidden" name="action" id="action" value="1" />
|
<th><?php __("Valid From:"); ?></th>
|
||||||
<input class="inb ok" type="submit" name="unshare" value="<?php __("Click here to share this certificate"); ?>" />
|
<td><?php
|
||||||
</form>
|
echo format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'), date("Y-m-d H:i:s", $cert["validstartts"]));
|
||||||
<?php
|
echo " ";
|
||||||
}
|
$days = intval((time() - $cert["validstartts"]) / 86400);
|
||||||
}
|
if ($days < 60) {
|
||||||
|
printf(_("(%d days ago)"), $days);
|
||||||
|
} else {
|
||||||
|
$month = intval($days / 30);
|
||||||
|
printf(_("(%d month ago)"), $month);
|
||||||
|
}
|
||||||
|
?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?php __("Valid Until:"); ?></th>
|
||||||
|
<td><?php
|
||||||
|
echo format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'), date("Y-m-d H:i:s", $cert["validendts"]));
|
||||||
|
echo " ";
|
||||||
|
$days = intval(($cert["validendts"] - time()) / 86400);
|
||||||
|
if ($days < 60) {
|
||||||
|
printf(_("(%d days from now)"), $days);
|
||||||
|
} else {
|
||||||
|
$month = intval($days / 30);
|
||||||
|
printf(_("(%d month from now)"), $month);
|
||||||
|
}
|
||||||
|
?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?php __("FQDN:"); ?></th>
|
||||||
|
<td><?php echo $cert["fqdn"]; ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?php __("Other Valid FQDN:"); ?></th>
|
||||||
|
<td><?php echo nl2br($cert["altnames"]); ?></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th><label for="csr"><?php __("Certificate Request File"); ?></label></th>
|
||||||
|
<td><textarea readonly="readonly" onclick="this.focus();
|
||||||
|
this.select()" class="int cert" name="csr" id="csr" style="width: 500px; height: 120px;"><?php echo $cert["sslcsr"]; ?></textarea></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><label for="crt"><?php __("SSL Certificate"); ?></label></th>
|
||||||
|
<td><textarea readonly="readonly" onclick="this.focus();
|
||||||
|
this.select()" class="int cert" name="crt" id="crt" style="width: 500px; height: 120px;"><?php echo $cert["sslcrt"]; ?></textarea></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><label for="chain"><?php __("Chained Certificate<br />(not mandatory)"); ?></label></th>
|
||||||
|
<td><textarea readonly="readonly" onclick="this.focus();
|
||||||
|
this.select()" class="int cert" name="chain" id="chain" style="width: 500px; height: 120px;"><?php echo $cert["sslchain"]; ?></textarea></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?php
|
||||||
|
// The admin is allowed to share (or not share) his valid certificates
|
||||||
|
if ($admin->enabled) {
|
||||||
|
?>
|
||||||
|
<p><?php __("As an administrator you can allow any account on this server to use this certificate to host his services. <br />(This is only useful for wildcard or multi-domain certificates)."); ?></p>
|
||||||
|
<p>
|
||||||
|
<?php
|
||||||
|
if ($cert["shared"]) {
|
||||||
|
echo _("This certificate is currently <b>shared</b>");
|
||||||
|
if ($cert["uid"] == $cuid) {
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
<form method="post" action="ssl_share.php">
|
||||||
|
<input type="hidden" name="id" id="id" value="<?php echo $cert["id"]; ?>"/>
|
||||||
|
<input type="hidden" name="action" id="action" value="0" />
|
||||||
|
<input class="inb cancel" type="submit" name="unshare" value="<?php __("Click here to stop sharing this certificate"); ?>" />
|
||||||
|
</form>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo _("This certificate is currently <b>NOT shared</b>");
|
||||||
|
if ($cert["uid"] == $cuid) {
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
<form method="post" action="ssl_share.php">
|
||||||
|
<input type="hidden" name="id" id="id" value="<?php echo $cert["id"]; ?>"/>
|
||||||
|
<input type="hidden" name="action" id="action" value="1" />
|
||||||
|
<input class="inb ok" type="submit" name="unshare" value="<?php __("Click here to share this certificate"); ?>" />
|
||||||
|
</form>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<?php include_once("foot.php"); ?>
|
<?php include_once("foot.php"); ?>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue