host = $host; $host->add_hook($host::HOOK_PREFS_TAB, $this); } /* plugins/main/init.php hook_prefs_tab */ function hook_prefs_tab($args) { if ($args != "prefPrefs") return; print "
"; print "

" . __("Fever Emulation") . "

"; print "

" . __("Since the Fever API uses a different authentication mechanism to Tiny Tiny RSS, you must set a separate password to login. This password may be the same as your Tiny Tiny RSS password.") . "

"; print "

" . __("Set a password to login with Fever:") . "

"; print "

" . __("WARNING: The Fever API uses an UNSECURE unsalted MD5 hash. Consider the use of a disposable application-specific password and use HTTPS.") . "

"; print "
"; print ""; print_hidden("op", "pluginhandler"); print_hidden("method", "save"); print_hidden("plugin", "fever"); print ""; print ""; print "
"; print "

" . __("To login with the Fever API, set your server details in your favourite RSS application to: ") . get_self_url_prefix() . "/plugins/fever/" . "

"; print "

" . __("Additional details can be found at ") . "https://feedafever.com/api

"; print "

" . __("Note: Due to the limitations of the API and some RSS clients (for example, Reeder on iOS), some features are unavailable: \"Special\" Feeds (Published / Tags / Labels / Fresh / Recent), Nested Categories (hierarchy is flattened)") . "

"; print "
"; } function save() { if (isset($_POST["password"]) && isset($_SESSION["uid"])) { $sth = $this->pdo->prepare("SELECT login FROM ttrss_users WHERE id = ?"); $sth->execute([clean($_SESSION["uid"])]); if ($line = $sth->fetch()) { $password = md5($line["login"] . ":" . $_POST["password"]); $this->host->set($this, "password", $password); echo __("Password saved."); } } } function api_version() { return 2; } } ?>