From c9fb4c29454901148d9a7f97587b1284c6c55b89 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 3 Nov 2020 17:08:00 +0100 Subject: [PATCH] More fixes for gitolite configuration script More usages of undefined variable. Corrected mistake in collection of system keys. --- scripts/gitolite/rebuild_gitolite.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/gitolite/rebuild_gitolite.php b/scripts/gitolite/rebuild_gitolite.php index c6b5683c36..6854203870 100755 --- a/scripts/gitolite/rebuild_gitolite.php +++ b/scripts/gitolite/rebuild_gitolite.php @@ -54,7 +54,7 @@ class Configuration { $this->keys_directory = "$gitolite_root/keydir"; $this->config_file = "$gitolite_root/conf/gitolite.conf"; - $this->system_keys = $this->getSystemPublicKeys(); + $this->collectSystemPublicKeys(); if (!file_exists($this->config_file)) { die("Not found: $this->config_file\n"); @@ -154,7 +154,6 @@ class Configuration { // public key duplication in the case system key is used by phabricator user. protected function getSystemPublicKeys() { $files = scandir($this->keys_directory); - $system_keys = array(); foreach ($files as $file) { if (startswith($file, "PHAB")) { continue; @@ -167,7 +166,6 @@ class Configuration { $this->system_keys[$key] = $file_we; $this->used_keys[$file_we] = true; } - return $system_keys; } protected function removeUnusedPublicKeys() { @@ -324,19 +322,19 @@ function handleCustomPolicy($config, $policy) { $rule_type = $rule['rule']; if ($rule_type == 'PhabricatorPolicyRuleUsers') { $policy_config_user_names = - handleUsersPolicyRule($system_keys, $rule); + handleUsersPolicyRule($config, $rule); } else if ($rule_type == 'PhabricatorProjectsPolicyRule') { $policy_config_user_names = - handleProjectsPolicyRule($system_keys, $rule); + handleProjectsPolicyRule($config, $rule); } else if ($rule_type == 'PhabricatorProjectsAllPolicyRule') { $policy_config_user_names = - handleProjectsAllPolicyRule($system_keys, $rule); + handleProjectsAllPolicyRule($config $rule); } else if ($rule_type == 'PhabricatorAdministratorsPolicyRule') { $policy_config_user_names = - handleAdministratorsPolicyRule($system_keys, $rule); + handleAdministratorsPolicyRule($config, $rule); } else if ($rule_type == 'PhabricatorLegalpadSignaturePolicyRule') { $policy_config_user_names = - handleLegalpadSignaturePolicyRule($system_keys, $rule); + handleLegalpadSignaturePolicyRule($config, $rule); } $config_user_names = array_merge(