Browse Source

Fixed calling git repo array instead of single path

pull/24/head
Teknikode 8 years ago
parent
commit
72634f1726
  1. 10
      includes/update_profile.php

10
includes/update_profile.php

@ -133,12 +133,12 @@ if(isset($_POST)) @@ -133,12 +133,12 @@ if(isset($_POST))
{
$Git = new Git();
$Git->windows_mode();
$repo = $Git->open($CONF['git_repo_path']."gitolite-admin\\");
$repo = $Git->open($CONF['git_repo_path'][0]."gitolite-admin\\");
$repo->pull('origin', 'master');
if (is_dir($CONF['git_repo_path']."gitolite-admin\\keydir\\u\\".$user->username))
if (is_dir($CONF['git_repo_path'][0]."gitolite-admin\\keydir\\u\\".$user->username))
{
$files = glob($CONF['git_repo_path']."gitolite-admin\\keydir\\u\\".$user->username."/*");
$files = glob($CONF['git_repo_path'][0]."gitolite-admin\\keydir\\u\\".$user->username."/*");
foreach($files as $file){ // iterate files
if(is_file($file))
unlink($file); // delete file
@ -146,7 +146,7 @@ if(isset($_POST)) @@ -146,7 +146,7 @@ if(isset($_POST))
}
else
{
mkdir($CONF['git_repo_path']."gitolite-admin\\keydir\\u\\".$user->username, 0777, true);
mkdir($CONF['git_repo_path'][0]."gitolite-admin\\keydir\\u\\".$user->username, 0777, true);
}
$index = 0;
$keys = explode(",", $public_key);
@ -155,7 +155,7 @@ if(isset($_POST)) @@ -155,7 +155,7 @@ if(isset($_POST))
preg_match($pattern, $key, $matches);
$key = "ssh-rsa " . $matches[2];
$keyFileName = $CONF['git_repo_path']."gitolite-admin\\keydir\\u\\".$user->username."\\".$user->username."@Key".$index.".pub";
$keyFileName = $CONF['git_repo_path'][0]."gitolite-admin\\keydir\\u\\".$user->username."\\".$user->username."@Key".$index.".pub";
$fileHandle = fopen($keyFileName, 'w');
fwrite($fileHandle, $key);
fclose($fileHandle);

Loading…
Cancel
Save