Пример #1
0
     foreach ($maintainer_openids as $key => $i) {
         $maintainer_openids[$key] = trim($i);
     }
 }
 if (in_array(WEBSPACE_OPENID, $maintainer_openids)) {
     define("USER_IS_MAINTAINER", 1);
 }
 // check if called from consumer : Do not log in if allready logged on before.
 if (isset($uri_routing[0]) && $uri_routing[0] == "login") {
     $openid_mode = GetFromURL("openid_mode");
     if ($openid_mode) {
         if (!empty($_SESSION['user_id'])) {
             $uri_routing[0] = "trust";
         } else {
             if ($openid_mode == "checkid_immediate") {
                 $openid_return_to = GetFromURL("openid_return_to");
                 if (strpos($openid_return_to, '?')) {
                     $s = '&';
                 } else {
                     $s = '?';
                 }
                 $data_to_send = array();
                 $data_to_send['openid.ns'] = 'http://specs.openid.net/auth/2.0';
                 $data_to_send['openid.mode'] = 'setup_needed';
                 $data_to_send['openid.user_setup_url'] = 'http' . (isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on' || $_SERVER['HTTPS'] == 1) ? 's' : '') . '://' . $_SERVER['SERVER_NAME'] . '/login';
                 $redirurl = $openid_return_to . $s . http_build_query($data_to_send);
                 if (strpos($redirurl, '\\n') !== FALSE || strpos($redirurl, 'http://') !== 0 && strpos($redirurl, 'https://') !== 0) {
                     header("Status: 500");
                     echo "Invalid return URL found.";
                     exit;
                 }
Пример #2
0
            $mail->Body = $html;
            // non - HTML-version of the email
            $mail->AltBody = utf8_decode(strip_tags($email_message));
            $mail->AddAddress($_POST['new_password_email']);
            if ($mail->Send()) {
                // sent
                $body->set('new_password', 1);
            }
            // success message
            $GLOBALS['script_message_log'][] = _("Your profile information was updated.");
        } else {
            $GLOBALS['script_error_log'][] = _("We could not find a match to your email and memorable date. Please contact the service owner.");
        }
    }
}
$openIDMode = GetFromURL("openid_mode");
if ($openIDMode) {
    $openid_mode = $openIDMode;
}
require_once 'class/Openid.class.php';
if (isset($openid_mode) && !isset($_POST['login']) && !isset($_POST['trust'])) {
    $server = new OpenidServer($db, $core_config['security']['openid_encryption_level']);
    switch ($openid_mode) {
        case 'associate':
            $server->associate();
            break;
        case 'checkid_setup':
            $server->checkid_setup();
            break;
        case 'check_authentication':
            $server->check_authentication();