Skip to content

Commit

Permalink
Repaired commit GD function, also made it redirect to the right page …
Browse files Browse the repository at this point in the history
…when clicking "Projects"
  • Loading branch information
xanmanning authored and josegonzalez committed Oct 17, 2010
1 parent f76f4bb commit bb1762b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
11 changes: 10 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,25 @@ Git-PHP is a port of gitweb to PHP. It includes various functionality, such as s

### Supposed directory structure:
git-php-\
|
|
+-.temp\
|
+-cache
|
+-bundles
|
+-secrets
$repo_directory-\
|
+-.temp\
|
+-cache
|
+-bundles
|
+-secrets
|
+-project1\.git
|
+-project2\.git
Expand Down
15 changes: 9 additions & 6 deletions commit.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
global $branches;
global $nr_of_shortlog_lines;

if(!@$_GET['p'] && !@$_GET['dl'])
header('Location: git.php');

global $keepurl; //the arguments that must be resent

//repos could be made by an embeder script
Expand Down Expand Up @@ -173,7 +176,7 @@ function create_bundles_directory() {
}

function load_bundles_in_directory() {
global $CONFIG['repo_directory'], $CONFIG['bundle_name'];
global $CONFIG;
$repo = $_GET['p'];
$bundles = array();
$dname = $CONFIG['repo_directory'] . $CONFIG['bundle_name'] . $repo . "/";
Expand Down Expand Up @@ -207,7 +210,7 @@ function load_bundles_in_directory() {
}

function save_bundle() {
global $CONFIG['repo_directory'], $CONFIG['bundle_name'], $CONFIG['email_address'];
global $CONFIG;
$repo = $_GET['p'];
$dname = $CONFIG['repo_directory'] . $CONFIG['bundle_name'] . $repo . "/";
create_bundles_directory();
Expand Down Expand Up @@ -241,7 +244,7 @@ function save_bundle() {

// check if a tag is in repository
function check_tag_in_repo($the_tag) {
global $CONFIG['repo_directory'];
global $CONFIG;
$repo = $_GET['p'];
$out = array();
$nr=0;
Expand Down Expand Up @@ -296,9 +299,9 @@ function check_new_head_in_bundle($what, &$out1) {
// returns true if bundle does apply to the database
// returns false if the bunlde does not apply to the database
function check_verify_bundle() {
$success=true;
$repo=$_GET['p'];
$what=$_FILES['bundle_file']['tmp_name'];
$success = true;
$repo = $_GET['p'];
$what = $_FILES['bundle_file']['tmp_name'];
$out1 = array();
if ($success) {
$success = $success && check_new_head_in_bundle($what, $out1);
Expand Down
6 changes: 1 addition & 5 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?php

error_reporting(-1);

$cat = "syntax error";

echo "pants to you" $cat;
header('Location: git.php');

?>
18 changes: 5 additions & 13 deletions security.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,24 +196,16 @@ function draw_human_checker($amessage) {

$im = imagecreate($w, $h);
$cvar[0] = imagecolorallocate($im, 255, 255, 255);
$cvar[1] = imagecolorallocate($im, 200, 0, 0);
$cvar[2] = imagecolorallocate($im, 0, 200, 0);
$cvar[3] = imagecolorallocate($im, 0, 0, 200);
$cvar[4] = imagecolorallocate($im, 0, 0, 0);

$col1 = rand(0,4);
do {
$col2 = rand(0,4);
} while ($col1 == $col2);
$cvar[1] = imagecolorallocate($im, 0, 0, 0);

//echo "$fh,$fw";
//die();

imagefill($im, 0, 0, $cvar[$col1]);
imagefill($im, 0, 0, $cvar[0]);

for ($i=0; $i<$ml; $i++) {
$m = "$amessage[$i]";
imagestring($im, 5, $i*$fw+rand(0,4), rand(0,12)-3, $m, $cvar[$col2]);
imagestring($im, 5, $i*$fw+rand(0,4), rand(0,12)-3, $m, $cvar[1]);
}

$n = $fw*$h*$prob / 100;
Expand All @@ -223,9 +215,9 @@ function draw_human_checker($amessage) {
$y = rand(0,$h-1);
$idx = imagecolorat($im, $x, $y);
if ($idx == $col1) {
imagesetpixel($im,$x,$y,$cvar[$col2]);
imagesetpixel($im,$x,$y,$cvar[1]);
} else {
imagesetpixel($im,$x,$y,$cvar[$col1]);
imagesetpixel($im,$x,$y,$cvar[0]);
}
}
}
Expand Down

0 comments on commit bb1762b

Please sign in to comment.