diff options
Diffstat (limited to 'modules/oauth/www/registry.edit.php')
-rw-r--r-- | modules/oauth/www/registry.edit.php | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/modules/oauth/www/registry.edit.php b/modules/oauth/www/registry.edit.php index 1b752cd..555e77b 100644 --- a/modules/oauth/www/registry.edit.php +++ b/modules/oauth/www/registry.edit.php @@ -7,10 +7,8 @@ $oauthconfig = SimpleSAML_Configuration::getOptionalConfig('module_oauth.php'); $store = new sspmod_core_Storage_SQLPermanentStorage('oauth'); -//$authsource = $oauthconfig->getValue('auth', 'admin'); $authsource = "admin"; // force admin to authenticate as registry maintainer $useridattr = $oauthconfig->getValue('useridattr', 'user'); -//$useridattr = $oauthconfig->getValue('useridattr', 'uid'); if ($session->isValid($authsource)) { $attributes = $session->getAuthData($authsource, 'Attributes'); @@ -19,7 +17,7 @@ if ($session->isValid($authsource)) { throw new Exception('User ID is missing'); $userid = $attributes[$useridattr][0]; } else { - SimpleSAML_Auth_Default::initLogin($authsource, SimpleSAML_Utilities::selfURL()); + SimpleSAML_Auth_Default::initLogin($authsource, \SimpleSAML\Utils\HTTP::getSelfURL()); } function requireOwnership($entry, $userid) { @@ -37,8 +35,8 @@ if (array_key_exists('editkey', $_REQUEST)) { } else { $entry = array( 'owner' => $userid, - 'key' => SimpleSAML_Utilities::generateID(), - 'secret' => SimpleSAML_Utilities::generateID(), + 'key' => SimpleSAML\Utils\Random::generateID(), + 'secret' => SimpleSAML\Utils\Random::generateID(), ); } @@ -52,9 +50,7 @@ if (isset($_POST['submit'])) { $entry = $editor->formToMeta($_POST, array(), array('owner' => $userid)); requireOwnership($entry, $userid); - -# echo('<pre>Created: '); print_r($entry); exit; - + $store->set('consumers', $entry['key'], '', $entry); $template = new SimpleSAML_XHTML_Template($config, 'oauth:registry.saved.php'); |