Exemplo n.º 1
0
function _secs_to_days($secs)
{
    $ret = $secs < 0 ? '- ' : '';
    $secs = abs($secs);
    $ret .= sPrintF('%d days %d:%02d:%02d', $secs / (60 * 60 * 24), $secs / (60 * 60) % 24, $secs / 60 % 60, $secs / 1 % 60);
    return $ret;
}
Exemplo n.º 2
0
function quoted_printable_encode($str, $wrap = true)
{
    $ret = '';
    $l = strLen($str);
    $current_locale = setLocale(LC_CTYPE, 0);
    setLocale(LC_CTYPE, 'C');
    for ($i = 0; $i < $l; ++$i) {
        $char = $str[$i];
        if (ctype_print($char) && !ctype_cntrl($char) && $char !== '=') {
            $ret .= $char;
        } else {
            $ret .= sPrintF('=%02X', ord($char));
        }
    }
    setLocale(LC_CTYPE, $current_locale);
    return $wrap ? wordWrap($ret, 67, " =\n") : $ret;
}
function gs_user_is_valid_name($username)
{
    if (!preg_match('/^[a-z0-9\\-_.]+$/', $username)) {
        return new GsError('Username must be lowercase alphanumeric.');
    }
    if (strLen($username) < 2) {
        return new GsError('Username must have 2 characters or more.');
    }
    if (strLen($username) > 50) {
        return new GsError('Username can\'t have more than 50 characters.');
    }
    if (preg_match('/^[.]/', $username)) {
        return new GsError('Username must not start in ".".');
    }
    if (!preg_match('/^[a-z0-9\\-_][a-z0-9\\-_.]+$/', $username)) {
        return new GsError('Invalid username.');
    }
    if (in_array($username, array('sysadmin', 'root', 'gemeinschaft', 'setup', 'my', 'prov', 'img', 'js', 'mon', 'styles', 'soap', 'srv'), true) || preg_match('/^nobody-/', $username)) {
        return new GsError(sPrintF('"%s" cannot be used as a username.', $username));
    }
    return true;
}
Exemplo n.º 4
0
    public function processLogs($logs)
    {
        if (empty($logs) || $this->getApplication()->getMode() === 'Performance') {
            return;
        }
        if (headers_sent()) {
            echo '
				<div style="width:100%; background-color:darkred; color:#FFF; padding:2px">
					TFirePhpLogRoute.GroupLabel "<i>' . $this->getGroupLabel() . '</i>" -
					Routing to FirePHP impossible, because headers already sent!
				</div>
			';
            $fallback = new TBrowserLogRoute();
            $fallback->processLogs($logs);
            return;
        }
        $firephp = FirePHP::getInstance(true);
        $firephp->setOptions(array('useNativeJsonEncode' => false));
        $firephp->group($this->getGroupLabel(), array('Collapsed' => true));
        $firephp->log('Time,  Message');
        $first = $logs[0][3];
        $c = count($logs);
        for ($i = 0, $n = $c; $i < $n; ++$i) {
            $message = $logs[$i][0];
            $level = $logs[$i][1];
            $category = $logs[$i][2];
            if ($i < $n - 1) {
                $delta = $logs[$i + 1][3] - $logs[$i][3];
                $total = $logs[$i + 1][3] - $first;
            } else {
                $delta = '?';
                $total = $logs[$i][3] - $first;
            }
            $message = sPrintF('+%0.6f: %s', $delta, preg_replace('/\\(line[^\\)]+\\)$/', '', $message));
            $firephp->fb($message, $category, self::translateLogLevel($level));
        }
        $firephp->log(sPrintF('%0.6f', $total), 'Cumulated Time');
        $firephp->groupEnd();
    }
Exemplo n.º 5
0
function _gs_legacy_user_map_lvm($user)
{
    global $dispatcher_errors_html;
    if (!$user) {
        return false;
    }
    if (GS_LDAP_PROP_UID === GS_LDAP_PROP_USER) {
        return $user;
    }
    $ldap = gs_ldap_connect();
    $u = gs_ldap_get_first($ldap, GS_LDAP_SEARCHBASE, '(' . GS_LDAP_PROP_UID . '=' . $user . ')', array(GS_LDAP_PROP_USER));
    if (isGsError($u)) {
        //echo $u->$msg;
        $dispatcher_errors_html[] = sPrintF(htmlEnt(__('Failed to get user "%s" from LDAP server.')), $user);
        return false;
    }
    if (!is_array($u)) {
        $dispatcher_errors_html[] = sPrintF(htmlEnt(__('User "%s" not found in LDAP database.')), $user);
        return false;
    }
    $lc_GS_LDAP_PROP_USER = strToLower(GS_LDAP_PROP_USER);
    if (!isset($u[$lc_GS_LDAP_PROP_USER])) {
        return false;
    }
    if (!isset($u[$lc_GS_LDAP_PROP_USER][0])) {
        return false;
    }
    $ret = $u[$lc_GS_LDAP_PROP_USER][0];
    //if (gs_get_conf('GS_LVM_USER_6_DIGIT_INT')) {
    // this check is not really needed as this is a custom function anyway
    $ret = str_pad($ret, 6, '0', STR_PAD_LEFT);
    //}
    return $ret;
}
<br />
<button type="submit">
	<img alt=" " src="<?php 
    echo GS_URL_PATH;
    ?>
crystal-svg/16/act/filesave.png" />
	<?php 
    echo __('Speichern');
    ?>
</button>

<br />
<br />
<br />
<p class="text"><sup>[1]</sup> <?php 
    echo htmlEnt(sPrintF(__("String für den Dial()-Befehl. Dabei wird {number} automatisch von Gemeinschaft durch die zu wählende Rufnummer, {number:1} durch die Rufnummer ohne die erste Ziffer, {port} durch den eingestellten Port und {gateway} durch die interne Bezeichnung \"%s\" ersetzt."), $gw['name']));
    ?>
</p>
<p class="text"><sup>[2]</sup> <?php 
    echo __('Gateways m&uuml;ssen jeweils einer Gateway-Gruppe zugeordnet werden damit sie benutzt werden k&ouml;nnen.');
    ?>
</p>

</form>

