diff --git a/block_mahara_iena.php b/block_mahara_iena.php index 639e24cead1c5651cdba6558f607653d844d431b..1104c7900fbe0cfdfd0f6df76b52922321e18864 100644 --- a/block_mahara_iena.php +++ b/block_mahara_iena.php @@ -64,7 +64,7 @@ class block_mahara_iena extends block_base if (count($result) == 0 && $is_mahara_user) { // create one mahara group for the course - $this->content->text .= 'wwwroot . '/blocks/mahara_iena/mahara_iena.php?courseid=' . $COURSE->id . '" class="btn btn-block btn-primary iena-btn-big">' . get_string('create_group', 'block_mahara_iena', $CFG->mahara_alias) . '
Créer un groupe dans '.$CFG->mahara_alias.'.
'; // create one mahara group for each moodle group (need groups) @@ -141,10 +141,10 @@ class block_mahara_iena extends block_base if ( count($ma_links) != 0 ) { if ( count($ma_links) == 1 ) { /* si il n'y a qu'un groupe, on affiche un bouton */ - $this->content->text .= "Aller à mon groupe sur ".$CFG->mahara_alias."Mon groupe : ".$ma_links[0]['mo_gr_name'].".
"; + $this->content->text = "Aller à mon groupe sur ".$CFG->mahara_alias."Mon groupe : ".$ma_links[0]['mo_gr_name'].".
"; } elseif ( count($ma_links) > 1 && count($ma_links) <= 5 ) { /* si il y a entre 2 et 5 groupes inclus, on affiche une liste */ - $this->content->text .= "Accéder à mon groupe sur $CFG->mahara_alias :
+ $this->content->text = "Accéder à mon groupe sur $CFG->mahara_alias :
You must have a Mahara account to do that.
"; + die; + } else { array_push($usersTab,array( 'id' => $mahara_user[0]->id, 'username' => $mahara_user[0]->username, 'role' => "admin", )); - } else { - echo "You must have a Mahara account to do that.
"; - die; } //All params used for mahara_group_create_groups her we can add/change some lines diff --git a/mahara_iena_groups.php b/mahara_iena_groups.php index d1c3e71d73d9a02d71aaef1735666a0f218cc79d..b780fae491c532a8668a32a45f58bf0f9a1eb8c0 100644 --- a/mahara_iena_groups.php +++ b/mahara_iena_groups.php @@ -56,15 +56,15 @@ if (count($students) == 0) { // get mahara user by mail (teacher) $mahara_user = $connexion->get_mahara_user_by_mail($USER->email); // if user is not a mahara user, there will be an error : it's not supposed to be because mahara account is checked before to have a button to go in this page but... but. - if ( !$mahara_user->error ) { + if ( isset($mahara_user->error) ) { + echo "You must have a Mahara account to do that.
"; + die; + } else { array_push($usersTab,array( 'id' => $mahara_user[0]->id, 'username' => $mahara_user[0]->username, 'role' => "admin", )); - } else { - echo "You must have a Mahara account to do that.
"; - die; } if ( count($usersTab) == 0 ) { diff --git a/mahara_iena_link.php b/mahara_iena_link.php index 59dba10b8df738566818c94042001bd925e16467..8fd2a30d7132d1361199824bd4f69dd2bd79108f 100644 --- a/mahara_iena_link.php +++ b/mahara_iena_link.php @@ -15,7 +15,7 @@ require_login($courseid, false, NULL); $content = ""; -if ( $_GET['connect_mahara'] == true ) { +if ( isset($_GET['connect_mahara']) && $_GET['connect_mahara'] == true ) { // connect the user to mahara to create his account with moodle/mahara existing link $mnetauth = get_auth_plugin('mnet'); $target_url = "/"; @@ -31,7 +31,7 @@ if ( $_GET['connect_mahara'] == true ) { //ensure user is member of it's mahara group : true if already or succeed // $all_right = $connexion->ensure_user_is_mahara_group_member($USER, $_GET['mahara_group']); - if ( $_GET['connect_direct'] == true ) { + if ( isset($_GET['connect_direct']) && $_GET['connect_direct'] == true ) { $all_right = true; } else { $all_right = $connexion->ensure_user_is_mahara_group_member_new($USER, $_GET['mahara_group'], $_GET['moodle_group']);