Moved Settings and downloader to their own files
Jeremy D

Jeremy D commited on 2011-12-29 14:40:27
Showing 4 changed files, with 55 additions and 34 deletions.

... ...
@@ -277,7 +277,7 @@ function download_file_generate()
277 277
 	$.generateFile({
278 278
 		filename	: "install.xml",
279 279
 		content		: $('#preview').text(),
280
-		script		: "index.php?download"
280
+		script		: "downloader.php?download"
281 281
 	});
282 282
 }
283 283
 
... ...
@@ -0,0 +1,22 @@
1
+<?php
2
+/*
3
+ * SMF Package Manager Generator
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/smf_package_maker
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+require_once(dirname(__FILE__) . '/settings.php');
9
+
10
+// Only invoke the download when it is enabled and we are going to try to do it.
11
+if (!$use_php || !isset($_GET['download']))
12
+	exit ('Invalid Download content');
13
+
14
+// We should at least try to verify the referrer
15
+if (!isset($_SERVER['HTTP_REFERER']) || strpos($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME']) === false)
16
+	exit('Invalid Request Detected');
17
+
18
+// Give them a download.
19
+header('Cache-Control: ');
20
+header('Content-type: text/plain');
21
+header ('Content-Disposition: attachment; filename="install.xml"');
22
+exit($_POST['content']);
0 23
\ No newline at end of file
... ...
@@ -1,37 +1,12 @@
1 1
 <?php
2
-// Assets URL location.
3
-$assets = '/PacManGen/assets';
4
-
5
-// Style to use.
6
-$style = 'default';
7
-
8
-// How to handle downloads..
9
-$use_php = true;
10
-
11
-$page_title = 'SleePyCode Package Manager Generator';
12
-
13
-// Commenting out logo will remove it.
14
-$logo = $assets . '/logo.png';
15
-$logo_url = 'http://sleepycode.com';
16
-
17
-$language = 'english';
18
-
19
-/**********************************************************
20
-********** END OF SETTINGS *******************************/
21
-include(dirname(__FILE__) . '/language/' . $language . '.php');
22
-
23
-// Only invoke the download when it is enabled and we are going to try to do it.
24
-if ($use_php && isset($_GET['download']))
25
-{
26
-	/* We should at least try to verify the referrer */
27
-	if (!isset($_SERVER['HTTP_REFERER']) || strpos($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME']) === false)
28
-		exit('Invalid Request Detected');
29
-
30
-		header('Cache-Control: ');
31
-		header('Content-type: text/plain');
32
-		header ('Content-Disposition: attachment; filename="install.xml"');
33
-		exit($_POST['content']);
34
-}
2
+/*
3
+ * SMF Package Manager Generator
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/smf_package_maker
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+require_once(dirname(__FILE__) . '/settings.php');
9
+require_once(dirname(__FILE__) . '/language/' . $language . '.php');
35 10
 
36 11
 echo '
37 12
 <!DOCTYPE html><!-- HTML 5 -->
... ...
@@ -0,0 +1,24 @@
1
+<?php
2
+/*
3
+ * SMF Package Manager Generator
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/smf_package_maker
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+
9
+// Assets URL location.
10
+$assets = '/PacManGen/assets';
11
+
12
+// Style to use.
13
+$style = 'default';
14
+
15
+// How to handle downloads..
16
+$use_php = true;
17
+
18
+$page_title = 'SleePyCode Package Manager Generator';
19
+
20
+// Commenting out logo will remove it.
21
+$logo = $assets . '/logo.png';
22
+$logo_url = 'http://sleepycode.com';
23
+
24
+$language = 'english';
0 25
\ No newline at end of file
1 26