diff --git a/lib/Conf.php b/lib/Conf.php index e3d2f15..451bc92 100644 --- a/lib/Conf.php +++ b/lib/Conf.php @@ -16,13 +16,13 @@ class Conf { public $dbPostgreSQLPort = 5432; public $dbPostgreSQLDb = "arsse"; public $dbPostgreSQLSchema = ""; - public $dbPostgreSQLAutoUpd = false; + public $dbPostgreSQLAutoUpd = true; public $dbMySQLHost = "localhost"; public $dbMySQLUser = "arsse"; public $dbMySQLPass = ""; public $dbMySQLPort = 3306; public $dbMySQLDb = "arsse"; - public $dbMySQLAutoUpd = false; + public $dbMySQLAutoUpd = true; public $userDriver = User\Internal\Driver::class; public $userComposeNames = true; @@ -33,14 +33,15 @@ class Conf { public $fetchUserAgentString; public function __construct(string $import_file = "") { - $this->fetchUserAgentString = sprintf('Arsse/%s (%s %s; %s; https://code.jkingweb.ca/jking/arsse) PicoFeed (https://github.com/fguillot/picoFeed)', - VERSION, // Arsse version - php_uname('s'), // OS - php_uname('r'), // OS version - php_uname('m') // platform architecture - ); - if($import_file != "") $this->importFile($import_file); + if(is_null($this->fetchUserAgentString)) { + $this->fetchUserAgentString = sprintf('Arsse/%s (%s %s; %s; https://code.jkingweb.ca/jking/arsse) PicoFeed (https://github.com/fguillot/picoFeed)', + VERSION, // Arsse version + php_uname('s'), // OS + php_uname('r'), // OS version + php_uname('m') // platform architecture + ); + } } public function importFile(string $file): self { diff --git a/lib/Misc/DateFormatter.php b/lib/Misc/DateFormatter.php index 0c68094..6bb4485 100644 --- a/lib/Misc/DateFormatter.php +++ b/lib/Misc/DateFormatter.php @@ -21,7 +21,6 @@ trait DateFormatter { } protected function dateNormalize($date, string $inFormat = null, bool $inLocal = false) { - // convert input to a Unix timestamp if($date instanceof \DateTimeInterface) { return $date; } else if(is_numeric($date)) { diff --git a/sql/SQLite3/0.sql b/sql/SQLite3/0.sql index 726a9b8..f33154b 100644 --- a/sql/SQLite3/0.sql +++ b/sql/SQLite3/0.sql @@ -11,10 +11,19 @@ create table arsse_users( name text, -- display name avatar_type text, -- internal avatar image's MIME content type avatar_data blob, -- internal avatar image's binary data - rights integer not null default 0 -- any administrative rights the user may have + admin boolean default 0, -- whether the user is a member of the special "admin" group + rights integer not null default 0 -- temporary admin-rights marker FIXME: remove reliance on this ); --- NextCloud folders +-- extra user metadata +create table arsse_users_meta( + owner text not null references arsse_users(id) on delete cascade on update cascade, + key text not null, + value text, + primary key(owner,key) +); + +-- NextCloud News folders create table arsse_folders( id integer primary key, -- sequence number owner text not null references arsse_users(id) on delete cascade on update cascade, -- owner of folder