From d493aba2386931d8baf76e218e35a77b8c85b618 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 10 Sep 2012 19:13:41 +0400 Subject: allow logging in by sharepopup --- classes/handler/public.php | 104 ++++++++++++++++++++++++++++++--------------- 1 file changed, 70 insertions(+), 34 deletions(-) (limited to 'classes/handler') diff --git a/classes/handler/public.php b/classes/handler/public.php index c06121d02..4d6c117eb 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -386,59 +386,95 @@ class Handler_Public extends Handler { if ($_SESSION["uid"]) { - if (!$action) { + if ($action == 'share') { - print ""; + $title = db_escape_string(strip_tags($_REQUEST["title"])); + $url = db_escape_string(strip_tags($_REQUEST["url"])); + $content = db_escape_string(strip_tags($_REQUEST["content"])); - print ""; + create_published_article($this->link, $title, $url, $content, $_SESSION["uid"]); - print ""; - print ""; + print ""; + } else { $title = htmlspecialchars($_REQUEST["title"]); $url = htmlspecialchars($_REQUEST["url"]); - print ""; - print ""; - print ""; + ?> - print ""; +
"; - print "

".__("Share with Tiny Tiny RSS")."

"; - print "
".__("Title:")."
".__("URL:")."
".__("Content:")."
- print "
+

+
-
". - __("Shared article will appear in the Published feed."). - "
- - "; + - print ""; - print "
"; + + - print ""; + + + + + + - } else { + - $title = db_escape_string(strip_tags($_REQUEST["title"])); - $url = db_escape_string(strip_tags($_REQUEST["url"])); - $content = db_escape_string(strip_tags($_REQUEST["content"])); + +
+ +
+ + + - create_published_article($this->link, $title, $url, $content, $_SESSION["uid"]); + + + + "; - print "window.close();"; - print ""; } } else { - print "
" . __("Not logged in.") . "
"; - + $return = urlencode($_SERVER["REQUEST_URI"]) + ?> + +
+ + + + + + + + + + + + +
+

">
">
+ +
+ + + +
+ +
+