summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2012-01-31 00:15:17 +0100
committerMichael Tänzer <neo@nhng.de>2012-01-31 00:15:17 +0100
commitb8b737768aa96deeffbb193682c1b45f517c0636 (patch)
tree4d30181c211da0beacfe3eceadcf9b99387caa16
parentccc8fb0f47871f2b8248c108d8e73e0da93cd8dc (diff)
downloadcacert-devel-b8b737768aa96deeffbb193682c1b45f517c0636.tar.gz
cacert-devel-b8b737768aa96deeffbb193682c1b45f517c0636.tar.xz
cacert-devel-b8b737768aa96deeffbb193682c1b45f517c0636.zip
bug 1003: Make scripts resilient against working directory changes and
make the fail hard if the include fails Signed-off-by: Michael Tänzer <neo@nhng.de>
-rwxr-xr-xscripts/cron/permissionreview.php2
-rwxr-xr-xscripts/cron/removedead.php4
-rwxr-xr-xscripts/cron/updatesort.php2
-rwxr-xr-xscripts/cron/warning.php2
4 files changed, 5 insertions, 5 deletions
diff --git a/scripts/cron/permissionreview.php b/scripts/cron/permissionreview.php
index 13a92c8..572c1fd 100755
--- a/scripts/cron/permissionreview.php
+++ b/scripts/cron/permissionreview.php
@@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-require_once('../../includes/mysql.php');
+require_once(dirname(__FILE__).'/../../includes/mysql.php');
$BOARD_PRIVATE = 'cacert-board-private@lists.cacert.org';
diff --git a/scripts/cron/removedead.php b/scripts/cron/removedead.php
index 23c4cd9..9906131 100755
--- a/scripts/cron/removedead.php
+++ b/scripts/cron/removedead.php
@@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
- include_once("/home/cacert/www/includes/mysql.php");
- require_once('/home/cacert/www/includes/lib/l10n.php');
+ require_once(dirname(__FILE__).'/../../includes/mysql.php.sample');
+ require_once(dirname(__FILE__).'/../../includes/lib/l10n.php');
$query = "select * from `users` where `users`.`verified`=0 and
(UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`users`.`created`)) >= 172800";
diff --git a/scripts/cron/updatesort.php b/scripts/cron/updatesort.php
index ec4f408..aa20b09 100755
--- a/scripts/cron/updatesort.php
+++ b/scripts/cron/updatesort.php
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
- include_once("../../includes/mysql.php");
+ require_once(dirname(__FILE__).'/../../includes/mysql.php');
diff --git a/scripts/cron/warning.php b/scripts/cron/warning.php
index b578c09..18e89da 100755
--- a/scripts/cron/warning.php
+++ b/scripts/cron/warning.php
@@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
- include_once("/home/cacert/www/includes/mysql.php");
+ require_once(dirname(__FILE__).'/../../includes/mysql.php');
$days = array("1" => "3", "15" => "2", "30" => "1", "45" => "0");