From 54b1ac3e4d2d14d620ba4561102bce9e7fdb56aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Thu, 13 Aug 2009 07:07:02 +0000
Subject: [PATCH] Automatically create temp directory for OAuth Storage

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1657 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/oauth/lib/OAuthStore.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/oauth/lib/OAuthStore.php b/modules/oauth/lib/OAuthStore.php
index 20e8ab3f4..21cd76182 100644
--- a/modules/oauth/lib/OAuthStore.php
+++ b/modules/oauth/lib/OAuthStore.php
@@ -14,6 +14,13 @@ class sspmod_oauth_OAuthStore extends OAuthDataStore {
 	private $path;
 
     function __construct($path = '/tmp/oauth/') {
+			
+		if (!file_exists($path)) {
+			mkdir($path);
+		} else {
+			if (!is_dir($path)) 
+				throw new Exception('OAuth Storage Path [' . $path . '] is not a valid directory');
+		}
 		$this->path = $path;
     }
 
-- 
GitLab