Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRannou committed Dec 2, 2011
1 parent 515045d commit 94f5047
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
10 changes: 7 additions & 3 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
FEATURES:
-MAMP, javascipt and html
-easy setup
-admin secured area
-encrypted passwords in db
-use jquery
-admin secured area via htpsswd
-encrypted passwords in db (md5)
-php page requires login (if user not logged in an tries to access page, he is redirected to login page)
-secured against sql injection (TODO: check the command too)
-upload image
Expand Down Expand Up @@ -33,12 +34,15 @@ ImageMagick
# Choose admin password
7-get new username and passord
http://www.addedbytes.com/lab/password-protect-a-directory-with-htaccess/#result
8- update admin/.htpasswd
8- update admin/.htpasswd and admin/.htaccess

# Create the tables
9- go to the website, to the admin section: imagebank/admin
10- enter your username, password then create DB

# bank write access


# Everything is setup now!

TODO:
Expand Down
12 changes: 8 additions & 4 deletions ajax/executecommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@
$command = &$_GET['var1'];
$image = $_SESSION["currentimage"];

$ext = end(explode('.', $image));
$realpath = substr($image, 0, strlen($image) - strlen($ext) -1);

$imagenoextension = split("\.", $image, 2);
$location = split("\/", $imagenoextension[0], 4);
$location = split("\/", $realpath, 4);
$filter = split(" ", $command, 3);

$newimage = $location[0] . "/" . $location[1] . "/modified/" . $location[3] . $filter[1] . $filter[2] . "." . $imagenoextension[1];
$newimage = $location[0] . "/" . $location[1] . "/modified/" . $location[3] . $filter[1] . $filter[2] ..
"." . $ext;

# session variables
$_SESSION["newimage"] = $newimage;
$_SESSION["command"] = $command;

$env_vars = "/Users/nr52/INSTALL/ImageMagick-6.7.3/bin/";

# clean the command
$fullcommand = $env_vars . $command . " ../" . $image . " ../" . $newimage;

system($fullcommand);

#return 2 images to update visualization and show paths
#echo $ext . " " . $realpath;
echo $image . " " . $newimage;
?>
?>

0 comments on commit 94f5047

Please sign in to comment.