Exemplo n.º 1
0
 public function __construct()
 {
     parent::$aFeatures = array('passCredentials' => true, 'getCredentials' => true, 'isAuthenticated' => true, 'getUser' => true, 'getUserId' => true, 'passNewPassword' => true, 'changePassword' => true, 'passNewPassword' => true, 'createUser' => true);
     $this->DB = new CoreMySQLHandler();
     // Open the MySQL database
     if (!$this->DB->open(cfg('auth_mysql', 'dbhost'), cfg('auth_mysql', 'dbport'), cfg('auth_mysql', 'dbname'), cfg('auth_mysql', 'dbuser'), cfg('auth_mysql', 'dbpass'))) {
         throw new NagVisException(l('Unable to open auth database'));
     } else {
         // Create initial db scheme if needed
         if (!$this->DB->tableExist('users')) {
             $this->DB->createInitialDb();
         } else {
             // Maybe an update is needed
             $this->DB->updateDb();
         }
     }
 }
Exemplo n.º 2
0
 public function __construct()
 {
     parent::$aFeatures = array('passCredentials' => true, 'getCredentials' => true, 'isAuthenticated' => true, 'getUser' => true, 'getUserId' => true, 'passNewPassword' => true, 'changePassword' => true, 'resetPassword' => true, 'createUser' => true);
     $this->DB = new CoreSQLiteHandler();
     // Open sqlite database
     if (!$this->DB->open(cfg('paths', 'cfg') . 'auth.db')) {
         throw new NagVisException(l('Unable to open auth database ([DB])', array('DB' => cfg('paths', 'cfg') . 'auth.db')));
     } else {
         // Create initial db scheme if needed
         if (!$this->DB->tableExist('users')) {
             $this->DB->createInitialDb();
         } else {
             // Maybe an update is needed
             $this->DB->updateDb();
         }
     }
 }