]> source.dussan.org Git - nextcloud-server.git/commitdiff
show error on openid request page when no user is selected
authorRobin Appelman <icewind1991@gmail.com>
Fri, 24 Jun 2011 15:06:02 +0000 (17:06 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Fri, 24 Jun 2011 15:17:07 +0000 (17:17 +0200)
apps/user_openid/phpmyid.php
apps/user_openid/templates/nomode.php
apps/user_openid/user.php

index 330cd466c4895c581b559ca25cf4dbcf364cc5f2..5b04684cd7d0ad9f85fddfcf7e4ef4c5108fa458 100644 (file)
@@ -560,7 +560,9 @@ function logout_mode () {
  * @global array $profile
  */
 function no_mode () {
+       global $USERNAME;
        $tmpl = new OC_TEMPLATE( 'user_openid', 'nomode', 'guest' );
+       $tmpl->assign('user',$USERNAME);
        $tmpl->printPage();
 }
 
@@ -1669,7 +1671,7 @@ if (! array_key_exists('auth_domain', $profile))
 
 // Set a default authentication realm
 if (! array_key_exists('auth_realm', $profile))
-       $profile['auth_realm'] = 'phpMyID';
+       $profile['auth_realm'] = 'ownCloud';
 
 // Determine the realm for digest authentication - DO NOT OVERRIDE
 $profile['php_realm'] = $profile['auth_realm'] . (ini_get('safe_mode') ? '-' . getmyuid() : '');
index 13a1a89493141155522c26068a63858d36c6b8ea..f85d28cdc9bd22d0904476827daa5bafc3a77228 100644 (file)
@@ -5,17 +5,22 @@ global $profile;
 ?>
 
 <div id="login">
-       <img src="<?php echo image_path("", "weather-clear.png"); ?>" alt="ownCloud" />
+       <img src="<?php echo image_path("", "owncloud-logo-medium-white.png"); ?>" alt="ownCloud" />
        <ul>
                <li class='error'>
                        <div id="setup_form">
-                       <p><?php echo($l->t('This is an OpenID server endpoint. For more information, see http://openid.net/'));?></p>
-                       <p><?php echo($l->t('Server: <b>').$profile['idp_url']); ?></b>
-                       <p><?php echo($l->t('Realm: <b>').$profile['php_realm']); ?></b>
-                       <p><a href="<?php echo($profile['idp_url']); ?>?openid.mode=login"><?php echo($l->t('Login')); ?></a>
-                       <?php if($profile['allow_test'] === true){ ?>
-                       | <a href="<?php echo($profile['idp_url']); ?>?openid.mode=test">Test</a>
-                       <?php } ?>
+                               <p><?php echo($l->t('This is an OpenID server endpoint. For more information, see '));?><a href='http://openid.net/' title='openid.net'>http://openid.net/</a></p>
+                               <?php if($_['user']):?>
+                                       <p><?php echo($l->t('Identity: <b>').$profile['idp_url']); ?></b></p>
+                                       <p><?php echo($l->t('Realm: <b>').$profile['php_realm']); ?></b></p>
+                                       <p><?php echo($l->t('User: <b>').$_['user']); ?></b>
+                                       <p><a href="<?php echo($profile['idp_url']); ?>?openid.mode=login"><?php echo($l->t('Login')); ?></a>
+                                       <?php if($profile['allow_test'] === true): ?>
+                                               <a href="<?php echo($profile['idp_url']); ?>?openid.mode=test">Test</a>
+                                       <?php endif; ?>
+                               <?php else: ?>
+                                       <p><?php echo($l->t('Error: <b>No user Selected')); ?></p>
+                               <?php endif; ?>
                        </div>
                </li>
        </ul>
index 9ca1fd47c924a13b7ee31443c5142bb4cbad046f..2199e5f9e58ed9ff78da4eb8a092f4f2e54dd187 100644 (file)
@@ -28,6 +28,10 @@ if(strpos($USERNAME,'?')){
 
 require_once '../../lib/base.php';
 
+if(!OC_USER::userExists($USERNAME)){
+               $USERNAME='';
+}
+
 require_once 'phpmyid.php';