2004-08-07 21:58:49 +02:00
|
|
|
<?php
|
|
|
|
//Code to be executed before a split activity
|
|
|
|
// If we didn't retrieve the instance before
|
|
|
|
if(empty($instance->instanceId)) {
|
|
|
|
// This activity needs an instance to be passed to
|
|
|
|
// be started, so get the instance into $instance.
|
|
|
|
if(isset($_REQUEST['iid'])) {
|
|
|
|
$instance->getInstance($_REQUEST['iid']);
|
|
|
|
} else {
|
|
|
|
// defined in lib/Galaxia/config.php
|
2005-05-15 20:25:51 +02:00
|
|
|
galaxia_show_error(lang("No instance indicated"));
|
2004-08-07 21:58:49 +02:00
|
|
|
die;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Set the current user for this activity
|
2005-05-11 16:23:23 +02:00
|
|
|
if(isset($GLOBALS['user']) && ($activity->isInteractive()) && !empty($instance->instanceId) && !empty($activity_id)) {
|
2005-05-15 20:25:51 +02:00
|
|
|
if (!$instance->setActivityUser($activity_id,$GLOBALS['user'])){
|
|
|
|
galaxia_show_error(lang("You do not have the right to run this activity anymore, maybe a concurrent access problem, refresh your datas."));
|
|
|
|
die;
|
|
|
|
}
|
2004-08-07 21:58:49 +02:00
|
|
|
}
|
|
|
|
?>
|