@@ -29,6 +29,7 @@ function removeLockFile() {
29
29
30
30
// Check configuration errors
31
31
$ err = array ();
32
+ if (!defined ('ENABLED ' )) $ err [] = 'Enabled flag is not configured ' ;
32
33
if (!defined ('ACCESS_TOKEN ' )) $ err [] = 'Access token is not configured ' ;
33
34
if (!defined ('REMOTE_REPOSITORY ' )) $ err [] = 'Remote repository is not configured ' ;
34
35
if (!defined ('BRANCH ' )) $ err [] = 'Branch is not configured ' ;
@@ -37,15 +38,15 @@ function removeLockFile() {
37
38
if (!defined ('TIME_LIMIT ' )) define ('TIME_LIMIT ' , 60 );
38
39
39
40
// If there's authorization error, set the correct HTTP header.
40
- if (!isset ($ _GET ['t ' ]) || $ _GET ['t ' ] !== ACCESS_TOKEN || ACCESS_TOKEN === '' ) {
41
+ if (!isset ($ _GET ['t ' ]) || $ _GET ['t ' ] !== ACCESS_TOKEN || ACCESS_TOKEN === '' || ENABLED !== true ) {
41
42
header ($ _SERVER ['SERVER_PROTOCOL ' ] . ' 403 Forbidden ' , true , 403 );
42
43
}
43
44
44
45
// Prevent caching
45
46
header ("Cache-Control: no-store, no-cache, must-revalidate, max-age=0 " );
46
47
header ("Cache-Control: post-check=0, pre-check=0 " , false );
47
48
header ("Pragma: no-cache " );
48
- if (!isset ($ _GET ['t ' ]) || $ _GET ['t ' ] !== ACCESS_TOKEN ) {
49
+ if (!isset ($ _GET ['t ' ]) || $ _GET ['t ' ] !== ACCESS_TOKEN || ENABLED !== true ) {
49
50
header ($ _SERVER ['SERVER_PROTOCOL ' ] . ' 403 Forbidden ' , true , 403 );
50
51
removeLockFile ();
51
52
echo "<html> \n<body> \n<h2>Access Denied</h2> \n</body> \n</html> \n" ;
0 commit comments