summary refs log tree commit diff stats
path: root/admin
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2009-02-22 13:15:37 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2009-02-22 13:15:37 -0500
commiteee98526c48b9154cd9e9bc8bc3e07769e6a39ea (patch)
tree9d8d719a2ccea91de86435ccd985241ddb3fa0cb /admin
parent653c7b3a488488d4b161a8fae41ada5851bf7685 (diff)
downloadpillowcase-eee98526c48b9154cd9e9bc8bc3e07769e6a39ea.tar.gz
pillowcase-eee98526c48b9154cd9e9bc8bc3e07769e6a39ea.tar.bz2
pillowcase-eee98526c48b9154cd9e9bc8bc3e07769e6a39ea.zip
Rewrote Pillowcase
NOTE: There is a new database schema now, so the database from the testing server has to be copied over to the production server, otherwise this code
will fail.
Diffstat (limited to 'admin')
-rwxr-xr-xadmin/.htaccess4
-rw-r--r--admin/add.php30
-rwxr-xr-xadmin/index.php27
-rw-r--r--admin/login.php30
-rw-r--r--admin/logout.php7
-rw-r--r--admin/main.php8
-rw-r--r--admin/manage.php15
-rw-r--r--admin/remove.php10
-rw-r--r--admin/update.php5
9 files changed, 0 insertions, 136 deletions
diff --git a/admin/.htaccess b/admin/.htaccess deleted file mode 100755 index d590e40..0000000 --- a/admin/.htaccess +++ /dev/null
@@ -1,4 +0,0 @@
1RewriteEngine On
2RewriteCond %{REQUEST_FILENAME} !index.php
3RewriteCond %{REQUEST_FILENAME} !-d
4RewriteRule (.*).php /admin/index.php?file=$1 [QSA,L]
diff --git a/admin/add.php b/admin/add.php deleted file mode 100644 index 96a9219..0000000 --- a/admin/add.php +++ /dev/null
@@ -1,30 +0,0 @@
1<?php
2
3$getimage = "SELECT * FROM moderation WHERE id = " . $_GET['id'];
4$getimage2 = mysql_query($getimage);
5$getimage3 = mysql_fetch_array($getimage2);
6
7$title = $getimage3['title'];
8$title = preg_replace('/[^A-Za-z0-9 ]/','',$title);
9$title = str_replace(' ', '-', $title);
10$title = preg_replace('/-{2,}/','-',$title);
11if (substr($title,0,1) == '-')
12{
13 $title = substr($title,1);
14}
15if (substr($title,strlen($title)-1,1) == '-')
16{
17 $title = substr($title,0,strlen($title)-1);
18}
19$title = strtolower($title);
20rename($_SERVER['DOCUMENT_ROOT'] . '/moderation/' . $getimage3['id'] . '.png', $_SERVER['DOCUMENT_ROOT'] . '/images/' . $title . '.png');
21
22$insimage = "INSERT INTO pending (title,filename,text,author) VALUES (\"" . $getimage3['title'] . "\",\"" . $title . "\",\"" . $getimage3['text'] . "\",\"" . $getimage3['author'] . "\")";
23$insimage2 = mysql_query($insimage);
24
25$delimage = "DELETE FROM moderation WHERE id = " . $_GET['id'];
26$delimage2 = mysql_query($delimage);
27
28?>
29
30Added comic <?php echo($getimage3['title']); ?>!
diff --git a/admin/index.php b/admin/index.php deleted file mode 100755 index 3a5f6be..0000000 --- a/admin/index.php +++ /dev/null
@@ -1,27 +0,0 @@
1<?php
2
3session_start();
4
5ob_start();
6
7include('../header.php');
8
9if (!isset($_SESSION['username']))
10{
11 include('login.php');
12} else {
13 if (!isset($_GET['file']))
14 {
15 $file = 'main.php';
16 } else {
17 $file = basename($_GET['file'] . '.php');
18 }
19
20 include($file);
21}
22
23include('../footer.php');
24
25ob_end_flush();
26
27?>
diff --git a/admin/login.php b/admin/login.php deleted file mode 100644 index f938664..0000000 --- a/admin/login.php +++ /dev/null
@@ -1,30 +0,0 @@
1<?php
2
3if (!isset($_GET['submit']))
4{
5
6?>
7<FORM ACTION="/admin/login.php?submit=" METHOD="POST">
8Username: <INPUT TYPE="text" NAME="user"><BR>
9Password: <INPUT TYPE="password" NAME="pass"><BR>
10<INPUT TYPE="submit"></FORM>
11<?php
12
13} else {
14 $getconfig = "SELECT * FROM config WHERE name = \"username\" OR name = \"password\" ORDER BY name DESC";
15 $getconfig2 = mysql_query($getconfig) or die($getconfig);
16 $username = mysql_fetch_array($getconfig2);
17 $password = mysql_fetch_array($getconfig2);
18
19 if (($username['value'] == $_POST['user']) && ($password['value'] == md5($_POST['pass'])))
20 {
21 $_SESSION['username'] = $_POST['user'];
22
23 header('Location: /admin/');
24 exit;
25 } else {
26?><H2>Incorrect login</H2><?php
27 }
28}
29
30?>
diff --git a/admin/logout.php b/admin/logout.php deleted file mode 100644 index 639e045..0000000 --- a/admin/logout.php +++ /dev/null
@@ -1,7 +0,0 @@
1<?php
2
3unset($_SESSION['username']);
4
5header('Location: /');
6
7?>
diff --git a/admin/main.php b/admin/main.php deleted file mode 100644 index aa01262..0000000 --- a/admin/main.php +++ /dev/null
@@ -1,8 +0,0 @@
1<H2>Admin Panel</H2>
2
3<UL>
4 <LI><A HREF="/admin/post.php">Upload a comic</A></LI>
5 <LI><A HREF="/admin/manage.php">Manage moderation queue</A></LI>
6 <LI><A HREF="/admin/update.php">HG Update</A></LI>
7 <LI><A HREF="/admin/logout.php">Logout</A></LI>
8</UL>
diff --git a/admin/manage.php b/admin/manage.php deleted file mode 100644 index 2485520..0000000 --- a/admin/manage.php +++ /dev/null
@@ -1,15 +0,0 @@
1<UL><?php
2
3$getimages = "SELECT * FROM moderation";
4$getimages2 = mysql_query($getimages);
5while ($getimages3 = mysql_fetch_array($getimages2))
6{
7?><LI><?php echo($getimages3['title']); ?> -
8<IMG SRC="/moderation/<?php echo($getimages3['id']); ?>.png" ALT="<?php echo($getimages3['text']); ?>" TITLE="<?php echo($getimages3['text']); ?>"> -
9<A HREF="/admin/add.php?id=<?php echo($getimages3['id']); ?>">Add to Pending Queue</A> -
10<A HREF="/admin/remove.php?id=<?php echo($getimages3['id']); ?>">Remove</A></LI><?php
11}
12
13?></UL>
14
15<A HREF="/admin/">Back to Admin</A>
diff --git a/admin/remove.php b/admin/remove.php deleted file mode 100644 index 824fdee..0000000 --- a/admin/remove.php +++ /dev/null
@@ -1,10 +0,0 @@
1<?php
2
3$delimage = "DELETE FROM moderation WHERE id = " . $_GET['id'];
4$delimage2 = mysql_query($delimage);
5
6unlink($_SERVER['DOCUMENT_ROOT'] . '/moderation/' . $_GET['id'] . '.png');
7
8?>
9
10Removed comic <?php echo($_GET['id']); ?>!
diff --git a/admin/update.php b/admin/update.php deleted file mode 100644 index c84c2c4..0000000 --- a/admin/update.php +++ /dev/null
@@ -1,5 +0,0 @@
1<?php
2
3system('hg update');
4
5?>