| @@ 565-580 (lines=16) @@ | ||
| 562 | ||
| 563 | $tool = 'BLOG_' . $blog_id; |
|
| 564 | ||
| 565 | if ($articleDelete == 'on') { |
|
| 566 | $sql = " INSERT INTO " . $tbl_tasks_permissions . " ( c_id, task_id, tool, action) VALUES ( |
|
| 567 | '" . (int)$course_id . "', |
|
| 568 | '" . (int)$task_id . "', |
|
| 569 | '" . Database::escape_string($tool) . "', |
|
| 570 | 'article_delete' |
|
| 571 | )"; |
|
| 572 | Database::query($sql); |
|
| 573 | ||
| 574 | $id = Database::insert_id(); |
|
| 575 | ||
| 576 | if ($id) { |
|
| 577 | $sql = "UPDATE $tbl_tasks_permissions SET id = iid WHERE iid = $id"; |
|
| 578 | Database::query($sql); |
|
| 579 | } |
|
| 580 | } |
|
| 581 | ||
| 582 | if ($articleEdit == 'on') { |
|
| 583 | $sql = " |
|
| @@ 582-597 (lines=16) @@ | ||
| 579 | } |
|
| 580 | } |
|
| 581 | ||
| 582 | if ($articleEdit == 'on') { |
|
| 583 | $sql = " |
|
| 584 | INSERT INTO " . $tbl_tasks_permissions . " (c_id, task_id, tool, action ) VALUES ( |
|
| 585 | '" . (int)$course_id . "', |
|
| 586 | '" . (int)$task_id . "', |
|
| 587 | '" . Database::escape_string($tool) . "', |
|
| 588 | 'article_edit' |
|
| 589 | )"; |
|
| 590 | Database::query($sql); |
|
| 591 | $id = Database::insert_id(); |
|
| 592 | ||
| 593 | if ($id) { |
|
| 594 | $sql = "UPDATE $tbl_tasks_permissions SET id = iid WHERE iid = $id"; |
|
| 595 | Database::query($sql); |
|
| 596 | } |
|
| 597 | } |
|
| 598 | ||
| 599 | if ($commentsDelete == 'on') { |
|
| 600 | $sql = " |
|
| @@ 599-614 (lines=16) @@ | ||
| 596 | } |
|
| 597 | } |
|
| 598 | ||
| 599 | if ($commentsDelete == 'on') { |
|
| 600 | $sql = " |
|
| 601 | INSERT INTO " . $tbl_tasks_permissions . " (c_id, task_id, tool, action ) VALUES ( |
|
| 602 | '" . (int)$course_id . "', |
|
| 603 | '" . (int)$task_id . "', |
|
| 604 | '" . Database::escape_string($tool) . "', |
|
| 605 | 'article_comments_delete' |
|
| 606 | )"; |
|
| 607 | Database::query($sql); |
|
| 608 | $id = Database::insert_id(); |
|
| 609 | ||
| 610 | if ($id) { |
|
| 611 | $sql = "UPDATE $tbl_tasks_permissions SET id = iid WHERE iid = $id"; |
|
| 612 | Database::query($sql); |
|
| 613 | } |
|
| 614 | } |
|
| 615 | } |
|
| 616 | ||
| 617 | /** |
|
| @@ 646-660 (lines=15) @@ | ||
| 643 | WHERE c_id = $course_id AND task_id = '" . (int)$task_id."'"; |
|
| 644 | Database::query($sql); |
|
| 645 | ||
| 646 | if ($articleDelete == 'on') { |
|
| 647 | $sql = "INSERT INTO " . $tbl_tasks_permissions . " ( c_id, task_id, tool, action) VALUES ( |
|
| 648 | '" . (int)$course_id . "', |
|
| 649 | '" . (int)$task_id . "', |
|
| 650 | '" . Database::escape_string($tool) . "', |
|
| 651 | 'article_delete' |
|
| 652 | )"; |
|
| 653 | Database::query($sql); |
|
| 654 | $id = Database::insert_id(); |
|
| 655 | ||
| 656 | if ($id) { |
|
| 657 | $sql = "UPDATE $tbl_tasks_permissions SET id = iid WHERE iid = $id"; |
|
| 658 | Database::query($sql); |
|
| 659 | } |
|
| 660 | } |
|
| 661 | ||
| 662 | if ($articleEdit == 'on') { |
|
| 663 | $sql = "INSERT INTO " . $tbl_tasks_permissions . " (c_id, task_id, tool, action) VALUES ( |
|
| @@ 662-676 (lines=15) @@ | ||
| 659 | } |
|
| 660 | } |
|
| 661 | ||
| 662 | if ($articleEdit == 'on') { |
|
| 663 | $sql = "INSERT INTO " . $tbl_tasks_permissions . " (c_id, task_id, tool, action) VALUES ( |
|
| 664 | '" . (int)$course_id . "', |
|
| 665 | '" . (int)$task_id . "', |
|
| 666 | '" . Database::escape_string($tool) . "', |
|
| 667 | 'article_edit' |
|
| 668 | )"; |
|
| 669 | Database::query($sql); |
|
| 670 | $id = Database::insert_id(); |
|
| 671 | ||
| 672 | if ($id) { |
|
| 673 | $sql = "UPDATE $tbl_tasks_permissions SET id = iid WHERE iid = $id"; |
|
| 674 | Database::query($sql); |
|
| 675 | } |
|
| 676 | } |
|
| 677 | ||
| 678 | if ($commentsDelete == 'on') { |
|
| 679 | $sql = " INSERT INTO " . $tbl_tasks_permissions . " (c_id, task_id, tool, action) VALUES ( |
|
| @@ 678-692 (lines=15) @@ | ||
| 675 | } |
|
| 676 | } |
|
| 677 | ||
| 678 | if ($commentsDelete == 'on') { |
|
| 679 | $sql = " 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 | /** |
|