ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\Setup\AbandonCASAuthModeUpdateObjective Class Reference
+ Inheritance diagram for ILIAS\Setup\AbandonCASAuthModeUpdateObjective:
+ Collaboration diagram for ILIAS\Setup\AbandonCASAuthModeUpdateObjective:

Public Member Functions

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

Protected Attributes

ilDBInterface $db
 

Private Attributes

const string TABLE_NAME = 'usr_data'
 

Detailed Description

Definition at line 28 of file AbandonCASAuthModeUpdateObjective.php.

Member Function Documentation

◆ prepare()

ILIAS\Setup\AbandonCASAuthModeUpdateObjective::prepare ( ilDBInterface  $db)

◆ step_1()

ILIAS\Setup\AbandonCASAuthModeUpdateObjective::step_1 ( )

Definition at line 39 of file AbandonCASAuthModeUpdateObjective.php.

References ilAuthUtils\AUTH_LOCAL, ILIAS\Repository\int(), and ilDBConstants\T_TEXT.

39  : void
40  {
41  $default_auth_mode_result = $this->db->query(
42  'SELECT value FROM settings WHERE module = ' . $this->db->quote('common', ilDBConstants::T_TEXT)
43  . ' AND keyword = ' . $this->db->quote('auth_mode', ilDBConstants::T_TEXT)
44  );
45 
46  $default_auth_mode = (int) ($this->db->fetchAssoc($default_auth_mode_result)['value'] ?? ilAuthUtils::AUTH_LOCAL);
47 
48  $this->db->manipulateF(
49  'UPDATE ' . self::TABLE_NAME . ' SET auth_mode = %s WHERE auth_mode = %s',
51  [$default_auth_mode === ilAuthUtils::AUTH_LOCAL ? 'default' : 'local', 'cas']
52  );
53  }
const int AUTH_LOCAL
+ Here is the call graph for this function:

◆ step_2()

ILIAS\Setup\AbandonCASAuthModeUpdateObjective::step_2 ( )

Definition at line 55 of file AbandonCASAuthModeUpdateObjective.php.

References ilDBConstants\T_TEXT.

55  : void
56  {
57  $settings = [
58  'cas_server',
59  'cas_port',
60  'cas_uri',
61  'cas_login_instructions',
62  'cas_active',
63  'cas_create_users',
64  'cas_allow_local',
65  'cas_user_default_role',
66  ];
67 
68  $this->db->manipulate(
69  'DELETE FROM settings WHERE module = ' . $this->db->quote('common', ilDBConstants::T_TEXT) . ' AND '
70  . $this->db->in('keyword', $settings, false, ilDBConstants::T_TEXT),
71  );
72  }

Field Documentation

◆ $db

ilDBInterface ILIAS\Setup\AbandonCASAuthModeUpdateObjective::$db
protected

◆ TABLE_NAME

const string ILIAS\Setup\AbandonCASAuthModeUpdateObjective::TABLE_NAME = 'usr_data'
private

Definition at line 30 of file AbandonCASAuthModeUpdateObjective.php.


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