aboutsummaryrefslogtreecommitdiff
path: root/mod/openid_server/actions/autologin.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-12-29 20:45:58 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-12-29 20:45:58 -0200
commit97e689213ff4e829f251af526ed4e796a3cc2b71 (patch)
treeb04d03ec56305041216b72328fc9b5afde27bc76 /mod/openid_server/actions/autologin.php
parent0ab6351abb7a602d96c62b0ad35413c88113a6cf (diff)
parent69e2d8c5d8732042c9319aef1fdea45a82b63e42 (diff)
downloadelgg-97e689213ff4e829f251af526ed4e796a3cc2b71.tar.gz
elgg-97e689213ff4e829f251af526ed4e796a3cc2b71.tar.bz2
Merge branch 'master' into saravea
Conflicts: .gitmodules mod/admins mod/assemblies mod/audio_html5 mod/beechat mod/crud mod/elgg-activitystreams mod/elggman mod/elggpg mod/favorites mod/federated-objects mod/friendly_time mod/group_alias mod/group_operators mod/languages mod/lightpics mod/openid_client mod/spotlight mod/suicide mod/tasks mod/videolist
Diffstat (limited to 'mod/openid_server/actions/autologin.php')
-rwxr-xr-xmod/openid_server/actions/autologin.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/mod/openid_server/actions/autologin.php b/mod/openid_server/actions/autologin.php
new file mode 100755
index 000000000..4a200fcfb
--- /dev/null
+++ b/mod/openid_server/actions/autologin.php
@@ -0,0 +1,52 @@
+<?php
+
+/**
+ * Elgg openid_server: autologin form
+ *
+ * @package ElggOpenID
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Kevin Jardine <kevin@radagast.biz>
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.org/
+ */
+
+require_once(dirname(dirname(__FILE__)).'/openid_server_include.php');
+
+require_once ('lib/common.php');
+require_once ('lib/session.php');
+
+$iframe_template = <<<END
+<iframe
+width="%s"
+height="%s"
+src="%s"
+>
+</iframe>');
+END;
+
+$openid_url = getLoggedinUser();
+$store = getOpenIDServerStore();
+$sites = $store->getAutoLoginSites();
+$request = getRequestInfo();
+if ($request) {
+ $return_url = $request->return_to;
+ setRequestInfo(null);
+} else {
+ $return_url = $CONFIG->wwwroot;
+}
+// TODO: get this to work with posts
+$iframes = '';
+foreach ($sites as $site) {
+ $iframes .= sprintf($iframe_template,$site->width,$site->height,sprintf($site->auto_login,$openid_url));
+}
+$body = elgg_view("openid_server/forms/autologin",
+ array(
+ 'iframes' => $iframes,
+ 'return_to' => $return_url,
+
+ ));
+$CONFIG->events['login'] = array();
+login();
+header("Content-type:text/html");
+print $body;
+?>