<?php 
}
#####################################################################
#####################################################################
if ($action == '') {
    ?>
        }
        echo '</tbody>', "\n";
        echo '</table>', "\n";
        echo '<br />', "\n";
        echo '<form method="post" action="', GS_URL_PATH, '" enctype="multipart/form-data">', "\n";
        echo gs_form_hidden($SECTION, $MODULE), "\n";
        echo '<input type="hidden" name="action" value="import" />', "\n";
        echo '<input type="hidden" name="sep"      value="', $sep, '" />', "\n";
        echo '<input type="hidden" name="encl"     value="', $encl, '" />', "\n";
        echo '<input type="hidden" name="enc"      value="', $enc, '" />', "\n";
        echo '<input type="hidden" name="col_ln"   value="', $col_ln, '" />', "\n";
        echo '<input type="hidden" name="col_fn"   value="', $col_fn, '" />', "\n";
        echo '<input type="hidden" name="col_nr"   value="', $col_nr, '" />', "\n";
        echo '<input type="hidden" name="skip_1st" value="', (int) $skip_1st, '" />', "\n";
        echo '<input type="hidden" name="rem_old_entries" value="', (int) $rem_old_entries, '" />', "\n";
        echo '<p class="text">', @sPrintF(__('Daten in Ihr pers&ouml;nliches Telefonbuch (Benutzer <code>%s</code>, %s %s, Durchwahl <code>%s</code>) importieren?'), @$_SESSION['sudo_user']['name'], @$_SESSION['sudo_user']['info']['firstname'], @$_SESSION['sudo_user']['info']['lastname'], @$_SESSION['sudo_user']['info']['ext']), '</p>', "\n";
        echo '<p class="text">';
        echo '<input type="checkbox" name="rem_old_entries" id="ipt-rem_old_entries" value="1"', $rem_old_entries ? ' checked="checked" ' : '', ' />', "\n", '<label for="ipt-rem_old_entries">', __('Alte Daten entfernen und Telefonbuch ersetzen'), '</label>', "\n";
        echo '</p>', "\n";
        echo '<input type="submit" value="', __('Import'), '" /><br />', "\n";
        echo '</form>', "\n";
        echo '<br />', "\n";
    }
}
if ($action === 'import') {
    if (!@is_array(@$records) || count($records) < 1) {
        echo 'Error.';
    } else {
        $user_id = (int) @$_SESSION['sudo_user']['info']['id'];
        $query_start = 'INSERT INTO `pb_prv` (`user_id`, `firstname`, `lastname`, `number`) VALUES ' . "\n";
        $sql_values = array();
Exemplo n.º 8
0
         break;
     default:
         echo htmlEnt($cf['src']);
 }
 //echo '</td>' ,"\n";
 //echo '<td>';
 echo ' &nbsp; ';
 switch ($cf['case']) {
     case 'always':
         echo __('sofort');
         break;
     case 'busy':
         echo __('bei besetzt');
         break;
     case 'unavail':
         echo sPrintF(__('nach %s Sek.'), $cf['timeout']);
         break;
     case 'offline':
         echo __('offline');
         break;
     default:
         echo htmlEnt($cf['case']);
 }
 //echo '</td>' ,"\n";
 //echo '<td>';
 echo ' &nbsp; ';
 echo '&rarr; &nbsp; ';
 if ($cf['active'] === 'vml' || preg_match('/^vm/', $cf['number'], $m)) {
     echo htmlEnt(__('AB'));
     if (preg_match('/^(?:(?:vm)?)(.*)/', $cf['number'], $m)) {
         $vm_number = $m[1];
Exemplo n.º 9
0
function _update_users($DB, $host_id, $host, $api, &$msg)
{
    $host_id = (int) $host_id;
    $num_users_total = (int) $DB->executeGetOne('SELECT COUNT(*) FROM `users` WHERE `host_id`=' . $host_id);
    $num_users_updated = 0;
    $msg = '';
    if ($num_users_total < 1) {
        return null;
    }
    switch ($api) {
        case 'm01':
        case 'm02':
            # update all users on the host
            $hp_route_prefix = (string) $DB->executeGetOne('SELECT `value` FROM `host_params` ' . 'WHERE `host_id`=' . $host_id . ' AND `param`=\'route_prefix\'');
            if (!extension_loaded('soap')) {
                $msg = 'Failed to sync users on foreign host (SoapClient not available).';
                return false;
            }
            include_once GS_DIR . 'inc/boi-soap/boi-soap.php';
            $rs = $DB->execute('SELECT ' . '`u`.`user`, `u`.`pin`, `u`.`firstname`, `u`.`lastname`, `u`.`email`, ' . '`s`.`secret` `sip_pwd`, `s`.`name` `ext` ' . 'FROM ' . '`users` `u` JOIN ' . '`ast_sipfriends` `s` ON (`s`.`_user_id`=`u`.`id`) ' . 'WHERE `u`.`host_id`=' . $host_id);
            if ($rs->numRows() == 0) {
                return null;
            }
            $soap_errors = array();
            while ($userinfo = $rs->fetchRow()) {
                $ext = $userinfo['ext'];
                $sub_ext = subStr($ext, 0, strLen($hp_route_prefix)) === $hp_route_prefix ? subStr($ext, strLen($hp_route_prefix)) : $ext;
                gs_log(GS_LOG_DEBUG, "Mapping ext. {$ext} to {$sub_ext} for SOAP call");
                $ok = gs_boi_update_extension($api, $host, $hp_route_prefix, $sub_ext, $userinfo['user'], $userinfo['sip_pwd'], $userinfo['pin'], $userinfo['firstname'], $userinfo['lastname'], $userinfo['email'], $soap_faultcode);
                if (!$ok) {
                    # SOAP error
                    if (strToUpper($soap_faultcode) === 'HTTP') {
                        # SOAP error: Could not connect to host
                        $msg = sPrintF(__('Die Benutzer auf Host %s konnten nicht aktualisiert werden! (Verbindung fehlgeschlagen.)'), htmlEnt($host) . ' (ID ' . $host_id . ')');
                        return false;
                    }
                    if (!array_key_exists($soap_faultcode, $soap_errors)) {
                        $soap_errors[$soap_faultcode] = 1;
                    } else {
                        $soap_errors[$soap_faultcode] = $soap_errors[$soap_faultcode] + 1;
                    }
                } else {
                    ++$num_users_updated;
                }
            }
            if ($num_users_updated < $num_users_total) {
                $msg = sPrintF(__('%u von %u Benutzern auf Host %s konnten nicht aktualisiert werden!'), $num_users_total - $num_users_updated, $num_users_total, htmlEnt($host) . ' (ID ' . $host_id . ')');
                if (count($soap_errors) > 0) {
                    $msg .= ' (SOAP errors: ';
                    $i = 0;
                    foreach ($soap_errors as $soap_faultcode => $num) {
                        if ($i === 0) {
                            ++$i;
                        } else {
                            $msg .= ', ';
                        }
                        $msg .= htmlEnt($soap_faultcode) . ' (' . $num . ')';
                    }
                    $msg .= ')';
                }
                return false;
            } else {
                $msg = sPrintF(__('Die Benutzer auf Host %s wurden aktualisiert.'), htmlEnt($host) . ' (ID ' . $host_id . ')');
                return true;
            }
            break;
        case '':
            # host does not provide any API
            return null;
            break;
        default:
            $msg = 'Failed to sync users on foreign host! (unknown API)';
            return false;
            # unknown API
    }
    return null;
}
Exemplo n.º 10
0
    $query = 'SELECT `lastname` `ln`, `firstname` `fn`, `number`
FROM
	`pb_prv`
WHERE
	`user_id`=' . $user_id . '
	' . ($where ? 'AND (' . $where . ')' : '') . '
ORDER BY `lastname`, `firstname`
LIMIT ' . $num_results;
    $rs = $db->execute($query);
    if ($rs->numRows() !== 0) {
        echo '<SnomIPPhoneDirectory>', "\n", '<Title>', snom_xml_esc($typeToTitle[$type]), '</Title>', "\n", '<Prompt>Prompt</Prompt>', "\n";
        while ($r = $rs->fetchRow()) {
            $name = $r['ln'] . (strLen($r['fn']) > 0 ? ', ' . $r['fn'] : '');
            $number = preg_replace('/[^\\d*#]/', '', $r['number']);
            echo '<DirectoryEntry>', '<Name>', snom_xml_esc($name), '</Name>', '<Telephone>', $number, '</Telephone>', '</DirectoryEntry>', "\n";
        }
        defineKeys();
        echo '</SnomIPPhoneDirectory>', "\n";
    } else {
        echo '<SnomIPPhoneText>', "\n", '<Title>', snom_xml_esc($typeToTitle[$type]), '</Title>', "\n", '<Prompt>Prompt</Prompt>', "\n";
        if (strLen($keys) > 0) {
            echo '<Text>', snom_xml_esc(sPrintF(__("Keine Treffer für \"%s\". Drücken Sie # um die letzte Eingabe zu widerrufen."), $keys)), '</Text>', "\n";
        } else {
            echo '<Text>', snom_xml_esc(__("Ihr persönliches Telefonbuch enthält keine Einträge.")), '</Text>', "\n";
        }
        defineBackKey();
        echo '</SnomIPPhoneText>', "\n";
    }
    _ob_send();
}
#################################### PRIVATE PHONEBOOK }
Exemplo n.º 11
0
$action = @$_REQUEST['action'];
$host_id = (int) @$_REQUEST['p_host_id'];
$user_id = (int) @$_REQUEST['p_user_id'];
$page = (int) @$_REQUEST['page'];
$u_rname = trim(@$_REQUEST['u_rname']);
$host = trim(@$_REQUEST['host']);
if ($action == '') {
    $action = 'view';
}
if (@$_REQUEST['p_user'] != '') {
    $action = 'add';
}
if ($action === 'add') {
    $user_id = (int) $DB->executeGetOne('SELECT `id` FROM `users` WHERE `user`=\'' . $DB->escape(trim(@$_REQUEST['p_user'])) . '\'');
    if ($user_id < 1) {
        echo '<div class="errorbox">', sPrintF(__('Benutzer &quot;%s&quot; unbekannt.'), @$_REQUEST['p_user']), '</div>', "\n";
    } else {
        $perms = '';
        if ((int) @$_REQUEST['p_perm_l'] == 1) {
            $perms .= 'l';
        }
        if ($perms == '') {
            echo '<div class="errorbox">', __('Sie haben keine Berechtigung ausgew&auml;hlt.'), '</div>', "\n";
        } else {
            $ok = $DB->execute('REPLACE INTO `boi_perms` (`user_id`, `host_id`, `roles`) ' . 'VALUES (' . $user_id . ', ' . $host_id . ', \'' . $DB->escape($perms) . '\')');
            if (!$ok) {
                echo '<div class="errorbox">', 'Error.', '</div>', "\n";
            }
        }
    }
    $action = 'view';
Exemplo n.º 12
0
    if ($err === 0) {
        $out = trim(implode(' ', $out));
        //$out = htmlEnt($out);
        $screen->addString(1, $out, 0, $y = $y + 13, 'font="f13h"');
    }
    # uptime
    $err = 0;
    $out = array();
    @exec('sudo cat /proc/uptime 2>>/dev/null', $out, $err);
    if ($err === 0) {
        $out = trim(implode(' ', $out));
        $tmp = explode(' ', $out);
        $uptime = (double) @$tmp[0];
        $days = $uptime < 0 ? '- ' : '';
        $uptime = abs($uptime);
        $days .= sPrintF('%d days %d:%02d:%02d', $uptime / (60 * 60 * 24), $uptime / (60 * 60) % 24, $uptime / 60 % 60, $uptime / 1 % 60);
        $screen->addString(2, 'Uptime: ' . $days, 0, $y = $y + 13, 'font="f13h"');
    }
} elseif ($info === 'user') {
    $rs = $db->execute('SELECT `id`, `lastname`, `firstname`, `email` FROM `users` WHERE `id`=' . $user_id);
    $user = $rs->fetchRow();
    $screen->addString(0, 'User Info', 107, 0, 'font="f18c" halign="Center" valign="Top"');
    $screen->addString(1, 'user_id: ' . $user['id'], 0, $y = $y + 13, 'font="f13h"');
    $screen->addString(2, 'lastname: ' . $user['lastname'], 0, $y = $y + 13, 'font="f13h"');
    $screen->addString(3, 'firstname: ' . $user['firstname'], 0, $y = $y + 13, 'font="f13h"');
    $screen->addString(4, 'email: ' . $user['email'], 0, $y = $y + 13, 'font="f13h"');
} elseif ($info === 'phone') {
    $rs = $db->execute('SELECT `type`, `mac_addr`, `firmware_cur` FROM `phones` WHERE `user_id`=' . $user_id);
    $phone = $rs->fetchRow();
    $screen->addString(0, 'Phone Info', 107, 0, 'font="f18c" halign="Center" valign="Top"');
    $screen->addString(1, 'Deine IP: ' . $remote_ip, 0, $y = $y + 13, 'font="f13h"');
Exemplo n.º 13
0
            $key_profile_id = null;
        }
        $prov_param_profile_id = (int) @$_REQUEST['group-' . $group_id . '-prov_param_profile_id'];
        if ($prov_param_profile_id < 1) {
            $prov_param_profile_id = null;
        }
        $parent_id = (int) @$_REQUEST['group-' . $group_id . '-parent_id'];
        if ($parent_id < 1) {
            $parent_id = null;
        }
        $show_ext_modules = (int) @$_REQUEST['group-' . $group_id . '-show_ext_modules'];
        $ret = gs_prov_group_change($group_id, $parent_id, $name, $title, $key_profile_id, $prov_param_profile_id, $show_ext_modules);
        if (isGsError($ret)) {
            echo '<div class="errorbox">', $ret->getMsg(), '</div>', "\n";
        } elseif (!$ret) {
            echo '<div class="errorbox">', sPrintF(__('Gruppe &quot;%s&quot; konnte nicht gespeichert werden.'), htmlEnt($name)), '</div>', "\n";
        }
    }
    if (GS_BUTTONDAEMON_USE == true) {
        gs_usergroup_update_all_ui();
    }
    $action = '';
    # view
}
#####################################################################
# save }
#####################################################################
#####################################################################
# delete {
#####################################################################
if ($action === 'delete') {
Exemplo n.º 14
0
		data="<?php 
        echo $audio_url_esc;
        ?>
"
		width="250"
		height="22"
		align="right"
		>
		<param name="src" value="<?php 
        echo $audio_url_esc;
        ?>
" />
		<param name="autoplay" value="true" />
		<param name="controller" value="true" />
		<small><?php 
        echo htmlEnt(sPrintF(__("Datei nicht gefunden, Konvertierungsfehler oder fehlendes Plugin für %s"), $formats[$fmt]['title']));
        ?>
</small>
	</object>
	
<?php 
    }
    echo '<br />';
    echo '<div class="r" style="font-size:80%; line-height:100%;"><a href="', $audio_url_dl_esc, '" style="text-decoration:none;" target="_blank"><img alt="+" title="', htmlEnt(__("In neuem Fenster öffnen")), '" src="', GS_URL_PATH, 'img/new-window.gif" /></a></div>';
    echo "\n", '</div>', "\n";
}
echo '<h2>';
if (@$MODULES[$SECTION]['icon']) {
    echo '<img alt=" " src="', GS_URL_PATH, str_replace('%s', '32', $MODULES[$SECTION]['icon']), '" /> ';
}
if (count($MODULES[$SECTION]['sub']) > 1) {
Exemplo n.º 15
0
 function execCmd($cmd, $arg = array())
 {
     #-------------------------------------------------------------------------------
     $proto = $this->https ? "https" : "http";
     #-------------------------------------------------------------------------------
     $params = array('login' => $this->login, 'psw' => $this->password, 'charset' => 'utf-8', 'fmt' => 3);
     #-------------------------------------------------------------------------------
     $params = array_merge($params, $arg);
     $urlParams = "";
     #-------------------------------------------------------------------------------
     foreach ($params as $param => $value) {
         $urlParams .= sprintf("%s=%s&", $param, urlencode($value));
     }
     #-------------------------------------------------------------------------------
     $url = sPrintF("%s://smsc.ru/sys/%s.php?%s", $proto, $cmd, $urlParams);
     #Debug(SPrintF('[system/classes/SMSC.class.php]: url = %s',$url));
     #-------------------------------------------------------------------------------
     #-------------------------------------------------------------------------------
     $i = 0;
     do {
         if ($i) {
             sleep(2);
         }
         $ret = $this->readUrl($url);
     } while ($ret == "" && ++$i < 3);
     if ($ret == "") {
         throw new jException("Error reading URL: " . $url);
     }
     #-------------------------------------------------------------------------------
     #-------------------------------------------------------------------------------
     $Result = Json_Decode($ret, TRUE);
     if (isset($Result['error'])) {
         $this->error = SPrintF('error_code = %s; error = (%s)', $Result['error_code'], $Result['error']);
         throw new jException(SPrintF('error_code = %s; error = (%s)', $Result['error_code'], $Result['error']));
     }
     #-------------------------------------------------------------------------------
     #-------------------------------------------------------------------------------
     return $Result;
     #-------------------------------------------------------------------------------
 }
Exemplo n.º 16
0
</code></p>
	<p style="margin:0; padding:0.4em 0; max-width:45em;"><?php 
        echo sPrintF(htmlEnt(__("Danach können Sie sich als User %s in dieser Web-Oberfläche einloggen, um dort andere User anzulegen und das System zu konfigurieren.")), '&quot;<code>' . 'lisa' . '</code>&quot;');
        ?>
</p>
	<hr size="1" />
	<p class="r" style="margin:0; padding:0.4em 0;"><?php 
        echo sPrintF(htmlEnt(__("Mailinglisten und andere Hilfen zu Gemeinschaft finden Sie online unter %s")), '<a class="nobr" target="_blank" href="' . 'http://www.amooma.de/gemeinschaft/' . '">' . 'http://www.amooma.de/gemeinschaft/' . '</a>');
        ?>
</p>
	<p class="r" style="margin:0; padding:0.4em 0;"><?php 
        echo htmlEnt(__("Danke dass Sie sich für Gemeinschaft entschieden haben."));
        ?>
<br />
	<?php 
        echo sPrintF(htmlEnt(__("-- Ihr %s-Team")), '<span style="text-transform:uppercase;">' . 'Amooma' . '</span>');
        ?>
<br />
</div>
<?php 
        $focus_field = false;
    }
    ?>
<div style="text-align:center; width:auto; margin:0 140px 0 0;">
<span style="line-height:1.4em; color:#999;"><?php 
    if (extension_loaded('apc')) {
        $vers = apc_fetch('gemeinschaft_version', $was_stored);
    } else {
        $was_stored = false;
    }
    if (!$was_stored) {
Exemplo n.º 17
0
 private function buildUrlMapping($class, $pattern, $properties, $url)
 {
     $pattern = Prado::createComponent($class, $this);
     if (!$pattern instanceof TUrlMappingPattern) {
         throw new TConfigurationException('urlmapping_urlmappingpattern_required');
     }
     foreach ($properties as $name => $value) {
         $pattern->setSubproperty($name, $value);
     }
     if ($url instanceof TXmlElement) {
         $text = $url->getValue();
         if ($text) {
             $text = preg_replace('/(\\s+)/S', '', $text);
             if (($regExp = $pattern->getRegularExpression()) !== '') {
                 trigger_error(sPrintF('%s.RegularExpression property value "%s" for ServiceID="%s" and ServiceParameter="%s" was replaced by node value "%s"', get_class($pattern), $regExp, $pattern->getServiceID(), $pattern->getServiceParameter(), $text), E_USER_NOTICE);
             }
             $pattern->setRegularExpression($text);
         }
     }
     $this->_patterns[] = $pattern;
     $pattern->init($url);
     $key = $pattern->getServiceID() . ':' . $pattern->getServiceParameter();
     $this->_constructRules[$key][] = $pattern;
 }
Exemplo n.º 18
0
Arquivo: mysql.php Projeto: rkania/GS3
 function &colsMeta($table)
 {
     $rs =& $this->_execute(sPrintF($this->_metaColsSQL, $this->escape($table)));
     $colsMeta = false;
     if (is_object($rs)) {
         //if (! $rs->EOF) {
         $colsMeta = array();
         $numPKCols = 0;
         while (!$rs->EOF) {
             $row = $rs->fetchRow();
             $col = array('mty' => 0, 'sty' => 0, 'flg' => 0, 'len' => -1, 'dec' => 0, 'def' => null);
             $t = $row['Type'];
             // split type into "type(length)":
             if (preg_match("/^([^(]+)\\((\\d+)\\)/", $t, $m)) {
                 $col['nty'] = strToUpper($m[1]);
                 $col['len'] = is_numeric($m[2]) ? (int) $m[2] : -1;
             } elseif (preg_match("/^([^(]+)\\((\\d+),(\\d+)\\)/", $t, $m)) {
                 $col['nty'] = strToUpper($m[1]);
                 $col['len'] = is_numeric($m[2]) ? (int) $m[2] : -1;
                 $col['dec'] = is_numeric($m[3]) ? (int) $m[3] : -1;
             } elseif (preg_match("/^(enum)\\(([^)]*)\\)\$/i", $t, $m)) {
                 $col['nty'] = strToUpper($m[1]);
                 $col['mty'] = YADB_MTYPE_STR;
                 $col['sty'] = YADB_STYPE_ENUM;
                 $col['len'] = max(array_map('strlen', explode(',', $m[2]))) - 2;
                 //$col['len']  = ($col['len']==0 ? 1 : $col['len']);
             } elseif (preg_match("/^(set)\\(([^)]*)\\)\$/i", $t, $m)) {
                 $col['nty'] = strToUpper($m[1]);
                 $col['mty'] = YADB_MTYPE_STR;
                 $col['sty'] = YADB_STYPE_SET;
                 $col['len'] = max(array_map('strlen', explode(',', $m[2]))) - 2;
                 //$col['len']  = ($col['len']==0 ? 1 : $col['len']);
             } else {
                 $col['nty'] = strToUpper($t);
                 //$col['len'] = -1;
             }
             /*
             $col['notnull'] = ($row['Null'] !== 'YES');
             $col['pri']     = ($row['Key'] === 'PRI');
             $col['autoinc'] = (strPos($row['Extra'], 'auto_increment') !== false);
             $col['bin']     = (strPos($type, 'bin') !== false || strPos($type, 'blob') !== false);
             $col['unsig']   = (strPos($type, 'unsigned') !== false);
             */
             if ($row['Null'] !== 'YES') {
                 $col['flg'] |= YADB_FLAG_NOTNULL;
             }
             if ($row['Key'] === 'PRI') {
                 $col['flg'] |= YADB_FLAG_PKPART | YADB_FLAG_PKCOL;
                 // assume that the column is the only one which
                 // the pri.key consists of. if not revoke later
                 ++$numPKCols;
             }
             if (strPos($row['Extra'], 'auto_increment') !== false) {
                 $col['flg'] |= YADB_FLAG_AUTOINC;
             }
             if (strPos($t, 'unsigned') !== false) {
                 $col['flg'] |= YADB_FLAG_UNSIGNED;
             } elseif (strPos($t, 'bin') !== false || strPos($t, 'blob') !== false) {
                 $col['flg'] |= YADB_FLAG_BINARY;
             }
             $col['def'] = $row['Default'] == '' || $row['Default'] === 'NULL' ? '' : $row['Default'];
             if (!($col['flg'] & YADB_FLAG_NOTNULL) && $col['def'] == '') {
                 $col['def'] = null;
             }
             $mt = $this->_colMetaType($col);
             $col['mty'] = $mt[0];
             // correct sub type for varchar/varbinary if
             // necessary:
             if (($col['nty'] === 'VARCHAR' || $col['nty'] === 'VARBINARY') && $col['len'] > 255) {
                 $col['sty'] = YADB_STYPE_STR_2;
             } else {
                 $col['sty'] = $mt[1];
             }
             // correct default value according to type:
             switch ($col['mty']) {
                 case YADB_MTYPE_INT:
                     $col['def'] = (int) $col['def'];
                     break;
                 case YADB_MTYPE_FLOAT:
                     $col['def'] = (double) $col['def'];
                     break;
                 case YADB_MTYPE_BOOL:
                     $col['def'] = (bool) $col['def'];
                     break;
                     // no need to cast string to string
             }
             unset($col['nty']);
             // native type no longer needed
             $colsMeta[$row['Field']] = $col;
         }
         if ($numPKCols > 1) {
             // pri.key consists of more than one column
             foreach ($colsMeta as $col => $colMeta) {
                 if ($colMeta['flg'] & YADB_FLAG_PKCOL) {
                     $colMeta['flg'] & ~YADB_FLAG_PKCOL;
                 }
             }
         }
         //}
         $rs->close();
     }
     return $colsMeta;
 }
Exemplo n.º 19
0
    $sudo_check = $gs_sbin_dir . 'sudo-check';
    $sudo_sudo_check = $gs_sbin_dir . 'sudo-sudo-check';
    if (!file_exists($sudo_check) || !file_exists($sudo_sudo_check)) {
        _test_result('FEHLER (Test-Skript nicht gefunden)', 'warn');
    } else {
        $err = 0;
        $out = array();
        @exec($sudo_check . ' 1>>/dev/null 2>>/dev/null', $out, $err);
        if ($err !== 0) {
            _test_result(sPrintF('FEHLER (User &quot;%s&quot; hat nicht gen&uuml;gend Rechte)', $username), 'warn');
        } else {
            $err = 0;
            $out = array();
            @exec($sudo_sudo_check . ' 1>>/dev/null 2>>/dev/null', $out, $err);
            if ($err !== 0) {
                _test_result(sPrintF('FEHLER (User &quot;%s&quot; hat nicht gen&uuml;gend Rechte)', 'root'), 'warn');
            } else {
                _test_result('OK', 'ok');
                //$can_continue = true;
            }
        }
    }
}
?>
</td>
</tr>

</tbody>
</table>

<br />
Exemplo n.º 20
0
Arquivo: util.php Projeto: rkania/GS3
function sec_to_hours($sec)
{
    return sPrintF('%d:%02d:%02d', $sec / 3600, $sec / 60 % 60, $sec % 60);
}
Exemplo n.º 21
0
 /**
  * @return TSimpleHttpResponse
  * @throws TSimpleHttpClientException
  */
 public function request()
 {
     if ($this->getBody()) {
         $this->setRequestMethod(self::POST);
     }
     $result = '';
     switch ($this->getAuthorization()) {
         case self::AUTHORIZATION_BASIC:
             if ($this->getUser()) {
                 $this->addHeader('Authorization', 'Basic ' . base64_encode($this->getUser() . ':' . $this->getPass()));
             }
             break;
     }
     // modifications for GET requests
     do {
         if ($this->isPost()) {
             break;
         }
         if ($this->isHeader('Content-type')) {
             $this->removeHeader('Content-type');
         }
         if ($this->isHeader('Content-length')) {
             $this->removeHeader('Content-length');
         }
     } while (0);
     // modifications for POST requests
     do {
         if (!$this->isPost()) {
             break;
         }
         if (!$this->isHeader('Content-length')) {
             $this->addHeader('Content-length', (int) strlen($this->getBody()));
         }
     } while (0);
     $query = $this->getQuery();
     if ($query) {
         $path = $this->getPath();
         $path .= '?' . $query;
         $this->setPath($path);
     }
     $this->streamOpen();
     $this->streamWrite(sPrintF("%s %s HTTP/1.1\n", $this->getRequestMethod(), $this->getPath()));
     $this->streamWrite(sPrintF("Host: %s \n", $this->getHost()));
     foreach ($this->getHeaders() as $hName => $hValue) {
         $this->streamWrite(sPrintF("%s: %s\n", $hName, $hValue));
     }
     $this->streamWrite("Connection: close\n\n");
     if ($this->isPost()) {
         $this->streamWrite($this->getBody() . "\n");
     }
     while (!$this->streamEOF()) {
         $result .= $this->streamRead(512);
     }
     $this->streamClose();
     return TSimpleHttpResponse::parse($result);
 }
