Added loading of owner from repository config file (gitweb.config).
Added loading of owner from repository config file (gitweb.config).

Signed-off-by: Chris Han <xiphux@gmail.com>

--- a/include/git/GitExe.class.php
+++ b/include/git/GitExe.class.php
@@ -24,6 +24,7 @@
 define('GIT_BLAME','blame');
 define('GIT_NAME_REV','name-rev');
 define('GIT_FOR_EACH_REF','for-each-ref');
+define('GIT_CONFIG','config');
 
 /**
  * Git Executable class

--- a/include/git/Project.class.php
+++ b/include/git/Project.class.php
@@ -267,6 +267,15 @@
 				} elseif (isset($data['name']) && !empty($data['name'])) {
 					$this->owner = $data['name'];
 				}
+			}
+			else {
+				$exe = new GitPHP_GitExe($this);
+				$args = array();
+				$args[] = 'gitweb.owner';
+				$ret = $exe->Execute(GIT_CONFIG, $args);
+				unset($exe);
+				
+				$this->owner = $ret;
 			}
 			$this->readOwner = true;
 		}

--- a/templates/project.tpl
+++ b/templates/project.tpl
@@ -17,7 +17,7 @@
  {* Project brief *}
  <table cellspacing="0">
    <tr><td>{t}description{/t}</td><td>{$project->GetDescription()}</td></tr>
-   <tr><td>{t}owner{/t}</td><td>{$project->GetOwner()}</td></tr>
+   <tr><td>{t}owner{/t}</td><td>{$project->GetOwner()|escape:'html'}</td></tr>
    {if $head}
    <tr><td>{t}last change{/t}</td><td>{$head->GetCommitterEpoch()|date_format:"%a, %d %b %Y %H:%M:%S %z"}</td></tr>
    {/if}

--- a/templates/projectlist.tpl
+++ b/templates/projectlist.tpl
@@ -71,7 +71,7 @@
         <a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&amp;a=summary" class="list {if $currentcategory != ''}indent{/if}">{$proj->GetProject()}</a>
       </td>
       <td class="projectDescription"><a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&amp;a=summary" class="list">{$proj->GetDescription()}</a></td>
-      <td class="projectOwner"><em>{$proj->GetOwner()}</em></td>
+      <td class="projectOwner"><em>{$proj->GetOwner()|escape:'html'}</em></td>
       {assign var=projecthead value=$proj->GetHeadCommit()}
       <td class="projectAge">
         {if $projecthead}

comments