Issue 117: git projects are added to mercurial Apache config

This commit is contained in:
Nathan Adams 2016-03-20 14:15:51 -05:00
parent 0e252b19b5
commit f6d60fdc35
2 changed files with 6 additions and 15 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
private_notify="/home/mercurial/tmp/notify.tmp"

View File

@ -130,16 +130,7 @@ class IDF_Plugin_SyncMercurial
* Get the repository password for the user
*/
function getMercurialPass($user){
//echo $user->password.Pluf::f('secret_key');
# return base64_encode(sha1($_POST["password"], true));
#file_put_contents("/tmp/test3", "test");
//return sha1($_POST["password"], true);
//if (isset($_POST["password"])) return $_POST["password"];
//return $_POST["password"];
//file_put_contents("/tmp/test", $user->password.Pluf::f('secret_key'));
//file_put_contents("/tmp/test", $user->password);
//return substr(sha1($user->password.Pluf::f('secret_key')), 0, 8);
return $user->password;
return $user->password;
}
/**
@ -152,15 +143,12 @@ class IDF_Plugin_SyncMercurial
throw new Exception (sprintf(__('%s does not exist or is not writable.'), $passwd_file));
}
$ht = new File_Passwd_Authbasic($passwd_file);
//$ht->setMode(Pluf::f('idf_plugin_syncmercurial_passwd_mode',
// FILE_PASSWD_SHA));
$ht->setMode("plain");
$ht->setMode("plain");
$ht->load();
$mem = $project->getMembershipData();
$members = array_merge((array)$mem['members'], (array)$mem['owners'],
(array)$mem['authorized']);
foreach($members as $user) {
//file_put_contents("/tmp/test", $this->getMercurialPass($user));
if ($ht->userExists($user->login)) {
$ht->changePasswd($user->login, "{SHA}" . $this->getMercurialPass($user));
} else {
@ -215,6 +203,9 @@ class IDF_Plugin_SyncMercurial
$notify_file = Pluf::f('idf_plugin_syncmercurial_private_notify');
$fcontent = '';
foreach (Pluf::factory('IDF_Project')->getList() as $project) {
if ($project->getConf()->getVal('scm') != "mercurial") {
continue;
}
$conf = new IDF_Conf();
$conf->setProject($project);
$hide_file = Pluf::f('idf_plugin_syncmercurial_path').sprintf('/%s/.hide', $project->shortname);