Browse Source

Fixed calling git repo array instead of single path

tags/v1.1
Teknikode 5 years ago
parent
commit
72634f1726
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      includes/update_profile.php

+ 5
- 5
includes/update_profile.php View File

@@ -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))
}
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))
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