-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsettings_server.php.template
More file actions
86 lines (73 loc) · 3.77 KB
/
settings_server.php.template
File metadata and controls
86 lines (73 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
// a fix for old PHP5 style MYSQL syntax
include_once($_SERVER['DOCUMENT_ROOT'] . '/includes/fix_mysql.php');
// in the case of forwarded remote IPs
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
}
// in the case when run via the CLI
if (!isset($_SERVER['SERVER_NAME'])) {
$_SERVER['SERVER_NAME'] = '';
}
//======================================================================
// GENERAL SETTINGS
//======================================================================
$GLOBALS['ADMIN_EMAIL'] = 'sscait+sscait-web-admin@gmail.com';
$GLOBALS['DOMAIN_WITHOUT_SLASH'] = 'http://'.trim($_SERVER['SERVER_NAME'],'/');
$GLOBALS['PROJECT_FOLDER_WITHOUT_SLASH'] = '/var/www/sscait-web';
$GLOBALS['BOTS_FOLDER_WITHOUT_SLASH'] = '/var/www/sscait-web/bots';
$GLOBALS['REPLAYS_FOLDER_WITHOUT_SLASH'] = '/var/www/html/Replays';
$GLOBALS['CACHE_FOLDER_WITHOUT_SLASH'] = '/var/www/sscait-web/cache';
//======================================================================
// MAIN WEBSITE SETTINGS
//======================================================================
if (!defined('PAGE_TITLE')) define('PAGE_TITLE','[SSCAIT] Student StarCraft AI Tournament & Ladder');
if (!defined('DOMAIN')) define('DOMAIN',$GLOBALS['BOTS_FOLDER_WITHOUT_SLASH']);
//======================================================================
// DATABASE
//======================================================================
$db_host = 'localhost';
$db_database = 'sc';
$db_username = 'enter-sc-database-user-here';
$db_password = 'enter-password-for-the-db_username_user-here';
// old PHP5-style connection (deprecated; TODO: remove once all the calls are replaced with the PDO implementation)
$GLOBALS['mysqlConnection'] = mysql_connect($db_host,$db_username,$db_password);
@mysql_select_db($db_database) or
die('<div>Unable to connect to database.</div>');
// more recent, PHP7+ style connection
try {
$GLOBALS['mysqliConnection'] = new PDO("mysql:host=$db_host;dbname=$db_database", $db_username, $db_password);
} catch (PDOException $e) {
die('<div>Error connecting to database: ' . $e->getMessage() . '</div>');
}
//======================================================================
// EMAILS
//======================================================================
$smtpinfo = array();
$GLOBALS['SMTP_HOST'] = 'smtp.gmail.com';
$GLOBALS['SMTP_PORT'] = '587';
$GLOBALS['SMTP_AUTH'] = true;
$GLOBALS['SMTP_USERNAME'] = 'enter-smtp-server-account-here-eg-sscait@gmail.com';
$GLOBALS['SMTP_GOOGLE_CLIENT_ID'] = 'enter-google-client-id-here';
$GLOBALS['SMTP_GOOGLE_CLIENT_SECRET'] = 'enter-google-client-secret-here';
$GLOBALS['SMTP_GOOGLE_REFRESH_TOKEN'] = 'enter-google-refresh-token-here';
//======================================================================
// ELO ratings remote url
//======================================================================
$eloRatingsRemoteURL = 'http://cachedsscaitscores.krasi0.com/eloRatings/';
$eloRatingsBASILRemoteURL = 'https://data.basil-ladder.net/stats/ranking.json';
//======================================================================
// DEBUG MODE
//======================================================================
$GLOBALS['debugMode'] = true;
//======================================================================
// VOTING FOR THE NEXT MU
//======================================================================
$GLOBALS['votingForPlayersEnabled'] = true;
$GLOBALS['votingForPlayersUseCaptcha'] = true;
//======================================================================
// Logging in / registering, etc.
//======================================================================
$GLOBALS['loggingInEnabled'] = true;
$GLOBALS['competitivePhase'] = false;
$GLOBALS['eliminationBracketPhase'] = false;