Permalink
Browse files

Repaired commit GD function, also made it redirect to the right page …

…when clicking "Projects"
  • Loading branch information...
xanmanning committed Jun 22, 2010
1 parent f499b11 commit f1d22a71e8a2c54185061a12921636279caf5057
Showing with 25 additions and 25 deletions.
  1. +10 −1 README.markdown
  2. +9 −6 commit.php
  3. +1 −5 index.php
  4. +5 −13 security.php
View
@@ -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
View
@@ -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
@@ -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 . "/";
@@ -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();
@@ -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;
@@ -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);
View
@@ -1,9 +1,5 @@
<?php
-error_reporting(-1);
-
-$cat = "syntax error";
-
-echo "pants to you" $cat;
+header('Location: git.php');
?>
View
@@ -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;
@@ -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]);
}
}
}

0 comments on commit f1d22a7

Please sign in to comment.