}
try {
- $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash();
+ $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash( $this->getUser() );
foreach ( $params['filekey'] as $filekey ) {
$file = $stash->getFile( $filekey );
*/
private function performStash() {
try {
- $stashFile = $this->mUpload->stashFile();
+ $stashFile = $this->mUpload->stashFile( $this->getUser() );
if ( !$stashFile ) {
throw new MWException( 'Invalid stashed file' );
if ( $warnings ) {
# Stash the upload
- $key = $this->upload->stashFile();
+ $key = $this->upload->stashFile( $this->user );
// @todo FIXME: This has been broken for a while.
// User::leaveUserMessage() does not exist.
protected function getDescriptionSection() {
$config = $this->getConfig();
if ( $this->mSessionKey ) {
- $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash();
+ $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash( $this->getUser() );
try {
$file = $stash->getFile( $this->mSessionKey );
} catch ( Exception $e ) {
public function __construct() {
parent::__construct( 'UploadStash', 'upload' );
try {
- $this->stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash();
+ $this->stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash( $this->getUser() );
} catch ( UploadStashNotAvailableException $e ) {
}
}
* This works, because there really is only one stash per logged-in user, despite appearances.
*
* @param array $formData
+ * @param HTMLForm $form
* @return Status
*/
- public static function tryClearStashedUploads( $formData ) {
+ public static function tryClearStashedUploads( $formData, $form ) {
if ( isset( $formData['Clear'] ) ) {
- $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash();
+ $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash( $form->getUser() );
wfDebug( 'stash has: ' . print_r( $stash->listFiles(), true ) . "\n" );
if ( !$stash->clear() ) {
$this->verifyChunk();
// Create a local stash target
- $this->mLocalFile = parent::stashFile();
+ $this->mLocalFile = parent::stashFile( $user );
// Update the initial file offset (based on file size)
$this->mOffset = $this->mLocalFile->getSize();
$this->mFileKey = $this->mLocalFile->getFileKey();