aboutsummaryrefslogtreecommitdiff
path: root/php/cfg
diff options
context:
space:
mode:
Diffstat (limited to 'php/cfg')
-rw-r--r--php/cfg/admin_init.php15
-rw-r--r--php/cfg/config-dist.php18
-rw-r--r--php/cfg/init.php18
3 files changed, 51 insertions, 0 deletions
diff --git a/php/cfg/admin_init.php b/php/cfg/admin_init.php
new file mode 100644
index 0000000..7d22ab3
--- /dev/null
+++ b/php/cfg/admin_init.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Admin initialization.
+ * @package mirror
+ * @subpackage cfg
+ */
+require_once(LIB.'/auth.php'); // auth functions
+require_once(LIB.'/forms.php'); // form library
+require_once(LIB.'/list.php'); // list library
+
+if (!auth_is_valid_session()) {
+ header('Location: http://'.$_SERVER['HTTP_HOST'].WEBPATH.'/admin/login.php');
+ exit;
+}
+?>
diff --git a/php/cfg/config-dist.php b/php/cfg/config-dist.php
new file mode 100644
index 0000000..308e844
--- /dev/null
+++ b/php/cfg/config-dist.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Mirror configuration document.
+ * @package mirror
+ * @subpackage cfg
+ */
+define('FILEPATH','/var/www/download'); // filepath of root dir
+define('WEBPATH',''); // web path of root dir
+define('LIB',FILEPATH.'/lib'); // path to lib dir
+define('INC',FILEPATH.'/inc'); // path to inc dir
+define('HEADER',INC.'/header.php'); // header document
+define('FOOTER',INC.'/footer.php'); // footer document
+define('DBHOST', ''); // db host
+define('DBNAME', ''); // db name
+define('DBUSER', ''); // db user
+define('DBPASS', ''); // db pass
+define('LOGGING',1); // enable logging? 1=on 0=off
+?>
diff --git a/php/cfg/init.php b/php/cfg/init.php
new file mode 100644
index 0000000..4eb6ed0
--- /dev/null
+++ b/php/cfg/init.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Init.
+ * @package mirror
+ * @subpackage cfg
+ */
+require_once('config.php'); // config file that defines constants
+require_once(LIB.'/util.php'); // util file for random functions (no SQL here)
+require_once(LIB.'/csv.php'); // util file for random functions (no SQL here)
+$start = microtime_float(); // start timer
+require_once(LIB.'/mirror.php'); // user and admin functions for the mirror app (some SQL)
+require_once(LIB.'/db.php'); // core mysql wrappers used in mirror functions
+db_connect(DBHOST,DBUSER,DBPASS); // open persistent connection to db
+db_select(DBNAME); // select db
+if (!empty($protect)) {
+ require_once('admin_init.php');
+}
+?>