Beispiel #1
0
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*
*
* This uses the Zend OpenID implementation, find a tutorial about it at http://framework.zend.com/manual/en/zend.openid.html .
*
*/
OC::$CLASSPATH['OC_OpenIdProviderUserSession'] = 'user_openid_provider/lib/OpenIdProviderUserSession.php';
OC::$CLASSPATH['OC_OpenIdProviderStorage'] = 'user_openid_provider/lib/OpenIdProviderStorage.php';
$userName = '';
if (strpos($_SERVER["REQUEST_URI"], '?') and !strpos($_SERVER["REQUEST_URI"], '=')) {
    if (strpos($_SERVER["REQUEST_URI"], '/?') !== false) {
        $userName = substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], '/?') + 2);
    } elseif (strpos($_SERVER["REQUEST_URI"], '.php?') !== false) {
        $userName = substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], '.php?') + 5);
    }
}
$remote_token = 'openid_provider';
if (($pos = strpos($_SERVER["REQUEST_URI"], $remote_token)) !== false) {
    $pos += strlen($remote_token) + 1;
    $userName = substr($_SERVER['REQUEST_URI'], $pos);
}
//die('username: '******'') {
    OCP\Util::addHeader('link', array('rel' => 'openid.server', 'href' => OCP\Util::linkToRemote($remote_token) . $userName));
    OCP\Util::addHeader('link', array('rel' => 'openid.delegate', 'href' => OCP\Util::linkToAbsolute('', '?') . $userName));
}
OCP\App::registerPersonal('user_openid_provider', 'settings');
Beispiel #2
0
<?php

//check if curl extension installed
if (!in_array('curl', get_loaded_extensions())) {
    return;
}
$userName = '';
if (strpos($_SERVER["REQUEST_URI"], '?') and !strpos($_SERVER["REQUEST_URI"], '=')) {
    if (strpos($_SERVER["REQUEST_URI"], '/?')) {
        $userName = substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], '/?') + 2);
    } elseif (strpos($_SERVER["REQUEST_URI"], '.php?')) {
        $userName = substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], '.php?') + 5);
    }
}
OCP\Util::addHeader('link', array('rel' => 'openid.server', 'href' => OCP\Util::linkToAbsolute("user_openid", "user.php") . '/' . $userName));
OCP\Util::addHeader('link', array('rel' => 'openid.delegate', 'href' => OCP\Util::linkToAbsolute("user_openid", "user.php") . '/' . $userName));
OCP\App::registerPersonal('user_openid', 'settings');
require_once 'apps/user_openid/user_openid.php';
//active the openid backend
OC_User::useBackend('openid');
//check for results from openid requests
if (isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res') {
    OCP\Util::writeLog('user_openid', 'openid retured', OCP\Util::DEBUG);
    $openid = new SimpleOpenID();
    $openid->SetIdentity($_GET['openid_identity']);
    $openid_validation_result = $openid->ValidateWithServer();
    if ($openid_validation_result == true) {
        // OK HERE KEY IS VALID
        OCP\Util::writeLog('user_openid', 'auth sucessfull', OCP\Util::DEBUG);
        $identity = $openid->GetIdentity();
        OCP\Util::writeLog('user_openid', 'auth as ' . $identity, OCP\Util::DEBUG);
Beispiel #3
0
*
* @author Florian Hülsmann
* @copyright 2012 Florian Hülsmann <*****@*****.**>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*
*/
$l = OC_L10N::get('notify');
OC::$CLASSPATH['OC_Notify'] = 'apps/notify/lib/notify.php';
if (OCP\User::isLoggedIn()) {
    // this makes no sense for guests, so only for users
    OCP\Util::addScript('notify', 'notifications');
    OCP\Util::addStyle('notify', 'notifications');
    OCP\Util::addStyle('notify', 'customNotifications');
    OCP\Util::addHeader('link', array('rel' => 'alternate', 'type' => 'application/atom+xml', 'title' => $l->t('ownCloud notifications (%s)', 'Atom 1.0'), 'href' => OCP\Util::linkToRemote('notify_feed') . 'feed.atom'));
    OCP\Util::addHeader('link', array('rel' => 'alternate', 'type' => 'application/rss+xml', 'title' => $l->t('ownCloud notifications (%s)', 'RSS 2.0'), 'href' => OCP\Util::linkToRemote('notify_feed') . 'feed.atom'));
    OCP\App::registerPersonal('notify', 'personal');
    OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Notify', 'post_deleteUser');
    OCP\Util::connectHook('OCP\\Share', 'post_shared', 'OC_Notify', 'post_shared');
}