]> git.mjollnir.org Git - moodle.git/commitdiff
Adding support to the forum user report action
authorstronk7 <stronk7>
Sat, 3 Jun 2006 17:51:20 +0000 (17:51 +0000)
committerstronk7 <stronk7>
Sat, 3 Jun 2006 17:51:20 +0000 (17:51 +0000)
in restore. Bug 3854.
(http://moodle.org/bugs/bug.php?op=show&bugid=3854)

Merged from MOODLE_16_STABLE

mod/forum/restorelib.php

index 463aca3d4264f635721ab39b236b247665d81071..a8471691dbd5b37e66d512480e253602f2362999 100644 (file)
             $log->url = "search.php?id=".$log->course."&search=".urlencode($log->info);
             $status = true;
             break;
+        case "user report":
+            //recode the info field (it's the user id)
+            $user = backup_getid($restore->backup_unique_code,"user",$log->info);
+            if ($user) {
+                $log->info = $user->new_id;
+                //Now, extract the mode from the url field
+                $mode = substr(strrchr($log->url,"="),1);
+                $log->url = "user.php?course=".$log->course."&id=".$log->info."&mode=".$mode;
+                $status = true;
+            }
+            break;
         default:
             if (!defined('RESTORE_SILENTLY')) {
                 echo "action (".$log->module."-".$log->action.") unknown. Not restored<br />";                 //Debug