diff --git a/install.php b/install.php
index 09da4d33..61a1bf69 100755
--- a/install.php
+++ b/install.php
@@ -1,7 +1,8 @@
-
+
+
Shimmie Installation
-
@@ -31,9 +33,10 @@ TD INPUT {width: 350px;}
Install Error
Shimmie needs to be run via a web server with PHP support -- you
appear to be either opening the file from your hard disk, or your
- web server is mis-configured.
+ web server is mis-configured.
If you've installed a web server on your desktop PC, you probably
- want to visit the local web server.
+ want to visit the local web server.
+
@@ -52,6 +55,7 @@ if(is_readable("config.php")) {
Shimmie Repair Console
";
*/
- echo "Database quick fix for User deletion
";
- echo "just a database fix for those who instaled shimmie before 2012 january the 22rd.
";
- echo "Note: some things needs to be done manually, to work properly.
";
- echo "WARNING: ONLY PROCEEDS IF YOU KNOW WHAT YOU ARE DOING!";
+ echo "Database Fix for User deletion
";
+ echo "This is a database fix for those who instaled shimmie before 2012 January 22rd.
";
+ echo "This is only for users with MySQL databases!
";
+ echo "Note: Some things needs to be done manually, to work properly.
";
+ echo "Please BACKUP YOUR DATABASE before performing this fix!
";
+ echo "WARNING: ONLY PROCEEDS IF YOU KNOW WHAT YOU ARE DOING!
";
echo "
EOD;
@@ -354,11 +359,12 @@ function build_dirs() { // {{{
!file_exists("images") || !file_exists("thumbs") || !file_exists("data") ||
!is_writable("images") || !is_writable("thumbs") || !is_writable("data")
) {
- print "Shimmie needs three folders in it's directory, 'images', 'thumbs', and 'data',
- and they need to be writable by the PHP user (if you see this error,
- if probably means the folders are owned by you, and they need to be
- writable by the web server).
- Once you have created these folders, hit 'refresh' to continue.";
+ print "
Shimmie needs three folders in it's directory, 'images', 'thumbs', and 'data',
+ and they need to be writable by the PHP user.
+ If you see this error, if probably means the folders are owned by you, and they need to be
+ writable by the web server.
+ PHP reports that it is currently running as user: ".$_ENV["USER"]." (". $_SERVER["USER"] .")
+ Once you have created these folders and/or changed the ownership of the shimmie folder, hit 'refresh' to continue.
";
exit;
}
} // }}}
@@ -393,10 +399,18 @@ function Database_user_deletion_fix() {
require_once "core/database.class.php";
$db = new Database();
- echo "Fixing user_favorites table....";
+ if ($database->db->getAttribute(PDO::ATTR_DRIVER_NAME) !== 'mysql') {
+ echo "
Database is not MySQL - Aborting changes.
";
+ echo 'Go Back';
+ return;
+ } else {
+ echo "Performing Database Fix Operations
";
+ }
+
+ echo "Fixing user_favorites table....
";
($db->Execute("ALTER TABLE user_favorites ENGINE=InnoDB;")) ? print_r("ok
") : print_r("failed
");
- echo "adding Foreign key to user ids...";
+ echo "adding Foreign key to user ids...
";
($db->Execute("ALTER TABLE user_favorites ADD CONSTRAINT foreign_user_favorites_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;"))? print_r("ok
"):print_r("failed
");
echo "cleaning, the table from deleted image favorites...
";
@@ -406,17 +420,17 @@ function Database_user_deletion_fix() {
foreach( $rows as $key => $value)
$db->Execute("DELETE FROM user_favorites WHERE image_id = :image_id;", array("image_id" => $value["image_id"]));
- echo "adding forign key to image ids...";
+ echo "adding forign key to image ids...
";
($db->Execute("ALTER TABLE user_favorites ADD CONSTRAINT user_favorites_image_id FOREIGN KEY (image_id) REFERENCES images(id) ON DELETE CASCADE;"))? print_r("ok
"):print_r("failed
");
- echo "adding foreign keys to private messages...";
+ echo "adding foreign keys to private messages...
";
($db->Execute("ALTER TABLE private_message
ADD CONSTRAINT foreign_private_message_from_id FOREIGN KEY (from_id) REFERENCES users(id) ON DELETE CASCADE,
ADD CONSTRAINT foreign_private_message_to_id FOREIGN KEY (to_id) REFERENCES users(id) ON DELETE CASCADE;")) ? print_r("ok
"):print_r("failed
");
- echo "Just one more step...which you need to do manually:
";
+ echo "
Just one more step...which you need to do manually:
";
echo "You need to go to your database and Delete the foreign key on the owner_id in the images table.
";
echo "How to remove foreign keys
";
echo "and finally execute this querry:
";