2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Set downloading voip client as the default

Use same tmp dir as Limesurvey
Check if tmp dir writable before using to avoid server overloading
This commit is contained in:
Adam Zammit
2013-07-15 11:54:22 +10:00
parent c23097eceb
commit 0f76ed7c64
2 changed files with 39 additions and 36 deletions

View File

@@ -92,9 +92,9 @@ if (is_voip_enabled($operator_id))
$exta = $exts[1]; $exta = $exts[1];
$extp = get_extension_password($operator_id); $extp = get_extension_password($operator_id);
if (get_extension_status($operator_id)) if (get_extension_status($operator_id))
print "<div class='online statusbutton'><a href='news://turnvoipoff'>" . T_("VoIP On") . "</a></div>"; print "<div class='online statusbutton'>" . T_("VoIP On") . "</div>";
else else
print "<div class='offline statusbutton'><a href='irc://$exta:$extp@" . VOIP_SERVER . "/'>" . T_("VoIP Off") . "</a></div>"; print "<div class='offline statusbutton'><a href='voip/downloadvoipclient.php'>" . T_("VoIP Off") . "</a></div>";
} }
else else
print "<div class='online statusbutton'>" . T_("No VoIP") . "</div>"; print "<div class='online statusbutton'>" . T_("No VoIP") . "</div>";

View File

@@ -47,7 +47,7 @@ function tempdir($dir, $prefix='', $mode=0700)
return $path; return $path;
} }
$tempdir = realpath(dirname(__FILE__) . '/tmp'); $tempdir = realpath(dirname(__FILE__) . '/../include/limesurvey/tmp');
$operator_id = get_operator_id(); $operator_id = get_operator_id();
if ($operator_id) if ($operator_id)
@@ -60,6 +60,8 @@ if ($operator_id)
$rs = $db->GetRow($sql); $rs = $db->GetRow($sql);
if (!empty($rs)) if (!empty($rs))
{
if (is_writable($tempdir))
{ {
$zipdir=tempdir($tempdir); $zipdir=tempdir($tempdir);
@@ -99,4 +101,5 @@ if ($operator_id)
unlink($zipfile); unlink($zipfile);
} }
} }
}
exit(); exit();