bug 1003: Make scripts resilient against working directory changes and
authorMichael Tänzer <neo@nhng.de>
Mon, 30 Jan 2012 23:15:17 +0000 (00:15 +0100)
committerMichael Tänzer <neo@nhng.de>
Mon, 30 Jan 2012 23:15:17 +0000 (00:15 +0100)
make the fail hard if the include fails

Signed-off-by: Michael Tänzer <neo@nhng.de>
scripts/cron/permissionreview.php
scripts/cron/removedead.php
scripts/cron/updatesort.php
scripts/cron/warning.php

index 13a92c8..572c1fd 100755 (executable)
@@ -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';
 
index 23c4cd9..9906131 100755 (executable)
@@ -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";
index ec4f408..aa20b09 100755 (executable)
@@ -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');
 
 
 
index b578c09..18e89da 100755 (executable)
@@ -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");