summaryrefslogtreecommitdiffstats
path: root/apps/contacts
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-30 14:18:47 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-05-30 14:18:47 +0200
commit4dc7ed139bdc809d468d4d055a86221c8e3b6dd0 (patch)
tree3b7d842d6f21d873b15c538fa93414d7fa30cacb /apps/contacts
parentc1f7d320e8c8b344d48745314614dac8968a79b2 (diff)
downloadnextcloud-server-4dc7ed139bdc809d468d4d055a86221c8e3b6dd0.tar.gz
nextcloud-server-4dc7ed139bdc809d468d4d055a86221c8e3b6dd0.zip
don´t hardcode /tmp
Diffstat (limited to 'apps/contacts')
-rw-r--r--apps/contacts/ajax/currentphoto.php2
-rw-r--r--apps/contacts/ajax/oc_photo.php2
-rw-r--r--apps/contacts/ajax/savecrop.php2
-rw-r--r--apps/contacts/ajax/uploadimport.php2
-rw-r--r--apps/contacts/ajax/uploadphoto.php4
5 files changed, 6 insertions, 6 deletions
diff --git a/apps/contacts/ajax/currentphoto.php b/apps/contacts/ajax/currentphoto.php
index d8afa060b1e..d0654b17d64 100644
--- a/apps/contacts/ajax/currentphoto.php
+++ b/apps/contacts/ajax/currentphoto.php
@@ -40,7 +40,7 @@ if (!isset($_GET['id'])) {
bailOut(OC_Contacts_App::$l10n->t('No contact ID was submitted.'));
}
-$tmpfname = tempnam("/tmp", "occOrig");
+$tmpfname = tempnam(get_temp_dir(), "occOrig");
$contact = OC_Contacts_App::getContactVCard($_GET['id']);
$image = new OC_Image();
if(!$image) {
diff --git a/apps/contacts/ajax/oc_photo.php b/apps/contacts/ajax/oc_photo.php
index 085d2710f5f..184217f2b72 100644
--- a/apps/contacts/ajax/oc_photo.php
+++ b/apps/contacts/ajax/oc_photo.php
@@ -42,7 +42,7 @@ if(!isset($_GET['path'])) {
}
$localpath = OC_Filesystem::getLocalFile($_GET['path']);
-$tmpfname = tempnam("/tmp", "occOrig");
+$tmpfname = tempnam(get_temp_dir(), "occOrig");
if(!file_exists($localpath)) {
bailOut(OC_Contacts_App::$l10n->t('File doesn\'t exist:').$localpath);
diff --git a/apps/contacts/ajax/savecrop.php b/apps/contacts/ajax/savecrop.php
index cd470307125..fe9e5c5b991 100644
--- a/apps/contacts/ajax/savecrop.php
+++ b/apps/contacts/ajax/savecrop.php
@@ -71,7 +71,7 @@ if(file_exists($tmp_path)) {
OCP\Util::writeLog('contacts','savecrop.php, x: '.$x1.' y: '.$y1.' w: '.$w.' h: '.$h, OCP\Util::DEBUG);
if($image->crop($x1, $y1, $w, $h)) {
if(($image->width() <= 200 && $image->height() <= 200) || $image->resize(200)) {
- $tmpfname = tempnam("/tmp", "occCropped"); // create a new file because of caching issues.
+ $tmpfname = tempnam(get_temp_dir(), "occCropped"); // create a new file because of caching issues.
if($image->save($tmpfname)) {
unlink($tmp_path);
$card = OC_Contacts_App::getContactVCard($id);
diff --git a/apps/contacts/ajax/uploadimport.php b/apps/contacts/ajax/uploadimport.php
index f4a13e0a4bb..b11f380fa8a 100644
--- a/apps/contacts/ajax/uploadimport.php
+++ b/apps/contacts/ajax/uploadimport.php
@@ -67,7 +67,7 @@ if($error !== UPLOAD_ERR_OK) {
}
$file=$_FILES['importfile'];
-$tmpfname = tempnam("/tmp", "occOrig");
+$tmpfname = tempnam(get_temp_dir(), "occOrig");
if(file_exists($file['tmp_name'])) {
if($view->file_put_contents('/'.$tmpfile, file_get_contents($file['tmp_name']))) {
debug($fn.' uploaded');
diff --git a/apps/contacts/ajax/uploadphoto.php b/apps/contacts/ajax/uploadphoto.php
index 99015e2d502..dca8ede6d60 100644
--- a/apps/contacts/ajax/uploadphoto.php
+++ b/apps/contacts/ajax/uploadphoto.php
@@ -46,7 +46,7 @@ if ($fn) {
exit();
}
$id = $_GET['id'];
- $tmpfname = tempnam('/tmp', 'occOrig');
+ $tmpfname = tempnam(get_temp_dir(), 'occOrig');
file_put_contents($tmpfname, file_get_contents('php://input'));
debug($tmpfname.' uploaded');
$image = new OC_Image();
@@ -93,7 +93,7 @@ if($error !== UPLOAD_ERR_OK) {
}
$file=$_FILES['imagefile'];
-$tmpfname = tempnam("/tmp", "occOrig");
+$tmpfname = tempnam(get_temp_dir(), "occOrig");
if(file_exists($file['tmp_name'])) {
$image = new OC_Image();
if($image->loadFromFile($file['tmp_name'])) {