[Fusionforge-commits] r11766 - in trunk/src/plugins/mantisbt: common view/admin www www/user

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Fri Dec 10 20:44:23 CET 2010


Author: nerville
Date: 2010-12-10 20:44:23 +0100 (Fri, 10 Dec 2010)
New Revision: 11766

Modified:
   trunk/src/plugins/mantisbt/common/MantisBTPlugin.class.php
   trunk/src/plugins/mantisbt/view/admin/StatPerStatus.php
   trunk/src/plugins/mantisbt/view/admin/viewCategorie.php
   trunk/src/plugins/mantisbt/view/admin/viewVersion.php
   trunk/src/plugins/mantisbt/www/index.php
   trunk/src/plugins/mantisbt/www/user/index.php
Log:
fix warning and user view

Modified: trunk/src/plugins/mantisbt/common/MantisBTPlugin.class.php
===================================================================
--- trunk/src/plugins/mantisbt/common/MantisBTPlugin.class.php	2010-12-10 17:53:09 UTC (rev 11765)
+++ trunk/src/plugins/mantisbt/common/MantisBTPlugin.class.php	2010-12-10 19:44:23 UTC (rev 11766)
@@ -61,8 +61,9 @@
 				$text = $this->text; // this is what shows in the tab
 				if ($G_SESSION->usesPlugin($this->name)) {
 					$param = '?type=user&id=' . $G_SESSION->getId() . '&pluginname=' . $this->name; // we indicate the part we're calling is the user one
-					echo $HTML->PrintSubMenu(array($text), array('/plugins/mantisbt/index.php' . $param ));
+					echo $HTML->PrintSubMenu(array($text), array('/plugins/mantisbt/index.php' . $param));
 				}
