diff options
author | 2018-01-29 16:04:13 -0500 | |
---|---|---|
committer | 2018-01-29 16:05:35 -0500 | |
commit | 3c56284f7fe1926f6bf6ebd97ec72805d94df1e4 (patch) | |
tree | 805a3fb4cfb14519c0bebc3f1863f4759e916a82 /php/cfg | |
download | bouncer-3c56284f7fe1926f6bf6ebd97ec72805d94df1e4.tar.gz bouncer-3c56284f7fe1926f6bf6ebd97ec72805d94df1e4.tar.bz2 bouncer-3c56284f7fe1926f6bf6ebd97ec72805d94df1e4.zip |
Import existing bouncer.g.o into gitv1.0-20181208-IMPORT
Diffstat (limited to 'php/cfg')
-rw-r--r-- | php/cfg/admin_init.php | 15 | ||||
-rw-r--r-- | php/cfg/config-dist.php | 18 | ||||
-rw-r--r-- | php/cfg/init.php | 18 |
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'); +} +?> |