This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, master has been updated
via 58186b33ac50c7c4c9cb33e0f8f1c62a55e0f08c (commit)
from 18c52f355861fb8fca9d373de3ec3177a6e98277 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=58186b33ac50c7c4c9cb33e0f8f1c62a55e0f08c
commit 58186b33ac50c7c4c9cb33e0f8f1c62a55e0f08c
Author: Franck Villaume <[email protected]>
Date: Fri Sep 16 19:29:15 2016 +0200
remove dead code
diff --git a/src/common/include/Group.class.php
b/src/common/include/Group.class.php
index 456b23f..b9c6860 100644
--- a/src/common/include/Group.class.php
+++ b/src/common/include/Group.class.php
@@ -457,7 +457,7 @@ class Group extends FFError {
* This function require site admin privilege.
*
* @param object $user User requesting operation (for
access control).
- * @param int $type_id Group type (1-project,
2-foundry).
+ * @param int $type_id Group type. Obsolete parameter
NOT USED.
* @param string $unix_box Machine on which group's home
directory located.
* @param string $http_domain Domain which serves group's WWW.
* @return bool status.
@@ -480,10 +480,9 @@ class Group extends FFError {
$res = db_query_params('
UPDATE groups
- SET type_id=$1, unix_box=$2, http_domain=$3
- WHERE group_id=$4',
- array($type_id,
- $unix_box,
+ SET unix_box=$1, http_domain=$2
+ WHERE group_id=$3',
+ array($unix_box,
$http_domain,
$this->getID()));
@@ -494,9 +493,6 @@ class Group extends FFError {
}
// Log the audit trail
- if ($type_id != $this->data_array['type_id']) {
- $this->addHistory('type_id',
$this->data_array['type_id']);
- }
if ($unix_box != $this->data_array['unix_box']) {
$this->addHistory('unix_box',
$this->data_array['unix_box']);
}
@@ -718,12 +714,12 @@ class Group extends FFError {
}
/**
- * getType() - Foundry, project, etc.
+ * getType() - project, etc. // OBSOLETE. Always return 1.
*
* @return int The type flag from the database.
*/
function getType() {
- return $this->data_array['type_id'];
+ return 1;
}
@@ -835,16 +831,12 @@ class Group extends FFError {
}
/**
- * isProject - Simple boolean test to see if it's a project or not.
+ * isProject - Simple boolean test to see if it's a project or not.
//OBSOLETE: always return true
*
* @return bool is_project.
*/
function isProject() {
- if ($this->getType()==1) {
- return true;
- } else {
- return false;
- }
+ return true;
}
/**
diff --git a/src/common/include/logger.php b/src/common/include/logger.php
index c64a647..0dcfa81 100644
--- a/src/common/include/logger.php
+++ b/src/common/include/logger.php
@@ -40,11 +40,10 @@ if (isset($group_id) && is_numeric($group_id) && $group_id)
{
}
} else {
//
- // This is a hack to allow the logger to have a group_id present
- // for foundry and project summary pages
+ // This is a hack to allow the logger to have a group_id present
for project summary pages
//
$expl_pathinfo = explode('/', getStringFromServer('REQUEST_URI'));
- if (($expl_pathinfo[1]=='foundry') || ($expl_pathinfo[1]=='projects')) {
+ if ($expl_pathinfo[1] == 'projects') {
$group_name = $expl_pathinfo[2];
if ($group_name) {
$res_grp = db_query_params ('
@@ -53,8 +52,7 @@ if (isset($group_id) && is_numeric($group_id) && $group_id) {
WHERE unix_group_name=$1
AND status IN ($2,$3)',
array ($group_name,
- 'A',
- 'H'));
+ 'A', 'H', 'P'));
// store subpage id for analyzing later
// This will later be used in the www/projects for
instance
@@ -67,7 +65,6 @@ if (isset($group_id) && is_numeric($group_id) && $group_id) {
//set up the group_id
$group_id=db_result($res_grp,0,'group_id');
- //set up a foundry object for reference all over the
place
if ($group_id) {
$grp = group_get_object($group_id,$res_grp);
if ($grp) {
@@ -107,7 +104,6 @@ if (isset($group_id) && is_numeric($group_id) && $group_id)
{
//set up the group_id
$group_id=db_result($res_grp,0,'group_id');
- //set up a foundry object for reference all over the place
if ($group_id) {
$grp = group_get_object($group_id,$res_grp);
if ($grp) {
diff --git a/src/plugins/globalsearch/www/index.php
b/src/plugins/globalsearch/www/index.php
index 0ccd53a..ed09b07 100644
--- a/src/plugins/globalsearch/www/index.php
+++ b/src/plugins/globalsearch/www/index.php
@@ -166,12 +166,6 @@ if (!$result || $rows < 1) {
echo $GLOBALS['HTML']->listTableTop($title_arr);
for ( $i = 0; $i < $rows; $i++ ) {
- if (db_result($result, $i, 'type') == 2) {
- $what = 'foundry';
- } else {
- $what = 'projects';
- }
-
print "<tr ". $HTML->boxGetAltRowStyle($i)."><td><a
href=\""
. db_result($result, $i, 'project_link')."\"
target=\"blank\">"
. html_image("ic/msg.png", 10, 12)." "
diff --git a/src/www/include/html.php b/src/www/include/html.php
index 11f43d9..46cb1f9 100644
--- a/src/www/include/html.php
+++ b/src/www/include/html.php
@@ -1041,13 +1041,10 @@ function site_footer($params = array()) {
* @param params array() must contain $toptab and $group
*/
function site_project_header($params) {
-
/*
Check to see if active
- Check to see if project rather than foundry
Check to see if private (if private check if user_ismember)
*/
-
$group_id = $params['group'];
//get the project object
@@ -1058,15 +1055,16 @@ function site_project_header($params) {
} elseif ($project->isError()) {
if ($project->isPermissionDeniedError()) {
if (!session_get_user()) {
- $next =
'/account/login.php?error_msg='.urlencode($project->getErrorMessage());
+ $error_msg = $project->getErrorMessage();
+ $next = '/account/login.php');
if (getStringFromServer('REQUEST_METHOD') !=
'POST') {
$next .=
'&return_to='.urlencode(getStringFromServer('REQUEST_URI'));
}
session_redirect($next);
} else
- exit_error(sprintf(_('Project access problem:
%s'), $project->getErrorMessage()), 'home');
+ exit_error(_('Project access problem')._(':
').$project->getErrorMessage(), 'home');
}
- exit_error(sprintf(_('Project Problem: %s'),
$project->getErrorMessage()), 'home');
+ exit_error(_('Project Problem')._(':
').$project->getErrorMessage(), 'home');
}
// Check permissions in case of restricted access
diff --git a/src/www/news/news_utils.php b/src/www/news/news_utils.php
index ff2aeea..4649031 100644
--- a/src/www/news/news_utils.php
+++ b/src/www/news/news_utils.php
@@ -226,53 +226,6 @@ ORDER BY post_date DESC',
return $return;
}
-function news_foundry_latest($group_id=0,$limit=5,$show_summaries=true) {
- /*
- Show a the latest news for a portal
- */
-
- $result=db_query_params("SELECT
groups.group_name,groups.unix_group_name,groups.group_id,
- users.user_name,users.realname,news_bytes.forum_id,
- news_bytes.summary,news_bytes.post_date,news_bytes.details
- FROM users,news_bytes,groups,foundry_news
- WHERE foundry_news.foundry_id=$1
- AND users.user_id=news_bytes.submitted_by
- AND foundry_news.news_id=news_bytes.id
- AND news_bytes.group_id=groups.group_id
- AND foundry_news.is_approved=1
- ORDER BY news_bytes.post_date DESC", array($group_id),$limit);
-
- $rows=db_numrows($result);
-
- if (!$result || $rows < 1) {
- $return .= '<h3>' . _('No News Found') . '</h3>';
- $return .= db_error();
- } else {
- for ($i=0; $i<$rows; $i++) {
- if ($show_summaries) {
- //get the first paragraph of the story
-
$arr=explode("\n",db_result($result,$i,'details'));
- if
((isset($arr[1]))&&(isset($arr[2]))&&(strlen($arr[0]) < 200) &&
(strlen($arr[1].$arr[2]) < 300) && (strlen($arr[2]) > 5)) {
- $summ_txt=util_make_links( $arr[0].'<br
/>'.$arr[1].'<br />'.$arr[2] );
- } else {
- $summ_txt=util_make_links( $arr[0] );
- }
-
- //show the project name
- $proj_name=' - '.util_make_link_g
(strtolower(db_result($result,$i,'unix_group_name')),db_result($result,$i,'group_id'),db_result($result,$i,'group_name'));
- } else {
- $proj_name='';
- $summ_txt='';
- }
- $return .= util_make_link
('/forum/forum.php?forum_id='. db_result($result,$i,'forum_id'),'<strong>'.
db_result($result,$i,'summary') . '</strong>')
- .'<br /><em>'. db_result($result,$i,'realname')
.' - '.
- date(_('Y-m-d
H:i'),db_result($result,$i,'post_date')) . $proj_name . '</em>
- '. $summ_txt .'';
- }
- }
- return $return;
-}
-
function get_news_name($id) {
/*
Takes an ID and returns the corresponding forum name
diff --git
a/src/www/search/include/renderers/ProjectHtmlSearchRenderer.class.php
b/src/www/search/include/renderers/ProjectHtmlSearchRenderer.class.php
index ef5b4c9..93f19c7 100644
--- a/src/www/search/include/renderers/ProjectHtmlSearchRenderer.class.php
+++ b/src/www/search/include/renderers/ProjectHtmlSearchRenderer.class.php
@@ -66,13 +66,8 @@ class ProjectHtmlSearchRenderer extends HtmlSearchRenderer {
foreach ($result as $row) {
$i++;
- if ($row['type_id'] == 2) {
- $what = 'foundry';
- } else {
- $what = 'projects';
- }
$return .= '<tr
'.$GLOBALS['HTML']->boxGetAltRowStyle($i).'>'
- .'<td style="width: 30%"><a
href="'.util_make_url('/'.$what.'/'.$row['unix_group_name'].'/').'">'
+ .'<td style="width: 30%"><a
href="'.util_make_url('/projects/'.$row['unix_group_name'].'/').'">'
.html_image('ic/msg.png', 10, 12)
.'
'.$this->highlightTargetWords($row['group_name']).'</a></td>'
.'<td style="width:
70%">'.$this->highlightTargetWords($row['short_description']).'</td></tr>';
@@ -92,21 +87,15 @@ class ProjectHtmlSearchRenderer extends HtmlSearchRenderer {
$project_name = str_replace('<b>', '', $project_name);
$project_name = str_replace('</b>', '', $project_name);
- if ($result['type_id'] == 2) {
- session_redirect('/foundry/'.$project_name.'/');
+ if (forge_check_perm('project_read', $project_id)) {
+ header('Location:
'.util_make_url_g($project_name,$project_id));
} else {
- if (forge_check_perm ('project_read', $project_id)) {
- header('Location:
'.util_make_url_g($project_name,$project_id));
- } else {
- $this->writeHeader();
-
- $html = '<h2>'.sprintf(_('Search results for
“%s”'), $project_name).'</h2>';
- $html .= '<p><strong>'.sprintf(_('No matches
found for “%s”'), $project_name).'</strong></p>';
- echo $html;
- $this->writeFooter();
- }
+ $this->writeHeader();
+ $html = '<h2>'.sprintf(_('Search results for “%s”'),
$project_name).'</h2>';
+ $html .= '<p><strong>'.sprintf(_('No matches found for
“%s”'), $project_name).'</strong></p>';
+ echo $html;
+ $this->writeFooter();
}
exit();
}
-
}
-----------------------------------------------------------------------
Summary of changes:
src/common/include/Group.class.php | 24 ++++-------
src/common/include/logger.php | 10 ++---
src/plugins/globalsearch/www/index.php | 6 ---
src/www/include/html.php | 10 ++---
src/www/news/news_utils.php | 47 ----------------------
.../renderers/ProjectHtmlSearchRenderer.class.php | 27 ++++---------
6 files changed, 23 insertions(+), 101 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits