Example #1
0
<?php

/**
 * Copyright (c) 2012 Bart Visscher <*****@*****.**>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
// Check if we are a user
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('user_openid_provider');
OCP\JSON::callCheck();
set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/../3rdparty');
$url = $_POST['url'];
$storage = new OC_OpenIdProviderStorage();
$storage->addSite('/?' . OCP\User::getUser(), $url, null);
OCP\JSON::success();
<?php

set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/3rdparty');
OCP\Util::addScript('user_openid_provider', 'settings');
OCP\Util::addStyle('user_openid_provider', 'settings');
$storage = new OC_OpenIdProviderStorage();
$trusted_sites = $storage->getTrustedSites('/?' . OCP\User::getUser());
if (empty($trusted_sites)) {
    return;
}
$tmpl = new OCP\Template('user_openid_provider', 'settings');
$tmpl->assign('trusted_sites', $trusted_sites);
return $tmpl->fetchPage();