+				$returned = true;
 				break;
 			}
 			case "groupmenu": {
@@ -78,6 +79,7 @@
 				if ($params['toptab'] == $this->name) {
 					$params['selected']=(count($params['TITLES'])-1);
 				}
+				$returned = true;
 				break;
 			}
 			case "user_personal_links": {
@@ -115,11 +117,11 @@
 				$group = group_get_object($group_id);
 				if ($group->usesPlugin($this->name)) {
 					if (!$this->isProjectMantisCreated($group->getID())) {
-						if($this->addProjectMantis($group)) {
+						if($this->addProjectMantis($group->getID())) {
 							$members = array();
 							foreach($group->getMembers() as $member) {
 								$members[] = $member->getUnixName();
-								if($this->updateUsersProjectMantis($group, $members)) {
+								if($this->updateUsersProjectMantis($group->getID(), $members)) {
 									$group->setPluginUse($this->name);
 									$returned = true;
 								};
@@ -201,11 +203,11 @@
 		$returned = false;
 		if ( getStringFromRequest($flag) == 1 ) {
 			if (!$this->isProjectMantisCreated($group->getID())) {
-				if($this->addProjectMantis($group)) {
+				if($this->addProjectMantis($group->getID())) {
 					$members = array();
 					foreach($group->getMembers() as $member) {
 						$members[] = $member->getUnixName();
-						if($this->updateUsersProjectMantis($group, $members)) {
+						if($this->updateUsersProjectMantis($group->getID(), $members)) {
 							$group->setPluginUse($this->name);
 							$returned = true;
 						};
@@ -398,7 +400,7 @@
 							WHERE users.user_name = $1
 							AND ( user_group.user_id = users.user_id AND user_group.group_id = $2 )
 							AND user_group.role_id = role.role_id',
-							array($member, $groupObject->getID));
+							array($member, $groupObject->getID()));
 			if (!$resUserRole) {
 				$groupObject->setError('updateUsersProjectMantis::'. _('Error : Cannot retrieve information about role') . ' ' .db_error());
 				return $returned;
@@ -410,7 +412,7 @@
 		}
 
 		if ($this->__getDBType() === "pgsql") {
-			if ($this->__updateUsersProjectMantisPgsql($groupObject, $stateForge)) {
+			if ($this->__updateUsersProjectMantisPgsql($groupObject->getID(), $stateForge)) {
 				$returned = true;
 			}
 		}

Modified: trunk/src/plugins/mantisbt/view/admin/StatPerStatus.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/StatPerStatus.php	2010-12-10 17:53:09 UTC (rev 11765)
+++ trunk/src/plugins/mantisbt/view/admin/StatPerStatus.php	2010-12-10 19:44:23 UTC (rev 11766)
@@ -22,6 +22,7 @@
 
 /* main display */
 global $HTML;
+global $idProjetMantis;
 
 try {
 	/* do not recreate $clientSOAP object if already created by other pages */

Modified: trunk/src/plugins/mantisbt/view/admin/viewCategorie.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/viewCategorie.php	2010-12-10 17:53:09 UTC (rev 11765)
+++ trunk/src/plugins/mantisbt/view/admin/viewCategorie.php	2010-12-10 19:44:23 UTC (rev 11766)
@@ -21,8 +21,8 @@
  */
 
 /* view categorie in MantisBt for the dedicated group */
-
 global $HTML;
+global $idProjetMantis;
 
 try {
 	/* do not recreate $clientSOAP object if already created by other pages */

Modified: trunk/src/plugins/mantisbt/view/admin/viewVersion.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/viewVersion.php	2010-12-10 17:53:09 UTC (rev 11765)
+++ trunk/src/plugins/mantisbt/view/admin/viewVersion.php	2010-12-10 19:44:23 UTC (rev 11766)
@@ -24,6 +24,7 @@
 
 /* main display */
 global $HTML;
+global $idProjetMantis;
 
 try {
 	/* do not recreate $clientSOAP object if already created by other pages */

Modified: trunk/src/plugins/mantisbt/www/index.php
===================================================================
--- trunk/src/plugins/mantisbt/www/index.php	2010-12-10 17:53:09 UTC (rev 11765)
+++ trunk/src/plugins/mantisbt/www/index.php	2010-12-10 19:44:23 UTC (rev 11766)
@@ -66,13 +66,12 @@
 
 $type = getStringFromRequest('type');
 $id = getStringFromRequest('id');
-$idProjetMantis = getIdProjetMantis($id);
 $pluginname = getStringFromRequest('pluginname');
 $feedback = htmlspecialchars(getStringFromRequest('feedback'));
 $error_msg = htmlspecialchars(getStringFromRequest('error_msg'));
 $warning_msg = htmlspecialchars(getStringFromRequest('warning_msg'));
 
-$password = '';
+$password = $user->getMD5Passwd();
 $username = $user->getUnixName();
 
 if (!$type) {
@@ -82,11 +81,12 @@
 } else {
 	switch ($type) {
 		case 'group': {
+			$idProjetMantis = getIdProjetMantis($id);
 			$group = group_get_object($id);
-			if ( !$group) {
+			if (!$group) {
 				exit_no_group();
 			}
-			if ( ! ($group->usesPlugin( $pluginname )) ) {//check if the group has the MantisBT plugin active
+			if (!$group->usesPlugin($pluginname)) {//check if the group has the MantisBT plugin active
 				exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'), $pluginname), 'home');
 			}
 			$userperm = $group->getPermission($user);//we'll check if the user belongs to the group (optional)
@@ -114,10 +114,8 @@
 
 			$format = "%07d";
 
-			if($idProjetMantis == 0){
+			if($idProjetMantis == 0) {
 				exit_error(_('Uninitialized Project. Force his activation by desactivate/activate mantisbt for this project'),'home');
-			} else if (is_int($password)){
-				exit_error(_('Impossible de récupérer les identifiants de connexions depuis le LDAP'),'home');
 			} else {
 				// do the job
 				mantisbt_Project_Header(array('title'=>$pluginname . ' Project Plugin!', 'pagename'=>"$pluginname", 'sectionvals'=>array(group_getname($id))));
@@ -127,17 +125,13 @@
 			break;
 		}
 		case 'user': {
-			$realuser = user_get_object($id);//
-			if (!($realuser) || !($realuser->usesPlugin($pluginname))) {
-				exit_error(sprintf(_('First activate the User\'s %s plugin through Account Maintenance Page'),$pluginname),'my');
+			if (!($user) || !($user->usesPlugin($pluginname))) {
+				exit_error(sprintf(_('First activate the User\'s %s plugin through Account Maintenance Page'), $pluginname), 'my');
 			}
 			if ( (!$user) || ($user->getID() != $id)) { // if someone else tried to access the private MantisBT part of this user
-				exit_permission_denied(sprintf(_('You cannot access other user\'s personal %s'),$pluginname),'my');
+				exit_permission_denied(sprintf(_('You cannot access other user\'s personal %s'), $pluginname), 'my');
 			}
 
-			$password ='';
-			$username = $realuser->getUnixName();
-
 			// URL analysis
 			$sort = getStringFromRequest('sort');
 			$dir = getStringFromRequest('dir');
@@ -147,7 +141,7 @@
 			$idNote = getStringFromRequest('idNote');
 			$page = getStringFromRequest('page');
 			// Si la variable $_GET['page'] existe...
-			if($page != null && $page != ''){
+			if($page != null && $page != '') {
 				$pageActuelle=intval($page);
 			} else {
 				$pageActuelle=1; // La page actuelle est la n°1 
@@ -155,14 +149,10 @@
 
 			$format = "%07d";
 
-			if (!is_int($password)) {
-				// do the job
-				mantisbt_User_Header(array('title'=>sprintf(_('My %s'),$pluginname),'pagename'=>"$pluginname",'sectionvals'=>array($realuser->getUnixName())));
-				html_use_tooltips();
-				include ('mantisbt/www/user/index.php');
-			} else {
-				exit_error(_('Impossible de récupérer les identifiants de connexions depuis le LDAP'),'home');
-			}
+			// do the job
+			mantisbt_User_Header(array('title'=>sprintf(_('My %s'), $pluginname), 'pagename'=>"$pluginname", 'sectionvals'=>array($username)));
+			html_use_tooltips();
+			include('mantisbt/www/user/index.php');
 			break;
 		}
 		case 'admin': {

Modified: trunk/src/plugins/mantisbt/www/user/index.php
===================================================================
--- trunk/src/plugins/mantisbt/www/user/index.php	2010-12-10 17:53:09 UTC (rev 11765)
+++ trunk/src/plugins/mantisbt/www/user/index.php	2010-12-10 19:44:23 UTC (rev 11766)
@@ -1,8 +1,8 @@
 <?php
-
 /*
  * User MantisBT page
  * Copyright 2010 (c) Franck Villaume - Capgemini
+ * http://fusionforge.org
  *
  * This file is part of FusionForge.
  *




More information about the Fusionforge-commits mailing list