ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilForumDatabaseUpdateSteps10 Class Reference
+ Inheritance diagram for ilForumDatabaseUpdateSteps10:
+ Collaboration diagram for ilForumDatabaseUpdateSteps10:

Public Member Functions

 prepare (ilDBInterface $db)
 
 step_1 ()
 
- Public Member Functions inherited from ilDatabaseUpdateSteps
 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Definition at line 21 of file class.ilForumDatabaseUpdateSteps10.php.

Member Function Documentation

◆ prepare()

ilForumDatabaseUpdateSteps10::prepare ( ilDBInterface  $db)

Definition at line 25 of file class.ilForumDatabaseUpdateSteps10.php.

References $db.

25  : void
26  {
27  $this->db = $db;
28  }

◆ step_1()

ilForumDatabaseUpdateSteps10::step_1 ( )

Definition at line 30 of file class.ilForumDatabaseUpdateSteps10.php.

References $res, ILIAS\Repository\int(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

30  : void
31  {
32  $res = $this->db->queryF(
33  "SELECT obj_id FROM object_data WHERE type = %s AND title = %s",
35  ['rolt', 'il_frm_moderator']
36  );
37 
38  $row = $this->db->fetchAssoc($res);
39  if (!isset($row['obj_id'])) {
40  return;
41  }
42 
43  $rol_id = (int) $row['obj_id'];
44 
45  $res = $this->db->query(
46  "SELECT ops_id FROM rbac_operations WHERE " . $this->db->in(
47  'operation',
48  ['edit_permission', 'delete', 'copy'],
49  false,
51  )
52  );
53 
54  $rows = $this->db->fetchAll($res);
55  if (!$rows) {
56  return;
57  }
58 
59  $operations_to_remove = [];
60  foreach ($rows as $row) {
61  $operations_to_remove[] = (int) $row['ops_id'];
62  }
63 
64  foreach ($operations_to_remove as $op_id) {
65  $this->db->manipulateF(
66  "DELETE FROM rbac_templates WHERE rol_id = %s AND type = %s AND ops_id = %s AND parent = %s",
68  [$rol_id, 'frm', $op_id, 8]
69  );
70  }
71 
72  $this->db->manipulateF(
73  "INSERT INTO settings (module, keyword, value) VALUES (%s, %s, %s)",
75  ['forum', 'frm_mod_tpl_perm_revocation', '1']
76  );
77  }
$res
Definition: ltiservices.php:69
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilForumDatabaseUpdateSteps10::$db
protected

Definition at line 23 of file class.ilForumDatabaseUpdateSteps10.php.

Referenced by prepare().


The documentation for this class was generated from the following file: