diff options
author | friendica <info@friendica.com> | 2015-03-15 16:48:45 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-03-15 16:48:45 -0700 |
commit | 6da40fc559f540e67802f771411aa9f85dc8d64d (patch) | |
tree | 1195a967c1d49dcf20f9abe0fdbb633ec240a1e1 | |
parent | 92470eb0f2f053363cdfaec7a7df18c85ffc74bc (diff) | |
download | volse-hubzilla-6da40fc559f540e67802f771411aa9f85dc8d64d.tar.gz volse-hubzilla-6da40fc559f540e67802f771411aa9f85dc8d64d.tar.bz2 volse-hubzilla-6da40fc559f540e67802f771411aa9f85dc8d64d.zip |
mod_id: load profile so the sidebar profile will work
-rw-r--r-- | mod/channel.php | 5 | ||||
-rw-r--r-- | mod/id.php | 54 |
2 files changed, 20 insertions, 39 deletions
diff --git a/mod/channel.php b/mod/channel.php index 109c9a596..3216da7e1 100644 --- a/mod/channel.php +++ b/mod/channel.php @@ -36,6 +36,11 @@ function channel_init(&$a) { $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/feed/' . $which .'" />' . "\r\n" ; + +// Not yet ready for prime time +// $a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->get_baseurl() . '/id/' . $which .'?f=" />' . "\r\n" ; +// $a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $a->get_baseurl() . '/id/' . $which .'" />' . "\r\n" ; + // Run profile_load() here to make sure the theme is set before // we start loading content diff --git a/mod/id.php b/mod/id.php index 378022717..6678004c5 100644 --- a/mod/id.php +++ b/mod/id.php @@ -2,45 +2,21 @@ function id_init(&$a) { -logger('id: ' . print_r($_REQUEST,true)); - -/** - * This example shows several things: - * - How a setup interface should look like. - * - How to use a mysql table for authentication - * - How to store associations in mysql table, instead of php sessions. - * - How to store realm authorizations. - * - How to send AX/SREG parameters. - * For the example to work, you need to create the necessary tables: -CREATE TABLE Users ( - id INT NOT NULL auto_increment PRIMARY KEY, - login VARCHAR(32) NOT NULL, - password CHAR(40) NOT NULL, - firstName VARCHAR(32) NOT NULL, - lastName VARCHAR(32) NOT NULL -); - -CREATE TABLE AllowedSites ( - user INT NOT NULL, - realm TEXT NOT NULL, - attributes TEXT NOT NULL, - INDEX(user) -); - -CREATE TABLE Associations ( - id INT NOT NULL PRIMARY KEY, - data TEXT NOT NULL -); - * - * This is only an example. Don't use it in your code as-is. - * It has several security flaws, which you shouldn't copy (like storing plaintext login and password in forms). - * - * This setup could be very easily flooded with many associations, - * since non-private ones aren't automatically deleted. - * You could prevent this by storing a date of association and removing old ones, - * or by setting $this->dh = false; - * However, the latter one would disable stateful mode, unless connecting via HTTPS. - */ + logger('id: ' . print_r($_REQUEST,true)); + + + if(argc() > 1) + $which = argv(1); + else { + $a->error = 404; + return; + } + + $profile = ''; + $channel = $a->get_channel(); + profile_load($a,$which,$profile); + + require 'library/openid/provider/provider.php'; |