diff options
Diffstat (limited to 'classes/handler/public.php')
-rwxr-xr-x | classes/handler/public.php | 91 |
1 files changed, 56 insertions, 35 deletions
diff --git a/classes/handler/public.php b/classes/handler/public.php index 37fe8612a..a8f72e21c 100755 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -525,6 +525,7 @@ class Handler_Public extends Handler { header('Content-Type: text/html; charset=utf-8'); ?> + <!DOCTYPE html> <html> <head> <title><?php echo __("Share with Tiny Tiny RSS") ?> ?></title> @@ -622,7 +623,7 @@ class Handler_Public extends Handler { } else { - $return = urlencode($_SERVER["REQUEST_URI"]) + $return = urlencode(make_self_url()); ?> @@ -711,7 +712,9 @@ class Handler_Public extends Handler { user_error("Failed login attempt for $login from {$_SERVER['REMOTE_ADDR']}", E_USER_WARNING); } - if (clean($_REQUEST['return'])) { + $return = clean($_REQUEST['return']); + + if ($_REQUEST['return'] && mb_strpos($return, SELF_URL_PATH) === 0) { header("Location: " . clean($_REQUEST['return'])); } else { header("Location: " . get_self_url_prefix()); @@ -742,6 +745,7 @@ class Handler_Public extends Handler { header('Content-Type: text/html; charset=utf-8'); ?> + <!DOCTYPE html> <html> <head> <title>Tiny Tiny RSS</title> @@ -770,7 +774,21 @@ class Handler_Public extends Handler { <?php if (!$feed_url) { - print_error("No feed to subscribe to."); + ?> + <form method="post"> + <input type="hidden" name="op" value="subscribe"> + <fieldset> + <label>Feed or site URL:</label> + <input style="width: 300px" dojoType="dijit.form.ValidationTextBox" required="1" name="feed_url"> + </fieldset> + + <button class="alt-primary" dojoType="dijit.form.Button" type="submit"> + <?php echo __("Subscribe") ?> + </button> + + <a href="index.php"><?php echo __("Return to Tiny Tiny RSS") ?></a> + </form> + <?php } else { $rc = Feeds::subscribe_to_feed($feed_url); @@ -814,9 +832,11 @@ class Handler_Public extends Handler { } print "</select>"; - print "<button class='alt-primary' dojoType='dijit.form.Button' type='submit'>".__("Subscribe to selected feed")."</button>"; print "</fieldset>"; + print "<button class='alt-primary' dojoType='dijit.form.Button' type='submit'>".__("Subscribe to selected feed")."</button>"; + print "<a href='index.php'>".__("Return to Tiny Tiny RSS")."</a>"; + print "</form>"; } @@ -832,20 +852,18 @@ class Handler_Public extends Handler { } else { $feed_id = 0; } - print "<p>"; if ($feed_id) { - print "<form method='GET' style='float : left' action=\"$tp_uri\"> + print "<form method='GET' action=\"$tp_uri\"> <input type='hidden' name='tab' value='feedConfig'> <input type='hidden' name='method' value='editfeed'> <input type='hidden' name='methodparam' value='$feed_id'> <button dojoType='dijit.form.Button' class='alt-info' type='submit'>".__("Edit subscription options")."</button> + <a href='index.php'>".__("Return to Tiny Tiny RSS")."</a> </form>"; } } - print "<a href='index.php'>".__("Return to Tiny Tiny RSS")."</a>"; - print "</div></div></body></html>"; } else { @@ -866,7 +884,7 @@ class Handler_Public extends Handler { header('Content-Type: text/html; charset=utf-8'); ?> - + <!DOCTYPE html> <html> <head> <title>Tiny Tiny RSS</title> @@ -941,12 +959,12 @@ class Handler_Public extends Handler { print "<form method='POST' action='public.php'> <input type='hidden' name='method' value='do'> <input type='hidden' name='op' value='forgotpass'> - + <fieldset> <label>".__("Login:")."</label> <input dojoType='dijit.form.TextBox' type='text' name='login' value='' required> </fieldset> - + <fieldset> <label>".__("Email:")."</label> <input dojoType='dijit.form.TextBox' type='email' name='email' value='' required> @@ -959,13 +977,13 @@ class Handler_Public extends Handler { <label>".T_sprintf("How much is %d + %d:", $_SESSION["pwdreset:testvalue1"], $_SESSION["pwdreset:testvalue2"])."</label> <input dojoType='dijit.form.TextBox' type='text' name='test' value='' required> </fieldset> - + <hr/> <fieldset> <button dojoType='dijit.form.Button' type='submit' class='alt-danger'>".__("Reset password")."</button> <a href='index.php'>".__("Return to Tiny Tiny RSS")."</a> </fieldset> - + </form>"; } else if ($method == 'do') { @@ -1018,7 +1036,7 @@ class Handler_Public extends Handler { $mailer = new Mailer(); - $rc = $mailer->mail(["to_name" => $login, + $rc = $mailer->mail(["to_name" => $login, "to_address" => $email, "subject" => __("[tt-rss] Password reset request"), "message" => $message]); @@ -1033,8 +1051,6 @@ class Handler_Public extends Handler { $sth->execute([$resetpass_token_full, $login, $email]); - //Pref_Users::resetUserPassword($id, false); - } else { print_error("User ID not found."); } @@ -1071,6 +1087,7 @@ class Handler_Public extends Handler { } ?> + <!DOCTYPE html> <html> <head> <title>Database Updater</title> @@ -1116,32 +1133,35 @@ class Handler_Public extends Handler { if ($op == "performupdate") { if ($updater->isUpdateRequired()) { - print "<h2>" . __("Performing updates") . "</h2>"; - - print "<h3>" . T_sprintf("Updating to schema version %d", SCHEMA_VERSION) . "</h3>"; - - print "<ul>"; + print "<h2>" . T_sprintf("Performing updates to version %d", SCHEMA_VERSION) . "</h2>"; for ($i = $updater->getSchemaVersion() + 1; $i <= SCHEMA_VERSION; $i++) { - print "<li>" . T_sprintf("Performing update up to version %d...", $i); + print "<ul>"; + + print "<li class='text-info'>" . T_sprintf("Updating to version %d", $i) . "</li>"; + print "<li>"; $result = $updater->performUpdateTo($i, true); + print "</li>"; if (!$result) { - print "<span class='err'>".__("FAILED!")."</span></li></ul>"; + print "</ul>"; - print_warning("One of the updates failed. Either retry the process or perform updates manually."); + print_error("One of the updates failed. Either retry the process or perform updates manually."); - print "<a href='index.php'>".__("Return to Tiny Tiny RSS")."</a>"; + print "<form method='POST'> + <input type='hidden' name='subop' value='performupdate'> + <button type='submit' dojoType='dijit.form.Button' class='alt-danger' onclick='return confirmOP()'>".__("Try again")."</button> + <a href='index.php'>".__("Return to Tiny Tiny RSS")."</a> + </form>"; return; } else { - print "<span class='ok'>".__("OK!")."</span></li>"; + print "<li class='text-success'>" . __("Completed.") . "</li>"; + print "</ul>"; } } - print "</ul>"; - print_notice("Your Tiny Tiny RSS database is now updated to the latest version."); print "<a href='index.php'>".__("Return to Tiny Tiny RSS")."</a>"; @@ -1154,14 +1174,15 @@ class Handler_Public extends Handler { } else { if ($updater->isUpdateRequired()) { - print "<h2>" . __("Database update required") . "</h2>"; - - print_notice("<h4>". - sprintf("Your Tiny Tiny RSS database needs update to the latest version: %d to %d.", - $updater->getSchemaVersion(), SCHEMA_VERSION). - "</h4>"); + print "<h2>".T_sprintf("Tiny Tiny RSS database needs update to the latest version (%d to %d).", + $updater->getSchemaVersion(), SCHEMA_VERSION)."</h2>"; - print_warning("Please backup your database before proceeding."); + if (DB_TYPE == "mysql") { + print_error("<strong>READ THIS:</strong> Due to MySQL limitations, your database is not completely protected while updating. ". + "Errors may put it in an inconsistent state requiring manual rollback. <strong>BACKUP YOUR DATABASE BEFORE CONTINUING.</strong>"); + } else { + print_warning("Please backup your database before proceeding."); + } print "<form method='POST'> <input type='hidden' name='subop' value='performupdate'> |