diff --git a/bureau/class/m_ssl.php b/bureau/class/m_ssl.php index 7c3bb7c9..66c5ad99 100644 --- a/bureau/class/m_ssl.php +++ b/bureau/class/m_ssl.php @@ -82,6 +82,7 @@ class m_ssl { * set expired certificates as such : */ function expire_certificates() { + global $db; $db->query("UPDATE certificates SET status=".self::STATUS_EXPIRED." WHERE status=".self::STATUS_OK." AND validendquery("SELECT id FROM certificates WHERE status=".self::STATUS_EXPIRED." AND validendnext_record()) { $CRTDIR = self::KEY_REPOSITORY . "/" . floor($db->Record["id"]/1000); diff --git a/src/functions_hosting.sh b/src/functions_hosting.sh index 2cc5718b..61bd7207 100644 --- a/src/functions_hosting.sh +++ b/src/functions_hosting.sh @@ -18,15 +18,18 @@ launch_hooks() { local VTYPE=$2 + EXITCODE=0 if [ -x "$HOSTING_DIR/hosting_$VTYPE.sh" ] ; then # If a specific script exist for this VTYPE, # we launch it, and return his return code "$HOSTING_DIR/hosting_$VTYPE.sh" "$1" "$2" "$3" "$4" - return $? + EXITCODE=$? fi - + # also launch ssl update domains hook + /usr/lib/alternc/update_certs.sh "$1" "$2" "$3" "$4" + # No specific script, return 0 - return 0 + return "$EXITCODE" } host_conffile() { diff --git a/etc/alternc/functions_hosting/hosting_vhost-ssl.sh b/src/update_cert.sh similarity index 95% rename from etc/alternc/functions_hosting/hosting_vhost-ssl.sh rename to src/update_cert.sh index 9680d90d..ff6e0d85 100755 --- a/etc/alternc/functions_hosting/hosting_vhost-ssl.sh +++ b/src/update_cert.sh @@ -21,7 +21,7 @@ require_once("/usr/share/alternc/panel/class/config_nochk.php"); if (!isset($ssl)) { - echo "OUPS: hosting_vhost-ssl.sh launched, but ssl module not installed, exiting\n"; + echo "OUPS: update_cert.sh launched, but ssl module not installed, exiting\n"; exit(); }