"debug-feed:",
"force-refetch",
"force-rehash",
+ "decrypt-feeds",
"help");
foreach (PluginHost::getInstance()->get_commands() as $command => $data) {
<div class="floatingLogo"><img src="images/logo_small.png"></div>
<h1><?php echo __("Tiny Tiny RSS data update script.") ?></h1>
- <?php print_error("Please run this script from the command line. Use option \"-help\" to display command help if this error is displayed erroneously."); ?>
+ <?php print_error("Please run this script from the command line. Use option \"--help\" to display command help if this error is displayed erroneously."); ?>
</body></html>
<?php
print " --debug-feed N - perform debug update of feed N\n";
print " --force-refetch - debug update: force refetch feed data\n";
print " --force-rehash - debug update: force rehash articles\n";
+ print " --decrypt-feeds - decrypt feed passwords\n";
print " --help - show this help\n";
print "Plugin options:\n";
update_rss_feed($feed);
}
+ if (isset($options["decrypt-feeds"])) {
+ $result = db_query("SELECT id, auth_pass FROM ttrss_feeds WHERE auth_pass_encrypted = true");
+
+ if (!function_exists("mcrypt_decrypt")) {
+ _debug("mcrypt functions not available.");
+ return;
+ }
+
+ require_once "crypt.php";
+
+ $total = 0;
+
+ db_query("BEGIN");
+
+ while ($line = db_fetch_assoc($result)) {
+ _debug("processing feed id " . $line["id"]);
+
+ $auth_pass = db_escape_string(decrypt_string($line["auth_pass"]));
+
+ db_query("UPDATE ttrss_feeds SET auth_pass_encrypted = false, auth_pass = '$auth_pass'
+ WHERE id = " . $line["id"]);
+
+ ++$total;
+ }
+
+ db_query("COMMIT");
+
+ _debug("$total feeds processed.");
+ }
+
PluginHost::getInstance()->run_commands($options);
if (file_exists(LOCK_DIRECTORY . "/$lock_filename"))