Browse Source

Reverted back to old library. Time to figure out permissions issue.

pull/24/head
Teknikode 8 years ago
parent
commit
d8e28e8429
  1. 15
      includes/update_profile.php

15
includes/update_profile.php

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<?php
require_once('config.php');
require_once('PHPGit/Repository.php');
require_once('Git.php');
//initialize php variables used in the form
$current_password = "";
@ -131,8 +131,11 @@ if(isset($_POST)) @@ -131,8 +131,11 @@ if(isset($_POST))
// Add the user's keys to his git account
if ($public_key != $user->public_key)
{
$repo = new PHPGit_Repository($CONF['git_repo_path'][0].'gitolite-admin\\', true, array('git_executable' => $CONF['git_path']));
$repo->git('pull origin master');
$Git = new Git();
$Git->windows_mode();
$repo = $Git->open($CONF['git_repo_path'][0].'gitolite-admin\\');
$repo->setenv("HOME", "/home/git");
$repo->pull('origin', 'master');
if (is_dir($CONF['git_repo_path'][0].'gitolite-admin\\keydir\\u\\'.$user->username))
{
@ -159,9 +162,9 @@ if(isset($_POST)) @@ -159,9 +162,9 @@ if(isset($_POST))
fclose($fileHandle);
$index++;
}
$repo->git('add .');
$repo->git('commit -m "Modified keys for '.$user->username.'"');
$repo->git('push origin master');
$repo->add('.');
$repo->commit('Modified keys for '.$user->username);
$repo->push('origin', 'master');
}
/*

Loading…
Cancel
Save