Exemplo n.º 22
0
	}
}
elseif (preg_match('/^siemens-/', $phone_type)) {
	if (preg_match('/^siemens-os/', $phone_type)) {
		echo '<a target="_blank" href="', __('http://wiki.siemens-enterprise.com/index.php/OpenStage_SIP') ,'">', sPrintF(__('Dokumentation %s'), 'Siemens OpenStage') ,'</a>';
	}
	else {
		echo '<a target="_blank" href="', __('http://wiki.siemens-enterprise.com/index.php/Phones') ,'">', sPrintF(__('Dokumentation %s'), 'Siemens') ,'</a>';
	}
}
elseif (preg_match('/^aastra-/', $phone_type)) {
	if (preg_match('/^aastra-5/', $phone_type)) {
		echo '<a target="_blank" href="', __('http://www.aastra-detewe.de/cps/rde/xchg/aastra-detewe/hs.xsl/21552.htm') ,'">', sPrintF(__('Dokumentation %s'), 'Aastra 5xi') ,'</a>';
	}
	else {
		echo '<a target="_blank" href="', __('http://www.aastra-detewe.de/cps/rde/xchg/aastra-detewe/hs.xsl/21552.htm') ,'">', sPrintF(__('Dokumentation %s'), 'Aastra') ,'</a>';
	}
}



