4 * webcalendarPlugin Class
7 * This file is part of GForge.
9 * GForge is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * GForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with GForge; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 class webcalendarPlugin extends Plugin {
25 function webcalendarPlugin () {
27 $this->name = "webcalendar" ;
28 $this->text = "Webcalendar" ; // To show in the tabs, use...
29 $this->hooks[] = "user_personal_links";//to make a link to the user´s personal part of the plugin
30 $this->hooks[] = "usermenu" ;
31 $this->hooks[] = "groupmenu" ; // To put into the project tabs
32 $this->hooks[] = "groupisactivecheckbox" ; // The "use ..." checkbox in editgroupinfo
33 $this->hooks[] = "groupisactivecheckboxpost" ; //
34 $this->hooks[] = "userisactivecheckbox" ; // The "use ..." checkbox in user account
35 $this->hooks[] = "userisactivecheckboxpost" ; //
36 $this->hooks[] = "project_admin_plugins"; // to show up in the admin page fro group
37 $this->hooks[] = "call_user_cal"; // to show the calendar of the user (file my/index.php line 434)
38 $this->hooks[] = "call_user_js"; // call a function when you click on webcal (file my/index.php line 434)
39 $this->hooks[] = "call_group_cal"; // to show the calendar of the group (file layout.class ligne 627)
40 //$this->hooks[] = "iframe_group_calendar"; // to show the calendar of the group (file ligne 627)
41 $this->hooks[] = "add_cal_user"; //add a gforge user in calendar base
42 $this->hooks[] = "del_cal_user"; //dell a gforge user in calendar base
43 $this->hooks[] = "add_cal_group"; //add a group user in calendar base
44 $this->hooks[] = "del_cal_group"; //del a gforge user in calendar base
45 $this->hooks[] = "change_cal_permission"; //change permission pour webcal user (admin or not)
46 $this->hooks[] = "change_cal_permission_default"; //change permission pour webcal user (admin or not)
47 $this->hooks[] = "change_cal_permission_auto"; //change permission pour webcal user when you modify role
48 $this->hooks[] = "add_cal_link_father"; // add a link between son and father
49 $this->hooks[] = "del_cal_link_father"; // del a link between son and father
50 $this->hooks[] = "add_cal_link_father_event"; // add a link between son and father
51 $this->hooks[] = "change_cal_password"; //change the password a webcal user
52 $this->hooks[] = "change_cal_mail"; //change the mail a webcal user
53 $this->hooks[] = "cal_link_group"; //a link to group calendar
56 function CallHook ($hookname, $params) {
57 global $use_webcalendarplugin,$G_SESSION,$HTML,$Language;
58 if ($hookname == "usermenu") {
59 $text = $this->text; // this is what shows in the tab
60 if ($G_SESSION->usesPlugin("webcalendar")) {
61 $param = '?type=user&id=' . $G_SESSION->getId() . "&pluginname=" . $this->name; // we indicate the part we´re calling is the user one
62 echo ' | ' . $HTML->PrintSubMenu (array ($text),
63 array ('/plugins/webcalendar/index.php' . $param ));
65 } elseif ($hookname == "groupmenu") {
66 $group_id=$params['group'];
67 $project = &group_get_object($group_id);
68 if (!$project || !is_object($project)) {
71 if ($project->isError()) {
74 if (!$project->isProject()) {
77 if ( !$project->usesPlugin ( $this->name ) ) {
78 $params['TITLES'][]=$this->text;
79 $params['DIRS'][]='/plugins/webcalendar/index2.php?type=group&group_id='.$group_id;
81 $params['TITLES'][]=$this->text." is [Off]";
84 (($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
85 } elseif ($hookname == "groupisactivecheckbox") {
86 ///Check if the group is active
87 } elseif ($hookname == "groupisactivecheckboxpost") {
88 // this code actually activates/deactivates the plugin after the form was submitted in the project edit public info page
89 $group_id=$params['group'];
90 $group = &group_get_object($group_id);
91 $use_webcalendarplugin = getStringFromRequest('use_webcalendarplugin');
92 if ( $use_webcalendarplugin == 1 ) {
93 $group->setPluginUse ( $this->name );
95 $group->setPluginUse ( $this->name, false );
97 } elseif ($hookname == "userisactivecheckbox") {
98 //check if user is active
99 // this code creates the checkbox in the user account manteinance page to activate/deactivate the plugin
100 } elseif ($hookname == "userisactivecheckboxpost") {
101 // this code actually activates/deactivates the plugin after the form was submitted in the user account manteinance page
102 $user = $params['user'];
103 $use_webcalendarplugin = getStringFromRequest('use_webcalendarplugin');
104 if ( $use_webcalendarplugin == 1 ) {
105 $user->setPluginUse ( $this->name );
107 $user->setPluginUse ( $this->name, false );
111 echo ' <input type="CHECKBOX" name="use_webcalendarplugin" value="1" ';
112 // CHECKED OR UNCHECKED?
113 if ( $user->usesPlugin ( $this->name ) ) {
116 echo "> Use ".$this->text." Plugin";
119 } elseif ($hookname == "user_personal_links") {
121 // this displays the link in the user´s profile page to it´s personal webcalendar (if you want other sto access it, youll have to change the permissions in the index.php
122 $userid = $params['user_id'];
123 $user = user_get_object($userid);
124 $text = $params['text'];
125 //check if the user has the plugin activated
126 if ($user->usesPlugin($this->name)) {
128 <a href="/plugins/webcalendar/index.php?id=' . $userid . '&type=user&pluginname=' . $this->name . '">' . _('View Personal webcalendar') .'</a></p>';
130 } elseif ($hookname == "project_admin_plugins") {
132 // this displays the link in the project admin options page to it´s webcalendar administration
133 $group_id = $params['group_id'];
134 $group = &group_get_object($group_id);
136 if ( $group->usesPlugin ( $this->name ) ) {
137 echo '<a href="/plugins/webcalendar/index.php?id=' . $group->getID() . '&type=admin&pluginname=' . $this->name . '">' . _('View the webcalendar Administration') . '</a><br />';
141 elseif ($hookname == "call_user_cal") {
142 //my/index.php line 365
145 <div id="cal" class="tabbertab" title="WebCalendar" >
146 <table width="100%" cellspacing="0" cellpadding="0" border="0" ><tr align="center" ><td >
147 <iframe name="webcal" src="/plugins/webcalendar/login.php?type=user" border=no scrolling="yes" width="100%" height="700"></iframe>
151 function reload_webcal() {
152 frames['webcal'].location.replace('/plugins/webcalendar/login.php?type=user');
158 elseif ($hookname == "call_user_js") {
159 // my/index.php line 67
162 onclick="reload_webcal()"
165 elseif ($hookname == "add_cal_user") {
167 //user.class line 590
168 //admin/userlist.php line 129
169 $query = "SELECT user_name,user_pw,email FROM users WHERE user_id = '".$params."'";
170 $res = db_query($query);
171 $row = db_fetch_array($res);
172 $cal_query = "INSERT INTO webcal_user (cal_login, cal_passwd, cal_email,cal_firstname, cal_is_admin) VALUES ('" . $row['user_name'] . "','" . $row['user_pw'] . "','" . $row['email'] . "','" . $row['user_name'] . "','N')";
173 $res_cal = db_query($cal_query);
175 elseif ($hookname == "del_cal_user") {
177 //admin/userlist.php line 122
178 $query = "SELECT user_name,user_pw,email FROM users WHERE user_id = '".$params."'";
179 $res = db_query($query);
180 $row = db_fetch_array($res);
181 $cal_query = "DELETE FROM webcal_user WHERE cal_login = '" . $row['user_name'] . "'";
182 $res_cal = db_query($cal_query);
183 db_query("DELETE FROM webcal_asst WHERE cal_boss = '" . $row['user_name'] . "' OR cal_assistant = '" . $row['user_name'] . "'");
184 db_query("DELETE FROM webcal_entry_user WHERE cal_login = '" . $row['user_name'] . "' ");
186 elseif ($hookname == "add_cal_group") {
188 //approve_pending.php line 69,80
189 $query = "SELECT unix_group_name,groups.group_id,group_name,email FROM groups,users,user_group WHERE groups.group_id = '".$params."' AND groups.group_id = user_group.group_id AND user_group.user_id = users.user_id AND user_group.admin_flags = 'A' ";
190 $res = db_query($query);
191 $row = db_fetch_array($res);
192 $cal_query = "INSERT INTO webcal_user (cal_login, cal_passwd, cal_firstname,cal_email) VALUES ('" . $row['unix_group_name'] . "','cccc','" . addslashes($row['group_name']) . "','".$row['email']."')";
193 $res_cal = db_query($cal_query);
197 elseif ($hookname == "del_cal_group") {
199 //approve_pending.php line 90
200 $query = "SELECT unix_group_name,group_id,group_name FROM groups WHERE group_id = '".$params."' ";
201 $res = db_query($query);
202 $row = db_fetch_array($res);
203 $cal_query = "DELETE FROM webcal_user WHERE cal_login = '" . $row['unix_group_name'] . "'";
204 $res_cal = db_query($cal_query);
205 db_query("DELETE FROM webcal_asst WHERE cal_boss = '" . $row['unix_group_name'] . "' OR cal_assistant = '" . $row['unix_group_name'] . "'");
206 db_query("DELETE FROM webcal_entry_user WHERE cal_login = '" . $row['unix_group_name'] . "' ");
208 elseif ($hookname == "change_cal_permission") {
209 //argument user_id -> $params[0]et group_id -> $params[1]
210 //project/admin/index.php line 72,87,103
211 //project/admin/massfinish.php line 50
215 $query_flags = "SELECT value,admin_flags FROM user_group,role_setting WHERE role_setting.role_id = user_group.role_id AND user_group.user_id = '".$params[0]."' AND user_group.group_id = '".$params[1]."' AND role_setting.section_name = 'webcal'";
217 $res = db_query($query_flags);
218 $row_flags = db_fetch_array($res);
221 $query_nom_boss = "SELECT unix_group_name FROM groups WHERE group_id = '".$params[1]."' ";
222 $res_nom_boss = db_query($query_nom_boss);
223 $row_nom_boss = db_fetch_array($res_nom_boss);
226 $query_nom_user = "SELECT user_name,email FROM users WHERE user_id = '".$params[0]."' ";
227 $res_nom_user = db_query($query_nom_user);
228 $row_nom_user = db_fetch_array($res_nom_user);
231 $query_flags = "SELECT COUNT(*) FROM webcal_asst WHERE cal_boss = '".$row_nom_boss['unix_group_name']."' AND cal_assistant = '".$row_nom_user['user_name']."'";
232 $res = db_query($query_flags);
233 $row_num = db_fetch_array($res);
236 $query_mail ="SELECT cal_email FROM webcal_user WHERE cal_login = '".$row_nom_boss['unix_group_name']."'";
237 $res_mail = db_query($query_mail);
238 $row_mail = db_fetch_array($res_mail);
239 $mail = $row_mail['cal_email'] ;
243 $query_flags_admin = "SELECT admin_flags FROM user_group WHERE user_id = '".$params[0]."' AND group_id = '".$params[1]."'";
244 $res_flags_admin = db_query($query_flags_admin);
245 $row_flags_admin = db_fetch_array($res_flags_admin);
246 if(trim($row_flags_admin['admin_flags']) == 'A' ) {
247 $update_admin = "UPDATE webcal_user SET cal_is_admin = 'Y' WHERE cal_login = '".$row_nom_user['user_name']."'" ;
250 $update_admin = "UPDATE webcal_user SET cal_is_admin = 'N' WHERE cal_login = '".$row_nom_user['user_name']."'" ;
253 db_query($update_admin);
257 if(($row_num[0] != 1 ) && ($row_flags['value'] == 1)){
259 $insert_ass = "INSERT INTO webcal_asst (cal_boss, cal_assistant) VALUES ('".$row_nom_boss['unix_group_name']."','".$row_nom_user['user_name']."')";
260 $res_insert = db_query($insert_ass);
262 //we add email of the new admin
263 $mail = str_replace($row_nom_user['email'],"",$mail);
264 $mail = str_replace(",".$row_nom_user['email'],"",$mail);
273 $mail = $mail.$virgule.$row_nom_user['email'] ;
277 //$mail = $row_mail['cal_email'].",".$row_nom_user['email'] ;
278 $update = "UPDATE webcal_user SET cal_email = '".trim($mail,',')."' WHERE cal_login = '".$row_nom_boss['unix_group_name']."'" ;
281 elseif($row_num[0] == 1 && ($row_flags['value'] != 1)){
282 $del_ass = "DELETE FROM webcal_asst WHERE cal_boss = '".$row_nom_boss['unix_group_name']."' AND cal_assistant = '".$row_nom_user['user_name']."'";
283 $res_del = db_query($del_ass);
285 //we del email of the old admin
286 $mail = str_replace(",".$row_nom_user['email'],"",$row_mail['cal_email']) ;
287 $update = "UPDATE webcal_user SET cal_email = '".$mail."' WHERE cal_login = '".$row_nom_boss['unix_group_name']."'" ;
293 elseif ($hookname == "change_cal_permission_default") {
294 //argument user_id -> $params[0]et group_id -> $params[1]
295 // Group.class line 2085
296 //$query_flags = "SELECT value FROM user_group,role_setting WHERE role_setting.role_id = user_group.role_id AND user_group.user_id = '".$params[0]."' AND user_group.group_id = '".$params[1]."' AND role_setting.section_name = 'test'";
298 $query_flags = "SELECT admin_flags FROM user_group WHERE user_id = '".$params[0]."' AND group_id = '".$params[1]."'";
299 $res = db_query($query_flags);
300 $row_flags = db_fetch_array($res);
305 $query_nom_boss = "SELECT unix_group_name FROM groups WHERE group_id = '".$params[1]."' ";
306 $res_nom_boss = db_query($query_nom_boss);
307 $row_nom_boss = db_fetch_array($res_nom_boss);
310 $query_nom_user = "SELECT user_name,email FROM users WHERE user_id = '".$params[0]."' ";
311 $res_nom_user = db_query($query_nom_user);
312 $row_nom_user = db_fetch_array($res_nom_user);
314 //verif du flag sur webcal
315 $query_flags = "SELECT COUNT(*) FROM webcal_asst WHERE cal_boss = '".$row_nom_boss['unix_group_name']."' AND cal_assistant = '".$row_nom_user['user_name']."'";
316 $res = db_query($query_flags);
317 $row_num = db_fetch_array($res);
320 $query_mail ="SELECT cal_email FROM webcal_user WHERE cal_login = '".$row_nom_boss['unix_group_name']."'";
321 $res_mail = db_query($query_mail);
322 $row_mail = db_fetch_array($res_mail);
323 $mail = $row_mail['cal_email'];
325 if(($row_num[0] != 1 ) && (trim($row_flags['admin_flags']) == 'A')){
326 //recuperer le nom du user et du group
327 $insert_ass = "INSERT INTO webcal_asst (cal_boss, cal_assistant) VALUES ('".$row_nom_boss['unix_group_name']."','".$row_nom_user['user_name']."')";
328 $res_insert = db_query($insert_ass);
330 //we add email of the new admin
331 $mail = str_replace($row_nom_user['email'],"",$mail);
332 $mail = str_replace(",".$row_nom_user['email'],"",$mail);
341 $mail = $mail.$virgule.$row_nom_user['email'] ;
343 //$mail = $row_mail['cal_email'].",".$row_nom_user['email'] ;
344 $update = "UPDATE webcal_user SET cal_email = '".trim($mail,',')."' WHERE cal_login = '".$row_nom_boss['unix_group_name']."'" ;
347 elseif($row_num[0] == 1 && (trim($row_flags['admin_flags']) != 'A')){
348 $del_ass = "DELETE FROM webcal_asst WHERE cal_boss = '".$row_nom_boss['unix_group_name']."' AND cal_assistant = '".$row_nom_user['user_name']."'";
349 $res_del = db_query($del_ass);
351 //we del email of the old admin
352 $mail = str_replace(",".$row_nom_user['email'],"",$row_mail['cal_email']) ;
353 $update = "UPDATE webcal_user SET cal_email = '".$mail."' WHERE cal_login = '".$row_nom_boss['unix_group_name']."'" ;
358 elseif ($hookname == "change_cal_permission_auto") {
359 //argument $params group_id
360 // project/admin/roleedit.php line 85
362 $query_flags = "SELECT value, user_id FROM user_group,role_setting WHERE role_setting.role_id = user_group.role_id AND role_setting.section_name = 'webcal' AND group_id = '".$params."'" ;
363 $res = db_query($query_flags);
365 while( $row_flags = db_fetch_array($res)){
369 //get the group and user names
370 $query_nom_boss = "SELECT unix_group_name FROM groups WHERE group_id = '".$params."' ";
371 $res_nom_boss = db_query($query_nom_boss);
372 $row_nom_boss = db_fetch_array($res_nom_boss);
375 $query_nom_user = "SELECT user_name,email FROM users WHERE user_id = '".$row_flags['user_id']."' ";
376 $res_nom_user = db_query($query_nom_user);
377 $row_nom_user = db_fetch_array($res_nom_user);
379 //verif if the user is admin
380 $query_flags = "SELECT COUNT(*) FROM webcal_asst WHERE cal_boss = '".$row_nom_boss['unix_group_name']."' AND cal_assistant = '".$row_nom_user['user_name']."'";
381 $res_count = db_query($query_flags);
382 $row_num = db_fetch_array($res_count);
385 $query_mail ="SELECT cal_email FROM webcal_user WHERE cal_login = '".$row_nom_boss['unix_group_name']."'";
386 $res_mail = db_query($query_mail);
387 $row_mail = db_fetch_array($res_mail);
388 $mail = $row_mail['cal_email'];
390 if(($row_num[0] != 1 ) && ($row_flags['value'] == 1)){
391 //recuperer le nom du user et du group
392 $insert_ass = "INSERT INTO webcal_asst (cal_boss, cal_assistant) VALUES ('".$row_nom_boss['unix_group_name']."','".$row_nom_user['user_name']."')";
393 $res_insert = db_query($insert_ass);
395 //we add email of the new admin
396 $mail = str_replace($row_nom_user['email'],"",$mail);
397 $mail = str_replace(",".$row_nom_user['email'],"",$mail);
406 $mail = $mail.$virgule.$row_nom_user['email'] ;
408 //$mail = $row_mail['cal_email'].",".$row_nom_user['email'] ;
409 $update = "UPDATE webcal_user SET cal_email = '".trim($mail,',')."' WHERE cal_login = '".$row_nom_boss['unix_group_name']."'" ;
413 elseif($row_num[0] == 1 && ($row_flags['value'] != 1)){
414 $del_ass = "DELETE FROM webcal_asst WHERE cal_boss = '".$row_nom_boss['unix_group_name']."' AND cal_assistant = '".$row_nom_user['user_name']."'";
415 $res_del = db_query($del_ass);
417 //we del email of the old admin
418 $mail = str_replace(",".$row_nom_user['email'],"",$row_mail['cal_email']) ;
419 $update = "UPDATE webcal_user SET cal_email = '".$mail."' WHERE cal_login = '".$row_nom_boss['unix_group_name']."'" ;
426 elseif ($hookname == "add_cal_link_father") {
427 //argument id du fils --> $params[0], id du pere--> $params[1]
428 //plugin hierachy wait_son.php line 36
429 $query_hierarchy = "select p1.group_id as father_id,p1.unix_group_name as father_unix_name,p1.group_name as father_name,p2.group_id as son_id,p2.unix_group_name as son_unix_name,p2.group_name as son_name from groups as p1,groups as p2,plugin_projects_hierarchy where p1.group_id=plugin_projects_hierarchy.project_id AND plugin_projects_hierarchy.project_id = '".$params[1]."' and p2.group_id=plugin_projects_hierarchy.sub_project_id AND plugin_projects_hierarchy.sub_project_id = '".$params[0]."'and plugin_projects_hierarchy.activated='t' AND plugin_projects_hierarchy.link_type='shar'";
430 $res_hierarchy = db_query($query_hierarchy);
432 while($row_hierarchy = db_fetch_array($res_hierarchy)) {
433 $query_entry = "SELECT cal_id FROM webcal_entry_user WHERE cal_login = '".$row_hierarchy['son_unix_name']."' AND cal_status = 'A'" ;
434 $res_entry = db_query($query_entry);
436 while($row_entry = db_fetch_array($res_entry)) {
437 $insert_entry = "INSERT INTO webcal_entry_user (cal_id,cal_login,cal_status) VALUES ('".$row_entry['cal_id']."','".$row_hierarchy['father_unix_name']."','A')";
438 $res_insert_entry = db_query($insert_entry);
445 elseif ($hookname == "add_cal_link_father_event") {
446 //argument name of the son --> $params[0], id_cal--> $params[1]
447 //webcalendar/edit_entry_handler.php line 390
448 //webcalendar/approve_entry.php line 21
449 $query_nom = "SELECT group_id FROM groups WHERE unix_group_name = '".$params[0]."'";
450 $res_nom = db_query($query_nom);
451 $row_nom = db_fetch_array($res_nom);
452 $query_pere = "SELECT project_id, unix_group_name FROM plugin_projects_hierarchy, groups WHERE plugin_projects_hierarchy.project_id = groups.group_id AND sub_project_id = '".$row_nom['group_id']."' AND link_type = 'shar' AND activated = true";
453 $res_pere = db_query($query_pere);
455 $row_pere = db_fetch_array($res_pere);
456 $insert_entry = "INSERT INTO webcal_entry_user (cal_id,cal_login,cal_status) VALUES ('".$params[1]."','".$row_pere['unix_group_name']."','A')";
457 $res_insert = db_query($insert_entry);
461 elseif ($hookname == "del_cal_link_father") {
462 //argument id son --> $params[0], id father--> $params[1]
463 //plugin hierachy wait_son.php line 36
464 $query_hierarchy = "select p1.group_id as father_id,p1.unix_group_name as father_unix_name,p1.group_name as father_name,p2.group_id as son_id,p2.unix_group_name as son_unix_name,p2.group_name as son_name from groups as p1,groups as p2,plugin_projects_hierarchy where p1.group_id=plugin_projects_hierarchy.project_id AND plugin_projects_hierarchy.project_id = '".$params[1]."' and p2.group_id=plugin_projects_hierarchy.sub_project_id AND plugin_projects_hierarchy.sub_project_id = '".$params[0]."'and plugin_projects_hierarchy.activated='t' AND plugin_projects_hierarchy.link_type='shar'";
465 $res_hierarchy = db_query($query_hierarchy);
467 while($row_hierarchy = db_fetch_array($res_hierarchy)) {
468 $query_entry = "SELECT cal_id FROM webcal_entry_user WHERE cal_login = '".$row_hierarchy['son_unix_name']."' " ;
469 $res_entry = db_query($query_entry);
471 while($row_entry = db_fetch_array($res_entry)) {
472 $insert_entry = "DELETE FROM webcal_entry_user WHERE cal_id = '".$row_entry['cal_id']."' AND cal_login = '".$row_hierarchy['father_unix_name']."'";
473 $res_insert_entry = db_query($insert_entry);
480 elseif ($hookname == "del_cal_link_father_event") {
481 //argument id son --> $params[0], id_cal--> $params[1]
484 elseif ($hookname == "change_cal_password") {
486 //account/change_pw.php line 79
487 $query_name = "SELECT user_name,user_pw,email FROM users WHERE user_id = '".$params."'" ;
488 $res_name = db_query($query_name);
489 $row_name = db_fetch_array($res_name);
491 $update = "UPDATE webcal_user SET cal_passwd = '".$row_name['user_pw']."', cal_email = '".$row_name['email']."' WHERE cal_login = '".$row_name['user_name']."'";
492 $res_update = db_query($update);
495 elseif ($hookname == "change_cal_mail") {
497 //account/change_email-complete.php line 63
499 $query_name = "SELECT user_name,user_pw,email FROM users WHERE user_id = '".$params."'" ;
500 $res_name = db_query($query_name);
501 $row_name = db_fetch_array($res_name);
503 $query_old = "SELECT cal_email FROM webcal_user WHERE cal_login = '".$row_name['user_name']."'" ;
504 $res_old = db_query($query_old);
505 $row_old = db_fetch_array($res_old);
507 //get all the cal_login where you need to change mail
508 $query_all_mail = "SELECT cal_login, cal_email FROM webcal_user WHERE cal_email LIKE '%".$row_old['cal_email']."%'" ;
509 $res_all_mail = db_query($query_all_mail);
510 print $query_all_mail;
511 while($row_all_mail = db_fetch_array($res_all_mail)){
512 $mail = str_replace($row_old['cal_email'],$row_name['email'],$row_all_mail['cal_email']);
513 $update = "UPDATE webcal_user SET cal_passwd = '".$row_name['user_pw']."', cal_email = '".$mail."' WHERE cal_login = '".$row_all_mail['cal_login']."'";
514 $res_update = db_query($update);
520 elseif ($hookname == "cal_link_group" ){
521 // www/include/project_home.php line 418
523 print '<hr size="1" />';
524 print '<a href="/plugins/webcalendar/index2.php?type=group&group_id='.$params.'">Webcalendar</a> ';
532 // c-file-style: "bsd"