Skip to content

Commit 8e418bb

Browse files
committed
Bug fixes
1 parent 997771c commit 8e418bb

39 files changed

+172
-418
lines changed

.htaccess

100644100755
File mode changed.

Admin.php

100644100755
File mode changed.

ChangeFile.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
}
5252
exit();
5353
}
54-
// Find out what already exists
54+
// Find out what already exists - this really needs to be rewritten (and it will be soon enough!)
5555
////////////////////////////////////
5656
$ident_json = $ident . ".json";
5757
$already_exists_base = getJSON("all_packages/$ident");

CreateFile.php

100644100755
+67-95
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,25 @@
99
}
1010
$session = $_SESSION[$RootSession];
1111
if ($session === true) {
12-
if (isset($_POST['identifier'])) {
13-
$identifier = $_POST['identifier'];
14-
$package = $_POST['identifier'];
12+
if (isset($_POST['Package'])) {
13+
$allvars = $_POST;
14+
$identifier = $_POST['Package'];
1515
$debname = $_POST['debname'];
16-
$md5sum = $_POST['md5sum'];
17-
$maintainer = $_POST['maintainer'];
18-
$section = $_POST['section'];
19-
$author = $_POST['author'];
20-
$version = $_POST['version'];
21-
$arch = $_POST['arch'];
22-
$size = $_POST['size'];
23-
$name = $_POST['name'];
24-
$depiction = $_POST['depiction'];
25-
$priority = $_POST['priority'];
26-
$tag = $_POST['tag'];
27-
$debnameplusdeb = $debname . ".deb";
28-
$filename = "./debs/$debnameplusdeb";
29-
$description = $_POST['description'];
3016
$permission = $_POST['permission'];
31-
$depends = $_POST['depends'];
32-
$conflicts = $_POST['conflicts'];
33-
$replaces = $_POST['replaces'];
34-
$olddebnames = getJSON("debnames");
17+
unset($allvars["depiction_content"]);
18+
unset($allvars["permission"]);
19+
unset($allvars["debname"]);
20+
unset($allvars["deb"]);
21+
$thisnewpackageinfo = array();
22+
foreach ($allvars as $objid => $objval) {
23+
$thisnewpackageinfo[$objid] = $objval;
24+
}
25+
$debnameplusdeb = $_POST["debname"] . ".deb";
26+
$filename = "./debs/$debnameplusdeb";
27+
$thisnewpackageinfo['Filename'] = $filename;
28+
// First update debs
3529
$usedindep = false;
30+
$olddebnames = getJSON("debnames");
3631
$newdebmame = array($identifier => $debname);
3732
$merged_deb_array = array_merge($olddebnames,$newdebmame);
3833
saveJSON("debnames",$merged_deb_array);
@@ -41,50 +36,27 @@
4136
$newpermission = array($debname => $permission);
4237
$mergedpermissions = array_merge($oldpermissions,$newpermission);
4338
saveJSON("package_groups",$mergedpermissions);
44-
// Ok, done with permissions. Now add package json info
45-
$thisnewpackageinfo = array("MD5Sum" => $md5sum,
46-
"Maintainer" => $maintainer,
47-
"Description" => $description,
48-
"Package" => $package,
49-
"Section" => $section,
50-
"Author" => $author,
51-
"Filename" => $filename,
52-
"Version" => $version,
53-
"Architecture" => $arch,
54-
"Size" => $size,
55-
"Name" => $name,
56-
"Depiction" => $depiction,
57-
"Priority" => $priority,
58-
"Tag" => $tag,
59-
"Depends" => $depends,
60-
"Replaces" => $replaces,
61-
"Conflicts" => $conflicts);
39+
// Done with permissions
40+
// Now save package json
6241
saveJSON("all_packages/$identifier",$thisnewpackageinfo);
6342
$finalpath = "all_packages/".$identifier.".json";
64-
chmod ($finalpath,0777);
43+
chmod($finalpath,0777);
6544
// Done with package json, now save the deb from form
66-
if (!empty($_FILES["deb"])) {
67-
// get extension
68-
$temp = explode(".", $_FILES["deb"]["name"]);
69-
$extension = end($temp);
70-
if ($extension === "deb") {
71-
// only debs
72-
if (file_exists("debs/" . $_FILES["deb"]["name"])) {
73-
echo "That deb already exists! Sigh...<br>";
74-
} else {
75-
move_uploaded_file($_FILES["deb"]["tmp_name"],
76-
"debs/" . $_FILES["deb"]["name"]);
77-
}
78-
}
79-
// permissions
80-
$file = $_FILES["deb"]["name"];
81-
chmod($file,0777);
45+
if (isset($_FILES['deb'])) {
46+
$info = pathinfo($_FILES['deb']['name']);
47+
$ext = $info['extension']; // get the extension of the file
48+
$newname = $_FILES['deb']['name'];
49+
50+
$target = 'debs/'.$newname;
51+
move_uploaded_file( $_FILES['deb']['tmp_name'], $target);
52+
// and chmod it
53+
chmod($target,0777);
8254
}
8355
// Done with saving deb, now check out depiction
8456
if (!empty($_POST['depiction_content'])) {
8557
//////////////////////////////////////////////
86-
$ident = $_POST['identifier'];
87-
$name = $_POST['name'];
58+
$ident = $_POST['Package'];
59+
$name = $_POST['Name'];
8860
$desc = $_POST['depiction_content'];
8961
$debnames = $_POST['debname'];
9062
$originalArrayNames = getJSON("descriptions/names");
@@ -105,14 +77,12 @@
10577
} else {
10678
$prepDebs = $originalArrayDebs;
10779
}
108-
//$prepDesc = $originalArrayDescs;
10980
if (!array_key_exists($ident, $prepName)) {
11081
$newArrayNames = array($ident => $name);
11182
$newArrayDescs = array($ident => $desc);
11283
$newArrayDebs = array($ident => $debnames);
11384
// name merge
11485
$finalName = array_merge($prepName,$newArrayNames);
115-
// $finalName = $prepName + $newArrayNames;
11686
saveJSON("descriptions/names",$finalName);
11787
// description merge
11888
$finalDesc = array_merge($prepDesc,$newArrayDescs);
@@ -140,7 +110,9 @@
140110
</body>
141111
</html>
142112
<?php } else {
143-
echo "New file added! Now, you need to <a href='descriptions/createDepiction.php?identifier=$identifier&name=$name&debname=$debname'>add its depiction</a> and add the deb file ('deb/$debname').";
113+
$name = $_POST['Name'];
114+
$debnameplusde = $debname . ".deb";
115+
echo "New file added! Now, you need to <a href='descriptions/createDepiction.php?identifier=$identifier&name=$name&debname=$debname'>add its depiction</a> and add the deb file ('debs/$debnameplusde').";
144116
}
145117
} else {
146118
if( $detect->isiOS() ){ ?>
@@ -177,24 +149,24 @@ function copyIt() {
177149
document.getElementByName("depiction").value = "<?php echo $depictionbase; ?>"+x;
178150
}
179151
</script>
180-
<ul><li><p><form action='' method='post'>
181-
Identifier: <input type="text" name="identifier" onkeyup="copyIt()"><br>
152+
<ul><li><p><form action='' method='post' enctype='multipart/form-data'>
153+
Identifier: <input type="text" name="Package" id="identifier" onkeyup="copyIt()"><br>
182154
Deb Name (no .deb): <input type="text" name="debname"><br>
183-
MD5Sum: <input type="text" name="md5sum"><br>
184-
Maintainer: <input type="text" name="maintainer" value="Me">
185-
Section: <input type="text" name="section"><br>
186-
Author: <input type="text" name="author" value="Me"><br>
187-
Version: <input type="text" name="version" value="1.0"><br>
188-
Architecture: <input type="text" name="arch" value="iphoneos-arm"><br>
189-
Description: <input type="text" name="description"><br>
190-
Size: <input type="text" name="size"><br>
191-
Name: <input type="text" name="name"><br>
192-
Depiction: <input type="text" name="depiction" value="<?php echo $depictionbase; ?>"><br>
193-
Priority: <input type="text" name="priority" value="optional"><br>
194-
Depends: <input type="text" name="depends" value=""><br>
195-
Conflicts: <input type="text" name="conflicts" value=""><br>
196-
Replaces: <input type="text" name="replaces" value=""><br>
197-
Tag (can leave blank): <input type="text" name="tag"><br>
155+
MD5Sum: <input type="text" name="MD5Sum"><br>
156+
Maintainer: <input type="text" name="Maintainer" value="Me">
157+
Section: <input type="text" name="Section"><br>
158+
Author: <input type="text" name="Author" value="Me"><br>
159+
Version: <input type="text" name="Version" value="1.0"><br>
160+
Architecture: <input type="text" name="Architecture" value="iphoneos-arm"><br>
161+
Description: <input type="text" name="Description"><br>
162+
Size: <input type="text" name="Size"><br>
163+
Name: <input type="text" name="Name"><br>
164+
Depiction: <input type="text" name="Depiction" value="<?php echo $depictionbase; ?>"><br>
165+
Priority: <input type="text" name="Priority" value="optional"><br>
166+
Depends: <input type="text" name="Depends" value=""><br>
167+
Conflicts: <input type="text" name="Conflicts" value=""><br>
168+
Replaces: <input type="text" name="Replaces" value=""><br>
169+
Tag (can leave blank): <input type="text" name="Tag"><br>
198170
Permission Level: <select name="permission"><option value="0">Level 0</option><option value="1">Level 1</option><option value="2">Level 2</option><option value="3">Level 3</option><option value="4">Level 4</option></select><br>
199171
(optional) Upload deb file: <input type="file" name="deb" id="deb"><br>
200172
Finally, if you want to add a dipiction here, go ahead and type it below:<br>
@@ -210,24 +182,24 @@ function copyItTwo() {
210182
document.getElementById("depiction").value = "<?php echo $depictionbase; ?>"+x;
211183
}
212184
</script>
213-
<form action='' method='post'>
214-
Identifier: <input type="text" name="identifier" id="identifier" onkeyup="copyItTwo()"><br>
185+
<form action='' method='post' enctype='multipart/form-data'>
186+
Identifier: <input type="text" name="Package" id="identifier" onkeyup="copyItTwo()"><br>
215187
Deb Name (no .deb) <input type="text" name="debname"><br>
216-
MD5Sum: <input type="text" name="md5sum"><br>
217-
Maintainer: <input type="text" name="maintainer" value="Me">
218-
Section: <input type="text" name="section"><br>
219-
Author: <input type="text" name="author" value="Me"><br>
220-
Version: <input type="text" name="version" value="1.0"><br>
221-
Architecture: <input type="text" name="arch" value="iphoneos-arm"><br>
222-
Description: <input type="text" name="description"><br>
223-
Size: <input type="text" name="size"><br>
224-
Name: <input type="text" name="name"><br>
225-
Depiction: <input type="text" name="depiction" id="depiction" value="<?php echo $depictionbase; ?>"><br>
226-
Priority: <input type="text" name="priority" value="optional"><br>
227-
Depends: <input type="text" name="depends" value=""><br>
228-
Conflicts: <input type="text" name="conflicts" value=""><br>
229-
Replaces: <input type="text" name="replaces" value=""><br>
230-
Tag (can leave blank): <input type="text" name="tag"><br>
188+
MD5Sum: <input type="text" name="MD5sum"><br>
189+
Maintainer: <input type="text" name="Maintainer" value="Me">
190+
Section: <input type="text" name="Section"><br>
191+
Author: <input type="text" name="Author" value="Me"><br>
192+
Version: <input type="text" name="Version" value="1.0"><br>
193+
Architecture: <input type="text" name="Architecture" value="iphoneos-arm"><br>
194+
Description: <input type="text" name="Description"><br>
195+
Size: <input type="text" name="Size"><br>
196+
Name: <input type="text" name="Name"><br>
197+
Depiction: <input type="text" name="Depiction" id="depiction" value="<?php echo $depictionbase; ?>"><br>
198+
Priority: <input type="text" name="Priority" value="optional"><br>
199+
Depends: <input type="text" name="Depends" value=""><br>
200+
Conflicts: <input type="text" name="Conflicts" value=""><br>
201+
Replaces: <input type="text" name="Replaces" value=""><br>
202+
Tag (can leave blank): <input type="text" name="Tag"><br>
231203
Permission Level: <select name="permission"><option value="0">Level 0</option><option value="1">Level 1</option><option value="2">Level 2</option><option value="3">Level 3</option><option value="4">Level 4</option></select><br>
232204
(optional) Upload deb file: <input type="file" name="deb" id="deb"><br>
233205
Finally, if you want to add a dipiction here, go ahead and type it below:<br>

DeleteFile.php

100644100755
File mode changed.

LICENSE

100644100755
File mode changed.

ManageUDID.php

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
$newusername = $_POST['name'];
6464
$oldarray = getJSON("approved_udids_2");
6565
$newarray = array($userudid,$newuserlevel,$newusername);
66-
//$finalarray = array_merge($oldarray,$newarray);
6766
array_push($oldarray,$newarray);
6867
saveJSON("approved_udids_2",$oldarray);
6968
echo "User added!";

Mobile_Detect.php

100644100755
File mode changed.

README.md

100644100755
File mode changed.

allFiles.php

100644100755
+6-24
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
$session = $_SESSION[$RootSession];
1010
if ($session === true) {
1111
$availableIdentifiers = array();
12+
// Get identifiers
1213
if (is_dir("all_packages"))
1314
{
15+
if (file_exists("all_packages/info.txt")) {
16+
unlink("all_packages/info.txt");
17+
}
1418
if ($handle = opendir("all_packages"))
1519
{
1620
//Notice the parentheses I added:
@@ -26,14 +30,9 @@
2630
}
2731
}
2832
if (!isset($_POST['submitted'])) {
29-
// Get all identifiers
30-
//////////////////////////////
31-
32-
//////////////////////////////
33-
//$allDeipictions = getJSON("names");
34-
//$availableIdentifiers = array_keys($allDeipictions);
33+
// Alphabetically sort the identifiers
3534
sort($availableIdentifiers);
36-
// remove first useless values
35+
// remove first useless values (. and ..)
3736
unset($availableIdentifiers[0]);
3837
unset($availableIdentifiers[1]);
3938
$form = "<form action='' method='post'>
@@ -77,28 +76,11 @@
7776
Identifier: <input type='text' name='identifier'><br>
7877
<input type='submit' value='Search'>
7978
<?php }
80-
81-
/*
82-
echo "<ul>";
83-
foreach ($availableIdentifiers as $ident) {
84-
echo "<li>".$ident."</li>";
85-
}
86-
echo "</ul>";
87-
echo "<br>";
88-
echo "<br>";
89-
echo "<br>";
90-
*/
9179
} else {
9280
$identifier = $_POST['identifier'];
93-
//$names = getJSON("names");
94-
//$descs = getJSON("description");
95-
//$debnames = getJSON("../debnames");
9681
if (in_array($identifier,$availableIdentifiers)) {
9782
$link1 = $CurrentDirectory . "ChangeFile.php?identifier=";
9883
$finallink2 = $link1 . $identifier;
99-
//$identname = $names[$identifier];
100-
//$identdesc = $descs[$identifier];
101-
//$identdeb = $debnames[$identifier];
10284
if( $detect->isiOS() ){ ?>
10385
<!DOCTYPE html>
10486
<html>

all_packages/info.txt

100644100755
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
This file is a placeholder for this folder. In here, you will find each package in its own JSON along with all its information inside of it.
2-
3-
After loading the repo, please delete this file. Thanks :)
1+
This file is a placeholder for this folder. In here, you will find each package in its own JSON along with all its information inside of it.
2+
3+
After loading the repo, please delete this file. Thanks :)

approved_udids_2.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[]
1+
[]

auth.php

100644100755
File mode changed.

debnames.json

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
[]

debs/.htaccess

100644100755
File mode changed.

debs/Check MD5 or SHA-1 hashes.bat

100644100755
File mode changed.

debs/index.php

100644100755
File mode changed.

descriptions/.htaccess

100644100755
File mode changed.

descriptions/DeleteDepiction.php

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
// Don't delete from debnames if this is an existing package
3131
echo "Successfully removed $ident's depiction! NOTE: This still exists in ../debnames!";
3232
} else {
33-
// Otherwise, it's probably a test depiction, so we can delete it.
33+
// Otherwise, it's probably a test depiction (or something leftover from a deleted package), so we can delete it.
3434
unset($debnames[$ident]);
3535
saveJSON("../debnames",$debnames);
3636
echo "Successfully removed $ident's depiction! NOTE: This does NOT exist in ../debnames! (It's not in the package listing, so we can assume it was a test.)";

descriptions/authenticate.php

100644100755
File mode changed.

descriptions/changeDepiction.php

100644100755
File mode changed.

descriptions/createDepiction.php

100644100755
-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
$newArrayDebs = array($ident => $debnames);
4848
// name merge
4949
$finalName = array_merge($prepName,$newArrayNames);
50-
// $finalName = $prepName + $newArrayNames;
5150
saveJSON("names",$finalName);
5251
// description merge
5352
$finalDesc = array_merge($prepDesc,$newArrayDescs);
@@ -64,8 +63,6 @@
6463
echo "<br>";
6564
$descriptroot = $CurrentDirectory . "descriptions/";
6665
echo "<a href='$descriptroot'>Go back</a>.";
67-
// print_r($prepDesc);
68-
// print_r($finalName);
6966
} else {
7067
echo "That already exists!";
7168
}

descriptions/description.json

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
[]

descriptions/index.php

100644100755
File mode changed.

descriptions/ios7css.css

100644100755
File mode changed.

descriptions/ios7css.js

100644100755
File mode changed.

descriptions/names.json

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
[]

descriptions/pages.php

100644100755
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22
include '../usergroups.php';
3-
// error
3+
// Hide universal notices/warnings
4+
error_reporting(E_ERROR);
5+
// Error to display if a download count failed (somehow)
46
$download_count = "(error)";
57
if (!isset($_GET['file'])) {
68
echo "No identifier listed!";
@@ -54,8 +56,6 @@
5456
}
5557
$con=mysqli_connect($Database,$DBUser,$DBPass,$DB_DB);
5658
if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); }
57-
//$result = mysqli_query($con,"SELECT `filename` FROM `downloads` WHERE 1");
58-
//$storeDownloadedPackages = mysqli_fetch_array($result);
5959
$result = mysqli_query($con,"SELECT * FROM downloads");
6060
$storeDownloadedPackages = Array();
6161
while ($row = mysqli_fetch_array($result, MYSQL_ASSOC)) {

descriptions/unAuth.php

100644100755
File mode changed.

descriptions/viewDepictions.php

100644100755
-10
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,6 @@
4242
}
4343
echo "</ul>";
4444
}
45-
/*
46-
echo "<ul>";
47-
foreach ($availableIdentifiers as $ident) {
48-
echo "<li>".$ident."</li>";
49-
}
50-
echo "</ul>";
51-
echo "<br>";
52-
echo "<br>";
53-
echo "<br>";
54-
*/
5545
if( $detect->isiOS() ){ ?>
5646
<!DOCTYPE html>
5747
<html>

downloads.sql

100644100755
File mode changed.

ios7css.css

100644100755
File mode changed.

ios7css.js

100644100755
File mode changed.

package_groups.json

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
[]

recycle_bin/info.txt

100644100755
+3-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
This folder stores deb files that have been deleted via DeleteFile.
2-
1+
This folder stores deb files that have been deleted via DeleteFile.
2+
3+
You can delete it or not; it really doesn't matter here.

0 commit comments

Comments
 (0)