--- /dev/null
+<?php
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.4 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | |
+ | CiviCRM is distributed in the hope that it will be useful, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License and the CiviCRM Licensing Exception along |
+ | with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+*/
+
+/**
+ *
+ * @package CRM
+ * @copyright CiviCRM LLC (c) 2004-2014
+ * $Id: $
+ *
+ */
+class CRM_Utils_Check_Message {
+ /**
+ * @var string
+ */
+ private $name;
+
+ /**
+ * @var string
+ */
+ private $message;
+
+ function __construct($name, $message) {
+ $this->name = $name;
+ $this->message = $message;
+ }
+
+ /**
+ * @return string
+ */
+ function getName() {
+ return $this->name;
+ }
+
+ /**
+ * @return string
+ */
+ function getMessage() {
+ return $this->message;
+ }
+
+ /**
+ * @return array
+ */
+ function toArray() {
+ return array(
+ 'name' => $this->name,
+ 'message' => $this->message,
+ );
+ }
+}
$config->cleanup(0, FALSE);
foreach ($this->checkAll() as $message) {
- CRM_Core_Session::setStatus($message, ts('Security Warning'));
+ CRM_Core_Session::setStatus($message->getMessage(), ts('Security Warning'));
}
}
}
$msg = 'The <a href="%1">CiviCRM debug log</a> should not be downloadable.'
. '<br />' .
'<a href="%2">Read more about this warning</a>';
- $messages[] = ts($msg, array(1 => $log_url, 2 => $docs_url));
+ $messages[] = new CRM_Utils_Check_Message(
+ 'checkLogFileIsNotAccessible',
+ ts($msg, array(1 => $log_url, 2 => $docs_url))
+ );
}
}
}
. '<br />' .
'<a href="%1">Read more about this warning</a>';
$docs_url = $this->createDocUrl('checkUploadsAreNotAccessible');
- $messages[] = ts($msg, array(1 => $docs_url));
+ $messages[] = new CRM_Utils_Check_Message(
+ 'checkUploadsAreNotAccessible',
+ ts($msg, array(1 => $docs_url))
+ );
}
}
}
. '<br />' .
'<a href="%3">Read more about this warning</a>';
$docs_url = $this->createDocUrl('checkDirectoriesAreNotBrowseable');
- $messages[] = ts($msg, array(1 => $publicDir, 2 => $publicDir, 3 => $docs_url));
+ $messages[] = new CRM_Utils_Check_Message(
+ 'checkDirectoriesAreNotBrowseable',
+ ts($msg, array(1 => $publicDir, 2 => $publicDir, 3 => $docs_url))
+ );
}
}