Exemple #1
0
$pin = gs_user_pin_get($user);
# use default fax TSI if not provided in http request
#
if ($tsi == '') {
    $fax_tsis_global = explode(',', gs_get_conf('GS_FAX_TSI'));
    if (array_key_exists(0, $fax_tsis_global) && $fax_tsis_global[0] != '') {
        $tsi = $fax_tsis_global[0];
    } else {
        $tsi = '0';
    }
}
# if no local file is specified check if ist's provided in http request
#
if ($local_file == '' && is_array($_FILES) && array_key_exists('file', $_FILES) && $_FILES['file']['error'] == 0 && $_FILES['file']['size'] > 0) {
    $local_file = $_FILES['file']['tmp_name'];
}
# invoke function from the fax library
#
if ($local_file != '') {
    $local_file = gs_get_conf('GS_FAX_INIT_DOCDIR', '') . '/' . preg_replace('/\\.\\./', '', $local_file);
    if (file_exists($local_file)) {
        $fax_job_id = fax_send($user_id, $user, $to, $tsi, $local_file, $email, $resolution, $pin);
    }
}
# result
#
if (isset($fax_job_id) && $fax_job_id >= 1) {
    die_ok('Fax job sent with id: ' . $fax_job_id);
} else {
    die_error('Fax job not accepted');
}
Exemple #2
0
}
$user_id = @$_SESSION['sudo_user']['id'];
$fax_job_id = 0;
$per_page = (int) gs_get_conf('GS_GUI_NUM_RESULTS');
$tsi = trim(@$_REQUEST['tsi']);
$faxnumber = trim(@$_REQUEST['faxnumber']);
$resolution = (int) trim(@$_REQUEST['res']);
$document = trim(@$_REQUEST['doc']);
if (is_array($_FILES) && @array_key_exists('file', @$_FILES) && @$_FILES['file']['error'] == 0 && @$_FILES['file']['size'] > 0) {
    $fax_job_id = fax_send($user_id, $_SESSION['sudo_user']['name'], $faxnumber, $tsi, $_FILES['file']['tmp_name'], email_by_username($_SESSION['sudo_user']['name']), $resolution, gs_user_pin_get($_SESSION['sudo_user']['name']));
    $file_ok = true;
} else {
    $file_ok = false;
}
if ($document && $resolution) {
    $fax_job_id = fax_send($user_id, $_SESSION['sudo_user']['name'], $faxnumber, $tsi, '/docq/' . $document, email_by_username($_SESSION['sudo_user']['name']), $resolution, gs_user_pin_get($_SESSION['sudo_user']['name']));
}
echo '<form enctype="multipart/form-data" method="post" action="', GS_URL_PATH, '">', "\n";
echo gs_form_hidden($SECTION, $MODULE);
?>

<table cellspacing="1">
<tbody>
<tr>
	<th style="width:150px;"></th>
	<th style="width:350px;"></th>
</tr>

<?php 
echo "<tr>\n";
echo '<th>', __('Senderkennung'), '</th>', "\n";