[Fusionforge-commits] r11115 - in trunk/src: common/include plugins/webcalendar/common www/account www/admin www/register

Roland Mas lolando at libremir.placard.fr.eu.org
Thu Oct 21 16:09:37 CEST 2010


Author: lolando
Date: 2010-10-21 16:09:37 +0200 (Thu, 21 Oct 2010)
New Revision: 11115

Modified:
   trunk/src/common/include/Group.class.php
   trunk/src/common/include/User.class.php
   trunk/src/plugins/webcalendar/common/webcalendarPlugin.class.php
   trunk/src/www/account/register.php
   trunk/src/www/admin/approve-pending.php
   trunk/src/www/admin/userlist.php
   trunk/src/www/register/index.php
Log:
Started porting webcalendar to PFO-RBAC, with a few simplifications on the way

Modified: trunk/src/common/include/Group.class.php
===================================================================
--- trunk/src/common/include/Group.class.php	2010-10-21 14:04:26 UTC (rev 11114)
+++ trunk/src/common/include/Group.class.php	2010-10-21 14:09:37 UTC (rev 11115)
@@ -2392,7 +2392,7 @@
 		//	
 		$params[0] = $idadmin_group ;
 		$params[1] = $this->getID();
-		plugin_hook('group_approve',$params);	
+		plugin_hook('group_approved',$params);	
 
 		return true;
 	}

Modified: trunk/src/common/include/User.class.php
===================================================================
--- trunk/src/common/include/User.class.php	2010-10-21 14:04:26 UTC (rev 11114)
+++ trunk/src/common/include/User.class.php	2010-10-21 14:09:37 UTC (rev 11115)
@@ -689,9 +689,6 @@
 			
 			db_commit();
 			
-			//plugin webcalendar, create cal_user
-			plugin_hook('add_cal_user',$this->getID());
-			
 			return true;
 		}
 	}

Modified: trunk/src/plugins/webcalendar/common/webcalendarPlugin.class.php
===================================================================
--- trunk/src/plugins/webcalendar/common/webcalendarPlugin.class.php	2010-10-21 14:04:26 UTC (rev 11114)
+++ trunk/src/plugins/webcalendar/common/webcalendarPlugin.class.php	2010-10-21 14:09:37 UTC (rev 11115)
@@ -1,12 +1,14 @@
 <?php
-
 /**
  * webcalendarPlugin Class
  *
+ * Copyright 2006, Fabien Regnier <fabien.regnier at sogeti.com>
+ * Copyright 2006, Julien Jeany <julien.jeany at sogeti.com>
+ * Copyright 2010, Roland Mas
  *
- * This file is part of GForge.
+ * This file is part of FusionForge.
  *
- * GForge is free software; you can redistribute it and/or modify
+ * FusionForge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
@@ -38,12 +40,9 @@
 		$this->hooks[] = "call_user_js"; // call a function when you click on webcal (file my/index.php line 434)
 		$this->hooks[] = "call_group_cal"; // to show the calendar of the group (file layout.class.php ligne 627)
 		//$this->hooks[] = "iframe_group_calendar"; // to show the calendar of the group (file  ligne 627)
-		$this->hooks[] = "add_cal_user"; //add a gforge user in calendar base
-		$this->hooks[] = "del_cal_user"; //dell a gforge user in calendar base
-		$this->hooks[] = "add_cal_group"; //add a group user in calendar base
-		$this->hooks[] = "del_cal_group"; //del a gforge user in calendar base
+		$this->hooks[] = "user_setstatus";
+		$this->hooks[] = "group_approved";
 		$this->hooks[] = "change_cal_permission"; //change permission pour webcal user (admin or not)
-		$this->hooks[] = "group_approve"; //change permission pour webcal user (admin or not)
 		$this->hooks[] = "change_cal_permission_auto"; //change permission pour webcal user when you modify role
 		$this->hooks[] = "add_cal_link_father"; // add a link between son and father
 		$this->hooks[] = "del_cal_link_father"; // del a link between son and father
@@ -51,6 +50,11 @@
 		$this->hooks[] = "change_cal_password"; //change the password a webcal user
 		$this->hooks[] = "change_cal_mail"; //change the mail a webcal user
 	        $this->hooks[] = "cal_link_group"; //a link to group calendar
+		$this->hooks[] = "role_get";
+		$this->hooks[] = "role_normalize";
+		$this->hooks[] = "role_translate_strings";
+		$this->hooks[] = "role_has_permission";
+		$this->hooks[] = "list_roles_by_permission";
 	}
 
 	function CallHook ($hookname, $params) {
@@ -159,79 +163,106 @@
 			?>
 			onclick="reload_webcal()"
 			<?php		
+		} elseif ($hookname == "role_get") {
+			$role =& $params['role'] ;
+
+			// Read access
+			$right = new PluginSpecificRoleSetting ($role,
+								'plugin_webcalendar_access') ;
+			$right->SetAllowedValues (array ('0', '1', '2')) ;
+			$right->SetDefaultValues (array ('Admin' => '1',
+							 'Senior Developer' => '1',
+							 'Junior Developer' => '2',
+							 'Doc Writer' => '2',
+							 'Support Tech' => '2')) ;
+		} elseif ($hookname == "role_normalize") {
+			$role =& $params['role'] ;
+			$new_pa =& $params['new_pa'] ;
+
+			if (USE_PFO_RBAC) {
+				$projects = $role->getLinkedProjects() ;		
+				foreach ($projects as $p) {
+					$role->normalizePermsForSection ($new_pa, 'plugin_webcalendar_access', $p->getID()) ;
+				}
+			}
+		} elseif ($hookname == "role_translate_strings") {
+			$right = new PluginSpecificRoleSetting ($role,
+							       'plugin_webcalendar_access') ;
+			$right->setDescription (_('Webcalendar read access')) ;
+			$right->setValueDescriptions (array ('0' => _('No reading'),
+							     '1' => _('Write access'),
+							     '2' => _('Read access'))) ;
+		} elseif ($hookname == "role_has_permission") {
+			if ($params['section'] == 'plugin_webcalendar_access') {
+				switch ($params['action']) {
+				case 'read':
+					$params['result'] |= ($value >= 1) ;
+					break ;
+				case 'write':
+					$params['result'] |= ($value == 1) ;
+					break ;
+				}
+			}
+		} elseif ($hookname == "list_roles_by_permission") {
+			if ($params['section'] == 'plugin_webcalendar_access') {
+				switch ($params['action']) {
+				case 'read':
+					$params['qpa'] = db_construct_qpa ($params['qpa'], ' AND perm_val >= 1') ;
+					break ;
+				case 'write':
+					$params['qpa'] = db_construct_qpa ($params['qpa'], ' AND perm_val = 1') ;
+					break ;
+				}
+			}
 		}
-		elseif ($hookname == "add_cal_user") { 
-				//argument user_id
-				//user.class.php line 590
-				//admin/userlist.php line 129
-			$res = db_query_params ('SELECT user_name,user_pw,email FROM users WHERE user_id = $1',
-						array ($params));
+		elseif ($hookname == "user_setstatus") { 
+			$user = $params['user'] ;
+			$status = $params['status'] ;
+			
+			if ($status == 'A') {
+				$res_cal = db_query_params ('SELECT COUNT(*) FROM webcal_user WHERE cal_login=$1',
+							    array ($user->getUnixName())) ;
 				$row = db_fetch_array($res);
-				$res_cal = db_query_params ('INSERT INTO webcal_user (cal_login, cal_passwd, cal_email,cal_firstname, cal_is_admin) VALUES ($1,$2,$3,$4,$5)',
-			array ($row['user_name'] ,
-				$row['user_pw'] ,
-				$row['email'] ,
-				$row['user_name'] ,
-				'N'));
+				if ($row[0] == 0) {
+					db_query_params ('INSERT INTO webcal_user (cal_login, cal_passwd, cal_email,cal_firstname, cal_is_admin) VALUES ($1,$2,$3,$4,$5)',
+								    array ($user->getUnixName(),
+									   $user->getUserPw(),
+									   $user->getEmail(),
+									   $user->getFirstName(),
+									   'N'));
+				}
+			} else {
+				db_query_params ('DELETE FROM webcal_user WHERE cal_login = $1',
+							    array ($user->getUnixName()));	
+				db_query_params ('DELETE FROM webcal_asst WHERE cal_boss = $1 OR cal_assistant = $2',
+						 array ($user->getUnixName(),
+							$user->getUnixName())) ;
+				db_query_params ('DELETE FROM webcal_entry_user WHERE cal_login = $1 ',
+						 array ($user->getUnixName())) ;
+			}
+		} elseif ($hookname == "group_approved") {
+			$project = group_get_object ($params['group_id']) ;
+			
+			$emails = array () ;
+			foreach ($project->getAdmins() as $u) {
+				$emails[] = $u->getEmail() ;
+			}
+			
+			db_query_params ('INSERT INTO webcal_user (cal_login, cal_passwd, cal_firstname,cal_email) VALUES ($1,$2,$3,$4)',
+					 array ($project->getUnixName(),
+						'cccc',
+						$project->getUnixName(),
+						implode (',', $emails)));
 		}
-		elseif ($hookname == "del_cal_user") { 
-				//argument user_id
-				//admin/userlist.php line 122
-			$res = db_query_params ('SELECT user_name,user_pw,email FROM users WHERE user_id = $1',
-			array ($params));
-				$row = db_fetch_array($res);
-				$res_cal = db_query_params ('DELETE FROM webcal_user WHERE cal_login = $1',
-			array ($row['user_name'] ));	
-db_query_params ('DELETE FROM webcal_asst WHERE cal_boss = $1 OR cal_assistant = $2',
-			array ($row['user_name'] ,
-				$row['user_name'] ));
-db_query_params ('DELETE FROM webcal_entry_user WHERE cal_login = $1 ',
-			array ($row['user_name'] ));
-		}
-		elseif ($hookname == "add_cal_group") {
-				//argument group_id
-				//approve_pending.php line 69,80 
-								$res = db_query_params ('SELECT  unix_group_name,groups.group_id,group_name,email FROM groups,users,user_group WHERE groups.group_id = $1 AND groups.group_id = user_group.group_id AND user_group.user_id = users.user_id AND user_group.admin_flags = $2 ',
-			array ($params,
-				'A'));
-				$row = db_fetch_array($res);
-				$res_cal = db_query_params ('INSERT INTO webcal_user (cal_login, cal_passwd, cal_firstname,cal_email) VALUES ($1,$2,$3,$4)',
-			array ($row['unix_group_name'] ,
-				'cccc',
-				addslashes($row['group_name']) ,
-				$row['email']));
+		elseif ($hookname == "group_approve") {
+			$res = db_query_params ('SELECT admin_flags FROM user_group WHERE user_id = $1 AND group_id = $2',
+						array ($params[0],
+						       $params[1]));
+			$row_flags = db_fetch_array($res);
+				 
 				
-		
-		}
-		elseif ($hookname == "del_cal_group") {
-				//argument group_id
-				//approve_pending.php line 90 
-								$res = db_query_params ('SELECT  unix_group_name,group_id,group_name FROM groups WHERE group_id = $1 ',
-			array ($params));
-				$row = db_fetch_array($res);
-				$res_cal = db_query_params ('DELETE FROM webcal_user WHERE cal_login = $1',
-			array ($row['unix_group_name'] ));
-db_query_params ('DELETE FROM webcal_asst WHERE cal_boss = $1 OR cal_assistant = $2',
-			array ($row['unix_group_name'] ,
-				$row['unix_group_name'] ));
-db_query_params ('DELETE FROM webcal_entry_user WHERE cal_login = $1 ',
-			array ($row['unix_group_name'] ));
-		}
-		elseif ($hookname == "change_cal_permission") {
-				//argument user_id -> $params[0]et group_id -> $params[1]
-				//project/admin/index.php line 72,87,103
-				//project/admin/massfinish.php line 50
 				
-				
-				
-								
-			$res = db_query_params ('SELECT value,admin_flags FROM user_group,role_setting WHERE role_setting.role_id = user_group.role_id AND user_group.user_id = $1 AND user_group.group_id = $2 AND role_setting.section_name = $3',
-			array ($params[0],
-				$params[1],
-				'webcal'));
-				$row_flags = db_fetch_array($res);
-				
-				//get user name :
+				//get user name
 				$res_nom_boss = db_query_params ('SELECT unix_group_name FROM groups WHERE group_id = $1 ',
 			array ($params[1]));
 				$row_nom_boss = db_fetch_array($res_nom_boss);
@@ -241,36 +272,20 @@
 			array ($params[0]));
 				$row_nom_user = db_fetch_array($res_nom_user);
 				
-				//flag verification
+				//verif du flag sur webcal
 				$res = db_query_params ('SELECT COUNT(*) FROM webcal_asst WHERE cal_boss = $1 AND cal_assistant = $2',
 			array ($row_nom_boss['unix_group_name'],
 				$row_nom_user['user_name']));
 				$row_num = db_fetch_array($res);
 				
-				//select email
+				 //select email
 				$res_mail = db_query_params ('SELECT cal_email FROM webcal_user WHERE  cal_login = $1',
 			array ($row_nom_boss['unix_group_name']));
 				$row_mail = db_fetch_array($res_mail);
-				$mail = $row_mail['cal_email'] ;
+				$mail = $row_mail['cal_email']; 
 				
-				//if group admin
-				if($params[1] == 1){
-					$res_flags_admin = db_query_params ('SELECT admin_flags FROM user_group WHERE user_id = $1 AND group_id = $2',
-									    array ($params[0],
-										   $params[1]));
-					$row_flags_admin = db_fetch_array($res_flags_admin);
-					if(trim($row_flags_admin['admin_flags']) == 'A'  ) {
-						$cia = 'Y' ;
-					} else {
-						$cia = 'N' ;
-					}
-					db_query_params ('UPDATE webcal_user SET cal_is_admin = $1 WHERE cal_login = $2',
-							 array ($cia,
-								$row_nom_user['user_name']));
-				}
-
-				if(($row_num[0] != 1 ) && ($row_flags['value'] == 1)){
-					
+				if(($row_num[0] != 1 ) && (trim($row_flags['admin_flags']) == 'A')){
+					//recuperer le nom du user et du group
 					$res_insert = db_query_params ('INSERT INTO webcal_asst (cal_boss, cal_assistant) VALUES ($1,$2)',
 			array ($row_nom_boss['unix_group_name'],
 				$row_nom_user['user_name']));
@@ -287,15 +302,13 @@
 					}
 									
 				$mail = $mail.$virgule.$row_nom_user['email'] ;
-				
-				
-				
+								
 				//$mail = $row_mail['cal_email'].",".$row_nom_user['email'] ;
 				db_query_params ('UPDATE webcal_user SET cal_email = $1 WHERE cal_login = $2',
 						 array (trim($mail,','),
 							$row_nom_boss['unix_group_name']));
 				}
-				elseif($row_num[0] == 1 && ($row_flags['value'] != 1)){
+				elseif($row_num[0] == 1 && (trim($row_flags['admin_flags']) != 'A')){
 					$res_del = db_query_params ('DELETE FROM webcal_asst WHERE cal_boss = $1 AND cal_assistant = $2',
 			array ($row_nom_boss['unix_group_name'],
 				$row_nom_user['user_name']));	
@@ -306,73 +319,101 @@
 			array ($mail,
 				$row_nom_boss['unix_group_name']));
 				}
+				
 		}
-		elseif ($hookname == "group_approve") {
-			$res = db_query_params ('SELECT admin_flags FROM user_group WHERE user_id = $1 AND group_id = $2',
-						array ($params[0],
-						       $params[1]));
-			$row_flags = db_fetch_array($res);
-				 
+		elseif ($hookname == "change_cal_permission") {
+			//argument user_id -> $params[0]et project_id -> $params[1]
+			//project/admin/index.php line 72,87,103
+			//project/admin/massfinish.php line 50
+
+			$user_id = $params[0] ;
+			$project_id = $params[1] ;
+
+			$project = group_get_object ($project_id) ;
+			$user = user_get_object ($user_id) ;
+			
+			if (USE_PFO_RBAC) {
+				if (forge_check_perm_for_user ($user, 'plugin_webcalendar_access', $project_id, 'write')) {
+					$user_perm = 1 ;
+				} elseif (forge_check_perm_for_user ($user, 'plugin_webcalendar_access', $project_id, 'read')) {
+					$user_perm = 2 ;
+				} else {
+					$user_perm = 0 ;
+				}
+			} else {
+				$res = db_query_params ('SELECT value,admin_flags FROM user_group,role_setting WHERE role_setting.role_id = user_group.role_id AND user_group.user_id = $1 AND user_group.group_id = $2 AND role_setting.section_name = $3',
+							array ($user_id,
+							       $project_id,
+							       'webcal'));
+				$row_flags = db_fetch_array($res);
+				$user_perm = $row_flags['value'] ;
+			}
 				
+			//flag verification
+			$res = db_query_params ('SELECT COUNT(*) FROM webcal_asst WHERE cal_boss = $1 AND cal_assistant = $2',
+						array ($project->getUnixName(),
+						       $user->getUnixName()));
+			$row_num = db_fetch_array($res);
 				
-				//get user name
-				$res_nom_boss = db_query_params ('SELECT unix_group_name FROM groups WHERE group_id = $1 ',
-			array ($params[1]));
-				$row_nom_boss = db_fetch_array($res_nom_boss);
+			//select email
+			$res_mail = db_query_params ('SELECT cal_email FROM webcal_user WHERE cal_login = $1',
+						     array ($project->getUnixName()));
+			$row_mail = db_fetch_array($res_mail);
+			$mail = $row_mail['cal_email'] ;
 				
+			//if group admin
+			if($project_id == 1){
+				$res_flags_admin = db_query_params ('SELECT admin_flags FROM user_group WHERE user_id = $1 AND group_id = $2',
+								    array ($user_id,
+									   $project_id));
+				$row_flags_admin = db_fetch_array($res_flags_admin);
+				if(trim($row_flags_admin['admin_flags']) == 'A'  ) {
+					$cia = 'Y' ;
+				} else {
+					$cia = 'N' ;
+				}
+				db_query_params ('UPDATE webcal_user SET cal_is_admin = $1 WHERE cal_login = $2',
+						 array ($cia,
+							$user->getUnixName()));
+			}
+
+			if(($row_num[0] != 1 ) && ($user_perm == 1)){
+					
+				$res_insert = db_query_params ('INSERT INTO webcal_asst (cal_boss, cal_assistant) VALUES ($1,$2)',
+							       array ($project->getUnixName(),
+								      $user->getUnixName()));
 				
-				$res_nom_user = db_query_params ('SELECT user_name,email FROM users WHERE user_id = $1 ',
-			array ($params[0]));
-				$row_nom_user = db_fetch_array($res_nom_user);
-				
-				//verif du flag sur webcal
-				$res = db_query_params ('SELECT COUNT(*) FROM webcal_asst WHERE cal_boss = $1 AND cal_assistant = $2',
-			array ($row_nom_boss['unix_group_name'],
-				$row_nom_user['user_name']));
-				$row_num = db_fetch_array($res);
-				
-				 //select email
-				$res_mail = db_query_params ('SELECT cal_email FROM webcal_user WHERE  cal_login = $1',
-			array ($row_nom_boss['unix_group_name']));
-				$row_mail = db_fetch_array($res_mail);
-				$mail = $row_mail['cal_email']; 
-				
-				if(($row_num[0] != 1 ) && (trim($row_flags['admin_flags']) == 'A')){
-					//recuperer le nom du user et du group
-					$res_insert = db_query_params ('INSERT INTO webcal_asst (cal_boss, cal_assistant) VALUES ($1,$2)',
-			array ($row_nom_boss['unix_group_name'],
-				$row_nom_user['user_name']));
-				
 				//we add email of the new admin
-				$mail = str_replace($row_nom_user['email'],"",$mail);
-				$mail = str_replace(",".$row_nom_user['email'],"",$mail);
+				$mail = str_replace($user->getEmail(),"",$mail);
+				$mail = str_replace(",".$user->getEmail(),"",$mail);
 								
 				if($mail == ""){
 					$virgule = "";	
-					}
+				}
 				else {
 					$virgule = ",";	
-					}
+				}
 									
-				$mail = $mail.$virgule.$row_nom_user['email'] ;
-								
+				$mail = $mail.$virgule.$user->getEmail() ;
+				
+				
+				
 				//$mail = $row_mail['cal_email'].",".$row_nom_user['email'] ;
 				db_query_params ('UPDATE webcal_user SET cal_email = $1 WHERE cal_login = $2',
 						 array (trim($mail,','),
-							$row_nom_boss['unix_group_name']));
-				}
-				elseif($row_num[0] == 1 && (trim($row_flags['admin_flags']) != 'A')){
-					$res_del = db_query_params ('DELETE FROM webcal_asst WHERE cal_boss = $1 AND cal_assistant = $2',
-			array ($row_nom_boss['unix_group_name'],
-				$row_nom_user['user_name']));	
+							$project->getUnixName()));
+			}
+			elseif($row_num[0] == 1 && ($user_perm != 1)){
+				$res_del = db_query_params ('DELETE FROM webcal_asst WHERE cal_boss = $1 AND cal_assistant = $2',
+							    array ($project->getUnixName(),
+								   $user->getUnixName()));	
 				
 				//we del email of the old admin
 				$mail = str_replace(",".$row_nom_user['email'],"",$row_mail['cal_email']) ;
-db_query_params ('UPDATE webcal_user SET cal_email = $1 WHERE cal_login = $2',
-			array ($mail,
-				$row_nom_boss['unix_group_name']));
-				}
-				
+				db_query_params ('UPDATE webcal_user SET cal_email = $1 WHERE cal_login = $2',
+						 array ($mail,
+							$project->getUnixName()));
+			}
 		}
 		elseif ($hookname == "change_cal_permission_auto") {
 			$res = db_query_params ('SELECT value, user_id FROM user_group,role_setting WHERE role_setting.role_id = user_group.role_id AND role_setting.section_name = $1 AND group_id = $2',

Modified: trunk/src/www/account/register.php
===================================================================
--- trunk/src/www/account/register.php	2010-10-21 14:04:26 UTC (rev 11114)
+++ trunk/src/www/account/register.php	2010-10-21 14:09:37 UTC (rev 11115)
@@ -102,7 +102,6 @@
 					$HTML->footer(array());
 					exit;
 				}
-				plugin_hook('add_cal_user', $unix_name);
 			}
 			if ($send_mail) {
 				echo '<p>';

Modified: trunk/src/www/admin/approve-pending.php
===================================================================
--- trunk/src/www/admin/approve-pending.php	2010-10-21 14:04:26 UTC (rev 11114)
+++ trunk/src/www/admin/approve-pending.php	2010-10-21 14:09:37 UTC (rev 11115)
@@ -52,7 +52,6 @@
 		return false;
 	}
 
-
 	if ($group->approve(session_get_user())) {
 		$feedback .= sprintf(_('Approving Project: %1$s'), $group->getUnixName());
 	} else {
@@ -61,14 +60,6 @@
 		return false;
 	}
 
-	$hook_params = array () ;
-	$hook_params['group_id'] = $group_id ;
-	plugin_hook ("group_approved", $hook_params) ;
-	
-	//plugin webcalendar
-	//create webcal group
-	plugin_hook('add_cal_group',$group_id);
-
 	return true;
 }
 
@@ -79,9 +70,6 @@
 
 	$groups=explode(',', $list_of_groups);
 	array_walk($groups, 'activate_group');
-	//plugin webcalendar
-	//create webcal group
-	plugin_hook('add_cal_group',$group_id);
 
 } else if ($action=='delete') {
 	$group_id = getIntFromRequest('group_id');
@@ -89,9 +77,6 @@
 	$add_to_can = getStringFromRequest('add_to_can');
 	$response_text = getStringFromRequest('response_text');
 	$response_title = getStringFromRequest('response_title');
-	//plugin webcalendar
-	//create webcal group
-	plugin_hook('del_cal_group',$group_id);
 	
 	$group = group_get_object($group_id);
 	if (!$group || !is_object($group)) {

Modified: trunk/src/www/admin/userlist.php
===================================================================
--- trunk/src/www/admin/userlist.php	2010-10-21 14:04:26 UTC (rev 11114)
+++ trunk/src/www/admin/userlist.php	2010-10-21 14:09:37 UTC (rev 11115)
@@ -46,6 +46,9 @@
 		exit_error($u->getErrorMessage(),'home');
 	}
 	if($newStatus=="D") {
+		if(!$u->setStatus($newStatus)) {
+			exit_error($u->getErrorMessage(),'home');
+		}
 		if(!$u->delete(true)) {
 			exit_error($u->getErrorMessage(),'home');
 		}
@@ -123,14 +126,8 @@
 
 if ($action=='delete') {
 	performAction('D', "DELETED", $user_id);
-	//plugin webcal
-	//del webcal user
-	plugin_hook('del_cal_user',$user_id);
 } else if ($action=='activate') {
 	performAction('A', "ACTIVE", $user_id);
-	//plugin webcal
-	//create webcal user
-	plugin_hook('add_cal_user',$user_id);
 } else if ($action=='suspend') {
 	performAction('S', "SUSPENDED", $user_id);
 }

Modified: trunk/src/www/register/index.php
===================================================================
--- trunk/src/www/register/index.php	2010-10-21 14:04:26 UTC (rev 11114)
+++ trunk/src/www/register/index.php	2010-10-21 14:09:37 UTC (rev 11115)
@@ -118,12 +118,6 @@
 				if (!$group->approve( user_get_object_by_name ( $sys_project_reg_autoapprove_user ) ) ) {
 					printf(_('<div class="error">Approval ERROR: %1$s</div>'), $group->getErrorMessage() );
 				} else {
-					$hook_params = array () ;
-					$hook_params['group_id'] = $group_id ;
-					plugin_hook ("group_approved", $hook_params) ;
-
-					plugin_hook('add_cal_group',$group_id);
-
 					printf(_('<p>Your project has been automatically approved.  You should receive an email containing further information shortly.<p/>Thank you for choosing %1$s</p>'), forge_get_config ('forge_name'));
 				}
 			}




More information about the Fusionforge-commits mailing list