#################################################################
#  params for all phone types {
#################################################################
//if (in_array($phone_type, array('siemens-os60', 'siemens-os80'), true)) {
	
	echo $save_bt;
	
	echo '<table cellspacing="1">' ,"\n";
	echo '<thead>' ,"\n";
	echo '<tr>' ,"\n";
Exemplo n.º 23
0
	if (in_array($phone_type, array('snom-300','snom-320','snom-360','snom-370','snom-821','grandstream-gxp2000','grandstream-gxp2010','grandstream-gxp2020'), true))
		echo '<a href="',GS_URL_PATH ,'srv/key-layout.php?phone_type=',$phone_type,'"><img alt="PDF" src="', GS_URL_PATH, 'crystal-svg/16/mime/pdf.png" /></a>'."\n"; 

	echo $save_bt;
}
#################################################################
#  } keys of snom, siemens, ...
#################################################################

#################################################################
#  keys of unknown phone type {
#################################################################
else {
	echo '<br />',"\n";
	echo '<div class="errorbox">';
	echo htmlEnt(sPrintF('Don\'t know how to display keys of phone type "%s".', $phone_type_title));
	echo '</div>' ,"\n";
}
#################################################################
#  } keys of unknown phone type
#################################################################
	
}

?>
</form>

<script type="text/javascript">
//<![CDATA[
try {
for (var i=0; i<document.forms.length; ++i) {
Exemplo n.º 24
0
function gs_db_query_err_handler(&$dbConn, &$sql, &$inputArr)
{
    trigger_error(sPrintF('SQL error %s / %s %s "%s" in query: %s -', $dbConn->getLastErrorCode(), $dbConn->_dbType, $dbConn->getLastNativeError(), $dbConn->getLastNativeErrorMsg(), str_replace(array("\n", "\t"), array('\\n', '\\t'), $sql)), E_USER_WARNING);
    /*
    echo "<pre>\n";
    if (function_exists('debug_backtrace')) {
    	$bt = debug_backtrace();
    	for ($i=2; $i<count($bt); ++$i) {
    		//if (isSet($bt[$i]['class']) && $bt[$i]['class'] === 'YADB_Connection') continue;
    		print_r($bt[$i]);
    	}
    }
    echo "</pre>\n";
    */
}
<!--[if lt IE 7]><style type="text/css">img {behavior: url("<?php 
echo GS_URL_PATH;
?>
js/pngbehavior.htc.php?msie-sucks=.htc");}</style><![endif]-->
<meta http-equiv="imagetoolbar" content="no" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
</head>
<body>

<?php 
if (array_key_exists('HTTP_USER_AGENT', $_SERVER)) {
    if (preg_match('/MSIE\\s*([0-9])/', $_SERVER['HTTP_USER_AGENT'], $m)) {
        if ('x' . $m[1] <= 'x' . '6') {
            echo '<div class="noticebox" style="font-size:94%; padding:1px 1em; margin:0; border-width:1px; border-style:solid; border-color:#ff0 #660 #660 #ff0;">';
            echo sPrintF(htmlEnt(__('Sie verwenden einen alten Browser (%s), der diese Webseiten fehlerhaft darstellt! Tipp: Benutzen Sie %s oder zumindest den aktuellen %s.')), htmlEnt($m[0]), '<a href="http://www.mozilla-europe.org/firefox/" target="_blank">Firefox</a>', '<a href="http://www.microsoft.com/windows/internet-explorer/" target="_blank">Internet Explorer</a>');
            echo '</div>';
        }
    }
}
?>
<div id="topheader"></div>
<div id="headerboxes">
<div id="boxtitle">
<?php 
switch ($GS_INSTALLATION_TYPE) {
    case 'gpbx':
        echo '<div style="position:relative;top:0;left:0;" class="fl">', "\n";
        echo '<h1 style="margin:0;padding:0;">', "\n";
        echo '<img style="position:absolute;top:2px;left:2px;z-index:1;" alt=" " src="', GS_URL_PATH, 'img/gpbx-shadow-32.png" />', "\n";
        echo '<img style="position:absolute;top:0px;left:0px;z-index:2;" alt="GPBX" src="', GS_URL_PATH, 'img/gpbx-32.png" />', "\n";
Exemplo n.º 26
0
<?php 
    $dial = '';
    switch (@$canonical->errt) {
        case 'empty':
            echo __('Keine Telefonnummer angegeben.');
            break;
        case 'cbc':
            echo __('Der Endanwender soll keine Call-by-Call-Vorwahlen verwenden.');
            break;
        case 'self':
            echo __('Diese Nummer ist innerhalb der eigenen Telefonanlage.');
            break;
        case '':
        default:
            $dial = $canonical->dial;
            echo sPrintF(__('Die Nummer w&uuml;rde als <b>%s</b> mit den Mustern in der Routing-Tabelle verglichen.'), $dial);
    }
    ?>
</p>

<?php 
} else {
    echo '<p class="text">(', __('Kanonisierung ist nicht aktiviert!'), ')</p>', "\n";
    $dial = trim($number);
}
###################################################### NO CANONIZATION }
###################################################### ROUTING {
if ($dial != '') {
    ?>

<h3><?php 
Exemplo n.º 27
0
    echo '<input type="text" name="cid-int" value="" size="20" maxlength="30" />';
    echo '</td>';
    echo '<td>';
    echo '<input type="text" name="cid-ext" value="" size="20" maxlength="30" />';
    echo '</td>';
    echo '<td>';
    echo '<button type="submit" title="', __('Eintrag speichern'), '" class="plain"><img alt="', __('Speichern'), '" src="', GS_URL_PATH, 'crystal-svg/16/act/filesave.png" /></button>';
    echo '</td>';
    echo '</tr>';
    ?>

</tbody>
</table>
</form>


<br />
<br />
<br />

<?php 
    echo '<a name="ftn-1"></a>', "\n";
    echo '<p id="ftn-1" class="text"><sup>[1]</sup> ', sPrintF(__('Suchen/Ersetzen-Muster (<a href="%s" target="_blank">PCRE</a>) f&uuml;r die Rufnummern&uuml;bermittlung bei abgehenden Anrufen. Beispiele:<br /> Nur die Durchwahl &uuml;bermitteln: <tt>s/^(.*)/$1/</tt><br /> Nationales Format: <tt>s/^(.*)/030123456$1/</tt><br /> Internationales Format: <tt>s/^(.*)/004930123456$1/</tt> oder <tt>s/^(.*)/+4930123456$1/</tt><br /> F&uuml;r alle Benutzer die gleiche Nummer &uuml;bertragen: <tt>s/^(.*)/00493012345612/</tt><br /> Normalerweise sollten Sie das nationale oder internationale Format verwenden.'), __('http://de.wikipedia.org/wiki/Regul%C3%A4rer_Ausdruck')), '</p>', "\n";
    echo '<a name="ftn-2"></a>', "\n";
    echo '<p id="ftn-2" class="text"><sup>[2]</sup> ', sPrintF(__('Geben Sie hier falls erforderlich ein <a href="%s" target="_blank">PCRE</a>-Muster an, das eventuelle Pr&auml;fixe von eingehend gew&auml;hlten Nummern wegschneidet, soda&szlig; nur noch die interne Durchwahl &uuml;brig bleibt! Beispiele:<br /> &nbsp;&nbsp;&nbsp; <tt>s/^026313370//</tt><br /> &nbsp;&nbsp;&nbsp; <tt>s/^(((0049|0)2631))3370//</tt><br /> &nbsp;&nbsp;&nbsp; <tt>s/^(?:(?:0049|0)2631)?3370(.*)/$1/</tt>'), __('http://de.wikipedia.org/wiki/Regul%C3%A4rer_Ausdruck')), '</p>', "\n";
    echo '<a name="ftn-3"></a>', "\n";
    echo '<p id="ftn-3" class="text"><sup>[3]</sup> ', sPrintF(__('Suchen/Ersetzen-Muster (<a href="%s" target="_blank">PCRE</a>) f&uuml;r die Rufnummern&uuml;bermittlung bei eingehenden Anrufen. Hiermit lassen sich Anrufernummern die vom Provider falsch &uuml;bermittelt werden korrigieren. Beispiel: <tt>s/^/0/</tt> oder <tt>s/^(.*)/0$1/</tt> um eine 0 an den Anfang zu setzen. Leer f&uuml;r keine Ersetzung.'), __('http://de.wikipedia.org/wiki/Regul%C3%A4rer_Ausdruck')), '<br />', __('Experimentell'), ': ', __('Sie k&ouml;nnen diese Feld auch verwenden um f&uuml;r die Anruflisten mit <tt>s/^/0/</tt> oder <tt>s/^(.*)/0$1/</tt> eine 0 am Anfang hinzuzuf&uuml;gen oder mit <tt>s/^0//</tt> oder <tt>s/^0(.*)/$1/</tt> eine 0 am Anfang wegzuschneiden.'), '</p>', "\n";
    echo '<a name="ftn-4"></a>', "\n";
    echo '<p id="ftn-4" class="text"><sup>[4]</sup> ', sPrintF(__('Tragen Sie pro Zeile eine interne Caller-ID (Nebenstellennummer) ein, die Sie beim W&auml;hlen &uuml;ber diese Gateway-Gruppe zu einer externen Caller-ID (Durchwahlnummer) umsetzen m&ouml;chten, z.B. um pro Benutzer eine abgehende <a href="%s" target="_blank">MSN</a> festzulegen.'), __('http://de.wikipedia.org/wiki/Vermittlungstechnische_Leistungsmerkmale_%28%C3%B6ffentliche_Netze%29#Mehrfachrufnummern_.28MSN.29_bei_Mehrger.C3.A4teanschluss')), '</p>', "\n";
}
#####################################################################
Exemplo n.º 28
0
echo GS_URL_PATH;
?>
crystal-svg/16/act/info.png" />
	<small><?php 
echo __('&Auml;nderungen ben&ouml;tigen einen Dialplan-Reload und Reload von Asterisk');
?>
</small>
</p>

<p style="max-width:500px;"><small><sup>[1]</sup> <?php 
echo __('Zus&auml;tzliche statische IP-Adresse die von Gemeinschaft nicht ver&auml;ndert wird.');
?>
</small></p>

<p style="max-width:500px;"><small><sup>[2]</sup> <?php 
echo __('Dies ist die f&uuml;r Gemeinschaft prim&auml;re IP-Adresse, die bei einem Ausfall von einem der anderen Nodes per Stonith und Gratuitous ARP &uuml;bernommen werden w&uuml;rde.');
echo "\n", __('Wenn Sie in dieses Feld einen Hostnamen eintragen wird er automatisch permanent zu einer IP-Adresse aufgel&ouml;st.');
?>
</small></p>

<p style="max-width:500px;"><small><sup>[3]</sup> <?php 
echo sPrintF(__('Diese IP-Adresse wird beim Provisioning von Telefonen im WAN (also au&szlig;erhalb der LAN-Netze &quot;%s&quot;) die einen Registrar im LAN haben als Outbound Proxy gesetzt (d.h. inbound aus Sicht von Gemeinschaft). F&uuml;r keinen Proxy das Feld leer lassen.'), htmlEnt(gs_get_conf('GS_PROV_LAN_NETS')));
?>
</small></p>

<p style="max-width:500px;"><small><sup>[4]</sup> <?php 
echo sPrintF(__('Diese IP-Adresse wird beim Provisioning von Telefonen im WAN (also au&szlig;erhalb der LAN-Netze &quot;%s&quot;) die einen Registrar im LAN haben als Server/Registrar gesetzt. (Mu&szlig; vom Session Border Controller auf den tats&auml;chlichen Server umgeleitet werden.) F&uuml;r den normalen Server das Feld leer lassen.'), htmlEnt(gs_get_conf('GS_PROV_LAN_NETS')));
?>
</small></p>

    ?>
</p>
<p class="text"><sup>[4]</sup> <?php 
    echo sPrintF(htmlEnt(__("Mit Angabe des Ports (Standard-IAX-Port: %s) wird direkt dieser Port verwendet.")), '4569');
    ?>
</p>
<p class="text"><sup>[5]</sup> <?php 
    echo sPrintF(htmlEnt(__("Sinnvolle Einstellungen wären z.B. %s um Anrufe von allen IP-Adressen zu erlauben, %s um nur Anrufe aus dem Netz %s zu erlauben, %s um nur Anrufe aus dem Netz %s zu erlauben, %s um nur Anrufe von der IP-Adresse %s zu erlauben usw.")), '<br /><tt>' . htmlEnt('0.0.0.0/0') . '</tt>', '<br /><tt>' . htmlEnt('192.0.2.0/24') . '</tt>', htmlEnt('192.0.2.*'), '<br /><tt>' . htmlEnt('192.168.0.0/16') . '</tt>', htmlEnt('192.168.*.*'), '<br /><tt>' . htmlEnt('192.168.1.1/32') . '</tt>', '192.168.1.1');
    ?>
<br />
<?php 
    echo htmlEnt(__("Weitere Informationen:"));
    echo "\n", sPrintF('<a href="%s" target="_blank">%s</a>', htmlEnt(__('http://de.wikipedia.org/wiki/IP-Adresse')), htmlEnt(__("IP-Adresse")));
    echo ",\n", sPrintF('<a href="%s" target="_blank">%s</a>', htmlEnt(__('http://de.wikipedia.org/wiki/Subnetz')), htmlEnt(__("Subnetz")));
    echo ",\n", sPrintF('<a href="%s" target="_blank">%s</a>', htmlEnt(__('http://de.wikipedia.org/wiki/Classless_Inter-Domain_Routing')), htmlEnt(__("CIDR")));
    echo ",\n", sPrintF('<a href="%s" target="_blank">%s</a>', htmlEnt(__('http://www.das-asterisk-buch.de/2.1/sip.html')), htmlEnt('sip.conf'));
    echo "\n";
    ?>
</p>

</form>

<?php 
}
#####################################################################
#####################################################################
if ($action == '') {
    ?>

<table cellspacing="1">
<thead>
Exemplo n.º 30
0
 echo " * \n";
 @ob_flush();
 @flush();
 $err = 0;
 @passThru('sudo sh -c ' . qsa(sPrintF($extract_file_cmd, qsa('./dl/update_script.sh')) . ' 2>&1'), $err);
 if ($err != 0) {
     echo "<br />\nError while extracting ./dl/update_script.sh .<br />\n";
     @exec('sudo rm -rf ' . qsa($gpbx_userdata . 'upgrades/dl/download') . ' 2>>/dev/null');
     @exec('sudo rm -rf ' . qsa($gpbx_userdata . 'upgrades/dl/update_script.sh') . ' 2>>/dev/null');
     return;
 }
 echo " * \n";
 @ob_flush();
 @flush();
 $err = 0;
 @passThru('sudo sh -c ' . qsa(sPrintF($extract_file_cmd, qsa('./upgrade-info')) . ' 2>&1'), $err);
 if ($err != 0) {
     echo "<br />\nError while extracting ./upgrade-info .<br />\n";
     @exec('sudo rm -rf ' . qsa($gpbx_userdata . 'upgrades/dl/download') . ' 2>>/dev/null');
     @exec('sudo rm -rf ' . qsa($gpbx_userdata . 'upgrades/dl/update_script.sh') . ' 2>>/dev/null');
     @exec('sudo rm -rf ' . qsa($gpbx_userdata . 'upgrades/upgrade-info') . ' 2>>/dev/null');
     return;
 }
 echo " * \n";
 @ob_flush();
 @flush();
 @exec('sudo sh -c ' . qsa('echo -n "yes" > ' . qsa($gpbx_userdata . 'upgrades/upgrade-avail') . ' 2>>/dev/null') . ' 2>>/dev/null');
 echo " * \n";
 @ob_flush();
 @flush();
 sleep(1);