From d013328ec3e94b5e9d7bbeb7ba38606870bb5dd2 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 25 Sep 2007 03:28:11 +0200 Subject: [PATCH] [svn r13231] Prevent accidental delete of a learnpath --- main/newscorm/learnpath.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index a38d01ec38..1a787fbae8 100644 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -749,6 +749,9 @@ class learnpath { //In clear: implement this in the item class as well (abstract class) and use the given ID in queries //if(empty($course)){$course = api_get_course_id();} //if(empty($id)){$id = $this->get_id();} + //If an ID is specifically given and the current LP is not the same, + //prevent delete + if(!empty($id) && ($id != $this->lp_id)){return false;} //if($this->debug>0){error_log('New LP - In learnpath::delete()',0);} foreach($this->items as $id => $dummy)