2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Cindy Qi Li, Harris Wong */
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /************************************************************************/
13 // $Id: openmeetings_delete.php 7575 2008-06-02 18:17:14Z hwong $
15 define('AT_INCLUDE_PATH', '../../include/');
16 require (AT_INCLUDE_PATH.'vitals.inc.php');
17 require ('lib/openmeetings.class.php');
20 $course_id = $_SESSION['course_id'];
23 $_REQUEST['room_id'] = intval($_REQUEST['room_id']);
25 //Initiate Openmeeting
26 $om_obj = new Openmeetings($course_id, $_SESSION['member_id']);
31 //Handles form actions
32 if (isset($_POST['submit']) && $_REQUEST['room_id']){
33 //have to makesure the user really do have permission over the paramater room id
34 if ($om_obj->isMine($_REQUEST['room_id']) || authenticate(AT_PRIV_OPENMEETINGS, true)){
35 $om_obj->om_deleteRoom($_REQUEST['room_id']);
36 $msg->addFeedback('OPENMEETINGS_DELETE_SUCEEDED');
37 header('Location: index.php');
40 $msg->addError('OPENMEETINGS_DELETE_FAILED');
42 } elseif (isset($_POST['cancel'])) {
43 $msg->addFeedback('OPENMEETINGS_CANCELLED');
44 header('Location: index.php');
49 require (AT_INCLUDE_PATH.'header.inc.php');
52 <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
53 <div class="input-form">
55 <p><?php echo _AT('openmeetings_confirm_delete'); ?></p>
57 <div class="row buttons">
58 <input type="hidden" name="room_id" value="<?php echo $_REQUEST['room_id']; ?>" />
59 <input type="submit" name="submit" value="<?php echo _AT('yes'); ?>" />
60 <input type="submit" name="cancel" value="<?php echo _AT('no'); ?>" />
65 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>