| @@ 643-658 (lines=16) @@ | ||
| 640 | ||
| 641 | $tool = 'BLOG_'.$blog_id; |
|
| 642 | ||
| 643 | if ($articleDelete == 'on') { |
|
| 644 | $sql = " INSERT INTO ".$tbl_tasks_permissions." ( c_id, task_id, tool, action) VALUES ( |
|
| 645 | '".(int) $course_id."', |
|
| 646 | '".(int) $task_id."', |
|
| 647 | '".Database::escape_string($tool)."', |
|
| 648 | 'article_delete' |
|
| 649 | )"; |
|
| 650 | Database::query($sql); |
|
| 651 | ||
| 652 | $id = Database::insert_id(); |
|
| 653 | ||
| 654 | if ($id) { |
|
| 655 | $sql = "UPDATE $tbl_tasks_permissions SET id = iid WHERE iid = $id"; |
|
| 656 | Database::query($sql); |
|
| 657 | } |
|
| 658 | } |
|
| 659 | ||
| 660 | if ($articleEdit == 'on') { |
|
| 661 | $sql = " |
|
| @@ 660-675 (lines=16) @@ | ||
| 657 | } |
|
| 658 | } |
|
| 659 | ||
| 660 | if ($articleEdit == 'on') { |
|
| 661 | $sql = " |
|
| 662 | INSERT INTO ".$tbl_tasks_permissions." (c_id, task_id, tool, action ) VALUES ( |
|
| 663 | '".(int) $course_id."', |
|
| 664 | '".(int) $task_id."', |
|
| 665 | '".Database::escape_string($tool)."', |
|
| 666 | 'article_edit' |
|
| 667 | )"; |
|
| 668 | Database::query($sql); |
|
| 669 | $id = Database::insert_id(); |
|
| 670 | ||
| 671 | if ($id) { |
|
| 672 | $sql = "UPDATE $tbl_tasks_permissions SET id = iid WHERE iid = $id"; |
|
| 673 | Database::query($sql); |
|
| 674 | } |
|
| 675 | } |
|
| 676 | ||
| 677 | if ($commentsDelete == 'on') { |
|
| 678 | $sql = " |
|
| @@ 677-692 (lines=16) @@ | ||
| 674 | } |
|
| 675 | } |
|
| 676 | ||
| 677 | if ($commentsDelete == 'on') { |
|
| 678 | $sql = " |
|
| 679 | INSERT INTO ".$tbl_tasks_permissions." (c_id, task_id, tool, action ) VALUES ( |
|
| 680 | '".(int) $course_id."', |
|
| 681 | '".(int) $task_id."', |
|
| 682 | '".Database::escape_string($tool)."', |
|
| 683 | 'article_comments_delete' |
|
| 684 | )"; |
|
| 685 | Database::query($sql); |
|
| 686 | $id = Database::insert_id(); |
|
| 687 | ||
| 688 | if ($id) { |
|
| 689 | $sql = "UPDATE $tbl_tasks_permissions SET id = iid WHERE iid = $id"; |
|
| 690 | Database::query($sql); |
|
| 691 | } |
|
| 692 | } |
|
| 693 | } |
|
| 694 | ||
| 695 | /** |
|
| @@ 736-750 (lines=15) @@ | ||
| 733 | WHERE c_id = $course_id AND task_id = '".(int) $task_id."'"; |
|
| 734 | Database::query($sql); |
|
| 735 | ||
| 736 | if ($articleDelete == 'on') { |
|
| 737 | $sql = "INSERT INTO ".$tbl_tasks_permissions." ( c_id, task_id, tool, action) VALUES ( |
|
| 738 | '".(int) $course_id."', |
|
| 739 | '".(int) $task_id."', |
|
| 740 | '".Database::escape_string($tool)."', |
|
| 741 | 'article_delete' |
|
| 742 | )"; |
|
| 743 | Database::query($sql); |
|
| 744 | $id = Database::insert_id(); |
|
| 745 | ||
| 746 | if ($id) { |
|
| 747 | $sql = "UPDATE $tbl_tasks_permissions SET id = iid WHERE iid = $id"; |
|
| 748 | Database::query($sql); |
|
| 749 | } |
|
| 750 | } |
|
| 751 | ||
| 752 | if ($articleEdit == 'on') { |
|
| 753 | $sql = "INSERT INTO ".$tbl_tasks_permissions." (c_id, task_id, tool, action) VALUES ( |
|
| @@ 752-766 (lines=15) @@ | ||
| 749 | } |
|
| 750 | } |
|
| 751 | ||
| 752 | if ($articleEdit == 'on') { |
|
| 753 | $sql = "INSERT INTO ".$tbl_tasks_permissions." (c_id, task_id, tool, action) VALUES ( |
|
| 754 | '".(int) $course_id."', |
|
| 755 | '".(int) $task_id."', |
|
| 756 | '".Database::escape_string($tool)."', |
|
| 757 | 'article_edit' |
|
| 758 | )"; |
|
| 759 | Database::query($sql); |
|
| 760 | $id = Database::insert_id(); |
|
| 761 | ||
| 762 | if ($id) { |
|
| 763 | $sql = "UPDATE $tbl_tasks_permissions SET id = iid WHERE iid = $id"; |
|
| 764 | Database::query($sql); |
|
| 765 | } |
|
| 766 | } |
|
| 767 | ||
| 768 | if ($commentsDelete == 'on') { |
|
| 769 | $sql = " INSERT INTO ".$tbl_tasks_permissions." (c_id, task_id, tool, action) VALUES ( |
|
| @@ 768-782 (lines=15) @@ | ||
| 765 | } |
|
| 766 | } |
|
| 767 | ||
| 768 | if ($commentsDelete == 'on') { |
|
| 769 | $sql = " INSERT INTO ".$tbl_tasks_permissions." (c_id, task_id, tool, action) VALUES ( |
|
| 770 | '".(int) $course_id."', |
|
| 771 | '".(int) $task_id."', |
|
| 772 | '".Database::escape_string($tool)."', |
|
| 773 | 'article_comments_delete' |
|
| 774 | )"; |
|
| 775 | Database::query($sql); |
|
| 776 | $id = Database::insert_id(); |
|
| 777 | ||
| 778 | if ($id) { |
|
| 779 | $sql = "UPDATE $tbl_tasks_permissions SET id = iid WHERE iid = $id"; |
|
| 780 | Database::query($sql); |
|
| 781 | } |
|
| 782 | } |
|
| 783 | } |
|
| 784 | ||
| 785 | /** |
|