diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 15:09:48 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 15:09:48 -0300 |
commit | 4fb376687dc1546f51e637cae1478582309f85f0 (patch) | |
tree | 8dd99abb6a221fd10bd86b00d5dd431ebcba4e0a /start.php | |
download | elgg-4fb376687dc1546f51e637cae1478582309f85f0.tar.gz elgg-4fb376687dc1546f51e637cae1478582309f85f0.tar.bz2 |
Squashed 'mod/foafssl/' content from commit 3c1da1e
git-subtree-dir: mod/foafssl
git-subtree-split: 3c1da1eaff8f61049b45ad99528f8f4e09ac7e62
Diffstat (limited to 'start.php')
-rw-r--r-- | start.php | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/start.php b/start.php new file mode 100644 index 000000000..a9e20c77f --- /dev/null +++ b/start.php @@ -0,0 +1,83 @@ +<?php +/** + * Elgg powered plugin + * + * @package + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author lorea + * @copyright lorea + * @link http://lorea.cc + */ + + function elgg_foafssl_createkey($modulus, $exponent, $user, $webid, $name) { + error_log("create foaf ssl key:".$modulus.":".$exponent); + $user_guid = $user->getGUID(); + $key = new ElggObject(); + $key->name = $name; + $key->title = $name; + $key->subtype = 'sslkey'; + $key->owner_guid = $user_guid; + $key->container_guid = $user_guid; + $key->access_id = ACCESS_PUBLIC; + $key->save(); + $key->webid = $webid; + $key->modulus = $modulus; + $key->exponent = $exponent; + return $key; + } + + + function foafssl_page_handler($page) { + global $CONFIG; + switch ($page[0]) { + case 'manage': + include($CONFIG->pluginspath.'foafssl/manage.php'); + break; + case 'add': + include($CONFIG->pluginspath.'foafssl/add.php'); + break; + case 'generate': + include($CONFIG->pluginspath.'foafssl/generate.php'); + break; + case 'login': + include($CONFIG->pluginspath.'foafssl/authenticationlogin.php'); + break; + } + } + + function foafssl_pagesetup() { + global $CONFIG; + if (get_context() == 'settings') { + add_submenu_item(elgg_echo('foafssl:manage'), $CONFIG->wwwroot . "pg/foafssl/manage"); + } + } + + + function foafssl_init(){ + global $CONFIG; + register_action("foafssl/add",false, $CONFIG->pluginspath . "foafssl/actions/add.php"); + register_action("foafssl/generate",false, $CONFIG->pluginspath . "foafssl/actions/generate.php"); + register_action("foafssl/suck",false, $CONFIG->pluginspath . "foafssl/actions/suck.php"); + register_action("foafssl/delete",false, $CONFIG->pluginspath . "foafssl/actions/delete.php"); + register_action('entities/delete'); + register_page_handler('foafssl','foafssl_page_handler'); + register_elgg_event_handler('pagesetup','system','foafssl_pagesetup'); + elgg_extend_view("account/forms/login", "foafssl/loginbox"); + register_action("foafssl/register",true, $CONFIG->pluginspath . "foafssl/actions/register.php"); + + + //elgg_extend_view("canvas/layouts/widgets", "foafssl/profile"); + /* + register_action("microthemes/clear",false, $CONFIG->pluginspath . "microthemes/actions/microthemes/clear.php"); + register_action("microthemes/edit",false, $CONFIG->pluginspath . "microthemes/actions/microthemes/edit.php"); + register_action("microthemes/choose",false, $CONFIG->pluginspath . "microthemes/actions/microthemes/choose.php"); + register_plugin_hook('entity:icon:url', 'object', 'microthemes_tasksicon_hook'); + register_elgg_event_handler('pagesetup','system','microthemes_pagesetup'); + + elgg_extend_view("metatags", "microthemes/metatags"); + //elgg_extend_view('profile/menu/linksownpage','microthemes/profilemenu');*/ + } + +register_elgg_event_handler('init','system','foafssl_init'); + +?> |