X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=GITManagedWebpage.class.php;h=2a3076f73a5770607bfbd7ed04c70fc689990eb9;hb=refs%2Fheads%2Fmaster;hp=fee826c0e284d0d24d0bdabac4961f04140e3d49;hpb=d9b4a6ae7a926fa03878a815f283b9b287c1ad78;p=GITManagedWebpage.git
diff --git a/GITManagedWebpage.class.php b/GITManagedWebpage.class.php
index fee826c..2a3076f 100644
--- a/GITManagedWebpage.class.php
+++ b/GITManagedWebpage.class.php
@@ -164,6 +164,14 @@ class GITManagedWebpage {
$this->error(self::ERROR_CRITICAL, "error cloning git repository.");
return;
}
+
+ $fp = fopen($this->workdir.'.htaccess');
+ fwrite($fp, '
+Order deny,allow
+Deny from all
+');
+ fclose($fp);
+
$this->ready = true;
$default_branch = str_replace(array("\r", "\n"), array("", ""), $this->gitcmd("rev-parse", "--abbrev-ref", "HEAD"));
@@ -243,9 +251,8 @@ class GITManagedWebpage {
if(substr($path, -1) != '/')
$path .= '/';
$current_branch = str_replace(array("\r", "\n"), array("", ""), $this->gitcmd("rev-parse", "--abbrev-ref", "HEAD"));
- if($current_branch != $branch)
- $this->gitcmd("checkout", $branch);
- $this->gitcmd("pull");
+ $this->gitcmd("fetch");
+ $this->gitcmd("reset", "--hard", "origin/".$branch);
$gitret = $this->gitcmd("rev-list", "--max-count=1", $branch);
preg_match("#([a-z0-9]{40})#", $gitret, $match);
$newest_version = $match[1];
@@ -302,6 +309,7 @@ class GITManagedWebpage {
return;
if(!$this->branchExists($branch)) {
+ $this->gitcmd("fetch");
if(!$this->branchExists('origin/'.$branch))
return false;
}
@@ -337,6 +345,124 @@ class GITManagedWebpage {
}
}
+ public function showMngrWindow() {
+ $html = '';
+ $html .= '';
+ $html .= '';
+ $html .= '';
+ $html .= '';
+ $html .= '';
+ $html .= '';
+
+ $current_branch = $this->getActiveBranch();
+ $current_version = substr($this->getConfig('version_'.$current_branch), 0, 7);
+ $html .= <<
+
+
+
+
+HTML_END;
+ return $html;
+ }
+
}
?>
\ No newline at end of file