public static function register($id, $hash) { global $gBitSystem; $err = false; $method = BaseAuth::getAuthMethod($id); if (!empty($method)) { BaseAuth::authError("Auth Registration Failed: {$id} already registered"); $err = true; } if (empty($hash['name'])) { BaseAuth::authError("Auth Registration Failed: {$id}: No Name given"); $err = true; } if (empty($hash['file'])) { BaseAuth::authError("Auth Registration Failed: {$id}: No file given"); $err = true; } elseif (!file_exists($hash['file'])) { BaseAuth::authError("Auth Registration Failed: {$id}: File (" . basename($hash['file']) . ") doesn't exist"); $err = true; } if (empty($hash['class'])) { BaseAuth::authError("Auth Registration Failed: {$id}: No class given"); $err = true; } if (!$err) { BaseAuth::setAuthMethod($id, $hash); } }