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 e27b2c6bd63473041c5f54f2e1c1039065a0b678 (commit) from 82cdedcf23772febb246593c25629eea4356fe36 (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=e27b2c6bd63473041c5f54f2e1c1039065a0b678 commit e27b2c6bd63473041c5f54f2e1c1039065a0b678 Author: Franck Villaume <franck.villa...@trivialdev.com> Date: Fri May 14 20:08:22 2021 +0200 clean-up: curly braces diff --git a/src/common/include/SCMPlugin.class.php b/src/common/include/SCMPlugin.class.php index f056b98..1932aa8 100644 --- a/src/common/include/SCMPlugin.class.php +++ b/src/common/include/SCMPlugin.class.php @@ -339,6 +339,8 @@ abstract class SCMPlugin extends Plugin { return false; } elseif ($project->isError()) { return false; + } elseif ($project->isActive()) { + return false; } elseif (!$project->usesSCM()) { return false; } elseif (!$project->usesPlugin($this->name)) { diff --git a/src/common/tracker/actions/format_csv.php b/src/common/tracker/actions/format_csv.php index e45e146..2d478a2 100644 --- a/src/common/tracker/actions/format_csv.php +++ b/src/common/tracker/actions/format_csv.php @@ -73,11 +73,11 @@ $sep = getStringFromRequest('sep', ','); <?php echo _('Separator')._(':'); ?> </td> <td> - <input type="radio" id="comma" name="sep" value=","<?php if ($sep==',') echo ' checked="checked"' ?> /> + <input type="radio" id="comma" name="sep" value=","<?php if ($sep==',') { echo ' checked="checked"' } ?> /> <label for="comma"> <?php echo _('Comma (char: “,”)'); ?><br /> </label> - <input type="radio" id="semi-colon" name="sep" value=";"<?php if ($sep==';') echo ' checked="checked"' ?> /> + <input type="radio" id="semi-colon" name="sep" value=";"<?php if ($sep==';') { echo ' checked="checked"' } ?> /> <label for="semi-colon"> <?php echo _('Semi-colon (char: “;”)'); ?> </label> @@ -88,11 +88,11 @@ $sep = getStringFromRequest('sep', ','); <?php echo _('Header')._(':'); ?> </td> <td> - <input type="radio" id="included" name="headers" value="1"<?php if ($headers) echo ' checked="checked"' ?> /> + <input type="radio" id="included" name="headers" value="1"<?php if ($headers) { echo ' checked="checked"' } ?> /> <label for="included"> <?php echo _('Included'); ?><br /> </label> - <input type="radio" id="none" name="headers" value="0"<?php if (!$headers) echo ' checked="checked"' ?> /> + <input type="radio" id="none" name="headers" value="0"<?php if (!$headers) echo {' checked="checked"' } ?> /> <label for="none"> <?php echo _('None'); ?> </label> @@ -103,19 +103,19 @@ $sep = getStringFromRequest('sep', ','); <?php echo _('Encoding')._(':'); ?> </td> <td> - <input type="radio" id="utf8" name="encoding" value="UTF-8"<?php if ($encoding == 'UTF-8') echo ' checked="checked"' ?> /> + <input type="radio" id="utf8" name="encoding" value="UTF-8"<?php if ($encoding == 'UTF-8') { echo ' checked="checked"' } ?> /> <label for="utf8"> <?php echo _('UTF-8'); ?><br /> </label> - <input type="radio" id="utf16be" name="encoding" value="UTF-16BE"<?php if ($encoding == 'UTF-16BE') echo ' checked="checked"' ?> /> + <input type="radio" id="utf16be" name="encoding" value="UTF-16BE"<?php if ($encoding == 'UTF-16BE') { echo ' checked="checked"' } ?> /> <label for="utf16be"> <?php echo _('UTF-16BE'); ?><br /> </label> - <input type="radio" id="utf16le" name="encoding" value="UTF-16LE"<?php if ($encoding == 'UTF-16LE') echo ' checked="checked"' ?> /> + <input type="radio" id="utf16le" name="encoding" value="UTF-16LE"<?php if ($encoding == 'UTF-16LE') { echo ' checked="checked"' } ?> /> <label for="utf16le"> <?php echo _('UTF-16LE'); ?><br /> </label> - <input type="radio" id="1252" name="encoding" value="Windows-1252"<?php if ($encoding == 'Windows-1252') echo ' checked="checked"' ?> /> + <input type="radio" id="1252" name="encoding" value="Windows-1252"<?php if ($encoding == 'Windows-1252') { echo ' checked="checked"' } ?> /> <label for="1252"> <?php echo _('Windows-1252'); ?><br /> </label> @@ -125,7 +125,7 @@ $sep = getStringFromRequest('sep', ','); <td> </td> <td> - <input type="checkbox" id="bom" name="bom" value="1"<?php if ($bom) echo ' checked="checked"' ?> /> + <input type="checkbox" id="bom" name="bom" value="1"<?php if ($bom) { echo ' checked="checked"' } ?> /> <label for="bom"> <?php echo _('Byte order mark'); ?><br /> </label> diff --git a/src/plugins/blocks/www/index.php b/src/plugins/blocks/www/index.php index 4f3afcd..a91342c 100644 --- a/src/plugins/blocks/www/index.php +++ b/src/plugins/blocks/www/index.php @@ -238,21 +238,21 @@ if ($type == 'admin') { } foreach ($blocks as $b => $help) { - if (!$activate[$b]) { $activate[$b] = 0; } if ((!isset($status[$b]) && $activate[$b]) || - (isset($status[$b]) && $activate[$b] !== $status[$b])) + (isset($status[$b]) && $activate[$b] !== $status[$b])) { // Must be updated. if (!isset($present[$b])) { - db_query_params('INSERT INTO plugin_blocks (group_id, name, status) - VALUES ($1, $2, $3)', - array($id, $b, $activate[$b])); - } else { - db_query_params('UPDATE plugin_blocks SET status=$1 - WHERE group_id=$2 AND name=$3', - array($activate[$b], $id, $b)); + db_query_params('INSERT INTO plugin_blocks (group_id, name, status) + VALUES ($1, $2, $3)', + array($id, $b, $activate[$b])); + } else { + db_query_params('UPDATE plugin_blocks SET status=$1 + WHERE group_id=$2 AND name=$3', + array($activate[$b], $id, $b)); + } } } $feedback = _('Block Saved'); @@ -301,9 +301,7 @@ if ($type == 'admin') { plugin_hook_by_reference("text_editor", $params); echo $params['content']; - print "<br /><input type=\"submit\" value=\"" . - _("Save") . - "\" />"; + print '<br /><input type="submit" value="'._("Save").'" />'; echo $HTML->closeForm(); print "</div>"; diff --git a/src/plugins/ckeditor/common/ckeditorPlugin.class.php b/src/plugins/ckeditor/common/ckeditorPlugin.class.php index dbd32d5..6c704b4 100644 --- a/src/plugins/ckeditor/common/ckeditorPlugin.class.php +++ b/src/plugins/ckeditor/common/ckeditorPlugin.class.php @@ -117,8 +117,12 @@ _("CKEditor is a WYSIWYG text editor that displays within a web browser."); $this->setError(_("Unable to activate ckeditor plugin, package ckeditor not found.")); return false; } - if (isset($params['width'])) $editor->config['width'] = $params['width']; - if (isset($params['height'])) $editor->config['height'] = $params['height']; + if (isset($params['width'])) { + $editor->config['width'] = $params['width']; + } + if (isset($params['height'])) { + $editor->config['height'] = $params['height']; + } if (isset($params['toolbar']) && array_key_exists(strtolower($params['toolbar']), $this->toolBar)) { $editor->config['toolbar'] = $this->toolBar[strtolower($params['toolbar'])]; } else { diff --git a/src/plugins/extsubproj/include/extsubprojPlugin.class.php b/src/plugins/extsubproj/include/extsubprojPlugin.class.php index c88b2fe..fa97d59 100644 --- a/src/plugins/extsubproj/include/extsubprojPlugin.class.php +++ b/src/plugins/extsubproj/include/extsubprojPlugin.class.php @@ -166,7 +166,7 @@ control over it to the project's administrator."); * @access public */ function getGlobalAdminView() { - global $gfplugins, $use_tooltips; + global $gfplugins; include $gfplugins.$this->name.'/view/admin/viewGlobalConfiguration.php'; return true; } @@ -176,7 +176,7 @@ control over it to the project's administrator."); * @return boolean */ function getProjectAdminView() { - global $gfplugins, $use_tooltips; + global $gfplugins; include $gfplugins.$this->name.'/view/admin/viewProjectConfiguration.php'; return true; } diff --git a/src/plugins/extsubproj/view/admin/viewProjectConfiguration.php b/src/plugins/extsubproj/view/admin/viewProjectConfiguration.php index 1d3979a..b3c417e 100644 --- a/src/plugins/extsubproj/view/admin/viewProjectConfiguration.php +++ b/src/plugins/extsubproj/view/admin/viewProjectConfiguration.php @@ -52,8 +52,9 @@ echo '<form method="post" action="'.$pluginExtSubProj->getProjectAdminAddExtSubP echo '<table>'; echo '<tr><td><label id="extSubProj-newsubprojecturl" '; -if ($use_tooltips) +if ($use_tooltips) { echo 'title="'._('URL of the new subproject.').'"'; +} echo ' >'._('URL').'</label></td><td><input type="text" name="newsubprojecturl"'; echo '/></td></tr>'; diff --git a/src/plugins/gravatar/common/gravatarPlugin.class.php b/src/plugins/gravatar/common/gravatarPlugin.class.php index 6ffc5e2..79c96ed 100644 --- a/src/plugins/gravatar/common/gravatarPlugin.class.php +++ b/src/plugins/gravatar/common/gravatarPlugin.class.php @@ -55,22 +55,24 @@ FusionForge user to have its gravatar icon displayed."); private function getHtml($user_id, $size) { if ($email = $this->getEmail($user_id)) { - $hash = md5( strtolower( trim( $email ) ) ); + $hash = md5(strtolower(trim($email))); $url = 'http://www.gravatar.com/avatar/'; - if (isset($_SERVER['HTTPS'])) + if (isset($_SERVER['HTTPS'])) { $url = 'https://secure.gravatar.com/avatar/'; + } - $image_size = 28; - - if ($size == 'l') + if ($size == 'l') { $image_size = 130; - if ($size == 'm') + } elseif ($size == 'm') { $image_size = 48; - if ($size == 's') + } elseif ($size == 's') { $image_size = 28; - if ($size == 'xs') + } elseif ($size == 'xs') { $image_size = 16; + } else { + $image_size = 28; + } $url .= $hash.'?s='. $image_size; $class = 'img-shadow-'.$size; diff --git a/src/plugins/headermenu/action/validateOrder.php b/src/plugins/headermenu/action/validateOrder.php index cf1610b..0c505e2 100644 --- a/src/plugins/headermenu/action/validateOrder.php +++ b/src/plugins/headermenu/action/validateOrder.php @@ -32,8 +32,9 @@ $returnValue['html'] = $HTML->error_msg(_('Error in Link Order validation')); if ($linksOrder && strlen($linksOrder)) { $linksOrderArr = explode(',', $linksOrder); - if ($headermenu->setLinksOrder($linksOrderArr)) + if ($headermenu->setLinksOrder($linksOrderArr)) { $returnValue['html'] = $HTML->feedback(_('Link Order successfully validated')); + } } echo json_encode($returnValue); exit; diff --git a/src/plugins/headermenu/common/headermenuPlugin.class.php b/src/plugins/headermenu/common/headermenuPlugin.class.php index bc2b0b1..1d79335 100644 --- a/src/plugins/headermenu/common/headermenuPlugin.class.php +++ b/src/plugins/headermenu/common/headermenuPlugin.class.php @@ -24,8 +24,6 @@ class headermenuPlugin extends Plugin { - var $pageid; - function __construct() { parent::__construct(); $this->name = 'headermenu'; @@ -206,7 +204,7 @@ in the main menu (outermenu) or in the project menu (groupmenu)."); * getAvailableLinks - get all the links from the db of certain kind * * @param string $linkmenu the type of menu links search in db - * @param int $project the group_id. Default is 0 meaning : forge level + * @param int $project the group_id. Default is 0 meaning : forge level * @return array the available links */ function getAvailableLinks($linkmenu, $project = 0) { @@ -238,8 +236,9 @@ in the main menu (outermenu) or in the project menu (groupmenu)."); function setLinksOrder($linksOrder) { for ($i =0; $i < count($linksOrder); $i++) { $res = db_query_params('update plugin_headermenu set ordering = $1 where id_headermenu = $2', array($i, $linksOrder[$i])); - if (!$res) + if (!$res) { return false; + } } return true; } @@ -281,16 +280,16 @@ in the main menu (outermenu) or in the project menu (groupmenu)."); $htmlcode, $ordering )); - if (!$res) + if (!$res) { return false; - + } return true; } /** * deleteLink - delete a link * - * @param int $idLink the link id + * @param int $idLink the link id * @return bool success or not */ function deleteLink($idLink) { @@ -304,8 +303,8 @@ in the main menu (outermenu) or in the project menu (groupmenu)."); /** * updateLinkStatus - update the link status * - * @param int $idLink the link id - * @param int $linkStatus the new status of the link id + * @param int $idLink the link id + * @param int $linkStatus the new status of the link id * @return bool success or not */ function updateLinkStatus($idLink, $linkStatus) { @@ -319,7 +318,7 @@ in the main menu (outermenu) or in the project menu (groupmenu)."); /** * getLink - get all informations about a link * - * @param int $idLink the link id + * @param int $idLink the link id * @return array the link informations */ function getLink($idLink) { @@ -333,12 +332,12 @@ in the main menu (outermenu) or in the project menu (groupmenu)."); /** * updateLink - update a valid link * - * @param int $idLink the link id to be updated - * @param string $url the url - * @param string $name the displayed name - * @param string $description a short description (to help administration) - * @param string $linkmenu linkmenu entry : headermenu or outermenu - * @param string $linktype : url or htmlcode, default is url + * @param int $idLink the link id to be updated + * @param string $url the url + * @param string $name the displayed name + * @param string $description a short description (to help administration) + * @param string $linkmenu linkmenu entry : headermenu or outermenu + * @param string $linktype url or htmlcode, default is url * @param string $htmlcode * @return bool success or not */ @@ -393,7 +392,7 @@ in the main menu (outermenu) or in the project menu (groupmenu)."); /** * getHeader - initialize header and js * - * @param string $type : user, project, globaladmin (aka group) + * @param string $type user, project, globaladmin (aka group) * @return bool success or not */ function getHeader($type) { diff --git a/src/plugins/headermenu/www/index.php b/src/plugins/headermenu/www/index.php index 8fd496d..5edff7f 100644 --- a/src/plugins/headermenu/www/index.php +++ b/src/plugins/headermenu/www/index.php @@ -30,7 +30,6 @@ if (!$type) { exit_missing_param($_SERVER['HTTP_REFERER'], array('No TYPE specified'), 'headermenu'); } -global $use_tooltips; $headermenu = plugin_get_object('headermenu'); switch ($type) { diff --git a/src/plugins/mantisbt/action/addAttachment.php b/src/plugins/mantisbt/action/addAttachment.php index 3c55833..990e5c5 100644 --- a/src/plugins/mantisbt/action/addAttachment.php +++ b/src/plugins/mantisbt/action/addAttachment.php @@ -30,9 +30,9 @@ global $group_id; global $idBug; try { - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url'].'/api/soap/mantisconnect.php?wsdl', array('trace' => true, 'exceptions' => true)); - + } $clientSOAP->__soapCall('mc_issue_attachment_add', array('username' => $username, 'password' => $password, 'issue_id' => $idBug, 'name' => $_FILES['attachment']['name'], 'file_type' => $_FILES['attachment']['type'], 'content' => file_get_contents($_FILES['attachment']['tmp_name']))); $feedback = _('Task succeeded.'); } catch (SoapFault $soapFault) { diff --git a/src/plugins/mantisbt/action/addVersion.php b/src/plugins/mantisbt/action/addVersion.php index 990f210..6e523e5 100644 --- a/src/plugins/mantisbt/action/addVersion.php +++ b/src/plugins/mantisbt/action/addVersion.php @@ -38,9 +38,9 @@ if (!empty($version)) { $versionStruct['description'] = getStringFromRequest('description'); $versionStruct['date_order'] = ''; try { - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true)); - + } $clientSOAP->__soapCall('mc_project_version_add', array("username" => $username, "password" => $password, "version" => $versionStruct)); // currently transverse is not implemented... need to rely on projects-hierarchy plugin. // if (isset($_POST['transverse'])) { diff --git a/src/plugins/mantisbt/action/deleteNote.php b/src/plugins/mantisbt/action/deleteNote.php index bcdf303..7cee44e 100644 --- a/src/plugins/mantisbt/action/deleteNote.php +++ b/src/plugins/mantisbt/action/deleteNote.php @@ -28,9 +28,9 @@ global $password; global $group_id; try { - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true)); - + } $clientSOAP->__soapCall('mc_issue_note_delete', array("username" => $username, "password" => $password, "issue_note_id" => $idNote)); } catch (SoapFault $soapFault) { $error_msg = _('Task failed')._(': ').$soapFault->faultstring; diff --git a/src/plugins/mantisbt/action/deleteVersion.php b/src/plugins/mantisbt/action/deleteVersion.php index eacffc8..64366fc 100644 --- a/src/plugins/mantisbt/action/deleteVersion.php +++ b/src/plugins/mantisbt/action/deleteVersion.php @@ -34,9 +34,9 @@ $deleteVersion = getIntFromRequest('deleteVersion'); if (!empty($deleteVersion)) { try { - if(!isset($clientSOAP)) + if(!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true)); - + } $clientSOAP->__soapCall('mc_project_version_delete', array("username" => $username, "password" => $password, "version_id" => $deleteVersion)); } catch (SoapFault $soapFault) { $error_msg = _('Task failed')._(': ').$soapFault->faultstring; diff --git a/src/plugins/mantisbt/common/MantisBTPlugin.class.php b/src/plugins/mantisbt/common/MantisBTPlugin.class.php index 2ce1e41..d18577d 100644 --- a/src/plugins/mantisbt/common/MantisBTPlugin.class.php +++ b/src/plugins/mantisbt/common/MantisBTPlugin.class.php @@ -298,12 +298,12 @@ _('Use Mantis Bugtracker as another ticket management tool.'); function isProjectMantisCreated($idProjet){ $resIdProjetMantis = db_query_params('SELECT id_mantisbt FROM plugin_mantisbt WHERE id_group = $1', array($idProjet)); - if (!$resIdProjetMantis) + if (!$resIdProjetMantis) { return false; - + } if (db_numrows($resIdProjetMantis) > 0) { return true; - }else{ + } else { return false; } } @@ -520,9 +520,9 @@ _('Use Mantis Bugtracker as another ticket management tool.'); function updateConf($group_id, $confArr) { $result = db_query_params('update plugin_mantisbt set url = $1 , soap_user = $2, soap_password = $3, use_global = $4 where id_group = $5', array($confArr['url'], $confArr['soap_user'], $confArr['soap_password'], $confArr['global_conf'], $group_id)); - if (!$result) + if (!$result) { return false; - + } return true; } @@ -542,9 +542,9 @@ _('Use Mantis Bugtracker as another ticket management tool.'); } $result = db_query_params('update plugin_mantisbt_users set mantisbt_user = $1 , mantisbt_password = $2 where id_user = $3 and mantisbt_url = $4', array($confArr['mantisbt_user'], $confArr['mantisbt_password'], user_getid(), $confArr['mantisbt_url'])); - if (!$result) + if (!$result) { return false; - + } return true; } @@ -557,9 +557,9 @@ _('Use Mantis Bugtracker as another ticket management tool.'); function deleteUserConf($url) { $result = db_query_params('delete from plugin_mantisbt_users where id_user = $1 and mantisbt_url = $2', array(user_getid(), $url)); - if (!$result) + if (!$result) { return false; - + } return true; } @@ -655,9 +655,9 @@ _('Use Mantis Bugtracker as another ticket management tool.'); } try { - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($confArr['url'].'/api/soap/mantisconnect.php?wsdl', array('trace' => true, 'exceptions' => true)); - + } $account = $clientSOAP->__soapCall('mc_login', array('username' => $confArr['soap_user'], 'password' => $confArr['soap_password'])); } catch (SoapFault $soapFault) { $this->setError($soapFault->faultstring); diff --git a/src/plugins/mantisbt/controler/filter.php b/src/plugins/mantisbt/controler/filter.php index 643e4e4..ac60b8b 100644 --- a/src/plugins/mantisbt/controler/filter.php +++ b/src/plugins/mantisbt/controler/filter.php @@ -98,11 +98,13 @@ if (!isset($errorPage)) { foreach ($mantisbtMembersChild as $key => $mantisbtMemberChild) { $found = 0; foreach ($mantisbtMembers as $key => $mantisbtMember) { - if ( $mantisbtMemberChild->id == $mantisbtMember->id ) + if ( $mantisbtMemberChild->id == $mantisbtMember->id ) { $found = 1; + } } - if (!$found) + if (!$found) { $mantisbtMembers[] = $mantisbtMemberChild; + } } $resultGroupNameFusionForge = db_query_params('select groups.group_name from groups,plugin_mantisbt where groups.group_id = plugin_mantisbt.id_group and plugin_mantisbt.id_mantisbt = $1', array($child)); diff --git a/src/plugins/mantisbt/controler/filter_roadmap.php b/src/plugins/mantisbt/controler/filter_roadmap.php index d858ba3..3d0c403 100644 --- a/src/plugins/mantisbt/controler/filter_roadmap.php +++ b/src/plugins/mantisbt/controler/filter_roadmap.php @@ -31,9 +31,9 @@ global $HTML; try { /* do not recreate $clientSOAP object if already created by other pages */ - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true)); - + } $listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt'])); } catch (SoapFault $soapFault) { @@ -68,8 +68,8 @@ if (!isset($errorPage)) { } if ( sizeof($listChild)) { - // nous avons deja un bloc - $nbblock = 1; + // nous avons deja un bloc + $nbblock = 1; foreach ($listChild as $key => $child) { $listChildVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $child)); if (sizeof($listChildVersions)) { diff --git a/src/plugins/mantisbt/view/addIssue.php b/src/plugins/mantisbt/view/addIssue.php index 8cbaddb..3fd070c 100644 --- a/src/plugins/mantisbt/view/addIssue.php +++ b/src/plugins/mantisbt/view/addIssue.php @@ -32,9 +32,9 @@ global $HTML; try { /* do not recreate $clientSOAP object if already created by other pages */ - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url'].'/api/soap/mantisconnect.php?wsdl', array('trace' => true, 'exceptions' => true)); - + } $listCategories = $clientSOAP->__soapCall('mc_project_get_categories', array('username' => $username, 'password' => $password, 'project_id' => $mantisbtConf['id_mantisbt'])); $listSeverities = $clientSOAP->__soapCall('mc_enum_severities', array('username' => $username, 'password' => $password)); $listReproducibilities = $clientSOAP->__soapCall('mc_enum_reproducibilities', array('username' => $username, 'password' => $password)); diff --git a/src/plugins/mantisbt/view/addOrEditNote.php b/src/plugins/mantisbt/view/addOrEditNote.php index be567e3..986a8da 100644 --- a/src/plugins/mantisbt/view/addOrEditNote.php +++ b/src/plugins/mantisbt/view/addOrEditNote.php @@ -32,9 +32,9 @@ global $HTML; $noteEdit; try { /* do not recreate $clientSOAP object if already created by other pages */ - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url'].'/api/soap/mantisconnect.php?wsdl', array('trace' => true, 'exceptions' => true)); - + } $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug)); if ($view == 'editNote'){ foreach($defect->notes as $key => $note){ diff --git a/src/plugins/mantisbt/view/admin/StatPerStatus.php b/src/plugins/mantisbt/view/admin/StatPerStatus.php index 2fbb9a7..a3cb423 100644 --- a/src/plugins/mantisbt/view/admin/StatPerStatus.php +++ b/src/plugins/mantisbt/view/admin/StatPerStatus.php @@ -32,9 +32,9 @@ global $password; try { /* do not recreate $clientSOAP object if already created by other pages */ - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true)); - + } $stats = $clientSOAP->__soapCall('mc_project_get_statistiques', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt'], "level" => 0)); } catch (SoapFault $soapFault) { echo $HTML->warning_msg(_('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring); diff --git a/src/plugins/mantisbt/view/admin/editVersion.php b/src/plugins/mantisbt/view/admin/editVersion.php index f1cae02..048233c 100644 --- a/src/plugins/mantisbt/view/admin/editVersion.php +++ b/src/plugins/mantisbt/view/admin/editVersion.php @@ -33,9 +33,9 @@ global $group; $idVersion=getIntFromRequest('idVersion'); try { - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url'].'/api/soap/mantisconnect.php?wsdl', array('trace' => true, 'exceptions' => true)); - + } $arrVersions = $clientSOAP->__soapCall('mc_project_get_versions', array('username' => $username, 'password' => $password, 'project_id' => $mantisbtConf['id_mantisbt'])); } catch (SoapFault $soapFault) { echo $HTML->warning_msg(_('Technical error occurs during data retrieving')._(': ').$soapFault->faultstring); diff --git a/src/plugins/mantisbt/view/admin/viewCategorie.php b/src/plugins/mantisbt/view/admin/viewCategorie.php index d8e6501..bee7854 100644 --- a/src/plugins/mantisbt/view/admin/viewCategorie.php +++ b/src/plugins/mantisbt/view/admin/viewCategorie.php @@ -32,9 +32,9 @@ global $group_id; try { /* do not recreate $clientSOAP object if already created by other pages */ - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url'].'/api/soap/mantisconnect.php?wsdl', array('trace' => true, 'exceptions' => true)); - + } $listCategories = $clientSOAP->__soapCall('mc_project_get_categories', array('username' => $username, 'password' => $password, 'project_id' => $mantisbtConf['id_mantisbt'])); } catch (SoapFault $soapFault) { echo $HTML->warning_msg(_('Technical error occurs during data retrieving')._(': ').$soapFault->faultstring); diff --git a/src/plugins/mantisbt/view/admin/viewConfiguration.php b/src/plugins/mantisbt/view/admin/viewConfiguration.php index 729e8d2..fe93d55 100644 --- a/src/plugins/mantisbt/view/admin/viewConfiguration.php +++ b/src/plugins/mantisbt/view/admin/viewConfiguration.php @@ -25,7 +25,6 @@ global $HTML; global $mantisbt; global $mantisbtConf; -global $use_tooltips; global $group_id; ?> diff --git a/src/plugins/mantisbt/view/admin/viewVersion.php b/src/plugins/mantisbt/view/admin/viewVersion.php index 4dcbf00..e61b971 100644 --- a/src/plugins/mantisbt/view/admin/viewVersion.php +++ b/src/plugins/mantisbt/view/admin/viewVersion.php @@ -33,9 +33,9 @@ global $password; try { /* do not recreate $clientSOAP object if already created by other pages */ - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url'].'/api/soap/mantisconnect.php?wsdl', array('trace' => true, 'exceptions' => true)); - + } $listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array('username' => $username, 'password' => $password, 'project_id' => $mantisbtConf['id_mantisbt'])); } catch (SoapFault $soapFault) { echo $HTML->warning_msg(_('Technical error occurs during data retrieving')._(': ').$soapFault->faultstring); diff --git a/src/plugins/mantisbt/view/editIssue.php b/src/plugins/mantisbt/view/editIssue.php index 82ddf1a..473608b 100644 --- a/src/plugins/mantisbt/view/editIssue.php +++ b/src/plugins/mantisbt/view/editIssue.php @@ -33,9 +33,9 @@ global $HTML; try { /* do not recreate $clientSOAP object if already created by other pages */ - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url'].'/api/soap/mantisconnect.php?wsdl', array('trace' => true, 'exceptions' => true)); - + } $defect = $clientSOAP->__soapCall('mc_issue_get', array('username' => $username, 'password' => $password, 'issue_id' => $idBug)); $listCategories = $clientSOAP->__soapCall('mc_project_get_categories', array('username' => $username, 'password' => $password, 'project_id' => $defect->project->id)); $listSeverities = $clientSOAP->__soapCall('mc_enum_severities', array('username' => $username, 'password' => $password)); diff --git a/src/plugins/mantisbt/view/roadmap.php b/src/plugins/mantisbt/view/roadmap.php index e215872..bb98d8b 100644 --- a/src/plugins/mantisbt/view/roadmap.php +++ b/src/plugins/mantisbt/view/roadmap.php @@ -32,9 +32,9 @@ global $HTML; try { /* do not recreate $clientSOAP object if already created by other pages */ - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true)); - + } $listChild = $clientSOAP->__soapCall('mc_project_get_all_subprojects', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt'])); } catch (SoapFault $soapFault) { diff --git a/src/plugins/mantisbt/view/viewAttachment.php b/src/plugins/mantisbt/view/viewAttachment.php index b791c8a..14db14a 100644 --- a/src/plugins/mantisbt/view/viewAttachment.php +++ b/src/plugins/mantisbt/view/viewAttachment.php @@ -32,10 +32,10 @@ global $HTML; if (empty($msg)) { if (!isset($defect)){ - try{ + try { $clientSOAP = new SoapClient($mantisbtConf['url'].'/api/soap/mantisconnect.php?wsdl', array('trace' => true, 'exceptions' => true)); $defect = $clientSOAP->__soapCall('mc_issue_get', array('username' => $username, 'password' => $password, 'issue_id' => $idBug)); - }catch (SoapFault $soapFault) { + } catch (SoapFault $soapFault) { echo $HTML->warning_msg(_('Technical error occurs during data retrieving')._(': ').$soapFault->faultstring); $errorPage = true; } @@ -50,9 +50,9 @@ if (empty($msg)) { $cells = array(); $cells[][] = $attachement->filename; $contentCell = '<input type=button value="'._('Download').'" onclick="window.location.href=\'/plugins/'.$mantisbt->name.'/getAttachment.php/'.$group_id.'/'.$attachement->id.'/'.$attachement->filename.'\'">'; - if ($editable) + if ($editable) { $contentCell .= '<input type=button value="'._('Delete').'" onclick="window.location.href=\'/plugins/'.$mantisbt->name.'/?type='.$type.'&group_id='.$group_id.'&idBug='.$idBug.'&idAttachment='.$attachement->id.'&action=deleteAttachment&view=viewIssue\'">'; - + } $cells[][] = $contentCell; echo $HTML->multiTableRow(array(), $cells); } diff --git a/src/plugins/mantisbt/view/viewIssue.php b/src/plugins/mantisbt/view/viewIssue.php index 8b8ecd4..f0edce0 100644 --- a/src/plugins/mantisbt/view/viewIssue.php +++ b/src/plugins/mantisbt/view/viewIssue.php @@ -35,10 +35,10 @@ global $clientSOAP; if (!isset($defect)) { try { - /* do not recreate $clientSOAP object if already created by other pages */ - if (!isset($clientSOAP)) + /* do not recreate $clientSOAP object if already created by other pages */ + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url'].'/api/soap/mantisconnect.php?wsdl', array('trace' => true, 'exceptions' => true)); - + } $defect = $clientSOAP->__soapCall('mc_issue_get', array('username' => $username, 'password' => $password, 'issue_id' => $idBug)); } catch (SoapFault $soapFault) { echo $HTML->warning_msg(_('Technical error occurs during data retrieving')._(': ').$soapFault->faultstring); diff --git a/src/plugins/mantisbt/view/viewNote.php b/src/plugins/mantisbt/view/viewNote.php index d434880..631da8d 100644 --- a/src/plugins/mantisbt/view/viewNote.php +++ b/src/plugins/mantisbt/view/viewNote.php @@ -32,11 +32,11 @@ global $HTML; //$msg is coming from previous soap error if (empty($msg)) { - if (!isset($defect)){ + if (!isset($defect)) { /* do not recreate $clientSOAP object if already created by other pages */ - if (!isset($clientSOAP)) + if (!isset($clientSOAP)) { $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true)); - + } $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug)); } diff --git a/src/plugins/mediawiki/bin/mw-plugin-init.php b/src/plugins/mediawiki/bin/mw-plugin-init.php index 934e981..ec01572 100755 --- a/src/plugins/mediawiki/bin/mw-plugin-init.php +++ b/src/plugins/mediawiki/bin/mw-plugin-init.php @@ -99,9 +99,9 @@ mysymlink($from, $to); // create skin subdir $todir = "$todir/fusionforge"; -if (!is_dir($todir)) +if (!is_dir($todir)) { mkdir($todir); - +} // link fusionforge.css files $fromdir = "$fromdir/fusionforge"; $from = "$fromdir/fusionforge.css"; @@ -129,5 +129,3 @@ closedir($dh); // mode: php // c-file-style: "bsd" // End: - -?> diff --git a/src/plugins/mediawiki/common/mediawikiPlugin.class.php b/src/plugins/mediawiki/common/mediawikiPlugin.class.php index db713b1..24744e9 100644 --- a/src/plugins/mediawiki/common/mediawikiPlugin.class.php +++ b/src/plugins/mediawiki/common/mediawikiPlugin.class.php @@ -24,13 +24,13 @@ */ require_once 'plugins_utils.php'; -if(is_dir("/usr/share/mediawiki")){ -forge_define_config_item('src_path','mediawiki', "/usr/share/mediawiki"); -forge_define_config_item('mwdata_path', 'mediawiki', '$core/data_path/plugins/mediawiki'); -forge_define_config_item('projects_path', 'mediawiki', '$mediawiki/mwdata_path/projects'); -forge_define_config_item('master_path', 'mediawiki', '$mediawiki/mwdata_path/master'); -forge_define_config_item('enable_uploads', 'mediawiki', false); -forge_set_config_item_bool('enable_uploads', 'mediawiki'); +if (is_dir("/usr/share/mediawiki")) { + forge_define_config_item('src_path','mediawiki', "/usr/share/mediawiki"); + forge_define_config_item('mwdata_path', 'mediawiki', '$core/data_path/plugins/mediawiki'); + forge_define_config_item('projects_path', 'mediawiki', '$mediawiki/mwdata_path/projects'); + forge_define_config_item('master_path', 'mediawiki', '$mediawiki/mwdata_path/master'); + forge_define_config_item('enable_uploads', 'mediawiki', false); + forge_set_config_item_bool('enable_uploads', 'mediawiki'); } require_once $gfcommon.'include/SysTasksQ.class.php'; @@ -336,8 +336,9 @@ _('This plugin allows each project to embed Mediawiki under a tab.'); } elseif ($hookname == 'project_admin_plugins') { $group_id = $params['group_id']; $group = group_get_object($group_id); - if ($group->usesPlugin($this->name)) + if ($group->usesPlugin($this->name)) { echo util_make_link('/plugins/mediawiki/plugin_admin.php?group_id='. $group->getID(), _('MediaWiki Plugin admin')).'<br />'; + } } elseif ($hookname == 'clone_project_from_template') { $template = $params['template']; $project = $params['project']; @@ -457,8 +458,9 @@ _('This plugin allows each project to embed Mediawiki under a tab.'); } function groupisactivecheckboxpost(&$params) { - if (!parent::groupisactivecheckboxpost($params)) - return false; + if (!parent::groupisactivecheckboxpost($params)) { + return false; + } if (getIntFromRequest('use_mediawiki') == 1) { $systasksq = new SystasksQ(); $group_id = $params['group']; diff --git a/src/plugins/mediawiki/www/plugin_admin.php b/src/plugins/mediawiki/www/plugin_admin.php index 34c7b5f..aa8b937 100644 --- a/src/plugins/mediawiki/www/plugin_admin.php +++ b/src/plugins/mediawiki/www/plugin_admin.php @@ -34,35 +34,39 @@ global $HTML; function logo_create($file_location, $project_mw_images_dir) { $logofile = $project_mw_images_dir . "/.wgLogo.png"; - if (!is_file($file_location) || !file_exists($file_location)) + if (!is_file($file_location) || !file_exists($file_location)) { return _("Invalid file upload"); - + } $img = getimagesize($file_location); - if (!$img || ($img[2] != IMAGETYPE_PNG)) + if (!$img || ($img[2] != IMAGETYPE_PNG)) { return _("Not a valid PNG image"); - if ($img[0] != 135 || $img[1] != 135) - return sprintf(_("Image size is %dx%d pixels, expected %dx%d instead"), - $img[0], $img[1], 135, 135); + } + if ($img[0] != 135 || $img[1] != 135) { + return sprintf(_("Image size is %dx%d pixels, expected %dx%d instead"), $img[0], $img[1], 135, 135); + } - if (!is_writable($project_mw_images_dir)) - return sprintf( _("Cannot copy file to target directory %s"), $project_mw_images_dir) ; + if (!is_writable($project_mw_images_dir)) { + return sprintf( _("Cannot copy file to target directory %s"), $project_mw_images_dir); + } - if (file_exists($logofile) && !is_writable($logofile)) + if (file_exists($logofile) && !is_writable($logofile)) { return _("Cannot overwrite existing file"); + } $cmd = "/bin/mv " . escapeshellcmd($file_location) . " " . escapeshellcmd($logofile); exec($cmd,$out); - if (!file_exists($logofile)) + if (!file_exists($logofile)) { return _("Cannot move file to target location"); + } return _("New file installed successfully"); } $user = session_get_user(); -if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) +if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) { exit_error("Invalid User", "Cannot process your request for this user."); - +} $gid = getIntFromRequest("group_id", -1); if ($gid == -1) { $group = false; @@ -77,17 +81,16 @@ if (!$group->usesPlugin("mediawiki")) { } $userperm = $group->getPermission(); -if (!$userperm->IsMember()) +if (!$userperm->IsMember()) { exit_permission_denied(); -if (!$userperm->IsAdmin()) +} elseif (!$userperm->IsAdmin()) { exit_error("Access Denied", "You are not an admin of this project"); +} $group_unix_name = $group->getUnixName(); -$wgUploadDirectory = forge_get_config('projects_path', 'mediawiki') . "/" . - $group_unix_name . "/images"; +$wgUploadDirectory = forge_get_config('projects_path', 'mediawiki') . "/".$group_unix_name . "/images"; $group_logo = $wgUploadDirectory . "/.wgLogo.png"; -$group_logo_url = util_make_url("/plugins/mediawiki/wiki/" . - $group_unix_name . "/images/.wgLogo.png"); +$group_logo_url = util_make_url("/plugins/mediawiki/wiki/" . $group_unix_name . "/images/.wgLogo.png"); $incoming = False; if (forge_get_config('use_manual_uploads')) { diff --git a/src/plugins/moinmoin/common/MoinMoinPlugin.class.php b/src/plugins/moinmoin/common/MoinMoinPlugin.class.php index 1602f00..21d4503 100644 --- a/src/plugins/moinmoin/common/MoinMoinPlugin.class.php +++ b/src/plugins/moinmoin/common/MoinMoinPlugin.class.php @@ -67,10 +67,7 @@ _("This plugin allows each project to embed MoinMoinWiki under a tab."); } if ($hookname == "groupmenu") { $project = group_get_object($group_id); - if (!$project || !is_object($project)) { - return; - } - if ($project->isError()) { + if (!$project || !is_object($project) || $project->isError()) { return; } if ($project->usesPlugin($this->name)) { @@ -89,10 +86,7 @@ _("This plugin allows each project to embed MoinMoinWiki under a tab."); } } elseif ($hookname == "project_public_area") { $project = group_get_object($group_id); - if (!$project || !is_object($project)) { - return; - } - if ($project->isError()) { + if (!$project || !is_object($project) || $project->isError()) { return; } if ( $project->usesPlugin ( $this->name ) ) { @@ -165,10 +159,7 @@ _("This plugin allows each project to embed MoinMoinWiki under a tab."); $systasksq->add($this->getID(), 'MOINMOIN_CREATE_WIKI', $group_id); } elseif ($hookname == 'crossrefurl') { $project = group_get_object($group_id); - if (!$project || !is_object($project)) { - return; - } - if ($project->isError()) { + if (!$project || !is_object($project) || $project->isError()) { return; } if ($project->usesPlugin($this->name) && isset($params['page'])) { @@ -179,8 +170,9 @@ _("This plugin allows each project to embed MoinMoinWiki under a tab."); } function groupisactivecheckboxpost(&$params) { - if (!parent::groupisactivecheckboxpost($params)) - return false; + if (!parent::groupisactivecheckboxpost($params)) { + return false; + } if (getIntFromRequest('use_moinmoin') == 1) { $systasksq = new SystasksQ(); $group_id = $params['group']; diff --git a/src/plugins/projectlabels/common/ProjectLabelsPlugin.class.php b/src/plugins/projectlabels/common/ProjectLabelsPlugin.class.php index 351fd11..233732a 100644 --- a/src/plugins/projectlabels/common/ProjectLabelsPlugin.class.php +++ b/src/plugins/projectlabels/common/ProjectLabelsPlugin.class.php @@ -39,10 +39,9 @@ for a “project of the month”."); } elseif ($hookname == "project_before_widgets") { $group_id=$params['group_id']; $project = group_get_object($group_id); - if (!$project || !is_object($project)) - return; - if ($project->isError()) + if (!$project || !is_object($project) || $project->isError()) { return; + } $res_tabs = db_query_params ('SELECT plugin_projectlabels_labels.label_text FROM plugin_projectlabels_labels, plugin_projectlabels_group_labels WHERE plugin_projectlabels_group_labels.group_id=$1 AND plugin_projectlabels_group_labels.label_id = plugin_projectlabels_labels.label_id', array ($group_id)); diff --git a/src/plugins/projects-hierarchy/actions/addChild.php b/src/plugins/projects-hierarchy/actions/addChild.php index 69659b5..7454e1f 100644 --- a/src/plugins/projects-hierarchy/actions/addChild.php +++ b/src/plugins/projects-hierarchy/actions/addChild.php @@ -28,10 +28,10 @@ global $_SERVER; global $id; $sub_project_id = getIntFromRequest('sub_project_id'); -if ($sub_project_id && $projectsHierarchy->is_child($sub_project_id)) +if ($sub_project_id && $projectsHierarchy->is_child($sub_project_id)) { $projectsHierarchy->redirect($_SERVER['HTTP_REFERER'], 'error_msg', _('This project already has a parent')); - -if ($sub_project_id && $projectsHierarchy->addChild($id, $sub_project_id)) +} +if ($sub_project_id && $projectsHierarchy->addChild($id, $sub_project_id)) { $projectsHierarchy->redirect($_SERVER['HTTP_REFERER'], 'feedback', _('Successfully added child')); - +} $projectsHierarchy->redirect($_SERVER['HTTP_REFERER'], 'error_msg', _('Failed to add child')); diff --git a/src/plugins/projects-hierarchy/actions/projectsHierarchyDocman.php b/src/plugins/projects-hierarchy/actions/projectsHierarchyDocman.php index a101fdc..528d0d8 100644 --- a/src/plugins/projects-hierarchy/actions/projectsHierarchyDocman.php +++ b/src/plugins/projects-hierarchy/actions/projectsHierarchyDocman.php @@ -28,7 +28,7 @@ global $id; $status = getIntFromRequest('status'); -if ($projectsHierarchy->setDocmanStatus($id, $status)) +if ($projectsHierarchy->setDocmanStatus($id, $status)) { $projectsHierarchy->redirect($_SERVER['HTTP_REFERER'], 'feedback', _('Successfully update status of hierarchical browsing')); - +} $projectsHierarchy->redirect($_SERVER['HTTP_REFERER'], 'error_msg', _('Failed to update status of hierarchical browsing')); diff --git a/src/plugins/projects-hierarchy/actions/removeChild.php b/src/plugins/projects-hierarchy/actions/removeChild.php index a0a4c15..707cf89 100644 --- a/src/plugins/projects-hierarchy/actions/removeChild.php +++ b/src/plugins/projects-hierarchy/actions/removeChild.php @@ -28,7 +28,7 @@ global $id; $child_id = getIntFromRequest('child_id'); -if ($child_id && $projectsHierarchy->removeChild($id, $child_id)) +if ($child_id && $projectsHierarchy->removeChild($id, $child_id)) { $projectsHierarchy->redirect($_SERVER['HTTP_REFERER'], 'feedback', _('Successfully removed child')); - +} $projectsHierarchy->redirect($_SERVER['HTTP_REFERER'], 'error_msg', _('Failed to remove child')); diff --git a/src/plugins/projects-hierarchy/actions/removeParent.php b/src/plugins/projects-hierarchy/actions/removeParent.php index 8abc2d2..fe6ef97 100644 --- a/src/plugins/projects-hierarchy/actions/removeParent.php +++ b/src/plugins/projects-hierarchy/actions/removeParent.php @@ -28,7 +28,7 @@ global $id; $parent_id = getIntFromRequest('parent_id'); -if ($parent_id && $projectsHierarchy->removeParent($id, $parent_id)) +if ($parent_id && $projectsHierarchy->removeParent($id, $parent_id)) { $projectsHierarchy->redirect($_SERVER['HTTP_REFERER'], 'feedback', _('Successfully removed parent')); - +} $projectsHierarchy->redirect($_SERVER['HTTP_REFERER'], 'error_msg', _('Failed to remove parent')); diff --git a/src/plugins/projects-hierarchy/actions/validateRelationship.php b/src/plugins/projects-hierarchy/actions/validateRelationship.php index 89fd043..50050fc 100644 --- a/src/plugins/projects-hierarchy/actions/validateRelationship.php +++ b/src/plugins/projects-hierarchy/actions/validateRelationship.php @@ -29,7 +29,7 @@ $validation_id = getIntFromRequest('validation_id'); $status = getStringFromRequest('validation_status'); $relation = getStringFromRequest('relation'); -if ($projectsHierarchy->validateRelationship($id, $validation_id, $relation, $status)) +if ($projectsHierarchy->validateRelationship($id, $validation_id, $relation, $status)) { $projectsHierarchy->redirect($_SERVER['HTTP_REFERER'], 'feedback', _('Task done.')); - +} $projectsHierarchy->redirect($_SERVER['HTTP_REFERER'], 'error_msg', _('Failed to do task.')); diff --git a/src/plugins/projects-hierarchy/common/projects-hierarchyPlugin.class.php b/src/plugins/projects-hierarchy/common/projects-hierarchyPlugin.class.php index 5cac16e..3e61d6e 100644 --- a/src/plugins/projects-hierarchy/common/projects-hierarchyPlugin.class.php +++ b/src/plugins/projects-hierarchy/common/projects-hierarchyPlugin.class.php @@ -277,8 +277,9 @@ EOS; $nextFamily = $this->getFamily($localFamily[$i], $order, $deep, $status); } } - if (isset($nextFamily) && sizeof($nextFamily)) + if (isset($nextFamily) && !empty($nextFamily)) { $localFamily = array_merge($localFamily, $nextFamily); + } return $localFamily; } @@ -741,7 +742,7 @@ EOS; * @access public */ function getGlobalAdminView() { - global $gfplugins, $use_tooltips; + global $gfplugins; include $gfplugins.$this->name.'/view/admin/viewGlobalConfiguration.php'; return true; } @@ -810,7 +811,7 @@ EOS; function getProjectAdminView() { - global $gfplugins, $use_tooltips; + global $gfplugins; include $gfplugins.$this->name.'/view/admin/viewProjectConfiguration.php'; return true; } diff --git a/src/plugins/projects-hierarchy/view/admin/viewProjectConfiguration.php b/src/plugins/projects-hierarchy/view/admin/viewProjectConfiguration.php index 60d9207..a379277 100644 --- a/src/plugins/projects-hierarchy/view/admin/viewProjectConfiguration.php +++ b/src/plugins/projects-hierarchy/view/admin/viewProjectConfiguration.php @@ -37,16 +37,18 @@ if (!$projectsHierarchyProjectConf) { $cells = array(); $cells[][] = html_e('label', array('id' => 'projectsHierarchy-tree', 'title' => _('Enable visibility in hierarchy tree.')), _('Enable Tree')); $inputAttrs = array('type' => 'checkbox', 'name' => 'tree', 'value' => 1); - if ($projectsHierarchyProjectConf['tree']) + if ($projectsHierarchyProjectConf['tree']) { $inputAttrs['checked'] = 'checked'; + } $cells[][] = html_e('input', $inputAttrs); echo $HTML->multiTableRow(array(), $cells); $cells = array(); $cells[][] = html_e('label', array('id' => 'projectsHierarchy-docman', 'title' => _('Enable hierarchy in docman browsing. Direct access to docman features in parent docman tab.')), _('Enable Docman')); $inputAttrs = array('type' => 'checkbox', 'name' => 'docman', 'value' => 1); - if ($projectsHierarchyProjectConf['docman']) + if ($projectsHierarchyProjectConf['docman']) { $inputAttrs['checked'] = 'checked'; + } $cells[][] = html_e('input', $inputAttrs); echo $HTML->multiTableRow(array(), $cells); @@ -80,8 +82,9 @@ if (!$projectsHierarchyProjectConf) { $cells = array(); $cells[][] = html_e('label', array('id' => 'projectsHierarchy-globalconf', 'title' => _('Use forge global configuration. Superseed any configuration done at project level.')), _('Enable forge global configuration')); $inputAttrs = array('type' => 'checkbox', 'name' => 'globalconf', 'value' => 1); - if ($projectsHierarchyProjectConf['globalconf']) + if ($projectsHierarchyProjectConf['globalconf']) { $inputAttrs['checked'] = 'checked'; + } $cells[][] = html_e('input', $inputAttrs); echo $HTML->multiTableRow(array(), $cells); diff --git a/src/plugins/quotamanagement/action/update.php b/src/plugins/quotamanagement/action/update.php index 9ae80ad..bfee848 100644 --- a/src/plugins/quotamanagement/action/update.php +++ b/src/plugins/quotamanagement/action/update.php @@ -35,7 +35,9 @@ if ( !forge_check_global_perm('forge_admin')) { require_once $gfcommon.'include/SysTasksQ.class.php'; $_quota_block_size = trim(shell_exec('echo $BLOCK_SIZE')) + 0; -if ($_quota_block_size == 0) $_quota_block_size = 1024; +if ($_quota_block_size == 0) { + $_quota_block_size = 1024; +} $type = getStringFromRequest('type'); diff --git a/src/plugins/quotamanagement/common/quotamanagementPlugin.class.php b/src/plugins/quotamanagement/common/quotamanagementPlugin.class.php index bc472a8..74e5c5e 100644 --- a/src/plugins/quotamanagement/common/quotamanagementPlugin.class.php +++ b/src/plugins/quotamanagement/common/quotamanagementPlugin.class.php @@ -77,7 +77,9 @@ to monitor disk and database usage per user, project."); $cmd = "/usr/bin/du -bs $dir"; $res = shell_exec($cmd); $a = explode("\t", $res); - if (isset($a[1])) $size = $a[0]; + if (isset($a[1])) { + $size = $a[0]; + } return (int)$size; } diff --git a/src/plugins/quotamanagement/view/quota.php b/src/plugins/quotamanagement/view/quota.php index a34af5d..3074e29 100644 --- a/src/plugins/quotamanagement/view/quota.php +++ b/src/plugins/quotamanagement/view/quota.php @@ -35,8 +35,9 @@ global $HTML; $quotamanagement = plugin_get_object('quotamanagement'); $_quota_block_size = intval(trim(shell_exec('echo $BLOCK_SIZE'))) + 0; -if ($_quota_block_size == 0) $_quota_block_size = 1024; - +if ($_quota_block_size == 0) { + $_quota_block_size = 1024; +} $subMenuTitle = array(); $subMenuUrl = array(); $subMenuAttr = array(); diff --git a/src/plugins/quotamanagement/view/quota_admin.php b/src/plugins/quotamanagement/view/quota_admin.php index 1598d6b..9f62b6f 100644 --- a/src/plugins/quotamanagement/view/quota_admin.php +++ b/src/plugins/quotamanagement/view/quota_admin.php @@ -33,7 +33,9 @@ $cmd = getStringFromRequest('cmd'); $quotamanagement = plugin_get_object('quotamanagement'); $_quota_block_size = intval(trim(shell_exec('echo $BLOCK_SIZE'))) + 0; -if ($_quota_block_size == 0) $_quota_block_size = 1024; +if ($_quota_block_size == 0) { + $_quota_block_size = 1024; +} $subMenuTitle = array(); $subMenuUrl = array(); diff --git a/src/plugins/quotamanagement/view/quota_project.php b/src/plugins/quotamanagement/view/quota_project.php index 0539067..46956d0 100644 --- a/src/plugins/quotamanagement/view/quota_project.php +++ b/src/plugins/quotamanagement/view/quota_project.php @@ -137,7 +137,9 @@ $quotas_disk = array(); // disk_total_space $_quota_block_size = intval(trim(shell_exec('echo $BLOCK_SIZE'))) + 0; -if ($_quota_block_size == 0) $_quota_block_size = 1024; +if ($_quota_block_size == 0) { + $_quota_block_size = 1024; +} $quota_soft = ""; $quota_hard = ""; $res_db = db_query_params('SELECT * FROM plugin_quotamanagement WHERE group_id = $1', diff --git a/src/plugins/scmarch/common/ArchPlugin.class.php b/src/plugins/scmarch/common/ArchPlugin.class.php index f3f0344..c25f7e7 100644 --- a/src/plugins/scmarch/common/ArchPlugin.class.php +++ b/src/plugins/scmarch/common/ArchPlugin.class.php @@ -26,7 +26,6 @@ forge_define_config_item ('repos_path', 'scmarch', forge_get_config('chroot').'/ class ArchPlugin extends SCMPlugin { function __construct() { - global $gfconfig; parent::__construct(); $this->name = 'scmarch'; $this->text = _('Arch'); @@ -57,10 +56,6 @@ some control over it to the project's administrator."); return false ; } - if (! $project->usesPlugin ($this->name)) { - return false; - } - $repo = forge_get_config('repos_path', 'scmarch') . '/' . $project->getUnixName() ; $unix_group = 'scm_' . $project->getUnixName() ; @@ -96,8 +91,12 @@ some control over it to the project's administrator."); $tarball = forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar'.util_get_compressed_file_extension(); if (! $project->enableAnonSCM()) { - if (file_exists ($snapshot)) unlink ($snapshot) ; - if (file_exists ($tarball)) unlink ($tarball) ; + if (file_exists ($snapshot)) { + unlink ($snapshot) ; + } + if (file_exists ($tarball)) { + unlink ($tarball) ; + } return false; } @@ -105,8 +104,12 @@ some control over it to the project's administrator."); $repo = $toprepo . '/' . $project->getUnixName() ; if (!is_dir ($repo) || !is_file ("$repo/format")) { - if (file_exists ($snapshot)) unlink ($snapshot) ; - if (file_exists ($tarball)) unlink ($tarball) ; + if (file_exists ($snapshot)) { + unlink ($snapshot) ; + } + if (file_exists ($tarball)) { + unlink ($tarball) ; + } return false ; } @@ -139,8 +142,3 @@ some control over it to the project's administrator."); } } } - -// Local Variables: -// mode: php -// c-file-style: "bsd" -// End: diff --git a/src/plugins/scmbzr/common/BzrPlugin.class.php b/src/plugins/scmbzr/common/BzrPlugin.class.php index 85f858e..758bf68 100644 --- a/src/plugins/scmbzr/common/BzrPlugin.class.php +++ b/src/plugins/scmbzr/common/BzrPlugin.class.php @@ -488,8 +488,12 @@ over it to the project's administrator."); $tarball = forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar'.util_get_compressed_file_extension(); if (! $project->enableAnonSCM()) { - if (file_exists ($snapshot)) unlink ($snapshot) ; - if (file_exists ($tarball)) unlink ($tarball) ; + if (file_exists($snapshot)) { + unlink ($snapshot) ; + } + if (file_exists($tarball)) { + unlink ($tarball) ; + } return false; } @@ -497,8 +501,12 @@ over it to the project's administrator."); $repo = $toprepo . '/' . $project->getUnixName() ; if (!is_dir ($repo) || !is_file ("$repo/format")) { - if (file_exists ($snapshot)) unlink ($snapshot) ; - if (file_exists ($tarball)) unlink ($tarball) ; + if (file_exists ($snapshot)) { + unlink ($snapshot) ; + } + if (file_exists ($tarball)) { + unlink ($tarball) ; + } return false ; } diff --git a/src/plugins/scmccase/common/CCasePlugin.class.php b/src/plugins/scmccase/common/CCasePlugin.class.php index 92038d1..6d902e4 100644 --- a/src/plugins/scmccase/common/CCasePlugin.class.php +++ b/src/plugins/scmccase/common/CCasePlugin.class.php @@ -200,16 +200,8 @@ class CCasePlugin extends SCMPlugin { function createOrUpdateRepo ($params) { return true ; // Disabled for now - $group_id = $params['group_id'] ; - - $project = group_get_object($group_id); - if (!$project || !is_object($project)) { - return false; - } elseif ($project->isError()) { - return false; - } - - if (! $project->usesPlugin ($this->name)) { + $project = $this->checkParams($params); + if (!$project) { return false; } diff --git a/src/plugins/scmcpold/common/CpoldPlugin.class.php b/src/plugins/scmcpold/common/CpoldPlugin.class.php index 6ff0360..1ebba171 100644 --- a/src/plugins/scmcpold/common/CpoldPlugin.class.php +++ b/src/plugins/scmcpold/common/CpoldPlugin.class.php @@ -160,7 +160,9 @@ class CpoldPlugin extends SCMPlugin { $repo = $toprepo . '/' . $project->getUnixName() ; if (!is_dir ($repo)) { - if (file_exists ($tarball)) unlink ($tarball) ; + if (file_exists ($tarball)) { + unlink ($tarball) ; + } return false ; } diff --git a/src/plugins/scmcvs/common/CVSPlugin.class.php b/src/plugins/scmcvs/common/CVSPlugin.class.php index ef3d5eb..d945175 100644 --- a/src/plugins/scmcvs/common/CVSPlugin.class.php +++ b/src/plugins/scmcvs/common/CVSPlugin.class.php @@ -214,10 +214,8 @@ over it to the project's administrator."); return; } - if ($project->usesPlugin($this->name)) { - $iframe_src = '/scm/viewvc.php?root='.$project->getUnixName(); - htmlIframe($iframe_src, array('id'=>'scmcvs_iframe')); - } + $iframe_src = '/scm/viewvc.php?root='.$project->getUnixName(); + htmlIframe($iframe_src, array('id'=>'scmcvs_iframe')); } function createOrUpdateRepo ($params) { @@ -226,10 +224,6 @@ over it to the project's administrator."); return false ; } - if (! $project->usesPlugin ($this->name)) { - return false; - } - $repo_prefix = forge_get_config('repos_path', 'scmcvs'); if (!is_dir($repo_prefix) && !mkdir($repo_prefix, 0755, true)) { return false; @@ -291,15 +285,11 @@ over it to the project's administrator."); } function gatherStats ($params) { - $project = $this->checkParams ($params) ; + $project = $this->checkParams($params); if (!$project) { return false ; } - if (! $project->usesPlugin ($this->name)) { - return false; - } - if ($params['mode'] == 'day') { db_begin(); @@ -376,11 +366,15 @@ over it to the project's administrator."); if ( ($time_parsed > $day_begin) && ($time_parsed < $day_end) ) { if ( $type == 'M' ) { $cvs_commit++; - if(!isset($usr_commit[$user])) $usr_commit[$user] = 0; + if(!isset($usr_commit[$user])) { + $usr_commit[$user] = 0; + } $usr_commit[$user]++; } elseif ( $type == 'A' ) { $cvs_add++; - if(!isset($usr_add[$user])) $usr_add[$user] = 0; + if(!isset($usr_add[$user])) { + $usr_add[$user] = 0; + } $usr_add[$user]++; } elseif ( $type == 'O' || $type == 'E' ) { $cvs_co++; @@ -454,13 +448,13 @@ over it to the project's administrator."); $snapshot = forge_get_config('scm_snapshots_path').'/'.$group_name.'-scm-latest.tar'.util_get_compressed_file_extension(); $tarball = forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar'.util_get_compressed_file_extension(); - if (! $project->usesPlugin ($this->name)) { - return false; - } - if (! $project->enableAnonSCM()) { - if (file_exists($snapshot)) unlink ($snapshot) ; - if (file_exists($tarball)) unlink ($tarball) ; + if (file_exists($snapshot)) { + unlink ($snapshot) ; + } + if (file_exists($tarball)) { + unlink ($tarball) ; + } return false; } @@ -473,8 +467,12 @@ over it to the project's administrator."); } if (!$repo_exists) { - if (file_exists($snapshot)) unlink ($snapshot) ; - if (file_exists($tarball)) unlink ($tarball) ; + if (file_exists($snapshot)) { + unlink ($snapshot) ; + } + if (file_exists($tarball)) { + unlink ($tarball) ; + } return false ; } diff --git a/src/plugins/scmcvs/cronjobs/usergroup.php b/src/plugins/scmcvs/cronjobs/usergroup.php index ad2a250..c1142ec 100755 --- a/src/plugins/scmcvs/cronjobs/usergroup.php +++ b/src/plugins/scmcvs/cronjobs/usergroup.php @@ -1,7 +1,7 @@ #! /usr/bin/php <?php /** - * GForge Cron Job + * FusionForge Cron Job * * The rest Copyright 2002-2005 (c) GForge Team * http://fusionforge.org/ @@ -31,9 +31,6 @@ require_once dirname(__FILE__).'/../../env.inc.php'; require_once $gfcommon.'include/pre.php'; require $gfcommon.'include/cron_utils.php'; -//error variable -$err = ''; - // // Default values for the script // @@ -41,15 +38,15 @@ define('DEFAULT_SHELL','/bin/cvssh.pl'); //use /bin/grap for cvs-only define('FILE_EXTENSION',''); // use .new when testing if (util_is_root_dir(forge_get_config('groupdir_prefix'))) { - $err .= "Error! groupdir_prefix Points To Root Directory!"; + $err = "Error! groupdir_prefix Points To Root Directory!"; echo $err; - cron_entry(16,$err); + cron_entry(16, $err); exit; } $res = db_query_params ('SELECT group_id FROM groups WHERE status=$1', array('A')) ; -$err .= db_error(); +$err = db_error(); $groups = group_get_objects (util_result_column_to_array($res,'group_id')); $res = db_query_params ('SELECT user_id FROM users WHERE unix_status=$1', @@ -57,7 +54,7 @@ $res = db_query_params ('SELECT user_id FROM users WHERE unix_status=$1', $err .= db_error(); $users = user_get_objects (util_result_column_to_array($res,'user_id')); -// Create the entries for the GForge users +// Create the entries for the FusionForge users $gforge_lines_passwd = array(); $gforge_lines_shadow = array(); $gforge_lines_groups = array(); @@ -89,8 +86,9 @@ for ($i=0; $i < count($passwd_orig); $i++) { // Got to end of file (shouldn't happen, means #GFORGEEND wasn't found on file, but // it's not a fatal error - if ($i >= (count($passwd_orig)-1)) break; - + if ($i >= (count($passwd_orig)-1)) { + break; + } // read next line $i++; $line = trim($passwd_orig[$i]); @@ -106,7 +104,7 @@ for ($i=0; $i < count($passwd_orig); $i++) { $unmanaged_lines_passwd[] = $line; } -// Now, check which of the GForge users were found outside the #GFORGE markers. In that +// Now, check which of the FusionForge users were found outside the #GFORGE markers. In that // case, the user must not be written inside the markers (means the user is managed by // the sysadmin) foreach ($users as $u) { @@ -150,8 +148,9 @@ for ($i=0; $i < count($shadow_orig); $i++) { // Got to end of file (shouldn't happen, means #GFORGEEND wasn't found on file, but // it's not a fatal error - if ($i >= (count($shadow_orig)-1)) break; - + if ($i >= (count($shadow_orig)-1)) { + break; + } // read next line $i++; $line = trim($shadow_orig[$i]); @@ -174,9 +173,8 @@ $err .= db_error(); $user_pws = array(); for($i = 0; $i < db_numrows($userp_res); $i++) { - $us_pw = db_result($userp_res,$i,'unix_pw'); - $user_pws[] = $us_pw; - + $us_pw = db_result($userp_res,$i,'unix_pw'); + $user_pws[] = $us_pw; } $i=0; @@ -212,9 +210,9 @@ $err .= db_error(); $gforge_groups = array(); for($i = 0; $i < db_numrows($group_res); $i++) { - $group_name = db_result($group_res,$i,'unix_group_name'); - $gforge_groups[] = $group_name; - $gids[$group_name] = db_result($group_res,$i,'group_id') + 50000; // 50000: hardcoded value (for now). + $group_name = db_result($group_res,$i,'unix_group_name'); + $gforge_groups[] = $group_name; + $gids[$group_name] = db_result($group_res,$i,'group_id') + 50000; // 50000: hardcoded value (for now). } // Add the groups from the gforge database @@ -228,8 +226,9 @@ for ($i=0; $i < count($group_orig); $i++) { } while ($i < count($group_orig) && !preg_match("/^[[:blank:]]*#GFORGEEND/", $line)); // Got to end of file (shouldn't happen, means #GFORGEEND wasn't found on file - if ($i >= (count($group_orig)-1)) break; - + if ($i >= (count($group_orig)-1)) { + break; + } // read next line $i++; $line = trim($group_orig[$i]); @@ -314,5 +313,3 @@ if ($group_file) { } cron_entry(16,$err); - -?> diff --git a/src/plugins/scmdarcs/common/DarcsPlugin.class.php b/src/plugins/scmdarcs/common/DarcsPlugin.class.php index 77b3217..1a2e4b6 100644 --- a/src/plugins/scmdarcs/common/DarcsPlugin.class.php +++ b/src/plugins/scmdarcs/common/DarcsPlugin.class.php @@ -372,7 +372,9 @@ over it to the project's administrator."); $tarball = forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar'.util_get_compressed_file_extension(); if (! $project->enableAnonSCM()) { - if (file_exists($tarball)) unlink($tarball); + if (file_exists($tarball)) { + unlink($tarball); + } return false; } @@ -381,7 +383,9 @@ over it to the project's administrator."); $repo = $this->getRootRepositories($project); if (!is_dir($repo)) { - if (file_exists($tarball)) unlink($tarball); + if (file_exists($tarball)) { + unlink($tarball); + } return false; } diff --git a/src/plugins/scmgit/libexec/gitlog.php b/src/plugins/scmgit/libexec/gitlog.php index 857e440..c47b107 100644 --- a/src/plugins/scmgit/libexec/gitlog.php +++ b/src/plugins/scmgit/libexec/gitlog.php @@ -51,36 +51,44 @@ if (!preg_match(',^/anonscm/,', $_SERVER['REQUEST_URI'])) { $unix_group_name = $_GET['unix_group_name']; $repo_name = $_GET['repo_name']; $mode = $_GET['mode']; -if (!preg_match('/^(date_range|latest|latest_user)$/', $mode)) +if (!preg_match('/^(date_range|latest|latest_user)$/', $mode)) { die('Invalid mode'); -if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $unix_group_name)) +} +if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $unix_group_name)) { die('Invalid group name'); -if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $repo_name)) +} +if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $repo_name)) { die('Invalid repository name'); +} if ($mode == 'date_range') { $start_time = $_GET['begin']; $end_time = $_GET['end']; - if (!ctype_digit($start_time)) + if (!ctype_digit($start_time)) { die('Invalid start time'); - if (!ctype_digit($end_time)) + } + if (!ctype_digit($end_time)) { die('Invalid end time'); + } $options = "--since=@$start_time --until=@$end_time"; } elseif ($mode == 'latest' or $mode == 'latest_user') { $limit = $_GET['limit']; - if (!ctype_digit($limit)) + if (!ctype_digit($limit)) { die('Invalid limit'); + } $options = "--max-count=$limit"; if ($mode == 'latest_user') { $email = $_GET['email']; $realname = $_GET['realname']; $user_name = $_GET['user_name']; - if (!validate_email($email)) + if (!validate_email($email)) { die('Invalid email'); + } $realname = escapeshellarg(preg_quote($realname)); - if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $user_name)) + if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $user_name)) { die('Invalid user name'); + } $options .= " --author='$email' --author=$realname --author='$user_name'"; } } diff --git a/src/plugins/scmhg/common/HgPlugin.class.php b/src/plugins/scmhg/common/HgPlugin.class.php index 8f215d2..469519e 100644 --- a/src/plugins/scmhg/common/HgPlugin.class.php +++ b/src/plugins/scmhg/common/HgPlugin.class.php @@ -275,7 +275,6 @@ Offer DAV or SSH access."); if ($params['scm_plugin'] != $this->name) { return; } - global $HTML; $project = $this->checkParams($params); if (!$project) { return false; @@ -423,9 +422,9 @@ Offer DAV or SSH access."); $unix_group = forge_get_config('apache_group'); $unix_user = forge_get_config('apache_user'); foreach ($groups as $project) { - if (!$project->isActive()) continue; - if (!$project->usesSCM()) continue; - + if ($project->isError() || !$project->isActive() || !$project->usesSCM()) { + continue; + } $repolist = $this->getRepositories($project); foreach ($repolist as $repo_name) { $push = ""; @@ -638,7 +637,9 @@ Offer DAV or SSH access."); while (!feof($pipe) && $line = fgets ($pipe)) { //determine between author line and file informations if (preg_match("/(\A[AMD]) .*/", $line, $matches)) { - if ($last_user == "") continue; + if ($last_user == "") { + continue; + } switch ($matches[1]) { case 'A': $usr_adds[$last_user]++; @@ -959,8 +960,3 @@ Offer DAV or SSH access."); return $repoarr; } } - -// Local Variables: -// mode: php -// c-file-style: "bsd" -// End: diff --git a/src/plugins/scmhg/libexec/hglog.php b/src/plugins/scmhg/libexec/hglog.php index c262218..bb41712 100644 --- a/src/plugins/scmhg/libexec/hglog.php +++ b/src/plugins/scmhg/libexec/hglog.php @@ -22,7 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -// Don't try to connect to the DB, just dumping SVN log +// Don't try to connect to the DB, just dumping Hg log putenv('FUSIONFORGE_NO_DB=true'); require_once '../../../www/env.inc.php'; @@ -52,33 +52,25 @@ if (!preg_match(',^/anonscm/,', $_SERVER['REQUEST_URI'])) { $unix_group_name = $_GET['unix_group_name']; $repo_name = $_GET['repo_name']; $mode = $_GET['mode']; -if (!preg_match('/^(date_range|latest|latest_user)$/', $mode)) +if (!preg_match('/^(date_range|latest|latest_user)$/', $mode)) { die('Invalid mode'); -if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $unix_group_name)) +} +if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $unix_group_name)) { die('Invalid group name'); +} if ($mode == 'date_range') { $start_time = $_GET['begin']; $end_time = $_GET['end']; - if (!ctype_digit($start_time)) + if (!ctype_digit($start_time)) { die('Invalid start time'); - if (!ctype_digit($end_time)) + } + if (!ctype_digit($end_time)) { die('Invalid end time'); + } $d1 = date('Y-m-d', $start_time - 80000); $d2 = date('Y-m-d', $end_time + 80000); $options = "-d '$start_time 0 to $end_time 0'"; -// } elseif ($mode == 'latest' or $mode == 'latest_user') { -// $limit = $_GET['limit']; -// if (!ctype_digit($limit)) -// die('Invalid limit'); -// $options = "--limit $limit"; -// -// if ($mode == 'latest_user') { -// $user_name = $_GET['user_name']; -// if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $user_name)) -// die('Invalid user name'); -// $options .= " --search '$user_name'"; -// } } $repo = forge_get_config('repos_path', 'scmhg').'/'.$unix_group_name.'/'.$repo_name; diff --git a/src/plugins/scmhook/common/scmhookPlugin.class.php b/src/plugins/scmhook/common/scmhookPlugin.class.php index 70926a3..3ffd0ae 100644 --- a/src/plugins/scmhook/common/scmhookPlugin.class.php +++ b/src/plugins/scmhook/common/scmhookPlugin.class.php @@ -72,21 +72,21 @@ project independently."); function exists($group_id) { $res = db_query_params('SELECT id_group FROM plugin_scmhook WHERE id_group = $1', array($group_id)); - if (!$res) + if (!$res) { return false; - - if (db_numrows($res)) + } + if (db_numrows($res)) { return true; - + } return false; } function remove($group_id) { if ($this->exists($group_id)) { $res = db_query_params('DELETE FROM plugin_scmhook where id_group = $1', array($group_id)); - if (!$res) + if (!$res) { return false; - + } } return true; } @@ -132,10 +132,12 @@ project independently."); $table = 'plugin_scmhook_'.$hook->getLabel().'_'.strtolower($hook->getClassname()); if (db_check_table_exists($table)) { $hook_params = $hook->getParams(); - if (count($hook_params) == 0) + if (empty($hook_params)) { continue; - if (array_search($hook->getClassname(), $enabled_hooknames) === false) + } + if (array_search($hook->getClassname(), $enabled_hooknames) === false) { continue; + } // Build 3 arrays for inconvenient db_query_params() $i = 1; $sql_cols = array_keys($hook_params); @@ -151,8 +153,9 @@ project independently."); $emails = array_map('trim', explode(',', $val['dest'])); $strict = true; $invalid = array_search(false, array_map('validate_email', $emails), $strict) !== false; - if ($invalid) + if ($invalid) { exit_error($hook->getName() . _(": ") . _("invalid e-mails"). ' ' . $val['dest']); + } $val = implode(',', $emails); } } @@ -176,9 +179,9 @@ project independently."); } } - if (!$res) + if (!$res) { return false; - + } $systasksq = new SystasksQ(); $systasksq->add($this->getID(), 'SCMHOOK_UPDATE', $group_id, user_getid()); @@ -228,8 +231,9 @@ project independently."); function getStatusDeploy($group_id) { $res = db_query_params('SELECT need_update FROM plugin_scmhook WHERE id_group = $1', array($group_id)); - if (!$res) + if (!$res) { return 1; + } $row = db_fetch_array($res); return $row['need_update']; } @@ -249,9 +253,9 @@ project independently."); function getEnabledHooks($group_id) { $enabledHooks = array(); $res = db_query_params('SELECT hooks, repository_name, scm_plugin FROM plugin_scmhook WHERE id_group = $1', array($group_id)); - if (!$res) + if (!$res) { return $enabledHooks; - + } while ($arr = db_fetch_array($res)) { $enabledHooks[$arr['scm_plugin']][$arr['repository_name']] = explode('|', $arr['hooks']); } diff --git a/src/plugins/scmhook/library/scmgit/hooks/committracker/post.php b/src/plugins/scmhook/library/scmgit/hooks/committracker/post.php index 016d4e4..a605084 100755 --- a/src/plugins/scmhook/library/scmgit/hooks/committracker/post.php +++ b/src/plugins/scmhook/library/scmgit/hooks/committracker/post.php @@ -54,11 +54,9 @@ function usage( $prog ) { * * @return string $Result Returns artifact. */ -function getInvolvedArtifacts($Log) -{ +function getInvolvedArtifacts($Log) { preg_match_all('/[[]#[\d]+[]]/', $Log, $Matches ); - foreach($Matches as $Match) - { + foreach($Matches as $Match) { $Result = preg_replace ('/[[]#([\d]+)[]]/', '\1', $Match); } return $Result; @@ -72,11 +70,9 @@ function getInvolvedArtifacts($Log) * * @return string $Result Returns task. */ -function getInvolvedTasks($Log) -{ +function getInvolvedTasks($Log) { preg_match_all ('/[[]T[\d]+[]]/', $Log, $Matches ); - foreach($Matches as $Match) - { + foreach($Matches as $Match) { $Result = preg_replace ('/[[]T([\d]+)[]]/', '\1', $Match); } return $Result; @@ -89,17 +85,17 @@ function getInvolvedTasks($Log) * * @return array Array of lines of Log Message. */ -function getLog($Input) -{ +function getLog($Input) { $Lines = explode("\n", $Input); $ii = count($Lines); $Logging=false; - for ( $i=0; $i < $ii ; $i++ ) - { - if ($Logging==true) + for ( $i=0; $i < $ii ; $i++ ) { + if ($Logging==true) { $Log.=$Lines[$i]."\n"; - if ($Lines[$i]=='Log Message:') + } + if ($Lines[$i]=='Log Message:') { $Logging=true; + } } return trim($Log); } diff --git a/src/plugins/scmhook/library/scmsvn/hooks/commitemail/commit-email.php b/src/plugins/scmhook/library/scmsvn/hooks/commitemail/commit-email.php index ae8b97a..6cca2e3 100755 --- a/src/plugins/scmhook/library/scmsvn/hooks/commitemail/commit-email.php +++ b/src/plugins/scmhook/library/scmsvn/hooks/commitemail/commit-email.php @@ -37,10 +37,13 @@ putenv("LANG=en_US.UTF-8"); if(!file_exists($svnlook) || !file_exists($commit_email_pl)) { die("Missing required executables."); } # Find who made the changes -if($argc < 4) { die("Invalid arguments."); } +if($argc < 4) { + die("Invalid arguments."); +} $users_host = forge_get_config('users_host'); -if (!empty($users_host)) - $hostname = "-h $users_host"; +if (!empty($users_host)) { + $hostname = "-h $users_host"; +} passthru("$commit_email_pl \"$argv[1]\" $argv[2] $hostname $argv[3]", $ret); exit($ret); // warn SVN if something went wrong diff --git a/src/plugins/scmsvn/common/SVNPlugin.class.php b/src/plugins/scmsvn/common/SVNPlugin.class.php index c9d6ab8..4aca55c 100644 --- a/src/plugins/scmsvn/common/SVNPlugin.class.php +++ b/src/plugins/scmsvn/common/SVNPlugin.class.php @@ -366,9 +366,9 @@ some control over it to the project's administrator."); function createOrUpdateRepo($params) { $project = $this->checkParams($params); - if (!$project) return false; - if (!$project->isActive()) return false; - + if (!$project) { + return false; + } $repo_prefix = forge_get_config('repos_path', 'scmsvn'); if (!is_dir($repo_prefix) && !mkdir($repo_prefix, 0755, true)) { return false; @@ -772,10 +772,11 @@ some control over it to the project's administrator."); curl_close($ch); // final checks - if (!xml_parse($xml_parser, '', true)) + if (!xml_parse($xml_parser, '', true)) { $this->setError('Unable to parse XML with error ' . xml_error_string(xml_get_error_code($xml_parser)) . ' on line ' . xml_get_current_line_number($xml_parser)); + } xml_parser_free($xml_parser); if ($adds > 0 || $updates > 0 || $commits > 0 || $deletes > 0) { @@ -830,10 +831,11 @@ some control over it to the project's administrator."); // Grab&parse commit log $protocol = forge_get_config('use_ssl', 'scmsvn') ? 'https://' : 'http://'; $u = session_get_user(); - if ($project->enableAnonSCM()) + if ($project->enableAnonSCM()) { $server_script = '/anonscm/svnlog'; - else + } else { $server_script = '/authscm/'.$u->getUnixName().'/svnlog'; + } if ($user) { $userunixname = $user->getUnixName(); $params = '&mode=latest_user&user_name='.$userunixname; @@ -861,10 +863,11 @@ some control over it to the project's administrator."); curl_close($ch); // final checks - if (!xml_parse($xml_parser, '', true)) + if (!xml_parse($xml_parser, '', true)) { $this->setError('Unable to parse XML with error ' . xml_error_string(xml_get_error_code($xml_parser)) . ' on line ' . xml_get_current_line_number($xml_parser)); + } xml_parser_free($xml_parser); if ($adds > 0 || $updates > 0 || $commits > 0 || $deletes > 0) { diff --git a/src/plugins/webanalytics/www/index.php b/src/plugins/webanalytics/www/index.php index 476d8c9..893c44d 100644 --- a/src/plugins/webanalytics/www/index.php +++ b/src/plugins/webanalytics/www/index.php @@ -30,7 +30,6 @@ if (!$type) { exit_missing_param($_SERVER['HTTP_REFERER'], array('No TYPE specified'), 'webanalytics'); } -global $use_tooltips; $webanalytics = plugin_get_object('webanalytics'); switch ($type) { ----------------------------------------------------------------------- Summary of changes: src/common/include/SCMPlugin.class.php | 2 + src/common/tracker/actions/format_csv.php | 18 ++++----- src/plugins/blocks/www/index.php | 22 +++++------ .../ckeditor/common/ckeditorPlugin.class.php | 8 +++- .../extsubproj/include/extsubprojPlugin.class.php | 4 +- .../view/admin/viewProjectConfiguration.php | 3 +- .../gravatar/common/gravatarPlugin.class.php | 18 +++++---- src/plugins/headermenu/action/validateOrder.php | 3 +- .../headermenu/common/headermenuPlugin.class.php | 33 ++++++++-------- src/plugins/headermenu/www/index.php | 1 - src/plugins/mantisbt/action/addAttachment.php | 4 +- src/plugins/mantisbt/action/addVersion.php | 4 +- src/plugins/mantisbt/action/deleteNote.php | 4 +- src/plugins/mantisbt/action/deleteVersion.php | 4 +- .../mantisbt/common/MantisBTPlugin.class.php | 22 +++++------ src/plugins/mantisbt/controler/filter.php | 6 ++- src/plugins/mantisbt/controler/filter_roadmap.php | 8 ++-- src/plugins/mantisbt/view/addIssue.php | 4 +- src/plugins/mantisbt/view/addOrEditNote.php | 4 +- src/plugins/mantisbt/view/admin/StatPerStatus.php | 4 +- src/plugins/mantisbt/view/admin/editVersion.php | 4 +- src/plugins/mantisbt/view/admin/viewCategorie.php | 4 +- .../mantisbt/view/admin/viewConfiguration.php | 1 - src/plugins/mantisbt/view/admin/viewVersion.php | 4 +- src/plugins/mantisbt/view/editIssue.php | 4 +- src/plugins/mantisbt/view/roadmap.php | 4 +- src/plugins/mantisbt/view/viewAttachment.php | 8 ++-- src/plugins/mantisbt/view/viewIssue.php | 6 +-- src/plugins/mantisbt/view/viewNote.php | 6 +-- src/plugins/mediawiki/bin/mw-plugin-init.php | 6 +-- .../mediawiki/common/mediawikiPlugin.class.php | 22 ++++++----- src/plugins/mediawiki/www/plugin_admin.php | 39 ++++++++++--------- .../moinmoin/common/MoinMoinPlugin.class.php | 20 +++------- .../common/ProjectLabelsPlugin.class.php | 5 +-- .../projects-hierarchy/actions/addChild.php | 8 ++-- .../actions/projectsHierarchyDocman.php | 4 +- .../projects-hierarchy/actions/removeChild.php | 4 +- .../projects-hierarchy/actions/removeParent.php | 4 +- .../actions/validateRelationship.php | 4 +- .../common/projects-hierarchyPlugin.class.php | 7 ++-- .../view/admin/viewProjectConfiguration.php | 9 +++-- src/plugins/quotamanagement/action/update.php | 4 +- .../common/quotamanagementPlugin.class.php | 4 +- src/plugins/quotamanagement/view/quota.php | 5 ++- src/plugins/quotamanagement/view/quota_admin.php | 4 +- src/plugins/quotamanagement/view/quota_project.php | 4 +- src/plugins/scmarch/common/ArchPlugin.class.php | 26 ++++++------- src/plugins/scmbzr/common/BzrPlugin.class.php | 16 ++++++-- src/plugins/scmccase/common/CCasePlugin.class.php | 12 +----- src/plugins/scmcpold/common/CpoldPlugin.class.php | 4 +- src/plugins/scmcvs/common/CVSPlugin.class.php | 44 +++++++++++----------- src/plugins/scmcvs/cronjobs/usergroup.php | 43 ++++++++++----------- src/plugins/scmdarcs/common/DarcsPlugin.class.php | 8 +++- src/plugins/scmgit/libexec/gitlog.php | 24 ++++++++---- src/plugins/scmhg/common/HgPlugin.class.php | 16 +++----- src/plugins/scmhg/libexec/hglog.php | 26 +++++-------- src/plugins/scmhook/common/scmhookPlugin.class.php | 32 +++++++++------- .../library/scmgit/hooks/committracker/post.php | 24 +++++------- .../scmsvn/hooks/commitemail/commit-email.php | 9 +++-- src/plugins/scmsvn/common/SVNPlugin.class.php | 17 +++++---- src/plugins/webanalytics/www/index.php | 1 - 61 files changed, 343 insertions(+), 329 deletions(-) hooks/post-receive -- FusionForge _______________________________________________ Fusionforge-commits mailing list Fusionforge-commits@lists.fusionforge.org http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits