ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilUserAccountSettings.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 
14 {
15  private static $instance = null;
16 
17  private $storage = null;
18 
19  private $lua_enabled = true;
20  private $lua_access_filter = false;
21 
26  protected function __construct()
27  {
28  $this->storage = new ilSetting('user_account');
29  $this->read();
30  }
31 
36  public static function getInstance()
37  {
38  if (self::$instance) {
39  return self::$instance;
40  }
41  return self::$instance = new ilUserAccountSettings();
42  }
43 
49  {
50  return (bool) $this->lua_enabled;
51  }
52 
58  public function enableLocalUserAdministration($a_status)
59  {
60  $this->lua_enabled = $a_status;
61  }
62 
67  public function isUserAccessRestricted()
68  {
69  return (bool) $this->lua_access_filter;
70  }
71 
77  public function restrictUserAccess($a_status)
78  {
79  $this->lua_access_filter = $a_status;
80  }
81 
86  public function update()
87  {
88  $this->storage->set('lua_enabled', $this->isLocalUserAdministrationEnabled());
89  $this->storage->set('lua_access_restricted', $this->isUserAccessRestricted());
90  }
91 
96  private function read()
97  {
98  $this->enableLocalUserAdministration($this->storage->get('lua_enabled', $this->isLocalUserAdministrationEnabled()));
99  $this->restrictUserAccess($this->storage->get('lua_access_restricted', $this->isUserAccessRestricted()));
100  }
101 }
restrictUserAccess($a_status)
En/disable user access.
isUserAccessRestricted()
Check if user access is restricted.
enableLocalUserAdministration($a_status)
Enable local user administration.
__construct()
Singleton constructor.
static getInstance()
Singelton get instance.
read()
Read user account settings.
isLocalUserAdministrationEnabled()
Check if local user administration is enabled.