[Fusionforge-commits] r13570 - in trunk/src/plugins/quota_management: common www

Franck VILLAUME nerville at fusionforge.org
Fri Jun 24 11:17:01 CEST 2011


Author: nerville
Date: 2011-06-24 11:17:01 +0200 (Fri, 24 Jun 2011)
New Revision: 13570

Modified:
   trunk/src/plugins/quota_management/common/quota_managementPlugin.class.php
   trunk/src/plugins/quota_management/www/index.php
Log:
remove useless code

Modified: trunk/src/plugins/quota_management/common/quota_managementPlugin.class.php
===================================================================
--- trunk/src/plugins/quota_management/common/quota_managementPlugin.class.php	2011-06-23 16:13:23 UTC (rev 13569)
+++ trunk/src/plugins/quota_management/common/quota_managementPlugin.class.php	2011-06-24 09:17:01 UTC (rev 13570)
@@ -28,8 +28,6 @@
 		$this->Plugin() ;
 		$this->name = "quota_management";
 		$this->text = "Quota Management"; // To show in the tabs, use...
-		$this->_addHook('user_personal_links');//to make a link to the user's personal part of the plugin
-		$this->_addHook('usermenu');
 		$this->_addHook('groupisactivecheckbox'); // The "use ..." checkbox in editgroupinfo
 		$this->_addHook('groupisactivecheckboxpost'); //
 		$this->_addHook('userisactivecheckbox'); // The "use ..." checkbox in user account
@@ -42,25 +40,7 @@
 
 	function CallHook($hookname, &$params) {
 		global $use_quota_managementplugin, $G_SESSION, $HTML;
-		if ($hookname == "usermenu") {
-			$text = $this->text; // this is what shows in the tab
-			if ($G_SESSION->usesPlugin("quota_management")) {
-				$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/quota_management/index.php'.$param ), array(_('Manage your quota')));
-			}
-		} elseif ($hookname == "user_personal_links") {
-			// this displays the link in the user's profile page to it's personal quota_management (if you want other sto access it, youll have to change the permissions in the index.php
-			$userid = $params['user_id'];
-			$user = user_get_object($userid);
-			//check if the user has the plugin activated
-			if ($user->usesPlugin($this->name)) {
-				echo '	<p>' ;
-				echo util_make_link ("/plugins/quota_management/index.php?id=$userid&type=user&pluginname=".$this->name,
-						     _('View Personal quota_management')
-					) ;
-				echo '</p>';
-			}
-		} elseif ($hookname == "project_admin_plugins") {
+		if ($hookname == "project_admin_plugins") {
 			// this displays the link in the project admin options page to it's  quota_management administration
 			$group_id = $params['group_id'];
 			$group = &group_get_object($group_id);

Modified: trunk/src/plugins/quota_management/www/index.php
===================================================================
--- trunk/src/plugins/quota_management/www/index.php	2011-06-23 16:13:23 UTC (rev 13569)
+++ trunk/src/plugins/quota_management/www/index.php	2011-06-24 09:17:01 UTC (rev 13570)
@@ -35,25 +35,14 @@
 	site_project_header($params);
 }
 
-// the header that displays for the user portion of the plugin
-function quota_management_User_Header($params) {
-	global $user_id;
-	$params['toptab'] = 'quota_management';
-	$params['user'] = $user_id;
-	/*
-	 Show horizontal links
-	 */
-	site_user_header($params);
-}
-
 $user = session_get_user(); // get the session user
 
 if (!$user || !is_object($user)) {
-	exit_error(_('Invalid User'),'home');
+	exit_error(_('Invalid User'), 'home');
 } else if ( $user->isError() ) {
-	exit_error($user->getErrorMessage,'home');
+	exit_error($user->getErrorMessage, 'home');
 } else if ( !$user->isActive()) {
-	exit_error(_('User not active'),'home');
+	exit_error(_('User not active'), 'home');
 }
 
 $type = getStringFromRequest('type');
@@ -79,18 +68,6 @@
 		}
 		quota_management_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));
 		include('quota_management/www/quota_project.php');
-	} elseif ($type == '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->getID() != $id)) { // if someone else tried to access the private quota_management part of this user
-			exit_permission_denied(sprintf(_('You cannot access other user\'s personal %s'),$pluginname),'my');
-		}
-		quota_management_User_Header(array('title'=>'My '.$pluginname,'pagename'=>"$pluginname",'sectionvals'=>array($realuser->getUnixName())));
-		// DO THE STUFF FOR THE USER PART HERE
-		echo "We are in the User quota_management plugin <br>";
-		echo "Greetings from planet " . $world; // $world comes from the config file in /etc
 	} elseif ($type == 'admin') {
 		$group = group_get_object($id);
 		if ( !$group) {
@@ -108,7 +85,7 @@
 			quota_management_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));
 			include('quota_management/www/quota_project.php');
 		} else {
-			exit_permission_denied(_('You are not Admin of this project'),'home');
+			exit_permission_denied(_('You are not Admin of this project'), 'home');
 		}
 	}
 }




More information about the Fusionforge-commits mailing list