diff options
Diffstat (limited to 'boca-1.5.0/src/private/autojudging.php')
| -rwxr-xr-x | boca-1.5.0/src/private/autojudging.php | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/boca-1.5.0/src/private/autojudging.php b/boca-1.5.0/src/private/autojudging.php index 3685254..cdd1e2e 100755 --- a/boca-1.5.0/src/private/autojudging.php +++ b/boca-1.5.0/src/private/autojudging.php @@ -15,16 +15,24 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// -// Last modified 05/aug/2012 by cassio@ime.usp.br +// Last modified 06/aug/2012 by cassio@ime.usp.br $ds = DIRECTORY_SEPARATOR; if($ds=="") $ds = "/"; -if(is_readable(getcwd() . $ds . '..' .$ds . 'db.php')) { - require_once(getcwd() . $ds . '..' .$ds . 'db.php'); - require_once(getcwd() . $ds . '..' .$ds . 'version.php'); + +if(is_readable('/etc/boca.conf')) { + $pif=parse_ini_file('/etc/boca.conf'); + $bocadir = trim($pif['bocadir']) . $ds . 'src'; +} else { + $bocadir = getcwd(); +} + +if(is_readable($bocadir . $ds . '..' .$ds . 'db.php')) { + require_once($bocadir . $ds . '..' .$ds . 'db.php'); + require_once($bocadir . $ds . '..' .$ds . 'version.php'); } else { - if(is_readable(getcwd() . $ds . 'db.php')) { - require_once(getcwd() . $ds . 'db.php'); - require_once(getcwd() . $ds . 'version.php'); + if(is_readable($bocadir . $ds . 'db.php')) { + require_once($bocadir . $ds . 'db.php'); + require_once($bocadir . $ds . 'version.php'); } else { echo "unable to find db.php"; exit; |