ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Authentication\Setup\AbandonCASAuthModeUpdateObjective Class Reference
+ Inheritance diagram for ILIAS\Authentication\Setup\AbandonCASAuthModeUpdateObjective:
+ Collaboration diagram for ILIAS\Authentication\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\Authentication\Setup\AbandonCASAuthModeUpdateObjective::prepare ( ilDBInterface  $db)

◆ step_1()

ILIAS\Authentication\Setup\AbandonCASAuthModeUpdateObjective::step_1 ( )

Definition at line 39 of file AbandonCASAuthModeUpdateObjective.php.

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

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

+ Here is the call graph for this function:

◆ step_2()

ILIAS\Authentication\Setup\AbandonCASAuthModeUpdateObjective::step_2 ( )

Definition at line 55 of file AbandonCASAuthModeUpdateObjective.php.

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 }

References ilDBConstants\T_TEXT.

Field Documentation

◆ $db

ilDBInterface ILIAS\Authentication\Setup\AbandonCASAuthModeUpdateObjective::$db
protected

◆ TABLE_NAME

const string ILIAS\Authentication\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: