Merge "Preferences: Add autocomplete="off" to preferences form"
[lhc/web/wiklou.git] / includes / api / ApiQueryStashImageInfo.php
index 51f4862..b039a1e 100644 (file)
@@ -32,6 +32,10 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo {
        }
 
        public function execute() {
+               if ( !$this->getUser()->isLoggedIn() ) {
+                       $this->dieUsage( 'You must be logged-in to have an upload stash', 'notloggedin' );
+               }
+
                $params = $this->extractRequestParams();
                $modulePrefix = $this->getModulePrefix();
 
@@ -42,7 +46,7 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo {
                $result = $this->getResult();
 
                if ( !$params['filekey'] && !$params['sessionkey'] ) {
-                       $this->dieUsage( "One of filekey or sessionkey must be supplied", 'nofilekey' );
+                       $this->dieUsage( 'One of filekey or sessionkey must be supplied', 'nofilekey' );
                }
 
                // Alias sessionkey to filekey, but give an existing filekey precedence.
@@ -62,9 +66,9 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo {
                        }
                // @todo Update exception handling here to understand current getFile exceptions
                } catch ( UploadStashFileNotFoundException $e ) {
-                       $this->dieUsage( "File not found: " . $e->getMessage(), "invalidsessiondata" );
+                       $this->dieUsage( 'File not found: ' . $e->getMessage(), 'invalidsessiondata' );
                } catch ( UploadStashBadPathException $e ) {
-                       $this->dieUsage( "Bad path: " . $e->getMessage(), "invalidsessiondata" );
+                       $this->dieUsage( 'Bad path: ' . $e->getMessage(), 'invalidsessiondata' );
                }
        }