From 1aa8399915bc6148fab3ad8e3eae736e9a135c09 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 24 Jun 2011 17:06:02 +0200 Subject: [PATCH] show error on openid request page when no user is selected --- apps/user_openid/phpmyid.php | 4 +++- apps/user_openid/templates/nomode.php | 21 +++++++++++++-------- apps/user_openid/user.php | 4 ++++ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php index 330cd466c4..5b04684cd7 100644 --- a/apps/user_openid/phpmyid.php +++ b/apps/user_openid/phpmyid.php @@ -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() : ''); diff --git a/apps/user_openid/templates/nomode.php b/apps/user_openid/templates/nomode.php index 13a1a89493..f85d28cdc9 100644 --- a/apps/user_openid/templates/nomode.php +++ b/apps/user_openid/templates/nomode.php @@ -5,17 +5,22 @@ global $profile; ?>
- " alt="ownCloud" /> + " alt="ownCloud" /> diff --git a/apps/user_openid/user.php b/apps/user_openid/user.php index 9ca1fd47c9..2199e5f9e5 100644 --- a/apps/user_openid/user.php +++ b/apps/user_openid/user.php @@ -28,6 +28,10 @@ if(strpos($USERNAME,'?')){ require_once '../../lib/base.php'; +if(!OC_USER::userExists($USERNAME)){ + $USERNAME=''; +} + require_once 'phpmyid.php';