]> source.dussan.org Git - nextcloud-server.git/commitdiff
offer login popup from oauth dialog
authorMichiel@unhosted <michiel@unhosted.org>
Mon, 12 Sep 2011 13:17:52 +0000 (15:17 +0200)
committerMichiel@unhosted <michiel@unhosted.org>
Mon, 12 Sep 2011 13:17:52 +0000 (15:17 +0200)
apps/unhosted/compat.php

index 5e0f1a09010dc6153dd68fef269fc6bad67dbb97..5034d04de311b29b916dd0e9a54fe827a9e500e1 100644 (file)
@@ -100,9 +100,16 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted'
                        $token=OC_UnhostedWeb::createDataScope($appUrl, $userAddress, $dataScope);
                        header('Location: '.$_GET['redirect_uri'].'#access_token='.$token.'&token_type=unhosted');
                } else {
+                       if($_SERVER['HTTPS']){
+                               $url = "https://";
+                       } else {
+                               $url = "http://";
+                       }
+                       $url .= $_SERVER['SERVER_NAME'];
+                       $url .= substr($_SERVER['SCRIPT_NAME'], 0, -strlen('apps/unhosted/compat.php'));
                        die('Please '
                                .'<input type="submit" onclick="'
-                               ."window.open('https://myfavouritesandwich.org:444/','Close me!','height=600,width=300');"
+                               ."window.open('$url','Close me!','height=600,width=300');"
                                .'" value="log in">'
                                .', close the pop-up, and '
                                .'<form method="POST"><input name="allow" type="submit" value="Try again"></form>');