HTML and CSS Reference
In-Depth Information
$header = APP_URI . 'no-room';
}
header("Location: " . $header);
exit;
}
/**
* Creates a new room and sets the creator as the presenter
*
* @return array Information about the updated room
*/
protected function create_room( )
{
$presenter = $this->sanitize($_POST['presenter-name']);
$email = $this->sanitize($_POST['presenter-email']);
$name = $this->sanitize($_POST['session-name']);
// Store the new room and its various associations in the database
$output = $this->model->create_room($presenter, $email, $name);
// Make sure valid output was returned
if (is_array($output) && isset($output['room_id'])) {
$room_id = $output['room_id'];
} else {
throw new Exception('Error creating the room.');
}
// Makes the creator of this room its presenter
setcookie('presenter_room_' . $room_id, 1, time() + 2592000, '/');
return $output;
}
/**
* Determines whether or not the current user is the presenter
*
* @return boolean TRUE if it's the presenter, otherwise FALSE
*/
protected function is_presenter( )
{
Reopening a Closed Room
To reopen a room that has been closed, the sanitized room ID is passed to the model's open_room() method.
// Makes the creator of this room its presenter
setcookie('presenter_room_' . $room_id, 1, time() + 2592000, '/');
return $output;
}
 
Search WWH ::




Custom Search