Source code taken from cacert-20141124.tar.bz2
[cacert.git] / scripts / cron / warning.php
index 8f607cd..59b1aa2 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/php -q
-<? /*
+<?php /*
     LibreSSL - CAcert web application
     Copyright (C) 2004-2008  CAcert Inc.
 
@@ -18,6 +18,8 @@
 */
 
        require_once(dirname(__FILE__).'/../../includes/mysql.php');
+       require_once(dirname(__FILE__).'/../../includes/lib/general.php');
+       require_once(dirname(__FILE__).'/../../includes/lib/l10n.php');
 
        $days = array("1" => "3", "15" => "2", "30" => "1", "45" => "0");
 
                $res = mysql_query($query);
                while($row = mysql_fetch_assoc($res))
                {
+                       L10n::set_recipient_language(intval($row['id']));
                        if($row['subject'] == "")
                        {
                                $row['crt_name'] = str_replace("../", "www/", $row['crt_name']);
                                $row['crt_name'] = "/home/cacert/".$row['crt_name'];
                                $crt_name = escapeshellarg($row['crt_name']);
-                               $subject = `openssl x509 -in $crt_name -text -noout|grep Subject:`;
+                               $subject = runCommand("openssl x509 -in $crt_name -text -noout|grep Subject:");
                                $bits = explode("/", $subject);
                                foreach($bits as $val)
                                {
@@ -107,6 +110,7 @@ echo $row['fname']." ".$row['lname']." <".$row['email']."> (memid: ".$row['memid
                $res = mysql_query($query);
                while($row = mysql_fetch_assoc($res))
                {
+                       L10n::set_recipient_language(intval($row['memid']));
                        if($row['subject'] == "")
                                $row['subject'] = $row['CN'];